Comparing version 4.0.11 to 4.0.12
@@ -141,72 +141,2 @@ "use strict"; | ||
function combine(a, b) { | ||
return function(c) { | ||
let e = talkbackPlaceholder, d = talkbackPlaceholder, f = void 0, g = void 0, h = !1, k = 0, l = !1; | ||
a((function(a) { | ||
var b = g; | ||
if ("number" == typeof a) { | ||
if (1 > k) { | ||
k = k + 1 | 0; | ||
return; | ||
} | ||
if (l) { | ||
return; | ||
} | ||
l = !0; | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (a = a[0], void 0 !== b) { | ||
if (!l) { | ||
return f = some(a), h = !1, c(__(1, [ [ a, valFromOption(b) ] ])); | ||
} | ||
} else if (f = some(a), h) { | ||
h = !1; | ||
} else { | ||
return d(0); | ||
} | ||
} else { | ||
e = a[0]; | ||
} | ||
})); | ||
b((function(a) { | ||
var b = f; | ||
if ("number" == typeof a) { | ||
if (1 > k) { | ||
k = k + 1 | 0; | ||
return; | ||
} | ||
if (l) { | ||
return; | ||
} | ||
l = !0; | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (a = a[0], void 0 !== b) { | ||
if (!l) { | ||
return g = some(a), h = !1, c(__(1, [ [ valFromOption(b), a ] ])); | ||
} | ||
} else if (g = some(a), h) { | ||
h = !1; | ||
} else { | ||
return e(0); | ||
} | ||
} else { | ||
d = a[0]; | ||
} | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (!l) { | ||
if (a) { | ||
return l = !0, e(1), d(1); | ||
} | ||
if (!h) { | ||
return h = !0, e(a), d(a); | ||
} | ||
} | ||
} ])); | ||
}; | ||
} | ||
function concatMap(a) { | ||
@@ -216,52 +146,12 @@ return function(b) { | ||
function e(b) { | ||
if ("number" == typeof b) { | ||
if (!k) { | ||
return; | ||
} | ||
k = !1; | ||
if (void 0 !== (b = d.shift())) { | ||
return n(a(valFromOption(b))); | ||
} | ||
if (m) { | ||
return c(0); | ||
} | ||
if (g) { | ||
return; | ||
} | ||
g = !0; | ||
return f(0); | ||
} | ||
if (b.tag) { | ||
if (k) { | ||
if (c(b), l) { | ||
l = !1; | ||
} else { | ||
return h(0); | ||
} | ||
} | ||
} else { | ||
return h = b = b[0], l = !1, b(0); | ||
} | ||
"number" == typeof b ? k && (k = !1, void 0 !== (b = d.shift()) ? (b = a(valFromOption(b)), | ||
k = !0, b(e)) : m ? c(0) : g || (g = !0, f(0))) : b.tag ? k && (c(b), l ? l = !1 : h(0)) : (h = b = b[0], | ||
l = !1, b(0)); | ||
} | ||
let d = [], f = talkbackPlaceholder, g = !1, h = talkbackPlaceholder, k = !1, l = !1, m = !1; | ||
var n = function(a) { | ||
k = !0; | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
}; | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (!m && (m = !0, !k && function isEmpty(a) { | ||
return 0 === a.length; | ||
}(d))) { | ||
return c(0); | ||
} | ||
} else if (!b.tag) { | ||
f = b[0]; | ||
} else if (!m) { | ||
if (b = b[0], g = !1, k) { | ||
d.push(b); | ||
} else { | ||
return n(a(b)); | ||
} | ||
} | ||
"number" == typeof b ? m || (m = !0, !k && function isEmpty(a) { | ||
return 0 === a.length; | ||
}(d) && c(0)) : b.tag ? m || (b = b[0], g = !1, k ? d.push(b) : (b = a(b), k = !0, | ||
b(e))) : f = b[0]; | ||
})); | ||
@@ -281,11 +171,11 @@ return c(__(0, [ function(a) { | ||
function _ref19(a) { | ||
function _ref3(a) { | ||
return a; | ||
} | ||
function _ref20(a) { | ||
function _ref4$1(a) { | ||
return a; | ||
} | ||
function _ref23(a) { | ||
function _ref7(a) { | ||
return a(0); | ||
@@ -338,5 +228,5 @@ } | ||
return c(__(0, [ function(a) { | ||
a ? (g || (g = !0, e(a)), f.forEach((function b(b) { | ||
return b(a); | ||
})), f = []) : (d || g ? d = !1 : (d = !0, e(0)), f.forEach(_ref23)); | ||
a ? (g || (g = !0, e(a)), f.forEach((function c(c) { | ||
return c(a); | ||
})), f = []) : (d || g ? d = !1 : (d = !0, e(0)), f.forEach(_ref7)); | ||
} ])); | ||
@@ -347,7 +237,7 @@ }; | ||
function _ref24(a) { | ||
function _ref8(a) { | ||
return a; | ||
} | ||
function _ref25(a) { | ||
function _ref9(a) { | ||
return a; | ||
@@ -357,3 +247,3 @@ } | ||
function mergeAll(a) { | ||
return mergeMap(_ref25)(a); | ||
return mergeMap(_ref9)(a); | ||
} | ||
@@ -364,26 +254,17 @@ | ||
return function(c) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
return; | ||
} | ||
d = !0; | ||
return c(b); | ||
let e = !1; | ||
return b((function(d) { | ||
if ("number" == typeof d) { | ||
e || (e = !0, c(d)); | ||
} else if (d.tag) { | ||
e || (a(d[0]), c(d)); | ||
} else { | ||
var g = d[0]; | ||
c(__(0, [ function b(a) { | ||
if (!e) { | ||
return a && (e = !0), g(a); | ||
} | ||
} ])); | ||
} | ||
if (b.tag) { | ||
if (d) { | ||
return; | ||
} | ||
a(b[0]); | ||
return c(b); | ||
} | ||
var g = b[0]; | ||
return c(__(0, [ function(a) { | ||
if (!d) { | ||
return a && (d = !0), g(a); | ||
} | ||
} ])); | ||
}; | ||
let d = !1; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -393,16 +274,3 @@ }; | ||
function scan(a, b) { | ||
return function(c) { | ||
return function(e) { | ||
var d = function(b) { | ||
"number" == typeof b ? b = 0 : b.tag ? (f = a(f, b[0]), b = __(1, [ f ])) : b = __(0, [ b[0] ]); | ||
return e(b); | ||
}; | ||
let f = b; | ||
return 1 === c.length ? c(d) : c.bind(null, d); | ||
}; | ||
}; | ||
} | ||
function _ref26(a) { | ||
function _ref11(a) { | ||
return a(0); | ||
@@ -442,14 +310,4 @@ } | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (!l && (l = !0, !h)) { | ||
return c(0); | ||
} | ||
} else if (b.tag) { | ||
if (!l) { | ||
return h && (g(1), g = talkbackPlaceholder), f ? f = !1 : (f = !0, d(0)), b = a(b[0]), | ||
h = !0, 1 === b.length ? b(e) : b.bind(null, e); | ||
} | ||
} else { | ||
d = b[0]; | ||
} | ||
"number" == typeof b ? l || (l = !0, h || c(0)) : b.tag ? l || (h && (g(1), g = talkbackPlaceholder), | ||
f ? f = !1 : (f = !0, d(0)), b = a(b[0]), h = !0, b(e)) : d = b[0]; | ||
})); | ||
@@ -469,3 +327,3 @@ return c(__(0, [ function(a) { | ||
function _ref31(a) { | ||
function _ref16(a) { | ||
return a; | ||
@@ -477,18 +335,7 @@ } | ||
return function(c) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
return fromArray(d)(c); | ||
} | ||
if (b.tag) { | ||
return d.length >= a && 0 < a && d.shift(), d.push(b[0]), f(0); | ||
} | ||
b = b[0]; | ||
if (0 >= a) { | ||
return b(1), empty(c); | ||
} | ||
f = b; | ||
return b(0); | ||
}; | ||
let d = [], f = talkbackPlaceholder; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
let e = [], d = talkbackPlaceholder; | ||
return b((function(b) { | ||
"number" == typeof b ? fromArray(e)(c) : b.tag ? (e.length >= a && 0 < a && e.shift(), | ||
e.push(b[0]), d(0)) : (b = b[0], 0 >= a ? (b(1), empty(c)) : (d = b, b(0))); | ||
})); | ||
}; | ||
@@ -502,43 +349,9 @@ }; | ||
function e(a) { | ||
if ("number" == typeof a) { | ||
if (k) { | ||
return; | ||
} | ||
k = !0; | ||
f(1); | ||
0 < d.length && c(__(1, [ d ])); | ||
return c(0); | ||
} | ||
if (!a.tag) { | ||
g = a[0]; | ||
} else if (!(k || 0 >= d.length)) { | ||
return a = d, d = [], c(__(1, [ a ])); | ||
} | ||
"number" == typeof a ? k || (k = !0, f(1), 0 < d.length && c(__(1, [ d ])), c(0)) : a.tag ? !k && 0 < d.length && (a = d, | ||
d = [], c(__(1, [ a ]))) : g = a[0]; | ||
} | ||
let d = [], f = talkbackPlaceholder, g = talkbackPlaceholder, h = !1, k = !1; | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (k) { | ||
return; | ||
} | ||
k = !0; | ||
g(1); | ||
0 < d.length && c(__(1, [ d ])); | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (k) { | ||
return; | ||
} | ||
d.push(b[0]); | ||
if (h) { | ||
h = !1; | ||
return; | ||
} | ||
h = !0; | ||
f(0); | ||
return g(0); | ||
} | ||
f = b[0]; | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
"number" == typeof b ? k || (k = !0, g(1), 0 < d.length && c(__(1, [ d ])), c(0)) : b.tag ? k || (d.push(b[0]), | ||
h ? h = !1 : (h = !0, f(0), g(0))) : (f = b[0], a(e)); | ||
})); | ||
@@ -558,20 +371,12 @@ return c(__(0, [ function(a) { | ||
}, concatMap$1 = concatMap, concatAll$1 = function concatAll(a) { | ||
return concatMap(_ref19)(a); | ||
return concatMap(_ref3)(a); | ||
}, concat$1 = function concat(a) { | ||
return concatMap(_ref20)(fromArray(a)); | ||
return concatMap(_ref4$1)(fromArray(a)); | ||
}, filter$1 = function filter(a) { | ||
return function(b) { | ||
return function(c) { | ||
var e = 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); | ||
}; | ||
let d = talkbackPlaceholder; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
let e = talkbackPlaceholder; | ||
return b((function(d) { | ||
"number" == typeof d ? c(d) : d.tag ? a(d[0]) ? c(d) : e(0) : (e = d[0], c(d)); | ||
})); | ||
}; | ||
@@ -582,35 +387,33 @@ }; | ||
return function(c) { | ||
var e = function(d) { | ||
d = "number" == typeof d ? 0 : d.tag ? __(1, [ a(d[0]) ]) : __(0, [ d[0] ]); | ||
return c(d); | ||
}; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
return b((function(b) { | ||
b = "number" == typeof b ? 0 : b.tag ? __(1, [ a(b[0]) ]) : __(0, [ b[0] ]); | ||
return c(b); | ||
})); | ||
}; | ||
}; | ||
}, mergeMap$1 = mergeMap, merge$1 = function merge(a) { | ||
return mergeMap(_ref24)(fromArray(a)); | ||
return mergeMap(_ref8)(fromArray(a)); | ||
}, mergeAll$1 = mergeAll, flatten$1 = mergeAll, onEnd$1 = function onEnd(a) { | ||
return function(b) { | ||
return function(c) { | ||
var e = function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
let e = !1; | ||
return b((function(d) { | ||
if ("number" == typeof d) { | ||
if (e) { | ||
return; | ||
} | ||
d = !0; | ||
c(b); | ||
e = !0; | ||
c(d); | ||
return a(); | ||
} | ||
if (b.tag) { | ||
return d ? void 0 : c(b); | ||
if (d.tag) { | ||
return e ? void 0 : c(d); | ||
} | ||
var g = b[0]; | ||
return c(__(0, [ function(b) { | ||
if (!d) { | ||
return b ? (d = !0, g(b), a()) : g(b); | ||
var b = d[0]; | ||
return c(__(0, [ function(c) { | ||
if (!e) { | ||
return c ? (e = !0, b(c), a()) : b(c); | ||
} | ||
} ])); | ||
}; | ||
let d = !1; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -621,3 +424,3 @@ }; | ||
return function(c) { | ||
var e = function(b) { | ||
return b((function(b) { | ||
if ("number" == typeof b || b.tag) { | ||
@@ -628,4 +431,3 @@ return c(b); | ||
return a(); | ||
}; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -684,4 +486,4 @@ }; | ||
function b(a) { | ||
"number" == typeof a ? (c.forEach(_ref26), c = []) : a.tag ? (d = !1, c.forEach((function(b) { | ||
return b(a); | ||
"number" == typeof a ? (c.forEach(_ref11), c = []) : a.tag ? (d = !1, c.forEach((function(c) { | ||
return c(a); | ||
}))) : e = a[0]; | ||
@@ -709,3 +511,4 @@ } | ||
return function(c) { | ||
var e = function(a) { | ||
let e = talkbackPlaceholder, d = a; | ||
return b((function(a) { | ||
if ("number" == typeof a) { | ||
@@ -715,9 +518,7 @@ return c(a); | ||
if (a.tag) { | ||
return 0 < f ? (f = f - 1 | 0, d(0)) : c(a); | ||
return 0 < d ? (d = d - 1 | 0, e(0)) : c(a); | ||
} | ||
d = a[0]; | ||
e = a[0]; | ||
return c(a); | ||
}; | ||
let d = talkbackPlaceholder, f = a; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -729,34 +530,9 @@ }; | ||
function e(a) { | ||
if ("number" == typeof a) { | ||
if (g) { | ||
return k = !0, d(1); | ||
} | ||
} else { | ||
if (a.tag) { | ||
return g = !1, f(1); | ||
} | ||
f = a = a[0]; | ||
return a(0); | ||
} | ||
"number" == typeof a ? g && (k = !0, d(1)) : a.tag ? (g = !1, f(1)) : (f = a = a[0], | ||
a(0)); | ||
} | ||
let d = talkbackPlaceholder, f = talkbackPlaceholder, g = !0, h = !1, k = !1; | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
return g && f(1), k = !0, c(0); | ||
} | ||
if (b.tag) { | ||
if (g || k) { | ||
if (h) { | ||
h = !1; | ||
return; | ||
} | ||
h = !0; | ||
d(0); | ||
return f(0); | ||
} | ||
h = !1; | ||
return c(b); | ||
} | ||
d = b[0]; | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
"number" == typeof b ? (g && f(1), k = !0, c(0)) : b.tag ? g || k ? h ? h = !1 : (h = !0, | ||
d(0), f(0)) : (h = !1, c(b)) : (d = b[0], a(e)); | ||
})); | ||
@@ -779,3 +555,4 @@ return c(__(0, [ function(a) { | ||
return function(c) { | ||
var e = function(b) { | ||
let e = talkbackPlaceholder, d = !0; | ||
return b((function(b) { | ||
if ("number" == typeof b) { | ||
@@ -785,19 +562,17 @@ return c(b); | ||
if (b.tag) { | ||
if (f) { | ||
if (d) { | ||
if (a(b[0])) { | ||
return d(0); | ||
return e(0); | ||
} | ||
f = !1; | ||
d = !1; | ||
} | ||
return c(b); | ||
} | ||
d = b[0]; | ||
e = b[0]; | ||
return c(b); | ||
}; | ||
let d = talkbackPlaceholder, f = !0; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
}; | ||
}, switchMap$1 = switchMap, switchAll$1 = function switchAll(a) { | ||
return switchMap(_ref31)(a); | ||
return switchMap(_ref16)(a); | ||
}, take$1 = function take(a) { | ||
@@ -843,25 +618,8 @@ return function(b) { | ||
function e(a) { | ||
if ("number" != typeof a) { | ||
if (a.tag) { | ||
return d = !0, f(1), c(0); | ||
} | ||
g = a = a[0]; | ||
return a(0); | ||
} | ||
"number" != typeof a && (a.tag ? (d = !0, f(1), c(0)) : (g = a = a[0], a(0))); | ||
} | ||
let d = !1, f = talkbackPlaceholder, g = talkbackPlaceholder; | ||
b((function(b) { | ||
if ("number" == typeof b) { | ||
if (d) { | ||
return; | ||
} | ||
d = !0; | ||
g(1); | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
return d ? void 0 : c(b); | ||
} | ||
f = b[0]; | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
"number" == typeof b ? d || (d = !0, g(1), c(0)) : b.tag ? d || c(b) : (f = b[0], | ||
a(e)); | ||
})); | ||
@@ -878,12 +636,13 @@ return c(__(0, [ function(a) { | ||
return function(c) { | ||
var e = function(b) { | ||
let e = talkbackPlaceholder, d = !1; | ||
return b((function(b) { | ||
if ("number" == typeof b) { | ||
if (f) { | ||
if (d) { | ||
return; | ||
} | ||
f = !0; | ||
d = !0; | ||
return c(0); | ||
} | ||
if (b.tag) { | ||
if (f) { | ||
if (d) { | ||
return; | ||
@@ -894,11 +653,9 @@ } | ||
} | ||
f = !0; | ||
d = !0; | ||
c(0); | ||
return d(1); | ||
return e(1); | ||
} | ||
d = b[0]; | ||
e = b[0]; | ||
return c(b); | ||
}; | ||
let d = talkbackPlaceholder, f = !1; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -965,24 +722,10 @@ }; | ||
function _ref7(a, b, c) { | ||
function _ref3$1(a, b, c) { | ||
a.addEventListener(b, c); | ||
} | ||
function _ref8(a, b, c) { | ||
function _ref4$2(a, b, c) { | ||
a.removeEventListener(b, c); | ||
} | ||
function fromDomEvent(a, b) { | ||
return function(c) { | ||
var e = _ref7, d = _ref8, f = function(a) { | ||
return c(__(1, [ a ])); | ||
}; | ||
c(__(0, [ function(c) { | ||
if (c) { | ||
return d(a, b, f); | ||
} | ||
} ])); | ||
return e(a, b, f); | ||
}; | ||
} | ||
var fromObservable$2 = function fromObservable(a) { | ||
@@ -1057,24 +800,23 @@ var b = void 0 !== a[observableSymbol] ? a[observableSymbol]() : a; | ||
return function(b, c) { | ||
function e(a) { | ||
if ("number" == typeof a) { | ||
return 2 === c.length ? c(2, void 0) : c.bind(null, 2, void 0); | ||
} | ||
if (a.tag) { | ||
return a = a[0], 2 === c.length ? c(1, a) : c.bind(null, 1, a); | ||
} | ||
var b = a[0]; | ||
a = function(a) { | ||
switch (a) { | ||
case 1: | ||
return b(0); | ||
if (0 === b) { | ||
return a((function e(a) { | ||
if ("number" == typeof a) { | ||
return 2 === c.length ? c(2, void 0) : c.bind(null, 2, void 0); | ||
} | ||
if (a.tag) { | ||
return a = a[0], 2 === c.length ? c(1, a) : c.bind(null, 1, a); | ||
} | ||
var b = a[0]; | ||
a = function(a) { | ||
switch (a) { | ||
case 1: | ||
return b(0); | ||
case 2: | ||
return b(1); | ||
} | ||
}; | ||
return 2 === c.length ? c(0, a) : c.bind(null, 0, a); | ||
case 2: | ||
return b(1); | ||
} | ||
}; | ||
return 2 === c.length ? c(0, a) : c.bind(null, 0, a); | ||
})); | ||
} | ||
if (0 === b) { | ||
return 1 === a.length ? a(e) : a.bind(null, e); | ||
} | ||
}; | ||
@@ -1084,10 +826,14 @@ }, debounce$1 = function debounce(a) { | ||
return function(c) { | ||
var e = function(b) { | ||
let e = void 0, d = !1, f = !1; | ||
var g = function(a) { | ||
void 0 !== (a = e) && (e = void 0, clearTimeout(valFromOption(a))); | ||
}; | ||
return b((function(b) { | ||
if ("number" == typeof b) { | ||
if (g) { | ||
if (f) { | ||
return; | ||
} | ||
g = !0; | ||
if (void 0 !== d) { | ||
f = !0; | ||
f = !0; | ||
if (void 0 !== e) { | ||
d = !0; | ||
return; | ||
@@ -1098,6 +844,6 @@ } | ||
if (b.tag) { | ||
g || (h(), d = some(setTimeout((function e(a) { | ||
d = void 0; | ||
f || (g(), e = some(setTimeout((function h(a) { | ||
e = void 0; | ||
c(b); | ||
if (f) { | ||
if (d) { | ||
return c(0); | ||
@@ -1107,15 +853,10 @@ } | ||
} else { | ||
var k = b[0]; | ||
var l = b[0]; | ||
return c(__(0, [ function(a) { | ||
if (!g) { | ||
return a ? (g = !0, f = !1, h(), k(1)) : k(0); | ||
if (!f) { | ||
return a ? (f = !0, d = !1, g(), l(1)) : l(0); | ||
} | ||
} ])); | ||
} | ||
}; | ||
let d = void 0, f = !1, g = !1; | ||
var h = function(a) { | ||
void 0 !== (a = d) && (d = void 0, clearTimeout(valFromOption(a))); | ||
}; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -1126,15 +867,14 @@ }; | ||
return function(c) { | ||
var e = function(b) { | ||
let e = 0; | ||
return b((function(b) { | ||
if ("number" != typeof b && !b.tag) { | ||
return c(b); | ||
} | ||
d = d + 1 | 0; | ||
e = e + 1 | 0; | ||
setTimeout((function(a) { | ||
if (0 !== d) { | ||
return d = d - 1 | 0, c(b); | ||
if (0 !== e) { | ||
return e = e - 1 | 0, c(b); | ||
} | ||
}), a); | ||
}; | ||
let d = 0; | ||
return 1 === b.length ? b(e) : b.bind(null, e); | ||
})); | ||
}; | ||
@@ -1146,28 +886,27 @@ }; | ||
function e(a) { | ||
g = void 0; | ||
f = !1; | ||
f = void 0; | ||
d = !1; | ||
} | ||
var d = function(b) { | ||
let d = !1, f = void 0; | ||
var g = function(a) { | ||
void 0 !== (a = f) && clearTimeout(valFromOption(a)); | ||
}; | ||
return b((function(b) { | ||
if ("number" == typeof b) { | ||
return h(), c(0); | ||
return g(), c(0); | ||
} | ||
if (b.tag) { | ||
if (f) { | ||
if (d) { | ||
return; | ||
} | ||
f = !0; | ||
h(); | ||
g = some(setTimeout(e, a(b[0]))); | ||
d = !0; | ||
g(); | ||
f = some(setTimeout(e, a(b[0]))); | ||
return c(b); | ||
} | ||
var d = b[0]; | ||
var h = b[0]; | ||
return c(__(0, [ function(a) { | ||
return a ? (h(), d(1)) : d(a); | ||
return a ? (g(), h(1)) : h(a); | ||
} ])); | ||
}; | ||
let f = !1, g = void 0; | ||
var h = function(a) { | ||
void 0 !== (a = g) && clearTimeout(valFromOption(a)); | ||
}; | ||
return 1 === b.length ? b(d) : b.bind(null, d); | ||
})); | ||
}; | ||
@@ -1177,8 +916,7 @@ }; | ||
return new Promise((function(b, c) { | ||
c = function(a) { | ||
takeLast(1)(a)((function(a) { | ||
if ("number" != typeof a) { | ||
return a.tag ? b(a[0]) : a[0](0); | ||
} | ||
}; | ||
return 1 === takeLast(1)(a).length ? takeLast(1)(a)(c) : takeLast(1)(a).bind(null, c); | ||
})); | ||
})); | ||
@@ -1213,3 +951,71 @@ }, interval$1 = function interval(a) { | ||
exports.combine = function(a, b) { | ||
return 2 === combine.length ? combine(a, b) : combine.bind(null, a, b); | ||
return function combine(a, b) { | ||
return function(c) { | ||
let e = talkbackPlaceholder, d = talkbackPlaceholder, f = void 0, g = void 0, h = !1, k = 0, l = !1; | ||
a((function(a) { | ||
var b = g; | ||
if ("number" == typeof a) { | ||
if (1 > k) { | ||
k = k + 1 | 0; | ||
return; | ||
} | ||
if (l) { | ||
return; | ||
} | ||
l = !0; | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (a = a[0], void 0 !== b) { | ||
if (!l) { | ||
return f = some(a), h = !1, c(__(1, [ [ a, valFromOption(b) ] ])); | ||
} | ||
} else if (f = some(a), h) { | ||
h = !1; | ||
} else { | ||
return d(0); | ||
} | ||
} else { | ||
e = a[0]; | ||
} | ||
})); | ||
b((function(a) { | ||
var b = f; | ||
if ("number" == typeof a) { | ||
if (1 > k) { | ||
k = k + 1 | 0; | ||
return; | ||
} | ||
if (l) { | ||
return; | ||
} | ||
l = !0; | ||
return c(0); | ||
} | ||
if (a.tag) { | ||
if (a = a[0], void 0 !== b) { | ||
if (!l) { | ||
return g = some(a), h = !1, c(__(1, [ [ valFromOption(b), a ] ])); | ||
} | ||
} else if (g = some(a), h) { | ||
h = !1; | ||
} else { | ||
return e(0); | ||
} | ||
} else { | ||
d = a[0]; | ||
} | ||
})); | ||
return c(__(0, [ function(a) { | ||
if (!l) { | ||
if (a) { | ||
return l = !0, e(1), d(1); | ||
} | ||
if (!h) { | ||
return h = !0, e(a), d(a); | ||
} | ||
} | ||
} ])); | ||
}; | ||
}(a, b); | ||
}; | ||
@@ -1240,3 +1046,15 @@ | ||
exports.fromDomEvent = function(a, b) { | ||
return 2 === fromDomEvent.length ? fromDomEvent(a, b) : fromDomEvent.bind(null, a, b); | ||
return function fromDomEvent(a, b) { | ||
return function(c) { | ||
var e = _ref3$1, d = _ref4$2, f = function(a) { | ||
return c(__(1, [ a ])); | ||
}; | ||
c(__(0, [ function(c) { | ||
if (c) { | ||
return d(a, b, f); | ||
} | ||
} ])); | ||
return e(a, b, f); | ||
}; | ||
}(a, b); | ||
}; | ||
@@ -1286,3 +1104,13 @@ | ||
exports.scan = function(a, b) { | ||
return 2 === scan.length ? scan(a, b) : scan.bind(null, a, b); | ||
return function scan(a, b) { | ||
return function(c) { | ||
return function(e) { | ||
let d = b; | ||
return c((function(c) { | ||
"number" == typeof c ? c = 0 : c.tag ? (d = a(d, c[0]), c = __(1, [ d ])) : c = __(0, [ c[0] ]); | ||
return e(c); | ||
})); | ||
}; | ||
}; | ||
}(a, b); | ||
}; | ||
@@ -1289,0 +1117,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";function n(n,t){return t.tag=n,t}function t(n){}function r(t){return function(r){var e=t.length;let u=!1,i=!1,f=!1,o=0;return r(n(0,[function(c){if(c)u=!0;else if(i)f=!0;else{for(i=f=!0;f&&!u;)o<e?(c=t[o],o=o+1|0,f=!1,r(n(1,[c]))):(u=!0,r(0));i=!1}}]))}}function e(){}function u(n){return n(0)}function i(t){let r=!1;return t(n(0,[function(n){if(n)r=!0;else if(!r)return t(0)}]))}var f=r,o=i,c=[];function l(n){return void 0===n?((n=[c,0]).tag=256,n):(null===n||n[0]!==c||((n=[c,n[1]+1|0]).tag=256),n)}function s(n){return null===n||n[0]!==c?n:0!==(n=n[1])?[c,n-1|0]:void 0}function a(r,e){return function(u){let i=t,f=t,o=void 0,c=void 0,a=!1,p=0,b=!1;return r((function(t){var r=c;if("number"==typeof t){if(1>p)return void(p=p+1|0);if(b)return;return b=!0,u(0)}if(t.tag)if(t=t[0],void 0!==r){if(!b)return o=l(t),a=!1,u(n(1,[[t,s(r)]]))}else{if(o=l(t),!a)return f(0);a=!1}else i=t[0]})),e((function(t){var r=o;if("number"==typeof t){if(1>p)return void(p=p+1|0);if(b)return;return b=!0,u(0)}if(t.tag)if(t=t[0],void 0!==r){if(!b)return c=l(t),a=!1,u(n(1,[[s(r),t]]))}else{if(c=l(t),!a)return i(0);a=!1}else f=t[0]})),u(n(0,[function(n){if(!b){if(n)return b=!0,i(1),f(1);if(!a)return a=!0,i(n),f(n)}}]))}}function p(r){return function(e){return function(u){function i(n){if("number"==typeof n){if(!a)return;if(a=!1,void 0!==(n=f.shift()))return g(r(s(n)));if(b)return u(0);if(c)return;return c=!0,o(0)}if(!n.tag)return l=n=n[0],p=!1,n(0);if(a){if(u(n),!p)return l(0);p=!1}}let f=[],o=t,c=!1,l=t,a=!1,p=!1,b=!1;var g=function(n){return a=!0,1===n.length?n(i):n.bind(null,i)};return e((function(n){if("number"==typeof n){if(!b&&(b=!0,!a&&function(n){return 0===n.length}(f)))return u(0)}else if(n.tag){if(!b){if(n=n[0],c=!1,!a)return g(r(n));f.push(n)}}else o=n[0]})),u(n(0,[function(n){if(n){if(b||(b=!0,o(1)),a)return a=!1,l(1)}else if(b||c||(c=!0,o(0)),a&&!p)return p=!0,l(0)}]))}}}function b(n){return n}function g(n){return n}function v(n){return n(0)}function m(r){return function(e){return function(u){let i=t,f=!1,o=[],c=!1;return e((function(e){if("number"==typeof e){if(!c&&(c=!0,0===o.length))return u(0)}else if(e.tag){if(!c&&(f=!1,function(r){function e(n){return n!==s}var l=function(t){if("number"==typeof t){if(0!==o.length){if(o=o.filter(e),t=0===o.length,c&&t)return u(0);if(!f&&t)return f=!0,i(0)}}else{if(!t.tag)return s=t=t[0],o=o.concat(t),t(0);if(0!==o.length)return u(n(1,[t[0]])),s(0)}};let s=t;1===r.length?r(l):r.bind(null,l)}(r(e[0])),!f))return f=!0,i(0)}else i=e[0]})),u(n(0,[function(n){n?(c||(c=!0,i(n)),o.forEach((function(t){return t(n)})),o=[]):(f||c?f=!1:(f=!0,i(0)),o.forEach(v))}]))}}}function h(n){return n}function d(n){return n}function x(n){return m(d)(n)}function y(t){return function(r){return function(e){var u=function(r){if("number"==typeof r){if(i)return;return i=!0,e(r)}if(r.tag){if(i)return;return t(r[0]),e(r)}var u=r[0];return e(n(0,[function(n){if(!i)return n&&(i=!0),u(n)}]))};let i=!1;return 1===r.length?r(u):r.bind(null,u)}}}function E(t,r){return function(e){return function(u){var i=function(r){return"number"==typeof r?r=0:r.tag?(f=t(f,r[0]),r=n(1,[f])):r=n(0,[r[0]]),u(r)};let f=r;return 1===e.length?e(i):e.bind(null,i)}}}function k(n){return n(0)}function S(r){return function(e){return function(u){function i(n){if(l){if("number"==typeof n){if(l=!1,a)return u(n);if(o)return;return o=!0,f(0)}return n.tag?(u(n),s?void(s=!1):c(0)):(c=n=n[0],s=!1,n(0))}}let f=t,o=!1,c=t,l=!1,s=!1,a=!1;return e((function(n){if("number"==typeof n){if(!a&&(a=!0,!l))return u(0)}else if(n.tag){if(!a)return l&&(c(1),c=t),o?o=!1:(o=!0,f(0)),n=r(n[0]),l=!0,1===n.length?n(i):n.bind(null,i)}else f=n[0]})),u(n(0,[function(n){if(n){if(a||(a=!0,f(1)),l)return l=!1,c(1)}else if(a||o||(o=!0,f(0)),l&&!s)return s=!0,c(0)}]))}}}function w(n){return n}function A(n){return function(e){return function(u){var f=function(t){return"number"==typeof t?r(o)(u):t.tag?(o.length>=n&&0<n&&o.shift(),o.push(t[0]),c(0)):(t=t[0],0>=n?(t(1),i(u)):(c=t,t(0)))};let o=[],c=t;return 1===e.length?e(f):e.bind(null,f)}}}var P=p,T=m,L=x,M=x,C=y,I=y,O=S,U=A;function W(n){return function(r){let e=t,u=!1;return r((function(t){if("number"!=typeof t){if(t.tag){if(u)return;return n(t[0]),e(0)}return e=t=t[0],t(0)}u=!0})),{unsubscribe:function(n){if(!u)return u=!0,e(1)}}}}function j(n){}var D=W,V="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function q(n){}function z(n,t,r){n.addEventListener(t,r)}function B(n,t,r){n.removeEventListener(t,r)}function F(t,r){return function(e){var u=z,i=B,f=function(t){return e(n(1,[t]))};return e(n(0,[function(n){if(n)return i(t,r,f)}])),u(t,r,f)}}exports.buffer=function(r){return function(e){return function(u){function i(t){if("number"==typeof t){if(s)return;return s=!0,o(1),0<f.length&&u(n(1,[f])),u(0)}if(t.tag){if(!(s||0>=f.length))return t=f,f=[],u(n(1,[t]))}else c=t[0]}let f=[],o=t,c=t,l=!1,s=!1;return e((function(t){if("number"==typeof t){if(s)return;return s=!0,c(1),0<f.length&&u(n(1,[f])),u(0)}if(t.tag){if(s)return;return f.push(t[0]),l?void(l=!1):(l=!0,o(0),c(0))}return o=t[0],1===r.length?r(i):r.bind(null,i)})),u(n(0,[function(n){if(!s){if(n)return s=!0,o(1),c(1);if(!l)return l=!0,o(0),c(0)}}]))}}},exports.combine=function(n,t){return 2===a.length?a(n,t):a.bind(null,n,t)},exports.concat=function(n){return p(g)(r(n))},exports.concatAll=function(n){return p(b)(n)},exports.concatMap=P,exports.debounce=function(t){return function(r){return function(e){var u=function(r){if("number"==typeof r){if(o)return;return o=!0,void 0!==i?void(f=!0):e(0)}if(!r.tag){var u=r[0];return e(n(0,[function(n){if(!o)return n?(o=!0,f=!1,c(),u(1)):u(0)}]))}o||(c(),i=l(setTimeout((function(n){if(i=void 0,e(r),f)return e(0)}),t(r[0]))))};let i=void 0,f=!1,o=!1;var c=function(n){void 0!==(n=i)&&(i=void 0,clearTimeout(s(n)))};return 1===r.length?r(u):r.bind(null,u)}}},exports.delay=function(n){return function(t){return function(r){var e=function(t){if("number"!=typeof t&&!t.tag)return r(t);u=u+1|0,setTimeout((function(n){if(0!==u)return u=u-1|0,r(t)}),n)};let u=0;return 1===t.length?t(e):t.bind(null,e)}}},exports.empty=o,exports.filter=function(n){return function(r){return function(e){var u=function(t){return"number"==typeof t?e(t):t.tag?n(t[0])?e(t):i(0):(i=t[0],e(t))};let i=t;return 1===r.length?r(u):r.bind(null,u)}}},exports.flatten=M,exports.forEach=function(n){return function(t){W(n)(t)}},exports.fromArray=f,exports.fromCallbag=function(t){return function(r){var e=function(t,e){switch(t){case 0:return r(n(0,[function(n){return e(n?2:1)}]));case 1:return r(n(1,[e]));case 2:return r(0)}};return 2===t.length?t(0,e):t.bind(null,0,e)}},exports.fromDomEvent=function(n,t){return 2===F.length?F(n,t):F.bind(null,n,t)},exports.fromList=function(t){return function(r){let e=!1,u=!1,i=!1,f=t;return r(n(0,[function(t){if(t)e=!0;else if(u)i=!0;else{for(u=i=!0;i&&!e;)(t=f)?(f=t[1],i=!1,r(n(1,[t[0]]))):(e=!0,r(0));u=!1}}]))}},exports.fromObservable=function(t){var r=void 0!==t[V]?t[V]():t;return function(t){var e=r.subscribe({next:function(r){return t(n(1,[r]))},complete:function(){return t(0)},error:q});return t(n(0,[function(n){if(n)return e.unsubscribe()}]))}},exports.fromPromise=function(t){return function(r){let e=!1;return t.then((function(t){return e||(r(n(1,[t])),r(0)),Promise.resolve(void 0)})),r(n(0,[function(n){n&&(e=!0)}]))}},exports.fromValue=function(t){return function(r){let e=!1;return r(n(0,[function(u){if(u)e=!0;else if(!e)return e=!0,r(n(1,[t])),r(0)}]))}},exports.interval=function(t){return function(r){let e=0;var u=setInterval((function(t){return t=e,e=e+1|0,r(n(1,[t]))}),t);return r(n(0,[function(n){n&&clearInterval(u)}]))}},exports.make=function(t){return function(r){let u=e,i=!1;return u=t({next:function(t){if(!i)return r(n(1,[t]))},complete:function(n){if(!i)return i=!0,r(0)}}),r(n(0,[function(n){if(n&&!i)return i=!0,u()}]))}},exports.makeSubject=function(t){let r=[],e=!1;return{source:function(t){function e(n){return n!==t}return r=r.concat(t),t(n(0,[function(n){n&&(r=r.filter(e))}]))},next:function(t){e||r.forEach((function(r){return r(n(1,[t]))}))},complete:function(n){e||(e=!0,r.forEach(u))}}},exports.map=function(t){return function(r){return function(e){var u=function(r){return r="number"==typeof r?0:r.tag?n(1,[t(r[0])]):n(0,[r[0]]),e(r)};return 1===r.length?r(u):r.bind(null,u)}}},exports.merge=function(n){return m(h)(r(n))},exports.mergeAll=L,exports.mergeMap=T,exports.never=function(r){return r(n(0,[t]))},exports.onEnd=function(t){return function(r){return function(e){var u=function(r){if("number"==typeof r){if(i)return;return i=!0,e(r),t()}if(r.tag)return i?void 0:e(r);var u=r[0];return e(n(0,[function(n){if(!i)return n?(i=!0,u(n),t()):u(n)}]))};let i=!1;return 1===r.length?r(u):r.bind(null,u)}}},exports.onPush=C,exports.onStart=function(n){return function(t){return function(r){var e=function(t){return"number"==typeof t||t.tag?r(t):(r(t),n())};return 1===t.length?t(e):t.bind(null,e)}}},exports.pipe=function(){for(var n=arguments,t=arguments[0],r=1,e=arguments.length;r<e;r++)t=n[r](t);return t},exports.publish=function(n){return W(j)(n)},exports.sample=function(r){return function(e){return function(u){let i=t,f=t,o=void 0,c=!1,a=!1;return e((function(n){if("number"==typeof n){if(a)return;return a=!0,f(1),u(0)}if(n.tag){if(o=l(n[0]),!c)return c=!0,f(0),i(0);c=!1}else i=n[0]})),r((function(t){var r=o;if("number"==typeof t){if(!a)return a=!0,i(1),u(0)}else if(t.tag){if(void 0!==r&&!a)return o=void 0,u(n(1,[s(r)]))}else f=t[0]})),u(n(0,[function(n){if(!a){if(n)return a=!0,i(1),f(1);if(!c)return c=!0,i(0),f(0)}}]))}}},exports.scan=function(n,t){return 2===E.length?E(n,t):E.bind(null,n,t)},exports.share=function(r){function e(n){"number"==typeof n?(u.forEach(k),u=[]):n.tag?(f=!1,u.forEach((function(t){return t(n)}))):i=n[0]}let u=[],i=t,f=!1;return function(t){function o(n){return n!==t}return u=u.concat(t),1===u.length&&r(e),t(n(0,[function(n){if(n){if(u=u.filter(o),0===u.length)return i(1)}else if(!f)return f=!0,i(n)}]))}},exports.skip=function(n){return function(r){return function(e){var u=function(n){return"number"==typeof n?e(n):n.tag?0<f?(f=f-1|0,i(0)):e(n):(i=n[0],e(n))};let i=t,f=n;return 1===r.length?r(u):r.bind(null,u)}}},exports.skipUntil=function(r){return function(e){return function(u){function i(n){return"number"!=typeof n?n.tag?(c=!1,o(1)):(o=n=n[0],n(0)):c?(s=!0,f(1)):void 0}let f=t,o=t,c=!0,l=!1,s=!1;return e((function(n){return"number"==typeof n?(c&&o(1),s=!0,u(0)):n.tag?c||s?l?void(l=!1):(l=!0,f(0),o(0)):(l=!1,u(n)):(f=n[0],1===r.length?r(i):r.bind(null,i))})),u(n(0,[function(n){if(!s)if(n){if(s=!0,f(1),c)return o(1)}else if(!l)return l=!0,c&&o(0),f(0)}]))}}},exports.skipWhile=function(n){return function(r){return function(e){var u=function(t){if("number"==typeof t)return e(t);if(t.tag){if(f){if(n(t[0]))return i(0);f=!1}return e(t)}return i=t[0],e(t)};let i=t,f=!0;return 1===r.length?r(u):r.bind(null,u)}}},exports.subscribe=D,exports.switchAll=function(n){return S(w)(n)},exports.switchMap=O,exports.take=function(r){return function(e){return function(u){let i=!1,f=0,o=t;return e((function(n){if("number"==typeof n){if(i)return;return i=!0,u(0)}if(n.tag){if(f<r&&!i&&(f=f+1|0,u(n),!i&&f>=r))return i=!0,u(0),o(1)}else{if(n=n[0],0>=r)return i=!0,u(0),n(1);o=n}})),u(n(0,[function(n){if(!i){if(n)return i=!0,o(1);if(f<r)return o(0)}}]))}}},exports.takeLast=U,exports.takeUntil=function(r){return function(e){return function(u){function i(n){if("number"!=typeof n)return n.tag?(f=!0,o(1),u(0)):(c=n=n[0],n(0))}let f=!1,o=t,c=t;return e((function(n){if("number"==typeof n){if(f)return;return f=!0,c(1),u(0)}return n.tag?f?void 0:u(n):(o=n[0],1===r.length?r(i):r.bind(null,i))})),u(n(0,[function(n){if(!f)return n?(f=!0,o(1),c(1)):o(0)}]))}}},exports.takeWhile=function(n){return function(r){return function(e){var u=function(t){if("number"==typeof t){if(f)return;return f=!0,e(0)}if(t.tag){if(f)return;return n(t[0])?e(t):(f=!0,e(0),i(1))}return i=t[0],e(t)};let i=t,f=!1;return 1===r.length?r(u):r.bind(null,u)}}},exports.tap=I,exports.throttle=function(t){return function(r){return function(e){function u(n){o=void 0,f=!1}var i=function(r){if("number"==typeof r)return c(),e(0);if(r.tag){if(f)return;return f=!0,c(),o=l(setTimeout(u,t(r[0]))),e(r)}var i=r[0];return e(n(0,[function(n){return n?(c(),i(1)):i(n)}]))};let f=!1,o=void 0;var c=function(n){void 0!==(n=o)&&clearTimeout(s(n))};return 1===r.length?r(i):r.bind(null,i)}}},exports.toArray=function(n){let r=[],e=t,u=!1;return n((function(n){if("number"!=typeof n)return n.tag?(r.push(n[0]),e(0)):(e=n=n[0],n(0));u=!0})),u||e(1),r},exports.toCallbag=function(n){return function(t,r){function e(n){if("number"==typeof n)return 2===r.length?r(2,void 0):r.bind(null,2,void 0);if(n.tag)return n=n[0],2===r.length?r(1,n):r.bind(null,1,n);var t=n[0];return n=function(n){switch(n){case 1:return t(0);case 2:return t(1)}},2===r.length?r(0,n):r.bind(null,0,n)}if(0===t)return 1===n.length?n(e):n.bind(null,e)}},exports.toObservable=function(n){var r={subscribe:function(r){let e=t,u=!1;return n((function(n){if("number"==typeof n)return u=!0,r.complete();if(n.tag){if(u)return;return r.next(n[0]),e(0)}return e=n=n[0],n(0)})),{unsubscribe:function(){if(!u)return u=!0,e(1)}}}};return r[V]=function(n){return r},r},exports.toPromise=function(n){return new Promise((function(t,r){return r=function(n){if("number"!=typeof n)return n.tag?t(n[0]):n[0](0)},1===A(1)(n).length?A(1)(n)(r):A(1)(n).bind(null,r)}))}; | ||
"use strict";function n(n,t){return t.tag=n,t}function t(n){}function r(t){return function(r){var e=t.length;let u=!1,i=!1,f=!1,o=0;return r(n(0,[function(c){if(c)u=!0;else if(i)f=!0;else{for(i=f=!0;f&&!u;)o<e?(c=t[o],o=o+1|0,f=!1,r(n(1,[c]))):(u=!0,r(0));i=!1}}]))}}function e(){}function u(n){return n(0)}function i(t){let r=!1;return t(n(0,[function(n){if(n)r=!0;else if(!r)return t(0)}]))}var f=r,o=i,c=[];function l(n){return void 0===n?((n=[c,0]).tag=256,n):(null===n||n[0]!==c||((n=[c,n[1]+1|0]).tag=256),n)}function s(n){return null===n||n[0]!==c?n:0!==(n=n[1])?[c,n-1|0]:void 0}function a(r){return function(e){return function(u){function i(n){"number"==typeof n?a&&(a=!1,void 0!==(n=f.shift())?(n=r(s(n)),a=!0,n(i)):b?u(0):c||(c=!0,o(0))):n.tag?a&&(u(n),p?p=!1:l(0)):(l=n=n[0],p=!1,n(0))}let f=[],o=t,c=!1,l=t,a=!1,p=!1,b=!1;return e((function(n){"number"==typeof n?b||(b=!0,!a&&function(n){return 0===n.length}(f)&&u(0)):n.tag?b||(n=n[0],c=!1,a?f.push(n):(n=r(n),a=!0,n(i))):o=n[0]})),u(n(0,[function(n){if(n){if(b||(b=!0,o(1)),a)return a=!1,l(1)}else if(b||c||(c=!0,o(0)),a&&!p)return p=!0,l(0)}]))}}}function p(n){return n}function b(n){return n}function m(n){return n(0)}function v(r){return function(e){return function(u){let i=t,f=!1,o=[],c=!1;return e((function(e){if("number"==typeof e){if(!c&&(c=!0,0===o.length))return u(0)}else if(e.tag){if(!c&&(f=!1,function(r){function e(n){return n!==s}var l=function(t){if("number"==typeof t){if(0!==o.length){if(o=o.filter(e),t=0===o.length,c&&t)return u(0);if(!f&&t)return f=!0,i(0)}}else{if(!t.tag)return s=t=t[0],o=o.concat(t),t(0);if(0!==o.length)return u(n(1,[t[0]])),s(0)}};let s=t;1===r.length?r(l):r.bind(null,l)}(r(e[0])),!f))return f=!0,i(0)}else i=e[0]})),u(n(0,[function(n){n?(c||(c=!0,i(n)),o.forEach((function(t){return t(n)})),o=[]):(f||c?f=!1:(f=!0,i(0)),o.forEach(m))}]))}}}function g(n){return n}function x(n){return n}function y(n){return v(x)(n)}function h(t){return function(r){return function(e){let u=!1;return r((function(r){if("number"==typeof r)u||(u=!0,e(r));else if(r.tag)u||(t(r[0]),e(r));else{var i=r[0];e(n(0,[function(n){if(!u)return n&&(u=!0),i(n)}]))}}))}}}function d(n){return n(0)}function E(r){return function(e){return function(u){function i(n){if(l){if("number"==typeof n){if(l=!1,a)return u(n);if(o)return;return o=!0,f(0)}return n.tag?(u(n),s?void(s=!1):c(0)):(c=n=n[0],s=!1,n(0))}}let f=t,o=!1,c=t,l=!1,s=!1,a=!1;return e((function(n){"number"==typeof n?a||(a=!0,l||u(0)):n.tag?a||(l&&(c(1),c=t),o?o=!1:(o=!0,f(0)),n=r(n[0]),l=!0,n(i)):f=n[0]})),u(n(0,[function(n){if(n){if(a||(a=!0,f(1)),l)return l=!1,c(1)}else if(a||o||(o=!0,f(0)),l&&!s)return s=!0,c(0)}]))}}}function k(n){return n}function S(n){return function(e){return function(u){let f=[],o=t;return e((function(t){"number"==typeof t?r(f)(u):t.tag?(f.length>=n&&0<n&&f.shift(),f.push(t[0]),o(0)):(t=t[0],0>=n?(t(1),i(u)):(o=t,t(0)))}))}}}var w=a,A=v,P=y,T=y,L=h,M=h,C=E,I=S;function O(n){return function(r){let e=t,u=!1;return r((function(t){if("number"!=typeof t){if(t.tag){if(u)return;return n(t[0]),e(0)}return e=t=t[0],t(0)}u=!0})),{unsubscribe:function(n){if(!u)return u=!0,e(1)}}}}function U(n){}var W=O,j="function"==typeof Symbol?Symbol.observable||(Symbol.observable=Symbol("observable")):"@@observable";function D(n){}function V(n,t,r){n.addEventListener(t,r)}function q(n,t,r){n.removeEventListener(t,r)}exports.buffer=function(r){return function(e){return function(u){function i(t){"number"==typeof t?s||(s=!0,o(1),0<f.length&&u(n(1,[f])),u(0)):t.tag?!s&&0<f.length&&(t=f,f=[],u(n(1,[t]))):c=t[0]}let f=[],o=t,c=t,l=!1,s=!1;return e((function(t){"number"==typeof t?s||(s=!0,c(1),0<f.length&&u(n(1,[f])),u(0)):t.tag?s||(f.push(t[0]),l?l=!1:(l=!0,o(0),c(0))):(o=t[0],r(i))})),u(n(0,[function(n){if(!s){if(n)return s=!0,o(1),c(1);if(!l)return l=!0,o(0),c(0)}}]))}}},exports.combine=function(r,e){return function(r,e){return function(u){let i=t,f=t,o=void 0,c=void 0,a=!1,p=0,b=!1;return r((function(t){var r=c;if("number"==typeof t){if(1>p)return void(p=p+1|0);if(b)return;return b=!0,u(0)}if(t.tag)if(t=t[0],void 0!==r){if(!b)return o=l(t),a=!1,u(n(1,[[t,s(r)]]))}else{if(o=l(t),!a)return f(0);a=!1}else i=t[0]})),e((function(t){var r=o;if("number"==typeof t){if(1>p)return void(p=p+1|0);if(b)return;return b=!0,u(0)}if(t.tag)if(t=t[0],void 0!==r){if(!b)return c=l(t),a=!1,u(n(1,[[s(r),t]]))}else{if(c=l(t),!a)return i(0);a=!1}else f=t[0]})),u(n(0,[function(n){if(!b){if(n)return b=!0,i(1),f(1);if(!a)return a=!0,i(n),f(n)}}]))}}(r,e)},exports.concat=function(n){return a(b)(r(n))},exports.concatAll=function(n){return a(p)(n)},exports.concatMap=w,exports.debounce=function(t){return function(r){return function(e){let u=void 0,i=!1,f=!1;var o=function(n){void 0!==(n=u)&&(u=void 0,clearTimeout(s(n)))};return r((function(r){if("number"==typeof r){if(f)return;return f=!0,void 0!==u?void(i=!0):e(0)}if(!r.tag){var c=r[0];return e(n(0,[function(n){if(!f)return n?(f=!0,i=!1,o(),c(1)):c(0)}]))}f||(o(),u=l(setTimeout((function(n){if(u=void 0,e(r),i)return e(0)}),t(r[0]))))}))}}},exports.delay=function(n){return function(t){return function(r){let e=0;return t((function(t){if("number"!=typeof t&&!t.tag)return r(t);e=e+1|0,setTimeout((function(n){if(0!==e)return e=e-1|0,r(t)}),n)}))}}},exports.empty=o,exports.filter=function(n){return function(r){return function(e){let u=t;return r((function(t){"number"==typeof t?e(t):t.tag?n(t[0])?e(t):u(0):(u=t[0],e(t))}))}}},exports.flatten=T,exports.forEach=function(n){return function(t){O(n)(t)}},exports.fromArray=f,exports.fromCallbag=function(t){return function(r){var e=function(t,e){switch(t){case 0:return r(n(0,[function(n){return e(n?2:1)}]));case 1:return r(n(1,[e]));case 2:return r(0)}};return 2===t.length?t(0,e):t.bind(null,0,e)}},exports.fromDomEvent=function(t,r){return function(t,r){return function(e){var u=V,i=q,f=function(t){return e(n(1,[t]))};return e(n(0,[function(n){if(n)return i(t,r,f)}])),u(t,r,f)}}(t,r)},exports.fromList=function(t){return function(r){let e=!1,u=!1,i=!1,f=t;return r(n(0,[function(t){if(t)e=!0;else if(u)i=!0;else{for(u=i=!0;i&&!e;)(t=f)?(f=t[1],i=!1,r(n(1,[t[0]]))):(e=!0,r(0));u=!1}}]))}},exports.fromObservable=function(t){var r=void 0!==t[j]?t[j]():t;return function(t){var e=r.subscribe({next:function(r){return t(n(1,[r]))},complete:function(){return t(0)},error:D});return t(n(0,[function(n){if(n)return e.unsubscribe()}]))}},exports.fromPromise=function(t){return function(r){let e=!1;return t.then((function(t){return e||(r(n(1,[t])),r(0)),Promise.resolve(void 0)})),r(n(0,[function(n){n&&(e=!0)}]))}},exports.fromValue=function(t){return function(r){let e=!1;return r(n(0,[function(u){if(u)e=!0;else if(!e)return e=!0,r(n(1,[t])),r(0)}]))}},exports.interval=function(t){return function(r){let e=0;var u=setInterval((function(t){return t=e,e=e+1|0,r(n(1,[t]))}),t);return r(n(0,[function(n){n&&clearInterval(u)}]))}},exports.make=function(t){return function(r){let u=e,i=!1;return u=t({next:function(t){if(!i)return r(n(1,[t]))},complete:function(n){if(!i)return i=!0,r(0)}}),r(n(0,[function(n){if(n&&!i)return i=!0,u()}]))}},exports.makeSubject=function(t){let r=[],e=!1;return{source:function(t){function e(n){return n!==t}return r=r.concat(t),t(n(0,[function(n){n&&(r=r.filter(e))}]))},next:function(t){e||r.forEach((function(r){return r(n(1,[t]))}))},complete:function(n){e||(e=!0,r.forEach(u))}}},exports.map=function(t){return function(r){return function(e){return r((function(r){return r="number"==typeof r?0:r.tag?n(1,[t(r[0])]):n(0,[r[0]]),e(r)}))}}},exports.merge=function(n){return v(g)(r(n))},exports.mergeAll=P,exports.mergeMap=A,exports.never=function(r){return r(n(0,[t]))},exports.onEnd=function(t){return function(r){return function(e){let u=!1;return r((function(r){if("number"==typeof r){if(u)return;return u=!0,e(r),t()}if(r.tag)return u?void 0:e(r);var i=r[0];return e(n(0,[function(n){if(!u)return n?(u=!0,i(n),t()):i(n)}]))}))}}},exports.onPush=L,exports.onStart=function(n){return function(t){return function(r){return 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,e=arguments.length;r<e;r++)t=n[r](t);return t},exports.publish=function(n){return O(U)(n)},exports.sample=function(r){return function(e){return function(u){let i=t,f=t,o=void 0,c=!1,a=!1;return e((function(n){if("number"==typeof n){if(a)return;return a=!0,f(1),u(0)}if(n.tag){if(o=l(n[0]),!c)return c=!0,f(0),i(0);c=!1}else i=n[0]})),r((function(t){var r=o;if("number"==typeof t){if(!a)return a=!0,i(1),u(0)}else if(t.tag){if(void 0!==r&&!a)return o=void 0,u(n(1,[s(r)]))}else f=t[0]})),u(n(0,[function(n){if(!a){if(n)return a=!0,i(1),f(1);if(!c)return c=!0,i(0),f(0)}}]))}}},exports.scan=function(t,r){return function(t,r){return function(e){return function(u){let i=r;return e((function(r){return"number"==typeof r?r=0:r.tag?(i=t(i,r[0]),r=n(1,[i])):r=n(0,[r[0]]),u(r)}))}}}(t,r)},exports.share=function(r){function e(n){"number"==typeof n?(u.forEach(d),u=[]):n.tag?(f=!1,u.forEach((function(t){return t(n)}))):i=n[0]}let u=[],i=t,f=!1;return function(t){function o(n){return n!==t}return u=u.concat(t),1===u.length&&r(e),t(n(0,[function(n){if(n){if(u=u.filter(o),0===u.length)return i(1)}else if(!f)return f=!0,i(n)}]))}},exports.skip=function(n){return function(r){return function(e){let u=t,i=n;return r((function(n){return"number"==typeof n?e(n):n.tag?0<i?(i=i-1|0,u(0)):e(n):(u=n[0],e(n))}))}}},exports.skipUntil=function(r){return function(e){return function(u){function i(n){"number"==typeof n?c&&(s=!0,f(1)):n.tag?(c=!1,o(1)):(o=n=n[0],n(0))}let f=t,o=t,c=!0,l=!1,s=!1;return e((function(n){"number"==typeof n?(c&&o(1),s=!0,u(0)):n.tag?c||s?l?l=!1:(l=!0,f(0),o(0)):(l=!1,u(n)):(f=n[0],r(i))})),u(n(0,[function(n){if(!s)if(n){if(s=!0,f(1),c)return o(1)}else if(!l)return l=!0,c&&o(0),f(0)}]))}}},exports.skipWhile=function(n){return function(r){return function(e){let u=t,i=!0;return r((function(t){if("number"==typeof t)return e(t);if(t.tag){if(i){if(n(t[0]))return u(0);i=!1}return e(t)}return u=t[0],e(t)}))}}},exports.subscribe=W,exports.switchAll=function(n){return E(k)(n)},exports.switchMap=C,exports.take=function(r){return function(e){return function(u){let i=!1,f=0,o=t;return e((function(n){if("number"==typeof n){if(i)return;return i=!0,u(0)}if(n.tag){if(f<r&&!i&&(f=f+1|0,u(n),!i&&f>=r))return i=!0,u(0),o(1)}else{if(n=n[0],0>=r)return i=!0,u(0),n(1);o=n}})),u(n(0,[function(n){if(!i){if(n)return i=!0,o(1);if(f<r)return o(0)}}]))}}},exports.takeLast=I,exports.takeUntil=function(r){return function(e){return function(u){function i(n){"number"!=typeof n&&(n.tag?(f=!0,o(1),u(0)):(c=n=n[0],n(0)))}let f=!1,o=t,c=t;return e((function(n){"number"==typeof n?f||(f=!0,c(1),u(0)):n.tag?f||u(n):(o=n[0],r(i))})),u(n(0,[function(n){if(!f)return n?(f=!0,o(1),c(1)):o(0)}]))}}},exports.takeWhile=function(n){return function(r){return function(e){let u=t,i=!1;return r((function(t){if("number"==typeof t){if(i)return;return i=!0,e(0)}if(t.tag){if(i)return;return n(t[0])?e(t):(i=!0,e(0),u(1))}return u=t[0],e(t)}))}}},exports.tap=M,exports.throttle=function(t){return function(r){return function(e){function u(n){f=void 0,i=!1}let i=!1,f=void 0;var o=function(n){void 0!==(n=f)&&clearTimeout(s(n))};return r((function(r){if("number"==typeof r)return o(),e(0);if(r.tag){if(i)return;return i=!0,o(),f=l(setTimeout(u,t(r[0]))),e(r)}var c=r[0];return e(n(0,[function(n){return n?(o(),c(1)):c(n)}]))}))}}},exports.toArray=function(n){let r=[],e=t,u=!1;return n((function(n){if("number"!=typeof n)return n.tag?(r.push(n[0]),e(0)):(e=n=n[0],n(0));u=!0})),u||e(1),r},exports.toCallbag=function(n){return function(t,r){if(0===t)return n((function(n){if("number"==typeof n)return 2===r.length?r(2,void 0):r.bind(null,2,void 0);if(n.tag)return n=n[0],2===r.length?r(1,n):r.bind(null,1,n);var t=n[0];return n=function(n){switch(n){case 1:return t(0);case 2:return t(1)}},2===r.length?r(0,n):r.bind(null,0,n)}))}},exports.toObservable=function(n){var r={subscribe:function(r){let e=t,u=!1;return n((function(n){if("number"==typeof n)return u=!0,r.complete();if(n.tag){if(u)return;return r.next(n[0]),e(0)}return e=n=n[0],n(0)})),{unsubscribe:function(){if(!u)return u=!0,e(1)}}}};return r[j]=function(n){return r},r},exports.toPromise=function(n){return new Promise((function(t,r){S(1)(n)((function(n){if("number"!=typeof n)return 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.11", | ||
"version": "4.0.12", | ||
"author": "Phil Pluckthun <phil@kitten.sh>", | ||
@@ -6,0 +6,0 @@ "source": "./src/Wonka.ts", |
@@ -152,11 +152,12 @@ | ||
return new Promise((function (resolve, param) { | ||
return Curry._1(Wonka_operators.takeLast(1)(source), (function (signal) { | ||
if (typeof signal === "number") { | ||
return ; | ||
} else if (signal.tag) { | ||
return resolve(signal[0]); | ||
} else { | ||
return signal[0](/* Pull */0); | ||
} | ||
})); | ||
Curry._1(Wonka_operators.takeLast(1)(source), (function (signal) { | ||
if (typeof signal === "number") { | ||
return ; | ||
} else if (signal.tag) { | ||
return resolve(signal[0]); | ||
} else { | ||
return signal[0](/* Pull */0); | ||
} | ||
})); | ||
})); | ||
@@ -163,0 +164,0 @@ } |
@@ -28,8 +28,6 @@ | ||
} | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
sink(/* End */0); | ||
} | ||
} | ||
if (signal.tag) { | ||
} else if (signal.tag) { | ||
if (!state.ended) { | ||
@@ -39,40 +37,36 @@ state.buffer.push(signal[0]); | ||
state.pulled = false; | ||
return ; | ||
} else { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
state.notifierTalkback(/* Pull */0); | ||
} | ||
} else { | ||
return ; | ||
} | ||
} | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (!state.ended) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.buffer.length > 0) { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
} | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
} | ||
} else { | ||
state.sourceTalkback = signal[0]; | ||
Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (!state.ended) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
if (state.buffer.length > 0) { | ||
sink(/* Push */Block.__(1, [state.buffer])); | ||
} | ||
if (!signal.tag) { | ||
state.notifierTalkback = signal[0]; | ||
return ; | ||
} | ||
if (state.ended) { | ||
return ; | ||
} | ||
if (state.buffer.length <= 0) { | ||
return ; | ||
} | ||
sink(/* End */0); | ||
} | ||
} else if (signal.tag) { | ||
if (!state.ended && state.buffer.length > 0) { | ||
var buffer = state.buffer; | ||
state.buffer = new Array(); | ||
return sink(/* Push */Block.__(1, [buffer])); | ||
})); | ||
sink(/* Push */Block.__(1, [buffer])); | ||
} | ||
} else { | ||
state.notifierTalkback = signal[0]; | ||
} | ||
})); | ||
} | ||
})); | ||
@@ -221,38 +215,37 @@ return sink(/* Start */Block.__(0, [(function (signal) { | ||
state.innerActive = true; | ||
return Curry._1(innerSource, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (!state.innerActive) { | ||
return ; | ||
} | ||
state.innerActive = false; | ||
var input = state.inputQueue.shift(); | ||
if (input !== undefined) { | ||
return applyInnerSource(f(Caml_option.valFromOption(input))); | ||
} else if (state.ended) { | ||
return sink(/* End */0); | ||
} else if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} | ||
if (signal.tag) { | ||
if (state.innerActive) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return ; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} else { | ||
return ; | ||
} | ||
} | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
Curry._1(innerSource, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.innerActive) { | ||
state.innerActive = false; | ||
var input = state.inputQueue.shift(); | ||
if (input !== undefined) { | ||
applyInnerSource(f(Caml_option.valFromOption(input))); | ||
} else if (state.ended) { | ||
sink(/* End */0); | ||
} else if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
state.outerTalkback(/* Pull */0); | ||
} | ||
} | ||
} else if (signal.tag) { | ||
if (state.innerActive) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
})); | ||
} else { | ||
state.innerTalkback(/* Pull */0); | ||
} | ||
} | ||
} else { | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
tb(/* Pull */0); | ||
} | ||
})); | ||
}; | ||
@@ -264,25 +257,22 @@ Curry._1(source, (function (signal) { | ||
if (!state.innerActive && MutableQueue_js.isEmpty(state.inputQueue)) { | ||
return sink(/* End */0); | ||
sink(/* End */0); | ||
} | ||
} | ||
} else if (signal.tag) { | ||
if (!state.ended) { | ||
var x = signal[0]; | ||
state.outerPulled = false; | ||
if (state.innerActive) { | ||
state.inputQueue.push(x); | ||
} else { | ||
return ; | ||
applyInnerSource(f(x)); | ||
} | ||
} else { | ||
return ; | ||
} | ||
} | ||
if (!signal.tag) { | ||
} else { | ||
state.outerTalkback = signal[0]; | ||
return ; | ||
} | ||
if (state.ended) { | ||
return ; | ||
} | ||
var x = signal[0]; | ||
state.outerPulled = false; | ||
if (state.innerActive) { | ||
state.inputQueue.push(x); | ||
return ; | ||
} else { | ||
return applyInnerSource(f(x)); | ||
} | ||
})); | ||
@@ -338,13 +328,14 @@ return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (typeof signal === "number") { | ||
return sink(signal); | ||
} | ||
if (signal.tag) { | ||
sink(signal); | ||
} else if (signal.tag) { | ||
if (f(signal[0])) { | ||
return sink(signal); | ||
sink(signal); | ||
} else { | ||
return talkback.contents(/* Pull */0); | ||
talkback.contents(/* Pull */0); | ||
} | ||
} else { | ||
talkback.contents = signal[0]; | ||
sink(signal); | ||
} | ||
talkback.contents = signal[0]; | ||
return sink(signal); | ||
})); | ||
@@ -535,27 +526,26 @@ }); | ||
ended.contents = true; | ||
return sink(signal); | ||
} else { | ||
return ; | ||
sink(signal); | ||
} | ||
} | ||
if (signal.tag) { | ||
} else if (signal.tag) { | ||
if (!ended.contents) { | ||
f(signal[0]); | ||
return sink(signal); | ||
} else { | ||
return ; | ||
sink(signal); | ||
} | ||
} else { | ||
var talkback = signal[0]; | ||
sink(/* Start */Block.__(0, [(function (signal) { | ||
if (!ended.contents) { | ||
if (signal) { | ||
ended.contents = true; | ||
return talkback(signal); | ||
} else { | ||
return talkback(signal); | ||
} | ||
} | ||
})])); | ||
} | ||
var talkback = signal[0]; | ||
return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (!ended.contents) { | ||
if (signal) { | ||
ended.contents = true; | ||
return talkback(signal); | ||
} else { | ||
return talkback(signal); | ||
} | ||
} | ||
})])); | ||
})); | ||
@@ -771,35 +761,35 @@ }); | ||
state.ended = true; | ||
return sink(/* End */0); | ||
} | ||
if (signal.tag) { | ||
sink(/* End */0); | ||
} else if (signal.tag) { | ||
if (!state.skip && !state.ended) { | ||
state.pulled = false; | ||
return sink(signal); | ||
sink(signal); | ||
} else if (state.pulled) { | ||
state.pulled = false; | ||
return ; | ||
} else { | ||
state.pulled = true; | ||
state.sourceTalkback(/* Pull */0); | ||
return state.notifierTalkback(/* Pull */0); | ||
state.notifierTalkback(/* Pull */0); | ||
} | ||
} else { | ||
state.sourceTalkback = signal[0]; | ||
Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.skip) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
} | ||
} else if (signal.tag) { | ||
state.skip = false; | ||
state.notifierTalkback(/* Close */1); | ||
} else { | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
innerTb(/* Pull */0); | ||
} | ||
})); | ||
} | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
if (state.skip) { | ||
state.ended = true; | ||
return state.sourceTalkback(/* Close */1); | ||
} else { | ||
return ; | ||
} | ||
} | ||
if (signal.tag) { | ||
state.skip = false; | ||
return state.notifierTalkback(/* Close */1); | ||
} | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
return innerTb(/* Pull */0); | ||
})); | ||
})); | ||
@@ -873,2 +863,35 @@ return sink(/* Start */Block.__(0, [(function (signal) { | ||
}; | ||
var applyInnerSource = function (innerSource) { | ||
state.innerActive = true; | ||
Curry._1(innerSource, (function (signal) { | ||
if (!state.innerActive) { | ||
return ; | ||
} | ||
if (typeof signal === "number") { | ||
state.innerActive = false; | ||
if (state.ended) { | ||
return sink(signal); | ||
} else if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} | ||
if (signal.tag) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return ; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
})); | ||
}; | ||
Curry._1(source, (function (signal) { | ||
@@ -879,9 +902,7 @@ if (typeof signal === "number") { | ||
if (!state.innerActive) { | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
sink(/* End */0); | ||
} | ||
} else { | ||
return ; | ||
} | ||
} else if (signal.tag) { | ||
@@ -899,40 +920,9 @@ if (!state.ended) { | ||
} | ||
var innerSource = f(signal[0]); | ||
state.innerActive = true; | ||
return Curry._1(innerSource, (function (signal) { | ||
if (!state.innerActive) { | ||
return ; | ||
} | ||
if (typeof signal === "number") { | ||
state.innerActive = false; | ||
if (state.ended) { | ||
return sink(signal); | ||
} else if (!state.outerPulled) { | ||
state.outerPulled = true; | ||
return state.outerTalkback(/* Pull */0); | ||
} else { | ||
return ; | ||
} | ||
} | ||
if (signal.tag) { | ||
sink(signal); | ||
if (state.innerPulled) { | ||
state.innerPulled = false; | ||
return ; | ||
} else { | ||
return state.innerTalkback(/* Pull */0); | ||
} | ||
} | ||
var tb = signal[0]; | ||
state.innerTalkback = tb; | ||
state.innerPulled = false; | ||
return tb(/* Pull */0); | ||
})); | ||
} else { | ||
return ; | ||
applyInnerSource(f(signal[0])); | ||
} | ||
} else { | ||
state.outerTalkback = signal[0]; | ||
return ; | ||
} | ||
})); | ||
@@ -1042,5 +1032,4 @@ return sink(/* Start */Block.__(0, [(function (signal) { | ||
if (typeof signal === "number") { | ||
return Wonka_sources.fromArray(state.queue)(sink); | ||
} | ||
if (signal.tag) { | ||
Wonka_sources.fromArray(state.queue)(sink); | ||
} else if (signal.tag) { | ||
var size = state.queue.length; | ||
@@ -1051,12 +1040,14 @@ if (size >= max && max > 0) { | ||
state.queue.push(signal[0]); | ||
return state.talkback(/* Pull */0); | ||
} | ||
var talkback = signal[0]; | ||
if (max <= 0) { | ||
talkback(/* Close */1); | ||
return Wonka_sources.empty(sink); | ||
state.talkback(/* Pull */0); | ||
} else { | ||
state.talkback = talkback; | ||
return talkback(/* Pull */0); | ||
var talkback = signal[0]; | ||
if (max <= 0) { | ||
talkback(/* Close */1); | ||
Wonka_sources.empty(sink); | ||
} else { | ||
state.talkback = talkback; | ||
talkback(/* Pull */0); | ||
} | ||
} | ||
})); | ||
@@ -1080,28 +1071,28 @@ }); | ||
state.notifierTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} else { | ||
return ; | ||
sink(/* End */0); | ||
} | ||
} | ||
if (signal.tag) { | ||
} else if (signal.tag) { | ||
if (!state.ended) { | ||
return sink(signal); | ||
} else { | ||
return ; | ||
sink(signal); | ||
} | ||
} | ||
state.sourceTalkback = signal[0]; | ||
return Curry._1(notifier, (function (signal) { | ||
if (typeof signal === "number") { | ||
return ; | ||
} | ||
if (signal.tag) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
return sink(/* End */0); | ||
} | ||
} else { | ||
state.sourceTalkback = signal[0]; | ||
Curry._1(notifier, (function (signal) { | ||
if (typeof signal !== "number") { | ||
if (signal.tag) { | ||
state.ended = true; | ||
state.sourceTalkback(/* Close */1); | ||
sink(/* End */0); | ||
} else { | ||
var innerTb = signal[0]; | ||
state.notifierTalkback = innerTb; | ||
return innerTb(/* Pull */0); | ||
})); | ||
innerTb(/* Pull */0); | ||
} | ||
} | ||
})); | ||
} | ||
})); | ||
@@ -1108,0 +1099,0 @@ return sink(/* Start */Block.__(0, [(function (signal) { |
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
404742
7323