"use strict";function n(n,t){return t.tag=n,t}function t(n){}function e(t){return function(e){var r=t.length;let u=!1,o=!1,i=!1,f=0;e(n(0,[function(c){if(c)u=!0;else if(o)i=!0;else{for(o=i=!0;i&&!u;)f=n&&0=n?(t(1),o(u)):(f=t,t(0)))}))}}}var w=a,A=g,P=y,T=y,L=h,j=h,M=k,C=S;function I(n){return function(e){let r=t,u=!1;return e((function(t){"number"==typeof t?u=!0:t.tag?u||(n(t[0]),r(0)):(r=t=t[0],t(0))})),{unsubscribe:function(n){if(!u)return u=!0,r(1)}}}}function O(n){}var U=I,W="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function D(n){}function V(){}function q(){}function z(n,t,e){n.addEventListener(t,e)}function B(n,t,e){n.removeEventListener(t,e)}exports.buffer=function(e){return function(r){return function(u){function o(t){"number"==typeof t?s||(s=!0,f(1),0p?p=p+1|0:b||(b=!0,u(0)):t.tag?(t=t[0],void 0!==e?b||(f=l(t),a=!1,u(n(1,[[t,s(e)]]))):(f=l(t),a?a=!1:i(0))):o=t[0]})),r((function(t){var e=f;"number"==typeof t?1>p?p=p+1|0:b||(b=!0,u(0)):t.tag?(t=t[0],void 0!==e?b||(c=l(t),a=!1,u(n(1,[[s(e),t]]))):(c=l(t),a?a=!1:o(0))):i=t[0]})),u(n(0,[function(n){if(!b){if(n)return b=!0,o(1),i(1);if(!a)return a=!0,o(n),i(n)}}]))}}(e,r)},exports.concat=function(n){return a(b)(e(n))},exports.concatAll=function(n){return a(p)(n)},exports.concatMap=w,exports.debounce=function(t){return function(e){return function(r){let u=void 0,o=!1,i=!1;var f=function(n){void 0!==(n=u)&&(u=void 0,clearTimeout(s(n)))};return e((function(e){if("number"==typeof e)i||(i=!0,void 0!==u?o=!0:r(0));else if(e.tag)i||(f(),u=l(setTimeout((function(n){u=void 0,r(e),o&&r(0)}),t(e[0]))));else{var c=e[0];r(n(0,[function(n){if(!i)return n?(i=!0,o=!1,f(),c(1)):c(0)}]))}}))}}},exports.delay=function(n){return function(t){return function(e){let r=0;return t((function(t){"number"==typeof t||t.tag?(r=r+1|0,setTimeout((function(n){0!==r&&(r=r-1|0,e(t))}),n)):e(t)}))}}},exports.empty=f,exports.filter=function(n){return function(e){return function(r){let u=t;return e((function(t){"number"==typeof t?r(t):t.tag?n(t[0])?r(t):u(0):(u=t[0],r(t))}))}}},exports.flatten=T,exports.forEach=function(n){return function(t){I(n)(t)}},exports.fromArray=i,exports.fromCallbag=function(t){return function(e){var r=function(t,r){switch(t){case 0:e(n(0,[function(n){return r(n?2:1)}]));break;case 1:e(n(1,[r]));break;case 2:e(0)}};return 2===t.length?t(0,r):t.bind(null,0,r)}},exports.fromDomEvent=function(t,e){return function(t,e){return function(r){var u=z,o=B,i=function(t){r(n(1,[t]))};return r(n(0,[function(n){if(n)return o(t,e,i)}])),u(t,e,i)}}(t,e)},exports.fromList=function(t){return function(e){let r=!1,u=!1,o=!1,i=t;e(n(0,[function(t){if(t)r=!0;else if(u)o=!0;else{for(u=o=!0;o&&!r;)(t=i)?(i=t[1],o=!1,e(n(1,[t[0]]))):(r=!0,e(0));u=!1}}]))}},exports.fromObservable=function(t){var e=void 0!==t[W]?t[W]():t;return function(t){var r=e.subscribe({next:function(e){t(n(1,[e]))},complete:function(){t(0)},error:D});t(n(0,[function(n){if(n)return r.unsubscribe()}]))}},exports.fromPromise=function(t){return function(e){let r=!1;t.then((function(t){return r||(e(n(1,[t])),e(0)),Promise.resolve(void 0)})),e(n(0,[function(n){n&&(r=!0)}]))}},exports.fromValue=function(t){return function(e){let r=!1;e(n(0,[function(u){u?r=!0:r||(r=!0,e(n(1,[t])),e(0))}]))}},exports.interval=function(t){return function(e){let r=0;var u=setInterval((function(t){t=r,r=r+1|0,e(n(1,[t]))}),t);e(n(0,[function(n){n&&clearInterval(u)}]))}},exports.make=function(t){return function(e){let u=r,o=!1;u=t({next:function(t){o||e(n(1,[t]))},complete:function(n){o||(o=!0,e(0))}}),e(n(0,[function(n){if(n&&!o)return o=!0,u()}]))}},exports.makeSubject=function(t){let e=[],r=!1;return{source:function(t){function r(n){return n!==t}e=e.concat(t),t(n(0,[function(n){n&&(e=e.filter(r))}]))},next:function(t){r||e.forEach((function(e){e(n(1,[t]))}))},complete:function(n){r||(r=!0,e.forEach(u))}}},exports.map=function(t){return function(e){return function(r){return e((function(e){e="number"==typeof e?0:e.tag?n(1,[t(e[0])]):n(0,[e[0]]),r(e)}))}}},exports.merge=function(n){return g(v)(e(n))},exports.mergeAll=P,exports.mergeMap=A,exports.never=function(e){e(n(0,[t]))},exports.onEnd=function(t){return function(e){return function(r){let u=!1;return e((function(e){if("number"==typeof e){if(u)return;return u=!0,r(e),t()}if(e.tag)u||r(e);else{var o=e[0];r(n(0,[function(n){if(!u)return n?(u=!0,o(n),t()):o(n)}]))}}))}}},exports.onPush=L,exports.onStart=function(n){return function(t){return function(e){return t((function(t){"number"==typeof t||t.tag?e(t):(e(t),n())}))}}},exports.pipe=function(){for(var n=arguments,t=arguments[0],e=1,r=arguments.length;e=e&&(o=!0,u(0),f(1))):(n=n[0],0>=e?(o=!0,u(0),n(1)):f=n)})),u(n(0,[function(n){if(!o){if(n)return o=!0,f(1);if(i