Socket
Socket
Sign inDemoInstall

kefir

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kefir - npm Package Compare versions

Comparing version 3.5.2 to 3.6.0

4

changelog.md

@@ -0,1 +1,5 @@

## 3.6.0 (19/10/2016)
- New methods `.spy` and `.offSpy` [#222](https://github.com/rpominov/kefir/pull/222) [@32bitkid](https://github.com/32bitkid)
## 3.5.2 (07/10/2016)

@@ -2,0 +6,0 @@

6

dist/kefir.min.js

@@ -1,6 +0,6 @@

/*! Kefir.js v3.5.2
/*! Kefir.js v3.6.0
* https://github.com/rpominov/kefir
*/
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.Kefir=t.Kefir||{})}(this,function(t){"use strict";function n(t){var n=function(){};return n.prototype=t,new n}function i(t){var n=arguments.length,i=void 0,e=void 0;for(i=1;i<n;i++)for(e in arguments[i])t[e]=arguments[i][e];return t}function e(t,e){var r=arguments.length,u=void 0;for(t.prototype=n(e.prototype),t.prototype.constructor=t,u=2;u<r;u++)i(t.prototype,arguments[u]);return t}function r(t,n){var i=void 0,e=void 0,r=void 0,u=void 0;if(0===t.length)return n;if(0===n.length)return t;for(u=0,i=new Array(t.length+n.length),e=t.length,r=0;r<e;r++,u++)i[u]=t[r];for(e=n.length,r=0;r<e;r++,u++)i[u]=n[r];return i}function u(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(t[e]===n)return e;return-1}function o(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(n(t[e]))return e;return-1}function s(t){var n=t.length,i=new Array(n),e=void 0;for(e=0;e<n;e++)i[e]=t[e];return i}function a(t,n){var i=t.length,e=void 0,r=void 0,u=void 0;if(n>=0&&n<i){if(1===i)return[];for(e=new Array(i-1),r=0,u=0;r<i;r++)r!==n&&(e[u]=t[r],u++);return e}return t}function h(t,n){var i=t.length,e=new Array(i),r=void 0;for(r=0;r<i;r++)e[r]=n(t[r]);return e}function l(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)n(t[e])}function _(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)t[e]=n}function f(t,n){return u(t,n)!==-1}function c(t,n,i){var e=Math.min(i,t.length+1),r=t.length-e+1,u=new Array(e),o=void 0;for(o=r;o<e;o++)u[o-r]=t[o];return u[e-1]=n,u}function d(t,n,i){t===an?n(i):t===i.type&&(t===on||t===sn?n(i.value):n())}function v(){this._items=[],this._inLoop=0,this._removedItems=null}function m(){this._dispatcher=new v,this._active=!1,this._alive=!0,this._activating=!1,this._logHandlers=null}function p(){m.call(this)}function y(){m.call(this),this._currentEvent=null}function E(){return hn}function g(t){function n(t,n){var i=this;p.call(this),this._wait=t,this._intervalId=null,this._$onTick=function(){return i._onTick()},this._init(n)}return e(n,p,{_init:function(){},_free:function(){},_onTick:function(){},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)},_clear:function(){p.prototype._clear.call(this),this._$onTick=null,this._free()}},t),n}function b(t,n){return new ln(t,{x:n})}function A(t,n){return new _n(t,{x:n})}function w(t,n){return 0===n.length?E():new fn(t,{xs:n})}function V(t,n){return new cn(t,{fn:n})}function S(t){function n(n){return t._emitValue(n),t._active}function i(n){return t._emitError(n),t._active}function e(){return t._emitEnd(),t._active}function r(n){return t._emit(n.type,n.value),t._active}return{value:n,error:i,end:e,event:r,emit:n,emitEvent:r}}function T(t,n){return new dn(t,{fn:n})}function $(t){p.call(this),this._fn=t,this._unsubscribe=null}function C(t){return new $(t)}function k(t){var n=!1;return C(function(i){n||(t(function(t){i.emit(t),i.end()}),n=!0)}).setName("fromCallback")}function I(t){var n=!1;return C(function(i){n||(t(function(t,n){t?i.error(t):i.emit(n),i.end()}),n=!0)}).setName("fromNodeCallback")}function O(t,n){switch(n){case 0:return function(){return t()};case 1:return function(n){return t(n[0])};case 2:return function(n){return t(n[0],n[1])};case 3:return function(n){return t(n[0],n[1],n[2])};case 4:return function(n){return t(n[0],n[1],n[2],n[3])};default:return function(n){return t.apply(null,n)}}}function x(t,n,i){var e=i?i.length:0;if(null==n)switch(e){case 0:return t();case 1:return t(i[0]);case 2:return t(i[0],i[1]);case 3:return t(i[0],i[1],i[2]);case 4:return t(i[0],i[1],i[2],i[3]);default:return t.apply(null,i)}else switch(e){case 0:return t.call(n);default:return t.apply(n,i)}}function L(t,n,i){return C(function(e){var r=i?function(){e.emit(x(i,this,arguments))}:function(t){e.emit(t)};return t(r),function(){return n(r)}}).setName("fromSubUnsub")}function P(t,n,i){for(var e=void 0,r=void 0,u=0;u<vn.length;u++)if("function"==typeof t[vn[u][0]]&&"function"==typeof t[vn[u][1]]){e=vn[u][0],r=vn[u][1];break}if(void 0===e)throw new Error("target don't support any of addEventListener/removeEventListener, addListener/removeListener, on/off method pair");return L(function(i){return t[e](n,i)},function(i){return t[r](n,i)},i).setName("fromEvents")}function M(t){this._currentEvent={type:"value",value:t,current:!0}}function D(t){return new M(t)}function N(t){this._currentEvent={type:"error",value:t,current:!0}}function q(t){return new N(t)}function W(t,n){return function(i,e){var r=this;t.call(this),this._source=i,this._name=i._name+"."+n,this._init(e),this._$handleAny=function(t){return r._handleAny(t)}}}function B(t){return{_init:function(){},_free:function(){},_handleValue:function(t){this._emitValue(t)},_handleError:function(t){this._emitError(t)},_handleEnd:function(){this._emitEnd()},_handleAny:function(t){switch(t.type){case on:return this._handleValue(t.value);case sn:return this._handleError(t.value);case un:return this._handleEnd()}},_onActivation:function(){this._source.onAny(this._$handleAny)},_onDeactivation:function(){this._source.offAny(this._$handleAny)},_clear:function(){t.prototype._clear.call(this),this._source=null,this._$handleAny=null,this._free()}}}function H(t,n){var i=W(p,t);return e(i,p,B(p),n),i}function j(t,n){var i=W(y,t);return e(i,y,B(y),n),i}function U(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(null!==n&&"function"!=typeof n)throw new Error("You should call toProperty() with a function or no arguments.");return new mn(t,{fn:n})}function F(t){return new pn(t)}function Q(t){var n=!1,i=C(function(i){if(!n){var e=function(t){i.emit(t),i.end()},r=function(t){i.error(t),i.end()},u=t.then(e,r);u&&"function"==typeof u.done&&u.done(),n=!0}});return U(i,null).setName("fromPromise")}function z(){if("function"==typeof Promise)return Promise;throw new Error("There isn't default Promise, use shim or parameter")}function Y(t){var n=arguments.length<=1||void 0===arguments[1]?z():arguments[1],i=null;return new n(function(n,e){t.onAny(function(t){t.type===un&&null!==i?((i.type===on?n:e)(i.value),i=null):i=t})})}function K(t,n){return n={exports:{}},t(n,n.exports),n.exports}function G(t){var n=t[Vn]?t[Vn]():t;return C(function(t){var i=n.subscribe({error:function(n){t.error(n),t.end()},next:function(n){t.emit(n)},complete:function(){t.end()}});return i.unsubscribe?function(){i.unsubscribe()}:i}).setName("fromESObservable")}function J(t){this._observable=t.takeErrors(1)}function R(){return new J(this)}function X(t){for(var n=void 0,i=0;i<t.length;i++)void 0!==t[i]&&(void 0===n||n.index<t[i].index)&&(n=t[i]);return n.error}function Z(t,n,i){var e=this;p.call(this),this._activeCount=t.length,this._sources=r(t,n),this._combinator=i?O(i,this._sources.length):function(t){return t},this._aliveCount=0,this._latestValues=new Array(this._sources.length),this._latestErrors=new Array(this._sources.length),_(this._latestValues,rn),this._emitAfterActivation=!1,this._endAfterActivation=!1,this._latestErrorIndex=0,this._$handlers=[];for(var u=function(t){e._$handlers.push(function(n){return e._handleAny(t,n)})},o=0;o<this._sources.length;o++)u(o)}function tt(t){var n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=arguments[2];return"function"==typeof n&&(i=n,n=[]),0===t.length?E():new Z(t,n,i)}function nt(t){var n=arguments.length<=1||void 0===arguments[1]?In:arguments[1];return new(t._ofSameType(Cn,kn))(t,{fn:n})}function it(t){var n=arguments.length<=1||void 0===arguments[1]?Pn:arguments[1];return new(t._ofSameType(xn,Ln))(t,{fn:n})}function et(t,n){return new(t._ofSameType(Dn,Nn))(t,{n:n})}function rt(t,n){return new(t._ofSameType(Wn,Bn))(t,{n:n})}function ut(t){var n=arguments.length<=1||void 0===arguments[1]?Fn:arguments[1];return new(t._ofSameType(jn,Un))(t,{fn:n})}function ot(t){return new(t._ofSameType(zn,Yn))(t)}function st(t,n){return new(t._ofSameType(Gn,Jn))(t,{n:n})}function at(t){var n=arguments.length<=1||void 0===arguments[1]?ti:arguments[1];return new(t._ofSameType(Xn,Zn))(t,{fn:n})}function ht(t){var n=arguments.length<=1||void 0===arguments[1]?ri:arguments[1];return new(t._ofSameType(ii,ei))(t,{fn:n})}function lt(t,n){return[t,n]}function _t(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new(t._ofSameType(oi,si))(t,{fn:n||lt,seed:i})}function ft(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new ai(t,{fn:n,seed:i})}function ct(t){var n=arguments.length<=1||void 0===arguments[1]?_i:arguments[1];return new li(t,{fn:n})}function dt(t,n){return new(t._ofSameType(di,vi))(t,{wait:n})}function vt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.leading,r=void 0===e||e,u=i.trailing,o=void 0===u||u;return new(t._ofSameType(yi,Ei))(t,{wait:n,leading:r,trailing:o})}function mt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.immediate,r=void 0!==e&&e;return new(t._ofSameType(bi,Ai))(t,{wait:n,immediate:r})}function pt(t){var n=arguments.length<=1||void 0===arguments[1]?Ti:arguments[1];return new(t._ofSameType(Vi,Si))(t,{fn:n})}function yt(t){var n=arguments.length<=1||void 0===arguments[1]?Ii:arguments[1];return new(t._ofSameType(Ci,ki))(t,{fn:n})}function Et(t){return new(t._ofSameType(xi,Li))(t)}function gt(t){return new(t._ofSameType(Mi,Di))(t)}function bt(t){return new(t._ofSameType(qi,Wi))(t)}function At(t,n){return new(t._ofSameType(Hi,ji))(t,{fn:n})}function wt(t,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return new(t._ofSameType(Fi,Qi))(t,{min:i,max:n})}function Vt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Yi,Ki))(t,{fn:n||Gi,flushOnEnd:r})}function St(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Ri,Xi))(t,{count:n,flushOnEnd:r})}function Tt(t,n,i){var e=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=e.flushOnEnd,u=void 0===r||r;return new(t._ofSameType(te,ne))(t,{wait:n,count:i,flushOnEnd:u})}function $t(t){return{"@@transducer/step":function(n,i){return t._emitValue(i),null},"@@transducer/result":function(){return t._emitEnd(),null}}}function Ct(t,n){return new(t._ofSameType(ee,re))(t,{transducer:n})}function kt(t,n){return new(t._ofSameType(oe,se))(t,{fn:n})}function It(t,n){var i=this;p.call(this),this._buffers=h(t,function(t){return ae(t)?s(t):[]}),this._sources=h(t,function(t){return ae(t)?E():t}),this._combinator=n?O(n,this._sources.length):function(t){return t},this._aliveCount=0,this._$handlers=[];for(var e=function(t){i._$handlers.push(function(n){return i._handleAny(t,n)})},r=0;r<this._sources.length;r++)e(r)}function Ot(t,n){return 0===t.length?E():new It(t,n)}function xt(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.queueLim,e=void 0===i?0:i,r=n.concurLim,u=void 0===r?-1:r,o=n.drop,s=void 0===o?"new":o;p.call(this),this._queueLim=e<0?-1:e,this._concurLim=u<0?-1:u,this._drop=s,this._queue=[],this._curSources=[],this._$handleSubAny=function(n){return t._handleSubAny(n)},this._$endHandlers=[],this._currentlyAdding=null,0===this._concurLim&&this._emitEnd()}function Lt(t){xt.call(this),this._addAll(t),this._initialised=!0}function Pt(t){return 0===t.length?E():new Lt(t)}function Mt(t){var n=this;p.call(this),this._generator=t,this._source=null,this._inLoop=!1,this._iteration=0,this._$handleAny=function(t){return n._handleAny(t)}}function Dt(t){return new Mt(t)}function Nt(t){return Dt(function(n){return t.length>n&&t[n]}).setName("concat")}function qt(){xt.call(this)}function Wt(t,n,i){var e=this;xt.call(this,i),this._source=t,this._fn=n,this._mainEnded=!1,this._lastCurrent=null,this._$handleMain=function(t){return e._handleMain(t)}}function Bt(t,n){Wt.call(this,t,n)}function Ht(t,n){return function(i,e,r){var u=this;t.call(this),this._primary=i,this._secondary=e,this._name=i._name+"."+n,this._lastSecondary=rn,this._$handleSecondaryAny=function(t){return u._handleSecondaryAny(t)},this._$handlePrimaryAny=function(t){return u._handlePrimaryAny(t)},this._init(r)}}function jt(t){return{_init:function(){},_free:function(){},_handlePrimaryValue:function(t){this._emitValue(t)},_handlePrimaryError:function(t){this._emitError(t)},_handlePrimaryEnd:function(){this._emitEnd()},_handleSecondaryValue:function(t){this._lastSecondary=t},_handleSecondaryError:function(t){this._emitError(t)},_handleSecondaryEnd:function(){},_handlePrimaryAny:function(t){switch(t.type){case on:return this._handlePrimaryValue(t.value);case sn:return this._handlePrimaryError(t.value);case un:return this._handlePrimaryEnd(t.value)}},_handleSecondaryAny:function(t){switch(t.type){case on:return this._handleSecondaryValue(t.value);case sn:return this._handleSecondaryError(t.value);case un:this._handleSecondaryEnd(t.value),this._removeSecondary()}},_removeSecondary:function(){null!==this._secondary&&(this._secondary.offAny(this._$handleSecondaryAny),this._$handleSecondaryAny=null,this._secondary=null)},_onActivation:function(){null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny),this._active&&this._primary.onAny(this._$handlePrimaryAny)},_onDeactivation:function(){null!==this._secondary&&this._secondary.offAny(this._$handleSecondaryAny),this._primary.offAny(this._$handlePrimaryAny)},_clear:function(){t.prototype._clear.call(this),this._primary=null,this._secondary=null,this._lastSecondary=null,this._$handleSecondaryAny=null,this._$handlePrimaryAny=null,this._free()}}}function Ut(t,n){var i=Ht(p,t);return e(i,p,jt(p),n),i}function Ft(t,n){var i=Ht(y,t);return e(i,y,jt(y),n),i}function Qt(t,n){return new(t._ofSameType(_e,fe))(t,n)}function zt(t,n,i){var e=i?function(t,n){return i(n,t)}:ce;return tt([n],[t],e).setName(t,"sampledBy")}function Yt(t,n){return new(t._ofSameType(ve,me))(t,n)}function Kt(t,n){return new(t._ofSameType(ye,Ee))(t,n)}function Gt(t,n,i){return new(t._ofSameType(be,Ae))(t,n,i)}function Jt(t,n,i){return new(t._ofSameType(Ve,Se))(t,n,i)}function Rt(t,n){var i=Pt([nt(t,$e),nt(n,Te)]);return i=ht(i),i=U(i,Te),i.setName(t,"awaiting")}function Xt(t){var n=arguments.length<=1||void 0===arguments[1]?Oe:arguments[1];return new(t._ofSameType(ke,Ie))(t,{fn:n})}function Zt(t){var n=arguments.length<=1||void 0===arguments[1]?Me:arguments[1];return new(t._ofSameType(Le,Pe))(t,{fn:n})}function tn(t){return new(t._ofSameType(Ne,qe))(t)}function nn(){Be=!1}function en(t){if(Be&&console&&"function"==typeof console.warn){var n="\nHere is an Error object for you containing the call stack:";console.warn(t,n,new Error)}}var rn=["<nothing>"],un="end",on="value",sn="error",an="any";i(v.prototype,{add:function(t,n){return this._items=r(this._items,[{type:t,fn:n}]),this._items.length},remove:function(t,n){var i=o(this._items,function(i){return i.type===t&&i.fn===n});return 0!==this._inLoop&&i!==-1&&(null===this._removedItems&&(this._removedItems=[]),this._removedItems.push(this._items[i])),this._items=a(this._items,i),this._items.length},dispatch:function(t){this._inLoop++;for(var n=0,i=this._items;n<i.length&&null!==this._items;n++)null!==this._removedItems&&f(this._removedItems,i[n])||d(i[n].type,i[n].fn,t);this._inLoop--,0===this._inLoop&&(this._removedItems=null)},cleanup:function(){this._items=null}}),i(m.prototype,{_name:"observable",_onActivation:function(){},_onDeactivation:function(){},_setActive:function(t){this._active!==t&&(this._active=t,t?(this._activating=!0,this._onActivation(),this._activating=!1):this._onDeactivation())},_clear:function(){this._setActive(!1),this._dispatcher.cleanup(),this._dispatcher=null,this._logHandlers=null},_emit:function(t,n){switch(t){case on:return this._emitValue(n);case sn:return this._emitError(n);case un:return this._emitEnd()}},_emitValue:function(t){this._alive&&this._dispatcher.dispatch({type:on,value:t})},_emitError:function(t){this._alive&&this._dispatcher.dispatch({type:sn,value:t})},_emitEnd:function(){this._alive&&(this._alive=!1,this._dispatcher.dispatch({type:un}),this._clear())},_on:function(t,n){return this._alive?(this._dispatcher.add(t,n),this._setActive(!0)):d(t,n,{type:un}),this},_off:function(t,n){if(this._alive){var i=this._dispatcher.remove(t,n);0===i&&this._setActive(!1)}return this},onValue:function(t){return this._on(on,t)},onError:function(t){return this._on(sn,t)},onEnd:function(t){return this._on(un,t)},onAny:function(t){return this._on(an,t)},offValue:function(t){return this._off(on,t)},offError:function(t){return this._off(sn,t)},offEnd:function(t){return this._off(un,t)},offAny:function(t){return this._off(an,t)},observe:function(t,n,i){var e=this,r=!1,u=t&&"function"!=typeof t?t:{value:t,error:n,end:i},o=function(t){t.type===un&&(r=!0),t.type===on&&u.value?u.value(t.value):t.type===sn&&u.error?u.error(t.value):t.type===un&&u.end&&u.end(t.value)};return this.onAny(o),{unsubscribe:function(){r||(e.offAny(o),r=!0)},get closed(){return r}}},_ofSameType:function(t,n){return t.prototype.getType()===this.getType()?t:n},setName:function(t,n){return this._name=n?t._name+"."+n:t,this},log:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0],n=void 0,i=function(i){var e="<"+i.type+(n?":current":"")+">";i.type===un?console.log(t,e):console.log(t,e,i.value)};return this._alive&&(this._logHandlers||(this._logHandlers=[]),this._logHandlers.push({name:t,handler:i})),n=!0,this.onAny(i),n=!1,this},offLog:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0];if(this._logHandlers){var n=o(this._logHandlers,function(n){return n.name===t});n!==-1&&(this.offAny(this._logHandlers[n].handler),this._logHandlers.splice(n,1))}return this}}),m.prototype.toString=function(){return"["+this._name+"]"},e(p,m,{_name:"stream",getType:function(){return"stream"}}),e(y,m,{_name:"property",_emitValue:function(t){this._alive&&(this._currentEvent={type:on,value:t},this._activating||this._dispatcher.dispatch({type:on,value:t}))},_emitError:function(t){this._alive&&(this._currentEvent={type:sn,value:t},this._activating||this._dispatcher.dispatch({type:sn,value:t}))},_emitEnd:function(){this._alive&&(this._alive=!1,this._activating||this._dispatcher.dispatch({type:un}),this._clear())},_on:function(t,n){return this._alive&&(this._dispatcher.add(t,n),this._setActive(!0)),null!==this._currentEvent&&d(t,n,this._currentEvent),this._alive||d(t,n,{type:un}),this},getType:function(){return"property"}});var hn=new p;hn._emitEnd(),hn._name="never";var ln=g({_name:"later",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x),this._emitEnd()}}),_n=g({_name:"interval",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x)}}),fn=g({_name:"sequentially",_init:function(t){var n=t.xs;this._xs=s(n)},_free:function(){this._xs=null},_onTick:function(){1===this._xs.length?(this._emitValue(this._xs[0]),this._emitEnd()):this._emitValue(this._xs.shift())}}),cn=g({_name:"fromPoll",_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_onTick:function(){var t=this._fn;this._emitValue(t())}}),dn=g({_name:"withInterval",_init:function(t){var n=t.fn;this._fn=n,this._emitter=S(this)},_free:function(){this._fn=null,this._emitter=null},_onTick:function(){var t=this._fn;t(this._emitter)}});e($,p,{_name:"stream",_onActivation:function(){var t=this._fn,n=t(S(this));this._unsubscribe="function"==typeof n?n:null,this._active||this._callUnsubscribe()},_callUnsubscribe:function(){null!==this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)},_onDeactivation:function(){this._callUnsubscribe()},_clear:function(){p.prototype._clear.call(this),this._fn=null}});var vn=[["addEventListener","removeEventListener"],["addListener","removeListener"],["on","off"]];e(M,y,{_name:"constant",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null}),e(N,y,{_name:"constantError",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null});var mn=j("toProperty",{_init:function(t){var n=t.fn;this._getInitialCurrent=n},_onActivation:function(){if(null!==this._getInitialCurrent){var t=this._getInitialCurrent;this._emitValue(t())}this._source.onAny(this._$handleAny)}}),pn=H("changes",{_handleValue:function(t){this._activating||this._emitValue(t)},_handleError:function(t){this._activating||this._emitError(t)}}),yn="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},En=K(function(t,n){function i(t){var n,i=t.Symbol;return"function"==typeof i?i.observable?n=i.observable:(n=i("observable"),i.observable=n):n="@@observable",n}Object.defineProperty(n,"__esModule",{value:!0}),n.default=i}),gn=En&&"object"==typeof En&&"default"in En?En.default:En,bn=K(function(t,n){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var e=gn,r=i(e),u=void 0;"undefined"!=typeof yn?u=yn:"undefined"!=typeof window&&(u=window);var o=(0,r.default)(u);n.default=o}),An=bn&&"object"==typeof bn&&"default"in bn?bn.default:bn,wn=K(function(t){t.exports=An}),Vn=wn&&"object"==typeof wn&&"default"in wn?wn.default:wn;i(J.prototype,{subscribe:function(t,n,i){var e=this,r="function"==typeof t?{next:t,error:n,complete:i}:t,u=function(t){t.type===un&&(o=!0),t.type===on&&r.next?r.next(t.value):t.type===sn&&r.error?r.error(t.value):t.type===un&&r.complete&&r.complete(t.value)};this._observable.onAny(u);var o=!1,s={unsubscribe:function(){o=!0,e._observable.offAny(u)},get closed(){return o}};return s}}),J.prototype[Vn]=function(){return this},e(Z,p,{_name:"combine",_onActivation:function(){this._aliveCount=this._activeCount;for(var t=this._activeCount;t<this._sources.length;t++)this._sources[t].onAny(this._$handlers[t]);for(var n=0;n<this._activeCount;n++)this._sources[n].onAny(this._$handlers[n]);this._emitAfterActivation&&(this._emitAfterActivation=!1,this._emitIfFull()),this._endAfterActivation&&this._emitEnd()},_onDeactivation:function(){var t=this._sources.length,n=void 0;for(n=0;n<t;n++)this._sources[n].offAny(this._$handlers[n])},_emitIfFull:function(){for(var t=!0,n=!1,i=this._latestValues.length,e=new Array(i),r=new Array(i),u=0;u<i;u++)e[u]=this._latestValues[u],r[u]=this._latestErrors[u],e[u]===rn&&(t=!1),void 0!==r[u]&&(n=!0);if(t){var o=this._combinator;this._emitValue(o(e))}n&&this._emitError(X(r))},_handleAny:function(t,n){n.type===on||n.type===sn?(n.type===on&&(this._latestValues[t]=n.value,this._latestErrors[t]=void 0),n.type===sn&&(this._latestValues[t]=rn,this._latestErrors[t]={index:this._latestErrorIndex++,error:n.value}),t<this._activeCount&&(this._activating?this._emitAfterActivation=!0:this._emitIfFull())):t<this._activeCount&&(this._aliveCount--,0===this._aliveCount&&(this._activating?this._endAfterActivation=!0:this._emitEnd()))},_clear:function(){p.prototype._clear.call(this),this._sources=null,this._latestValues=null,this._latestErrors=null,this._combinator=null,this._$handlers=null}});var Sn={empty:function(){return E()},concat:function(t,n){return t.merge(n)},of:function(t){return D(t)},map:function(t,n){return n.map(t)},bimap:function(t,n,i){return i.mapErrors(t).map(n)},ap:function(t,n){return tt([t,n],function(t,n){return t(n)})},chain:function(t,n){return n.flatMap(t)}},Tn=Object.freeze({Observable:Sn}),$n={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;this._emitValue(n(t))}},Cn=H("map",$n),kn=j("map",$n),In=function(t){return t},On={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)&&this._emitValue(t)}},xn=H("filter",On),Ln=j("filter",On),Pn=function(t){return t},Mn={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleValue:function(t){this._n--,this._emitValue(t),0===this._n&&this._emitEnd()}},Dn=H("take",Mn),Nn=j("take",Mn),qn={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleError:function(t){this._n--,this._emitError(t),0===this._n&&this._emitEnd()}},Wn=H("takeErrors",qn),Bn=j("takeErrors",qn),Hn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)?this._emitValue(t):this._emitEnd()}},jn=H("takeWhile",Hn),Un=j("takeWhile",Hn),Fn=function(t){return t},Qn={_init:function(){this._lastValue=rn},_free:function(){this._lastValue=null},_handleValue:function(t){this._lastValue=t},_handleEnd:function(){this._lastValue!==rn&&this._emitValue(this._lastValue),this._emitEnd()}},zn=H("last",Qn),Yn=j("last",Qn),Kn={_init:function(t){var n=t.n;this._n=Math.max(0,n)},_handleValue:function(t){0===this._n?this._emitValue(t):this._n--}},Gn=H("skip",Kn),Jn=j("skip",Kn),Rn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;null===this._fn||n(t)||(this._fn=null),null===this._fn&&this._emitValue(t)}},Xn=H("skipWhile",Rn),Zn=j("skipWhile",Rn),ti=function(t){return t},ni={_init:function(t){var n=t.fn;this._fn=n,this._prev=rn},_free:function(){this._fn=null,this._prev=null},_handleValue:function(t){var n=this._fn;this._prev!==rn&&n(this._prev,t)||(this._prev=t,this._emitValue(t))}},ii=H("skipDuplicates",ni),ei=j("skipDuplicates",ni),ri=function(t,n){return t===n},ui={_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._prev=i},_free:function(){this._prev=null,this._fn=null},_handleValue:function(t){if(this._prev!==rn){var n=this._fn;this._emitValue(n(this._prev,t))}this._prev=t}},oi=H("diff",ui),si=j("diff",ui),ai=j("scan",{_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._seed=i,i!==rn&&this._emitValue(i)},_free:function(){this._fn=null,this._seed=null},_handleValue:function(t){var n=this._fn;null===this._currentEvent||this._currentEvent.type===sn?this._emitValue(this._seed===rn?t:n(this._seed,t)):this._emitValue(n(this._currentEvent.value,t))}}),hi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){for(var n=this._fn,i=n(t),e=0;e<i.length;e++)this._emitValue(i[e])}},li=H("flatten",hi),_i=function(t){return t},fi={},ci={_init:function(t){var n=this,i=t.wait;this._wait=Math.max(0,i),this._buff=[],this._$shiftBuff=function(){var t=n._buff.shift();t===fi?n._emitEnd():n._emitValue(t)}},_free:function(){this._buff=null,this._$shiftBuff=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._buff.push(t),setTimeout(this._$shiftBuff,this._wait))},_handleEnd:function(){this._activating?this._emitEnd():(this._buff.push(fi),setTimeout(this._$shiftBuff,this._wait))}},di=H("delay",ci),vi=j("delay",ci),mi=Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},pi={_init:function(t){var n=this,i=t.wait,e=t.leading,r=t.trailing;this._wait=Math.max(0,i),this._leading=e,this._trailing=r,this._trailingValue=null,this._timeoutId=null,this._endLater=!1,this._lastCallTime=0,this._$trailingCall=function(){return n._trailingCall()}},_free:function(){this._trailingValue=null,this._$trailingCall=null},_handleValue:function(t){if(this._activating)this._emitValue(t);else{var n=mi();0!==this._lastCallTime||this._leading||(this._lastCallTime=n);var i=this._wait-(n-this._lastCallTime);i<=0?(this._cancelTrailing(),this._lastCallTime=n,this._emitValue(t)):this._trailing&&(this._cancelTrailing(),this._trailingValue=t,this._timeoutId=setTimeout(this._$trailingCall,i))}},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId?this._endLater=!0:this._emitEnd()},_cancelTrailing:function(){null!==this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null)},_trailingCall:function(){this._emitValue(this._trailingValue),this._timeoutId=null,this._trailingValue=null,this._lastCallTime=this._leading?mi():0,this._endLater&&this._emitEnd()}},yi=H("throttle",pi),Ei=j("throttle",pi),gi={_init:function(t){var n=this,i=t.wait,e=t.immediate;this._wait=Math.max(0,i),this._immediate=e,this._lastAttempt=0,this._timeoutId=null,this._laterValue=null,this._endLater=!1,this._$later=function(){return n._later()}},_free:function(){this._laterValue=null,this._$later=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._lastAttempt=mi(),this._immediate&&!this._timeoutId&&this._emitValue(t),this._timeoutId||(this._timeoutId=setTimeout(this._$later,this._wait)),this._immediate||(this._laterValue=t))},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId&&!this._immediate?this._endLater=!0:this._emitEnd()},_later:function(){var t=mi()-this._lastAttempt;t<this._wait&&t>=0?this._timeoutId=setTimeout(this._$later,this._wait-t):(this._timeoutId=null,this._immediate||(this._emitValue(this._laterValue),this._laterValue=null),this._endLater&&this._emitEnd())}},bi=H("debounce",gi),Ai=j("debounce",gi),wi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;this._emitError(n(t))}},Vi=H("mapErrors",wi),Si=j("mapErrors",wi),Ti=function(t){return t},$i={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;n(t)&&this._emitError(t)}},Ci=H("filterErrors",$i),ki=j("filterErrors",$i),Ii=function(t){return t},Oi={_handleValue:function(){}},xi=H("ignoreValues",Oi),Li=j("ignoreValues",Oi),Pi={_handleError:function(){}},Mi=H("ignoreErrors",Pi),Di=j("ignoreErrors",Pi),Ni={_handleEnd:function(){}},qi=H("ignoreEnd",Ni),Wi=j("ignoreEnd",Ni),Bi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleEnd:function(){var t=this._fn;this._emitValue(t()),this._emitEnd()}},Hi=H("beforeEnd",Bi),ji=j("beforeEnd",Bi),Ui={_init:function(t){var n=t.min,i=t.max;this._max=i,this._min=n,this._buff=[]},_free:function(){this._buff=null},_handleValue:function(t){this._buff=c(this._buff,t,this._max),this._buff.length>=this._min&&this._emitValue(this._buff)}},Fi=H("slidingWindow",Ui),Qi=j("slidingWindow",Ui),zi={_init:function(t){var n=t.fn,i=t.flushOnEnd;this._fn=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t);var n=this._fn;n(t)||this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Yi=H("bufferWhile",zi),Ki=j("bufferWhile",zi),Gi=function(t){return t},Ji={_init:function(t){var n=t.count,i=t.flushOnEnd;this._count=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Ri=H("bufferWithCount",Ji),Xi=j("bufferWithCount",Ji),Zi={_init:function(t){var n=this,i=t.wait,e=t.count,r=t.flushOnEnd;this._wait=i,this._count=e,this._flushOnEnd=r,this._intervalId=null,this._$onTick=function(){return n._flush()},this._buff=[]},_free:function(){this._$onTick=null,this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&(clearInterval(this._intervalId),this._flush(),this._intervalId=setInterval(this._$onTick,this._wait))},_handleEnd:function(){this._flushOnEnd&&0!==this._buff.length&&this._flush(),this._emitEnd()},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait),this._source.onAny(this._$handleAny)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._source.offAny(this._$handleAny)}},te=H("bufferWithTimeOrCount",Zi),ne=j("bufferWithTimeOrCount",Zi),ie={_init:function(t){var n=t.transducer;this._xform=n($t(this));
},_free:function(){this._xform=null},_handleValue:function(t){null!==this._xform["@@transducer/step"](null,t)&&this._xform["@@transducer/result"](null)},_handleEnd:function(){this._xform["@@transducer/result"](null)}},ee=H("transduce",ie),re=j("transduce",ie),ue={_init:function(t){var n=t.fn;this._handler=n,this._emitter=S(this)},_free:function(){this._handler=null,this._emitter=null},_handleAny:function(t){this._handler(this._emitter,t)}},oe=H("withHandler",ue),se=j("withHandler",ue),ae=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};e(It,p,{_name:"zip",_onActivation:function(){for(;this._isFull();)this._emit();var t=this._sources.length;this._aliveCount=t;for(var n=0;n<t&&this._active;n++)this._sources[n].onAny(this._$handlers[n])},_onDeactivation:function(){for(var t=0;t<this._sources.length;t++)this._sources[t].offAny(this._$handlers[t])},_emit:function(){for(var t=new Array(this._buffers.length),n=0;n<this._buffers.length;n++)t[n]=this._buffers[n].shift();var i=this._combinator;this._emitValue(i(t))},_isFull:function(){for(var t=0;t<this._buffers.length;t++)if(0===this._buffers[t].length)return!1;return!0},_handleAny:function(t,n){n.type===on&&(this._buffers[t].push(n.value),this._isFull()&&this._emit()),n.type===sn&&this._emitError(n.value),n.type===un&&(this._aliveCount--,0===this._aliveCount&&this._emitEnd())},_clear:function(){p.prototype._clear.call(this),this._sources=null,this._buffers=null,this._combinator=null,this._$handlers=null}});var he=function(t){return t};e(xt,p,{_name:"abstractPool",_add:function(t,n){n=n||he,this._concurLim===-1||this._curSources.length<this._concurLim?this._addToCur(n(t)):this._queueLim===-1||this._queue.length<this._queueLim?this._addToQueue(n(t)):"old"===this._drop&&(this._removeOldest(),this._add(t,n))},_addAll:function(t){var n=this;l(t,function(t){return n._add(t)})},_remove:function(t){this._removeCur(t)===-1&&this._removeQueue(t)},_addToQueue:function(t){this._queue=r(this._queue,[t])},_addToCur:function(t){if(this._active){if(!t._alive)return void(t._currentEvent&&this._emit(t._currentEvent.type,t._currentEvent.value));this._currentlyAdding=t,t.onAny(this._$handleSubAny),this._currentlyAdding=null,t._alive&&(this._curSources=r(this._curSources,[t]),this._active&&this._subToEnd(t))}else this._curSources=r(this._curSources,[t])},_subToEnd:function(t){var n=this,i=function(){return n._removeCur(t)};this._$endHandlers.push({obs:t,handler:i}),t.onEnd(i)},_subscribe:function(t){t.onAny(this._$handleSubAny),this._active&&this._subToEnd(t)},_unsubscribe:function(t){t.offAny(this._$handleSubAny);var n=o(this._$endHandlers,function(n){return n.obs===t});n!==-1&&(t.offEnd(this._$endHandlers[n].handler),this._$endHandlers.splice(n,1))},_handleSubAny:function(t){t.type===on?this._emitValue(t.value):t.type===sn&&this._emitError(t.value)},_removeQueue:function(t){var n=u(this._queue,t);return this._queue=a(this._queue,n),n},_removeCur:function(t){this._active&&this._unsubscribe(t);var n=u(this._curSources,t);return this._curSources=a(this._curSources,n),n!==-1&&(0!==this._queue.length?this._pullQueue():0===this._curSources.length&&this._onEmpty()),n},_removeOldest:function(){this._removeCur(this._curSources[0])},_pullQueue:function(){0!==this._queue.length&&(this._queue=s(this._queue),this._addToCur(this._queue.shift()))},_onActivation:function(){for(var t=0,n=this._curSources;t<n.length&&this._active;t++)this._subscribe(n[t])},_onDeactivation:function(){for(var t=0,n=this._curSources;t<n.length;t++)this._unsubscribe(n[t]);null!==this._currentlyAdding&&this._unsubscribe(this._currentlyAdding)},_isEmpty:function(){return 0===this._curSources.length},_onEmpty:function(){},_clear:function(){p.prototype._clear.call(this),this._queue=null,this._curSources=null,this._$handleSubAny=null,this._$endHandlers=null}}),e(Lt,xt,{_name:"merge",_onEmpty:function(){this._initialised&&this._emitEnd()}}),e(Mt,p,{_name:"repeat",_handleAny:function(t){t.type===un?(this._source=null,this._getSource()):this._emit(t.type,t.value)},_getSource:function(){if(!this._inLoop){this._inLoop=!0;for(var t=this._generator;null===this._source&&this._alive&&this._active;)this._source=t(this._iteration++),this._source?this._source.onAny(this._$handleAny):this._emitEnd();this._inLoop=!1}},_onActivation:function(){this._source?this._source.onAny(this._$handleAny):this._getSource()},_onDeactivation:function(){this._source&&this._source.offAny(this._$handleAny)},_clear:function(){p.prototype._clear.call(this),this._generator=null,this._source=null,this._$handleAny=null}}),e(qt,xt,{_name:"pool",plug:function(t){return this._add(t),this},unplug:function(t){return this._remove(t),this}}),e(Wt,xt,{_onActivation:function(){xt.prototype._onActivation.call(this),this._active&&this._source.onAny(this._$handleMain)},_onDeactivation:function(){xt.prototype._onDeactivation.call(this),this._source.offAny(this._$handleMain),this._hadNoEvSinceDeact=!0},_handleMain:function(t){if(t.type===on){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===sn&&this._emitError(t.value),t.type===un&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)},_onEmpty:function(){this._mainEnded&&this._emitEnd()},_clear:function(){xt.prototype._clear.call(this),this._source=null,this._lastCurrent=null,this._$handleMain=null}}),e(Bt,Wt,{_handleMain:function(t){if(t.type===sn){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===on&&this._emitValue(t.value),t.type===un&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)}});var le={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._lastSecondary&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary!==rn&&this._lastSecondary||this._emitEnd()}},_e=Ut("filterBy",le),fe=Ft("filterBy",le),ce=function(t,n){return n},de={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary===rn&&this._emitEnd()}},ve=Ut("skipUntilBy",de),me=Ft("skipUntilBy",de),pe={_handleSecondaryValue:function(){this._emitEnd()}},ye=Ut("takeUntilBy",pe),Ee=Ft("takeUntilBy",pe),ge={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n;this._buff=[],this._flushOnEnd=i},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_onActivation:function(){this._primary.onAny(this._$handlePrimaryAny),this._alive&&null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny)},_handlePrimaryValue:function(t){this._buff.push(t)},_handleSecondaryValue:function(){this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._emitEnd()}},be=Ut("bufferBy",ge),Ae=Ft("bufferBy",ge),we={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n,e=t.flushOnChange,r=void 0!==e&&e;this._buff=[],this._flushOnEnd=i,this._flushOnChange=r},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_handlePrimaryValue:function(t){this._buff.push(t),this._lastSecondary===rn||this._lastSecondary||this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._lastSecondary!==rn&&!this._lastSecondary||this._emitEnd()},_handleSecondaryValue:function(t){this._flushOnChange&&!t&&this._flush(),this._lastSecondary=t}},Ve=Ut("bufferWhileBy",we),Se=Ft("bufferWhileBy",we),Te=function(){return!1},$e=function(){return!0},Ce={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn,i=n(t);i.convert?this._emitError(i.error):this._emitValue(t)}},ke=H("valuesToErrors",Ce),Ie=j("valuesToErrors",Ce),Oe=function(t){return{convert:!0,error:t}},xe={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn,i=n(t);i.convert?this._emitValue(i.value):this._emitError(t)}},Le=H("errorsToValues",xe),Pe=j("errorsToValues",xe),Me=function(t){return{convert:!0,value:t}},De={_handleError:function(t){this._emitError(t),this._emitEnd()}},Ne=H("endOnError",De),qe=j("endOnError",De);m.prototype.toProperty=function(t){return U(this,t)},m.prototype.changes=function(){return F(this)},m.prototype.toPromise=function(t){return Y(this,t)},m.prototype.toESObservable=R,m.prototype[Vn]=R,m.prototype.map=function(t){return nt(this,t)},m.prototype.filter=function(t){return it(this,t)},m.prototype.take=function(t){return et(this,t)},m.prototype.takeErrors=function(t){return rt(this,t)},m.prototype.takeWhile=function(t){return ut(this,t)},m.prototype.last=function(){return ot(this)},m.prototype.skip=function(t){return st(this,t)},m.prototype.skipWhile=function(t){return at(this,t)},m.prototype.skipDuplicates=function(t){return ht(this,t)},m.prototype.diff=function(t,n){return _t(this,t,n)},m.prototype.scan=function(t,n){return ft(this,t,n)},m.prototype.flatten=function(t){return ct(this,t)},m.prototype.delay=function(t){return dt(this,t)},m.prototype.throttle=function(t,n){return vt(this,t,n)},m.prototype.debounce=function(t,n){return mt(this,t,n)},m.prototype.mapErrors=function(t){return pt(this,t)},m.prototype.filterErrors=function(t){return yt(this,t)},m.prototype.ignoreValues=function(){return Et(this)},m.prototype.ignoreErrors=function(){return gt(this)},m.prototype.ignoreEnd=function(){return bt(this)},m.prototype.beforeEnd=function(t){return At(this,t)},m.prototype.slidingWindow=function(t,n){return wt(this,t,n)},m.prototype.bufferWhile=function(t,n){return Vt(this,t,n)},m.prototype.bufferWithCount=function(t,n){return St(this,t,n)},m.prototype.bufferWithTimeOrCount=function(t,n,i){return Tt(this,t,n,i)},m.prototype.transduce=function(t){return Ct(this,t)},m.prototype.withHandler=function(t){return kt(this,t)},m.prototype.combine=function(t,n){return tt([this,t],n)},m.prototype.zip=function(t,n){return Ot([this,t],n)},m.prototype.merge=function(t){return Pt([this,t])},m.prototype.concat=function(t){return Nt([this,t])};var We=function(){return new qt};m.prototype.flatMap=function(t){return new Wt(this,t).setName(this,"flatMap")},m.prototype.flatMapLatest=function(t){return new Wt(this,t,{concurLim:1,drop:"old"}).setName(this,"flatMapLatest")},m.prototype.flatMapFirst=function(t){return new Wt(this,t,{concurLim:1}).setName(this,"flatMapFirst")},m.prototype.flatMapConcat=function(t){return new Wt(this,t,{queueLim:-1,concurLim:1}).setName(this,"flatMapConcat")},m.prototype.flatMapConcurLimit=function(t,n){return new Wt(this,t,{queueLim:-1,concurLim:n}).setName(this,"flatMapConcurLimit")},m.prototype.flatMapErrors=function(t){return new Bt(this,t).setName(this,"flatMapErrors")},m.prototype.filterBy=function(t){return Qt(this,t)},m.prototype.sampledBy=function(t,n){return zt(this,t,n)},m.prototype.skipUntilBy=function(t){return Yt(this,t)},m.prototype.takeUntilBy=function(t){return Kt(this,t)},m.prototype.bufferBy=function(t,n){return Gt(this,t,n)},m.prototype.bufferWhileBy=function(t,n){return Jt(this,t,n)};var Be=!0;m.prototype.awaiting=function(t){return en("You are using deprecated .awaiting() method, see https://github.com/rpominov/kefir/issues/145"),Rt(this,t)},m.prototype.valuesToErrors=function(t){return en("You are using deprecated .valuesToErrors() method, see https://github.com/rpominov/kefir/issues/149"),Xt(this,t)},m.prototype.errorsToValues=function(t){return en("You are using deprecated .errorsToValues() method, see https://github.com/rpominov/kefir/issues/149"),Zt(this,t)},m.prototype.endOnError=function(){return en("You are using deprecated .endOnError() method, see https://github.com/rpominov/kefir/issues/150"),tn(this)};var He={Observable:m,Stream:p,Property:y,never:E,later:b,interval:A,sequentially:w,fromPoll:V,withInterval:T,fromCallback:k,fromNodeCallback:I,fromEvents:P,stream:C,constant:D,constantError:q,fromPromise:Q,fromESObservable:G,combine:tt,zip:Ot,merge:Pt,concat:Nt,Pool:qt,pool:We,repeat:Dt,staticLand:Tn};He.Kefir=He,t.dissableDeprecationWarnings=nn,t.Kefir=He,t.Observable=m,t.Stream=p,t.Property=y,t.never=E,t.later=b,t.interval=A,t.sequentially=w,t.fromPoll=V,t.withInterval=T,t.fromCallback=k,t.fromNodeCallback=I,t.fromEvents=P,t.stream=C,t.constant=D,t.constantError=q,t.fromPromise=Q,t.fromESObservable=G,t.combine=tt,t.zip=Ot,t.merge=Pt,t.concat=Nt,t.Pool=qt,t.pool=We,t.repeat=Dt,t.staticLand=Tn,t.default=He,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.Kefir=t.Kefir||{})}(this,function(t){"use strict";function n(t){var n=function(){};return n.prototype=t,new n}function i(t){var n=arguments.length,i=void 0,e=void 0;for(i=1;i<n;i++)for(e in arguments[i])t[e]=arguments[i][e];return t}function e(t,e){var r=arguments.length,s=void 0;for(t.prototype=n(e.prototype),t.prototype.constructor=t,s=2;s<r;s++)i(t.prototype,arguments[s]);return t}function r(t,n){var i=void 0,e=void 0,r=void 0,s=void 0;if(0===t.length)return n;if(0===n.length)return t;for(s=0,i=new Array(t.length+n.length),e=t.length,r=0;r<e;r++,s++)i[s]=t[r];for(e=n.length,r=0;r<e;r++,s++)i[s]=n[r];return i}function s(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(t[e]===n)return e;return-1}function u(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)if(n(t[e]))return e;return-1}function o(t){var n=t.length,i=new Array(n),e=void 0;for(e=0;e<n;e++)i[e]=t[e];return i}function a(t,n){var i=t.length,e=void 0,r=void 0,s=void 0;if(n>=0&&n<i){if(1===i)return[];for(e=new Array(i-1),r=0,s=0;r<i;r++)r!==n&&(e[s]=t[r],s++);return e}return t}function h(t,n){var i=t.length,e=new Array(i),r=void 0;for(r=0;r<i;r++)e[r]=n(t[r]);return e}function l(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)n(t[e])}function _(t,n){var i=t.length,e=void 0;for(e=0;e<i;e++)t[e]=n}function f(t,n){return s(t,n)!==-1}function c(t,n,i){var e=Math.min(i,t.length+1),r=t.length-e+1,s=new Array(e),u=void 0;for(u=r;u<e;u++)s[u-r]=t[u];return s[e-1]=n,s}function d(t,n,i){t===an?n(i):t===i.type&&(t===un||t===on?n(i.value):n())}function v(){this._items=[],this._spies=[],this._inLoop=0,this._removedItems=null}function p(){this._dispatcher=new v,this._active=!1,this._alive=!0,this._activating=!1,this._logHandlers=null,this._spyHandlers=null}function m(){p.call(this)}function y(){p.call(this),this._currentEvent=null}function g(){return hn}function E(t){function n(t,n){var i=this;m.call(this),this._wait=t,this._intervalId=null,this._$onTick=function(){return i._onTick()},this._init(n)}return e(n,m,{_init:function(){},_free:function(){},_onTick:function(){},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null)},_clear:function(){m.prototype._clear.call(this),this._$onTick=null,this._free()}},t),n}function b(t,n){return new ln(t,{x:n})}function A(t,n){return new _n(t,{x:n})}function w(t,n){return 0===n.length?g():new fn(t,{xs:n})}function S(t,n){return new cn(t,{fn:n})}function V(t){function n(n){return t._emitValue(n),t._active}function i(n){return t._emitError(n),t._active}function e(){return t._emitEnd(),t._active}function r(n){return t._emit(n.type,n.value),t._active}return{value:n,error:i,end:e,event:r,emit:n,emitEvent:r}}function T(t,n){return new dn(t,{fn:n})}function $(t){m.call(this),this._fn=t,this._unsubscribe=null}function C(t){return new $(t)}function k(t){var n=!1;return C(function(i){n||(t(function(t){i.emit(t),i.end()}),n=!0)}).setName("fromCallback")}function I(t){var n=!1;return C(function(i){n||(t(function(t,n){t?i.error(t):i.emit(n),i.end()}),n=!0)}).setName("fromNodeCallback")}function O(t,n){switch(n){case 0:return function(){return t()};case 1:return function(n){return t(n[0])};case 2:return function(n){return t(n[0],n[1])};case 3:return function(n){return t(n[0],n[1],n[2])};case 4:return function(n){return t(n[0],n[1],n[2],n[3])};default:return function(n){return t.apply(null,n)}}}function x(t,n,i){var e=i?i.length:0;if(null==n)switch(e){case 0:return t();case 1:return t(i[0]);case 2:return t(i[0],i[1]);case 3:return t(i[0],i[1],i[2]);case 4:return t(i[0],i[1],i[2],i[3]);default:return t.apply(null,i)}else switch(e){case 0:return t.call(n);default:return t.apply(n,i)}}function L(t,n,i){return C(function(e){var r=i?function(){e.emit(x(i,this,arguments))}:function(t){e.emit(t)};return t(r),function(){return n(r)}}).setName("fromSubUnsub")}function P(t,n,i){for(var e=void 0,r=void 0,s=0;s<vn.length;s++)if("function"==typeof t[vn[s][0]]&&"function"==typeof t[vn[s][1]]){e=vn[s][0],r=vn[s][1];break}if(void 0===e)throw new Error("target don't support any of addEventListener/removeEventListener, addListener/removeListener, on/off method pair");return L(function(i){return t[e](n,i)},function(i){return t[r](n,i)},i).setName("fromEvents")}function H(t){this._currentEvent={type:"value",value:t,current:!0}}function M(t){return new H(t)}function D(t){this._currentEvent={type:"error",value:t,current:!0}}function N(t){return new D(t)}function q(t,n){return function(i,e){var r=this;t.call(this),this._source=i,this._name=i._name+"."+n,this._init(e),this._$handleAny=function(t){return r._handleAny(t)}}}function W(t){return{_init:function(){},_free:function(){},_handleValue:function(t){this._emitValue(t)},_handleError:function(t){this._emitError(t)},_handleEnd:function(){this._emitEnd()},_handleAny:function(t){switch(t.type){case un:return this._handleValue(t.value);case on:return this._handleError(t.value);case sn:return this._handleEnd()}},_onActivation:function(){this._source.onAny(this._$handleAny)},_onDeactivation:function(){this._source.offAny(this._$handleAny)},_clear:function(){t.prototype._clear.call(this),this._source=null,this._$handleAny=null,this._free()}}}function B(t,n){var i=q(m,t);return e(i,m,W(m),n),i}function j(t,n){var i=q(y,t);return e(i,y,W(y),n),i}function U(t){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(null!==n&&"function"!=typeof n)throw new Error("You should call toProperty() with a function or no arguments.");return new pn(t,{fn:n})}function F(t){return new mn(t)}function Q(t){var n=!1,i=C(function(i){if(!n){var e=function(t){i.emit(t),i.end()},r=function(t){i.error(t),i.end()},s=t.then(e,r);s&&"function"==typeof s.done&&s.done(),n=!0}});return U(i,null).setName("fromPromise")}function z(){if("function"==typeof Promise)return Promise;throw new Error("There isn't default Promise, use shim or parameter")}function Y(t){var n=arguments.length<=1||void 0===arguments[1]?z():arguments[1],i=null;return new n(function(n,e){t.onAny(function(t){t.type===sn&&null!==i?((i.type===un?n:e)(i.value),i=null):i=t})})}function K(t,n){return n={exports:{}},t(n,n.exports),n.exports}function G(t){var n=t[Sn]?t[Sn]():t;return C(function(t){var i=n.subscribe({error:function(n){t.error(n),t.end()},next:function(n){t.emit(n)},complete:function(){t.end()}});return i.unsubscribe?function(){i.unsubscribe()}:i}).setName("fromESObservable")}function J(t){this._observable=t.takeErrors(1)}function R(){return new J(this)}function X(t){for(var n=void 0,i=0;i<t.length;i++)void 0!==t[i]&&(void 0===n||n.index<t[i].index)&&(n=t[i]);return n.error}function Z(t,n,i){var e=this;m.call(this),this._activeCount=t.length,this._sources=r(t,n),this._combinator=i?O(i,this._sources.length):function(t){return t},this._aliveCount=0,this._latestValues=new Array(this._sources.length),this._latestErrors=new Array(this._sources.length),_(this._latestValues,rn),this._emitAfterActivation=!1,this._endAfterActivation=!1,this._latestErrorIndex=0,this._$handlers=[];for(var s=function(t){e._$handlers.push(function(n){return e._handleAny(t,n)})},u=0;u<this._sources.length;u++)s(u)}function tt(t){var n=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=arguments[2];return"function"==typeof n&&(i=n,n=[]),0===t.length?g():new Z(t,n,i)}function nt(t){var n=arguments.length<=1||void 0===arguments[1]?In:arguments[1];return new(t._ofSameType(Cn,kn))(t,{fn:n})}function it(t){var n=arguments.length<=1||void 0===arguments[1]?Pn:arguments[1];return new(t._ofSameType(xn,Ln))(t,{fn:n})}function et(t,n){return new(t._ofSameType(Mn,Dn))(t,{n:n})}function rt(t,n){return new(t._ofSameType(qn,Wn))(t,{n:n})}function st(t){var n=arguments.length<=1||void 0===arguments[1]?Fn:arguments[1];return new(t._ofSameType(jn,Un))(t,{fn:n})}function ut(t){return new(t._ofSameType(zn,Yn))(t)}function ot(t,n){return new(t._ofSameType(Gn,Jn))(t,{n:n})}function at(t){var n=arguments.length<=1||void 0===arguments[1]?ti:arguments[1];return new(t._ofSameType(Xn,Zn))(t,{fn:n})}function ht(t){var n=arguments.length<=1||void 0===arguments[1]?ri:arguments[1];return new(t._ofSameType(ii,ei))(t,{fn:n})}function lt(t,n){return[t,n]}function _t(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new(t._ofSameType(ui,oi))(t,{fn:n||lt,seed:i})}function ft(t,n){var i=arguments.length<=2||void 0===arguments[2]?rn:arguments[2];return new ai(t,{fn:n,seed:i})}function ct(t){var n=arguments.length<=1||void 0===arguments[1]?_i:arguments[1];return new li(t,{fn:n})}function dt(t,n){return new(t._ofSameType(di,vi))(t,{wait:n})}function vt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.leading,r=void 0===e||e,s=i.trailing,u=void 0===s||s;return new(t._ofSameType(yi,gi))(t,{wait:n,leading:r,trailing:u})}function pt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.immediate,r=void 0!==e&&e;return new(t._ofSameType(bi,Ai))(t,{wait:n,immediate:r})}function mt(t){var n=arguments.length<=1||void 0===arguments[1]?Ti:arguments[1];return new(t._ofSameType(Si,Vi))(t,{fn:n})}function yt(t){var n=arguments.length<=1||void 0===arguments[1]?Ii:arguments[1];return new(t._ofSameType(Ci,ki))(t,{fn:n})}function gt(t){return new(t._ofSameType(xi,Li))(t)}function Et(t){return new(t._ofSameType(Hi,Mi))(t)}function bt(t){return new(t._ofSameType(Ni,qi))(t)}function At(t,n){return new(t._ofSameType(Bi,ji))(t,{fn:n})}function wt(t,n){var i=arguments.length<=2||void 0===arguments[2]?0:arguments[2];return new(t._ofSameType(Fi,Qi))(t,{min:i,max:n})}function St(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Yi,Ki))(t,{fn:n||Gi,flushOnEnd:r})}function Vt(t,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],e=i.flushOnEnd,r=void 0===e||e;return new(t._ofSameType(Ri,Xi))(t,{count:n,flushOnEnd:r})}function Tt(t,n,i){var e=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],r=e.flushOnEnd,s=void 0===r||r;return new(t._ofSameType(te,ne))(t,{wait:n,count:i,flushOnEnd:s})}function $t(t){return{"@@transducer/step":function(n,i){return t._emitValue(i),null},"@@transducer/result":function(){return t._emitEnd(),null}}}function Ct(t,n){return new(t._ofSameType(ee,re))(t,{transducer:n})}function kt(t,n){return new(t._ofSameType(ue,oe))(t,{fn:n})}function It(t,n){var i=this;m.call(this),this._buffers=h(t,function(t){return ae(t)?o(t):[]}),this._sources=h(t,function(t){return ae(t)?g():t}),this._combinator=n?O(n,this._sources.length):function(t){return t},this._aliveCount=0,this._$handlers=[];for(var e=function(t){i._$handlers.push(function(n){return i._handleAny(t,n)})},r=0;r<this._sources.length;r++)e(r)}function Ot(t,n){return 0===t.length?g():new It(t,n)}function xt(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],i=n.queueLim,e=void 0===i?0:i,r=n.concurLim,s=void 0===r?-1:r,u=n.drop,o=void 0===u?"new":u;m.call(this),this._queueLim=e<0?-1:e,this._concurLim=s<0?-1:s,this._drop=o,this._queue=[],this._curSources=[],this._$handleSubAny=function(n){return t._handleSubAny(n)},this._$endHandlers=[],this._currentlyAdding=null,0===this._concurLim&&this._emitEnd()}function Lt(t){xt.call(this),this._addAll(t),this._initialised=!0}function Pt(t){return 0===t.length?g():new Lt(t)}function Ht(t){var n=this;m.call(this),this._generator=t,this._source=null,this._inLoop=!1,this._iteration=0,this._$handleAny=function(t){return n._handleAny(t)}}function Mt(t){return new Ht(t)}function Dt(t){return Mt(function(n){return t.length>n&&t[n]}).setName("concat")}function Nt(){xt.call(this)}function qt(t,n,i){var e=this;xt.call(this,i),this._source=t,this._fn=n,this._mainEnded=!1,this._lastCurrent=null,this._$handleMain=function(t){return e._handleMain(t)}}function Wt(t,n){qt.call(this,t,n)}function Bt(t,n){return function(i,e,r){var s=this;t.call(this),this._primary=i,this._secondary=e,this._name=i._name+"."+n,this._lastSecondary=rn,this._$handleSecondaryAny=function(t){return s._handleSecondaryAny(t)},this._$handlePrimaryAny=function(t){return s._handlePrimaryAny(t)},this._init(r)}}function jt(t){return{_init:function(){},_free:function(){},_handlePrimaryValue:function(t){this._emitValue(t)},_handlePrimaryError:function(t){this._emitError(t)},_handlePrimaryEnd:function(){this._emitEnd()},_handleSecondaryValue:function(t){this._lastSecondary=t},_handleSecondaryError:function(t){this._emitError(t)},_handleSecondaryEnd:function(){},_handlePrimaryAny:function(t){switch(t.type){case un:return this._handlePrimaryValue(t.value);case on:return this._handlePrimaryError(t.value);case sn:return this._handlePrimaryEnd(t.value)}},_handleSecondaryAny:function(t){switch(t.type){case un:return this._handleSecondaryValue(t.value);case on:return this._handleSecondaryError(t.value);case sn:this._handleSecondaryEnd(t.value),this._removeSecondary()}},_removeSecondary:function(){null!==this._secondary&&(this._secondary.offAny(this._$handleSecondaryAny),this._$handleSecondaryAny=null,this._secondary=null)},_onActivation:function(){null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny),this._active&&this._primary.onAny(this._$handlePrimaryAny)},_onDeactivation:function(){null!==this._secondary&&this._secondary.offAny(this._$handleSecondaryAny),this._primary.offAny(this._$handlePrimaryAny)},_clear:function(){t.prototype._clear.call(this),this._primary=null,this._secondary=null,this._lastSecondary=null,this._$handleSecondaryAny=null,this._$handlePrimaryAny=null,this._free()}}}function Ut(t,n){var i=Bt(m,t);return e(i,m,jt(m),n),i}function Ft(t,n){var i=Bt(y,t);return e(i,y,jt(y),n),i}function Qt(t,n){return new(t._ofSameType(_e,fe))(t,n)}function zt(t,n,i){var e=i?function(t,n){return i(n,t)}:ce;return tt([n],[t],e).setName(t,"sampledBy")}function Yt(t,n){return new(t._ofSameType(ve,pe))(t,n)}function Kt(t,n){return new(t._ofSameType(ye,ge))(t,n)}function Gt(t,n,i){return new(t._ofSameType(be,Ae))(t,n,i)}function Jt(t,n,i){return new(t._ofSameType(Se,Ve))(t,n,i)}function Rt(t,n){var i=Pt([nt(t,$e),nt(n,Te)]);return i=ht(i),i=U(i,Te),i.setName(t,"awaiting")}function Xt(t){var n=arguments.length<=1||void 0===arguments[1]?Oe:arguments[1];return new(t._ofSameType(ke,Ie))(t,{fn:n})}function Zt(t){var n=arguments.length<=1||void 0===arguments[1]?He:arguments[1];return new(t._ofSameType(Le,Pe))(t,{fn:n})}function tn(t){return new(t._ofSameType(De,Ne))(t)}function nn(){We=!1}function en(t){if(We&&console&&"function"==typeof console.warn){var n="\nHere is an Error object for you containing the call stack:";console.warn(t,n,new Error)}}var rn=["<nothing>"],sn="end",un="value",on="error",an="any";i(v.prototype,{add:function(t,n){return this._items=r(this._items,[{type:t,fn:n}]),this._items.length},remove:function(t,n){var i=u(this._items,function(i){return i.type===t&&i.fn===n});return 0!==this._inLoop&&i!==-1&&(null===this._removedItems&&(this._removedItems=[]),this._removedItems.push(this._items[i])),this._items=a(this._items,i),this._items.length},addSpy:function(t){return this._spies=r(this._spies,[t]),this._spies.length},removeSpy:function(t){return this._spies=a(this._spies,this._spies.indexOf(t)),this._spies.length},dispatch:function(t){this._inLoop++;for(var n=0,i=this._spies;null!==this._spies&&n<i.length;n++)i[n](t);for(var e=0,r=this._items;e<r.length&&null!==this._items;e++)null!==this._removedItems&&f(this._removedItems,r[e])||d(r[e].type,r[e].fn,t);this._inLoop--,0===this._inLoop&&(this._removedItems=null)},cleanup:function(){this._items=null,this._spies=null}}),i(p.prototype,{_name:"observable",_onActivation:function(){},_onDeactivation:function(){},_setActive:function(t){this._active!==t&&(this._active=t,t?(this._activating=!0,this._onActivation(),this._activating=!1):this._onDeactivation())},_clear:function(){this._setActive(!1),this._dispatcher.cleanup(),this._dispatcher=null,this._logHandlers=null},_emit:function(t,n){switch(t){case un:return this._emitValue(n);case on:return this._emitError(n);case sn:return this._emitEnd()}},_emitValue:function(t){this._alive&&this._dispatcher.dispatch({type:un,value:t})},_emitError:function(t){this._alive&&this._dispatcher.dispatch({type:on,value:t})},_emitEnd:function(){this._alive&&(this._alive=!1,this._dispatcher.dispatch({type:sn}),this._clear())},_on:function(t,n){return this._alive?(this._dispatcher.add(t,n),this._setActive(!0)):d(t,n,{type:sn}),this},_off:function(t,n){if(this._alive){var i=this._dispatcher.remove(t,n);0===i&&this._setActive(!1)}return this},onValue:function(t){return this._on(un,t)},onError:function(t){return this._on(on,t)},onEnd:function(t){return this._on(sn,t)},onAny:function(t){return this._on(an,t)},offValue:function(t){return this._off(un,t)},offError:function(t){return this._off(on,t)},offEnd:function(t){return this._off(sn,t)},offAny:function(t){return this._off(an,t)},observe:function(t,n,i){var e=this,r=!1,s=t&&"function"!=typeof t?t:{value:t,error:n,end:i},u=function(t){t.type===sn&&(r=!0),t.type===un&&s.value?s.value(t.value):t.type===on&&s.error?s.error(t.value):t.type===sn&&s.end&&s.end(t.value)};return this.onAny(u),{unsubscribe:function(){r||(e.offAny(u),r=!0)},get closed(){return r}}},_ofSameType:function(t,n){return t.prototype.getType()===this.getType()?t:n},setName:function(t,n){return this._name=n?t._name+"."+n:t,this},log:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0],n=void 0,i=function(i){var e="<"+i.type+(n?":current":"")+">";i.type===sn?console.log(t,e):console.log(t,e,i.value)};return this._alive&&(this._logHandlers||(this._logHandlers=[]),this._logHandlers.push({name:t,handler:i})),n=!0,this.onAny(i),n=!1,this},offLog:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0];if(this._logHandlers){var n=u(this._logHandlers,function(n){return n.name===t});n!==-1&&(this.offAny(this._logHandlers[n].handler),this._logHandlers.splice(n,1))}return this},spy:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0],n=function(n){var i="<"+n.type+">";n.type===sn?console.log(t,i):console.log(t,i,n.value)};return this._alive&&(this._spyHandlers||(this._spyHandlers=[]),this._spyHandlers.push({name:t,handler:n}),this._dispatcher.addSpy(n)),this},offSpy:function(){var t=arguments.length<=0||void 0===arguments[0]?this.toString():arguments[0];if(this._spyHandlers){var n=u(this._spyHandlers,function(n){return n.name===t});n!==-1&&(this._dispatcher.removeSpy(this._spyHandlers[n].handler),this._spyHandlers.splice(n,1))}return this}}),p.prototype.toString=function(){return"["+this._name+"]"},e(m,p,{_name:"stream",getType:function(){return"stream"}}),e(y,p,{_name:"property",_emitValue:function(t){this._alive&&(this._currentEvent={type:un,value:t},this._activating||this._dispatcher.dispatch({type:un,value:t}))},_emitError:function(t){this._alive&&(this._currentEvent={type:on,value:t},this._activating||this._dispatcher.dispatch({type:on,value:t}))},_emitEnd:function(){this._alive&&(this._alive=!1,this._activating||this._dispatcher.dispatch({type:sn}),this._clear())},_on:function(t,n){return this._alive&&(this._dispatcher.add(t,n),this._setActive(!0)),null!==this._currentEvent&&d(t,n,this._currentEvent),this._alive||d(t,n,{type:sn}),this},getType:function(){return"property"}});var hn=new m;hn._emitEnd(),hn._name="never";var ln=E({_name:"later",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x),this._emitEnd()}}),_n=E({_name:"interval",_init:function(t){var n=t.x;this._x=n},_free:function(){this._x=null},_onTick:function(){this._emitValue(this._x)}}),fn=E({_name:"sequentially",_init:function(t){var n=t.xs;this._xs=o(n)},_free:function(){this._xs=null},_onTick:function(){1===this._xs.length?(this._emitValue(this._xs[0]),this._emitEnd()):this._emitValue(this._xs.shift())}}),cn=E({_name:"fromPoll",_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_onTick:function(){var t=this._fn;this._emitValue(t())}}),dn=E({_name:"withInterval",_init:function(t){var n=t.fn;this._fn=n,this._emitter=V(this)},_free:function(){this._fn=null,this._emitter=null},_onTick:function(){var t=this._fn;t(this._emitter)}});e($,m,{_name:"stream",_onActivation:function(){var t=this._fn,n=t(V(this));this._unsubscribe="function"==typeof n?n:null,this._active||this._callUnsubscribe()},_callUnsubscribe:function(){null!==this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)},_onDeactivation:function(){this._callUnsubscribe()},_clear:function(){m.prototype._clear.call(this),this._fn=null}});var vn=[["addEventListener","removeEventListener"],["addListener","removeListener"],["on","off"]];e(H,y,{_name:"constant",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null}),e(D,y,{_name:"constantError",_active:!1,_activating:!1,_alive:!1,_dispatcher:null,_logHandlers:null});var pn=j("toProperty",{_init:function(t){var n=t.fn;this._getInitialCurrent=n},_onActivation:function(){if(null!==this._getInitialCurrent){var t=this._getInitialCurrent;this._emitValue(t())}this._source.onAny(this._$handleAny)}}),mn=B("changes",{_handleValue:function(t){this._activating||this._emitValue(t)},_handleError:function(t){this._activating||this._emitError(t)}}),yn="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},gn=K(function(t,n){function i(t){var n,i=t.Symbol;return"function"==typeof i?i.observable?n=i.observable:(n=i("observable"),i.observable=n):n="@@observable",n}Object.defineProperty(n,"__esModule",{value:!0}),n.default=i}),En=gn&&"object"==typeof gn&&"default"in gn?gn.default:gn,bn=K(function(t,n){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0});var e=En,r=i(e),s=void 0;"undefined"!=typeof yn?s=yn:"undefined"!=typeof window&&(s=window);var u=(0,r.default)(s);n.default=u}),An=bn&&"object"==typeof bn&&"default"in bn?bn.default:bn,wn=K(function(t){t.exports=An}),Sn=wn&&"object"==typeof wn&&"default"in wn?wn.default:wn;i(J.prototype,{subscribe:function(t,n,i){var e=this,r="function"==typeof t?{next:t,error:n,complete:i}:t,s=function(t){t.type===sn&&(u=!0),t.type===un&&r.next?r.next(t.value):t.type===on&&r.error?r.error(t.value):t.type===sn&&r.complete&&r.complete(t.value)};this._observable.onAny(s);var u=!1,o={unsubscribe:function(){u=!0,e._observable.offAny(s)},get closed(){return u}};return o}}),J.prototype[Sn]=function(){return this},e(Z,m,{_name:"combine",_onActivation:function(){this._aliveCount=this._activeCount;for(var t=this._activeCount;t<this._sources.length;t++)this._sources[t].onAny(this._$handlers[t]);for(var n=0;n<this._activeCount;n++)this._sources[n].onAny(this._$handlers[n]);this._emitAfterActivation&&(this._emitAfterActivation=!1,this._emitIfFull()),this._endAfterActivation&&this._emitEnd()},_onDeactivation:function(){var t=this._sources.length,n=void 0;for(n=0;n<t;n++)this._sources[n].offAny(this._$handlers[n])},_emitIfFull:function(){for(var t=!0,n=!1,i=this._latestValues.length,e=new Array(i),r=new Array(i),s=0;s<i;s++)e[s]=this._latestValues[s],r[s]=this._latestErrors[s],e[s]===rn&&(t=!1),void 0!==r[s]&&(n=!0);if(t){var u=this._combinator;this._emitValue(u(e))}n&&this._emitError(X(r))},_handleAny:function(t,n){n.type===un||n.type===on?(n.type===un&&(this._latestValues[t]=n.value,this._latestErrors[t]=void 0),n.type===on&&(this._latestValues[t]=rn,this._latestErrors[t]={index:this._latestErrorIndex++,error:n.value}),t<this._activeCount&&(this._activating?this._emitAfterActivation=!0:this._emitIfFull())):t<this._activeCount&&(this._aliveCount--,0===this._aliveCount&&(this._activating?this._endAfterActivation=!0:this._emitEnd()))},_clear:function(){m.prototype._clear.call(this),this._sources=null,this._latestValues=null,this._latestErrors=null,this._combinator=null,this._$handlers=null}});var Vn={empty:function(){return g()},concat:function(t,n){return t.merge(n)},of:function(t){return M(t)},map:function(t,n){return n.map(t)},bimap:function(t,n,i){return i.mapErrors(t).map(n)},ap:function(t,n){return tt([t,n],function(t,n){return t(n)})},chain:function(t,n){return n.flatMap(t)}},Tn=Object.freeze({Observable:Vn}),$n={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;this._emitValue(n(t))}},Cn=B("map",$n),kn=j("map",$n),In=function(t){return t},On={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)&&this._emitValue(t)}},xn=B("filter",On),Ln=j("filter",On),Pn=function(t){return t},Hn={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleValue:function(t){this._n--,this._emitValue(t),0===this._n&&this._emitEnd()}},Mn=B("take",Hn),Dn=j("take",Hn),Nn={_init:function(t){var n=t.n;this._n=n,n<=0&&this._emitEnd()},_handleError:function(t){this._n--,this._emitError(t),0===this._n&&this._emitEnd()}},qn=B("takeErrors",Nn),Wn=j("takeErrors",Nn),Bn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;n(t)?this._emitValue(t):this._emitEnd()}},jn=B("takeWhile",Bn),Un=j("takeWhile",Bn),Fn=function(t){return t},Qn={_init:function(){this._lastValue=rn},_free:function(){this._lastValue=null},_handleValue:function(t){this._lastValue=t},_handleEnd:function(){this._lastValue!==rn&&this._emitValue(this._lastValue),this._emitEnd()}},zn=B("last",Qn),Yn=j("last",Qn),Kn={_init:function(t){var n=t.n;this._n=Math.max(0,n)},_handleValue:function(t){0===this._n?this._emitValue(t):this._n--}},Gn=B("skip",Kn),Jn=j("skip",Kn),Rn={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn;null===this._fn||n(t)||(this._fn=null),null===this._fn&&this._emitValue(t)}},Xn=B("skipWhile",Rn),Zn=j("skipWhile",Rn),ti=function(t){return t},ni={_init:function(t){var n=t.fn;this._fn=n,this._prev=rn},_free:function(){this._fn=null,this._prev=null},_handleValue:function(t){var n=this._fn;this._prev!==rn&&n(this._prev,t)||(this._prev=t,this._emitValue(t))}},ii=B("skipDuplicates",ni),ei=j("skipDuplicates",ni),ri=function(t,n){return t===n},si={_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._prev=i},_free:function(){this._prev=null,this._fn=null},_handleValue:function(t){if(this._prev!==rn){var n=this._fn;this._emitValue(n(this._prev,t))}this._prev=t}},ui=B("diff",si),oi=j("diff",si),ai=j("scan",{_init:function(t){var n=t.fn,i=t.seed;this._fn=n,this._seed=i,i!==rn&&this._emitValue(i)},_free:function(){this._fn=null,this._seed=null},_handleValue:function(t){var n=this._fn;null===this._currentEvent||this._currentEvent.type===on?this._emitValue(this._seed===rn?t:n(this._seed,t)):this._emitValue(n(this._currentEvent.value,t))}}),hi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){for(var n=this._fn,i=n(t),e=0;e<i.length;e++)this._emitValue(i[e])}},li=B("flatten",hi),_i=function(t){return t},fi={},ci={_init:function(t){var n=this,i=t.wait;this._wait=Math.max(0,i),this._buff=[],this._$shiftBuff=function(){var t=n._buff.shift();t===fi?n._emitEnd():n._emitValue(t)}},_free:function(){this._buff=null,this._$shiftBuff=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._buff.push(t),setTimeout(this._$shiftBuff,this._wait))},_handleEnd:function(){this._activating?this._emitEnd():(this._buff.push(fi),setTimeout(this._$shiftBuff,this._wait))}},di=B("delay",ci),vi=j("delay",ci),pi=Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},mi={_init:function(t){var n=this,i=t.wait,e=t.leading,r=t.trailing;this._wait=Math.max(0,i),this._leading=e,this._trailing=r,this._trailingValue=null,this._timeoutId=null,this._endLater=!1,this._lastCallTime=0,this._$trailingCall=function(){return n._trailingCall()}},_free:function(){this._trailingValue=null,this._$trailingCall=null},_handleValue:function(t){if(this._activating)this._emitValue(t);else{var n=pi();0!==this._lastCallTime||this._leading||(this._lastCallTime=n);var i=this._wait-(n-this._lastCallTime);i<=0?(this._cancelTrailing(),this._lastCallTime=n,this._emitValue(t)):this._trailing&&(this._cancelTrailing(),this._trailingValue=t,this._timeoutId=setTimeout(this._$trailingCall,i))}},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId?this._endLater=!0:this._emitEnd()},_cancelTrailing:function(){null!==this._timeoutId&&(clearTimeout(this._timeoutId),this._timeoutId=null)},_trailingCall:function(){this._emitValue(this._trailingValue),this._timeoutId=null,this._trailingValue=null,this._lastCallTime=this._leading?pi():0,this._endLater&&this._emitEnd()}},yi=B("throttle",mi),gi=j("throttle",mi),Ei={_init:function(t){var n=this,i=t.wait,e=t.immediate;this._wait=Math.max(0,i),this._immediate=e,this._lastAttempt=0,this._timeoutId=null,this._laterValue=null,this._endLater=!1,this._$later=function(){return n._later()}},_free:function(){this._laterValue=null,this._$later=null},_handleValue:function(t){this._activating?this._emitValue(t):(this._lastAttempt=pi(),this._immediate&&!this._timeoutId&&this._emitValue(t),this._timeoutId||(this._timeoutId=setTimeout(this._$later,this._wait)),this._immediate||(this._laterValue=t))},_handleEnd:function(){this._activating?this._emitEnd():this._timeoutId&&!this._immediate?this._endLater=!0:this._emitEnd()},_later:function(){var t=pi()-this._lastAttempt;t<this._wait&&t>=0?this._timeoutId=setTimeout(this._$later,this._wait-t):(this._timeoutId=null,this._immediate||(this._emitValue(this._laterValue),this._laterValue=null),this._endLater&&this._emitEnd())}},bi=B("debounce",Ei),Ai=j("debounce",Ei),wi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;this._emitError(n(t))}},Si=B("mapErrors",wi),Vi=j("mapErrors",wi),Ti=function(t){return t},$i={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn;n(t)&&this._emitError(t)}},Ci=B("filterErrors",$i),ki=j("filterErrors",$i),Ii=function(t){return t},Oi={_handleValue:function(){}},xi=B("ignoreValues",Oi),Li=j("ignoreValues",Oi),Pi={_handleError:function(){}},Hi=B("ignoreErrors",Pi),Mi=j("ignoreErrors",Pi),Di={_handleEnd:function(){}},Ni=B("ignoreEnd",Di),qi=j("ignoreEnd",Di),Wi={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleEnd:function(){var t=this._fn;this._emitValue(t()),this._emitEnd()}},Bi=B("beforeEnd",Wi),ji=j("beforeEnd",Wi),Ui={_init:function(t){var n=t.min,i=t.max;this._max=i,this._min=n,this._buff=[]},_free:function(){this._buff=null},_handleValue:function(t){this._buff=c(this._buff,t,this._max),this._buff.length>=this._min&&this._emitValue(this._buff)}},Fi=B("slidingWindow",Ui),Qi=j("slidingWindow",Ui),zi={_init:function(t){var n=t.fn,i=t.flushOnEnd;this._fn=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t);var n=this._fn;n(t)||this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Yi=B("bufferWhile",zi),Ki=j("bufferWhile",zi),Gi=function(t){return t},Ji={_init:function(t){var n=t.count,i=t.flushOnEnd;this._count=n,this._flushOnEnd=i,this._buff=[]},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&0!==this._buff.length&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&this._flush()},_handleEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()}},Ri=B("bufferWithCount",Ji),Xi=j("bufferWithCount",Ji),Zi={_init:function(t){var n=this,i=t.wait,e=t.count,r=t.flushOnEnd;this._wait=i,
this._count=e,this._flushOnEnd=r,this._intervalId=null,this._$onTick=function(){return n._flush()},this._buff=[]},_free:function(){this._$onTick=null,this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handleValue:function(t){this._buff.push(t),this._buff.length>=this._count&&(clearInterval(this._intervalId),this._flush(),this._intervalId=setInterval(this._$onTick,this._wait))},_handleEnd:function(){this._flushOnEnd&&0!==this._buff.length&&this._flush(),this._emitEnd()},_onActivation:function(){this._intervalId=setInterval(this._$onTick,this._wait),this._source.onAny(this._$handleAny)},_onDeactivation:function(){null!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._source.offAny(this._$handleAny)}},te=B("bufferWithTimeOrCount",Zi),ne=j("bufferWithTimeOrCount",Zi),ie={_init:function(t){var n=t.transducer;this._xform=n($t(this))},_free:function(){this._xform=null},_handleValue:function(t){null!==this._xform["@@transducer/step"](null,t)&&this._xform["@@transducer/result"](null)},_handleEnd:function(){this._xform["@@transducer/result"](null)}},ee=B("transduce",ie),re=j("transduce",ie),se={_init:function(t){var n=t.fn;this._handler=n,this._emitter=V(this)},_free:function(){this._handler=null,this._emitter=null},_handleAny:function(t){this._handler(this._emitter,t)}},ue=B("withHandler",se),oe=j("withHandler",se),ae=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};e(It,m,{_name:"zip",_onActivation:function(){for(;this._isFull();)this._emit();var t=this._sources.length;this._aliveCount=t;for(var n=0;n<t&&this._active;n++)this._sources[n].onAny(this._$handlers[n])},_onDeactivation:function(){for(var t=0;t<this._sources.length;t++)this._sources[t].offAny(this._$handlers[t])},_emit:function(){for(var t=new Array(this._buffers.length),n=0;n<this._buffers.length;n++)t[n]=this._buffers[n].shift();var i=this._combinator;this._emitValue(i(t))},_isFull:function(){for(var t=0;t<this._buffers.length;t++)if(0===this._buffers[t].length)return!1;return!0},_handleAny:function(t,n){n.type===un&&(this._buffers[t].push(n.value),this._isFull()&&this._emit()),n.type===on&&this._emitError(n.value),n.type===sn&&(this._aliveCount--,0===this._aliveCount&&this._emitEnd())},_clear:function(){m.prototype._clear.call(this),this._sources=null,this._buffers=null,this._combinator=null,this._$handlers=null}});var he=function(t){return t};e(xt,m,{_name:"abstractPool",_add:function(t,n){n=n||he,this._concurLim===-1||this._curSources.length<this._concurLim?this._addToCur(n(t)):this._queueLim===-1||this._queue.length<this._queueLim?this._addToQueue(n(t)):"old"===this._drop&&(this._removeOldest(),this._add(t,n))},_addAll:function(t){var n=this;l(t,function(t){return n._add(t)})},_remove:function(t){this._removeCur(t)===-1&&this._removeQueue(t)},_addToQueue:function(t){this._queue=r(this._queue,[t])},_addToCur:function(t){if(this._active){if(!t._alive)return void(t._currentEvent&&this._emit(t._currentEvent.type,t._currentEvent.value));this._currentlyAdding=t,t.onAny(this._$handleSubAny),this._currentlyAdding=null,t._alive&&(this._curSources=r(this._curSources,[t]),this._active&&this._subToEnd(t))}else this._curSources=r(this._curSources,[t])},_subToEnd:function(t){var n=this,i=function(){return n._removeCur(t)};this._$endHandlers.push({obs:t,handler:i}),t.onEnd(i)},_subscribe:function(t){t.onAny(this._$handleSubAny),this._active&&this._subToEnd(t)},_unsubscribe:function(t){t.offAny(this._$handleSubAny);var n=u(this._$endHandlers,function(n){return n.obs===t});n!==-1&&(t.offEnd(this._$endHandlers[n].handler),this._$endHandlers.splice(n,1))},_handleSubAny:function(t){t.type===un?this._emitValue(t.value):t.type===on&&this._emitError(t.value)},_removeQueue:function(t){var n=s(this._queue,t);return this._queue=a(this._queue,n),n},_removeCur:function(t){this._active&&this._unsubscribe(t);var n=s(this._curSources,t);return this._curSources=a(this._curSources,n),n!==-1&&(0!==this._queue.length?this._pullQueue():0===this._curSources.length&&this._onEmpty()),n},_removeOldest:function(){this._removeCur(this._curSources[0])},_pullQueue:function(){0!==this._queue.length&&(this._queue=o(this._queue),this._addToCur(this._queue.shift()))},_onActivation:function(){for(var t=0,n=this._curSources;t<n.length&&this._active;t++)this._subscribe(n[t])},_onDeactivation:function(){for(var t=0,n=this._curSources;t<n.length;t++)this._unsubscribe(n[t]);null!==this._currentlyAdding&&this._unsubscribe(this._currentlyAdding)},_isEmpty:function(){return 0===this._curSources.length},_onEmpty:function(){},_clear:function(){m.prototype._clear.call(this),this._queue=null,this._curSources=null,this._$handleSubAny=null,this._$endHandlers=null}}),e(Lt,xt,{_name:"merge",_onEmpty:function(){this._initialised&&this._emitEnd()}}),e(Ht,m,{_name:"repeat",_handleAny:function(t){t.type===sn?(this._source=null,this._getSource()):this._emit(t.type,t.value)},_getSource:function(){if(!this._inLoop){this._inLoop=!0;for(var t=this._generator;null===this._source&&this._alive&&this._active;)this._source=t(this._iteration++),this._source?this._source.onAny(this._$handleAny):this._emitEnd();this._inLoop=!1}},_onActivation:function(){this._source?this._source.onAny(this._$handleAny):this._getSource()},_onDeactivation:function(){this._source&&this._source.offAny(this._$handleAny)},_clear:function(){m.prototype._clear.call(this),this._generator=null,this._source=null,this._$handleAny=null}}),e(Nt,xt,{_name:"pool",plug:function(t){return this._add(t),this},unplug:function(t){return this._remove(t),this}}),e(qt,xt,{_onActivation:function(){xt.prototype._onActivation.call(this),this._active&&this._source.onAny(this._$handleMain)},_onDeactivation:function(){xt.prototype._onDeactivation.call(this),this._source.offAny(this._$handleMain),this._hadNoEvSinceDeact=!0},_handleMain:function(t){if(t.type===un){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===on&&this._emitError(t.value),t.type===sn&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)},_onEmpty:function(){this._mainEnded&&this._emitEnd()},_clear:function(){xt.prototype._clear.call(this),this._source=null,this._lastCurrent=null,this._$handleMain=null}}),e(Wt,qt,{_handleMain:function(t){if(t.type===on){var n=this._activating&&this._hadNoEvSinceDeact&&this._lastCurrent===t.value;n||this._add(t.value,this._fn),this._lastCurrent=t.value,this._hadNoEvSinceDeact=!1}t.type===un&&this._emitValue(t.value),t.type===sn&&(this._isEmpty()?this._emitEnd():this._mainEnded=!0)}});var le={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._lastSecondary&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary!==rn&&this._lastSecondary||this._emitEnd()}},_e=Ut("filterBy",le),fe=Ft("filterBy",le),ce=function(t,n){return n},de={_handlePrimaryValue:function(t){this._lastSecondary!==rn&&this._emitValue(t)},_handleSecondaryEnd:function(){this._lastSecondary===rn&&this._emitEnd()}},ve=Ut("skipUntilBy",de),pe=Ft("skipUntilBy",de),me={_handleSecondaryValue:function(){this._emitEnd()}},ye=Ut("takeUntilBy",me),ge=Ft("takeUntilBy",me),Ee={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n;this._buff=[],this._flushOnEnd=i},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_onActivation:function(){this._primary.onAny(this._$handlePrimaryAny),this._alive&&null!==this._secondary&&this._secondary.onAny(this._$handleSecondaryAny)},_handlePrimaryValue:function(t){this._buff.push(t)},_handleSecondaryValue:function(){this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._emitEnd()}},be=Ut("bufferBy",Ee),Ae=Ft("bufferBy",Ee),we={_init:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.flushOnEnd,i=void 0===n||n,e=t.flushOnChange,r=void 0!==e&&e;this._buff=[],this._flushOnEnd=i,this._flushOnChange=r},_free:function(){this._buff=null},_flush:function(){null!==this._buff&&(this._emitValue(this._buff),this._buff=[])},_handlePrimaryEnd:function(){this._flushOnEnd&&this._flush(),this._emitEnd()},_handlePrimaryValue:function(t){this._buff.push(t),this._lastSecondary===rn||this._lastSecondary||this._flush()},_handleSecondaryEnd:function(){this._flushOnEnd||this._lastSecondary!==rn&&!this._lastSecondary||this._emitEnd()},_handleSecondaryValue:function(t){this._flushOnChange&&!t&&this._flush(),this._lastSecondary=t}},Se=Ut("bufferWhileBy",we),Ve=Ft("bufferWhileBy",we),Te=function(){return!1},$e=function(){return!0},Ce={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleValue:function(t){var n=this._fn,i=n(t);i.convert?this._emitError(i.error):this._emitValue(t)}},ke=B("valuesToErrors",Ce),Ie=j("valuesToErrors",Ce),Oe=function(t){return{convert:!0,error:t}},xe={_init:function(t){var n=t.fn;this._fn=n},_free:function(){this._fn=null},_handleError:function(t){var n=this._fn,i=n(t);i.convert?this._emitValue(i.value):this._emitError(t)}},Le=B("errorsToValues",xe),Pe=j("errorsToValues",xe),He=function(t){return{convert:!0,value:t}},Me={_handleError:function(t){this._emitError(t),this._emitEnd()}},De=B("endOnError",Me),Ne=j("endOnError",Me);p.prototype.toProperty=function(t){return U(this,t)},p.prototype.changes=function(){return F(this)},p.prototype.toPromise=function(t){return Y(this,t)},p.prototype.toESObservable=R,p.prototype[Sn]=R,p.prototype.map=function(t){return nt(this,t)},p.prototype.filter=function(t){return it(this,t)},p.prototype.take=function(t){return et(this,t)},p.prototype.takeErrors=function(t){return rt(this,t)},p.prototype.takeWhile=function(t){return st(this,t)},p.prototype.last=function(){return ut(this)},p.prototype.skip=function(t){return ot(this,t)},p.prototype.skipWhile=function(t){return at(this,t)},p.prototype.skipDuplicates=function(t){return ht(this,t)},p.prototype.diff=function(t,n){return _t(this,t,n)},p.prototype.scan=function(t,n){return ft(this,t,n)},p.prototype.flatten=function(t){return ct(this,t)},p.prototype.delay=function(t){return dt(this,t)},p.prototype.throttle=function(t,n){return vt(this,t,n)},p.prototype.debounce=function(t,n){return pt(this,t,n)},p.prototype.mapErrors=function(t){return mt(this,t)},p.prototype.filterErrors=function(t){return yt(this,t)},p.prototype.ignoreValues=function(){return gt(this)},p.prototype.ignoreErrors=function(){return Et(this)},p.prototype.ignoreEnd=function(){return bt(this)},p.prototype.beforeEnd=function(t){return At(this,t)},p.prototype.slidingWindow=function(t,n){return wt(this,t,n)},p.prototype.bufferWhile=function(t,n){return St(this,t,n)},p.prototype.bufferWithCount=function(t,n){return Vt(this,t,n)},p.prototype.bufferWithTimeOrCount=function(t,n,i){return Tt(this,t,n,i)},p.prototype.transduce=function(t){return Ct(this,t)},p.prototype.withHandler=function(t){return kt(this,t)},p.prototype.combine=function(t,n){return tt([this,t],n)},p.prototype.zip=function(t,n){return Ot([this,t],n)},p.prototype.merge=function(t){return Pt([this,t])},p.prototype.concat=function(t){return Dt([this,t])};var qe=function(){return new Nt};p.prototype.flatMap=function(t){return new qt(this,t).setName(this,"flatMap")},p.prototype.flatMapLatest=function(t){return new qt(this,t,{concurLim:1,drop:"old"}).setName(this,"flatMapLatest")},p.prototype.flatMapFirst=function(t){return new qt(this,t,{concurLim:1}).setName(this,"flatMapFirst")},p.prototype.flatMapConcat=function(t){return new qt(this,t,{queueLim:-1,concurLim:1}).setName(this,"flatMapConcat")},p.prototype.flatMapConcurLimit=function(t,n){return new qt(this,t,{queueLim:-1,concurLim:n}).setName(this,"flatMapConcurLimit")},p.prototype.flatMapErrors=function(t){return new Wt(this,t).setName(this,"flatMapErrors")},p.prototype.filterBy=function(t){return Qt(this,t)},p.prototype.sampledBy=function(t,n){return zt(this,t,n)},p.prototype.skipUntilBy=function(t){return Yt(this,t)},p.prototype.takeUntilBy=function(t){return Kt(this,t)},p.prototype.bufferBy=function(t,n){return Gt(this,t,n)},p.prototype.bufferWhileBy=function(t,n){return Jt(this,t,n)};var We=!0;p.prototype.awaiting=function(t){return en("You are using deprecated .awaiting() method, see https://github.com/rpominov/kefir/issues/145"),Rt(this,t)},p.prototype.valuesToErrors=function(t){return en("You are using deprecated .valuesToErrors() method, see https://github.com/rpominov/kefir/issues/149"),Xt(this,t)},p.prototype.errorsToValues=function(t){return en("You are using deprecated .errorsToValues() method, see https://github.com/rpominov/kefir/issues/149"),Zt(this,t)},p.prototype.endOnError=function(){return en("You are using deprecated .endOnError() method, see https://github.com/rpominov/kefir/issues/150"),tn(this)};var Be={Observable:p,Stream:m,Property:y,never:g,later:b,interval:A,sequentially:w,fromPoll:S,withInterval:T,fromCallback:k,fromNodeCallback:I,fromEvents:P,stream:C,constant:M,constantError:N,fromPromise:Q,fromESObservable:G,combine:tt,zip:Ot,merge:Pt,concat:Dt,Pool:Nt,pool:qe,repeat:Mt,staticLand:Tn};Be.Kefir=Be,t.dissableDeprecationWarnings=nn,t.Kefir=Be,t.Observable=p,t.Stream=m,t.Property=y,t.never=g,t.later=b,t.interval=A,t.sequentially=w,t.fromPoll=S,t.withInterval=T,t.fromCallback=k,t.fromNodeCallback=I,t.fromEvents=P,t.stream=C,t.constant=M,t.constantError=N,t.fromPromise=Q,t.fromESObservable=G,t.combine=tt,t.zip=Ot,t.merge=Pt,t.concat=Dt,t.Pool=Nt,t.pool=qe,t.repeat=Mt,t.staticLand=Tn,t.default=Be,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=kefir.min.js.map
{
"name": "kefir",
"version": "3.5.2",
"version": "3.6.0",
"description": "Reactive Programming library for JavaScript inspired by Bacon.js and RxJS with focus on high performance and low memory usage",

@@ -5,0 +5,0 @@ "main": "dist/kefir.js",

@@ -19,2 +19,3 @@ import {extend} from './utils/objects';

this._items = [];
this._spies = [];
this._inLoop = 0;

@@ -47,4 +48,22 @@ this._removedItems = null;

addSpy(fn) {
this._spies = concat(this._spies, [fn]);
return this._spies.length;
},
// Because spies are only ever a function that perform logging as
// their only side effect, we don't need the same complicated
// removal logic like in remove()
removeSpy(fn) {
this._spies = remove(this._spies, this._spies.indexOf(fn));
return this._spies.length;
},
dispatch(event) {
this._inLoop++;
for (let i = 0, spies = this._spies; this._spies !== null && i < spies.length; i++) {
spies[i](event);
}
for (let i = 0, items = this._items; i < items.length; i++) {

@@ -72,2 +91,3 @@

this._items = null;
this._spies = null;
}

@@ -74,0 +94,0 @@

@@ -14,2 +14,3 @@ import {extend} from './utils/objects';

this._logHandlers = null;
this._spyHandlers = null;
}

@@ -202,2 +203,32 @@

return this;
},
spy(name = this.toString()) {
let handler = function(event) {
let type = `<${event.type}>`;
if (event.type === END) {
console.log(name, type);
} else {
console.log(name, type, event.value);
}
};
if (this._alive) {
if (!this._spyHandlers) {
this._spyHandlers = [];
}
this._spyHandlers.push({name: name, handler: handler});
this._dispatcher.addSpy(handler);
}
return this;
},
offSpy(name = this.toString()) {
if (this._spyHandlers) {
let handlerIndex = findByPred(this._spyHandlers, obj => obj.name === name);
if (handlerIndex !== -1) {
this._dispatcher.removeSpy(this._spyHandlers[handlerIndex].handler);
this._spyHandlers.splice(handlerIndex, 1);
}
}
return this;
}

@@ -204,0 +235,0 @@ });

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc