Comparing version 4.0.0-rc.0 to 4.0.0-rc.1
@@ -9,3 +9,3 @@ import { operatorT as Wonka_types_operatorT } from './Wonka_types.gen'; | ||
export declare const filter: <a>(_1: ((_1: a) => boolean)) => Wonka_types_operatorT<a, a>; | ||
export declare const map: <a, b>(_1: ((_1: a) => b)) => Wonka_types_operatorT<a, b>; | ||
export declare const map: <b>(_1: ((_1: b) => b)) => Wonka_types_operatorT<b, b>; | ||
export declare const mergeMap: <a, b>(_1: ((_1: a) => Wonka_types_sourceT<b>)) => Wonka_types_operatorT<a, b>; | ||
@@ -12,0 +12,0 @@ export declare const merge: <a>(_1: Wonka_types_sourceT<a>[]) => Wonka_types_sourceT<a>; |
@@ -1,2 +0,2 @@ | ||
function h(a, b) { | ||
function k(a, b) { | ||
b.tag = a; | ||
@@ -6,9 +6,9 @@ return b; | ||
var l = []; | ||
var m = []; | ||
function m(a) { | ||
function n(a) { | ||
if (void 0 === a) { | ||
return (a = [ l, 0 ]).tag = 256, a; | ||
return (a = [ m, 0 ]).tag = 256, a; | ||
} | ||
null !== a && a[0] === l && ((a = [ l, a[1] + 1 | 0 ]).tag = 256); | ||
null !== a && a[0] === m && ((a = [ m, a[1] + 1 | 0 ]).tag = 256); | ||
return a; | ||
@@ -18,5 +18,5 @@ } | ||
function q(a) { | ||
if (null !== a && a[0] === l) { | ||
if (null !== a && a[0] === m) { | ||
if (0 !== (a = a[1])) { | ||
return [ l, a - 1 | 0 ]; | ||
return [ m, a - 1 | 0 ]; | ||
} | ||
@@ -28,3 +28,55 @@ } else { | ||
function r(a, b, c) { | ||
function r() { | ||
return 0; | ||
} | ||
function t(a, b) { | ||
let c = !1, d = !1, e = !1; | ||
return a(k(0, [ function(f) { | ||
if (f) { | ||
c = !0; | ||
} else if (d) { | ||
e = !0; | ||
} else { | ||
for (d = e = !0; e && !c; ) { | ||
void 0 !== (f = b()) ? (e = !1, a(k(1, [ q(f) ]))) : (c = !0, a(0)); | ||
} | ||
d = !1; | ||
} | ||
return 0; | ||
} ])); | ||
} | ||
function u(a) { | ||
return function(b) { | ||
var c = a.length; | ||
let d = 0; | ||
return t(b, (function() { | ||
if (d < c) { | ||
var e = a[d]; | ||
d = d + 1 | 0; | ||
return n(e); | ||
} | ||
})); | ||
}; | ||
} | ||
function w() { | ||
return 0; | ||
} | ||
function x(a) { | ||
return a(0); | ||
} | ||
function y(a) { | ||
let b = !1; | ||
a(k(0, [ function(a) { | ||
a && (b = !0); | ||
return 0; | ||
} ])); | ||
return b ? 0 : a(0); | ||
} | ||
function z(a, b, c) { | ||
for (var d = Array(c), e = 0; e < c; ) { | ||
@@ -36,3 +88,3 @@ d[e] = a[b], e = e + 1 | 0, b = b + 1 | 0; | ||
function t(a, b) { | ||
function A(a, b) { | ||
for (;;) { | ||
@@ -45,7 +97,7 @@ var c = b; | ||
if (0 > b) { | ||
b = r(c, d, 0 | -b), a = a.apply(null, r(c, 0, d)); | ||
b = z(c, d, 0 | -b), a = a.apply(null, z(c, 0, d)); | ||
} else { | ||
return function(a, c) { | ||
return function(d) { | ||
return t(a, c.concat([ d ])); | ||
return A(a, c.concat([ d ])); | ||
}; | ||
@@ -57,5 +109,5 @@ }(a, c); | ||
function v(a, b) { | ||
function C(a, b) { | ||
var c = a.length; | ||
return 1 === c ? a(b) : function u(a, b, c) { | ||
return 1 === c ? a(b) : function B(a, b, c) { | ||
switch (c) { | ||
@@ -86,13 +138,13 @@ case 1: | ||
case 6: | ||
return function(c, e, f, g, k) { | ||
return a(b, c, e, f, g, k); | ||
return function(c, e, f, g, h) { | ||
return a(b, c, e, f, g, h); | ||
}; | ||
case 7: | ||
return function(c, e, f, g, k, n) { | ||
return a(b, c, e, f, g, k, n); | ||
return function(c, e, f, g, h, l) { | ||
return a(b, c, e, f, g, h, l); | ||
}; | ||
default: | ||
return t(a, [ b ]); | ||
return A(a, [ b ]); | ||
} | ||
@@ -102,8 +154,8 @@ }(a, b, c); | ||
function x(a, b, c) { | ||
function E(a, b, c) { | ||
var d = a.length; | ||
return 2 === d ? a(b, c) : function w(a, b, c, d) { | ||
return 2 === d ? a(b, c) : function D(a, b, c, d) { | ||
switch (d) { | ||
case 1: | ||
return t(a(b), [ c ]); | ||
return A(a(b), [ c ]); | ||
@@ -114,28 +166,28 @@ case 2: | ||
case 3: | ||
return function(d) { | ||
return a(b, c, d); | ||
return function(e) { | ||
return a(b, c, e); | ||
}; | ||
case 4: | ||
return function(d, f) { | ||
return a(b, c, d, f); | ||
return function(e, d) { | ||
return a(b, c, e, d); | ||
}; | ||
case 5: | ||
return function(d, f, g) { | ||
return a(b, c, d, f, g); | ||
return function(e, d, g) { | ||
return a(b, c, e, d, g); | ||
}; | ||
case 6: | ||
return function(d, f, g, k) { | ||
return a(b, c, d, f, g, k); | ||
return function(e, d, g, h) { | ||
return a(b, c, e, d, g, h); | ||
}; | ||
case 7: | ||
return function(d, f, g, k, n) { | ||
return a(b, c, d, f, g, k, n); | ||
return function(e, d, g, h, l) { | ||
return a(b, c, e, d, g, h, l); | ||
}; | ||
default: | ||
return t(a, [ b, c ]); | ||
return A(a, [ b, c ]); | ||
} | ||
@@ -145,11 +197,11 @@ }(a, b, c, d); | ||
function z(a, b, c, d) { | ||
function G(a, b, c, d) { | ||
var e = a.length; | ||
return 3 === e ? a(b, c, d) : function y(a, b, c, d, e) { | ||
return 3 === e ? a(b, c, d) : function F(a, b, c, d, e) { | ||
switch (e) { | ||
case 1: | ||
return t(a(b), [ c, d ]); | ||
return A(a(b), [ c, d ]); | ||
case 2: | ||
return t(a(b, c), [ d ]); | ||
return A(a(b, c), [ d ]); | ||
@@ -170,13 +222,13 @@ case 3: | ||
case 6: | ||
return function(e, g, k) { | ||
return a(b, c, d, e, g, k); | ||
return function(e, g, h) { | ||
return a(b, c, d, e, g, h); | ||
}; | ||
case 7: | ||
return function(e, g, k, n) { | ||
return a(b, c, d, e, g, k, n); | ||
return function(e, g, h, l) { | ||
return a(b, c, d, e, g, h, l); | ||
}; | ||
default: | ||
return t(a, [ b, c, d ]); | ||
return A(a, [ b, c, d ]); | ||
} | ||
@@ -186,61 +238,10 @@ }(a, b, c, d, e); | ||
function A() { | ||
return 0; | ||
} | ||
function B(a, b) { | ||
let c = A; | ||
return v(a, (function(a) { | ||
"number" == typeof a || a.tag || (c = a[0]); | ||
return b(a, c); | ||
})); | ||
} | ||
function C(a, b) { | ||
let c = !1, d = !1, e = !1; | ||
return a(h(0, [ function(f) { | ||
if (f) { | ||
c = !0; | ||
} else if (d) { | ||
e = !0; | ||
} else { | ||
for (d = e = !0; e && !c; ) { | ||
void 0 !== (f = b()) ? (e = !1, a(h(1, [ q(f) ]))) : (c = !0, a(0)); | ||
} | ||
d = !1; | ||
} | ||
return 0; | ||
} ])); | ||
} | ||
function D(a) { | ||
return function(b) { | ||
var c = a.length; | ||
let d = 0; | ||
return C(b, (function() { | ||
if (d < c) { | ||
var e = a[d]; | ||
d = d + 1 | 0; | ||
return m(e); | ||
} | ||
})); | ||
}; | ||
} | ||
function E() { | ||
return 0; | ||
} | ||
function F(a) { | ||
return a(0); | ||
} | ||
function G(a, b) { | ||
function H(a, b) { | ||
return function(c) { | ||
let d = A, e = A, f = void 0, g = void 0, k = !1, n = 0, p = !1; | ||
v(a, (function(a) { | ||
var e = g; | ||
let d = r, e = r, f = void 0, g = void 0, h = !1, l = 0, p = !1; | ||
C(a, (function(a) { | ||
var b = g; | ||
if ("number" == typeof a) { | ||
if (1 > n) { | ||
return n = n + 1 | 0, 0; | ||
if (1 > l) { | ||
return l = l + 1 | 0, 0; | ||
} | ||
@@ -255,13 +256,12 @@ if (p) { | ||
a = a[0]; | ||
if (void 0 !== e) { | ||
if (void 0 !== b) { | ||
if (p) { | ||
return 0; | ||
} | ||
f = m(a); | ||
k = !1; | ||
return c(h(1, [ [ a, q(e) ] ])); | ||
f = n(a); | ||
h = !1; | ||
return c(k(1, [ [ a, q(b) ] ])); | ||
} | ||
f = m(a); | ||
k = !1; | ||
return 0; | ||
f = n(a); | ||
return h ? (h = !1, 0) : e(0); | ||
} | ||
@@ -271,7 +271,7 @@ d = a[0]; | ||
})); | ||
v(b, (function(a) { | ||
var d = f; | ||
C(b, (function(a) { | ||
var b = f; | ||
if ("number" == typeof a) { | ||
if (1 > n) { | ||
return n = n + 1 | 0, 0; | ||
if (1 > l) { | ||
return l = l + 1 | 0, 0; | ||
} | ||
@@ -286,13 +286,12 @@ if (p) { | ||
a = a[0]; | ||
if (void 0 !== d) { | ||
if (void 0 !== b) { | ||
if (p) { | ||
return 0; | ||
} | ||
g = m(a); | ||
k = !1; | ||
return c(h(1, [ [ q(d), a ] ])); | ||
g = n(a); | ||
h = !1; | ||
return c(k(1, [ [ q(b), a ] ])); | ||
} | ||
g = m(a); | ||
k = !1; | ||
return 0; | ||
g = n(a); | ||
return h ? (h = !1, 0) : d(0); | ||
} | ||
@@ -302,3 +301,3 @@ e = a[0]; | ||
})); | ||
return c(h(0, [ function(a) { | ||
return c(k(0, [ function(a) { | ||
if (p) { | ||
@@ -310,6 +309,6 @@ return 0; | ||
} | ||
if (k) { | ||
if (h) { | ||
return 0; | ||
} | ||
k = !0; | ||
h = !0; | ||
d(a); | ||
@@ -321,3 +320,3 @@ return e(a); | ||
function H(a) { | ||
function I(a) { | ||
return function(b) { | ||
@@ -327,37 +326,44 @@ return function(c) { | ||
if ("number" == typeof b) { | ||
return k = !1, g = A, void 0 !== (b = e.shift()) ? v(a(q(b)), d) : p ? c(0) : 0; | ||
return l ? (l = !1, void 0 !== (b = e.shift()) ? C(a(q(b)), d) : v ? c(0) : 0) : 0; | ||
} | ||
if (b.tag) { | ||
if (n) { | ||
return 0; | ||
} | ||
c(h(1, [ b[0] ])); | ||
return g(0); | ||
return l ? (c(b), p ? (p = !1, 0) : h(0)) : 0; | ||
} | ||
k = !0; | ||
g = b = b[0]; | ||
l = !0; | ||
h = b = b[0]; | ||
p = !1; | ||
return b(0); | ||
} | ||
let e = [], f = A, g = A, k = !1, n = !1, p = !1; | ||
v(b, (function(b) { | ||
let e = [], f = r, g = !1, h = r, l = !1, p = !1, v = !1; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (p) { | ||
if (v) { | ||
return 0; | ||
} | ||
p = !0; | ||
return k || 0 !== e.length ? 0 : c(0); | ||
v = !0; | ||
return l || 0 !== e.length ? 0 : c(0); | ||
} | ||
if (b.tag) { | ||
if (p) { | ||
if (v) { | ||
return 0; | ||
} | ||
b = b[0]; | ||
k ? e.push(b) : v(a(b), d); | ||
return f(0); | ||
g ? g = !1 : (g = !0, f(0)); | ||
return l ? (e.push(b), 0) : C(a(b), d); | ||
} | ||
f = b = b[0]; | ||
return b(0); | ||
f = b[0]; | ||
return 0; | ||
})); | ||
return c(h(0, [ function(a) { | ||
return a ? (g(1), p || (n = p = !0, f(1), g = A), 0) : p ? 0 : g(0); | ||
return c(k(0, [ function(a) { | ||
if (a) { | ||
if (v) { | ||
return 0; | ||
} | ||
v = !0; | ||
l = !1; | ||
h(1); | ||
return f(1); | ||
} | ||
v || g || (g = !0, f(0)); | ||
return l && !p ? (p = !0, h(0)) : 0; | ||
} ])); | ||
@@ -368,6 +374,2 @@ }; | ||
function I(a) { | ||
return a; | ||
} | ||
function J(a) { | ||
@@ -378,18 +380,14 @@ return a; | ||
function K(a) { | ||
return a(1); | ||
return a; | ||
} | ||
function L(a) { | ||
return a(1); | ||
return a(0); | ||
} | ||
function M(a) { | ||
return a(0); | ||
} | ||
function N(a) { | ||
return function(b) { | ||
return function(c) { | ||
let e = A, f = [], g = !1; | ||
v(b, (function(b) { | ||
let d = r, e = !1, f = [], g = !1; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
@@ -406,26 +404,39 @@ if (g) { | ||
} | ||
!function d(a) { | ||
function d(a) { | ||
return a !== b; | ||
} | ||
let b = A; | ||
return v(a, (function(a) { | ||
{ | ||
var h = function(a) { | ||
return a !== d; | ||
}; | ||
e = !1; | ||
b = a(b[0]); | ||
let d = r; | ||
return C(b, (function(a) { | ||
if ("number" == typeof a) { | ||
return f = f.filter(d), g && 0 === f.length ? c(0) : 0; | ||
return 0 !== f.length ? (f = f.filter(h), g && 0 === f.length ? c(0) : 0) : 0; | ||
} | ||
if (a.tag) { | ||
return 0 !== f.length ? (c(h(1, [ a[0] ])), b(0)) : 0; | ||
return 0 !== f.length ? (c(k(1, [ a[0] ])), d(0)) : 0; | ||
} | ||
b = a = a[0]; | ||
d = a = a[0]; | ||
f = f.concat(a); | ||
return a(0); | ||
})); | ||
}(a(b[0])); | ||
return e(0); | ||
} | ||
} | ||
e = b = b[0]; | ||
return b(0); | ||
d = b[0]; | ||
return 0; | ||
})); | ||
return c(h(0, [ function(a) { | ||
a ? (f.forEach(K), g || (g = !0, e(1), f.forEach(L), f = [])) : g || f.forEach(M); | ||
return c(k(0, [ function(a) { | ||
if (!g) { | ||
if (a) { | ||
var b = f; | ||
g = !0; | ||
f = []; | ||
d(a); | ||
b.forEach((function c(c) { | ||
return c(a); | ||
})); | ||
} else { | ||
e || (e = !0, d(0)), f.forEach(L); | ||
} | ||
} | ||
return 0; | ||
@@ -437,2 +448,6 @@ } ])); | ||
function N(a) { | ||
return a; | ||
} | ||
function O(a) { | ||
@@ -443,13 +458,9 @@ return a; | ||
function P(a) { | ||
return a; | ||
return M(O)(a); | ||
} | ||
function Q(a) { | ||
return N(P)(a); | ||
} | ||
function R(a) { | ||
return function(b) { | ||
return function(c) { | ||
return v(b, (function(b) { | ||
return C(b, (function(b) { | ||
"number" != typeof b && b.tag && a(b[0]); | ||
@@ -462,16 +473,8 @@ return c(b); | ||
function S() { | ||
return 0; | ||
} | ||
function T() { | ||
return 0; | ||
} | ||
function U(a, b) { | ||
function R(a, b) { | ||
return function(c) { | ||
return function(d) { | ||
let e = b; | ||
return v(c, (function(c) { | ||
"number" == typeof c ? c = 0 : c.tag ? (e = a(e, c[0]), c = h(1, [ e ])) : c = h(0, [ c[0] ]); | ||
return C(c, (function(c) { | ||
"number" == typeof c ? c = 0 : c.tag ? (e = a(e, c[0]), c = k(1, [ e ])) : c = k(0, [ c[0] ]); | ||
return d(c); | ||
@@ -483,7 +486,7 @@ })); | ||
function V(a) { | ||
function S(a) { | ||
return a(0); | ||
} | ||
function W(a) { | ||
function T(a) { | ||
return function(b) { | ||
@@ -493,37 +496,44 @@ return function(c) { | ||
if ("number" == typeof a) { | ||
return g = !1, f = A, n ? c(0) : 0; | ||
return h ? (h = !1, p ? c(a) : 0) : 0; | ||
} | ||
if (a.tag) { | ||
if (k) { | ||
return 0; | ||
} | ||
c(h(1, [ a[0] ])); | ||
return f(0); | ||
return h ? (c(a), l ? (l = !1, 0) : g(0)) : 0; | ||
} | ||
g = !0; | ||
f = a = a[0]; | ||
h = !0; | ||
g = a = a[0]; | ||
l = !1; | ||
return a(0); | ||
} | ||
let e = A, f = A, g = !1, k = !1, n = !1; | ||
v(b, (function(b) { | ||
let e = r, f = !1, g = r, h = !1, l = !1, p = !1; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (n) { | ||
if (p) { | ||
return 0; | ||
} | ||
n = !0; | ||
return g ? 0 : c(0); | ||
p = !0; | ||
return h ? 0 : c(0); | ||
} | ||
if (b.tag) { | ||
if (n) { | ||
if (p) { | ||
return 0; | ||
} | ||
g && (f(1), f = A); | ||
v(a(b[0]), d); | ||
return e(0); | ||
h && (g(1), g = r); | ||
f ? f = !1 : (f = !0, e(0)); | ||
return C(b = a(b[0]), d); | ||
} | ||
e = b = b[0]; | ||
return b(0); | ||
e = b[0]; | ||
return 0; | ||
})); | ||
return c(h(0, [ function(a) { | ||
return a ? (f(1), n || (k = n = !0, e(1), f = A), 0) : f(0); | ||
return c(k(0, [ function(a) { | ||
if (a) { | ||
if (p) { | ||
return 0; | ||
} | ||
p = !0; | ||
h = !1; | ||
g(1); | ||
return e(1); | ||
} | ||
p || f || (f = !0, e(0)); | ||
return h && !l ? (l = !0, g(0)) : 0; | ||
} ])); | ||
@@ -534,19 +544,27 @@ }; | ||
function aa(a) { | ||
function U(a) { | ||
return a; | ||
} | ||
function X(a) { | ||
function V(a) { | ||
return function(b) { | ||
return function(c) { | ||
function d() { | ||
return e.shift(); | ||
return f.shift(); | ||
} | ||
var e = []; | ||
return B(b, (function(b, g) { | ||
let e = r; | ||
var f = []; | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return C(c, d); | ||
return t(c, d); | ||
} | ||
b.tag && (e.length >= a && 0 < a && e.shift(), e.push(b[0])); | ||
return g(0); | ||
if (b.tag) { | ||
return f.length >= a && 0 < a && f.shift(), f.push(b[0]), e(0); | ||
} | ||
b = b[0]; | ||
if (0 >= a) { | ||
return b(1), y(c); | ||
} | ||
e = b; | ||
return b(0); | ||
})); | ||
@@ -557,6 +575,6 @@ }; | ||
function Y(a) { | ||
function W(a) { | ||
return function(b) { | ||
let c = A, d = !1; | ||
v(b, (function(b) { | ||
let c = r, d = !1; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
@@ -587,29 +605,29 @@ return d = !0, 0; | ||
function ba() { | ||
function X() { | ||
return 0; | ||
} | ||
var Z = "function" == typeof Symbol ? Symbol.observable || (Symbol.observable = Symbol("observable")) : "@@observable"; | ||
var Y = "function" == typeof Symbol ? Symbol.observable || (Symbol.observable = Symbol("observable")) : "@@observable"; | ||
function ca() { | ||
function Z() { | ||
return 0; | ||
} | ||
function da(a, b, c) { | ||
function aa(a, b, c) { | ||
a.addEventListener(b, c); | ||
} | ||
function ea(a, b, c) { | ||
function ba(a, b, c) { | ||
a.removeEventListener(b, c); | ||
} | ||
function fa(a, b) { | ||
function ca(a, b) { | ||
return function(c) { | ||
function d(a) { | ||
return c(h(1, [ a ])); | ||
return c(k(1, [ a ])); | ||
} | ||
c(h(0, [ function(c) { | ||
return c ? z(ea, a, b, d) : 0; | ||
c(k(0, [ function(c) { | ||
return c ? G(ba, a, b, d) : 0; | ||
} ])); | ||
return z(da, a, b, d); | ||
return G(aa, a, b, d); | ||
}; | ||
@@ -623,44 +641,56 @@ } | ||
if ("number" == typeof a) { | ||
if (k) { | ||
if (l) { | ||
return 0; | ||
} | ||
k = !0; | ||
l = !0; | ||
f(1); | ||
c(h(1, [ e ])); | ||
0 < e.length && c(k(1, [ e ])); | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (k) { | ||
if (l || 0 >= e.length) { | ||
return 0; | ||
} | ||
c(h(1, [ e ])); | ||
a = e; | ||
e = []; | ||
return g(0); | ||
return c(k(1, [ a ])); | ||
} | ||
g = a[0]; | ||
return g(0); | ||
return 0; | ||
} | ||
let e = [], f = A, g = A, k = !1; | ||
v(b, (function(b) { | ||
let e = [], f = r, g = r, h = !1, l = !1; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (k) { | ||
if (l) { | ||
return 0; | ||
} | ||
k = !0; | ||
l = !0; | ||
g(1); | ||
c(h(1, [ e ])); | ||
0 < e.length && c(k(1, [ e ])); | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (k) { | ||
if (l) { | ||
return 0; | ||
} | ||
e.push(b[0]); | ||
return f(0); | ||
h = !1; | ||
return g(0); | ||
} | ||
f = b[0]; | ||
return v(a, d); | ||
return C(a, d); | ||
})); | ||
return c(h(0, [ function(a) { | ||
return k ? 0 : a ? (k = !0, f(1), g(1)) : f(0); | ||
return c(k(0, [ function(a) { | ||
if (l) { | ||
return 0; | ||
} | ||
if (a) { | ||
return l = !0, f(1), g(1); | ||
} | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
f(0); | ||
return g(0); | ||
} ])); | ||
@@ -672,11 +702,11 @@ }; | ||
function combine(a, b) { | ||
return x(G, a, b); | ||
return E(H, a, b); | ||
} | ||
function concat(a) { | ||
return H(J)(D(a)); | ||
return I(K)(u(a)); | ||
} | ||
function concatAll(a) { | ||
return H(I)(a); | ||
return I(J)(a); | ||
} | ||
@@ -688,21 +718,25 @@ | ||
function d() { | ||
var a = f; | ||
void 0 !== a && (f = void 0, clearTimeout(q(a))); | ||
var a = e; | ||
void 0 !== a && (e = void 0, clearTimeout(q(a))); | ||
return 0; | ||
} | ||
let e = !1, f = void 0; | ||
return v(b, (function(b) { | ||
let e = void 0, f = !1, g = !1; | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return e = !0, void 0 !== f ? 0 : c(0); | ||
if (g) { | ||
return 0; | ||
} | ||
g = !0; | ||
return void 0 !== e ? (f = !0, 0) : c(0); | ||
} | ||
if (b.tag) { | ||
return d(), f = m(setTimeout((function g() { | ||
f = void 0; | ||
return g || (d(), e = n(setTimeout((function h() { | ||
e = void 0; | ||
c(b); | ||
return e ? c(0) : 0; | ||
}), a(b[0]))), 0; | ||
return f ? c(0) : 0; | ||
}), a(b[0])))), 0; | ||
} | ||
var n = b[0]; | ||
return c(h(0, [ function(a) { | ||
return a ? (d(), n(1)) : n(a); | ||
var p = b[0]; | ||
return c(k(0, [ function(a) { | ||
return g ? 0 : a ? (g = !0, f = !1, d(), p(1)) : p(0); | ||
} ])); | ||
@@ -717,16 +751,13 @@ })); | ||
return function(c) { | ||
let d = A, e = 0, f = !1; | ||
v(b, (function(b) { | ||
let d = 0; | ||
return C(b, (function(b) { | ||
if ("number" != typeof b && !b.tag) { | ||
return d = b[0], 0; | ||
return c(b); | ||
} | ||
f || (e = e + 1 | 0, setTimeout((function g() { | ||
f && 0 === e ? c(0) : e = e - 1 | 0; | ||
return c(b); | ||
}), a)); | ||
d = d + 1 | 0; | ||
setTimeout((function() { | ||
return 0 !== d ? (d = d - 1 | 0, c(b)) : 0; | ||
}), a); | ||
return 0; | ||
})); | ||
return c(h(0, [ function(a) { | ||
return a ? (f = !0, 0 === e ? c(0) : 0) : f ? 0 : d(a); | ||
} ])); | ||
}; | ||
@@ -736,12 +767,15 @@ }; | ||
function empty(a) { | ||
a(h(0, [ A ])); | ||
return a(0); | ||
} | ||
function filter(a) { | ||
return function(b) { | ||
return function(c) { | ||
return B(b, (function(b, e) { | ||
return "number" == typeof b || !b.tag || a(b[0]) ? c(b) : e(0); | ||
let d = r; | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return c(b); | ||
} | ||
if (b.tag) { | ||
return a(b[0]) ? c(b) : d(0); | ||
} | ||
d = b[0]; | ||
return c(b); | ||
})); | ||
@@ -754,3 +788,3 @@ }; | ||
return function(b) { | ||
Y(a)(b); | ||
W(a)(b); | ||
return 0; | ||
@@ -762,6 +796,6 @@ }; | ||
return function(b) { | ||
return x(a, 0, (function(a, d) { | ||
return E(a, 0, (function(a, d) { | ||
switch (a) { | ||
case 0: | ||
return b(h(0, [ function c(a) { | ||
return b(k(0, [ function c(a) { | ||
return a ? d(2) : d(1); | ||
@@ -771,3 +805,3 @@ } ])); | ||
case 1: | ||
return b(h(1, [ d ])); | ||
return b(k(1, [ d ])); | ||
@@ -782,3 +816,3 @@ case 2: | ||
function fromDomEvent(a, b) { | ||
return x(fa, a, b); | ||
return E(ca, a, b); | ||
} | ||
@@ -789,6 +823,6 @@ | ||
let c = a; | ||
return C(b, (function() { | ||
return t(b, (function() { | ||
var a = c; | ||
if (a) { | ||
return c = a[1], m(a[0]); | ||
return c = a[1], n(a[0]); | ||
} | ||
@@ -800,7 +834,7 @@ })); | ||
function fromObservable(a) { | ||
var b = void 0 !== a[Z] ? a[Z]() : a; | ||
var b = void 0 !== a[Y] ? a[Y]() : a; | ||
return function(a) { | ||
var c = b.subscribe({ | ||
next: function(b) { | ||
return a(h(1, [ b ])); | ||
return a(k(1, [ b ])); | ||
}, | ||
@@ -810,5 +844,5 @@ complete: function() { | ||
}, | ||
error: ca | ||
error: Z | ||
}); | ||
return a(h(0, [ function(a) { | ||
return a(k(0, [ function(a) { | ||
return a ? c.unsubscribe() : 0; | ||
@@ -823,6 +857,6 @@ } ])); | ||
a.then((function(a) { | ||
c || (b(h(1, [ a ])), b(0)); | ||
c || (b(k(1, [ a ])), b(0)); | ||
return Promise.resolve(0); | ||
})); | ||
return b(h(0, [ function(a) { | ||
return b(k(0, [ function(a) { | ||
a && (c = !0); | ||
@@ -837,8 +871,11 @@ return 0; | ||
let c = !1; | ||
return b(h(0, [ function(d) { | ||
if (d || c) { | ||
return b(k(0, [ function(d) { | ||
if (d) { | ||
return c = !0, 0; | ||
} | ||
if (c) { | ||
return 0; | ||
} | ||
c = !0; | ||
b(h(1, [ a ])); | ||
b(k(1, [ a ])); | ||
return b(0); | ||
@@ -855,5 +892,5 @@ } ])); | ||
c = c + 1 | 0; | ||
return b(h(1, [ a ])); | ||
return b(k(1, [ a ])); | ||
}), a); | ||
return b(h(0, [ function(a) { | ||
return b(k(0, [ function(a) { | ||
a && clearInterval(d); | ||
@@ -867,11 +904,15 @@ return 0; | ||
return function(b) { | ||
let c = E; | ||
b(h(0, [ function(a) { | ||
return a ? c() : 0; | ||
let c = w, d = !1; | ||
b(k(0, [ function(a) { | ||
return a && !d ? (d = !0, c()) : 0; | ||
} ])); | ||
c = a({ | ||
next: function(a) { | ||
return b(h(1, [ a ])); | ||
return d ? 0 : b(k(1, [ a ])); | ||
}, | ||
complete: function() { | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
return b(0); | ||
@@ -892,4 +933,4 @@ } | ||
a = a.concat(b); | ||
return b(h(0, [ function(b) { | ||
1 === b && (a = a.filter(c)); | ||
return b(k(0, [ function(b) { | ||
b && (a = a.filter(c)); | ||
return 0; | ||
@@ -900,3 +941,3 @@ } ])); | ||
b || a.forEach((function d(a) { | ||
return a(h(1, [ c ])); | ||
return a(k(1, [ c ])); | ||
})); | ||
@@ -906,3 +947,3 @@ return 0; | ||
complete: function() { | ||
b || (b = !0, a.forEach(F)); | ||
b || (b = !0, a.forEach(x)); | ||
return 0; | ||
@@ -916,4 +957,4 @@ } | ||
return function(c) { | ||
return v(b, (function(b) { | ||
b = "number" == typeof b ? 0 : b.tag ? h(1, [ a(b[0]) ]) : h(0, [ b[0] ]); | ||
return C(b, (function(b) { | ||
b = "number" != typeof b && b.tag ? k(1, [ a(b[0]) ]) : b; | ||
return c(b); | ||
@@ -926,7 +967,7 @@ })); | ||
function merge(a) { | ||
return N(O)(D(a)); | ||
return M(N)(u(a)); | ||
} | ||
function never(a) { | ||
return a(h(0, [ A ])); | ||
return a(k(0, [ r ])); | ||
} | ||
@@ -937,11 +978,5 @@ | ||
return function(c) { | ||
let d = !1; | ||
return v(b, (function(b) { | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
c(b); | ||
return a(); | ||
return c(b), a(); | ||
} | ||
@@ -951,6 +986,6 @@ if (b.tag) { | ||
} | ||
var e = b[0]; | ||
return c(h(0, [ function(b) { | ||
b && !d && (d = !0, a()); | ||
return e(b); | ||
var d = b[0]; | ||
return c(k(0, [ function(b) { | ||
b && a(); | ||
return d(b); | ||
} ])); | ||
@@ -965,3 +1000,3 @@ })); | ||
return function(c) { | ||
return v(b, (function(b) { | ||
return C(b, (function(b) { | ||
if ("number" == typeof b || b.tag) { | ||
@@ -985,3 +1020,3 @@ return c(b); | ||
function publish(a) { | ||
return Y(ba)(a); | ||
return W(X)(a); | ||
} | ||
@@ -992,31 +1027,51 @@ | ||
return function(c) { | ||
let d = !1, e = void 0, f = S, g = T; | ||
v(b, (function(a) { | ||
let d = r, e = r, f = void 0, g = !1, h = !1; | ||
C(b, (function(a) { | ||
if ("number" == typeof a) { | ||
return d = !0, g(1), c(0); | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
e(1); | ||
return c(0); | ||
} | ||
a.tag ? e = m(a[0]) : f = a[0]; | ||
if (a.tag) { | ||
return f = n(a[0]), e(0); | ||
} | ||
d = a[0]; | ||
return 0; | ||
})); | ||
v(a, (function(a) { | ||
var b = e; | ||
C(a, (function(a) { | ||
var b = f; | ||
if ("number" == typeof a) { | ||
return d = !0, f(1), c(0); | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
d(1); | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (void 0 === b || d) { | ||
if (void 0 === b || h) { | ||
return 0; | ||
} | ||
e = void 0; | ||
return c(h(1, [ q(b) ])); | ||
f = void 0; | ||
return c(k(1, [ q(b) ])); | ||
} | ||
g = a[0]; | ||
e = a[0]; | ||
return 0; | ||
})); | ||
return c(h(0, [ function(a) { | ||
return c(k(0, [ function(a) { | ||
if (h) { | ||
return 0; | ||
} | ||
if (a) { | ||
return d = !0, f(1), g(1); | ||
return h = !0, d(1), e(1); | ||
} | ||
f(0); | ||
return g(0); | ||
if (g) { | ||
return 0; | ||
} | ||
g = !0; | ||
d(0); | ||
return e(0); | ||
} ])); | ||
@@ -1028,3 +1083,3 @@ }; | ||
function scan(a, b) { | ||
return x(U, a, b); | ||
return E(R, a, b); | ||
} | ||
@@ -1034,3 +1089,3 @@ | ||
function b(a) { | ||
"number" == typeof a ? (c.forEach(V), c = []) : a.tag ? (e = !1, c.forEach((function b(b) { | ||
"number" == typeof a ? (c.forEach(S), c = []) : a.tag ? (e = !1, c.forEach((function b(b) { | ||
return b(a); | ||
@@ -1040,3 +1095,3 @@ }))) : d = a[0]; | ||
} | ||
let c = [], d = A, e = !1; | ||
let c = [], d = r, e = !1; | ||
return function(f) { | ||
@@ -1047,4 +1102,4 @@ function g(a) { | ||
c = c.concat(f); | ||
1 === c.length && v(a, b); | ||
return f(h(0, [ function(a) { | ||
1 === c.length && C(a, b); | ||
return f(k(0, [ function(a) { | ||
if (a) { | ||
@@ -1065,5 +1120,12 @@ return c = c.filter(g), 0 === c.length ? d(1) : 0; | ||
return function(c) { | ||
let d = a; | ||
return B(b, (function(a, b) { | ||
return "number" != typeof a && a.tag && 0 < d ? (d = d - 1 | 0, b(0)) : c(a); | ||
let d = r, e = a; | ||
return C(b, (function(a) { | ||
if ("number" == typeof a) { | ||
return c(a); | ||
} | ||
if (a.tag) { | ||
return 0 < e ? (e = e - 1 | 0, d(0)) : c(a); | ||
} | ||
d = a[0]; | ||
return c(a); | ||
})); | ||
@@ -1077,40 +1139,40 @@ }; | ||
return function(c) { | ||
let d = !0, e = !1, f = !1, g = A, k = A; | ||
v(b, (function(b) { | ||
function d(a) { | ||
if ("number" == typeof a) { | ||
return g ? (l = !0, e(1)) : 0; | ||
} | ||
if (a.tag) { | ||
return g = !1, f(1); | ||
} | ||
f = a = a[0]; | ||
return a(0); | ||
} | ||
let e = r, f = r, g = !0, h = !1, l = !1; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return d && k(1), e = !0, c(0); | ||
return g && f(1), l = !0, c(0); | ||
} | ||
if (b.tag) { | ||
if (d && !e) { | ||
return g(0); | ||
} | ||
if (e) { | ||
if (g || l) { | ||
return 0; | ||
} | ||
f = !1; | ||
h = !1; | ||
return c(b); | ||
} | ||
var n = b[0]; | ||
g = n; | ||
return v(a, (function(a) { | ||
if ("number" == typeof a) { | ||
return 0; | ||
} | ||
if (a.tag) { | ||
return d = !1, k(1); | ||
} | ||
k = a = a[0]; | ||
a(0); | ||
return n(0); | ||
})); | ||
e = b[0]; | ||
return C(a, d); | ||
})); | ||
return c(h(0, [ function(a) { | ||
return c(k(0, [ function(a) { | ||
if (l) { | ||
return 0; | ||
} | ||
if (a) { | ||
return d && k(1), e = !0, g(1); | ||
return l = !0, e(1), g ? f(1) : 0; | ||
} | ||
if (f || e) { | ||
if (h) { | ||
return 0; | ||
} | ||
f = !0; | ||
return g(0); | ||
h = !0; | ||
g && f(0); | ||
return e(0); | ||
} ])); | ||
@@ -1124,10 +1186,17 @@ }; | ||
return function(c) { | ||
let d = !0; | ||
return B(b, (function(b, f) { | ||
if ("number" != typeof b && b.tag && d) { | ||
if (a(b[0])) { | ||
return f(0); | ||
let d = r, e = !0; | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return c(b); | ||
} | ||
if (b.tag) { | ||
if (e) { | ||
if (a(b[0])) { | ||
return d(0); | ||
} | ||
e = !1; | ||
} | ||
d = !1; | ||
return c(b); | ||
} | ||
d = b[0]; | ||
return c(b); | ||
@@ -1140,3 +1209,3 @@ })); | ||
function switchAll(a) { | ||
return W(aa)(a); | ||
return T(U)(a); | ||
} | ||
@@ -1147,15 +1216,23 @@ | ||
return function(c) { | ||
let d = 0, e = A; | ||
v(b, (function(b) { | ||
let d = !1, e = 0, f = r; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return d < a ? (d = a, c(0)) : 0; | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
return d < a && (d = d + 1 | 0, c(b), d === a) ? (c(0), e(1)) : 0; | ||
return e < a && !d && (e = e + 1 | 0, c(b), !d && e >= a) ? (d = !0, c(0), f(1)) : 0; | ||
} | ||
e = b[0]; | ||
b = b[0]; | ||
if (0 >= a) { | ||
return d = !0, c(0), b(1); | ||
} | ||
f = b; | ||
return 0; | ||
})); | ||
return c(h(0, [ function(b) { | ||
return d < a ? b ? (d = a, e(1)) : e(0) : 0; | ||
return c(k(0, [ function(b) { | ||
return d ? 0 : b ? (d = !0, f(1)) : e < a ? f(0) : 0; | ||
} ])); | ||
@@ -1179,4 +1256,4 @@ }; | ||
} | ||
let e = !1, f = A, g = A; | ||
v(b, (function(b) { | ||
let e = !1, f = r, g = r; | ||
C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
@@ -1194,5 +1271,5 @@ if (e) { | ||
f = b[0]; | ||
return v(a, d); | ||
return C(a, d); | ||
})); | ||
return c(h(0, [ function(a) { | ||
return c(k(0, [ function(a) { | ||
return e ? 0 : a ? (e = !0, f(1), g(1)) : f(0); | ||
@@ -1207,13 +1284,13 @@ } ])); | ||
return function(c) { | ||
let d = !1, e = A; | ||
v(b, (function(b) { | ||
let d = r, e = !1; | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
if (e) { | ||
return 0; | ||
} | ||
d = !0; | ||
e = !0; | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (d) { | ||
if (e) { | ||
return 0; | ||
@@ -1224,12 +1301,9 @@ } | ||
} | ||
d = !0; | ||
e = !0; | ||
c(0); | ||
return e(1); | ||
return d(1); | ||
} | ||
e = b[0]; | ||
d = b[0]; | ||
return c(b); | ||
})); | ||
return c(h(0, [ function(a) { | ||
return d ? 0 : a ? (d = !0, e(1)) : e(0); | ||
} ])); | ||
}; | ||
@@ -1252,3 +1326,3 @@ }; | ||
let f = !1, g = void 0; | ||
return v(b, (function(b) { | ||
return C(b, (function(b) { | ||
if ("number" == typeof b) { | ||
@@ -1263,8 +1337,8 @@ return d(), c(0); | ||
d(); | ||
g = m(setTimeout(e, a(b[0]))); | ||
g = n(setTimeout(e, a(b[0]))); | ||
return c(b); | ||
} | ||
var k = b[0]; | ||
return c(h(0, [ function(a) { | ||
return a ? (d(), k(1)) : k(a); | ||
var h = b[0]; | ||
return c(k(0, [ function(a) { | ||
return a ? (d(), h(1)) : h(a); | ||
} ])); | ||
@@ -1277,4 +1351,4 @@ })); | ||
function toArray(a) { | ||
let b = [], c = A, d = !1; | ||
v(a, (function(a) { | ||
let b = [], c = r, d = !1; | ||
C(a, (function(a) { | ||
if ("number" == typeof a) { | ||
@@ -1295,11 +1369,11 @@ return d = !0, 0; | ||
return function(b, c) { | ||
return 0 === b ? v(a, (function d(a) { | ||
return 0 === b ? C(a, (function d(a) { | ||
if ("number" == typeof a) { | ||
return x(c, 2, 0); | ||
return E(c, 2, 0); | ||
} | ||
if (a.tag) { | ||
return x(c, 1, a[0]); | ||
return E(c, 1, a[0]); | ||
} | ||
var b = a[0]; | ||
return x(c, 0, (function(a) { | ||
return E(c, 0, (function(a) { | ||
switch (a) { | ||
@@ -1323,4 +1397,4 @@ case 0: | ||
subscribe: function(b) { | ||
let c = A, e = !1; | ||
v(a, (function(a) { | ||
let c = r, e = !1; | ||
C(a, (function(a) { | ||
if ("number" == typeof a) { | ||
@@ -1350,3 +1424,3 @@ return e = !0, b.complete(); | ||
}; | ||
b[Z] = function() { | ||
b[Y] = function() { | ||
return b; | ||
@@ -1359,3 +1433,3 @@ }; | ||
return new Promise((function(b) { | ||
return v(X(1)(a), (function(a) { | ||
return C(V(1)(a), (function(a) { | ||
return "number" == typeof a ? 0 : a.tag ? b(a[0]) : a[0](0); | ||
@@ -1366,2 +1440,2 @@ })); | ||
export { buffer, combine, concat, concatAll, H as concatMap, debounce, delay, empty, filter, Q as flatten, forEach, D as fromArray, fromCallbag, fromDomEvent, fromList, fromObservable, fromPromise, fromValue, interval, make, makeSubject, map, merge, Q as mergeAll, N as mergeMap, never, onEnd, R as onPush, onStart, pipe, publish, sample, scan, share, skip, skipUntil, skipWhile, Y as subscribe, switchAll, W as switchMap, take, X as takeLast, takeUntil, takeWhile, R as tap, throttle, toArray, toCallbag, toObservable, toPromise }; | ||
export { buffer, combine, concat, concatAll, I as concatMap, debounce, delay, y as empty, filter, P as flatten, forEach, u as fromArray, fromCallbag, fromDomEvent, fromList, fromObservable, fromPromise, fromValue, interval, make, makeSubject, map, merge, P as mergeAll, M as mergeMap, never, onEnd, Q as onPush, onStart, pipe, publish, sample, scan, share, skip, skipUntil, skipWhile, W as subscribe, switchAll, T as switchMap, take, V as takeLast, takeUntil, takeWhile, Q as tap, throttle, toArray, toCallbag, toObservable, toPromise }; |
@@ -28,2 +28,127 @@ "use strict"; | ||
function talkbackPlaceholder(a) { | ||
return 0; | ||
} | ||
function makeTrampoline(a, b) { | ||
let c = !1, d = !1, e = !1; | ||
return a(__(0, [ function(f) { | ||
if (f) { | ||
c = !0; | ||
} else if (d) { | ||
e = !0; | ||
} else { | ||
for (d = e = !0; e && !c; ) { | ||
void 0 !== (f = b()) ? (e = !1, a(__(1, [ valFromOption(f) ]))) : (c = !0, a(0)); | ||
} | ||
d = !1; | ||
} | ||
return 0; | ||
} ])); | ||
} | ||
function fromArray(a) { | ||
return function(b) { | ||
var c = a.length; | ||
let d = 0; | ||
return makeTrampoline(b, (function() { | ||
if (d < c) { | ||
var e = a[d]; | ||
d = d + 1 | 0; | ||
return some(e); | ||
} | ||
})); | ||
}; | ||
} | ||
function _ref() { | ||
return 0; | ||
} | ||
function _ref4(a) { | ||
return a(0); | ||
} | ||
function empty(a) { | ||
let b = !1; | ||
a(__(0, [ function(a) { | ||
a && (b = !0); | ||
return 0; | ||
} ])); | ||
return b ? 0 : a(0); | ||
} | ||
var fromArray$1 = fromArray, fromList$1 = function fromList(a) { | ||
return function(b) { | ||
let c = a; | ||
return makeTrampoline(b, (function() { | ||
var a = c; | ||
if (a) { | ||
return c = a[1], some(a[0]); | ||
} | ||
})); | ||
}; | ||
}, fromValue$1 = function fromValue(a) { | ||
return function(b) { | ||
let c = !1; | ||
return b(__(0, [ function(d) { | ||
if (d) { | ||
return c = !0, 0; | ||
} | ||
if (c) { | ||
return 0; | ||
} | ||
c = !0; | ||
b(__(1, [ a ])); | ||
return b(0); | ||
} ])); | ||
}; | ||
}, make$1 = function make(a) { | ||
return function(b) { | ||
let c = _ref, d = !1; | ||
b(__(0, [ function(a) { | ||
return a && !d ? (d = !0, c()) : 0; | ||
} ])); | ||
c = a({ | ||
next: function(a) { | ||
return d ? 0 : b(__(1, [ a ])); | ||
}, | ||
complete: function(a) { | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
return b(0); | ||
} | ||
}); | ||
return 0; | ||
}; | ||
}, makeSubject$1 = function makeSubject(a) { | ||
let b = [], c = !1; | ||
return { | ||
source: function(a) { | ||
function c(c) { | ||
return c !== a; | ||
} | ||
b = b.concat(a); | ||
return a(__(0, [ function(a) { | ||
a && (b = b.filter(c)); | ||
return 0; | ||
} ])); | ||
}, | ||
next: function(a) { | ||
c || b.forEach((function d(c) { | ||
return c(__(1, [ a ])); | ||
})); | ||
return 0; | ||
}, | ||
complete: function(a) { | ||
c || (c = !0, b.forEach(_ref4)); | ||
return 0; | ||
} | ||
}; | ||
}, empty$1 = empty, never$1 = function never(a) { | ||
return a(__(0, [ talkbackPlaceholder ])); | ||
}; | ||
function caml_array_sub(a, b, c) { | ||
@@ -109,9 +234,9 @@ for (var d = Array(c), e = 0; e < c; ) { | ||
case 3: | ||
return function(d) { | ||
return a(b, c, d); | ||
return function(e) { | ||
return a(b, c, e); | ||
}; | ||
case 4: | ||
return function(d, f) { | ||
return a(b, c, d, f); | ||
return function(e, d) { | ||
return a(b, c, e, d); | ||
}; | ||
@@ -179,122 +304,2 @@ | ||
function talkbackPlaceholder(a) { | ||
return 0; | ||
} | ||
function captureTalkback(a, b) { | ||
let c = talkbackPlaceholder; | ||
return _1(a, (function(a) { | ||
"number" == typeof a || a.tag || (c = a[0]); | ||
return b(a, c); | ||
})); | ||
} | ||
function makeTrampoline(a, b) { | ||
let c = !1, d = !1, e = !1; | ||
return a(__(0, [ function(f) { | ||
if (f) { | ||
c = !0; | ||
} else if (d) { | ||
e = !0; | ||
} else { | ||
for (d = e = !0; e && !c; ) { | ||
void 0 !== (f = b()) ? (e = !1, a(__(1, [ valFromOption(f) ]))) : (c = !0, a(0)); | ||
} | ||
d = !1; | ||
} | ||
return 0; | ||
} ])); | ||
} | ||
function fromArray(a) { | ||
return function(b) { | ||
var c = a.length; | ||
let d = 0; | ||
return makeTrampoline(b, (function() { | ||
if (d < c) { | ||
var e = a[d]; | ||
d = d + 1 | 0; | ||
return some(e); | ||
} | ||
})); | ||
}; | ||
} | ||
function _ref() { | ||
return 0; | ||
} | ||
function _ref4(a) { | ||
return a(0); | ||
} | ||
var fromArray$1 = fromArray, fromList$1 = function fromList(a) { | ||
return function(b) { | ||
let c = a; | ||
return makeTrampoline(b, (function() { | ||
var a = c; | ||
if (a) { | ||
return c = a[1], some(a[0]); | ||
} | ||
})); | ||
}; | ||
}, fromValue$1 = function fromValue(a) { | ||
return function(b) { | ||
let c = !1; | ||
return b(__(0, [ function(d) { | ||
if (d || c) { | ||
return 0; | ||
} | ||
c = !0; | ||
b(__(1, [ a ])); | ||
return b(0); | ||
} ])); | ||
}; | ||
}, make$1 = function make(a) { | ||
return function(b) { | ||
let c = _ref; | ||
b(__(0, [ function(a) { | ||
return a ? c() : 0; | ||
} ])); | ||
c = a({ | ||
next: function(a) { | ||
return b(__(1, [ a ])); | ||
}, | ||
complete: function(a) { | ||
return b(0); | ||
} | ||
}); | ||
return 0; | ||
}; | ||
}, makeSubject$1 = function makeSubject(a) { | ||
let b = [], c = !1; | ||
return { | ||
source: function(a) { | ||
function c(c) { | ||
return c !== a; | ||
} | ||
b = b.concat(a); | ||
return a(__(0, [ function(a) { | ||
1 === a && (b = b.filter(c)); | ||
return 0; | ||
} ])); | ||
}, | ||
next: function(a) { | ||
c || b.forEach((function e(c) { | ||
return c(__(1, [ a ])); | ||
})); | ||
return 0; | ||
}, | ||
complete: function(a) { | ||
c || (c = !0, b.forEach(_ref4)); | ||
return 0; | ||
} | ||
}; | ||
}, empty$1 = function empty(a) { | ||
a(__(0, [ talkbackPlaceholder ])); | ||
return a(0); | ||
}, never$1 = function never(a) { | ||
return a(__(0, [ talkbackPlaceholder ])); | ||
}; | ||
function combine(a, b) { | ||
@@ -304,3 +309,3 @@ return function(c) { | ||
_1(a, (function(a) { | ||
var e = g; | ||
var b = g; | ||
if ("number" == typeof a) { | ||
@@ -318,3 +323,3 @@ if (1 > k) { | ||
a = a[0]; | ||
if (void 0 !== e) { | ||
if (void 0 !== b) { | ||
if (l) { | ||
@@ -325,7 +330,6 @@ return 0; | ||
h = !1; | ||
return c(__(1, [ [ a, valFromOption(e) ] ])); | ||
return c(__(1, [ [ a, valFromOption(b) ] ])); | ||
} | ||
f = some(a); | ||
h = !1; | ||
return 0; | ||
return h ? (h = !1, 0) : e(0); | ||
} | ||
@@ -336,3 +340,3 @@ d = a[0]; | ||
_1(b, (function(a) { | ||
var d = f; | ||
var b = f; | ||
if ("number" == typeof a) { | ||
@@ -350,3 +354,3 @@ if (1 > k) { | ||
a = a[0]; | ||
if (void 0 !== d) { | ||
if (void 0 !== b) { | ||
if (l) { | ||
@@ -357,7 +361,6 @@ return 0; | ||
h = !1; | ||
return c(__(1, [ [ valFromOption(d), a ] ])); | ||
return c(__(1, [ [ valFromOption(b), a ] ])); | ||
} | ||
g = some(a); | ||
h = !1; | ||
return 0; | ||
return h ? (h = !1, 0) : d(0); | ||
} | ||
@@ -389,23 +392,20 @@ e = a[0]; | ||
if ("number" == typeof b) { | ||
return h = !1, g = talkbackPlaceholder, void 0 !== (b = e.shift()) ? _1(a(valFromOption(b)), d) : l ? c(0) : 0; | ||
return k ? (k = !1, void 0 !== (b = e.shift()) ? _1(a(valFromOption(b)), d) : m ? c(0) : 0) : 0; | ||
} | ||
if (b.tag) { | ||
if (k) { | ||
return 0; | ||
} | ||
c(__(1, [ b[0] ])); | ||
return g(0); | ||
return k ? (c(b), l ? (l = !1, 0) : h(0)) : 0; | ||
} | ||
h = !0; | ||
g = b = b[0]; | ||
k = !0; | ||
h = b = b[0]; | ||
l = !1; | ||
return b(0); | ||
} | ||
let e = [], f = talkbackPlaceholder, g = talkbackPlaceholder, h = !1, k = !1, l = !1; | ||
let e = [], f = talkbackPlaceholder, g = !1, h = talkbackPlaceholder, k = !1, l = !1, m = !1; | ||
_1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (l) { | ||
if (m) { | ||
return 0; | ||
} | ||
l = !0; | ||
return !h && function isEmpty(a) { | ||
m = !0; | ||
return !k && function isEmpty(a) { | ||
return 0 === a.length; | ||
@@ -415,14 +415,24 @@ }(e) ? c(0) : 0; | ||
if (b.tag) { | ||
if (l) { | ||
if (m) { | ||
return 0; | ||
} | ||
b = b[0]; | ||
h ? e.push(b) : _1(a(b), d); | ||
return f(0); | ||
g ? g = !1 : (g = !0, f(0)); | ||
return k ? (e.push(b), 0) : _1(a(b), d); | ||
} | ||
f = b = b[0]; | ||
return b(0); | ||
f = b[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
return a ? (g(1), l || (k = l = !0, f(1), g = talkbackPlaceholder), 0) : l ? 0 : g(0); | ||
if (a) { | ||
if (m) { | ||
return 0; | ||
} | ||
m = !0; | ||
k = !1; | ||
h(1); | ||
return f(1); | ||
} | ||
m || g || (g = !0, f(0)); | ||
return k && !l ? (l = !0, h(0)) : 0; | ||
} ])); | ||
@@ -441,11 +451,3 @@ }; | ||
function _ref6(a) { | ||
return a(1); | ||
} | ||
function _ref7(a) { | ||
return a(1); | ||
} | ||
function _ref8(a) { | ||
return a(0); | ||
@@ -457,39 +459,52 @@ } | ||
return function(c) { | ||
let d = talkbackPlaceholder, e = [], f = !1; | ||
let d = talkbackPlaceholder, e = !1, f = [], g = !1; | ||
_1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (f) { | ||
if (g) { | ||
return 0; | ||
} | ||
f = !0; | ||
return 0 === e.length ? c(0) : 0; | ||
g = !0; | ||
return 0 === f.length ? c(0) : 0; | ||
} | ||
if (b.tag) { | ||
if (f) { | ||
if (g) { | ||
return 0; | ||
} | ||
!function(a) { | ||
function b(a) { | ||
{ | ||
var h = function(a) { | ||
return a !== d; | ||
} | ||
}; | ||
e = !1; | ||
b = a(b[0]); | ||
let d = talkbackPlaceholder; | ||
_1(a, (function(a) { | ||
return _1(b, (function(a) { | ||
if ("number" == typeof a) { | ||
return e = e.filter(b), f && 0 === e.length ? c(0) : 0; | ||
return 0 !== f.length ? (f = f.filter(h), g && 0 === f.length ? c(0) : 0) : 0; | ||
} | ||
if (a.tag) { | ||
return 0 !== e.length ? (c(__(1, [ a[0] ])), d(0)) : 0; | ||
return 0 !== f.length ? (c(__(1, [ a[0] ])), d(0)) : 0; | ||
} | ||
d = a = a[0]; | ||
e = e.concat(a); | ||
f = f.concat(a); | ||
return a(0); | ||
})); | ||
}(a(b[0])); | ||
return d(0); | ||
} | ||
} | ||
d = b = b[0]; | ||
return b(0); | ||
d = b[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
a ? (e.forEach(_ref6), f || (f = !0, d(1), e.forEach(_ref7), e = [])) : f || e.forEach(_ref8); | ||
if (!g) { | ||
if (a) { | ||
var b = f; | ||
g = !0; | ||
f = []; | ||
d(a); | ||
b.forEach((function c(c) { | ||
return c(a); | ||
})); | ||
} else { | ||
e || (e = !0, d(0)), f.forEach(_ref7); | ||
} | ||
} | ||
return 0; | ||
@@ -501,7 +516,7 @@ } ])); | ||
function _ref9(a) { | ||
function _ref8(a) { | ||
return a; | ||
} | ||
function _ref10(a) { | ||
function _ref9(a) { | ||
return a; | ||
@@ -511,3 +526,3 @@ } | ||
function mergeAll(a) { | ||
return mergeMap(_ref10)(a); | ||
return mergeMap(_ref9)(a); | ||
} | ||
@@ -526,10 +541,2 @@ | ||
function _ref12(a) { | ||
return 0; | ||
} | ||
function _ref13(a) { | ||
return 0; | ||
} | ||
function scan(a, b) { | ||
@@ -547,3 +554,3 @@ return function(c) { | ||
function _ref14(a) { | ||
function _ref11(a) { | ||
return a(0); | ||
@@ -557,37 +564,44 @@ } | ||
if ("number" == typeof a) { | ||
return g = !1, f = talkbackPlaceholder, k ? c(0) : 0; | ||
return h ? (h = !1, l ? c(a) : 0) : 0; | ||
} | ||
if (a.tag) { | ||
if (h) { | ||
return 0; | ||
} | ||
c(__(1, [ a[0] ])); | ||
return f(0); | ||
return h ? (c(a), k ? (k = !1, 0) : g(0)) : 0; | ||
} | ||
g = !0; | ||
f = a = a[0]; | ||
h = !0; | ||
g = a = a[0]; | ||
k = !1; | ||
return a(0); | ||
} | ||
let e = talkbackPlaceholder, f = talkbackPlaceholder, g = !1, h = !1, k = !1; | ||
let e = talkbackPlaceholder, f = !1, g = talkbackPlaceholder, h = !1, k = !1, l = !1; | ||
_1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (k) { | ||
if (l) { | ||
return 0; | ||
} | ||
k = !0; | ||
return g ? 0 : c(0); | ||
l = !0; | ||
return h ? 0 : c(0); | ||
} | ||
if (b.tag) { | ||
if (k) { | ||
if (l) { | ||
return 0; | ||
} | ||
g && (f(1), f = talkbackPlaceholder); | ||
_1(a(b[0]), d); | ||
return e(0); | ||
h && (g(1), g = talkbackPlaceholder); | ||
f ? f = !1 : (f = !0, e(0)); | ||
return _1(b = a(b[0]), d); | ||
} | ||
e = b = b[0]; | ||
return b(0); | ||
e = b[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
return a ? (f(1), k || (h = k = !0, e(1), f = talkbackPlaceholder), 0) : f(0); | ||
if (a) { | ||
if (l) { | ||
return 0; | ||
} | ||
l = !0; | ||
h = !1; | ||
g(1); | ||
return e(1); | ||
} | ||
l || f || (f = !0, e(0)); | ||
return h && !k ? (k = !0, g(0)) : 0; | ||
} ])); | ||
@@ -598,3 +612,3 @@ }; | ||
function _ref20(a) { | ||
function _ref17(a) { | ||
return a; | ||
@@ -607,11 +621,19 @@ } | ||
function d() { | ||
return e.shift(); | ||
return f.shift(); | ||
} | ||
var e = []; | ||
return captureTalkback(b, (function(b, g) { | ||
let e = talkbackPlaceholder; | ||
var f = []; | ||
return _1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return makeTrampoline(c, d); | ||
} | ||
b.tag && (e.length >= a && 0 < a && e.shift(), e.push(b[0])); | ||
return g(0); | ||
if (b.tag) { | ||
return f.length >= a && 0 < a && f.shift(), f.push(b[0]), e(0); | ||
} | ||
b = b[0]; | ||
if (0 >= a) { | ||
return b(1), empty(c); | ||
} | ||
e = b; | ||
return b(0); | ||
})); | ||
@@ -627,38 +649,39 @@ }; | ||
if ("number" == typeof a) { | ||
if (h) { | ||
if (k) { | ||
return 0; | ||
} | ||
h = !0; | ||
k = !0; | ||
f(1); | ||
c(__(1, [ e ])); | ||
0 < e.length && c(__(1, [ e ])); | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (h) { | ||
if (k || 0 >= e.length) { | ||
return 0; | ||
} | ||
c(__(1, [ e ])); | ||
a = e; | ||
e = []; | ||
return g(0); | ||
return c(__(1, [ a ])); | ||
} | ||
g = a[0]; | ||
return g(0); | ||
return 0; | ||
} | ||
let e = [], f = talkbackPlaceholder, g = talkbackPlaceholder, h = !1; | ||
let e = [], f = talkbackPlaceholder, g = talkbackPlaceholder, h = !1, k = !1; | ||
_1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (h) { | ||
if (k) { | ||
return 0; | ||
} | ||
h = !0; | ||
k = !0; | ||
g(1); | ||
c(__(1, [ e ])); | ||
0 < e.length && c(__(1, [ e ])); | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (h) { | ||
if (k) { | ||
return 0; | ||
} | ||
e.push(b[0]); | ||
return f(0); | ||
h = !1; | ||
return g(0); | ||
} | ||
@@ -669,3 +692,14 @@ f = b[0]; | ||
return c(__(0, [ function(a) { | ||
return h ? 0 : a ? (h = !0, f(1), g(1)) : f(0); | ||
if (k) { | ||
return 0; | ||
} | ||
if (a) { | ||
return k = !0, f(1), g(1); | ||
} | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
f(0); | ||
return g(0); | ||
} ])); | ||
@@ -681,4 +715,12 @@ }; | ||
return function(c) { | ||
return captureTalkback(b, (function(b, e) { | ||
return "number" == typeof b || !b.tag || a(b[0]) ? c(b) : e(0); | ||
let d = talkbackPlaceholder; | ||
return _1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return c(b); | ||
} | ||
if (b.tag) { | ||
return a(b[0]) ? c(b) : d(0); | ||
} | ||
d = b[0]; | ||
return c(b); | ||
})); | ||
@@ -691,3 +733,3 @@ }; | ||
return _1(b, (function(b) { | ||
b = "number" == typeof b ? 0 : b.tag ? __(1, [ a(b[0]) ]) : __(0, [ b[0] ]); | ||
b = "number" != typeof b && b.tag ? __(1, [ a(b[0]) ]) : b; | ||
return c(b); | ||
@@ -698,15 +740,9 @@ })); | ||
}, mergeMap$1 = mergeMap, merge$1 = function merge(a) { | ||
return mergeMap(_ref9)(fromArray(a)); | ||
return mergeMap(_ref8)(fromArray(a)); | ||
}, mergeAll$1 = mergeAll, flatten$1 = mergeAll, onEnd$1 = function onEnd(a) { | ||
return function(b) { | ||
return function(c) { | ||
let d = !1; | ||
return _1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
c(b); | ||
return a(); | ||
return c(b), a(); | ||
} | ||
@@ -716,6 +752,6 @@ if (b.tag) { | ||
} | ||
var e = b[0]; | ||
var d = b[0]; | ||
return c(__(0, [ function(b) { | ||
b && !d && (d = !0, a()); | ||
return e(b); | ||
b && a(); | ||
return d(b); | ||
} ])); | ||
@@ -740,31 +776,51 @@ })); | ||
return function(c) { | ||
let d = !1, e = void 0, f = _ref12, g = _ref13; | ||
let d = talkbackPlaceholder, e = talkbackPlaceholder, f = void 0, g = !1, h = !1; | ||
_1(b, (function(a) { | ||
if ("number" == typeof a) { | ||
return d = !0, g(1), c(0); | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
e(1); | ||
return c(0); | ||
} | ||
a.tag ? e = some(a[0]) : f = a[0]; | ||
if (a.tag) { | ||
return f = some(a[0]), e(0); | ||
} | ||
d = a[0]; | ||
return 0; | ||
})); | ||
_1(a, (function(a) { | ||
var b = e; | ||
var b = f; | ||
if ("number" == typeof a) { | ||
return d = !0, f(1), c(0); | ||
if (h) { | ||
return 0; | ||
} | ||
h = !0; | ||
d(1); | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (void 0 === b || d) { | ||
if (void 0 === b || h) { | ||
return 0; | ||
} | ||
e = void 0; | ||
f = void 0; | ||
return c(__(1, [ valFromOption(b) ])); | ||
} | ||
g = a[0]; | ||
e = a[0]; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (h) { | ||
return 0; | ||
} | ||
if (a) { | ||
return d = !0, f(1), g(1); | ||
return h = !0, d(1), e(1); | ||
} | ||
f(0); | ||
return g(0); | ||
if (g) { | ||
return 0; | ||
} | ||
g = !0; | ||
d(0); | ||
return e(0); | ||
} ])); | ||
@@ -775,3 +831,3 @@ }; | ||
function b(a) { | ||
"number" == typeof a ? (c.forEach(_ref14), c = []) : a.tag ? (e = !1, c.forEach((function b(b) { | ||
"number" == typeof a ? (c.forEach(_ref11), c = []) : a.tag ? (e = !1, c.forEach((function b(b) { | ||
return b(a); | ||
@@ -802,5 +858,12 @@ }))) : d = a[0]; | ||
return function(c) { | ||
let d = a; | ||
return captureTalkback(b, (function(a, b) { | ||
return "number" != typeof a && a.tag && 0 < d ? (d = d - 1 | 0, b(0)) : c(a); | ||
let d = talkbackPlaceholder, e = a; | ||
return _1(b, (function(a) { | ||
if ("number" == typeof a) { | ||
return c(a); | ||
} | ||
if (a.tag) { | ||
return 0 < e ? (e = e - 1 | 0, d(0)) : c(a); | ||
} | ||
d = a[0]; | ||
return c(a); | ||
})); | ||
@@ -812,40 +875,40 @@ }; | ||
return function(c) { | ||
let d = !0, e = !1, f = !1, g = talkbackPlaceholder, h = talkbackPlaceholder; | ||
function d(a) { | ||
if ("number" == typeof a) { | ||
return g ? (k = !0, e(1)) : 0; | ||
} | ||
if (a.tag) { | ||
return g = !1, f(1); | ||
} | ||
f = a = a[0]; | ||
return a(0); | ||
} | ||
let e = talkbackPlaceholder, f = talkbackPlaceholder, g = !0, h = !1, k = !1; | ||
_1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return d && h(1), e = !0, c(0); | ||
return g && f(1), k = !0, c(0); | ||
} | ||
if (b.tag) { | ||
if (d && !e) { | ||
return g(0); | ||
} | ||
if (e) { | ||
if (g || k) { | ||
return 0; | ||
} | ||
f = !1; | ||
h = !1; | ||
return c(b); | ||
} | ||
var l = b[0]; | ||
g = l; | ||
return _1(a, (function(a) { | ||
if ("number" == typeof a) { | ||
return 0; | ||
} | ||
if (a.tag) { | ||
return d = !1, h(1); | ||
} | ||
h = a = a[0]; | ||
a(0); | ||
return l(0); | ||
})); | ||
e = b[0]; | ||
return _1(a, d); | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (k) { | ||
return 0; | ||
} | ||
if (a) { | ||
return d && h(1), e = !0, g(1); | ||
return k = !0, e(1), g ? f(1) : 0; | ||
} | ||
if (f || e) { | ||
if (h) { | ||
return 0; | ||
} | ||
f = !0; | ||
return g(0); | ||
h = !0; | ||
g && f(0); | ||
return e(0); | ||
} ])); | ||
@@ -857,10 +920,17 @@ }; | ||
return function(c) { | ||
let d = !0; | ||
return captureTalkback(b, (function(b, f) { | ||
if ("number" != typeof b && b.tag && d) { | ||
if (a(b[0])) { | ||
return f(0); | ||
let d = talkbackPlaceholder, e = !0; | ||
return _1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return c(b); | ||
} | ||
if (b.tag) { | ||
if (e) { | ||
if (a(b[0])) { | ||
return d(0); | ||
} | ||
e = !1; | ||
} | ||
d = !1; | ||
return c(b); | ||
} | ||
d = b[0]; | ||
return c(b); | ||
@@ -871,19 +941,27 @@ })); | ||
}, switchMap$1 = switchMap, switchAll$1 = function switchAll(a) { | ||
return switchMap(_ref20)(a); | ||
return switchMap(_ref17)(a); | ||
}, take$1 = function take(a) { | ||
return function(b) { | ||
return function(c) { | ||
let d = 0, e = talkbackPlaceholder; | ||
let d = !1, e = 0, f = talkbackPlaceholder; | ||
_1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
return d < a ? (d = a, c(0)) : 0; | ||
if (d) { | ||
return 0; | ||
} | ||
d = !0; | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
return d < a && (d = d + 1 | 0, c(b), d === a) ? (c(0), e(1)) : 0; | ||
return e < a && !d && (e = e + 1 | 0, c(b), !d && e >= a) ? (d = !0, c(0), f(1)) : 0; | ||
} | ||
e = b[0]; | ||
b = b[0]; | ||
if (0 >= a) { | ||
return d = !0, c(0), b(1); | ||
} | ||
f = b; | ||
return 0; | ||
})); | ||
return c(__(0, [ function(b) { | ||
return d < a ? b ? (d = a, e(1)) : e(0) : 0; | ||
return d ? 0 : b ? (d = !0, f(1)) : e < a ? f(0) : 0; | ||
} ])); | ||
@@ -929,13 +1007,13 @@ }; | ||
return function(c) { | ||
let d = !1, e = talkbackPlaceholder; | ||
_1(b, (function(b) { | ||
let d = talkbackPlaceholder, e = !1; | ||
return _1(b, (function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
if (e) { | ||
return 0; | ||
} | ||
d = !0; | ||
e = !0; | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (d) { | ||
if (e) { | ||
return 0; | ||
@@ -946,12 +1024,9 @@ } | ||
} | ||
d = !0; | ||
e = !0; | ||
c(0); | ||
return e(1); | ||
return d(1); | ||
} | ||
e = b[0]; | ||
d = b[0]; | ||
return c(b); | ||
})); | ||
return c(__(0, [ function(a) { | ||
return d ? 0 : a ? (d = !0, e(1)) : e(0); | ||
} ])); | ||
}; | ||
@@ -1023,7 +1098,7 @@ }; | ||
function _ref6$1(a, b, c) { | ||
function _ref5(a, b, c) { | ||
a.addEventListener(b, c); | ||
} | ||
function _ref7$1(a, b, c) { | ||
function _ref6(a, b, c) { | ||
a.removeEventListener(b, c); | ||
@@ -1034,3 +1109,3 @@ } | ||
return function(c) { | ||
var d = _ref6$1, e = _ref7$1, f = function(a) { | ||
var d = _ref5, e = _ref6, f = function(a) { | ||
return c(__(1, [ a ])); | ||
@@ -1138,5 +1213,5 @@ }; | ||
return function(c) { | ||
let d = !1, e = void 0; | ||
var f = function(a) { | ||
void 0 !== (a = e) && (e = void 0, clearTimeout(valFromOption(a))); | ||
let d = void 0, e = !1, f = !1; | ||
var g = function(a) { | ||
void 0 !== (a = d) && (d = void 0, clearTimeout(valFromOption(a))); | ||
return 0; | ||
@@ -1146,14 +1221,18 @@ }; | ||
if ("number" == typeof b) { | ||
return d = !0, void 0 !== e ? 0 : c(0); | ||
if (f) { | ||
return 0; | ||
} | ||
f = !0; | ||
return void 0 !== d ? (e = !0, 0) : c(0); | ||
} | ||
if (b.tag) { | ||
return f(), e = some(setTimeout((function g(a) { | ||
e = void 0; | ||
return f || (g(), d = some(setTimeout((function h(a) { | ||
d = void 0; | ||
c(b); | ||
return d ? c(0) : 0; | ||
}), a(b[0]))), 0; | ||
return e ? c(0) : 0; | ||
}), a(b[0])))), 0; | ||
} | ||
var k = b[0]; | ||
var l = b[0]; | ||
return c(__(0, [ function(a) { | ||
return a ? (f(), k(1)) : k(a); | ||
return f ? 0 : a ? (f = !0, e = !1, g(), l(1)) : l(0); | ||
} ])); | ||
@@ -1166,16 +1245,13 @@ })); | ||
return function(c) { | ||
let d = talkbackPlaceholder, e = 0, f = !1; | ||
_1(b, (function(b) { | ||
let d = 0; | ||
return _1(b, (function(b) { | ||
if ("number" != typeof b && !b.tag) { | ||
return d = b[0], 0; | ||
return c(b); | ||
} | ||
f || (e = e + 1 | 0, setTimeout((function g(a) { | ||
f && 0 === e ? c(0) : e = e - 1 | 0; | ||
return c(b); | ||
}), a)); | ||
d = d + 1 | 0; | ||
setTimeout((function(a) { | ||
return 0 !== d ? (d = d - 1 | 0, c(b)) : 0; | ||
}), a); | ||
return 0; | ||
})); | ||
return c(__(0, [ function(a) { | ||
return a ? (f = !0, 0 === e ? c(0) : 0) : f ? 0 : d(a); | ||
} ])); | ||
}; | ||
@@ -1182,0 +1258,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
"use strict";function n(n,t){return t.tag=n,t}var t=[];function r(n){return void 0===n?((n=[t,0]).tag=256,n):(null!==n&&n[0]===t&&((n=[t,n[1]+1|0]).tag=256),n)}function u(n){return null===n||n[0]!==t?n:0!==(n=n[1])?[t,n-1|0]:void 0}function e(n,t,r){for(var u=Array(r),e=0;e<r;)u[e]=n[t],e=e+1|0,t=t+1|0;return u}function o(n,t){for(;;){var r=t,u=0===(t=n.length)?1:t;if(0==(t=u-r.length|0))return n.apply(null,r);if(!(0>t))return function(n,t){return function(r){return o(n,t.concat([r]))}}(n,r);t=e(r,u,0|-t),n=n.apply(null,e(r,0,u))}}function f(n,t){var r=n.length;return 1===r?n(t):function(n,t,r){switch(r){case 1:return n(t);case 2:return function(r){return n(t,r)};case 3:return function(r,u){return n(t,r,u)};case 4:return function(r,u,e){return n(t,r,u,e)};case 5:return function(r,u,e,o){return n(t,r,u,e,o)};case 6:return function(r,u,e,o,f){return n(t,r,u,e,o,f)};case 7:return function(r,u,e,o,f,i){return n(t,r,u,e,o,f,i)};default:return o(n,[t])}}(n,t,r)}function i(n,t,r){var u=n.length;return 2===u?n(t,r):function(n,t,r,u){switch(u){case 1:return o(n(t),[r]);case 2:return n(t,r);case 3:return function(u){return n(t,r,u)};case 4:return function(u,e){return n(t,r,u,e)};case 5:return function(u,e,o){return n(t,r,u,e,o)};case 6:return function(u,e,o,f){return n(t,r,u,e,o,f)};case 7:return function(u,e,o,f,i){return n(t,r,u,e,o,f,i)};default:return o(n,[t,r])}}(n,t,r,u)}function c(n,t,r,u){var e=n.length;return 3===e?n(t,r,u):function(n,t,r,u,e){switch(e){case 1:return o(n(t),[r,u]);case 2:return o(n(t,r),[u]);case 3:return n(t,r,u);case 4:return function(e){return n(t,r,u,e)};case 5:return function(e,o){return n(t,r,u,e,o)};case 6:return function(e,o,f){return n(t,r,u,e,o,f)};case 7:return function(e,o,f,i){return n(t,r,u,e,o,f,i)};default:return o(n,[t,r,u])}}(n,t,r,u,e)}function a(n){return 0}function s(n,t){let r=a;return f(n,(function(n){return"number"==typeof n||n.tag||(r=n[0]),t(n,r)}))}function p(t,r){let e=!1,o=!1,f=!1;return t(n(0,[function(i){if(i)e=!0;else if(o)f=!0;else{for(o=f=!0;f&&!e;)void 0!==(i=r())?(f=!1,t(n(1,[u(i)]))):(e=!0,t(0));o=!1}return 0}]))}function l(n){return function(t){var u=n.length;let e=0;return p(t,(function(){if(e<u){var t=n[e];return e=e+1|0,r(t)}}))}}function b(){return 0}function m(n){return n(0)}var v=l;function g(t,e){return function(o){let i=a,c=a,s=void 0,p=void 0,l=!1,b=0,m=!1;return f(t,(function(t){var e=p;return"number"==typeof t?1>b?(b=b+1|0,0):m?0:(m=!0,o(0)):t.tag?(t=t[0],void 0!==e?m?0:(s=r(t),l=!1,o(n(1,[[t,u(e)]]))):(s=r(t),l=!1,0)):(i=t[0],0)})),f(e,(function(t){var e=s;return"number"==typeof t?1>b?(b=b+1|0,0):m?0:(m=!0,o(0)):t.tag?(t=t[0],void 0!==e?m?0:(p=r(t),l=!1,o(n(1,[[u(e),t]]))):(p=r(t),l=!1,0)):(c=t[0],0)})),o(n(0,[function(n){return m?0:n?(m=!0,i(1),c(1)):l?0:(l=!0,i(n),c(n))}]))}}function x(t){return function(r){return function(e){function o(r){return"number"==typeof r?(p=!1,s=a,void 0!==(r=i.shift())?f(t(u(r)),o):b?e(0):0):r.tag?l?0:(e(n(1,[r[0]])),s(0)):(p=!0,s=r=r[0],r(0))}let i=[],c=a,s=a,p=!1,l=!1,b=!1;return f(r,(function(n){return"number"==typeof n?b?0:(b=!0,!p&&function(n){return 0===n.length}(i)?e(0):0):n.tag?b?0:(n=n[0],p?i.push(n):f(t(n),o),c(0)):(c=n=n[0],n(0))})),e(n(0,[function(n){return n?(s(1),b||(l=b=!0,c(1),s=a),0):b?0:s(0)}]))}}}function y(n){return n}function h(n){return n}function d(n){return n(1)}function E(n){return n(1)}function k(n){return n(0)}function w(t){return function(r){return function(u){let e=a,o=[],i=!1;return f(r,(function(r){return"number"==typeof r?i?0:(i=!0,0===o.length?u(0):0):r.tag?i?0:(function(t){function r(n){return n!==e}let e=a;f(t,(function(t){return"number"==typeof t?(o=o.filter(r),i&&0===o.length?u(0):0):t.tag?0!==o.length?(u(n(1,[t[0]])),e(0)):0:(e=t=t[0],o=o.concat(t),t(0))}))}(t(r[0])),e(0)):(e=r=r[0],r(0))})),u(n(0,[function(n){return n?(o.forEach(d),i||(i=!0,e(1),o.forEach(E),o=[])):i||o.forEach(k),0}]))}}}function A(n){return n}function S(n){return n}function P(n){return w(S)(n)}function T(n){return function(t){return function(r){return f(t,(function(t){return"number"!=typeof t&&t.tag&&n(t[0]),r(t)}))}}}function L(n){return 0}function M(n){return 0}function C(t,r){return function(u){return function(e){let o=r;return f(u,(function(r){return"number"==typeof r?r=0:r.tag?(o=t(o,r[0]),r=n(1,[o])):r=n(0,[r[0]]),e(r)}))}}}function I(n){return n(0)}function O(t){return function(r){return function(u){function e(t){return"number"==typeof t?(c=!1,i=a,p?u(0):0):t.tag?s?0:(u(n(1,[t[0]])),i(0)):(c=!0,i=t=t[0],t(0))}let o=a,i=a,c=!1,s=!1,p=!1;return f(r,(function(n){return"number"==typeof n?p?0:(p=!0,c?0:u(0)):n.tag?p?0:(c&&(i(1),i=a),f(t(n[0]),e),o(0)):(o=n=n[0],n(0))})),u(n(0,[function(n){return n?(i(1),p||(s=p=!0,o(1),i=a),0):i(0)}]))}}}function U(n){return n}function W(n){return function(t){return function(r){function u(){return e.shift()}var e=[];return s(t,(function(t,o){return"number"==typeof t?p(r,u):(t.tag&&(e.length>=n&&0<n&&e.shift(),e.push(t[0])),o(0))}))}}}var j=x,D=w,V=P,q=P,z=T,B=T,F=O,G=W;function H(n){return function(t){let r=a,u=!1;return f(t,(function(t){return"number"==typeof t?(u=!0,0):t.tag?u?0:(n(t[0]),r(0)):(r=t=t[0],t(0))})),{unsubscribe:function(n){return u?0:(u=!0,r(1))}}}}function J(n){return 0}var K=H,N="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function Q(n){return 0}function R(n,t,r){n.addEventListener(t,r)}function X(n,t,r){n.removeEventListener(t,r)}function Y(t,r){return function(u){var e=R,o=X,f=function(t){return u(n(1,[t]))};return u(n(0,[function(n){return n?c(o,t,r,f):0}])),c(e,t,r,f)}}exports.buffer=function(t){return function(r){return function(u){function e(t){return"number"==typeof t?s?0:(s=!0,i(1),u(n(1,[o])),u(0)):t.tag?s?0:(u(n(1,[o])),o=[],c(0)):(c=t[0],c(0))}let o=[],i=a,c=a,s=!1;return f(r,(function(r){return"number"==typeof r?s?0:(s=!0,c(1),u(n(1,[o])),u(0)):r.tag?s?0:(o.push(r[0]),i(0)):(i=r[0],f(t,e))})),u(n(0,[function(n){return s?0:n?(s=!0,i(1),c(1)):i(0)}]))}}},exports.combine=function(n,t){return i(g,n,t)},exports.concat=function(n){return x(h)(l(n))},exports.concatAll=function(n){return x(y)(n)},exports.concatMap=j,exports.debounce=function(t){return function(e){return function(o){let i=!1,c=void 0;var a=function(n){return void 0!==(n=c)&&(c=void 0,clearTimeout(u(n))),0};return f(e,(function(u){if("number"==typeof u)return i=!0,void 0!==c?0:o(0);if(u.tag)return a(),c=r(setTimeout((function(n){return c=void 0,o(u),i?o(0):0}),t(u[0]))),0;var e=u[0];return o(n(0,[function(n){return n?(a(),e(1)):e(n)}]))}))}}},exports.delay=function(t){return function(r){return function(u){let e=a,o=0,i=!1;return f(r,(function(n){return"number"==typeof n||n.tag?(i||(o=o+1|0,setTimeout((function(t){return i&&0===o?u(0):o=o-1|0,u(n)}),t)),0):(e=n[0],0)})),u(n(0,[function(n){return n?(i=!0,0===o?u(0):0):i?0:e(n)}]))}}},exports.empty=function(t){return t(n(0,[a])),t(0)},exports.filter=function(n){return function(t){return function(r){return s(t,(function(t,u){return"number"==typeof t||!t.tag||n(t[0])?r(t):u(0)}))}}},exports.flatten=q,exports.forEach=function(n){return function(t){return H(n)(t),0}},exports.fromArray=v,exports.fromCallbag=function(t){return function(r){return i(t,0,(function(t,u){switch(t){case 0:return r(n(0,[function(n){return u(n?2:1)}]));case 1:return r(n(1,[u]));case 2:return r(0)}}))}},exports.fromDomEvent=function(n,t){return i(Y,n,t)},exports.fromList=function(n){return function(t){let u=n;return p(t,(function(){var n=u;if(n)return u=n[1],r(n[0])}))}},exports.fromObservable=function(t){var r=void 0!==t[N]?t[N]():t;return function(t){var u=r.subscribe({next:function(r){return t(n(1,[r]))},complete:function(){return t(0)},error:Q});return t(n(0,[function(n){return n?u.unsubscribe():0}]))}},exports.fromPromise=function(t){return function(r){let u=!1;return t.then((function(t){return u||(r(n(1,[t])),r(0)),Promise.resolve(0)})),r(n(0,[function(n){return n&&(u=!0),0}]))}},exports.fromValue=function(t){return function(r){let u=!1;return r(n(0,[function(e){return e||u?0:(u=!0,r(n(1,[t])),r(0))}]))}},exports.interval=function(t){return function(r){let u=0;var e=setInterval((function(t){return t=u,u=u+1|0,r(n(1,[t]))}),t);return r(n(0,[function(n){return n&&clearInterval(e),0}]))}},exports.make=function(t){return function(r){let u=b;return r(n(0,[function(n){return n?u():0}])),u=t({next:function(t){return r(n(1,[t]))},complete:function(n){return r(0)}}),0}},exports.makeSubject=function(t){let r=[],u=!1;return{source:function(t){function u(n){return n!==t}return r=r.concat(t),t(n(0,[function(n){return 1===n&&(r=r.filter(u)),0}]))},next:function(t){return u||r.forEach((function(r){return r(n(1,[t]))})),0},complete:function(n){return u||(u=!0,r.forEach(m)),0}}},exports.map=function(t){return function(r){return function(u){return f(r,(function(r){return r="number"==typeof r?0:r.tag?n(1,[t(r[0])]):n(0,[r[0]]),u(r)}))}}},exports.merge=function(n){return w(A)(l(n))},exports.mergeAll=V,exports.mergeMap=D,exports.never=function(t){return t(n(0,[a]))},exports.onEnd=function(t){return function(r){return function(u){let e=!1;return f(r,(function(r){if("number"==typeof r)return e?0:(e=!0,u(r),t());if(r.tag)return u(r);var o=r[0];return u(n(0,[function(n){return n&&!e&&(e=!0,t()),o(n)}]))}))}}},exports.onPush=z,exports.onStart=function(n){return function(t){return function(r){return f(t,(function(t){return"number"==typeof t||t.tag?r(t):(r(t),n())}))}}},exports.pipe=function(){for(var n=arguments,t=arguments[0],r=1,u=arguments.length;r<u;r++)t=n[r](t);return t},exports.publish=function(n){return H(J)(n)},exports.sample=function(t){return function(e){return function(o){let i=!1,c=void 0,a=L,s=M;return f(e,(function(n){return"number"==typeof n?(i=!0,s(1),o(0)):(n.tag?c=r(n[0]):a=n[0],0)})),f(t,(function(t){var r=c;return"number"==typeof t?(i=!0,a(1),o(0)):t.tag?void 0===r||i?0:(c=void 0,o(n(1,[u(r)]))):(s=t[0],0)})),o(n(0,[function(n){return n?(i=!0,a(1),s(1)):(a(0),s(0))}]))}}},exports.scan=function(n,t){return i(C,n,t)},exports.share=function(t){function r(n){return"number"==typeof n?(u.forEach(I),u=[]):n.tag?(o=!1,u.forEach((function(t){return t(n)}))):e=n[0],0}let u=[],e=a,o=!1;return function(i){function c(n){return n!==i}return u=u.concat(i),1===u.length&&f(t,r),i(n(0,[function(n){return n?(u=u.filter(c),0===u.length?e(1):0):o?0:(o=!0,e(n))}]))}},exports.skip=function(n){return function(t){return function(r){let u=n;return s(t,(function(n,t){return"number"!=typeof n&&n.tag&&0<u?(u=u-1|0,t(0)):r(n)}))}}},exports.skipUntil=function(t){return function(r){return function(u){let e=!0,o=!1,i=!1,c=a,s=a;return f(r,(function(n){if("number"==typeof n)return e&&s(1),o=!0,u(0);if(n.tag)return e&&!o?c(0):o?0:(i=!1,u(n));var r=n[0];return c=r,f(t,(function(n){return"number"==typeof n?0:n.tag?(e=!1,s(1)):(s=n=n[0],n(0),r(0))}))})),u(n(0,[function(n){return n?(e&&s(1),o=!0,c(1)):i||o?0:(i=!0,c(0))}]))}}},exports.skipWhile=function(n){return function(t){return function(r){let u=!0;return s(t,(function(t,e){if("number"!=typeof t&&t.tag&&u){if(n(t[0]))return e(0);u=!1}return r(t)}))}}},exports.subscribe=K,exports.switchAll=function(n){return O(U)(n)},exports.switchMap=F,exports.take=function(t){return function(r){return function(u){let e=0,o=a;return f(r,(function(n){return"number"==typeof n?e<t?(e=t,u(0)):0:n.tag?e<t&&(e=e+1|0,u(n),e===t)?(u(0),o(1)):0:(o=n[0],0)})),u(n(0,[function(n){return e<t?n?(e=t,o(1)):o(0):0}]))}}},exports.takeLast=G,exports.takeUntil=function(t){return function(r){return function(u){function e(n){return"number"==typeof n?0:n.tag?(o=!0,i(1),u(0)):(c=n=n[0],n(0))}let o=!1,i=a,c=a;return f(r,(function(n){return"number"==typeof n?o?0:(o=!0,c(1),u(0)):n.tag?o?0:u(n):(i=n[0],f(t,e))})),u(n(0,[function(n){return o?0:n?(o=!0,i(1),c(1)):i(0)}]))}}},exports.takeWhile=function(t){return function(r){return function(u){let e=!1,o=a;return f(r,(function(n){return"number"==typeof n?e?0:(e=!0,u(0)):n.tag?e?0:t(n[0])?u(n):(e=!0,u(0),o(1)):(o=n[0],u(n))})),u(n(0,[function(n){return e?0:n?(e=!0,o(1)):o(0)}]))}}},exports.tap=B,exports.throttle=function(t){return function(e){return function(o){function i(n){return a=void 0,c=!1,0}let c=!1,a=void 0;var s=function(n){return void 0!==(n=a)&&clearTimeout(u(n)),0};return f(e,(function(u){if("number"==typeof u)return s(),o(0);if(u.tag)return c?0:(c=!0,s(),a=r(setTimeout(i,t(u[0]))),o(u));var e=u[0];return o(n(0,[function(n){return n?(s(),e(1)):e(n)}]))}))}}},exports.toArray=function(n){let t=[],r=a,u=!1;return f(n,(function(n){return"number"==typeof n?(u=!0,0):n.tag?(t.push(n[0]),r(0)):(r=n=n[0],n(0))})),u||r(1),t},exports.toCallbag=function(n){return function(t,r){return 0===t?f(n,(function(n){if("number"==typeof n)return i(r,2,0);if(n.tag)return i(r,1,n[0]);var t=n[0];return i(r,0,(function(n){switch(n){case 0:return 0;case 1:return t(0);case 2:return t(1)}}))})):0}},exports.toObservable=function(n){var t={subscribe:function(t){let r=a,u=!1;return f(n,(function(n){return"number"==typeof n?(u=!0,t.complete()):n.tag?u?0:(t.next(n[0]),r(0)):(r=n=n[0],n(0))})),{unsubscribe:function(){return u?0:(u=!0,r(1))}}}};return t[N]=function(n){return t},t},exports.toPromise=function(n){return new Promise((function(t,r){return f(W(1)(n),(function(n){return"number"==typeof n?0:n.tag?t(n[0]):n[0](0)}))}))}; | ||
"use strict";function n(n,t){return t.tag=n,t}var t=[];function r(n){return void 0===n?((n=[t,0]).tag=256,n):(null!==n&&n[0]===t&&((n=[t,n[1]+1|0]).tag=256),n)}function u(n){return null===n||n[0]!==t?n:0!==(n=n[1])?[t,n-1|0]:void 0}function e(n){return 0}function o(t,r){let e=!1,o=!1,f=!1;return t(n(0,[function(i){if(i)e=!0;else if(o)f=!0;else{for(o=f=!0;f&&!e;)void 0!==(i=r())?(f=!1,t(n(1,[u(i)]))):(e=!0,t(0));o=!1}return 0}]))}function f(n){return function(t){var u=n.length;let e=0;return o(t,(function(){if(e<u){var t=n[e];return e=e+1|0,r(t)}}))}}function i(){return 0}function c(n){return n(0)}function a(t){let r=!1;return t(n(0,[function(n){return n&&(r=!0),0}])),r?0:t(0)}var s=f,p=a;function l(n,t,r){for(var u=Array(r),e=0;e<r;)u[e]=n[t],e=e+1|0,t=t+1|0;return u}function b(n,t){for(;;){var r=t,u=0===(t=n.length)?1:t;if(0==(t=u-r.length|0))return n.apply(null,r);if(!(0>t))return function(n,t){return function(r){return b(n,t.concat([r]))}}(n,r);t=l(r,u,0|-t),n=n.apply(null,l(r,0,u))}}function m(n,t){var r=n.length;return 1===r?n(t):function(n,t,r){switch(r){case 1:return n(t);case 2:return function(r){return n(t,r)};case 3:return function(r,u){return n(t,r,u)};case 4:return function(r,u,e){return n(t,r,u,e)};case 5:return function(r,u,e,o){return n(t,r,u,e,o)};case 6:return function(r,u,e,o,f){return n(t,r,u,e,o,f)};case 7:return function(r,u,e,o,f,i){return n(t,r,u,e,o,f,i)};default:return b(n,[t])}}(n,t,r)}function v(n,t,r){var u=n.length;return 2===u?n(t,r):function(n,t,r,u){switch(u){case 1:return b(n(t),[r]);case 2:return n(t,r);case 3:return function(u){return n(t,r,u)};case 4:return function(u,e){return n(t,r,u,e)};case 5:return function(u,e,o){return n(t,r,u,e,o)};case 6:return function(u,e,o,f){return n(t,r,u,e,o,f)};case 7:return function(u,e,o,f,i){return n(t,r,u,e,o,f,i)};default:return b(n,[t,r])}}(n,t,r,u)}function g(n,t,r,u){var e=n.length;return 3===e?n(t,r,u):function(n,t,r,u,e){switch(e){case 1:return b(n(t),[r,u]);case 2:return b(n(t,r),[u]);case 3:return n(t,r,u);case 4:return function(e){return n(t,r,u,e)};case 5:return function(e,o){return n(t,r,u,e,o)};case 6:return function(e,o,f){return n(t,r,u,e,o,f)};case 7:return function(e,o,f,i){return n(t,r,u,e,o,f,i)};default:return b(n,[t,r,u])}}(n,t,r,u,e)}function x(t,o){return function(f){let i=e,c=e,a=void 0,s=void 0,p=!1,l=0,b=!1;return m(t,(function(t){var e=s;return"number"==typeof t?1>l?(l=l+1|0,0):b?0:(b=!0,f(0)):t.tag?(t=t[0],void 0!==e?b?0:(a=r(t),p=!1,f(n(1,[[t,u(e)]]))):(a=r(t),p?(p=!1,0):c(0))):(i=t[0],0)})),m(o,(function(t){var e=a;return"number"==typeof t?1>l?(l=l+1|0,0):b?0:(b=!0,f(0)):t.tag?(t=t[0],void 0!==e?b?0:(s=r(t),p=!1,f(n(1,[[u(e),t]]))):(s=r(t),p?(p=!1,0):i(0))):(c=t[0],0)})),f(n(0,[function(n){return b?0:n?(b=!0,i(1),c(1)):p?0:(p=!0,i(n),c(n))}]))}}function y(t){return function(r){return function(o){function f(n){return"number"==typeof n?p?(p=!1,void 0!==(n=i.shift())?m(t(u(n)),f):b?o(0):0):0:n.tag?p?(o(n),l?(l=!1,0):s(0)):0:(p=!0,s=n=n[0],l=!1,n(0))}let i=[],c=e,a=!1,s=e,p=!1,l=!1,b=!1;return m(r,(function(n){return"number"==typeof n?b?0:(b=!0,!p&&function(n){return 0===n.length}(i)?o(0):0):n.tag?b?0:(n=n[0],a?a=!1:(a=!0,c(0)),p?(i.push(n),0):m(t(n),f)):(c=n[0],0)})),o(n(0,[function(n){return n?b?0:(b=!0,p=!1,s(1),c(1)):(b||a||(a=!0,c(0)),p&&!l?(l=!0,s(0)):0)}]))}}}function h(n){return n}function d(n){return n}function E(n){return n(0)}function k(t){return function(r){return function(u){let o=e,f=!1,i=[],c=!1;return m(r,(function(r){if("number"==typeof r)return c?0:(c=!0,0===i.length?u(0):0);if(r.tag){if(c)return 0;{var a=function(n){return n!==o};f=!1,r=t(r[0]);let o=e;return m(r,(function(t){return"number"==typeof t?0!==i.length?(i=i.filter(a),c&&0===i.length?u(0):0):0:t.tag?0!==i.length?(u(n(1,[t[0]])),o(0)):0:(o=t=t[0],i=i.concat(t),t(0))}))}}return o=r[0],0})),u(n(0,[function(n){if(!c)if(n){var t=i;c=!0,i=[],o(n),t.forEach((function(t){return t(n)}))}else f||(f=!0,o(0)),i.forEach(E);return 0}]))}}}function w(n){return n}function A(n){return n}function S(n){return k(A)(n)}function P(n){return function(t){return function(r){return m(t,(function(t){return"number"!=typeof t&&t.tag&&n(t[0]),r(t)}))}}}function T(t,r){return function(u){return function(e){let o=r;return m(u,(function(r){return"number"==typeof r?r=0:r.tag?(o=t(o,r[0]),r=n(1,[o])):r=n(0,[r[0]]),e(r)}))}}}function L(n){return n(0)}function M(t){return function(r){return function(u){function o(n){return"number"==typeof n?a?(a=!1,p?u(n):0):0:n.tag?a?(u(n),s?(s=!1,0):c(0)):0:(a=!0,c=n=n[0],s=!1,n(0))}let f=e,i=!1,c=e,a=!1,s=!1,p=!1;return m(r,(function(n){return"number"==typeof n?p?0:(p=!0,a?0:u(0)):n.tag?p?0:(a&&(c(1),c=e),i?i=!1:(i=!0,f(0)),m(n=t(n[0]),o)):(f=n[0],0)})),u(n(0,[function(n){return n?p?0:(p=!0,a=!1,c(1),f(1)):(p||i||(i=!0,f(0)),a&&!s?(s=!0,c(0)):0)}]))}}}function C(n){return n}function I(n){return function(t){return function(r){function u(){return i.shift()}let f=e;var i=[];return m(t,(function(t){return"number"==typeof t?o(r,u):t.tag?(i.length>=n&&0<n&&i.shift(),i.push(t[0]),f(0)):(t=t[0],0>=n?(t(1),a(r)):(f=t,t(0)))}))}}}var O=y,U=k,W=S,j=S,D=P,V=P,q=M,z=I;function B(n){return function(t){let r=e,u=!1;return m(t,(function(t){return"number"==typeof t?(u=!0,0):t.tag?u?0:(n(t[0]),r(0)):(r=t=t[0],t(0))})),{unsubscribe:function(n){return u?0:(u=!0,r(1))}}}}function F(n){return 0}var G=B,H="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function J(n){return 0}function K(n,t,r){n.addEventListener(t,r)}function N(n,t,r){n.removeEventListener(t,r)}function Q(t,r){return function(u){var e=K,o=N,f=function(t){return u(n(1,[t]))};return u(n(0,[function(n){return n?g(o,t,r,f):0}])),g(e,t,r,f)}}exports.buffer=function(t){return function(r){return function(u){function o(t){return"number"==typeof t?s?0:(s=!0,i(1),0<f.length&&u(n(1,[f])),u(0)):t.tag?s||0>=f.length?0:(t=f,f=[],u(n(1,[t]))):(c=t[0],0)}let f=[],i=e,c=e,a=!1,s=!1;return m(r,(function(r){return"number"==typeof r?s?0:(s=!0,c(1),0<f.length&&u(n(1,[f])),u(0)):r.tag?s?0:(f.push(r[0]),a=!1,c(0)):(i=r[0],m(t,o))})),u(n(0,[function(n){return s?0:n?(s=!0,i(1),c(1)):a?0:(a=!0,i(0),c(0))}]))}}},exports.combine=function(n,t){return v(x,n,t)},exports.concat=function(n){return y(d)(f(n))},exports.concatAll=function(n){return y(h)(n)},exports.concatMap=O,exports.debounce=function(t){return function(e){return function(o){let f=void 0,i=!1,c=!1;var a=function(n){return void 0!==(n=f)&&(f=void 0,clearTimeout(u(n))),0};return m(e,(function(u){if("number"==typeof u)return c?0:(c=!0,void 0!==f?(i=!0,0):o(0));if(u.tag)return c||(a(),f=r(setTimeout((function(n){return f=void 0,o(u),i?o(0):0}),t(u[0])))),0;var e=u[0];return o(n(0,[function(n){return c?0:n?(c=!0,i=!1,a(),e(1)):e(0)}]))}))}}},exports.delay=function(n){return function(t){return function(r){let u=0;return m(t,(function(t){return"number"==typeof t||t.tag?(u=u+1|0,setTimeout((function(n){return 0!==u?(u=u-1|0,r(t)):0}),n),0):r(t)}))}}},exports.empty=p,exports.filter=function(n){return function(t){return function(r){let u=e;return m(t,(function(t){return"number"==typeof t?r(t):t.tag?n(t[0])?r(t):u(0):(u=t[0],r(t))}))}}},exports.flatten=j,exports.forEach=function(n){return function(t){return B(n)(t),0}},exports.fromArray=s,exports.fromCallbag=function(t){return function(r){return v(t,0,(function(t,u){switch(t){case 0:return r(n(0,[function(n){return u(n?2:1)}]));case 1:return r(n(1,[u]));case 2:return r(0)}}))}},exports.fromDomEvent=function(n,t){return v(Q,n,t)},exports.fromList=function(n){return function(t){let u=n;return o(t,(function(){var n=u;if(n)return u=n[1],r(n[0])}))}},exports.fromObservable=function(t){var r=void 0!==t[H]?t[H]():t;return function(t){var u=r.subscribe({next:function(r){return t(n(1,[r]))},complete:function(){return t(0)},error:J});return t(n(0,[function(n){return n?u.unsubscribe():0}]))}},exports.fromPromise=function(t){return function(r){let u=!1;return t.then((function(t){return u||(r(n(1,[t])),r(0)),Promise.resolve(0)})),r(n(0,[function(n){return n&&(u=!0),0}]))}},exports.fromValue=function(t){return function(r){let u=!1;return r(n(0,[function(e){return e?(u=!0,0):u?0:(u=!0,r(n(1,[t])),r(0))}]))}},exports.interval=function(t){return function(r){let u=0;var e=setInterval((function(t){return t=u,u=u+1|0,r(n(1,[t]))}),t);return r(n(0,[function(n){return n&&clearInterval(e),0}]))}},exports.make=function(t){return function(r){let u=i,e=!1;return r(n(0,[function(n){return n&&!e?(e=!0,u()):0}])),u=t({next:function(t){return e?0:r(n(1,[t]))},complete:function(n){return e?0:(e=!0,r(0))}}),0}},exports.makeSubject=function(t){let r=[],u=!1;return{source:function(t){function u(n){return n!==t}return r=r.concat(t),t(n(0,[function(n){return n&&(r=r.filter(u)),0}]))},next:function(t){return u||r.forEach((function(r){return r(n(1,[t]))})),0},complete:function(n){return u||(u=!0,r.forEach(c)),0}}},exports.map=function(t){return function(r){return function(u){return m(r,(function(r){return r="number"!=typeof r&&r.tag?n(1,[t(r[0])]):r,u(r)}))}}},exports.merge=function(n){return k(w)(f(n))},exports.mergeAll=W,exports.mergeMap=U,exports.never=function(t){return t(n(0,[e]))},exports.onEnd=function(t){return function(r){return function(u){return m(r,(function(r){if("number"==typeof r)return u(r),t();if(r.tag)return u(r);var e=r[0];return u(n(0,[function(n){return n&&t(),e(n)}]))}))}}},exports.onPush=D,exports.onStart=function(n){return function(t){return function(r){return m(t,(function(t){return"number"==typeof t||t.tag?r(t):(r(t),n())}))}}},exports.pipe=function(){for(var n=arguments,t=arguments[0],r=1,u=arguments.length;r<u;r++)t=n[r](t);return t},exports.publish=function(n){return B(F)(n)},exports.sample=function(t){return function(o){return function(f){let i=e,c=e,a=void 0,s=!1,p=!1;return m(o,(function(n){return"number"==typeof n?p?0:(p=!0,c(1),f(0)):n.tag?(a=r(n[0]),c(0)):(i=n[0],0)})),m(t,(function(t){var r=a;return"number"==typeof t?p?0:(p=!0,i(1),f(0)):t.tag?void 0===r||p?0:(a=void 0,f(n(1,[u(r)]))):(c=t[0],0)})),f(n(0,[function(n){return p?0:n?(p=!0,i(1),c(1)):s?0:(s=!0,i(0),c(0))}]))}}},exports.scan=function(n,t){return v(T,n,t)},exports.share=function(t){function r(n){return"number"==typeof n?(u.forEach(L),u=[]):n.tag?(f=!1,u.forEach((function(t){return t(n)}))):o=n[0],0}let u=[],o=e,f=!1;return function(e){function i(n){return n!==e}return u=u.concat(e),1===u.length&&m(t,r),e(n(0,[function(n){return n?(u=u.filter(i),0===u.length?o(1):0):f?0:(f=!0,o(n))}]))}},exports.skip=function(n){return function(t){return function(r){let u=e,o=n;return m(t,(function(n){return"number"==typeof n?r(n):n.tag?0<o?(o=o-1|0,u(0)):r(n):(u=n[0],r(n))}))}}},exports.skipUntil=function(t){return function(r){return function(u){function o(n){return"number"==typeof n?c?(s=!0,f(1)):0:n.tag?(c=!1,i(1)):(i=n=n[0],n(0))}let f=e,i=e,c=!0,a=!1,s=!1;return m(r,(function(n){return"number"==typeof n?(c&&i(1),s=!0,u(0)):n.tag?c||s?0:(a=!1,u(n)):(f=n[0],m(t,o))})),u(n(0,[function(n){return s?0:n?(s=!0,f(1),c?i(1):0):a?0:(a=!0,c&&i(0),f(0))}]))}}},exports.skipWhile=function(n){return function(t){return function(r){let u=e,o=!0;return m(t,(function(t){if("number"==typeof t)return r(t);if(t.tag){if(o){if(n(t[0]))return u(0);o=!1}return r(t)}return u=t[0],r(t)}))}}},exports.subscribe=G,exports.switchAll=function(n){return M(C)(n)},exports.switchMap=q,exports.take=function(t){return function(r){return function(u){let o=!1,f=0,i=e;return m(r,(function(n){return"number"==typeof n?o?0:(o=!0,u(0)):n.tag?f<t&&!o&&(f=f+1|0,u(n),!o&&f>=t)?(o=!0,u(0),i(1)):0:(n=n[0],0>=t?(o=!0,u(0),n(1)):(i=n,0))})),u(n(0,[function(n){return o?0:n?(o=!0,i(1)):f<t?i(0):0}]))}}},exports.takeLast=z,exports.takeUntil=function(t){return function(r){return function(u){function o(n){return"number"==typeof n?0:n.tag?(f=!0,i(1),u(0)):(c=n=n[0],n(0))}let f=!1,i=e,c=e;return m(r,(function(n){return"number"==typeof n?f?0:(f=!0,c(1),u(0)):n.tag?f?0:u(n):(i=n[0],m(t,o))})),u(n(0,[function(n){return f?0:n?(f=!0,i(1),c(1)):i(0)}]))}}},exports.takeWhile=function(n){return function(t){return function(r){let u=e,o=!1;return m(t,(function(t){return"number"==typeof t?o?0:(o=!0,r(0)):t.tag?o?0:n(t[0])?r(t):(o=!0,r(0),u(1)):(u=t[0],r(t))}))}}},exports.tap=V,exports.throttle=function(t){return function(e){return function(o){function f(n){return c=void 0,i=!1,0}let i=!1,c=void 0;var a=function(n){return void 0!==(n=c)&&clearTimeout(u(n)),0};return m(e,(function(u){if("number"==typeof u)return a(),o(0);if(u.tag)return i?0:(i=!0,a(),c=r(setTimeout(f,t(u[0]))),o(u));var e=u[0];return o(n(0,[function(n){return n?(a(),e(1)):e(n)}]))}))}}},exports.toArray=function(n){let t=[],r=e,u=!1;return m(n,(function(n){return"number"==typeof n?(u=!0,0):n.tag?(t.push(n[0]),r(0)):(r=n=n[0],n(0))})),u||r(1),t},exports.toCallbag=function(n){return function(t,r){return 0===t?m(n,(function(n){if("number"==typeof n)return v(r,2,0);if(n.tag)return v(r,1,n[0]);var t=n[0];return v(r,0,(function(n){switch(n){case 0:return 0;case 1:return t(0);case 2:return t(1)}}))})):0}},exports.toObservable=function(n){var t={subscribe:function(t){let r=e,u=!1;return m(n,(function(n){return"number"==typeof n?(u=!0,t.complete()):n.tag?u?0:(t.next(n[0]),r(0)):(r=n=n[0],n(0))})),{unsubscribe:function(){return u?0:(u=!0,r(1))}}}};return t[H]=function(n){return t},t},exports.toPromise=function(n){return new Promise((function(t,r){return m(I(1)(n),(function(n){return"number"==typeof n?0:n.tag?t(n[0]):n[0](0)}))}))}; |
{ | ||
"name": "wonka", | ||
"description": "A fast push & pull stream library for Reason/OCaml, Flow, and TypeScript", | ||
"version": "4.0.0-rc.0", | ||
"version": "4.0.0-rc.1", | ||
"author": "Phil Pluckthun <phil@kitten.sh>", | ||
@@ -6,0 +6,0 @@ "source": "./src/wonka.ts", |
import * as Block from "bs-platform/lib/es6/block.js"; | ||
import * as Curry from "bs-platform/lib/es6/curry.js"; | ||
import * as Caml_option from "bs-platform/lib/es6/caml_option.js"; | ||
@@ -11,14 +10,2 @@ | ||
function captureTalkback(source, sinkWithTalkback) { | ||
var talkback = { | ||
contents: talkbackPlaceholder | ||
}; | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal !== "number" && !signal.tag) { | ||
talkback.contents = signal[0]; | ||
} | ||
return sinkWithTalkback(signal, talkback.contents); | ||
})); | ||
} | ||
function makeTrampoline(sink, f) { | ||
@@ -59,3 +46,2 @@ var state = { | ||
talkbackPlaceholder , | ||
captureTalkback , | ||
makeTrampoline , | ||
@@ -62,0 +48,0 @@ |
@@ -7,3 +7,2 @@ | ||
import * as Wonka_callbag from "./wonka_callbag.bs.js"; | ||
import * as Wonka_helpers from "../helpers/wonka_helpers.bs.js"; | ||
import * as Wonka_operators from "../wonka_operators.bs.js"; | ||
@@ -15,12 +14,11 @@ import * as Wonka_observable from "./wonka_observable.bs.js"; | ||
return (function (sink) { | ||
var gotEndSignal = { | ||
contents: false | ||
var state = { | ||
id: undefined, | ||
deferredEnded: false, | ||
ended: false | ||
}; | ||
var id = { | ||
contents: undefined | ||
}; | ||
var $$clearTimeout$1 = function (param) { | ||
var match = id.contents; | ||
var match = state.id; | ||
if (match !== undefined) { | ||
id.contents = undefined; | ||
state.id = undefined; | ||
clearTimeout(Caml_option.valFromOption(match)); | ||
@@ -34,29 +32,42 @@ return /* () */0; | ||
if (typeof signal === "number") { | ||
gotEndSignal.contents = true; | ||
var match = id.contents; | ||
if (match !== undefined) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
return sink(/* End */0); | ||
state.ended = true; | ||
var match = state.id; | ||
if (match !== undefined) { | ||
state.deferredEnded = true; | ||
return /* () */0; | ||
} else { | ||
return sink(/* End */0); | ||
} | ||
} | ||
} else if (signal.tag) { | ||
$$clearTimeout$1(/* () */0); | ||
id.contents = Caml_option.some(setTimeout((function (param) { | ||
id.contents = undefined; | ||
sink(signal); | ||
if (gotEndSignal.contents) { | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
}), f(signal[0]))); | ||
return /* () */0; | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
$$clearTimeout$1(/* () */0); | ||
state.id = Caml_option.some(setTimeout((function (param) { | ||
state.id = undefined; | ||
sink(signal); | ||
if (state.deferredEnded) { | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
}), f(signal[0]))); | ||
return /* () */0; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.deferredEnded = false; | ||
$$clearTimeout$1(/* () */0); | ||
return tb(/* Close */1); | ||
} else { | ||
return tb(signal); | ||
return tb(/* Pull */0); | ||
} | ||
@@ -73,41 +84,20 @@ })])); | ||
return (function (sink) { | ||
var state = { | ||
talkback: Wonka_helpers.talkbackPlaceholder, | ||
active: 0, | ||
gotEndSignal: false | ||
var active = { | ||
contents: 0 | ||
}; | ||
Curry._1(source, (function (signal) { | ||
if (typeof signal !== "number" && !signal.tag) { | ||
state.talkback = signal[0]; | ||
return /* () */0; | ||
} | ||
if (state.gotEndSignal) { | ||
return /* () */0; | ||
} else { | ||
state.active = state.active + 1 | 0; | ||
setTimeout((function (param) { | ||
if (state.gotEndSignal && state.active === 0) { | ||
sink(/* End */0); | ||
} else { | ||
state.active = state.active - 1 | 0; | ||
} | ||
return sink(signal); | ||
}), wait); | ||
return /* () */0; | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
state.gotEndSignal = true; | ||
if (state.active === 0) { | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
} else if (state.gotEndSignal) { | ||
return /* () */0; | ||
} else { | ||
return state.talkback(signal); | ||
} | ||
})])); | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal !== "number" && !signal.tag) { | ||
return sink(signal); | ||
} | ||
active.contents = active.contents + 1 | 0; | ||
setTimeout((function (param) { | ||
if (active.contents !== 0) { | ||
active.contents = active.contents - 1 | 0; | ||
return sink(signal); | ||
} else { | ||
return 0; | ||
} | ||
}), wait); | ||
return /* () */0; | ||
})); | ||
}); | ||
@@ -114,0 +104,0 @@ }); |
@@ -17,2 +17,3 @@ | ||
notifierTalkback: Wonka_helpers.talkbackPlaceholder, | ||
pulled: false, | ||
ended: false | ||
@@ -27,3 +28,5 @@ }; | ||
state.notifierTalkback(/* Close */1); | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
if (state.buffer.length > 0) { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
} | ||
return sink(/* End */0); | ||
@@ -36,3 +39,4 @@ } | ||
state.buffer.push(signal[0]); | ||
return state.sourceTalkback(/* Pull */0); | ||
state.pulled = false; | ||
return state.notifierTalkback(/* Pull */0); | ||
} | ||
@@ -48,16 +52,18 @@ } else { | ||
state.sourceTalkback(/* Close */1); | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
if (state.buffer.length > 0) { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
} | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
if (state.ended || state.buffer.length <= 0) { | ||
return /* () */0; | ||
} else { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
var buffer = state.buffer; | ||
state.buffer = new Array(); | ||
return state.notifierTalkback(/* Pull */0); | ||
return sink(/* Push */Block.__(1, [buffer])); | ||
} | ||
} else { | ||
state.notifierTalkback = signal[0]; | ||
return state.notifierTalkback(/* Pull */0); | ||
return /* () */0; | ||
} | ||
@@ -74,4 +80,8 @@ })); | ||
return state.notifierTalkback(/* Close */1); | ||
} else if (state.pulled) { | ||
return /* () */0; | ||
} else { | ||
return state.sourceTalkback(/* Pull */0); | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
} | ||
@@ -121,4 +131,8 @@ })])); | ||
state.lastValA = Caml_option.some(a); | ||
state.gotSignal = false; | ||
return /* () */0; | ||
if (state.gotSignal) { | ||
state.gotSignal = false; | ||
return /* () */0; | ||
} else { | ||
return state.talkbackB(/* Pull */0); | ||
} | ||
} | ||
@@ -157,4 +171,8 @@ } else { | ||
state.lastValB = Caml_option.some(b); | ||
state.gotSignal = false; | ||
return /* () */0; | ||
if (state.gotSignal) { | ||
state.gotSignal = false; | ||
return /* () */0; | ||
} else { | ||
return state.talkbackA(/* Pull */0); | ||
} | ||
} | ||
@@ -190,5 +208,6 @@ } else { | ||
outerTalkback: Wonka_helpers.talkbackPlaceholder, | ||
outerPulled: false, | ||
innerTalkback: Wonka_helpers.talkbackPlaceholder, | ||
innerActive: false, | ||
closed: false, | ||
innerPulled: false, | ||
ended: false | ||
@@ -199,9 +218,12 @@ }; | ||
if (typeof signal === "number") { | ||
state.innerActive = false; | ||
state.innerTalkback = Wonka_helpers.talkbackPlaceholder; | ||
var match = state.inputQueue.shift(); | ||
if (match !== undefined) { | ||
return applyInnerSource(f(Caml_option.valFromOption(match))); | ||
} else if (state.ended) { | ||
return sink(/* End */0); | ||
if (state.innerActive) { | ||
state.innerActive = false; | ||
var match = state.inputQueue.shift(); | ||
if (match !== undefined) { | ||
return applyInnerSource(f(Caml_option.valFromOption(match))); | ||
} else if (state.ended) { | ||
return sink(/* End */0); | ||
} else { | ||
return /* () */0; | ||
} | ||
} else { | ||
@@ -211,7 +233,12 @@ return /* () */0; | ||
} else if (signal.tag) { | ||
if (state.closed) { | ||
if (state.innerActive) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return /* () */0; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} else { | ||
return /* () */0; | ||
} else { | ||
sink(/* Push */Block.__(1, [signal[0]])); | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
@@ -222,2 +249,3 @@ } else { | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
@@ -244,13 +272,18 @@ } | ||
var x = signal[0]; | ||
if (state.outerPulled) { | ||
state.outerPulled = false; | ||
} else { | ||
state.outerPulled = true; | ||
state.outerTalkback(/* Pull */0); | ||
} | ||
if (state.innerActive) { | ||
state.inputQueue.push(x); | ||
return /* () */0; | ||
} else { | ||
applyInnerSource(f(x)); | ||
return applyInnerSource(f(x)); | ||
} | ||
return state.outerTalkback(/* Pull */0); | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.outerTalkback = tb; | ||
return tb(/* Pull */0); | ||
state.outerTalkback = signal[0]; | ||
return /* () */0; | ||
} | ||
@@ -260,16 +293,21 @@ })); | ||
if (signal) { | ||
state.innerTalkback(/* Close */1); | ||
if (state.ended) { | ||
return 0; | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
state.closed = true; | ||
state.outerTalkback(/* Close */1); | ||
state.innerTalkback = Wonka_helpers.talkbackPlaceholder; | ||
return /* () */0; | ||
state.innerActive = false; | ||
state.innerTalkback(/* Close */1); | ||
return state.outerTalkback(/* Close */1); | ||
} | ||
} else if (state.ended) { | ||
return 0; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
if (!state.ended && !state.outerPulled) { | ||
state.outerPulled = true; | ||
state.outerTalkback(/* Pull */0); | ||
} | ||
if (state.innerActive && !state.innerPulled) { | ||
state.innerPulled = true; | ||
return state.innerTalkback(/* Pull */0); | ||
} else { | ||
return 0; | ||
} | ||
} | ||
@@ -296,7 +334,17 @@ })])); | ||
return (function (sink) { | ||
return Wonka_helpers.captureTalkback(source, (function (signal, talkback) { | ||
if (typeof signal === "number" || !(signal.tag && !f(signal[0]))) { | ||
var talkback = { | ||
contents: Wonka_helpers.talkbackPlaceholder | ||
}; | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
return sink(signal); | ||
} else if (signal.tag) { | ||
if (f(signal[0])) { | ||
return sink(signal); | ||
} else { | ||
return talkback.contents(/* Pull */0); | ||
} | ||
} else { | ||
return talkback(/* Pull */0); | ||
talkback.contents = signal[0]; | ||
return sink(signal); | ||
} | ||
@@ -313,5 +361,3 @@ })); | ||
var tmp; | ||
tmp = typeof signal === "number" ? /* End */0 : ( | ||
signal.tag ? /* Push */Block.__(1, [f(signal[0])]) : /* Start */Block.__(0, [signal[0]]) | ||
); | ||
tmp = typeof signal === "number" || !signal.tag ? signal : /* Push */Block.__(1, [f(signal[0])]); | ||
return sink(tmp); | ||
@@ -328,34 +374,6 @@ })); | ||
outerTalkback: Wonka_helpers.talkbackPlaceholder, | ||
outerPulled: false, | ||
innerTalkbacks: new Array(), | ||
ended: false | ||
}; | ||
var applyInnerSource = function (innerSource) { | ||
var talkback = { | ||
contents: Wonka_helpers.talkbackPlaceholder | ||
}; | ||
return Curry._1(innerSource, (function (signal) { | ||
if (typeof signal === "number") { | ||
state.innerTalkbacks = state.innerTalkbacks.filter((function (x) { | ||
return x !== talkback.contents; | ||
})); | ||
if (state.ended && state.innerTalkbacks.length === 0) { | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
} else if (signal.tag) { | ||
if (state.innerTalkbacks.length !== 0) { | ||
sink(/* Push */Block.__(1, [signal[0]])); | ||
return talkback.contents(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
talkback.contents = tb; | ||
state.innerTalkbacks = state.innerTalkbacks.concat(tb); | ||
return tb(/* Pull */0); | ||
} | ||
})); | ||
}; | ||
Curry._1(source, (function (signal) { | ||
@@ -377,32 +395,60 @@ if (typeof signal === "number") { | ||
} else { | ||
applyInnerSource(f(signal[0])); | ||
return state.outerTalkback(/* Pull */0); | ||
state.outerPulled = false; | ||
var innerSource = f(signal[0]); | ||
var talkback = { | ||
contents: Wonka_helpers.talkbackPlaceholder | ||
}; | ||
return Curry._1(innerSource, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.innerTalkbacks.length !== 0) { | ||
state.innerTalkbacks = state.innerTalkbacks.filter((function (x) { | ||
return x !== talkback.contents; | ||
})); | ||
if (state.ended && state.innerTalkbacks.length === 0) { | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
} else { | ||
return /* () */0; | ||
} | ||
} else if (signal.tag) { | ||
if (state.innerTalkbacks.length !== 0) { | ||
sink(/* Push */Block.__(1, [signal[0]])); | ||
return talkback.contents(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
talkback.contents = tb; | ||
state.innerTalkbacks = state.innerTalkbacks.concat(tb); | ||
return tb(/* Pull */0); | ||
} | ||
})); | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.outerTalkback = tb; | ||
return tb(/* Pull */0); | ||
state.outerTalkback = signal[0]; | ||
return /* () */0; | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
state.innerTalkbacks.forEach((function (talkback) { | ||
return talkback(/* Close */1); | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
var tbs = state.innerTalkbacks; | ||
state.ended = true; | ||
state.innerTalkbacks = new Array(); | ||
state.outerTalkback(signal); | ||
tbs.forEach((function (tb) { | ||
return tb(signal); | ||
})); | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
state.ended = true; | ||
state.outerTalkback(/* Close */1); | ||
state.innerTalkbacks.forEach((function (talkback) { | ||
return talkback(/* Close */1); | ||
})); | ||
state.innerTalkbacks = new Array(); | ||
return /* () */0; | ||
} | ||
} else if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.innerTalkbacks.forEach((function (talkback) { | ||
return talkback(/* Pull */0); | ||
if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
state.outerTalkback(/* Pull */0); | ||
} | ||
state.innerTalkbacks.forEach((function (tb) { | ||
return tb(/* Pull */0); | ||
})); | ||
@@ -431,14 +477,6 @@ return /* () */0; | ||
return (function (sink) { | ||
var ended = { | ||
contents: false | ||
}; | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (ended.contents) { | ||
return 0; | ||
} else { | ||
ended.contents = true; | ||
sink(signal); | ||
return f(); | ||
} | ||
sink(signal); | ||
return f(); | ||
} else if (signal.tag) { | ||
@@ -450,8 +488,3 @@ return sink(signal); | ||
if (signal) { | ||
if (ended.contents) { | ||
} else { | ||
ended.contents = true; | ||
f(); | ||
} | ||
f(); | ||
} | ||
@@ -498,19 +531,20 @@ return talkback(signal); | ||
var state = { | ||
ended: false, | ||
sourceTalkback: Wonka_helpers.talkbackPlaceholder, | ||
notifierTalkback: Wonka_helpers.talkbackPlaceholder, | ||
value: undefined, | ||
sourceTalkback: (function (param) { | ||
return /* () */0; | ||
}), | ||
notifierTalkback: (function (param) { | ||
return /* () */0; | ||
}) | ||
pulled: false, | ||
ended: false | ||
}; | ||
Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
state.ended = true; | ||
state.notifierTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
state.notifierTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
state.value = Caml_option.some(signal[0]); | ||
return /* () */0; | ||
return state.notifierTalkback(/* Pull */0); | ||
} else { | ||
@@ -524,5 +558,9 @@ state.sourceTalkback = signal[0]; | ||
if (typeof signal === "number") { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
@@ -541,7 +579,12 @@ if (match !== undefined && !state.ended) { | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else if (state.pulled) { | ||
return /* () */0; | ||
} else { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
@@ -628,11 +671,19 @@ return state.notifierTalkback(/* Pull */0); | ||
return (function (sink) { | ||
var rest = { | ||
contents: wait | ||
var state = { | ||
talkback: Wonka_helpers.talkbackPlaceholder, | ||
rest: wait | ||
}; | ||
return Wonka_helpers.captureTalkback(source, (function (signal, talkback) { | ||
if (typeof signal === "number" || !(signal.tag && rest.contents > 0)) { | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
return sink(signal); | ||
} else if (signal.tag) { | ||
if (state.rest > 0) { | ||
state.rest = state.rest - 1 | 0; | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
return sink(signal); | ||
} | ||
} else { | ||
rest.contents = rest.contents - 1 | 0; | ||
return talkback(/* Pull */0); | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
} | ||
@@ -648,7 +699,7 @@ })); | ||
var state = { | ||
sourceTalkback: Wonka_helpers.talkbackPlaceholder, | ||
notifierTalkback: Wonka_helpers.talkbackPlaceholder, | ||
skip: true, | ||
ended: false, | ||
gotSignal: false, | ||
sourceTalkback: Wonka_helpers.talkbackPlaceholder, | ||
notifierTalkback: Wonka_helpers.talkbackPlaceholder | ||
pulled: false, | ||
ended: false | ||
}; | ||
@@ -663,16 +714,18 @@ Curry._1(source, (function (signal) { | ||
} else if (signal.tag) { | ||
if (state.skip && !state.ended) { | ||
return state.sourceTalkback(/* Pull */0); | ||
} else if (state.ended) { | ||
if (!state.skip && !state.ended) { | ||
state.pulled = false; | ||
return sink(signal); | ||
} else { | ||
return /* () */0; | ||
} else { | ||
state.gotSignal = false; | ||
return sink(signal); | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.sourceTalkback = tb; | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
return /* () */0; | ||
if (state.skip) { | ||
state.ended = true; | ||
return state.sourceTalkback(/* Close */1); | ||
} else { | ||
return /* () */0; | ||
} | ||
} else if (signal.tag) { | ||
@@ -684,4 +737,3 @@ state.skip = false; | ||
state.notifierTalkback = innerTb; | ||
innerTb(/* Pull */0); | ||
return tb(/* Pull */0); | ||
return innerTb(/* Pull */0); | ||
} | ||
@@ -692,13 +744,20 @@ })); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.skip) { | ||
state.notifierTalkback(/* Close */1); | ||
return state.notifierTalkback(/* Close */1); | ||
} else { | ||
return 0; | ||
} | ||
state.ended = true; | ||
return state.sourceTalkback(/* Close */1); | ||
} else if (!state.gotSignal && !state.ended) { | ||
state.gotSignal = true; | ||
} else if (state.pulled) { | ||
return /* () */0; | ||
} else { | ||
state.pulled = true; | ||
if (state.skip) { | ||
state.notifierTalkback(/* Pull */0); | ||
} | ||
return state.sourceTalkback(/* Pull */0); | ||
} else { | ||
return /* () */0; | ||
} | ||
@@ -713,12 +772,22 @@ })])); | ||
return (function (sink) { | ||
var skip = { | ||
contents: true | ||
var state = { | ||
talkback: Wonka_helpers.talkbackPlaceholder, | ||
skip: true | ||
}; | ||
return Wonka_helpers.captureTalkback(source, (function (signal, talkback) { | ||
if (typeof signal === "number" || !(signal.tag && skip.contents)) { | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
return sink(signal); | ||
} else if (f(signal[0])) { | ||
return talkback(/* Pull */0); | ||
} else if (signal.tag) { | ||
if (state.skip) { | ||
if (f(signal[0])) { | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
state.skip = false; | ||
return sink(signal); | ||
} | ||
} else { | ||
return sink(signal); | ||
} | ||
} else { | ||
skip.contents = false; | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
@@ -736,32 +805,8 @@ } | ||
outerTalkback: Wonka_helpers.talkbackPlaceholder, | ||
outerPulled: false, | ||
innerTalkback: Wonka_helpers.talkbackPlaceholder, | ||
innerActive: false, | ||
closed: false, | ||
innerPulled: false, | ||
ended: false | ||
}; | ||
var applyInnerSource = function (innerSource) { | ||
return Curry._1(innerSource, (function (signal) { | ||
if (typeof signal === "number") { | ||
state.innerActive = false; | ||
state.innerTalkback = Wonka_helpers.talkbackPlaceholder; | ||
if (state.ended) { | ||
return sink(/* End */0); | ||
} else { | ||
return 0; | ||
} | ||
} else if (signal.tag) { | ||
if (state.closed) { | ||
return /* () */0; | ||
} else { | ||
sink(/* Push */Block.__(1, [signal[0]])); | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.innerActive = true; | ||
state.innerTalkback = tb; | ||
return tb(/* Pull */0); | ||
} | ||
})); | ||
}; | ||
Curry._1(source, (function (signal) { | ||
@@ -787,9 +832,45 @@ if (typeof signal === "number") { | ||
} | ||
applyInnerSource(f(signal[0])); | ||
return state.outerTalkback(/* Pull */0); | ||
if (state.outerPulled) { | ||
state.outerPulled = false; | ||
} else { | ||
state.outerPulled = true; | ||
state.outerTalkback(/* Pull */0); | ||
} | ||
var innerSource = f(signal[0]); | ||
return Curry._1(innerSource, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.innerActive) { | ||
state.innerActive = false; | ||
if (state.ended) { | ||
return sink(signal); | ||
} else { | ||
return 0; | ||
} | ||
} else { | ||
return /* () */0; | ||
} | ||
} else if (signal.tag) { | ||
if (state.innerActive) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return /* () */0; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} else { | ||
return /* () */0; | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.innerActive = true; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
} | ||
})); | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.outerTalkback = tb; | ||
return tb(/* Pull */0); | ||
state.outerTalkback = signal[0]; | ||
return /* () */0; | ||
} | ||
@@ -799,14 +880,21 @@ })); | ||
if (signal) { | ||
state.innerTalkback(/* Close */1); | ||
if (state.ended) { | ||
return 0; | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
state.closed = true; | ||
state.outerTalkback(/* Close */1); | ||
state.innerTalkback = Wonka_helpers.talkbackPlaceholder; | ||
return /* () */0; | ||
state.innerActive = false; | ||
state.innerTalkback(/* Close */1); | ||
return state.outerTalkback(/* Close */1); | ||
} | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
if (!state.ended && !state.outerPulled) { | ||
state.outerPulled = true; | ||
state.outerTalkback(/* Pull */0); | ||
} | ||
if (state.innerActive && !state.innerPulled) { | ||
state.innerPulled = true; | ||
return state.innerTalkback(/* Pull */0); | ||
} else { | ||
return 0; | ||
} | ||
} | ||
@@ -828,2 +916,3 @@ })])); | ||
var state = { | ||
ended: false, | ||
taken: 0, | ||
@@ -834,13 +923,14 @@ talkback: Wonka_helpers.talkbackPlaceholder | ||
if (typeof signal === "number") { | ||
if (state.taken < max) { | ||
state.taken = max; | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} else { | ||
return /* () */0; | ||
} | ||
} else if (signal.tag) { | ||
if (state.taken < max) { | ||
if (state.taken < max && !state.ended) { | ||
state.taken = state.taken + 1 | 0; | ||
sink(signal); | ||
if (state.taken === max) { | ||
if (!state.ended && state.taken >= max) { | ||
state.ended = true; | ||
sink(/* End */0); | ||
@@ -855,16 +945,23 @@ return state.talkback(/* Close */1); | ||
} else { | ||
state.talkback = signal[0]; | ||
return /* () */0; | ||
var tb = signal[0]; | ||
if (max <= 0) { | ||
state.ended = true; | ||
sink(/* End */0); | ||
return tb(/* Close */1); | ||
} else { | ||
state.talkback = tb; | ||
return /* () */0; | ||
} | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (state.taken < max) { | ||
if (signal) { | ||
state.taken = max; | ||
return state.talkback(/* Close */1); | ||
} else { | ||
return state.talkback(/* Pull */0); | ||
} | ||
if (state.ended) { | ||
return 0; | ||
} else if (signal) { | ||
state.ended = true; | ||
return state.talkback(/* Close */1); | ||
} else if (state.taken < max) { | ||
return state.talkback(/* Pull */0); | ||
} else { | ||
return 0; | ||
return /* () */0; | ||
} | ||
@@ -879,4 +976,7 @@ })])); | ||
return (function (sink) { | ||
var talkback = { | ||
contents: Wonka_helpers.talkbackPlaceholder | ||
}; | ||
var queue = new Array(); | ||
return Wonka_helpers.captureTalkback(source, (function (signal, talkback) { | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
@@ -892,5 +992,12 @@ return Wonka_helpers.makeTrampoline(sink, (function () { | ||
queue.push(signal[0]); | ||
return talkback(/* Pull */0); | ||
return talkback.contents(/* Pull */0); | ||
} else { | ||
return talkback(/* Pull */0); | ||
var tb = signal[0]; | ||
if (max <= 0) { | ||
tb(/* Close */1); | ||
return Wonka_sources.empty(sink); | ||
} else { | ||
talkback.contents = tb; | ||
return tb(/* Pull */0); | ||
} | ||
} | ||
@@ -960,41 +1067,29 @@ })); | ||
return (function (sink) { | ||
var ended = { | ||
contents: false | ||
var state = { | ||
talkback: Wonka_helpers.talkbackPlaceholder, | ||
ended: false | ||
}; | ||
var talkback = { | ||
contents: Wonka_helpers.talkbackPlaceholder | ||
}; | ||
Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (ended.contents) { | ||
return /* () */0; | ||
} else { | ||
ended.contents = true; | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
if (ended.contents) { | ||
return /* () */0; | ||
} else if (f(signal[0])) { | ||
return sink(signal); | ||
} else { | ||
ended.contents = true; | ||
sink(/* End */0); | ||
return talkback.contents(/* Close */1); | ||
} | ||
} else { | ||
talkback.contents = signal[0]; | ||
return sink(signal); | ||
} | ||
})); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (ended.contents) { | ||
return 0; | ||
} else if (signal) { | ||
ended.contents = true; | ||
return talkback.contents(/* Close */1); | ||
} else { | ||
return talkback.contents(/* Pull */0); | ||
} | ||
})])); | ||
return Curry._1(source, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
if (state.ended) { | ||
return /* () */0; | ||
} else if (f(signal[0])) { | ||
return sink(signal); | ||
} else { | ||
state.ended = true; | ||
sink(/* End */0); | ||
return state.talkback(/* Close */1); | ||
} | ||
} else { | ||
state.talkback = signal[0]; | ||
return sink(signal); | ||
} | ||
})); | ||
}); | ||
@@ -1001,0 +1096,0 @@ }); |
@@ -18,2 +18,3 @@ import * as deriving from './helpers/wonka_deriving'; | ||
let talkback = null; | ||
let push = 0; | ||
const values = []; | ||
@@ -23,4 +24,6 @@ | ||
sink(deriving.start(tb => { | ||
if (tb === deriving.pull) | ||
if (!push && tb === deriving.pull) { | ||
push++; | ||
sink(deriving.push(0)); | ||
} | ||
})); | ||
@@ -203,3 +206,3 @@ }; | ||
that either Close sources themselves or may operate on multiple sources. */ | ||
const passesStrictEnd = (operator: types.operatorT<any, any>) => | ||
const passesStrictEnd = (operator: types.operatorT<any, any>) => { | ||
it('stops all signals after End has been received (spec: strict end)', () => { | ||
@@ -214,3 +217,3 @@ let pulls = 0; | ||
sink(deriving.end()); | ||
sink(deriving.push(0)); | ||
sink(deriving.push(123)); | ||
} | ||
@@ -236,2 +239,29 @@ })); | ||
it('stops all signals after Close has been received (spec: strict close)', () => { | ||
const signals = []; | ||
const source: types.sourceT<any> = sink => { | ||
sink(deriving.start(tb => { | ||
if (tb === deriving.close) { | ||
sink(deriving.push(123)); | ||
} | ||
})); | ||
}; | ||
const sink: types.sinkT<any> = signal => { | ||
if (deriving.isStart(signal)) { | ||
deriving.unboxStart(signal)(deriving.close); | ||
} else { | ||
signals.push(signal); | ||
} | ||
}; | ||
operator(source)(sink); | ||
// The Push signal should've been dropped | ||
jest.runAllTimers(); | ||
expect(signals).toEqual([]); | ||
}); | ||
}; | ||
/* This tests an immediately closing operator for End signals to | ||
@@ -321,3 +351,3 @@ the sink and Close signals to the source. | ||
passesPassivePull(noop, [0, 0]); | ||
// TODO: passesActivePush(noop, [0, 0]); | ||
passesActivePush(noop, [0, 0]); | ||
passesSinkClose(noop); | ||
@@ -343,15 +373,16 @@ passesSourceEnd(noop, [0, 0]); | ||
describe('buffer', () => { | ||
const noop = operators.buffer( | ||
operators.merge([ | ||
sources.fromValue(null), | ||
sources.never | ||
]) | ||
); | ||
const valueThenNever: types.sourceT<any> = sink => | ||
sink(deriving.start(tb => { | ||
if (tb === deriving.pull) | ||
sink(deriving.push(null)); | ||
})); | ||
// TODO: passesPassivePull(noop, [0]); | ||
// TODO: passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
// TODO: passesSourceEnd(noop); | ||
const noop = operators.buffer(valueThenNever); | ||
passesPassivePull(noop, [0]); | ||
passesActivePush(noop, [0]); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop, [0]); | ||
passesSingleStart(noop); | ||
// TODO: passesStrictEnd(noop); | ||
passesStrictEnd(noop); | ||
@@ -371,2 +402,6 @@ it('emits batches of input values when a notifier emits', () => { | ||
expect(fn).toHaveBeenCalledWith([1, 2]); | ||
next(3); | ||
notify(null); | ||
expect(fn).toHaveBeenCalledWith([3]); | ||
}); | ||
@@ -377,6 +412,6 @@ }); | ||
const noop = operators.concatMap(x => sources.fromValue(x)); | ||
// TODO: passesPassivePull(noop); | ||
// TODO: passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
// TODO: passesSourceEnd(noop); | ||
passesPassivePull(noop); | ||
passesActivePush(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
passesSingleStart(noop); | ||
@@ -433,2 +468,15 @@ passesStrictEnd(noop); | ||
}); | ||
it('emits synchronous values in order', () => { | ||
const values = []; | ||
sinks.forEach(x => values.push(x))( | ||
operators.concat([ | ||
sources.fromArray([1, 2]), | ||
sources.fromArray([3, 4]) | ||
]) | ||
); | ||
expect(values).toEqual([ 1, 2, 3, 4 ]); | ||
}); | ||
}); | ||
@@ -443,3 +491,3 @@ | ||
passesSingleStart(noop); | ||
// TODO: passesStrictEnd(noop); | ||
passesStrictEnd(noop); | ||
passesAsyncSequence(noop); | ||
@@ -464,2 +512,14 @@ | ||
}); | ||
it('emits debounced value with delayed End signal', () => { | ||
const { source, next, complete } = sources.makeSubject<number>(); | ||
const fn = jest.fn(); | ||
sinks.forEach(fn)(web.debounce(() => 100)(source)); | ||
next(1); | ||
complete(); | ||
jest.advanceTimersByTime(100); | ||
expect(fn).toHaveBeenCalled(); | ||
}); | ||
}); | ||
@@ -471,3 +531,3 @@ | ||
passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
@@ -521,3 +581,2 @@ passesSingleStart(noop); | ||
passesSingleStart(noop); | ||
// TODO: passesStrictEnd(noop); | ||
passesAsyncSequence(noop); | ||
@@ -538,6 +597,6 @@ | ||
const noop = operators.mergeMap(x => sources.fromValue(x)); | ||
// TODO: passesPassivePull(noop); | ||
// TODO: passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
// TODO: passesSourceEnd(noop); | ||
passesPassivePull(noop); | ||
passesActivePush(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
passesSingleStart(noop); | ||
@@ -580,10 +639,23 @@ passesStrictEnd(noop); | ||
jest.advanceTimersByTime(14); | ||
jest.runAllTimers(); | ||
expect(fn.mock.calls).toEqual([ | ||
[1], | ||
[2], | ||
[10], | ||
[2], | ||
[20], | ||
]); | ||
}); | ||
it('emits synchronous values in order', () => { | ||
const values = []; | ||
sinks.forEach(x => values.push(x))( | ||
operators.merge([ | ||
sources.fromArray([1, 2]), | ||
sources.fromArray([3, 4]) | ||
]) | ||
); | ||
expect(values).toEqual([ 1, 2, 3, 4 ]); | ||
}); | ||
}); | ||
@@ -665,9 +737,16 @@ | ||
describe('sample', () => { | ||
const noop = operators.sample(sources.fromValue(null)); | ||
// TODO: passesPassivePull(noop); | ||
// TODO: passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
// TODO: passesSourceEnd(noop); | ||
const valueThenNever: types.sourceT<any> = sink => | ||
sink(deriving.start(tb => { | ||
if (tb === deriving.pull) | ||
sink(deriving.push(null)); | ||
})); | ||
const noop = operators.sample(valueThenNever); | ||
passesPassivePull(noop); | ||
passesActivePush(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
passesSingleStart(noop); | ||
// TODO: passesStrictEnd(noop); | ||
passesStrictEnd(noop); | ||
@@ -771,8 +850,9 @@ it('emits the latest value when a notifier source emits', () => { | ||
const noop = operators.skipUntil(sources.fromValue(null)); | ||
// TODO: passesPassivePull(noop); | ||
// TODO: passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
passesPassivePull(noop); | ||
passesActivePush(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
passesSingleStart(noop); | ||
passesAsyncSequence(noop); | ||
passesStrictEnd(noop); | ||
@@ -818,6 +898,6 @@ it('skips values until the notifier source emits', () => { | ||
const noop = operators.switchMap(x => sources.fromValue(x)); | ||
// TODO: passesPassivePull(noop); | ||
// TODO: passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
// TODO: passesSourceEnd(noop); | ||
passesPassivePull(noop); | ||
passesActivePush(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
passesSingleStart(noop); | ||
@@ -855,5 +935,5 @@ passesStrictEnd(noop); | ||
sinks.forEach(fn)( | ||
operators.switchMap((x: number) => { | ||
return web.delay(5)(sources.fromArray([x, x * 2])); | ||
})(source) | ||
operators.switchMap((x: number) => ( | ||
operators.take(2)(operators.map((y: number) => x * (y + 1))(web.interval(5))) | ||
))(source) | ||
); | ||
@@ -874,3 +954,3 @@ | ||
passesActivePush(noop); | ||
// TODO: passesSinkClose(noop); | ||
passesSinkClose(noop); | ||
passesSourceEnd(noop); | ||
@@ -881,5 +961,3 @@ passesSingleStart(noop); | ||
// TODO: take(0) seems to be broken | ||
const ending = operators.take(1); | ||
passesCloseAndEnd(ending); | ||
passesCloseAndEnd(operators.take(0)); | ||
@@ -941,4 +1019,3 @@ it('emits values until a maximum is reached', () => { | ||
passesSourceEnd(noop); | ||
// TODO: passesSingleStart(noop); | ||
passesStrictEnd(noop); | ||
passesSingleStart(noop); | ||
passesAsyncSequence(noop); | ||
@@ -957,6 +1034,4 @@ | ||
expect(fn).toHaveBeenCalledTimes(4); | ||
expect(fn.mock.calls).toEqual([ | ||
[deriving.start(expect.any(Function))], | ||
[deriving.start(expect.any(Function))], | ||
[deriving.push(1)], | ||
@@ -968,2 +1043,32 @@ [deriving.end()], | ||
describe('takeLast', () => { | ||
passesCloseAndEnd(operators.takeLast(0)); | ||
it('emits the last max values of an ended source', () => { | ||
const { source, next, complete } = sources.makeSubject<number>(); | ||
const values = []; | ||
let talkback; | ||
operators.takeLast(1)(source)(signal => { | ||
values.push(signal); | ||
if (deriving.isStart(signal)) | ||
talkback = deriving.unboxStart(signal); | ||
if (!deriving.isEnd(signal)) | ||
talkback(deriving.pull); | ||
}); | ||
next(1); | ||
next(2); | ||
expect(values.length).toBe(0); | ||
complete(); | ||
expect(values).toEqual([ | ||
deriving.start(expect.any(Function)), | ||
deriving.push(2), | ||
deriving.end(), | ||
]); | ||
}); | ||
}); | ||
describe('throttle', () => { | ||
@@ -970,0 +1075,0 @@ const noop = web.throttle(() => 0); |
@@ -46,4 +46,7 @@ | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal || ended.contents) { | ||
if (signal) { | ||
ended.contents = true; | ||
return /* () */0; | ||
} else if (ended.contents) { | ||
return /* () */0; | ||
} else { | ||
@@ -60,10 +63,12 @@ ended.contents = true; | ||
return (function (sink) { | ||
var teardown = { | ||
contents: (function () { | ||
var state = { | ||
teardown: (function () { | ||
return /* () */0; | ||
}) | ||
}), | ||
ended: false | ||
}; | ||
sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
return teardown.contents(); | ||
if (signal && !state.ended) { | ||
state.ended = true; | ||
return state.teardown(); | ||
} else { | ||
@@ -73,8 +78,17 @@ return /* () */0; | ||
})])); | ||
teardown.contents = f({ | ||
state.teardown = f({ | ||
next: (function (value) { | ||
return sink(/* Push */Block.__(1, [value])); | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
return sink(/* Push */Block.__(1, [value])); | ||
} | ||
}), | ||
complete: (function (param) { | ||
return sink(/* End */0); | ||
if (state.ended) { | ||
return 0; | ||
} else { | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} | ||
}) | ||
@@ -94,3 +108,3 @@ }); | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal === /* Close */1) { | ||
if (signal) { | ||
state.sinks = state.sinks.filter((function (x) { | ||
@@ -101,3 +115,3 @@ return x !== sink; | ||
} else { | ||
return 0; | ||
return /* () */0; | ||
} | ||
@@ -135,4 +149,18 @@ })])); | ||
function empty(sink) { | ||
sink(/* Start */Block.__(0, [Wonka_helpers.talkbackPlaceholder])); | ||
return sink(/* End */0); | ||
var ended = { | ||
contents: false | ||
}; | ||
sink(/* Start */Block.__(0, [(function (signal) { | ||
if (signal) { | ||
ended.contents = true; | ||
return /* () */0; | ||
} else { | ||
return /* () */0; | ||
} | ||
})])); | ||
if (ended.contents) { | ||
return 0; | ||
} else { | ||
return sink(/* End */0); | ||
} | ||
} | ||
@@ -139,0 +167,0 @@ |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
352956
7400
2