// ==UserScript== // @name remove the jump link in BAIDU (typescript) // @author axetroy // @collaborator axetroy // @description 去除百度搜索跳转链接 // @version 2016.11.10 // @grant GM_xmlhttpRequest // @include *www.baidu.com* // @connect * // @compatible chrome 完美运行 // @compatible firefox 完美运行 // @supportURL http://www.burningall.com // @run-at document-start // @contributionURL troy450409405@gmail.com|alipay.com // @namespace https://greasyfork.org/zh-CN/users/3400-axetroy // @license The MIT License (MIT); http://opensource.org/licenses/MIT // @downloadURL none // ==/UserScript== // Github源码:https://github.com/axetroy/bd-fuck /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.l = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // identity function for calling harmory imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ // define getter function for harmory exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ }; /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 347); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var root_1 = __webpack_require__(7); var toSubscriber_1 = __webpack_require__(344); var observable_1 = __webpack_require__(22); /** * A representation of any set of values over any amount of time. This the most basic building block * of RxJS. * * @class Observable */ 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; } } /** * Creates a new Observable, with this Observable as the source, and the passed * operator defined as the new observable's operator. * @method lift * @param {Operator} operator the operator defining the operation to take on the observable * @return {Observable} a new observable with the Operator applied */ Observable.prototype.lift = function (operator) { var observable = new Observable(); observable.source = this; observable.operator = operator; return observable; }; Observable.prototype.subscribe = function (observerOrNext, error, complete) { var operator = this.operator; var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete); if (operator) { operator.call(sink, this); } else { sink.add(this._subscribe(sink)); } if (sink.syncErrorThrowable) { sink.syncErrorThrowable = false; if (sink.syncErrorThrown) { throw sink.syncErrorValue; } } return sink; }; /** * @method forEach * @param {Function} next a handler for each value emitted by the observable * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise * @return {Promise} a promise that either resolves on observable completion or * rejects with the handled error */ Observable.prototype.forEach = function (next, 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 subscription = _this.subscribe(function (value) { if (subscription) { // if there is a subscription, then we can surmise // the next handling is asynchronous. Any errors thrown // need to be rejected explicitly and unsubscribe must be // called manually try { next(value); } catch (err) { reject(err); subscription.unsubscribe(); } } else { // if there is NO subscription, then we're getting a nexted // value synchronously during subscription. We can just call it. // If it errors, Observable's `subscribe` will ensure the // unsubscription logic is called, then synchronously rethrow the error. // After that, Promise will trap the error and send it // down the rejection path. next(value); } }, reject, resolve); }); }; Observable.prototype._subscribe = function (subscriber) { return this.source.subscribe(subscriber); }; /** * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable * @method Symbol.observable * @return {Observable} this instance of the observable */ Observable.prototype[observable_1.$$observable] = function () { return this; }; // HACK: Since TypeScript inherits static properties too, we have to // fight against TypeScript here so Subject can have a different static create signature /** * Creates a new cold Observable by calling the Observable constructor * @static true * @owner Observable * @method create * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor * @return {Observable} a new cold observable */ Observable.create = function (subscribe) { return new Observable(subscribe); }; return Observable; }()); exports.Observable = Observable; //# sourceMappingURL=Observable.js.map /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var isFunction_1 = __webpack_require__(36); var Subscription_1 = __webpack_require__(4); var Observer_1 = __webpack_require__(40); var rxSubscriber_1 = __webpack_require__(23); /** * Implements the {@link Observer} interface and extends the * {@link Subscription} class. While the {@link Observer} is the public API for * consuming the values of an {@link Observable}, all Observers get converted to * a Subscriber, in order to provide Subscription-like capabilities such as * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for * implementing operators, but it is rarely used as a public API. * * @class Subscriber */ var Subscriber = (function (_super) { __extends(Subscriber, _super); /** * @param {Observer|function(value: T): void} [destinationOrNext] A partially * defined Observer or a `next` callback function. * @param {function(e: ?any): void} [error] The `error` callback of an * Observer. * @param {function(): void} [complete] The `complete` callback of an * Observer. */ function Subscriber(destinationOrNext, error, complete) { _super.call(this); this.syncErrorValue = null; this.syncErrorThrown = false; this.syncErrorThrowable = false; this.isStopped = false; switch (arguments.length) { case 0: this.destination = Observer_1.empty; break; case 1: if (!destinationOrNext) { this.destination = Observer_1.empty; break; } if (typeof destinationOrNext === 'object') { if (destinationOrNext instanceof Subscriber) { this.destination = destinationOrNext; this.destination.add(this); } else { this.syncErrorThrowable = true; this.destination = new SafeSubscriber(this, destinationOrNext); } break; } default: this.syncErrorThrowable = true; this.destination = new SafeSubscriber(this, destinationOrNext, error, complete); break; } } Subscriber.prototype[rxSubscriber_1.$$rxSubscriber] = function () { return this; }; /** * A static factory for a Subscriber, given a (potentially partial) definition * of an Observer. * @param {function(x: ?T): void} [next] The `next` callback of an Observer. * @param {function(e: ?any): void} [error] The `error` callback of an * Observer. * @param {function(): void} [complete] The `complete` callback of an * Observer. * @return {Subscriber} A Subscriber wrapping the (partially defined) * Observer represented by the given arguments. */ Subscriber.create = function (next, error, complete) { var subscriber = new Subscriber(next, error, complete); subscriber.syncErrorThrowable = false; return subscriber; }; /** * The {@link Observer} callback to receive notifications of type `next` from * the Observable, with a value. The Observable may call this method 0 or more * times. * @param {T} [value] The `next` value. * @return {void} */ Subscriber.prototype.next = function (value) { if (!this.isStopped) { this._next(value); } }; /** * The {@link Observer} callback to receive notifications of type `error` from * the Observable, with an attached {@link Error}. Notifies the Observer that * the Observable has experienced an error condition. * @param {any} [err] The `error` exception. * @return {void} */ Subscriber.prototype.error = function (err) { if (!this.isStopped) { this.isStopped = true; this._error(err); } }; /** * The {@link Observer} callback to receive a valueless notification of type * `complete` from the Observable. Notifies the Observer that the Observable * has finished sending push-based notifications. * @return {void} */ Subscriber.prototype.complete = function () { if (!this.isStopped) { this.isStopped = true; this._complete(); } }; Subscriber.prototype.unsubscribe = function () { if (this.closed) { return; } this.isStopped = true; _super.prototype.unsubscribe.call(this); }; Subscriber.prototype._next = function (value) { this.destination.next(value); }; Subscriber.prototype._error = function (err) { this.destination.error(err); this.unsubscribe(); }; Subscriber.prototype._complete = function () { this.destination.complete(); this.unsubscribe(); }; return Subscriber; }(Subscription_1.Subscription)); exports.Subscriber = Subscriber; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var SafeSubscriber = (function (_super) { __extends(SafeSubscriber, _super); function SafeSubscriber(_parent, observerOrNext, error, complete) { _super.call(this); this._parent = _parent; var next; var context = this; if (isFunction_1.isFunction(observerOrNext)) { next = observerOrNext; } else if (observerOrNext) { context = observerOrNext; next = observerOrNext.next; error = observerOrNext.error; complete = observerOrNext.complete; if (isFunction_1.isFunction(context.unsubscribe)) { this.add(context.unsubscribe.bind(context)); } context.unsubscribe = this.unsubscribe.bind(this); } this._context = context; this._next = next; this._error = error; this._complete = complete; } SafeSubscriber.prototype.next = function (value) { if (!this.isStopped && this._next) { var _parent = this._parent; if (!_parent.syncErrorThrowable) { this.__tryOrUnsub(this._next, value); } else if (this.__tryOrSetError(_parent, this._next, value)) { this.unsubscribe(); } } }; SafeSubscriber.prototype.error = function (err) { if (!this.isStopped) { var _parent = this._parent; if (this._error) { if (!_parent.syncErrorThrowable) { this.__tryOrUnsub(this._error, err); this.unsubscribe(); } else { this.__tryOrSetError(_parent, this._error, err); this.unsubscribe(); } } else if (!_parent.syncErrorThrowable) { this.unsubscribe(); throw err; } else { _parent.syncErrorValue = err; _parent.syncErrorThrown = true; this.unsubscribe(); } } }; SafeSubscriber.prototype.complete = function () { if (!this.isStopped) { var _parent = this._parent; if (this._complete) { if (!_parent.syncErrorThrowable) { this.__tryOrUnsub(this._complete); this.unsubscribe(); } else { this.__tryOrSetError(_parent, this._complete); this.unsubscribe(); } } else { this.unsubscribe(); } } }; SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { try { fn.call(this._context, value); } catch (err) { this.unsubscribe(); throw err; } }; SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { try { fn.call(this._context, value); } catch (err) { parent.syncErrorValue = err; parent.syncErrorThrown = true; return true; } return false; }; SafeSubscriber.prototype._unsubscribe = function () { var _parent = this._parent; this._context = null; this._parent = null; _parent.unsubscribe(); }; return SafeSubscriber; }(Subscriber)); //# sourceMappingURL=Subscriber.js.map /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var OuterSubscriber = (function (_super) { __extends(OuterSubscriber, _super); function OuterSubscriber() { _super.apply(this, arguments); } OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); }; OuterSubscriber.prototype.notifyError = function (error, innerSub) { this.destination.error(error); }; OuterSubscriber.prototype.notifyComplete = function (innerSub) { this.destination.complete(); }; return OuterSubscriber; }(Subscriber_1.Subscriber)); exports.OuterSubscriber = OuterSubscriber; //# sourceMappingURL=OuterSubscriber.js.map /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var root_1 = __webpack_require__(7); var isArray_1 = __webpack_require__(10); var isPromise_1 = __webpack_require__(64); var Observable_1 = __webpack_require__(0); var iterator_1 = __webpack_require__(18); var InnerSubscriber_1 = __webpack_require__(70); var observable_1 = __webpack_require__(22); function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex); if (destination.closed) { return null; } if (result instanceof Observable_1.Observable) { if (result._isScalar) { destination.next(result.value); destination.complete(); return null; } else { return result.subscribe(destination); } } if (isArray_1.isArray(result)) { for (var i = 0, len = result.length; i < len && !destination.closed; i++) { destination.next(result[i]); } if (!destination.closed) { destination.complete(); } } else if (isPromise_1.isPromise(result)) { result.then(function (value) { if (!destination.closed) { destination.next(value); destination.complete(); } }, function (err) { return destination.error(err); }) .then(null, function (err) { // Escaping the Promise trap: globally throw unhandled errors root_1.root.setTimeout(function () { throw err; }); }); return destination; } else if (typeof result[iterator_1.$$iterator] === 'function') { var iterator = result[iterator_1.$$iterator](); do { var item = iterator.next(); if (item.done) { destination.complete(); break; } destination.next(item.value); if (destination.closed) { break; } } while (true); } else if (typeof result[observable_1.$$observable] === 'function') { var obs = result[observable_1.$$observable](); if (typeof obs.subscribe !== 'function') { destination.error(new Error('invalid observable')); } else { return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex)); } } else { destination.error(new TypeError('unknown type returned')); } return null; } exports.subscribeToResult = subscribeToResult; //# sourceMappingURL=subscribeToResult.js.map /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var isArray_1 = __webpack_require__(10); var isObject_1 = __webpack_require__(342); var isFunction_1 = __webpack_require__(36); var tryCatch_1 = __webpack_require__(8); var errorObject_1 = __webpack_require__(6); var UnsubscriptionError_1 = __webpack_require__(62); /** * Represents a disposable resource, such as the execution of an Observable. A * Subscription has one important method, `unsubscribe`, that takes no argument * and just disposes the resource held by the subscription. * * Additionally, subscriptions may be grouped together through the `add()` * method, which will attach a child Subscription to the current Subscription. * When a Subscription is unsubscribed, all its children (and its grandchildren) * will be unsubscribed as well. * * @class Subscription */ var Subscription = (function () { /** * @param {function(): void} [unsubscribe] A function describing how to * perform the disposal of resources when the `unsubscribe` method is called. */ function Subscription(unsubscribe) { /** * A flag to indicate whether this Subscription has already been unsubscribed. * @type {boolean} */ this.closed = false; if (unsubscribe) { this._unsubscribe = unsubscribe; } } /** * Disposes the resources held by the subscription. May, for instance, cancel * an ongoing Observable execution or cancel any other type of work that * started when the Subscription was created. * @return {void} */ Subscription.prototype.unsubscribe = function () { var hasErrors = false; var errors; if (this.closed) { return; } this.closed = true; var _a = this, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions; this._subscriptions = null; if (isFunction_1.isFunction(_unsubscribe)) { var trial = tryCatch_1.tryCatch(_unsubscribe).call(this); if (trial === errorObject_1.errorObject) { hasErrors = true; (errors = errors || []).push(errorObject_1.errorObject.e); } } if (isArray_1.isArray(_subscriptions)) { var index = -1; var len = _subscriptions.length; while (++index < len) { var sub = _subscriptions[index]; if (isObject_1.isObject(sub)) { var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub); if (trial === errorObject_1.errorObject) { hasErrors = true; errors = errors || []; var err = errorObject_1.errorObject.e; if (err instanceof UnsubscriptionError_1.UnsubscriptionError) { errors = errors.concat(err.errors); } else { errors.push(err); } } } } } if (hasErrors) { throw new UnsubscriptionError_1.UnsubscriptionError(errors); } }; /** * Adds a tear down to be called during the unsubscribe() of this * Subscription. * * If the tear down being added is a subscription that is already * unsubscribed, is the same reference `add` is being called on, or is * `Subscription.EMPTY`, it will not be added. * * If this subscription is already in an `closed` state, the passed * tear down logic will be executed immediately. * * @param {TeardownLogic} teardown The additional logic to execute on * teardown. * @return {Subscription} Returns the Subscription used or created to be * added to the inner subscriptions list. This Subscription can be used with * `remove()` to remove the passed teardown logic from the inner subscriptions * list. */ Subscription.prototype.add = function (teardown) { if (!teardown || (teardown === Subscription.EMPTY)) { return Subscription.EMPTY; } if (teardown === this) { return this; } var sub = teardown; switch (typeof teardown) { case 'function': sub = new Subscription(teardown); case 'object': if (sub.closed || typeof sub.unsubscribe !== 'function') { break; } else if (this.closed) { sub.unsubscribe(); } else { (this._subscriptions || (this._subscriptions = [])).push(sub); } break; default: throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); } return sub; }; /** * Removes a Subscription from the internal list of subscriptions that will * unsubscribe during the unsubscribe process of this Subscription. * @param {Subscription} subscription The subscription to remove. * @return {void} */ Subscription.prototype.remove = function (subscription) { // HACK: This might be redundant because of the logic in `add()` 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.closed = true; return empty; }(new Subscription())); return Subscription; }()); exports.Subscription = Subscription; //# sourceMappingURL=Subscription.js.map /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(0); var Subscriber_1 = __webpack_require__(1); var Subscription_1 = __webpack_require__(4); var ObjectUnsubscribedError_1 = __webpack_require__(26); var SubjectSubscription_1 = __webpack_require__(41); var rxSubscriber_1 = __webpack_require__(23); /** * @class SubjectSubscriber */ var SubjectSubscriber = (function (_super) { __extends(SubjectSubscriber, _super); function SubjectSubscriber(destination) { _super.call(this, destination); this.destination = destination; } return SubjectSubscriber; }(Subscriber_1.Subscriber)); exports.SubjectSubscriber = SubjectSubscriber; /** * @class Subject */ var Subject = (function (_super) { __extends(Subject, _super); function Subject() { _super.call(this); this.observers = []; this.closed = false; this.isStopped = false; this.hasError = false; this.thrownError = null; } Subject.prototype[rxSubscriber_1.$$rxSubscriber] = function () { return new SubjectSubscriber(this); }; Subject.prototype.lift = function (operator) { var subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; }; Subject.prototype.next = function (value) { if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } if (!this.isStopped) { var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].next(value); } } }; Subject.prototype.error = function (err) { if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } this.hasError = true; this.thrownError = err; this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].error(err); } this.observers.length = 0; }; Subject.prototype.complete = function () { if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].complete(); } this.observers.length = 0; }; Subject.prototype.unsubscribe = function () { this.isStopped = true; this.closed = true; this.observers = null; }; Subject.prototype._subscribe = function (subscriber) { if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } else if (this.hasError) { subscriber.error(this.thrownError); return Subscription_1.Subscription.EMPTY; } else if (this.isStopped) { subscriber.complete(); return Subscription_1.Subscription.EMPTY; } else { this.observers.push(subscriber); return new SubjectSubscription_1.SubjectSubscription(this, subscriber); } }; Subject.prototype.asObservable = function () { var observable = new Observable_1.Observable(); observable.source = this; return observable; }; Subject.create = function (destination, source) { return new AnonymousSubject(destination, source); }; return Subject; }(Observable_1.Observable)); exports.Subject = Subject; /** * @class AnonymousSubject */ var AnonymousSubject = (function (_super) { __extends(AnonymousSubject, _super); function AnonymousSubject(destination, source) { _super.call(this); this.destination = destination; this.source = source; } AnonymousSubject.prototype.next = function (value) { var destination = this.destination; if (destination && destination.next) { destination.next(value); } }; AnonymousSubject.prototype.error = function (err) { var destination = this.destination; if (destination && destination.error) { this.destination.error(err); } }; AnonymousSubject.prototype.complete = function () { var destination = this.destination; if (destination && destination.complete) { this.destination.complete(); } }; AnonymousSubject.prototype._subscribe = function (subscriber) { var source = this.source; if (source) { return this.source.subscribe(subscriber); } else { return Subscription_1.Subscription.EMPTY; } }; return AnonymousSubject; }(Subject)); exports.AnonymousSubject = AnonymousSubject; //# sourceMappingURL=Subject.js.map /***/ }, /* 6 */ /***/ function(module, exports) { "use strict"; "use strict"; // typeof any so that it we don't have to cast when comparing a result to the error object exports.errorObject = { e: {} }; //# sourceMappingURL=errorObject.js.map /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {"use strict"; /** * window: browser in DOM main thread * self: browser in WebWorker * global: Node.js/other */ exports.root = (typeof window == 'object' && window.window === window && window || typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global); if (!exports.root) { throw new Error('RxJS could not find any global context (window, self, global)'); } //# sourceMappingURL=root.js.map /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(346))) /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var errorObject_1 = __webpack_require__(6); 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; ; //# sourceMappingURL=tryCatch.js.map /***/ }, /* 9 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var AsyncAction_1 = __webpack_require__(16); var AsyncScheduler_1 = __webpack_require__(17); exports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction); //# sourceMappingURL=async.js.map /***/ }, /* 10 */ /***/ function(module, exports) { "use strict"; "use strict"; exports.isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); //# sourceMappingURL=isArray.js.map /***/ }, /* 11 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(0); var ScalarObservable_1 = __webpack_require__(29); var EmptyObservable_1 = __webpack_require__(12); var isScheduler_1 = __webpack_require__(13); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ 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); }; /** * Creates an Observable that emits some values you specify as arguments, * immediately one after the other, and then emits a complete notification. * * Emits the arguments you provide, then completes. * * * * * This static operator is useful for creating a simple Observable that only * emits the arguments given, and the complete notification thereafter. It can * be used for composing with other Observables, such as with {@link concat}. * By default, it uses a `null` Scheduler, which means the `next` * notifications are sent synchronously, although with a different Scheduler * it is possible to determine when those notifications will be delivered. * * @example Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second. * var numbers = Rx.Observable.of(10, 20, 30); * var letters = Rx.Observable.of('a', 'b', 'c'); * var interval = Rx.Observable.interval(1000); * var result = numbers.concat(letters).concat(interval); * result.subscribe(x => console.log(x)); * * @see {@link create} * @see {@link empty} * @see {@link never} * @see {@link throw} * * @param {...T} values Arguments that represent `next` values to be emitted. * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling * the emissions of the `next` notifications. * @return {Observable} An Observable that emits each given input value. * @static true * @name of * @owner Observable */ 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 = null; } 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 EmptyObservable_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.closed) { 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) { return scheduler.schedule(ArrayObservable.dispatch, 0, { array: array, index: index, count: count, subscriber: subscriber }); } else { for (var i = 0; i < count && !subscriber.closed; i++) { subscriber.next(array[i]); } subscriber.complete(); } }; return ArrayObservable; }(Observable_1.Observable)); exports.ArrayObservable = ArrayObservable; //# sourceMappingURL=ArrayObservable.js.map /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(0); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ var EmptyObservable = (function (_super) { __extends(EmptyObservable, _super); function EmptyObservable(scheduler) { _super.call(this); this.scheduler = scheduler; } /** * Creates an Observable that emits no items to the Observer and immediately * emits a complete notification. * * Just emits 'complete', and nothing else. * * * * * This static operator is useful for creating a simple Observable that only * emits the complete notification. It can be used for composing with other * Observables, such as in a {@link mergeMap}. * * @example Emit the number 7, then complete. * var result = Rx.Observable.empty().startWith(7); * result.subscribe(x => console.log(x)); * * @example Map and flatten only odd numbers to the sequence 'a', 'b', 'c' * var interval = Rx.Observable.interval(1000); * var result = interval.mergeMap(x => * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty() * ); * result.subscribe(x => console.log(x)); * * @see {@link create} * @see {@link never} * @see {@link of} * @see {@link throw} * * @param {Scheduler} [scheduler] A {@link Scheduler} to use for scheduling * the emission of the complete notification. * @return {Observable} An "empty" Observable: emits only the complete * notification. * @static true * @name empty * @owner Observable */ EmptyObservable.create = function (scheduler) { return new EmptyObservable(scheduler); }; EmptyObservable.dispatch = function (arg) { var subscriber = arg.subscriber; subscriber.complete(); }; EmptyObservable.prototype._subscribe = function (subscriber) { var scheduler = this.scheduler; if (scheduler) { return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber }); } else { subscriber.complete(); } }; return EmptyObservable; }(Observable_1.Observable)); exports.EmptyObservable = EmptyObservable; //# sourceMappingURL=EmptyObservable.js.map /***/ }, /* 13 */ /***/ function(module, exports) { "use strict"; "use strict"; function isScheduler(value) { return value && typeof value.schedule === 'function'; } exports.isScheduler = isScheduler; //# sourceMappingURL=isScheduler.js.map /***/ }, /* 14 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var ConnectableObservable_1 = __webpack_require__(42); /* tslint:disable:max-line-length */ function multicast(subjectOrSubjectFactory, selector) { var subjectFactory; if (typeof subjectOrSubjectFactory === 'function') { subjectFactory = subjectOrSubjectFactory; } else { subjectFactory = function subjectFactory() { return subjectOrSubjectFactory; }; } if (typeof selector === 'function') { return this.lift(new MulticastOperator(subjectFactory, selector)); } var connectable = Object.create(this, ConnectableObservable_1.connectableObservableDescriptor); connectable.source = this; connectable.subjectFactory = subjectFactory; return connectable; } exports.multicast = multicast; var MulticastOperator = (function () { function MulticastOperator(subjectFactory, selector) { this.subjectFactory = subjectFactory; this.selector = selector; } MulticastOperator.prototype.call = function (subscriber, source) { var selector = this.selector; var subject = this.subjectFactory(); var subscription = selector(subject).subscribe(subscriber); subscription.add(source._subscribe(subject)); return subscription; }; return MulticastOperator; }()); exports.MulticastOperator = MulticastOperator; //# sourceMappingURL=multicast.js.map /***/ }, /* 15 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var Observable_1 = __webpack_require__(0); /** * Represents a push-based event or value that an {@link Observable} can emit. * This class is particularly useful for operators that manage notifications, * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and * others. Besides wrapping the actual delivered value, it also annotates it * with metadata of, for instance, what type of push message it is (`next`, * `error`, or `complete`). * * @see {@link materialize} * @see {@link dematerialize} * @see {@link observeOn} * * @class Notification */ var Notification = (function () { function Notification(kind, value, error) { this.kind = kind; this.value = value; this.error = error; this.hasValue = kind === 'N'; } /** * Delivers to the given `observer` the value wrapped by this Notification. * @param {Observer} observer * @return */ Notification.prototype.observe = function (observer) { switch (this.kind) { case 'N': return observer.next && observer.next(this.value); case 'E': return observer.error && observer.error(this.error); case 'C': return observer.complete && observer.complete(); } }; /** * Given some {@link Observer} callbacks, deliver the value represented by the * current Notification to the correctly corresponding callback. * @param {function(value: T): void} next An Observer `next` callback. * @param {function(err: any): void} [error] An Observer `error` callback. * @param {function(): void} [complete] An Observer `complete` callback. * @return {any} */ Notification.prototype.do = function (next, error, complete) { var kind = this.kind; switch (kind) { case 'N': return next && next(this.value); case 'E': return error && error(this.error); case 'C': return complete && complete(); } }; /** * Takes an Observer or its individual callback functions, and calls `observe` * or `do` methods accordingly. * @param {Observer|function(value: T): void} nextOrObserver An Observer or * the `next` callback. * @param {function(err: any): void} [error] An Observer `error` callback. * @param {function(): void} [complete] An Observer `complete` callback. * @return {any} */ Notification.prototype.accept = function (nextOrObserver, error, complete) { if (nextOrObserver && typeof nextOrObserver.next === 'function') { return this.observe(nextOrObserver); } else { return this.do(nextOrObserver, error, complete); } }; /** * Returns a simple Observable that just delivers the notification represented * by this Notification instance. * @return {any} */ 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.error); case 'C': return Observable_1.Observable.empty(); } throw new Error('unexpected notification kind value'); }; /** * A shortcut to create a Notification instance of the type `next` from a * given value. * @param {T} value The `next` value. * @return {Notification} The "next" Notification representing the * argument. */ Notification.createNext = function (value) { if (typeof value !== 'undefined') { return new Notification('N', value); } return this.undefinedValueNotification; }; /** * A shortcut to create a Notification instance of the type `error` from a * given error. * @param {any} [err] The `error` error. * @return {Notification} The "error" Notification representing the * argument. */ Notification.createError = function (err) { return new Notification('E', undefined, err); }; /** * A shortcut to create a Notification instance of the type `complete`. * @return {Notification} The valueless "complete" Notification. */ Notification.createComplete = function () { return this.completeNotification; }; Notification.completeNotification = new Notification('C'); Notification.undefinedValueNotification = new Notification('N', undefined); return Notification; }()); exports.Notification = Notification; //# sourceMappingURL=Notification.js.map /***/ }, /* 16 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var root_1 = __webpack_require__(7); var Action_1 = __webpack_require__(324); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var AsyncAction = (function (_super) { __extends(AsyncAction, _super); function AsyncAction(scheduler, work) { _super.call(this, scheduler, work); this.scheduler = scheduler; this.work = work; this.pending = false; } AsyncAction.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } if (this.closed) { return this; } // Always replace the current state with the new state. this.state = state; // Set the pending flag indicating that this action has been scheduled, or // has recursively rescheduled itself. this.pending = true; var id = this.id; var scheduler = this.scheduler; // // Important implementation note: // // Actions only execute once by default, unless rescheduled from within the // scheduled callback. This allows us to implement single and repeat // actions via the same code path, without adding API surface area, as well // as mimic traditional recursion but across asynchronous boundaries. // // However, JS runtimes and timers distinguish between intervals achieved by // serial `setTimeout` calls vs. a single `setInterval` call. An interval of // serial `setTimeout` calls can be individually delayed, which delays // scheduling the next `setTimeout`, and so on. `setInterval` attempts to // guarantee the interval callback will be invoked more precisely to the // interval period, regardless of load. // // Therefore, we use `setInterval` to schedule single and repeat actions. // If the action reschedules itself with the same delay, the interval is not // canceled. If the action doesn't reschedule, or reschedules with a // different delay, the interval will be canceled after scheduled callback // execution. // if (id != null) { this.id = this.recycleAsyncId(scheduler, id, delay); } this.delay = delay; // If this action has already an async Id, don't request a new one. this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); return this; }; AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } return root_1.root.setInterval(scheduler.flush.bind(scheduler, this), delay); }; AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } // If this action is rescheduled with the same delay time, don't clear the interval id. if (delay !== null && this.delay === delay) { return id; } // Otherwise, if the action's delay time is different from the current delay, // clear the interval id return root_1.root.clearInterval(id) && undefined || undefined; }; /** * Immediately executes this action and the `work` it contains. * @return {any} */ AsyncAction.prototype.execute = function (state, delay) { if (this.closed) { return new Error('executing a cancelled action'); } this.pending = false; var error = this._execute(state, delay); if (error) { return error; } else if (this.pending === false && this.id != null) { // Dequeue if the action didn't reschedule itself. Don't call // unsubscribe(), because the action could reschedule later. // For example: // ``` // scheduler.schedule(function doWork(counter) { // /* ... I'm a busy worker bee ... */ // var originalAction = this; // /* wait 100ms before rescheduling the action */ // setTimeout(function () { // originalAction.schedule(counter + 1); // }, 100); // }, 1000); // ``` this.id = this.recycleAsyncId(this.scheduler, this.id, null); } }; AsyncAction.prototype._execute = function (state, delay) { var errored = false; var errorValue = undefined; try { this.work(state); } catch (e) { errored = true; errorValue = !!e && e || new Error(e); } if (errored) { this.unsubscribe(); return errorValue; } }; AsyncAction.prototype._unsubscribe = function () { var id = this.id; var scheduler = this.scheduler; var actions = scheduler.actions; var index = actions.indexOf(this); this.work = null; this.delay = null; this.state = null; this.pending = false; this.scheduler = null; if (index !== -1) { actions.splice(index, 1); } if (id != null) { this.id = this.recycleAsyncId(scheduler, id, null); } }; return AsyncAction; }(Action_1.Action)); exports.AsyncAction = AsyncAction; //# sourceMappingURL=AsyncAction.js.map /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Scheduler_1 = __webpack_require__(71); var AsyncScheduler = (function (_super) { __extends(AsyncScheduler, _super); function AsyncScheduler() { _super.apply(this, arguments); this.actions = []; /** * A flag to indicate whether the Scheduler is currently executing a batch of * queued actions. * @type {boolean} */ this.active = false; /** * An internal ID used to track the latest asynchronous task such as those * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and * others. * @type {any} */ this.scheduled = undefined; } AsyncScheduler.prototype.flush = function (action) { var actions = this.actions; if (this.active) { actions.push(action); return; } var error; this.active = true; do { if (error = action.execute(action.state, action.delay)) { break; } } while (action = actions.shift()); // exhaust the scheduler queue this.active = false; if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } }; return AsyncScheduler; }(Scheduler_1.Scheduler)); exports.AsyncScheduler = AsyncScheduler; //# sourceMappingURL=AsyncScheduler.js.map /***/ }, /* 18 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var root_1 = __webpack_require__(7); function symbolIteratorPonyfill(root) { var Symbol = root.Symbol; if (typeof Symbol === 'function') { if (!Symbol.iterator) { Symbol.iterator = Symbol('iterator polyfill'); } return Symbol.iterator; } else { // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC) var Set_1 = root.Set; if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') { return '@@iterator'; } var Map_1 = root.Map; // required for compatability with es6-shim if (Map_1) { var keys = Object.getOwnPropertyNames(Map_1.prototype); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal. if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) { return key; } } } return '@@iterator'; } } exports.symbolIteratorPonyfill = symbolIteratorPonyfill; exports.$$iterator = symbolIteratorPonyfill(root_1.root); //# sourceMappingURL=iterator.js.map /***/ }, /* 19 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(setImmediate, clearImmediate) {var nextTick = __webpack_require__(38).nextTick; var apply = Function.prototype.apply; var slice = Array.prototype.slice; var immediateIds = {}; var nextImmediateId = 0; // DOM APIs, for completeness exports.setTimeout = function() { return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); }; exports.setInterval = function() { return new Timeout(apply.call(setInterval, window, arguments), clearInterval); }; exports.clearTimeout = exports.clearInterval = function(timeout) { timeout.close(); }; function Timeout(id, clearFn) { this._id = id; this._clearFn = clearFn; } Timeout.prototype.unref = Timeout.prototype.ref = function() {}; Timeout.prototype.close = function() { this._clearFn.call(window, this._id); }; // Does not start the time, just sets up the members needed. exports.enroll = function(item, msecs) { clearTimeout(item._idleTimeoutId); item._idleTimeout = msecs; }; exports.unenroll = function(item) { clearTimeout(item._idleTimeoutId); item._idleTimeout = -1; }; exports._unrefActive = exports.active = function(item) { clearTimeout(item._idleTimeoutId); var msecs = item._idleTimeout; if (msecs >= 0) { item._idleTimeoutId = setTimeout(function onTimeout() { if (item._onTimeout) item._onTimeout(); }, msecs); } }; // That's not how node.js implements it but the exposed api is the same. exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { var id = nextImmediateId++; var args = arguments.length < 2 ? false : slice.call(arguments, 1); immediateIds[id] = true; nextTick(function onNextTick() { if (immediateIds[id]) { // fn.call() is faster so we optimize for the common use-case // @see http://jsperf.com/call-apply-segu if (args) { fn.apply(null, args); } else { fn.call(null); } // Prevent ids from leaking exports.clearImmediate(id); } }); return id; }; exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { delete immediateIds[id]; }; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19).setImmediate, __webpack_require__(19).clearImmediate)) /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(5); var Subscription_1 = __webpack_require__(4); /** * @class AsyncSubject */ var AsyncSubject = (function (_super) { __extends(AsyncSubject, _super); function AsyncSubject() { _super.apply(this, arguments); this.value = null; this.hasNext = false; this.hasCompleted = false; } AsyncSubject.prototype._subscribe = function (subscriber) { if (this.hasCompleted && this.hasNext) { subscriber.next(this.value); subscriber.complete(); return Subscription_1.Subscription.EMPTY; } else if (this.hasError) { subscriber.error(this.thrownError); return Subscription_1.Subscription.EMPTY; } return _super.prototype._subscribe.call(this, subscriber); }; AsyncSubject.prototype.next = function (value) { if (!this.hasCompleted) { this.value = value; this.hasNext = true; } }; AsyncSubject.prototype.complete = function () { this.hasCompleted = true; if (this.hasNext) { _super.prototype.next.call(this, this.value); } _super.prototype.complete.call(this); }; return AsyncSubject; }(Subject_1.Subject)); exports.AsyncSubject = AsyncSubject; //# sourceMappingURL=AsyncSubject.js.map /***/ }, /* 21 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(2); var subscribeToResult_1 = __webpack_require__(3); /** * Converts a higher-order Observable into a first-order Observable which * concurrently delivers all values that are emitted on the inner Observables. * * Flattens an Observable-of-Observables. * * * * `mergeAll` subscribes to an Observable that emits Observables, also known as * a higher-order Observable. Each time it observes one of these emitted inner * Observables, it subscribes to that and delivers all the values from the * inner Observable on the output Observable. The output Observable only * completes once all inner Observables have completed. Any error delivered by * a inner Observable will be immediately emitted on the output Observable. * * @example Spawn a new interval Observable for each click event, and blend their outputs as one Observable * var clicks = Rx.Observable.fromEvent(document, 'click'); * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000)); * var firstOrder = higherOrder.mergeAll(); * firstOrder.subscribe(x => console.log(x)); * * @example Count from 0 to 9 every second for each click, but only allow 2 concurrent timers * var clicks = Rx.Observable.fromEvent(document, 'click'); * var higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10)); * var firstOrder = higherOrder.mergeAll(2); * firstOrder.subscribe(x => console.log(x)); * * @see {@link combineAll} * @see {@link concatAll} * @see {@link exhaust} * @see {@link merge} * @see {@link mergeMap} * @see {@link mergeMapTo} * @see {@link mergeScan} * @see {@link switch} * @see {@link zipAll} * * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of inner * Observables being subscribed to concurrently. * @return {Observable} An Observable that emits values coming from all the * inner Observables emitted by the source Observable. * @method mergeAll * @owner Observable */ function mergeAll(concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } return this.lift(new MergeAllOperator(concurrent)); } exports.mergeAll = mergeAll; var MergeAllOperator = (function () { function MergeAllOperator(concurrent) { this.concurrent = concurrent; } MergeAllOperator.prototype.call = function (observer, source) { return source._subscribe(new MergeAllSubscriber(observer, this.concurrent)); }; return MergeAllOperator; }()); exports.MergeAllOperator = MergeAllOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ 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) { 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; //# sourceMappingURL=mergeAll.js.map /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var root_1 = __webpack_require__(7); function getSymbolObservable(context) { var $$observable; var Symbol = context.Symbol; if (typeof Symbol === 'function') { if (Symbol.observable) { $$observable = Symbol.observable; } else { $$observable = Symbol('observable'); Symbol.observable = $$observable; } } else { $$observable = '@@observable'; } return $$observable; } exports.getSymbolObservable = getSymbolObservable; exports.$$observable = getSymbolObservable(root_1.root); //# sourceMappingURL=observable.js.map /***/ }, /* 23 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var root_1 = __webpack_require__(7); var Symbol = root_1.root.Symbol; exports.$$rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ? Symbol.for('rxSubscriber') : '@@rxSubscriber'; //# sourceMappingURL=rxSubscriber.js.map /***/ }, /* 24 */ /***/ function(module, exports) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /** * An error thrown when an element was queried at a certain index of an * Observable, but no such index or position exists in that sequence. * * @see {@link elementAt} * @see {@link take} * @see {@link takeLast} * * @class ArgumentOutOfRangeError */ var ArgumentOutOfRangeError = (function (_super) { __extends(ArgumentOutOfRangeError, _super); function ArgumentOutOfRangeError() { var err = _super.call(this, 'argument out of range'); this.name = err.name = 'ArgumentOutOfRangeError'; this.stack = err.stack; this.message = err.message; } return ArgumentOutOfRangeError; }(Error)); exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError; //# sourceMappingURL=ArgumentOutOfRangeError.js.map /***/ }, /* 25 */ /***/ function(module, exports) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /** * An error thrown when an Observable or a sequence was queried but has no * elements. * * @see {@link first} * @see {@link last} * @see {@link single} * * @class EmptyError */ var EmptyError = (function (_super) { __extends(EmptyError, _super); function EmptyError() { var err = _super.call(this, 'no elements in sequence'); this.name = err.name = 'EmptyError'; this.stack = err.stack; this.message = err.message; } return EmptyError; }(Error)); exports.EmptyError = EmptyError; //# sourceMappingURL=EmptyError.js.map /***/ }, /* 26 */ /***/ function(module, exports) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /** * An error thrown when an action is invalid because the object has been * unsubscribed. * * @see {@link Subject} * @see {@link BehaviorSubject} * * @class ObjectUnsubscribedError */ var ObjectUnsubscribedError = (function (_super) { __extends(ObjectUnsubscribedError, _super); function ObjectUnsubscribedError() { var err = _super.call(this, 'object unsubscribed'); this.name = err.name = 'ObjectUnsubscribedError'; this.stack = err.stack; this.message = err.message; } return ObjectUnsubscribedError; }(Error)); exports.ObjectUnsubscribedError = ObjectUnsubscribedError; //# sourceMappingURL=ObjectUnsubscribedError.js.map /***/ }, /* 27 */ /***/ function(module, exports) { "use strict"; "use strict"; function isDate(value) { return value instanceof Date && !isNaN(+value); } exports.isDate = isDate; //# sourceMappingURL=isDate.js.map /***/ }, /* 28 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(5); var queue_1 = __webpack_require__(58); var Subscription_1 = __webpack_require__(4); var observeOn_1 = __webpack_require__(33); var ObjectUnsubscribedError_1 = __webpack_require__(26); var SubjectSubscription_1 = __webpack_require__(41); /** * @class ReplaySubject */ 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.scheduler = scheduler; this._events = []; this._bufferSize = bufferSize < 1 ? 1 : bufferSize; this._windowTime = windowTime < 1 ? 1 : windowTime; } ReplaySubject.prototype.next = function (value) { var now = this._getNow(); this._events.push(new ReplayEvent(now, value)); this._trimBufferThenGetEvents(); _super.prototype.next.call(this, value); }; ReplaySubject.prototype._subscribe = function (subscriber) { var _events = this._trimBufferThenGetEvents(); var scheduler = this.scheduler; var subscription; if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } else if (this.hasError) { subscription = Subscription_1.Subscription.EMPTY; } else if (this.isStopped) { subscription = Subscription_1.Subscription.EMPTY; } else { this.observers.push(subscriber); subscription = new SubjectSubscription_1.SubjectSubscription(this, subscriber); } if (scheduler) { subscriber.add(subscriber = new observeOn_1.ObserveOnSubscriber(subscriber, scheduler)); } var len = _events.length; for (var i = 0; i < len && !subscriber.closed; i++) { subscriber.next(_events[i].value); } if (this.hasError) { subscriber.error(this.thrownError); } else if (this.isStopped) { subscriber.complete(); } return subscription; }; ReplaySubject.prototype._getNow = function () { return (this.scheduler || queue_1.queue).now(); }; ReplaySubject.prototype._trimBufferThenGetEvents = function () { var now = this._getNow(); 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++; } 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; }()); //# sourceMappingURL=ReplaySubject.js.map /***/ }, /* 29 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(0); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ var ScalarObservable = (function (_super) { __extends(ScalarObservable, _super); function ScalarObservable(value, scheduler) { _super.call(this); this.value = value; this.scheduler = scheduler; this._isScalar = true; if (scheduler) { this._isScalar = false; } } 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.closed) { return; } state.done = true; this.schedule(state); }; ScalarObservable.prototype._subscribe = function (subscriber) { var value = this.value; var scheduler = this.scheduler; if (scheduler) { return scheduler.schedule(ScalarObservable.dispatch, 0, { done: false, value: value, subscriber: subscriber }); } else { subscriber.next(value); if (!subscriber.closed) { subscriber.complete(); } } }; return ScalarObservable; }(Observable_1.Observable)); exports.ScalarObservable = ScalarObservable; //# sourceMappingURL=ScalarObservable.js.map /***/ }, /* 30 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ArrayObservable_1 = __webpack_require__(11); var isArray_1 = __webpack_require__(10); var OuterSubscriber_1 = __webpack_require__(2); var subscribeToResult_1 = __webpack_require__(3); var none = {}; /* tslint:disable:max-line-length */ 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 this.lift.call(new ArrayObservable_1.ArrayObservable(observables), new CombineLatestOperator(project)); } exports.combineLatest = combineLatest; var CombineLatestOperator = (function () { function CombineLatestOperator(project) { this.project = project; } CombineLatestOperator.prototype.call = function (subscriber, source) { return source._subscribe(new CombineLatestSubscriber(subscriber, this.project)); }; return CombineLatestOperator; }()); exports.CombineLatestOperator = CombineLatestOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ 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 = []; } CombineLatestSubscriber.prototype._next = function (observable) { this.values.push(none); 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; this.toRespond = 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 (outerValue, innerValue, outerIndex, innerIndex, innerSub) { var values = this.values; var oldVal = values[outerIndex]; var toRespond = !this.toRespond ? 0 : oldVal === none ? --this.toRespond : this.toRespond; values[outerIndex] = innerValue; if (toRespond === 0) { if (this.project) { this._tryProject(values); } else { this.destination.next(values.slice()); } } }; CombineLatestSubscriber.prototype._tryProject = function (values) { var result; try { result = this.project.apply(this, values); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; return CombineLatestSubscriber; }(OuterSubscriber_1.OuterSubscriber)); exports.CombineLatestSubscriber = CombineLatestSubscriber; //# sourceMappingURL=combineLatest.js.map /***/ }, /* 31 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var isScheduler_1 = __webpack_require__(13); var ArrayObservable_1 = __webpack_require__(11); var mergeAll_1 = __webpack_require__(21); /* tslint:disable:max-line-length */ function concat() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } return this.lift.call(concatStatic.apply(void 0, [this].concat(observables))); } exports.concat = concat; /* tslint:enable:max-line-length */ /** * Creates an output Observable which sequentially emits all values from every * given input Observable after the current Observable. * * Concatenates multiple Observables together by * sequentially emitting their values, one Observable after the other. * * * * Joins multiple Observables together by subscribing to them one at a time and * merging their results into the output Observable. Will wait for each * Observable to complete before moving on to the next. * * @example Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10 * var timer = Rx.Observable.interval(1000).take(4); * var sequence = Rx.Observable.range(1, 10); * var result = Rx.Observable.concat(timer, sequence); * result.subscribe(x => console.log(x)); * * @example Concatenate 3 Observables * var timer1 = Rx.Observable.interval(1000).take(10); * var timer2 = Rx.Observable.interval(2000).take(6); * var timer3 = Rx.Observable.interval(500).take(10); * var result = Rx.Observable.concat(timer1, timer2, timer3); * result.subscribe(x => console.log(x)); * * @see {@link concatAll} * @see {@link concatMap} * @see {@link concatMapTo} * * @param {Observable} input1 An input Observable to concatenate with others. * @param {Observable} input2 An input Observable to concatenate with others. * More than one input Observables may be given as argument. * @param {Scheduler} [scheduler=null] An optional Scheduler to schedule each * Observable subscription on. * @return {Observable} All values of each passed Observable merged into a * single Observable, in order, in serial fashion. * @static true * @name concat * @owner Observable */ function concatStatic() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } var scheduler = null; var args = observables; if (isScheduler_1.isScheduler(args[observables.length - 1])) { scheduler = args.pop(); } if (scheduler === null && observables.length === 1) { return observables[0]; } return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new mergeAll_1.MergeAllOperator(1)); } exports.concatStatic = concatStatic; //# sourceMappingURL=concat.js.map /***/ }, /* 32 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); /** * Applies a given `project` function to each value emitted by the source * Observable, and emits the resulting values as an Observable. * * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map), * it passes each source value through a transformation function to get * corresponding output values. * * * * Similar to the well known `Array.prototype.map` function, this operator * applies a projection to each value and emits that projection in the output * Observable. * * @example Map every every click to the clientX position of that click * var clicks = Rx.Observable.fromEvent(document, 'click'); * var positions = clicks.map(ev => ev.clientX); * positions.subscribe(x => console.log(x)); * * @see {@link mapTo} * @see {@link pluck} * * @param {function(value: T, index: number): R} project The function to apply * to each `value` emitted by the source Observable. The `index` parameter is * the number `i` for the i-th emission that has happened since the * subscription, starting from the number `0`. * @param {any} [thisArg] An optional argument to define what `this` is in the * `project` function. * @return {Observable} An Observable that emits the values from the source * Observable transformed by the given `project` function. * @method map * @owner Observable */ 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, source) { return source._subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); }; return MapOperator; }()); exports.MapOperator = MapOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var MapSubscriber = (function (_super) { __extends(MapSubscriber, _super); function MapSubscriber(destination, project, thisArg) { _super.call(this, destination); this.project = project; this.count = 0; this.thisArg = thisArg || this; } // NOTE: This looks unoptimized, but it's actually purposefully NOT // using try/catch optimizations. MapSubscriber.prototype._next = function (value) { var result; try { result = this.project.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; return MapSubscriber; }(Subscriber_1.Subscriber)); //# sourceMappingURL=map.js.map /***/ }, /* 33 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); var Notification_1 = __webpack_require__(15); /** * @see {@link Notification} * * @param scheduler * @param delay * @return {Observable|WebSocketSubject|Observable} * @method observeOn * @owner Observable */ function observeOn(scheduler, delay) { if (delay === void 0) { delay = 0; } return this.lift(new ObserveOnOperator(scheduler, delay)); } exports.observeOn = observeOn; var ObserveOnOperator = (function () { function ObserveOnOperator(scheduler, delay) { if (delay === void 0) { delay = 0; } this.scheduler = scheduler; this.delay = delay; } ObserveOnOperator.prototype.call = function (subscriber, source) { return source._subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay)); }; return ObserveOnOperator; }()); exports.ObserveOnOperator = ObserveOnOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ 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 (arg) { var notification = arg.notification, destination = arg.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; }()); exports.ObserveOnMessage = ObserveOnMessage; //# sourceMappingURL=observeOn.js.map /***/ }, /* 34 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); /* tslint:disable:max-line-length */ function reduce(accumulator, seed) { var hasSeed = false; // providing a seed of `undefined` *should* be valid and trigger // hasSeed! so don't use `seed !== undefined` checks! // For this reason, we have to check it here at the original call site // otherwise inside Operator/Subscriber we won't know if `undefined` // means they didn't provide anything or if they literally provided `undefined` if (arguments.length >= 2) { hasSeed = true; } return this.lift(new ReduceOperator(accumulator, seed, hasSeed)); } exports.reduce = reduce; var ReduceOperator = (function () { function ReduceOperator(accumulator, seed, hasSeed) { if (hasSeed === void 0) { hasSeed = false; } this.accumulator = accumulator; this.seed = seed; this.hasSeed = hasSeed; } ReduceOperator.prototype.call = function (subscriber, source) { return source._subscribe(new ReduceSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed)); }; return ReduceOperator; }()); exports.ReduceOperator = ReduceOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var ReduceSubscriber = (function (_super) { __extends(ReduceSubscriber, _super); function ReduceSubscriber(destination, accumulator, seed, hasSeed) { _super.call(this, destination); this.accumulator = accumulator; this.hasSeed = hasSeed; this.hasValue = false; this.acc = seed; } ReduceSubscriber.prototype._next = function (value) { if (this.hasValue || (this.hasValue = this.hasSeed)) { this._tryReduce(value); } else { this.acc = value; this.hasValue = true; } }; ReduceSubscriber.prototype._tryReduce = function (value) { var result; try { result = this.accumulator(this.acc, value); } catch (err) { this.destination.error(err); return; } this.acc = result; }; 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; //# sourceMappingURL=reduce.js.map /***/ }, /* 35 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ArrayObservable_1 = __webpack_require__(11); var isArray_1 = __webpack_require__(10); var Subscriber_1 = __webpack_require__(1); var OuterSubscriber_1 = __webpack_require__(2); var subscribeToResult_1 = __webpack_require__(3); var iterator_1 = __webpack_require__(18); /* tslint:disable:max-line-length */ function zipProto() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } return this.lift.call(zipStatic.apply(void 0, [this].concat(observables))); } exports.zipProto = zipProto; /* tslint:enable:max-line-length */ /** * @param observables * @return {Observable} * @static true * @name zip * @owner Observable */ function zipStatic() { 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 ArrayObservable_1.ArrayObservable(observables).lift(new ZipOperator(project)); } exports.zipStatic = zipStatic; var ZipOperator = (function () { function ZipOperator(project) { this.project = project; } ZipOperator.prototype.call = function (subscriber, source) { return source._subscribe(new ZipSubscriber(subscriber, this.project)); }; return ZipOperator; }()); exports.ZipOperator = ZipOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ 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.iterators = []; this.active = 0; this.project = (typeof project === 'function') ? project : null; this.values = values; } ZipSubscriber.prototype._next = function (value) { var iterators = this.iterators; if (isArray_1.isArray(value)) { iterators.push(new StaticArrayIterator(value)); } else if (typeof value[iterator_1.$$iterator] === 'function') { iterators.push(new StaticIterator(value[iterator_1.$$iterator]())); } else { iterators.push(new ZipBufferIterator(this.destination, this, value)); } }; 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) { this.add(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); } if (this.project) { this._tryProject(args); } else { destination.next(args); } if (shouldComplete) { destination.complete(); } }; ZipSubscriber.prototype._tryProject = function (args) { var result; try { result = this.project.apply(this, args); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; 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[iterator_1.$$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 } : { value: null, done: true }; }; StaticArrayIterator.prototype.hasValue = function () { return this.array.length > this.index; }; StaticArrayIterator.prototype.hasCompleted = function () { return this.array.length === this.index; }; return StaticArrayIterator; }()); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var ZipBufferIterator = (function (_super) { __extends(ZipBufferIterator, _super); function ZipBufferIterator(destination, parent, observable) { _super.call(this, destination); this.parent = parent; this.observable = observable; this.stillUnsubscribed = true; this.buffer = []; this.isComplete = false; } ZipBufferIterator.prototype[iterator_1.$$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 { value: null, 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, innerSub) { this.buffer.push(innerValue); this.parent.checkIterators(); }; ZipBufferIterator.prototype.subscribe = function (value, index) { return subscribeToResult_1.subscribeToResult(this, this.observable, this, index); }; return ZipBufferIterator; }(OuterSubscriber_1.OuterSubscriber)); //# sourceMappingURL=zip.js.map /***/ }, /* 36 */ /***/ function(module, exports) { "use strict"; "use strict"; function isFunction(x) { return typeof x === 'function'; } exports.isFunction = isFunction; //# sourceMappingURL=isFunction.js.map /***/ }, /* 37 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var isArray_1 = __webpack_require__(10); function isNumeric(val) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN // adding 1 corrects loss of precision from parseFloat (#15100) return !isArray_1.isArray(val) && (val - parseFloat(val) + 1) >= 0; } exports.isNumeric = isNumeric; ; //# sourceMappingURL=isNumeric.js.map /***/ }, /* 38 */ /***/ function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }, /* 39 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(5); var ObjectUnsubscribedError_1 = __webpack_require__(26); /** * @class BehaviorSubject */ var BehaviorSubject = (function (_super) { __extends(BehaviorSubject, _super); function BehaviorSubject(_value) { _super.call(this); this._value = _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 && !subscription.closed) { subscriber.next(this._value); } return subscription; }; BehaviorSubject.prototype.getValue = function () { if (this.hasError) { throw this.thrownError; } else if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } else { return this._value; } }; BehaviorSubject.prototype.next = function (value) { _super.prototype.next.call(this, this._value = value); }; return BehaviorSubject; }(Subject_1.Subject)); exports.BehaviorSubject = BehaviorSubject; //# sourceMappingURL=BehaviorSubject.js.map /***/ }, /* 40 */ /***/ function(module, exports) { "use strict"; "use strict"; exports.empty = { closed: true, next: function (value) { }, error: function (err) { throw err; }, complete: function () { } }; //# sourceMappingURL=Observer.js.map /***/ }, /* 41 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(4); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var SubjectSubscription = (function (_super) { __extends(SubjectSubscription, _super); function SubjectSubscription(subject, subscriber) { _super.call(this); this.subject = subject; this.subscriber = subscriber; this.closed = false; } SubjectSubscription.prototype.unsubscribe = function () { if (this.closed) { return; } this.closed = true; var subject = this.subject; var observers = subject.observers; this.subject = null; if (!observers || observers.length === 0 || subject.isStopped || subject.closed) { return; } var subscriberIndex = observers.indexOf(this.subscriber); if (subscriberIndex !== -1) { observers.splice(subscriberIndex, 1); } }; return SubjectSubscription; }(Subscription_1.Subscription)); exports.SubjectSubscription = SubjectSubscription; //# sourceMappingURL=SubjectSubscription.js.map /***/ }, /* 42 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(5); var Observable_1 = __webpack_require__(0); var Subscriber_1 = __webpack_require__(1); var Subscription_1 = __webpack_require__(4); /** * @class ConnectableObservable */ var ConnectableObservable = (function (_super) { __extends(ConnectableObservable, _super); function ConnectableObservable(source, subjectFactory) { _super.call(this); this.source = source; this.subjectFactory = subjectFactory; this._refCount = 0; } ConnectableObservable.prototype._subscribe = function (subscriber) { return this.getSubject().subscribe(subscriber); }; ConnectableObservable.prototype.getSubject = function () { var subject = this._subject; if (!subject || subject.isStopped) { this._subject = this.subjectFactory(); } return this._subject; }; ConnectableObservable.prototype.connect = function () { var connection = this._connection; if (!connection) { connection = this._connection = new Subscription_1.Subscription(); connection.add(this.source .subscribe(new ConnectableSubscriber(this.getSubject(), this))); if (connection.closed) { this._connection = null; connection = Subscription_1.Subscription.EMPTY; } else { this._connection = connection; } } return connection; }; ConnectableObservable.prototype.refCount = function () { return this.lift(new RefCountOperator(this)); }; return ConnectableObservable; }(Observable_1.Observable)); exports.ConnectableObservable = ConnectableObservable; exports.connectableObservableDescriptor = { operator: { value: null }, _refCount: { value: 0, writable: true }, _subscribe: { value: ConnectableObservable.prototype._subscribe }, getSubject: { value: ConnectableObservable.prototype.getSubject }, connect: { value: ConnectableObservable.prototype.connect }, refCount: { value: ConnectableObservable.prototype.refCount } }; var ConnectableSubscriber = (function (_super) { __extends(ConnectableSubscriber, _super); function ConnectableSubscriber(destination, connectable) { _super.call(this, destination); this.connectable = connectable; } ConnectableSubscriber.prototype._error = function (err) { this._unsubscribe(); _super.prototype._error.call(this, err); }; ConnectableSubscriber.prototype._complete = function () { this._unsubscribe(); _super.prototype._complete.call(this); }; ConnectableSubscriber.prototype._unsubscribe = function () { var connectable = this.connectable; if (connectable) { this.connectable = null; var connection = connectable._connection; connectable._refCount = 0; connectable._subject = null; connectable._connection = null; if (connection) { connection.unsubscribe(); } } }; return ConnectableSubscriber; }(Subject_1.SubjectSubscriber)); var RefCountOperator = (function () { function RefCountOperator(connectable) { this.connectable = connectable; } RefCountOperator.prototype.call = function (subscriber, source) { var connectable = this.connectable; connectable._refCount++; var refCounter = new RefCountSubscriber(subscriber, connectable); var subscription = source._subscribe(refCounter); if (!refCounter.closed) { refCounter.connection = connectable.connect(); } return subscription; }; return RefCountOperator; }()); var RefCountSubscriber = (function (_super) { __extends(RefCountSubscriber, _super); function RefCountSubscriber(destination, connectable) { _super.call(this, destination); this.connectable = connectable; } RefCountSubscriber.prototype._unsubscribe = function () { var connectable = this.connectable; if (!connectable) { this.connection = null; return; } this.connectable = null; var refCount = connectable._refCount; if (refCount <= 0) { this.connection = null; return; } connectable._refCount = refCount - 1; if (refCount > 1) { this.connection = null; return; } /// // Compare the local RefCountSubscriber's connection Subscription to the // connection Subscription on the shared ConnectableObservable. In cases // where the ConnectableObservable source synchronously emits values, and // the RefCountSubscriber's downstream Observers synchronously unsubscribe, // execution continues to here before the RefCountOperator has a chance to // supply the RefCountSubscriber with the shared connection Subscription. // For example: // ``` // Observable.range(0, 10) // .publish() // .refCount() // .take(5) // .subscribe(); // ``` // In order to account for this case, RefCountSubscriber should only dispose // the ConnectableObservable's shared connection Subscription if the // connection Subscription exists, *and* either: // a. RefCountSubscriber doesn't have a reference to the shared connection // Subscription yet, or, // b. RefCountSubscriber's connection Subscription reference is identical // to the shared connection Subscription /// var connection = this.connection; var sharedConnection = connectable._connection; this.connection = null; if (sharedConnection && (!connection || sharedConnection === connection)) { sharedConnection.unsubscribe(); } }; return RefCountSubscriber; }(Subscriber_1.Subscriber)); //# sourceMappingURL=ConnectableObservable.js.map /***/ }, /* 43 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var isArray_1 = __webpack_require__(10); var isPromise_1 = __webpack_require__(64); var PromiseObservable_1 = __webpack_require__(44); var IteratorObservable_1 = __webpack_require__(210); var ArrayObservable_1 = __webpack_require__(11); var ArrayLikeObservable_1 = __webpack_require__(199); var iterator_1 = __webpack_require__(18); var Observable_1 = __webpack_require__(0); var observeOn_1 = __webpack_require__(33); var observable_1 = __webpack_require__(22); var isArrayLike = (function (x) { return x && typeof x.length === 'number'; }); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ var FromObservable = (function (_super) { __extends(FromObservable, _super); function FromObservable(ish, scheduler) { _super.call(this, null); this.ish = ish; this.scheduler = scheduler; } /** * Creates an Observable from an Array, an array-like object, a Promise, an * iterable object, or an Observable-like object. * * Converts almost anything to an Observable. * * * * Convert various other objects and data types into Observables. `from` * converts a Promise or an array-like or an * [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable) * object into an Observable that emits the items in that promise or array or * iterable. A String, in this context, is treated as an array of characters. * Observable-like objects (contains a function named with the ES2015 Symbol * for Observable) can also be converted through this operator. * * @example Converts an array to an Observable * var array = [10, 20, 30]; * var result = Rx.Observable.from(array); * result.subscribe(x => console.log(x)); * * @example Convert an infinite iterable (from a generator) to an Observable * function* generateDoubles(seed) { * var i = seed; * while (true) { * yield i; * i = 2 * i; // double it * } * } * * var iterator = generateDoubles(3); * var result = Rx.Observable.from(iterator).take(10); * result.subscribe(x => console.log(x)); * * @see {@link create} * @see {@link fromEvent} * @see {@link fromEventPattern} * @see {@link fromPromise} * * @param {ObservableInput} ish A subscribable object, a Promise, an * Observable-like, an Array, an iterable or an array-like object to be * converted. * @param {Scheduler} [scheduler] The scheduler on which to schedule the * emissions of values. * @return {Observable} The Observable whose values are originally from the * input object that was converted. * @static true * @name from * @owner Observable */ FromObservable.create = function (ish, scheduler) { if (ish != null) { if (typeof ish[observable_1.$$observable] === 'function') { if (ish instanceof Observable_1.Observable && !scheduler) { return ish; } return new FromObservable(ish, scheduler); } else if (isArray_1.isArray(ish)) { return new ArrayObservable_1.ArrayObservable(ish, scheduler); } else if (isPromise_1.isPromise(ish)) { return new PromiseObservable_1.PromiseObservable(ish, scheduler); } else if (typeof ish[iterator_1.$$iterator] === 'function' || typeof ish === 'string') { return new IteratorObservable_1.IteratorObservable(ish, scheduler); } else if (isArrayLike(ish)) { return new ArrayLikeObservable_1.ArrayLikeObservable(ish, scheduler); } } throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable'); }; FromObservable.prototype._subscribe = function (subscriber) { var ish = this.ish; var scheduler = this.scheduler; if (scheduler == null) { return ish[observable_1.$$observable]().subscribe(subscriber); } else { return ish[observable_1.$$observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0)); } }; return FromObservable; }(Observable_1.Observable)); exports.FromObservable = FromObservable; //# sourceMappingURL=FromObservable.js.map /***/ }, /* 44 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var root_1 = __webpack_require__(7); var Observable_1 = __webpack_require__(0); /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ var PromiseObservable = (function (_super) { __extends(PromiseObservable, _super); function PromiseObservable(promise, scheduler) { _super.call(this); this.promise = promise; this.scheduler = scheduler; } /** * Converts a Promise to an Observable. * * Returns an Observable that just emits the Promise's * resolved value, then completes. * * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an * Observable. If the Promise resolves with a value, the output Observable * emits that resolved value as a `next`, and then completes. If the Promise * is rejected, then the output Observable emits the corresponding Error. * * @example Convert the Promise returned by Fetch to an Observable * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/')); * result.subscribe(x => console.log(x), e => console.error(e)); * * @see {@link bindCallback} * @see {@link from} * * @param {Promise} promise The promise to be converted. * @param {Scheduler} [scheduler] An optional Scheduler to use for scheduling * the delivery of the resolved value (or the rejection). * @return {Observable} An Observable which wraps the Promise. * @static true * @name fromPromise * @owner Observable */ PromiseObservable.create = function (promise, scheduler) { return new PromiseObservable(promise, scheduler); }; PromiseObservable.prototype._subscribe = function (subscriber) { var _this = this; var promise = this.promise; var scheduler = this.scheduler; if (scheduler == null) { if (this._isScalar) { if (!subscriber.closed) { subscriber.next(this.value); subscriber.complete(); } } else { promise.then(function (value) { _this.value = value; _this._isScalar = true; if (!subscriber.closed) { subscriber.next(value); subscriber.complete(); } }, function (err) { if (!subscriber.closed) { subscriber.error(err); } }) .then(null, function (err) { // escape the promise trap, throw unhandled errors root_1.root.setTimeout(function () { throw err; }); }); } } else { if (this._isScalar) { if (!subscriber.closed) { return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber }); } } else { promise.then(function (value) { _this.value = value; _this._isScalar = true; if (!subscriber.closed) { subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber })); } }, function (err) { if (!subscriber.closed) { subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber })); } }) .then(null, function (err) { // escape the promise trap, throw unhandled errors root_1.root.setTimeout(function () { throw err; }); }); } } }; return PromiseObservable; }(Observable_1.Observable)); exports.PromiseObservable = PromiseObservable; function dispatchNext(arg) { var value = arg.value, subscriber = arg.subscriber; if (!subscriber.closed) { subscriber.next(value); subscriber.complete(); } } function dispatchError(arg) { var err = arg.err, subscriber = arg.subscriber; if (!subscriber.closed) { subscriber.error(err); } } //# sourceMappingURL=PromiseObservable.js.map /***/ }, /* 45 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var root_1 = __webpack_require__(7); var tryCatch_1 = __webpack_require__(8); var errorObject_1 = __webpack_require__(6); var Observable_1 = __webpack_require__(0); var Subscriber_1 = __webpack_require__(1); var map_1 = __webpack_require__(32); function getCORSRequest() { if (root_1.root.XMLHttpRequest) { var xhr = new root_1.root.XMLHttpRequest(); if ('withCredentials' in xhr) { xhr.withCredentials = !!this.withCredentials; } return xhr; } else if (!!root_1.root.XDomainRequest) { return new root_1.root.XDomainRequest(); } else { throw new Error('CORS is not supported by your browser'); } } function getXMLHttpRequest() { if (root_1.root.XMLHttpRequest) { return new root_1.root.XMLHttpRequest(); } else { var progId = void 0; try { var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0']; for (var i = 0; i < 3; i++) { try { progId = progIds[i]; if (new root_1.root.ActiveXObject(progId)) { break; } } catch (e) { } } return new root_1.root.ActiveXObject(progId); } catch (e) { throw new Error('XMLHttpRequest is not supported by your browser'); } } } function ajaxGet(url, headers) { if (headers === void 0) { headers = null; } return new AjaxObservable({ method: 'GET', url: url, headers: headers }); } exports.ajaxGet = ajaxGet; ; function ajaxPost(url, body, headers) { return new AjaxObservable({ method: 'POST', url: url, body: body, headers: headers }); } exports.ajaxPost = ajaxPost; ; function ajaxDelete(url, headers) { return new AjaxObservable({ method: 'DELETE', url: url, headers: headers }); } exports.ajaxDelete = ajaxDelete; ; function ajaxPut(url, body, headers) { return new AjaxObservable({ method: 'PUT', url: url, body: body, headers: headers }); } exports.ajaxPut = ajaxPut; ; function ajaxGetJSON(url, headers) { return new AjaxObservable({ method: 'GET', url: url, responseType: 'json', headers: headers }) .lift(new map_1.MapOperator(function (x, index) { return x.response; }, null)); } exports.ajaxGetJSON = ajaxGetJSON; ; /** * We need this JSDoc comment for affecting ESDoc. * @extends {Ignored} * @hide true */ var AjaxObservable = (function (_super) { __extends(AjaxObservable, _super); function AjaxObservable(urlOrRequest) { _super.call(this); var request = { async: true, createXHR: function () { return this.crossDomain ? getCORSRequest.call(this) : getXMLHttpRequest(); }, crossDomain: false, withCredentials: false, headers: {}, method: 'GET', responseType: 'json', timeout: 0 }; if (typeof urlOrRequest === 'string') { request.url = urlOrRequest; } else { for (var prop in urlOrRequest) { if (urlOrRequest.hasOwnProperty(prop)) { request[prop] = urlOrRequest[prop]; } } } this.request = request; } AjaxObservable.prototype._subscribe = function (subscriber) { return new AjaxSubscriber(subscriber, this.request); }; /** * Creates an observable for an Ajax request with either a request object with * url, headers, etc or a string for a URL. * * @example * source = Rx.Observable.ajax('/products'); * source = Rx.Observable.ajax({ url: 'products', method: 'GET' }); * * @param {string|Object} request Can be one of the following: * A string of the URL to make the Ajax call. * An object with the following properties * - url: URL of the request * - body: The body of the request * - method: Method of the request, such as GET, POST, PUT, PATCH, DELETE * - async: Whether the request is async * - headers: Optional headers * - crossDomain: true if a cross domain request, else false * - createXHR: a function to override if you need to use an alternate * XMLHttpRequest implementation. * - resultSelector: a function to use to alter the output value type of * the Observable. Gets {@link AjaxResponse} as an argument. * @return {Observable} An observable sequence containing the XMLHttpRequest. * @static true * @name ajax * @owner Observable */ AjaxObservable.create = (function () { var create = function (urlOrRequest) { return new AjaxObservable(urlOrRequest); }; create.get = ajaxGet; create.post = ajaxPost; create.delete = ajaxDelete; create.put = ajaxPut; create.getJSON = ajaxGetJSON; return create; })(); return AjaxObservable; }(Observable_1.Observable)); exports.AjaxObservable = AjaxObservable; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var AjaxSubscriber = (function (_super) { __extends(AjaxSubscriber, _super); function AjaxSubscriber(destination, request) { _super.call(this, destination); this.request = request; this.done = false; var headers = request.headers = request.headers || {}; // force CORS if requested if (!request.crossDomain && !headers['X-Requested-With']) { headers['X-Requested-With'] = 'XMLHttpRequest'; } // ensure content type is set if (!('Content-Type' in headers) && !(root_1.root.FormData && request.body instanceof root_1.root.FormData) && typeof request.body !== 'undefined') { headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'; } // properly serialize body request.body = this.serializeBody(request.body, request.headers['Content-Type']); this.send(); } AjaxSubscriber.prototype.next = function (e) { this.done = true; var _a = this, xhr = _a.xhr, request = _a.request, destination = _a.destination; var response = new AjaxResponse(e, xhr, request); destination.next(response); }; AjaxSubscriber.prototype.send = function () { var _a = this, request = _a.request, _b = _a.request, user = _b.user, method = _b.method, url = _b.url, async = _b.async, password = _b.password, headers = _b.headers, body = _b.body; var createXHR = request.createXHR; var xhr = tryCatch_1.tryCatch(createXHR).call(request); if (xhr === errorObject_1.errorObject) { this.error(errorObject_1.errorObject.e); } else { this.xhr = xhr; // open XHR first var result = void 0; if (user) { result = tryCatch_1.tryCatch(xhr.open).call(xhr, method, url, async, user, password); } else { result = tryCatch_1.tryCatch(xhr.open).call(xhr, method, url, async); } if (result === errorObject_1.errorObject) { this.error(errorObject_1.errorObject.e); return null; } // timeout and responseType can be set once the XHR is open xhr.timeout = request.timeout; xhr.responseType = request.responseType; // set headers this.setHeaders(xhr, headers); // now set up the events this.setupEvents(xhr, request); // finally send the request if (body) { xhr.send(body); } else { xhr.send(); } } return xhr; }; AjaxSubscriber.prototype.serializeBody = function (body, contentType) { if (!body || typeof body === 'string') { return body; } else if (root_1.root.FormData && body instanceof root_1.root.FormData) { return body; } if (contentType) { var splitIndex = contentType.indexOf(';'); if (splitIndex !== -1) { contentType = contentType.substring(0, splitIndex); } } switch (contentType) { case 'application/x-www-form-urlencoded': return Object.keys(body).map(function (key) { return (encodeURI(key) + "=" + encodeURI(body[key])); }).join('&'); case 'application/json': return JSON.stringify(body); default: return body; } }; AjaxSubscriber.prototype.setHeaders = function (xhr, headers) { for (var key in headers) { if (headers.hasOwnProperty(key)) { xhr.setRequestHeader(key, headers[key]); } } }; AjaxSubscriber.prototype.setupEvents = function (xhr, request) { var progressSubscriber = request.progressSubscriber; function xhrTimeout(e) { var _a = xhrTimeout, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request; if (progressSubscriber) { progressSubscriber.error(e); } subscriber.error(new AjaxTimeoutError(this, request)); //TODO: Make betterer. } ; xhr.ontimeout = xhrTimeout; xhrTimeout.request = request; xhrTimeout.subscriber = this; xhrTimeout.progressSubscriber = progressSubscriber; if (xhr.upload && 'withCredentials' in xhr && root_1.root.XDomainRequest) { if (progressSubscriber) { var xhrProgress_1; xhrProgress_1 = function (e) { var progressSubscriber = xhrProgress_1.progressSubscriber; progressSubscriber.next(e); }; xhr.onprogress = xhrProgress_1; xhrProgress_1.progressSubscriber = progressSubscriber; } var xhrError_1; xhrError_1 = function (e) { var _a = xhrError_1, progressSubscriber = _a.progressSubscriber, subscriber = _a.subscriber, request = _a.request; if (progressSubscriber) { progressSubscriber.error(e); } subscriber.error(new AjaxError('ajax error', this, request)); }; xhr.onerror = xhrError_1; xhrError_1.request = request; xhrError_1.subscriber = this; xhrError_1.progressSubscriber = progressSubscriber; } function xhrReadyStateChange(e) { var _a = xhrReadyStateChange, subscriber = _a.subscriber, progressSubscriber = _a.progressSubscriber, request = _a.request; if (this.readyState === 4) { // normalize IE9 bug (http://bugs.jquery.com/ticket/1450) var status_1 = this.status === 1223 ? 204 : this.status; var response = (this.responseType === 'text' ? (this.response || this.responseText) : this.response); // fix status code when it is 0 (0 status is undocumented). // Occurs when accessing file resources or on Android 4.1 stock browser // while retrieving files from application cache. if (status_1 === 0) { status_1 = response ? 200 : 0; } if (200 <= status_1 && status_1 < 300) { if (progressSubscriber) { progressSubscriber.complete(); } subscriber.next(e); subscriber.complete(); } else { if (progressSubscriber) { progressSubscriber.error(e); } subscriber.error(new AjaxError('ajax error ' + status_1, this, request)); } } } ; xhr.onreadystatechange = xhrReadyStateChange; xhrReadyStateChange.subscriber = this; xhrReadyStateChange.progressSubscriber = progressSubscriber; xhrReadyStateChange.request = request; }; AjaxSubscriber.prototype.unsubscribe = function () { var _a = this, done = _a.done, xhr = _a.xhr; if (!done && xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') { xhr.abort(); } _super.prototype.unsubscribe.call(this); }; return AjaxSubscriber; }(Subscriber_1.Subscriber)); exports.AjaxSubscriber = AjaxSubscriber; /** * A normalized AJAX response. * * @see {@link ajax} * * @class AjaxResponse */ var AjaxResponse = (function () { function AjaxResponse(originalEvent, xhr, request) { this.originalEvent = originalEvent; this.xhr = xhr; this.request = request; this.status = xhr.status; this.responseType = xhr.responseType || request.responseType; switch (this.responseType) { case 'json': if ('response' in xhr) { //IE does not support json as responseType, parse it internally this.response = xhr.responseType ? xhr.response : JSON.parse(xhr.response || xhr.responseText || 'null'); } else { this.response = JSON.parse(xhr.responseText || 'null'); } break; case 'xml': this.response = xhr.responseXML; break; case 'text': default: this.response = ('response' in xhr) ? xhr.response : xhr.responseText; break; } } return AjaxResponse; }()); exports.AjaxResponse = AjaxResponse; /** * A normalized AJAX error. * * @see {@link ajax} * * @class AjaxError */ var AjaxError = (function (_super) { __extends(AjaxError, _super); function AjaxError(message, xhr, request) { _super.call(this, message); this.message = message; this.xhr = xhr; this.request = request; this.status = xhr.status; } return AjaxError; }(Error)); exports.AjaxError = AjaxError; /** * @see {@link ajax} * * @class AjaxTimeoutError */ var AjaxTimeoutError = (function (_super) { __extends(AjaxTimeoutError, _super); function AjaxTimeoutError(xhr, request) { _super.call(this, 'ajax timeout', xhr, request); } return AjaxTimeoutError; }(AjaxError)); exports.AjaxTimeoutError = AjaxTimeoutError; //# sourceMappingURL=AjaxObservable.js.map /***/ }, /* 46 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); var tryCatch_1 = __webpack_require__(8); var errorObject_1 = __webpack_require__(6); /* tslint:disable:max-line-length */ function distinctUntilChanged(compare, keySelector) { return this.lift(new DistinctUntilChangedOperator(compare, keySelector)); } exports.distinctUntilChanged = distinctUntilChanged; var DistinctUntilChangedOperator = (function () { function DistinctUntilChangedOperator(compare, keySelector) { this.compare = compare; this.keySelector = keySelector; } DistinctUntilChangedOperator.prototype.call = function (subscriber, source) { return source._subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector)); }; return DistinctUntilChangedOperator; }()); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var DistinctUntilChangedSubscriber = (function (_super) { __extends(DistinctUntilChangedSubscriber, _super); function DistinctUntilChangedSubscriber(destination, compare, keySelector) { _super.call(this, destination); this.keySelector = keySelector; this.hasKey = false; if (typeof compare === 'function') { this.compare = compare; } } DistinctUntilChangedSubscriber.prototype.compare = function (x, y) { return x === y; }; DistinctUntilChangedSubscriber.prototype._next = function (value) { var keySelector = this.keySelector; var key = value; if (keySelector) { key = tryCatch_1.tryCatch(this.keySelector)(value); if (key === errorObject_1.errorObject) { return this.destination.error(errorObject_1.errorObject.e); } } var result = false; if (this.hasKey) { result = tryCatch_1.tryCatch(this.compare)(this.key, key); if (result === errorObject_1.errorObject) { return this.destination.error(errorObject_1.errorObject.e); } } else { this.hasKey = true; } if (Boolean(result) === false) { this.key = key; this.destination.next(value); } }; return DistinctUntilChangedSubscriber; }(Subscriber_1.Subscriber)); //# sourceMappingURL=distinctUntilChanged.js.map /***/ }, /* 47 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); /* tslint:disable:max-line-length */ function filter(predicate, thisArg) { return this.lift(new FilterOperator(predicate, thisArg)); } exports.filter = filter; var FilterOperator = (function () { function FilterOperator(predicate, thisArg) { this.predicate = predicate; this.thisArg = thisArg; } FilterOperator.prototype.call = function (subscriber, source) { return source._subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg)); }; return FilterOperator; }()); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var FilterSubscriber = (function (_super) { __extends(FilterSubscriber, _super); function FilterSubscriber(destination, predicate, thisArg) { _super.call(this, destination); this.predicate = predicate; this.thisArg = thisArg; this.count = 0; this.predicate = predicate; } // the try catch block below is left specifically for // optimization and perf reasons. a tryCatcher is not necessary here. FilterSubscriber.prototype._next = function (value) { var result; try { result = this.predicate.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } if (result) { this.destination.next(value); } }; return FilterSubscriber; }(Subscriber_1.Subscriber)); //# sourceMappingURL=filter.js.map /***/ }, /* 48 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); /* tslint:disable:max-line-length */ function find(predicate, thisArg) { if (typeof predicate !== 'function') { throw new TypeError('predicate is not a function'); } return this.lift(new FindValueOperator(predicate, this, false, thisArg)); } exports.find = find; var FindValueOperator = (function () { function FindValueOperator(predicate, source, yieldIndex, thisArg) { this.predicate = predicate; this.source = source; this.yieldIndex = yieldIndex; this.thisArg = thisArg; } FindValueOperator.prototype.call = function (observer, source) { return source._subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg)); }; return FindValueOperator; }()); exports.FindValueOperator = FindValueOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var FindValueSubscriber = (function (_super) { __extends(FindValueSubscriber, _super); function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) { _super.call(this, destination); this.predicate = predicate; this.source = source; this.yieldIndex = yieldIndex; this.thisArg = thisArg; this.index = 0; } FindValueSubscriber.prototype.notifyComplete = function (value) { var destination = this.destination; destination.next(value); destination.complete(); }; FindValueSubscriber.prototype._next = function (value) { var _a = this, predicate = _a.predicate, thisArg = _a.thisArg; var index = this.index++; try { var result = predicate.call(thisArg || this, value, index, this.source); if (result) { this.notifyComplete(this.yieldIndex ? index : value); } } catch (err) { this.destination.error(err); } }; FindValueSubscriber.prototype._complete = function () { this.notifyComplete(this.yieldIndex ? -1 : undefined); }; return FindValueSubscriber; }(Subscriber_1.Subscriber)); exports.FindValueSubscriber = FindValueSubscriber; //# sourceMappingURL=find.js.map /***/ }, /* 49 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var ArrayObservable_1 = __webpack_require__(11); var mergeAll_1 = __webpack_require__(21); var isScheduler_1 = __webpack_require__(13); /* tslint:disable:max-line-length */ function merge() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } return this.lift.call(mergeStatic.apply(void 0, [this].concat(observables))); } exports.merge = merge; /* tslint:enable:max-line-length */ /** * Creates an output Observable which concurrently emits all values from every * given input Observable. * * Flattens multiple Observables together by blending * their values into one Observable. * * * * `merge` subscribes to each given input Observable (as arguments), and simply * forwards (without doing any transformation) all the values from all the input * Observables to the output Observable. The output Observable only completes * once all input Observables have completed. Any error delivered by an input * Observable will be immediately emitted on the output Observable. * * @example Merge together two Observables: 1s interval and clicks * var clicks = Rx.Observable.fromEvent(document, 'click'); * var timer = Rx.Observable.interval(1000); * var clicksOrTimer = Rx.Observable.merge(clicks, timer); * clicksOrTimer.subscribe(x => console.log(x)); * * @example Merge together 3 Observables, but only 2 run concurrently * var timer1 = Rx.Observable.interval(1000).take(10); * var timer2 = Rx.Observable.interval(2000).take(6); * var timer3 = Rx.Observable.interval(500).take(10); * var concurrent = 2; // the argument * var merged = Rx.Observable.merge(timer1, timer2, timer3, concurrent); * merged.subscribe(x => console.log(x)); * * @see {@link mergeAll} * @see {@link mergeMap} * @see {@link mergeMapTo} * @see {@link mergeScan} * * @param {...Observable} observables Input Observables to merge together. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input * Observables being subscribed to concurrently. * @param {Scheduler} [scheduler=null] The Scheduler to use for managing * concurrency of input Observables. * @return {Observable} an Observable that emits items that are the result of * every input Observable. * @static true * @name merge * @owner Observable */ function mergeStatic() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } var concurrent = Number.POSITIVE_INFINITY; var scheduler = null; 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 (scheduler === null && observables.length === 1) { return observables[0]; } return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new mergeAll_1.MergeAllOperator(concurrent)); } exports.mergeStatic = mergeStatic; //# sourceMappingURL=merge.js.map /***/ }, /* 50 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var subscribeToResult_1 = __webpack_require__(3); var OuterSubscriber_1 = __webpack_require__(2); /* tslint:disable:max-line-length */ function mergeMap(project, resultSelector, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } if (typeof resultSelector === 'number') { concurrent = resultSelector; resultSelector = null; } return this.lift(new MergeMapOperator(project, resultSelector, concurrent)); } exports.mergeMap = mergeMap; 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, source) { return source._subscribe(new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent)); }; return MergeMapOperator; }()); exports.MergeMapOperator = MergeMapOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ 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) { this._tryNext(value); } else { this.buffer.push(value); } }; MergeMapSubscriber.prototype._tryNext = function (value) { var result; var index = this.index++; try { result = this.project(value, index); } catch (err) { this.destination.error(err); return; } this.active++; this._innerSub(result, value, index); }; 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, innerSub) { if (this.resultSelector) { this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex); } else { this.destination.next(innerValue); } }; MergeMapSubscriber.prototype._notifyResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) { var result; try { result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; 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; //# sourceMappingURL=mergeMap.js.map /***/ }, /* 51 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(2); var subscribeToResult_1 = __webpack_require__(3); /* tslint:disable:max-line-length */ function mergeMapTo(innerObservable, resultSelector, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } if (typeof resultSelector === 'number') { concurrent = resultSelector; resultSelector = null; } return this.lift(new MergeMapToOperator(innerObservable, resultSelector, concurrent)); } exports.mergeMapTo = mergeMapTo; // TODO: Figure out correct signature here: an Operator, R> // needs to implement call(observer: Subscriber): Subscriber> 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, source) { return source._subscribe(new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent)); }; return MergeMapToOperator; }()); exports.MergeMapToOperator = MergeMapToOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ 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, innerSub) { var _a = this, resultSelector = _a.resultSelector, destination = _a.destination; if (resultSelector) { this.trySelectResult(outerValue, innerValue, outerIndex, innerIndex); } else { destination.next(innerValue); } }; MergeMapToSubscriber.prototype.trySelectResult = function (outerValue, innerValue, outerIndex, innerIndex) { var _a = this, resultSelector = _a.resultSelector, destination = _a.destination; var result; try { result = resultSelector(outerValue, innerValue, outerIndex, innerIndex); } catch (err) { destination.error(err); return; } destination.next(result); }; 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; //# sourceMappingURL=mergeMapTo.js.map /***/ }, /* 52 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var FromObservable_1 = __webpack_require__(43); var isArray_1 = __webpack_require__(10); var OuterSubscriber_1 = __webpack_require__(2); var subscribeToResult_1 = __webpack_require__(3); /* tslint:disable:max-line-length */ function onErrorResumeNext() { var nextSources = []; for (var _i = 0; _i < arguments.length; _i++) { nextSources[_i - 0] = arguments[_i]; } if (nextSources.length === 1 && isArray_1.isArray(nextSources[0])) { nextSources = nextSources[0]; } return this.lift(new OnErrorResumeNextOperator(nextSources)); } exports.onErrorResumeNext = onErrorResumeNext; /* tslint:enable:max-line-length */ function onErrorResumeNextStatic() { var nextSources = []; for (var _i = 0; _i < arguments.length; _i++) { nextSources[_i - 0] = arguments[_i]; } var source = null; if (nextSources.length === 1 && isArray_1.isArray(nextSources[0])) { nextSources = nextSources[0]; } source = nextSources.shift(); return new FromObservable_1.FromObservable(source, null).lift(new OnErrorResumeNextOperator(nextSources)); } exports.onErrorResumeNextStatic = onErrorResumeNextStatic; var OnErrorResumeNextOperator = (function () { function OnErrorResumeNextOperator(nextSources) { this.nextSources = nextSources; } OnErrorResumeNextOperator.prototype.call = function (subscriber, source) { return source._subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources)); }; return OnErrorResumeNextOperator; }()); var OnErrorResumeNextSubscriber = (function (_super) { __extends(OnErrorResumeNextSubscriber, _super); function OnErrorResumeNextSubscriber(destination, nextSources) { _super.call(this, destination); this.destination = destination; this.nextSources = nextSources; } OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype._error = function (err) { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype._complete = function () { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () { var next = this.nextSources.shift(); if (next) { this.add(subscribeToResult_1.subscribeToResult(this, next)); } else { this.destination.complete(); } }; return OnErrorResumeNextSubscriber; }(OuterSubscriber_1.OuterSubscriber)); //# sourceMappingURL=onErrorResumeNext.js.map /***/ }, /* 53 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var isArray_1 = __webpack_require__(10); var ArrayObservable_1 = __webpack_require__(11); var OuterSubscriber_1 = __webpack_require__(2); var subscribeToResult_1 = __webpack_require__(3); /* tslint:disable:max-line-length */ function race() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } // if the only argument is an array, it was most likely called with // `pair([obs1, obs2, ...])` if (observables.length === 1 && isArray_1.isArray(observables[0])) { observables = observables[0]; } return this.lift.call(raceStatic.apply(void 0, [this].concat(observables))); } exports.race = race; function raceStatic() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i - 0] = arguments[_i]; } // if the only argument is an array, it was most likely called with // `pair([obs1, obs2, ...])` if (observables.length === 1) { if (isArray_1.isArray(observables[0])) { observables = observables[0]; } else { return observables[0]; } } return new ArrayObservable_1.ArrayObservable(observables).lift(new RaceOperator()); } exports.raceStatic = raceStatic; var RaceOperator = (function () { function RaceOperator() { } RaceOperator.prototype.call = function (subscriber, source) { return source._subscribe(new RaceSubscriber(subscriber)); }; return RaceOperator; }()); exports.RaceOperator = RaceOperator; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var RaceSubscriber = (function (_super) { __extends(RaceSubscriber, _super); function RaceSubscriber(destination) { _super.call(this, destination); this.hasFirst = false; this.observables = []; this.subscriptions = []; } RaceSubscriber.prototype._next = function (observable) { this.observables.push(observable); }; RaceSubscriber.prototype._complete = function () { var observables = this.observables; var len = observables.length; if (len === 0) { this.destination.complete(); } else { for (var i = 0; i < len; i++) { var observable = observables[i]; var subscription = subscribeToResult_1.subscribeToResult(this, observable, observable, i); if (this.subscriptions) { this.subscriptions.push(subscription); this.add(subscription); } } this.observables = null; } }; RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { if (!this.hasFirst) { this.hasFirst = true; for (var i = 0; i < this.subscriptions.length; i++) { if (i !== outerIndex) { var subscription = this.subscriptions[i]; subscription.unsubscribe(); this.remove(subscription); } } this.subscriptions = null; } this.destination.next(innerValue); }; return RaceSubscriber; }(OuterSubscriber_1.OuterSubscriber)); exports.RaceSubscriber = RaceSubscriber; //# sourceMappingURL=race.js.map /***/ }, /* 54 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); var async_1 = __webpack_require__(9); /** * @param scheduler * @return {Observable>|WebSocketSubject|Observable} * @method timeInterval * @owner Observable */ function timeInterval(scheduler) { if (scheduler === void 0) { scheduler = async_1.async; } return this.lift(new TimeIntervalOperator(scheduler)); } exports.timeInterval = timeInterval; var TimeInterval = (function () { function TimeInterval(value, interval) { this.value = value; this.interval = interval; } return TimeInterval; }()); exports.TimeInterval = TimeInterval; ; var TimeIntervalOperator = (function () { function TimeIntervalOperator(scheduler) { this.scheduler = scheduler; } TimeIntervalOperator.prototype.call = function (observer, source) { return source._subscribe(new TimeIntervalSubscriber(observer, this.scheduler)); }; return TimeIntervalOperator; }()); /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var TimeIntervalSubscriber = (function (_super) { __extends(TimeIntervalSubscriber, _super); function TimeIntervalSubscriber(destination, scheduler) { _super.call(this, destination); this.scheduler = scheduler; this.lastTime = 0; this.lastTime = scheduler.now(); } TimeIntervalSubscriber.prototype._next = function (value) { var now = this.scheduler.now(); var span = now - this.lastTime; this.lastTime = now; this.destination.next(new TimeInterval(value, span)); }; return TimeIntervalSubscriber; }(Subscriber_1.Subscriber)); //# sourceMappingURL=timeInterval.js.map /***/ }, /* 55 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) 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 = __webpack_require__(1); var async_1 = __webpack_require__(9); /** * @param scheduler * @return {Observable>|WebSocketSubject|Observable} * @method timestamp * @owner Observable */ function timestamp(scheduler) { if (scheduler === void 0) { scheduler = async_1.async; } return this.lift(new TimestampOperator(scheduler)); } exports.timestamp = timestamp; var Timestamp = (function () { function Timestamp(value, timestamp) { this.value = value; this.timestamp = timestamp; } return Timestamp; }()); exports.Timestamp = Timestamp; ; var TimestampOperator = (function () { function TimestampOperator(scheduler) { this.scheduler = scheduler; } TimestampOperator.prototype.call = function (observer, source) { return source._subscribe(new TimestampSubscriber(observer, this.scheduler)); }; return TimestampOperator; }()); var TimestampSubscriber = (function (_super) { __extends(TimestampSubscriber, _super); function TimestampSubscriber(destination, scheduler) { _super.call(this, destination); this.scheduler = scheduler; } TimestampSubscriber.prototype._next = function (value) { var now = this.scheduler.now(); this.destination.next(new Timestamp(value, now)); }; return TimestampSubscriber; }(Subscriber_1.Subscriber)); //# sourceMappingURL=timestamp.js.map /***/ }, /* 56 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var AsyncAction_1 = __webpack_require__(16); var AsyncScheduler_1 = __webpack_require__(17); var VirtualTimeScheduler = (function (_super) { __extends(VirtualTimeScheduler, _super); function VirtualTimeScheduler(SchedulerAction, maxFrames) { var _this = this; if (SchedulerAction === void 0) { SchedulerAction = VirtualAction; } if (maxFrames === void 0) { maxFrames = Number.POSITIVE_INFINITY; } _super.call(this, SchedulerAction, function () { return _this.frame; }); this.maxFrames = maxFrames; this.frame = 0; this.index = -1; } /** * Prompt the Scheduler to execute all of its queued actions, therefore * clearing its queue. * @return {void} */ VirtualTimeScheduler.prototype.flush = function () { var _a = this, actions = _a.actions, maxFrames = _a.maxFrames; var error, action; while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) { if (error = action.execute(action.state, action.delay)) { break; } } if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } }; VirtualTimeScheduler.frameTimeFactor = 10; return VirtualTimeScheduler; }(AsyncScheduler_1.AsyncScheduler)); exports.VirtualTimeScheduler = VirtualTimeScheduler; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var VirtualAction = (function (_super) { __extends(VirtualAction, _super); function VirtualAction(scheduler, work, index) { if (index === void 0) { index = scheduler.index += 1; } _super.call(this, scheduler, work); this.scheduler = scheduler; this.work = work; this.index = index; this.index = scheduler.index = index; } VirtualAction.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } return !this.id ? _super.prototype.schedule.call(this, state, delay) : this.add(new VirtualAction(this.scheduler, this.work)).schedule(state, delay); }; VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } this.delay = scheduler.frame + delay; var actions = scheduler.actions; actions.push(this); actions.sort(VirtualAction.sortActions); return true; }; VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } return undefined; }; VirtualAction.sortActions = function (a, b) { if (a.delay === b.delay) { if (a.index === b.index) { return 0; } else if (a.index > b.index) { return 1; } else { return -1; } } else if (a.delay > b.delay) { return 1; } else { return -1; } }; return VirtualAction; }(AsyncAction_1.AsyncAction)); exports.VirtualAction = VirtualAction; //# sourceMappingURL=VirtualTimeScheduler.js.map /***/ }, /* 57 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var AsapAction_1 = __webpack_require__(327); var AsapScheduler_1 = __webpack_require__(328); exports.asap = new AsapScheduler_1.AsapScheduler(AsapAction_1.AsapAction); //# sourceMappingURL=asap.js.map /***/ }, /* 58 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var QueueAction_1 = __webpack_require__(329); var QueueScheduler_1 = __webpack_require__(330); exports.queue = new QueueScheduler_1.QueueScheduler(QueueAction_1.QueueAction); //# sourceMappingURL=queue.js.map /***/ }, /* 59 */ /***/ function(module, exports) { "use strict"; "use strict"; var SubscriptionLog = (function () { function SubscriptionLog(subscribedFrame, unsubscribedFrame) { if (unsubscribedFrame === void 0) { unsubscribedFrame = Number.POSITIVE_INFINITY; } this.subscribedFrame = subscribedFrame; this.unsubscribedFrame = unsubscribedFrame; } return SubscriptionLog; }()); exports.SubscriptionLog = SubscriptionLog; //# sourceMappingURL=SubscriptionLog.js.map /***/ }, /* 60 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var SubscriptionLog_1 = __webpack_require__(59); var SubscriptionLoggable = (function () { function SubscriptionLoggable() { this.subscriptions = []; } SubscriptionLoggable.prototype.logSubscribedFrame = function () { this.subscriptions.push(new SubscriptionLog_1.SubscriptionLog(this.scheduler.now())); return this.subscriptions.length - 1; }; SubscriptionLoggable.prototype.logUnsubscribedFrame = function (index) { var subscriptionLogs = this.subscriptions; var oldSubscriptionLog = subscriptionLogs[index]; subscriptionLogs[index] = new SubscriptionLog_1.SubscriptionLog(oldSubscriptionLog.subscribedFrame, this.scheduler.now()); }; return SubscriptionLoggable; }()); exports.SubscriptionLoggable = SubscriptionLoggable; //# sourceMappingURL=SubscriptionLoggable.js.map /***/ }, /* 61 */ /***/ function(module, exports) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /** * An error thrown when duetime elapses. * * @see {@link timeout} * * @class TimeoutError */ var TimeoutError = (function (_super) { __extends(TimeoutError, _super); function TimeoutError() { var err = _super.call(this, 'Timeout has occurred'); this.name = err.name = 'TimeoutError'; this.stack = err.stack; this.message = err.message; } return TimeoutError; }(Error)); exports.TimeoutError = TimeoutError; //# sourceMappingURL=TimeoutError.js.map /***/ }, /* 62 */ /***/ function(module, exports) { "use strict"; "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; /** * An error thrown when one or more errors have occurred during the * `unsubscribe` of a {@link Subscription}. */ var UnsubscriptionError = (function (_super) { __extends(UnsubscriptionError, _super); function UnsubscriptionError(errors) { _super.call(this); this.errors = errors; var err = Error.call(this, errors ? errors.length + " errors occurred during unsubscription:\n " + errors.map(function (err, i) { return ((i + 1) + ") " + err.toString()); }).join('\n ') : ''); this.name = err.name = 'UnsubscriptionError'; this.stack = err.stack; this.message = err.message; } return UnsubscriptionError; }(Error)); exports.UnsubscriptionError = UnsubscriptionError; //# sourceMappingURL=UnsubscriptionError.js.map /***/ }, /* 63 */ /***/ function(module, exports) { "use strict"; "use strict"; function applyMixins(derivedCtor, baseCtors) { for (var i = 0, len = baseCtors.length; i < len; i++) { var baseCtor = baseCtors[i]; var propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype); for (var j = 0, len2 = propertyKeys.length; j < len2; j++) { var name_1 = propertyKeys[j]; derivedCtor.prototype[name_1] = baseCtor.prototype[name_1]; } } } exports.applyMixins = applyMixins; //# sourceMappingURL=applyMixins.js.map /***/ }, /* 64 */ /***/ function(module, exports) { "use strict"; "use strict"; function isPromise(value) { return value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; } exports.isPromise = isPromise; //# sourceMappingURL=isPromise.js.map /***/ }, /* 65 */ /***/ function(module, exports) { "use strict"; "use strict"; /* tslint:disable:no-empty */ function noop() { } exports.noop = noop; //# sourceMappingURL=noop.js.map /***/ }, /* 66 */ /***/ function(module, exports, __webpack_require__) { /*! * in-view 0.6.0 - Get notified when a DOM element enters or exits the viewport. * Copyright (c) 2016 Cam Wiegert - https://camwiegert.github.io/in-view * License: MIT */ !function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.inView=e():t.inView=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),o=r(i);t.exports=o["default"]},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),o=r(i),u=n(3),f=r(u),s=n(4),c=function(){if("undefined"!=typeof window){var t=100,e=["scroll","resize","load"],n={history:[]},r={offset:{},threshold:0,test:s.inViewport},i=(0,o["default"])(function(){n.history.forEach(function(t){n[t].check()})},t);e.forEach(function(t){return addEventListener(t,i)}),window.MutationObserver&&new MutationObserver(i).observe(document.body,{attributes:!0,childList:!0,subtree:!0});var u=function(t){if("string"==typeof t){var e=[].slice.call(document.querySelectorAll(t));return n.history.indexOf(t)>-1?n[t].elements=e:(n[t]=(0,f["default"])(e,r),n.history.push(t)),n[t]}};return u.offset=function(t){if(void 0===t)return r.offset;var e=function(t){return"number"==typeof t};return["top","right","bottom","left"].forEach(e(t)?function(e){return r.offset[e]=t}:function(n){return e(t[n])?r.offset[n]=t[n]:null}),r.offset},u.threshold=function(t){return"number"==typeof t&&t>=0&&t<=1?r.threshold=t:r.threshold},u.test=function(t){return"function"==typeof t?r.test=t:r.test},u.is=function(t){return r.test(t,r)},u.offset(0),u}};e["default"]=c()},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n-1,o=n&&!i,u=!n&&i;o&&(t.current.push(e),t.emit("enter",e)),u&&(t.current.splice(r,1),t.emit("exit",e))}),this}},{key:"on",value:function(t,e){return this.handlers[t].push(e),this}},{key:"once",value:function(t,e){return this.singles[t].unshift(e),this}},{key:"emit",value:function(t,e){for(;this.singles[t].length;)this.singles[t].pop()(e);for(var n=this.handlers[t].length;--n>-1;)this.handlers[t][n](e);return this}}]),t}();e["default"]=function(t,e){return new i(t,e)}},function(t,e){"use strict";function n(t,e){var n=t.getBoundingClientRect(),r=n.top,i=n.right,o=n.bottom,u=n.left,f=n.width,s=n.height,c={t:o,r:window.innerWidth-u,b:window.innerHeight-r,l:i},a={x:e.threshold*f,y:e.threshold*s};return c.t>e.offset.top+a.y&&c.r>e.offset.right+a.x&&c.b>e.offset.bottom+a.y&&c.l>e.offset.left+a.x}Object.defineProperty(e,"__esModule",{value:!0}),e.inViewport=n},function(t,e){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,function(){return this}())},function(t,e,n){var r=n(5),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){function r(t,e,n){function r(e){var n=x,r=m;return x=m=void 0,E=e,w=t.apply(r,n)}function a(t){return E=t,j=setTimeout(h,e),_?r(t):w}function l(t){var n=t-O,r=t-E,i=e-n;return M?c(i,g-r):i}function d(t){var n=t-O,r=t-E;return void 0===O||n>=e||n<0||M&&r>=g}function h(){var t=o();return d(t)?p(t):void(j=setTimeout(h,l(t)))}function p(t){return j=void 0,T&&x?r(t):(x=m=void 0,w)}function v(){void 0!==j&&clearTimeout(j),E=0,x=O=m=j=void 0}function y(){return void 0===j?w:p(o())}function b(){var t=o(),n=d(t);if(x=arguments,m=this,O=t,n){if(void 0===j)return a(O);if(M)return j=setTimeout(h,e),r(O)}return void 0===j&&(j=setTimeout(h,e)),w}var x,m,g,w,j,O,E=0,_=!1,M=!1,T=!0;if("function"!=typeof t)throw new TypeError(f);return e=u(e)||0,i(n)&&(_=!!n.leading,M="maxWait"in n,g=M?s(u(n.maxWait)||0,e):g,T="trailing"in n?!!n.trailing:T),b.cancel=v,b.flush=y,b}var i=n(1),o=n(8),u=n(10),f="Expected a function",s=Math.max,c=Math.min;t.exports=r},function(t,e,n){var r=n(6),i=function(){return r.Date.now()};t.exports=i},function(t,e,n){function r(t,e,n){var r=!0,f=!0;if("function"!=typeof t)throw new TypeError(u);return o(n)&&(r="leading"in n?!!n.leading:r,f="trailing"in n?!!n.trailing:f),i(t,e,{leading:r,maxWait:e,trailing:f})}var i=n(7),o=n(1),u="Expected a function";t.exports=r},function(t,e){function n(t){return t}t.exports=n}])}); /***/ }, /* 67 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; /* 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 = __webpack_require__(5); exports.Subject = Subject_1.Subject; exports.AnonymousSubject = Subject_1.AnonymousSubject; /* tslint:enable:no-unused-variable */ var Observable_1 = __webpack_require__(0); exports.Observable = Observable_1.Observable; // statics /* tslint:disable:no-use-before-declare */ __webpack_require__(72); __webpack_require__(73); __webpack_require__(74); __webpack_require__(75); __webpack_require__(76); __webpack_require__(79); __webpack_require__(80); __webpack_require__(81); __webpack_require__(82); __webpack_require__(83); __webpack_require__(84); __webpack_require__(85); __webpack_require__(86); __webpack_require__(87); __webpack_require__(88); __webpack_require__(93); __webpack_require__(89); __webpack_require__(90); __webpack_require__(91); __webpack_require__(92); __webpack_require__(94); __webpack_require__(97); __webpack_require__(95); __webpack_require__(96); __webpack_require__(98); //dom __webpack_require__(77); __webpack_require__(78); //operators __webpack_require__(101); __webpack_require__(102); __webpack_require__(103); __webpack_require__(104); __webpack_require__(105); __webpack_require__(106); __webpack_require__(107); __webpack_require__(108); __webpack_require__(109); __webpack_require__(110); __webpack_require__(111); __webpack_require__(112); __webpack_require__(113); __webpack_require__(119); __webpack_require__(114); __webpack_require__(115); __webpack_require__(116); __webpack_require__(117); __webpack_require__(118); __webpack_require__(120); __webpack_require__(121); __webpack_require__(122); __webpack_require__(123); __webpack_require__(126); __webpack_require__(127); __webpack_require__(128); __webpack_require__(124); __webpack_require__(129); __webpack_require__(130); __webpack_require__(131); __webpack_require__(132); __webpack_require__(133); __webpack_require__(134); __webpack_require__(135); __webpack_require__(136); __webpack_require__(99); __webpack_require__(100); __webpack_require__(137); __webpack_require__(138); __webpack_require__(125); __webpack_require__(139); __webpack_require__(140); __webpack_require__(141); __webpack_require__(142); __webpack_require__(143); __webpack_require__(144); __webpack_require__(145); __webpack_require__(146); __webpack_require__(147); __webpack_require__(148); __webpack_require__(149); __webpack_require__(150); __webpack_require__(151); __webpack_require__(152); __webpack_require__(153); __webpack_require__(154); __webpack_require__(155); __webpack_require__(156); __webpack_require__(158); __webpack_require__(157); __webpack_require__(159); __webpack_require__(160); __webpack_require__(161); __webpack_require__(162); __webpack_require__(163); __webpack_require__(164); __webpack_require__(165); __webpack_require__(166); __webpack_require__(167); __webpack_require__(168); __webpack_require__(169); __webpack_require__(170); __webpack_require__(171); __webpack_require__(172); __webpack_require__(173); __webpack_require__(174); __webpack_require__(175); __webpack_require__(176); __webpack_require__(177); __webpack_require__(178); __webpack_require__(179); __webpack_require__(180); __webpack_require__(181); __webpack_require__(182); __webpack_require__(183); __webpack_require__(184); __webpack_require__(185); __webpack_require__(186); __webpack_require__(187); __webpack_require__(188); __webpack_require__(189); __webpack_require__(190); __webpack_require__(191); __webpack_require__(192); __webpack_require__(193); __webpack_require__(194); __webpack_require__(195); __webpack_require__(196); __webpack_require__(197); __webpack_require__(198); /* tslint:disable:no-unused-variable */ var Subscription_1 = __webpack_require__(4); exports.Subscription = Subscription_1.Subscription; var Subscriber_1 = __webpack_require__(1); exports.Subscriber = Subscriber_1.Subscriber; var AsyncSubject_1 = __webpack_require__(20); exports.AsyncSubject = AsyncSubject_1.AsyncSubject; var ReplaySubject_1 = __webpack_require__(28); exports.ReplaySubject = ReplaySubject_1.ReplaySubject; var BehaviorSubject_1 = __webpack_require__(39); exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject; var ConnectableObservable_1 = __webpack_require__(42); exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable; var Notification_1 = __webpack_require__(15); exports.Notification = Notification_1.Notification; var EmptyError_1 = __webpack_require__(25); exports.EmptyError = EmptyError_1.EmptyError; var ArgumentOutOfRangeError_1 = __webpack_require__(24); exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError; var ObjectUnsubscribedError_1 = __webpack_require__(26); exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError; var TimeoutError_1 = __webpack_require__(61); exports.TimeoutError = TimeoutError_1.TimeoutError; var UnsubscriptionError_1 = __webpack_require__(62); exports.UnsubscriptionError = UnsubscriptionError_1.UnsubscriptionError; var timeInterval_1 = __webpack_require__(54); exports.TimeInterval = timeInterval_1.TimeInterval; var timestamp_1 = __webpack_require__(55); exports.Timestamp = timestamp_1.Timestamp; var TestScheduler_1 = __webpack_require__(334); exports.TestScheduler = TestScheduler_1.TestScheduler; var VirtualTimeScheduler_1 = __webpack_require__(56); exports.VirtualTimeScheduler = VirtualTimeScheduler_1.VirtualTimeScheduler; var AjaxObservable_1 = __webpack_require__(45); exports.AjaxResponse = AjaxObservable_1.AjaxResponse; exports.AjaxError = AjaxObservable_1.AjaxError; exports.AjaxTimeoutError = AjaxObservable_1.AjaxTimeoutError; var asap_1 = __webpack_require__(57); var async_1 = __webpack_require__(9); var queue_1 = __webpack_require__(58); var animationFrame_1 = __webpack_require__(331); var rxSubscriber_1 = __webpack_require__(23); var iterator_1 = __webpack_require__(18); var observable_1 = __webpack_require__(22); /* tslint:enable:no-unused-variable */ /** * @typedef {Object} Rx.Scheduler * @property {Scheduler} queue Schedules on a queue in the current event frame * (trampoline scheduler). Use this for iteration operations. * @property {Scheduler} asap Schedules on the micro task queue, which uses the * fastest transport mechanism available, either Node.js' `process.nextTick()` * or Web Worker MessageChannel or setTimeout or others. Use this for * asynchronous conversions. * @property {Scheduler} async Schedules work with `setInterval`. Use this for * time-based operations. * @property {Scheduler} animationFrame Schedules work with `requestAnimationFrame`. * Use this for synchronizing with the platform's painting */ var Scheduler = { asap: asap_1.asap, queue: queue_1.queue, animationFrame: animationFrame_1.animationFrame, async: async_1.async }; exports.Scheduler = Scheduler; /** * @typedef {Object} Rx.Symbol * @property {Symbol|string} rxSubscriber A symbol to use as a property name to * retrieve 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). * @property {Symbol|string} observable A symbol to use as a property name to * retrieve an Observable as defined by the [ECMAScript "Observable" spec](https://github.com/zenparsing/es-observable). * @property {Symbol|string} iterator The ES6 symbol to use as a property name * to retrieve an iterator from an object. */ var Symbol = { rxSubscriber: rxSubscriber_1.$$rxSubscriber, observable: observable_1.$$observable, iterator: iterator_1.$$iterator }; exports.Symbol = Symbol; //# sourceMappingURL=Rx.js.map /***/ }, /* 68 */ /***/ function(module, exports, __webpack_require__) { "use strict"; "use strict"; var _ = __webpack_require__(345); var Q = __webpack_require__(69); var Http = (function () { function Http(options) { this.options = options; } Http.prototype.request = function (requestOptions) { var options = _.extend({}, this.options, requestOptions); var deferred = Q.defer(); var onreadystatechange = options.onreadystatechange, onerror = options.onerror, onabort = options.onabort, ontimeout = options.ontimeout; options.synchronous = true; // async options.onreadystatechange = function (response) { _.isFunction(onreadystatechange) && onreadystatechange.call(this, response); if (response.readyState !== 4) return; if (/^(2|3)/.test(response.status + '') || response.finalUrl) { deferred.resolve(response); } else { deferred.reject(response); } }; options.onerror = function (response) { _.isFunction(onerror) && onerror.call(this, response); deferred.reject(response); }; options.onabort = function (response) { _.isFunction(onabort) && onabort.call(this, response); deferred.reject(response); }; options.ontimeout = function (response) { _.isFunction(ontimeout) && ontimeout.call(this, response); deferred.reject(response); }; var distOptions = _.extend({}, options); GM_xmlhttpRequest(distOptions); return deferred.promise; }; Http.prototype.get = function (url, options) { var requestOptions = _.extend(options || {}, { url: url, method: 'GET' }); return this.request(requestOptions); }; Http.prototype.post = function (url, data, options) { return this.request(_.extend(options || {}, { url: url, method: 'POST', data: data })); }; Http.prototype.head = function (url, options) { return this.request(_.extend(options || {}, { url: url, method: 'HEAD' })); }; return Http; }()); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Http; /***/ }, /* 69 */ /***/ function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process, setImmediate) {// vim:ts=4:sts=4:sw=4: /*! * * Copyright 2009-2012 Kris Kowal under the terms of the MIT * license found at http://github.com/kriskowal/q/raw/master/LICENSE * * With parts by Tyler Close * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found * at http://www.opensource.org/licenses/mit-license.html * Forked at ref_send.js version: 2009-05-11 * * With parts by Mark Miller * Copyright (C) 2011 Google 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. * */ (function (definition) { "use strict"; // This file will function properly as a