UNPKG

ngx-tree-select

Version:

Angular component for select with tree items.

1 lines 208 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/forms","@angular/common"],e):e(t.ngxTreeSelect={},t.ng.core,t.ng.forms,t.ng.common)}(this,function(t,e,r,n){"use strict";function i(t,e){return e={exports:{}},t(e,e.exports),e.exports}function o(){try{return nt.apply(this,arguments)}catch(t){return ut.errorObject.e=t,ut.errorObject}}function s(t){return t.reduce(function(t,e){return t.concat(e instanceof ht.UnsubscriptionError?e.errors:e)},[])}function c(t){return t?1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}:_t.noop}function u(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function a(t){var e=t.err;t.subject.error(e)}function l(t){var e=this,r=t.source,n=t.subscriber,i=t.context,o=r,s=o.callbackFunc,c=o.args,u=o.scheduler,a=r.subject;if(!a){a=r.subject=new Rt.AsyncSubject;var l=function t(){for(var r=[],n=0;n<arguments.length;n++)r[n-0]=arguments[n];var i=t.source,o=i.selector,s=i.subject,c=r.shift();if(c)e.add(u.schedule(p,0,{err:c,subject:s}));else if(o){var a=at.tryCatch(o).apply(this,r);a===ut.errorObject?e.add(u.schedule(p,0,{err:ut.errorObject.e,subject:s})):e.add(u.schedule(h,0,{value:a,subject:s}))}else{var l=r.length<=1?r[0]:r;e.add(u.schedule(h,0,{value:l,subject:s}))}};l.source=r,at.tryCatch(s).apply(i,c.concat(l))===ut.errorObject&&e.add(u.schedule(p,0,{err:ut.errorObject.e,subject:a}))}e.add(a.subscribe(n))}function h(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function p(t){var e=t.err;t.subject.error(e)}function f(t){var e=t.value,r=t.subscriber;r.closed||(r.next(e),r.complete())}function b(t){var e=t.err,r=t.subscriber;r.closed||r.error(e)}function d(t){var e=t[Zt.iterator];if(!e&&"string"==typeof t)return new de(t);if(!e&&void 0!==t.length)return new ye(t);if(!e)throw new TypeError("object is not iterable");return t[Zt.iterator]()}function y(t){var e=+t.length;return isNaN(e)?0:0!==e&&v(e)?(e=m(e)*Math.floor(Math.abs(e)))<=0?0:e>ve?ve:e:e}function v(t){return"number"==typeof t&&it.root.isFinite(t)}function m(t){var e=+t;return 0===e?e:isNaN(e)?e:e<0?-1:1}function w(t){return!!t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}function x(t){return!!t&&"function"==typeof t.on&&"function"==typeof t.off}function g(t){return!!t&&"[object NodeList]"===Ke.call(t)}function _(t){return!!t&&"[object HTMLCollection]"===Ke.call(t)}function O(t){return!!t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}function S(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return Bt.isScheduler(i)?(n=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(r=t.pop())):"number"==typeof i&&(r=t.pop()),null===n&&1===t.length&&t[0]instanceof St.Observable?t[0]:Le.mergeAll(r)(new $t.ArrayObservable(t,n))}function j(t){var e=t.obj,r=t.keys,n=t.length,i=t.index,o=t.subscriber;if(i!==n){var s=r[i];o.next([s,e[s]]),t.index=i+1,this.schedule(t)}else o.complete()}function T(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=t[t.length-1];return"function"==typeof r&&t.pop(),new $t.ArrayObservable(t).lift(new Jr(r))}function C(){if(it.root.XMLHttpRequest)return new it.root.XMLHttpRequest;if(it.root.XDomainRequest)return new it.root.XDomainRequest;throw new Error("CORS is not supported by your browser")}function I(){if(it.root.XMLHttpRequest)return new it.root.XMLHttpRequest;var t=void 0;try{for(var e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;r<3;r++)try{if(t=e[r],new it.root.ActiveXObject(t))break}catch(t){}return new it.root.ActiveXObject(t)}catch(t){throw new Error("XMLHttpRequest is not supported by your browser")}}function P(t,e){return void 0===e&&(e=null),new wn({method:"GET",url:t,headers:e})}function E(t,e,r){return new wn({method:"POST",url:t,body:e,headers:r})}function N(t,e){return new wn({method:"DELETE",url:t,headers:e})}function k(t,e,r){return new wn({method:"PUT",url:t,body:e,headers:r})}function A(t,e,r){return new wn({method:"PATCH",url:t,body:e,headers:r})}function F(t,e){return vn(new wn({method:"GET",url:t,responseType:"json",headers:e}))}function V(t,e){switch(t){case"json":return"response"in e?e.responseType?e.response:JSON.parse(e.response||e.responseText||"null"):JSON.parse(e.responseText||"null");case"xml":return e.responseXML;case"text":default:return"response"in e?e.response:e.responseText}}function M(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var n=e.length,i=0;i<n;i++){var o=e[i];for(var s in o)o.hasOwnProperty(s)&&(t[s]=o[s])}return t}function R(t){return t.Object.assign||M}function L(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function W(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,o=n.openContext(),s=this;n.closed||(n.add(o.closeAction=i.schedule(q,r,{subscriber:n,context:o})),s.schedule(t,e))}function q(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function z(t){t.debouncedNext()}function B(){return function(){function t(){this._values=[]}return t.prototype.add=function(t){this.has(t)||this._values.push(t)},t.prototype.has=function(t){return-1!==this._values.indexOf(t)},Object.defineProperty(t.prototype,"size",{get:function(){return this._values.length},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this._values.length=0},t}()}function U(t,e){return function(r){for(var n=r,i=0;i<e;i++){var o=n[t[i]];if(void 0===o)return;n=o}return n}}function D(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function Y(){return new Vt.Subject}function H(t,e,r){var n,i,o=0,s=!1,c=!1;return function(u){o++,n&&!s||(s=!1,n=new Mn.ReplaySubject(t,e,r),i=u.subscribe({next:function(t){n.next(t)},error:function(t){s=!0,n.error(t)},complete:function(){c=!0,n.complete()}}));var a=n.subscribe(this);return function(){o--,a.unsubscribe(),i&&0===o&&c&&i.unsubscribe()}}}function X(t){t.subscriber.clearThrottle()}function $(t,e,r){return t.push(e),t}function G(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function J(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,o=this,s={action:o,subscription:null},c={subscriber:r,window:r.openWindow(),context:s};s.subscription=n.schedule(K,e,c),o.add(s.subscription),o.schedule(t,i)}function K(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}var Q="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z="undefined"!=typeof window&&window,tt="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,et=Z||void 0!==Q&&Q||tt,rt=et;!function(){if(!et)throw new Error("RxJS could not find any global context (window, self, global)")}();var nt,it={root:rt},ot={isFunction:function(t){return"function"==typeof t}},st={isArray:Array.isArray||function(t){return t&&"number"==typeof t.length}},ct={isObject:function(t){return null!=t&&"object"==typeof t}},ut={errorObject:{e:{}}},at={tryCatch:function(t){return nt=t,o}},lt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},ht={UnsubscriptionError:function(t){function e(e){t.call(this),this.errors=e;var r=Error.call(this,e?e.length+" errors occurred during unsubscription:\n "+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return lt(e,t),e}(Error)},pt={Subscription:function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var r=this,n=r._parent,i=r._parents,o=r._unsubscribe,c=r._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var u=-1,a=i?i.length:0;n;)n.remove(this),n=++u<a&&i[u]||null;if(ot.isFunction(o)&&(h=at.tryCatch(o).call(this))===ut.errorObject&&(e=!0,t=t||(ut.errorObject.e instanceof ht.UnsubscriptionError?s(ut.errorObject.e.errors):[ut.errorObject.e])),st.isArray(c))for(u=-1,a=c.length;++u<a;){var l=c[u];if(ct.isObject(l)){var h=at.tryCatch(l.unsubscribe).call(l);if(h===ut.errorObject){e=!0,t=t||[];var p=ut.errorObject.e;p instanceof ht.UnsubscriptionError?t=t.concat(s(p.errors)):t.push(p)}}}if(e)throw new ht.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var r=e;switch(typeof e){case"function":r=new t(e);case"object":if(r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if("function"!=typeof r._addParent){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(r),r._addParent(this),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.prototype._addParent=function(t){var e=this,r=e._parent,n=e._parents;r&&r!==t?n?-1===n.indexOf(t)&&n.push(t):this._parents=[t]:this._parent=t},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}()},ft={empty:{closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}},bt=i(function(t,e){var r=it.root.Symbol;e.rxSubscriber="function"==typeof r&&"function"==typeof r.for?r.for("rxSubscriber"):"@@rxSubscriber",e.$$rxSubscriber=e.rxSubscriber}),dt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},yt=function(t){function e(r,n,i){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=ft.empty;break;case 1:if(!r){this.destination=ft.empty;break}if("object"==typeof r){r instanceof e?(this.destination=r,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new mt(this,r));break}default:this.syncErrorThrowable=!0,this.destination=new mt(this,r,n,i)}}return dt(e,t),e.prototype[bt.rxSubscriber]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this,e=t._parent,r=t._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=r,this},e}(pt.Subscription),vt=yt,mt=function(t){function e(e,r,n,i){t.call(this),this._parentSubscriber=e;var o,s=this;ot.isFunction(r)?o=r:r&&(o=r.next,n=r.error,i=r.complete,r!==ft.empty&&(s=Object.create(r),ot.isFunction(s.unsubscribe)&&this.add(s.unsubscribe.bind(s)),s.unsubscribe=this.unsubscribe.bind(this))),this._context=s,this._next=o,this._error=n,this._complete=i}return dt(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(yt),wt={Subscriber:vt},xt={toSubscriber:function(t,e,r){if(t){if(t instanceof wt.Subscriber)return t;if(t[bt.rxSubscriber])return t[bt.rxSubscriber]()}return t||e||r?new wt.Subscriber(t,e,r):new wt.Subscriber(ft.empty)}},gt=i(function(t,e){function r(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}e.getSymbolObservable=r,e.observable=r(it.root),e.$$observable=e.observable}),_t={noop:function(){}},Ot={pipe:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return c(t)},pipeFromArray:c},St={Observable:function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n=this.operator,i=xt.toSubscriber(t,e,r);if(n?n.call(i,this.source):i.add(this.source?this._subscribe(i):this._trySubscribe(i)),i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var r=this;if(e||(it.root.Rx&&it.root.Rx.config&&it.root.Rx.config.Promise?e=it.root.Rx.config.Promise:it.root.Promise&&(e=it.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,n){var i;i=r.subscribe(function(e){if(i)try{t(e)}catch(t){n(t),i.unsubscribe()}else t(e)},n,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[gt.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 0===t.length?this:Ot.pipeFromArray(t)(this)},t.prototype.toPromise=function(t){var e=this;if(t||(it.root.Rx&&it.root.Rx.config&&it.root.Rx.config.Promise?t=it.root.Rx.config.Promise:it.root.Promise&&(t=it.root.Promise)),!t)throw new Error("no Promise impl found");return new t(function(t,r){var n;e.subscribe(function(t){return n=t},function(t){return r(t)},function(){return t(n)})})},t.create=function(e){return new t(e)},t}()},jt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Tt={ObjectUnsubscribedError:function(t){function e(){var e=t.call(this,"object unsubscribed");this.name=e.name="ObjectUnsubscribedError",this.stack=e.stack,this.message=e.message}return jt(e,t),e}(Error)},Ct=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},It={SubjectSubscription:function(t){function e(e,r){t.call(this),this.subject=e,this.subscriber=r,this.closed=!1}return Ct(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(pt.Subscription)},Pt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Et=function(t){function e(e){t.call(this,e),this.destination=e}return Pt(e,t),e}(wt.Subscriber),Nt=Et,kt=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return Pt(e,t),e.prototype[bt.rxSubscriber]=function(){return new Et(this)},e.prototype.lift=function(t){var e=new Ft(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new Tt.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new Tt.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Tt.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new Tt.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new Tt.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),pt.Subscription.EMPTY):this.isStopped?(t.complete(),pt.Subscription.EMPTY):(this.observers.push(t),new It.SubjectSubscription(this,t))},e.prototype.asObservable=function(){var t=new St.Observable;return t.source=this,t},e.create=function(t,e){return new Ft(t,e)},e}(St.Observable),At=kt,Ft=function(t){function e(e,r){t.call(this),this.destination=e,this.source=r}return Pt(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):pt.Subscription.EMPTY},e}(kt),Vt={SubjectSubscriber:Nt,Subject:At,AnonymousSubject:Ft},Mt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Rt={AsyncSubject:function(t){function e(){t.apply(this,arguments),this.value=null,this.hasNext=!1,this.hasCompleted=!1}return Mt(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),pt.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),pt.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Vt.Subject)},Lt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Wt={bindCallback:{BoundCallbackObservable:function(t){function e(e,r,n,i,o){t.call(this),this.callbackFunc=e,this.selector=r,this.args=n,this.context=i,this.scheduler=o}return Lt(e,t),e.create=function(t,r,n){return void 0===r&&(r=void 0),function(){for(var i=[],o=0;o<arguments.length;o++)i[o-0]=arguments[o];return new e(t,r,i,this,n)}},e.prototype._subscribe=function(t){var r=this.callbackFunc,n=this.args,i=this.scheduler,o=this.subject;if(i)return i.schedule(e.dispatch,0,{source:this,subscriber:t,context:this.context});if(!o){o=this.subject=new Rt.AsyncSubject;var s=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];var n=t.source,i=n.selector,o=n.subject;if(i){var s=at.tryCatch(i).apply(this,e);s===ut.errorObject?o.error(ut.errorObject.e):(o.next(s),o.complete())}else o.next(e.length<=1?e[0]:e),o.complete()};s.source=this,at.tryCatch(r).apply(this.context,n.concat(s))===ut.errorObject&&o.error(ut.errorObject.e)}return o.subscribe(t)},e.dispatch=function(t){var e=this,r=t.source,n=t.subscriber,i=t.context,o=r.callbackFunc,s=r.args,c=r.scheduler,l=r.subject;if(!l){l=r.subject=new Rt.AsyncSubject;var h=function t(){for(var r=[],n=0;n<arguments.length;n++)r[n-0]=arguments[n];var i=t.source,o=i.selector,s=i.subject;if(o){var l=at.tryCatch(o).apply(this,r);l===ut.errorObject?e.add(c.schedule(a,0,{err:ut.errorObject.e,subject:s})):e.add(c.schedule(u,0,{value:l,subject:s}))}else{var h=r.length<=1?r[0]:r;e.add(c.schedule(u,0,{value:h,subject:s}))}};h.source=r,at.tryCatch(o).apply(i,s.concat(h))===ut.errorObject&&l.error(ut.errorObject.e)}e.add(l.subscribe(n))},e}(St.Observable)}.BoundCallbackObservable.create};St.Observable.bindCallback=Wt.bindCallback;var qt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},zt={bindNodeCallback:{BoundNodeCallbackObservable:function(t){function e(e,r,n,i,o){t.call(this),this.callbackFunc=e,this.selector=r,this.args=n,this.context=i,this.scheduler=o}return qt(e,t),e.create=function(t,r,n){return void 0===r&&(r=void 0),function(){for(var i=[],o=0;o<arguments.length;o++)i[o-0]=arguments[o];return new e(t,r,i,this,n)}},e.prototype._subscribe=function(t){var e=this.callbackFunc,r=this.args,n=this.scheduler,i=this.subject;if(n)return n.schedule(l,0,{source:this,subscriber:t,context:this.context});if(!i){i=this.subject=new Rt.AsyncSubject;var o=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];var n=t.source,i=n.selector,o=n.subject,s=e.shift();if(s)o.error(s);else if(i){var c=at.tryCatch(i).apply(this,e);c===ut.errorObject?o.error(ut.errorObject.e):(o.next(c),o.complete())}else o.next(e.length<=1?e[0]:e),o.complete()};o.source=this,at.tryCatch(e).apply(this.context,r.concat(o))===ut.errorObject&&i.error(ut.errorObject.e)}return i.subscribe(t)},e}(St.Observable)}.BoundNodeCallbackObservable.create};St.Observable.bindNodeCallback=zt.bindNodeCallback;var Bt={isScheduler:function(t){return t&&"function"==typeof t.schedule}},Ut=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Dt={ScalarObservable:function(t){function e(e,r){t.call(this),this.value=e,this.scheduler=r,this._isScalar=!0,r&&(this._isScalar=!1)}return Ut(e,t),e.create=function(t,r){return new e(t,r)},e.dispatch=function(t){var e=t.done,r=t.value,n=t.subscriber;e?n.complete():(n.next(r),n.closed||(t.done=!0,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.value,n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{done:!1,value:r,subscriber:t});t.next(r),t.closed||t.complete()},e}(St.Observable)},Yt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Ht={EmptyObservable:function(t){function e(e){t.call(this),this.scheduler=e}return Yt(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(St.Observable)},Xt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},$t={ArrayObservable:function(t){function e(e,r){t.call(this),this.array=e,this.scheduler=r,r||1!==e.length||(this._isScalar=!0,this.value=e[0])}return Xt(e,t),e.create=function(t,r){return new e(t,r)},e.of=function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];var n=t[t.length-1];Bt.isScheduler(n)?t.pop():n=null;var i=t.length;return i>1?new e(t,n):1===i?new Dt.ScalarObservable(t[0],n):new Ht.EmptyObservable(n)},e.dispatch=function(t){var e=t.array,r=t.index,n=t.count,i=t.subscriber;r>=n?i.complete():(i.next(e[r]),i.closed||(t.index=r+1,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this.array,n=r.length,i=this.scheduler;if(i)return i.schedule(e.dispatch,0,{array:r,index:0,count:n,subscriber:t});for(var o=0;o<n&&!t.closed;o++)t.next(r[o]);t.complete()},e}(St.Observable)},Gt=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Jt={OuterSubscriber:function(t){function e(){t.apply(this,arguments)}return Gt(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(wt.Subscriber)},Kt={isArrayLike:function(t){return t&&"number"==typeof t.length}},Qt={isPromise:function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},Zt=i(function(t,e){function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var r=t.Set;if(r&&"function"==typeof(new r)["@@iterator"])return"@@iterator";var n=t.Map;if(n)for(var i=Object.getOwnPropertyNames(n.prototype),o=0;o<i.length;++o){var s=i[o];if("entries"!==s&&"size"!==s&&n.prototype[s]===n.prototype.entries)return s}return"@@iterator"}e.symbolIteratorPonyfill=r,e.iterator=r(it.root),e.$$iterator=e.iterator}),te=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},ee={InnerSubscriber:function(t){function e(e,r,n){t.call(this),this.parent=e,this.outerValue=r,this.outerIndex=n,this.index=0}return te(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(wt.Subscriber)},re={subscribeToResult:function(t,e,r,n){var i=new ee.InnerSubscriber(t,r,n);if(i.closed)return null;if(e instanceof St.Observable)return e._isScalar?(i.next(e.value),i.complete(),null):(i.syncErrorThrowable=!0,e.subscribe(i));if(Kt.isArrayLike(e)){for(var o=0,s=e.length;o<s&&!i.closed;o++)i.next(e[o]);i.closed||i.complete()}else{if(Qt.isPromise(e))return e.then(function(t){i.closed||(i.next(t),i.complete())},function(t){return i.error(t)}).then(null,function(t){it.root.setTimeout(function(){throw t})}),i;if(e&&"function"==typeof e[Zt.iterator])for(var c=e[Zt.iterator]();;){var u=c.next();if(u.done){i.complete();break}if(i.next(u.value),i.closed)break}else if(e&&"function"==typeof e[gt.observable]){var a=e[gt.observable]();if("function"==typeof a.subscribe)return a.subscribe(new ee.InnerSubscriber(t,r,n));i.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var l="You provided "+(ct.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";i.error(new TypeError(l))}}return null}},ne=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},ie={},oe=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new ce(t,this.project))},t}(),se=oe,ce=function(t){function e(e,r){t.call(this,e),this.project=r,this.active=0,this.values=[],this.observables=[]}return ne(e,t),e.prototype._next=function(t){this.values.push(ie),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var n=t[r];this.add(re.subscribeToResult(this,n,n,r))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,i){var o=this.values,s=o[r],c=this.toRespond?s===ie?--this.toRespond:this.toRespond:0;o[r]=e,0===c&&(this.project?this._tryProject(o):this.destination.next(o.slice()))},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(Jt.OuterSubscriber),ue={combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&st.isArray(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(new $t.ArrayObservable([e].concat(t)),new oe(r))}},CombineLatestOperator:se,CombineLatestSubscriber:ce},ae={combineLatest:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var r=null,n=null;return Bt.isScheduler(t[t.length-1])&&(n=t.pop()),"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&st.isArray(t[0])&&(t=t[0]),new $t.ArrayObservable(t,n).lift(new ue.CombineLatestOperator(r))}};St.Observable.combineLatest=ae.combineLatest;var le={of:$t.ArrayObservable.of},he=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},pe={PromiseObservable:function(t){function e(e,r){t.call(this),this.promise=e,this.scheduler=r}return he(e,t),e.create=function(t,r){return new e(t,r)},e.prototype._subscribe=function(t){var e=this,r=this.promise,n=this.scheduler;if(null==n)this._isScalar?t.closed||(t.next(this.value),t.complete()):r.then(function(r){e.value=r,e._isScalar=!0,t.closed||(t.next(r),t.complete())},function(e){t.closed||t.error(e)}).then(null,function(t){it.root.setTimeout(function(){throw t})});else if(this._isScalar){if(!t.closed)return n.schedule(f,0,{value:this.value,subscriber:t})}else r.then(function(r){e.value=r,e._isScalar=!0,t.closed||t.add(n.schedule(f,0,{value:r,subscriber:t}))},function(e){t.closed||t.add(n.schedule(b,0,{err:e,subscriber:t}))}).then(null,function(t){it.root.setTimeout(function(){throw t})})},e}(St.Observable)},fe=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},be=function(t){function e(e,r){if(t.call(this),this.scheduler=r,null==e)throw new Error("iterator cannot be null.");this.iterator=d(e)}return fe(e,t),e.create=function(t,r){return new e(t,r)},e.dispatch=function(t){var e=t.index,r=t.hasError,n=t.iterator,i=t.subscriber;if(r)i.error(t.error);else{var o=n.next();o.done?i.complete():(i.next(o.value),t.index=e+1,i.closed?"function"==typeof n.return&&n.return():this.schedule(t))}},e.prototype._subscribe=function(t){var r=this,n=r.iterator,i=r.scheduler;if(i)return i.schedule(e.dispatch,0,{index:0,iterator:n,subscriber:t});for(;;){var o=n.next();if(o.done){t.complete();break}if(t.next(o.value),t.closed){"function"==typeof n.return&&n.return();break}}},e}(St.Observable),de=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=t.length),this.str=t,this.idx=e,this.len=r}return t.prototype[Zt.iterator]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},t}(),ye=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=y(t)),this.arr=t,this.idx=e,this.len=r}return t.prototype[Zt.iterator]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},t}(),ve=Math.pow(2,53)-1,me={IteratorObservable:be},we=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},xe={ArrayLikeObservable:function(t){function e(e,r){t.call(this),this.arrayLike=e,this.scheduler=r,r||1!==e.length||(this._isScalar=!0,this.value=e[0])}return we(e,t),e.create=function(t,r){var n=t.length;return 0===n?new Ht.EmptyObservable:1===n?new Dt.ScalarObservable(t[0],r):new e(t,r)},e.dispatch=function(t){var e=t.arrayLike,r=t.index,n=t.length,i=t.subscriber;i.closed||(r>=n?i.complete():(i.next(e[r]),t.index=r+1,this.schedule(t)))},e.prototype._subscribe=function(t){var r=this,n=r.arrayLike,i=r.scheduler,o=n.length;if(i)return i.schedule(e.dispatch,0,{arrayLike:n,index:0,length:o,subscriber:t});for(var s=0;s<o&&!t.closed;s++)t.next(n[s]);t.complete()},e}(St.Observable)},ge={Notification:function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){switch(this.kind){case"N":return St.Observable.of(this.value);case"E":return St.Observable.throw(this.error);case"C":return St.Observable.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}()},_e=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Oe=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new je(t,this.scheduler,this.delay))},t}(),Se=Oe,je=function(t){function e(e,r,n){void 0===n&&(n=0),t.call(this,e),this.scheduler=r,this.delay=n}return _e(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.add(this.scheduler.schedule(e.dispatch,this.delay,new Ce(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(ge.Notification.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(ge.Notification.createError(t))},e.prototype._complete=function(){this.scheduleMessage(ge.Notification.createComplete())},e}(wt.Subscriber),Te=je,Ce=function(){return function(t,e){this.notification=t,this.destination=e}}(),Ie={observeOn:function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new Oe(t,e))}},ObserveOnOperator:Se,ObserveOnSubscriber:Te,ObserveOnMessage:Ce},Pe=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Ee={FromObservable:function(t){function e(e,r){t.call(this,null),this.ish=e,this.scheduler=r}return Pe(e,t),e.create=function(t,r){if(null!=t){if("function"==typeof t[gt.observable])return t instanceof St.Observable&&!r?t:new e(t,r);if(st.isArray(t))return new $t.ArrayObservable(t,r);if(Qt.isPromise(t))return new pe.PromiseObservable(t,r);if("function"==typeof t[Zt.iterator]||"string"==typeof t)return new me.IteratorObservable(t,r);if(Kt.isArrayLike(t))return new xe.ArrayLikeObservable(t,r)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")},e.prototype._subscribe=function(t){var e=this.ish,r=this.scheduler;return null==r?e[gt.observable]().subscribe(t):e[gt.observable]().subscribe(new Ie.ObserveOnSubscriber(t,r,0))},e}(St.Observable)},Ne={from:Ee.FromObservable.create},ke=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Ae=function(){function t(t,e,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=t,this.resultSelector=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new Ve(t,this.project,this.resultSelector,this.concurrent))},t}(),Fe=Ae,Ve=function(t){function e(e,r,n,i){void 0===i&&(i=Number.POSITIVE_INFINITY),t.call(this,e),this.project=r,this.resultSelector=n,this.concurrent=i,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return ke(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e,t,r)},e.prototype._innerSub=function(t,e,r){this.add(re.subscribeToResult(this,t,e,r))},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},e.prototype.notifyNext=function(t,e,r,n,i){this.resultSelector?this._notifyResultSelector(t,e,r,n):this.destination.next(e)},e.prototype._notifyResultSelector=function(t,e,r,n){var i;try{i=this.resultSelector(t,e,r,n)}catch(t){return void this.destination.error(t)}this.destination.next(i)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(Jt.OuterSubscriber),Me={mergeMap:function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(n){return"number"==typeof e&&(r=e,e=null),n.lift(new Ae(t,e,r))}},MergeMapOperator:Fe,MergeMapSubscriber:Ve},Re={identity:function(t){return t}},Le={mergeAll:function(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),Me.mergeMap(Re.identity,null,t)}},We={concatAll:function(){return Le.mergeAll(1)}},qe={concat:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 1===t.length||2===t.length&&Bt.isScheduler(t[1])?Ne.from(t[0]):We.concatAll()(le.of.apply(void 0,t))}};St.Observable.concat=qe.concat;var ze=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Be=function(t){function e(e){t.call(this),this.observableFactory=e}return ze(e,t),e.create=function(t){return new e(t)},e.prototype._subscribe=function(t){return new Ue(t,this.observableFactory)},e}(St.Observable),Ue=function(t){function e(e,r){t.call(this,e),this.factory=r,this.tryDefer()}return ze(e,t),e.prototype.tryDefer=function(){try{this._callFactory()}catch(t){this._error(t)}},e.prototype._callFactory=function(){var t=this.factory();t&&this.add(re.subscribeToResult(this,t))},e}(Jt.OuterSubscriber),De={defer:{DeferObservable:Be}.DeferObservable.create};St.Observable.defer=De.defer;var Ye={empty:Ht.EmptyObservable.create};St.Observable.empty=Ye.empty;var He=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Xe=function(t){function e(e,r){t.call(this),this.sources=e,this.resultSelector=r}return He(e,t),e.create=function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];if(null===t||0===arguments.length)return new Ht.EmptyObservable;var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&st.isArray(t[0])&&(t=t[0]),0===t.length?new Ht.EmptyObservable:new e(t,n)},e.prototype._subscribe=function(t){return new $e(t,this.sources,this.resultSelector)},e}(St.Observable),$e=function(t){function e(e,r,n){t.call(this,e),this.sources=r,this.resultSelector=n,this.completed=0,this.haveValues=0;var i=r.length;this.total=i,this.values=new Array(i);for(var o=0;o<i;o++){var s=r[o],c=re.subscribeToResult(this,s,null,o);c&&(c.outerIndex=o,this.add(c))}}return He(e,t),e.prototype.notifyNext=function(t,e,r,n,i){this.values[r]=e,i._hasValue||(i._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,r=this,n=r.haveValues,i=r.resultSelector,o=r.values,s=o.length;if(t._hasValue){if(this.completed++,this.completed===s){if(n===s){var c=i?i.apply(this,o):o;e.next(c)}e.complete()}}else e.complete()},e}(Jt.OuterSubscriber),Ge={forkJoin:{ForkJoinObservable:Xe}.ForkJoinObservable.create};St.Observable.forkJoin=Ge.forkJoin,St.Observable.from=Ne.from;var Je=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Ke=Object.prototype.toString,Qe={fromEvent:{FromEventObservable:function(t){function e(e,r,n,i){t.call(this),this.sourceObj=e,this.eventName=r,this.selector=n,this.options=i}return Je(e,t),e.create=function(t,r,n,i){return ot.isFunction(n)&&(i=n,n=void 0),new e(t,r,i,n)},e.setupSubscription=function(t,r,n,i,o){var s;if(g(t)||_(t))for(var c=0,u=t.length;c<u;c++)e.setupSubscription(t[c],r,n,i,o);else if(O(t)){var a=t;t.addEventListener(r,n,o),s=function(){return a.removeEventListener(r,n)}}else if(x(t)){var l=t;t.on(r,n),s=function(){return l.off(r,n)}}else{if(!w(t))throw new TypeError("Invalid event target");var h=t;t.addListener(r,n),s=function(){return h.removeListener(r,n)}}i.add(new pt.Subscription(s))},e.prototype._subscribe=function(t){var r=this.sourceObj,n=this.eventName,i=this.options,o=this.selector;e.setupSubscription(r,n,o?function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];var n=at.tryCatch(o).apply(void 0,e);n===ut.errorObject?t.error(ut.errorObject.e):t.next(n)}:function(e){return t.next(e)},t,i)},e}(St.Observable)}.FromEventObservable.create};St.Observable.fromEvent=Qe.fromEvent;var Ze=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},tr={fromEventPattern:{FromEventPatternObservable:function(t){function e(e,r,n){t.call(this),this.addHandler=e,this.removeHandler=r,this.selector=n}return Ze(e,t),e.create=function(t,r,n){return new e(t,r,n)},e.prototype._subscribe=function(t){var e=this,r=this.removeHandler,n=this.selector?function(){for(var r=[],n=0;n<arguments.length;n++)r[n-0]=arguments[n];e._callSelector(t,r)}:function(e){t.next(e)},i=this._callAddHandler(n,t);ot.isFunction(r)&&t.add(new pt.Subscription(function(){r(n,i)}))},e.prototype._callSelector=function(t,e){try{var r=this.selector.apply(this,e);t.next(r)}catch(e){t.error(e)}},e.prototype._callAddHandler=function(t,e){try{return this.addHandler(t)||null}catch(t){e.error(t)}},e}(St.Observable)}.FromEventPatternObservable.create};St.Observable.fromEventPattern=tr.fromEventPattern;var er={fromPromise:pe.PromiseObservable.create};St.Observable.fromPromise=er.fromPromise;var rr=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},nr=function(t){return t},ir={generate:{GenerateObservable:function(t){function e(e,r,n,i,o){t.call(this),this.initialState=e,this.condition=r,this.iterate=n,this.resultSelector=i,this.scheduler=o}return rr(e,t),e.create=function(t,r,n,i,o){return 1==arguments.length?new e(t.initialState,t.condition,t.iterate,t.resultSelector||nr,t.scheduler):void 0===i||Bt.isScheduler(i)?new e(t,r,n,nr,i):new e(t,r,n,i,o)},e.prototype._subscribe=function(t){var r=this.initialState;if(this.scheduler)return this.scheduler.schedule(e.dispatch,0,{subscriber:t,iterate:this.iterate,condition:this.condition,resultSelector:this.resultSelector,state:r});for(var n=this,i=n.condition,o=n.resultSelector,s=n.iterate;;){if(i){var c=void 0;try{c=i(r)}catch(e){return void t.error(e)}if(!c){t.complete();break}}var u=void 0;try{u=o(r)}catch(e){return void t.error(e)}if(t.next(u),t.closed)break;try{r=s(r)}catch(e){return void t.error(e)}}},e.dispatch=function(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(t){return void e.error(t)}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(t){return void e.error(t)}if(!n)return void e.complete();if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(t){return void e.error(t)}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}},e}(St.Observable)}.GenerateObservable.create};St.Observable.generate=ir.generate;var or=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},sr=function(t){function e(e,r,n){t.call(this),this.condition=e,this.thenSource=r,this.elseSource=n}return or(e,t),e.create=function(t,r,n){return new e(t,r,n)},e.prototype._subscribe=function(t){var e=this,r=e.condition,n=e.thenSource,i=e.elseSource;return new cr(t,r,n,i)},e}(St.Observable),cr=function(t){function e(e,r,n,i){t.call(this,e),this.condition=r,this.thenSource=n,this.elseSource=i,this.tryIf()}return or(e,t),e.prototype.tryIf=function(){var t,e=this,r=e.condition,n=e.thenSource,i=e.elseSource;try{var o=(t=r())?n:i;o?this.add(re.subscribeToResult(this,o)):this._complete()}catch(t){this._error(t)}},e}(Jt.OuterSubscriber),ur={_if:{IfObservable:sr}.IfObservable.create};St.Observable.if=ur._if;var ar={isNumeric:function(t){return!st.isArray(t)&&t-parseFloat(t)+1>=0}},lr=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},hr={Action:function(t){function e(e,r){t.call(this)}return lr(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(pt.Subscription)},pr=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},fr={AsyncAction:function(t){function e(e,r){t.call(this,e,r),this.scheduler=e,this.work=r,this.pending=!1}return pr(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t,this.pending=!0;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),it.root.setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){return void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending?e:it.root.clearInterval(e)&&void 0||void 0},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(hr.Action)},br={Scheduler:function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=Date.now?Date.now:function(){return+new Date},t}()},dr=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},yr={AsyncScheduler:function(t){function e(){t.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return dr(e,t),e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(br.Scheduler)},vr={async:new yr.AsyncScheduler(fr.AsyncAction)},mr=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},wr={interval:{IntervalObservable:function(t){function e(e,r){void 0===e&&(e=0),void 0===r&&(r=vr.async),t.call(this),this.period=e,this.scheduler=r,(!ar.isNumeric(e)||e<0)&&(this.period=0),r&&"function"==typeof r.schedule||(this.scheduler=vr.async)}return mr(e,t),e.create=function(t,r){return void 0===t&&(t=0),void 0===r&&(r=vr.async),new e(t,r)},e.dispatch=function(t){var e=t.index,r=t.subscriber,n=t.period;r.next(e),r.closed||(t.index+=1,this.schedule(t,n))},e.prototype._subscribe=function(t){var r=this.period,n=this.scheduler;t.add(n.schedule(e.dispatch,r,{index:0,subscriber:t,period:r}))},e}(St.Observable)}.IntervalObservable.create};St.Observable.interval=wr.interval;var xr={merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return function(e){return e.lift.call(S.apply(void 0,[e].concat(t)))}},mergeStatic:S},gr={mergeStatic:xr.mergeStatic,merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return xr.merge.apply(void 0,t)(this)}},_r={merge:gr.mergeStatic};St.Observable.merge=_r.merge;var Or=Q&&Q.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},Sr=function(){funct