diff --git a/2.0.0-alpha.55/Rx.js b/2.0.0-alpha.55/Rx.js new file mode 100644 index 000000000..d356227e1 --- /dev/null +++ b/2.0.0-alpha.55/Rx.js @@ -0,0 +1,10421 @@ +/** + 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. +**/ +"format register"; +System.register("rxjs/util/noop", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function noop() {} + exports.noop = noop; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/throwError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function throwError(e) { + throw e; + } + exports.throwError = throwError; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/tryOrOnError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function tryOrOnError(target) { + function tryCatcher() { + try { + tryCatcher.target.apply(this, arguments); + } catch (e) { + this.error(e); + } + } + tryCatcher.target = target; + return tryCatcher; + } + exports.tryOrOnError = tryOrOnError; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/Subscription", ["rxjs/util/noop"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var noop_1 = require("rxjs/util/noop"); + var Subscription = (function() { + function Subscription(_unsubscribe) { + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function() { + noop_1.noop(); + }; + Subscription.prototype.unsubscribe = function() { + 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(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(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); + } + } + }; + Subscription.EMPTY = (function(empty) { + empty.isUnsubscribed = true; + return empty; + }(new Subscription())); + return Subscription; + })(); + exports.Subscription = Subscription; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/root", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + exports.root = (objectTypes[typeof self] && self) || (objectTypes[typeof window] && window); + 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 = freeGlobal; + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/subject/SubjectSubscription", ["rxjs/Subscription", "rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscription_1 = require("rxjs/Subscription"); + var Subscriber_1 = require("rxjs/Subscriber"); + var SubjectSubscription = (function(_super) { + __extends(SubjectSubscription, _super); + function SubjectSubscription(subject, observer) { + _super.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function() { + 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 Subscriber_1.Subscriber) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; + })(Subscription_1.Subscription); + exports.SubjectSubscription = SubjectSubscription; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/errorObject", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.errorObject = {e: {}}; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/throw", ["rxjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var ErrorObservable = (function(_super) { + __extends(ErrorObservable, _super); + function ErrorObservable(error, scheduler) { + _super.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function(error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function(_a) { + var error = _a.error, + subscriber = _a.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function(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; + })(Observable_1.Observable); + exports.ErrorObservable = ErrorObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/empty", ["rxjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var EmptyObservable = (function(_super) { + __extends(EmptyObservable, _super); + function EmptyObservable(scheduler) { + _super.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function(scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function(_a) { + var subscriber = _a.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function(subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, {subscriber: subscriber})); + } else { + subscriber.complete(); + } + }; + return EmptyObservable; + })(Observable_1.Observable); + exports.EmptyObservable = EmptyObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/isScheduler", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isScheduler(value) { + return value && typeof value.schedule === 'function'; + } + exports.isScheduler = isScheduler; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/OuterSubscriber", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var OuterSubscriber = (function(_super) { + __extends(OuterSubscriber, _super); + function OuterSubscriber() { + _super.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function(inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function(error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; + })(Subscriber_1.Subscriber); + exports.OuterSubscriber = OuterSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/InnerSubscriber", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var InnerSubscriber = (function(_super) { + __extends(InnerSubscriber, _super); + function InnerSubscriber(parent, outerValue, outerIndex) { + _super.call(this); + this.parent = parent; + this.outerValue = outerValue; + this.outerIndex = outerIndex; + this.index = 0; + } + InnerSubscriber.prototype._next = function(value) { + var index = this.index++; + this.parent.notifyNext(this.outerValue, value, this.outerIndex, index); + }; + InnerSubscriber.prototype._error = function(error) { + this.parent.notifyError(error, this); + }; + InnerSubscriber.prototype._complete = function() { + this.parent.notifyComplete(this); + }; + return InnerSubscriber; + })(Subscriber_1.Subscriber); + exports.InnerSubscriber = InnerSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/isArray", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + exports.isArray = Array.isArray || (function(x) { + return x && typeof x.length === 'number'; + }); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/QueueAction", ["rxjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscription_1 = require("rxjs/Subscription"); + var QueueAction = (function(_super) { + __extends(QueueAction, _super); + function QueueAction(scheduler, work) { + _super.call(this); + this.scheduler = scheduler; + this.work = work; + } + QueueAction.prototype.schedule = function(state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + QueueAction.prototype.execute = function() { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + QueueAction.prototype.unsubscribe = function() { + 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); + } + _super.prototype.unsubscribe.call(this); + }; + return QueueAction; + })(Subscription_1.Subscription); + exports.QueueAction = QueueAction; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/FutureAction", ["rxjs/scheduler/QueueAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var QueueAction_1 = require("rxjs/scheduler/QueueAction"); + var FutureAction = (function(_super) { + __extends(FutureAction, _super); + function FutureAction(scheduler, work) { + _super.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function(state, delay) { + var _this = this; + if (delay === void 0) { + delay = 0; + } + 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() { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _super.prototype.unsubscribe.call(this); + }; + return FutureAction; + })(QueueAction_1.QueueAction); + exports.FutureAction = FutureAction; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mergeAll-support", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + var MergeAllOperator = (function() { + function MergeAllOperator(concurrent) { + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function(observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; + })(); + exports.MergeAllOperator = MergeAllOperator; + var MergeAllSubscriber = (function(_super) { + __extends(MergeAllSubscriber, _super); + function MergeAllSubscriber(destination, concurrent) { + _super.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function(observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } else { + this.active++; + this.add(subscribeToResult_1.subscribeToResult(this, observable)); + } + } else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function(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; + })(OuterSubscriber_1.OuterSubscriber); + exports.MergeAllSubscriber = MergeAllSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/merge-static", ["rxjs/observable/fromArray", "rxjs/operator/mergeAll-support", "rxjs/scheduler/queue", "rxjs/util/isScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var fromArray_1 = require("rxjs/observable/fromArray"); + var mergeAll_support_1 = require("rxjs/operator/mergeAll-support"); + var queue_1 = require("rxjs/scheduler/queue"); + var isScheduler_1 = require("rxjs/util/isScheduler"); + function merge() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = queue_1.queue; + var last = observables[observables.length - 1]; + if (isScheduler_1.isScheduler(last)) { + 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 fromArray_1.ArrayObservable(observables, scheduler).lift(new mergeAll_support_1.MergeAllOperator(concurrent)); + } + exports.merge = merge; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/subject/AsyncSubject", ["rxjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subject_1 = require("rxjs/Subject"); + var AsyncSubject = (function(_super) { + __extends(AsyncSubject, _super); + function AsyncSubject() { + _super.call(this); + this._value = void 0; + this._hasNext = false; + this._isScalar = false; + } + AsyncSubject.prototype._subscribe = function(subscriber) { + if (this.completeSignal && this._hasNext) { + subscriber.next(this._value); + } + return _super.prototype._subscribe.call(this, subscriber); + }; + AsyncSubject.prototype._next = function(value) { + this._value = value; + this._hasNext = true; + }; + AsyncSubject.prototype._complete = function() { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + if (this._hasNext) { + while (++index < len) { + var o = observers[index]; + o.next(this._value); + o.complete(); + } + } else { + while (++index < len) { + observers[index].complete(); + } + } + this.isUnsubscribed = false; + }; + return AsyncSubject; + })(Subject_1.Subject); + exports.AsyncSubject = AsyncSubject; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/defer", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var DeferObservable = (function(_super) { + __extends(DeferObservable, _super); + function DeferObservable(observableFactory) { + _super.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function(observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function(subscriber) { + var result = tryCatch_1.tryCatch(this.observableFactory)(); + if (result === errorObject_1.errorObject) { + subscriber.error(errorObject_1.errorObject.e); + } else { + result.subscribe(subscriber); + } + }; + return DeferObservable; + })(Observable_1.Observable); + exports.DeferObservable = DeferObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/empty", ["rxjs/Observable", "rxjs/observable/empty"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var empty_1 = require("rxjs/observable/empty"); + Observable_1.Observable.empty = empty_1.EmptyObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/fromPromise", ["rxjs/Observable", "rxjs/Subscription", "rxjs/scheduler/queue"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var Subscription_1 = require("rxjs/Subscription"); + var queue_1 = require("rxjs/scheduler/queue"); + var PromiseObservable = (function(_super) { + __extends(PromiseObservable, _super); + function PromiseObservable(promise, scheduler) { + if (scheduler === void 0) { + scheduler = queue_1.queue; + } + _super.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function(promise, scheduler) { + if (scheduler === void 0) { + scheduler = queue_1.queue; + } + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function(subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === queue_1.queue) { + 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 subscription = new Subscription_1.Subscription(); + 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 subscription; + } + }; + return PromiseObservable; + })(Observable_1.Observable); + exports.PromiseObservable = PromiseObservable; + function dispatchNext(_a) { + var value = _a.value, + subscriber = _a.subscriber; + subscriber.next(value); + subscriber.complete(); + } + function dispatchError(_a) { + var err = _a.err, + subscriber = _a.subscriber; + subscriber.error(err); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/isPromise", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isPromise(value) { + return value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; + } + exports.isPromise = isPromise; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/IteratorObservable", ["rxjs/Observable", "rxjs/util/root", "rxjs/util/SymbolShim", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var root_1 = require("rxjs/util/root"); + var SymbolShim_1 = require("rxjs/util/SymbolShim"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var IteratorObservable = (function(_super) { + __extends(IteratorObservable, _super); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _super.call(this); + this.project = project; + this.thisArg = thisArg; + this.scheduler = 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.'); + } + this.iterator = getIterator(iterator); + } + IteratorObservable.create = function(iterator, project, thisArg, scheduler) { + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function(state) { + var index = state.index, + hasError = state.hasError, + thisArg = state.thisArg, + project = state.project, + iterator = state.iterator, + subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return ; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return ; + } + if (project) { + result = tryCatch_1.tryCatch(project).call(thisArg, result.value, index); + if (result === errorObject_1.errorObject) { + state.error = errorObject_1.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(subscriber) { + var index = 0; + var _a = this, + iterator = _a.iterator, + project = _a.project, + thisArg = _a.thisArg, + scheduler = _a.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 = tryCatch_1.tryCatch(project).call(thisArg, result.value, index++); + if (result === errorObject_1.errorObject) { + subscriber.error(errorObject_1.errorObject.e); + break; + } + subscriber.next(result); + } else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; + })(Observable_1.Observable); + exports.IteratorObservable = IteratorObservable; + var StringIterator = (function() { + function StringIterator(str, idx, len) { + if (idx === void 0) { + idx = 0; + } + if (len === void 0) { + len = str.length; + } + this.str = str; + this.idx = idx; + this.len = len; + } + StringIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { + return (this); + }; + StringIterator.prototype.next = function() { + 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, idx, len) { + if (idx === void 0) { + idx = 0; + } + if (len === void 0) { + len = toLength(arr); + } + this.arr = arr; + this.idx = idx; + this.len = len; + } + ArrayIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { + return this; + }; + ArrayIterator.prototype.next = function() { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; + })(); + function getIterator(obj) { + var i = obj[SymbolShim_1.SymbolShim.iterator]; + if (!i && typeof obj === 'string') { + return new StringIterator(obj); + } + if (!i && obj.length !== undefined) { + return new ArrayIterator(obj); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return obj[SymbolShim_1.SymbolShim.iterator](); + } + var maxSafeInteger = Math.pow(2, 53) - 1; + 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' && root_1.root.isFinite(value); + } + function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/Notification", ["rxjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var Notification = (function() { + function Notification(kind, value, exception) { + this.kind = kind; + this.value = value; + this.exception = exception; + this.hasValue = kind === 'N'; + } + Notification.prototype.observe = function(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(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(nextOrObserver, error, complete) { + if (nextOrObserver && typeof nextOrObserver.next === 'function') { + return this.observe(nextOrObserver); + } else { + return this.do(nextOrObserver, error, complete); + } + }; + Notification.prototype.toObservable = function() { + var kind = this.kind; + switch (kind) { + case 'N': + return Observable_1.Observable.of(this.value); + case 'E': + return Observable_1.Observable.throw(this.exception); + case 'C': + return Observable_1.Observable.empty(); + } + }; + Notification.createNext = function(value) { + if (typeof value !== 'undefined') { + return new Notification('N', value); + } + return this.undefinedValueNotification; + }; + Notification.createError = function(err) { + return new Notification('E', undefined, err); + }; + Notification.createComplete = function() { + return this.completeNotification; + }; + Notification.completeNotification = new Notification('C'); + Notification.undefinedValueNotification = new Notification('N', undefined); + return Notification; + })(); + exports.Notification = Notification; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/fromArray", ["rxjs/Observable", "rxjs/observable/fromArray"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var fromArray_1 = require("rxjs/observable/fromArray"); + Observable_1.Observable.fromArray = fromArray_1.ArrayObservable.create; + Observable_1.Observable.of = fromArray_1.ArrayObservable.of; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/fromEvent", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var Subscription_1 = require("rxjs/Subscription"); + var FromEventObservable = (function(_super) { + __extends(FromEventObservable, _super); + function FromEventObservable(sourceObj, eventName, selector) { + _super.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function(sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function(sourceObj, eventName, handler, subscriber) { + var unsubscribe; + 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 Subscription_1.Subscription(unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function(subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function(e) { + var result = tryCatch_1.tryCatch(selector)(e); + if (result === errorObject_1.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + return subscriber.next(e); + }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; + })(Observable_1.Observable); + exports.FromEventObservable = FromEventObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/fromEventPattern", ["rxjs/Observable", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var Subscription_1 = require("rxjs/Subscription"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var FromEventPatternObservable = (function(_super) { + __extends(FromEventPatternObservable, _super); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _super.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function(addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function(subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function(e) { + var result = tryCatch_1.tryCatch(selector).apply(null, arguments); + if (result === errorObject_1.errorObject) { + subscriber.error(result.e); + } else { + subscriber.next(result); + } + } : function(e) { + subscriber.next(e); + }; + var result = tryCatch_1.tryCatch(addHandler)(handler); + if (result === errorObject_1.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new Subscription_1.Subscription(function() { + removeHandler(handler); + })); + }; + return FromEventPatternObservable; + })(Observable_1.Observable); + exports.FromEventPatternObservable = FromEventPatternObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/fromPromise", ["rxjs/Observable", "rxjs/observable/fromPromise"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var fromPromise_1 = require("rxjs/observable/fromPromise"); + Observable_1.Observable.fromPromise = fromPromise_1.PromiseObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/isNumeric", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var is_array = Array.isArray; + function isNumeric(val) { + return !is_array(val) && (val - parseFloat(val) + 1) >= 0; + } + exports.isNumeric = isNumeric; + ; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/Immediate", ["rxjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var root_1 = require("rxjs/util/root"); + var ImmediateDefinition = (function() { + function ImmediateDefinition(root) { + this.root = root; + if (root.setImmediate) { + this.setImmediate = root.setImmediate; + this.clearImmediate = root.clearImmediate; + } else { + this.nextHandle = 1; + this.tasksByHandle = {}; + this.currentlyRunningATask = false; + if (this.canUseProcessNextTick()) { + this.setImmediate = this.createProcessNextTickSetImmediate(); + } else if (this.canUsePostMessage()) { + this.setImmediate = this.createPostMessageSetImmediate(); + } else if (this.canUseMessageChannel()) { + this.setImmediate = this.createMessageChannelSetImmediate(); + } else if (this.canUseReadyStateChange()) { + this.setImmediate = this.createReadyStateChangeSetImmediate(); + } else { + this.setImmediate = this.createSetTimeoutSetImmediate(); + } + var ci = function clearImmediate(handle) { + delete clearImmediate.instance.tasksByHandle[handle]; + }; + ci.instance = this; + this.clearImmediate = ci; + } + } + ImmediateDefinition.prototype.identify = function(o) { + return this.root.Object.prototype.toString.call(o); + }; + ImmediateDefinition.prototype.canUseProcessNextTick = function() { + return this.identify(this.root.process) === '[object process]'; + }; + ImmediateDefinition.prototype.canUseMessageChannel = function() { + return Boolean(this.root.MessageChannel); + }; + ImmediateDefinition.prototype.canUseReadyStateChange = function() { + var document = this.root.document; + return Boolean(document && 'onreadystatechange' in document.createElement('script')); + }; + ImmediateDefinition.prototype.canUsePostMessage = function() { + var root = this.root; + if (root.postMessage && !root.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = root.onmessage; + root.onmessage = function() { + postMessageIsAsynchronous = false; + }; + root.postMessage('', '*'); + root.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + return false; + }; + ImmediateDefinition.prototype.partiallyApplied = function(handler) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var fn = function result() { + var _a = result, + handler = _a.handler, + args = _a.args; + if (typeof handler === 'function') { + handler.apply(undefined, args); + } else { + (new Function('' + handler))(); + } + }; + fn.handler = handler; + fn.args = args; + return fn; + }; + ImmediateDefinition.prototype.addFromSetImmediateArguments = function(args) { + this.tasksByHandle[this.nextHandle] = this.partiallyApplied.apply(undefined, args); + return this.nextHandle++; + }; + ImmediateDefinition.prototype.createProcessNextTickSetImmediate = function() { + var fn = function setImmediate() { + var instance = setImmediate.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + instance.root.process.nextTick(instance.partiallyApplied(instance.runIfPresent, handle)); + return handle; + }; + fn.instance = this; + return fn; + }; + ImmediateDefinition.prototype.createPostMessageSetImmediate = function() { + var root = this.root; + var messagePrefix = 'setImmediate$' + root.Math.random() + '$'; + var onGlobalMessage = function globalMessageHandler(event) { + var instance = globalMessageHandler.instance; + if (event.source === root && typeof event.data === 'string' && event.data.indexOf(messagePrefix) === 0) { + instance.runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + onGlobalMessage.instance = this; + root.addEventListener('message', onGlobalMessage, false); + var fn = function setImmediate() { + var _a = setImmediate, + messagePrefix = _a.messagePrefix, + instance = _a.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + instance.root.postMessage(messagePrefix + handle, '*'); + return handle; + }; + fn.instance = this; + fn.messagePrefix = messagePrefix; + return fn; + }; + ImmediateDefinition.prototype.runIfPresent = function(handle) { + if (this.currentlyRunningATask) { + this.root.setTimeout(this.partiallyApplied(this.runIfPresent, handle), 0); + } else { + var task = this.tasksByHandle[handle]; + if (task) { + this.currentlyRunningATask = true; + try { + task(); + } finally { + this.clearImmediate(handle); + this.currentlyRunningATask = false; + } + } + } + }; + ImmediateDefinition.prototype.createMessageChannelSetImmediate = function() { + var _this = this; + var channel = new this.root.MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + _this.runIfPresent(handle); + }; + var fn = function setImmediate() { + var _a = setImmediate, + channel = _a.channel, + instance = _a.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + fn.channel = channel; + fn.instance = this; + return fn; + }; + ImmediateDefinition.prototype.createReadyStateChangeSetImmediate = function() { + var fn = function setImmediate() { + var instance = setImmediate.instance; + var root = instance.root; + var doc = root.document; + var html = doc.documentElement; + var handle = instance.addFromSetImmediateArguments(arguments); + var script = doc.createElement('script'); + script.onreadystatechange = function() { + instance.runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + return handle; + }; + fn.instance = this; + return fn; + }; + ImmediateDefinition.prototype.createSetTimeoutSetImmediate = function() { + var fn = function setImmediate() { + var instance = setImmediate.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + instance.root.setTimeout(instance.partiallyApplied(instance.runIfPresent, handle), 0); + return handle; + }; + fn.instance = this; + return fn; + }; + return ImmediateDefinition; + })(); + exports.ImmediateDefinition = ImmediateDefinition; + exports.Immediate = new ImmediateDefinition(root_1.root); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/never", ["rxjs/Observable", "rxjs/util/noop"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var noop_1 = require("rxjs/util/noop"); + var InfiniteObservable = (function(_super) { + __extends(InfiniteObservable, _super); + function InfiniteObservable() { + _super.call(this); + } + InfiniteObservable.create = function() { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function(subscriber) { + noop_1.noop(); + }; + return InfiniteObservable; + })(Observable_1.Observable); + exports.InfiniteObservable = InfiniteObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/range", ["rxjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var RangeObservable = (function(_super) { + __extends(RangeObservable, _super); + function RangeObservable(start, end, scheduler) { + _super.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function(start, end, scheduler) { + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = 0; + } + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function(state) { + var start = state.start, + index = state.index, + end = state.end, + 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(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; + })(Observable_1.Observable); + exports.RangeObservable = RangeObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/throw", ["rxjs/Observable", "rxjs/observable/throw"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var throw_1 = require("rxjs/observable/throw"); + Observable_1.Observable.throw = throw_1.ErrorObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/isDate", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function isDate(value) { + return value instanceof Date && !isNaN(+value); + } + exports.isDate = isDate; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/zip-support", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult", "rxjs/util/SymbolShim"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + var SymbolShim_1 = require("rxjs/util/SymbolShim"); + var isArray = Array.isArray; + var ZipOperator = (function() { + function ZipOperator(project) { + this.project = project; + } + ZipOperator.prototype.call = function(subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; + })(); + exports.ZipOperator = ZipOperator; + var ZipSubscriber = (function(_super) { + __extends(ZipSubscriber, _super); + function ZipSubscriber(destination, project, values) { + if (values === void 0) { + values = Object.create(null); + } + _super.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(value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } else if (typeof value[SymbolShim_1.SymbolShim.iterator] === 'function') { + iterators.push(new StaticIterator(value[SymbolShim_1.SymbolShim.iterator]())); + } else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function() { + 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() { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function() { + 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 = tryCatch_1.tryCatch(project).apply(this, args); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; + })(Subscriber_1.Subscriber); + exports.ZipSubscriber = ZipSubscriber; + var StaticIterator = (function() { + function StaticIterator(iterator) { + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function() { + return true; + }; + StaticIterator.prototype.next = function() { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function() { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; + })(); + var StaticArrayIterator = (function() { + function StaticArrayIterator(array) { + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { + return this; + }; + StaticArrayIterator.prototype.next = function(value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { + value: array[i], + done: false + } : {done: true}; + }; + StaticArrayIterator.prototype.hasValue = function() { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function() { + return this.array.length === this.index; + }; + return StaticArrayIterator; + })(); + var ZipBufferIterator = (function(_super) { + __extends(ZipBufferIterator, _super); + function ZipBufferIterator(destination, parent, observable, index) { + _super.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function() { + return this; + }; + ZipBufferIterator.prototype.next = function() { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return {done: true}; + } else { + return { + value: buffer.shift(), + done: false + }; + } + }; + ZipBufferIterator.prototype.hasValue = function() { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function() { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function() { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function(value, index) { + this.add(subscribeToResult_1.subscribeToResult(this, this.observable, this, index)); + }; + return ZipBufferIterator; + })(OuterSubscriber_1.OuterSubscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/buffer", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); + } + exports.buffer = buffer; + var BufferOperator = (function() { + function BufferOperator(closingNotifier) { + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function(subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; + })(); + var BufferSubscriber = (function(_super) { + __extends(BufferSubscriber, _super); + function BufferSubscriber(destination, closingNotifier) { + _super.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function(value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function(err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function() { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function() { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; + })(Subscriber_1.Subscriber); + var BufferClosingNotifierSubscriber = (function(_super) { + __extends(BufferClosingNotifierSubscriber, _super); + function BufferClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function(value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function() { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/bufferCount", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function bufferCount(bufferSize, startBufferEvery) { + if (startBufferEvery === void 0) { + startBufferEvery = null; + } + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); + } + exports.bufferCount = bufferCount; + var BufferCountOperator = (function() { + function BufferCountOperator(bufferSize, startBufferEvery) { + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function(subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; + })(); + var BufferCountSubscriber = (function(_super) { + __extends(BufferCountSubscriber, _super); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _super.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function(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(err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function() { + 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; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/bufferTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var asap_1 = require("rxjs/scheduler/asap"); + function bufferTime(bufferTimeSpan, bufferCreationInterval, scheduler) { + if (bufferCreationInterval === void 0) { + bufferCreationInterval = null; + } + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); + } + exports.bufferTime = bufferTime; + var BufferTimeOperator = (function() { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function(subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; + })(); + var BufferTimeSubscriber = (function(_super) { + __extends(BufferTimeSubscriber, _super); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _super.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(value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function(err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function() { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function() { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function(buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; + })(Subscriber_1.Subscriber); + 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, + bufferTimeSpan = state.bufferTimeSpan, + subscriber = state.subscriber, + 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(_a) { + var subscriber = _a.subscriber, + buffer = _a.buffer; + subscriber.closeBuffer(buffer); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/bufferToggle", ["rxjs/Subscriber", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subscription_1 = require("rxjs/Subscription"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); + } + exports.bufferToggle = bufferToggle; + var BufferToggleOperator = (function() { + function BufferToggleOperator(openings, closingSelector) { + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function(subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; + })(); + var BufferToggleSubscriber = (function(_super) { + __extends(BufferToggleSubscriber, _super); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _super.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function(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(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.subscription.unsubscribe(); + context.buffer = null; + context.subscription = null; + } + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function() { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + context.subscription = null; + } + this.contexts = null; + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function(value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = tryCatch_1.tryCatch(closingSelector)(value); + if (closingNotifier === errorObject_1.errorObject) { + this._error(closingNotifier.e); + } else { + var context = { + buffer: [], + subscription: new Subscription_1.Subscription() + }; + contexts.push(context); + var subscriber = new BufferToggleClosingsSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + context.subscription.add(subscription); + this.add(subscription); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function(context) { + var contexts = this.contexts; + if (contexts === null) { + return ; + } + var buffer = context.buffer, + subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; + })(Subscriber_1.Subscriber); + var BufferToggleOpeningsSubscriber = (function(_super) { + __extends(BufferToggleOpeningsSubscriber, _super); + function BufferToggleOpeningsSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function(value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function() {}; + return BufferToggleOpeningsSubscriber; + })(Subscriber_1.Subscriber); + var BufferToggleClosingsSubscriber = (function(_super) { + __extends(BufferToggleClosingsSubscriber, _super); + function BufferToggleClosingsSubscriber(parent, context) { + _super.call(this, null); + this.parent = parent; + this.context = context; + } + BufferToggleClosingsSubscriber.prototype._next = function() { + this.parent.closeBuffer(this.context); + }; + BufferToggleClosingsSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + BufferToggleClosingsSubscriber.prototype._complete = function() { + this.parent.closeBuffer(this.context); + }; + return BufferToggleClosingsSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/bufferWhen", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); + } + exports.bufferWhen = bufferWhen; + var BufferWhenOperator = (function() { + function BufferWhenOperator(closingSelector) { + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function(subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; + })(); + var BufferWhenSubscriber = (function(_super) { + __extends(BufferWhenSubscriber, _super); + function BufferWhenSubscriber(destination, closingSelector) { + _super.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function(value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function(err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function() { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function() { + 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 = tryCatch_1.tryCatch(this.closingSelector)(); + if (closingNotifier === errorObject_1.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; + })(Subscriber_1.Subscriber); + var BufferClosingNotifierSubscriber = (function(_super) { + __extends(BufferClosingNotifierSubscriber, _super); + function BufferClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function() { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function() { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/catch", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; + } + exports._catch = _catch; + var CatchOperator = (function() { + function CatchOperator(selector) { + this.selector = selector; + } + CatchOperator.prototype.call = function(subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; + })(); + var CatchSubscriber = (function(_super) { + __extends(CatchSubscriber, _super); + function CatchSubscriber(destination, selector, caught) { + _super.call(this, null); + this.destination = destination; + this.selector = selector; + this.caught = caught; + this.lastSubscription = this; + this.destination.add(this); + } + CatchSubscriber.prototype._next = function(value) { + this.destination.next(value); + }; + CatchSubscriber.prototype._error = function(err) { + var result = tryCatch_1.tryCatch(this.selector)(err, this.caught); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else { + this.lastSubscription.unsubscribe(); + this.lastSubscription = result.subscribe(this.destination); + } + }; + CatchSubscriber.prototype._complete = function() { + this.lastSubscription.unsubscribe(); + this.destination.complete(); + }; + CatchSubscriber.prototype._unsubscribe = function() { + this.lastSubscription.unsubscribe(); + }; + return CatchSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/combineAll", ["rxjs/operator/combineLatest-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var combineLatest_support_1 = require("rxjs/operator/combineLatest-support"); + function combineAll(project) { + return this.lift(new combineLatest_support_1.CombineLatestOperator(project)); + } + exports.combineAll = combineAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/combineLatest", ["rxjs/observable/fromArray", "rxjs/operator/combineLatest-support", "rxjs/util/isArray"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var fromArray_1 = require("rxjs/observable/fromArray"); + var combineLatest_support_1 = require("rxjs/operator/combineLatest-support"); + var isArray_1 = require("rxjs/util/isArray"); + function combineLatest() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = null; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + if (observables.length === 1 && isArray_1.isArray(observables[0])) { + observables = observables[0]; + } + observables.unshift(this); + return new fromArray_1.ArrayObservable(observables).lift(new combineLatest_support_1.CombineLatestOperator(project)); + } + exports.combineLatest = combineLatest; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/concat", ["rxjs/util/isScheduler", "rxjs/observable/fromArray", "rxjs/operator/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var isScheduler_1 = require("rxjs/util/isScheduler"); + var fromArray_1 = require("rxjs/observable/fromArray"); + var mergeAll_support_1 = require("rxjs/operator/mergeAll-support"); + function concat() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var args = observables; + args.unshift(this); + var scheduler = null; + if (isScheduler_1.isScheduler(args[args.length - 1])) { + scheduler = args.pop(); + } + return new fromArray_1.ArrayObservable(args, scheduler).lift(new mergeAll_support_1.MergeAllOperator(1)); + } + exports.concat = concat; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/concatAll", ["rxjs/operator/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var mergeAll_support_1 = require("rxjs/operator/mergeAll-support"); + function concatAll() { + return this.lift(new mergeAll_support_1.MergeAllOperator(1)); + } + exports.concatAll = concatAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mergeMap-support", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/util/subscribeToResult", "rxjs/OuterSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var MergeMapOperator = (function() { + function MergeMapOperator(project, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function(observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; + })(); + exports.MergeMapOperator = MergeMapOperator; + var MergeMapSubscriber = (function(_super) { + __extends(MergeMapSubscriber, _super); + function MergeMapSubscriber(destination, project, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + _super.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(value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = tryCatch_1.tryCatch(this.project)(value, index); + var destination = this.destination; + if (ish === errorObject_1.errorObject) { + destination.error(ish.e); + } else { + this.active++; + this._innerSub(ish, value, index); + } + } else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function(ish, value, index) { + this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, + destination = _a.destination, + resultSelector = _a.resultSelector; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function(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; + })(OuterSubscriber_1.OuterSubscriber); + exports.MergeMapSubscriber = MergeMapSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mergeMapTo-support", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + var MergeMapToOperator = (function() { + function MergeMapToOperator(ish, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function(observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; + })(); + exports.MergeMapToOperator = MergeMapToOperator; + var MergeMapToSubscriber = (function(_super) { + __extends(MergeMapToSubscriber, _super); + function MergeMapToSubscriber(destination, ish, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + _super.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(value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function(ish, destination, resultSelector, value, index) { + this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function() { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, + resultSelector = _a.resultSelector, + destination = _a.destination; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function(err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function(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; + })(OuterSubscriber_1.OuterSubscriber); + exports.MergeMapToSubscriber = MergeMapToSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/count", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function count(predicate) { + return this.lift(new CountOperator(predicate, this)); + } + exports.count = count; + var CountOperator = (function() { + function CountOperator(predicate, source) { + this.predicate = predicate; + this.source = source; + } + CountOperator.prototype.call = function(subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.source); + }; + return CountOperator; + })(); + var CountSubscriber = (function(_super) { + __extends(CountSubscriber, _super); + function CountSubscriber(destination, predicate, source) { + _super.call(this, destination); + this.predicate = predicate; + this.source = source; + this.count = 0; + this.index = 0; + } + CountSubscriber.prototype._next = function(value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = tryCatch_1.tryCatch(predicate)(value, this.index++, this.source); + if (passed === errorObject_1.errorObject) { + this.destination.error(passed.e); + return ; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function() { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/dematerialize", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function dematerialize() { + return this.lift(new DeMaterializeOperator()); + } + exports.dematerialize = dematerialize; + var DeMaterializeOperator = (function() { + function DeMaterializeOperator() {} + DeMaterializeOperator.prototype.call = function(subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; + })(); + var DeMaterializeSubscriber = (function(_super) { + __extends(DeMaterializeSubscriber, _super); + function DeMaterializeSubscriber(destination) { + _super.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function(value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/debounce", ["rxjs/observable/fromPromise", "rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/isPromise", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var fromPromise_1 = require("rxjs/observable/fromPromise"); + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var isPromise_1 = require("rxjs/util/isPromise"); + var errorObject_1 = require("rxjs/util/errorObject"); + function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); + } + exports.debounce = debounce; + var DebounceOperator = (function() { + function DebounceOperator(durationSelector) { + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function(observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; + })(); + var DebounceSubscriber = (function(_super) { + __extends(DebounceSubscriber, _super); + function DebounceSubscriber(destination, durationSelector) { + _super.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + Object.defineProperty(DebounceSubscriber.prototype, "index", { + get: function() { + return this._index; + }, + enumerable: true, + configurable: true + }); + DebounceSubscriber.prototype._next = function(value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = tryCatch_1.tryCatch(this.durationSelector)(value); + if (debounce === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + if (isPromise_1.isPromise(debounce)) { + debounce = fromPromise_1.PromiseObservable.create(debounce); + } + this.lastValue = value; + this.clearDebounce(); + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription) { + debouncedSubscription.unsubscribe(); + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + return DebounceSubscriber; + })(Subscriber_1.Subscriber); + var DurationSelectorSubscriber = (function(_super) { + __extends(DurationSelectorSubscriber, _super); + function DurationSelectorSubscriber(parent, currentIndex) { + _super.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function() { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function(unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function() { + this.debounceNext(); + }; + return DurationSelectorSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/debounceTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var asap_1 = require("rxjs/scheduler/asap"); + function debounceTime(dueTime, scheduler) { + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); + } + exports.debounceTime = debounceTime; + var DebounceTimeOperator = (function() { + function DebounceTimeOperator(dueTime, scheduler) { + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function(subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; + })(); + var DebounceTimeSubscriber = (function(_super) { + __extends(DebounceTimeSubscriber, _super); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _super.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function(value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function() { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function() { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function() { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; + })(Subscriber_1.Subscriber); + function dispatchNext(subscriber) { + subscriber.debouncedNext(); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/defaultIfEmpty", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function defaultIfEmpty(defaultValue) { + if (defaultValue === void 0) { + defaultValue = null; + } + return this.lift(new DefaultIfEmptyOperator(defaultValue)); + } + exports.defaultIfEmpty = defaultIfEmpty; + var DefaultIfEmptyOperator = (function() { + function DefaultIfEmptyOperator(defaultValue) { + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function(subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; + })(); + var DefaultIfEmptySubscriber = (function(_super) { + __extends(DefaultIfEmptySubscriber, _super); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _super.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function(value) { + this.isEmpty = false; + this.destination.next(value); + }; + DefaultIfEmptySubscriber.prototype._complete = function() { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/delay", ["rxjs/Subscriber", "rxjs/Notification", "rxjs/scheduler/queue", "rxjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Notification_1 = require("rxjs/Notification"); + var queue_1 = require("rxjs/scheduler/queue"); + var isDate_1 = require("rxjs/util/isDate"); + function delay(delay, scheduler) { + if (scheduler === void 0) { + scheduler = queue_1.queue; + } + var absoluteDelay = isDate_1.isDate(delay); + var delayFor = absoluteDelay ? (+delay - scheduler.now()) : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); + } + exports.delay = delay; + var DelayOperator = (function() { + function DelayOperator(delay, scheduler) { + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function(subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; + })(); + var DelaySubscriber = (function(_super) { + __extends(DelaySubscriber, _super); + function DelaySubscriber(destination, delay, scheduler) { + _super.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function(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_1 = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, delay_1); + } else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function(scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, + destination: this.destination, + scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function(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(value) { + this.scheduleNotification(Notification_1.Notification.createNext(value)); + }; + DelaySubscriber.prototype._error = function(err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function() { + this.scheduleNotification(Notification_1.Notification.createComplete()); + }; + return DelaySubscriber; + })(Subscriber_1.Subscriber); + var DelayMessage = (function() { + function DelayMessage(time, notification) { + this.time = time; + this.notification = notification; + } + return DelayMessage; + })(); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/distinctUntilChanged", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function distinctUntilChanged(compare) { + return this.lift(new DistinctUntilChangedOperator(compare)); + } + exports.distinctUntilChanged = distinctUntilChanged; + var DistinctUntilChangedOperator = (function() { + function DistinctUntilChangedOperator(compare) { + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function(subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; + })(); + var DistinctUntilChangedSubscriber = (function(_super) { + __extends(DistinctUntilChangedSubscriber, _super); + function DistinctUntilChangedSubscriber(destination, compare) { + _super.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function(x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function(value) { + var result = false; + if (this.hasValue) { + result = tryCatch_1.tryCatch(this.compare)(this.value, value); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + return ; + } + } else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = value; + this.destination.next(value); + } + }; + return DistinctUntilChangedSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/do", ["rxjs/Subscriber", "rxjs/util/noop", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var noop_1 = require("rxjs/util/noop"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function _do(nextOrObserver, error, complete) { + var next; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || noop_1.noop, error || noop_1.noop, complete || noop_1.noop)); + } + exports._do = _do; + var DoOperator = (function() { + function DoOperator(next, error, complete) { + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function(subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; + })(); + var DoSubscriber = (function(_super) { + __extends(DoSubscriber, _super); + function DoSubscriber(destination, next, error, complete) { + _super.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function(x) { + var result = tryCatch_1.tryCatch(this.__next)(x); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function(e) { + var result = tryCatch_1.tryCatch(this.__error)(e); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function() { + var result = tryCatch_1.tryCatch(this.__complete)(); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else { + this.destination.complete(); + } + }; + return DoSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/expand-support", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + var ExpandOperator = (function() { + function ExpandOperator(project, concurrent, scheduler) { + this.project = project; + this.concurrent = concurrent; + this.scheduler = scheduler; + } + ExpandOperator.prototype.call = function(subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler); + }; + return ExpandOperator; + })(); + exports.ExpandOperator = ExpandOperator; + var ExpandSubscriber = (function(_super) { + __extends(ExpandSubscriber, _super); + function ExpandSubscriber(destination, project, concurrent, scheduler) { + _super.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.scheduler = scheduler; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.dispatch = function(_a) { + var subscriber = _a.subscriber, + result = _a.result, + value = _a.value, + index = _a.index; + subscriber.subscribeToProjection(result, value, index); + }; + ExpandSubscriber.prototype._next = function(value) { + var destination = this.destination; + if (destination.isUnsubscribed) { + this._complete(); + return ; + } + var index = this.index++; + if (this.active < this.concurrent) { + destination.next(value); + var result = tryCatch_1.tryCatch(this.project)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } else if (!this.scheduler) { + this.subscribeToProjection(result, value, index); + } else { + var state = { + subscriber: this, + result: result, + value: value, + index: index + }; + this.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state)); + } + } else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype.subscribeToProjection = function(result, value, index) { + if (result._isScalar) { + this._next(result.value); + } else { + this.active++; + this.add(subscribeToResult_1.subscribeToResult(this, result, value, index)); + } + }; + ExpandSubscriber.prototype._complete = function() { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function(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(outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + exports.ExpandSubscriber = ExpandSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/filter", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); + } + exports.filter = filter; + var FilterOperator = (function() { + function FilterOperator(select, thisArg) { + this.select = select; + this.thisArg = thisArg; + } + FilterOperator.prototype.call = function(subscriber) { + return new FilterSubscriber(subscriber, this.select, this.thisArg); + }; + return FilterOperator; + })(); + var FilterSubscriber = (function(_super) { + __extends(FilterSubscriber, _super); + function FilterSubscriber(destination, select, thisArg) { + _super.call(this, destination); + this.thisArg = thisArg; + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function(x) { + var result = tryCatch_1.tryCatch(this.select).call(this.thisArg || this, x, this.count++); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/finally", ["rxjs/Subscriber", "rxjs/Subscription"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subscription_1 = require("rxjs/Subscription"); + function _finally(finallySelector) { + return this.lift(new FinallyOperator(finallySelector)); + } + exports._finally = _finally; + var FinallyOperator = (function() { + function FinallyOperator(finallySelector) { + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function(subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; + })(); + var FinallySubscriber = (function(_super) { + __extends(FinallySubscriber, _super); + function FinallySubscriber(destination, finallySelector) { + _super.call(this, destination); + this.add(new Subscription_1.Subscription(finallySelector)); + } + return FinallySubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/EmptyError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var EmptyError = (function() { + function EmptyError() { + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + } + return EmptyError; + })(); + exports.EmptyError = EmptyError; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/MapPolyfill", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var MapPolyfill = (function() { + function MapPolyfill() { + this.size = 0; + this._values = []; + this._keys = []; + } + MapPolyfill.prototype.get = function(key) { + var i = this._keys.indexOf(key); + return i === -1 ? undefined : this._values[i]; + }; + MapPolyfill.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; + }; + MapPolyfill.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; + }; + MapPolyfill.prototype.forEach = function(cb, thisArg) { + for (var i = 0; i < this.size; i++) { + cb.call(thisArg, this._values[i], this._keys[i]); + } + }; + return MapPolyfill; + })(); + exports.MapPolyfill = MapPolyfill; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/FastMap", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var FastMap = (function() { + function FastMap() { + this.values = {}; + } + FastMap.prototype.delete = function(key) { + this.values[key] = null; + return true; + }; + FastMap.prototype.set = function(key, value) { + this.values[key] = value; + return this; + }; + FastMap.prototype.get = function(key) { + return this.values[key]; + }; + FastMap.prototype.forEach = function(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() { + this.values = {}; + }; + return FastMap; + })(); + exports.FastMap = FastMap; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/groupBy-support", ["rxjs/Subscription", "rxjs/Observable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscription_1 = require("rxjs/Subscription"); + var Observable_1 = require("rxjs/Observable"); + var RefCountSubscription = (function(_super) { + __extends(RefCountSubscription, _super); + function RefCountSubscription() { + _super.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function(subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function() { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _super.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; + })(Subscription_1.Subscription); + exports.RefCountSubscription = RefCountSubscription; + var GroupedObservable = (function(_super) { + __extends(GroupedObservable, _super); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _super.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function(subscriber) { + var subscription = new Subscription_1.Subscription(); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; + })(Observable_1.Observable); + exports.GroupedObservable = GroupedObservable; + var InnerRefCountSubscription = (function(_super) { + __extends(InnerRefCountSubscription, _super); + function InnerRefCountSubscription(parent) { + _super.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function() { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _super.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; + })(Subscription_1.Subscription); + exports.InnerRefCountSubscription = InnerRefCountSubscription; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/ignoreElements", ["rxjs/Subscriber", "rxjs/util/noop"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var noop_1 = require("rxjs/util/noop"); + function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); + } + exports.ignoreElements = ignoreElements; + ; + var IgnoreElementsOperator = (function() { + function IgnoreElementsOperator() {} + IgnoreElementsOperator.prototype.call = function(subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; + })(); + var IgnoreElementsSubscriber = (function(_super) { + __extends(IgnoreElementsSubscriber, _super); + function IgnoreElementsSubscriber() { + _super.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function(unused) { + noop_1.noop(); + }; + return IgnoreElementsSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/every", ["rxjs/observable/ScalarObservable", "rxjs/observable/fromArray", "rxjs/observable/throw", "rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ScalarObservable_1 = require("rxjs/observable/ScalarObservable"); + var fromArray_1 = require("rxjs/observable/fromArray"); + var throw_1 = require("rxjs/observable/throw"); + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function every(predicate, thisArg) { + var source = this; + var result; + if (source._isScalar) { + result = tryCatch_1.tryCatch(predicate).call(thisArg || this, source.value, 0, source); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e, source.scheduler); + } else { + return new ScalarObservable_1.ScalarObservable(result, source.scheduler); + } + } + if (source instanceof fromArray_1.ArrayObservable) { + var array = source.array; + var result_1 = tryCatch_1.tryCatch(function(array, predicate, thisArg) { + return array.every(predicate, thisArg); + })(array, predicate, thisArg); + if (result_1 === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e, source.scheduler); + } else { + return new ScalarObservable_1.ScalarObservable(result_1, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); + } + exports.every = every; + var EveryOperator = (function() { + function EveryOperator(predicate, thisArg, source) { + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function(observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; + })(); + var EverySubscriber = (function(_super) { + __extends(EverySubscriber, _super); + function EverySubscriber(destination, predicate, thisArg, source) { + _super.call(this, destination); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + this.index = 0; + } + EverySubscriber.prototype.notifyComplete = function(everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function(value) { + var result = tryCatch_1.tryCatch(this.predicate).call(this.thisArg || this, value, this.index++, this.source); + if (result === errorObject_1.errorObject) { + this.destination.error(result.e); + } else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function() { + this.notifyComplete(true); + }; + return EverySubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/last", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var EmptyError_1 = require("rxjs/util/EmptyError"); + function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); + } + exports.last = last; + var LastOperator = (function() { + function LastOperator(predicate, resultSelector, defaultValue, source) { + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function(observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; + })(); + var LastSubscriber = (function(_super) { + __extends(LastSubscriber, _super); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _super.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(value) { + var _a = this, + predicate = _a.predicate, + resultSelector = _a.resultSelector, + destination = _a.destination; + var index = this.index++; + if (predicate) { + var found = tryCatch_1.tryCatch(predicate)(value, index, this.source); + if (found === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return ; + } + if (found) { + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return ; + } + this.lastValue = result; + } else { + this.lastValue = value; + } + this.hasValue = true; + } + } else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function() { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } else { + destination.error(new EmptyError_1.EmptyError); + } + }; + return LastSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/map", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function map(project, thisArg) { + if (typeof project !== 'function') { + throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); + } + return this.lift(new MapOperator(project, thisArg)); + } + exports.map = map; + var MapOperator = (function() { + function MapOperator(project, thisArg) { + this.project = project; + this.thisArg = thisArg; + } + MapOperator.prototype.call = function(subscriber) { + return new MapSubscriber(subscriber, this.project, this.thisArg); + }; + return MapOperator; + })(); + var MapSubscriber = (function(_super) { + __extends(MapSubscriber, _super); + function MapSubscriber(destination, project, thisArg) { + _super.call(this, destination); + this.project = project; + this.thisArg = thisArg; + this.count = 0; + } + MapSubscriber.prototype._next = function(x) { + var result = tryCatch_1.tryCatch(this.project).call(this.thisArg || this, x, this.count++); + if (result === errorObject_1.errorObject) { + this.error(errorObject_1.errorObject.e); + } else { + this.destination.next(result); + } + }; + return MapSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mapTo", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function mapTo(value) { + return this.lift(new MapToOperator(value)); + } + exports.mapTo = mapTo; + var MapToOperator = (function() { + function MapToOperator(value) { + this.value = value; + } + MapToOperator.prototype.call = function(subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; + })(); + var MapToSubscriber = (function(_super) { + __extends(MapToSubscriber, _super); + function MapToSubscriber(destination, value) { + _super.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function(x) { + this.destination.next(this.value); + }; + return MapToSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/materialize", ["rxjs/Subscriber", "rxjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Notification_1 = require("rxjs/Notification"); + function materialize() { + return this.lift(new MaterializeOperator()); + } + exports.materialize = materialize; + var MaterializeOperator = (function() { + function MaterializeOperator() {} + MaterializeOperator.prototype.call = function(subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; + })(); + var MaterializeSubscriber = (function(_super) { + __extends(MaterializeSubscriber, _super); + function MaterializeSubscriber(destination) { + _super.call(this, destination); + } + MaterializeSubscriber.prototype._next = function(value) { + this.destination.next(Notification_1.Notification.createNext(value)); + }; + MaterializeSubscriber.prototype._error = function(err) { + var destination = this.destination; + destination.next(Notification_1.Notification.createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function() { + var destination = this.destination; + destination.next(Notification_1.Notification.createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/merge", ["rxjs/operator/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var merge_static_1 = require("rxjs/operator/merge-static"); + function merge() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + observables.unshift(this); + return merge_static_1.merge.apply(this, observables); + } + exports.merge = merge; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mergeAll", ["rxjs/operator/mergeAll-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var mergeAll_support_1 = require("rxjs/operator/mergeAll-support"); + function mergeAll(concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + return this.lift(new mergeAll_support_1.MergeAllOperator(concurrent)); + } + exports.mergeAll = mergeAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mergeMap", ["rxjs/operator/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var mergeMap_support_1 = require("rxjs/operator/mergeMap-support"); + function mergeMap(project, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + return this.lift(new mergeMap_support_1.MergeMapOperator(project, resultSelector, concurrent)); + } + exports.mergeMap = mergeMap; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/mergeMapTo", ["rxjs/operator/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var mergeMapTo_support_1 = require("rxjs/operator/mergeMapTo-support"); + function mergeMapTo(observable, resultSelector, concurrent) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + return this.lift(new mergeMapTo_support_1.MergeMapToOperator(observable, resultSelector, concurrent)); + } + exports.mergeMapTo = mergeMapTo; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/ConnectableObservable", ["rxjs/Observable", "rxjs/Subscription", "rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var Subscription_1 = require("rxjs/Subscription"); + var Subscriber_1 = require("rxjs/Subscriber"); + var ConnectableObservable = (function(_super) { + __extends(ConnectableObservable, _super); + function ConnectableObservable(source, subjectFactory) { + _super.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function(subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function() { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return (this.subject = this.subjectFactory()); + }; + ConnectableObservable.prototype.connect = function() { + 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() { + return new RefCountObservable(this); + }; + return ConnectableObservable; + })(Observable_1.Observable); + exports.ConnectableObservable = ConnectableObservable; + var ConnectableSubscription = (function(_super) { + __extends(ConnectableSubscription, _super); + function ConnectableSubscription(connectable) { + _super.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function() { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; + })(Subscription_1.Subscription); + var RefCountObservable = (function(_super) { + __extends(RefCountObservable, _super); + function RefCountObservable(connectable, refCount) { + if (refCount === void 0) { + refCount = 0; + } + _super.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function(subscriber) { + var connectable = this.connectable; + var refCountSubscriber = new RefCountSubscriber(subscriber, this); + var subscription = connectable.subscribe(refCountSubscriber); + if (!subscription.isUnsubscribed && ++this.refCount === 1) { + refCountSubscriber.connection = this.connection = connectable.connect(); + } + return subscription; + }; + return RefCountObservable; + })(Observable_1.Observable); + var RefCountSubscriber = (function(_super) { + __extends(RefCountSubscriber, _super); + function RefCountSubscriber(destination, refCountObservable) { + _super.call(this, null); + this.destination = destination; + this.refCountObservable = refCountObservable; + this.connection = refCountObservable.connection; + destination.add(this); + } + RefCountSubscriber.prototype._next = function(value) { + this.destination.next(value); + }; + RefCountSubscriber.prototype._error = function(err) { + this._resetConnectable(); + this.destination.error(err); + }; + RefCountSubscriber.prototype._complete = function() { + this._resetConnectable(); + this.destination.complete(); + }; + RefCountSubscriber.prototype._resetConnectable = function() { + var observable = this.refCountObservable; + var obsConnection = observable.connection; + var subConnection = this.connection; + if (subConnection && subConnection === obsConnection) { + observable.refCount = 0; + obsConnection.unsubscribe(); + observable.connection = void 0; + this.unsubscribe(); + } + }; + RefCountSubscriber.prototype._unsubscribe = function() { + var observable = this.refCountObservable; + if (observable.refCount === 0) { + return ; + } + if (--observable.refCount === 0) { + var obsConnection = observable.connection; + var subConnection = this.connection; + if (subConnection && subConnection === obsConnection) { + obsConnection.unsubscribe(); + observable.connection = void 0; + } + } + }; + return RefCountSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/observeOn", ["rxjs/operator/observeOn-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var observeOn_support_1 = require("rxjs/operator/observeOn-support"); + function observeOn(scheduler, delay) { + if (delay === void 0) { + delay = 0; + } + return this.lift(new observeOn_support_1.ObserveOnOperator(scheduler, delay)); + } + exports.observeOn = observeOn; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/not", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + function not(pred, thisArg) { + function notPred() { + return !(notPred.pred.apply(notPred.thisArg, arguments)); + } + notPred.pred = pred; + notPred.thisArg = thisArg; + return notPred; + } + exports.not = not; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/publish", ["rxjs/Subject", "rxjs/operator/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Subject_1 = require("rxjs/Subject"); + var multicast_1 = require("rxjs/operator/multicast"); + function publish() { + return multicast_1.multicast.call(this, new Subject_1.Subject()); + } + exports.publish = publish; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/ObjectUnsubscribedError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var ObjectUnsubscribedError = (function(_super) { + __extends(ObjectUnsubscribedError, _super); + function ObjectUnsubscribedError() { + _super.call(this, 'object unsubscribed'); + this.name = 'ObjectUnsubscribedError'; + } + return ObjectUnsubscribedError; + })(Error); + exports.ObjectUnsubscribedError = ObjectUnsubscribedError; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/subject/ReplaySubject", ["rxjs/Subject", "rxjs/scheduler/queue"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subject_1 = require("rxjs/Subject"); + var queue_1 = require("rxjs/scheduler/queue"); + var ReplaySubject = (function(_super) { + __extends(ReplaySubject, _super); + function ReplaySubject(bufferSize, windowTime, scheduler) { + if (bufferSize === void 0) { + bufferSize = Number.POSITIVE_INFINITY; + } + if (windowTime === void 0) { + windowTime = Number.POSITIVE_INFINITY; + } + _super.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = windowTime < 1 ? 1 : windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function(value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + this._trimBufferThenGetEvents(now); + _super.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function(subscriber) { + var events = this._trimBufferThenGetEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _super.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function() { + return (this.scheduler || queue_1.queue).now(); + }; + ReplaySubject.prototype._trimBufferThenGetEvents = function(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; + })(Subject_1.Subject); + exports.ReplaySubject = ReplaySubject; + var ReplayEvent = (function() { + function ReplayEvent(time, value) { + this.time = time; + this.value = value; + } + return ReplayEvent; + })(); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/publishLast", ["rxjs/subject/AsyncSubject", "rxjs/operator/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); + var multicast_1 = require("rxjs/operator/multicast"); + function publishLast() { + return multicast_1.multicast.call(this, new AsyncSubject_1.AsyncSubject()); + } + exports.publishLast = publishLast; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/reduce-support", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var ReduceOperator = (function() { + function ReduceOperator(project, seed) { + this.project = project; + this.seed = seed; + } + ReduceOperator.prototype.call = function(subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.seed); + }; + return ReduceOperator; + })(); + exports.ReduceOperator = ReduceOperator; + var ReduceSubscriber = (function(_super) { + __extends(ReduceSubscriber, _super); + function ReduceSubscriber(destination, project, seed) { + _super.call(this, destination); + this.hasValue = false; + this.acc = seed; + this.project = project; + this.hasSeed = typeof seed !== 'undefined'; + } + ReduceSubscriber.prototype._next = function(x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = tryCatch_1.tryCatch(this.project).call(this, this.acc, x); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else { + this.acc = result; + } + } else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function() { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; + })(Subscriber_1.Subscriber); + exports.ReduceSubscriber = ReduceSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/repeat", ["rxjs/Subscriber", "rxjs/observable/empty"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var empty_1 = require("rxjs/observable/empty"); + function repeat(count) { + if (count === void 0) { + count = -1; + } + if (count === 0) { + return new empty_1.EmptyObservable(); + } else { + return this.lift(new RepeatOperator(count, this)); + } + } + exports.repeat = repeat; + var RepeatOperator = (function() { + function RepeatOperator(count, source) { + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function(subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; + })(); + var FirstRepeatSubscriber = (function(_super) { + __extends(FirstRepeatSubscriber, _super); + function FirstRepeatSubscriber(destination, count, source) { + _super.call(this); + this.destination = destination; + this.count = count; + this.source = source; + destination.add(this); + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function(value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function(err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function() { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _super.prototype.unsubscribe.call(this); + } else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function(count) { + var _a = this, + destination = _a.destination, + lastSubscription = _a.lastSubscription; + destination.remove(lastSubscription); + lastSubscription.unsubscribe(); + if (count - 1 === 0) { + destination.complete(); + } else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + destination.add(this.lastSubscription); + } + }; + return FirstRepeatSubscriber; + })(Subscriber_1.Subscriber); + var MoreRepeatSubscriber = (function(_super) { + __extends(MoreRepeatSubscriber, _super); + function MoreRepeatSubscriber(parent, count) { + _super.call(this); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function(value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function(err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function() { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/retry", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function retry(count) { + if (count === void 0) { + count = 0; + } + return this.lift(new RetryOperator(count, this)); + } + exports.retry = retry; + var RetryOperator = (function() { + function RetryOperator(count, source) { + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function(subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; + })(); + var FirstRetrySubscriber = (function(_super) { + __extends(FirstRetrySubscriber, _super); + function FirstRetrySubscriber(destination, count, source) { + _super.call(this); + this.destination = destination; + this.count = count; + this.source = source; + destination.add(this); + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function(value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function(error) { + if (!this.isUnsubscribed) { + this.unsubscribe(); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function() { + this.unsubscribe(); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.resubscribe = function(retried) { + if (retried === void 0) { + retried = 0; + } + var _a = this, + lastSubscription = _a.lastSubscription, + destination = _a.destination; + destination.remove(lastSubscription); + lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + destination.add(this.lastSubscription); + }; + return FirstRetrySubscriber; + })(Subscriber_1.Subscriber); + var RetryMoreSubscriber = (function(_super) { + __extends(RetryMoreSubscriber, _super); + function RetryMoreSubscriber(parent, count, retried) { + if (retried === void 0) { + retried = 0; + } + _super.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function(value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function(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() { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/retryWhen", ["rxjs/Subscriber", "rxjs/Subject", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subject_1 = require("rxjs/Subject"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); + } + exports.retryWhen = retryWhen; + var RetryWhenOperator = (function() { + function RetryWhenOperator(notifier, source) { + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function(subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; + })(); + var FirstRetryWhenSubscriber = (function(_super) { + __extends(FirstRetryWhenSubscriber, _super); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _super.call(this); + this.destination = destination; + this.notifier = notifier; + this.source = source; + destination.add(this); + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function(value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function(err) { + var destination = this.destination; + if (!this.isUnsubscribed) { + _super.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new Subject_1.Subject(); + var notifications = tryCatch_1.tryCatch(this.notifier).call(this, this.errors); + if (notifications === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + destination.add(this.notificationSubscription); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function(err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function() { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function() { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function() { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _super.prototype.unsubscribe.call(this); + } else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function() { + _super.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function() { + var _a = this, + destination = _a.destination, + lastSubscription = _a.lastSubscription; + destination.remove(lastSubscription); + lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + destination.add(this.lastSubscription); + }; + return FirstRetryWhenSubscriber; + })(Subscriber_1.Subscriber); + var MoreRetryWhenSubscriber = (function(_super) { + __extends(MoreRetryWhenSubscriber, _super); + function MoreRetryWhenSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function(value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function(err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function() { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; + })(Subscriber_1.Subscriber); + var RetryNotificationSubscriber = (function(_super) { + __extends(RetryNotificationSubscriber, _super); + function RetryNotificationSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function(value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function(err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function() { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/sample", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function sample(notifier) { + return this.lift(new SampleOperator(notifier)); + } + exports.sample = sample; + var SampleOperator = (function() { + function SampleOperator(notifier) { + this.notifier = notifier; + } + SampleOperator.prototype.call = function(subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; + })(); + var SampleSubscriber = (function(_super) { + __extends(SampleSubscriber, _super); + function SampleSubscriber(destination, notifier) { + _super.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNotificationSubscriber(this))); + } + SampleSubscriber.prototype._next = function(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function() { + if (this.hasValue) { + this.hasValue = false; + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; + })(Subscriber_1.Subscriber); + var SampleNotificationSubscriber = (function(_super) { + __extends(SampleNotificationSubscriber, _super); + function SampleNotificationSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + SampleNotificationSubscriber.prototype._next = function() { + this.parent.notifyNext(); + }; + SampleNotificationSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + SampleNotificationSubscriber.prototype._complete = function() { + this.parent.notifyNext(); + }; + return SampleNotificationSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/sampleTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var asap_1 = require("rxjs/scheduler/asap"); + function sampleTime(delay, scheduler) { + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return this.lift(new SampleTimeOperator(delay, scheduler)); + } + exports.sampleTime = sampleTime; + var SampleTimeOperator = (function() { + function SampleTimeOperator(delay, scheduler) { + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function(subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; + })(); + var SampleTimeSubscriber = (function(_super) { + __extends(SampleTimeSubscriber, _super); + function SampleTimeSubscriber(destination, delay, scheduler) { + _super.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(value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function() { + if (this.hasValue) { + this.hasValue = false; + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; + })(Subscriber_1.Subscriber); + function dispatchNotification(state) { + var subscriber = state.subscriber, + delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/scan", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function scan(accumulator, seed) { + return this.lift(new ScanOperator(accumulator, seed)); + } + exports.scan = scan; + var ScanOperator = (function() { + function ScanOperator(accumulator, seed) { + this.accumulator = accumulator; + this.seed = seed; + } + ScanOperator.prototype.call = function(subscriber) { + return new ScanSubscriber(subscriber, this.accumulator, this.seed); + }; + return ScanOperator; + })(); + var ScanSubscriber = (function(_super) { + __extends(ScanSubscriber, _super); + function ScanSubscriber(destination, accumulator, seed) { + _super.call(this, destination); + this.accumulator = accumulator; + this.accumulatorSet = false; + this.seed = seed; + this.accumulator = accumulator; + this.accumulatorSet = typeof seed !== 'undefined'; + } + Object.defineProperty(ScanSubscriber.prototype, "seed", { + get: function() { + return this._seed; + }, + set: function(value) { + this.accumulatorSet = true; + this._seed = value; + }, + enumerable: true, + configurable: true + }); + ScanSubscriber.prototype._next = function(value) { + if (!this.accumulatorSet) { + this.seed = value; + this.destination.next(value); + } else { + var result = tryCatch_1.tryCatch(this.accumulator).call(this, this.seed, value); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } else { + this.seed = result; + this.destination.next(this.seed); + } + } + }; + return ScanSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/share", ["rxjs/operator/multicast", "rxjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var multicast_1 = require("rxjs/operator/multicast"); + var Subject_1 = require("rxjs/Subject"); + function shareSubjectFactory() { + return new Subject_1.Subject(); + } + function share() { + return multicast_1.multicast.call(this, shareSubjectFactory).refCount(); + } + exports.share = share; + ; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/single", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var EmptyError_1 = require("rxjs/util/EmptyError"); + function single(predicate) { + return this.lift(new SingleOperator(predicate, this)); + } + exports.single = single; + var SingleOperator = (function() { + function SingleOperator(predicate, source) { + this.predicate = predicate; + this.source = source; + } + SingleOperator.prototype.call = function(subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.source); + }; + return SingleOperator; + })(); + var SingleSubscriber = (function(_super) { + __extends(SingleSubscriber, _super); + function SingleSubscriber(destination, predicate, source) { + _super.call(this, destination); + this.predicate = predicate; + this.source = source; + this.seenValue = false; + this.index = 0; + } + SingleSubscriber.prototype.applySingleValue = function(value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function(value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = tryCatch_1.tryCatch(predicate)(value, currentIndex, this.source); + if (result === errorObject_1.errorObject) { + this.destination.error(result.e); + } else if (result) { + this.applySingleValue(value); + } + } else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function() { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } else { + destination.error(new EmptyError_1.EmptyError); + } + }; + return SingleSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/skip", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function skip(total) { + return this.lift(new SkipOperator(total)); + } + exports.skip = skip; + var SkipOperator = (function() { + function SkipOperator(total) { + this.total = total; + } + SkipOperator.prototype.call = function(subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; + })(); + var SkipSubscriber = (function(_super) { + __extends(SkipSubscriber, _super); + function SkipSubscriber(destination, total) { + _super.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function(x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/skipUntil", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function skipUntil(notifier) { + return this.lift(new SkipUntilOperator(notifier)); + } + exports.skipUntil = skipUntil; + var SkipUntilOperator = (function() { + function SkipUntilOperator(notifier) { + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function(subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; + })(); + var SkipUntilSubscriber = (function(_super) { + __extends(SkipUntilSubscriber, _super); + function SkipUntilSubscriber(destination, notifier) { + _super.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(value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._error = function(err) { + this.destination.error(err); + }; + SkipUntilSubscriber.prototype._complete = function() { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + SkipUntilSubscriber.prototype.unsubscribe = function() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._subscription.unsubscribe(); + this._isUnsubscribed = true; + } else { + _super.prototype.unsubscribe.call(this); + } + }; + return SkipUntilSubscriber; + })(Subscriber_1.Subscriber); + var NotificationSubscriber = (function(_super) { + __extends(NotificationSubscriber, _super); + function NotificationSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function(unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function(err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function() { + this.hasCompleted = true; + }; + return NotificationSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/skipWhile", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function skipWhile(predicate) { + return this.lift(new SkipWhileOperator(predicate)); + } + exports.skipWhile = skipWhile; + var SkipWhileOperator = (function() { + function SkipWhileOperator(predicate) { + this.predicate = predicate; + } + SkipWhileOperator.prototype.call = function(subscriber) { + return new SkipWhileSubscriber(subscriber, this.predicate); + }; + return SkipWhileOperator; + })(); + var SkipWhileSubscriber = (function(_super) { + __extends(SkipWhileSubscriber, _super); + function SkipWhileSubscriber(destination, predicate) { + _super.call(this, destination); + this.predicate = predicate; + this.skipping = true; + this.index = 0; + } + SkipWhileSubscriber.prototype._next = function(value) { + var destination = this.destination; + if (this.skipping === true) { + var index = this.index++; + var result = tryCatch_1.tryCatch(this.predicate)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } else { + this.skipping = Boolean(result); + } + } + if (this.skipping === false) { + destination.next(value); + } + }; + return SkipWhileSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/startWith", ["rxjs/observable/fromArray", "rxjs/observable/ScalarObservable", "rxjs/observable/empty", "rxjs/operator/concat-static", "rxjs/util/isScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var fromArray_1 = require("rxjs/observable/fromArray"); + var ScalarObservable_1 = require("rxjs/observable/ScalarObservable"); + var empty_1 = require("rxjs/observable/empty"); + var concat_static_1 = require("rxjs/operator/concat-static"); + var isScheduler_1 = require("rxjs/util/isScheduler"); + function startWith() { + var array = []; + for (var _i = 0; _i < arguments.length; _i++) { + array[_i - 0] = arguments[_i]; + } + var scheduler = array[array.length - 1]; + if (isScheduler_1.isScheduler(scheduler)) { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return concat_static_1.concat(new ScalarObservable_1.ScalarObservable(array[0], scheduler), this); + } else if (len > 1) { + return concat_static_1.concat(new fromArray_1.ArrayObservable(array, scheduler), this); + } else { + return concat_static_1.concat(new empty_1.EmptyObservable(scheduler), this); + } + } + exports.startWith = startWith; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/SubscribeOnObservable", ["rxjs/Observable", "rxjs/scheduler/asap", "rxjs/util/isNumeric"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var asap_1 = require("rxjs/scheduler/asap"); + var isNumeric_1 = require("rxjs/util/isNumeric"); + var SubscribeOnObservable = (function(_super) { + __extends(SubscribeOnObservable, _super); + function SubscribeOnObservable(source, delayTime, scheduler) { + if (delayTime === void 0) { + delayTime = 0; + } + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + _super.call(this); + this.source = source; + this.delayTime = delayTime; + this.scheduler = scheduler; + if (!isNumeric_1.isNumeric(delayTime) || delayTime < 0) { + this.delayTime = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = asap_1.asap; + } + } + SubscribeOnObservable.create = function(source, delay, scheduler) { + if (delay === void 0) { + delay = 0; + } + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function(_a) { + var source = _a.source, + subscriber = _a.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function(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; + })(Observable_1.Observable); + exports.SubscribeOnObservable = SubscribeOnObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/switch", ["rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + function _switch() { + return this.lift(new SwitchOperator()); + } + exports._switch = _switch; + var SwitchOperator = (function() { + function SwitchOperator() {} + SwitchOperator.prototype.call = function(subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; + })(); + var SwitchSubscriber = (function(_super) { + __extends(SwitchSubscriber, _super); + function SwitchSubscriber(destination) { + _super.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function(value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, value)); + }; + SwitchSubscriber.prototype._complete = function() { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function() { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function(outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function(err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function() { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/switchMap", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); + } + exports.switchMap = switchMap; + var SwitchMapOperator = (function() { + function SwitchMapOperator(project, resultSelector) { + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function(subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; + })(); + var SwitchMapSubscriber = (function(_super) { + __extends(SwitchMapSubscriber, _super); + function SwitchMapSubscriber(destination, project, resultSelector) { + _super.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function(value) { + var index = this.index++; + var destination = this.destination; + var result = tryCatch_1.tryCatch(this.project)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function(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(err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, + resultSelector = _a.resultSelector, + destination = _a.destination; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/switchMapTo", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); + } + exports.switchMapTo = switchMapTo; + var SwitchMapToOperator = (function() { + function SwitchMapToOperator(observable, resultSelector) { + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function(subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; + })(); + var SwitchMapToSubscriber = (function(_super) { + __extends(SwitchMapToSubscriber, _super); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _super.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function(value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function() { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function(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(err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function(outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, + resultSelector = _a.resultSelector, + destination = _a.destination; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/ArgumentOutOfRangeError", [], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ArgumentOutOfRangeError = (function() { + function ArgumentOutOfRangeError() { + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + } + return ArgumentOutOfRangeError; + })(); + exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/takeUntil", ["rxjs/Subscriber", "rxjs/util/noop"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var noop_1 = require("rxjs/util/noop"); + function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); + } + exports.takeUntil = takeUntil; + var TakeUntilOperator = (function() { + function TakeUntilOperator(notifier) { + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function(subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; + })(); + var TakeUntilSubscriber = (function(_super) { + __extends(TakeUntilSubscriber, _super); + function TakeUntilSubscriber(destination, notifier) { + _super.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function() { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; + })(Subscriber_1.Subscriber); + var TakeUntilInnerSubscriber = (function(_super) { + __extends(TakeUntilInnerSubscriber, _super); + function TakeUntilInnerSubscriber(destination) { + _super.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function(unused) { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function(err) { + this.destination.error(err); + }; + TakeUntilInnerSubscriber.prototype._complete = function() { + noop_1.noop(); + }; + return TakeUntilInnerSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/takeWhile", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function takeWhile(predicate) { + return this.lift(new TakeWhileOperator(predicate)); + } + exports.takeWhile = takeWhile; + var TakeWhileOperator = (function() { + function TakeWhileOperator(predicate) { + this.predicate = predicate; + } + TakeWhileOperator.prototype.call = function(subscriber) { + return new TakeWhileSubscriber(subscriber, this.predicate); + }; + return TakeWhileOperator; + })(); + var TakeWhileSubscriber = (function(_super) { + __extends(TakeWhileSubscriber, _super); + function TakeWhileSubscriber(destination, predicate) { + _super.call(this, destination); + this.predicate = predicate; + this.index = 0; + } + TakeWhileSubscriber.prototype._next = function(value) { + var destination = this.destination; + var result = tryCatch_1.tryCatch(this.predicate)(value, this.index++); + if (result == errorObject_1.errorObject) { + destination.error(result.e); + } else if (Boolean(result)) { + destination.next(value); + } else { + destination.complete(); + } + }; + return TakeWhileSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/throttle", ["rxjs/observable/fromPromise", "rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/isPromise", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var fromPromise_1 = require("rxjs/observable/fromPromise"); + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var isPromise_1 = require("rxjs/util/isPromise"); + var errorObject_1 = require("rxjs/util/errorObject"); + function throttle(durationSelector) { + return this.lift(new ThrottleOperator(durationSelector)); + } + exports.throttle = throttle; + var ThrottleOperator = (function() { + function ThrottleOperator(durationSelector) { + this.durationSelector = durationSelector; + } + ThrottleOperator.prototype.call = function(subscriber) { + return new ThrottleSubscriber(subscriber, this.durationSelector); + }; + return ThrottleOperator; + })(); + var ThrottleSubscriber = (function(_super) { + __extends(ThrottleSubscriber, _super); + function ThrottleSubscriber(destination, durationSelector) { + _super.call(this, destination); + this.durationSelector = durationSelector; + } + ThrottleSubscriber.prototype._next = function(value) { + if (!this.throttled) { + var destination = this.destination; + var duration = tryCatch_1.tryCatch(this.durationSelector)(value); + if (duration === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return ; + } + if (isPromise_1.isPromise(duration)) { + duration = fromPromise_1.PromiseObservable.create(duration); + } + this.add(this.throttled = duration._subscribe(new ThrottleDurationSelectorSubscriber(this))); + destination.next(value); + } + }; + ThrottleSubscriber.prototype._error = function(err) { + this.clearThrottle(); + _super.prototype._error.call(this, err); + }; + ThrottleSubscriber.prototype._complete = function() { + this.clearThrottle(); + _super.prototype._complete.call(this); + }; + ThrottleSubscriber.prototype.clearThrottle = function() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + this.throttled = null; + } + }; + return ThrottleSubscriber; + })(Subscriber_1.Subscriber); + var ThrottleDurationSelectorSubscriber = (function(_super) { + __extends(ThrottleDurationSelectorSubscriber, _super); + function ThrottleDurationSelectorSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + ThrottleDurationSelectorSubscriber.prototype._next = function(unused) { + this.parent.clearThrottle(); + }; + ThrottleDurationSelectorSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + ThrottleDurationSelectorSubscriber.prototype._complete = function() { + this.parent.clearThrottle(); + }; + return ThrottleDurationSelectorSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/throttleTime", ["rxjs/Subscriber", "rxjs/scheduler/asap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var asap_1 = require("rxjs/scheduler/asap"); + function throttleTime(delay, scheduler) { + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return this.lift(new ThrottleTimeOperator(delay, scheduler)); + } + exports.throttleTime = throttleTime; + var ThrottleTimeOperator = (function() { + function ThrottleTimeOperator(delay, scheduler) { + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleTimeOperator.prototype.call = function(subscriber) { + return new ThrottleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleTimeOperator; + })(); + var ThrottleTimeSubscriber = (function(_super) { + __extends(ThrottleTimeSubscriber, _super); + function ThrottleTimeSubscriber(destination, delay, scheduler) { + _super.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleTimeSubscriber.prototype._next = function(value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, {subscriber: this})); + this.destination.next(value); + } + }; + ThrottleTimeSubscriber.prototype.clearThrottle = function() { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + this.throttled = null; + } + }; + return ThrottleTimeSubscriber; + })(Subscriber_1.Subscriber); + function dispatchNext(_a) { + var subscriber = _a.subscriber; + subscriber.clearThrottle(); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/timeout", ["rxjs/Subscriber", "rxjs/scheduler/queue", "rxjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var queue_1 = require("rxjs/scheduler/queue"); + var isDate_1 = require("rxjs/util/isDate"); + function timeout(due, errorToSend, scheduler) { + if (errorToSend === void 0) { + errorToSend = null; + } + if (scheduler === void 0) { + scheduler = queue_1.queue; + } + var absoluteTimeout = isDate_1.isDate(due); + var waitFor = absoluteTimeout ? (+due - scheduler.now()) : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); + } + exports.timeout = timeout; + var TimeoutOperator = (function() { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function(subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; + })(); + var TimeoutSubscriber = (function(_super) { + __extends(TimeoutSubscriber, _super); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _super.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(); + } + Object.defineProperty(TimeoutSubscriber.prototype, "previousIndex", { + get: function() { + return this._previousIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TimeoutSubscriber.prototype, "hasCompleted", { + get: function() { + return this._hasCompleted; + }, + enumerable: true, + configurable: true + }); + TimeoutSubscriber.dispatchTimeout = function(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function() { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { + subscriber: this, + index: currentIndex + }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function() { + this.error(this.errorToSend || new Error('timeout')); + }; + return TimeoutSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/timeoutWith", ["rxjs/scheduler/queue", "rxjs/util/isDate", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var queue_1 = require("rxjs/scheduler/queue"); + var isDate_1 = require("rxjs/util/isDate"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + function timeoutWith(due, withObservable, scheduler) { + if (scheduler === void 0) { + scheduler = queue_1.queue; + } + var absoluteTimeout = isDate_1.isDate(due); + var waitFor = absoluteTimeout ? (+due - scheduler.now()) : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); + } + exports.timeoutWith = timeoutWith; + var TimeoutWithOperator = (function() { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function(subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; + })(); + var TimeoutWithSubscriber = (function(_super) { + __extends(TimeoutWithSubscriber, _super); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _super.call(this, null); + this.destination = destination; + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + destination.add(this); + this.scheduleTimeout(); + } + Object.defineProperty(TimeoutWithSubscriber.prototype, "previousIndex", { + get: function() { + return this._previousIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TimeoutWithSubscriber.prototype, "hasCompleted", { + get: function() { + return this._hasCompleted; + }, + enumerable: true, + configurable: true + }); + TimeoutWithSubscriber.dispatchTimeout = function(state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function() { + 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(value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutWithSubscriber.prototype._error = function(err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutWithSubscriber.prototype._complete = function() { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutWithSubscriber.prototype.handleTimeout = function() { + if (!this.isUnsubscribed) { + var withObservable = this.withObservable; + this.unsubscribe(); + this.destination.add(this.timeoutSubscription = subscribeToResult_1.subscribeToResult(this, withObservable)); + } + }; + return TimeoutWithSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/toArray", ["rxjs/Subscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + function toArray() { + return this.lift(new ToArrayOperator()); + } + exports.toArray = toArray; + var ToArrayOperator = (function() { + function ToArrayOperator() {} + ToArrayOperator.prototype.call = function(subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; + })(); + var ToArraySubscriber = (function(_super) { + __extends(ToArraySubscriber, _super); + function ToArraySubscriber(destination) { + _super.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function(x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function() { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/toPromise", ["rxjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var root_1 = require("rxjs/util/root"); + function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { + PromiseCtor = root_1.root.Rx.config.Promise; + } else if (root_1.root.Promise) { + PromiseCtor = root_1.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function(resolve, reject) { + var value; + _this.subscribe(function(x) { + return value = x; + }, function(err) { + return reject(err); + }, function() { + return resolve(value); + }); + }); + } + exports.toPromise = toPromise; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/window", ["rxjs/Subscriber", "rxjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subject_1 = require("rxjs/Subject"); + function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); + } + exports.window = window; + var WindowOperator = (function() { + function WindowOperator(closingNotifier) { + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function(subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_super) { + __extends(WindowSubscriber, _super); + function WindowSubscriber(destination, closingNotifier) { + _super.call(this, destination); + this.destination = destination; + this.closingNotifier = closingNotifier; + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function(err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function() { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function() { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + var destination = this.destination; + var newWindow = this.window = new Subject_1.Subject(); + destination.add(newWindow); + destination.next(newWindow); + }; + return WindowSubscriber; + })(Subscriber_1.Subscriber); + var WindowClosingNotifierSubscriber = (function(_super) { + __extends(WindowClosingNotifierSubscriber, _super); + function WindowClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function(err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function() { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/windowCount", ["rxjs/Subscriber", "rxjs/Subject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subject_1 = require("rxjs/Subject"); + function windowCount(windowSize, startWindowEvery) { + if (startWindowEvery === void 0) { + startWindowEvery = 0; + } + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); + } + exports.windowCount = windowCount; + var WindowCountOperator = (function() { + function WindowCountOperator(windowSize, startWindowEvery) { + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function(subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; + })(); + var WindowCountSubscriber = (function(_super) { + __extends(WindowCountSubscriber, _super); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _super.call(this, destination); + this.destination = destination; + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new Subject_1.Subject()]; + this.count = 0; + var firstWindow = this.windows[0]; + destination.add(firstWindow); + destination.next(firstWindow); + } + WindowCountSubscriber.prototype._next = function(value) { + var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize; + var destination = this.destination; + 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_1 = new Subject_1.Subject(); + windows.push(window_1); + destination.add(window_1); + destination.next(window_1); + } + }; + WindowCountSubscriber.prototype._error = function(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/windowTime", ["rxjs/Subscriber", "rxjs/Subject", "rxjs/scheduler/asap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subject_1 = require("rxjs/Subject"); + var asap_1 = require("rxjs/scheduler/asap"); + function windowTime(windowTimeSpan, windowCreationInterval, scheduler) { + if (windowCreationInterval === void 0) { + windowCreationInterval = null; + } + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); + } + exports.windowTime = windowTime; + var WindowTimeOperator = (function() { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function(subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; + })(); + var WindowTimeSubscriber = (function(_super) { + __extends(WindowTimeSubscriber, _super); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _super.call(this, destination); + this.destination = destination; + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var window_1 = this.openWindow(); + var closeState = { + subscriber: this, + window: window_1, + 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 window_2 = this.openWindow(); + var timeSpanOnlyState = { + subscriber: this, + window: window_2, + windowTimeSpan: windowTimeSpan + }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function(value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function(err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function() { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function() { + var window = new Subject_1.Subject(); + this.windows.push(window); + var destination = this.destination; + destination.add(window); + destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function(window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; + })(Subscriber_1.Subscriber); + function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber, + windowTimeSpan = state.windowTimeSpan, + window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); + } + function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan, + subscriber = state.subscriber, + scheduler = state.scheduler, + 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(_a) { + var subscriber = _a.subscriber, + window = _a.window, + context = _a.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/windowToggle", ["rxjs/Subscriber", "rxjs/Subject", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subject_1 = require("rxjs/Subject"); + var Subscription_1 = require("rxjs/Subscription"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); + } + exports.windowToggle = windowToggle; + var WindowToggleOperator = (function() { + function WindowToggleOperator(openings, closingSelector) { + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function(subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; + })(); + var WindowToggleSubscriber = (function(_super) { + __extends(WindowToggleSubscriber, _super); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _super.call(this, destination); + this.destination = destination; + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function(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(err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function() { + 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(value) { + var closingSelector = this.closingSelector; + var closingNotifier = tryCatch_1.tryCatch(closingSelector)(value); + if (closingNotifier === errorObject_1.errorObject) { + this.error(closingNotifier.e); + } else { + var destination = this.destination; + var window_1 = new Subject_1.Subject(); + var subscription = new Subscription_1.Subscription(); + var context = { + window: window_1, + subscription: subscription + }; + this.contexts.push(context); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var closingSubscription = closingNotifier._subscribe(subscriber); + subscription.add(closingSubscription); + destination.add(subscription); + destination.add(window_1); + destination.next(window_1); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function(context) { + var window = context.window, + subscription = context.subscription; + var contexts = this.contexts; + var destination = this.destination; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + destination.remove(subscription); + destination.remove(window); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; + })(Subscriber_1.Subscriber); + var WindowClosingNotifierSubscriber = (function(_super) { + __extends(WindowClosingNotifierSubscriber, _super); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _super.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function() { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function() { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; + })(Subscriber_1.Subscriber); + var WindowToggleOpeningsSubscriber = (function(_super) { + __extends(WindowToggleOpeningsSubscriber, _super); + function WindowToggleOpeningsSubscriber(parent) { + _super.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function(value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function() {}; + return WindowToggleOpeningsSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/windowWhen", ["rxjs/Subscriber", "rxjs/Subject", "rxjs/Subscription", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Subject_1 = require("rxjs/Subject"); + var Subscription_1 = require("rxjs/Subscription"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function windowWhen(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); + } + exports.windowWhen = windowWhen; + var WindowOperator = (function() { + function WindowOperator(closingSelector) { + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function(subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; + })(); + var WindowSubscriber = (function(_super) { + __extends(WindowSubscriber, _super); + function WindowSubscriber(destination, closingSelector) { + _super.call(this, destination); + this.destination = destination; + this.closingSelector = closingSelector; + this.openWindow(); + } + WindowSubscriber.prototype._next = function(value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function(err) { + this.window.error(err); + this.destination.error(err); + this._unsubscribeClosingNotification(); + }; + WindowSubscriber.prototype._complete = function() { + this.window.complete(); + this.destination.complete(); + this._unsubscribeClosingNotification(); + }; + WindowSubscriber.prototype.unsubscribe = function() { + _super.prototype.unsubscribe.call(this); + this._unsubscribeClosingNotification(); + }; + WindowSubscriber.prototype._unsubscribeClosingNotification = function() { + var closingNotification = this.closingNotification; + if (closingNotification) { + closingNotification.unsubscribe(); + } + }; + WindowSubscriber.prototype.openWindow = function() { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + var window = this.window = new Subject_1.Subject(); + this.destination.next(window); + var closingNotifier = tryCatch_1.tryCatch(this.closingSelector)(); + if (closingNotifier === errorObject_1.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } else { + var closingNotification = this.closingNotification = new Subscription_1.Subscription(); + closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.add(closingNotification); + this.add(window); + } + }; + return WindowSubscriber; + })(Subscriber_1.Subscriber); + var WindowClosingNotifierSubscriber = (function(_super) { + __extends(WindowClosingNotifierSubscriber, _super); + function WindowClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function() { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function(err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function() { + this.parent.openWindow(); + }; + return WindowClosingNotifierSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/withLatestFrom", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + function withLatestFrom() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var project; + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); + } + exports.withLatestFrom = withLatestFrom; + var WithLatestFromOperator = (function() { + function WithLatestFromOperator(observables, project) { + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function(subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; + })(); + var WithLatestFromSubscriber = (function(_super) { + __extends(WithLatestFromSubscriber, _super); + function WithLatestFromSubscriber(destination, observables, project) { + _super.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(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function(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() {}; + WithLatestFromSubscriber.prototype._next = function(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 = tryCatch_1.tryCatch(this.project).apply(this, args); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } else { + destination.next(result); + } + } else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/zip", ["rxjs/operator/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var zip_static_1 = require("rxjs/operator/zip-static"); + function zipProto() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + observables.unshift(this); + return zip_static_1.zip.apply(this, observables); + } + exports.zipProto = zipProto; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/zipAll", ["rxjs/operator/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var zip_support_1 = require("rxjs/operator/zip-support"); + function zipAll(project) { + return this.lift(new zip_support_1.ZipOperator(project)); + } + exports.zipAll = zipAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/SymbolShim", ["rxjs/util/root"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var root_1 = require("rxjs/util/root"); + function polyfillSymbol(root) { + var Symbol = ensureSymbol(root); + ensureIterator(Symbol, root); + ensureObservable(Symbol); + ensureFor(Symbol); + return Symbol; + } + exports.polyfillSymbol = polyfillSymbol; + function ensureFor(Symbol) { + if (!Symbol.for) { + Symbol.for = symbolForPolyfill; + } + } + exports.ensureFor = ensureFor; + var id = 0; + function ensureSymbol(root) { + if (!root.Symbol) { + root.Symbol = function symbolFuncPolyfill(description) { + return "@@Symbol(" + description + "):" + id++; + }; + } + return root.Symbol; + } + exports.ensureSymbol = ensureSymbol; + function symbolForPolyfill(key) { + return '@@' + key; + } + exports.symbolForPolyfill = symbolForPolyfill; + function ensureIterator(Symbol, root) { + if (!Symbol.iterator) { + if (typeof Symbol.for === 'function') { + Symbol.iterator = Symbol.for('iterator'); + } else if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { + Symbol.iterator = '@@iterator'; + } else if (root.Map) { + var keys = Object.getOwnPropertyNames(root.Map.prototype); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (key !== 'entries' && key !== 'size' && root.Map.prototype[key] === root.Map.prototype['entries']) { + Symbol.iterator = key; + break; + } + } + } else { + Symbol.iterator = '@@iterator'; + } + } + } + exports.ensureIterator = ensureIterator; + function ensureObservable(Symbol) { + if (!Symbol.observable) { + if (typeof Symbol.for === 'function') { + Symbol.observable = Symbol.for('observable'); + } else { + Symbol.observable = '@@observable'; + } + } + } + exports.ensureObservable = ensureObservable; + exports.SymbolShim = polyfillSymbol(root_1.root); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/tryCatch", ["rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var errorObject_1 = require("rxjs/util/errorObject"); + var tryCatchTarget; + function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + errorObject_1.errorObject.e = e; + return errorObject_1.errorObject; + } + } + function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; + } + exports.tryCatch = tryCatch; + ; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/subscribeToResult", ["rxjs/Observable", "rxjs/util/SymbolShim", "rxjs/InnerSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var SymbolShim_1 = require("rxjs/util/SymbolShim"); + var InnerSubscriber_1 = require("rxjs/InnerSubscriber"); + var isArray = Array.isArray; + function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { + var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex); + if (destination.isUnsubscribed) { + return ; + } + if (result instanceof Observable_1.Observable) { + 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[SymbolShim_1.SymbolShim.iterator] === 'function') { + for (var _i = 0, + result_1 = result; _i < result_1.length; _i++) { + var item = result_1[_i]; + destination.next(item); + if (destination.isUnsubscribed) { + break; + } + } + if (!destination.isUnsubscribed) { + destination.complete(); + } + } else if (typeof result[SymbolShim_1.SymbolShim.observable] === 'function') { + var obs = result[SymbolShim_1.SymbolShim.observable](); + if (typeof obs.subscribe !== 'function') { + destination.error('invalid observable'); + } else { + return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex)); + } + } else { + destination.error(new TypeError('unknown type returned')); + } + } + exports.subscribeToResult = subscribeToResult; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/QueueScheduler", ["rxjs/scheduler/QueueAction", "rxjs/scheduler/FutureAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var QueueAction_1 = require("rxjs/scheduler/QueueAction"); + var FutureAction_1 = require("rxjs/scheduler/FutureAction"); + var QueueScheduler = (function() { + function QueueScheduler() { + this.actions = []; + this.active = false; + this.scheduled = false; + } + QueueScheduler.prototype.now = function() { + return Date.now(); + }; + QueueScheduler.prototype.flush = function() { + if (this.active || this.scheduled) { + return ; + } + this.active = true; + var actions = this.actions; + for (var action = void 0; action = actions.shift(); ) { + action.execute(); + } + this.active = false; + }; + QueueScheduler.prototype.schedule = function(work, delay, state) { + if (delay === void 0) { + delay = 0; + } + return (delay <= 0) ? this.scheduleNow(work, state) : this.scheduleLater(work, delay, state); + }; + QueueScheduler.prototype.scheduleNow = function(work, state) { + return new QueueAction_1.QueueAction(this, work).schedule(state); + }; + QueueScheduler.prototype.scheduleLater = function(work, delay, state) { + return new FutureAction_1.FutureAction(this, work).schedule(state, delay); + }; + return QueueScheduler; + })(); + exports.QueueScheduler = QueueScheduler; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/merge-static", ["rxjs/Observable", "rxjs/operator/merge-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var merge_static_1 = require("rxjs/operator/merge-static"); + Observable_1.Observable.merge = merge_static_1.merge; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/bindCallback", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/subject/AsyncSubject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); + var BoundCallbackObservable = (function(_super) { + __extends(BoundCallbackObservable, _super); + function BoundCallbackObservable(callbackFunc, selector, args, scheduler) { + _super.call(this); + this.callbackFunc = callbackFunc; + this.selector = selector; + this.args = args; + this.scheduler = scheduler; + } + BoundCallbackObservable.create = function(callbackFunc, selector, scheduler) { + if (selector === void 0) { + selector = undefined; + } + return function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return new BoundCallbackObservable(callbackFunc, selector, args, scheduler); + }; + }; + BoundCallbackObservable.prototype._subscribe = function(subscriber) { + var callbackFunc = this.callbackFunc; + var args = this.args; + var scheduler = this.scheduler; + var subject = this.subject; + if (!scheduler) { + if (!subject) { + subject = this.subject = new AsyncSubject_1.AsyncSubject(); + var handler = function handlerFn() { + var innerArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + innerArgs[_i - 0] = arguments[_i]; + } + var source = handlerFn.source; + var selector = source.selector, + subject = source.subject; + if (selector) { + var result_1 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); + if (result_1 === errorObject_1.errorObject) { + subject.error(errorObject_1.errorObject.e); + } else { + subject.next(result_1); + subject.complete(); + } + } else { + subject.next(innerArgs.length === 1 ? innerArgs[0] : innerArgs); + subject.complete(); + } + }; + handler.source = this; + var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); + if (result === errorObject_1.errorObject) { + subject.error(errorObject_1.errorObject.e); + } + } + return subject.subscribe(subscriber); + } else { + subscriber.add(scheduler.schedule(dispatch, 0, { + source: this, + subscriber: subscriber + })); + return subscriber; + } + }; + return BoundCallbackObservable; + })(Observable_1.Observable); + exports.BoundCallbackObservable = BoundCallbackObservable; + function dispatch(state) { + var source = state.source, + subscriber = state.subscriber; + var callbackFunc = source.callbackFunc, + args = source.args, + scheduler = source.scheduler; + var subject = source.subject; + if (!subject) { + subject = source.subject = new AsyncSubject_1.AsyncSubject(); + var handler = function handlerFn() { + var innerArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + innerArgs[_i - 0] = arguments[_i]; + } + var source = handlerFn.source; + var selector = source.selector, + subject = source.subject; + if (selector) { + var result_2 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); + if (result_2 === errorObject_1.errorObject) { + subject.add(scheduler.schedule(dispatchError, 0, { + err: errorObject_1.errorObject.e, + subject: subject + })); + } else { + subject.add(scheduler.schedule(dispatchNext, 0, { + value: result_2, + subject: subject + })); + } + } else { + var value = innerArgs.length === 1 ? innerArgs[0] : innerArgs; + subject.add(scheduler.schedule(dispatchNext, 0, { + value: value, + subject: subject + })); + } + }; + handler.source = source; + var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); + if (result === errorObject_1.errorObject) { + subject.error(errorObject_1.errorObject.e); + } + } + this.add(subject.subscribe(subscriber)); + } + function dispatchNext(_a) { + var value = _a.value, + subject = _a.subject; + subject.next(value); + subject.complete(); + } + function dispatchError(_a) { + var err = _a.err, + subject = _a.subject; + subject.error(err); + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/defer", ["rxjs/Observable", "rxjs/observable/defer"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var defer_1 = require("rxjs/observable/defer"); + Observable_1.Observable.defer = defer_1.DeferObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/forkJoin", ["rxjs/Observable", "rxjs/Subscriber", "rxjs/observable/fromPromise", "rxjs/observable/empty", "rxjs/util/isPromise", "rxjs/util/isArray"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var Subscriber_1 = require("rxjs/Subscriber"); + var fromPromise_1 = require("rxjs/observable/fromPromise"); + var empty_1 = require("rxjs/observable/empty"); + var isPromise_1 = require("rxjs/util/isPromise"); + var isArray_1 = require("rxjs/util/isArray"); + var ForkJoinObservable = (function(_super) { + __extends(ForkJoinObservable, _super); + function ForkJoinObservable(sources, resultSelector) { + _super.call(this); + this.sources = sources; + this.resultSelector = resultSelector; + } + ForkJoinObservable.create = function() { + var sources = []; + for (var _i = 0; _i < arguments.length; _i++) { + sources[_i - 0] = arguments[_i]; + } + if (sources === null || arguments.length === 0) { + return new empty_1.EmptyObservable(); + } + var resultSelector = null; + if (typeof sources[sources.length - 1] === 'function') { + resultSelector = sources.pop(); + } + if (sources.length === 1 && isArray_1.isArray(sources[0])) { + sources = sources[0]; + } + return new ForkJoinObservable(sources, resultSelector); + }; + ForkJoinObservable.prototype._subscribe = function(subscriber) { + var sources = this.sources; + var len = sources.length; + var context = { + completed: 0, + total: len, + values: emptyArray(len), + selector: this.resultSelector + }; + for (var i = 0; i < len; i++) { + var source = sources[i]; + if (isPromise_1.isPromise(source)) { + source = new fromPromise_1.PromiseObservable(source); + } + source.subscribe(new AllSubscriber(subscriber, i, context)); + } + }; + return ForkJoinObservable; + })(Observable_1.Observable); + exports.ForkJoinObservable = ForkJoinObservable; + var AllSubscriber = (function(_super) { + __extends(AllSubscriber, _super); + function AllSubscriber(destination, index, context) { + _super.call(this, destination); + this.index = index; + this.context = context; + this._value = null; + } + AllSubscriber.prototype._next = function(value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function() { + var destination = this.destination; + if (this._value == null) { + destination.complete(); + } + var context = this.context; + context.completed++; + context.values[this.index] = this._value; + var values = context.values; + if (context.completed !== values.length) { + return ; + } + if (values.every(hasValue)) { + var value = context.selector ? context.selector.apply(this, values) : values; + destination.next(value); + } + destination.complete(); + }; + return AllSubscriber; + })(Subscriber_1.Subscriber); + function hasValue(x) { + return x !== null; + } + function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; + } + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/observeOn-support", ["rxjs/Subscriber", "rxjs/Notification"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Notification_1 = require("rxjs/Notification"); + var ObserveOnOperator = (function() { + function ObserveOnOperator(scheduler, delay) { + if (delay === void 0) { + delay = 0; + } + this.scheduler = scheduler; + this.delay = delay; + } + ObserveOnOperator.prototype.call = function(subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; + })(); + exports.ObserveOnOperator = ObserveOnOperator; + var ObserveOnSubscriber = (function(_super) { + __extends(ObserveOnSubscriber, _super); + function ObserveOnSubscriber(destination, scheduler, delay) { + if (delay === void 0) { + delay = 0; + } + _super.call(this, destination); + this.scheduler = scheduler; + this.delay = delay; + } + ObserveOnSubscriber.dispatch = function(_a) { + var notification = _a.notification, + destination = _a.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype.scheduleMessage = function(notification) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination))); + }; + ObserveOnSubscriber.prototype._next = function(value) { + this.scheduleMessage(Notification_1.Notification.createNext(value)); + }; + ObserveOnSubscriber.prototype._error = function(err) { + this.scheduleMessage(Notification_1.Notification.createError(err)); + }; + ObserveOnSubscriber.prototype._complete = function() { + this.scheduleMessage(Notification_1.Notification.createComplete()); + }; + return ObserveOnSubscriber; + })(Subscriber_1.Subscriber); + exports.ObserveOnSubscriber = ObserveOnSubscriber; + var ObserveOnMessage = (function() { + function ObserveOnMessage(notification, destination) { + this.notification = notification; + this.destination = destination; + } + return ObserveOnMessage; + })(); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/fromEvent", ["rxjs/Observable", "rxjs/observable/fromEvent"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var fromEvent_1 = require("rxjs/observable/fromEvent"); + Observable_1.Observable.fromEvent = fromEvent_1.FromEventObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/fromEventPattern", ["rxjs/Observable", "rxjs/observable/fromEventPattern"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var fromEventPattern_1 = require("rxjs/observable/fromEventPattern"); + Observable_1.Observable.fromEventPattern = fromEventPattern_1.FromEventPatternObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/AsapAction", ["rxjs/util/Immediate", "rxjs/scheduler/QueueAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Immediate_1 = require("rxjs/util/Immediate"); + var QueueAction_1 = require("rxjs/scheduler/QueueAction"); + var AsapAction = (function(_super) { + __extends(AsapAction, _super); + function AsapAction() { + _super.apply(this, arguments); + } + AsapAction.prototype.schedule = function(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 = Immediate_1.Immediate.setImmediate(function() { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + AsapAction.prototype.unsubscribe = function() { + var id = this.id; + var scheduler = this.scheduler; + _super.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + Immediate_1.Immediate.clearImmediate(id); + } + }; + return AsapAction; + })(QueueAction_1.QueueAction); + exports.AsapAction = AsapAction; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/never", ["rxjs/Observable", "rxjs/observable/never"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var never_1 = require("rxjs/observable/never"); + Observable_1.Observable.never = never_1.InfiniteObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/range", ["rxjs/Observable", "rxjs/observable/range"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var range_1 = require("rxjs/observable/range"); + Observable_1.Observable.range = range_1.RangeObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/timer", ["rxjs/util/isNumeric", "rxjs/Observable", "rxjs/scheduler/asap", "rxjs/util/isScheduler", "rxjs/util/isDate"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var isNumeric_1 = require("rxjs/util/isNumeric"); + var Observable_1 = require("rxjs/Observable"); + var asap_1 = require("rxjs/scheduler/asap"); + var isScheduler_1 = require("rxjs/util/isScheduler"); + var isDate_1 = require("rxjs/util/isDate"); + var TimerObservable = (function(_super) { + __extends(TimerObservable, _super); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === void 0) { + dueTime = 0; + } + _super.call(this); + this.period = period; + this.scheduler = scheduler; + this.dueTime = 0; + if (isNumeric_1.isNumeric(period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } else if (isScheduler_1.isScheduler(period)) { + scheduler = period; + } + if (!isScheduler_1.isScheduler(scheduler)) { + scheduler = asap_1.asap; + } + this.scheduler = scheduler; + var absoluteDueTime = isDate_1.isDate(dueTime); + this.dueTime = absoluteDueTime ? (+dueTime - this.scheduler.now()) : dueTime; + } + TimerObservable.create = function(dueTime, period, scheduler) { + if (dueTime === void 0) { + dueTime = 0; + } + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function(state) { + var index = state.index, + period = state.period, + 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(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; + })(Observable_1.Observable); + exports.TimerObservable = TimerObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/zip-static", ["rxjs/observable/fromArray", "rxjs/operator/zip-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var fromArray_1 = require("rxjs/observable/fromArray"); + var zip_support_1 = require("rxjs/operator/zip-support"); + function zip() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new fromArray_1.ArrayObservable(observables).lift(new zip_support_1.ZipOperator(project)); + } + exports.zip = zip; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/buffer", ["rxjs/Observable", "rxjs/operator/buffer"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var buffer_1 = require("rxjs/operator/buffer"); + Observable_1.Observable.prototype.buffer = buffer_1.buffer; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/bufferCount", ["rxjs/Observable", "rxjs/operator/bufferCount"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var bufferCount_1 = require("rxjs/operator/bufferCount"); + Observable_1.Observable.prototype.bufferCount = bufferCount_1.bufferCount; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/bufferTime", ["rxjs/Observable", "rxjs/operator/bufferTime"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var bufferTime_1 = require("rxjs/operator/bufferTime"); + Observable_1.Observable.prototype.bufferTime = bufferTime_1.bufferTime; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/bufferToggle", ["rxjs/Observable", "rxjs/operator/bufferToggle"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var bufferToggle_1 = require("rxjs/operator/bufferToggle"); + Observable_1.Observable.prototype.bufferToggle = bufferToggle_1.bufferToggle; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/bufferWhen", ["rxjs/Observable", "rxjs/operator/bufferWhen"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var bufferWhen_1 = require("rxjs/operator/bufferWhen"); + Observable_1.Observable.prototype.bufferWhen = bufferWhen_1.bufferWhen; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/catch", ["rxjs/Observable", "rxjs/operator/catch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var catch_1 = require("rxjs/operator/catch"); + Observable_1.Observable.prototype.catch = catch_1._catch; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/combineAll", ["rxjs/Observable", "rxjs/operator/combineAll"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var combineAll_1 = require("rxjs/operator/combineAll"); + Observable_1.Observable.prototype.combineAll = combineAll_1.combineAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/combineLatest", ["rxjs/Observable", "rxjs/operator/combineLatest"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var combineLatest_1 = require("rxjs/operator/combineLatest"); + Observable_1.Observable.prototype.combineLatest = combineLatest_1.combineLatest; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/concat", ["rxjs/Observable", "rxjs/operator/concat"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var concat_1 = require("rxjs/operator/concat"); + Observable_1.Observable.prototype.concat = concat_1.concat; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/concatAll", ["rxjs/Observable", "rxjs/operator/concatAll"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var concatAll_1 = require("rxjs/operator/concatAll"); + Observable_1.Observable.prototype.concatAll = concatAll_1.concatAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/concatMap", ["rxjs/operator/mergeMap-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var mergeMap_support_1 = require("rxjs/operator/mergeMap-support"); + function concatMap(project, projectResult) { + return this.lift(new mergeMap_support_1.MergeMapOperator(project, projectResult, 1)); + } + exports.concatMap = concatMap; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/concatMapTo", ["rxjs/operator/mergeMapTo-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var mergeMapTo_support_1 = require("rxjs/operator/mergeMapTo-support"); + function concatMapTo(observable, projectResult) { + return this.lift(new mergeMapTo_support_1.MergeMapToOperator(observable, projectResult, 1)); + } + exports.concatMapTo = concatMapTo; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/count", ["rxjs/Observable", "rxjs/operator/count"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var count_1 = require("rxjs/operator/count"); + Observable_1.Observable.prototype.count = count_1.count; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/dematerialize", ["rxjs/Observable", "rxjs/operator/dematerialize"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var dematerialize_1 = require("rxjs/operator/dematerialize"); + Observable_1.Observable.prototype.dematerialize = dematerialize_1.dematerialize; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/debounce", ["rxjs/Observable", "rxjs/operator/debounce"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var debounce_1 = require("rxjs/operator/debounce"); + Observable_1.Observable.prototype.debounce = debounce_1.debounce; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/debounceTime", ["rxjs/Observable", "rxjs/operator/debounceTime"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var debounceTime_1 = require("rxjs/operator/debounceTime"); + Observable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/defaultIfEmpty", ["rxjs/Observable", "rxjs/operator/defaultIfEmpty"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var defaultIfEmpty_1 = require("rxjs/operator/defaultIfEmpty"); + Observable_1.Observable.prototype.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/delay", ["rxjs/Observable", "rxjs/operator/delay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var delay_1 = require("rxjs/operator/delay"); + Observable_1.Observable.prototype.delay = delay_1.delay; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/distinctUntilChanged", ["rxjs/Observable", "rxjs/operator/distinctUntilChanged"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var distinctUntilChanged_1 = require("rxjs/operator/distinctUntilChanged"); + Observable_1.Observable.prototype.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/do", ["rxjs/Observable", "rxjs/operator/do"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var do_1 = require("rxjs/operator/do"); + Observable_1.Observable.prototype.do = do_1._do; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/expand", ["rxjs/operator/expand-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var expand_support_1 = require("rxjs/operator/expand-support"); + function expand(project, concurrent, scheduler) { + if (concurrent === void 0) { + concurrent = Number.POSITIVE_INFINITY; + } + if (scheduler === void 0) { + scheduler = undefined; + } + concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; + return this.lift(new expand_support_1.ExpandOperator(project, concurrent, scheduler)); + } + exports.expand = expand; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/filter", ["rxjs/Observable", "rxjs/operator/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var filter_1 = require("rxjs/operator/filter"); + Observable_1.Observable.prototype.filter = filter_1.filter; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/finally", ["rxjs/Observable", "rxjs/operator/finally"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var finally_1 = require("rxjs/operator/finally"); + Observable_1.Observable.prototype.finally = finally_1._finally; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/first", ["rxjs/Subscriber", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/util/EmptyError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var EmptyError_1 = require("rxjs/util/EmptyError"); + function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); + } + exports.first = first; + var FirstOperator = (function() { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function(observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; + })(); + var FirstSubscriber = (function(_super) { + __extends(FirstSubscriber, _super); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _super.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(value) { + var _a = this, + destination = _a.destination, + predicate = _a.predicate, + resultSelector = _a.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = tryCatch_1.tryCatch(predicate)(value, index, this.source); + if (passed === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return ; + } + } + if (passed) { + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return ; + } + destination.next(result); + } else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function() { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } else if (!this.hasCompleted) { + destination.error(new EmptyError_1.EmptyError); + } + }; + return FirstSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/util/Map", ["rxjs/util/root", "rxjs/util/MapPolyfill"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var root_1 = require("rxjs/util/root"); + var MapPolyfill_1 = require("rxjs/util/MapPolyfill"); + exports.Map = root_1.root.Map || (function() { + return MapPolyfill_1.MapPolyfill; + })(); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/ignoreElements", ["rxjs/Observable", "rxjs/operator/ignoreElements"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var ignoreElements_1 = require("rxjs/operator/ignoreElements"); + Observable_1.Observable.prototype.ignoreElements = ignoreElements_1.ignoreElements; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/every", ["rxjs/Observable", "rxjs/operator/every"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var every_1 = require("rxjs/operator/every"); + Observable_1.Observable.prototype.every = every_1.every; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/last", ["rxjs/Observable", "rxjs/operator/last"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var last_1 = require("rxjs/operator/last"); + Observable_1.Observable.prototype.last = last_1.last; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/map", ["rxjs/Observable", "rxjs/operator/map"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var map_1 = require("rxjs/operator/map"); + Observable_1.Observable.prototype.map = map_1.map; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/mapTo", ["rxjs/Observable", "rxjs/operator/mapTo"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var mapTo_1 = require("rxjs/operator/mapTo"); + Observable_1.Observable.prototype.mapTo = mapTo_1.mapTo; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/materialize", ["rxjs/Observable", "rxjs/operator/materialize"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var materialize_1 = require("rxjs/operator/materialize"); + Observable_1.Observable.prototype.materialize = materialize_1.materialize; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/merge", ["rxjs/Observable", "rxjs/operator/merge"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var merge_1 = require("rxjs/operator/merge"); + Observable_1.Observable.prototype.merge = merge_1.merge; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/mergeAll", ["rxjs/Observable", "rxjs/operator/mergeAll"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var mergeAll_1 = require("rxjs/operator/mergeAll"); + Observable_1.Observable.prototype.mergeAll = mergeAll_1.mergeAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/mergeMap", ["rxjs/Observable", "rxjs/operator/mergeMap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var mergeMap_1 = require("rxjs/operator/mergeMap"); + Observable_1.Observable.prototype.mergeMap = mergeMap_1.mergeMap; + Observable_1.Observable.prototype.flatMap = mergeMap_1.mergeMap; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/mergeMapTo", ["rxjs/Observable", "rxjs/operator/mergeMapTo"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var mergeMapTo_1 = require("rxjs/operator/mergeMapTo"); + Observable_1.Observable.prototype.mergeMapTo = mergeMapTo_1.mergeMapTo; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/multicast", ["rxjs/observable/ConnectableObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ConnectableObservable_1 = require("rxjs/observable/ConnectableObservable"); + function multicast(subjectOrSubjectFactory) { + var subjectFactory; + if (typeof subjectOrSubjectFactory === 'function') { + subjectFactory = subjectOrSubjectFactory; + } else { + subjectFactory = function subjectFactory() { + return subjectOrSubjectFactory; + }; + } + return new ConnectableObservable_1.ConnectableObservable(this, subjectFactory); + } + exports.multicast = multicast; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/observeOn", ["rxjs/Observable", "rxjs/operator/observeOn"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var observeOn_1 = require("rxjs/operator/observeOn"); + Observable_1.Observable.prototype.observeOn = observeOn_1.observeOn; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/partition", ["rxjs/util/not", "rxjs/operator/filter"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var not_1 = require("rxjs/util/not"); + var filter_1 = require("rxjs/operator/filter"); + function partition(predicate, thisArg) { + return [filter_1.filter.call(this, predicate), filter_1.filter.call(this, not_1.not(predicate, thisArg))]; + } + exports.partition = partition; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/publish", ["rxjs/Observable", "rxjs/operator/publish"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var publish_1 = require("rxjs/operator/publish"); + Observable_1.Observable.prototype.publish = publish_1.publish; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/subject/BehaviorSubject", ["rxjs/Subject", "rxjs/util/throwError", "rxjs/util/ObjectUnsubscribedError"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subject_1 = require("rxjs/Subject"); + var throwError_1 = require("rxjs/util/throwError"); + var ObjectUnsubscribedError_1 = require("rxjs/util/ObjectUnsubscribedError"); + var BehaviorSubject = (function(_super) { + __extends(BehaviorSubject, _super); + function BehaviorSubject(_value) { + _super.call(this); + this._value = _value; + this._hasError = false; + } + BehaviorSubject.prototype.getValue = function() { + if (this._hasError) { + throwError_1.throwError(this._err); + } else if (this.isUnsubscribed) { + throwError_1.throwError(new ObjectUnsubscribedError_1.ObjectUnsubscribedError()); + } else { + return this._value; + } + }; + Object.defineProperty(BehaviorSubject.prototype, "value", { + get: function() { + return this.getValue(); + }, + enumerable: true, + configurable: true + }); + BehaviorSubject.prototype._subscribe = function(subscriber) { + var subscription = _super.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return ; + } else if (!subscription.isUnsubscribed) { + subscriber.next(this._value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function(value) { + _super.prototype._next.call(this, this._value = value); + }; + BehaviorSubject.prototype._error = function(err) { + this._hasError = true; + _super.prototype._error.call(this, this._err = err); + }; + return BehaviorSubject; + })(Subject_1.Subject); + exports.BehaviorSubject = BehaviorSubject; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/publishReplay", ["rxjs/subject/ReplaySubject", "rxjs/operator/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var ReplaySubject_1 = require("rxjs/subject/ReplaySubject"); + var multicast_1 = require("rxjs/operator/multicast"); + function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === void 0) { + bufferSize = Number.POSITIVE_INFINITY; + } + if (windowTime === void 0) { + windowTime = Number.POSITIVE_INFINITY; + } + return multicast_1.multicast.call(this, new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler)); + } + exports.publishReplay = publishReplay; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/publishLast", ["rxjs/Observable", "rxjs/operator/publishLast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var publishLast_1 = require("rxjs/operator/publishLast"); + Observable_1.Observable.prototype.publishLast = publishLast_1.publishLast; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/reduce", ["rxjs/operator/reduce-support"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var reduce_support_1 = require("rxjs/operator/reduce-support"); + function reduce(project, seed) { + return this.lift(new reduce_support_1.ReduceOperator(project, seed)); + } + exports.reduce = reduce; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/repeat", ["rxjs/Observable", "rxjs/operator/repeat"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var repeat_1 = require("rxjs/operator/repeat"); + Observable_1.Observable.prototype.repeat = repeat_1.repeat; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/retry", ["rxjs/Observable", "rxjs/operator/retry"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var retry_1 = require("rxjs/operator/retry"); + Observable_1.Observable.prototype.retry = retry_1.retry; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/retryWhen", ["rxjs/Observable", "rxjs/operator/retryWhen"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var retryWhen_1 = require("rxjs/operator/retryWhen"); + Observable_1.Observable.prototype.retryWhen = retryWhen_1.retryWhen; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/sample", ["rxjs/Observable", "rxjs/operator/sample"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var sample_1 = require("rxjs/operator/sample"); + Observable_1.Observable.prototype.sample = sample_1.sample; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/sampleTime", ["rxjs/Observable", "rxjs/operator/sampleTime"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var sampleTime_1 = require("rxjs/operator/sampleTime"); + Observable_1.Observable.prototype.sampleTime = sampleTime_1.sampleTime; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/scan", ["rxjs/Observable", "rxjs/operator/scan"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var scan_1 = require("rxjs/operator/scan"); + Observable_1.Observable.prototype.scan = scan_1.scan; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/share", ["rxjs/Observable", "rxjs/operator/share"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var share_1 = require("rxjs/operator/share"); + Observable_1.Observable.prototype.share = share_1.share; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/single", ["rxjs/Observable", "rxjs/operator/single"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var single_1 = require("rxjs/operator/single"); + Observable_1.Observable.prototype.single = single_1.single; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/skip", ["rxjs/Observable", "rxjs/operator/skip"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var skip_1 = require("rxjs/operator/skip"); + Observable_1.Observable.prototype.skip = skip_1.skip; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/skipUntil", ["rxjs/Observable", "rxjs/operator/skipUntil"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var skipUntil_1 = require("rxjs/operator/skipUntil"); + Observable_1.Observable.prototype.skipUntil = skipUntil_1.skipUntil; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/skipWhile", ["rxjs/Observable", "rxjs/operator/skipWhile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var skipWhile_1 = require("rxjs/operator/skipWhile"); + Observable_1.Observable.prototype.skipWhile = skipWhile_1.skipWhile; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/startWith", ["rxjs/Observable", "rxjs/operator/startWith"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var startWith_1 = require("rxjs/operator/startWith"); + Observable_1.Observable.prototype.startWith = startWith_1.startWith; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/subscribeOn", ["rxjs/observable/SubscribeOnObservable"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SubscribeOnObservable_1 = require("rxjs/observable/SubscribeOnObservable"); + function subscribeOn(scheduler, delay) { + if (delay === void 0) { + delay = 0; + } + return new SubscribeOnObservable_1.SubscribeOnObservable(this, delay, scheduler); + } + exports.subscribeOn = subscribeOn; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/switch", ["rxjs/Observable", "rxjs/operator/switch"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var switch_1 = require("rxjs/operator/switch"); + Observable_1.Observable.prototype.switch = switch_1._switch; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/switchMap", ["rxjs/Observable", "rxjs/operator/switchMap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var switchMap_1 = require("rxjs/operator/switchMap"); + Observable_1.Observable.prototype.switchMap = switchMap_1.switchMap; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/switchMapTo", ["rxjs/Observable", "rxjs/operator/switchMapTo"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var switchMapTo_1 = require("rxjs/operator/switchMapTo"); + Observable_1.Observable.prototype.switchMapTo = switchMapTo_1.switchMapTo; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/take", ["rxjs/Subscriber", "rxjs/util/ArgumentOutOfRangeError", "rxjs/observable/empty"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var ArgumentOutOfRangeError_1 = require("rxjs/util/ArgumentOutOfRangeError"); + var empty_1 = require("rxjs/observable/empty"); + function take(total) { + if (total === 0) { + return new empty_1.EmptyObservable(); + } else { + return this.lift(new TakeOperator(total)); + } + } + exports.take = take; + var TakeOperator = (function() { + function TakeOperator(total) { + this.total = total; + if (this.total < 0) { + throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; + } + } + TakeOperator.prototype.call = function(subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; + })(); + var TakeSubscriber = (function(_super) { + __extends(TakeSubscriber, _super); + function TakeSubscriber(destination, total) { + _super.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function(value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/takeUntil", ["rxjs/Observable", "rxjs/operator/takeUntil"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var takeUntil_1 = require("rxjs/operator/takeUntil"); + Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/takeWhile", ["rxjs/Observable", "rxjs/operator/takeWhile"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var takeWhile_1 = require("rxjs/operator/takeWhile"); + Observable_1.Observable.prototype.takeWhile = takeWhile_1.takeWhile; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/throttle", ["rxjs/Observable", "rxjs/operator/throttle"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var throttle_1 = require("rxjs/operator/throttle"); + Observable_1.Observable.prototype.throttle = throttle_1.throttle; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/throttleTime", ["rxjs/Observable", "rxjs/operator/throttleTime"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var throttleTime_1 = require("rxjs/operator/throttleTime"); + Observable_1.Observable.prototype.throttleTime = throttleTime_1.throttleTime; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/timeout", ["rxjs/Observable", "rxjs/operator/timeout"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var timeout_1 = require("rxjs/operator/timeout"); + Observable_1.Observable.prototype.timeout = timeout_1.timeout; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/timeoutWith", ["rxjs/Observable", "rxjs/operator/timeoutWith"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var timeoutWith_1 = require("rxjs/operator/timeoutWith"); + Observable_1.Observable.prototype.timeoutWith = timeoutWith_1.timeoutWith; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/toArray", ["rxjs/Observable", "rxjs/operator/toArray"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var toArray_1 = require("rxjs/operator/toArray"); + Observable_1.Observable.prototype.toArray = toArray_1.toArray; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/toPromise", ["rxjs/Observable", "rxjs/operator/toPromise"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var toPromise_1 = require("rxjs/operator/toPromise"); + Observable_1.Observable.prototype.toPromise = toPromise_1.toPromise; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/window", ["rxjs/Observable", "rxjs/operator/window"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var window_1 = require("rxjs/operator/window"); + Observable_1.Observable.prototype.window = window_1.window; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/windowCount", ["rxjs/Observable", "rxjs/operator/windowCount"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var windowCount_1 = require("rxjs/operator/windowCount"); + Observable_1.Observable.prototype.windowCount = windowCount_1.windowCount; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/windowTime", ["rxjs/Observable", "rxjs/operator/windowTime"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var windowTime_1 = require("rxjs/operator/windowTime"); + Observable_1.Observable.prototype.windowTime = windowTime_1.windowTime; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/windowToggle", ["rxjs/Observable", "rxjs/operator/windowToggle"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var windowToggle_1 = require("rxjs/operator/windowToggle"); + Observable_1.Observable.prototype.windowToggle = windowToggle_1.windowToggle; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/windowWhen", ["rxjs/Observable", "rxjs/operator/windowWhen"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var windowWhen_1 = require("rxjs/operator/windowWhen"); + Observable_1.Observable.prototype.windowWhen = windowWhen_1.windowWhen; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/withLatestFrom", ["rxjs/Observable", "rxjs/operator/withLatestFrom"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var withLatestFrom_1 = require("rxjs/operator/withLatestFrom"); + Observable_1.Observable.prototype.withLatestFrom = withLatestFrom_1.withLatestFrom; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/zip", ["rxjs/Observable", "rxjs/operator/zip"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var zip_1 = require("rxjs/operator/zip"); + Observable_1.Observable.prototype.zip = zip_1.zipProto; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/zipAll", ["rxjs/Observable", "rxjs/operator/zipAll"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var zipAll_1 = require("rxjs/operator/zipAll"); + Observable_1.Observable.prototype.zipAll = zipAll_1.zipAll; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/symbol/rxSubscriber", ["rxjs/util/SymbolShim"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var SymbolShim_1 = require("rxjs/util/SymbolShim"); + exports.rxSubscriber = SymbolShim_1.SymbolShim.for('rxSubscriber'); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/ScalarObservable", ["rxjs/Observable", "rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/observable/throw", "rxjs/observable/empty"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var throw_1 = require("rxjs/observable/throw"); + var empty_1 = require("rxjs/observable/empty"); + var ScalarObservable = (function(_super) { + __extends(ScalarObservable, _super); + function ScalarObservable(value, scheduler) { + _super.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function(value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function(state) { + var done = state.done, + value = state.value, + 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(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; + })(Observable_1.Observable); + exports.ScalarObservable = ScalarObservable; + var proto = ScalarObservable.prototype; + proto.map = function(project, thisArg) { + var result = tryCatch_1.tryCatch(project).call(thisArg || this, this.value, 0); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } + }; + proto.filter = function(select, thisArg) { + var result = tryCatch_1.tryCatch(select).call(thisArg || this, this.value, 0); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } else if (result) { + return this; + } else { + return new empty_1.EmptyObservable(); + } + }; + proto.reduce = function(project, seed) { + if (typeof seed === 'undefined') { + return this; + } + var result = tryCatch_1.tryCatch(project)(seed, this.value); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } else { + return new ScalarObservable(result); + } + }; + proto.scan = function(project, acc) { + return this.reduce(project, acc); + }; + proto.count = function(predicate) { + if (!predicate) { + return new ScalarObservable(1); + } else { + var result = tryCatch_1.tryCatch(predicate).call(this, this.value, 0, this); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } else { + return new ScalarObservable(result ? 1 : 0); + } + } + }; + proto.skip = function(count) { + if (count > 0) { + return new empty_1.EmptyObservable(); + } + return this; + }; + proto.take = function(count) { + if (count > 0) { + return this; + } + return new empty_1.EmptyObservable(); + }; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/combineLatest-support", ["rxjs/util/tryCatch", "rxjs/util/errorObject", "rxjs/OuterSubscriber", "rxjs/util/subscribeToResult"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + var OuterSubscriber_1 = require("rxjs/OuterSubscriber"); + var subscribeToResult_1 = require("rxjs/util/subscribeToResult"); + var CombineLatestOperator = (function() { + function CombineLatestOperator(project) { + this.project = project; + } + CombineLatestOperator.prototype.call = function(subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; + })(); + exports.CombineLatestOperator = CombineLatestOperator; + var CombineLatestSubscriber = (function(_super) { + __extends(CombineLatestSubscriber, _super); + function CombineLatestSubscriber(destination, project) { + _super.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function(observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function() { + 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(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function(unused) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function(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 = tryCatch_1.tryCatch(project).apply(this, values); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } else { + destination.next(result); + } + } else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; + })(OuterSubscriber_1.OuterSubscriber); + exports.CombineLatestSubscriber = CombineLatestSubscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/queue", ["rxjs/scheduler/QueueScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var QueueScheduler_1 = require("rxjs/scheduler/QueueScheduler"); + exports.queue = new QueueScheduler_1.QueueScheduler(); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/bindCallback", ["rxjs/Observable", "rxjs/observable/bindCallback"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var bindCallback_1 = require("rxjs/observable/bindCallback"); + Observable_1.Observable.bindCallback = bindCallback_1.BoundCallbackObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/forkJoin", ["rxjs/Observable", "rxjs/observable/forkJoin"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var forkJoin_1 = require("rxjs/observable/forkJoin"); + Observable_1.Observable.forkJoin = forkJoin_1.ForkJoinObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/from", ["rxjs/observable/fromPromise", "rxjs/observable/IteratorObservable", "rxjs/observable/fromArray", "rxjs/util/SymbolShim", "rxjs/Observable", "rxjs/operator/observeOn-support", "rxjs/scheduler/queue"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var fromPromise_1 = require("rxjs/observable/fromPromise"); + var IteratorObservable_1 = require("rxjs/observable/IteratorObservable"); + var fromArray_1 = require("rxjs/observable/fromArray"); + var SymbolShim_1 = require("rxjs/util/SymbolShim"); + var Observable_1 = require("rxjs/Observable"); + var observeOn_support_1 = require("rxjs/operator/observeOn-support"); + var queue_1 = require("rxjs/scheduler/queue"); + var isArray = Array.isArray; + var FromObservable = (function(_super) { + __extends(FromObservable, _super); + function FromObservable(ish, scheduler) { + _super.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function(ish, scheduler) { + if (scheduler === void 0) { + scheduler = queue_1.queue; + } + if (ish) { + if (isArray(ish)) { + return new fromArray_1.ArrayObservable(ish, scheduler); + } else if (typeof ish.then === 'function') { + return new fromPromise_1.PromiseObservable(ish, scheduler); + } else if (typeof ish[SymbolShim_1.SymbolShim.observable] === 'function') { + if (ish instanceof Observable_1.Observable) { + return ish; + } + return new FromObservable(ish, scheduler); + } else if (typeof ish[SymbolShim_1.SymbolShim.iterator] === 'function') { + return new IteratorObservable_1.IteratorObservable(ish, null, null, scheduler); + } + } + throw new TypeError((typeof ish) + ' is not observable'); + }; + FromObservable.prototype._subscribe = function(subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === queue_1.queue) { + return ish[SymbolShim_1.SymbolShim.observable]().subscribe(subscriber); + } else { + return ish[SymbolShim_1.SymbolShim.observable]().subscribe(new observeOn_support_1.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; + })(Observable_1.Observable); + exports.FromObservable = FromObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/AsapScheduler", ["rxjs/scheduler/QueueScheduler", "rxjs/scheduler/AsapAction", "rxjs/scheduler/QueueAction"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var QueueScheduler_1 = require("rxjs/scheduler/QueueScheduler"); + var AsapAction_1 = require("rxjs/scheduler/AsapAction"); + var QueueAction_1 = require("rxjs/scheduler/QueueAction"); + var AsapScheduler = (function(_super) { + __extends(AsapScheduler, _super); + function AsapScheduler() { + _super.apply(this, arguments); + } + AsapScheduler.prototype.scheduleNow = function(work, state) { + return (this.scheduled ? new QueueAction_1.QueueAction(this, work) : new AsapAction_1.AsapAction(this, work)).schedule(state); + }; + return AsapScheduler; + })(QueueScheduler_1.QueueScheduler); + exports.AsapScheduler = AsapScheduler; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/timer", ["rxjs/Observable", "rxjs/observable/timer"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var timer_1 = require("rxjs/observable/timer"); + Observable_1.Observable.timer = timer_1.TimerObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/zip-static", ["rxjs/Observable", "rxjs/operator/zip-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var zip_static_1 = require("rxjs/operator/zip-static"); + Observable_1.Observable.zip = zip_static_1.zip; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/concatMap", ["rxjs/Observable", "rxjs/operator/concatMap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var concatMap_1 = require("rxjs/operator/concatMap"); + Observable_1.Observable.prototype.concatMap = concatMap_1.concatMap; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/concatMapTo", ["rxjs/Observable", "rxjs/operator/concatMapTo"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var concatMapTo_1 = require("rxjs/operator/concatMapTo"); + Observable_1.Observable.prototype.concatMapTo = concatMapTo_1.concatMapTo; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/expand", ["rxjs/Observable", "rxjs/operator/expand"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var expand_1 = require("rxjs/operator/expand"); + Observable_1.Observable.prototype.expand = expand_1.expand; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/first", ["rxjs/Observable", "rxjs/operator/first"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var first_1 = require("rxjs/operator/first"); + Observable_1.Observable.prototype.first = first_1.first; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/groupBy", ["rxjs/Subscriber", "rxjs/Observable", "rxjs/Subject", "rxjs/util/Map", "rxjs/util/FastMap", "rxjs/operator/groupBy-support", "rxjs/util/tryCatch", "rxjs/util/errorObject"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Subscriber_1 = require("rxjs/Subscriber"); + var Observable_1 = require("rxjs/Observable"); + var Subject_1 = require("rxjs/Subject"); + var Map_1 = require("rxjs/util/Map"); + var FastMap_1 = require("rxjs/util/FastMap"); + var groupBy_support_1 = require("rxjs/operator/groupBy-support"); + var tryCatch_1 = require("rxjs/util/tryCatch"); + var errorObject_1 = require("rxjs/util/errorObject"); + function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); + } + exports.groupBy = groupBy; + var GroupByObservable = (function(_super) { + __extends(GroupByObservable, _super); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _super.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function(subscriber) { + var refCountSubscription = new groupBy_support_1.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; + })(Observable_1.Observable); + exports.GroupByObservable = GroupByObservable; + var GroupBySubscriber = (function(_super) { + __extends(GroupBySubscriber, _super); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _super.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(x) { + var key = tryCatch_1.tryCatch(this.keySelector)(x); + if (key === errorObject_1.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 FastMap_1.FastMap() : new Map_1.Map(); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new Subject_1.Subject()); + var groupedObservable = new groupBy_support_1.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = tryCatch_1.tryCatch(durationSelector)(new groupBy_support_1.GroupedObservable(key, group)); + if (duration === errorObject_1.errorObject) { + this.error(duration.e); + } else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = tryCatch_1.tryCatch(elementSelector)(x); + if (value === errorObject_1.errorObject) { + this.error(value.e); + } else { + group.next(value); + } + } else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function(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() { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function(group, key) { + group.complete(); + _this.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function(key) { + this.groups.delete(key); + }; + return GroupBySubscriber; + })(Subscriber_1.Subscriber); + var GroupDurationSubscriber = (function(_super) { + __extends(GroupDurationSubscriber, _super); + function GroupDurationSubscriber(key, group, parent) { + _super.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function(value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function(err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function() { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; + })(Subscriber_1.Subscriber); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/multicast", ["rxjs/Observable", "rxjs/operator/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var multicast_1 = require("rxjs/operator/multicast"); + Observable_1.Observable.prototype.multicast = multicast_1.multicast; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/partition", ["rxjs/Observable", "rxjs/operator/partition"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var partition_1 = require("rxjs/operator/partition"); + Observable_1.Observable.prototype.partition = partition_1.partition; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/publishBehavior", ["rxjs/subject/BehaviorSubject", "rxjs/operator/multicast"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var BehaviorSubject_1 = require("rxjs/subject/BehaviorSubject"); + var multicast_1 = require("rxjs/operator/multicast"); + function publishBehavior(value) { + return multicast_1.multicast.call(this, new BehaviorSubject_1.BehaviorSubject(value)); + } + exports.publishBehavior = publishBehavior; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/publishReplay", ["rxjs/Observable", "rxjs/operator/publishReplay"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var publishReplay_1 = require("rxjs/operator/publishReplay"); + Observable_1.Observable.prototype.publishReplay = publishReplay_1.publishReplay; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/reduce", ["rxjs/Observable", "rxjs/operator/reduce"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var reduce_1 = require("rxjs/operator/reduce"); + Observable_1.Observable.prototype.reduce = reduce_1.reduce; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/subscribeOn", ["rxjs/Observable", "rxjs/operator/subscribeOn"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var subscribeOn_1 = require("rxjs/operator/subscribeOn"); + Observable_1.Observable.prototype.subscribeOn = subscribeOn_1.subscribeOn; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/take", ["rxjs/Observable", "rxjs/operator/take"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var take_1 = require("rxjs/operator/take"); + Observable_1.Observable.prototype.take = take_1.take; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/Subscriber", ["rxjs/util/noop", "rxjs/util/throwError", "rxjs/util/tryOrOnError", "rxjs/Subscription", "rxjs/symbol/rxSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var noop_1 = require("rxjs/util/noop"); + var throwError_1 = require("rxjs/util/throwError"); + var tryOrOnError_1 = require("rxjs/util/tryOrOnError"); + var Subscription_1 = require("rxjs/Subscription"); + var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); + var Subscriber = (function(_super) { + __extends(Subscriber, _super); + function Subscriber(destination) { + _super.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.prototype[rxSubscriber_1.rxSubscriber] = function() { + return this; + }; + Object.defineProperty(Subscriber.prototype, "isUnsubscribed", { + get: function() { + var subscription = this._subscription; + if (subscription) { + return this._isUnsubscribed || subscription.isUnsubscribed; + } else { + return this._isUnsubscribed; + } + }, + set: function(value) { + var subscription = this._subscription; + if (subscription) { + subscription.isUnsubscribed = Boolean(value); + } else { + this._isUnsubscribed = Boolean(value); + } + }, + enumerable: true, + configurable: true + }); + Subscriber.create = function(next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = (typeof next === 'function') && tryOrOnError_1.tryOrOnError(next) || noop_1.noop; + subscriber._error = (typeof error === 'function') && error || throwError_1.throwError; + subscriber._complete = (typeof complete === 'function') && complete || noop_1.noop; + return subscriber; + }; + Subscriber.prototype.add = function(sub) { + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } else { + _super.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function(sub) { + if (this._subscription) { + this._subscription.remove(sub); + } else { + _super.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function() { + if (this._isUnsubscribed) { + return ; + } else if (this._subscription) { + this._isUnsubscribed = true; + } else { + _super.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function(value) { + var destination = this.destination; + if (destination.next) { + destination.next(value); + } + }; + Subscriber.prototype._error = function(err) { + var destination = this.destination; + if (destination.error) { + destination.error(err); + } + }; + Subscriber.prototype._complete = function() { + var destination = this.destination; + if (destination.complete) { + destination.complete(); + } + }; + Subscriber.prototype.next = function(value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function(err) { + if (!this.isUnsubscribed) { + this._error(err); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function() { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + return Subscriber; + })(Subscription_1.Subscription); + exports.Subscriber = Subscriber; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/fromArray", ["rxjs/Observable", "rxjs/observable/ScalarObservable", "rxjs/observable/empty", "rxjs/util/isScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var ScalarObservable_1 = require("rxjs/observable/ScalarObservable"); + var empty_1 = require("rxjs/observable/empty"); + var isScheduler_1 = require("rxjs/util/isScheduler"); + var ArrayObservable = (function(_super) { + __extends(ArrayObservable, _super); + function ArrayObservable(array, scheduler) { + _super.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function(array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function() { + var array = []; + for (var _i = 0; _i < arguments.length; _i++) { + array[_i - 0] = arguments[_i]; + } + var scheduler = array[array.length - 1]; + if (isScheduler_1.isScheduler(scheduler)) { + array.pop(); + } else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } else if (len === 1) { + return new ScalarObservable_1.ScalarObservable(array[0], scheduler); + } else { + return new empty_1.EmptyObservable(scheduler); + } + }; + ArrayObservable.dispatch = function(state) { + var array = state.array, + index = state.index, + count = state.count, + 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(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; + })(Observable_1.Observable); + exports.ArrayObservable = ArrayObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/concat-static", ["rxjs/scheduler/queue", "rxjs/operator/mergeAll-support", "rxjs/observable/fromArray", "rxjs/util/isScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var queue_1 = require("rxjs/scheduler/queue"); + var mergeAll_support_1 = require("rxjs/operator/mergeAll-support"); + var fromArray_1 = require("rxjs/observable/fromArray"); + var isScheduler_1 = require("rxjs/util/isScheduler"); + function concat() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var scheduler = queue_1.queue; + var args = observables; + if (isScheduler_1.isScheduler(args[observables.length - 1])) { + scheduler = args.pop(); + } + return new fromArray_1.ArrayObservable(observables, scheduler).lift(new mergeAll_support_1.MergeAllOperator(1)); + } + exports.concat = concat; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/from", ["rxjs/Observable", "rxjs/observable/from"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var from_1 = require("rxjs/observable/from"); + Observable_1.Observable.from = from_1.FromObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/scheduler/asap", ["rxjs/scheduler/AsapScheduler"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var AsapScheduler_1 = require("rxjs/scheduler/AsapScheduler"); + exports.asap = new AsapScheduler_1.AsapScheduler(); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/groupBy", ["rxjs/Observable", "rxjs/operator/groupBy"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var groupBy_1 = require("rxjs/operator/groupBy"); + Observable_1.Observable.prototype.groupBy = groupBy_1.groupBy; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/publishBehavior", ["rxjs/Observable", "rxjs/operator/publishBehavior"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var publishBehavior_1 = require("rxjs/operator/publishBehavior"); + Observable_1.Observable.prototype.publishBehavior = publishBehavior_1.publishBehavior; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/Observable", ["rxjs/Subscriber", "rxjs/util/root", "rxjs/util/SymbolShim", "rxjs/symbol/rxSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Subscriber_1 = require("rxjs/Subscriber"); + var root_1 = require("rxjs/util/root"); + var SymbolShim_1 = require("rxjs/util/SymbolShim"); + var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); + var Observable = (function() { + function Observable(subscribe) { + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + Observable.prototype.lift = function(operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + Observable.prototype[SymbolShim_1.SymbolShim.observable] = function() { + return this; + }; + Observable.prototype.subscribe = function(observerOrNext, error, complete) { + var subscriber; + if (observerOrNext && typeof observerOrNext === 'object') { + if (observerOrNext instanceof Subscriber_1.Subscriber) { + subscriber = observerOrNext; + } else if (observerOrNext[rxSubscriber_1.rxSubscriber]) { + subscriber = observerOrNext[rxSubscriber_1.rxSubscriber](); + } else { + subscriber = new Subscriber_1.Subscriber(observerOrNext); + } + } else { + var next = observerOrNext; + subscriber = Subscriber_1.Subscriber.create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + Observable.prototype.forEach = function(next, thisArg, PromiseCtor) { + if (!PromiseCtor) { + if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { + PromiseCtor = root_1.root.Rx.config.Promise; + } else if (root_1.root.Promise) { + PromiseCtor = root_1.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + var nextHandler; + if (thisArg) { + nextHandler = function nextHandlerFn(value) { + var _a = nextHandlerFn, + thisArg = _a.thisArg, + next = _a.next; + return next.call(thisArg, value); + }; + nextHandler.thisArg = thisArg; + nextHandler.next = next; + } else { + nextHandler = next; + } + var promiseCallback = function promiseCallbackFn(resolve, reject) { + var _a = promiseCallbackFn, + source = _a.source, + nextHandler = _a.nextHandler; + source.subscribe(nextHandler, reject, resolve); + }; + promiseCallback.source = this; + promiseCallback.nextHandler = nextHandler; + return new PromiseCtor(promiseCallback); + }; + Observable.prototype._subscribe = function(subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + Observable.create = function(subscribe) { + return new Observable(subscribe); + }; + return Observable; + })(); + exports.Observable = Observable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/operator/combineLatest-static", ["rxjs/observable/fromArray", "rxjs/operator/combineLatest-support", "rxjs/util/isScheduler", "rxjs/util/isArray"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var fromArray_1 = require("rxjs/observable/fromArray"); + var combineLatest_support_1 = require("rxjs/operator/combineLatest-support"); + var isScheduler_1 = require("rxjs/util/isScheduler"); + var isArray_1 = require("rxjs/util/isArray"); + function combineLatest() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = null; + var scheduler = null; + if (isScheduler_1.isScheduler(observables[observables.length - 1])) { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + if (observables.length === 1 && isArray_1.isArray(observables[0])) { + observables = observables[0]; + } + return new fromArray_1.ArrayObservable(observables, scheduler).lift(new combineLatest_support_1.CombineLatestOperator(project)); + } + exports.combineLatest = combineLatest; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/concat-static", ["rxjs/Observable", "rxjs/operator/concat-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var concat_static_1 = require("rxjs/operator/concat-static"); + Observable_1.Observable.concat = concat_static_1.concat; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/observable/interval", ["rxjs/util/isNumeric", "rxjs/Observable", "rxjs/scheduler/asap"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var isNumeric_1 = require("rxjs/util/isNumeric"); + var Observable_1 = require("rxjs/Observable"); + var asap_1 = require("rxjs/scheduler/asap"); + var IntervalObservable = (function(_super) { + __extends(IntervalObservable, _super); + function IntervalObservable(period, scheduler) { + if (period === void 0) { + period = 0; + } + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + _super.call(this); + this.period = period; + this.scheduler = scheduler; + if (!isNumeric_1.isNumeric(period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = asap_1.asap; + } + } + IntervalObservable.create = function(period, scheduler) { + if (period === void 0) { + period = 0; + } + if (scheduler === void 0) { + scheduler = asap_1.asap; + } + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function(state) { + var index = state.index, + subscriber = state.subscriber, + period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return ; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function(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; + })(Observable_1.Observable); + exports.IntervalObservable = IntervalObservable; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/Subject", ["rxjs/Observable", "rxjs/Subscriber", "rxjs/Subscription", "rxjs/subject/SubjectSubscription", "rxjs/symbol/rxSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var __extends = (this && this.__extends) || function(d, b) { + for (var p in b) + if (b.hasOwnProperty(p)) + d[p] = b[p]; + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + var Observable_1 = require("rxjs/Observable"); + var Subscriber_1 = require("rxjs/Subscriber"); + var Subscription_1 = require("rxjs/Subscription"); + var SubjectSubscription_1 = require("rxjs/subject/SubjectSubscription"); + var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); + var subscriptionAdd = Subscription_1.Subscription.prototype.add; + var subscriptionRemove = Subscription_1.Subscription.prototype.remove; + var subscriptionUnsubscribe = Subscription_1.Subscription.prototype.unsubscribe; + var subscriberNext = Subscriber_1.Subscriber.prototype.next; + var subscriberError = Subscriber_1.Subscriber.prototype.error; + var subscriberComplete = Subscriber_1.Subscriber.prototype.complete; + var _subscriberNext = Subscriber_1.Subscriber.prototype._next; + var _subscriberError = Subscriber_1.Subscriber.prototype._error; + var _subscriberComplete = Subscriber_1.Subscriber.prototype._complete; + var Subject = (function(_super) { + __extends(Subject, _super); + function Subject() { + _super.apply(this, arguments); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.prototype[rxSubscriber_1.rxSubscriber] = function() { + return this; + }; + Subject.create = function(source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function(operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function(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 SubjectSubscription_1.SubjectSubscription(this, subscriber); + }; + Subject.prototype.add = function(subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function(subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function() { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function(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(err) { + if (this.isUnsubscribed || this.completeSignal) { + return ; + } + this.errorSignal = true; + this.errorInstance = err; + if (this.dispatching) { + return ; + } + this._error(err); + this.unsubscribe(); + }; + Subject.prototype.complete = function() { + if (this.isUnsubscribed || this.errorSignal) { + return ; + } + this.completeSignal = true; + if (this.dispatching) { + return ; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function(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(err) { + var index = -1; + var observers = this.observers; + var len = observers.length; + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(err); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function() { + 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; + })(Observable_1.Observable); + exports.Subject = Subject; + var BidirectionalSubject = (function(_super) { + __extends(BidirectionalSubject, _super); + function BidirectionalSubject(source, destination) { + _super.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function(subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function(value) { + subscriberNext.call(this, value); + }; + BidirectionalSubject.prototype.error = function(err) { + subscriberError.call(this, err); + }; + BidirectionalSubject.prototype.complete = function() { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function(value) { + _subscriberNext.call(this, value); + }; + BidirectionalSubject.prototype._error = function(err) { + _subscriberError.call(this, err); + }; + BidirectionalSubject.prototype._complete = function() { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; + })(Subject); + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/operator/combineLatest-static", ["rxjs/Observable", "rxjs/operator/combineLatest-static"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var combineLatest_static_1 = require("rxjs/operator/combineLatest-static"); + Observable_1.Observable.combineLatest = combineLatest_static_1.combineLatest; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/add/observable/interval", ["rxjs/Observable", "rxjs/observable/interval"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Observable_1 = require("rxjs/Observable"); + var interval_1 = require("rxjs/observable/interval"); + Observable_1.Observable.interval = interval_1.IntervalObservable.create; + global.define = __define; + return module.exports; +}); + +System.register("rxjs/Rx", ["rxjs/Subject", "rxjs/Observable", "rxjs/add/operator/combineLatest-static", "rxjs/add/operator/concat-static", "rxjs/add/operator/merge-static", "rxjs/add/observable/bindCallback", "rxjs/add/observable/defer", "rxjs/add/observable/empty", "rxjs/add/observable/forkJoin", "rxjs/add/observable/from", "rxjs/add/observable/fromArray", "rxjs/add/observable/fromEvent", "rxjs/add/observable/fromEventPattern", "rxjs/add/observable/fromPromise", "rxjs/add/observable/interval", "rxjs/add/observable/never", "rxjs/add/observable/range", "rxjs/add/observable/throw", "rxjs/add/observable/timer", "rxjs/add/operator/zip-static", "rxjs/add/operator/buffer", "rxjs/add/operator/bufferCount", "rxjs/add/operator/bufferTime", "rxjs/add/operator/bufferToggle", "rxjs/add/operator/bufferWhen", "rxjs/add/operator/catch", "rxjs/add/operator/combineAll", "rxjs/add/operator/combineLatest", "rxjs/add/operator/concat", "rxjs/add/operator/concatAll", "rxjs/add/operator/concatMap", "rxjs/add/operator/concatMapTo", "rxjs/add/operator/count", "rxjs/add/operator/dematerialize", "rxjs/add/operator/debounce", "rxjs/add/operator/debounceTime", "rxjs/add/operator/defaultIfEmpty", "rxjs/add/operator/delay", "rxjs/add/operator/distinctUntilChanged", "rxjs/add/operator/do", "rxjs/add/operator/expand", "rxjs/add/operator/filter", "rxjs/add/operator/finally", "rxjs/add/operator/first", "rxjs/add/operator/groupBy", "rxjs/add/operator/ignoreElements", "rxjs/add/operator/every", "rxjs/add/operator/last", "rxjs/add/operator/map", "rxjs/add/operator/mapTo", "rxjs/add/operator/materialize", "rxjs/add/operator/merge", "rxjs/add/operator/mergeAll", "rxjs/add/operator/mergeMap", "rxjs/add/operator/mergeMapTo", "rxjs/add/operator/multicast", "rxjs/add/operator/observeOn", "rxjs/add/operator/partition", "rxjs/add/operator/publish", "rxjs/add/operator/publishBehavior", "rxjs/add/operator/publishReplay", "rxjs/add/operator/publishLast", "rxjs/add/operator/reduce", "rxjs/add/operator/repeat", "rxjs/add/operator/retry", "rxjs/add/operator/retryWhen", "rxjs/add/operator/sample", "rxjs/add/operator/sampleTime", "rxjs/add/operator/scan", "rxjs/add/operator/share", "rxjs/add/operator/single", "rxjs/add/operator/skip", "rxjs/add/operator/skipUntil", "rxjs/add/operator/skipWhile", "rxjs/add/operator/startWith", "rxjs/add/operator/subscribeOn", "rxjs/add/operator/switch", "rxjs/add/operator/switchMap", "rxjs/add/operator/switchMapTo", "rxjs/add/operator/take", "rxjs/add/operator/takeUntil", "rxjs/add/operator/takeWhile", "rxjs/add/operator/throttle", "rxjs/add/operator/throttleTime", "rxjs/add/operator/timeout", "rxjs/add/operator/timeoutWith", "rxjs/add/operator/toArray", "rxjs/add/operator/toPromise", "rxjs/add/operator/window", "rxjs/add/operator/windowCount", "rxjs/add/operator/windowTime", "rxjs/add/operator/windowToggle", "rxjs/add/operator/windowWhen", "rxjs/add/operator/withLatestFrom", "rxjs/add/operator/zip", "rxjs/add/operator/zipAll", "rxjs/Subscription", "rxjs/Subscriber", "rxjs/subject/AsyncSubject", "rxjs/subject/ReplaySubject", "rxjs/subject/BehaviorSubject", "rxjs/observable/ConnectableObservable", "rxjs/Notification", "rxjs/util/EmptyError", "rxjs/util/ArgumentOutOfRangeError", "rxjs/util/ObjectUnsubscribedError", "rxjs/scheduler/asap", "rxjs/scheduler/queue", "rxjs/symbol/rxSubscriber"], true, function(require, exports, module) { + var global = System.global, + __define = global.define; + global.define = undefined; + var Subject_1 = require("rxjs/Subject"); + exports.Subject = Subject_1.Subject; + var Observable_1 = require("rxjs/Observable"); + exports.Observable = Observable_1.Observable; + require("rxjs/add/operator/combineLatest-static"); + require("rxjs/add/operator/concat-static"); + require("rxjs/add/operator/merge-static"); + require("rxjs/add/observable/bindCallback"); + require("rxjs/add/observable/defer"); + require("rxjs/add/observable/empty"); + require("rxjs/add/observable/forkJoin"); + require("rxjs/add/observable/from"); + require("rxjs/add/observable/fromArray"); + require("rxjs/add/observable/fromEvent"); + require("rxjs/add/observable/fromEventPattern"); + require("rxjs/add/observable/fromPromise"); + require("rxjs/add/observable/interval"); + require("rxjs/add/observable/never"); + require("rxjs/add/observable/range"); + require("rxjs/add/observable/throw"); + require("rxjs/add/observable/timer"); + require("rxjs/add/operator/zip-static"); + require("rxjs/add/operator/buffer"); + require("rxjs/add/operator/bufferCount"); + require("rxjs/add/operator/bufferTime"); + require("rxjs/add/operator/bufferToggle"); + require("rxjs/add/operator/bufferWhen"); + require("rxjs/add/operator/catch"); + require("rxjs/add/operator/combineAll"); + require("rxjs/add/operator/combineLatest"); + require("rxjs/add/operator/concat"); + require("rxjs/add/operator/concatAll"); + require("rxjs/add/operator/concatMap"); + require("rxjs/add/operator/concatMapTo"); + require("rxjs/add/operator/count"); + require("rxjs/add/operator/dematerialize"); + require("rxjs/add/operator/debounce"); + require("rxjs/add/operator/debounceTime"); + require("rxjs/add/operator/defaultIfEmpty"); + require("rxjs/add/operator/delay"); + require("rxjs/add/operator/distinctUntilChanged"); + require("rxjs/add/operator/do"); + require("rxjs/add/operator/expand"); + require("rxjs/add/operator/filter"); + require("rxjs/add/operator/finally"); + require("rxjs/add/operator/first"); + require("rxjs/add/operator/groupBy"); + require("rxjs/add/operator/ignoreElements"); + require("rxjs/add/operator/every"); + require("rxjs/add/operator/last"); + require("rxjs/add/operator/map"); + require("rxjs/add/operator/mapTo"); + require("rxjs/add/operator/materialize"); + require("rxjs/add/operator/merge"); + require("rxjs/add/operator/mergeAll"); + require("rxjs/add/operator/mergeMap"); + require("rxjs/add/operator/mergeMapTo"); + require("rxjs/add/operator/multicast"); + require("rxjs/add/operator/observeOn"); + require("rxjs/add/operator/partition"); + require("rxjs/add/operator/publish"); + require("rxjs/add/operator/publishBehavior"); + require("rxjs/add/operator/publishReplay"); + require("rxjs/add/operator/publishLast"); + require("rxjs/add/operator/reduce"); + require("rxjs/add/operator/repeat"); + require("rxjs/add/operator/retry"); + require("rxjs/add/operator/retryWhen"); + require("rxjs/add/operator/sample"); + require("rxjs/add/operator/sampleTime"); + require("rxjs/add/operator/scan"); + require("rxjs/add/operator/share"); + require("rxjs/add/operator/single"); + require("rxjs/add/operator/skip"); + require("rxjs/add/operator/skipUntil"); + require("rxjs/add/operator/skipWhile"); + require("rxjs/add/operator/startWith"); + require("rxjs/add/operator/subscribeOn"); + require("rxjs/add/operator/switch"); + require("rxjs/add/operator/switchMap"); + require("rxjs/add/operator/switchMapTo"); + require("rxjs/add/operator/take"); + require("rxjs/add/operator/takeUntil"); + require("rxjs/add/operator/takeWhile"); + require("rxjs/add/operator/throttle"); + require("rxjs/add/operator/throttleTime"); + require("rxjs/add/operator/timeout"); + require("rxjs/add/operator/timeoutWith"); + require("rxjs/add/operator/toArray"); + require("rxjs/add/operator/toPromise"); + require("rxjs/add/operator/window"); + require("rxjs/add/operator/windowCount"); + require("rxjs/add/operator/windowTime"); + require("rxjs/add/operator/windowToggle"); + require("rxjs/add/operator/windowWhen"); + require("rxjs/add/operator/withLatestFrom"); + require("rxjs/add/operator/zip"); + require("rxjs/add/operator/zipAll"); + var Subscription_1 = require("rxjs/Subscription"); + exports.Subscription = Subscription_1.Subscription; + var Subscriber_1 = require("rxjs/Subscriber"); + exports.Subscriber = Subscriber_1.Subscriber; + var AsyncSubject_1 = require("rxjs/subject/AsyncSubject"); + exports.AsyncSubject = AsyncSubject_1.AsyncSubject; + var ReplaySubject_1 = require("rxjs/subject/ReplaySubject"); + exports.ReplaySubject = ReplaySubject_1.ReplaySubject; + var BehaviorSubject_1 = require("rxjs/subject/BehaviorSubject"); + exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject; + var ConnectableObservable_1 = require("rxjs/observable/ConnectableObservable"); + exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable; + var Notification_1 = require("rxjs/Notification"); + exports.Notification = Notification_1.Notification; + var EmptyError_1 = require("rxjs/util/EmptyError"); + exports.EmptyError = EmptyError_1.EmptyError; + var ArgumentOutOfRangeError_1 = require("rxjs/util/ArgumentOutOfRangeError"); + exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; + var ObjectUnsubscribedError_1 = require("rxjs/util/ObjectUnsubscribedError"); + exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError; + var asap_1 = require("rxjs/scheduler/asap"); + var queue_1 = require("rxjs/scheduler/queue"); + var rxSubscriber_1 = require("rxjs/symbol/rxSubscriber"); + var Scheduler = { + asap: asap_1.asap, + queue: queue_1.queue + }; + exports.Scheduler = Scheduler; + var Symbol = {rxSubscriber: rxSubscriber_1.rxSubscriber}; + exports.Symbol = Symbol; + global.define = __define; + return module.exports; +}); diff --git a/2.0.0-alpha.55/Rx.min.js b/2.0.0-alpha.55/Rx.min.js new file mode 100644 index 000000000..9ce41538e --- /dev/null +++ b/2.0.0-alpha.55/Rx.min.js @@ -0,0 +1,211 @@ +/** + 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. +**/ +"format register";System.register("rxjs/util/noop",[],!0,function(require,e,t){function r(){}var i=System.global,s=i.define;return i.define=void 0,e.noop=r,i.define=s,t.exports}),System.register("rxjs/util/throwError",[],!0,function(require,e,t){function r(e){throw e}var i=System.global,s=i.define;return i.define=void 0,e.throwError=r,i.define=s,t.exports}),System.register("rxjs/util/tryOrOnError",[],!0,function(require,e,t){function r(e){function t(){try{t.target.apply(this,arguments)}catch(e){this.error(e)}}return t.target=e,t}var i=System.global,s=i.define;return i.define=void 0,e.tryOrOnError=r,i.define=s,t.exports}),System.register("rxjs/Subscription",["rxjs/util/noop"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/util/noop"),o=function(){function e(e){this.isUnsubscribed=!1,e&&(this._unsubscribe=e)}return e.prototype._unsubscribe=function(){s.noop()},e.prototype.unsubscribe=function(){if(!this.isUnsubscribed){this.isUnsubscribed=!0;var e=this._unsubscribe,t=this._subscriptions;if(this._subscriptions=void 0,e&&e.call(this),null!=t)for(var r=-1,i=t.length;++r0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(o.OuterSubscriber);return e.MergeAllSubscriber=u,r.define=i,t.exports}),System.register("rxjs/operator/merge-static",["rxjs/observable/fromArray","rxjs/operator/mergeAll-support","rxjs/scheduler/queue","rxjs/util/isScheduler"],!0,function(require,e,t){function r(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof s&&(r=e.pop()),1===e.length?e[0]:new o.ArrayObservable(e,i).lift(new n.MergeAllOperator(r))}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/observable/fromArray"),n=require("rxjs/operator/mergeAll-support"),a=require("rxjs/scheduler/queue"),u=require("rxjs/util/isScheduler");return e.merge=r,i.define=s,t.exports}),System.register("rxjs/subject/AsyncSubject",["rxjs/Subject"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Subject"),n=function(e){function t(){e.call(this),this._value=void 0,this._hasNext=!1,this._isScalar=!1}return s(t,e),t.prototype._subscribe=function(t){return this.completeSignal&&this._hasNext&&t.next(this._value),e.prototype._subscribe.call(this,t)},t.prototype._next=function(e){this._value=e,this._hasNext=!0},t.prototype._complete=function(){var e=-1,t=this.observers,r=t.length;if(this.observers=void 0,this.isUnsubscribed=!0,this._hasNext)for(;++e=t?0:t>x?x:t):t}function s(e){return"number"==typeof e&&l.root.isFinite(e)}function o(e){var t=+e;return 0===t?t:isNaN(t)?t:0>t?-1:1}var n=System.global,a=n.define;n.define=void 0;var u=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=require("rxjs/Observable"),l=require("rxjs/util/root"),p=require("rxjs/util/SymbolShim"),b=require("rxjs/util/tryCatch"),h=require("rxjs/util/errorObject"),f=function(e){function t(t,i,s,o){if(e.call(this),this.project=i,this.thisArg=s,this.scheduler=o,null==t)throw new Error("iterator cannot be null.");if(i&&"function"!=typeof i)throw new Error("When provided, `project` must be a function.");this.iterator=r(t)}return u(t,e),t.create=function(e,r,i,s){return new t(e,r,i,s)},t.dispatch=function(e){var t=e.index,r=e.hasError,i=e.thisArg,s=e.project,o=e.iterator,n=e.subscriber;if(r)return void n.error(e.error);var a=o.next();return a.done?void n.complete():(s?(a=b.tryCatch(s).call(i,a.value,t),a===h.errorObject?(e.error=h.errorObject.e,e.hasError=!0):(n.next(a),e.index=t+1)):(n.next(a.value),e.index=t+1),void(n.isUnsubscribed||this.schedule(e)))},t.prototype._subscribe=function(e){var r=0,i=this,s=i.iterator,o=i.project,n=i.thisArg,a=i.scheduler;if(a)e.add(a.schedule(t.dispatch,0,{index:r,thisArg:n,project:o,iterator:s,subscriber:e}));else for(;;){var u=s.next();if(u.done){e.complete();break}if(o){if(u=b.tryCatch(o).call(n,u.value,r++),u===h.errorObject){e.error(h.errorObject.e);break}e.next(u)}else e.next(u.value);if(e.isUnsubscribed)break}},t}(c.Observable);e.IteratorObservable=f;var d=function(){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=e.length),this.str=e,this.idx=t,this.len=r}return e.prototype[p.SymbolShim.iterator]=function(){return this},e.prototype.next=function(){return this.idxa;a++)t.setupSubscription(e[a],r,i,s);else"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener?(e.addEventListener(r,i),o=function(){return e.removeEventListener(r,i)}):"function"==typeof e.on&&"function"==typeof e.off?(e.on(r,i),o=function(){return e.off(r,i)}):"function"==typeof e.addListener&&"function"==typeof e.removeListener&&(e.addListener(r,i),o=function(){return e.removeListener(r,i)});s.add(new u.Subscription(o))},t.prototype._subscribe=function(e){var r=this.sourceObj,i=this.eventName,s=this.selector,o=s?function(t){var r=n.tryCatch(s)(t);r===a.errorObject?e.error(r.e):e.next(r)}:function(t){return e.next(t)};t.setupSubscription(r,i,o,e)},t}(o.Observable);return e.FromEventObservable=c,r.define=i,t.exports}),System.register("rxjs/observable/fromEventPattern",["rxjs/Observable","rxjs/Subscription","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Observable"),n=require("rxjs/Subscription"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject"),c=function(e){function t(t,r,i){e.call(this),this.addHandler=t,this.removeHandler=r,this.selector=i}return s(t,e),t.create=function(e,r,i){return new t(e,r,i)},t.prototype._subscribe=function(e){var t=this.addHandler,r=this.removeHandler,i=this.selector,s=i?function(t){var r=a.tryCatch(i).apply(null,arguments);r===u.errorObject?e.error(r.e):e.next(r)}:function(t){e.next(t)},o=a.tryCatch(t)(s);o===u.errorObject&&e.error(o.e),e.add(new n.Subscription(function(){r(s)}))},t}(o.Observable);return e.FromEventPatternObservable=c,r.define=i,t.exports}),System.register("rxjs/add/observable/fromPromise",["rxjs/Observable","rxjs/observable/fromPromise"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/fromPromise");return s.Observable.fromPromise=o.PromiseObservable.create,r.define=i,t.exports}),System.register("rxjs/util/isNumeric",[],!0,function(require,e,t){function r(e){return!o(e)&&e-parseFloat(e)+1>=0}var i=System.global,s=i.define;i.define=void 0;var o=Array.isArray;return e.isNumeric=r,i.define=s,t.exports}),System.register("rxjs/util/Immediate",["rxjs/util/root"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/util/root"),o=function(){function e(e){if(this.root=e,e.setImmediate)this.setImmediate=e.setImmediate,this.clearImmediate=e.clearImmediate;else{this.nextHandle=1,this.tasksByHandle={},this.currentlyRunningATask=!1,this.canUseProcessNextTick()?this.setImmediate=this.createProcessNextTickSetImmediate():this.canUsePostMessage()?this.setImmediate=this.createPostMessageSetImmediate():this.canUseMessageChannel()?this.setImmediate=this.createMessageChannelSetImmediate():this.canUseReadyStateChange()?this.setImmediate=this.createReadyStateChangeSetImmediate():this.setImmediate=this.createSetTimeoutSetImmediate();var t=function r(e){delete r.instance.tasksByHandle[e]};t.instance=this,this.clearImmediate=t}}return e.prototype.identify=function(e){return this.root.Object.prototype.toString.call(e)},e.prototype.canUseProcessNextTick=function(){return"[object process]"===this.identify(this.root.process)},e.prototype.canUseMessageChannel=function(){return Boolean(this.root.MessageChannel)},e.prototype.canUseReadyStateChange=function(){var e=this.root.document;return Boolean(e&&"onreadystatechange"in e.createElement("script"))},e.prototype.canUsePostMessage=function(){var e=this.root;if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}return!1},e.prototype.partiallyApplied=function(e){for(var t=[],r=1;r=i?void s.complete():(s.next(t),void(s.isUnsubscribed||(e.index=r+1,e.start=t+1,this.schedule(e))))},t.prototype._subscribe=function(e){var r=0,i=this.start,s=this.end,o=this.scheduler;if(o)e.add(o.schedule(t.dispatch,0,{index:r,end:s,start:i,subscriber:e}));else for(;;){if(r++>=s){e.complete();break}if(e.next(i++),e.isUnsubscribed)break}},t}(o.Observable);return e.RangeObservable=n,r.define=i,t.exports}),System.register("rxjs/add/observable/throw",["rxjs/Observable","rxjs/observable/throw"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/throw");return s.Observable["throw"]=o.ErrorObservable.create,r.define=i,t.exports}),System.register("rxjs/util/isDate",[],!0,function(require,e,t){function r(e){return e instanceof Date&&!isNaN(+e)}var i=System.global,s=i.define;return i.define=void 0,e.isDate=r,i.define=s,t.exports}),System.register("rxjs/operator/zip-support",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult","rxjs/util/SymbolShim"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Subscriber"),n=require("rxjs/util/tryCatch"),a=require("rxjs/util/errorObject"),u=require("rxjs/OuterSubscriber"),c=require("rxjs/util/subscribeToResult"),l=require("rxjs/util/SymbolShim"),p=Array.isArray,b=function(){function e(e){this.project=e}return e.prototype.call=function(e){return new h(e,this.project)},e}();e.ZipOperator=b;var h=function(e){function t(t,r,i){void 0===i&&(i=Object.create(null)),e.call(this,t),this.index=0,this.iterators=[],this.active=0,this.project="function"==typeof r?r:null,this.values=i}return s(t,e),t.prototype._next=function(e){var t=this.iterators,r=this.index++;p(e)?t.push(new d(e)):"function"==typeof e[l.SymbolShim.iterator]?t.push(new f(e[l.SymbolShim.iterator]())):t.push(new v(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 i=e[r];i.stillUnsubscribed?i.subscribe(i,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,i=0;t>i;i++){var s=e[i];if("function"==typeof s.hasValue&&!s.hasValue())return}for(var o=!1,u=[],i=0;t>i;i++){var s=e[i],c=s.next();if(s.hasCompleted()&&(o=!0),c.done)return void r.complete();u.push(c.value)}var l=this.project;if(l){var c=n.tryCatch(l).apply(this,u);c===a.errorObject?r.error(a.errorObject.e):r.next(c)}else r.next(u);o&&r.complete()},t}(o.Subscriber);e.ZipSubscriber=h;var f=function(){function e(e){this.iterator=e,this.nextResult=e.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}(),d=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.SymbolShim.iterator]=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}(),v=function(e){function t(t,r,i,s){e.call(this,t),this.parent=r,this.observable=i,this.index=s,this.stillUnsubscribed=!0,this.buffer=[],this.isComplete=!1}return s(t,e),t.prototype[l.SymbolShim.iterator]=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,i){this.buffer.push(t),this.parent.checkIterators()},t.prototype.subscribe=function(e,t){this.add(c.subscribeToResult(this,this.observable,this,t))},t}(u.OuterSubscriber);return r.define=i,t.exports}),System.register("rxjs/operator/buffer",["rxjs/Subscriber"],!0,function(require,e,t){function r(e){return this.lift(new a(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.buffer=r;var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e){return new u(e,this.closingNotifier); +},e}(),u=function(e){function t(t,r){e.call(this,t),this.buffer=[],this.notifierSubscriber=null,this.notifierSubscriber=new c(this),this.add(r._subscribe(this.notifierSubscriber))}return o(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}(n.Subscriber),c=function(e){function t(t){e.call(this,null),this.parent=t}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/bufferCount",["rxjs/Subscriber"],!0,function(require,e,t){function r(e,t){return void 0===t&&(t=null),this.lift(new a(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.bufferCount=r;var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t}return e.prototype.call=function(e){return new u(e,this.bufferSize,this.startBufferEvery)},e}(),u=function(e){function t(t,r,i){e.call(this,t),this.bufferSize=r,this.startBufferEvery=i,this.buffers=[[]],this.count=0}return o(t,e),t.prototype._next=function(e){var t=this.count+=1,r=this.destination,i=this.bufferSize,s=null==this.startBufferEvery?i:this.startBufferEvery,o=this.buffers,n=o.length,a=-1;t%s===0&&o.push([]);for(var u=0;n>u;u++){var c=o[u];c.push(e),c.length===i&&(a=u,r.next(c))}-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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/bufferTime",["rxjs/Subscriber","rxjs/scheduler/asap"],!0,function(require,e,t){function r(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=l.asap),this.lift(new p(e,t,r))}function i(e){var t=e.subscriber,r=e.buffer;r&&t.closeBuffer(r),e.buffer=t.openBuffer(),t.isUnsubscribed||this.schedule(e,e.bufferTimeSpan)}function s(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,i=e.subscriber,s=e.scheduler,n=i.openBuffer(),a=this;i.isUnsubscribed||(a.add(s.schedule(o,r,{subscriber:i,buffer:n})),a.schedule(e,t))}function o(e){var t=e.subscriber,r=e.buffer;t.closeBuffer(r)}var n=System.global,a=n.define;n.define=void 0;var u=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=require("rxjs/Subscriber"),l=require("rxjs/scheduler/asap");e.bufferTime=r;var p=function(){function e(e,t,r){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.scheduler=r}return e.prototype.call=function(e){return new b(e,this.bufferTimeSpan,this.bufferCreationInterval,this.scheduler)},e}(),b=function(e){function t(t,r,n,a){e.call(this,t),this.bufferTimeSpan=r,this.bufferCreationInterval=n,this.scheduler=a,this.buffers=[];var u=this.openBuffer();if(null!==n&&n>=0){var c={subscriber:this,buffer:u},l={bufferTimeSpan:r,bufferCreationInterval:n,subscriber:this,scheduler:a};this.add(a.schedule(o,r,c)),this.add(a.schedule(s,n,l))}else{var p={subscriber:this,buffer:u,bufferTimeSpan:r};this.add(a.schedule(i,r,p))}}return u(t,e),t.prototype._next=function(e){for(var t=this.buffers,r=t.length,i=0;r>i;i++)t[i].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}(c.Subscriber);return n.define=a,t.exports}),System.register("rxjs/operator/bufferToggle",["rxjs/Subscriber","rxjs/Subscription","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e,t){return this.lift(new l(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subscription"),u=require("rxjs/util/tryCatch"),c=require("rxjs/util/errorObject");e.bufferToggle=r;var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e){return new p(e,this.openings,this.closingSelector)},e}(),p=function(e){function t(t,r,i){e.call(this,t),this.openings=r,this.closingSelector=i,this.contexts=[],this.add(this.openings._subscribe(new b(this)))}return o(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,i=0;r>i;i++)t[i].buffer.push(e)},t.prototype._error=function(e){for(var t=this.contexts;t.length>0;){var r=t.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}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,t.subscription=null}this.contexts=null,this.destination.complete()},t.prototype.openBuffer=function(e){var t=this.closingSelector,r=this.contexts,i=u.tryCatch(t)(e);if(i===c.errorObject)this._error(i.e);else{var s={buffer:[],subscription:new a.Subscription};r.push(s);var o=new h(this,s),n=i._subscribe(o);s.subscription.add(n),this.add(n)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(null!==t){var r=e.buffer,i=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(i),i.unsubscribe()}},t}(n.Subscriber),b=function(e){function t(t){e.call(this,null),this.parent=t}return o(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}(n.Subscriber),h=function(e){function t(t,r){e.call(this,null),this.parent=t,this.context=r}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/bufferWhen",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new c(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.bufferWhen=r;var c=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e){return new l(e,this.closingSelector)},e}(),l=function(e){function t(t,r){e.call(this,t),this.closingSelector=r,this.openBuffer()}return o(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=a.tryCatch(this.closingSelector)();if(r===u.errorObject){var i=r.e;this.buffer=null,this.destination.error(i)}else this.add(this.closingNotification=r._subscribe(new p(this)))},t}(n.Subscriber),p=function(e){function t(t){e.call(this,null),this.parent=t}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/catch",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){var t=new c(e),r=this.lift(t);return t.caught=r,r}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e._catch=r;var c=function(){function e(e){this.selector=e}return e.prototype.call=function(e){return new l(e,this.selector,this.caught)},e}(),l=function(e){function t(t,r,i){e.call(this,null),this.destination=t,this.selector=r,this.caught=i,this.lastSubscription=this,this.destination.add(this)}return o(t,e),t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){var t=a.tryCatch(this.selector)(e,this.caught);t===u.errorObject?this.destination.error(u.errorObject.e):(this.lastSubscription.unsubscribe(),this.lastSubscription=t.subscribe(this.destination))},t.prototype._complete=function(){this.lastSubscription.unsubscribe(),this.destination.complete()},t.prototype._unsubscribe=function(){this.lastSubscription.unsubscribe()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/combineAll",["rxjs/operator/combineLatest-support"],!0,function(require,e,t){function r(e){return this.lift(new o.CombineLatestOperator(e))}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/operator/combineLatest-support");return e.combineAll=r,i.define=s,t.exports}),System.register("rxjs/operator/combineLatest",["rxjs/observable/fromArray","rxjs/operator/combineLatest-support","rxjs/util/isArray"],!0,function(require,e,t){function r(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(u.OuterSubscriber);return e.MergeMapSubscriber=l,r.define=i,t.exports}),System.register("rxjs/operator/mergeMapTo-support",["rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/util/tryCatch"),n=require("rxjs/util/errorObject"),a=require("rxjs/OuterSubscriber"),u=require("rxjs/util/subscribeToResult"),c=function(){function e(e,t,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.ish=e,this.resultSelector=t,this.concurrent=r}return e.prototype.call=function(e){return new l(e,this.ish,this.resultSelector,this.concurrent)},e}();e.MergeMapToOperator=c;var l=function(e){function t(t,r,i,s){void 0===s&&(s=Number.POSITIVE_INFINITY),e.call(this,t),this.ish=r,this.resultSelector=i,this.concurrent=s,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return s(t,e),t.prototype._next=function(e){if(this.active0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(a.OuterSubscriber);return e.MergeMapToSubscriber=l,r.define=i,t.exports}),System.register("rxjs/operator/count",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new c(e,this))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.count=r;var c=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e){return new l(e,this.predicate,this.source)},e}(),l=function(e){function t(t,r,i){e.call(this,t),this.predicate=r,this.source=i,this.count=0,this.index=0}return o(t,e),t.prototype._next=function(e){var t=this.predicate,r=!0;return t&&(r=a.tryCatch(t)(e,this.index++,this.source),r===u.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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/dematerialize",["rxjs/Subscriber"],!0,function(require,e,t){function r(){return this.lift(new a)}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.dematerialize=r;var a=function(){function e(){}return e.prototype.call=function(e){return new u(e)},e}(),u=function(e){function t(t){e.call(this,t)}return o(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/debounce",["rxjs/observable/fromPromise","rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/isPromise","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new p(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/observable/fromPromise"),a=require("rxjs/Subscriber"),u=require("rxjs/util/tryCatch"),c=require("rxjs/util/isPromise"),l=require("rxjs/util/errorObject");e.debounce=r;var p=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e){return new b(e,this.durationSelector)},e}(),b=function(e){function t(t,r){e.call(this,t),this.durationSelector=r,this.debouncedSubscription=null,this.lastValue=null,this._index=0}return o(t,e),Object.defineProperty(t.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),t.prototype._next=function(e){var t=this.destination,r=++this._index,i=u.tryCatch(this.durationSelector)(e);i===l.errorObject?t.error(l.errorObject.e):(c.isPromise(i)&&(i=n.PromiseObservable.create(i)),this.lastValue=e,this.clearDebounce(),this.add(this.debouncedSubscription=i._subscribe(new h(this,r))))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){this.clearDebounce(),null!=this.lastValue&&(this.destination.next(this.lastValue),this.lastValue=null)},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;e&&(e.unsubscribe(),this.remove(e),this.debouncedSubscription=null)},t}(a.Subscriber),h=function(e){function t(t,r){e.call(this,null),this.parent=t,this.currentIndex=r}return o(t,e),t.prototype.debounceNext=function(){var e=this.parent;this.currentIndex===e.index&&(e.debouncedNext(),this.isUnsubscribed||this.unsubscribe())},t.prototype._next=function(e){this.debounceNext()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.debounceNext()},t}(a.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/debounceTime",["rxjs/Subscriber","rxjs/scheduler/asap"],!0,function(require,e,t){function r(e,t){return void 0===t&&(t=u.asap),this.lift(new c(e,t))}function i(e){e.debouncedNext()}var s=System.global,o=s.define;s.define=void 0;var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=require("rxjs/Subscriber"),u=require("rxjs/scheduler/asap");e.debounceTime=r;var c=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e){return new l(e,this.dueTime,this.scheduler)},e}(),l=function(e){function t(t,r,i){e.call(this,t),this.dueTime=r,this.scheduler=i,this.debouncedSubscription=null,this.lastValue=null}return n(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.add(this.debouncedSubscription=this.scheduler.schedule(i,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){this.clearDebounce(),null!=this.lastValue&&(this.destination.next(this.lastValue),this.lastValue=null)},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(a.Subscriber);return s.define=o,t.exports}),System.register("rxjs/operator/defaultIfEmpty",["rxjs/Subscriber"],!0,function(require,e,t){function r(e){return void 0===e&&(e=null),this.lift(new a(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.defaultIfEmpty=r;var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e){return new u(e,this.defaultValue)},e}(),u=function(e){function t(t,r){e.call(this,t),this.defaultValue=r,this.isEmpty=!0}return o(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/delay",["rxjs/Subscriber","rxjs/Notification","rxjs/scheduler/queue","rxjs/util/isDate"],!0,function(require,e,t){function r(e,t){void 0===t&&(t=u.queue);var r=c.isDate(e),i=r?+e-t.now():e;return this.lift(new l(i,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Notification"),u=require("rxjs/scheduler/queue"),c=require("rxjs/util/isDate");e.delay=r;var l=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e){return new p(e,this.delay,this.scheduler)},e}(),p=function(e){function t(t,r,i){e.call(this,t),this.delay=r,this.scheduler=i,this.queue=[],this.active=!1,this.errored=!1}return o(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,i=e.scheduler,s=e.destination;r.length>0&&r[0].time-i.now()<=0;)r.shift().notification.observe(s);if(r.length>0){var o=Math.max(0,r[0].time-i.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 b(t.now()+this.delay,e);this.queue.push(r),this.active===!1&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(a.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e)},t.prototype._complete=function(){this.scheduleNotification(a.Notification.createComplete())},t}(n.Subscriber),b=function(){function e(e,t){this.time=e,this.notification=t}return e}();return i.define=s,t.exports}),System.register("rxjs/operator/distinctUntilChanged",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new c(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.distinctUntilChanged=r;var c=function(){function e(e){this.compare=e}return e.prototype.call=function(e){return new l(e,this.compare)},e}(),l=function(e){function t(t,r){e.call(this,t),this.hasValue=!1,"function"==typeof r&&(this.compare=r)}return o(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t=!1;if(this.hasValue){if(t=a.tryCatch(this.compare)(this.value,e),t===u.errorObject)return void this.destination.error(u.errorObject.e)}else this.hasValue=!0;Boolean(t)===!1&&(this.value=e,this.destination.next(e))},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/do",["rxjs/Subscriber","rxjs/util/noop","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e,t,r){var i;return e&&"object"==typeof e?(i=e.next,t=e.error,r=e.complete):i=e,this.lift(new l(i||a.noop,t||a.noop,r||a.noop))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/noop"),u=require("rxjs/util/tryCatch"),c=require("rxjs/util/errorObject");e._do=r;var l=function(){function e(e,t,r){this.next=e,this.error=t,this.complete=r}return e.prototype.call=function(e){return new p(e,this.next,this.error,this.complete)},e}(),p=function(e){function t(t,r,i,s){e.call(this,t),this.__next=r,this.__error=i,this.__complete=s}return o(t,e),t.prototype._next=function(e){var t=u.tryCatch(this.__next)(e);t===c.errorObject?this.destination.error(c.errorObject.e):this.destination.next(e)},t.prototype._error=function(e){var t=u.tryCatch(this.__error)(e);t===c.errorObject?this.destination.error(c.errorObject.e):this.destination.error(e)},t.prototype._complete=function(){var e=u.tryCatch(this.__complete)();e===c.errorObject?this.destination.error(c.errorObject.e):this.destination.complete()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/expand-support",["rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/util/tryCatch"),n=require("rxjs/util/errorObject"),a=require("rxjs/OuterSubscriber"),u=require("rxjs/util/subscribeToResult"),c=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e){return new l(e,this.project,this.concurrent,this.scheduler)},e}();e.ExpandOperator=c;var l=function(e){function t(t,r,i,s){e.call(this,t),this.project=r,this.concurrent=i,this.scheduler=s,this.index=0,this.active=0,this.hasCompleted=!1,i0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,i){this._next(t)},t}(a.OuterSubscriber);return e.ExpandSubscriber=l,r.define=i,t.exports}),System.register("rxjs/operator/filter",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e,t){return this.lift(new c(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.filter=r;var c=function(){function e(e,t){this.select=e,this.thisArg=t}return e.prototype.call=function(e){return new l(e,this.select,this.thisArg)},e}(),l=function(e){function t(t,r,i){e.call(this,t),this.thisArg=i,this.count=0,this.select=r}return o(t,e),t.prototype._next=function(e){var t=a.tryCatch(this.select).call(this.thisArg||this,e,this.count++);t===u.errorObject?this.destination.error(u.errorObject.e):Boolean(t)&&this.destination.next(e)},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/finally",["rxjs/Subscriber","rxjs/Subscription"],!0,function(require,e,t){function r(e){return this.lift(new u(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subscription");e._finally=r;var u=function(){function e(e){this.finallySelector=e}return e.prototype.call=function(e){return new c(e,this.finallySelector)},e}(),c=function(e){function t(t,r){e.call(this,t),this.add(new a.Subscription(r))}return o(t,e),t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/util/EmptyError",[],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=function(){function e(){this.name="EmptyError",this.message="no elements in sequence"}return e}();return e.EmptyError=s,r.define=i,t.exports}),System.register("rxjs/util/MapPolyfill",[],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=function(){function e(){this.size=0,this._values=[],this._keys=[]}return 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["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.forEach=function(e,t){for(var r=0;rt?1:t,this._windowTime=1>r?1:r,this.scheduler=i}return s(t,e),t.prototype._next=function(t){var r=this._getNow();this.events.push(new u(r,t)),this._trimBufferThenGetEvents(r),e.prototype._next.call(this,t)},t.prototype._subscribe=function(t){for(var r=this._trimBufferThenGetEvents(this._getNow()),i=-1,s=r.length;!t.isUnsubscribed&&++io&&!(e-i[o].timet&&(o=Math.max(o,s-t)),o>0&&i.splice(0,o),i},t}(o.Subject);e.ReplaySubject=a;var u=function(){function e(e,t){this.time=e,this.value=t}return e}();return r.define=i,t.exports}),System.register("rxjs/operator/publishLast",["rxjs/subject/AsyncSubject","rxjs/operator/multicast"],!0,function(require,e,t){function r(){return n.multicast.call(this,new o.AsyncSubject)}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/subject/AsyncSubject"),n=require("rxjs/operator/multicast");return e.publishLast=r,i.define=s,t.exports}),System.register("rxjs/operator/reduce-support",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Subscriber"),n=require("rxjs/util/tryCatch"),a=require("rxjs/util/errorObject"),u=function(){function e(e,t){this.project=e,this.seed=t}return e.prototype.call=function(e){return new c(e,this.project,this.seed)},e}();e.ReduceOperator=u;var c=function(e){function t(t,r,i){e.call(this,t),this.hasValue=!1,this.acc=i,this.project=r,this.hasSeed="undefined"!=typeof i}return s(t,e),t.prototype._next=function(e){if(this.hasValue||(this.hasValue=this.hasSeed)){var t=n.tryCatch(this.project).call(this,this.acc,e);t===a.errorObject?this.destination.error(a.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}(o.Subscriber);return e.ReduceSubscriber=c,r.define=i,t.exports}),System.register("rxjs/operator/repeat",["rxjs/Subscriber","rxjs/observable/empty"],!0,function(require,e,t){function r(e){return void 0===e&&(e=-1),0===e?new a.EmptyObservable:this.lift(new u(e,this))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/observable/empty");e.repeat=r;var u=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e){return new c(e,this.count,this.source)},e}(),c=function(e){function t(t,r,i){e.call(this),this.destination=t,this.count=r,this.source=i,t.add(this),this.lastSubscription=this}return o(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){var t=this,r=t.destination,i=t.lastSubscription;if(r.remove(i),i.unsubscribe(),e-1===0)r.complete();else{var s=new l(this,e-1);this.lastSubscription=this.source.subscribe(s),r.add(this.lastSubscription)}},t}(n.Subscriber),l=function(e){function t(t,r){e.call(this),this.parent=t,this.count=r}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/retry",["rxjs/Subscriber"],!0,function(require,e,t){function r(e){return void 0===e&&(e=0),this.lift(new a(e,this))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.retry=r;var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e){return new u(e,this.count,this.source)},e}(),u=function(e){function t(t,r,i){e.call(this),this.destination=t,this.count=r,this.source=i,t.add(this),this.lastSubscription=this}return o(t,e),t.prototype._next=function(e){this.destination.next(e)},t.prototype.error=function(e){this.isUnsubscribed||(this.unsubscribe(),this.resubscribe())},t.prototype._complete=function(){this.unsubscribe(),this.destination.complete()},t.prototype.resubscribe=function(e){void 0===e&&(e=0);var t=this,r=t.lastSubscription,i=t.destination;i.remove(r),r.unsubscribe();var s=new c(this,this.count,e+1);this.lastSubscription=this.source.subscribe(s),i.add(this.lastSubscription)},t}(n.Subscriber),c=function(e){function t(t,r,i){void 0===i&&(i=0),e.call(this,null),this.parent=t,this.count=r,this.retried=i}return o(t,e),t.prototype._next=function(e){this.parent.destination.next(e)},t.prototype._error=function(e){var t=this.parent,r=this.retried,i=this.count;i&&r===i?t.destination.error(e):t.resubscribe(r)},t.prototype._complete=function(){this.parent.destination.complete()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/retryWhen",["rxjs/Subscriber","rxjs/Subject","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new l(e,this))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subject"),u=require("rxjs/util/tryCatch"),c=require("rxjs/util/errorObject");e.retryWhen=r;var l=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e){return new p(e,this.notifier,this.source)},e}(),p=function(e){function t(t,r,i){e.call(this),this.destination=t,this.notifier=r,this.source=i,t.add(this),this.lastSubscription=this}return o(t,e),t.prototype._next=function(e){this.destination.next(e)},t.prototype.error=function(t){var r=this.destination;if(!this.isUnsubscribed){if(e.prototype.unsubscribe.call(this),!this.retryNotifications){this.errors=new a.Subject;var i=u.tryCatch(this.notifier).call(this,this.errors);if(i===c.errorObject)r.error(c.errorObject.e);else{this.retryNotifications=i;var s=new h(this);this.notificationSubscription=i.subscribe(s),r.add(this.notificationSubscription)}}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(){var e=this,t=e.destination,r=e.lastSubscription;t.remove(r),r.unsubscribe();var i=new b(this);this.lastSubscription=this.source.subscribe(i),t.add(this.lastSubscription)},t}(n.Subscriber),b=function(e){function t(t){e.call(this,null),this.parent=t}return o(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}(n.Subscriber),h=function(e){function t(t){e.call(this,null),this.parent=t}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/sample",["rxjs/Subscriber"],!0,function(require,e,t){function r(e){return this.lift(new a(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.sample=r;var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e){return new u(e,this.notifier)},e}(),u=function(e){function t(t,r){e.call(this,t),this.notifier=r,this.hasValue=!1,this.add(r._subscribe(new c(this)))}return o(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(n.Subscriber),c=function(e){function t(t){e.call(this,null),this.parent=t}return o(t,e),t.prototype._next=function(){this.parent.notifyNext()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.notifyNext()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/sampleTime",["rxjs/Subscriber","rxjs/scheduler/asap"],!0,function(require,e,t){function r(e,t){return void 0===t&&(t=u.asap),this.lift(new c(e,t))}function i(e){var t=e.subscriber,r=e.delay;t.notifyNext(),this.schedule(e,r)}var s=System.global,o=s.define;s.define=void 0;var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=require("rxjs/Subscriber"),u=require("rxjs/scheduler/asap");e.sampleTime=r;var c=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e){return new l(e,this.delay,this.scheduler)},e}(),l=function(e){function t(t,r,s){e.call(this,t),this.delay=r,this.scheduler=s,this.hasValue=!1,this.add(s.schedule(i,r,{subscriber:this,delay:r}))}return n(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(a.Subscriber);return s.define=o,t.exports}),System.register("rxjs/operator/scan",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e,t){return this.lift(new c(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.scan=r;var c=function(){function e(e,t){this.accumulator=e,this.seed=t}return e.prototype.call=function(e){return new l(e,this.accumulator,this.seed)},e}(),l=function(e){function t(t,r,i){e.call(this,t),this.accumulator=r,this.accumulatorSet=!1,this.seed=i,this.accumulator=r,this.accumulatorSet="undefined"!=typeof i}return o(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.accumulatorSet=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.accumulatorSet){var t=a.tryCatch(this.accumulator).call(this,this.seed,e);t===u.errorObject?this.destination.error(u.errorObject.e):(this.seed=t,this.destination.next(this.seed))}else this.seed=e,this.destination.next(e)},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/share",["rxjs/operator/multicast","rxjs/Subject"],!0,function(require,e,t){function r(){return new a.Subject}function i(){return n.multicast.call(this,r).refCount()}var s=System.global,o=s.define;s.define=void 0;var n=require("rxjs/operator/multicast"),a=require("rxjs/Subject");return e.share=i,s.define=o,t.exports}),System.register("rxjs/operator/single",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/util/EmptyError"],!0,function(require,e,t){function r(e){return this.lift(new l(e,this))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject"),c=require("rxjs/util/EmptyError");e.single=r;var l=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e){return new p(e,this.predicate,this.source)},e}(),p=function(e){function t(t,r,i){e.call(this,t),this.predicate=r,this.source=i,this.seenValue=!1,this.index=0}return o(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.predicate,r=this.index++;if(t){var i=a.tryCatch(t)(e,r,this.source);i===u.errorObject?this.destination.error(i.e):i&&this.applySingleValue(e)}else this.applySingleValue(e)},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new c.EmptyError)},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/skip",["rxjs/Subscriber"],!0,function(require,e,t){function r(e){return this.lift(new a(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.skip=r;var a=function(){function e(e){this.total=e}return e.prototype.call=function(e){return new u(e,this.total)},e}(),u=function(e){function t(t,r){e.call(this,t),this.total=r,this.count=0}return o(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/skipUntil",["rxjs/Subscriber"],!0,function(require,e,t){function r(e){return this.lift(new a(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.skipUntil=r;var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e){return new u(e,this.notifier)},e}(),u=function(e){function t(t,r){e.call(this,t),this.notifier=r,this.notificationSubscriber=null,this.notificationSubscriber=new c(this),this.add(this.notifier.subscribe(this.notificationSubscriber))}return o(t,e),t.prototype._next=function(e){this.notificationSubscriber.hasValue&&this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){this.notificationSubscriber.hasCompleted&&this.destination.complete(),this.notificationSubscriber.unsubscribe()},t.prototype.unsubscribe=function(){this._isUnsubscribed||(this._subscription?(this._subscription.unsubscribe(),this._isUnsubscribed=!0):e.prototype.unsubscribe.call(this))},t}(n.Subscriber),c=function(e){function t(t){e.call(this,null),this.parent=t,this.hasValue=!1,this.hasCompleted=!1}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/skipWhile",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new c(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.skipWhile=r;var c=function(){function e(e){this.predicate=e}return e.prototype.call=function(e){return new l(e,this.predicate)},e}(),l=function(e){function t(t,r){e.call(this,t),this.predicate=r,this.skipping=!0,this.index=0}return o(t,e),t.prototype._next=function(e){var t=this.destination;if(this.skipping===!0){var r=this.index++,i=a.tryCatch(this.predicate)(e,r);i===u.errorObject?t.error(i.e):this.skipping=Boolean(i)}this.skipping===!1&&t.next(e)},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/startWith",["rxjs/observable/fromArray","rxjs/observable/ScalarObservable","rxjs/observable/empty","rxjs/operator/concat-static","rxjs/util/isScheduler"],!0,function(require,e,t){function r(){for(var e=[],t=0;t1?u.concat(new o.ArrayObservable(e,r),this):u.concat(new a.EmptyObservable(r),this)}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/observable/fromArray"),n=require("rxjs/observable/ScalarObservable"),a=require("rxjs/observable/empty"),u=require("rxjs/operator/concat-static"),c=require("rxjs/util/isScheduler");return e.startWith=r,i.define=s,t.exports}),System.register("rxjs/observable/SubscribeOnObservable",["rxjs/Observable","rxjs/scheduler/asap","rxjs/util/isNumeric"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Observable"),n=require("rxjs/scheduler/asap"),a=require("rxjs/util/isNumeric"),u=function(e){function t(t,r,i){void 0===r&&(r=0),void 0===i&&(i=n.asap),e.call(this),this.source=t,this.delayTime=r, +this.scheduler=i,(!a.isNumeric(r)||0>r)&&(this.delayTime=0),i&&"function"==typeof i.schedule||(this.scheduler=n.asap)}return s(t,e),t.create=function(e,r,i){return void 0===r&&(r=0),void 0===i&&(i=n.asap),new t(e,r,i)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return t.subscribe(r)},t.prototype._subscribe=function(e){var r=this.delayTime,i=this.source,s=this.scheduler;e.add(s.schedule(t.dispatch,r,{source:i,subscriber:e}))},t}(o.Observable);return e.SubscribeOnObservable=u,r.define=i,t.exports}),System.register("rxjs/operator/switch",["rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){function r(){return this.lift(new u)}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/OuterSubscriber"),a=require("rxjs/util/subscribeToResult");e._switch=r;var u=function(){function e(){}return e.prototype.call=function(e){return new c(e)},e}(),c=function(e){function t(t){e.call(this,t),this.active=0,this.hasCompleted=!1}return o(t,e),t.prototype._next=function(e){this.unsubscribeInner(),this.active++,this.add(this.innerSubscription=a.subscribeToResult(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}(n.OuterSubscriber);return i.define=s,t.exports}),System.register("rxjs/operator/switchMap",["rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){function r(e,t){return this.lift(new l(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/util/tryCatch"),a=require("rxjs/util/errorObject"),u=require("rxjs/OuterSubscriber"),c=require("rxjs/util/subscribeToResult");e.switchMap=r;var l=function(){function e(e,t){this.project=e,this.resultSelector=t}return e.prototype.call=function(e){return new p(e,this.project,this.resultSelector)},e}(),p=function(e){function t(t,r,i){e.call(this,t),this.project=r,this.resultSelector=i,this.hasCompleted=!1,this.index=0}return o(t,e),t.prototype._next=function(e){var t=this.index++,r=this.destination,i=n.tryCatch(this.project)(e,t);if(i===a.errorObject)r.error(i.e);else{var s=this.innerSubscription;s&&s.unsubscribe(),this.add(this.innerSubscription=c.subscribeToResult(this,i,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,i){var s=this,o=s.resultSelector,u=s.destination;if(o){var c=n.tryCatch(o)(e,t,r,i);c===a.errorObject?u.error(a.errorObject.e):u.next(c)}else u.next(t)},t}(u.OuterSubscriber);return i.define=s,t.exports}),System.register("rxjs/operator/switchMapTo",["rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){function r(e,t){return this.lift(new l(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/util/tryCatch"),a=require("rxjs/util/errorObject"),u=require("rxjs/OuterSubscriber"),c=require("rxjs/util/subscribeToResult");e.switchMapTo=r;var l=function(){function e(e,t){this.observable=e,this.resultSelector=t}return e.prototype.call=function(e){return new p(e,this.observable,this.resultSelector)},e}(),p=function(e){function t(t,r,i){e.call(this,t),this.inner=r,this.resultSelector=i,this.hasCompleted=!1,this.index=0}return o(t,e),t.prototype._next=function(e){var t=this.index++,r=this.innerSubscription;r&&r.unsubscribe(),this.add(this.innerSubscription=c.subscribeToResult(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,i){var s=this,o=s.resultSelector,u=s.destination;if(o){var c=n.tryCatch(o)(e,t,r,i);c===a.errorObject?u.error(a.errorObject.e):u.next(c)}else u.next(t)},t}(u.OuterSubscriber);return i.define=s,t.exports}),System.register("rxjs/util/ArgumentOutOfRangeError",[],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=function(){function e(){this.name="ArgumentOutOfRangeError",this.message="argument out of range"}return e}();return e.ArgumentOutOfRangeError=s,r.define=i,t.exports}),System.register("rxjs/operator/takeUntil",["rxjs/Subscriber","rxjs/util/noop"],!0,function(require,e,t){function r(e){return this.lift(new u(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/noop");e.takeUntil=r;var u=function(){function e(e){this.notifier=e}return e.prototype.call=function(e){return new c(e,this.notifier)},e}(),c=function(e){function t(t,r){e.call(this,t),this.notifier=r,this.notificationSubscriber=null,this.notificationSubscriber=new l(t),this.add(r.subscribe(this.notificationSubscriber))}return o(t,e),t.prototype._complete=function(){this.destination.complete(),this.notificationSubscriber.unsubscribe()},t}(n.Subscriber),l=function(e){function t(t){e.call(this,null),this.destination=t}return o(t,e),t.prototype._next=function(e){this.destination.complete()},t.prototype._error=function(e){this.destination.error(e)},t.prototype._complete=function(){a.noop()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/takeWhile",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new c(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject");e.takeWhile=r;var c=function(){function e(e){this.predicate=e}return e.prototype.call=function(e){return new l(e,this.predicate)},e}(),l=function(e){function t(t,r){e.call(this,t),this.predicate=r,this.index=0}return o(t,e),t.prototype._next=function(e){var t=this.destination,r=a.tryCatch(this.predicate)(e,this.index++);r==u.errorObject?t.error(r.e):Boolean(r)?t.next(e):t.complete()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/throttle",["rxjs/observable/fromPromise","rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/isPromise","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new p(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/observable/fromPromise"),a=require("rxjs/Subscriber"),u=require("rxjs/util/tryCatch"),c=require("rxjs/util/isPromise"),l=require("rxjs/util/errorObject");e.throttle=r;var p=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e){return new b(e,this.durationSelector)},e}(),b=function(e){function t(t,r){e.call(this,t),this.durationSelector=r}return o(t,e),t.prototype._next=function(e){if(!this.throttled){var t=this.destination,r=u.tryCatch(this.durationSelector)(e);if(r===l.errorObject)return void t.error(l.errorObject.e);c.isPromise(r)&&(r=n.PromiseObservable.create(r)),this.add(this.throttled=r._subscribe(new h(this))),t.next(e)}},t.prototype._error=function(t){this.clearThrottle(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.clearThrottle(),e.prototype._complete.call(this)},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(e.unsubscribe(),this.remove(e),this.throttled=null)},t}(a.Subscriber),h=function(e){function t(t){e.call(this,null),this.parent=t}return o(t,e),t.prototype._next=function(e){this.parent.clearThrottle()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.clearThrottle()},t}(a.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/throttleTime",["rxjs/Subscriber","rxjs/scheduler/asap"],!0,function(require,e,t){function r(e,t){return void 0===t&&(t=u.asap),this.lift(new c(e,t))}function i(e){var t=e.subscriber;t.clearThrottle()}var s=System.global,o=s.define;s.define=void 0;var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=require("rxjs/Subscriber"),u=require("rxjs/scheduler/asap");e.throttleTime=r;var c=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e){return new l(e,this.delay,this.scheduler)},e}(),l=function(e){function t(t,r,i){e.call(this,t),this.delay=r,this.scheduler=i}return n(t,e),t.prototype._next=function(e){this.throttled||(this.add(this.throttled=this.scheduler.schedule(i,this.delay,{subscriber:this})),this.destination.next(e))},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(e.unsubscribe(),this.remove(e),this.throttled=null)},t}(a.Subscriber);return s.define=o,t.exports}),System.register("rxjs/operator/timeout",["rxjs/Subscriber","rxjs/scheduler/queue","rxjs/util/isDate"],!0,function(require,e,t){function r(e,t,r){void 0===t&&(t=null),void 0===r&&(r=a.queue);var i=u.isDate(e),s=i?+e-r.now():e;return this.lift(new c(s,i,t,r))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/scheduler/queue"),u=require("rxjs/util/isDate");e.timeout=r;var c=function(){function e(e,t,r,i){this.waitFor=e,this.absoluteTimeout=t,this.errorToSend=r,this.scheduler=i}return e.prototype.call=function(e){return new l(e,this.absoluteTimeout,this.waitFor,this.errorToSend,this.scheduler)},e}(),l=function(e){function t(t,r,i,s,o){e.call(this,t),this.absoluteTimeout=r,this.waitFor=i,this.errorToSend=s,this.scheduler=o,this.index=0,this._previousIndex=0,this._hasCompleted=!1,this.scheduleTimeout()}return o(t,e),Object.defineProperty(t.prototype,"previousIndex",{get:function(){return this._previousIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasCompleted",{get:function(){return this._hasCompleted},enumerable:!0,configurable:!0}),t.dispatchTimeout=function(e){var t=e.subscriber,r=e.index;t.hasCompleted||t.previousIndex!==r||t.notifyTimeout()},t.prototype.scheduleTimeout=function(){var e=this.index;this.scheduler.schedule(t.dispatchTimeout,this.waitFor,{subscriber:this,index:e}),this.index++,this._previousIndex=e},t.prototype._next=function(e){this.destination.next(e),this.absoluteTimeout||this.scheduleTimeout()},t.prototype._error=function(e){this.destination.error(e),this._hasCompleted=!0},t.prototype._complete=function(){this.destination.complete(),this._hasCompleted=!0},t.prototype.notifyTimeout=function(){this.error(this.errorToSend||new Error("timeout"))},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/timeoutWith",["rxjs/scheduler/queue","rxjs/util/isDate","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){function r(e,t,r){void 0===r&&(r=n.queue);var i=a.isDate(e),s=i?+e-r.now():e;return this.lift(new l(s,i,t,r))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/scheduler/queue"),a=require("rxjs/util/isDate"),u=require("rxjs/OuterSubscriber"),c=require("rxjs/util/subscribeToResult");e.timeoutWith=r;var l=function(){function e(e,t,r,i){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=i}return e.prototype.call=function(e){return new p(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler)},e}(),p=function(e){function t(t,r,i,s,o){e.call(this,null),this.destination=t,this.absoluteTimeout=r,this.waitFor=i,this.withObservable=s,this.scheduler=o,this.timeoutSubscription=void 0,this.index=0,this._previousIndex=0,this._hasCompleted=!1,t.add(this),this.scheduleTimeout()}return o(t,e),Object.defineProperty(t.prototype,"previousIndex",{get:function(){return this._previousIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasCompleted",{get:function(){return this._hasCompleted},enumerable:!0,configurable:!0}),t.dispatchTimeout=function(e){var t=e.subscriber,r=e.index;t.hasCompleted||t.previousIndex!==r||t.handleTimeout()},t.prototype.scheduleTimeout=function(){var e=this.index,r={subscriber:this,index:e};this.scheduler.schedule(t.dispatchTimeout,this.waitFor,r),this.index++,this._previousIndex=e},t.prototype._next=function(e){this.destination.next(e),this.absoluteTimeout||this.scheduleTimeout()},t.prototype._error=function(e){this.destination.error(e),this._hasCompleted=!0},t.prototype._complete=function(){this.destination.complete(),this._hasCompleted=!0},t.prototype.handleTimeout=function(){if(!this.isUnsubscribed){var e=this.withObservable;this.unsubscribe(),this.destination.add(this.timeoutSubscription=c.subscribeToResult(this,e))}},t}(u.OuterSubscriber);return i.define=s,t.exports}),System.register("rxjs/operator/toArray",["rxjs/Subscriber"],!0,function(require,e,t){function r(){return this.lift(new a)}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber");e.toArray=r;var a=function(){function e(){}return e.prototype.call=function(e){return new u(e)},e}(),u=function(e){function t(t){e.call(this,t),this.array=[]}return o(t,e),t.prototype._next=function(e){this.array.push(e)},t.prototype._complete=function(){this.destination.next(this.array),this.destination.complete()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/toPromise",["rxjs/util/root"],!0,function(require,e,t){function r(e){var t=this;if(e||(o.root.Rx&&o.root.Rx.config&&o.root.Rx.config.Promise?e=o.root.Rx.config.Promise:o.root.Promise&&(e=o.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,r){var i;t.subscribe(function(e){return i=e},function(e){return r(e)},function(){return e(i)})})}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/util/root");return e.toPromise=r,i.define=s,t.exports}),System.register("rxjs/operator/window",["rxjs/Subscriber","rxjs/Subject"],!0,function(require,e,t){function r(e){return this.lift(new u(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subject");e.window=r;var u=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e){return new c(e,this.closingNotifier)},e}(),c=function(e){function t(t,r){e.call(this,t),this.destination=t,this.closingNotifier=r,this.add(r._subscribe(new l(this))),this.openWindow()}return o(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.window;e&&e.complete();var t=this.destination,r=this.window=new a.Subject;t.add(r),t.next(r)},t}(n.Subscriber),l=function(e){function t(t){e.call(this,null),this.parent=t}return o(t,e),t.prototype._next=function(){this.parent.openWindow()},t.prototype._error=function(e){this.parent._error(e)},t.prototype._complete=function(){this.parent._complete()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/windowCount",["rxjs/Subscriber","rxjs/Subject"],!0,function(require,e,t){function r(e,t){return void 0===t&&(t=0),this.lift(new u(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subject");e.windowCount=r;var u=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e){return new c(e,this.windowSize,this.startWindowEvery)},e}(),c=function(e){function t(t,r,i){e.call(this,t),this.destination=t,this.windowSize=r,this.startWindowEvery=i,this.windows=[new a.Subject],this.count=0;var s=this.windows[0];t.add(s),t.next(s)}return o(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,i=this.windowSize,s=this.windows,o=s.length,n=0;o>n;n++)s[n].next(e);var u=this.count-i+1;if(u>=0&&u%t===0&&s.shift().complete(),++this.count%t===0){var c=new a.Subject;s.push(c),r.add(c),r.next(c)}},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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/windowTime",["rxjs/Subscriber","rxjs/Subject","rxjs/scheduler/asap"],!0,function(require,e,t){function r(e,t,r){return void 0===t&&(t=null),void 0===r&&(r=p.asap),this.lift(new b(e,t,r))}function i(e){var t=e.subscriber,r=e.windowTimeSpan,i=e.window;i&&i.complete(),e.window=t.openWindow(),this.schedule(e,r)}function s(e){var t=e.windowTimeSpan,r=e.subscriber,i=e.scheduler,s=e.windowCreationInterval,n=r.openWindow(),a=this,u={action:a,subscription:null},c={subscriber:r,window:n,context:u};u.subscription=i.schedule(o,t,c),a.add(u.subscription),a.schedule(e,s)}function o(e){var t=e.subscriber,r=e.window,i=e.context;i&&i.action&&i.subscription&&i.action.remove(i.subscription),t.closeWindow(r)}var n=System.global,a=n.define;n.define=void 0;var u=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},c=require("rxjs/Subscriber"),l=require("rxjs/Subject"),p=require("rxjs/scheduler/asap");e.windowTime=r;var b=function(){function e(e,t,r){this.windowTimeSpan=e,this.windowCreationInterval=t,this.scheduler=r}return e.prototype.call=function(e){return new h(e,this.windowTimeSpan,this.windowCreationInterval,this.scheduler)},e}(),h=function(e){function t(t,r,n,a){if(e.call(this,t),this.destination=t,this.windowTimeSpan=r,this.windowCreationInterval=n,this.scheduler=a,this.windows=[],null!==n&&n>=0){var u=this.openWindow(),c={subscriber:this,window:u,context:null},l={windowTimeSpan:r,windowCreationInterval:n,subscriber:this,scheduler:a};this.add(a.schedule(o,r,c)),this.add(a.schedule(s,n,l))}else{var p=this.openWindow(),b={subscriber:this,window:p,windowTimeSpan:r};this.add(a.schedule(i,r,b))}}return u(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,i=0;r>i;i++)t[i].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 l.Subject;this.windows.push(e);var t=this.destination;return t.add(e),t.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(c.Subscriber);return n.define=a,t.exports}),System.register("rxjs/operator/windowToggle",["rxjs/Subscriber","rxjs/Subject","rxjs/Subscription","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e,t){return this.lift(new p(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subject"),u=require("rxjs/Subscription"),c=require("rxjs/util/tryCatch"),l=require("rxjs/util/errorObject");e.windowToggle=r;var p=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e){return new b(e,this.openings,this.closingSelector)},e}(),b=function(e){function t(t,r,i){e.call(this,t),this.destination=t,this.openings=r,this.closingSelector=i,this.contexts=[],this.add(this.openings._subscribe(new f(this)))}return o(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,i=0;r>i;i++)t[i].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=c.tryCatch(t)(e);if(r===l.errorObject)this.error(r.e);else{var i=this.destination,s=new a.Subject,o=new u.Subscription,n={window:s,subscription:o};this.contexts.push(n);var p=new h(this,n),b=r._subscribe(p);o.add(b),i.add(o),i.add(s),i.next(s)}},t.prototype.closeWindow=function(e){var t=e.window,r=e.subscription,i=this.contexts,s=this.destination;i.splice(i.indexOf(e),1),t.complete(),s.remove(r),s.remove(t),r.unsubscribe()},t}(n.Subscriber),h=function(e){function t(t,r){e.call(this,null),this.parent=t,this.windowContext=r}return o(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}(n.Subscriber),f=function(e){function t(t){e.call(this),this.parent=t}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/windowWhen",["rxjs/Subscriber","rxjs/Subject","rxjs/Subscription","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e){return this.lift(new p(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Subject"),u=require("rxjs/Subscription"),c=require("rxjs/util/tryCatch"),l=require("rxjs/util/errorObject");e.windowWhen=r;var p=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e){return new b(e,this.closingSelector)},e}(),b=function(e){function t(t,r){e.call(this,t),this.destination=t,this.closingSelector=r,this.openWindow()}return o(t,e),t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this._unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this._unsubscribeClosingNotification()},t.prototype.unsubscribe=function(){e.prototype.unsubscribe.call(this),this._unsubscribeClosingNotification()},t.prototype._unsubscribeClosingNotification=function(){var e=this.closingNotification;e&&e.unsubscribe()},t.prototype.openWindow=function(){var e=this.closingNotification;e&&(this.remove(e),e.unsubscribe());var t=this.window;t&&t.complete();var r=this.window=new a.Subject;this.destination.next(r);var i=c.tryCatch(this.closingSelector)();if(i===l.errorObject){var s=i.e;this.destination.error(s),this.window.error(s)}else{var o=this.closingNotification=new u.Subscription;o.add(i._subscribe(new h(this))),this.add(o),this.add(r)}},t}(n.Subscriber),h=function(e){function t(t){e.call(this,null),this.parent=t}return o(t,e),t.prototype._next=function(){this.parent.openWindow()},t.prototype._error=function(e){this.parent.error(e)},t.prototype._complete=function(){this.parent.openWindow()},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/operator/withLatestFrom",["rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){function r(){for(var e=[],t=0;to;o++)this.toRespond.push(o);for(var o=0;s>o;o++){var n=r[o];this.add(c.subscribeToResult(this,n,n,o))}}return o(t,e),t.prototype.notifyNext=function(e,t,r,i){this.values[r]=t;var s=this.toRespond;if(s.length>0){var o=s.indexOf(r);-1!==o&&s.splice(o,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=this.values,r=this.destination,i=this.project,s=[e].concat(t);if(i){var o=n.tryCatch(this.project).apply(this,s);o===a.errorObject?r.error(o.e):r.next(o)}else r.next(s)}},t}(u.OuterSubscriber);return i.define=s,t.exports}),System.register("rxjs/operator/zip",["rxjs/operator/zip-static"],!0,function(require,e,t){function r(){for(var e=[],t=0;tc&&!s.isUnsubscribed;c++)s.next(t[c]);s.isUnsubscribed||s.complete()}else{if("function"==typeof t.then)return t.then(function(e){s.isUnsubscribed||(s.next(e),s.complete())},function(e){return s.error(e)}).then(null,function(e){setTimeout(function(){throw e})}),s;if("function"==typeof t[n.SymbolShim.iterator]){for(var p=0,b=t;p=t?this.scheduleNow(e,r):this.scheduleLater(e,t,r)},e.prototype.scheduleNow=function(e,t){return new s.QueueAction(this,e).schedule(t)},e.prototype.scheduleLater=function(e,t,r){return new o.FutureAction(this,e).schedule(r,t)},e}();return e.QueueScheduler=n,r.define=i,t.exports}),System.register("rxjs/add/operator/merge-static",["rxjs/Observable","rxjs/operator/merge-static"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/merge-static");return s.Observable.merge=o.merge,r.define=i,t.exports}),System.register("rxjs/observable/bindCallback",["rxjs/Observable","rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/subject/AsyncSubject"],!0,function(require,e,t){ +function r(e){var t=e.source,r=e.subscriber,o=t.callbackFunc,n=t.args,a=t.scheduler,u=t.subject;if(!u){u=t.subject=new p.AsyncSubject;var b=function f(){for(var e=[],t=0;tr;r++)t.push(null);return t}var s=System.global,o=s.define;s.define=void 0;var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},a=require("rxjs/Observable"),u=require("rxjs/Subscriber"),c=require("rxjs/observable/fromPromise"),l=require("rxjs/observable/empty"),p=require("rxjs/util/isPromise"),b=require("rxjs/util/isArray"),h=function(e){function t(t,r){e.call(this),this.sources=t,this.resultSelector=r}return n(t,e),t.create=function(){for(var e=[],r=0;ro;o++){var n=t[o];p.isPromise(n)&&(n=new c.PromiseObservable(n)),n.subscribe(new f(e,o,s))}},t}(a.Observable);e.ForkJoinObservable=h;var f=function(e){function t(t,r,i){e.call(this,t),this.index=r,this.context=i,this._value=null}return n(t,e),t.prototype._next=function(e){this._value=e},t.prototype._complete=function(){var e=this.destination;null==this._value&&e.complete();var t=this.context;t.completed++,t.values[this.index]=this._value;var i=t.values;if(t.completed===i.length){if(i.every(r)){var s=t.selector?t.selector.apply(this,i):i;e.next(s)}e.complete()}},t}(u.Subscriber);return s.define=o,t.exports}),System.register("rxjs/operator/observeOn-support",["rxjs/Subscriber","rxjs/Notification"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Subscriber"),n=require("rxjs/Notification"),a=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e){return new u(e,this.scheduler,this.delay)},e}();e.ObserveOnOperator=a;var u=function(e){function t(t,r,i){void 0===i&&(i=0),e.call(this,t),this.scheduler=r,this.delay=i}return s(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r)},t.prototype.scheduleMessage=function(e){this.add(this.scheduler.schedule(t.dispatch,this.delay,new c(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(n.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(n.Notification.createError(e))},t.prototype._complete=function(){this.scheduleMessage(n.Notification.createComplete())},t}(o.Subscriber);e.ObserveOnSubscriber=u;var c=function(){function e(e,t){this.notification=e,this.destination=t}return e}();return r.define=i,t.exports}),System.register("rxjs/add/observable/fromEvent",["rxjs/Observable","rxjs/observable/fromEvent"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/fromEvent");return s.Observable.fromEvent=o.FromEventObservable.create,r.define=i,t.exports}),System.register("rxjs/add/observable/fromEventPattern",["rxjs/Observable","rxjs/observable/fromEventPattern"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/fromEventPattern");return s.Observable.fromEventPattern=o.FromEventPatternObservable.create,r.define=i,t.exports}),System.register("rxjs/scheduler/AsapAction",["rxjs/util/Immediate","rxjs/scheduler/QueueAction"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/util/Immediate"),n=require("rxjs/scheduler/QueueAction"),a=function(e){function t(){e.apply(this,arguments)}return s(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=o.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,o.Immediate.clearImmediate(t))},t}(n.QueueAction);return e.AsapAction=a,r.define=i,t.exports}),System.register("rxjs/add/observable/never",["rxjs/Observable","rxjs/observable/never"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/never");return s.Observable.never=o.InfiniteObservable.create,r.define=i,t.exports}),System.register("rxjs/add/observable/range",["rxjs/Observable","rxjs/observable/range"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/range");return s.Observable.range=o.RangeObservable.create,r.define=i,t.exports}),System.register("rxjs/observable/timer",["rxjs/util/isNumeric","rxjs/Observable","rxjs/scheduler/asap","rxjs/util/isScheduler","rxjs/util/isDate"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/util/isNumeric"),n=require("rxjs/Observable"),a=require("rxjs/scheduler/asap"),u=require("rxjs/util/isScheduler"),c=require("rxjs/util/isDate"),l=function(e){function t(t,r,i){void 0===t&&(t=0),e.call(this),this.period=r,this.scheduler=i,this.dueTime=0,o.isNumeric(r)?this._period=Number(r)<1&&1||Number(r):u.isScheduler(r)&&(i=r),u.isScheduler(i)||(i=a.asap),this.scheduler=i;var s=c.isDate(t);this.dueTime=s?+t-this.scheduler.now():t}return s(t,e),t.create=function(e,r,i){return void 0===e&&(e=0),new t(e,r,i)},t.dispatch=function(e){var r=e.index,i=e.period,s=e.subscriber,o=this;return s.next(r),"undefined"==typeof i?void s.complete():void(s.isUnsubscribed||("undefined"==typeof o.delay?o.add(o.scheduler.schedule(t.dispatch,i,{index:r+1,period:i,subscriber:s})):(e.index=r+1,o.schedule(e,i))))},t.prototype._subscribe=function(e){var r=0,i=this._period,s=this.dueTime,o=this.scheduler;e.add(o.schedule(t.dispatch,s,{index:r,period:i,subscriber:e}))},t}(n.Observable);return e.TimerObservable=l,r.define=i,t.exports}),System.register("rxjs/operator/zip-static",["rxjs/observable/fromArray","rxjs/operator/zip-support"],!0,function(require,e,t){function r(){for(var e=[],t=0;t(t||0)?Number.POSITIVE_INFINITY:t,this.lift(new o.ExpandOperator(e,t,r))}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/operator/expand-support");return e.expand=r,i.define=s,t.exports}),System.register("rxjs/add/operator/filter",["rxjs/Observable","rxjs/operator/filter"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/filter");return s.Observable.prototype.filter=o.filter,r.define=i,t.exports}),System.register("rxjs/add/operator/finally",["rxjs/Observable","rxjs/operator/finally"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/finally");return s.Observable.prototype["finally"]=o._finally,r.define=i,t.exports}),System.register("rxjs/operator/first",["rxjs/Subscriber","rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/util/EmptyError"],!0,function(require,e,t){function r(e,t,r){return this.lift(new l(e,t,r,this))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/tryCatch"),u=require("rxjs/util/errorObject"),c=require("rxjs/util/EmptyError");e.first=r;var l=function(){function e(e,t,r,i){this.predicate=e,this.resultSelector=t,this.defaultValue=r,this.source=i}return e.prototype.call=function(e){return new p(e,this.predicate,this.resultSelector,this.defaultValue,this.source)},e}(),p=function(e){function t(t,r,i,s,o){e.call(this,t),this.predicate=r,this.resultSelector=i,this.defaultValue=s,this.source=o,this.index=0,this.hasCompleted=!1}return o(t,e),t.prototype._next=function(e){var t=this,r=t.destination,i=t.predicate,s=t.resultSelector,o=this.index++,n=!0;if(i&&(n=a.tryCatch(i)(e,o,this.source),n===u.errorObject))return void r.error(u.errorObject.e);if(n){if(s){var c=a.tryCatch(s)(e,o);if(c===u.errorObject)return void r.error(u.errorObject.e);r.next(c)}else r.next(e);r.complete(),this.hasCompleted=!0}},t.prototype._complete=function(){var e=this.destination;this.hasCompleted||"undefined"==typeof this.defaultValue?this.hasCompleted||e.error(new c.EmptyError):(e.next(this.defaultValue),e.complete())},t}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/util/Map",["rxjs/util/root","rxjs/util/MapPolyfill"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/util/root"),o=require("rxjs/util/MapPolyfill");return e.Map=s.root.Map||function(){return o.MapPolyfill}(),r.define=i,t.exports}),System.register("rxjs/add/operator/ignoreElements",["rxjs/Observable","rxjs/operator/ignoreElements"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/ignoreElements");return s.Observable.prototype.ignoreElements=o.ignoreElements,r.define=i,t.exports}),System.register("rxjs/add/operator/every",["rxjs/Observable","rxjs/operator/every"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/every");return s.Observable.prototype.every=o.every,r.define=i,t.exports}),System.register("rxjs/add/operator/last",["rxjs/Observable","rxjs/operator/last"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/last");return s.Observable.prototype.last=o.last,r.define=i,t.exports}),System.register("rxjs/add/operator/map",["rxjs/Observable","rxjs/operator/map"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/map");return s.Observable.prototype.map=o.map,r.define=i,t.exports}),System.register("rxjs/add/operator/mapTo",["rxjs/Observable","rxjs/operator/mapTo"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/mapTo");return s.Observable.prototype.mapTo=o.mapTo,r.define=i,t.exports}),System.register("rxjs/add/operator/materialize",["rxjs/Observable","rxjs/operator/materialize"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/materialize");return s.Observable.prototype.materialize=o.materialize,r.define=i,t.exports}),System.register("rxjs/add/operator/merge",["rxjs/Observable","rxjs/operator/merge"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/merge");return s.Observable.prototype.merge=o.merge,r.define=i,t.exports}),System.register("rxjs/add/operator/mergeAll",["rxjs/Observable","rxjs/operator/mergeAll"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/mergeAll");return s.Observable.prototype.mergeAll=o.mergeAll,r.define=i,t.exports}),System.register("rxjs/add/operator/mergeMap",["rxjs/Observable","rxjs/operator/mergeMap"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/mergeMap");return s.Observable.prototype.mergeMap=o.mergeMap,s.Observable.prototype.flatMap=o.mergeMap,r.define=i,t.exports}),System.register("rxjs/add/operator/mergeMapTo",["rxjs/Observable","rxjs/operator/mergeMapTo"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/mergeMapTo");return s.Observable.prototype.mergeMapTo=o.mergeMapTo,r.define=i,t.exports}),System.register("rxjs/operator/multicast",["rxjs/observable/ConnectableObservable"],!0,function(require,e,t){function r(e){var t;return t="function"==typeof e?e:function(){return e},new o.ConnectableObservable(this,t)}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/observable/ConnectableObservable");return e.multicast=r,i.define=s,t.exports}),System.register("rxjs/add/operator/observeOn",["rxjs/Observable","rxjs/operator/observeOn"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/observeOn");return s.Observable.prototype.observeOn=o.observeOn,r.define=i,t.exports}),System.register("rxjs/operator/partition",["rxjs/util/not","rxjs/operator/filter"],!0,function(require,e,t){function r(e,t){return[n.filter.call(this,e),n.filter.call(this,o.not(e,t))]}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/util/not"),n=require("rxjs/operator/filter");return e.partition=r,i.define=s,t.exports}),System.register("rxjs/add/operator/publish",["rxjs/Observable","rxjs/operator/publish"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/publish");return s.Observable.prototype.publish=o.publish,r.define=i,t.exports}),System.register("rxjs/subject/BehaviorSubject",["rxjs/Subject","rxjs/util/throwError","rxjs/util/ObjectUnsubscribedError"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Subject"),n=require("rxjs/util/throwError"),a=require("rxjs/util/ObjectUnsubscribedError"),u=function(e){function t(t){e.call(this),this._value=t,this._hasError=!1}return s(t,e),t.prototype.getValue=function(){if(this._hasError)n.throwError(this._err);else{if(!this.isUnsubscribed)return this._value;n.throwError(new a.ObjectUnsubscribedError)}},Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);if(r)return r.isUnsubscribed||t.next(this._value),r},t.prototype._next=function(t){e.prototype._next.call(this,this._value=t)},t.prototype._error=function(t){this._hasError=!0,e.prototype._error.call(this,this._err=t)},t}(o.Subject);return e.BehaviorSubject=u,r.define=i,t.exports}),System.register("rxjs/operator/publishReplay",["rxjs/subject/ReplaySubject","rxjs/operator/multicast"],!0,function(require,e,t){function r(e,t,r){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===t&&(t=Number.POSITIVE_INFINITY),n.multicast.call(this,new o.ReplaySubject(e,t,r))}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/subject/ReplaySubject"),n=require("rxjs/operator/multicast");return e.publishReplay=r,i.define=s,t.exports}),System.register("rxjs/add/operator/publishLast",["rxjs/Observable","rxjs/operator/publishLast"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/publishLast");return s.Observable.prototype.publishLast=o.publishLast,r.define=i,t.exports}),System.register("rxjs/operator/reduce",["rxjs/operator/reduce-support"],!0,function(require,e,t){function r(e,t){return this.lift(new o.ReduceOperator(e,t))}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/operator/reduce-support");return e.reduce=r,i.define=s,t.exports}),System.register("rxjs/add/operator/repeat",["rxjs/Observable","rxjs/operator/repeat"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/repeat");return s.Observable.prototype.repeat=o.repeat,r.define=i,t.exports}),System.register("rxjs/add/operator/retry",["rxjs/Observable","rxjs/operator/retry"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/retry");return s.Observable.prototype.retry=o.retry,r.define=i,t.exports}),System.register("rxjs/add/operator/retryWhen",["rxjs/Observable","rxjs/operator/retryWhen"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/retryWhen");return s.Observable.prototype.retryWhen=o.retryWhen,r.define=i,t.exports}),System.register("rxjs/add/operator/sample",["rxjs/Observable","rxjs/operator/sample"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/sample");return s.Observable.prototype.sample=o.sample,r.define=i,t.exports}),System.register("rxjs/add/operator/sampleTime",["rxjs/Observable","rxjs/operator/sampleTime"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/sampleTime");return s.Observable.prototype.sampleTime=o.sampleTime,r.define=i,t.exports}),System.register("rxjs/add/operator/scan",["rxjs/Observable","rxjs/operator/scan"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/scan");return s.Observable.prototype.scan=o.scan,r.define=i,t.exports}),System.register("rxjs/add/operator/share",["rxjs/Observable","rxjs/operator/share"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/share");return s.Observable.prototype.share=o.share,r.define=i,t.exports}),System.register("rxjs/add/operator/single",["rxjs/Observable","rxjs/operator/single"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/single");return s.Observable.prototype.single=o.single,r.define=i,t.exports}),System.register("rxjs/add/operator/skip",["rxjs/Observable","rxjs/operator/skip"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/skip");return s.Observable.prototype.skip=o.skip,r.define=i,t.exports}),System.register("rxjs/add/operator/skipUntil",["rxjs/Observable","rxjs/operator/skipUntil"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/skipUntil");return s.Observable.prototype.skipUntil=o.skipUntil,r.define=i,t.exports}),System.register("rxjs/add/operator/skipWhile",["rxjs/Observable","rxjs/operator/skipWhile"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/skipWhile");return s.Observable.prototype.skipWhile=o.skipWhile,r.define=i,t.exports}),System.register("rxjs/add/operator/startWith",["rxjs/Observable","rxjs/operator/startWith"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/startWith");return s.Observable.prototype.startWith=o.startWith,r.define=i,t.exports}),System.register("rxjs/operator/subscribeOn",["rxjs/observable/SubscribeOnObservable"],!0,function(require,e,t){function r(e,t){return void 0===t&&(t=0),new o.SubscribeOnObservable(this,t,e)}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/observable/SubscribeOnObservable");return e.subscribeOn=r,i.define=s,t.exports}),System.register("rxjs/add/operator/switch",["rxjs/Observable","rxjs/operator/switch"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/switch");return s.Observable.prototype["switch"]=o._switch,r.define=i,t.exports}),System.register("rxjs/add/operator/switchMap",["rxjs/Observable","rxjs/operator/switchMap"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/switchMap");return s.Observable.prototype.switchMap=o.switchMap,r.define=i,t.exports}),System.register("rxjs/add/operator/switchMapTo",["rxjs/Observable","rxjs/operator/switchMapTo"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/switchMapTo");return s.Observable.prototype.switchMapTo=o.switchMapTo,r.define=i,t.exports}),System.register("rxjs/operator/take",["rxjs/Subscriber","rxjs/util/ArgumentOutOfRangeError","rxjs/observable/empty"],!0,function(require,e,t){function r(e){return 0===e?new u.EmptyObservable:this.lift(new c(e))}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/util/ArgumentOutOfRangeError"),u=require("rxjs/observable/empty");e.take=r;var c=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e){return new l(e,this.total)},e}(),l=function(e){function t(t,r){e.call(this,t),this.total=r,this.count=0}return o(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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/add/operator/takeUntil",["rxjs/Observable","rxjs/operator/takeUntil"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/takeUntil");return s.Observable.prototype.takeUntil=o.takeUntil,r.define=i,t.exports}),System.register("rxjs/add/operator/takeWhile",["rxjs/Observable","rxjs/operator/takeWhile"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/takeWhile");return s.Observable.prototype.takeWhile=o.takeWhile,r.define=i,t.exports; +}),System.register("rxjs/add/operator/throttle",["rxjs/Observable","rxjs/operator/throttle"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/throttle");return s.Observable.prototype.throttle=o.throttle,r.define=i,t.exports}),System.register("rxjs/add/operator/throttleTime",["rxjs/Observable","rxjs/operator/throttleTime"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/throttleTime");return s.Observable.prototype.throttleTime=o.throttleTime,r.define=i,t.exports}),System.register("rxjs/add/operator/timeout",["rxjs/Observable","rxjs/operator/timeout"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/timeout");return s.Observable.prototype.timeout=o.timeout,r.define=i,t.exports}),System.register("rxjs/add/operator/timeoutWith",["rxjs/Observable","rxjs/operator/timeoutWith"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/timeoutWith");return s.Observable.prototype.timeoutWith=o.timeoutWith,r.define=i,t.exports}),System.register("rxjs/add/operator/toArray",["rxjs/Observable","rxjs/operator/toArray"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/toArray");return s.Observable.prototype.toArray=o.toArray,r.define=i,t.exports}),System.register("rxjs/add/operator/toPromise",["rxjs/Observable","rxjs/operator/toPromise"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/toPromise");return s.Observable.prototype.toPromise=o.toPromise,r.define=i,t.exports}),System.register("rxjs/add/operator/window",["rxjs/Observable","rxjs/operator/window"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/window");return s.Observable.prototype.window=o.window,r.define=i,t.exports}),System.register("rxjs/add/operator/windowCount",["rxjs/Observable","rxjs/operator/windowCount"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/windowCount");return s.Observable.prototype.windowCount=o.windowCount,r.define=i,t.exports}),System.register("rxjs/add/operator/windowTime",["rxjs/Observable","rxjs/operator/windowTime"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/windowTime");return s.Observable.prototype.windowTime=o.windowTime,r.define=i,t.exports}),System.register("rxjs/add/operator/windowToggle",["rxjs/Observable","rxjs/operator/windowToggle"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/windowToggle");return s.Observable.prototype.windowToggle=o.windowToggle,r.define=i,t.exports}),System.register("rxjs/add/operator/windowWhen",["rxjs/Observable","rxjs/operator/windowWhen"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/windowWhen");return s.Observable.prototype.windowWhen=o.windowWhen,r.define=i,t.exports}),System.register("rxjs/add/operator/withLatestFrom",["rxjs/Observable","rxjs/operator/withLatestFrom"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/withLatestFrom");return s.Observable.prototype.withLatestFrom=o.withLatestFrom,r.define=i,t.exports}),System.register("rxjs/add/operator/zip",["rxjs/Observable","rxjs/operator/zip"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/zip");return s.Observable.prototype.zip=o.zipProto,r.define=i,t.exports}),System.register("rxjs/add/operator/zipAll",["rxjs/Observable","rxjs/operator/zipAll"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/zipAll");return s.Observable.prototype.zipAll=o.zipAll,r.define=i,t.exports}),System.register("rxjs/symbol/rxSubscriber",["rxjs/util/SymbolShim"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/util/SymbolShim");return e.rxSubscriber=s.SymbolShim["for"]("rxSubscriber"),r.define=i,t.exports}),System.register("rxjs/observable/ScalarObservable",["rxjs/Observable","rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/observable/throw","rxjs/observable/empty"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Observable"),n=require("rxjs/util/tryCatch"),a=require("rxjs/util/errorObject"),u=require("rxjs/observable/throw"),c=require("rxjs/observable/empty"),l=function(e){function t(t,r){e.call(this),this.value=t,this.scheduler=r,this._isScalar=!0}return s(t,e),t.create=function(e,r){return new t(e,r)},t.dispatch=function(e){var t=e.done,r=e.value,i=e.subscriber;return t?void i.complete():(i.next(r),void(i.isUnsubscribed||(e.done=!0,this.schedule(e))))},t.prototype._subscribe=function(e){var r=this.value,i=this.scheduler;i?e.add(i.schedule(t.dispatch,0,{done:!1,value:r,subscriber:e})):(e.next(r),e.isUnsubscribed||e.complete())},t}(o.Observable);e.ScalarObservable=l;var p=l.prototype;return p.map=function(e,t){var r=n.tryCatch(e).call(t||this,this.value,0);return r===a.errorObject?new u.ErrorObservable(a.errorObject.e):new l(e.call(t||this,this.value,0))},p.filter=function(e,t){var r=n.tryCatch(e).call(t||this,this.value,0);return r===a.errorObject?new u.ErrorObservable(a.errorObject.e):r?this:new c.EmptyObservable},p.reduce=function(e,t){if("undefined"==typeof t)return this;var r=n.tryCatch(e)(t,this.value);return r===a.errorObject?new u.ErrorObservable(a.errorObject.e):new l(r)},p.scan=function(e,t){return this.reduce(e,t)},p.count=function(e){if(e){var t=n.tryCatch(e).call(this,this.value,0,this);return t===a.errorObject?new u.ErrorObservable(a.errorObject.e):new l(t?1:0)}return new l(1)},p.skip=function(e){return e>0?new c.EmptyObservable:this},p.take=function(e){return e>0?this:new c.EmptyObservable},r.define=i,t.exports}),System.register("rxjs/operator/combineLatest-support",["rxjs/util/tryCatch","rxjs/util/errorObject","rxjs/OuterSubscriber","rxjs/util/subscribeToResult"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/util/tryCatch"),n=require("rxjs/util/errorObject"),a=require("rxjs/OuterSubscriber"),u=require("rxjs/util/subscribeToResult"),c=function(){function e(e){this.project=e}return e.prototype.call=function(e){return new l(e,this.project)},e}();e.CombineLatestOperator=c;var l=function(e){function t(t,r){e.call(this,t),this.project=r,this.active=0,this.values=[],this.observables=[],this.toRespond=[]}return s(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 i=e[r];this.add(u.subscribeToResult(this,i,i,r))}}},t.prototype.notifyComplete=function(e){0===(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r,i){var s=this.values;s[r]=t;var a=this.toRespond;if(a.length>0){var u=a.indexOf(r);-1!==u&&a.splice(u,1)}if(0===a.length){var c=this.project,l=this.destination;if(c){var p=o.tryCatch(c).apply(this,s);p===n.errorObject?l.error(n.errorObject.e):l.next(p)}else l.next(s)}},t}(a.OuterSubscriber);return e.CombineLatestSubscriber=l,r.define=i,t.exports}),System.register("rxjs/scheduler/queue",["rxjs/scheduler/QueueScheduler"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/scheduler/QueueScheduler");return e.queue=new s.QueueScheduler,r.define=i,t.exports}),System.register("rxjs/add/observable/bindCallback",["rxjs/Observable","rxjs/observable/bindCallback"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/bindCallback");return s.Observable.bindCallback=o.BoundCallbackObservable.create,r.define=i,t.exports}),System.register("rxjs/add/observable/forkJoin",["rxjs/Observable","rxjs/observable/forkJoin"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/forkJoin");return s.Observable.forkJoin=o.ForkJoinObservable.create,r.define=i,t.exports}),System.register("rxjs/observable/from",["rxjs/observable/fromPromise","rxjs/observable/IteratorObservable","rxjs/observable/fromArray","rxjs/util/SymbolShim","rxjs/Observable","rxjs/operator/observeOn-support","rxjs/scheduler/queue"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/observable/fromPromise"),n=require("rxjs/observable/IteratorObservable"),a=require("rxjs/observable/fromArray"),u=require("rxjs/util/SymbolShim"),c=require("rxjs/Observable"),l=require("rxjs/operator/observeOn-support"),p=require("rxjs/scheduler/queue"),b=Array.isArray,h=function(e){function t(t,r){e.call(this,null),this.ish=t,this.scheduler=r}return s(t,e),t.create=function(e,r){if(void 0===r&&(r=p.queue),e){if(b(e))return new a.ArrayObservable(e,r);if("function"==typeof e.then)return new o.PromiseObservable(e,r);if("function"==typeof e[u.SymbolShim.observable])return e instanceof c.Observable?e:new t(e,r);if("function"==typeof e[u.SymbolShim.iterator])return new n.IteratorObservable(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===p.queue?t[u.SymbolShim.observable]().subscribe(e):t[u.SymbolShim.observable]().subscribe(new l.ObserveOnSubscriber(e,r,0))},t}(c.Observable);return e.FromObservable=h,r.define=i,t.exports}),System.register("rxjs/scheduler/AsapScheduler",["rxjs/scheduler/QueueScheduler","rxjs/scheduler/AsapAction","rxjs/scheduler/QueueAction"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/scheduler/QueueScheduler"),n=require("rxjs/scheduler/AsapAction"),a=require("rxjs/scheduler/QueueAction"),u=function(e){function t(){e.apply(this,arguments)}return s(t,e),t.prototype.scheduleNow=function(e,t){return(this.scheduled?new a.QueueAction(this,e):new n.AsapAction(this,e)).schedule(t)},t}(o.QueueScheduler);return e.AsapScheduler=u,r.define=i,t.exports}),System.register("rxjs/add/observable/timer",["rxjs/Observable","rxjs/observable/timer"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/observable/timer");return s.Observable.timer=o.TimerObservable.create,r.define=i,t.exports}),System.register("rxjs/add/operator/zip-static",["rxjs/Observable","rxjs/operator/zip-static"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/zip-static");return s.Observable.zip=o.zip,r.define=i,t.exports}),System.register("rxjs/add/operator/concatMap",["rxjs/Observable","rxjs/operator/concatMap"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/concatMap");return s.Observable.prototype.concatMap=o.concatMap,r.define=i,t.exports}),System.register("rxjs/add/operator/concatMapTo",["rxjs/Observable","rxjs/operator/concatMapTo"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/concatMapTo");return s.Observable.prototype.concatMapTo=o.concatMapTo,r.define=i,t.exports}),System.register("rxjs/add/operator/expand",["rxjs/Observable","rxjs/operator/expand"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/expand");return s.Observable.prototype.expand=o.expand,r.define=i,t.exports}),System.register("rxjs/add/operator/first",["rxjs/Observable","rxjs/operator/first"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/first");return s.Observable.prototype.first=o.first,r.define=i,t.exports}),System.register("rxjs/operator/groupBy",["rxjs/Subscriber","rxjs/Observable","rxjs/Subject","rxjs/util/Map","rxjs/util/FastMap","rxjs/operator/groupBy-support","rxjs/util/tryCatch","rxjs/util/errorObject"],!0,function(require,e,t){function r(e,t,r){return new f(this,e,t,r)}var i=System.global,s=i.define;i.define=void 0;var o=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},n=require("rxjs/Subscriber"),a=require("rxjs/Observable"),u=require("rxjs/Subject"),c=require("rxjs/util/Map"),l=require("rxjs/util/FastMap"),p=require("rxjs/operator/groupBy-support"),b=require("rxjs/util/tryCatch"),h=require("rxjs/util/errorObject");e.groupBy=r;var f=function(e){function t(t,r,i,s){e.call(this),this.source=t,this.keySelector=r,this.elementSelector=i,this.durationSelector=s}return o(t,e),t.prototype._subscribe=function(e){var t=new p.RefCountSubscription,r=new d(e,t,this.keySelector,this.elementSelector,this.durationSelector);return t.setPrimary(this.source.subscribe(r)),t},t}(a.Observable);e.GroupByObservable=f;var d=function(e){function t(t,r,i,s,o){e.call(this),this.refCountSubscription=r,this.keySelector=i,this.elementSelector=s,this.durationSelector=o,this.groups=null,this.destination=t,this.add(t)}return o(t,e),t.prototype._next=function(e){var t=b.tryCatch(this.keySelector)(e);if(t===h.errorObject)this.error(t.e);else{var r=this.groups,i=this.elementSelector,s=this.durationSelector;r||(r=this.groups="string"==typeof t?new l.FastMap:new c.Map);var o=r.get(t);if(!o){r.set(t,o=new u.Subject);var n=new p.GroupedObservable(t,o,this.refCountSubscription);if(s){var a=b.tryCatch(s)(new p.GroupedObservable(t,o));a===h.errorObject?this.error(a.e):this.add(a._subscribe(new v(t,o,this)))}this.destination.next(n)}if(i){var f=b.tryCatch(i)(e);f===h.errorObject?this.error(f.e):o.next(f)}else o.next(e)}},t.prototype._error=function(e){var t=this,r=this.groups;r&&r.forEach(function(r,i){r.error(e),t.removeGroup(i)}),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}(n.Subscriber),v=function(e){function t(t,r,i){e.call(this,null),this.key=t,this.group=r,this.parent=i}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}(n.Subscriber);return i.define=s,t.exports}),System.register("rxjs/add/operator/multicast",["rxjs/Observable","rxjs/operator/multicast"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/multicast");return s.Observable.prototype.multicast=o.multicast,r.define=i,t.exports}),System.register("rxjs/add/operator/partition",["rxjs/Observable","rxjs/operator/partition"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/partition");return s.Observable.prototype.partition=o.partition,r.define=i,t.exports}),System.register("rxjs/operator/publishBehavior",["rxjs/subject/BehaviorSubject","rxjs/operator/multicast"],!0,function(require,e,t){function r(e){return n.multicast.call(this,new o.BehaviorSubject(e))}var i=System.global,s=i.define;i.define=void 0;var o=require("rxjs/subject/BehaviorSubject"),n=require("rxjs/operator/multicast");return e.publishBehavior=r,i.define=s,t.exports}),System.register("rxjs/add/operator/publishReplay",["rxjs/Observable","rxjs/operator/publishReplay"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/publishReplay");return s.Observable.prototype.publishReplay=o.publishReplay,r.define=i,t.exports}),System.register("rxjs/add/operator/reduce",["rxjs/Observable","rxjs/operator/reduce"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/reduce");return s.Observable.prototype.reduce=o.reduce,r.define=i,t.exports}),System.register("rxjs/add/operator/subscribeOn",["rxjs/Observable","rxjs/operator/subscribeOn"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/subscribeOn");return s.Observable.prototype.subscribeOn=o.subscribeOn,r.define=i,t.exports}),System.register("rxjs/add/operator/take",["rxjs/Observable","rxjs/operator/take"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=require("rxjs/Observable"),o=require("rxjs/operator/take");return s.Observable.prototype.take=o.take,r.define=i,t.exports}),System.register("rxjs/Subscriber",["rxjs/util/noop","rxjs/util/throwError","rxjs/util/tryOrOnError","rxjs/Subscription","rxjs/symbol/rxSubscriber"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/util/noop"),n=require("rxjs/util/throwError"),a=require("rxjs/util/tryOrOnError"),u=require("rxjs/Subscription"),c=require("rxjs/symbol/rxSubscriber"),l=function(e){function t(r){if(e.call(this),this.destination=r,this._isUnsubscribed=!1,this.destination){var i=r._subscription;i?this._subscription=i:r instanceof t&&(this._subscription=r)}}return s(t,e),t.prototype[c.rxSubscriber]=function(){return this},Object.defineProperty(t.prototype,"isUnsubscribed",{get:function(){var e=this._subscription;return e?this._isUnsubscribed||e.isUnsubscribed:this._isUnsubscribed},set:function(e){var t=this._subscription;t?t.isUnsubscribed=Boolean(e):this._isUnsubscribed=Boolean(e)},enumerable:!0,configurable:!0}),t.create=function(e,r,i){var s=new t;return s._next="function"==typeof e&&a.tryOrOnError(e)||o.noop,s._error="function"==typeof r&&r||n.throwError,s._complete="function"==typeof i&&i||o.noop,s},t.prototype.add=function(t){var r=this._subscription;r?r.add(t):e.prototype.add.call(this,t)},t.prototype.remove=function(t){this._subscription?this._subscription.remove(t):e.prototype.remove.call(this,t)},t.prototype.unsubscribe=function(){this._isUnsubscribed||(this._subscription?this._isUnsubscribed=!0:e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){var t=this.destination;t.next&&t.next(e)},t.prototype._error=function(e){var t=this.destination;t.error&&t.error(e)},t.prototype._complete=function(){var e=this.destination;e.complete&&e.complete()},t.prototype.next=function(e){this.isUnsubscribed||this._next(e)},t.prototype.error=function(e){this.isUnsubscribed||(this._error(e),this.unsubscribe())},t.prototype.complete=function(){this.isUnsubscribed||(this._complete(),this.unsubscribe())},t}(u.Subscription);return e.Subscriber=l,r.define=i,t.exports}),System.register("rxjs/observable/fromArray",["rxjs/Observable","rxjs/observable/ScalarObservable","rxjs/observable/empty","rxjs/util/isScheduler"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Observable"),n=require("rxjs/observable/ScalarObservable"),a=require("rxjs/observable/empty"),u=require("rxjs/util/isScheduler"),c=function(e){function t(t,r){e.call(this),this.array=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return s(t,e),t.create=function(e,r){return new t(e,r)},t.of=function(){for(var e=[],r=0;r1?new t(e,i):1===s?new n.ScalarObservable(e[0],i):new a.EmptyObservable(i)},t.dispatch=function(e){var t=e.array,r=e.index,i=e.count,s=e.subscriber;return r>=i?void s.complete():(s.next(t[r]),void(s.isUnsubscribed||(e.index=r+1,this.schedule(e))))},t.prototype._subscribe=function(e){var r=0,i=this.array,s=i.length,o=this.scheduler;if(o)e.add(o.schedule(t.dispatch,0,{array:i,index:r,count:s,subscriber:e}));else{for(var n=0;s>n&&!e.isUnsubscribed;n++)e.next(i[n]);e.complete()}},t}(o.Observable);return e.ArrayObservable=c,r.define=i,t.exports}),System.register("rxjs/operator/concat-static",["rxjs/scheduler/queue","rxjs/operator/mergeAll-support","rxjs/observable/fromArray","rxjs/util/isScheduler"],!0,function(require,e,t){function r(){for(var e=[],t=0;tt)&&(this.period=0),r&&"function"==typeof r.schedule||(this.scheduler=a.asap)}return s(t,e),t.create=function(e,r){return void 0===e&&(e=0),void 0===r&&(r=a.asap),new t(e,r)},t.dispatch=function(e){var t=e.index,r=e.subscriber,i=e.period;r.next(t),r.isUnsubscribed||(e.index+=1,this.schedule(e,i))},t.prototype._subscribe=function(e){var r=0,i=this.period,s=this.scheduler;e.add(s.schedule(t.dispatch,i,{index:r,subscriber:e,period:i}))},t}(n.Observable);return e.IntervalObservable=u,r.define=i,t.exports}),System.register("rxjs/Subject",["rxjs/Observable","rxjs/Subscriber","rxjs/Subscription","rxjs/subject/SubjectSubscription","rxjs/symbol/rxSubscriber"],!0,function(require,e,t){var r=System.global,i=r.define;r.define=void 0;var s=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=require("rxjs/Observable"),n=require("rxjs/Subscriber"),a=require("rxjs/Subscription"),u=require("rxjs/subject/SubjectSubscription"),c=require("rxjs/symbol/rxSubscriber"),l=a.Subscription.prototype.add,p=a.Subscription.prototype.remove,b=a.Subscription.prototype.unsubscribe,h=n.Subscriber.prototype.next,f=n.Subscriber.prototype.error,d=n.Subscriber.prototype.complete,v=n.Subscriber.prototype._next,x=n.Subscriber.prototype._error,y=n.Subscriber.prototype._complete,j=function(e){function t(){e.apply(this,arguments),this.observers=[],this.isUnsubscribed=!1,this.dispatching=!1,this.errorSignal=!1,this.completeSignal=!1}return s(t,e),t.prototype[c.rxSubscriber]=function(){return this},t.create=function(e,t){return new m(e,t)},t.prototype.lift=function(e){var t=new m(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 u.SubjectSubscription(this,e)}},t.prototype.add=function(e){l.call(this,e)},t.prototype.remove=function(e){p.call(this,e)},t.prototype.unsubscribe=function(){this.observers=void 0,b.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),i=r.length;++t + */ +var Observable = (function () { + /** + * @constructor + * @param {Function} subscribe the function that is + * called when the Observable is initially subscribed to. This function is given a Subscriber, to which new values + * can be `next`ed, or an `error` method can be called to raise an error, or `complete` can be called to notify + * of a successful completion. + */ + function Observable(subscribe) { + this._isScalar = false; + if (subscribe) { + this._subscribe = subscribe; + } + } + /** + * @method lift + * @param {Operator} operator the operator defining the operation to take on the observable + * @returns {Observable} a new observable with the Operator applied + * @description creates a new Observable, with this Observable as the source, and the passed + * operator defined as the new observable's operator. + */ + Observable.prototype.lift = function (operator) { + var observable = new Observable(); + observable.source = this; + observable.operator = operator; + return observable; + }; + /** + * @method Symbol.observable + * @returns {Observable} this instance of the observable + * @description an interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable + */ + Observable.prototype[SymbolShim_1.SymbolShim.observable] = function () { + return this; + }; + /** + * @method subscribe + * @param {Observer|Function} observerOrNext (optional) either an observer defining all functions to be called, + * or the first of three possible handlers, which is the handler for each value emitted from the observable. + * @param {Function} error (optional) a handler for a terminal event resulting from an error. If no error handler is provided, + * the error will be thrown as unhandled + * @param {Function} complete (optional) a handler for a terminal event resulting from successful completion. + * @returns {Subscription} a subscription reference to the registered handlers + * @description registers handlers for handling emitted values, error and completions from the observable, and + * executes the observable's subscriber function, which will take action to set up the underlying data stream + */ + Observable.prototype.subscribe = function (observerOrNext, error, complete) { + var subscriber; + if (observerOrNext && typeof observerOrNext === 'object') { + if (observerOrNext instanceof Subscriber_1.Subscriber) { + subscriber = observerOrNext; + } + else if (observerOrNext[rxSubscriber_1.rxSubscriber]) { + subscriber = observerOrNext[rxSubscriber_1.rxSubscriber](); + } + else { + subscriber = new Subscriber_1.Subscriber(observerOrNext); + } + } + else { + var next = observerOrNext; + subscriber = Subscriber_1.Subscriber.create(next, error, complete); + } + subscriber.add(this._subscribe(subscriber)); + return subscriber; + }; + /** + * @method forEach + * @param {Function} next a handler for each value emitted by the observable + * @param {any} [thisArg] a `this` context for the `next` handler function + * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise + * @returns {Promise} a promise that either resolves on observable completion or + * rejects with the handled error + */ + Observable.prototype.forEach = function (next, thisArg, PromiseCtor) { + if (!PromiseCtor) { + if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { + PromiseCtor = root_1.root.Rx.config.Promise; + } + else if (root_1.root.Promise) { + PromiseCtor = root_1.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + var nextHandler; + if (thisArg) { + nextHandler = function nextHandlerFn(value) { + var _a = nextHandlerFn, thisArg = _a.thisArg, next = _a.next; + return next.call(thisArg, value); + }; + nextHandler.thisArg = thisArg; + nextHandler.next = next; + } + else { + nextHandler = next; + } + var promiseCallback = function promiseCallbackFn(resolve, reject) { + var _a = promiseCallbackFn, source = _a.source, nextHandler = _a.nextHandler; + source.subscribe(nextHandler, reject, resolve); + }; + promiseCallback.source = this; + promiseCallback.nextHandler = nextHandler; + return new PromiseCtor(promiseCallback); + }; + Observable.prototype._subscribe = function (subscriber) { + return this.source._subscribe(this.operator.call(subscriber)); + }; + // HACK: Since TypeScript inherits static properties too, we have to + // fight against TypeScript here so Subject can have a different static create signature + /** + * @static + * @method create + * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor + * @returns {Observable} a new cold observable + * @description creates a new cold Observable by calling the Observable constructor + */ + Observable.create = function (subscribe) { + return new Observable(subscribe); + }; + return Observable; +})(); +exports.Observable = Observable; + +},{"./Subscriber":7,"./symbol/rxSubscriber":221,"./util/SymbolShim":229,"./util/root":238}],4:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('./Subscriber'); +var OuterSubscriber = (function (_super) { + __extends(OuterSubscriber, _super); + function OuterSubscriber() { + _super.apply(this, arguments); + } + OuterSubscriber.prototype.notifyComplete = function (inner) { + this.destination.complete(); + }; + OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { + this.destination.next(innerValue); + }; + OuterSubscriber.prototype.notifyError = function (error, inner) { + this.destination.error(error); + }; + return OuterSubscriber; +})(Subscriber_1.Subscriber); +exports.OuterSubscriber = OuterSubscriber; + +},{"./Subscriber":7}],5:[function(require,module,exports){ +/* tslint:disable:no-unused-variable */ +// Subject imported before Observable to bypass circular dependency issue since +// Subject extends Observable and Observable references Subject in it's +// definition +var Subject_1 = require('./Subject'); +exports.Subject = Subject_1.Subject; +/* tslint:enable:no-unused-variable */ +var Observable_1 = require('./Observable'); +exports.Observable = Observable_1.Observable; +// statics +/* tslint:disable:no-use-before-declare */ +require('./add/operator/combineLatest-static'); +require('./add/operator/concat-static'); +require('./add/operator/merge-static'); +require('./add/observable/bindCallback'); +require('./add/observable/defer'); +require('./add/observable/empty'); +require('./add/observable/forkJoin'); +require('./add/observable/from'); +require('./add/observable/fromArray'); +require('./add/observable/fromEvent'); +require('./add/observable/fromEventPattern'); +require('./add/observable/fromPromise'); +require('./add/observable/interval'); +require('./add/observable/never'); +require('./add/observable/range'); +require('./add/observable/throw'); +require('./add/observable/timer'); +require('./add/operator/zip-static'); +//operators +require('./add/operator/buffer'); +require('./add/operator/bufferCount'); +require('./add/operator/bufferTime'); +require('./add/operator/bufferToggle'); +require('./add/operator/bufferWhen'); +require('./add/operator/catch'); +require('./add/operator/combineAll'); +require('./add/operator/combineLatest'); +require('./add/operator/concat'); +require('./add/operator/concatAll'); +require('./add/operator/concatMap'); +require('./add/operator/concatMapTo'); +require('./add/operator/count'); +require('./add/operator/dematerialize'); +require('./add/operator/debounce'); +require('./add/operator/debounceTime'); +require('./add/operator/defaultIfEmpty'); +require('./add/operator/delay'); +require('./add/operator/distinctUntilChanged'); +require('./add/operator/do'); +require('./add/operator/expand'); +require('./add/operator/filter'); +require('./add/operator/finally'); +require('./add/operator/first'); +require('./add/operator/groupBy'); +require('./add/operator/ignoreElements'); +require('./add/operator/every'); +require('./add/operator/last'); +require('./add/operator/map'); +require('./add/operator/mapTo'); +require('./add/operator/materialize'); +require('./add/operator/merge'); +require('./add/operator/mergeAll'); +require('./add/operator/mergeMap'); +require('./add/operator/mergeMapTo'); +require('./add/operator/multicast'); +require('./add/operator/observeOn'); +require('./add/operator/partition'); +require('./add/operator/publish'); +require('./add/operator/publishBehavior'); +require('./add/operator/publishReplay'); +require('./add/operator/publishLast'); +require('./add/operator/reduce'); +require('./add/operator/repeat'); +require('./add/operator/retry'); +require('./add/operator/retryWhen'); +require('./add/operator/sample'); +require('./add/operator/sampleTime'); +require('./add/operator/scan'); +require('./add/operator/share'); +require('./add/operator/single'); +require('./add/operator/skip'); +require('./add/operator/skipUntil'); +require('./add/operator/skipWhile'); +require('./add/operator/startWith'); +require('./add/operator/subscribeOn'); +require('./add/operator/switch'); +require('./add/operator/switchMap'); +require('./add/operator/switchMapTo'); +require('./add/operator/take'); +require('./add/operator/takeUntil'); +require('./add/operator/takeWhile'); +require('./add/operator/throttle'); +require('./add/operator/throttleTime'); +require('./add/operator/timeout'); +require('./add/operator/timeoutWith'); +require('./add/operator/toArray'); +require('./add/operator/toPromise'); +require('./add/operator/window'); +require('./add/operator/windowCount'); +require('./add/operator/windowTime'); +require('./add/operator/windowToggle'); +require('./add/operator/windowWhen'); +require('./add/operator/withLatestFrom'); +require('./add/operator/zip'); +require('./add/operator/zipAll'); +/* tslint:disable:no-unused-variable */ +var Subscription_1 = require('./Subscription'); +exports.Subscription = Subscription_1.Subscription; +var Subscriber_1 = require('./Subscriber'); +exports.Subscriber = Subscriber_1.Subscriber; +var AsyncSubject_1 = require('./subject/AsyncSubject'); +exports.AsyncSubject = AsyncSubject_1.AsyncSubject; +var ReplaySubject_1 = require('./subject/ReplaySubject'); +exports.ReplaySubject = ReplaySubject_1.ReplaySubject; +var BehaviorSubject_1 = require('./subject/BehaviorSubject'); +exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject; +var ConnectableObservable_1 = require('./observable/ConnectableObservable'); +exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable; +var Notification_1 = require('./Notification'); +exports.Notification = Notification_1.Notification; +var EmptyError_1 = require('./util/EmptyError'); +exports.EmptyError = EmptyError_1.EmptyError; +var ArgumentOutOfRangeError_1 = require('./util/ArgumentOutOfRangeError'); +exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; +var ObjectUnsubscribedError_1 = require('./util/ObjectUnsubscribedError'); +exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError; +var asap_1 = require('./scheduler/asap'); +var queue_1 = require('./scheduler/queue'); +var rxSubscriber_1 = require('./symbol/rxSubscriber'); +/* tslint:enable:no-unused-variable */ +/* tslint:disable:no-var-keyword */ +var Scheduler = { + asap: asap_1.asap, + queue: queue_1.queue +}; +exports.Scheduler = Scheduler; +var Symbol = { + rxSubscriber: rxSubscriber_1.rxSubscriber +}; +exports.Symbol = Symbol; +/* tslint:enable:no-var-keyword */ + +},{"./Notification":2,"./Observable":3,"./Subject":6,"./Subscriber":7,"./Subscription":8,"./add/observable/bindCallback":9,"./add/observable/defer":10,"./add/observable/empty":11,"./add/observable/forkJoin":12,"./add/observable/from":13,"./add/observable/fromArray":14,"./add/observable/fromEvent":15,"./add/observable/fromEventPattern":16,"./add/observable/fromPromise":17,"./add/observable/interval":18,"./add/observable/never":19,"./add/observable/range":20,"./add/observable/throw":21,"./add/observable/timer":22,"./add/operator/buffer":23,"./add/operator/bufferCount":24,"./add/operator/bufferTime":25,"./add/operator/bufferToggle":26,"./add/operator/bufferWhen":27,"./add/operator/catch":28,"./add/operator/combineAll":29,"./add/operator/combineLatest":31,"./add/operator/combineLatest-static":30,"./add/operator/concat":33,"./add/operator/concat-static":32,"./add/operator/concatAll":34,"./add/operator/concatMap":35,"./add/operator/concatMapTo":36,"./add/operator/count":37,"./add/operator/debounce":38,"./add/operator/debounceTime":39,"./add/operator/defaultIfEmpty":40,"./add/operator/delay":41,"./add/operator/dematerialize":42,"./add/operator/distinctUntilChanged":43,"./add/operator/do":44,"./add/operator/every":45,"./add/operator/expand":46,"./add/operator/filter":47,"./add/operator/finally":48,"./add/operator/first":49,"./add/operator/groupBy":50,"./add/operator/ignoreElements":51,"./add/operator/last":52,"./add/operator/map":53,"./add/operator/mapTo":54,"./add/operator/materialize":55,"./add/operator/merge":57,"./add/operator/merge-static":56,"./add/operator/mergeAll":58,"./add/operator/mergeMap":59,"./add/operator/mergeMapTo":60,"./add/operator/multicast":61,"./add/operator/observeOn":62,"./add/operator/partition":63,"./add/operator/publish":64,"./add/operator/publishBehavior":65,"./add/operator/publishLast":66,"./add/operator/publishReplay":67,"./add/operator/reduce":68,"./add/operator/repeat":69,"./add/operator/retry":70,"./add/operator/retryWhen":71,"./add/operator/sample":72,"./add/operator/sampleTime":73,"./add/operator/scan":74,"./add/operator/share":75,"./add/operator/single":76,"./add/operator/skip":77,"./add/operator/skipUntil":78,"./add/operator/skipWhile":79,"./add/operator/startWith":80,"./add/operator/subscribeOn":81,"./add/operator/switch":82,"./add/operator/switchMap":83,"./add/operator/switchMapTo":84,"./add/operator/take":85,"./add/operator/takeUntil":86,"./add/operator/takeWhile":87,"./add/operator/throttle":88,"./add/operator/throttleTime":89,"./add/operator/timeout":90,"./add/operator/timeoutWith":91,"./add/operator/toArray":92,"./add/operator/toPromise":93,"./add/operator/window":94,"./add/operator/windowCount":95,"./add/operator/windowTime":96,"./add/operator/windowToggle":97,"./add/operator/windowWhen":98,"./add/operator/withLatestFrom":99,"./add/operator/zip":101,"./add/operator/zip-static":100,"./add/operator/zipAll":102,"./observable/ConnectableObservable":103,"./scheduler/asap":215,"./scheduler/queue":216,"./subject/AsyncSubject":217,"./subject/BehaviorSubject":218,"./subject/ReplaySubject":219,"./symbol/rxSubscriber":221,"./util/ArgumentOutOfRangeError":222,"./util/EmptyError":223,"./util/ObjectUnsubscribedError":228}],6:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('./Observable'); +var Subscriber_1 = require('./Subscriber'); +var Subscription_1 = require('./Subscription'); +var SubjectSubscription_1 = require('./subject/SubjectSubscription'); +var rxSubscriber_1 = require('./symbol/rxSubscriber'); +var subscriptionAdd = Subscription_1.Subscription.prototype.add; +var subscriptionRemove = Subscription_1.Subscription.prototype.remove; +var subscriptionUnsubscribe = Subscription_1.Subscription.prototype.unsubscribe; +var subscriberNext = Subscriber_1.Subscriber.prototype.next; +var subscriberError = Subscriber_1.Subscriber.prototype.error; +var subscriberComplete = Subscriber_1.Subscriber.prototype.complete; +var _subscriberNext = Subscriber_1.Subscriber.prototype._next; +var _subscriberError = Subscriber_1.Subscriber.prototype._error; +var _subscriberComplete = Subscriber_1.Subscriber.prototype._complete; +var Subject = (function (_super) { + __extends(Subject, _super); + function Subject() { + _super.apply(this, arguments); + this.observers = []; + this.isUnsubscribed = false; + this.dispatching = false; + this.errorSignal = false; + this.completeSignal = false; + } + Subject.prototype[rxSubscriber_1.rxSubscriber] = function () { + return this; + }; + Subject.create = function (source, destination) { + return new BidirectionalSubject(source, destination); + }; + Subject.prototype.lift = function (operator) { + var subject = new BidirectionalSubject(this, this.destination || this); + subject.operator = operator; + return subject; + }; + Subject.prototype._subscribe = function (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 SubjectSubscription_1.SubjectSubscription(this, subscriber); + }; + Subject.prototype.add = function (subscription) { + subscriptionAdd.call(this, subscription); + }; + Subject.prototype.remove = function (subscription) { + subscriptionRemove.call(this, subscription); + }; + Subject.prototype.unsubscribe = function () { + this.observers = void 0; + subscriptionUnsubscribe.call(this); + }; + Subject.prototype.next = function (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 (err) { + if (this.isUnsubscribed || this.completeSignal) { + return; + } + this.errorSignal = true; + this.errorInstance = err; + if (this.dispatching) { + return; + } + this._error(err); + this.unsubscribe(); + }; + Subject.prototype.complete = function () { + if (this.isUnsubscribed || this.errorSignal) { + return; + } + this.completeSignal = true; + if (this.dispatching) { + return; + } + this._complete(); + this.unsubscribe(); + }; + Subject.prototype._next = function (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 (err) { + var index = -1; + var observers = this.observers; + var len = observers.length; + // optimization -- block next, complete, and unsubscribe while dispatching + this.observers = void 0; + this.isUnsubscribed = true; + while (++index < len) { + observers[index].error(err); + } + this.isUnsubscribed = false; + }; + Subject.prototype._complete = function () { + var index = -1; + var observers = this.observers; + var len = observers.length; + // optimization -- block next, complete, and unsubscribe while dispatching + this.observers = void 0; // optimization + this.isUnsubscribed = true; + while (++index < len) { + observers[index].complete(); + } + this.isUnsubscribed = false; + }; + return Subject; +})(Observable_1.Observable); +exports.Subject = Subject; +var BidirectionalSubject = (function (_super) { + __extends(BidirectionalSubject, _super); + function BidirectionalSubject(source, destination) { + _super.call(this); + this.source = source; + this.destination = destination; + } + BidirectionalSubject.prototype._subscribe = function (subscriber) { + var operator = this.operator; + return this.source._subscribe.call(this.source, operator ? operator.call(subscriber) : subscriber); + }; + BidirectionalSubject.prototype.next = function (value) { + subscriberNext.call(this, value); + }; + BidirectionalSubject.prototype.error = function (err) { + subscriberError.call(this, err); + }; + BidirectionalSubject.prototype.complete = function () { + subscriberComplete.call(this); + }; + BidirectionalSubject.prototype._next = function (value) { + _subscriberNext.call(this, value); + }; + BidirectionalSubject.prototype._error = function (err) { + _subscriberError.call(this, err); + }; + BidirectionalSubject.prototype._complete = function () { + _subscriberComplete.call(this); + }; + return BidirectionalSubject; +})(Subject); + +},{"./Observable":3,"./Subscriber":7,"./Subscription":8,"./subject/SubjectSubscription":220,"./symbol/rxSubscriber":221}],7:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var noop_1 = require('./util/noop'); +var throwError_1 = require('./util/throwError'); +var tryOrOnError_1 = require('./util/tryOrOnError'); +var Subscription_1 = require('./Subscription'); +var rxSubscriber_1 = require('./symbol/rxSubscriber'); +var Subscriber = (function (_super) { + __extends(Subscriber, _super); + function Subscriber(destination) { + _super.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.prototype[rxSubscriber_1.rxSubscriber] = function () { + return this; + }; + Object.defineProperty(Subscriber.prototype, "isUnsubscribed", { + get: function () { + var subscription = this._subscription; + if (subscription) { + // route to the shared Subscription if it exists + return this._isUnsubscribed || subscription.isUnsubscribed; + } + else { + return this._isUnsubscribed; + } + }, + set: function (value) { + var subscription = this._subscription; + if (subscription) { + // route to the shared Subscription if it exists + subscription.isUnsubscribed = Boolean(value); + } + else { + this._isUnsubscribed = Boolean(value); + } + }, + enumerable: true, + configurable: true + }); + Subscriber.create = function (next, error, complete) { + var subscriber = new Subscriber(); + subscriber._next = (typeof next === 'function') && tryOrOnError_1.tryOrOnError(next) || noop_1.noop; + subscriber._error = (typeof error === 'function') && error || throwError_1.throwError; + subscriber._complete = (typeof complete === 'function') && complete || noop_1.noop; + return subscriber; + }; + Subscriber.prototype.add = function (sub) { + // route add to the shared Subscription if it exists + var _subscription = this._subscription; + if (_subscription) { + _subscription.add(sub); + } + else { + _super.prototype.add.call(this, sub); + } + }; + Subscriber.prototype.remove = function (sub) { + // route remove to the shared Subscription if it exists + if (this._subscription) { + this._subscription.remove(sub); + } + else { + _super.prototype.remove.call(this, sub); + } + }; + Subscriber.prototype.unsubscribe = function () { + if (this._isUnsubscribed) { + return; + } + else if (this._subscription) { + this._isUnsubscribed = true; + } + else { + _super.prototype.unsubscribe.call(this); + } + }; + Subscriber.prototype._next = function (value) { + var destination = this.destination; + if (destination.next) { + destination.next(value); + } + }; + Subscriber.prototype._error = function (err) { + var destination = this.destination; + if (destination.error) { + destination.error(err); + } + }; + Subscriber.prototype._complete = function () { + var destination = this.destination; + if (destination.complete) { + destination.complete(); + } + }; + Subscriber.prototype.next = function (value) { + if (!this.isUnsubscribed) { + this._next(value); + } + }; + Subscriber.prototype.error = function (err) { + if (!this.isUnsubscribed) { + this._error(err); + this.unsubscribe(); + } + }; + Subscriber.prototype.complete = function () { + if (!this.isUnsubscribed) { + this._complete(); + this.unsubscribe(); + } + }; + return Subscriber; +})(Subscription_1.Subscription); +exports.Subscriber = Subscriber; + +},{"./Subscription":8,"./symbol/rxSubscriber":221,"./util/noop":236,"./util/throwError":240,"./util/tryOrOnError":242}],8:[function(require,module,exports){ +var noop_1 = require('./util/noop'); +var Subscription = (function () { + function Subscription(_unsubscribe) { + this.isUnsubscribed = false; + if (_unsubscribe) { + this._unsubscribe = _unsubscribe; + } + } + Subscription.prototype._unsubscribe = function () { + noop_1.noop(); + }; + Subscription.prototype.unsubscribe = function () { + 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 (subscription) { + // return early if: + // 1. the subscription is null + // 2. we're attempting to add our this + // 3. we're attempting to add the static `empty` 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 (subscription) { + // return early if: + // 1. the subscription is null + // 2. we're attempting to remove ourthis + // 3. we're attempting to remove the static `empty` 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); + } + } + }; + Subscription.EMPTY = (function (empty) { + empty.isUnsubscribed = true; + return empty; + }(new Subscription())); + return Subscription; +})(); +exports.Subscription = Subscription; + +},{"./util/noop":236}],9:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var bindCallback_1 = require('../../observable/bindCallback'); +Observable_1.Observable.bindCallback = bindCallback_1.BoundCallbackObservable.create; + +},{"../../Observable":3,"../../observable/bindCallback":107}],10:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var defer_1 = require('../../observable/defer'); +Observable_1.Observable.defer = defer_1.DeferObservable.create; + +},{"../../Observable":3,"../../observable/defer":108}],11:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var empty_1 = require('../../observable/empty'); +Observable_1.Observable.empty = empty_1.EmptyObservable.create; + +},{"../../Observable":3,"../../observable/empty":109}],12:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var forkJoin_1 = require('../../observable/forkJoin'); +Observable_1.Observable.forkJoin = forkJoin_1.ForkJoinObservable.create; + +},{"../../Observable":3,"../../observable/forkJoin":110}],13:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var from_1 = require('../../observable/from'); +Observable_1.Observable.from = from_1.FromObservable.create; + +},{"../../Observable":3,"../../observable/from":111}],14:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var fromArray_1 = require('../../observable/fromArray'); +Observable_1.Observable.fromArray = fromArray_1.ArrayObservable.create; +Observable_1.Observable.of = fromArray_1.ArrayObservable.of; + +},{"../../Observable":3,"../../observable/fromArray":112}],15:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var fromEvent_1 = require('../../observable/fromEvent'); +Observable_1.Observable.fromEvent = fromEvent_1.FromEventObservable.create; + +},{"../../Observable":3,"../../observable/fromEvent":113}],16:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var fromEventPattern_1 = require('../../observable/fromEventPattern'); +Observable_1.Observable.fromEventPattern = fromEventPattern_1.FromEventPatternObservable.create; + +},{"../../Observable":3,"../../observable/fromEventPattern":114}],17:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var fromPromise_1 = require('../../observable/fromPromise'); +Observable_1.Observable.fromPromise = fromPromise_1.PromiseObservable.create; + +},{"../../Observable":3,"../../observable/fromPromise":115}],18:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var interval_1 = require('../../observable/interval'); +Observable_1.Observable.interval = interval_1.IntervalObservable.create; + +},{"../../Observable":3,"../../observable/interval":116}],19:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var never_1 = require('../../observable/never'); +Observable_1.Observable.never = never_1.InfiniteObservable.create; + +},{"../../Observable":3,"../../observable/never":117}],20:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var range_1 = require('../../observable/range'); +Observable_1.Observable.range = range_1.RangeObservable.create; + +},{"../../Observable":3,"../../observable/range":118}],21:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var throw_1 = require('../../observable/throw'); +Observable_1.Observable.throw = throw_1.ErrorObservable.create; + +},{"../../Observable":3,"../../observable/throw":119}],22:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var timer_1 = require('../../observable/timer'); +Observable_1.Observable.timer = timer_1.TimerObservable.create; + +},{"../../Observable":3,"../../observable/timer":120}],23:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var buffer_1 = require('../../operator/buffer'); +Observable_1.Observable.prototype.buffer = buffer_1.buffer; + +},{"../../Observable":3,"../../operator/buffer":121}],24:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var bufferCount_1 = require('../../operator/bufferCount'); +Observable_1.Observable.prototype.bufferCount = bufferCount_1.bufferCount; + +},{"../../Observable":3,"../../operator/bufferCount":122}],25:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var bufferTime_1 = require('../../operator/bufferTime'); +Observable_1.Observable.prototype.bufferTime = bufferTime_1.bufferTime; + +},{"../../Observable":3,"../../operator/bufferTime":123}],26:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var bufferToggle_1 = require('../../operator/bufferToggle'); +Observable_1.Observable.prototype.bufferToggle = bufferToggle_1.bufferToggle; + +},{"../../Observable":3,"../../operator/bufferToggle":124}],27:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var bufferWhen_1 = require('../../operator/bufferWhen'); +Observable_1.Observable.prototype.bufferWhen = bufferWhen_1.bufferWhen; + +},{"../../Observable":3,"../../operator/bufferWhen":125}],28:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var catch_1 = require('../../operator/catch'); +Observable_1.Observable.prototype.catch = catch_1._catch; + +},{"../../Observable":3,"../../operator/catch":126}],29:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var combineAll_1 = require('../../operator/combineAll'); +Observable_1.Observable.prototype.combineAll = combineAll_1.combineAll; + +},{"../../Observable":3,"../../operator/combineAll":127}],30:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var combineLatest_static_1 = require('../../operator/combineLatest-static'); +Observable_1.Observable.combineLatest = combineLatest_static_1.combineLatest; + +},{"../../Observable":3,"../../operator/combineLatest-static":128}],31:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var combineLatest_1 = require('../../operator/combineLatest'); +Observable_1.Observable.prototype.combineLatest = combineLatest_1.combineLatest; + +},{"../../Observable":3,"../../operator/combineLatest":130}],32:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var concat_static_1 = require('../../operator/concat-static'); +Observable_1.Observable.concat = concat_static_1.concat; + +},{"../../Observable":3,"../../operator/concat-static":131}],33:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var concat_1 = require('../../operator/concat'); +Observable_1.Observable.prototype.concat = concat_1.concat; + +},{"../../Observable":3,"../../operator/concat":132}],34:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var concatAll_1 = require('../../operator/concatAll'); +Observable_1.Observable.prototype.concatAll = concatAll_1.concatAll; + +},{"../../Observable":3,"../../operator/concatAll":133}],35:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var concatMap_1 = require('../../operator/concatMap'); +Observable_1.Observable.prototype.concatMap = concatMap_1.concatMap; + +},{"../../Observable":3,"../../operator/concatMap":134}],36:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var concatMapTo_1 = require('../../operator/concatMapTo'); +Observable_1.Observable.prototype.concatMapTo = concatMapTo_1.concatMapTo; + +},{"../../Observable":3,"../../operator/concatMapTo":135}],37:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var count_1 = require('../../operator/count'); +Observable_1.Observable.prototype.count = count_1.count; + +},{"../../Observable":3,"../../operator/count":136}],38:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var debounce_1 = require('../../operator/debounce'); +Observable_1.Observable.prototype.debounce = debounce_1.debounce; + +},{"../../Observable":3,"../../operator/debounce":137}],39:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var debounceTime_1 = require('../../operator/debounceTime'); +Observable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime; + +},{"../../Observable":3,"../../operator/debounceTime":138}],40:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var defaultIfEmpty_1 = require('../../operator/defaultIfEmpty'); +Observable_1.Observable.prototype.defaultIfEmpty = defaultIfEmpty_1.defaultIfEmpty; + +},{"../../Observable":3,"../../operator/defaultIfEmpty":139}],41:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var delay_1 = require('../../operator/delay'); +Observable_1.Observable.prototype.delay = delay_1.delay; + +},{"../../Observable":3,"../../operator/delay":140}],42:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var dematerialize_1 = require('../../operator/dematerialize'); +Observable_1.Observable.prototype.dematerialize = dematerialize_1.dematerialize; + +},{"../../Observable":3,"../../operator/dematerialize":141}],43:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var distinctUntilChanged_1 = require('../../operator/distinctUntilChanged'); +Observable_1.Observable.prototype.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged; + +},{"../../Observable":3,"../../operator/distinctUntilChanged":142}],44:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var do_1 = require('../../operator/do'); +Observable_1.Observable.prototype.do = do_1._do; + +},{"../../Observable":3,"../../operator/do":143}],45:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var every_1 = require('../../operator/every'); +Observable_1.Observable.prototype.every = every_1.every; + +},{"../../Observable":3,"../../operator/every":144}],46:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var expand_1 = require('../../operator/expand'); +Observable_1.Observable.prototype.expand = expand_1.expand; + +},{"../../Observable":3,"../../operator/expand":146}],47:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var filter_1 = require('../../operator/filter'); +Observable_1.Observable.prototype.filter = filter_1.filter; + +},{"../../Observable":3,"../../operator/filter":147}],48:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var finally_1 = require('../../operator/finally'); +Observable_1.Observable.prototype.finally = finally_1._finally; + +},{"../../Observable":3,"../../operator/finally":148}],49:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var first_1 = require('../../operator/first'); +Observable_1.Observable.prototype.first = first_1.first; + +},{"../../Observable":3,"../../operator/first":149}],50:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var groupBy_1 = require('../../operator/groupBy'); +Observable_1.Observable.prototype.groupBy = groupBy_1.groupBy; + +},{"../../Observable":3,"../../operator/groupBy":151}],51:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var ignoreElements_1 = require('../../operator/ignoreElements'); +Observable_1.Observable.prototype.ignoreElements = ignoreElements_1.ignoreElements; + +},{"../../Observable":3,"../../operator/ignoreElements":152}],52:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var last_1 = require('../../operator/last'); +Observable_1.Observable.prototype.last = last_1.last; + +},{"../../Observable":3,"../../operator/last":153}],53:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var map_1 = require('../../operator/map'); +Observable_1.Observable.prototype.map = map_1.map; + +},{"../../Observable":3,"../../operator/map":154}],54:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var mapTo_1 = require('../../operator/mapTo'); +Observable_1.Observable.prototype.mapTo = mapTo_1.mapTo; + +},{"../../Observable":3,"../../operator/mapTo":155}],55:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var materialize_1 = require('../../operator/materialize'); +Observable_1.Observable.prototype.materialize = materialize_1.materialize; + +},{"../../Observable":3,"../../operator/materialize":156}],56:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var merge_static_1 = require('../../operator/merge-static'); +Observable_1.Observable.merge = merge_static_1.merge; + +},{"../../Observable":3,"../../operator/merge-static":157}],57:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var merge_1 = require('../../operator/merge'); +Observable_1.Observable.prototype.merge = merge_1.merge; + +},{"../../Observable":3,"../../operator/merge":158}],58:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var mergeAll_1 = require('../../operator/mergeAll'); +Observable_1.Observable.prototype.mergeAll = mergeAll_1.mergeAll; + +},{"../../Observable":3,"../../operator/mergeAll":160}],59:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var mergeMap_1 = require('../../operator/mergeMap'); +Observable_1.Observable.prototype.mergeMap = mergeMap_1.mergeMap; +Observable_1.Observable.prototype.flatMap = mergeMap_1.mergeMap; + +},{"../../Observable":3,"../../operator/mergeMap":162}],60:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var mergeMapTo_1 = require('../../operator/mergeMapTo'); +Observable_1.Observable.prototype.mergeMapTo = mergeMapTo_1.mergeMapTo; + +},{"../../Observable":3,"../../operator/mergeMapTo":164}],61:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var multicast_1 = require('../../operator/multicast'); +Observable_1.Observable.prototype.multicast = multicast_1.multicast; + +},{"../../Observable":3,"../../operator/multicast":165}],62:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var observeOn_1 = require('../../operator/observeOn'); +Observable_1.Observable.prototype.observeOn = observeOn_1.observeOn; + +},{"../../Observable":3,"../../operator/observeOn":167}],63:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var partition_1 = require('../../operator/partition'); +Observable_1.Observable.prototype.partition = partition_1.partition; + +},{"../../Observable":3,"../../operator/partition":168}],64:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var publish_1 = require('../../operator/publish'); +Observable_1.Observable.prototype.publish = publish_1.publish; + +},{"../../Observable":3,"../../operator/publish":169}],65:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var publishBehavior_1 = require('../../operator/publishBehavior'); +Observable_1.Observable.prototype.publishBehavior = publishBehavior_1.publishBehavior; + +},{"../../Observable":3,"../../operator/publishBehavior":170}],66:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var publishLast_1 = require('../../operator/publishLast'); +Observable_1.Observable.prototype.publishLast = publishLast_1.publishLast; + +},{"../../Observable":3,"../../operator/publishLast":171}],67:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var publishReplay_1 = require('../../operator/publishReplay'); +Observable_1.Observable.prototype.publishReplay = publishReplay_1.publishReplay; + +},{"../../Observable":3,"../../operator/publishReplay":172}],68:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var reduce_1 = require('../../operator/reduce'); +Observable_1.Observable.prototype.reduce = reduce_1.reduce; + +},{"../../Observable":3,"../../operator/reduce":174}],69:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var repeat_1 = require('../../operator/repeat'); +Observable_1.Observable.prototype.repeat = repeat_1.repeat; + +},{"../../Observable":3,"../../operator/repeat":175}],70:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var retry_1 = require('../../operator/retry'); +Observable_1.Observable.prototype.retry = retry_1.retry; + +},{"../../Observable":3,"../../operator/retry":176}],71:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var retryWhen_1 = require('../../operator/retryWhen'); +Observable_1.Observable.prototype.retryWhen = retryWhen_1.retryWhen; + +},{"../../Observable":3,"../../operator/retryWhen":177}],72:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var sample_1 = require('../../operator/sample'); +Observable_1.Observable.prototype.sample = sample_1.sample; + +},{"../../Observable":3,"../../operator/sample":178}],73:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var sampleTime_1 = require('../../operator/sampleTime'); +Observable_1.Observable.prototype.sampleTime = sampleTime_1.sampleTime; + +},{"../../Observable":3,"../../operator/sampleTime":179}],74:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var scan_1 = require('../../operator/scan'); +Observable_1.Observable.prototype.scan = scan_1.scan; + +},{"../../Observable":3,"../../operator/scan":180}],75:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var share_1 = require('../../operator/share'); +Observable_1.Observable.prototype.share = share_1.share; + +},{"../../Observable":3,"../../operator/share":181}],76:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var single_1 = require('../../operator/single'); +Observable_1.Observable.prototype.single = single_1.single; + +},{"../../Observable":3,"../../operator/single":182}],77:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var skip_1 = require('../../operator/skip'); +Observable_1.Observable.prototype.skip = skip_1.skip; + +},{"../../Observable":3,"../../operator/skip":183}],78:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var skipUntil_1 = require('../../operator/skipUntil'); +Observable_1.Observable.prototype.skipUntil = skipUntil_1.skipUntil; + +},{"../../Observable":3,"../../operator/skipUntil":184}],79:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var skipWhile_1 = require('../../operator/skipWhile'); +Observable_1.Observable.prototype.skipWhile = skipWhile_1.skipWhile; + +},{"../../Observable":3,"../../operator/skipWhile":185}],80:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var startWith_1 = require('../../operator/startWith'); +Observable_1.Observable.prototype.startWith = startWith_1.startWith; + +},{"../../Observable":3,"../../operator/startWith":186}],81:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var subscribeOn_1 = require('../../operator/subscribeOn'); +Observable_1.Observable.prototype.subscribeOn = subscribeOn_1.subscribeOn; + +},{"../../Observable":3,"../../operator/subscribeOn":187}],82:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var switch_1 = require('../../operator/switch'); +Observable_1.Observable.prototype.switch = switch_1._switch; + +},{"../../Observable":3,"../../operator/switch":188}],83:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var switchMap_1 = require('../../operator/switchMap'); +Observable_1.Observable.prototype.switchMap = switchMap_1.switchMap; + +},{"../../Observable":3,"../../operator/switchMap":189}],84:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var switchMapTo_1 = require('../../operator/switchMapTo'); +Observable_1.Observable.prototype.switchMapTo = switchMapTo_1.switchMapTo; + +},{"../../Observable":3,"../../operator/switchMapTo":190}],85:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var take_1 = require('../../operator/take'); +Observable_1.Observable.prototype.take = take_1.take; + +},{"../../Observable":3,"../../operator/take":191}],86:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var takeUntil_1 = require('../../operator/takeUntil'); +Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil; + +},{"../../Observable":3,"../../operator/takeUntil":192}],87:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var takeWhile_1 = require('../../operator/takeWhile'); +Observable_1.Observable.prototype.takeWhile = takeWhile_1.takeWhile; + +},{"../../Observable":3,"../../operator/takeWhile":193}],88:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var throttle_1 = require('../../operator/throttle'); +Observable_1.Observable.prototype.throttle = throttle_1.throttle; + +},{"../../Observable":3,"../../operator/throttle":194}],89:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var throttleTime_1 = require('../../operator/throttleTime'); +Observable_1.Observable.prototype.throttleTime = throttleTime_1.throttleTime; + +},{"../../Observable":3,"../../operator/throttleTime":195}],90:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var timeout_1 = require('../../operator/timeout'); +Observable_1.Observable.prototype.timeout = timeout_1.timeout; + +},{"../../Observable":3,"../../operator/timeout":196}],91:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var timeoutWith_1 = require('../../operator/timeoutWith'); +Observable_1.Observable.prototype.timeoutWith = timeoutWith_1.timeoutWith; + +},{"../../Observable":3,"../../operator/timeoutWith":197}],92:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var toArray_1 = require('../../operator/toArray'); +Observable_1.Observable.prototype.toArray = toArray_1.toArray; + +},{"../../Observable":3,"../../operator/toArray":198}],93:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var toPromise_1 = require('../../operator/toPromise'); +Observable_1.Observable.prototype.toPromise = toPromise_1.toPromise; + +},{"../../Observable":3,"../../operator/toPromise":199}],94:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var window_1 = require('../../operator/window'); +Observable_1.Observable.prototype.window = window_1.window; + +},{"../../Observable":3,"../../operator/window":200}],95:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var windowCount_1 = require('../../operator/windowCount'); +Observable_1.Observable.prototype.windowCount = windowCount_1.windowCount; + +},{"../../Observable":3,"../../operator/windowCount":201}],96:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var windowTime_1 = require('../../operator/windowTime'); +Observable_1.Observable.prototype.windowTime = windowTime_1.windowTime; + +},{"../../Observable":3,"../../operator/windowTime":202}],97:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var windowToggle_1 = require('../../operator/windowToggle'); +Observable_1.Observable.prototype.windowToggle = windowToggle_1.windowToggle; + +},{"../../Observable":3,"../../operator/windowToggle":203}],98:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var windowWhen_1 = require('../../operator/windowWhen'); +Observable_1.Observable.prototype.windowWhen = windowWhen_1.windowWhen; + +},{"../../Observable":3,"../../operator/windowWhen":204}],99:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var withLatestFrom_1 = require('../../operator/withLatestFrom'); +Observable_1.Observable.prototype.withLatestFrom = withLatestFrom_1.withLatestFrom; + +},{"../../Observable":3,"../../operator/withLatestFrom":205}],100:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var zip_static_1 = require('../../operator/zip-static'); +Observable_1.Observable.zip = zip_static_1.zip; + +},{"../../Observable":3,"../../operator/zip-static":206}],101:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var zip_1 = require('../../operator/zip'); +Observable_1.Observable.prototype.zip = zip_1.zipProto; + +},{"../../Observable":3,"../../operator/zip":208}],102:[function(require,module,exports){ +var Observable_1 = require('../../Observable'); +var zipAll_1 = require('../../operator/zipAll'); +Observable_1.Observable.prototype.zipAll = zipAll_1.zipAll; + +},{"../../Observable":3,"../../operator/zipAll":209}],103:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var Subscription_1 = require('../Subscription'); +var Subscriber_1 = require('../Subscriber'); +var ConnectableObservable = (function (_super) { + __extends(ConnectableObservable, _super); + function ConnectableObservable(source, subjectFactory) { + _super.call(this); + this.source = source; + this.subjectFactory = subjectFactory; + } + ConnectableObservable.prototype._subscribe = function (subscriber) { + return this._getSubject().subscribe(subscriber); + }; + ConnectableObservable.prototype._getSubject = function () { + var subject = this.subject; + if (subject && !subject.isUnsubscribed) { + return subject; + } + return (this.subject = this.subjectFactory()); + }; + ConnectableObservable.prototype.connect = function () { + 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 () { + return new RefCountObservable(this); + }; + return ConnectableObservable; +})(Observable_1.Observable); +exports.ConnectableObservable = ConnectableObservable; +var ConnectableSubscription = (function (_super) { + __extends(ConnectableSubscription, _super); + function ConnectableSubscription(connectable) { + _super.call(this); + this.connectable = connectable; + } + ConnectableSubscription.prototype._unsubscribe = function () { + var connectable = this.connectable; + connectable.subject = void 0; + connectable.subscription = void 0; + this.connectable = void 0; + }; + return ConnectableSubscription; +})(Subscription_1.Subscription); +var RefCountObservable = (function (_super) { + __extends(RefCountObservable, _super); + function RefCountObservable(connectable, refCount) { + if (refCount === void 0) { refCount = 0; } + _super.call(this); + this.connectable = connectable; + this.refCount = refCount; + } + RefCountObservable.prototype._subscribe = function (subscriber) { + var connectable = this.connectable; + var refCountSubscriber = new RefCountSubscriber(subscriber, this); + var subscription = connectable.subscribe(refCountSubscriber); + if (!subscription.isUnsubscribed && ++this.refCount === 1) { + refCountSubscriber.connection = this.connection = connectable.connect(); + } + return subscription; + }; + return RefCountObservable; +})(Observable_1.Observable); +var RefCountSubscriber = (function (_super) { + __extends(RefCountSubscriber, _super); + function RefCountSubscriber(destination, refCountObservable) { + _super.call(this, null); + this.destination = destination; + this.refCountObservable = refCountObservable; + this.connection = refCountObservable.connection; + destination.add(this); + } + RefCountSubscriber.prototype._next = function (value) { + this.destination.next(value); + }; + RefCountSubscriber.prototype._error = function (err) { + this._resetConnectable(); + this.destination.error(err); + }; + RefCountSubscriber.prototype._complete = function () { + this._resetConnectable(); + this.destination.complete(); + }; + RefCountSubscriber.prototype._resetConnectable = function () { + var observable = this.refCountObservable; + var obsConnection = observable.connection; + var subConnection = this.connection; + if (subConnection && subConnection === obsConnection) { + observable.refCount = 0; + obsConnection.unsubscribe(); + observable.connection = void 0; + this.unsubscribe(); + } + }; + RefCountSubscriber.prototype._unsubscribe = function () { + var observable = this.refCountObservable; + if (observable.refCount === 0) { + return; + } + if (--observable.refCount === 0) { + var obsConnection = observable.connection; + var subConnection = this.connection; + if (subConnection && subConnection === obsConnection) { + obsConnection.unsubscribe(); + observable.connection = void 0; + } + } + }; + return RefCountSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Observable":3,"../Subscriber":7,"../Subscription":8}],104:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var root_1 = require('../util/root'); +var SymbolShim_1 = require('../util/SymbolShim'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var IteratorObservable = (function (_super) { + __extends(IteratorObservable, _super); + function IteratorObservable(iterator, project, thisArg, scheduler) { + _super.call(this); + this.project = project; + this.thisArg = thisArg; + this.scheduler = 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.'); + } + this.iterator = getIterator(iterator); + } + IteratorObservable.create = function (iterator, project, thisArg, scheduler) { + return new IteratorObservable(iterator, project, thisArg, scheduler); + }; + IteratorObservable.dispatch = function (state) { + var index = state.index, hasError = state.hasError, thisArg = state.thisArg, project = state.project, iterator = state.iterator, subscriber = state.subscriber; + if (hasError) { + subscriber.error(state.error); + return; + } + var result = iterator.next(); + if (result.done) { + subscriber.complete(); + return; + } + if (project) { + result = tryCatch_1.tryCatch(project).call(thisArg, result.value, index); + if (result === errorObject_1.errorObject) { + state.error = errorObject_1.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 (subscriber) { + var index = 0; + var _a = this, iterator = _a.iterator, project = _a.project, thisArg = _a.thisArg, scheduler = _a.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 = tryCatch_1.tryCatch(project).call(thisArg, result.value, index++); + if (result === errorObject_1.errorObject) { + subscriber.error(errorObject_1.errorObject.e); + break; + } + subscriber.next(result); + } + else { + subscriber.next(result.value); + } + if (subscriber.isUnsubscribed) { + break; + } + } while (true); + } + }; + return IteratorObservable; +})(Observable_1.Observable); +exports.IteratorObservable = IteratorObservable; +var StringIterator = (function () { + function StringIterator(str, idx, len) { + if (idx === void 0) { idx = 0; } + if (len === void 0) { len = str.length; } + this.str = str; + this.idx = idx; + this.len = len; + } + StringIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function () { return (this); }; + StringIterator.prototype.next = function () { + 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, idx, len) { + if (idx === void 0) { idx = 0; } + if (len === void 0) { len = toLength(arr); } + this.arr = arr; + this.idx = idx; + this.len = len; + } + ArrayIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function () { return this; }; + ArrayIterator.prototype.next = function () { + return this.idx < this.len ? { + done: false, + value: this.arr[this.idx++] + } : { + done: true, + value: undefined + }; + }; + return ArrayIterator; +})(); +function getIterator(obj) { + var i = obj[SymbolShim_1.SymbolShim.iterator]; + if (!i && typeof obj === 'string') { + return new StringIterator(obj); + } + if (!i && obj.length !== undefined) { + return new ArrayIterator(obj); + } + if (!i) { + throw new TypeError('Object is not iterable'); + } + return obj[SymbolShim_1.SymbolShim.iterator](); +} +var maxSafeInteger = Math.pow(2, 53) - 1; +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' && root_1.root.isFinite(value); +} +function sign(value) { + var valueAsNumber = +value; + if (valueAsNumber === 0) { + return valueAsNumber; + } + if (isNaN(valueAsNumber)) { + return valueAsNumber; + } + return valueAsNumber < 0 ? -1 : 1; +} + +},{"../Observable":3,"../util/SymbolShim":229,"../util/errorObject":230,"../util/root":238,"../util/tryCatch":241}],105:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var throw_1 = require('./throw'); +var empty_1 = require('./empty'); +var ScalarObservable = (function (_super) { + __extends(ScalarObservable, _super); + function ScalarObservable(value, scheduler) { + _super.call(this); + this.value = value; + this.scheduler = scheduler; + this._isScalar = true; + } + ScalarObservable.create = function (value, scheduler) { + return new ScalarObservable(value, scheduler); + }; + ScalarObservable.dispatch = function (state) { + var done = state.done, value = state.value, 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 (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; +})(Observable_1.Observable); +exports.ScalarObservable = ScalarObservable; +// TypeScript is weird about class prototype member functions and instance properties touching on it's plate. +var proto = ScalarObservable.prototype; +proto.map = function (project, thisArg) { + var result = tryCatch_1.tryCatch(project).call(thisArg || this, this.value, 0); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } + else { + return new ScalarObservable(project.call(thisArg || this, this.value, 0)); + } +}; +proto.filter = function (select, thisArg) { + var result = tryCatch_1.tryCatch(select).call(thisArg || this, this.value, 0); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } + else if (result) { + return this; + } + else { + return new empty_1.EmptyObservable(); + } +}; +proto.reduce = function (project, seed) { + if (typeof seed === 'undefined') { + return this; + } + var result = tryCatch_1.tryCatch(project)(seed, this.value); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } + else { + return new ScalarObservable(result); + } +}; +proto.scan = function (project, acc) { + return this.reduce(project, acc); +}; +proto.count = function (predicate) { + if (!predicate) { + return new ScalarObservable(1); + } + else { + var result = tryCatch_1.tryCatch(predicate).call(this, this.value, 0, this); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e); + } + else { + return new ScalarObservable(result ? 1 : 0); + } + } +}; +proto.skip = function (count) { + if (count > 0) { + return new empty_1.EmptyObservable(); + } + return this; +}; +proto.take = function (count) { + if (count > 0) { + return this; + } + return new empty_1.EmptyObservable(); +}; + +},{"../Observable":3,"../util/errorObject":230,"../util/tryCatch":241,"./empty":109,"./throw":119}],106:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var asap_1 = require('../scheduler/asap'); +var isNumeric_1 = require('../util/isNumeric'); +var SubscribeOnObservable = (function (_super) { + __extends(SubscribeOnObservable, _super); + function SubscribeOnObservable(source, delayTime, scheduler) { + if (delayTime === void 0) { delayTime = 0; } + if (scheduler === void 0) { scheduler = asap_1.asap; } + _super.call(this); + this.source = source; + this.delayTime = delayTime; + this.scheduler = scheduler; + if (!isNumeric_1.isNumeric(delayTime) || delayTime < 0) { + this.delayTime = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = asap_1.asap; + } + } + SubscribeOnObservable.create = function (source, delay, scheduler) { + if (delay === void 0) { delay = 0; } + if (scheduler === void 0) { scheduler = asap_1.asap; } + return new SubscribeOnObservable(source, delay, scheduler); + }; + SubscribeOnObservable.dispatch = function (_a) { + var source = _a.source, subscriber = _a.subscriber; + return source.subscribe(subscriber); + }; + SubscribeOnObservable.prototype._subscribe = function (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; +})(Observable_1.Observable); +exports.SubscribeOnObservable = SubscribeOnObservable; + +},{"../Observable":3,"../scheduler/asap":215,"../util/isNumeric":233}],107:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var AsyncSubject_1 = require('../subject/AsyncSubject'); +var BoundCallbackObservable = (function (_super) { + __extends(BoundCallbackObservable, _super); + function BoundCallbackObservable(callbackFunc, selector, args, scheduler) { + _super.call(this); + this.callbackFunc = callbackFunc; + this.selector = selector; + this.args = args; + this.scheduler = scheduler; + } + BoundCallbackObservable.create = function (callbackFunc, selector, scheduler) { + if (selector === void 0) { selector = undefined; } + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return new BoundCallbackObservable(callbackFunc, selector, args, scheduler); + }; + }; + BoundCallbackObservable.prototype._subscribe = function (subscriber) { + var callbackFunc = this.callbackFunc; + var args = this.args; + var scheduler = this.scheduler; + var subject = this.subject; + if (!scheduler) { + if (!subject) { + subject = this.subject = new AsyncSubject_1.AsyncSubject(); + var handler = function handlerFn() { + var innerArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + innerArgs[_i - 0] = arguments[_i]; + } + var source = handlerFn.source; + var selector = source.selector, subject = source.subject; + if (selector) { + var result_1 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); + if (result_1 === errorObject_1.errorObject) { + subject.error(errorObject_1.errorObject.e); + } + else { + subject.next(result_1); + subject.complete(); + } + } + else { + subject.next(innerArgs.length === 1 ? innerArgs[0] : innerArgs); + subject.complete(); + } + }; + // use named function instance to avoid closure. + handler.source = this; + var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); + if (result === errorObject_1.errorObject) { + subject.error(errorObject_1.errorObject.e); + } + } + return subject.subscribe(subscriber); + } + else { + subscriber.add(scheduler.schedule(dispatch, 0, { source: this, subscriber: subscriber })); + return subscriber; + } + }; + return BoundCallbackObservable; +})(Observable_1.Observable); +exports.BoundCallbackObservable = BoundCallbackObservable; +function dispatch(state) { + var source = state.source, subscriber = state.subscriber; + var callbackFunc = source.callbackFunc, args = source.args, scheduler = source.scheduler; + var subject = source.subject; + if (!subject) { + subject = source.subject = new AsyncSubject_1.AsyncSubject(); + var handler = function handlerFn() { + var innerArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + innerArgs[_i - 0] = arguments[_i]; + } + var source = handlerFn.source; + var selector = source.selector, subject = source.subject; + if (selector) { + var result_2 = tryCatch_1.tryCatch(selector).apply(this, innerArgs); + if (result_2 === errorObject_1.errorObject) { + subject.add(scheduler.schedule(dispatchError, 0, { err: errorObject_1.errorObject.e, subject: subject })); + } + else { + subject.add(scheduler.schedule(dispatchNext, 0, { value: result_2, subject: subject })); + } + } + else { + var value = innerArgs.length === 1 ? innerArgs[0] : innerArgs; + subject.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject })); + } + }; + // use named function to pass values in without closure + handler.source = source; + var result = tryCatch_1.tryCatch(callbackFunc).apply(this, args.concat(handler)); + if (result === errorObject_1.errorObject) { + subject.error(errorObject_1.errorObject.e); + } + } + this.add(subject.subscribe(subscriber)); +} +function dispatchNext(_a) { + var value = _a.value, subject = _a.subject; + subject.next(value); + subject.complete(); +} +function dispatchError(_a) { + var err = _a.err, subject = _a.subject; + subject.error(err); +} + +},{"../Observable":3,"../subject/AsyncSubject":217,"../util/errorObject":230,"../util/tryCatch":241}],108:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var DeferObservable = (function (_super) { + __extends(DeferObservable, _super); + function DeferObservable(observableFactory) { + _super.call(this); + this.observableFactory = observableFactory; + } + DeferObservable.create = function (observableFactory) { + return new DeferObservable(observableFactory); + }; + DeferObservable.prototype._subscribe = function (subscriber) { + var result = tryCatch_1.tryCatch(this.observableFactory)(); + if (result === errorObject_1.errorObject) { + subscriber.error(errorObject_1.errorObject.e); + } + else { + result.subscribe(subscriber); + } + }; + return DeferObservable; +})(Observable_1.Observable); +exports.DeferObservable = DeferObservable; + +},{"../Observable":3,"../util/errorObject":230,"../util/tryCatch":241}],109:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var EmptyObservable = (function (_super) { + __extends(EmptyObservable, _super); + function EmptyObservable(scheduler) { + _super.call(this); + this.scheduler = scheduler; + } + EmptyObservable.create = function (scheduler) { + return new EmptyObservable(scheduler); + }; + EmptyObservable.dispatch = function (_a) { + var subscriber = _a.subscriber; + subscriber.complete(); + }; + EmptyObservable.prototype._subscribe = function (subscriber) { + var scheduler = this.scheduler; + if (scheduler) { + subscriber.add(scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber })); + } + else { + subscriber.complete(); + } + }; + return EmptyObservable; +})(Observable_1.Observable); +exports.EmptyObservable = EmptyObservable; + +},{"../Observable":3}],110:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var Subscriber_1 = require('../Subscriber'); +var fromPromise_1 = require('./fromPromise'); +var empty_1 = require('./empty'); +var isPromise_1 = require('../util/isPromise'); +var isArray_1 = require('../util/isArray'); +var ForkJoinObservable = (function (_super) { + __extends(ForkJoinObservable, _super); + function ForkJoinObservable(sources, resultSelector) { + _super.call(this); + this.sources = sources; + this.resultSelector = resultSelector; + } + ForkJoinObservable.create = function () { + var sources = []; + for (var _i = 0; _i < arguments.length; _i++) { + sources[_i - 0] = arguments[_i]; + } + if (sources === null || arguments.length === 0) { + return new empty_1.EmptyObservable(); + } + var resultSelector = null; + if (typeof sources[sources.length - 1] === 'function') { + resultSelector = sources.pop(); + } + // if the first and only other argument besides the resultSelector is an array + // assume it's been called with `forkJoin([obs1, obs2, obs3], resultSelector)` + if (sources.length === 1 && isArray_1.isArray(sources[0])) { + sources = sources[0]; + } + return new ForkJoinObservable(sources, resultSelector); + }; + ForkJoinObservable.prototype._subscribe = function (subscriber) { + var sources = this.sources; + var len = sources.length; + var context = { completed: 0, total: len, values: emptyArray(len), selector: this.resultSelector }; + for (var i = 0; i < len; i++) { + var source = sources[i]; + if (isPromise_1.isPromise(source)) { + source = new fromPromise_1.PromiseObservable(source); + } + source.subscribe(new AllSubscriber(subscriber, i, context)); + } + }; + return ForkJoinObservable; +})(Observable_1.Observable); +exports.ForkJoinObservable = ForkJoinObservable; +var AllSubscriber = (function (_super) { + __extends(AllSubscriber, _super); + function AllSubscriber(destination, index, context) { + _super.call(this, destination); + this.index = index; + this.context = context; + this._value = null; + } + AllSubscriber.prototype._next = function (value) { + this._value = value; + }; + AllSubscriber.prototype._complete = function () { + var destination = this.destination; + if (this._value == null) { + destination.complete(); + } + var context = this.context; + context.completed++; + context.values[this.index] = this._value; + var values = context.values; + if (context.completed !== values.length) { + return; + } + if (values.every(hasValue)) { + var value = context.selector ? context.selector.apply(this, values) : + values; + destination.next(value); + } + destination.complete(); + }; + return AllSubscriber; +})(Subscriber_1.Subscriber); +function hasValue(x) { + return x !== null; +} +function emptyArray(len) { + var arr = []; + for (var i = 0; i < len; i++) { + arr.push(null); + } + return arr; +} + +},{"../Observable":3,"../Subscriber":7,"../util/isArray":231,"../util/isPromise":234,"./empty":109,"./fromPromise":115}],111:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var fromPromise_1 = require('./fromPromise'); +var IteratorObservable_1 = require('./IteratorObservable'); +var fromArray_1 = require('./fromArray'); +var SymbolShim_1 = require('../util/SymbolShim'); +var Observable_1 = require('../Observable'); +var observeOn_support_1 = require('../operator/observeOn-support'); +var queue_1 = require('../scheduler/queue'); +var isArray = Array.isArray; +var FromObservable = (function (_super) { + __extends(FromObservable, _super); + function FromObservable(ish, scheduler) { + _super.call(this, null); + this.ish = ish; + this.scheduler = scheduler; + } + FromObservable.create = function (ish, scheduler) { + if (scheduler === void 0) { scheduler = queue_1.queue; } + if (ish) { + if (isArray(ish)) { + return new fromArray_1.ArrayObservable(ish, scheduler); + } + else if (typeof ish.then === 'function') { + return new fromPromise_1.PromiseObservable(ish, scheduler); + } + else if (typeof ish[SymbolShim_1.SymbolShim.observable] === 'function') { + if (ish instanceof Observable_1.Observable) { + return ish; + } + return new FromObservable(ish, scheduler); + } + else if (typeof ish[SymbolShim_1.SymbolShim.iterator] === 'function') { + return new IteratorObservable_1.IteratorObservable(ish, null, null, scheduler); + } + } + throw new TypeError((typeof ish) + ' is not observable'); + }; + FromObservable.prototype._subscribe = function (subscriber) { + var ish = this.ish; + var scheduler = this.scheduler; + if (scheduler === queue_1.queue) { + return ish[SymbolShim_1.SymbolShim.observable]().subscribe(subscriber); + } + else { + return ish[SymbolShim_1.SymbolShim.observable]().subscribe(new observeOn_support_1.ObserveOnSubscriber(subscriber, scheduler, 0)); + } + }; + return FromObservable; +})(Observable_1.Observable); +exports.FromObservable = FromObservable; + +},{"../Observable":3,"../operator/observeOn-support":166,"../scheduler/queue":216,"../util/SymbolShim":229,"./IteratorObservable":104,"./fromArray":112,"./fromPromise":115}],112:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var ScalarObservable_1 = require('./ScalarObservable'); +var empty_1 = require('./empty'); +var isScheduler_1 = require('../util/isScheduler'); +var ArrayObservable = (function (_super) { + __extends(ArrayObservable, _super); + function ArrayObservable(array, scheduler) { + _super.call(this); + this.array = array; + this.scheduler = scheduler; + if (!scheduler && array.length === 1) { + this._isScalar = true; + this.value = array[0]; + } + } + ArrayObservable.create = function (array, scheduler) { + return new ArrayObservable(array, scheduler); + }; + ArrayObservable.of = function () { + var array = []; + for (var _i = 0; _i < arguments.length; _i++) { + array[_i - 0] = arguments[_i]; + } + var scheduler = array[array.length - 1]; + if (isScheduler_1.isScheduler(scheduler)) { + array.pop(); + } + else { + scheduler = void 0; + } + var len = array.length; + if (len > 1) { + return new ArrayObservable(array, scheduler); + } + else if (len === 1) { + return new ScalarObservable_1.ScalarObservable(array[0], scheduler); + } + else { + return new empty_1.EmptyObservable(scheduler); + } + }; + ArrayObservable.dispatch = function (state) { + var array = state.array, index = state.index, count = state.count, 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 (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; +})(Observable_1.Observable); +exports.ArrayObservable = ArrayObservable; + +},{"../Observable":3,"../util/isScheduler":235,"./ScalarObservable":105,"./empty":109}],113:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var Subscription_1 = require('../Subscription'); +var FromEventObservable = (function (_super) { + __extends(FromEventObservable, _super); + function FromEventObservable(sourceObj, eventName, selector) { + _super.call(this); + this.sourceObj = sourceObj; + this.eventName = eventName; + this.selector = selector; + } + FromEventObservable.create = function (sourceObj, eventName, selector) { + return new FromEventObservable(sourceObj, eventName, selector); + }; + FromEventObservable.setupSubscription = function (sourceObj, eventName, handler, subscriber) { + var unsubscribe; + 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 Subscription_1.Subscription(unsubscribe)); + }; + FromEventObservable.prototype._subscribe = function (subscriber) { + var sourceObj = this.sourceObj; + var eventName = this.eventName; + var selector = this.selector; + var handler = selector ? function (e) { + var result = tryCatch_1.tryCatch(selector)(e); + if (result === errorObject_1.errorObject) { + subscriber.error(result.e); + } + else { + subscriber.next(result); + } + } : function (e) { return subscriber.next(e); }; + FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber); + }; + return FromEventObservable; +})(Observable_1.Observable); +exports.FromEventObservable = FromEventObservable; + +},{"../Observable":3,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],114:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var Subscription_1 = require('../Subscription'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var FromEventPatternObservable = (function (_super) { + __extends(FromEventPatternObservable, _super); + function FromEventPatternObservable(addHandler, removeHandler, selector) { + _super.call(this); + this.addHandler = addHandler; + this.removeHandler = removeHandler; + this.selector = selector; + } + FromEventPatternObservable.create = function (addHandler, removeHandler, selector) { + return new FromEventPatternObservable(addHandler, removeHandler, selector); + }; + FromEventPatternObservable.prototype._subscribe = function (subscriber) { + var addHandler = this.addHandler; + var removeHandler = this.removeHandler; + var selector = this.selector; + var handler = selector ? function (e) { + var result = tryCatch_1.tryCatch(selector).apply(null, arguments); + if (result === errorObject_1.errorObject) { + subscriber.error(result.e); + } + else { + subscriber.next(result); + } + } : function (e) { subscriber.next(e); }; + var result = tryCatch_1.tryCatch(addHandler)(handler); + if (result === errorObject_1.errorObject) { + subscriber.error(result.e); + } + subscriber.add(new Subscription_1.Subscription(function () { + //TODO: determine whether or not to forward to error handler + removeHandler(handler); + })); + }; + return FromEventPatternObservable; +})(Observable_1.Observable); +exports.FromEventPatternObservable = FromEventPatternObservable; + +},{"../Observable":3,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],115:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var Subscription_1 = require('../Subscription'); +var queue_1 = require('../scheduler/queue'); +var PromiseObservable = (function (_super) { + __extends(PromiseObservable, _super); + function PromiseObservable(promise, scheduler) { + if (scheduler === void 0) { scheduler = queue_1.queue; } + _super.call(this); + this.promise = promise; + this.scheduler = scheduler; + this._isScalar = false; + } + PromiseObservable.create = function (promise, scheduler) { + if (scheduler === void 0) { scheduler = queue_1.queue; } + return new PromiseObservable(promise, scheduler); + }; + PromiseObservable.prototype._subscribe = function (subscriber) { + var _this = this; + var scheduler = this.scheduler; + var promise = this.promise; + if (scheduler === queue_1.queue) { + 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) { + // escape the promise trap, throw unhandled errors + setTimeout(function () { throw err; }); + }); + } + } + else { + var subscription = new Subscription_1.Subscription(); + 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) { + // escape the promise trap, throw unhandled errors + scheduler.schedule(function () { throw err; }); + }); + } + return subscription; + } + }; + return PromiseObservable; +})(Observable_1.Observable); +exports.PromiseObservable = PromiseObservable; +function dispatchNext(_a) { + var value = _a.value, subscriber = _a.subscriber; + subscriber.next(value); + subscriber.complete(); +} +function dispatchError(_a) { + var err = _a.err, subscriber = _a.subscriber; + subscriber.error(err); +} + +},{"../Observable":3,"../Subscription":8,"../scheduler/queue":216}],116:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var isNumeric_1 = require('../util/isNumeric'); +var Observable_1 = require('../Observable'); +var asap_1 = require('../scheduler/asap'); +var IntervalObservable = (function (_super) { + __extends(IntervalObservable, _super); + function IntervalObservable(period, scheduler) { + if (period === void 0) { period = 0; } + if (scheduler === void 0) { scheduler = asap_1.asap; } + _super.call(this); + this.period = period; + this.scheduler = scheduler; + if (!isNumeric_1.isNumeric(period) || period < 0) { + this.period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + this.scheduler = asap_1.asap; + } + } + IntervalObservable.create = function (period, scheduler) { + if (period === void 0) { period = 0; } + if (scheduler === void 0) { scheduler = asap_1.asap; } + return new IntervalObservable(period, scheduler); + }; + IntervalObservable.dispatch = function (state) { + var index = state.index, subscriber = state.subscriber, period = state.period; + subscriber.next(index); + if (subscriber.isUnsubscribed) { + return; + } + state.index += 1; + this.schedule(state, period); + }; + IntervalObservable.prototype._subscribe = function (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; +})(Observable_1.Observable); +exports.IntervalObservable = IntervalObservable; + +},{"../Observable":3,"../scheduler/asap":215,"../util/isNumeric":233}],117:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var noop_1 = require('../util/noop'); +var InfiniteObservable = (function (_super) { + __extends(InfiniteObservable, _super); + function InfiniteObservable() { + _super.call(this); + } + InfiniteObservable.create = function () { + return new InfiniteObservable(); + }; + InfiniteObservable.prototype._subscribe = function (subscriber) { + noop_1.noop(); + }; + return InfiniteObservable; +})(Observable_1.Observable); +exports.InfiniteObservable = InfiniteObservable; + +},{"../Observable":3,"../util/noop":236}],118:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var RangeObservable = (function (_super) { + __extends(RangeObservable, _super); + function RangeObservable(start, end, scheduler) { + _super.call(this); + this.start = start; + this.end = end; + this.scheduler = scheduler; + } + RangeObservable.create = function (start, end, scheduler) { + if (start === void 0) { start = 0; } + if (end === void 0) { end = 0; } + return new RangeObservable(start, end, scheduler); + }; + RangeObservable.dispatch = function (state) { + var start = state.start, index = state.index, end = state.end, 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 (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; +})(Observable_1.Observable); +exports.RangeObservable = RangeObservable; + +},{"../Observable":3}],119:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Observable_1 = require('../Observable'); +var ErrorObservable = (function (_super) { + __extends(ErrorObservable, _super); + function ErrorObservable(error, scheduler) { + _super.call(this); + this.error = error; + this.scheduler = scheduler; + } + ErrorObservable.create = function (error, scheduler) { + return new ErrorObservable(error, scheduler); + }; + ErrorObservable.dispatch = function (_a) { + var error = _a.error, subscriber = _a.subscriber; + subscriber.error(error); + }; + ErrorObservable.prototype._subscribe = function (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; +})(Observable_1.Observable); +exports.ErrorObservable = ErrorObservable; + +},{"../Observable":3}],120:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var isNumeric_1 = require('../util/isNumeric'); +var Observable_1 = require('../Observable'); +var asap_1 = require('../scheduler/asap'); +var isScheduler_1 = require('../util/isScheduler'); +var isDate_1 = require('../util/isDate'); +var TimerObservable = (function (_super) { + __extends(TimerObservable, _super); + function TimerObservable(dueTime, period, scheduler) { + if (dueTime === void 0) { dueTime = 0; } + _super.call(this); + this.period = period; + this.scheduler = scheduler; + this.dueTime = 0; + if (isNumeric_1.isNumeric(period)) { + this._period = Number(period) < 1 && 1 || Number(period); + } + else if (isScheduler_1.isScheduler(period)) { + scheduler = period; + } + if (!isScheduler_1.isScheduler(scheduler)) { + scheduler = asap_1.asap; + } + this.scheduler = scheduler; + var absoluteDueTime = isDate_1.isDate(dueTime); + this.dueTime = absoluteDueTime ? (+dueTime - this.scheduler.now()) : dueTime; + } + TimerObservable.create = function (dueTime, period, scheduler) { + if (dueTime === void 0) { dueTime = 0; } + return new TimerObservable(dueTime, period, scheduler); + }; + TimerObservable.dispatch = function (state) { + var index = state.index, period = state.period, 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 (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; +})(Observable_1.Observable); +exports.TimerObservable = TimerObservable; + +},{"../Observable":3,"../scheduler/asap":215,"../util/isDate":232,"../util/isNumeric":233,"../util/isScheduler":235}],121:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +/** + * buffers the incoming observable values until the passed `closingNotifier` emits a value, at which point + * it emits the buffer on the returned observable and starts a new buffer internally, awaiting the + * next time `closingNotifier` emits + * + * @param {Observable} closingNotifier an observable, that signals the buffer to be emitted} from the returned observable + * @returns {Observable} an observable of buffers, which are arrays of values + */ +function buffer(closingNotifier) { + return this.lift(new BufferOperator(closingNotifier)); +} +exports.buffer = buffer; +var BufferOperator = (function () { + function BufferOperator(closingNotifier) { + this.closingNotifier = closingNotifier; + } + BufferOperator.prototype.call = function (subscriber) { + return new BufferSubscriber(subscriber, this.closingNotifier); + }; + return BufferOperator; +})(); +var BufferSubscriber = (function (_super) { + __extends(BufferSubscriber, _super); + function BufferSubscriber(destination, closingNotifier) { + _super.call(this, destination); + this.buffer = []; + this.notifierSubscriber = null; + this.notifierSubscriber = new BufferClosingNotifierSubscriber(this); + this.add(closingNotifier._subscribe(this.notifierSubscriber)); + } + BufferSubscriber.prototype._next = function (value) { + this.buffer.push(value); + }; + BufferSubscriber.prototype._error = function (err) { + this.destination.error(err); + }; + BufferSubscriber.prototype._complete = function () { + this.destination.complete(); + }; + BufferSubscriber.prototype.flushBuffer = function () { + var buffer = this.buffer; + this.buffer = []; + this.destination.next(buffer); + if (this.isUnsubscribed) { + this.notifierSubscriber.unsubscribe(); + } + }; + return BufferSubscriber; +})(Subscriber_1.Subscriber); +var BufferClosingNotifierSubscriber = (function (_super) { + __extends(BufferClosingNotifierSubscriber, _super); + function BufferClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function (value) { + this.parent.flushBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function () { + this.parent.complete(); + }; + return BufferClosingNotifierSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],122:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +/** + * buffers a number of values from the source observable by `bufferSize` then emits the buffer and clears it, and starts a + * new buffer each `startBufferEvery` values. If `startBufferEvery` is not provided or is `null`, then new buffers are + * started immediately at the start of the source and when each buffer closes and is emitted. + * @param {number} bufferSize the maximum size of the buffer emitted. + * @param {number} [startBufferEvery] optional interval at which to start a new buffer. (e.g. if `startBufferEvery` is `2`,asdf then a + * new buffer will be started on every other value from the source.) A new buffer is started at the beginning of the source by default. + * @returns {Observable} an observable of arrays of buffered values. + */ +function bufferCount(bufferSize, startBufferEvery) { + if (startBufferEvery === void 0) { startBufferEvery = null; } + return this.lift(new BufferCountOperator(bufferSize, startBufferEvery)); +} +exports.bufferCount = bufferCount; +var BufferCountOperator = (function () { + function BufferCountOperator(bufferSize, startBufferEvery) { + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + } + BufferCountOperator.prototype.call = function (subscriber) { + return new BufferCountSubscriber(subscriber, this.bufferSize, this.startBufferEvery); + }; + return BufferCountOperator; +})(); +var BufferCountSubscriber = (function (_super) { + __extends(BufferCountSubscriber, _super); + function BufferCountSubscriber(destination, bufferSize, startBufferEvery) { + _super.call(this, destination); + this.bufferSize = bufferSize; + this.startBufferEvery = startBufferEvery; + this.buffers = [[]]; + this.count = 0; + } + BufferCountSubscriber.prototype._next = function (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 (err) { + this.destination.error(err); + }; + BufferCountSubscriber.prototype._complete = function () { + 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; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],123:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var asap_1 = require('../scheduler/asap'); +/** + * buffers values from the source for a specific time period. Optionally allows new buffers to be set up at an interval. + * @param {number} the amount of time to fill each buffer for before emitting them and clearing them. + * @param {number} [bufferCreationInterval] the interval at which to start new buffers. + * @param {Scheduler} [scheduler] (optional, defaults to `asap` scheduler) The scheduler on which to schedule the + * intervals that determine buffer boundaries. + * @returns {Observable} an observable of arrays of buffered values. + */ +function bufferTime(bufferTimeSpan, bufferCreationInterval, scheduler) { + if (bufferCreationInterval === void 0) { bufferCreationInterval = null; } + if (scheduler === void 0) { scheduler = asap_1.asap; } + return this.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler)); +} +exports.bufferTime = bufferTime; +var BufferTimeOperator = (function () { + function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, scheduler) { + this.bufferTimeSpan = bufferTimeSpan; + this.bufferCreationInterval = bufferCreationInterval; + this.scheduler = scheduler; + } + BufferTimeOperator.prototype.call = function (subscriber) { + return new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.scheduler); + }; + return BufferTimeOperator; +})(); +var BufferTimeSubscriber = (function (_super) { + __extends(BufferTimeSubscriber, _super); + function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, scheduler) { + _super.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 (value) { + var buffers = this.buffers; + var len = buffers.length; + for (var i = 0; i < len; i++) { + buffers[i].push(value); + } + }; + BufferTimeSubscriber.prototype._error = function (err) { + this.buffers.length = 0; + this.destination.error(err); + }; + BufferTimeSubscriber.prototype._complete = function () { + var buffers = this.buffers; + while (buffers.length > 0) { + this.destination.next(buffers.shift()); + } + this.destination.complete(); + }; + BufferTimeSubscriber.prototype.openBuffer = function () { + var buffer = []; + this.buffers.push(buffer); + return buffer; + }; + BufferTimeSubscriber.prototype.closeBuffer = function (buffer) { + this.destination.next(buffer); + var buffers = this.buffers; + buffers.splice(buffers.indexOf(buffer), 1); + }; + return BufferTimeSubscriber; +})(Subscriber_1.Subscriber); +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, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, 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(_a) { + var subscriber = _a.subscriber, buffer = _a.buffer; + subscriber.closeBuffer(buffer); +} + +},{"../Subscriber":7,"../scheduler/asap":215}],124:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subscription_1 = require('../Subscription'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +/** + * buffers values from the source by opening the buffer via signals from an observable provided to `openings`, and closing + * and sending the buffers when an observable returned by the `closingSelector` emits. + * @param {Observable} openings An observable of notifications to start new buffers + * @param {Function} an function, that takes the value emitted by the `openings` observable and returns an Observable, which, + * when it emits, signals that the associated buffer should be emitted and cleared. + * @returns {Observable} an observable of arrays of buffered values. + */ +function bufferToggle(openings, closingSelector) { + return this.lift(new BufferToggleOperator(openings, closingSelector)); +} +exports.bufferToggle = bufferToggle; +var BufferToggleOperator = (function () { + function BufferToggleOperator(openings, closingSelector) { + this.openings = openings; + this.closingSelector = closingSelector; + } + BufferToggleOperator.prototype.call = function (subscriber) { + return new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return BufferToggleOperator; +})(); +var BufferToggleSubscriber = (function (_super) { + __extends(BufferToggleSubscriber, _super); + function BufferToggleSubscriber(destination, openings, closingSelector) { + _super.call(this, destination); + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new BufferToggleOpeningsSubscriber(this))); + } + BufferToggleSubscriber.prototype._next = function (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 (err) { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + context.subscription.unsubscribe(); + context.buffer = null; + context.subscription = null; + } + this.contexts = null; + this.destination.error(err); + }; + BufferToggleSubscriber.prototype._complete = function () { + var contexts = this.contexts; + while (contexts.length > 0) { + var context = contexts.shift(); + this.destination.next(context.buffer); + context.subscription.unsubscribe(); + context.buffer = null; + context.subscription = null; + } + this.contexts = null; + this.destination.complete(); + }; + BufferToggleSubscriber.prototype.openBuffer = function (value) { + var closingSelector = this.closingSelector; + var contexts = this.contexts; + var closingNotifier = tryCatch_1.tryCatch(closingSelector)(value); + if (closingNotifier === errorObject_1.errorObject) { + this._error(closingNotifier.e); + } + else { + var context = { + buffer: [], + subscription: new Subscription_1.Subscription() + }; + contexts.push(context); + var subscriber = new BufferToggleClosingsSubscriber(this, context); + var subscription = closingNotifier._subscribe(subscriber); + context.subscription.add(subscription); + this.add(subscription); + } + }; + BufferToggleSubscriber.prototype.closeBuffer = function (context) { + var contexts = this.contexts; + if (contexts === null) { + return; + } + var buffer = context.buffer, subscription = context.subscription; + this.destination.next(buffer); + contexts.splice(contexts.indexOf(context), 1); + this.remove(subscription); + subscription.unsubscribe(); + }; + return BufferToggleSubscriber; +})(Subscriber_1.Subscriber); +var BufferToggleOpeningsSubscriber = (function (_super) { + __extends(BufferToggleOpeningsSubscriber, _super); + function BufferToggleOpeningsSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + BufferToggleOpeningsSubscriber.prototype._next = function (value) { + this.parent.openBuffer(value); + }; + BufferToggleOpeningsSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + BufferToggleOpeningsSubscriber.prototype._complete = function () { + // noop + }; + return BufferToggleOpeningsSubscriber; +})(Subscriber_1.Subscriber); +var BufferToggleClosingsSubscriber = (function (_super) { + __extends(BufferToggleClosingsSubscriber, _super); + function BufferToggleClosingsSubscriber(parent, context) { + _super.call(this, null); + this.parent = parent; + this.context = context; + } + BufferToggleClosingsSubscriber.prototype._next = function () { + this.parent.closeBuffer(this.context); + }; + BufferToggleClosingsSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + BufferToggleClosingsSubscriber.prototype._complete = function () { + this.parent.closeBuffer(this.context); + }; + return BufferToggleClosingsSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],125:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +/** + * Opens a buffer immediately, then closes the buffer when the observable returned by calling `closingSelector` emits a value. + * It that immediately opens a new buffer and repeats the process + * @param {function} a function that takes no arguments and returns an Observable that signals buffer closure + * @returns {Observable} an observable of arrays of buffered values. + */ +function bufferWhen(closingSelector) { + return this.lift(new BufferWhenOperator(closingSelector)); +} +exports.bufferWhen = bufferWhen; +var BufferWhenOperator = (function () { + function BufferWhenOperator(closingSelector) { + this.closingSelector = closingSelector; + } + BufferWhenOperator.prototype.call = function (subscriber) { + return new BufferWhenSubscriber(subscriber, this.closingSelector); + }; + return BufferWhenOperator; +})(); +var BufferWhenSubscriber = (function (_super) { + __extends(BufferWhenSubscriber, _super); + function BufferWhenSubscriber(destination, closingSelector) { + _super.call(this, destination); + this.closingSelector = closingSelector; + this.openBuffer(); + } + BufferWhenSubscriber.prototype._next = function (value) { + this.buffer.push(value); + }; + BufferWhenSubscriber.prototype._error = function (err) { + this.buffer = null; + this.destination.error(err); + }; + BufferWhenSubscriber.prototype._complete = function () { + var buffer = this.buffer; + this.destination.next(buffer); + this.buffer = null; + this.destination.complete(); + }; + BufferWhenSubscriber.prototype.openBuffer = function () { + 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 = tryCatch_1.tryCatch(this.closingSelector)(); + if (closingNotifier === errorObject_1.errorObject) { + var err = closingNotifier.e; + this.buffer = null; + this.destination.error(err); + } + else { + this.add(this.closingNotification = closingNotifier._subscribe(new BufferClosingNotifierSubscriber(this))); + } + }; + return BufferWhenSubscriber; +})(Subscriber_1.Subscriber); +var BufferClosingNotifierSubscriber = (function (_super) { + __extends(BufferClosingNotifierSubscriber, _super); + function BufferClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + BufferClosingNotifierSubscriber.prototype._next = function () { + this.parent.openBuffer(); + }; + BufferClosingNotifierSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + BufferClosingNotifierSubscriber.prototype._complete = function () { + this.parent.openBuffer(); + }; + return BufferClosingNotifierSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],126:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +/** + * Catches errors on the observable to be handled by returning a new observable or throwing an error. + * @param {function} selector a function that takes as arguments `err`, which is the error, and `caught`, which + * is the source observable, in case you'd like to "retry" that observable by returning it again. Whatever observable + * is returned by the `selector` will be used to continue the observable chain. + * @return {Observable} an observable that originates from either the source or the observable returned by the + * catch `selector` function. + */ +function _catch(selector) { + var catchOperator = new CatchOperator(selector); + var caught = this.lift(catchOperator); + catchOperator.caught = caught; + return caught; +} +exports._catch = _catch; +var CatchOperator = (function () { + function CatchOperator(selector) { + this.selector = selector; + } + CatchOperator.prototype.call = function (subscriber) { + return new CatchSubscriber(subscriber, this.selector, this.caught); + }; + return CatchOperator; +})(); +var CatchSubscriber = (function (_super) { + __extends(CatchSubscriber, _super); + function CatchSubscriber(destination, selector, caught) { + _super.call(this, null); + this.destination = destination; + this.selector = selector; + this.caught = caught; + this.lastSubscription = this; + this.destination.add(this); + } + CatchSubscriber.prototype._next = function (value) { + this.destination.next(value); + }; + CatchSubscriber.prototype._error = function (err) { + var result = tryCatch_1.tryCatch(this.selector)(err, this.caught); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else { + this.lastSubscription.unsubscribe(); + this.lastSubscription = result.subscribe(this.destination); + } + }; + CatchSubscriber.prototype._complete = function () { + this.lastSubscription.unsubscribe(); + this.destination.complete(); + }; + CatchSubscriber.prototype._unsubscribe = function () { + this.lastSubscription.unsubscribe(); + }; + return CatchSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],127:[function(require,module,exports){ +var combineLatest_support_1 = require('./combineLatest-support'); +/** + * Takes an Observable of Observables, and collects all observables from it. Once the outer observable + * completes, it subscribes to all collected observables and "combines" their values, such that: + * - every time an observable emits, the returned observable emits + * - when the returned observable emits, it emits all of the most recent values by: + * - if a `project` function is provided, it is called with each recent value from each observable in whatever order they arrived, + * and the result of the `project` function is what is emitted by the returned observable + * - if there is no `project` function, an array of all of the most recent values is emitted by the returned observable. + * @param {function} [project] an optional function to map the most recent values from each observable into a new result. Takes each of the + * most recent values from each collected observable as arguments, in order. + * @returns {Observable} an observable of projected results or arrays of recent values. + */ +function combineAll(project) { + return this.lift(new combineLatest_support_1.CombineLatestOperator(project)); +} +exports.combineAll = combineAll; + +},{"./combineLatest-support":129}],128:[function(require,module,exports){ +var fromArray_1 = require('../observable/fromArray'); +var combineLatest_support_1 = require('./combineLatest-support'); +var isScheduler_1 = require('../util/isScheduler'); +var isArray_1 = require('../util/isArray'); +/** + * Combines the values from observables passed as arguments. This is done by subscribing + * to each observable, in order, and collecting an array of each of the most recent values any time any of the observables + * emits, then either taking that array and passing it as arguments to an option `project` function and emitting the return + * value of that, or just emitting the array of recent values directly if there is no `project` function. + * @param {...Observable} observables the observables to combine + * @param {function} [project] an optional function to project the values from the combined recent values into a new value for emission. + * @returns {Observable} an observable of other projected values from the most recent values from each observable, or an array of each of + * the most recent values from each observable. + */ +function combineLatest() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = null; + var scheduler = null; + if (isScheduler_1.isScheduler(observables[observables.length - 1])) { + scheduler = observables.pop(); + } + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + // if the first and only other argument besides the resultSelector is an array + // assume it's been called with `combineLatest([obs1, obs2, obs3], project)` + if (observables.length === 1 && isArray_1.isArray(observables[0])) { + observables = observables[0]; + } + return new fromArray_1.ArrayObservable(observables, scheduler).lift(new combineLatest_support_1.CombineLatestOperator(project)); +} +exports.combineLatest = combineLatest; + +},{"../observable/fromArray":112,"../util/isArray":231,"../util/isScheduler":235,"./combineLatest-support":129}],129:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +var CombineLatestOperator = (function () { + function CombineLatestOperator(project) { + this.project = project; + } + CombineLatestOperator.prototype.call = function (subscriber) { + return new CombineLatestSubscriber(subscriber, this.project); + }; + return CombineLatestOperator; +})(); +exports.CombineLatestOperator = CombineLatestOperator; +var CombineLatestSubscriber = (function (_super) { + __extends(CombineLatestSubscriber, _super); + function CombineLatestSubscriber(destination, project) { + _super.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + this.toRespond = []; + } + CombineLatestSubscriber.prototype._next = function (observable) { + var toRespond = this.toRespond; + toRespond.push(toRespond.length); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function () { + 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(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function (unused) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function (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 = tryCatch_1.tryCatch(project).apply(this, values); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + destination.next(result); + } + } + else { + destination.next(values); + } + } + }; + return CombineLatestSubscriber; +})(OuterSubscriber_1.OuterSubscriber); +exports.CombineLatestSubscriber = CombineLatestSubscriber; + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],130:[function(require,module,exports){ +var fromArray_1 = require('../observable/fromArray'); +var combineLatest_support_1 = require('./combineLatest-support'); +var isArray_1 = require('../util/isArray'); +/** + * Combines the values from this observable with values from observables passed as arguments. This is done by subscribing + * to each observable, in order, and collecting an array of each of the most recent values any time any of the observables + * emits, then either taking that array and passing it as arguments to an option `project` function and emitting the return + * value of that, or just emitting the array of recent values directly if there is no `project` function. + * @param {...Observable} observables the observables to combine the source with + * @param {function} [project] an optional function to project the values from the combined recent values into a new value for emission. + * @returns {Observable} an observable of other projected values from the most recent values from each observable, or an array of each of + * the most recent values from each observable. + */ +function combineLatest() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = null; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + // if the first and only other argument besides the resultSelector is an array + // assume it's been called with `combineLatest([obs1, obs2, obs3], project)` + if (observables.length === 1 && isArray_1.isArray(observables[0])) { + observables = observables[0]; + } + observables.unshift(this); + return new fromArray_1.ArrayObservable(observables).lift(new combineLatest_support_1.CombineLatestOperator(project)); +} +exports.combineLatest = combineLatest; + +},{"../observable/fromArray":112,"../util/isArray":231,"./combineLatest-support":129}],131:[function(require,module,exports){ +var queue_1 = require('../scheduler/queue'); +var mergeAll_support_1 = require('./mergeAll-support'); +var fromArray_1 = require('../observable/fromArray'); +var isScheduler_1 = require('../util/isScheduler'); +/** + * Joins multiple observables together by subscribing to them one at a time and merging their results + * into the returned observable. Will wait for each observable to complete before moving on to the next. + * @params {...Observable} the observables to concatenate + * @params {Scheduler} [scheduler] an optional scheduler to schedule each observable subscription on. + * @returns {Observable} All values of each passed observable merged into a single observable, in order, in serial fashion. + */ +function concat() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var scheduler = queue_1.queue; + var args = observables; + if (isScheduler_1.isScheduler(args[observables.length - 1])) { + scheduler = args.pop(); + } + return new fromArray_1.ArrayObservable(observables, scheduler).lift(new mergeAll_support_1.MergeAllOperator(1)); +} +exports.concat = concat; + +},{"../observable/fromArray":112,"../scheduler/queue":216,"../util/isScheduler":235,"./mergeAll-support":159}],132:[function(require,module,exports){ +var isScheduler_1 = require('../util/isScheduler'); +var fromArray_1 = require('../observable/fromArray'); +var mergeAll_support_1 = require('./mergeAll-support'); +/** + * Joins this observable with multiple other observables by subscribing to them one at a time, starting with the source, + * and merging their results into the returned observable. Will wait for each observable to complete before moving + * on to the next. + * @params {...Observable} the observables to concatenate + * @params {Scheduler} [scheduler] an optional scheduler to schedule each observable subscription on. + * @returns {Observable} All values of each passed observable merged into a single observable, in order, in serial fashion. + */ +function concat() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var args = observables; + args.unshift(this); + var scheduler = null; + if (isScheduler_1.isScheduler(args[args.length - 1])) { + scheduler = args.pop(); + } + return new fromArray_1.ArrayObservable(args, scheduler).lift(new mergeAll_support_1.MergeAllOperator(1)); +} +exports.concat = concat; + +},{"../observable/fromArray":112,"../util/isScheduler":235,"./mergeAll-support":159}],133:[function(require,module,exports){ +var mergeAll_support_1 = require('./mergeAll-support'); +/** + * Joins every Observable emitted by the source (an Observable of Observables), in a serial + * fashion. Subscribing to each one only when the previous one has completed, and merging + * all of their values into the returned observable. + * + * __Warning:__ If the source Observable emits Observables quickly and endlessly, and the + * Observables it emits generally complete slower than the source emits, you can run into + * memory issues as the incoming observables collect in an unbounded buffer. + * + * @returns {Observable} an observable of values merged from the incoming observables. + */ +function concatAll() { + return this.lift(new mergeAll_support_1.MergeAllOperator(1)); +} +exports.concatAll = concatAll; + +},{"./mergeAll-support":159}],134:[function(require,module,exports){ +var mergeMap_support_1 = require('./mergeMap-support'); +/** + * Maps values from the source observable into new Observables, then merges them in a serialized fashion, + * waiting for each one to complete before merging the next. + * + * __Warning:__ if incoming values arrive endlessly and faster than the observables they're being mapped + * to can complete, it will result in memory issues as created observables amass in an unbounded buffer + * waiting for their turn to be subscribed to. + * + * @param {function} project a function to map incoming values into Observables to be concatenated. accepts + * the `value` and the `index` as arguments. + * @param {function} [projectResult] an optional result selector that is applied to values before they're + * merged into the returned observable. The arguments passed to this function are: + * - `outerValue`: the value that came from the source + * - `innerValue`: the value that came from the projected Observable + * - `outerIndex`: the "index" of the value that came from the source + * - `innerIndex`: the "index" of the value from the projected Observable + * @returns {Observable} an observable of values merged from the projected Observables as they were subscribed to, + * one at a time. Optionally, these values may have been projected from a passed `projectResult` argument. + */ +function concatMap(project, projectResult) { + return this.lift(new mergeMap_support_1.MergeMapOperator(project, projectResult, 1)); +} +exports.concatMap = concatMap; + +},{"./mergeMap-support":161}],135:[function(require,module,exports){ +var mergeMapTo_support_1 = require('./mergeMapTo-support'); +/** + * Maps values from the source to a specific observable, and merges them together in a serialized fashion. + * + * @param {Observable} observable the observable to map each source value to + * @param {function} [projectResult] an optional result selector that is applied to values before they're + * merged into the returned observable. The arguments passed to this function are: + * - `outerValue`: the value that came from the source + * - `innerValue`: the value that came from the projected Observable + * - `outerIndex`: the "index" of the value that came from the source + * - `innerIndex`: the "index" of the value from the projected Observable + * @returns {Observable} an observable of values merged together by joining the passed observable + * with itself, one after the other, for each value emitted from the source. + */ +function concatMapTo(observable, projectResult) { + return this.lift(new mergeMapTo_support_1.MergeMapToOperator(observable, projectResult, 1)); +} +exports.concatMapTo = concatMapTo; + +},{"./mergeMapTo-support":163}],136:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +/** + * Returns an observable of a single number that represents the number of items that either: + * Match a provided predicate function, _or_ if a predicate is not provided, the number + * represents the total count of all items in the source observable. The count is emitted + * by the returned observable when the source observable completes. + * @param {function} [predicate] a boolean function to select what values are to be counted. + * it is provided with arguments of: + * - `value`: the value from the source observable + * - `index`: the "index" of the value from the source observable + * - `source`: the source observable instance itself. + * @returns {Observable} an observable of one number that represents the count as described + * above + */ +function count(predicate) { + return this.lift(new CountOperator(predicate, this)); +} +exports.count = count; +var CountOperator = (function () { + function CountOperator(predicate, source) { + this.predicate = predicate; + this.source = source; + } + CountOperator.prototype.call = function (subscriber) { + return new CountSubscriber(subscriber, this.predicate, this.source); + }; + return CountOperator; +})(); +var CountSubscriber = (function (_super) { + __extends(CountSubscriber, _super); + function CountSubscriber(destination, predicate, source) { + _super.call(this, destination); + this.predicate = predicate; + this.source = source; + this.count = 0; + this.index = 0; + } + CountSubscriber.prototype._next = function (value) { + var predicate = this.predicate; + var passed = true; + if (predicate) { + passed = tryCatch_1.tryCatch(predicate)(value, this.index++, this.source); + if (passed === errorObject_1.errorObject) { + this.destination.error(passed.e); + return; + } + } + if (passed) { + this.count += 1; + } + }; + CountSubscriber.prototype._complete = function () { + this.destination.next(this.count); + this.destination.complete(); + }; + return CountSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],137:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var fromPromise_1 = require('../observable/fromPromise'); +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var isPromise_1 = require('../util/isPromise'); +var errorObject_1 = require('../util/errorObject'); +function debounce(durationSelector) { + return this.lift(new DebounceOperator(durationSelector)); +} +exports.debounce = debounce; +var DebounceOperator = (function () { + function DebounceOperator(durationSelector) { + this.durationSelector = durationSelector; + } + DebounceOperator.prototype.call = function (observer) { + return new DebounceSubscriber(observer, this.durationSelector); + }; + return DebounceOperator; +})(); +var DebounceSubscriber = (function (_super) { + __extends(DebounceSubscriber, _super); + function DebounceSubscriber(destination, durationSelector) { + _super.call(this, destination); + this.durationSelector = durationSelector; + this.debouncedSubscription = null; + this.lastValue = null; + this._index = 0; + } + Object.defineProperty(DebounceSubscriber.prototype, "index", { + get: function () { + return this._index; + }, + enumerable: true, + configurable: true + }); + DebounceSubscriber.prototype._next = function (value) { + var destination = this.destination; + var currentIndex = ++this._index; + var debounce = tryCatch_1.tryCatch(this.durationSelector)(value); + if (debounce === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + if (isPromise_1.isPromise(debounce)) { + debounce = fromPromise_1.PromiseObservable.create(debounce); + } + this.lastValue = value; + this.clearDebounce(); + this.add(this.debouncedSubscription = debounce._subscribe(new DurationSelectorSubscriber(this, currentIndex))); + } + }; + DebounceSubscriber.prototype._complete = function () { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceSubscriber.prototype.debouncedNext = function () { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceSubscriber.prototype.clearDebounce = function () { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription) { + debouncedSubscription.unsubscribe(); + this.remove(debouncedSubscription); + this.debouncedSubscription = null; + } + }; + return DebounceSubscriber; +})(Subscriber_1.Subscriber); +var DurationSelectorSubscriber = (function (_super) { + __extends(DurationSelectorSubscriber, _super); + function DurationSelectorSubscriber(parent, currentIndex) { + _super.call(this, null); + this.parent = parent; + this.currentIndex = currentIndex; + } + DurationSelectorSubscriber.prototype.debounceNext = function () { + var parent = this.parent; + if (this.currentIndex === parent.index) { + parent.debouncedNext(); + if (!this.isUnsubscribed) { + this.unsubscribe(); + } + } + }; + DurationSelectorSubscriber.prototype._next = function (unused) { + this.debounceNext(); + }; + DurationSelectorSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + DurationSelectorSubscriber.prototype._complete = function () { + this.debounceNext(); + }; + return DurationSelectorSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../observable/fromPromise":115,"../util/errorObject":230,"../util/isPromise":234,"../util/tryCatch":241}],138:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var asap_1 = require('../scheduler/asap'); +function debounceTime(dueTime, scheduler) { + if (scheduler === void 0) { scheduler = asap_1.asap; } + return this.lift(new DebounceTimeOperator(dueTime, scheduler)); +} +exports.debounceTime = debounceTime; +var DebounceTimeOperator = (function () { + function DebounceTimeOperator(dueTime, scheduler) { + this.dueTime = dueTime; + this.scheduler = scheduler; + } + DebounceTimeOperator.prototype.call = function (subscriber) { + return new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler); + }; + return DebounceTimeOperator; +})(); +var DebounceTimeSubscriber = (function (_super) { + __extends(DebounceTimeSubscriber, _super); + function DebounceTimeSubscriber(destination, dueTime, scheduler) { + _super.call(this, destination); + this.dueTime = dueTime; + this.scheduler = scheduler; + this.debouncedSubscription = null; + this.lastValue = null; + } + DebounceTimeSubscriber.prototype._next = function (value) { + this.clearDebounce(); + this.lastValue = value; + this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); + }; + DebounceTimeSubscriber.prototype._complete = function () { + this.debouncedNext(); + this.destination.complete(); + }; + DebounceTimeSubscriber.prototype.debouncedNext = function () { + this.clearDebounce(); + if (this.lastValue != null) { + this.destination.next(this.lastValue); + this.lastValue = null; + } + }; + DebounceTimeSubscriber.prototype.clearDebounce = function () { + var debouncedSubscription = this.debouncedSubscription; + if (debouncedSubscription !== null) { + this.remove(debouncedSubscription); + debouncedSubscription.unsubscribe(); + this.debouncedSubscription = null; + } + }; + return DebounceTimeSubscriber; +})(Subscriber_1.Subscriber); +function dispatchNext(subscriber) { + subscriber.debouncedNext(); +} + +},{"../Subscriber":7,"../scheduler/asap":215}],139:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function defaultIfEmpty(defaultValue) { + if (defaultValue === void 0) { defaultValue = null; } + return this.lift(new DefaultIfEmptyOperator(defaultValue)); +} +exports.defaultIfEmpty = defaultIfEmpty; +var DefaultIfEmptyOperator = (function () { + function DefaultIfEmptyOperator(defaultValue) { + this.defaultValue = defaultValue; + } + DefaultIfEmptyOperator.prototype.call = function (subscriber) { + return new DefaultIfEmptySubscriber(subscriber, this.defaultValue); + }; + return DefaultIfEmptyOperator; +})(); +var DefaultIfEmptySubscriber = (function (_super) { + __extends(DefaultIfEmptySubscriber, _super); + function DefaultIfEmptySubscriber(destination, defaultValue) { + _super.call(this, destination); + this.defaultValue = defaultValue; + this.isEmpty = true; + } + DefaultIfEmptySubscriber.prototype._next = function (value) { + this.isEmpty = false; + this.destination.next(value); + }; + DefaultIfEmptySubscriber.prototype._complete = function () { + if (this.isEmpty) { + this.destination.next(this.defaultValue); + } + this.destination.complete(); + }; + return DefaultIfEmptySubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],140:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Notification_1 = require('../Notification'); +var queue_1 = require('../scheduler/queue'); +var isDate_1 = require('../util/isDate'); +function delay(delay, scheduler) { + if (scheduler === void 0) { scheduler = queue_1.queue; } + var absoluteDelay = isDate_1.isDate(delay); + var delayFor = absoluteDelay ? (+delay - scheduler.now()) : delay; + return this.lift(new DelayOperator(delayFor, scheduler)); +} +exports.delay = delay; +var DelayOperator = (function () { + function DelayOperator(delay, scheduler) { + this.delay = delay; + this.scheduler = scheduler; + } + DelayOperator.prototype.call = function (subscriber) { + return new DelaySubscriber(subscriber, this.delay, this.scheduler); + }; + return DelayOperator; +})(); +var DelaySubscriber = (function (_super) { + __extends(DelaySubscriber, _super); + function DelaySubscriber(destination, delay, scheduler) { + _super.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + this.queue = []; + this.active = false; + this.errored = false; + } + DelaySubscriber.dispatch = function (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_1 = Math.max(0, queue[0].time - scheduler.now()); + this.schedule(state, delay_1); + } + else { + source.active = false; + } + }; + DelaySubscriber.prototype._schedule = function (scheduler) { + this.active = true; + this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { + source: this, destination: this.destination, scheduler: scheduler + })); + }; + DelaySubscriber.prototype.scheduleNotification = function (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 (value) { + this.scheduleNotification(Notification_1.Notification.createNext(value)); + }; + DelaySubscriber.prototype._error = function (err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + }; + DelaySubscriber.prototype._complete = function () { + this.scheduleNotification(Notification_1.Notification.createComplete()); + }; + return DelaySubscriber; +})(Subscriber_1.Subscriber); +var DelayMessage = (function () { + function DelayMessage(time, notification) { + this.time = time; + this.notification = notification; + } + return DelayMessage; +})(); + +},{"../Notification":2,"../Subscriber":7,"../scheduler/queue":216,"../util/isDate":232}],141:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function dematerialize() { + return this.lift(new DeMaterializeOperator()); +} +exports.dematerialize = dematerialize; +var DeMaterializeOperator = (function () { + function DeMaterializeOperator() { + } + DeMaterializeOperator.prototype.call = function (subscriber) { + return new DeMaterializeSubscriber(subscriber); + }; + return DeMaterializeOperator; +})(); +var DeMaterializeSubscriber = (function (_super) { + __extends(DeMaterializeSubscriber, _super); + function DeMaterializeSubscriber(destination) { + _super.call(this, destination); + } + DeMaterializeSubscriber.prototype._next = function (value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],142:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function distinctUntilChanged(compare) { + return this.lift(new DistinctUntilChangedOperator(compare)); +} +exports.distinctUntilChanged = distinctUntilChanged; +var DistinctUntilChangedOperator = (function () { + function DistinctUntilChangedOperator(compare) { + this.compare = compare; + } + DistinctUntilChangedOperator.prototype.call = function (subscriber) { + return new DistinctUntilChangedSubscriber(subscriber, this.compare); + }; + return DistinctUntilChangedOperator; +})(); +var DistinctUntilChangedSubscriber = (function (_super) { + __extends(DistinctUntilChangedSubscriber, _super); + function DistinctUntilChangedSubscriber(destination, compare) { + _super.call(this, destination); + this.hasValue = false; + if (typeof compare === 'function') { + this.compare = compare; + } + } + DistinctUntilChangedSubscriber.prototype.compare = function (x, y) { + return x === y; + }; + DistinctUntilChangedSubscriber.prototype._next = function (value) { + var result = false; + if (this.hasValue) { + result = tryCatch_1.tryCatch(this.compare)(this.value, value); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + return; + } + } + else { + this.hasValue = true; + } + if (Boolean(result) === false) { + this.value = value; + this.destination.next(value); + } + }; + return DistinctUntilChangedSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],143:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var noop_1 = require('../util/noop'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function _do(nextOrObserver, error, complete) { + var next; + if (nextOrObserver && typeof nextOrObserver === 'object') { + next = nextOrObserver.next; + error = nextOrObserver.error; + complete = nextOrObserver.complete; + } + else { + next = nextOrObserver; + } + return this.lift(new DoOperator(next || noop_1.noop, error || noop_1.noop, complete || noop_1.noop)); +} +exports._do = _do; +var DoOperator = (function () { + function DoOperator(next, error, complete) { + this.next = next; + this.error = error; + this.complete = complete; + } + DoOperator.prototype.call = function (subscriber) { + return new DoSubscriber(subscriber, this.next, this.error, this.complete); + }; + return DoOperator; +})(); +var DoSubscriber = (function (_super) { + __extends(DoSubscriber, _super); + function DoSubscriber(destination, next, error, complete) { + _super.call(this, destination); + this.__next = next; + this.__error = error; + this.__complete = complete; + } + DoSubscriber.prototype._next = function (x) { + var result = tryCatch_1.tryCatch(this.__next)(x); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else { + this.destination.next(x); + } + }; + DoSubscriber.prototype._error = function (e) { + var result = tryCatch_1.tryCatch(this.__error)(e); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else { + this.destination.error(e); + } + }; + DoSubscriber.prototype._complete = function () { + var result = tryCatch_1.tryCatch(this.__complete)(); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else { + this.destination.complete(); + } + }; + return DoSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/noop":236,"../util/tryCatch":241}],144:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var ScalarObservable_1 = require('../observable/ScalarObservable'); +var fromArray_1 = require('../observable/fromArray'); +var throw_1 = require('../observable/throw'); +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function every(predicate, thisArg) { + var source = this; + var result; + if (source._isScalar) { + result = tryCatch_1.tryCatch(predicate).call(thisArg || this, source.value, 0, source); + if (result === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e, source.scheduler); + } + else { + return new ScalarObservable_1.ScalarObservable(result, source.scheduler); + } + } + if (source instanceof fromArray_1.ArrayObservable) { + var array = source.array; + var result_1 = tryCatch_1.tryCatch(function (array, predicate, thisArg) { return array.every(predicate, thisArg); })(array, predicate, thisArg); + if (result_1 === errorObject_1.errorObject) { + return new throw_1.ErrorObservable(errorObject_1.errorObject.e, source.scheduler); + } + else { + return new ScalarObservable_1.ScalarObservable(result_1, source.scheduler); + } + } + return source.lift(new EveryOperator(predicate, thisArg, source)); +} +exports.every = every; +var EveryOperator = (function () { + function EveryOperator(predicate, thisArg, source) { + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + } + EveryOperator.prototype.call = function (observer) { + return new EverySubscriber(observer, this.predicate, this.thisArg, this.source); + }; + return EveryOperator; +})(); +var EverySubscriber = (function (_super) { + __extends(EverySubscriber, _super); + function EverySubscriber(destination, predicate, thisArg, source) { + _super.call(this, destination); + this.predicate = predicate; + this.thisArg = thisArg; + this.source = source; + this.index = 0; + } + EverySubscriber.prototype.notifyComplete = function (everyValueMatch) { + this.destination.next(everyValueMatch); + this.destination.complete(); + }; + EverySubscriber.prototype._next = function (value) { + var result = tryCatch_1.tryCatch(this.predicate).call(this.thisArg || this, value, this.index++, this.source); + if (result === errorObject_1.errorObject) { + this.destination.error(result.e); + } + else if (!result) { + this.notifyComplete(false); + } + }; + EverySubscriber.prototype._complete = function () { + this.notifyComplete(true); + }; + return EverySubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../observable/ScalarObservable":105,"../observable/fromArray":112,"../observable/throw":119,"../util/errorObject":230,"../util/tryCatch":241}],145:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +var ExpandOperator = (function () { + function ExpandOperator(project, concurrent, scheduler) { + this.project = project; + this.concurrent = concurrent; + this.scheduler = scheduler; + } + ExpandOperator.prototype.call = function (subscriber) { + return new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler); + }; + return ExpandOperator; +})(); +exports.ExpandOperator = ExpandOperator; +var ExpandSubscriber = (function (_super) { + __extends(ExpandSubscriber, _super); + function ExpandSubscriber(destination, project, concurrent, scheduler) { + _super.call(this, destination); + this.project = project; + this.concurrent = concurrent; + this.scheduler = scheduler; + this.index = 0; + this.active = 0; + this.hasCompleted = false; + if (concurrent < Number.POSITIVE_INFINITY) { + this.buffer = []; + } + } + ExpandSubscriber.dispatch = function (_a) { + var subscriber = _a.subscriber, result = _a.result, value = _a.value, index = _a.index; + subscriber.subscribeToProjection(result, value, index); + }; + ExpandSubscriber.prototype._next = function (value) { + var destination = this.destination; + if (destination.isUnsubscribed) { + this._complete(); + return; + } + var index = this.index++; + if (this.active < this.concurrent) { + destination.next(value); + var result = tryCatch_1.tryCatch(this.project)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } + else if (!this.scheduler) { + this.subscribeToProjection(result, value, index); + } + else { + var state = { subscriber: this, result: result, value: value, index: index }; + this.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state)); + } + } + else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) { + if (result._isScalar) { + this._next(result.value); + } + else { + this.active++; + this.add(subscribeToResult_1.subscribeToResult(this, result, value, index)); + } + }; + ExpandSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + ExpandSubscriber.prototype.notifyComplete = function (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 (outerValue, innerValue, outerIndex, innerIndex) { + this._next(innerValue); + }; + return ExpandSubscriber; +})(OuterSubscriber_1.OuterSubscriber); +exports.ExpandSubscriber = ExpandSubscriber; + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],146:[function(require,module,exports){ +var expand_support_1 = require('./expand-support'); +function expand(project, concurrent, scheduler) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + if (scheduler === void 0) { scheduler = undefined; } + concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; + return this.lift(new expand_support_1.ExpandOperator(project, concurrent, scheduler)); +} +exports.expand = expand; + +},{"./expand-support":145}],147:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +/** + * Similar to the well-known `Array.prototype.filter` method, this operator filters values down to a set + * allowed by a `select` function + * + * @param {Function} select a function that is used to select the resulting values + * if it returns `true`, the value is emitted, if `false` the value is not passed to the resulting observable + * @param {any} [thisArg] an optional argument to determine the value of `this` in the `select` function + * @returns {Observable} an observable of values allowed by the select function + */ +function filter(select, thisArg) { + return this.lift(new FilterOperator(select, thisArg)); +} +exports.filter = filter; +var FilterOperator = (function () { + function FilterOperator(select, thisArg) { + this.select = select; + this.thisArg = thisArg; + } + FilterOperator.prototype.call = function (subscriber) { + return new FilterSubscriber(subscriber, this.select, this.thisArg); + }; + return FilterOperator; +})(); +var FilterSubscriber = (function (_super) { + __extends(FilterSubscriber, _super); + function FilterSubscriber(destination, select, thisArg) { + _super.call(this, destination); + this.thisArg = thisArg; + this.count = 0; + this.select = select; + } + FilterSubscriber.prototype._next = function (x) { + var result = tryCatch_1.tryCatch(this.select).call(this.thisArg || this, x, this.count++); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else if (Boolean(result)) { + this.destination.next(x); + } + }; + return FilterSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],148:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subscription_1 = require('../Subscription'); +function _finally(finallySelector) { + return this.lift(new FinallyOperator(finallySelector)); +} +exports._finally = _finally; +var FinallyOperator = (function () { + function FinallyOperator(finallySelector) { + this.finallySelector = finallySelector; + } + FinallyOperator.prototype.call = function (subscriber) { + return new FinallySubscriber(subscriber, this.finallySelector); + }; + return FinallyOperator; +})(); +var FinallySubscriber = (function (_super) { + __extends(FinallySubscriber, _super); + function FinallySubscriber(destination, finallySelector) { + _super.call(this, destination); + this.add(new Subscription_1.Subscription(finallySelector)); + } + return FinallySubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../Subscription":8}],149:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var EmptyError_1 = require('../util/EmptyError'); +function first(predicate, resultSelector, defaultValue) { + return this.lift(new FirstOperator(predicate, resultSelector, defaultValue, this)); +} +exports.first = first; +var FirstOperator = (function () { + function FirstOperator(predicate, resultSelector, defaultValue, source) { + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + FirstOperator.prototype.call = function (observer) { + return new FirstSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return FirstOperator; +})(); +var FirstSubscriber = (function (_super) { + __extends(FirstSubscriber, _super); + function FirstSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _super.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 (value) { + var _a = this, destination = _a.destination, predicate = _a.predicate, resultSelector = _a.resultSelector; + var index = this.index++; + var passed = true; + if (predicate) { + passed = tryCatch_1.tryCatch(predicate)(value, index, this.source); + if (passed === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return; + } + } + if (passed) { + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return; + } + destination.next(result); + } + else { + destination.next(value); + } + destination.complete(); + this.hasCompleted = true; + } + }; + FirstSubscriber.prototype._complete = function () { + var destination = this.destination; + if (!this.hasCompleted && typeof this.defaultValue !== 'undefined') { + destination.next(this.defaultValue); + destination.complete(); + } + else if (!this.hasCompleted) { + destination.error(new EmptyError_1.EmptyError); + } + }; + return FirstSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/EmptyError":223,"../util/errorObject":230,"../util/tryCatch":241}],150:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscription_1 = require('../Subscription'); +var Observable_1 = require('../Observable'); +var RefCountSubscription = (function (_super) { + __extends(RefCountSubscription, _super); + function RefCountSubscription() { + _super.call(this); + this.attemptedToUnsubscribePrimary = false; + this.count = 0; + } + RefCountSubscription.prototype.setPrimary = function (subscription) { + this.primary = subscription; + }; + RefCountSubscription.prototype.unsubscribe = function () { + if (!this.isUnsubscribed && !this.attemptedToUnsubscribePrimary) { + this.attemptedToUnsubscribePrimary = true; + if (this.count === 0) { + _super.prototype.unsubscribe.call(this); + this.primary.unsubscribe(); + } + } + }; + return RefCountSubscription; +})(Subscription_1.Subscription); +exports.RefCountSubscription = RefCountSubscription; +var GroupedObservable = (function (_super) { + __extends(GroupedObservable, _super); + function GroupedObservable(key, groupSubject, refCountSubscription) { + _super.call(this); + this.key = key; + this.groupSubject = groupSubject; + this.refCountSubscription = refCountSubscription; + } + GroupedObservable.prototype._subscribe = function (subscriber) { + var subscription = new Subscription_1.Subscription(); + if (this.refCountSubscription && !this.refCountSubscription.isUnsubscribed) { + subscription.add(new InnerRefCountSubscription(this.refCountSubscription)); + } + subscription.add(this.groupSubject.subscribe(subscriber)); + return subscription; + }; + return GroupedObservable; +})(Observable_1.Observable); +exports.GroupedObservable = GroupedObservable; +var InnerRefCountSubscription = (function (_super) { + __extends(InnerRefCountSubscription, _super); + function InnerRefCountSubscription(parent) { + _super.call(this); + this.parent = parent; + parent.count++; + } + InnerRefCountSubscription.prototype.unsubscribe = function () { + if (!this.parent.isUnsubscribed && !this.isUnsubscribed) { + _super.prototype.unsubscribe.call(this); + this.parent.count--; + if (this.parent.count === 0 && this.parent.attemptedToUnsubscribePrimary) { + this.parent.unsubscribe(); + this.parent.primary.unsubscribe(); + } + } + }; + return InnerRefCountSubscription; +})(Subscription_1.Subscription); +exports.InnerRefCountSubscription = InnerRefCountSubscription; + +},{"../Observable":3,"../Subscription":8}],151:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Observable_1 = require('../Observable'); +var Subject_1 = require('../Subject'); +var Map_1 = require('../util/Map'); +var FastMap_1 = require('../util/FastMap'); +var groupBy_support_1 = require('./groupBy-support'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function groupBy(keySelector, elementSelector, durationSelector) { + return new GroupByObservable(this, keySelector, elementSelector, durationSelector); +} +exports.groupBy = groupBy; +var GroupByObservable = (function (_super) { + __extends(GroupByObservable, _super); + function GroupByObservable(source, keySelector, elementSelector, durationSelector) { + _super.call(this); + this.source = source; + this.keySelector = keySelector; + this.elementSelector = elementSelector; + this.durationSelector = durationSelector; + } + GroupByObservable.prototype._subscribe = function (subscriber) { + var refCountSubscription = new groupBy_support_1.RefCountSubscription(); + var groupBySubscriber = new GroupBySubscriber(subscriber, refCountSubscription, this.keySelector, this.elementSelector, this.durationSelector); + refCountSubscription.setPrimary(this.source.subscribe(groupBySubscriber)); + return refCountSubscription; + }; + return GroupByObservable; +})(Observable_1.Observable); +exports.GroupByObservable = GroupByObservable; +var GroupBySubscriber = (function (_super) { + __extends(GroupBySubscriber, _super); + function GroupBySubscriber(destination, refCountSubscription, keySelector, elementSelector, durationSelector) { + _super.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 (x) { + var key = tryCatch_1.tryCatch(this.keySelector)(x); + if (key === errorObject_1.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 FastMap_1.FastMap() : new Map_1.Map(); + } + var group = groups.get(key); + if (!group) { + groups.set(key, group = new Subject_1.Subject()); + var groupedObservable = new groupBy_support_1.GroupedObservable(key, group, this.refCountSubscription); + if (durationSelector) { + var duration = tryCatch_1.tryCatch(durationSelector)(new groupBy_support_1.GroupedObservable(key, group)); + if (duration === errorObject_1.errorObject) { + this.error(duration.e); + } + else { + this.add(duration._subscribe(new GroupDurationSubscriber(key, group, this))); + } + } + this.destination.next(groupedObservable); + } + if (elementSelector) { + var value = tryCatch_1.tryCatch(elementSelector)(x); + if (value === errorObject_1.errorObject) { + this.error(value.e); + } + else { + group.next(value); + } + } + else { + group.next(x); + } + } + }; + GroupBySubscriber.prototype._error = function (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 () { + var _this = this; + var groups = this.groups; + if (groups) { + groups.forEach(function (group, key) { + group.complete(); + _this.removeGroup(group); + }); + } + this.destination.complete(); + }; + GroupBySubscriber.prototype.removeGroup = function (key) { + this.groups.delete(key); + }; + return GroupBySubscriber; +})(Subscriber_1.Subscriber); +var GroupDurationSubscriber = (function (_super) { + __extends(GroupDurationSubscriber, _super); + function GroupDurationSubscriber(key, group, parent) { + _super.call(this, null); + this.key = key; + this.group = group; + this.parent = parent; + } + GroupDurationSubscriber.prototype._next = function (value) { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._error = function (err) { + this.group.error(err); + this.parent.removeGroup(this.key); + }; + GroupDurationSubscriber.prototype._complete = function () { + this.group.complete(); + this.parent.removeGroup(this.key); + }; + return GroupDurationSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Observable":3,"../Subject":6,"../Subscriber":7,"../util/FastMap":224,"../util/Map":226,"../util/errorObject":230,"../util/tryCatch":241,"./groupBy-support":150}],152:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var noop_1 = require('../util/noop'); +function ignoreElements() { + return this.lift(new IgnoreElementsOperator()); +} +exports.ignoreElements = ignoreElements; +; +var IgnoreElementsOperator = (function () { + function IgnoreElementsOperator() { + } + IgnoreElementsOperator.prototype.call = function (subscriber) { + return new IgnoreElementsSubscriber(subscriber); + }; + return IgnoreElementsOperator; +})(); +var IgnoreElementsSubscriber = (function (_super) { + __extends(IgnoreElementsSubscriber, _super); + function IgnoreElementsSubscriber() { + _super.apply(this, arguments); + } + IgnoreElementsSubscriber.prototype._next = function (unused) { + noop_1.noop(); + }; + return IgnoreElementsSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/noop":236}],153:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var EmptyError_1 = require('../util/EmptyError'); +function last(predicate, resultSelector, defaultValue) { + return this.lift(new LastOperator(predicate, resultSelector, defaultValue, this)); +} +exports.last = last; +var LastOperator = (function () { + function LastOperator(predicate, resultSelector, defaultValue, source) { + this.predicate = predicate; + this.resultSelector = resultSelector; + this.defaultValue = defaultValue; + this.source = source; + } + LastOperator.prototype.call = function (observer) { + return new LastSubscriber(observer, this.predicate, this.resultSelector, this.defaultValue, this.source); + }; + return LastOperator; +})(); +var LastSubscriber = (function (_super) { + __extends(LastSubscriber, _super); + function LastSubscriber(destination, predicate, resultSelector, defaultValue, source) { + _super.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 (value) { + var _a = this, predicate = _a.predicate, resultSelector = _a.resultSelector, destination = _a.destination; + var index = this.index++; + if (predicate) { + var found = tryCatch_1.tryCatch(predicate)(value, index, this.source); + if (found === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return; + } + if (found) { + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return; + } + this.lastValue = result; + } + else { + this.lastValue = value; + } + this.hasValue = true; + } + } + else { + this.lastValue = value; + this.hasValue = true; + } + }; + LastSubscriber.prototype._complete = function () { + var destination = this.destination; + if (this.hasValue) { + destination.next(this.lastValue); + destination.complete(); + } + else { + destination.error(new EmptyError_1.EmptyError); + } + }; + return LastSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/EmptyError":223,"../util/errorObject":230,"../util/tryCatch":241}],154:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +/** + * Similar to the well known `Array.prototype.map` function, this operator + * applies a projection to each value and emits that projection in the returned observable + * + * @param {Function} project the function to create projection + * @param {any} [thisArg] an optional argument to define what `this` is in the project function + * @returns {Observable} a observable of projected values + */ +function map(project, thisArg) { + if (typeof project !== 'function') { + throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); + } + return this.lift(new MapOperator(project, thisArg)); +} +exports.map = map; +var MapOperator = (function () { + function MapOperator(project, thisArg) { + this.project = project; + this.thisArg = thisArg; + } + MapOperator.prototype.call = function (subscriber) { + return new MapSubscriber(subscriber, this.project, this.thisArg); + }; + return MapOperator; +})(); +var MapSubscriber = (function (_super) { + __extends(MapSubscriber, _super); + function MapSubscriber(destination, project, thisArg) { + _super.call(this, destination); + this.project = project; + this.thisArg = thisArg; + this.count = 0; + } + MapSubscriber.prototype._next = function (x) { + var result = tryCatch_1.tryCatch(this.project).call(this.thisArg || this, x, this.count++); + if (result === errorObject_1.errorObject) { + this.error(errorObject_1.errorObject.e); + } + else { + this.destination.next(result); + } + }; + return MapSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],155:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +/** + * Maps every value to the same value every time. + * @param {any} value the value to map each incoming value to + * @returns {Observable} an observable of the passed value that emits everytime the source does + */ +function mapTo(value) { + return this.lift(new MapToOperator(value)); +} +exports.mapTo = mapTo; +var MapToOperator = (function () { + function MapToOperator(value) { + this.value = value; + } + MapToOperator.prototype.call = function (subscriber) { + return new MapToSubscriber(subscriber, this.value); + }; + return MapToOperator; +})(); +var MapToSubscriber = (function (_super) { + __extends(MapToSubscriber, _super); + function MapToSubscriber(destination, value) { + _super.call(this, destination); + this.value = value; + } + MapToSubscriber.prototype._next = function (x) { + this.destination.next(this.value); + }; + return MapToSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],156:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Notification_1 = require('../Notification'); +function materialize() { + return this.lift(new MaterializeOperator()); +} +exports.materialize = materialize; +var MaterializeOperator = (function () { + function MaterializeOperator() { + } + MaterializeOperator.prototype.call = function (subscriber) { + return new MaterializeSubscriber(subscriber); + }; + return MaterializeOperator; +})(); +var MaterializeSubscriber = (function (_super) { + __extends(MaterializeSubscriber, _super); + function MaterializeSubscriber(destination) { + _super.call(this, destination); + } + MaterializeSubscriber.prototype._next = function (value) { + this.destination.next(Notification_1.Notification.createNext(value)); + }; + MaterializeSubscriber.prototype._error = function (err) { + var destination = this.destination; + destination.next(Notification_1.Notification.createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function () { + var destination = this.destination; + destination.next(Notification_1.Notification.createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Notification":2,"../Subscriber":7}],157:[function(require,module,exports){ +var fromArray_1 = require('../observable/fromArray'); +var mergeAll_support_1 = require('./mergeAll-support'); +var queue_1 = require('../scheduler/queue'); +var isScheduler_1 = require('../util/isScheduler'); +function merge() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var concurrent = Number.POSITIVE_INFINITY; + var scheduler = queue_1.queue; + var last = observables[observables.length - 1]; + if (isScheduler_1.isScheduler(last)) { + 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 fromArray_1.ArrayObservable(observables, scheduler).lift(new mergeAll_support_1.MergeAllOperator(concurrent)); +} +exports.merge = merge; + +},{"../observable/fromArray":112,"../scheduler/queue":216,"../util/isScheduler":235,"./mergeAll-support":159}],158:[function(require,module,exports){ +var merge_static_1 = require('./merge-static'); +function merge() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + observables.unshift(this); + return merge_static_1.merge.apply(this, observables); +} +exports.merge = merge; + +},{"./merge-static":157}],159:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +var MergeAllOperator = (function () { + function MergeAllOperator(concurrent) { + this.concurrent = concurrent; + } + MergeAllOperator.prototype.call = function (observer) { + return new MergeAllSubscriber(observer, this.concurrent); + }; + return MergeAllOperator; +})(); +exports.MergeAllOperator = MergeAllOperator; +var MergeAllSubscriber = (function (_super) { + __extends(MergeAllSubscriber, _super); + function MergeAllSubscriber(destination, concurrent) { + _super.call(this, destination); + this.concurrent = concurrent; + this.hasCompleted = false; + this.buffer = []; + this.active = 0; + } + MergeAllSubscriber.prototype._next = function (observable) { + if (this.active < this.concurrent) { + if (observable._isScalar) { + this.destination.next(observable.value); + } + else { + this.active++; + this.add(subscribeToResult_1.subscribeToResult(this, observable)); + } + } + else { + this.buffer.push(observable); + } + }; + MergeAllSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeAllSubscriber.prototype.notifyComplete = function (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; +})(OuterSubscriber_1.OuterSubscriber); +exports.MergeAllSubscriber = MergeAllSubscriber; + +},{"../OuterSubscriber":4,"../util/subscribeToResult":239}],160:[function(require,module,exports){ +var mergeAll_support_1 = require('./mergeAll-support'); +function mergeAll(concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + return this.lift(new mergeAll_support_1.MergeAllOperator(concurrent)); +} +exports.mergeAll = mergeAll; + +},{"./mergeAll-support":159}],161:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var MergeMapOperator = (function () { + function MergeMapOperator(project, resultSelector, concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + this.project = project; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapOperator.prototype.call = function (observer) { + return new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent); + }; + return MergeMapOperator; +})(); +exports.MergeMapOperator = MergeMapOperator; +var MergeMapSubscriber = (function (_super) { + __extends(MergeMapSubscriber, _super); + function MergeMapSubscriber(destination, project, resultSelector, concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + _super.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 (value) { + if (this.active < this.concurrent) { + var index = this.index++; + var ish = tryCatch_1.tryCatch(this.project)(value, index); + var destination = this.destination; + if (ish === errorObject_1.errorObject) { + destination.error(ish.e); + } + else { + this.active++; + this._innerSub(ish, value, index); + } + } + else { + this.buffer.push(value); + } + }; + MergeMapSubscriber.prototype._innerSub = function (ish, value, index) { + this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index)); + }; + MergeMapSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, destination = _a.destination, resultSelector = _a.resultSelector; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + destination.next(result); + } + } + else { + destination.next(innerValue); + } + }; + MergeMapSubscriber.prototype.notifyComplete = function (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; +})(OuterSubscriber_1.OuterSubscriber); +exports.MergeMapSubscriber = MergeMapSubscriber; + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],162:[function(require,module,exports){ +var mergeMap_support_1 = require('./mergeMap-support'); +function mergeMap(project, resultSelector, concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + return this.lift(new mergeMap_support_1.MergeMapOperator(project, resultSelector, concurrent)); +} +exports.mergeMap = mergeMap; + +},{"./mergeMap-support":161}],163:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +var MergeMapToOperator = (function () { + function MergeMapToOperator(ish, resultSelector, concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + this.ish = ish; + this.resultSelector = resultSelector; + this.concurrent = concurrent; + } + MergeMapToOperator.prototype.call = function (observer) { + return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent); + }; + return MergeMapToOperator; +})(); +exports.MergeMapToOperator = MergeMapToOperator; +var MergeMapToSubscriber = (function (_super) { + __extends(MergeMapToSubscriber, _super); + function MergeMapToSubscriber(destination, ish, resultSelector, concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + _super.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 (value) { + if (this.active < this.concurrent) { + var resultSelector = this.resultSelector; + var index = this.index++; + var ish = this.ish; + var destination = this.destination; + this.active++; + this._innerSub(ish, destination, resultSelector, value, index); + } + else { + this.buffer.push(value); + } + }; + MergeMapToSubscriber.prototype._innerSub = function (ish, destination, resultSelector, value, index) { + this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index)); + }; + MergeMapToSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + }; + MergeMapToSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, resultSelector = _a.resultSelector, destination = _a.destination; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + destination.next(result); + } + } + else { + destination.next(innerValue); + } + }; + MergeMapToSubscriber.prototype.notifyError = function (err) { + this.destination.error(err); + }; + MergeMapToSubscriber.prototype.notifyComplete = function (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; +})(OuterSubscriber_1.OuterSubscriber); +exports.MergeMapToSubscriber = MergeMapToSubscriber; + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],164:[function(require,module,exports){ +var mergeMapTo_support_1 = require('./mergeMapTo-support'); +function mergeMapTo(observable, resultSelector, concurrent) { + if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } + return this.lift(new mergeMapTo_support_1.MergeMapToOperator(observable, resultSelector, concurrent)); +} +exports.mergeMapTo = mergeMapTo; + +},{"./mergeMapTo-support":163}],165:[function(require,module,exports){ +var ConnectableObservable_1 = require('../observable/ConnectableObservable'); +function multicast(subjectOrSubjectFactory) { + var subjectFactory; + if (typeof subjectOrSubjectFactory === 'function') { + subjectFactory = subjectOrSubjectFactory; + } + else { + subjectFactory = function subjectFactory() { + return subjectOrSubjectFactory; + }; + } + return new ConnectableObservable_1.ConnectableObservable(this, subjectFactory); +} +exports.multicast = multicast; + +},{"../observable/ConnectableObservable":103}],166:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Notification_1 = require('../Notification'); +var ObserveOnOperator = (function () { + function ObserveOnOperator(scheduler, delay) { + if (delay === void 0) { delay = 0; } + this.scheduler = scheduler; + this.delay = delay; + } + ObserveOnOperator.prototype.call = function (subscriber) { + return new ObserveOnSubscriber(subscriber, this.scheduler, this.delay); + }; + return ObserveOnOperator; +})(); +exports.ObserveOnOperator = ObserveOnOperator; +var ObserveOnSubscriber = (function (_super) { + __extends(ObserveOnSubscriber, _super); + function ObserveOnSubscriber(destination, scheduler, delay) { + if (delay === void 0) { delay = 0; } + _super.call(this, destination); + this.scheduler = scheduler; + this.delay = delay; + } + ObserveOnSubscriber.dispatch = function (_a) { + var notification = _a.notification, destination = _a.destination; + notification.observe(destination); + }; + ObserveOnSubscriber.prototype.scheduleMessage = function (notification) { + this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination))); + }; + ObserveOnSubscriber.prototype._next = function (value) { + this.scheduleMessage(Notification_1.Notification.createNext(value)); + }; + ObserveOnSubscriber.prototype._error = function (err) { + this.scheduleMessage(Notification_1.Notification.createError(err)); + }; + ObserveOnSubscriber.prototype._complete = function () { + this.scheduleMessage(Notification_1.Notification.createComplete()); + }; + return ObserveOnSubscriber; +})(Subscriber_1.Subscriber); +exports.ObserveOnSubscriber = ObserveOnSubscriber; +var ObserveOnMessage = (function () { + function ObserveOnMessage(notification, destination) { + this.notification = notification; + this.destination = destination; + } + return ObserveOnMessage; +})(); + +},{"../Notification":2,"../Subscriber":7}],167:[function(require,module,exports){ +var observeOn_support_1 = require('./observeOn-support'); +function observeOn(scheduler, delay) { + if (delay === void 0) { delay = 0; } + return this.lift(new observeOn_support_1.ObserveOnOperator(scheduler, delay)); +} +exports.observeOn = observeOn; + +},{"./observeOn-support":166}],168:[function(require,module,exports){ +var not_1 = require('../util/not'); +var filter_1 = require('./filter'); +function partition(predicate, thisArg) { + return [ + filter_1.filter.call(this, predicate), + filter_1.filter.call(this, not_1.not(predicate, thisArg)) + ]; +} +exports.partition = partition; + +},{"../util/not":237,"./filter":147}],169:[function(require,module,exports){ +var Subject_1 = require('../Subject'); +var multicast_1 = require('./multicast'); +function publish() { + return multicast_1.multicast.call(this, new Subject_1.Subject()); +} +exports.publish = publish; + +},{"../Subject":6,"./multicast":165}],170:[function(require,module,exports){ +var BehaviorSubject_1 = require('../subject/BehaviorSubject'); +var multicast_1 = require('./multicast'); +function publishBehavior(value) { + return multicast_1.multicast.call(this, new BehaviorSubject_1.BehaviorSubject(value)); +} +exports.publishBehavior = publishBehavior; + +},{"../subject/BehaviorSubject":218,"./multicast":165}],171:[function(require,module,exports){ +var AsyncSubject_1 = require('../subject/AsyncSubject'); +var multicast_1 = require('./multicast'); +function publishLast() { + return multicast_1.multicast.call(this, new AsyncSubject_1.AsyncSubject()); +} +exports.publishLast = publishLast; + +},{"../subject/AsyncSubject":217,"./multicast":165}],172:[function(require,module,exports){ +var ReplaySubject_1 = require('../subject/ReplaySubject'); +var multicast_1 = require('./multicast'); +function publishReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; } + if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; } + return multicast_1.multicast.call(this, new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler)); +} +exports.publishReplay = publishReplay; + +},{"../subject/ReplaySubject":219,"./multicast":165}],173:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var ReduceOperator = (function () { + function ReduceOperator(project, seed) { + this.project = project; + this.seed = seed; + } + ReduceOperator.prototype.call = function (subscriber) { + return new ReduceSubscriber(subscriber, this.project, this.seed); + }; + return ReduceOperator; +})(); +exports.ReduceOperator = ReduceOperator; +var ReduceSubscriber = (function (_super) { + __extends(ReduceSubscriber, _super); + function ReduceSubscriber(destination, project, seed) { + _super.call(this, destination); + this.hasValue = false; + this.acc = seed; + this.project = project; + this.hasSeed = typeof seed !== 'undefined'; + } + ReduceSubscriber.prototype._next = function (x) { + if (this.hasValue || (this.hasValue = this.hasSeed)) { + var result = tryCatch_1.tryCatch(this.project).call(this, this.acc, x); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else { + this.acc = result; + } + } + else { + this.acc = x; + this.hasValue = true; + } + }; + ReduceSubscriber.prototype._complete = function () { + if (this.hasValue || this.hasSeed) { + this.destination.next(this.acc); + } + this.destination.complete(); + }; + return ReduceSubscriber; +})(Subscriber_1.Subscriber); +exports.ReduceSubscriber = ReduceSubscriber; + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],174:[function(require,module,exports){ +var reduce_support_1 = require('./reduce-support'); +function reduce(project, seed) { + return this.lift(new reduce_support_1.ReduceOperator(project, seed)); +} +exports.reduce = reduce; + +},{"./reduce-support":173}],175:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var empty_1 = require('../observable/empty'); +function repeat(count) { + if (count === void 0) { count = -1; } + if (count === 0) { + return new empty_1.EmptyObservable(); + } + else { + return this.lift(new RepeatOperator(count, this)); + } +} +exports.repeat = repeat; +var RepeatOperator = (function () { + function RepeatOperator(count, source) { + this.count = count; + this.source = source; + } + RepeatOperator.prototype.call = function (subscriber) { + return new FirstRepeatSubscriber(subscriber, this.count, this.source); + }; + return RepeatOperator; +})(); +var FirstRepeatSubscriber = (function (_super) { + __extends(FirstRepeatSubscriber, _super); + function FirstRepeatSubscriber(destination, count, source) { + _super.call(this); + this.destination = destination; + this.count = count; + this.source = source; + destination.add(this); + this.lastSubscription = this; + } + FirstRepeatSubscriber.prototype._next = function (value) { + this.destination.next(value); + }; + FirstRepeatSubscriber.prototype._error = function (err) { + this.destination.error(err); + }; + FirstRepeatSubscriber.prototype.complete = function () { + if (!this.isUnsubscribed) { + this.resubscribe(this.count); + } + }; + FirstRepeatSubscriber.prototype.unsubscribe = function () { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _super.prototype.unsubscribe.call(this); + } + else { + lastSubscription.unsubscribe(); + } + }; + FirstRepeatSubscriber.prototype.resubscribe = function (count) { + var _a = this, destination = _a.destination, lastSubscription = _a.lastSubscription; + destination.remove(lastSubscription); + lastSubscription.unsubscribe(); + if (count - 1 === 0) { + destination.complete(); + } + else { + var nextSubscriber = new MoreRepeatSubscriber(this, count - 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + destination.add(this.lastSubscription); + } + }; + return FirstRepeatSubscriber; +})(Subscriber_1.Subscriber); +var MoreRepeatSubscriber = (function (_super) { + __extends(MoreRepeatSubscriber, _super); + function MoreRepeatSubscriber(parent, count) { + _super.call(this); + this.parent = parent; + this.count = count; + } + MoreRepeatSubscriber.prototype._next = function (value) { + this.parent.destination.next(value); + }; + MoreRepeatSubscriber.prototype._error = function (err) { + this.parent.destination.error(err); + }; + MoreRepeatSubscriber.prototype._complete = function () { + var count = this.count; + this.parent.resubscribe(count < 0 ? -1 : count); + }; + return MoreRepeatSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../observable/empty":109}],176:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function retry(count) { + if (count === void 0) { count = 0; } + return this.lift(new RetryOperator(count, this)); +} +exports.retry = retry; +var RetryOperator = (function () { + function RetryOperator(count, source) { + this.count = count; + this.source = source; + } + RetryOperator.prototype.call = function (subscriber) { + return new FirstRetrySubscriber(subscriber, this.count, this.source); + }; + return RetryOperator; +})(); +var FirstRetrySubscriber = (function (_super) { + __extends(FirstRetrySubscriber, _super); + function FirstRetrySubscriber(destination, count, source) { + _super.call(this); + this.destination = destination; + this.count = count; + this.source = source; + destination.add(this); + this.lastSubscription = this; + } + FirstRetrySubscriber.prototype._next = function (value) { + this.destination.next(value); + }; + FirstRetrySubscriber.prototype.error = function (error) { + if (!this.isUnsubscribed) { + this.unsubscribe(); + this.resubscribe(); + } + }; + FirstRetrySubscriber.prototype._complete = function () { + this.unsubscribe(); + this.destination.complete(); + }; + FirstRetrySubscriber.prototype.resubscribe = function (retried) { + if (retried === void 0) { retried = 0; } + var _a = this, lastSubscription = _a.lastSubscription, destination = _a.destination; + destination.remove(lastSubscription); + lastSubscription.unsubscribe(); + var nextSubscriber = new RetryMoreSubscriber(this, this.count, retried + 1); + this.lastSubscription = this.source.subscribe(nextSubscriber); + destination.add(this.lastSubscription); + }; + return FirstRetrySubscriber; +})(Subscriber_1.Subscriber); +var RetryMoreSubscriber = (function (_super) { + __extends(RetryMoreSubscriber, _super); + function RetryMoreSubscriber(parent, count, retried) { + if (retried === void 0) { retried = 0; } + _super.call(this, null); + this.parent = parent; + this.count = count; + this.retried = retried; + } + RetryMoreSubscriber.prototype._next = function (value) { + this.parent.destination.next(value); + }; + RetryMoreSubscriber.prototype._error = function (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 () { + this.parent.destination.complete(); + }; + return RetryMoreSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],177:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subject_1 = require('../Subject'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function retryWhen(notifier) { + return this.lift(new RetryWhenOperator(notifier, this)); +} +exports.retryWhen = retryWhen; +var RetryWhenOperator = (function () { + function RetryWhenOperator(notifier, source) { + this.notifier = notifier; + this.source = source; + } + RetryWhenOperator.prototype.call = function (subscriber) { + return new FirstRetryWhenSubscriber(subscriber, this.notifier, this.source); + }; + return RetryWhenOperator; +})(); +var FirstRetryWhenSubscriber = (function (_super) { + __extends(FirstRetryWhenSubscriber, _super); + function FirstRetryWhenSubscriber(destination, notifier, source) { + _super.call(this); + this.destination = destination; + this.notifier = notifier; + this.source = source; + destination.add(this); + this.lastSubscription = this; + } + FirstRetryWhenSubscriber.prototype._next = function (value) { + this.destination.next(value); + }; + FirstRetryWhenSubscriber.prototype.error = function (err) { + var destination = this.destination; + if (!this.isUnsubscribed) { + _super.prototype.unsubscribe.call(this); + if (!this.retryNotifications) { + this.errors = new Subject_1.Subject(); + var notifications = tryCatch_1.tryCatch(this.notifier).call(this, this.errors); + if (notifications === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + this.retryNotifications = notifications; + var notificationSubscriber = new RetryNotificationSubscriber(this); + this.notificationSubscription = notifications.subscribe(notificationSubscriber); + destination.add(this.notificationSubscription); + } + } + this.errors.next(err); + } + }; + FirstRetryWhenSubscriber.prototype.destinationError = function (err) { + this.tearDown(); + this.destination.error(err); + }; + FirstRetryWhenSubscriber.prototype._complete = function () { + this.destinationComplete(); + }; + FirstRetryWhenSubscriber.prototype.destinationComplete = function () { + this.tearDown(); + this.destination.complete(); + }; + FirstRetryWhenSubscriber.prototype.unsubscribe = function () { + var lastSubscription = this.lastSubscription; + if (lastSubscription === this) { + _super.prototype.unsubscribe.call(this); + } + else { + this.tearDown(); + } + }; + FirstRetryWhenSubscriber.prototype.tearDown = function () { + _super.prototype.unsubscribe.call(this); + this.lastSubscription.unsubscribe(); + var notificationSubscription = this.notificationSubscription; + if (notificationSubscription) { + notificationSubscription.unsubscribe(); + } + }; + FirstRetryWhenSubscriber.prototype.resubscribe = function () { + var _a = this, destination = _a.destination, lastSubscription = _a.lastSubscription; + destination.remove(lastSubscription); + lastSubscription.unsubscribe(); + var nextSubscriber = new MoreRetryWhenSubscriber(this); + this.lastSubscription = this.source.subscribe(nextSubscriber); + destination.add(this.lastSubscription); + }; + return FirstRetryWhenSubscriber; +})(Subscriber_1.Subscriber); +var MoreRetryWhenSubscriber = (function (_super) { + __extends(MoreRetryWhenSubscriber, _super); + function MoreRetryWhenSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + MoreRetryWhenSubscriber.prototype._next = function (value) { + this.parent.destination.next(value); + }; + MoreRetryWhenSubscriber.prototype._error = function (err) { + this.parent.errors.next(err); + }; + MoreRetryWhenSubscriber.prototype._complete = function () { + this.parent.destinationComplete(); + }; + return MoreRetryWhenSubscriber; +})(Subscriber_1.Subscriber); +var RetryNotificationSubscriber = (function (_super) { + __extends(RetryNotificationSubscriber, _super); + function RetryNotificationSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + RetryNotificationSubscriber.prototype._next = function (value) { + this.parent.resubscribe(); + }; + RetryNotificationSubscriber.prototype._error = function (err) { + this.parent.destinationError(err); + }; + RetryNotificationSubscriber.prototype._complete = function () { + this.parent.destinationComplete(); + }; + return RetryNotificationSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subject":6,"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],178:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function sample(notifier) { + return this.lift(new SampleOperator(notifier)); +} +exports.sample = sample; +var SampleOperator = (function () { + function SampleOperator(notifier) { + this.notifier = notifier; + } + SampleOperator.prototype.call = function (subscriber) { + return new SampleSubscriber(subscriber, this.notifier); + }; + return SampleOperator; +})(); +var SampleSubscriber = (function (_super) { + __extends(SampleSubscriber, _super); + function SampleSubscriber(destination, notifier) { + _super.call(this, destination); + this.notifier = notifier; + this.hasValue = false; + this.add(notifier._subscribe(new SampleNotificationSubscriber(this))); + } + SampleSubscriber.prototype._next = function (value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleSubscriber.prototype.notifyNext = function () { + if (this.hasValue) { + this.hasValue = false; + this.destination.next(this.lastValue); + } + }; + return SampleSubscriber; +})(Subscriber_1.Subscriber); +var SampleNotificationSubscriber = (function (_super) { + __extends(SampleNotificationSubscriber, _super); + function SampleNotificationSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + SampleNotificationSubscriber.prototype._next = function () { + this.parent.notifyNext(); + }; + SampleNotificationSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + SampleNotificationSubscriber.prototype._complete = function () { + this.parent.notifyNext(); + }; + return SampleNotificationSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],179:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var asap_1 = require('../scheduler/asap'); +function sampleTime(delay, scheduler) { + if (scheduler === void 0) { scheduler = asap_1.asap; } + return this.lift(new SampleTimeOperator(delay, scheduler)); +} +exports.sampleTime = sampleTime; +var SampleTimeOperator = (function () { + function SampleTimeOperator(delay, scheduler) { + this.delay = delay; + this.scheduler = scheduler; + } + SampleTimeOperator.prototype.call = function (subscriber) { + return new SampleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return SampleTimeOperator; +})(); +var SampleTimeSubscriber = (function (_super) { + __extends(SampleTimeSubscriber, _super); + function SampleTimeSubscriber(destination, delay, scheduler) { + _super.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 (value) { + this.lastValue = value; + this.hasValue = true; + }; + SampleTimeSubscriber.prototype.notifyNext = function () { + if (this.hasValue) { + this.hasValue = false; + this.destination.next(this.lastValue); + } + }; + return SampleTimeSubscriber; +})(Subscriber_1.Subscriber); +function dispatchNotification(state) { + var subscriber = state.subscriber, delay = state.delay; + subscriber.notifyNext(); + this.schedule(state, delay); +} + +},{"../Subscriber":7,"../scheduler/asap":215}],180:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function scan(accumulator, seed) { + return this.lift(new ScanOperator(accumulator, seed)); +} +exports.scan = scan; +var ScanOperator = (function () { + function ScanOperator(accumulator, seed) { + this.accumulator = accumulator; + this.seed = seed; + } + ScanOperator.prototype.call = function (subscriber) { + return new ScanSubscriber(subscriber, this.accumulator, this.seed); + }; + return ScanOperator; +})(); +var ScanSubscriber = (function (_super) { + __extends(ScanSubscriber, _super); + function ScanSubscriber(destination, accumulator, seed) { + _super.call(this, destination); + this.accumulator = accumulator; + this.accumulatorSet = false; + this.seed = seed; + this.accumulator = accumulator; + this.accumulatorSet = typeof seed !== 'undefined'; + } + Object.defineProperty(ScanSubscriber.prototype, "seed", { + get: function () { + return this._seed; + }, + set: function (value) { + this.accumulatorSet = true; + this._seed = value; + }, + enumerable: true, + configurable: true + }); + ScanSubscriber.prototype._next = function (value) { + if (!this.accumulatorSet) { + this.seed = value; + this.destination.next(value); + } + else { + var result = tryCatch_1.tryCatch(this.accumulator).call(this, this.seed, value); + if (result === errorObject_1.errorObject) { + this.destination.error(errorObject_1.errorObject.e); + } + else { + this.seed = result; + this.destination.next(this.seed); + } + } + }; + return ScanSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],181:[function(require,module,exports){ +var multicast_1 = require('./multicast'); +var Subject_1 = require('../Subject'); +function shareSubjectFactory() { + return new Subject_1.Subject(); +} +function share() { + return multicast_1.multicast.call(this, shareSubjectFactory).refCount(); +} +exports.share = share; +; + +},{"../Subject":6,"./multicast":165}],182:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var EmptyError_1 = require('../util/EmptyError'); +function single(predicate) { + return this.lift(new SingleOperator(predicate, this)); +} +exports.single = single; +var SingleOperator = (function () { + function SingleOperator(predicate, source) { + this.predicate = predicate; + this.source = source; + } + SingleOperator.prototype.call = function (subscriber) { + return new SingleSubscriber(subscriber, this.predicate, this.source); + }; + return SingleOperator; +})(); +var SingleSubscriber = (function (_super) { + __extends(SingleSubscriber, _super); + function SingleSubscriber(destination, predicate, source) { + _super.call(this, destination); + this.predicate = predicate; + this.source = source; + this.seenValue = false; + this.index = 0; + } + SingleSubscriber.prototype.applySingleValue = function (value) { + if (this.seenValue) { + this.destination.error('Sequence contains more than one element'); + } + else { + this.seenValue = true; + this.singleValue = value; + } + }; + SingleSubscriber.prototype._next = function (value) { + var predicate = this.predicate; + var currentIndex = this.index++; + if (predicate) { + var result = tryCatch_1.tryCatch(predicate)(value, currentIndex, this.source); + if (result === errorObject_1.errorObject) { + this.destination.error(result.e); + } + else if (result) { + this.applySingleValue(value); + } + } + else { + this.applySingleValue(value); + } + }; + SingleSubscriber.prototype._complete = function () { + var destination = this.destination; + if (this.index > 0) { + destination.next(this.seenValue ? this.singleValue : undefined); + destination.complete(); + } + else { + destination.error(new EmptyError_1.EmptyError); + } + }; + return SingleSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/EmptyError":223,"../util/errorObject":230,"../util/tryCatch":241}],183:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function skip(total) { + return this.lift(new SkipOperator(total)); +} +exports.skip = skip; +var SkipOperator = (function () { + function SkipOperator(total) { + this.total = total; + } + SkipOperator.prototype.call = function (subscriber) { + return new SkipSubscriber(subscriber, this.total); + }; + return SkipOperator; +})(); +var SkipSubscriber = (function (_super) { + __extends(SkipSubscriber, _super); + function SkipSubscriber(destination, total) { + _super.call(this, destination); + this.total = total; + this.count = 0; + } + SkipSubscriber.prototype._next = function (x) { + if (++this.count > this.total) { + this.destination.next(x); + } + }; + return SkipSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],184:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function skipUntil(notifier) { + return this.lift(new SkipUntilOperator(notifier)); +} +exports.skipUntil = skipUntil; +var SkipUntilOperator = (function () { + function SkipUntilOperator(notifier) { + this.notifier = notifier; + } + SkipUntilOperator.prototype.call = function (subscriber) { + return new SkipUntilSubscriber(subscriber, this.notifier); + }; + return SkipUntilOperator; +})(); +var SkipUntilSubscriber = (function (_super) { + __extends(SkipUntilSubscriber, _super); + function SkipUntilSubscriber(destination, notifier) { + _super.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 (value) { + if (this.notificationSubscriber.hasValue) { + this.destination.next(value); + } + }; + SkipUntilSubscriber.prototype._error = function (err) { + this.destination.error(err); + }; + SkipUntilSubscriber.prototype._complete = function () { + if (this.notificationSubscriber.hasCompleted) { + this.destination.complete(); + } + this.notificationSubscriber.unsubscribe(); + }; + SkipUntilSubscriber.prototype.unsubscribe = function () { + if (this._isUnsubscribed) { + return; + } + else if (this._subscription) { + this._subscription.unsubscribe(); + this._isUnsubscribed = true; + } + else { + _super.prototype.unsubscribe.call(this); + } + }; + return SkipUntilSubscriber; +})(Subscriber_1.Subscriber); +var NotificationSubscriber = (function (_super) { + __extends(NotificationSubscriber, _super); + function NotificationSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + this.hasValue = false; + this.hasCompleted = false; + } + NotificationSubscriber.prototype._next = function (unused) { + this.hasValue = true; + }; + NotificationSubscriber.prototype._error = function (err) { + this.parent.error(err); + this.hasValue = true; + }; + NotificationSubscriber.prototype._complete = function () { + this.hasCompleted = true; + }; + return NotificationSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],185:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function skipWhile(predicate) { + return this.lift(new SkipWhileOperator(predicate)); +} +exports.skipWhile = skipWhile; +var SkipWhileOperator = (function () { + function SkipWhileOperator(predicate) { + this.predicate = predicate; + } + SkipWhileOperator.prototype.call = function (subscriber) { + return new SkipWhileSubscriber(subscriber, this.predicate); + }; + return SkipWhileOperator; +})(); +var SkipWhileSubscriber = (function (_super) { + __extends(SkipWhileSubscriber, _super); + function SkipWhileSubscriber(destination, predicate) { + _super.call(this, destination); + this.predicate = predicate; + this.skipping = true; + this.index = 0; + } + SkipWhileSubscriber.prototype._next = function (value) { + var destination = this.destination; + if (this.skipping === true) { + var index = this.index++; + var result = tryCatch_1.tryCatch(this.predicate)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } + else { + this.skipping = Boolean(result); + } + } + if (this.skipping === false) { + destination.next(value); + } + }; + return SkipWhileSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],186:[function(require,module,exports){ +var fromArray_1 = require('../observable/fromArray'); +var ScalarObservable_1 = require('../observable/ScalarObservable'); +var empty_1 = require('../observable/empty'); +var concat_static_1 = require('./concat-static'); +var isScheduler_1 = require('../util/isScheduler'); +function startWith() { + var array = []; + for (var _i = 0; _i < arguments.length; _i++) { + array[_i - 0] = arguments[_i]; + } + var scheduler = array[array.length - 1]; + if (isScheduler_1.isScheduler(scheduler)) { + array.pop(); + } + else { + scheduler = void 0; + } + var len = array.length; + if (len === 1) { + return concat_static_1.concat(new ScalarObservable_1.ScalarObservable(array[0], scheduler), this); + } + else if (len > 1) { + return concat_static_1.concat(new fromArray_1.ArrayObservable(array, scheduler), this); + } + else { + return concat_static_1.concat(new empty_1.EmptyObservable(scheduler), this); + } +} +exports.startWith = startWith; + +},{"../observable/ScalarObservable":105,"../observable/empty":109,"../observable/fromArray":112,"../util/isScheduler":235,"./concat-static":131}],187:[function(require,module,exports){ +var SubscribeOnObservable_1 = require('../observable/SubscribeOnObservable'); +function subscribeOn(scheduler, delay) { + if (delay === void 0) { delay = 0; } + return new SubscribeOnObservable_1.SubscribeOnObservable(this, delay, scheduler); +} +exports.subscribeOn = subscribeOn; + +},{"../observable/SubscribeOnObservable":106}],188:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +function _switch() { + return this.lift(new SwitchOperator()); +} +exports._switch = _switch; +var SwitchOperator = (function () { + function SwitchOperator() { + } + SwitchOperator.prototype.call = function (subscriber) { + return new SwitchSubscriber(subscriber); + }; + return SwitchOperator; +})(); +var SwitchSubscriber = (function (_super) { + __extends(SwitchSubscriber, _super); + function SwitchSubscriber(destination) { + _super.call(this, destination); + this.active = 0; + this.hasCompleted = false; + } + SwitchSubscriber.prototype._next = function (value) { + this.unsubscribeInner(); + this.active++; + this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, value)); + }; + SwitchSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.active === 0) { + this.destination.complete(); + } + }; + SwitchSubscriber.prototype.unsubscribeInner = function () { + this.active = this.active > 0 ? this.active - 1 : 0; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + this.remove(innerSubscription); + } + }; + SwitchSubscriber.prototype.notifyNext = function (outerValue, innerValue) { + this.destination.next(innerValue); + }; + SwitchSubscriber.prototype.notifyError = function (err) { + this.destination.error(err); + }; + SwitchSubscriber.prototype.notifyComplete = function () { + this.unsubscribeInner(); + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return SwitchSubscriber; +})(OuterSubscriber_1.OuterSubscriber); + +},{"../OuterSubscriber":4,"../util/subscribeToResult":239}],189:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +function switchMap(project, resultSelector) { + return this.lift(new SwitchMapOperator(project, resultSelector)); +} +exports.switchMap = switchMap; +var SwitchMapOperator = (function () { + function SwitchMapOperator(project, resultSelector) { + this.project = project; + this.resultSelector = resultSelector; + } + SwitchMapOperator.prototype.call = function (subscriber) { + return new SwitchMapSubscriber(subscriber, this.project, this.resultSelector); + }; + return SwitchMapOperator; +})(); +var SwitchMapSubscriber = (function (_super) { + __extends(SwitchMapSubscriber, _super); + function SwitchMapSubscriber(destination, project, resultSelector) { + _super.call(this, destination); + this.project = project; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapSubscriber.prototype._next = function (value) { + var index = this.index++; + var destination = this.destination; + var result = tryCatch_1.tryCatch(this.project)(value, index); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } + else { + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, result, value, index)); + } + }; + SwitchMapSubscriber.prototype._complete = function () { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapSubscriber.prototype.notifyComplete = function (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 (err) { + this.destination.error(err); + }; + SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, resultSelector = _a.resultSelector, destination = _a.destination; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + destination.next(result); + } + } + else { + destination.next(innerValue); + } + }; + return SwitchMapSubscriber; +})(OuterSubscriber_1.OuterSubscriber); + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],190:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +function switchMapTo(observable, projectResult) { + return this.lift(new SwitchMapToOperator(observable, projectResult)); +} +exports.switchMapTo = switchMapTo; +var SwitchMapToOperator = (function () { + function SwitchMapToOperator(observable, resultSelector) { + this.observable = observable; + this.resultSelector = resultSelector; + } + SwitchMapToOperator.prototype.call = function (subscriber) { + return new SwitchMapToSubscriber(subscriber, this.observable, this.resultSelector); + }; + return SwitchMapToOperator; +})(); +var SwitchMapToSubscriber = (function (_super) { + __extends(SwitchMapToSubscriber, _super); + function SwitchMapToSubscriber(destination, inner, resultSelector) { + _super.call(this, destination); + this.inner = inner; + this.resultSelector = resultSelector; + this.hasCompleted = false; + this.index = 0; + } + SwitchMapToSubscriber.prototype._next = function (value) { + var index = this.index++; + var innerSubscription = this.innerSubscription; + if (innerSubscription) { + innerSubscription.unsubscribe(); + } + this.add(this.innerSubscription = subscribeToResult_1.subscribeToResult(this, this.inner, value, index)); + }; + SwitchMapToSubscriber.prototype._complete = function () { + var innerSubscription = this.innerSubscription; + this.hasCompleted = true; + if (!innerSubscription || innerSubscription.isUnsubscribed) { + this.destination.complete(); + } + }; + SwitchMapToSubscriber.prototype.notifyComplete = function (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 (err) { + this.destination.error(err); + }; + SwitchMapToSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { + var _a = this, resultSelector = _a.resultSelector, destination = _a.destination; + if (resultSelector) { + var result = tryCatch_1.tryCatch(resultSelector)(outerValue, innerValue, outerIndex, innerIndex); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + destination.next(result); + } + } + else { + destination.next(innerValue); + } + }; + return SwitchMapToSubscriber; +})(OuterSubscriber_1.OuterSubscriber); + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],191:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var ArgumentOutOfRangeError_1 = require('../util/ArgumentOutOfRangeError'); +var empty_1 = require('../observable/empty'); +function take(total) { + if (total === 0) { + return new empty_1.EmptyObservable(); + } + else { + return this.lift(new TakeOperator(total)); + } +} +exports.take = take; +var TakeOperator = (function () { + function TakeOperator(total) { + this.total = total; + if (this.total < 0) { + throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; + } + } + TakeOperator.prototype.call = function (subscriber) { + return new TakeSubscriber(subscriber, this.total); + }; + return TakeOperator; +})(); +var TakeSubscriber = (function (_super) { + __extends(TakeSubscriber, _super); + function TakeSubscriber(destination, total) { + _super.call(this, destination); + this.total = total; + this.count = 0; + } + TakeSubscriber.prototype._next = function (value) { + var total = this.total; + if (++this.count <= total) { + this.destination.next(value); + if (this.count === total) { + this.destination.complete(); + } + } + }; + return TakeSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../observable/empty":109,"../util/ArgumentOutOfRangeError":222}],192:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var noop_1 = require('../util/noop'); +function takeUntil(notifier) { + return this.lift(new TakeUntilOperator(notifier)); +} +exports.takeUntil = takeUntil; +var TakeUntilOperator = (function () { + function TakeUntilOperator(notifier) { + this.notifier = notifier; + } + TakeUntilOperator.prototype.call = function (subscriber) { + return new TakeUntilSubscriber(subscriber, this.notifier); + }; + return TakeUntilOperator; +})(); +var TakeUntilSubscriber = (function (_super) { + __extends(TakeUntilSubscriber, _super); + function TakeUntilSubscriber(destination, notifier) { + _super.call(this, destination); + this.notifier = notifier; + this.notificationSubscriber = null; + this.notificationSubscriber = new TakeUntilInnerSubscriber(destination); + this.add(notifier.subscribe(this.notificationSubscriber)); + } + TakeUntilSubscriber.prototype._complete = function () { + this.destination.complete(); + this.notificationSubscriber.unsubscribe(); + }; + return TakeUntilSubscriber; +})(Subscriber_1.Subscriber); +var TakeUntilInnerSubscriber = (function (_super) { + __extends(TakeUntilInnerSubscriber, _super); + function TakeUntilInnerSubscriber(destination) { + _super.call(this, null); + this.destination = destination; + } + TakeUntilInnerSubscriber.prototype._next = function (unused) { + this.destination.complete(); + }; + TakeUntilInnerSubscriber.prototype._error = function (err) { + this.destination.error(err); + }; + TakeUntilInnerSubscriber.prototype._complete = function () { + noop_1.noop(); + }; + return TakeUntilInnerSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/noop":236}],193:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function takeWhile(predicate) { + return this.lift(new TakeWhileOperator(predicate)); +} +exports.takeWhile = takeWhile; +var TakeWhileOperator = (function () { + function TakeWhileOperator(predicate) { + this.predicate = predicate; + } + TakeWhileOperator.prototype.call = function (subscriber) { + return new TakeWhileSubscriber(subscriber, this.predicate); + }; + return TakeWhileOperator; +})(); +var TakeWhileSubscriber = (function (_super) { + __extends(TakeWhileSubscriber, _super); + function TakeWhileSubscriber(destination, predicate) { + _super.call(this, destination); + this.predicate = predicate; + this.index = 0; + } + TakeWhileSubscriber.prototype._next = function (value) { + var destination = this.destination; + var result = tryCatch_1.tryCatch(this.predicate)(value, this.index++); + if (result == errorObject_1.errorObject) { + destination.error(result.e); + } + else if (Boolean(result)) { + destination.next(value); + } + else { + destination.complete(); + } + }; + return TakeWhileSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../util/errorObject":230,"../util/tryCatch":241}],194:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var fromPromise_1 = require('../observable/fromPromise'); +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var isPromise_1 = require('../util/isPromise'); +var errorObject_1 = require('../util/errorObject'); +function throttle(durationSelector) { + return this.lift(new ThrottleOperator(durationSelector)); +} +exports.throttle = throttle; +var ThrottleOperator = (function () { + function ThrottleOperator(durationSelector) { + this.durationSelector = durationSelector; + } + ThrottleOperator.prototype.call = function (subscriber) { + return new ThrottleSubscriber(subscriber, this.durationSelector); + }; + return ThrottleOperator; +})(); +var ThrottleSubscriber = (function (_super) { + __extends(ThrottleSubscriber, _super); + function ThrottleSubscriber(destination, durationSelector) { + _super.call(this, destination); + this.durationSelector = durationSelector; + } + ThrottleSubscriber.prototype._next = function (value) { + if (!this.throttled) { + var destination = this.destination; + var duration = tryCatch_1.tryCatch(this.durationSelector)(value); + if (duration === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + return; + } + if (isPromise_1.isPromise(duration)) { + duration = fromPromise_1.PromiseObservable.create(duration); + } + this.add(this.throttled = duration._subscribe(new ThrottleDurationSelectorSubscriber(this))); + destination.next(value); + } + }; + ThrottleSubscriber.prototype._error = function (err) { + this.clearThrottle(); + _super.prototype._error.call(this, err); + }; + ThrottleSubscriber.prototype._complete = function () { + this.clearThrottle(); + _super.prototype._complete.call(this); + }; + ThrottleSubscriber.prototype.clearThrottle = function () { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + this.throttled = null; + } + }; + return ThrottleSubscriber; +})(Subscriber_1.Subscriber); +var ThrottleDurationSelectorSubscriber = (function (_super) { + __extends(ThrottleDurationSelectorSubscriber, _super); + function ThrottleDurationSelectorSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + ThrottleDurationSelectorSubscriber.prototype._next = function (unused) { + this.parent.clearThrottle(); + }; + ThrottleDurationSelectorSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + ThrottleDurationSelectorSubscriber.prototype._complete = function () { + this.parent.clearThrottle(); + }; + return ThrottleDurationSelectorSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../observable/fromPromise":115,"../util/errorObject":230,"../util/isPromise":234,"../util/tryCatch":241}],195:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var asap_1 = require('../scheduler/asap'); +function throttleTime(delay, scheduler) { + if (scheduler === void 0) { scheduler = asap_1.asap; } + return this.lift(new ThrottleTimeOperator(delay, scheduler)); +} +exports.throttleTime = throttleTime; +var ThrottleTimeOperator = (function () { + function ThrottleTimeOperator(delay, scheduler) { + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleTimeOperator.prototype.call = function (subscriber) { + return new ThrottleTimeSubscriber(subscriber, this.delay, this.scheduler); + }; + return ThrottleTimeOperator; +})(); +var ThrottleTimeSubscriber = (function (_super) { + __extends(ThrottleTimeSubscriber, _super); + function ThrottleTimeSubscriber(destination, delay, scheduler) { + _super.call(this, destination); + this.delay = delay; + this.scheduler = scheduler; + } + ThrottleTimeSubscriber.prototype._next = function (value) { + if (!this.throttled) { + this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.delay, { subscriber: this })); + this.destination.next(value); + } + }; + ThrottleTimeSubscriber.prototype.clearThrottle = function () { + var throttled = this.throttled; + if (throttled) { + throttled.unsubscribe(); + this.remove(throttled); + this.throttled = null; + } + }; + return ThrottleTimeSubscriber; +})(Subscriber_1.Subscriber); +function dispatchNext(_a) { + var subscriber = _a.subscriber; + subscriber.clearThrottle(); +} + +},{"../Subscriber":7,"../scheduler/asap":215}],196:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var queue_1 = require('../scheduler/queue'); +var isDate_1 = require('../util/isDate'); +function timeout(due, errorToSend, scheduler) { + if (errorToSend === void 0) { errorToSend = null; } + if (scheduler === void 0) { scheduler = queue_1.queue; } + var absoluteTimeout = isDate_1.isDate(due); + var waitFor = absoluteTimeout ? (+due - scheduler.now()) : due; + return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler)); +} +exports.timeout = timeout; +var TimeoutOperator = (function () { + function TimeoutOperator(waitFor, absoluteTimeout, errorToSend, scheduler) { + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.errorToSend = errorToSend; + this.scheduler = scheduler; + } + TimeoutOperator.prototype.call = function (subscriber) { + return new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.errorToSend, this.scheduler); + }; + return TimeoutOperator; +})(); +var TimeoutSubscriber = (function (_super) { + __extends(TimeoutSubscriber, _super); + function TimeoutSubscriber(destination, absoluteTimeout, waitFor, errorToSend, scheduler) { + _super.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(); + } + Object.defineProperty(TimeoutSubscriber.prototype, "previousIndex", { + get: function () { + return this._previousIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TimeoutSubscriber.prototype, "hasCompleted", { + get: function () { + return this._hasCompleted; + }, + enumerable: true, + configurable: true + }); + TimeoutSubscriber.dispatchTimeout = function (state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.notifyTimeout(); + } + }; + TimeoutSubscriber.prototype.scheduleTimeout = function () { + var currentIndex = this.index; + this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { subscriber: this, index: currentIndex }); + this.index++; + this._previousIndex = currentIndex; + }; + TimeoutSubscriber.prototype._next = function (value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutSubscriber.prototype._error = function (err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype._complete = function () { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutSubscriber.prototype.notifyTimeout = function () { + this.error(this.errorToSend || new Error('timeout')); + }; + return TimeoutSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7,"../scheduler/queue":216,"../util/isDate":232}],197:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var queue_1 = require('../scheduler/queue'); +var isDate_1 = require('../util/isDate'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +function timeoutWith(due, withObservable, scheduler) { + if (scheduler === void 0) { scheduler = queue_1.queue; } + var absoluteTimeout = isDate_1.isDate(due); + var waitFor = absoluteTimeout ? (+due - scheduler.now()) : due; + return this.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); +} +exports.timeoutWith = timeoutWith; +var TimeoutWithOperator = (function () { + function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { + this.waitFor = waitFor; + this.absoluteTimeout = absoluteTimeout; + this.withObservable = withObservable; + this.scheduler = scheduler; + } + TimeoutWithOperator.prototype.call = function (subscriber) { + return new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler); + }; + return TimeoutWithOperator; +})(); +var TimeoutWithSubscriber = (function (_super) { + __extends(TimeoutWithSubscriber, _super); + function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { + _super.call(this, null); + this.destination = destination; + this.absoluteTimeout = absoluteTimeout; + this.waitFor = waitFor; + this.withObservable = withObservable; + this.scheduler = scheduler; + this.timeoutSubscription = undefined; + this.index = 0; + this._previousIndex = 0; + this._hasCompleted = false; + destination.add(this); + this.scheduleTimeout(); + } + Object.defineProperty(TimeoutWithSubscriber.prototype, "previousIndex", { + get: function () { + return this._previousIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TimeoutWithSubscriber.prototype, "hasCompleted", { + get: function () { + return this._hasCompleted; + }, + enumerable: true, + configurable: true + }); + TimeoutWithSubscriber.dispatchTimeout = function (state) { + var source = state.subscriber; + var currentIndex = state.index; + if (!source.hasCompleted && source.previousIndex === currentIndex) { + source.handleTimeout(); + } + }; + TimeoutWithSubscriber.prototype.scheduleTimeout = function () { + 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 (value) { + this.destination.next(value); + if (!this.absoluteTimeout) { + this.scheduleTimeout(); + } + }; + TimeoutWithSubscriber.prototype._error = function (err) { + this.destination.error(err); + this._hasCompleted = true; + }; + TimeoutWithSubscriber.prototype._complete = function () { + this.destination.complete(); + this._hasCompleted = true; + }; + TimeoutWithSubscriber.prototype.handleTimeout = function () { + if (!this.isUnsubscribed) { + var withObservable = this.withObservable; + this.unsubscribe(); + this.destination.add(this.timeoutSubscription = subscribeToResult_1.subscribeToResult(this, withObservable)); + } + }; + return TimeoutWithSubscriber; +})(OuterSubscriber_1.OuterSubscriber); + +},{"../OuterSubscriber":4,"../scheduler/queue":216,"../util/isDate":232,"../util/subscribeToResult":239}],198:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +function toArray() { + return this.lift(new ToArrayOperator()); +} +exports.toArray = toArray; +var ToArrayOperator = (function () { + function ToArrayOperator() { + } + ToArrayOperator.prototype.call = function (subscriber) { + return new ToArraySubscriber(subscriber); + }; + return ToArrayOperator; +})(); +var ToArraySubscriber = (function (_super) { + __extends(ToArraySubscriber, _super); + function ToArraySubscriber(destination) { + _super.call(this, destination); + this.array = []; + } + ToArraySubscriber.prototype._next = function (x) { + this.array.push(x); + }; + ToArraySubscriber.prototype._complete = function () { + this.destination.next(this.array); + this.destination.complete(); + }; + return ToArraySubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subscriber":7}],199:[function(require,module,exports){ +var root_1 = require('../util/root'); +function toPromise(PromiseCtor) { + var _this = this; + if (!PromiseCtor) { + if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) { + PromiseCtor = root_1.root.Rx.config.Promise; + } + else if (root_1.root.Promise) { + PromiseCtor = root_1.root.Promise; + } + } + if (!PromiseCtor) { + throw new Error('no Promise impl found'); + } + return new PromiseCtor(function (resolve, reject) { + var value; + _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); + }); +} +exports.toPromise = toPromise; + +},{"../util/root":238}],200:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subject_1 = require('../Subject'); +function window(closingNotifier) { + return this.lift(new WindowOperator(closingNotifier)); +} +exports.window = window; +var WindowOperator = (function () { + function WindowOperator(closingNotifier) { + this.closingNotifier = closingNotifier; + } + WindowOperator.prototype.call = function (subscriber) { + return new WindowSubscriber(subscriber, this.closingNotifier); + }; + return WindowOperator; +})(); +var WindowSubscriber = (function (_super) { + __extends(WindowSubscriber, _super); + function WindowSubscriber(destination, closingNotifier) { + _super.call(this, destination); + this.destination = destination; + this.closingNotifier = closingNotifier; + this.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.openWindow(); + } + WindowSubscriber.prototype._next = function (value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function (err) { + this.window.error(err); + this.destination.error(err); + }; + WindowSubscriber.prototype._complete = function () { + this.window.complete(); + this.destination.complete(); + }; + WindowSubscriber.prototype.openWindow = function () { + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + var destination = this.destination; + var newWindow = this.window = new Subject_1.Subject(); + destination.add(newWindow); + destination.next(newWindow); + }; + return WindowSubscriber; +})(Subscriber_1.Subscriber); +var WindowClosingNotifierSubscriber = (function (_super) { + __extends(WindowClosingNotifierSubscriber, _super); + function WindowClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function () { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function (err) { + this.parent._error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function () { + this.parent._complete(); + }; + return WindowClosingNotifierSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subject":6,"../Subscriber":7}],201:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subject_1 = require('../Subject'); +function windowCount(windowSize, startWindowEvery) { + if (startWindowEvery === void 0) { startWindowEvery = 0; } + return this.lift(new WindowCountOperator(windowSize, startWindowEvery)); +} +exports.windowCount = windowCount; +var WindowCountOperator = (function () { + function WindowCountOperator(windowSize, startWindowEvery) { + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + } + WindowCountOperator.prototype.call = function (subscriber) { + return new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery); + }; + return WindowCountOperator; +})(); +var WindowCountSubscriber = (function (_super) { + __extends(WindowCountSubscriber, _super); + function WindowCountSubscriber(destination, windowSize, startWindowEvery) { + _super.call(this, destination); + this.destination = destination; + this.windowSize = windowSize; + this.startWindowEvery = startWindowEvery; + this.windows = [new Subject_1.Subject()]; + this.count = 0; + var firstWindow = this.windows[0]; + destination.add(firstWindow); + destination.next(firstWindow); + } + WindowCountSubscriber.prototype._next = function (value) { + var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize; + var destination = this.destination; + 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_1 = new Subject_1.Subject(); + windows.push(window_1); + destination.add(window_1); + destination.next(window_1); + } + }; + WindowCountSubscriber.prototype._error = function (err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowCountSubscriber.prototype._complete = function () { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + return WindowCountSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subject":6,"../Subscriber":7}],202:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subject_1 = require('../Subject'); +var asap_1 = require('../scheduler/asap'); +function windowTime(windowTimeSpan, windowCreationInterval, scheduler) { + if (windowCreationInterval === void 0) { windowCreationInterval = null; } + if (scheduler === void 0) { scheduler = asap_1.asap; } + return this.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler)); +} +exports.windowTime = windowTime; +var WindowTimeOperator = (function () { + function WindowTimeOperator(windowTimeSpan, windowCreationInterval, scheduler) { + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + } + WindowTimeOperator.prototype.call = function (subscriber) { + return new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.scheduler); + }; + return WindowTimeOperator; +})(); +var WindowTimeSubscriber = (function (_super) { + __extends(WindowTimeSubscriber, _super); + function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, scheduler) { + _super.call(this, destination); + this.destination = destination; + this.windowTimeSpan = windowTimeSpan; + this.windowCreationInterval = windowCreationInterval; + this.scheduler = scheduler; + this.windows = []; + if (windowCreationInterval !== null && windowCreationInterval >= 0) { + var window_1 = this.openWindow(); + var closeState = { subscriber: this, window: window_1, 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 window_2 = this.openWindow(); + var timeSpanOnlyState = { subscriber: this, window: window_2, windowTimeSpan: windowTimeSpan }; + this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); + } + } + WindowTimeSubscriber.prototype._next = function (value) { + var windows = this.windows; + var len = windows.length; + for (var i = 0; i < len; i++) { + windows[i].next(value); + } + }; + WindowTimeSubscriber.prototype._error = function (err) { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().error(err); + } + this.destination.error(err); + }; + WindowTimeSubscriber.prototype._complete = function () { + var windows = this.windows; + while (windows.length > 0) { + windows.shift().complete(); + } + this.destination.complete(); + }; + WindowTimeSubscriber.prototype.openWindow = function () { + var window = new Subject_1.Subject(); + this.windows.push(window); + var destination = this.destination; + destination.add(window); + destination.next(window); + return window; + }; + WindowTimeSubscriber.prototype.closeWindow = function (window) { + window.complete(); + var windows = this.windows; + windows.splice(windows.indexOf(window), 1); + }; + return WindowTimeSubscriber; +})(Subscriber_1.Subscriber); +function dispatchWindowTimeSpanOnly(state) { + var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window; + if (window) { + window.complete(); + } + state.window = subscriber.openWindow(); + this.schedule(state, windowTimeSpan); +} +function dispatchWindowCreation(state) { + var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, 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(_a) { + var subscriber = _a.subscriber, window = _a.window, context = _a.context; + if (context && context.action && context.subscription) { + context.action.remove(context.subscription); + } + subscriber.closeWindow(window); +} + +},{"../Subject":6,"../Subscriber":7,"../scheduler/asap":215}],203:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subject_1 = require('../Subject'); +var Subscription_1 = require('../Subscription'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function windowToggle(openings, closingSelector) { + return this.lift(new WindowToggleOperator(openings, closingSelector)); +} +exports.windowToggle = windowToggle; +var WindowToggleOperator = (function () { + function WindowToggleOperator(openings, closingSelector) { + this.openings = openings; + this.closingSelector = closingSelector; + } + WindowToggleOperator.prototype.call = function (subscriber) { + return new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector); + }; + return WindowToggleOperator; +})(); +var WindowToggleSubscriber = (function (_super) { + __extends(WindowToggleSubscriber, _super); + function WindowToggleSubscriber(destination, openings, closingSelector) { + _super.call(this, destination); + this.destination = destination; + this.openings = openings; + this.closingSelector = closingSelector; + this.contexts = []; + this.add(this.openings._subscribe(new WindowToggleOpeningsSubscriber(this))); + } + WindowToggleSubscriber.prototype._next = function (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 (err) { + var contexts = this.contexts; + while (contexts.length > 0) { + contexts.shift().window.error(err); + } + this.destination.error(err); + }; + WindowToggleSubscriber.prototype._complete = function () { + 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 (value) { + var closingSelector = this.closingSelector; + var closingNotifier = tryCatch_1.tryCatch(closingSelector)(value); + if (closingNotifier === errorObject_1.errorObject) { + this.error(closingNotifier.e); + } + else { + var destination = this.destination; + var window_1 = new Subject_1.Subject(); + var subscription = new Subscription_1.Subscription(); + var context = { window: window_1, subscription: subscription }; + this.contexts.push(context); + var subscriber = new WindowClosingNotifierSubscriber(this, context); + var closingSubscription = closingNotifier._subscribe(subscriber); + subscription.add(closingSubscription); + destination.add(subscription); + destination.add(window_1); + destination.next(window_1); + } + }; + WindowToggleSubscriber.prototype.closeWindow = function (context) { + var window = context.window, subscription = context.subscription; + var contexts = this.contexts; + var destination = this.destination; + contexts.splice(contexts.indexOf(context), 1); + window.complete(); + destination.remove(subscription); + destination.remove(window); + subscription.unsubscribe(); + }; + return WindowToggleSubscriber; +})(Subscriber_1.Subscriber); +var WindowClosingNotifierSubscriber = (function (_super) { + __extends(WindowClosingNotifierSubscriber, _super); + function WindowClosingNotifierSubscriber(parent, windowContext) { + _super.call(this, null); + this.parent = parent; + this.windowContext = windowContext; + } + WindowClosingNotifierSubscriber.prototype._next = function () { + this.parent.closeWindow(this.windowContext); + }; + WindowClosingNotifierSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function () { + this.parent.closeWindow(this.windowContext); + }; + return WindowClosingNotifierSubscriber; +})(Subscriber_1.Subscriber); +var WindowToggleOpeningsSubscriber = (function (_super) { + __extends(WindowToggleOpeningsSubscriber, _super); + function WindowToggleOpeningsSubscriber(parent) { + _super.call(this); + this.parent = parent; + } + WindowToggleOpeningsSubscriber.prototype._next = function (value) { + this.parent.openWindow(value); + }; + WindowToggleOpeningsSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + WindowToggleOpeningsSubscriber.prototype._complete = function () { + // noop + }; + return WindowToggleOpeningsSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subject":6,"../Subscriber":7,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],204:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var Subject_1 = require('../Subject'); +var Subscription_1 = require('../Subscription'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +function windowWhen(closingSelector) { + return this.lift(new WindowOperator(closingSelector)); +} +exports.windowWhen = windowWhen; +var WindowOperator = (function () { + function WindowOperator(closingSelector) { + this.closingSelector = closingSelector; + } + WindowOperator.prototype.call = function (subscriber) { + return new WindowSubscriber(subscriber, this.closingSelector); + }; + return WindowOperator; +})(); +var WindowSubscriber = (function (_super) { + __extends(WindowSubscriber, _super); + function WindowSubscriber(destination, closingSelector) { + _super.call(this, destination); + this.destination = destination; + this.closingSelector = closingSelector; + this.openWindow(); + } + WindowSubscriber.prototype._next = function (value) { + this.window.next(value); + }; + WindowSubscriber.prototype._error = function (err) { + this.window.error(err); + this.destination.error(err); + this._unsubscribeClosingNotification(); + }; + WindowSubscriber.prototype._complete = function () { + this.window.complete(); + this.destination.complete(); + this._unsubscribeClosingNotification(); + }; + WindowSubscriber.prototype.unsubscribe = function () { + _super.prototype.unsubscribe.call(this); + this._unsubscribeClosingNotification(); + }; + WindowSubscriber.prototype._unsubscribeClosingNotification = function () { + var closingNotification = this.closingNotification; + if (closingNotification) { + closingNotification.unsubscribe(); + } + }; + WindowSubscriber.prototype.openWindow = function () { + var prevClosingNotification = this.closingNotification; + if (prevClosingNotification) { + this.remove(prevClosingNotification); + prevClosingNotification.unsubscribe(); + } + var prevWindow = this.window; + if (prevWindow) { + prevWindow.complete(); + } + var window = this.window = new Subject_1.Subject(); + this.destination.next(window); + var closingNotifier = tryCatch_1.tryCatch(this.closingSelector)(); + if (closingNotifier === errorObject_1.errorObject) { + var err = closingNotifier.e; + this.destination.error(err); + this.window.error(err); + } + else { + var closingNotification = this.closingNotification = new Subscription_1.Subscription(); + closingNotification.add(closingNotifier._subscribe(new WindowClosingNotifierSubscriber(this))); + this.add(closingNotification); + this.add(window); + } + }; + return WindowSubscriber; +})(Subscriber_1.Subscriber); +var WindowClosingNotifierSubscriber = (function (_super) { + __extends(WindowClosingNotifierSubscriber, _super); + function WindowClosingNotifierSubscriber(parent) { + _super.call(this, null); + this.parent = parent; + } + WindowClosingNotifierSubscriber.prototype._next = function () { + this.parent.openWindow(); + }; + WindowClosingNotifierSubscriber.prototype._error = function (err) { + this.parent.error(err); + }; + WindowClosingNotifierSubscriber.prototype._complete = function () { + this.parent.openWindow(); + }; + return WindowClosingNotifierSubscriber; +})(Subscriber_1.Subscriber); + +},{"../Subject":6,"../Subscriber":7,"../Subscription":8,"../util/errorObject":230,"../util/tryCatch":241}],205:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +/** + * @param {Observable} observables the observables to get the latest values from. + * @param {Function} [project] optional projection function for merging values together. Receives all values in order + * of observables passed. (e.g. `a.withLatestFrom(b, c, (a1, b1, c1) => a1 + b1 + c1)`). If this is not passed, arrays + * will be returned. + * @description merges each value from an observable with the latest values from the other passed observables. + * All observables must emit at least one value before the resulting observable will emit + * + * #### example + * ``` + * A.withLatestFrom(B, C) + * + * A: ----a-----------------b---------------c-----------| + * B: ---d----------------e--------------f---------| + * C: --x----------------y-------------z-------------| + * result: ---([a,d,x])---------([b,e,y])--------([c,f,z])---| + * ``` + */ +function withLatestFrom() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + var project; + if (typeof args[args.length - 1] === 'function') { + project = args.pop(); + } + var observables = args; + return this.lift(new WithLatestFromOperator(observables, project)); +} +exports.withLatestFrom = withLatestFrom; +var WithLatestFromOperator = (function () { + function WithLatestFromOperator(observables, project) { + this.observables = observables; + this.project = project; + } + WithLatestFromOperator.prototype.call = function (subscriber) { + return new WithLatestFromSubscriber(subscriber, this.observables, this.project); + }; + return WithLatestFromOperator; +})(); +var WithLatestFromSubscriber = (function (_super) { + __extends(WithLatestFromSubscriber, _super); + function WithLatestFromSubscriber(destination, observables, project) { + _super.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(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); + } + } + WithLatestFromSubscriber.prototype.notifyNext = function (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 () { + // noop + }; + WithLatestFromSubscriber.prototype._next = function (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 = tryCatch_1.tryCatch(this.project).apply(this, args); + if (result === errorObject_1.errorObject) { + destination.error(result.e); + } + else { + destination.next(result); + } + } + else { + destination.next(args); + } + } + }; + return WithLatestFromSubscriber; +})(OuterSubscriber_1.OuterSubscriber); + +},{"../OuterSubscriber":4,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],206:[function(require,module,exports){ +var fromArray_1 = require('../observable/fromArray'); +var zip_support_1 = require('./zip-support'); +function zip() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new fromArray_1.ArrayObservable(observables).lift(new zip_support_1.ZipOperator(project)); +} +exports.zip = zip; + +},{"../observable/fromArray":112,"./zip-support":207}],207:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscriber_1 = require('../Subscriber'); +var tryCatch_1 = require('../util/tryCatch'); +var errorObject_1 = require('../util/errorObject'); +var OuterSubscriber_1 = require('../OuterSubscriber'); +var subscribeToResult_1 = require('../util/subscribeToResult'); +var SymbolShim_1 = require('../util/SymbolShim'); +var isArray = Array.isArray; +var ZipOperator = (function () { + function ZipOperator(project) { + this.project = project; + } + ZipOperator.prototype.call = function (subscriber) { + return new ZipSubscriber(subscriber, this.project); + }; + return ZipOperator; +})(); +exports.ZipOperator = ZipOperator; +var ZipSubscriber = (function (_super) { + __extends(ZipSubscriber, _super); + function ZipSubscriber(destination, project, values) { + if (values === void 0) { values = Object.create(null); } + _super.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 (value) { + var iterators = this.iterators; + var index = this.index++; + if (isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } + else if (typeof value[SymbolShim_1.SymbolShim.iterator] === 'function') { + iterators.push(new StaticIterator(value[SymbolShim_1.SymbolShim.iterator]())); + } + else { + iterators.push(new ZipBufferIterator(this.destination, this, value, index)); + } + }; + ZipSubscriber.prototype._complete = function () { + 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--; // not an observable + } + } + }; + ZipSubscriber.prototype.notifyInactive = function () { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function () { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + // abort if not all of them have values + 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(); + // check to see if it's completed now that you've gotten + // the next value. + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return; + } + args.push(result.value); + } + var project = this.project; + if (project) { + var result = tryCatch_1.tryCatch(project).apply(this, args); + if (result === errorObject_1.errorObject) { + destination.error(errorObject_1.errorObject.e); + } + else { + destination.next(result); + } + } + else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + return ZipSubscriber; +})(Subscriber_1.Subscriber); +exports.ZipSubscriber = ZipSubscriber; +var StaticIterator = (function () { + function StaticIterator(iterator) { + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function () { + return true; + }; + StaticIterator.prototype.next = function () { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function () { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; +})(); +var StaticArrayIterator = (function () { + function StaticArrayIterator(array) { + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function () { + return this; + }; + StaticArrayIterator.prototype.next = function (value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { value: array[i], done: false } : { done: true }; + }; + StaticArrayIterator.prototype.hasValue = function () { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function () { + return this.array.length === this.index; + }; + return StaticArrayIterator; +})(); +var ZipBufferIterator = (function (_super) { + __extends(ZipBufferIterator, _super); + function ZipBufferIterator(destination, parent, observable, index) { + _super.call(this, destination); + this.parent = parent; + this.observable = observable; + this.index = index; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[SymbolShim_1.SymbolShim.iterator] = function () { + return this; + }; + // NOTE: there is actually a name collision here with Subscriber.next and Iterator.next + // this is legit because `next()` will never be called by a subscription in this case. + ZipBufferIterator.prototype.next = function () { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return { done: true }; + } + else { + return { value: buffer.shift(), done: false }; + } + }; + ZipBufferIterator.prototype.hasValue = function () { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function () { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function () { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } + else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function (value, index) { + this.add(subscribeToResult_1.subscribeToResult(this, this.observable, this, index)); + }; + return ZipBufferIterator; +})(OuterSubscriber_1.OuterSubscriber); + +},{"../OuterSubscriber":4,"../Subscriber":7,"../util/SymbolShim":229,"../util/errorObject":230,"../util/subscribeToResult":239,"../util/tryCatch":241}],208:[function(require,module,exports){ +var zip_static_1 = require('./zip-static'); +function zipProto() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + observables.unshift(this); + return zip_static_1.zip.apply(this, observables); +} +exports.zipProto = zipProto; + +},{"./zip-static":206}],209:[function(require,module,exports){ +var zip_support_1 = require('./zip-support'); +function zipAll(project) { + return this.lift(new zip_support_1.ZipOperator(project)); +} +exports.zipAll = zipAll; + +},{"./zip-support":207}],210:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Immediate_1 = require('../util/Immediate'); +var QueueAction_1 = require('./QueueAction'); +var AsapAction = (function (_super) { + __extends(AsapAction, _super); + function AsapAction() { + _super.apply(this, arguments); + } + AsapAction.prototype.schedule = function (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 = Immediate_1.Immediate.setImmediate(function () { + _this.id = null; + _this.scheduler.scheduled = false; + _this.scheduler.flush(); + }); + } + return this; + }; + AsapAction.prototype.unsubscribe = function () { + var id = this.id; + var scheduler = this.scheduler; + _super.prototype.unsubscribe.call(this); + if (scheduler.actions.length === 0) { + scheduler.active = false; + scheduler.scheduled = false; + } + if (id) { + this.id = null; + Immediate_1.Immediate.clearImmediate(id); + } + }; + return AsapAction; +})(QueueAction_1.QueueAction); +exports.AsapAction = AsapAction; + +},{"../util/Immediate":225,"./QueueAction":213}],211:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var QueueScheduler_1 = require('./QueueScheduler'); +var AsapAction_1 = require('./AsapAction'); +var QueueAction_1 = require('./QueueAction'); +var AsapScheduler = (function (_super) { + __extends(AsapScheduler, _super); + function AsapScheduler() { + _super.apply(this, arguments); + } + AsapScheduler.prototype.scheduleNow = function (work, state) { + return (this.scheduled ? + new QueueAction_1.QueueAction(this, work) : + new AsapAction_1.AsapAction(this, work)).schedule(state); + }; + return AsapScheduler; +})(QueueScheduler_1.QueueScheduler); +exports.AsapScheduler = AsapScheduler; + +},{"./AsapAction":210,"./QueueAction":213,"./QueueScheduler":214}],212:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var QueueAction_1 = require('./QueueAction'); +var FutureAction = (function (_super) { + __extends(FutureAction, _super); + function FutureAction(scheduler, work) { + _super.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + } + FutureAction.prototype.schedule = function (state, delay) { + var _this = this; + if (delay === void 0) { delay = 0; } + 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 () { + var id = this.id; + if (id != null) { + this.id = void 0; + clearTimeout(id); + } + _super.prototype.unsubscribe.call(this); + }; + return FutureAction; +})(QueueAction_1.QueueAction); +exports.FutureAction = FutureAction; + +},{"./QueueAction":213}],213:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscription_1 = require('../Subscription'); +var QueueAction = (function (_super) { + __extends(QueueAction, _super); + function QueueAction(scheduler, work) { + _super.call(this); + this.scheduler = scheduler; + this.work = work; + } + QueueAction.prototype.schedule = function (state) { + if (this.isUnsubscribed) { + return this; + } + this.state = state; + var scheduler = this.scheduler; + scheduler.actions.push(this); + scheduler.flush(); + return this; + }; + QueueAction.prototype.execute = function () { + if (this.isUnsubscribed) { + throw new Error('How did did we execute a canceled Action?'); + } + this.work(this.state); + }; + QueueAction.prototype.unsubscribe = function () { + 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); + } + _super.prototype.unsubscribe.call(this); + }; + return QueueAction; +})(Subscription_1.Subscription); +exports.QueueAction = QueueAction; + +},{"../Subscription":8}],214:[function(require,module,exports){ +var QueueAction_1 = require('./QueueAction'); +var FutureAction_1 = require('./FutureAction'); +var QueueScheduler = (function () { + function QueueScheduler() { + this.actions = []; + this.active = false; + this.scheduled = false; + } + QueueScheduler.prototype.now = function () { + return Date.now(); + }; + QueueScheduler.prototype.flush = function () { + if (this.active || this.scheduled) { + return; + } + this.active = true; + var actions = this.actions; + for (var action = void 0; action = actions.shift();) { + action.execute(); + } + this.active = false; + }; + QueueScheduler.prototype.schedule = function (work, delay, state) { + if (delay === void 0) { delay = 0; } + return (delay <= 0) ? + this.scheduleNow(work, state) : + this.scheduleLater(work, delay, state); + }; + QueueScheduler.prototype.scheduleNow = function (work, state) { + return new QueueAction_1.QueueAction(this, work).schedule(state); + }; + QueueScheduler.prototype.scheduleLater = function (work, delay, state) { + return new FutureAction_1.FutureAction(this, work).schedule(state, delay); + }; + return QueueScheduler; +})(); +exports.QueueScheduler = QueueScheduler; + +},{"./FutureAction":212,"./QueueAction":213}],215:[function(require,module,exports){ +var AsapScheduler_1 = require('./AsapScheduler'); +exports.asap = new AsapScheduler_1.AsapScheduler(); + +},{"./AsapScheduler":211}],216:[function(require,module,exports){ +var QueueScheduler_1 = require('./QueueScheduler'); +exports.queue = new QueueScheduler_1.QueueScheduler(); + +},{"./QueueScheduler":214}],217:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subject_1 = require('../Subject'); +var AsyncSubject = (function (_super) { + __extends(AsyncSubject, _super); + function AsyncSubject() { + _super.call(this); + this._value = void 0; + this._hasNext = false; + this._isScalar = false; + } + AsyncSubject.prototype._subscribe = function (subscriber) { + if (this.completeSignal && this._hasNext) { + subscriber.next(this._value); + } + return _super.prototype._subscribe.call(this, subscriber); + }; + AsyncSubject.prototype._next = function (value) { + this._value = value; + this._hasNext = true; + }; + AsyncSubject.prototype._complete = function () { + var index = -1; + var observers = this.observers; + var len = observers.length; + // optimization -- block next, complete, and unsubscribe while dispatching + this.observers = void 0; // optimization + this.isUnsubscribed = true; + if (this._hasNext) { + while (++index < len) { + var o = observers[index]; + o.next(this._value); + o.complete(); + } + } + else { + while (++index < len) { + observers[index].complete(); + } + } + this.isUnsubscribed = false; + }; + return AsyncSubject; +})(Subject_1.Subject); +exports.AsyncSubject = AsyncSubject; + +},{"../Subject":6}],218:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subject_1 = require('../Subject'); +var throwError_1 = require('../util/throwError'); +var ObjectUnsubscribedError_1 = require('../util/ObjectUnsubscribedError'); +var BehaviorSubject = (function (_super) { + __extends(BehaviorSubject, _super); + function BehaviorSubject(_value) { + _super.call(this); + this._value = _value; + this._hasError = false; + } + BehaviorSubject.prototype.getValue = function () { + if (this._hasError) { + throwError_1.throwError(this._err); + } + else if (this.isUnsubscribed) { + throwError_1.throwError(new ObjectUnsubscribedError_1.ObjectUnsubscribedError()); + } + else { + return this._value; + } + }; + Object.defineProperty(BehaviorSubject.prototype, "value", { + get: function () { + return this.getValue(); + }, + enumerable: true, + configurable: true + }); + BehaviorSubject.prototype._subscribe = function (subscriber) { + var subscription = _super.prototype._subscribe.call(this, subscriber); + if (!subscription) { + return; + } + else if (!subscription.isUnsubscribed) { + subscriber.next(this._value); + } + return subscription; + }; + BehaviorSubject.prototype._next = function (value) { + _super.prototype._next.call(this, this._value = value); + }; + BehaviorSubject.prototype._error = function (err) { + this._hasError = true; + _super.prototype._error.call(this, this._err = err); + }; + return BehaviorSubject; +})(Subject_1.Subject); +exports.BehaviorSubject = BehaviorSubject; + +},{"../Subject":6,"../util/ObjectUnsubscribedError":228,"../util/throwError":240}],219:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subject_1 = require('../Subject'); +var queue_1 = require('../scheduler/queue'); +var ReplaySubject = (function (_super) { + __extends(ReplaySubject, _super); + function ReplaySubject(bufferSize, windowTime, scheduler) { + if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; } + if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; } + _super.call(this); + this.events = []; + this.bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = windowTime < 1 ? 1 : windowTime; + this.scheduler = scheduler; + } + ReplaySubject.prototype._next = function (value) { + var now = this._getNow(); + this.events.push(new ReplayEvent(now, value)); + this._trimBufferThenGetEvents(now); + _super.prototype._next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function (subscriber) { + var events = this._trimBufferThenGetEvents(this._getNow()); + var index = -1; + var len = events.length; + while (!subscriber.isUnsubscribed && ++index < len) { + subscriber.next(events[index].value); + } + return _super.prototype._subscribe.call(this, subscriber); + }; + ReplaySubject.prototype._getNow = function () { + return (this.scheduler || queue_1.queue).now(); + }; + ReplaySubject.prototype._trimBufferThenGetEvents = function (now) { + var bufferSize = this.bufferSize; + var _windowTime = this._windowTime; + var events = this.events; + var eventsCount = events.length; + var spliceCount = 0; + // Trim events that fall out of the time window. + // Start at the front of the list. Break early once + // we encounter an event that falls within the window. + 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; +})(Subject_1.Subject); +exports.ReplaySubject = ReplaySubject; +var ReplayEvent = (function () { + function ReplayEvent(time, value) { + this.time = time; + this.value = value; + } + return ReplayEvent; +})(); + +},{"../Subject":6,"../scheduler/queue":216}],220:[function(require,module,exports){ +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subscription_1 = require('../Subscription'); +var Subscriber_1 = require('../Subscriber'); +var SubjectSubscription = (function (_super) { + __extends(SubjectSubscription, _super); + function SubjectSubscription(subject, observer) { + _super.call(this); + this.subject = subject; + this.observer = observer; + this.isUnsubscribed = false; + } + SubjectSubscription.prototype.unsubscribe = function () { + 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 Subscriber_1.Subscriber) { + this.observer.unsubscribe(); + } + var subscriberIndex = observers.indexOf(this.observer); + if (subscriberIndex !== -1) { + observers.splice(subscriberIndex, 1); + } + }; + return SubjectSubscription; +})(Subscription_1.Subscription); +exports.SubjectSubscription = SubjectSubscription; + +},{"../Subscriber":7,"../Subscription":8}],221:[function(require,module,exports){ +var SymbolShim_1 = require('../util/SymbolShim'); +/** + * rxSubscriber symbol is a symbol for retreiving an "Rx safe" Observer from an object + * "Rx safety" can be defined as an object that has all of the traits of an Rx Subscriber, + * including the ability to add and remove subscriptions to the subscription chain and + * guarantees involving event triggering (can't "next" after unsubscription, etc). + */ +exports.rxSubscriber = SymbolShim_1.SymbolShim.for('rxSubscriber'); + +},{"../util/SymbolShim":229}],222:[function(require,module,exports){ +var ArgumentOutOfRangeError = (function () { + function ArgumentOutOfRangeError() { + this.name = 'ArgumentOutOfRangeError'; + this.message = 'argument out of range'; + } + return ArgumentOutOfRangeError; +})(); +exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError; + +},{}],223:[function(require,module,exports){ +var EmptyError = (function () { + function EmptyError() { + this.name = 'EmptyError'; + this.message = 'no elements in sequence'; + } + return EmptyError; +})(); +exports.EmptyError = EmptyError; + +},{}],224:[function(require,module,exports){ +var FastMap = (function () { + function FastMap() { + this.values = {}; + } + FastMap.prototype.delete = function (key) { + this.values[key] = null; + return true; + }; + FastMap.prototype.set = function (key, value) { + this.values[key] = value; + return this; + }; + FastMap.prototype.get = function (key) { + return this.values[key]; + }; + FastMap.prototype.forEach = function (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 () { + this.values = {}; + }; + return FastMap; +})(); +exports.FastMap = FastMap; + +},{}],225:[function(require,module,exports){ +/** +Some credit for this helper goes to http://github.com/YuzuJS/setImmediate +*/ +var root_1 = require('./root'); +var ImmediateDefinition = (function () { + function ImmediateDefinition(root) { + this.root = root; + if (root.setImmediate) { + this.setImmediate = root.setImmediate; + this.clearImmediate = root.clearImmediate; + } + else { + this.nextHandle = 1; + this.tasksByHandle = {}; + this.currentlyRunningATask = false; + // Don't get fooled by e.g. browserify environments. + if (this.canUseProcessNextTick()) { + // For Node.js before 0.9 + this.setImmediate = this.createProcessNextTickSetImmediate(); + } + else if (this.canUsePostMessage()) { + // For non-IE10 modern browsers + this.setImmediate = this.createPostMessageSetImmediate(); + } + else if (this.canUseMessageChannel()) { + // For web workers, where supported + this.setImmediate = this.createMessageChannelSetImmediate(); + } + else if (this.canUseReadyStateChange()) { + // For IE 6–8 + this.setImmediate = this.createReadyStateChangeSetImmediate(); + } + else { + // For older browsers + this.setImmediate = this.createSetTimeoutSetImmediate(); + } + var ci = function clearImmediate(handle) { + delete clearImmediate.instance.tasksByHandle[handle]; + }; + ci.instance = this; + this.clearImmediate = ci; + } + } + ImmediateDefinition.prototype.identify = function (o) { + return this.root.Object.prototype.toString.call(o); + }; + ImmediateDefinition.prototype.canUseProcessNextTick = function () { + return this.identify(this.root.process) === '[object process]'; + }; + ImmediateDefinition.prototype.canUseMessageChannel = function () { + return Boolean(this.root.MessageChannel); + }; + ImmediateDefinition.prototype.canUseReadyStateChange = function () { + var document = this.root.document; + return Boolean(document && 'onreadystatechange' in document.createElement('script')); + }; + ImmediateDefinition.prototype.canUsePostMessage = function () { + var root = this.root; + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `root.postMessage` means something completely different and can't be used for this purpose. + if (root.postMessage && !root.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = root.onmessage; + root.onmessage = function () { + postMessageIsAsynchronous = false; + }; + root.postMessage('', '*'); + root.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + return false; + }; + // This function accepts the same arguments as setImmediate, but + // returns a function that requires no arguments. + ImmediateDefinition.prototype.partiallyApplied = function (handler) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + var fn = function result() { + var _a = result, handler = _a.handler, args = _a.args; + if (typeof handler === 'function') { + handler.apply(undefined, args); + } + else { + (new Function('' + handler))(); + } + }; + fn.handler = handler; + fn.args = args; + return fn; + }; + ImmediateDefinition.prototype.addFromSetImmediateArguments = function (args) { + this.tasksByHandle[this.nextHandle] = this.partiallyApplied.apply(undefined, args); + return this.nextHandle++; + }; + ImmediateDefinition.prototype.createProcessNextTickSetImmediate = function () { + var fn = function setImmediate() { + var instance = setImmediate.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + instance.root.process.nextTick(instance.partiallyApplied(instance.runIfPresent, handle)); + return handle; + }; + fn.instance = this; + return fn; + }; + ImmediateDefinition.prototype.createPostMessageSetImmediate = function () { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + var root = this.root; + var messagePrefix = 'setImmediate$' + root.Math.random() + '$'; + var onGlobalMessage = function globalMessageHandler(event) { + var instance = globalMessageHandler.instance; + if (event.source === root && + typeof event.data === 'string' && + event.data.indexOf(messagePrefix) === 0) { + instance.runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + onGlobalMessage.instance = this; + root.addEventListener('message', onGlobalMessage, false); + var fn = function setImmediate() { + var _a = setImmediate, messagePrefix = _a.messagePrefix, instance = _a.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + instance.root.postMessage(messagePrefix + handle, '*'); + return handle; + }; + fn.instance = this; + fn.messagePrefix = messagePrefix; + return fn; + }; + ImmediateDefinition.prototype.runIfPresent = function (handle) { + // From the spec: 'Wait until any invocations of this algorithm started before this one have completed.' + // So if we're currently running a task, we'll need to delay this invocation. + if (this.currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // 'too much recursion' error. + this.root.setTimeout(this.partiallyApplied(this.runIfPresent, handle), 0); + } + else { + var task = this.tasksByHandle[handle]; + if (task) { + this.currentlyRunningATask = true; + try { + task(); + } + finally { + this.clearImmediate(handle); + this.currentlyRunningATask = false; + } + } + } + }; + ImmediateDefinition.prototype.createMessageChannelSetImmediate = function () { + var _this = this; + var channel = new this.root.MessageChannel(); + channel.port1.onmessage = function (event) { + var handle = event.data; + _this.runIfPresent(handle); + }; + var fn = function setImmediate() { + var _a = setImmediate, channel = _a.channel, instance = _a.instance; + var handle = instance.addFromSetImmediateArguments(arguments); + channel.port2.postMessage(handle); + return handle; + }; + fn.channel = channel; + fn.instance = this; + return fn; + }; + ImmediateDefinition.prototype.createReadyStateChangeSetImmediate = function () { + var fn = function setImmediate() { + var instance = setImmediate.instance; + var root = instance.root; + var doc = root.document; + var html = doc.documentElement; + var handle = instance.addFromSetImmediateArguments(arguments); + // Create a