12671 lines
366 KiB
JavaScript
12671 lines
366 KiB
JavaScript
(() => {
|
|
// output/Control.Apply/foreign.js
|
|
var arrayApply = function(fs) {
|
|
return function(xs) {
|
|
var l = fs.length;
|
|
var k = xs.length;
|
|
var result = new Array(l * k);
|
|
var n = 0;
|
|
for (var i2 = 0; i2 < l; i2++) {
|
|
var f = fs[i2];
|
|
for (var j = 0; j < k; j++) {
|
|
result[n++] = f(xs[j]);
|
|
}
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
|
|
// output/Control.Semigroupoid/index.js
|
|
var semigroupoidFn = {
|
|
compose: function(f) {
|
|
return function(g) {
|
|
return function(x) {
|
|
return f(g(x));
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var compose = function(dict) {
|
|
return dict.compose;
|
|
};
|
|
|
|
// output/Control.Category/index.js
|
|
var identity = function(dict) {
|
|
return dict.identity;
|
|
};
|
|
var categoryFn = {
|
|
identity: function(x) {
|
|
return x;
|
|
},
|
|
Semigroupoid0: function() {
|
|
return semigroupoidFn;
|
|
}
|
|
};
|
|
|
|
// output/Data.Boolean/index.js
|
|
var otherwise = true;
|
|
|
|
// output/Data.Function/index.js
|
|
var on = function(f) {
|
|
return function(g) {
|
|
return function(x) {
|
|
return function(y) {
|
|
return f(g(x))(g(y));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var flip = function(f) {
|
|
return function(b2) {
|
|
return function(a2) {
|
|
return f(a2)(b2);
|
|
};
|
|
};
|
|
};
|
|
var $$const = function(a2) {
|
|
return function(v) {
|
|
return a2;
|
|
};
|
|
};
|
|
var applyFlipped = function(x) {
|
|
return function(f) {
|
|
return f(x);
|
|
};
|
|
};
|
|
|
|
// output/Data.Functor/foreign.js
|
|
var arrayMap = function(f) {
|
|
return function(arr) {
|
|
var l = arr.length;
|
|
var result = new Array(l);
|
|
for (var i2 = 0; i2 < l; i2++) {
|
|
result[i2] = f(arr[i2]);
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
|
|
// output/Data.Unit/foreign.js
|
|
var unit = void 0;
|
|
|
|
// output/Type.Proxy/index.js
|
|
var $$Proxy = /* @__PURE__ */ function() {
|
|
function $$Proxy2() {
|
|
}
|
|
;
|
|
$$Proxy2.value = new $$Proxy2();
|
|
return $$Proxy2;
|
|
}();
|
|
|
|
// output/Data.Functor/index.js
|
|
var map = function(dict) {
|
|
return dict.map;
|
|
};
|
|
var mapFlipped = function(dictFunctor) {
|
|
var map116 = map(dictFunctor);
|
|
return function(fa) {
|
|
return function(f) {
|
|
return map116(f)(fa);
|
|
};
|
|
};
|
|
};
|
|
var $$void = function(dictFunctor) {
|
|
return map(dictFunctor)($$const(unit));
|
|
};
|
|
var voidLeft = function(dictFunctor) {
|
|
var map116 = map(dictFunctor);
|
|
return function(f) {
|
|
return function(x) {
|
|
return map116($$const(x))(f);
|
|
};
|
|
};
|
|
};
|
|
var voidRight = function(dictFunctor) {
|
|
var map116 = map(dictFunctor);
|
|
return function(x) {
|
|
return map116($$const(x));
|
|
};
|
|
};
|
|
var functorFn = {
|
|
map: /* @__PURE__ */ compose(semigroupoidFn)
|
|
};
|
|
var functorArray = {
|
|
map: arrayMap
|
|
};
|
|
|
|
// output/Control.Apply/index.js
|
|
var identity2 = /* @__PURE__ */ identity(categoryFn);
|
|
var applyFn = {
|
|
apply: function(f) {
|
|
return function(g) {
|
|
return function(x) {
|
|
return f(x)(g(x));
|
|
};
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorFn;
|
|
}
|
|
};
|
|
var applyArray = {
|
|
apply: arrayApply,
|
|
Functor0: function() {
|
|
return functorArray;
|
|
}
|
|
};
|
|
var apply = function(dict) {
|
|
return dict.apply;
|
|
};
|
|
var applyFirst = function(dictApply) {
|
|
var apply12 = apply(dictApply);
|
|
var map41 = map(dictApply.Functor0());
|
|
return function(a2) {
|
|
return function(b2) {
|
|
return apply12(map41($$const)(a2))(b2);
|
|
};
|
|
};
|
|
};
|
|
var applySecond = function(dictApply) {
|
|
var apply12 = apply(dictApply);
|
|
var map41 = map(dictApply.Functor0());
|
|
return function(a2) {
|
|
return function(b2) {
|
|
return apply12(map41($$const(identity2))(a2))(b2);
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Control.Applicative/index.js
|
|
var pure = function(dict) {
|
|
return dict.pure;
|
|
};
|
|
var unless = function(dictApplicative) {
|
|
var pure111 = pure(dictApplicative);
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (!v) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v) {
|
|
return pure111(unit);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative (line 68, column 1 - line 68, column 65): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var when = function(dictApplicative) {
|
|
var pure111 = pure(dictApplicative);
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (v) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (!v) {
|
|
return pure111(unit);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative (line 63, column 1 - line 63, column 63): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var liftA1 = function(dictApplicative) {
|
|
var apply6 = apply(dictApplicative.Apply0());
|
|
var pure111 = pure(dictApplicative);
|
|
return function(f) {
|
|
return function(a2) {
|
|
return apply6(pure111(f))(a2);
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Control.Bind/foreign.js
|
|
var arrayBind = function(arr) {
|
|
return function(f) {
|
|
var result = [];
|
|
for (var i2 = 0, l = arr.length; i2 < l; i2++) {
|
|
Array.prototype.push.apply(result, f(arr[i2]));
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
|
|
// output/Control.Bind/index.js
|
|
var identity3 = /* @__PURE__ */ identity(categoryFn);
|
|
var discard = function(dict) {
|
|
return dict.discard;
|
|
};
|
|
var bindArray = {
|
|
bind: arrayBind,
|
|
Apply0: function() {
|
|
return applyArray;
|
|
}
|
|
};
|
|
var bind = function(dict) {
|
|
return dict.bind;
|
|
};
|
|
var bindFlipped = function(dictBind) {
|
|
return flip(bind(dictBind));
|
|
};
|
|
var composeKleisliFlipped = function(dictBind) {
|
|
var bindFlipped13 = bindFlipped(dictBind);
|
|
return function(f) {
|
|
return function(g) {
|
|
return function(a2) {
|
|
return bindFlipped13(f)(g(a2));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var composeKleisli = function(dictBind) {
|
|
var bind18 = bind(dictBind);
|
|
return function(f) {
|
|
return function(g) {
|
|
return function(a2) {
|
|
return bind18(f(a2))(g);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var discardUnit = {
|
|
discard: function(dictBind) {
|
|
return bind(dictBind);
|
|
}
|
|
};
|
|
var join = function(dictBind) {
|
|
var bind18 = bind(dictBind);
|
|
return function(m) {
|
|
return bind18(m)(identity3);
|
|
};
|
|
};
|
|
|
|
// output/Data.Eq/foreign.js
|
|
var refEq = function(r1) {
|
|
return function(r2) {
|
|
return r1 === r2;
|
|
};
|
|
};
|
|
var eqBooleanImpl = refEq;
|
|
var eqIntImpl = refEq;
|
|
var eqStringImpl = refEq;
|
|
|
|
// output/Data.Symbol/index.js
|
|
var reflectSymbol = function(dict) {
|
|
return dict.reflectSymbol;
|
|
};
|
|
|
|
// output/Record.Unsafe/foreign.js
|
|
var unsafeGet = function(label5) {
|
|
return function(rec) {
|
|
return rec[label5];
|
|
};
|
|
};
|
|
|
|
// output/Data.Eq/index.js
|
|
var eqUnit = {
|
|
eq: function(v) {
|
|
return function(v1) {
|
|
return true;
|
|
};
|
|
}
|
|
};
|
|
var eqString = {
|
|
eq: eqStringImpl
|
|
};
|
|
var eqInt = {
|
|
eq: eqIntImpl
|
|
};
|
|
var eqBoolean = {
|
|
eq: eqBooleanImpl
|
|
};
|
|
var eq = function(dict) {
|
|
return dict.eq;
|
|
};
|
|
var eq2 = /* @__PURE__ */ eq(eqBoolean);
|
|
var notEq = function(dictEq) {
|
|
var eq32 = eq(dictEq);
|
|
return function(x) {
|
|
return function(y) {
|
|
return eq2(eq32(x)(y))(false);
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Foldable/foreign.js
|
|
var foldrArray = function(f) {
|
|
return function(init4) {
|
|
return function(xs) {
|
|
var acc = init4;
|
|
var len = xs.length;
|
|
for (var i2 = len - 1; i2 >= 0; i2--) {
|
|
acc = f(xs[i2])(acc);
|
|
}
|
|
return acc;
|
|
};
|
|
};
|
|
};
|
|
var foldlArray = function(f) {
|
|
return function(init4) {
|
|
return function(xs) {
|
|
var acc = init4;
|
|
var len = xs.length;
|
|
for (var i2 = 0; i2 < len; i2++) {
|
|
acc = f(acc)(xs[i2]);
|
|
}
|
|
return acc;
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Semigroup/foreign.js
|
|
var concatString = function(s1) {
|
|
return function(s2) {
|
|
return s1 + s2;
|
|
};
|
|
};
|
|
var concatArray = function(xs) {
|
|
return function(ys) {
|
|
if (xs.length === 0)
|
|
return ys;
|
|
if (ys.length === 0)
|
|
return xs;
|
|
return xs.concat(ys);
|
|
};
|
|
};
|
|
|
|
// output/Data.Semigroup/index.js
|
|
var semigroupString = {
|
|
append: concatString
|
|
};
|
|
var semigroupArray = {
|
|
append: concatArray
|
|
};
|
|
var append = function(dict) {
|
|
return dict.append;
|
|
};
|
|
|
|
// output/Control.Alt/index.js
|
|
var alt = function(dict) {
|
|
return dict.alt;
|
|
};
|
|
|
|
// output/Control.Plus/index.js
|
|
var empty = function(dict) {
|
|
return dict.empty;
|
|
};
|
|
|
|
// output/Data.Bounded/foreign.js
|
|
var topChar = String.fromCharCode(65535);
|
|
var bottomChar = String.fromCharCode(0);
|
|
var topNumber = Number.POSITIVE_INFINITY;
|
|
var bottomNumber = Number.NEGATIVE_INFINITY;
|
|
|
|
// output/Data.Ord/foreign.js
|
|
var unsafeCompareImpl = function(lt) {
|
|
return function(eq4) {
|
|
return function(gt) {
|
|
return function(x) {
|
|
return function(y) {
|
|
return x < y ? lt : x === y ? eq4 : gt;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var ordIntImpl = unsafeCompareImpl;
|
|
var ordStringImpl = unsafeCompareImpl;
|
|
|
|
// output/Data.Ordering/index.js
|
|
var LT = /* @__PURE__ */ function() {
|
|
function LT2() {
|
|
}
|
|
;
|
|
LT2.value = new LT2();
|
|
return LT2;
|
|
}();
|
|
var GT = /* @__PURE__ */ function() {
|
|
function GT2() {
|
|
}
|
|
;
|
|
GT2.value = new GT2();
|
|
return GT2;
|
|
}();
|
|
var EQ = /* @__PURE__ */ function() {
|
|
function EQ2() {
|
|
}
|
|
;
|
|
EQ2.value = new EQ2();
|
|
return EQ2;
|
|
}();
|
|
|
|
// output/Data.Ord/index.js
|
|
var ordUnit = {
|
|
compare: function(v) {
|
|
return function(v1) {
|
|
return EQ.value;
|
|
};
|
|
},
|
|
Eq0: function() {
|
|
return eqUnit;
|
|
}
|
|
};
|
|
var ordString = /* @__PURE__ */ function() {
|
|
return {
|
|
compare: ordStringImpl(LT.value)(EQ.value)(GT.value),
|
|
Eq0: function() {
|
|
return eqString;
|
|
}
|
|
};
|
|
}();
|
|
var ordInt = /* @__PURE__ */ function() {
|
|
return {
|
|
compare: ordIntImpl(LT.value)(EQ.value)(GT.value),
|
|
Eq0: function() {
|
|
return eqInt;
|
|
}
|
|
};
|
|
}();
|
|
var compare = function(dict) {
|
|
return dict.compare;
|
|
};
|
|
|
|
// output/Data.Show/foreign.js
|
|
var showIntImpl = function(n) {
|
|
return n.toString();
|
|
};
|
|
var showStringImpl = function(s) {
|
|
var l = s.length;
|
|
return '"' + s.replace(
|
|
/[\0-\x1F\x7F"\\]/g,
|
|
// eslint-disable-line no-control-regex
|
|
function(c, i2) {
|
|
switch (c) {
|
|
case '"':
|
|
case "\\":
|
|
return "\\" + c;
|
|
case "\x07":
|
|
return "\\a";
|
|
case "\b":
|
|
return "\\b";
|
|
case "\f":
|
|
return "\\f";
|
|
case "\n":
|
|
return "\\n";
|
|
case "\r":
|
|
return "\\r";
|
|
case " ":
|
|
return "\\t";
|
|
case "\v":
|
|
return "\\v";
|
|
}
|
|
var k = i2 + 1;
|
|
var empty7 = k < l && s[k] >= "0" && s[k] <= "9" ? "\\&" : "";
|
|
return "\\" + c.charCodeAt(0).toString(10) + empty7;
|
|
}
|
|
) + '"';
|
|
};
|
|
|
|
// output/Data.Show/index.js
|
|
var showString = {
|
|
show: showStringImpl
|
|
};
|
|
var showInt = {
|
|
show: showIntImpl
|
|
};
|
|
var show = function(dict) {
|
|
return dict.show;
|
|
};
|
|
|
|
// output/Data.Generic.Rep/index.js
|
|
var Inl = /* @__PURE__ */ function() {
|
|
function Inl2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Inl2.create = function(value0) {
|
|
return new Inl2(value0);
|
|
};
|
|
return Inl2;
|
|
}();
|
|
var Inr = /* @__PURE__ */ function() {
|
|
function Inr2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Inr2.create = function(value0) {
|
|
return new Inr2(value0);
|
|
};
|
|
return Inr2;
|
|
}();
|
|
var NoArguments = /* @__PURE__ */ function() {
|
|
function NoArguments2() {
|
|
}
|
|
;
|
|
NoArguments2.value = new NoArguments2();
|
|
return NoArguments2;
|
|
}();
|
|
var Constructor = function(x) {
|
|
return x;
|
|
};
|
|
var Argument = function(x) {
|
|
return x;
|
|
};
|
|
var to = function(dict) {
|
|
return dict.to;
|
|
};
|
|
var from = function(dict) {
|
|
return dict.from;
|
|
};
|
|
|
|
// output/Data.Maybe/index.js
|
|
var identity4 = /* @__PURE__ */ identity(categoryFn);
|
|
var Nothing = /* @__PURE__ */ function() {
|
|
function Nothing2() {
|
|
}
|
|
;
|
|
Nothing2.value = new Nothing2();
|
|
return Nothing2;
|
|
}();
|
|
var Just = /* @__PURE__ */ function() {
|
|
function Just2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Just2.create = function(value0) {
|
|
return new Just2(value0);
|
|
};
|
|
return Just2;
|
|
}();
|
|
var semigroupMaybe = function(dictSemigroup) {
|
|
var append12 = append(dictSemigroup);
|
|
return {
|
|
append: function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Nothing) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v1 instanceof Nothing) {
|
|
return v;
|
|
}
|
|
;
|
|
if (v instanceof Just && v1 instanceof Just) {
|
|
return new Just(append12(v.value0)(v1.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Maybe (line 182, column 1 - line 185, column 43): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
}
|
|
};
|
|
};
|
|
var maybe = function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Nothing) {
|
|
return v;
|
|
}
|
|
;
|
|
if (v2 instanceof Just) {
|
|
return v1(v2.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Maybe (line 237, column 1 - line 237, column 51): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var isNothing = /* @__PURE__ */ maybe(true)(/* @__PURE__ */ $$const(false));
|
|
var isJust = /* @__PURE__ */ maybe(false)(/* @__PURE__ */ $$const(true));
|
|
var functorMaybe = {
|
|
map: function(v) {
|
|
return function(v1) {
|
|
if (v1 instanceof Just) {
|
|
return new Just(v(v1.value0));
|
|
}
|
|
;
|
|
return Nothing.value;
|
|
};
|
|
}
|
|
};
|
|
var map2 = /* @__PURE__ */ map(functorMaybe);
|
|
var fromMaybe = function(a2) {
|
|
return maybe(a2)(identity4);
|
|
};
|
|
var fromJust = function() {
|
|
return function(v) {
|
|
if (v instanceof Just) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Maybe (line 288, column 1 - line 288, column 46): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
var eqMaybe = function(dictEq) {
|
|
var eq4 = eq(dictEq);
|
|
return {
|
|
eq: function(x) {
|
|
return function(y) {
|
|
if (x instanceof Nothing && y instanceof Nothing) {
|
|
return true;
|
|
}
|
|
;
|
|
if (x instanceof Just && y instanceof Just) {
|
|
return eq4(x.value0)(y.value0);
|
|
}
|
|
;
|
|
return false;
|
|
};
|
|
}
|
|
};
|
|
};
|
|
var applyMaybe = {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Just) {
|
|
return map2(v.value0)(v1);
|
|
}
|
|
;
|
|
if (v instanceof Nothing) {
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Maybe (line 67, column 1 - line 69, column 30): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorMaybe;
|
|
}
|
|
};
|
|
var bindMaybe = {
|
|
bind: function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Just) {
|
|
return v1(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Nothing) {
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Maybe (line 125, column 1 - line 127, column 28): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
},
|
|
Apply0: function() {
|
|
return applyMaybe;
|
|
}
|
|
};
|
|
var applicativeMaybe = /* @__PURE__ */ function() {
|
|
return {
|
|
pure: Just.create,
|
|
Apply0: function() {
|
|
return applyMaybe;
|
|
}
|
|
};
|
|
}();
|
|
|
|
// output/Data.Either/index.js
|
|
var Left = /* @__PURE__ */ function() {
|
|
function Left2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Left2.create = function(value0) {
|
|
return new Left2(value0);
|
|
};
|
|
return Left2;
|
|
}();
|
|
var Right = /* @__PURE__ */ function() {
|
|
function Right2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Right2.create = function(value0) {
|
|
return new Right2(value0);
|
|
};
|
|
return Right2;
|
|
}();
|
|
var note = function(a2) {
|
|
return maybe(new Left(a2))(Right.create);
|
|
};
|
|
var functorEither = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
if (m instanceof Left) {
|
|
return new Left(m.value0);
|
|
}
|
|
;
|
|
if (m instanceof Right) {
|
|
return new Right(f(m.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Either (line 0, column 0 - line 0, column 0): " + [m.constructor.name]);
|
|
};
|
|
}
|
|
};
|
|
var map3 = /* @__PURE__ */ map(functorEither);
|
|
var either = function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Left) {
|
|
return v(v2.value0);
|
|
}
|
|
;
|
|
if (v2 instanceof Right) {
|
|
return v1(v2.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Either (line 208, column 1 - line 208, column 64): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var hush = /* @__PURE__ */ function() {
|
|
return either($$const(Nothing.value))(Just.create);
|
|
}();
|
|
var applyEither = {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Left) {
|
|
return new Left(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Right) {
|
|
return map3(v.value0)(v1);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Either (line 70, column 1 - line 72, column 30): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorEither;
|
|
}
|
|
};
|
|
var bindEither = {
|
|
bind: /* @__PURE__ */ either(function(e) {
|
|
return function(v) {
|
|
return new Left(e);
|
|
};
|
|
})(function(a2) {
|
|
return function(f) {
|
|
return f(a2);
|
|
};
|
|
}),
|
|
Apply0: function() {
|
|
return applyEither;
|
|
}
|
|
};
|
|
var applicativeEither = /* @__PURE__ */ function() {
|
|
return {
|
|
pure: Right.create,
|
|
Apply0: function() {
|
|
return applyEither;
|
|
}
|
|
};
|
|
}();
|
|
|
|
// output/Data.HeytingAlgebra/foreign.js
|
|
var boolConj = function(b1) {
|
|
return function(b2) {
|
|
return b1 && b2;
|
|
};
|
|
};
|
|
var boolDisj = function(b1) {
|
|
return function(b2) {
|
|
return b1 || b2;
|
|
};
|
|
};
|
|
var boolNot = function(b2) {
|
|
return !b2;
|
|
};
|
|
|
|
// output/Data.HeytingAlgebra/index.js
|
|
var tt = function(dict) {
|
|
return dict.tt;
|
|
};
|
|
var not = function(dict) {
|
|
return dict.not;
|
|
};
|
|
var implies = function(dict) {
|
|
return dict.implies;
|
|
};
|
|
var ff = function(dict) {
|
|
return dict.ff;
|
|
};
|
|
var disj = function(dict) {
|
|
return dict.disj;
|
|
};
|
|
var heytingAlgebraBoolean = {
|
|
ff: false,
|
|
tt: true,
|
|
implies: function(a2) {
|
|
return function(b2) {
|
|
return disj(heytingAlgebraBoolean)(not(heytingAlgebraBoolean)(a2))(b2);
|
|
};
|
|
},
|
|
conj: boolConj,
|
|
disj: boolDisj,
|
|
not: boolNot
|
|
};
|
|
var conj = function(dict) {
|
|
return dict.conj;
|
|
};
|
|
var heytingAlgebraFunction = function(dictHeytingAlgebra) {
|
|
var ff1 = ff(dictHeytingAlgebra);
|
|
var tt1 = tt(dictHeytingAlgebra);
|
|
var implies1 = implies(dictHeytingAlgebra);
|
|
var conj1 = conj(dictHeytingAlgebra);
|
|
var disj1 = disj(dictHeytingAlgebra);
|
|
var not1 = not(dictHeytingAlgebra);
|
|
return {
|
|
ff: function(v) {
|
|
return ff1;
|
|
},
|
|
tt: function(v) {
|
|
return tt1;
|
|
},
|
|
implies: function(f) {
|
|
return function(g) {
|
|
return function(a2) {
|
|
return implies1(f(a2))(g(a2));
|
|
};
|
|
};
|
|
},
|
|
conj: function(f) {
|
|
return function(g) {
|
|
return function(a2) {
|
|
return conj1(f(a2))(g(a2));
|
|
};
|
|
};
|
|
},
|
|
disj: function(f) {
|
|
return function(g) {
|
|
return function(a2) {
|
|
return disj1(f(a2))(g(a2));
|
|
};
|
|
};
|
|
},
|
|
not: function(f) {
|
|
return function(a2) {
|
|
return not1(f(a2));
|
|
};
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/Data.Monoid/index.js
|
|
var monoidString = {
|
|
mempty: "",
|
|
Semigroup0: function() {
|
|
return semigroupString;
|
|
}
|
|
};
|
|
var mempty = function(dict) {
|
|
return dict.mempty;
|
|
};
|
|
|
|
// output/Data.Tuple/index.js
|
|
var Tuple = /* @__PURE__ */ function() {
|
|
function Tuple2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Tuple2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Tuple2(value0, value1);
|
|
};
|
|
};
|
|
return Tuple2;
|
|
}();
|
|
var uncurry = function(f) {
|
|
return function(v) {
|
|
return f(v.value0)(v.value1);
|
|
};
|
|
};
|
|
var snd = function(v) {
|
|
return v.value1;
|
|
};
|
|
var functorTuple = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
return new Tuple(m.value0, f(m.value1));
|
|
};
|
|
}
|
|
};
|
|
var fst = function(v) {
|
|
return v.value0;
|
|
};
|
|
var eqTuple = function(dictEq) {
|
|
var eq4 = eq(dictEq);
|
|
return function(dictEq1) {
|
|
var eq12 = eq(dictEq1);
|
|
return {
|
|
eq: function(x) {
|
|
return function(y) {
|
|
return eq4(x.value0)(y.value0) && eq12(x.value1)(y.value1);
|
|
};
|
|
}
|
|
};
|
|
};
|
|
};
|
|
var ordTuple = function(dictOrd) {
|
|
var compare2 = compare(dictOrd);
|
|
var eqTuple1 = eqTuple(dictOrd.Eq0());
|
|
return function(dictOrd1) {
|
|
var compare12 = compare(dictOrd1);
|
|
var eqTuple2 = eqTuple1(dictOrd1.Eq0());
|
|
return {
|
|
compare: function(x) {
|
|
return function(y) {
|
|
var v = compare2(x.value0)(y.value0);
|
|
if (v instanceof LT) {
|
|
return LT.value;
|
|
}
|
|
;
|
|
if (v instanceof GT) {
|
|
return GT.value;
|
|
}
|
|
;
|
|
return compare12(x.value1)(y.value1);
|
|
};
|
|
},
|
|
Eq0: function() {
|
|
return eqTuple2;
|
|
}
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Bifunctor/index.js
|
|
var identity5 = /* @__PURE__ */ identity(categoryFn);
|
|
var bimap = function(dict) {
|
|
return dict.bimap;
|
|
};
|
|
var lmap = function(dictBifunctor) {
|
|
var bimap1 = bimap(dictBifunctor);
|
|
return function(f) {
|
|
return bimap1(f)(identity5);
|
|
};
|
|
};
|
|
var bifunctorTuple = {
|
|
bimap: function(f) {
|
|
return function(g) {
|
|
return function(v) {
|
|
return new Tuple(f(v.value0), g(v.value1));
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var bifunctorEither = {
|
|
bimap: function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Left) {
|
|
return new Left(v(v2.value0));
|
|
}
|
|
;
|
|
if (v2 instanceof Right) {
|
|
return new Right(v1(v2.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Bifunctor (line 32, column 1 - line 34, column 36): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
}
|
|
};
|
|
|
|
// output/Data.Monoid.Disj/index.js
|
|
var Disj = function(x) {
|
|
return x;
|
|
};
|
|
var semigroupDisj = function(dictHeytingAlgebra) {
|
|
var disj2 = disj(dictHeytingAlgebra);
|
|
return {
|
|
append: function(v) {
|
|
return function(v1) {
|
|
return disj2(v)(v1);
|
|
};
|
|
}
|
|
};
|
|
};
|
|
var monoidDisj = function(dictHeytingAlgebra) {
|
|
var semigroupDisj1 = semigroupDisj(dictHeytingAlgebra);
|
|
return {
|
|
mempty: ff(dictHeytingAlgebra),
|
|
Semigroup0: function() {
|
|
return semigroupDisj1;
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/Unsafe.Coerce/foreign.js
|
|
var unsafeCoerce2 = function(x) {
|
|
return x;
|
|
};
|
|
|
|
// output/Safe.Coerce/index.js
|
|
var coerce = function() {
|
|
return unsafeCoerce2;
|
|
};
|
|
|
|
// output/Data.Newtype/index.js
|
|
var coerce2 = /* @__PURE__ */ coerce();
|
|
var unwrap = function() {
|
|
return coerce2;
|
|
};
|
|
var over = function() {
|
|
return function() {
|
|
return function(v) {
|
|
return coerce2;
|
|
};
|
|
};
|
|
};
|
|
var alaF = function() {
|
|
return function() {
|
|
return function() {
|
|
return function() {
|
|
return function(v) {
|
|
return coerce2;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Foldable/index.js
|
|
var alaF2 = /* @__PURE__ */ alaF()()()();
|
|
var foldr = function(dict) {
|
|
return dict.foldr;
|
|
};
|
|
var traverse_ = function(dictApplicative) {
|
|
var applySecond2 = applySecond(dictApplicative.Apply0());
|
|
var pure23 = pure(dictApplicative);
|
|
return function(dictFoldable) {
|
|
var foldr22 = foldr(dictFoldable);
|
|
return function(f) {
|
|
return foldr22(function($454) {
|
|
return applySecond2(f($454));
|
|
})(pure23(unit));
|
|
};
|
|
};
|
|
};
|
|
var for_ = function(dictApplicative) {
|
|
var traverse_14 = traverse_(dictApplicative);
|
|
return function(dictFoldable) {
|
|
return flip(traverse_14(dictFoldable));
|
|
};
|
|
};
|
|
var foldl = function(dict) {
|
|
return dict.foldl;
|
|
};
|
|
var indexl = function(dictFoldable) {
|
|
var foldl22 = foldl(dictFoldable);
|
|
return function(idx) {
|
|
var go2 = function(cursor) {
|
|
return function(a2) {
|
|
if (cursor.elem instanceof Just) {
|
|
return cursor;
|
|
}
|
|
;
|
|
var $296 = cursor.pos === idx;
|
|
if ($296) {
|
|
return {
|
|
elem: new Just(a2),
|
|
pos: cursor.pos
|
|
};
|
|
}
|
|
;
|
|
return {
|
|
pos: cursor.pos + 1 | 0,
|
|
elem: cursor.elem
|
|
};
|
|
};
|
|
};
|
|
var $455 = foldl22(go2)({
|
|
elem: Nothing.value,
|
|
pos: 0
|
|
});
|
|
return function($456) {
|
|
return function(v) {
|
|
return v.elem;
|
|
}($455($456));
|
|
};
|
|
};
|
|
};
|
|
var intercalate = function(dictFoldable) {
|
|
var foldl22 = foldl(dictFoldable);
|
|
return function(dictMonoid) {
|
|
var append9 = append(dictMonoid.Semigroup0());
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(sep) {
|
|
return function(xs) {
|
|
var go2 = function(v) {
|
|
return function(v1) {
|
|
if (v.init) {
|
|
return {
|
|
init: false,
|
|
acc: v1
|
|
};
|
|
}
|
|
;
|
|
return {
|
|
init: false,
|
|
acc: append9(v.acc)(append9(sep)(v1))
|
|
};
|
|
};
|
|
};
|
|
return foldl22(go2)({
|
|
init: true,
|
|
acc: mempty3
|
|
})(xs).acc;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var foldableMaybe = {
|
|
foldr: function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Nothing) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v2 instanceof Just) {
|
|
return v(v2.value0)(v1);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Foldable (line 138, column 1 - line 144, column 27): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
},
|
|
foldl: function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Nothing) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v2 instanceof Just) {
|
|
return v(v1)(v2.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Foldable (line 138, column 1 - line 144, column 27): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
},
|
|
foldMap: function(dictMonoid) {
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (v1 instanceof Nothing) {
|
|
return mempty3;
|
|
}
|
|
;
|
|
if (v1 instanceof Just) {
|
|
return v(v1.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Foldable (line 138, column 1 - line 144, column 27): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var foldableEither = {
|
|
foldr: function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Left) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v2 instanceof Right) {
|
|
return v(v2.value0)(v1);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Foldable (line 181, column 1 - line 187, column 28): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
},
|
|
foldl: function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Left) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v2 instanceof Right) {
|
|
return v(v1)(v2.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Foldable (line 181, column 1 - line 187, column 28): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
},
|
|
foldMap: function(dictMonoid) {
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (v1 instanceof Left) {
|
|
return mempty3;
|
|
}
|
|
;
|
|
if (v1 instanceof Right) {
|
|
return v(v1.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Foldable (line 181, column 1 - line 187, column 28): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var foldMapDefaultR = function(dictFoldable) {
|
|
var foldr22 = foldr(dictFoldable);
|
|
return function(dictMonoid) {
|
|
var append9 = append(dictMonoid.Semigroup0());
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(f) {
|
|
return foldr22(function(x) {
|
|
return function(acc) {
|
|
return append9(f(x))(acc);
|
|
};
|
|
})(mempty3);
|
|
};
|
|
};
|
|
};
|
|
var foldableArray = {
|
|
foldr: foldrArray,
|
|
foldl: foldlArray,
|
|
foldMap: function(dictMonoid) {
|
|
return foldMapDefaultR(foldableArray)(dictMonoid);
|
|
}
|
|
};
|
|
var foldMap = function(dict) {
|
|
return dict.foldMap;
|
|
};
|
|
var any = function(dictFoldable) {
|
|
var foldMap22 = foldMap(dictFoldable);
|
|
return function(dictHeytingAlgebra) {
|
|
return alaF2(Disj)(foldMap22(monoidDisj(dictHeytingAlgebra)));
|
|
};
|
|
};
|
|
|
|
// output/Effect/foreign.js
|
|
var pureE = function(a2) {
|
|
return function() {
|
|
return a2;
|
|
};
|
|
};
|
|
var bindE = function(a2) {
|
|
return function(f) {
|
|
return function() {
|
|
return f(a2())();
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Control.Monad/index.js
|
|
var unlessM = function(dictMonad) {
|
|
var bind18 = bind(dictMonad.Bind1());
|
|
var unless4 = unless(dictMonad.Applicative0());
|
|
return function(mb) {
|
|
return function(m) {
|
|
return bind18(mb)(function(b2) {
|
|
return unless4(b2)(m);
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var ap = function(dictMonad) {
|
|
var bind18 = bind(dictMonad.Bind1());
|
|
var pure23 = pure(dictMonad.Applicative0());
|
|
return function(f) {
|
|
return function(a2) {
|
|
return bind18(f)(function(f$prime) {
|
|
return bind18(a2)(function(a$prime) {
|
|
return pure23(f$prime(a$prime));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Effect/index.js
|
|
var $runtime_lazy = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var monadEffect = {
|
|
Applicative0: function() {
|
|
return applicativeEffect;
|
|
},
|
|
Bind1: function() {
|
|
return bindEffect;
|
|
}
|
|
};
|
|
var bindEffect = {
|
|
bind: bindE,
|
|
Apply0: function() {
|
|
return $lazy_applyEffect(0);
|
|
}
|
|
};
|
|
var applicativeEffect = {
|
|
pure: pureE,
|
|
Apply0: function() {
|
|
return $lazy_applyEffect(0);
|
|
}
|
|
};
|
|
var $lazy_functorEffect = /* @__PURE__ */ $runtime_lazy("functorEffect", "Effect", function() {
|
|
return {
|
|
map: liftA1(applicativeEffect)
|
|
};
|
|
});
|
|
var $lazy_applyEffect = /* @__PURE__ */ $runtime_lazy("applyEffect", "Effect", function() {
|
|
return {
|
|
apply: ap(monadEffect),
|
|
Functor0: function() {
|
|
return $lazy_functorEffect(0);
|
|
}
|
|
};
|
|
});
|
|
var functorEffect = /* @__PURE__ */ $lazy_functorEffect(20);
|
|
var applyEffect = /* @__PURE__ */ $lazy_applyEffect(23);
|
|
|
|
// output/Effect.Aff/foreign.js
|
|
var Aff = function() {
|
|
var EMPTY = {};
|
|
var PURE = "Pure";
|
|
var THROW = "Throw";
|
|
var CATCH = "Catch";
|
|
var SYNC = "Sync";
|
|
var ASYNC = "Async";
|
|
var BIND = "Bind";
|
|
var BRACKET = "Bracket";
|
|
var FORK = "Fork";
|
|
var SEQ = "Sequential";
|
|
var MAP = "Map";
|
|
var APPLY = "Apply";
|
|
var ALT = "Alt";
|
|
var CONS = "Cons";
|
|
var RESUME = "Resume";
|
|
var RELEASE = "Release";
|
|
var FINALIZER = "Finalizer";
|
|
var FINALIZED = "Finalized";
|
|
var FORKED = "Forked";
|
|
var FIBER = "Fiber";
|
|
var THUNK = "Thunk";
|
|
function Aff2(tag, _1, _2, _3) {
|
|
this.tag = tag;
|
|
this._1 = _1;
|
|
this._2 = _2;
|
|
this._3 = _3;
|
|
}
|
|
function AffCtr(tag) {
|
|
var fn = function(_1, _2, _3) {
|
|
return new Aff2(tag, _1, _2, _3);
|
|
};
|
|
fn.tag = tag;
|
|
return fn;
|
|
}
|
|
function nonCanceler2(error4) {
|
|
return new Aff2(PURE, void 0);
|
|
}
|
|
function runEff(eff) {
|
|
try {
|
|
eff();
|
|
} catch (error4) {
|
|
setTimeout(function() {
|
|
throw error4;
|
|
}, 0);
|
|
}
|
|
}
|
|
function runSync(left2, right2, eff) {
|
|
try {
|
|
return right2(eff());
|
|
} catch (error4) {
|
|
return left2(error4);
|
|
}
|
|
}
|
|
function runAsync(left2, eff, k) {
|
|
try {
|
|
return eff(k)();
|
|
} catch (error4) {
|
|
k(left2(error4))();
|
|
return nonCanceler2;
|
|
}
|
|
}
|
|
var Scheduler = function() {
|
|
var limit = 1024;
|
|
var size5 = 0;
|
|
var ix = 0;
|
|
var queue = new Array(limit);
|
|
var draining = false;
|
|
function drain() {
|
|
var thunk;
|
|
draining = true;
|
|
while (size5 !== 0) {
|
|
size5--;
|
|
thunk = queue[ix];
|
|
queue[ix] = void 0;
|
|
ix = (ix + 1) % limit;
|
|
thunk();
|
|
}
|
|
draining = false;
|
|
}
|
|
return {
|
|
isDraining: function() {
|
|
return draining;
|
|
},
|
|
enqueue: function(cb) {
|
|
var i2, tmp;
|
|
if (size5 === limit) {
|
|
tmp = draining;
|
|
drain();
|
|
draining = tmp;
|
|
}
|
|
queue[(ix + size5) % limit] = cb;
|
|
size5++;
|
|
if (!draining) {
|
|
drain();
|
|
}
|
|
}
|
|
};
|
|
}();
|
|
function Supervisor(util) {
|
|
var fibers = {};
|
|
var fiberId = 0;
|
|
var count = 0;
|
|
return {
|
|
register: function(fiber) {
|
|
var fid = fiberId++;
|
|
fiber.onComplete({
|
|
rethrow: true,
|
|
handler: function(result) {
|
|
return function() {
|
|
count--;
|
|
delete fibers[fid];
|
|
};
|
|
}
|
|
})();
|
|
fibers[fid] = fiber;
|
|
count++;
|
|
},
|
|
isEmpty: function() {
|
|
return count === 0;
|
|
},
|
|
killAll: function(killError, cb) {
|
|
return function() {
|
|
if (count === 0) {
|
|
return cb();
|
|
}
|
|
var killCount = 0;
|
|
var kills = {};
|
|
function kill3(fid) {
|
|
kills[fid] = fibers[fid].kill(killError, function(result) {
|
|
return function() {
|
|
delete kills[fid];
|
|
killCount--;
|
|
if (util.isLeft(result) && util.fromLeft(result)) {
|
|
setTimeout(function() {
|
|
throw util.fromLeft(result);
|
|
}, 0);
|
|
}
|
|
if (killCount === 0) {
|
|
cb();
|
|
}
|
|
};
|
|
})();
|
|
}
|
|
for (var k in fibers) {
|
|
if (fibers.hasOwnProperty(k)) {
|
|
killCount++;
|
|
kill3(k);
|
|
}
|
|
}
|
|
fibers = {};
|
|
fiberId = 0;
|
|
count = 0;
|
|
return function(error4) {
|
|
return new Aff2(SYNC, function() {
|
|
for (var k2 in kills) {
|
|
if (kills.hasOwnProperty(k2)) {
|
|
kills[k2]();
|
|
}
|
|
}
|
|
});
|
|
};
|
|
};
|
|
}
|
|
};
|
|
}
|
|
var SUSPENDED = 0;
|
|
var CONTINUE = 1;
|
|
var STEP_BIND = 2;
|
|
var STEP_RESULT = 3;
|
|
var PENDING = 4;
|
|
var RETURN = 5;
|
|
var COMPLETED = 6;
|
|
function Fiber(util, supervisor, aff) {
|
|
var runTick = 0;
|
|
var status = SUSPENDED;
|
|
var step4 = aff;
|
|
var fail4 = null;
|
|
var interrupt = null;
|
|
var bhead = null;
|
|
var btail = null;
|
|
var attempts = null;
|
|
var bracketCount = 0;
|
|
var joinId = 0;
|
|
var joins = null;
|
|
var rethrow = true;
|
|
function run5(localRunTick) {
|
|
var tmp, result, attempt;
|
|
while (true) {
|
|
tmp = null;
|
|
result = null;
|
|
attempt = null;
|
|
switch (status) {
|
|
case STEP_BIND:
|
|
status = CONTINUE;
|
|
try {
|
|
step4 = bhead(step4);
|
|
if (btail === null) {
|
|
bhead = null;
|
|
} else {
|
|
bhead = btail._1;
|
|
btail = btail._2;
|
|
}
|
|
} catch (e) {
|
|
status = RETURN;
|
|
fail4 = util.left(e);
|
|
step4 = null;
|
|
}
|
|
break;
|
|
case STEP_RESULT:
|
|
if (util.isLeft(step4)) {
|
|
status = RETURN;
|
|
fail4 = step4;
|
|
step4 = null;
|
|
} else if (bhead === null) {
|
|
status = RETURN;
|
|
} else {
|
|
status = STEP_BIND;
|
|
step4 = util.fromRight(step4);
|
|
}
|
|
break;
|
|
case CONTINUE:
|
|
switch (step4.tag) {
|
|
case BIND:
|
|
if (bhead) {
|
|
btail = new Aff2(CONS, bhead, btail);
|
|
}
|
|
bhead = step4._2;
|
|
status = CONTINUE;
|
|
step4 = step4._1;
|
|
break;
|
|
case PURE:
|
|
if (bhead === null) {
|
|
status = RETURN;
|
|
step4 = util.right(step4._1);
|
|
} else {
|
|
status = STEP_BIND;
|
|
step4 = step4._1;
|
|
}
|
|
break;
|
|
case SYNC:
|
|
status = STEP_RESULT;
|
|
step4 = runSync(util.left, util.right, step4._1);
|
|
break;
|
|
case ASYNC:
|
|
status = PENDING;
|
|
step4 = runAsync(util.left, step4._1, function(result2) {
|
|
return function() {
|
|
if (runTick !== localRunTick) {
|
|
return;
|
|
}
|
|
runTick++;
|
|
Scheduler.enqueue(function() {
|
|
if (runTick !== localRunTick + 1) {
|
|
return;
|
|
}
|
|
status = STEP_RESULT;
|
|
step4 = result2;
|
|
run5(runTick);
|
|
});
|
|
};
|
|
});
|
|
return;
|
|
case THROW:
|
|
status = RETURN;
|
|
fail4 = util.left(step4._1);
|
|
step4 = null;
|
|
break;
|
|
case CATCH:
|
|
if (bhead === null) {
|
|
attempts = new Aff2(CONS, step4, attempts, interrupt);
|
|
} else {
|
|
attempts = new Aff2(CONS, step4, new Aff2(CONS, new Aff2(RESUME, bhead, btail), attempts, interrupt), interrupt);
|
|
}
|
|
bhead = null;
|
|
btail = null;
|
|
status = CONTINUE;
|
|
step4 = step4._1;
|
|
break;
|
|
case BRACKET:
|
|
bracketCount++;
|
|
if (bhead === null) {
|
|
attempts = new Aff2(CONS, step4, attempts, interrupt);
|
|
} else {
|
|
attempts = new Aff2(CONS, step4, new Aff2(CONS, new Aff2(RESUME, bhead, btail), attempts, interrupt), interrupt);
|
|
}
|
|
bhead = null;
|
|
btail = null;
|
|
status = CONTINUE;
|
|
step4 = step4._1;
|
|
break;
|
|
case FORK:
|
|
status = STEP_RESULT;
|
|
tmp = Fiber(util, supervisor, step4._2);
|
|
if (supervisor) {
|
|
supervisor.register(tmp);
|
|
}
|
|
if (step4._1) {
|
|
tmp.run();
|
|
}
|
|
step4 = util.right(tmp);
|
|
break;
|
|
case SEQ:
|
|
status = CONTINUE;
|
|
step4 = sequential3(util, supervisor, step4._1);
|
|
break;
|
|
}
|
|
break;
|
|
case RETURN:
|
|
bhead = null;
|
|
btail = null;
|
|
if (attempts === null) {
|
|
status = COMPLETED;
|
|
step4 = interrupt || fail4 || step4;
|
|
} else {
|
|
tmp = attempts._3;
|
|
attempt = attempts._1;
|
|
attempts = attempts._2;
|
|
switch (attempt.tag) {
|
|
case CATCH:
|
|
if (interrupt && interrupt !== tmp && bracketCount === 0) {
|
|
status = RETURN;
|
|
} else if (fail4) {
|
|
status = CONTINUE;
|
|
step4 = attempt._2(util.fromLeft(fail4));
|
|
fail4 = null;
|
|
}
|
|
break;
|
|
case RESUME:
|
|
if (interrupt && interrupt !== tmp && bracketCount === 0 || fail4) {
|
|
status = RETURN;
|
|
} else {
|
|
bhead = attempt._1;
|
|
btail = attempt._2;
|
|
status = STEP_BIND;
|
|
step4 = util.fromRight(step4);
|
|
}
|
|
break;
|
|
case BRACKET:
|
|
bracketCount--;
|
|
if (fail4 === null) {
|
|
result = util.fromRight(step4);
|
|
attempts = new Aff2(CONS, new Aff2(RELEASE, attempt._2, result), attempts, tmp);
|
|
if (interrupt === tmp || bracketCount > 0) {
|
|
status = CONTINUE;
|
|
step4 = attempt._3(result);
|
|
}
|
|
}
|
|
break;
|
|
case RELEASE:
|
|
attempts = new Aff2(CONS, new Aff2(FINALIZED, step4, fail4), attempts, interrupt);
|
|
status = CONTINUE;
|
|
if (interrupt && interrupt !== tmp && bracketCount === 0) {
|
|
step4 = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);
|
|
} else if (fail4) {
|
|
step4 = attempt._1.failed(util.fromLeft(fail4))(attempt._2);
|
|
} else {
|
|
step4 = attempt._1.completed(util.fromRight(step4))(attempt._2);
|
|
}
|
|
fail4 = null;
|
|
bracketCount++;
|
|
break;
|
|
case FINALIZER:
|
|
bracketCount++;
|
|
attempts = new Aff2(CONS, new Aff2(FINALIZED, step4, fail4), attempts, interrupt);
|
|
status = CONTINUE;
|
|
step4 = attempt._1;
|
|
break;
|
|
case FINALIZED:
|
|
bracketCount--;
|
|
status = RETURN;
|
|
step4 = attempt._1;
|
|
fail4 = attempt._2;
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
case COMPLETED:
|
|
for (var k in joins) {
|
|
if (joins.hasOwnProperty(k)) {
|
|
rethrow = rethrow && joins[k].rethrow;
|
|
runEff(joins[k].handler(step4));
|
|
}
|
|
}
|
|
joins = null;
|
|
if (interrupt && fail4) {
|
|
setTimeout(function() {
|
|
throw util.fromLeft(fail4);
|
|
}, 0);
|
|
} else if (util.isLeft(step4) && rethrow) {
|
|
setTimeout(function() {
|
|
if (rethrow) {
|
|
throw util.fromLeft(step4);
|
|
}
|
|
}, 0);
|
|
}
|
|
return;
|
|
case SUSPENDED:
|
|
status = CONTINUE;
|
|
break;
|
|
case PENDING:
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
function onComplete(join5) {
|
|
return function() {
|
|
if (status === COMPLETED) {
|
|
rethrow = rethrow && join5.rethrow;
|
|
join5.handler(step4)();
|
|
return function() {
|
|
};
|
|
}
|
|
var jid = joinId++;
|
|
joins = joins || {};
|
|
joins[jid] = join5;
|
|
return function() {
|
|
if (joins !== null) {
|
|
delete joins[jid];
|
|
}
|
|
};
|
|
};
|
|
}
|
|
function kill3(error4, cb) {
|
|
return function() {
|
|
if (status === COMPLETED) {
|
|
cb(util.right(void 0))();
|
|
return function() {
|
|
};
|
|
}
|
|
var canceler = onComplete({
|
|
rethrow: false,
|
|
handler: function() {
|
|
return cb(util.right(void 0));
|
|
}
|
|
})();
|
|
switch (status) {
|
|
case SUSPENDED:
|
|
interrupt = util.left(error4);
|
|
status = COMPLETED;
|
|
step4 = interrupt;
|
|
run5(runTick);
|
|
break;
|
|
case PENDING:
|
|
if (interrupt === null) {
|
|
interrupt = util.left(error4);
|
|
}
|
|
if (bracketCount === 0) {
|
|
if (status === PENDING) {
|
|
attempts = new Aff2(CONS, new Aff2(FINALIZER, step4(error4)), attempts, interrupt);
|
|
}
|
|
status = RETURN;
|
|
step4 = null;
|
|
fail4 = null;
|
|
run5(++runTick);
|
|
}
|
|
break;
|
|
default:
|
|
if (interrupt === null) {
|
|
interrupt = util.left(error4);
|
|
}
|
|
if (bracketCount === 0) {
|
|
status = RETURN;
|
|
step4 = null;
|
|
fail4 = null;
|
|
}
|
|
}
|
|
return canceler;
|
|
};
|
|
}
|
|
function join4(cb) {
|
|
return function() {
|
|
var canceler = onComplete({
|
|
rethrow: false,
|
|
handler: cb
|
|
})();
|
|
if (status === SUSPENDED) {
|
|
run5(runTick);
|
|
}
|
|
return canceler;
|
|
};
|
|
}
|
|
return {
|
|
kill: kill3,
|
|
join: join4,
|
|
onComplete,
|
|
isSuspended: function() {
|
|
return status === SUSPENDED;
|
|
},
|
|
run: function() {
|
|
if (status === SUSPENDED) {
|
|
if (!Scheduler.isDraining()) {
|
|
Scheduler.enqueue(function() {
|
|
run5(runTick);
|
|
});
|
|
} else {
|
|
run5(runTick);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
function runPar(util, supervisor, par, cb) {
|
|
var fiberId = 0;
|
|
var fibers = {};
|
|
var killId = 0;
|
|
var kills = {};
|
|
var early = new Error("[ParAff] Early exit");
|
|
var interrupt = null;
|
|
var root2 = EMPTY;
|
|
function kill3(error4, par2, cb2) {
|
|
var step4 = par2;
|
|
var head6 = null;
|
|
var tail3 = null;
|
|
var count = 0;
|
|
var kills2 = {};
|
|
var tmp, kid;
|
|
loop:
|
|
while (true) {
|
|
tmp = null;
|
|
switch (step4.tag) {
|
|
case FORKED:
|
|
if (step4._3 === EMPTY) {
|
|
tmp = fibers[step4._1];
|
|
kills2[count++] = tmp.kill(error4, function(result) {
|
|
return function() {
|
|
count--;
|
|
if (count === 0) {
|
|
cb2(result)();
|
|
}
|
|
};
|
|
});
|
|
}
|
|
if (head6 === null) {
|
|
break loop;
|
|
}
|
|
step4 = head6._2;
|
|
if (tail3 === null) {
|
|
head6 = null;
|
|
} else {
|
|
head6 = tail3._1;
|
|
tail3 = tail3._2;
|
|
}
|
|
break;
|
|
case MAP:
|
|
step4 = step4._2;
|
|
break;
|
|
case APPLY:
|
|
case ALT:
|
|
if (head6) {
|
|
tail3 = new Aff2(CONS, head6, tail3);
|
|
}
|
|
head6 = step4;
|
|
step4 = step4._1;
|
|
break;
|
|
}
|
|
}
|
|
if (count === 0) {
|
|
cb2(util.right(void 0))();
|
|
} else {
|
|
kid = 0;
|
|
tmp = count;
|
|
for (; kid < tmp; kid++) {
|
|
kills2[kid] = kills2[kid]();
|
|
}
|
|
}
|
|
return kills2;
|
|
}
|
|
function join4(result, head6, tail3) {
|
|
var fail4, step4, lhs, rhs, tmp, kid;
|
|
if (util.isLeft(result)) {
|
|
fail4 = result;
|
|
step4 = null;
|
|
} else {
|
|
step4 = result;
|
|
fail4 = null;
|
|
}
|
|
loop:
|
|
while (true) {
|
|
lhs = null;
|
|
rhs = null;
|
|
tmp = null;
|
|
kid = null;
|
|
if (interrupt !== null) {
|
|
return;
|
|
}
|
|
if (head6 === null) {
|
|
cb(fail4 || step4)();
|
|
return;
|
|
}
|
|
if (head6._3 !== EMPTY) {
|
|
return;
|
|
}
|
|
switch (head6.tag) {
|
|
case MAP:
|
|
if (fail4 === null) {
|
|
head6._3 = util.right(head6._1(util.fromRight(step4)));
|
|
step4 = head6._3;
|
|
} else {
|
|
head6._3 = fail4;
|
|
}
|
|
break;
|
|
case APPLY:
|
|
lhs = head6._1._3;
|
|
rhs = head6._2._3;
|
|
if (fail4) {
|
|
head6._3 = fail4;
|
|
tmp = true;
|
|
kid = killId++;
|
|
kills[kid] = kill3(early, fail4 === lhs ? head6._2 : head6._1, function() {
|
|
return function() {
|
|
delete kills[kid];
|
|
if (tmp) {
|
|
tmp = false;
|
|
} else if (tail3 === null) {
|
|
join4(fail4, null, null);
|
|
} else {
|
|
join4(fail4, tail3._1, tail3._2);
|
|
}
|
|
};
|
|
});
|
|
if (tmp) {
|
|
tmp = false;
|
|
return;
|
|
}
|
|
} else if (lhs === EMPTY || rhs === EMPTY) {
|
|
return;
|
|
} else {
|
|
step4 = util.right(util.fromRight(lhs)(util.fromRight(rhs)));
|
|
head6._3 = step4;
|
|
}
|
|
break;
|
|
case ALT:
|
|
lhs = head6._1._3;
|
|
rhs = head6._2._3;
|
|
if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {
|
|
return;
|
|
}
|
|
if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {
|
|
fail4 = step4 === lhs ? rhs : lhs;
|
|
step4 = null;
|
|
head6._3 = fail4;
|
|
} else {
|
|
head6._3 = step4;
|
|
tmp = true;
|
|
kid = killId++;
|
|
kills[kid] = kill3(early, step4 === lhs ? head6._2 : head6._1, function() {
|
|
return function() {
|
|
delete kills[kid];
|
|
if (tmp) {
|
|
tmp = false;
|
|
} else if (tail3 === null) {
|
|
join4(step4, null, null);
|
|
} else {
|
|
join4(step4, tail3._1, tail3._2);
|
|
}
|
|
};
|
|
});
|
|
if (tmp) {
|
|
tmp = false;
|
|
return;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
if (tail3 === null) {
|
|
head6 = null;
|
|
} else {
|
|
head6 = tail3._1;
|
|
tail3 = tail3._2;
|
|
}
|
|
}
|
|
}
|
|
function resolve(fiber) {
|
|
return function(result) {
|
|
return function() {
|
|
delete fibers[fiber._1];
|
|
fiber._3 = result;
|
|
join4(result, fiber._2._1, fiber._2._2);
|
|
};
|
|
};
|
|
}
|
|
function run5() {
|
|
var status = CONTINUE;
|
|
var step4 = par;
|
|
var head6 = null;
|
|
var tail3 = null;
|
|
var tmp, fid;
|
|
loop:
|
|
while (true) {
|
|
tmp = null;
|
|
fid = null;
|
|
switch (status) {
|
|
case CONTINUE:
|
|
switch (step4.tag) {
|
|
case MAP:
|
|
if (head6) {
|
|
tail3 = new Aff2(CONS, head6, tail3);
|
|
}
|
|
head6 = new Aff2(MAP, step4._1, EMPTY, EMPTY);
|
|
step4 = step4._2;
|
|
break;
|
|
case APPLY:
|
|
if (head6) {
|
|
tail3 = new Aff2(CONS, head6, tail3);
|
|
}
|
|
head6 = new Aff2(APPLY, EMPTY, step4._2, EMPTY);
|
|
step4 = step4._1;
|
|
break;
|
|
case ALT:
|
|
if (head6) {
|
|
tail3 = new Aff2(CONS, head6, tail3);
|
|
}
|
|
head6 = new Aff2(ALT, EMPTY, step4._2, EMPTY);
|
|
step4 = step4._1;
|
|
break;
|
|
default:
|
|
fid = fiberId++;
|
|
status = RETURN;
|
|
tmp = step4;
|
|
step4 = new Aff2(FORKED, fid, new Aff2(CONS, head6, tail3), EMPTY);
|
|
tmp = Fiber(util, supervisor, tmp);
|
|
tmp.onComplete({
|
|
rethrow: false,
|
|
handler: resolve(step4)
|
|
})();
|
|
fibers[fid] = tmp;
|
|
if (supervisor) {
|
|
supervisor.register(tmp);
|
|
}
|
|
}
|
|
break;
|
|
case RETURN:
|
|
if (head6 === null) {
|
|
break loop;
|
|
}
|
|
if (head6._1 === EMPTY) {
|
|
head6._1 = step4;
|
|
status = CONTINUE;
|
|
step4 = head6._2;
|
|
head6._2 = EMPTY;
|
|
} else {
|
|
head6._2 = step4;
|
|
step4 = head6;
|
|
if (tail3 === null) {
|
|
head6 = null;
|
|
} else {
|
|
head6 = tail3._1;
|
|
tail3 = tail3._2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
root2 = step4;
|
|
for (fid = 0; fid < fiberId; fid++) {
|
|
fibers[fid].run();
|
|
}
|
|
}
|
|
function cancel(error4, cb2) {
|
|
interrupt = util.left(error4);
|
|
var innerKills;
|
|
for (var kid in kills) {
|
|
if (kills.hasOwnProperty(kid)) {
|
|
innerKills = kills[kid];
|
|
for (kid in innerKills) {
|
|
if (innerKills.hasOwnProperty(kid)) {
|
|
innerKills[kid]();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
kills = null;
|
|
var newKills = kill3(error4, root2, cb2);
|
|
return function(killError) {
|
|
return new Aff2(ASYNC, function(killCb) {
|
|
return function() {
|
|
for (var kid2 in newKills) {
|
|
if (newKills.hasOwnProperty(kid2)) {
|
|
newKills[kid2]();
|
|
}
|
|
}
|
|
return nonCanceler2;
|
|
};
|
|
});
|
|
};
|
|
}
|
|
run5();
|
|
return function(killError) {
|
|
return new Aff2(ASYNC, function(killCb) {
|
|
return function() {
|
|
return cancel(killError, killCb);
|
|
};
|
|
});
|
|
};
|
|
}
|
|
function sequential3(util, supervisor, par) {
|
|
return new Aff2(ASYNC, function(cb) {
|
|
return function() {
|
|
return runPar(util, supervisor, par, cb);
|
|
};
|
|
});
|
|
}
|
|
Aff2.EMPTY = EMPTY;
|
|
Aff2.Pure = AffCtr(PURE);
|
|
Aff2.Throw = AffCtr(THROW);
|
|
Aff2.Catch = AffCtr(CATCH);
|
|
Aff2.Sync = AffCtr(SYNC);
|
|
Aff2.Async = AffCtr(ASYNC);
|
|
Aff2.Bind = AffCtr(BIND);
|
|
Aff2.Bracket = AffCtr(BRACKET);
|
|
Aff2.Fork = AffCtr(FORK);
|
|
Aff2.Seq = AffCtr(SEQ);
|
|
Aff2.ParMap = AffCtr(MAP);
|
|
Aff2.ParApply = AffCtr(APPLY);
|
|
Aff2.ParAlt = AffCtr(ALT);
|
|
Aff2.Fiber = Fiber;
|
|
Aff2.Supervisor = Supervisor;
|
|
Aff2.Scheduler = Scheduler;
|
|
Aff2.nonCanceler = nonCanceler2;
|
|
return Aff2;
|
|
}();
|
|
var _pure = Aff.Pure;
|
|
var _throwError = Aff.Throw;
|
|
function _catchError(aff) {
|
|
return function(k) {
|
|
return Aff.Catch(aff, k);
|
|
};
|
|
}
|
|
function _map(f) {
|
|
return function(aff) {
|
|
if (aff.tag === Aff.Pure.tag) {
|
|
return Aff.Pure(f(aff._1));
|
|
} else {
|
|
return Aff.Bind(aff, function(value15) {
|
|
return Aff.Pure(f(value15));
|
|
});
|
|
}
|
|
};
|
|
}
|
|
function _bind(aff) {
|
|
return function(k) {
|
|
return Aff.Bind(aff, k);
|
|
};
|
|
}
|
|
function _fork(immediate) {
|
|
return function(aff) {
|
|
return Aff.Fork(immediate, aff);
|
|
};
|
|
}
|
|
var _liftEffect = Aff.Sync;
|
|
function _parAffMap(f) {
|
|
return function(aff) {
|
|
return Aff.ParMap(f, aff);
|
|
};
|
|
}
|
|
function _parAffApply(aff1) {
|
|
return function(aff2) {
|
|
return Aff.ParApply(aff1, aff2);
|
|
};
|
|
}
|
|
var makeAff = Aff.Async;
|
|
function generalBracket(acquire) {
|
|
return function(options2) {
|
|
return function(k) {
|
|
return Aff.Bracket(acquire, options2, k);
|
|
};
|
|
};
|
|
}
|
|
function _makeFiber(util, aff) {
|
|
return function() {
|
|
return Aff.Fiber(util, null, aff);
|
|
};
|
|
}
|
|
var _delay = /* @__PURE__ */ function() {
|
|
function setDelay(n, k) {
|
|
if (n === 0 && typeof setImmediate !== "undefined") {
|
|
return setImmediate(k);
|
|
} else {
|
|
return setTimeout(k, n);
|
|
}
|
|
}
|
|
function clearDelay(n, t) {
|
|
if (n === 0 && typeof clearImmediate !== "undefined") {
|
|
return clearImmediate(t);
|
|
} else {
|
|
return clearTimeout(t);
|
|
}
|
|
}
|
|
return function(right2, ms) {
|
|
return Aff.Async(function(cb) {
|
|
return function() {
|
|
var timer2 = setDelay(ms, cb(right2()));
|
|
return function() {
|
|
return Aff.Sync(function() {
|
|
return right2(clearDelay(ms, timer2));
|
|
});
|
|
};
|
|
};
|
|
});
|
|
};
|
|
}();
|
|
var _sequential = Aff.Seq;
|
|
|
|
// output/Effect.Exception/foreign.js
|
|
function error(msg) {
|
|
return new Error(msg);
|
|
}
|
|
function message(e) {
|
|
return e.message;
|
|
}
|
|
function throwException(e) {
|
|
return function() {
|
|
throw e;
|
|
};
|
|
}
|
|
function catchException(c) {
|
|
return function(t) {
|
|
return function() {
|
|
try {
|
|
return t();
|
|
} catch (e) {
|
|
if (e instanceof Error || Object.prototype.toString.call(e) === "[object Error]") {
|
|
return c(e)();
|
|
} else {
|
|
return c(new Error(e.toString()))();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Effect.Exception/index.js
|
|
var pure2 = /* @__PURE__ */ pure(applicativeEffect);
|
|
var map4 = /* @__PURE__ */ map(functorEffect);
|
|
var $$try = function(action2) {
|
|
return catchException(function($3) {
|
|
return pure2(Left.create($3));
|
|
})(map4(Right.create)(action2));
|
|
};
|
|
var $$throw = function($4) {
|
|
return throwException(error($4));
|
|
};
|
|
|
|
// output/Control.Monad.Error.Class/index.js
|
|
var throwError = function(dict) {
|
|
return dict.throwError;
|
|
};
|
|
var catchError = function(dict) {
|
|
return dict.catchError;
|
|
};
|
|
var $$try2 = function(dictMonadError) {
|
|
var catchError1 = catchError(dictMonadError);
|
|
var Monad0 = dictMonadError.MonadThrow0().Monad0();
|
|
var map41 = map(Monad0.Bind1().Apply0().Functor0());
|
|
var pure23 = pure(Monad0.Applicative0());
|
|
return function(a2) {
|
|
return catchError1(map41(Right.create)(a2))(function($52) {
|
|
return pure23(Left.create($52));
|
|
});
|
|
};
|
|
};
|
|
|
|
// output/Data.Identity/index.js
|
|
var Identity = function(x) {
|
|
return x;
|
|
};
|
|
var functorIdentity = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
return f(m);
|
|
};
|
|
}
|
|
};
|
|
var applyIdentity = {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
return v(v1);
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorIdentity;
|
|
}
|
|
};
|
|
var bindIdentity = {
|
|
bind: function(v) {
|
|
return function(f) {
|
|
return f(v);
|
|
};
|
|
},
|
|
Apply0: function() {
|
|
return applyIdentity;
|
|
}
|
|
};
|
|
var applicativeIdentity = {
|
|
pure: Identity,
|
|
Apply0: function() {
|
|
return applyIdentity;
|
|
}
|
|
};
|
|
var monadIdentity = {
|
|
Applicative0: function() {
|
|
return applicativeIdentity;
|
|
},
|
|
Bind1: function() {
|
|
return bindIdentity;
|
|
}
|
|
};
|
|
|
|
// output/Effect.Ref/foreign.js
|
|
var _new = function(val) {
|
|
return function() {
|
|
return { value: val };
|
|
};
|
|
};
|
|
var read = function(ref2) {
|
|
return function() {
|
|
return ref2.value;
|
|
};
|
|
};
|
|
var modifyImpl = function(f) {
|
|
return function(ref2) {
|
|
return function() {
|
|
var t = f(ref2.value);
|
|
ref2.value = t.state;
|
|
return t.value;
|
|
};
|
|
};
|
|
};
|
|
var write = function(val) {
|
|
return function(ref2) {
|
|
return function() {
|
|
ref2.value = val;
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Effect.Ref/index.js
|
|
var $$void2 = /* @__PURE__ */ $$void(functorEffect);
|
|
var $$new = _new;
|
|
var modify$prime = modifyImpl;
|
|
var modify = function(f) {
|
|
return modify$prime(function(s) {
|
|
var s$prime = f(s);
|
|
return {
|
|
state: s$prime,
|
|
value: s$prime
|
|
};
|
|
});
|
|
};
|
|
var modify_ = function(f) {
|
|
return function(s) {
|
|
return $$void2(modify(f)(s));
|
|
};
|
|
};
|
|
|
|
// output/Control.Monad.Rec.Class/index.js
|
|
var bindFlipped2 = /* @__PURE__ */ bindFlipped(bindEffect);
|
|
var map5 = /* @__PURE__ */ map(functorEffect);
|
|
var Loop = /* @__PURE__ */ function() {
|
|
function Loop2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Loop2.create = function(value0) {
|
|
return new Loop2(value0);
|
|
};
|
|
return Loop2;
|
|
}();
|
|
var Done = /* @__PURE__ */ function() {
|
|
function Done2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Done2.create = function(value0) {
|
|
return new Done2(value0);
|
|
};
|
|
return Done2;
|
|
}();
|
|
var tailRecM = function(dict) {
|
|
return dict.tailRecM;
|
|
};
|
|
var monadRecEffect = {
|
|
tailRecM: function(f) {
|
|
return function(a2) {
|
|
var fromDone = function(v) {
|
|
if (v instanceof Done) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 137, column 30 - line 137, column 44): " + [v.constructor.name]);
|
|
};
|
|
return function __do2() {
|
|
var r = bindFlipped2($$new)(f(a2))();
|
|
(function() {
|
|
while (!function __do3() {
|
|
var v = read(r)();
|
|
if (v instanceof Loop) {
|
|
var e = f(v.value0)();
|
|
write(e)(r)();
|
|
return false;
|
|
}
|
|
;
|
|
if (v instanceof Done) {
|
|
return true;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Rec.Class (line 128, column 22 - line 133, column 28): " + [v.constructor.name]);
|
|
}()) {
|
|
}
|
|
;
|
|
return {};
|
|
})();
|
|
return map5(fromDone)(read(r))();
|
|
};
|
|
};
|
|
},
|
|
Monad0: function() {
|
|
return monadEffect;
|
|
}
|
|
};
|
|
var forever = function(dictMonadRec) {
|
|
var tailRecM1 = tailRecM(dictMonadRec);
|
|
var voidRight3 = voidRight(dictMonadRec.Monad0().Bind1().Apply0().Functor0());
|
|
return function(ma) {
|
|
return tailRecM1(function(u2) {
|
|
return voidRight3(new Loop(u2))(ma);
|
|
})(unit);
|
|
};
|
|
};
|
|
|
|
// output/Control.Monad.Reader.Class/index.js
|
|
var ask = function(dict) {
|
|
return dict.ask;
|
|
};
|
|
|
|
// output/Control.Monad.State.Class/index.js
|
|
var state = function(dict) {
|
|
return dict.state;
|
|
};
|
|
var modify_2 = function(dictMonadState) {
|
|
var state1 = state(dictMonadState);
|
|
return function(f) {
|
|
return state1(function(s) {
|
|
return new Tuple(unit, f(s));
|
|
});
|
|
};
|
|
};
|
|
var gets = function(dictMonadState) {
|
|
var state1 = state(dictMonadState);
|
|
return function(f) {
|
|
return state1(function(s) {
|
|
return new Tuple(f(s), s);
|
|
});
|
|
};
|
|
};
|
|
var get = function(dictMonadState) {
|
|
return state(dictMonadState)(function(s) {
|
|
return new Tuple(s, s);
|
|
});
|
|
};
|
|
|
|
// output/Control.Monad.Trans.Class/index.js
|
|
var lift = function(dict) {
|
|
return dict.lift;
|
|
};
|
|
|
|
// output/Effect.Class/index.js
|
|
var monadEffectEffect = {
|
|
liftEffect: /* @__PURE__ */ identity(categoryFn),
|
|
Monad0: function() {
|
|
return monadEffect;
|
|
}
|
|
};
|
|
var liftEffect = function(dict) {
|
|
return dict.liftEffect;
|
|
};
|
|
|
|
// output/Control.Monad.Except.Trans/index.js
|
|
var map6 = /* @__PURE__ */ map(functorEither);
|
|
var ExceptT = function(x) {
|
|
return x;
|
|
};
|
|
var withExceptT = function(dictFunctor) {
|
|
var map116 = map(dictFunctor);
|
|
return function(f) {
|
|
return function(v) {
|
|
var mapLeft = function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Right) {
|
|
return new Right(v2.value0);
|
|
}
|
|
;
|
|
if (v2 instanceof Left) {
|
|
return new Left(v1(v2.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 42, column 3 - line 42, column 32): " + [v1.constructor.name, v2.constructor.name]);
|
|
};
|
|
};
|
|
return map116(mapLeft(f))(v);
|
|
};
|
|
};
|
|
};
|
|
var runExceptT = function(v) {
|
|
return v;
|
|
};
|
|
var mapExceptT = function(f) {
|
|
return function(v) {
|
|
return f(v);
|
|
};
|
|
};
|
|
var functorExceptT = function(dictFunctor) {
|
|
var map116 = map(dictFunctor);
|
|
return {
|
|
map: function(f) {
|
|
return mapExceptT(map116(map6(f)));
|
|
}
|
|
};
|
|
};
|
|
var monadExceptT = function(dictMonad) {
|
|
return {
|
|
Applicative0: function() {
|
|
return applicativeExceptT(dictMonad);
|
|
},
|
|
Bind1: function() {
|
|
return bindExceptT(dictMonad);
|
|
}
|
|
};
|
|
};
|
|
var bindExceptT = function(dictMonad) {
|
|
var bind18 = bind(dictMonad.Bind1());
|
|
var pure23 = pure(dictMonad.Applicative0());
|
|
return {
|
|
bind: function(v) {
|
|
return function(k) {
|
|
return bind18(v)(either(function($187) {
|
|
return pure23(Left.create($187));
|
|
})(function(a2) {
|
|
var v1 = k(a2);
|
|
return v1;
|
|
}));
|
|
};
|
|
},
|
|
Apply0: function() {
|
|
return applyExceptT(dictMonad);
|
|
}
|
|
};
|
|
};
|
|
var applyExceptT = function(dictMonad) {
|
|
var functorExceptT1 = functorExceptT(dictMonad.Bind1().Apply0().Functor0());
|
|
return {
|
|
apply: ap(monadExceptT(dictMonad)),
|
|
Functor0: function() {
|
|
return functorExceptT1;
|
|
}
|
|
};
|
|
};
|
|
var applicativeExceptT = function(dictMonad) {
|
|
return {
|
|
pure: function() {
|
|
var $188 = pure(dictMonad.Applicative0());
|
|
return function($189) {
|
|
return ExceptT($188(Right.create($189)));
|
|
};
|
|
}(),
|
|
Apply0: function() {
|
|
return applyExceptT(dictMonad);
|
|
}
|
|
};
|
|
};
|
|
var monadThrowExceptT = function(dictMonad) {
|
|
var monadExceptT1 = monadExceptT(dictMonad);
|
|
return {
|
|
throwError: function() {
|
|
var $198 = pure(dictMonad.Applicative0());
|
|
return function($199) {
|
|
return ExceptT($198(Left.create($199)));
|
|
};
|
|
}(),
|
|
Monad0: function() {
|
|
return monadExceptT1;
|
|
}
|
|
};
|
|
};
|
|
var altExceptT = function(dictSemigroup) {
|
|
var append9 = append(dictSemigroup);
|
|
return function(dictMonad) {
|
|
var Bind1 = dictMonad.Bind1();
|
|
var bind18 = bind(Bind1);
|
|
var pure23 = pure(dictMonad.Applicative0());
|
|
var functorExceptT1 = functorExceptT(Bind1.Apply0().Functor0());
|
|
return {
|
|
alt: function(v) {
|
|
return function(v1) {
|
|
return bind18(v)(function(rm) {
|
|
if (rm instanceof Right) {
|
|
return pure23(new Right(rm.value0));
|
|
}
|
|
;
|
|
if (rm instanceof Left) {
|
|
return bind18(v1)(function(rn) {
|
|
if (rn instanceof Right) {
|
|
return pure23(new Right(rn.value0));
|
|
}
|
|
;
|
|
if (rn instanceof Left) {
|
|
return pure23(new Left(append9(rm.value0)(rn.value0)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 86, column 9 - line 88, column 49): " + [rn.constructor.name]);
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Except.Trans (line 82, column 5 - line 88, column 49): " + [rm.constructor.name]);
|
|
});
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorExceptT1;
|
|
}
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Control.Monad.Reader.Trans/index.js
|
|
var ReaderT = function(x) {
|
|
return x;
|
|
};
|
|
var runReaderT = function(v) {
|
|
return v;
|
|
};
|
|
var monadTransReaderT = {
|
|
lift: function(dictMonad) {
|
|
return function($147) {
|
|
return ReaderT($$const($147));
|
|
};
|
|
}
|
|
};
|
|
var lift3 = /* @__PURE__ */ lift(monadTransReaderT);
|
|
var mapReaderT = function(f) {
|
|
return function(v) {
|
|
return function($148) {
|
|
return f(v($148));
|
|
};
|
|
};
|
|
};
|
|
var functorReaderT = function(dictFunctor) {
|
|
return {
|
|
map: function() {
|
|
var $149 = map(dictFunctor);
|
|
return function($150) {
|
|
return mapReaderT($149($150));
|
|
};
|
|
}()
|
|
};
|
|
};
|
|
var applyReaderT = function(dictApply) {
|
|
var apply6 = apply(dictApply);
|
|
var functorReaderT1 = functorReaderT(dictApply.Functor0());
|
|
return {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
return function(r) {
|
|
return apply6(v(r))(v1(r));
|
|
};
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorReaderT1;
|
|
}
|
|
};
|
|
};
|
|
var bindReaderT = function(dictBind) {
|
|
var bind18 = bind(dictBind);
|
|
var applyReaderT1 = applyReaderT(dictBind.Apply0());
|
|
return {
|
|
bind: function(v) {
|
|
return function(k) {
|
|
return function(r) {
|
|
return bind18(v(r))(function(a2) {
|
|
var v1 = k(a2);
|
|
return v1(r);
|
|
});
|
|
};
|
|
};
|
|
},
|
|
Apply0: function() {
|
|
return applyReaderT1;
|
|
}
|
|
};
|
|
};
|
|
var applicativeReaderT = function(dictApplicative) {
|
|
var applyReaderT1 = applyReaderT(dictApplicative.Apply0());
|
|
return {
|
|
pure: function() {
|
|
var $154 = pure(dictApplicative);
|
|
return function($155) {
|
|
return ReaderT($$const($154($155)));
|
|
};
|
|
}(),
|
|
Apply0: function() {
|
|
return applyReaderT1;
|
|
}
|
|
};
|
|
};
|
|
var monadReaderT = function(dictMonad) {
|
|
var applicativeReaderT1 = applicativeReaderT(dictMonad.Applicative0());
|
|
var bindReaderT1 = bindReaderT(dictMonad.Bind1());
|
|
return {
|
|
Applicative0: function() {
|
|
return applicativeReaderT1;
|
|
},
|
|
Bind1: function() {
|
|
return bindReaderT1;
|
|
}
|
|
};
|
|
};
|
|
var monadAskReaderT = function(dictMonad) {
|
|
var monadReaderT1 = monadReaderT(dictMonad);
|
|
return {
|
|
ask: pure(dictMonad.Applicative0()),
|
|
Monad0: function() {
|
|
return monadReaderT1;
|
|
}
|
|
};
|
|
};
|
|
var monadEffectReader = function(dictMonadEffect) {
|
|
var Monad0 = dictMonadEffect.Monad0();
|
|
var monadReaderT1 = monadReaderT(Monad0);
|
|
return {
|
|
liftEffect: function() {
|
|
var $157 = lift3(Monad0);
|
|
var $158 = liftEffect(dictMonadEffect);
|
|
return function($159) {
|
|
return $157($158($159));
|
|
};
|
|
}(),
|
|
Monad0: function() {
|
|
return monadReaderT1;
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/Data.Profunctor/index.js
|
|
var dimap = function(dict) {
|
|
return dict.dimap;
|
|
};
|
|
|
|
// output/Control.Parallel.Class/index.js
|
|
var sequential = function(dict) {
|
|
return dict.sequential;
|
|
};
|
|
var parallel = function(dict) {
|
|
return dict.parallel;
|
|
};
|
|
|
|
// output/Data.Traversable/foreign.js
|
|
var traverseArrayImpl = /* @__PURE__ */ function() {
|
|
function array1(a2) {
|
|
return [a2];
|
|
}
|
|
function array2(a2) {
|
|
return function(b2) {
|
|
return [a2, b2];
|
|
};
|
|
}
|
|
function array3(a2) {
|
|
return function(b2) {
|
|
return function(c) {
|
|
return [a2, b2, c];
|
|
};
|
|
};
|
|
}
|
|
function concat2(xs) {
|
|
return function(ys) {
|
|
return xs.concat(ys);
|
|
};
|
|
}
|
|
return function(apply6) {
|
|
return function(map41) {
|
|
return function(pure23) {
|
|
return function(f) {
|
|
return function(array) {
|
|
function go2(bot, top2) {
|
|
switch (top2 - bot) {
|
|
case 0:
|
|
return pure23([]);
|
|
case 1:
|
|
return map41(array1)(f(array[bot]));
|
|
case 2:
|
|
return apply6(map41(array2)(f(array[bot])))(f(array[bot + 1]));
|
|
case 3:
|
|
return apply6(apply6(map41(array3)(f(array[bot])))(f(array[bot + 1])))(f(array[bot + 2]));
|
|
default:
|
|
var pivot = bot + Math.floor((top2 - bot) / 4) * 2;
|
|
return apply6(map41(concat2)(go2(bot, pivot)))(go2(pivot, top2));
|
|
}
|
|
}
|
|
return go2(0, array.length);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}();
|
|
|
|
// output/Data.Traversable/index.js
|
|
var identity6 = /* @__PURE__ */ identity(categoryFn);
|
|
var traverse = function(dict) {
|
|
return dict.traverse;
|
|
};
|
|
var traversableMaybe = {
|
|
traverse: function(dictApplicative) {
|
|
var pure23 = pure(dictApplicative);
|
|
var map41 = map(dictApplicative.Apply0().Functor0());
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (v1 instanceof Nothing) {
|
|
return pure23(Nothing.value);
|
|
}
|
|
;
|
|
if (v1 instanceof Just) {
|
|
return map41(Just.create)(v(v1.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Traversable (line 115, column 1 - line 119, column 33): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
},
|
|
sequence: function(dictApplicative) {
|
|
var pure23 = pure(dictApplicative);
|
|
var map41 = map(dictApplicative.Apply0().Functor0());
|
|
return function(v) {
|
|
if (v instanceof Nothing) {
|
|
return pure23(Nothing.value);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return map41(Just.create)(v.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Traversable (line 115, column 1 - line 119, column 33): " + [v.constructor.name]);
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorMaybe;
|
|
},
|
|
Foldable1: function() {
|
|
return foldableMaybe;
|
|
}
|
|
};
|
|
var sequenceDefault = function(dictTraversable) {
|
|
var traverse22 = traverse(dictTraversable);
|
|
return function(dictApplicative) {
|
|
return traverse22(dictApplicative)(identity6);
|
|
};
|
|
};
|
|
var traversableArray = {
|
|
traverse: function(dictApplicative) {
|
|
var Apply0 = dictApplicative.Apply0();
|
|
return traverseArrayImpl(apply(Apply0))(map(Apply0.Functor0()))(pure(dictApplicative));
|
|
},
|
|
sequence: function(dictApplicative) {
|
|
return sequenceDefault(traversableArray)(dictApplicative);
|
|
},
|
|
Functor0: function() {
|
|
return functorArray;
|
|
},
|
|
Foldable1: function() {
|
|
return foldableArray;
|
|
}
|
|
};
|
|
var sequence = function(dict) {
|
|
return dict.sequence;
|
|
};
|
|
|
|
// output/Control.Parallel/index.js
|
|
var identity7 = /* @__PURE__ */ identity(categoryFn);
|
|
var parTraverse_ = function(dictParallel) {
|
|
var sequential3 = sequential(dictParallel);
|
|
var parallel4 = parallel(dictParallel);
|
|
return function(dictApplicative) {
|
|
var traverse_7 = traverse_(dictApplicative);
|
|
return function(dictFoldable) {
|
|
var traverse_14 = traverse_7(dictFoldable);
|
|
return function(f) {
|
|
var $51 = traverse_14(function($53) {
|
|
return parallel4(f($53));
|
|
});
|
|
return function($52) {
|
|
return sequential3($51($52));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var parSequence_ = function(dictParallel) {
|
|
var parTraverse_1 = parTraverse_(dictParallel);
|
|
return function(dictApplicative) {
|
|
var parTraverse_2 = parTraverse_1(dictApplicative);
|
|
return function(dictFoldable) {
|
|
return parTraverse_2(dictFoldable)(identity7);
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Effect.Unsafe/foreign.js
|
|
var unsafePerformEffect = function(f) {
|
|
return f();
|
|
};
|
|
|
|
// output/Partial.Unsafe/foreign.js
|
|
var _unsafePartial = function(f) {
|
|
return f();
|
|
};
|
|
|
|
// output/Partial/foreign.js
|
|
var _crashWith = function(msg) {
|
|
throw new Error(msg);
|
|
};
|
|
|
|
// output/Partial/index.js
|
|
var crashWith = function() {
|
|
return _crashWith;
|
|
};
|
|
|
|
// output/Partial.Unsafe/index.js
|
|
var crashWith2 = /* @__PURE__ */ crashWith();
|
|
var unsafePartial = _unsafePartial;
|
|
var unsafeCrashWith = function(msg) {
|
|
return unsafePartial(function() {
|
|
return crashWith2(msg);
|
|
});
|
|
};
|
|
|
|
// output/Effect.Aff/index.js
|
|
var $runtime_lazy2 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var pure3 = /* @__PURE__ */ pure(applicativeEffect);
|
|
var $$void3 = /* @__PURE__ */ $$void(functorEffect);
|
|
var map7 = /* @__PURE__ */ map(functorEffect);
|
|
var Canceler = function(x) {
|
|
return x;
|
|
};
|
|
var suspendAff = /* @__PURE__ */ _fork(false);
|
|
var functorParAff = {
|
|
map: _parAffMap
|
|
};
|
|
var functorAff = {
|
|
map: _map
|
|
};
|
|
var map1 = /* @__PURE__ */ map(functorAff);
|
|
var forkAff = /* @__PURE__ */ _fork(true);
|
|
var ffiUtil = /* @__PURE__ */ function() {
|
|
var unsafeFromRight = function(v) {
|
|
if (v instanceof Right) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
if (v instanceof Left) {
|
|
return unsafeCrashWith("unsafeFromRight: Left");
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Effect.Aff (line 412, column 21 - line 414, column 54): " + [v.constructor.name]);
|
|
};
|
|
var unsafeFromLeft = function(v) {
|
|
if (v instanceof Left) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
if (v instanceof Right) {
|
|
return unsafeCrashWith("unsafeFromLeft: Right");
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Effect.Aff (line 407, column 20 - line 409, column 55): " + [v.constructor.name]);
|
|
};
|
|
var isLeft = function(v) {
|
|
if (v instanceof Left) {
|
|
return true;
|
|
}
|
|
;
|
|
if (v instanceof Right) {
|
|
return false;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Effect.Aff (line 402, column 12 - line 404, column 21): " + [v.constructor.name]);
|
|
};
|
|
return {
|
|
isLeft,
|
|
fromLeft: unsafeFromLeft,
|
|
fromRight: unsafeFromRight,
|
|
left: Left.create,
|
|
right: Right.create
|
|
};
|
|
}();
|
|
var makeFiber = function(aff) {
|
|
return _makeFiber(ffiUtil, aff);
|
|
};
|
|
var launchAff = function(aff) {
|
|
return function __do2() {
|
|
var fiber = makeFiber(aff)();
|
|
fiber.run();
|
|
return fiber;
|
|
};
|
|
};
|
|
var launchAff_ = function($75) {
|
|
return $$void3(launchAff($75));
|
|
};
|
|
var delay = function(v) {
|
|
return _delay(Right.create, v);
|
|
};
|
|
var bracket = function(acquire) {
|
|
return function(completed) {
|
|
return generalBracket(acquire)({
|
|
killed: $$const(completed),
|
|
failed: $$const(completed),
|
|
completed: $$const(completed)
|
|
});
|
|
};
|
|
};
|
|
var applyParAff = {
|
|
apply: _parAffApply,
|
|
Functor0: function() {
|
|
return functorParAff;
|
|
}
|
|
};
|
|
var monadAff = {
|
|
Applicative0: function() {
|
|
return applicativeAff;
|
|
},
|
|
Bind1: function() {
|
|
return bindAff;
|
|
}
|
|
};
|
|
var bindAff = {
|
|
bind: _bind,
|
|
Apply0: function() {
|
|
return $lazy_applyAff(0);
|
|
}
|
|
};
|
|
var applicativeAff = {
|
|
pure: _pure,
|
|
Apply0: function() {
|
|
return $lazy_applyAff(0);
|
|
}
|
|
};
|
|
var $lazy_applyAff = /* @__PURE__ */ $runtime_lazy2("applyAff", "Effect.Aff", function() {
|
|
return {
|
|
apply: ap(monadAff),
|
|
Functor0: function() {
|
|
return functorAff;
|
|
}
|
|
};
|
|
});
|
|
var applyAff = /* @__PURE__ */ $lazy_applyAff(73);
|
|
var pure22 = /* @__PURE__ */ pure(applicativeAff);
|
|
var bind1 = /* @__PURE__ */ bind(bindAff);
|
|
var bindFlipped3 = /* @__PURE__ */ bindFlipped(bindAff);
|
|
var $$finally = function(fin) {
|
|
return function(a2) {
|
|
return bracket(pure22(unit))($$const(fin))($$const(a2));
|
|
};
|
|
};
|
|
var parallelAff = {
|
|
parallel: unsafeCoerce2,
|
|
sequential: _sequential,
|
|
Apply0: function() {
|
|
return applyAff;
|
|
},
|
|
Apply1: function() {
|
|
return applyParAff;
|
|
}
|
|
};
|
|
var parallel2 = /* @__PURE__ */ parallel(parallelAff);
|
|
var applicativeParAff = {
|
|
pure: function($76) {
|
|
return parallel2(pure22($76));
|
|
},
|
|
Apply0: function() {
|
|
return applyParAff;
|
|
}
|
|
};
|
|
var monadEffectAff = {
|
|
liftEffect: _liftEffect,
|
|
Monad0: function() {
|
|
return monadAff;
|
|
}
|
|
};
|
|
var liftEffect2 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var effectCanceler = function($77) {
|
|
return Canceler($$const(liftEffect2($77)));
|
|
};
|
|
var joinFiber = function(v) {
|
|
return makeAff(function(k) {
|
|
return map7(effectCanceler)(v.join(k));
|
|
});
|
|
};
|
|
var functorFiber = {
|
|
map: function(f) {
|
|
return function(t) {
|
|
return unsafePerformEffect(makeFiber(map1(f)(joinFiber(t))));
|
|
};
|
|
}
|
|
};
|
|
var killFiber = function(e) {
|
|
return function(v) {
|
|
return bind1(liftEffect2(v.isSuspended))(function(suspended) {
|
|
if (suspended) {
|
|
return liftEffect2($$void3(v.kill(e, $$const(pure3(unit)))));
|
|
}
|
|
;
|
|
return makeAff(function(k) {
|
|
return map7(effectCanceler)(v.kill(e, k));
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var monadThrowAff = {
|
|
throwError: _throwError,
|
|
Monad0: function() {
|
|
return monadAff;
|
|
}
|
|
};
|
|
var monadErrorAff = {
|
|
catchError: _catchError,
|
|
MonadThrow0: function() {
|
|
return monadThrowAff;
|
|
}
|
|
};
|
|
var $$try3 = /* @__PURE__ */ $$try2(monadErrorAff);
|
|
var runAff = function(k) {
|
|
return function(aff) {
|
|
return launchAff(bindFlipped3(function($83) {
|
|
return liftEffect2(k($83));
|
|
})($$try3(aff)));
|
|
};
|
|
};
|
|
var runAff_ = function(k) {
|
|
return function(aff) {
|
|
return $$void3(runAff(k)(aff));
|
|
};
|
|
};
|
|
var monadRecAff = {
|
|
tailRecM: function(k) {
|
|
var go2 = function(a2) {
|
|
return bind1(k(a2))(function(res) {
|
|
if (res instanceof Done) {
|
|
return pure22(res.value0);
|
|
}
|
|
;
|
|
if (res instanceof Loop) {
|
|
return go2(res.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Effect.Aff (line 104, column 7 - line 106, column 23): " + [res.constructor.name]);
|
|
});
|
|
};
|
|
return go2;
|
|
},
|
|
Monad0: function() {
|
|
return monadAff;
|
|
}
|
|
};
|
|
var nonCanceler = /* @__PURE__ */ $$const(/* @__PURE__ */ pure22(unit));
|
|
|
|
// output/Data.Argonaut.Core/foreign.js
|
|
function id(x) {
|
|
return x;
|
|
}
|
|
function stringify(j) {
|
|
return JSON.stringify(j);
|
|
}
|
|
function _caseJson(isNull3, isBool, isNum, isStr, isArr, isObj, j) {
|
|
if (j == null)
|
|
return isNull3();
|
|
else if (typeof j === "boolean")
|
|
return isBool(j);
|
|
else if (typeof j === "number")
|
|
return isNum(j);
|
|
else if (typeof j === "string")
|
|
return isStr(j);
|
|
else if (Object.prototype.toString.call(j) === "[object Array]")
|
|
return isArr(j);
|
|
else
|
|
return isObj(j);
|
|
}
|
|
|
|
// output/Foreign.Object/foreign.js
|
|
function _copyST(m) {
|
|
return function() {
|
|
var r = {};
|
|
for (var k in m) {
|
|
if (hasOwnProperty.call(m, k)) {
|
|
r[k] = m[k];
|
|
}
|
|
}
|
|
return r;
|
|
};
|
|
}
|
|
var empty2 = {};
|
|
function runST(f) {
|
|
return f();
|
|
}
|
|
function _fmapObject(m0, f) {
|
|
var m = {};
|
|
for (var k in m0) {
|
|
if (hasOwnProperty.call(m0, k)) {
|
|
m[k] = f(m0[k]);
|
|
}
|
|
}
|
|
return m;
|
|
}
|
|
function _mapWithKey(m0, f) {
|
|
var m = {};
|
|
for (var k in m0) {
|
|
if (hasOwnProperty.call(m0, k)) {
|
|
m[k] = f(k)(m0[k]);
|
|
}
|
|
}
|
|
return m;
|
|
}
|
|
function _foldM(bind18) {
|
|
return function(f) {
|
|
return function(mz) {
|
|
return function(m) {
|
|
var acc = mz;
|
|
function g(k2) {
|
|
return function(z) {
|
|
return f(z)(k2)(m[k2]);
|
|
};
|
|
}
|
|
for (var k in m) {
|
|
if (hasOwnProperty.call(m, k)) {
|
|
acc = bind18(acc)(g(k));
|
|
}
|
|
}
|
|
return acc;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
function _lookup(no, yes, k, m) {
|
|
return k in m ? yes(m[k]) : no;
|
|
}
|
|
function toArrayWithKey(f) {
|
|
return function(m) {
|
|
var r = [];
|
|
for (var k in m) {
|
|
if (hasOwnProperty.call(m, k)) {
|
|
r.push(f(k)(m[k]));
|
|
}
|
|
}
|
|
return r;
|
|
};
|
|
}
|
|
var keys = Object.keys || toArrayWithKey(function(k) {
|
|
return function() {
|
|
return k;
|
|
};
|
|
});
|
|
|
|
// output/Data.Array/foreign.js
|
|
var replicateFill = function(count, value15) {
|
|
if (count < 1) {
|
|
return [];
|
|
}
|
|
var result = new Array(count);
|
|
return result.fill(value15);
|
|
};
|
|
var replicatePolyfill = function(count, value15) {
|
|
var result = [];
|
|
var n = 0;
|
|
for (var i2 = 0; i2 < count; i2++) {
|
|
result[n++] = value15;
|
|
}
|
|
return result;
|
|
};
|
|
var replicateImpl = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill;
|
|
var length = function(xs) {
|
|
return xs.length;
|
|
};
|
|
var unconsImpl = function(empty7, next, xs) {
|
|
return xs.length === 0 ? empty7({}) : next(xs[0])(xs.slice(1));
|
|
};
|
|
var indexImpl = function(just, nothing, xs, i2) {
|
|
return i2 < 0 || i2 >= xs.length ? nothing : just(xs[i2]);
|
|
};
|
|
var findIndexImpl = function(just, nothing, f, xs) {
|
|
for (var i2 = 0, l = xs.length; i2 < l; i2++) {
|
|
if (f(xs[i2]))
|
|
return just(i2);
|
|
}
|
|
return nothing;
|
|
};
|
|
var _deleteAt = function(just, nothing, i2, l) {
|
|
if (i2 < 0 || i2 >= l.length)
|
|
return nothing;
|
|
var l1 = l.slice();
|
|
l1.splice(i2, 1);
|
|
return just(l1);
|
|
};
|
|
var sliceImpl = function(s, e, l) {
|
|
return l.slice(s, e);
|
|
};
|
|
|
|
// output/Data.Array.ST/foreign.js
|
|
function unsafeFreezeThawImpl(xs) {
|
|
return xs;
|
|
}
|
|
var unsafeFreezeImpl = unsafeFreezeThawImpl;
|
|
function copyImpl(xs) {
|
|
return xs.slice();
|
|
}
|
|
var thawImpl = copyImpl;
|
|
var pushImpl = function(a2, xs) {
|
|
return xs.push(a2);
|
|
};
|
|
|
|
// output/Control.Monad.ST.Uncurried/foreign.js
|
|
var runSTFn1 = function runSTFn12(fn) {
|
|
return function(a2) {
|
|
return function() {
|
|
return fn(a2);
|
|
};
|
|
};
|
|
};
|
|
var runSTFn2 = function runSTFn22(fn) {
|
|
return function(a2) {
|
|
return function(b2) {
|
|
return function() {
|
|
return fn(a2, b2);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Array.ST/index.js
|
|
var unsafeFreeze = /* @__PURE__ */ runSTFn1(unsafeFreezeImpl);
|
|
var thaw = /* @__PURE__ */ runSTFn1(thawImpl);
|
|
var withArray = function(f) {
|
|
return function(xs) {
|
|
return function __do2() {
|
|
var result = thaw(xs)();
|
|
f(result)();
|
|
return unsafeFreeze(result)();
|
|
};
|
|
};
|
|
};
|
|
var push = /* @__PURE__ */ runSTFn2(pushImpl);
|
|
|
|
// output/Data.Function.Uncurried/foreign.js
|
|
var runFn3 = function(fn) {
|
|
return function(a2) {
|
|
return function(b2) {
|
|
return function(c) {
|
|
return fn(a2, b2, c);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var runFn4 = function(fn) {
|
|
return function(a2) {
|
|
return function(b2) {
|
|
return function(c) {
|
|
return function(d) {
|
|
return fn(a2, b2, c, d);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.FunctorWithIndex/foreign.js
|
|
var mapWithIndexArray = function(f) {
|
|
return function(xs) {
|
|
var l = xs.length;
|
|
var result = Array(l);
|
|
for (var i2 = 0; i2 < l; i2++) {
|
|
result[i2] = f(i2)(xs[i2]);
|
|
}
|
|
return result;
|
|
};
|
|
};
|
|
|
|
// output/Data.FunctorWithIndex/index.js
|
|
var mapWithIndex = function(dict) {
|
|
return dict.mapWithIndex;
|
|
};
|
|
var functorWithIndexArray = {
|
|
mapWithIndex: mapWithIndexArray,
|
|
Functor0: function() {
|
|
return functorArray;
|
|
}
|
|
};
|
|
|
|
// output/Data.Array/index.js
|
|
var fromJust2 = /* @__PURE__ */ fromJust();
|
|
var append2 = /* @__PURE__ */ append(semigroupArray);
|
|
var uncons = /* @__PURE__ */ function() {
|
|
return runFn3(unconsImpl)($$const(Nothing.value))(function(x) {
|
|
return function(xs) {
|
|
return new Just({
|
|
head: x,
|
|
tail: xs
|
|
});
|
|
};
|
|
});
|
|
}();
|
|
var tail = /* @__PURE__ */ function() {
|
|
return runFn3(unconsImpl)($$const(Nothing.value))(function(v) {
|
|
return function(xs) {
|
|
return new Just(xs);
|
|
};
|
|
});
|
|
}();
|
|
var snoc = function(xs) {
|
|
return function(x) {
|
|
return withArray(push(x))(xs)();
|
|
};
|
|
};
|
|
var slice = /* @__PURE__ */ runFn3(sliceImpl);
|
|
var singleton2 = function(a2) {
|
|
return [a2];
|
|
};
|
|
var $$null = function(xs) {
|
|
return length(xs) === 0;
|
|
};
|
|
var init = function(xs) {
|
|
if ($$null(xs)) {
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return new Just(slice(0)(length(xs) - 1 | 0)(xs));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Array (line 351, column 1 - line 351, column 45): " + [xs.constructor.name]);
|
|
};
|
|
var index = /* @__PURE__ */ function() {
|
|
return runFn4(indexImpl)(Just.create)(Nothing.value);
|
|
}();
|
|
var last = function(xs) {
|
|
return index(xs)(length(xs) - 1 | 0);
|
|
};
|
|
var head = function(xs) {
|
|
return index(xs)(0);
|
|
};
|
|
var foldl2 = /* @__PURE__ */ foldl(foldableArray);
|
|
var findIndex = /* @__PURE__ */ function() {
|
|
return runFn4(findIndexImpl)(Just.create)(Nothing.value);
|
|
}();
|
|
var drop = function(n) {
|
|
return function(xs) {
|
|
var $173 = n < 1;
|
|
if ($173) {
|
|
return xs;
|
|
}
|
|
;
|
|
return slice(n)(length(xs))(xs);
|
|
};
|
|
};
|
|
var deleteAt = /* @__PURE__ */ function() {
|
|
return runFn4(_deleteAt)(Just.create)(Nothing.value);
|
|
}();
|
|
var deleteBy = function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2.length === 0) {
|
|
return [];
|
|
}
|
|
;
|
|
return maybe(v2)(function(i2) {
|
|
return fromJust2(deleteAt(i2)(v2));
|
|
})(findIndex(v(v1))(v2));
|
|
};
|
|
};
|
|
};
|
|
var cons = function(x) {
|
|
return function(xs) {
|
|
return append2([x])(xs);
|
|
};
|
|
};
|
|
var concatMap = /* @__PURE__ */ flip(/* @__PURE__ */ bind(bindArray));
|
|
var mapMaybe = function(f) {
|
|
return concatMap(function() {
|
|
var $189 = maybe([])(singleton2);
|
|
return function($190) {
|
|
return $189(f($190));
|
|
};
|
|
}());
|
|
};
|
|
|
|
// output/Data.FoldableWithIndex/index.js
|
|
var foldr8 = /* @__PURE__ */ foldr(foldableArray);
|
|
var mapWithIndex2 = /* @__PURE__ */ mapWithIndex(functorWithIndexArray);
|
|
var foldl8 = /* @__PURE__ */ foldl(foldableArray);
|
|
var foldrWithIndex = function(dict) {
|
|
return dict.foldrWithIndex;
|
|
};
|
|
var foldMapWithIndexDefaultR = function(dictFoldableWithIndex) {
|
|
var foldrWithIndex1 = foldrWithIndex(dictFoldableWithIndex);
|
|
return function(dictMonoid) {
|
|
var append9 = append(dictMonoid.Semigroup0());
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(f) {
|
|
return foldrWithIndex1(function(i2) {
|
|
return function(x) {
|
|
return function(acc) {
|
|
return append9(f(i2)(x))(acc);
|
|
};
|
|
};
|
|
})(mempty3);
|
|
};
|
|
};
|
|
};
|
|
var foldableWithIndexArray = {
|
|
foldrWithIndex: function(f) {
|
|
return function(z) {
|
|
var $291 = foldr8(function(v) {
|
|
return function(y) {
|
|
return f(v.value0)(v.value1)(y);
|
|
};
|
|
})(z);
|
|
var $292 = mapWithIndex2(Tuple.create);
|
|
return function($293) {
|
|
return $291($292($293));
|
|
};
|
|
};
|
|
},
|
|
foldlWithIndex: function(f) {
|
|
return function(z) {
|
|
var $294 = foldl8(function(y) {
|
|
return function(v) {
|
|
return f(v.value0)(y)(v.value1);
|
|
};
|
|
})(z);
|
|
var $295 = mapWithIndex2(Tuple.create);
|
|
return function($296) {
|
|
return $294($295($296));
|
|
};
|
|
};
|
|
},
|
|
foldMapWithIndex: function(dictMonoid) {
|
|
return foldMapWithIndexDefaultR(foldableWithIndexArray)(dictMonoid);
|
|
},
|
|
Foldable0: function() {
|
|
return foldableArray;
|
|
}
|
|
};
|
|
|
|
// output/Data.TraversableWithIndex/index.js
|
|
var traverseWithIndexDefault = function(dictTraversableWithIndex) {
|
|
var sequence2 = sequence(dictTraversableWithIndex.Traversable2());
|
|
var mapWithIndex4 = mapWithIndex(dictTraversableWithIndex.FunctorWithIndex0());
|
|
return function(dictApplicative) {
|
|
var sequence12 = sequence2(dictApplicative);
|
|
return function(f) {
|
|
var $174 = mapWithIndex4(f);
|
|
return function($175) {
|
|
return sequence12($174($175));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var traverseWithIndex = function(dict) {
|
|
return dict.traverseWithIndex;
|
|
};
|
|
var traversableWithIndexArray = {
|
|
traverseWithIndex: function(dictApplicative) {
|
|
return traverseWithIndexDefault(traversableWithIndexArray)(dictApplicative);
|
|
},
|
|
FunctorWithIndex0: function() {
|
|
return functorWithIndexArray;
|
|
},
|
|
FoldableWithIndex1: function() {
|
|
return foldableWithIndexArray;
|
|
},
|
|
Traversable2: function() {
|
|
return traversableArray;
|
|
}
|
|
};
|
|
|
|
// output/Foreign.Object.ST/foreign.js
|
|
var newImpl = function() {
|
|
return {};
|
|
};
|
|
function poke2(k) {
|
|
return function(v) {
|
|
return function(m) {
|
|
return function() {
|
|
m[k] = v;
|
|
return m;
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Foreign.Object/index.js
|
|
var foldr2 = /* @__PURE__ */ foldr(foldableArray);
|
|
var identity8 = /* @__PURE__ */ identity(categoryFn);
|
|
var values = /* @__PURE__ */ toArrayWithKey(function(v) {
|
|
return function(v1) {
|
|
return v1;
|
|
};
|
|
});
|
|
var thawST = _copyST;
|
|
var mutate = function(f) {
|
|
return function(m) {
|
|
return runST(function __do2() {
|
|
var s = thawST(m)();
|
|
f(s)();
|
|
return s;
|
|
});
|
|
};
|
|
};
|
|
var mapWithKey = function(f) {
|
|
return function(m) {
|
|
return _mapWithKey(m, f);
|
|
};
|
|
};
|
|
var lookup = /* @__PURE__ */ function() {
|
|
return runFn4(_lookup)(Nothing.value)(Just.create);
|
|
}();
|
|
var insert = function(k) {
|
|
return function(v) {
|
|
return mutate(poke2(k)(v));
|
|
};
|
|
};
|
|
var functorObject = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
return _fmapObject(m, f);
|
|
};
|
|
}
|
|
};
|
|
var functorWithIndexObject = {
|
|
mapWithIndex: mapWithKey,
|
|
Functor0: function() {
|
|
return functorObject;
|
|
}
|
|
};
|
|
var fold2 = /* @__PURE__ */ _foldM(applyFlipped);
|
|
var foldMap2 = function(dictMonoid) {
|
|
var append12 = append(dictMonoid.Semigroup0());
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(f) {
|
|
return fold2(function(acc) {
|
|
return function(k) {
|
|
return function(v) {
|
|
return append12(acc)(f(k)(v));
|
|
};
|
|
};
|
|
})(mempty3);
|
|
};
|
|
};
|
|
var foldableObject = {
|
|
foldl: function(f) {
|
|
return fold2(function(z) {
|
|
return function(v) {
|
|
return f(z);
|
|
};
|
|
});
|
|
},
|
|
foldr: function(f) {
|
|
return function(z) {
|
|
return function(m) {
|
|
return foldr2(f)(z)(values(m));
|
|
};
|
|
};
|
|
},
|
|
foldMap: function(dictMonoid) {
|
|
var foldMap12 = foldMap2(dictMonoid);
|
|
return function(f) {
|
|
return foldMap12($$const(f));
|
|
};
|
|
}
|
|
};
|
|
var foldableWithIndexObject = {
|
|
foldlWithIndex: function(f) {
|
|
return fold2(flip(f));
|
|
},
|
|
foldrWithIndex: function(f) {
|
|
return function(z) {
|
|
return function(m) {
|
|
return foldr2(uncurry(f))(z)(toArrayWithKey(Tuple.create)(m));
|
|
};
|
|
};
|
|
},
|
|
foldMapWithIndex: function(dictMonoid) {
|
|
return foldMap2(dictMonoid);
|
|
},
|
|
Foldable0: function() {
|
|
return foldableObject;
|
|
}
|
|
};
|
|
var traversableWithIndexObject = {
|
|
traverseWithIndex: function(dictApplicative) {
|
|
var Apply0 = dictApplicative.Apply0();
|
|
var apply6 = apply(Apply0);
|
|
var map41 = map(Apply0.Functor0());
|
|
var pure111 = pure(dictApplicative);
|
|
return function(f) {
|
|
return function(ms) {
|
|
return fold2(function(acc) {
|
|
return function(k) {
|
|
return function(v) {
|
|
return apply6(map41(flip(insert(k)))(acc))(f(k)(v));
|
|
};
|
|
};
|
|
})(pure111(empty2))(ms);
|
|
};
|
|
};
|
|
},
|
|
FunctorWithIndex0: function() {
|
|
return functorWithIndexObject;
|
|
},
|
|
FoldableWithIndex1: function() {
|
|
return foldableWithIndexObject;
|
|
},
|
|
Traversable2: function() {
|
|
return traversableObject;
|
|
}
|
|
};
|
|
var traversableObject = {
|
|
traverse: function(dictApplicative) {
|
|
var $96 = traverseWithIndex(traversableWithIndexObject)(dictApplicative);
|
|
return function($97) {
|
|
return $96($$const($97));
|
|
};
|
|
},
|
|
sequence: function(dictApplicative) {
|
|
return traverse(traversableObject)(dictApplicative)(identity8);
|
|
},
|
|
Functor0: function() {
|
|
return functorObject;
|
|
},
|
|
Foldable1: function() {
|
|
return foldableObject;
|
|
}
|
|
};
|
|
|
|
// output/Data.Argonaut.Core/index.js
|
|
var verbJsonType = function(def) {
|
|
return function(f) {
|
|
return function(g) {
|
|
return g(def)(f);
|
|
};
|
|
};
|
|
};
|
|
var toJsonType = /* @__PURE__ */ function() {
|
|
return verbJsonType(Nothing.value)(Just.create);
|
|
}();
|
|
var jsonEmptyObject = /* @__PURE__ */ id(empty2);
|
|
var isJsonType = /* @__PURE__ */ verbJsonType(false)(/* @__PURE__ */ $$const(true));
|
|
var caseJsonString = function(d) {
|
|
return function(f) {
|
|
return function(j) {
|
|
return _caseJson($$const(d), $$const(d), $$const(d), f, $$const(d), $$const(d), j);
|
|
};
|
|
};
|
|
};
|
|
var caseJsonObject = function(d) {
|
|
return function(f) {
|
|
return function(j) {
|
|
return _caseJson($$const(d), $$const(d), $$const(d), $$const(d), $$const(d), f, j);
|
|
};
|
|
};
|
|
};
|
|
var toObject = /* @__PURE__ */ toJsonType(caseJsonObject);
|
|
var caseJsonNull = function(d) {
|
|
return function(f) {
|
|
return function(j) {
|
|
return _caseJson(f, $$const(d), $$const(d), $$const(d), $$const(d), $$const(d), j);
|
|
};
|
|
};
|
|
};
|
|
var isNull = /* @__PURE__ */ isJsonType(caseJsonNull);
|
|
|
|
// output/Data.Argonaut.Decode.Error/index.js
|
|
var show2 = /* @__PURE__ */ show(showString);
|
|
var show1 = /* @__PURE__ */ show(showInt);
|
|
var TypeMismatch = /* @__PURE__ */ function() {
|
|
function TypeMismatch3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
TypeMismatch3.create = function(value0) {
|
|
return new TypeMismatch3(value0);
|
|
};
|
|
return TypeMismatch3;
|
|
}();
|
|
var UnexpectedValue = /* @__PURE__ */ function() {
|
|
function UnexpectedValue2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
UnexpectedValue2.create = function(value0) {
|
|
return new UnexpectedValue2(value0);
|
|
};
|
|
return UnexpectedValue2;
|
|
}();
|
|
var AtIndex = /* @__PURE__ */ function() {
|
|
function AtIndex2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
AtIndex2.create = function(value0) {
|
|
return function(value1) {
|
|
return new AtIndex2(value0, value1);
|
|
};
|
|
};
|
|
return AtIndex2;
|
|
}();
|
|
var AtKey = /* @__PURE__ */ function() {
|
|
function AtKey2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
AtKey2.create = function(value0) {
|
|
return function(value1) {
|
|
return new AtKey2(value0, value1);
|
|
};
|
|
};
|
|
return AtKey2;
|
|
}();
|
|
var Named = /* @__PURE__ */ function() {
|
|
function Named2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Named2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Named2(value0, value1);
|
|
};
|
|
};
|
|
return Named2;
|
|
}();
|
|
var MissingValue = /* @__PURE__ */ function() {
|
|
function MissingValue2() {
|
|
}
|
|
;
|
|
MissingValue2.value = new MissingValue2();
|
|
return MissingValue2;
|
|
}();
|
|
var showJsonDecodeError = {
|
|
show: function(v) {
|
|
if (v instanceof TypeMismatch) {
|
|
return "(TypeMismatch " + (show2(v.value0) + ")");
|
|
}
|
|
;
|
|
if (v instanceof UnexpectedValue) {
|
|
return "(UnexpectedValue " + (stringify(v.value0) + ")");
|
|
}
|
|
;
|
|
if (v instanceof AtIndex) {
|
|
return "(AtIndex " + (show1(v.value0) + (" " + (show(showJsonDecodeError)(v.value1) + ")")));
|
|
}
|
|
;
|
|
if (v instanceof AtKey) {
|
|
return "(AtKey " + (show2(v.value0) + (" " + (show(showJsonDecodeError)(v.value1) + ")")));
|
|
}
|
|
;
|
|
if (v instanceof Named) {
|
|
return "(Named " + (show2(v.value0) + (" " + (show(showJsonDecodeError)(v.value1) + ")")));
|
|
}
|
|
;
|
|
if (v instanceof MissingValue) {
|
|
return "MissingValue";
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Argonaut.Decode.Error (line 24, column 10 - line 30, column 35): " + [v.constructor.name]);
|
|
}
|
|
};
|
|
|
|
// output/Data.Array.NonEmpty.Internal/index.js
|
|
var NonEmptyArray = function(x) {
|
|
return x;
|
|
};
|
|
var semigroupNonEmptyArray = semigroupArray;
|
|
var functorNonEmptyArray = functorArray;
|
|
var foldableNonEmptyArray = foldableArray;
|
|
|
|
// output/Data.NonEmpty/index.js
|
|
var NonEmpty = /* @__PURE__ */ function() {
|
|
function NonEmpty2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
NonEmpty2.create = function(value0) {
|
|
return function(value1) {
|
|
return new NonEmpty2(value0, value1);
|
|
};
|
|
};
|
|
return NonEmpty2;
|
|
}();
|
|
var singleton4 = function(dictPlus) {
|
|
var empty7 = empty(dictPlus);
|
|
return function(a2) {
|
|
return new NonEmpty(a2, empty7);
|
|
};
|
|
};
|
|
var showNonEmpty = function(dictShow) {
|
|
var show7 = show(dictShow);
|
|
return function(dictShow1) {
|
|
var show15 = show(dictShow1);
|
|
return {
|
|
show: function(v) {
|
|
return "(NonEmpty " + (show7(v.value0) + (" " + (show15(v.value1) + ")")));
|
|
}
|
|
};
|
|
};
|
|
};
|
|
var functorNonEmpty = function(dictFunctor) {
|
|
var map212 = map(dictFunctor);
|
|
return {
|
|
map: function(f) {
|
|
return function(m) {
|
|
return new NonEmpty(f(m.value0), map212(f)(m.value1));
|
|
};
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/Data.Array.NonEmpty/index.js
|
|
var fromJust3 = /* @__PURE__ */ fromJust();
|
|
var unsafeFromArray = NonEmptyArray;
|
|
var toArray = function(v) {
|
|
return v;
|
|
};
|
|
var snoc$prime = function(xs) {
|
|
return function(x) {
|
|
return unsafeFromArray(snoc(xs)(x));
|
|
};
|
|
};
|
|
var snoc2 = function(xs) {
|
|
return function(x) {
|
|
return unsafeFromArray(snoc(toArray(xs))(x));
|
|
};
|
|
};
|
|
var singleton5 = function($110) {
|
|
return unsafeFromArray(singleton2($110));
|
|
};
|
|
var fromArray = function(xs) {
|
|
if (length(xs) > 0) {
|
|
return new Just(unsafeFromArray(xs));
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Array.NonEmpty (line 161, column 1 - line 161, column 58): " + [xs.constructor.name]);
|
|
};
|
|
var cons$prime = function(x) {
|
|
return function(xs) {
|
|
return unsafeFromArray(cons(x)(xs));
|
|
};
|
|
};
|
|
var adaptMaybe = function(f) {
|
|
return function($126) {
|
|
return fromJust3(f(toArray($126)));
|
|
};
|
|
};
|
|
var head2 = /* @__PURE__ */ adaptMaybe(head);
|
|
var init2 = /* @__PURE__ */ adaptMaybe(init);
|
|
var last2 = /* @__PURE__ */ adaptMaybe(last);
|
|
var tail2 = /* @__PURE__ */ adaptMaybe(tail);
|
|
var adaptAny = function(f) {
|
|
return function($128) {
|
|
return f(toArray($128));
|
|
};
|
|
};
|
|
var unsafeAdapt = function(f) {
|
|
var $129 = adaptAny(f);
|
|
return function($130) {
|
|
return unsafeFromArray($129($130));
|
|
};
|
|
};
|
|
var cons2 = function(x) {
|
|
return unsafeAdapt(cons(x));
|
|
};
|
|
|
|
// output/Data.Int/foreign.js
|
|
var fromNumberImpl = function(just) {
|
|
return function(nothing) {
|
|
return function(n) {
|
|
return (n | 0) === n ? just(n) : nothing;
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Int/index.js
|
|
var fromNumber = /* @__PURE__ */ function() {
|
|
return fromNumberImpl(Just.create)(Nothing.value);
|
|
}();
|
|
|
|
// output/Data.List.Types/index.js
|
|
var Nil = /* @__PURE__ */ function() {
|
|
function Nil3() {
|
|
}
|
|
;
|
|
Nil3.value = new Nil3();
|
|
return Nil3;
|
|
}();
|
|
var Cons = /* @__PURE__ */ function() {
|
|
function Cons3(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Cons3.create = function(value0) {
|
|
return function(value1) {
|
|
return new Cons3(value0, value1);
|
|
};
|
|
};
|
|
return Cons3;
|
|
}();
|
|
var NonEmptyList = function(x) {
|
|
return x;
|
|
};
|
|
var toList = function(v) {
|
|
return new Cons(v.value0, v.value1);
|
|
};
|
|
var listMap = function(f) {
|
|
var chunkedRevMap = function($copy_v) {
|
|
return function($copy_v1) {
|
|
var $tco_var_v = $copy_v;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v, v1) {
|
|
if (v1 instanceof Cons && (v1.value1 instanceof Cons && v1.value1.value1 instanceof Cons)) {
|
|
$tco_var_v = new Cons(v1, v);
|
|
$copy_v1 = v1.value1.value1.value1;
|
|
return;
|
|
}
|
|
;
|
|
var unrolledMap = function(v2) {
|
|
if (v2 instanceof Cons && (v2.value1 instanceof Cons && v2.value1.value1 instanceof Nil)) {
|
|
return new Cons(f(v2.value0), new Cons(f(v2.value1.value0), Nil.value));
|
|
}
|
|
;
|
|
if (v2 instanceof Cons && v2.value1 instanceof Nil) {
|
|
return new Cons(f(v2.value0), Nil.value);
|
|
}
|
|
;
|
|
return Nil.value;
|
|
};
|
|
var reverseUnrolledMap = function($copy_v2) {
|
|
return function($copy_v3) {
|
|
var $tco_var_v2 = $copy_v2;
|
|
var $tco_done1 = false;
|
|
var $tco_result2;
|
|
function $tco_loop2(v2, v3) {
|
|
if (v2 instanceof Cons && (v2.value0 instanceof Cons && (v2.value0.value1 instanceof Cons && v2.value0.value1.value1 instanceof Cons))) {
|
|
$tco_var_v2 = v2.value1;
|
|
$copy_v3 = new Cons(f(v2.value0.value0), new Cons(f(v2.value0.value1.value0), new Cons(f(v2.value0.value1.value1.value0), v3)));
|
|
return;
|
|
}
|
|
;
|
|
$tco_done1 = true;
|
|
return v3;
|
|
}
|
|
;
|
|
while (!$tco_done1) {
|
|
$tco_result2 = $tco_loop2($tco_var_v2, $copy_v3);
|
|
}
|
|
;
|
|
return $tco_result2;
|
|
};
|
|
};
|
|
$tco_done = true;
|
|
return reverseUnrolledMap(v)(unrolledMap(v1));
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_v, $copy_v1);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return chunkedRevMap(Nil.value);
|
|
};
|
|
var functorList = {
|
|
map: listMap
|
|
};
|
|
var map8 = /* @__PURE__ */ map(functorList);
|
|
var functorNonEmptyList = /* @__PURE__ */ functorNonEmpty(functorList);
|
|
var foldableList = {
|
|
foldr: function(f) {
|
|
return function(b2) {
|
|
var rev3 = function() {
|
|
var go2 = function($copy_v) {
|
|
return function($copy_v1) {
|
|
var $tco_var_v = $copy_v;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v, v1) {
|
|
if (v1 instanceof Nil) {
|
|
$tco_done = true;
|
|
return v;
|
|
}
|
|
;
|
|
if (v1 instanceof Cons) {
|
|
$tco_var_v = new Cons(v1.value0, v);
|
|
$copy_v1 = v1.value1;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.List.Types (line 107, column 7 - line 107, column 23): " + [v.constructor.name, v1.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_v, $copy_v1);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go2(Nil.value);
|
|
}();
|
|
var $284 = foldl(foldableList)(flip(f))(b2);
|
|
return function($285) {
|
|
return $284(rev3($285));
|
|
};
|
|
};
|
|
},
|
|
foldl: function(f) {
|
|
var go2 = function($copy_b) {
|
|
return function($copy_v) {
|
|
var $tco_var_b = $copy_b;
|
|
var $tco_done1 = false;
|
|
var $tco_result;
|
|
function $tco_loop(b2, v) {
|
|
if (v instanceof Nil) {
|
|
$tco_done1 = true;
|
|
return b2;
|
|
}
|
|
;
|
|
if (v instanceof Cons) {
|
|
$tco_var_b = f(b2)(v.value0);
|
|
$copy_v = v.value1;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.List.Types (line 111, column 12 - line 113, column 30): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done1) {
|
|
$tco_result = $tco_loop($tco_var_b, $copy_v);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go2;
|
|
},
|
|
foldMap: function(dictMonoid) {
|
|
var append22 = append(dictMonoid.Semigroup0());
|
|
var mempty3 = mempty(dictMonoid);
|
|
return function(f) {
|
|
return foldl(foldableList)(function(acc) {
|
|
var $286 = append22(acc);
|
|
return function($287) {
|
|
return $286(f($287));
|
|
};
|
|
})(mempty3);
|
|
};
|
|
}
|
|
};
|
|
var foldr3 = /* @__PURE__ */ foldr(foldableList);
|
|
var intercalate3 = /* @__PURE__ */ intercalate(foldableList)(monoidString);
|
|
var semigroupList = {
|
|
append: function(xs) {
|
|
return function(ys) {
|
|
return foldr3(Cons.create)(ys)(xs);
|
|
};
|
|
}
|
|
};
|
|
var append1 = /* @__PURE__ */ append(semigroupList);
|
|
var semigroupNonEmptyList = {
|
|
append: function(v) {
|
|
return function(as$prime) {
|
|
return new NonEmpty(v.value0, append1(v.value1)(toList(as$prime)));
|
|
};
|
|
}
|
|
};
|
|
var showList = function(dictShow) {
|
|
var show7 = show(dictShow);
|
|
return {
|
|
show: function(v) {
|
|
if (v instanceof Nil) {
|
|
return "Nil";
|
|
}
|
|
;
|
|
return "(" + (intercalate3(" : ")(map8(show7)(v)) + " : Nil)");
|
|
}
|
|
};
|
|
};
|
|
var showNonEmptyList = function(dictShow) {
|
|
var show7 = show(showNonEmpty(dictShow)(showList(dictShow)));
|
|
return {
|
|
show: function(v) {
|
|
return "(NonEmptyList " + (show7(v) + ")");
|
|
}
|
|
};
|
|
};
|
|
var applyList = {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Nil) {
|
|
return Nil.value;
|
|
}
|
|
;
|
|
if (v instanceof Cons) {
|
|
return append1(map8(v.value0)(v1))(apply(applyList)(v.value1)(v1));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.List.Types (line 157, column 1 - line 159, column 48): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorList;
|
|
}
|
|
};
|
|
var apply2 = /* @__PURE__ */ apply(applyList);
|
|
var applyNonEmptyList = {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
return new NonEmpty(v.value0(v1.value0), append1(apply2(v.value1)(new Cons(v1.value0, Nil.value)))(apply2(new Cons(v.value0, v.value1))(v1.value1)));
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorNonEmptyList;
|
|
}
|
|
};
|
|
var altList = {
|
|
alt: append1,
|
|
Functor0: function() {
|
|
return functorList;
|
|
}
|
|
};
|
|
var plusList = /* @__PURE__ */ function() {
|
|
return {
|
|
empty: Nil.value,
|
|
Alt0: function() {
|
|
return altList;
|
|
}
|
|
};
|
|
}();
|
|
var applicativeNonEmptyList = {
|
|
pure: /* @__PURE__ */ function() {
|
|
var $315 = singleton4(plusList);
|
|
return function($316) {
|
|
return NonEmptyList($315($316));
|
|
};
|
|
}(),
|
|
Apply0: function() {
|
|
return applyNonEmptyList;
|
|
}
|
|
};
|
|
|
|
// output/Data.List/index.js
|
|
var reverse2 = /* @__PURE__ */ function() {
|
|
var go2 = function($copy_v) {
|
|
return function($copy_v1) {
|
|
var $tco_var_v = $copy_v;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v, v1) {
|
|
if (v1 instanceof Nil) {
|
|
$tco_done = true;
|
|
return v;
|
|
}
|
|
;
|
|
if (v1 instanceof Cons) {
|
|
$tco_var_v = new Cons(v1.value0, v);
|
|
$copy_v1 = v1.value1;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.List (line 368, column 3 - line 368, column 19): " + [v.constructor.name, v1.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_v, $copy_v1);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go2(Nil.value);
|
|
}();
|
|
var $$null2 = function(v) {
|
|
if (v instanceof Nil) {
|
|
return true;
|
|
}
|
|
;
|
|
return false;
|
|
};
|
|
|
|
// output/Data.List.NonEmpty/index.js
|
|
var singleton6 = /* @__PURE__ */ function() {
|
|
var $200 = singleton4(plusList);
|
|
return function($201) {
|
|
return NonEmptyList($200($201));
|
|
};
|
|
}();
|
|
var head3 = function(v) {
|
|
return v.value0;
|
|
};
|
|
var cons3 = function(y) {
|
|
return function(v) {
|
|
return new NonEmpty(y, new Cons(v.value0, v.value1));
|
|
};
|
|
};
|
|
|
|
// output/Data.Map.Internal/index.js
|
|
var $runtime_lazy3 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var map9 = /* @__PURE__ */ map(functorMaybe);
|
|
var Leaf = /* @__PURE__ */ function() {
|
|
function Leaf2() {
|
|
}
|
|
;
|
|
Leaf2.value = new Leaf2();
|
|
return Leaf2;
|
|
}();
|
|
var Node = /* @__PURE__ */ function() {
|
|
function Node2(value0, value1, value22, value32, value42, value52) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
this.value3 = value32;
|
|
this.value4 = value42;
|
|
this.value5 = value52;
|
|
}
|
|
;
|
|
Node2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return function(value32) {
|
|
return function(value42) {
|
|
return function(value52) {
|
|
return new Node2(value0, value1, value22, value32, value42, value52);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Node2;
|
|
}();
|
|
var Split = /* @__PURE__ */ function() {
|
|
function Split2(value0, value1, value22) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
}
|
|
;
|
|
Split2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return new Split2(value0, value1, value22);
|
|
};
|
|
};
|
|
};
|
|
return Split2;
|
|
}();
|
|
var SplitLast = /* @__PURE__ */ function() {
|
|
function SplitLast2(value0, value1, value22) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
}
|
|
;
|
|
SplitLast2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return new SplitLast2(value0, value1, value22);
|
|
};
|
|
};
|
|
};
|
|
return SplitLast2;
|
|
}();
|
|
var unsafeNode = function(k, v, l, r) {
|
|
if (l instanceof Leaf) {
|
|
if (r instanceof Leaf) {
|
|
return new Node(1, 1, k, v, l, r);
|
|
}
|
|
;
|
|
if (r instanceof Node) {
|
|
return new Node(1 + r.value0 | 0, 1 + r.value1 | 0, k, v, l, r);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 680, column 5 - line 684, column 39): " + [r.constructor.name]);
|
|
}
|
|
;
|
|
if (l instanceof Node) {
|
|
if (r instanceof Leaf) {
|
|
return new Node(1 + l.value0 | 0, 1 + l.value1 | 0, k, v, l, r);
|
|
}
|
|
;
|
|
if (r instanceof Node) {
|
|
return new Node(1 + function() {
|
|
var $277 = l.value0 > r.value0;
|
|
if ($277) {
|
|
return l.value0;
|
|
}
|
|
;
|
|
return r.value0;
|
|
}() | 0, (1 + l.value1 | 0) + r.value1 | 0, k, v, l, r);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 686, column 5 - line 690, column 68): " + [r.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 678, column 32 - line 690, column 68): " + [l.constructor.name]);
|
|
};
|
|
var singleton7 = function(k) {
|
|
return function(v) {
|
|
return new Node(1, 1, k, v, Leaf.value, Leaf.value);
|
|
};
|
|
};
|
|
var unsafeBalancedNode = /* @__PURE__ */ function() {
|
|
var height8 = function(v) {
|
|
if (v instanceof Leaf) {
|
|
return 0;
|
|
}
|
|
;
|
|
if (v instanceof Node) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 735, column 12 - line 737, column 26): " + [v.constructor.name]);
|
|
};
|
|
var rotateLeft = function(k, v, l, rk, rv, rl, rr) {
|
|
if (rl instanceof Node && rl.value0 > height8(rr)) {
|
|
return unsafeNode(rl.value2, rl.value3, unsafeNode(k, v, l, rl.value4), unsafeNode(rk, rv, rl.value5, rr));
|
|
}
|
|
;
|
|
return unsafeNode(rk, rv, unsafeNode(k, v, l, rl), rr);
|
|
};
|
|
var rotateRight = function(k, v, lk, lv, ll, lr, r) {
|
|
if (lr instanceof Node && height8(ll) <= lr.value0) {
|
|
return unsafeNode(lr.value2, lr.value3, unsafeNode(lk, lv, ll, lr.value4), unsafeNode(k, v, lr.value5, r));
|
|
}
|
|
;
|
|
return unsafeNode(lk, lv, ll, unsafeNode(k, v, lr, r));
|
|
};
|
|
return function(k, v, l, r) {
|
|
if (l instanceof Leaf) {
|
|
if (r instanceof Leaf) {
|
|
return singleton7(k)(v);
|
|
}
|
|
;
|
|
if (r instanceof Node && r.value0 > 1) {
|
|
return rotateLeft(k, v, l, r.value2, r.value3, r.value4, r.value5);
|
|
}
|
|
;
|
|
return unsafeNode(k, v, l, r);
|
|
}
|
|
;
|
|
if (l instanceof Node) {
|
|
if (r instanceof Node) {
|
|
if (r.value0 > (l.value0 + 1 | 0)) {
|
|
return rotateLeft(k, v, l, r.value2, r.value3, r.value4, r.value5);
|
|
}
|
|
;
|
|
if (l.value0 > (r.value0 + 1 | 0)) {
|
|
return rotateRight(k, v, l.value2, l.value3, l.value4, l.value5, r);
|
|
}
|
|
;
|
|
}
|
|
;
|
|
if (r instanceof Leaf && l.value0 > 1) {
|
|
return rotateRight(k, v, l.value2, l.value3, l.value4, l.value5, r);
|
|
}
|
|
;
|
|
return unsafeNode(k, v, l, r);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 695, column 40 - line 716, column 34): " + [l.constructor.name]);
|
|
};
|
|
}();
|
|
var $lazy_unsafeSplit = /* @__PURE__ */ $runtime_lazy3("unsafeSplit", "Data.Map.Internal", function() {
|
|
return function(comp, k, m) {
|
|
if (m instanceof Leaf) {
|
|
return new Split(Nothing.value, Leaf.value, Leaf.value);
|
|
}
|
|
;
|
|
if (m instanceof Node) {
|
|
var v = comp(k)(m.value2);
|
|
if (v instanceof LT) {
|
|
var v1 = $lazy_unsafeSplit(771)(comp, k, m.value4);
|
|
return new Split(v1.value0, v1.value1, unsafeBalancedNode(m.value2, m.value3, v1.value2, m.value5));
|
|
}
|
|
;
|
|
if (v instanceof GT) {
|
|
var v1 = $lazy_unsafeSplit(774)(comp, k, m.value5);
|
|
return new Split(v1.value0, unsafeBalancedNode(m.value2, m.value3, m.value4, v1.value1), v1.value2);
|
|
}
|
|
;
|
|
if (v instanceof EQ) {
|
|
return new Split(new Just(m.value3), m.value4, m.value5);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 769, column 5 - line 777, column 30): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 765, column 34 - line 777, column 30): " + [m.constructor.name]);
|
|
};
|
|
});
|
|
var unsafeSplit = /* @__PURE__ */ $lazy_unsafeSplit(764);
|
|
var $lazy_unsafeSplitLast = /* @__PURE__ */ $runtime_lazy3("unsafeSplitLast", "Data.Map.Internal", function() {
|
|
return function(k, v, l, r) {
|
|
if (r instanceof Leaf) {
|
|
return new SplitLast(k, v, l);
|
|
}
|
|
;
|
|
if (r instanceof Node) {
|
|
var v1 = $lazy_unsafeSplitLast(757)(r.value2, r.value3, r.value4, r.value5);
|
|
return new SplitLast(v1.value0, v1.value1, unsafeBalancedNode(k, v, l, v1.value2));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 754, column 37 - line 758, column 57): " + [r.constructor.name]);
|
|
};
|
|
});
|
|
var unsafeSplitLast = /* @__PURE__ */ $lazy_unsafeSplitLast(753);
|
|
var unsafeJoinNodes = function(v, v1) {
|
|
if (v instanceof Leaf) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v instanceof Node) {
|
|
var v2 = unsafeSplitLast(v.value2, v.value3, v.value4, v.value5);
|
|
return unsafeBalancedNode(v2.value0, v2.value1, v2.value2, v1);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 742, column 25 - line 746, column 38): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
var pop = function(dictOrd) {
|
|
var compare2 = compare(dictOrd);
|
|
return function(k) {
|
|
return function(m) {
|
|
var v = unsafeSplit(compare2, k, m);
|
|
return map9(function(a2) {
|
|
return new Tuple(a2, unsafeJoinNodes(v.value1, v.value2));
|
|
})(v.value0);
|
|
};
|
|
};
|
|
};
|
|
var lookup2 = function(dictOrd) {
|
|
var compare2 = compare(dictOrd);
|
|
return function(k) {
|
|
var go2 = function($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
if (v instanceof Leaf) {
|
|
$tco_done = true;
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
if (v instanceof Node) {
|
|
var v1 = compare2(k)(v.value2);
|
|
if (v1 instanceof LT) {
|
|
$copy_v = v.value4;
|
|
return;
|
|
}
|
|
;
|
|
if (v1 instanceof GT) {
|
|
$copy_v = v.value5;
|
|
return;
|
|
}
|
|
;
|
|
if (v1 instanceof EQ) {
|
|
$tco_done = true;
|
|
return new Just(v.value3);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 281, column 7 - line 284, column 22): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 278, column 8 - line 284, column 22): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
return go2;
|
|
};
|
|
};
|
|
var insert3 = function(dictOrd) {
|
|
var compare2 = compare(dictOrd);
|
|
return function(k) {
|
|
return function(v) {
|
|
var go2 = function(v1) {
|
|
if (v1 instanceof Leaf) {
|
|
return singleton7(k)(v);
|
|
}
|
|
;
|
|
if (v1 instanceof Node) {
|
|
var v2 = compare2(k)(v1.value2);
|
|
if (v2 instanceof LT) {
|
|
return unsafeBalancedNode(v1.value2, v1.value3, go2(v1.value4), v1.value5);
|
|
}
|
|
;
|
|
if (v2 instanceof GT) {
|
|
return unsafeBalancedNode(v1.value2, v1.value3, v1.value4, go2(v1.value5));
|
|
}
|
|
;
|
|
if (v2 instanceof EQ) {
|
|
return new Node(v1.value0, v1.value1, k, v, v1.value4, v1.value5);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 469, column 7 - line 472, column 35): " + [v2.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 466, column 8 - line 472, column 35): " + [v1.constructor.name]);
|
|
};
|
|
return go2;
|
|
};
|
|
};
|
|
};
|
|
var foldableMap = {
|
|
foldr: function(f) {
|
|
return function(z) {
|
|
var $lazy_go = $runtime_lazy3("go", "Data.Map.Internal", function() {
|
|
return function(m$prime, z$prime) {
|
|
if (m$prime instanceof Leaf) {
|
|
return z$prime;
|
|
}
|
|
;
|
|
if (m$prime instanceof Node) {
|
|
return $lazy_go(170)(m$prime.value4, f(m$prime.value3)($lazy_go(170)(m$prime.value5, z$prime)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 167, column 26 - line 170, column 43): " + [m$prime.constructor.name]);
|
|
};
|
|
});
|
|
var go2 = $lazy_go(167);
|
|
return function(m) {
|
|
return go2(m, z);
|
|
};
|
|
};
|
|
},
|
|
foldl: function(f) {
|
|
return function(z) {
|
|
var $lazy_go = $runtime_lazy3("go", "Data.Map.Internal", function() {
|
|
return function(z$prime, m$prime) {
|
|
if (m$prime instanceof Leaf) {
|
|
return z$prime;
|
|
}
|
|
;
|
|
if (m$prime instanceof Node) {
|
|
return $lazy_go(176)(f($lazy_go(176)(z$prime, m$prime.value4))(m$prime.value3), m$prime.value5);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 173, column 26 - line 176, column 43): " + [m$prime.constructor.name]);
|
|
};
|
|
});
|
|
var go2 = $lazy_go(173);
|
|
return function(m) {
|
|
return go2(z, m);
|
|
};
|
|
};
|
|
},
|
|
foldMap: function(dictMonoid) {
|
|
var mempty3 = mempty(dictMonoid);
|
|
var append12 = append(dictMonoid.Semigroup0());
|
|
return function(f) {
|
|
var go2 = function(v) {
|
|
if (v instanceof Leaf) {
|
|
return mempty3;
|
|
}
|
|
;
|
|
if (v instanceof Node) {
|
|
return append12(go2(v.value4))(append12(f(v.value3))(go2(v.value5)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 179, column 10 - line 182, column 28): " + [v.constructor.name]);
|
|
};
|
|
return go2;
|
|
};
|
|
}
|
|
};
|
|
var empty3 = /* @__PURE__ */ function() {
|
|
return Leaf.value;
|
|
}();
|
|
var $$delete2 = function(dictOrd) {
|
|
var compare2 = compare(dictOrd);
|
|
return function(k) {
|
|
var go2 = function(v) {
|
|
if (v instanceof Leaf) {
|
|
return Leaf.value;
|
|
}
|
|
;
|
|
if (v instanceof Node) {
|
|
var v1 = compare2(k)(v.value2);
|
|
if (v1 instanceof LT) {
|
|
return unsafeBalancedNode(v.value2, v.value3, go2(v.value4), v.value5);
|
|
}
|
|
;
|
|
if (v1 instanceof GT) {
|
|
return unsafeBalancedNode(v.value2, v.value3, v.value4, go2(v.value5));
|
|
}
|
|
;
|
|
if (v1 instanceof EQ) {
|
|
return unsafeJoinNodes(v.value4, v.value5);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 496, column 7 - line 499, column 43): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 493, column 8 - line 499, column 43): " + [v.constructor.name]);
|
|
};
|
|
return go2;
|
|
};
|
|
};
|
|
var alter = function(dictOrd) {
|
|
var compare2 = compare(dictOrd);
|
|
return function(f) {
|
|
return function(k) {
|
|
return function(m) {
|
|
var v = unsafeSplit(compare2, k, m);
|
|
var v2 = f(v.value0);
|
|
if (v2 instanceof Nothing) {
|
|
return unsafeJoinNodes(v.value1, v.value2);
|
|
}
|
|
;
|
|
if (v2 instanceof Just) {
|
|
return unsafeBalancedNode(k, v2.value0, v.value1, v.value2);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Map.Internal (line 512, column 3 - line 516, column 41): " + [v2.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.String.CodePoints/foreign.js
|
|
var hasArrayFrom = typeof Array.from === "function";
|
|
var hasStringIterator = typeof Symbol !== "undefined" && Symbol != null && typeof Symbol.iterator !== "undefined" && typeof String.prototype[Symbol.iterator] === "function";
|
|
var hasFromCodePoint = typeof String.prototype.fromCodePoint === "function";
|
|
var hasCodePointAt = typeof String.prototype.codePointAt === "function";
|
|
|
|
// output/Data.String.CodeUnits/foreign.js
|
|
var length3 = function(s) {
|
|
return s.length;
|
|
};
|
|
var _indexOf = function(just) {
|
|
return function(nothing) {
|
|
return function(x) {
|
|
return function(s) {
|
|
var i2 = s.indexOf(x);
|
|
return i2 === -1 ? nothing : just(i2);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var take3 = function(n) {
|
|
return function(s) {
|
|
return s.substr(0, n);
|
|
};
|
|
};
|
|
var drop3 = function(n) {
|
|
return function(s) {
|
|
return s.substring(n);
|
|
};
|
|
};
|
|
var splitAt2 = function(i2) {
|
|
return function(s) {
|
|
return { before: s.substring(0, i2), after: s.substring(i2) };
|
|
};
|
|
};
|
|
|
|
// output/Data.String.CodeUnits/index.js
|
|
var stripPrefix = function(v) {
|
|
return function(str) {
|
|
var v1 = splitAt2(length3(v))(str);
|
|
var $20 = v1.before === v;
|
|
if ($20) {
|
|
return new Just(v1.after);
|
|
}
|
|
;
|
|
return Nothing.value;
|
|
};
|
|
};
|
|
var indexOf = /* @__PURE__ */ function() {
|
|
return _indexOf(Just.create)(Nothing.value);
|
|
}();
|
|
|
|
// output/Data.String.Common/foreign.js
|
|
var split = function(sep) {
|
|
return function(s) {
|
|
return s.split(sep);
|
|
};
|
|
};
|
|
var joinWith = function(s) {
|
|
return function(xs) {
|
|
return xs.join(s);
|
|
};
|
|
};
|
|
|
|
// output/Data.Argonaut.Decode.Decoders/index.js
|
|
var pure4 = /* @__PURE__ */ pure(applicativeEither);
|
|
var map10 = /* @__PURE__ */ map(functorEither);
|
|
var lmap2 = /* @__PURE__ */ lmap(bifunctorEither);
|
|
var composeKleisliFlipped2 = /* @__PURE__ */ composeKleisliFlipped(bindEither);
|
|
var traverse5 = /* @__PURE__ */ traverse(traversableObject)(applicativeEither);
|
|
var getField = function(decoder) {
|
|
return function(obj) {
|
|
return function(str) {
|
|
return maybe(new Left(new AtKey(str, MissingValue.value)))(function() {
|
|
var $48 = lmap2(AtKey.create(str));
|
|
return function($49) {
|
|
return $48(decoder($49));
|
|
};
|
|
}())(lookup(str)(obj));
|
|
};
|
|
};
|
|
};
|
|
var decodeString = /* @__PURE__ */ function() {
|
|
return caseJsonString(new Left(new TypeMismatch("String")))(Right.create);
|
|
}();
|
|
var decodeMaybe = function(decoder) {
|
|
return function(json) {
|
|
if (isNull(json)) {
|
|
return pure4(Nothing.value);
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return map10(Just.create)(decoder(json));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.Argonaut.Decode.Decoders (line 37, column 1 - line 41, column 38): " + [decoder.constructor.name, json.constructor.name]);
|
|
};
|
|
};
|
|
var decodeJObject = /* @__PURE__ */ function() {
|
|
var $50 = note(new TypeMismatch("Object"));
|
|
return function($51) {
|
|
return $50(toObject($51));
|
|
};
|
|
}();
|
|
var decodeForeignObject = function(decoder) {
|
|
return composeKleisliFlipped2(function() {
|
|
var $86 = lmap2(Named.create("ForeignObject"));
|
|
var $87 = traverse5(decoder);
|
|
return function($88) {
|
|
return $86($87($88));
|
|
};
|
|
}())(decodeJObject);
|
|
};
|
|
|
|
// output/Record/index.js
|
|
var get2 = function(dictIsSymbol) {
|
|
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
|
|
return function() {
|
|
return function(l) {
|
|
return function(r) {
|
|
return unsafeGet(reflectSymbol2(l))(r);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Data.Argonaut.Decode.Class/index.js
|
|
var decodeJsonString = {
|
|
decodeJson: decodeString
|
|
};
|
|
var decodeJsonJson = /* @__PURE__ */ function() {
|
|
return {
|
|
decodeJson: Right.create
|
|
};
|
|
}();
|
|
var decodeJson = function(dict) {
|
|
return dict.decodeJson;
|
|
};
|
|
var decodeJsonMaybe = function(dictDecodeJson) {
|
|
return {
|
|
decodeJson: decodeMaybe(decodeJson(dictDecodeJson))
|
|
};
|
|
};
|
|
var decodeForeignObject2 = function(dictDecodeJson) {
|
|
return {
|
|
decodeJson: decodeForeignObject(decodeJson(dictDecodeJson))
|
|
};
|
|
};
|
|
|
|
// output/Data.Argonaut.Decode.Combinators/index.js
|
|
var map11 = /* @__PURE__ */ map(functorEither);
|
|
var getField2 = function(dictDecodeJson) {
|
|
return getField(decodeJson(dictDecodeJson));
|
|
};
|
|
var defaultField = function(parser) {
|
|
return function($$default2) {
|
|
return map11(fromMaybe($$default2))(parser);
|
|
};
|
|
};
|
|
|
|
// output/Data.Nullable/foreign.js
|
|
var nullImpl = null;
|
|
function nullable(a2, r, f) {
|
|
return a2 == null ? r : f(a2);
|
|
}
|
|
function notNull(x) {
|
|
return x;
|
|
}
|
|
|
|
// output/Data.Nullable/index.js
|
|
var toNullable = /* @__PURE__ */ maybe(nullImpl)(notNull);
|
|
var toMaybe = function(n) {
|
|
return nullable(n, Nothing.value, Just.create);
|
|
};
|
|
|
|
// output/Exblo.API/index.js
|
|
var bind2 = /* @__PURE__ */ bind(bindEither);
|
|
var decodeJson2 = /* @__PURE__ */ decodeJson(decodeJsonString);
|
|
var decodeJson1 = /* @__PURE__ */ decodeJson(/* @__PURE__ */ decodeForeignObject2(decodeJsonJson));
|
|
var getField3 = /* @__PURE__ */ getField2(decodeJsonString);
|
|
var pure5 = /* @__PURE__ */ pure(applicativeEither);
|
|
var MainNet = /* @__PURE__ */ function() {
|
|
function MainNet2() {
|
|
}
|
|
;
|
|
MainNet2.value = new MainNet2();
|
|
return MainNet2;
|
|
}();
|
|
var TestNet = /* @__PURE__ */ function() {
|
|
function TestNet2() {
|
|
}
|
|
;
|
|
TestNet2.value = new TestNet2();
|
|
return TestNet2;
|
|
}();
|
|
var zcashNetToString = function(v) {
|
|
if (v instanceof MainNet) {
|
|
return "MainNet";
|
|
}
|
|
;
|
|
if (v instanceof TestNet) {
|
|
return "TestNet";
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.API (line 22, column 20 - line 24, column 23): " + [v.constructor.name]);
|
|
};
|
|
var zcashNetFromString = function(v) {
|
|
if (v === "MainNet") {
|
|
return new Just(MainNet.value);
|
|
}
|
|
;
|
|
if (v === "TestNet") {
|
|
return new Just(TestNet.value);
|
|
}
|
|
;
|
|
return Nothing.value;
|
|
};
|
|
var sumBundles = function(t) {
|
|
return function(s) {
|
|
return function(o) {
|
|
return function() {
|
|
var v = toMaybe(o);
|
|
if (v instanceof Nothing) {
|
|
return 0;
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return v.value0.value;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.API (line 127, column 5 - line 129, column 28): " + [v.constructor.name]);
|
|
}() + function() {
|
|
var v = toMaybe(s);
|
|
if (v instanceof Nothing) {
|
|
return 0;
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return v.value0.value;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.API (line 132, column 9 - line 134, column 32): " + [v.constructor.name]);
|
|
}() | 0;
|
|
};
|
|
};
|
|
};
|
|
var showZcashNet = {
|
|
show: zcashNetToString
|
|
};
|
|
var eqZcashNet = {
|
|
eq: function(x) {
|
|
return function(y) {
|
|
if (x instanceof MainNet && y instanceof MainNet) {
|
|
return true;
|
|
}
|
|
;
|
|
if (x instanceof TestNet && y instanceof TestNet) {
|
|
return true;
|
|
}
|
|
;
|
|
return false;
|
|
};
|
|
}
|
|
};
|
|
var decodeJsonZcashNet = {
|
|
decodeJson: function(json) {
|
|
return bind2(decodeJson2(json))(function(string3) {
|
|
return note(new TypeMismatch("ZcashNet"))(zcashNetFromString(string3));
|
|
});
|
|
}
|
|
};
|
|
var getField1 = /* @__PURE__ */ getField2(/* @__PURE__ */ decodeJsonMaybe(decodeJsonZcashNet));
|
|
var decodeJsonExbloInfo = {
|
|
decodeJson: function(json) {
|
|
return bind2(decodeJson1(json))(function(obj) {
|
|
return bind2(defaultField(getField1(obj)("net"))(TestNet.value))(function(net) {
|
|
return bind2(getField3(obj)("version"))(function(version) {
|
|
return bind2(getField3(obj)("zebra"))(function(zebra) {
|
|
return pure5({
|
|
net,
|
|
version,
|
|
zebra
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
};
|
|
|
|
// output/Effect.Aff.Class/index.js
|
|
var lift4 = /* @__PURE__ */ lift(monadTransReaderT);
|
|
var monadAffAff = {
|
|
liftAff: /* @__PURE__ */ identity(categoryFn),
|
|
MonadEffect0: function() {
|
|
return monadEffectAff;
|
|
}
|
|
};
|
|
var liftAff = function(dict) {
|
|
return dict.liftAff;
|
|
};
|
|
var monadAffReader = function(dictMonadAff) {
|
|
var MonadEffect0 = dictMonadAff.MonadEffect0();
|
|
var monadEffectReader2 = monadEffectReader(MonadEffect0);
|
|
return {
|
|
liftAff: function() {
|
|
var $79 = lift4(MonadEffect0.Monad0());
|
|
var $80 = liftAff(dictMonadAff);
|
|
return function($81) {
|
|
return $79($80($81));
|
|
};
|
|
}(),
|
|
MonadEffect0: function() {
|
|
return monadEffectReader2;
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/DOM.HTML.Indexed.ButtonType/index.js
|
|
var ButtonButton = /* @__PURE__ */ function() {
|
|
function ButtonButton2() {
|
|
}
|
|
;
|
|
ButtonButton2.value = new ButtonButton2();
|
|
return ButtonButton2;
|
|
}();
|
|
var ButtonSubmit = /* @__PURE__ */ function() {
|
|
function ButtonSubmit2() {
|
|
}
|
|
;
|
|
ButtonSubmit2.value = new ButtonSubmit2();
|
|
return ButtonSubmit2;
|
|
}();
|
|
var ButtonReset = /* @__PURE__ */ function() {
|
|
function ButtonReset2() {
|
|
}
|
|
;
|
|
ButtonReset2.value = new ButtonReset2();
|
|
return ButtonReset2;
|
|
}();
|
|
var renderButtonType = function(v) {
|
|
if (v instanceof ButtonButton) {
|
|
return "button";
|
|
}
|
|
;
|
|
if (v instanceof ButtonSubmit) {
|
|
return "submit";
|
|
}
|
|
;
|
|
if (v instanceof ButtonReset) {
|
|
return "reset";
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at DOM.HTML.Indexed.ButtonType (line 14, column 20 - line 17, column 25): " + [v.constructor.name]);
|
|
};
|
|
|
|
// output/Halogen.Query.Input/index.js
|
|
var RefUpdate = /* @__PURE__ */ function() {
|
|
function RefUpdate2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
RefUpdate2.create = function(value0) {
|
|
return function(value1) {
|
|
return new RefUpdate2(value0, value1);
|
|
};
|
|
};
|
|
return RefUpdate2;
|
|
}();
|
|
var Action = /* @__PURE__ */ function() {
|
|
function Action3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Action3.create = function(value0) {
|
|
return new Action3(value0);
|
|
};
|
|
return Action3;
|
|
}();
|
|
var functorInput = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
if (m instanceof RefUpdate) {
|
|
return new RefUpdate(m.value0, m.value1);
|
|
}
|
|
;
|
|
if (m instanceof Action) {
|
|
return new Action(f(m.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Query.Input (line 0, column 0 - line 0, column 0): " + [m.constructor.name]);
|
|
};
|
|
}
|
|
};
|
|
|
|
// output/Halogen.VDom.Machine/index.js
|
|
var Step = /* @__PURE__ */ function() {
|
|
function Step3(value0, value1, value22, value32) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
this.value3 = value32;
|
|
}
|
|
;
|
|
Step3.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return function(value32) {
|
|
return new Step3(value0, value1, value22, value32);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Step3;
|
|
}();
|
|
var unStep = unsafeCoerce2;
|
|
var step = function(v, a2) {
|
|
return v.value2(v.value1, a2);
|
|
};
|
|
var mkStep = unsafeCoerce2;
|
|
var halt = function(v) {
|
|
return v.value3(v.value1);
|
|
};
|
|
var extract2 = /* @__PURE__ */ unStep(function(v) {
|
|
return v.value0;
|
|
});
|
|
|
|
// output/Halogen.VDom.Types/index.js
|
|
var map12 = /* @__PURE__ */ map(functorArray);
|
|
var map13 = /* @__PURE__ */ map(functorTuple);
|
|
var Text = /* @__PURE__ */ function() {
|
|
function Text2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Text2.create = function(value0) {
|
|
return new Text2(value0);
|
|
};
|
|
return Text2;
|
|
}();
|
|
var Elem = /* @__PURE__ */ function() {
|
|
function Elem2(value0, value1, value22, value32) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
this.value3 = value32;
|
|
}
|
|
;
|
|
Elem2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return function(value32) {
|
|
return new Elem2(value0, value1, value22, value32);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Elem2;
|
|
}();
|
|
var Keyed = /* @__PURE__ */ function() {
|
|
function Keyed2(value0, value1, value22, value32) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
this.value3 = value32;
|
|
}
|
|
;
|
|
Keyed2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return function(value32) {
|
|
return new Keyed2(value0, value1, value22, value32);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Keyed2;
|
|
}();
|
|
var Widget = /* @__PURE__ */ function() {
|
|
function Widget2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Widget2.create = function(value0) {
|
|
return new Widget2(value0);
|
|
};
|
|
return Widget2;
|
|
}();
|
|
var Grafted = /* @__PURE__ */ function() {
|
|
function Grafted2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Grafted2.create = function(value0) {
|
|
return new Grafted2(value0);
|
|
};
|
|
return Grafted2;
|
|
}();
|
|
var Graft = /* @__PURE__ */ function() {
|
|
function Graft2(value0, value1, value22) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
}
|
|
;
|
|
Graft2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return new Graft2(value0, value1, value22);
|
|
};
|
|
};
|
|
};
|
|
return Graft2;
|
|
}();
|
|
var unGraft = function(f) {
|
|
return function($61) {
|
|
return f($61);
|
|
};
|
|
};
|
|
var graft = unsafeCoerce2;
|
|
var bifunctorGraft = {
|
|
bimap: function(f) {
|
|
return function(g) {
|
|
return unGraft(function(v) {
|
|
return graft(new Graft(function($63) {
|
|
return f(v.value0($63));
|
|
}, function($64) {
|
|
return g(v.value1($64));
|
|
}, v.value2));
|
|
});
|
|
};
|
|
}
|
|
};
|
|
var bimap2 = /* @__PURE__ */ bimap(bifunctorGraft);
|
|
var bifunctorVDom = {
|
|
bimap: function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v2 instanceof Text) {
|
|
return new Text(v2.value0);
|
|
}
|
|
;
|
|
if (v2 instanceof Grafted) {
|
|
return new Grafted(bimap2(v)(v1)(v2.value0));
|
|
}
|
|
;
|
|
return new Grafted(graft(new Graft(v, v1, v2)));
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var runGraft = /* @__PURE__ */ unGraft(function(v) {
|
|
var go2 = function(v2) {
|
|
if (v2 instanceof Text) {
|
|
return new Text(v2.value0);
|
|
}
|
|
;
|
|
if (v2 instanceof Elem) {
|
|
return new Elem(v2.value0, v2.value1, v.value0(v2.value2), map12(go2)(v2.value3));
|
|
}
|
|
;
|
|
if (v2 instanceof Keyed) {
|
|
return new Keyed(v2.value0, v2.value1, v.value0(v2.value2), map12(map13(go2))(v2.value3));
|
|
}
|
|
;
|
|
if (v2 instanceof Widget) {
|
|
return new Widget(v.value1(v2.value0));
|
|
}
|
|
;
|
|
if (v2 instanceof Grafted) {
|
|
return new Grafted(bimap2(v.value0)(v.value1)(v2.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.Types (line 86, column 7 - line 86, column 27): " + [v2.constructor.name]);
|
|
};
|
|
return go2(v.value2);
|
|
});
|
|
|
|
// output/Halogen.VDom.Util/foreign.js
|
|
function unsafeGetAny(key, obj) {
|
|
return obj[key];
|
|
}
|
|
function unsafeHasAny(key, obj) {
|
|
return obj.hasOwnProperty(key);
|
|
}
|
|
function unsafeSetAny(key, val, obj) {
|
|
obj[key] = val;
|
|
}
|
|
function forE2(a2, f) {
|
|
var b2 = [];
|
|
for (var i2 = 0; i2 < a2.length; i2++) {
|
|
b2.push(f(i2, a2[i2]));
|
|
}
|
|
return b2;
|
|
}
|
|
function forEachE(a2, f) {
|
|
for (var i2 = 0; i2 < a2.length; i2++) {
|
|
f(a2[i2]);
|
|
}
|
|
}
|
|
function forInE(o, f) {
|
|
var ks = Object.keys(o);
|
|
for (var i2 = 0; i2 < ks.length; i2++) {
|
|
var k = ks[i2];
|
|
f(k, o[k]);
|
|
}
|
|
}
|
|
function diffWithIxE(a1, a2, f1, f2, f3) {
|
|
var a3 = [];
|
|
var l1 = a1.length;
|
|
var l2 = a2.length;
|
|
var i2 = 0;
|
|
while (1) {
|
|
if (i2 < l1) {
|
|
if (i2 < l2) {
|
|
a3.push(f1(i2, a1[i2], a2[i2]));
|
|
} else {
|
|
f2(i2, a1[i2]);
|
|
}
|
|
} else if (i2 < l2) {
|
|
a3.push(f3(i2, a2[i2]));
|
|
} else {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
return a3;
|
|
}
|
|
function strMapWithIxE(as2, fk, f) {
|
|
var o = {};
|
|
for (var i2 = 0; i2 < as2.length; i2++) {
|
|
var a2 = as2[i2];
|
|
var k = fk(a2);
|
|
o[k] = f(k, i2, a2);
|
|
}
|
|
return o;
|
|
}
|
|
function diffWithKeyAndIxE(o1, as2, fk, f1, f2, f3) {
|
|
var o2 = {};
|
|
for (var i2 = 0; i2 < as2.length; i2++) {
|
|
var a2 = as2[i2];
|
|
var k = fk(a2);
|
|
if (o1.hasOwnProperty(k)) {
|
|
o2[k] = f1(k, i2, o1[k], a2);
|
|
} else {
|
|
o2[k] = f3(k, i2, a2);
|
|
}
|
|
}
|
|
for (var k in o1) {
|
|
if (k in o2) {
|
|
continue;
|
|
}
|
|
f2(k, o1[k]);
|
|
}
|
|
return o2;
|
|
}
|
|
function refEq2(a2, b2) {
|
|
return a2 === b2;
|
|
}
|
|
function createTextNode(s, doc) {
|
|
return doc.createTextNode(s);
|
|
}
|
|
function setTextContent(s, n) {
|
|
n.textContent = s;
|
|
}
|
|
function createElement(ns, name16, doc) {
|
|
if (ns != null) {
|
|
return doc.createElementNS(ns, name16);
|
|
} else {
|
|
return doc.createElement(name16);
|
|
}
|
|
}
|
|
function insertChildIx(i2, a2, b2) {
|
|
var n = b2.childNodes.item(i2) || null;
|
|
if (n !== a2) {
|
|
b2.insertBefore(a2, n);
|
|
}
|
|
}
|
|
function removeChild(a2, b2) {
|
|
if (b2 && a2.parentNode === b2) {
|
|
b2.removeChild(a2);
|
|
}
|
|
}
|
|
function parentNode(a2) {
|
|
return a2.parentNode;
|
|
}
|
|
function setAttribute(ns, attr3, val, el) {
|
|
if (ns != null) {
|
|
el.setAttributeNS(ns, attr3, val);
|
|
} else {
|
|
el.setAttribute(attr3, val);
|
|
}
|
|
}
|
|
function removeAttribute(ns, attr3, el) {
|
|
if (ns != null) {
|
|
el.removeAttributeNS(ns, attr3);
|
|
} else {
|
|
el.removeAttribute(attr3);
|
|
}
|
|
}
|
|
function hasAttribute(ns, attr3, el) {
|
|
if (ns != null) {
|
|
return el.hasAttributeNS(ns, attr3);
|
|
} else {
|
|
return el.hasAttribute(attr3);
|
|
}
|
|
}
|
|
function addEventListener(ev, listener, el) {
|
|
el.addEventListener(ev, listener, false);
|
|
}
|
|
function removeEventListener(ev, listener, el) {
|
|
el.removeEventListener(ev, listener, false);
|
|
}
|
|
var jsUndefined = void 0;
|
|
|
|
// output/Halogen.VDom.Util/index.js
|
|
var unsafeLookup = unsafeGetAny;
|
|
var unsafeFreeze2 = unsafeCoerce2;
|
|
var pokeMutMap = unsafeSetAny;
|
|
var newMutMap = newImpl;
|
|
|
|
// output/Web.DOM.Element/foreign.js
|
|
var getProp = function(name16) {
|
|
return function(doctype) {
|
|
return doctype[name16];
|
|
};
|
|
};
|
|
var _namespaceURI = getProp("namespaceURI");
|
|
var _prefix = getProp("prefix");
|
|
var localName = getProp("localName");
|
|
var tagName = getProp("tagName");
|
|
|
|
// output/Web.DOM.ParentNode/foreign.js
|
|
var getEffProp = function(name16) {
|
|
return function(node) {
|
|
return function() {
|
|
return node[name16];
|
|
};
|
|
};
|
|
};
|
|
var children = getEffProp("children");
|
|
var _firstElementChild = getEffProp("firstElementChild");
|
|
var _lastElementChild = getEffProp("lastElementChild");
|
|
var childElementCount = getEffProp("childElementCount");
|
|
function _querySelector(selector) {
|
|
return function(node) {
|
|
return function() {
|
|
return node.querySelector(selector);
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Web.DOM.ParentNode/index.js
|
|
var map14 = /* @__PURE__ */ map(functorEffect);
|
|
var querySelector = function(qs) {
|
|
var $2 = map14(toMaybe);
|
|
var $3 = _querySelector(qs);
|
|
return function($4) {
|
|
return $2($3($4));
|
|
};
|
|
};
|
|
|
|
// output/Web.DOM.Element/index.js
|
|
var toNode = unsafeCoerce2;
|
|
|
|
// output/Halogen.VDom.DOM/index.js
|
|
var $runtime_lazy4 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var haltWidget = function(v) {
|
|
return halt(v.widget);
|
|
};
|
|
var $lazy_patchWidget = /* @__PURE__ */ $runtime_lazy4("patchWidget", "Halogen.VDom.DOM", function() {
|
|
return function(state3, vdom) {
|
|
if (vdom instanceof Grafted) {
|
|
return $lazy_patchWidget(291)(state3, runGraft(vdom.value0));
|
|
}
|
|
;
|
|
if (vdom instanceof Widget) {
|
|
var res = step(state3.widget, vdom.value0);
|
|
var res$prime = unStep(function(v) {
|
|
return mkStep(new Step(v.value0, {
|
|
build: state3.build,
|
|
widget: res
|
|
}, $lazy_patchWidget(296), haltWidget));
|
|
})(res);
|
|
return res$prime;
|
|
}
|
|
;
|
|
haltWidget(state3);
|
|
return state3.build(vdom);
|
|
};
|
|
});
|
|
var patchWidget = /* @__PURE__ */ $lazy_patchWidget(286);
|
|
var haltText = function(v) {
|
|
var parent2 = parentNode(v.node);
|
|
return removeChild(v.node, parent2);
|
|
};
|
|
var $lazy_patchText = /* @__PURE__ */ $runtime_lazy4("patchText", "Halogen.VDom.DOM", function() {
|
|
return function(state3, vdom) {
|
|
if (vdom instanceof Grafted) {
|
|
return $lazy_patchText(82)(state3, runGraft(vdom.value0));
|
|
}
|
|
;
|
|
if (vdom instanceof Text) {
|
|
if (state3.value === vdom.value0) {
|
|
return mkStep(new Step(state3.node, state3, $lazy_patchText(85), haltText));
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
var nextState = {
|
|
build: state3.build,
|
|
node: state3.node,
|
|
value: vdom.value0
|
|
};
|
|
setTextContent(vdom.value0, state3.node);
|
|
return mkStep(new Step(state3.node, nextState, $lazy_patchText(89), haltText));
|
|
}
|
|
;
|
|
}
|
|
;
|
|
haltText(state3);
|
|
return state3.build(vdom);
|
|
};
|
|
});
|
|
var patchText = /* @__PURE__ */ $lazy_patchText(77);
|
|
var haltKeyed = function(v) {
|
|
var parent2 = parentNode(v.node);
|
|
removeChild(v.node, parent2);
|
|
forInE(v.children, function(v1, s) {
|
|
return halt(s);
|
|
});
|
|
return halt(v.attrs);
|
|
};
|
|
var haltElem = function(v) {
|
|
var parent2 = parentNode(v.node);
|
|
removeChild(v.node, parent2);
|
|
forEachE(v.children, halt);
|
|
return halt(v.attrs);
|
|
};
|
|
var eqElemSpec = function(ns1, v, ns2, v1) {
|
|
var $63 = v === v1;
|
|
if ($63) {
|
|
if (ns1 instanceof Just && (ns2 instanceof Just && ns1.value0 === ns2.value0)) {
|
|
return true;
|
|
}
|
|
;
|
|
if (ns1 instanceof Nothing && ns2 instanceof Nothing) {
|
|
return true;
|
|
}
|
|
;
|
|
return false;
|
|
}
|
|
;
|
|
return false;
|
|
};
|
|
var $lazy_patchElem = /* @__PURE__ */ $runtime_lazy4("patchElem", "Halogen.VDom.DOM", function() {
|
|
return function(state3, vdom) {
|
|
if (vdom instanceof Grafted) {
|
|
return $lazy_patchElem(135)(state3, runGraft(vdom.value0));
|
|
}
|
|
;
|
|
if (vdom instanceof Elem && eqElemSpec(state3.ns, state3.name, vdom.value0, vdom.value1)) {
|
|
var v = length(vdom.value3);
|
|
var v1 = length(state3.children);
|
|
if (v1 === 0 && v === 0) {
|
|
var attrs2 = step(state3.attrs, vdom.value2);
|
|
var nextState = {
|
|
build: state3.build,
|
|
node: state3.node,
|
|
attrs: attrs2,
|
|
ns: vdom.value0,
|
|
name: vdom.value1,
|
|
children: state3.children
|
|
};
|
|
return mkStep(new Step(state3.node, nextState, $lazy_patchElem(149), haltElem));
|
|
}
|
|
;
|
|
var onThis = function(v2, s) {
|
|
return halt(s);
|
|
};
|
|
var onThese = function(ix, s, v2) {
|
|
var res = step(s, v2);
|
|
insertChildIx(ix, extract2(res), state3.node);
|
|
return res;
|
|
};
|
|
var onThat = function(ix, v2) {
|
|
var res = state3.build(v2);
|
|
insertChildIx(ix, extract2(res), state3.node);
|
|
return res;
|
|
};
|
|
var children2 = diffWithIxE(state3.children, vdom.value3, onThese, onThis, onThat);
|
|
var attrs2 = step(state3.attrs, vdom.value2);
|
|
var nextState = {
|
|
build: state3.build,
|
|
node: state3.node,
|
|
attrs: attrs2,
|
|
ns: vdom.value0,
|
|
name: vdom.value1,
|
|
children: children2
|
|
};
|
|
return mkStep(new Step(state3.node, nextState, $lazy_patchElem(172), haltElem));
|
|
}
|
|
;
|
|
haltElem(state3);
|
|
return state3.build(vdom);
|
|
};
|
|
});
|
|
var patchElem = /* @__PURE__ */ $lazy_patchElem(130);
|
|
var $lazy_patchKeyed = /* @__PURE__ */ $runtime_lazy4("patchKeyed", "Halogen.VDom.DOM", function() {
|
|
return function(state3, vdom) {
|
|
if (vdom instanceof Grafted) {
|
|
return $lazy_patchKeyed(222)(state3, runGraft(vdom.value0));
|
|
}
|
|
;
|
|
if (vdom instanceof Keyed && eqElemSpec(state3.ns, state3.name, vdom.value0, vdom.value1)) {
|
|
var v = length(vdom.value3);
|
|
if (state3.length === 0 && v === 0) {
|
|
var attrs2 = step(state3.attrs, vdom.value2);
|
|
var nextState = {
|
|
build: state3.build,
|
|
node: state3.node,
|
|
attrs: attrs2,
|
|
ns: vdom.value0,
|
|
name: vdom.value1,
|
|
children: state3.children,
|
|
length: 0
|
|
};
|
|
return mkStep(new Step(state3.node, nextState, $lazy_patchKeyed(237), haltKeyed));
|
|
}
|
|
;
|
|
var onThis = function(v2, s) {
|
|
return halt(s);
|
|
};
|
|
var onThese = function(v2, ix$prime, s, v3) {
|
|
var res = step(s, v3.value1);
|
|
insertChildIx(ix$prime, extract2(res), state3.node);
|
|
return res;
|
|
};
|
|
var onThat = function(v2, ix, v3) {
|
|
var res = state3.build(v3.value1);
|
|
insertChildIx(ix, extract2(res), state3.node);
|
|
return res;
|
|
};
|
|
var children2 = diffWithKeyAndIxE(state3.children, vdom.value3, fst, onThese, onThis, onThat);
|
|
var attrs2 = step(state3.attrs, vdom.value2);
|
|
var nextState = {
|
|
build: state3.build,
|
|
node: state3.node,
|
|
attrs: attrs2,
|
|
ns: vdom.value0,
|
|
name: vdom.value1,
|
|
children: children2,
|
|
length: v
|
|
};
|
|
return mkStep(new Step(state3.node, nextState, $lazy_patchKeyed(261), haltKeyed));
|
|
}
|
|
;
|
|
haltKeyed(state3);
|
|
return state3.build(vdom);
|
|
};
|
|
});
|
|
var patchKeyed = /* @__PURE__ */ $lazy_patchKeyed(217);
|
|
var buildWidget = function(v, build2, w) {
|
|
var res = v.buildWidget(v)(w);
|
|
var res$prime = unStep(function(v1) {
|
|
return mkStep(new Step(v1.value0, {
|
|
build: build2,
|
|
widget: res
|
|
}, patchWidget, haltWidget));
|
|
})(res);
|
|
return res$prime;
|
|
};
|
|
var buildText = function(v, build2, s) {
|
|
var node = createTextNode(s, v.document);
|
|
var state3 = {
|
|
build: build2,
|
|
node,
|
|
value: s
|
|
};
|
|
return mkStep(new Step(node, state3, patchText, haltText));
|
|
};
|
|
var buildKeyed = function(v, build2, ns1, name1, as1, ch1) {
|
|
var el = createElement(toNullable(ns1), name1, v.document);
|
|
var node = toNode(el);
|
|
var onChild = function(v1, ix, v2) {
|
|
var res = build2(v2.value1);
|
|
insertChildIx(ix, extract2(res), node);
|
|
return res;
|
|
};
|
|
var children2 = strMapWithIxE(ch1, fst, onChild);
|
|
var attrs = v.buildAttributes(el)(as1);
|
|
var state3 = {
|
|
build: build2,
|
|
node,
|
|
attrs,
|
|
ns: ns1,
|
|
name: name1,
|
|
children: children2,
|
|
length: length(ch1)
|
|
};
|
|
return mkStep(new Step(node, state3, patchKeyed, haltKeyed));
|
|
};
|
|
var buildElem = function(v, build2, ns1, name1, as1, ch1) {
|
|
var el = createElement(toNullable(ns1), name1, v.document);
|
|
var node = toNode(el);
|
|
var onChild = function(ix, child) {
|
|
var res = build2(child);
|
|
insertChildIx(ix, extract2(res), node);
|
|
return res;
|
|
};
|
|
var children2 = forE2(ch1, onChild);
|
|
var attrs = v.buildAttributes(el)(as1);
|
|
var state3 = {
|
|
build: build2,
|
|
node,
|
|
attrs,
|
|
ns: ns1,
|
|
name: name1,
|
|
children: children2
|
|
};
|
|
return mkStep(new Step(node, state3, patchElem, haltElem));
|
|
};
|
|
var buildVDom = function(spec) {
|
|
var $lazy_build = $runtime_lazy4("build", "Halogen.VDom.DOM", function() {
|
|
return function(v) {
|
|
if (v instanceof Text) {
|
|
return buildText(spec, $lazy_build(59), v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Elem) {
|
|
return buildElem(spec, $lazy_build(60), v.value0, v.value1, v.value2, v.value3);
|
|
}
|
|
;
|
|
if (v instanceof Keyed) {
|
|
return buildKeyed(spec, $lazy_build(61), v.value0, v.value1, v.value2, v.value3);
|
|
}
|
|
;
|
|
if (v instanceof Widget) {
|
|
return buildWidget(spec, $lazy_build(62), v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Grafted) {
|
|
return $lazy_build(63)(runGraft(v.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM (line 58, column 27 - line 63, column 52): " + [v.constructor.name]);
|
|
};
|
|
});
|
|
var build2 = $lazy_build(58);
|
|
return build2;
|
|
};
|
|
|
|
// output/Foreign/foreign.js
|
|
function typeOf(value15) {
|
|
return typeof value15;
|
|
}
|
|
function tagOf(value15) {
|
|
return Object.prototype.toString.call(value15).slice(8, -1);
|
|
}
|
|
function isNull2(value15) {
|
|
return value15 === null;
|
|
}
|
|
var isArray = Array.isArray || function(value15) {
|
|
return Object.prototype.toString.call(value15) === "[object Array]";
|
|
};
|
|
|
|
// output/Foreign/index.js
|
|
var show3 = /* @__PURE__ */ show(showString);
|
|
var show12 = /* @__PURE__ */ show(showInt);
|
|
var pure6 = /* @__PURE__ */ pure(applicativeEither);
|
|
var ForeignError = /* @__PURE__ */ function() {
|
|
function ForeignError2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ForeignError2.create = function(value0) {
|
|
return new ForeignError2(value0);
|
|
};
|
|
return ForeignError2;
|
|
}();
|
|
var TypeMismatch2 = /* @__PURE__ */ function() {
|
|
function TypeMismatch3(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
TypeMismatch3.create = function(value0) {
|
|
return function(value1) {
|
|
return new TypeMismatch3(value0, value1);
|
|
};
|
|
};
|
|
return TypeMismatch3;
|
|
}();
|
|
var ErrorAtIndex = /* @__PURE__ */ function() {
|
|
function ErrorAtIndex2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
ErrorAtIndex2.create = function(value0) {
|
|
return function(value1) {
|
|
return new ErrorAtIndex2(value0, value1);
|
|
};
|
|
};
|
|
return ErrorAtIndex2;
|
|
}();
|
|
var ErrorAtProperty = /* @__PURE__ */ function() {
|
|
function ErrorAtProperty2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
ErrorAtProperty2.create = function(value0) {
|
|
return function(value1) {
|
|
return new ErrorAtProperty2(value0, value1);
|
|
};
|
|
};
|
|
return ErrorAtProperty2;
|
|
}();
|
|
var unsafeToForeign = unsafeCoerce2;
|
|
var unsafeFromForeign = unsafeCoerce2;
|
|
var showForeignError = {
|
|
show: function(v) {
|
|
if (v instanceof ForeignError) {
|
|
return "(ForeignError " + (show3(v.value0) + ")");
|
|
}
|
|
;
|
|
if (v instanceof ErrorAtIndex) {
|
|
return "(ErrorAtIndex " + (show12(v.value0) + (" " + (show(showForeignError)(v.value1) + ")")));
|
|
}
|
|
;
|
|
if (v instanceof ErrorAtProperty) {
|
|
return "(ErrorAtProperty " + (show3(v.value0) + (" " + (show(showForeignError)(v.value1) + ")")));
|
|
}
|
|
;
|
|
if (v instanceof TypeMismatch2) {
|
|
return "(TypeMismatch " + (show3(v.value0) + (" " + (show3(v.value1) + ")")));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Foreign (line 69, column 1 - line 73, column 89): " + [v.constructor.name]);
|
|
}
|
|
};
|
|
var renderForeignError = function(v) {
|
|
if (v instanceof ForeignError) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
if (v instanceof ErrorAtIndex) {
|
|
return "Error at array index " + (show12(v.value0) + (": " + renderForeignError(v.value1)));
|
|
}
|
|
;
|
|
if (v instanceof ErrorAtProperty) {
|
|
return "Error at property " + (show3(v.value0) + (": " + renderForeignError(v.value1)));
|
|
}
|
|
;
|
|
if (v instanceof TypeMismatch2) {
|
|
return "Type mismatch: expected " + (v.value0 + (", found " + v.value1));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Foreign (line 78, column 1 - line 78, column 45): " + [v.constructor.name]);
|
|
};
|
|
var readNull = function(dictMonad) {
|
|
var pure111 = pure(applicativeExceptT(dictMonad));
|
|
return function(value15) {
|
|
if (isNull2(value15)) {
|
|
return pure111(Nothing.value);
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return pure111(new Just(value15));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Foreign (line 169, column 1 - line 169, column 98): " + [value15.constructor.name]);
|
|
};
|
|
};
|
|
var fail = function(dictMonad) {
|
|
var $153 = throwError(monadThrowExceptT(dictMonad));
|
|
return function($154) {
|
|
return $153(singleton6($154));
|
|
};
|
|
};
|
|
var readArray = function(dictMonad) {
|
|
var pure111 = pure(applicativeExceptT(dictMonad));
|
|
var fail1 = fail(dictMonad);
|
|
return function(value15) {
|
|
if (isArray(value15)) {
|
|
return pure111(unsafeFromForeign(value15));
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return fail1(new TypeMismatch2("array", tagOf(value15)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Foreign (line 164, column 1 - line 164, column 99): " + [value15.constructor.name]);
|
|
};
|
|
};
|
|
var unsafeReadTagged = function(dictMonad) {
|
|
var pure111 = pure(applicativeExceptT(dictMonad));
|
|
var fail1 = fail(dictMonad);
|
|
return function(tag) {
|
|
return function(value15) {
|
|
if (tagOf(value15) === tag) {
|
|
return pure111(unsafeFromForeign(value15));
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return fail1(new TypeMismatch2(tag, tagOf(value15)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Foreign (line 123, column 1 - line 123, column 104): " + [tag.constructor.name, value15.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var readBoolean = function(dictMonad) {
|
|
return unsafeReadTagged(dictMonad)("Boolean");
|
|
};
|
|
var readNumber = function(dictMonad) {
|
|
return unsafeReadTagged(dictMonad)("Number");
|
|
};
|
|
var readInt = function(dictMonad) {
|
|
var map41 = map(dictMonad.Bind1().Apply0().Functor0());
|
|
var readNumber1 = readNumber(dictMonad);
|
|
return function(value15) {
|
|
var error4 = new Left(singleton6(new TypeMismatch2("Int", tagOf(value15))));
|
|
var fromNumber2 = function() {
|
|
var $155 = maybe(error4)(pure6);
|
|
return function($156) {
|
|
return $155(fromNumber($156));
|
|
};
|
|
}();
|
|
return mapExceptT(map41(either($$const(error4))(fromNumber2)))(readNumber1(value15));
|
|
};
|
|
};
|
|
var readString = function(dictMonad) {
|
|
return unsafeReadTagged(dictMonad)("String");
|
|
};
|
|
|
|
// output/Web.Event.EventTarget/foreign.js
|
|
function eventListener(fn) {
|
|
return function() {
|
|
return function(event) {
|
|
return fn(event)();
|
|
};
|
|
};
|
|
}
|
|
function addEventListener2(type) {
|
|
return function(listener) {
|
|
return function(useCapture) {
|
|
return function(target6) {
|
|
return function() {
|
|
return target6.addEventListener(type, listener, useCapture);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
function removeEventListener2(type) {
|
|
return function(listener) {
|
|
return function(useCapture) {
|
|
return function(target6) {
|
|
return function() {
|
|
return target6.removeEventListener(type, listener, useCapture);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Halogen.VDom.DOM.Prop/index.js
|
|
var $runtime_lazy5 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var map15 = /* @__PURE__ */ map(functorFn);
|
|
var map16 = /* @__PURE__ */ map(functorMaybe);
|
|
var Created = /* @__PURE__ */ function() {
|
|
function Created2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Created2.create = function(value0) {
|
|
return new Created2(value0);
|
|
};
|
|
return Created2;
|
|
}();
|
|
var Removed = /* @__PURE__ */ function() {
|
|
function Removed2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Removed2.create = function(value0) {
|
|
return new Removed2(value0);
|
|
};
|
|
return Removed2;
|
|
}();
|
|
var Attribute = /* @__PURE__ */ function() {
|
|
function Attribute2(value0, value1, value22) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
}
|
|
;
|
|
Attribute2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return new Attribute2(value0, value1, value22);
|
|
};
|
|
};
|
|
};
|
|
return Attribute2;
|
|
}();
|
|
var Property = /* @__PURE__ */ function() {
|
|
function Property2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Property2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Property2(value0, value1);
|
|
};
|
|
};
|
|
return Property2;
|
|
}();
|
|
var Handler = /* @__PURE__ */ function() {
|
|
function Handler2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Handler2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Handler2(value0, value1);
|
|
};
|
|
};
|
|
return Handler2;
|
|
}();
|
|
var Ref = /* @__PURE__ */ function() {
|
|
function Ref2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Ref2.create = function(value0) {
|
|
return new Ref2(value0);
|
|
};
|
|
return Ref2;
|
|
}();
|
|
var unsafeGetProperty = unsafeGetAny;
|
|
var setProperty = unsafeSetAny;
|
|
var removeProperty = function(key, el) {
|
|
var v = hasAttribute(nullImpl, key, el);
|
|
if (v) {
|
|
return removeAttribute(nullImpl, key, el);
|
|
}
|
|
;
|
|
var v1 = typeOf(unsafeGetAny(key, el));
|
|
if (v1 === "string") {
|
|
return unsafeSetAny(key, "", el);
|
|
}
|
|
;
|
|
if (key === "rowSpan") {
|
|
return unsafeSetAny(key, 1, el);
|
|
}
|
|
;
|
|
if (key === "colSpan") {
|
|
return unsafeSetAny(key, 1, el);
|
|
}
|
|
;
|
|
return unsafeSetAny(key, jsUndefined, el);
|
|
};
|
|
var propToStrKey = function(v) {
|
|
if (v instanceof Attribute && v.value0 instanceof Just) {
|
|
return "attr/" + (v.value0.value0 + (":" + v.value1));
|
|
}
|
|
;
|
|
if (v instanceof Attribute) {
|
|
return "attr/:" + v.value1;
|
|
}
|
|
;
|
|
if (v instanceof Property) {
|
|
return "prop/" + v.value0;
|
|
}
|
|
;
|
|
if (v instanceof Handler) {
|
|
return "handler/" + v.value0;
|
|
}
|
|
;
|
|
if (v instanceof Ref) {
|
|
return "ref";
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM.Prop (line 182, column 16 - line 187, column 16): " + [v.constructor.name]);
|
|
};
|
|
var propFromString = unsafeCoerce2;
|
|
var functorProp = {
|
|
map: function(v) {
|
|
return function(v1) {
|
|
if (v1 instanceof Handler) {
|
|
return new Handler(v1.value0, map15(map16(v))(v1.value1));
|
|
}
|
|
;
|
|
if (v1 instanceof Ref) {
|
|
return new Ref(map15(map16(v))(v1.value0));
|
|
}
|
|
;
|
|
return v1;
|
|
};
|
|
}
|
|
};
|
|
var buildProp = function(emit) {
|
|
return function(el) {
|
|
var removeProp = function(prevEvents) {
|
|
return function(v, v1) {
|
|
if (v1 instanceof Attribute) {
|
|
return removeAttribute(toNullable(v1.value0), v1.value1, el);
|
|
}
|
|
;
|
|
if (v1 instanceof Property) {
|
|
return removeProperty(v1.value0, el);
|
|
}
|
|
;
|
|
if (v1 instanceof Handler) {
|
|
var handler3 = unsafeLookup(v1.value0, prevEvents);
|
|
return removeEventListener(v1.value0, fst(handler3), el);
|
|
}
|
|
;
|
|
if (v1 instanceof Ref) {
|
|
return unit;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM.Prop (line 169, column 5 - line 179, column 18): " + [v1.constructor.name]);
|
|
};
|
|
};
|
|
var mbEmit = function(v) {
|
|
if (v instanceof Just) {
|
|
return emit(v.value0)();
|
|
}
|
|
;
|
|
return unit;
|
|
};
|
|
var haltProp = function(state3) {
|
|
var v = lookup("ref")(state3.props);
|
|
if (v instanceof Just && v.value0 instanceof Ref) {
|
|
return mbEmit(v.value0.value0(new Removed(el)));
|
|
}
|
|
;
|
|
return unit;
|
|
};
|
|
var diffProp = function(prevEvents, events) {
|
|
return function(v, v1, v11, v2) {
|
|
if (v11 instanceof Attribute && v2 instanceof Attribute) {
|
|
var $66 = v11.value2 === v2.value2;
|
|
if ($66) {
|
|
return v2;
|
|
}
|
|
;
|
|
setAttribute(toNullable(v2.value0), v2.value1, v2.value2, el);
|
|
return v2;
|
|
}
|
|
;
|
|
if (v11 instanceof Property && v2 instanceof Property) {
|
|
var v4 = refEq2(v11.value1, v2.value1);
|
|
if (v4) {
|
|
return v2;
|
|
}
|
|
;
|
|
if (v2.value0 === "value") {
|
|
var elVal = unsafeGetProperty("value", el);
|
|
var $75 = refEq2(elVal, v2.value1);
|
|
if ($75) {
|
|
return v2;
|
|
}
|
|
;
|
|
setProperty(v2.value0, v2.value1, el);
|
|
return v2;
|
|
}
|
|
;
|
|
setProperty(v2.value0, v2.value1, el);
|
|
return v2;
|
|
}
|
|
;
|
|
if (v11 instanceof Handler && v2 instanceof Handler) {
|
|
var handler3 = unsafeLookup(v2.value0, prevEvents);
|
|
write(v2.value1)(snd(handler3))();
|
|
pokeMutMap(v2.value0, handler3, events);
|
|
return v2;
|
|
}
|
|
;
|
|
return v2;
|
|
};
|
|
};
|
|
var applyProp = function(events) {
|
|
return function(v, v1, v2) {
|
|
if (v2 instanceof Attribute) {
|
|
setAttribute(toNullable(v2.value0), v2.value1, v2.value2, el);
|
|
return v2;
|
|
}
|
|
;
|
|
if (v2 instanceof Property) {
|
|
setProperty(v2.value0, v2.value1, el);
|
|
return v2;
|
|
}
|
|
;
|
|
if (v2 instanceof Handler) {
|
|
var v3 = unsafeGetAny(v2.value0, events);
|
|
if (unsafeHasAny(v2.value0, events)) {
|
|
write(v2.value1)(snd(v3))();
|
|
return v2;
|
|
}
|
|
;
|
|
var ref2 = $$new(v2.value1)();
|
|
var listener = eventListener(function(ev) {
|
|
return function __do2() {
|
|
var f$prime = read(ref2)();
|
|
return mbEmit(f$prime(ev));
|
|
};
|
|
})();
|
|
pokeMutMap(v2.value0, new Tuple(listener, ref2), events);
|
|
addEventListener(v2.value0, listener, el);
|
|
return v2;
|
|
}
|
|
;
|
|
if (v2 instanceof Ref) {
|
|
mbEmit(v2.value0(new Created(el)));
|
|
return v2;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.DOM.Prop (line 113, column 5 - line 135, column 15): " + [v2.constructor.name]);
|
|
};
|
|
};
|
|
var $lazy_patchProp = $runtime_lazy5("patchProp", "Halogen.VDom.DOM.Prop", function() {
|
|
return function(state3, ps2) {
|
|
var events = newMutMap();
|
|
var onThis = removeProp(state3.events);
|
|
var onThese = diffProp(state3.events, events);
|
|
var onThat = applyProp(events);
|
|
var props = diffWithKeyAndIxE(state3.props, ps2, propToStrKey, onThese, onThis, onThat);
|
|
var nextState = {
|
|
events: unsafeFreeze2(events),
|
|
props
|
|
};
|
|
return mkStep(new Step(unit, nextState, $lazy_patchProp(100), haltProp));
|
|
};
|
|
});
|
|
var patchProp = $lazy_patchProp(87);
|
|
var renderProp = function(ps1) {
|
|
var events = newMutMap();
|
|
var ps1$prime = strMapWithIxE(ps1, propToStrKey, applyProp(events));
|
|
var state3 = {
|
|
events: unsafeFreeze2(events),
|
|
props: ps1$prime
|
|
};
|
|
return mkStep(new Step(unit, state3, patchProp, haltProp));
|
|
};
|
|
return renderProp;
|
|
};
|
|
};
|
|
|
|
// output/Web.HTML.Common/index.js
|
|
var ClassName = function(x) {
|
|
return x;
|
|
};
|
|
|
|
// output/Halogen.HTML.Core/index.js
|
|
var map17 = /* @__PURE__ */ map(functorArray);
|
|
var map18 = /* @__PURE__ */ map(functorProp);
|
|
var map22 = /* @__PURE__ */ map(functorInput);
|
|
var bimap3 = /* @__PURE__ */ bimap(bifunctorVDom);
|
|
var HTML = function(x) {
|
|
return x;
|
|
};
|
|
var widget = function($28) {
|
|
return HTML(Widget.create($28));
|
|
};
|
|
var toPropValue = function(dict) {
|
|
return dict.toPropValue;
|
|
};
|
|
var text = function($29) {
|
|
return HTML(Text.create($29));
|
|
};
|
|
var prop = function(dictIsProp) {
|
|
var toPropValue1 = toPropValue(dictIsProp);
|
|
return function(v) {
|
|
var $31 = Property.create(v);
|
|
return function($32) {
|
|
return $31(toPropValue1($32));
|
|
};
|
|
};
|
|
};
|
|
var isPropString = {
|
|
toPropValue: propFromString
|
|
};
|
|
var isPropButtonType = {
|
|
toPropValue: function($50) {
|
|
return propFromString(renderButtonType($50));
|
|
}
|
|
};
|
|
var handler = /* @__PURE__ */ function() {
|
|
return Handler.create;
|
|
}();
|
|
var element = function(ns) {
|
|
return function(name16) {
|
|
return function(props) {
|
|
return function(children2) {
|
|
return new Elem(ns, name16, props, children2);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var bifunctorHTML = {
|
|
bimap: function(f) {
|
|
return function(g) {
|
|
return function(v) {
|
|
return bimap3(map17(map18(map22(g))))(f)(v);
|
|
};
|
|
};
|
|
}
|
|
};
|
|
|
|
// output/Halogen.HTML.Properties/index.js
|
|
var unwrap2 = /* @__PURE__ */ unwrap();
|
|
var prop2 = function(dictIsProp) {
|
|
return prop(dictIsProp);
|
|
};
|
|
var prop22 = /* @__PURE__ */ prop2(isPropString);
|
|
var type_ = function(dictIsProp) {
|
|
return prop2(dictIsProp)("type");
|
|
};
|
|
var value = function(dictIsProp) {
|
|
return prop2(dictIsProp)("value");
|
|
};
|
|
var placeholder = /* @__PURE__ */ prop22("placeholder");
|
|
var href = /* @__PURE__ */ prop22("href");
|
|
var class_ = /* @__PURE__ */ function() {
|
|
var $36 = prop22("className");
|
|
return function($37) {
|
|
return $36(unwrap2($37));
|
|
};
|
|
}();
|
|
|
|
// output/Control.Applicative.Free/index.js
|
|
var identity9 = /* @__PURE__ */ identity(categoryFn);
|
|
var Pure = /* @__PURE__ */ function() {
|
|
function Pure2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Pure2.create = function(value0) {
|
|
return new Pure2(value0);
|
|
};
|
|
return Pure2;
|
|
}();
|
|
var Lift = /* @__PURE__ */ function() {
|
|
function Lift3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Lift3.create = function(value0) {
|
|
return new Lift3(value0);
|
|
};
|
|
return Lift3;
|
|
}();
|
|
var Ap = /* @__PURE__ */ function() {
|
|
function Ap2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Ap2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Ap2(value0, value1);
|
|
};
|
|
};
|
|
return Ap2;
|
|
}();
|
|
var mkAp = function(fba) {
|
|
return function(fb) {
|
|
return new Ap(fba, fb);
|
|
};
|
|
};
|
|
var liftFreeAp = /* @__PURE__ */ function() {
|
|
return Lift.create;
|
|
}();
|
|
var goLeft = function(dictApplicative) {
|
|
var pure23 = pure(dictApplicative);
|
|
return function(fStack) {
|
|
return function(valStack) {
|
|
return function(nat) {
|
|
return function(func) {
|
|
return function(count) {
|
|
if (func instanceof Pure) {
|
|
return new Tuple(new Cons({
|
|
func: pure23(func.value0),
|
|
count
|
|
}, fStack), valStack);
|
|
}
|
|
;
|
|
if (func instanceof Lift) {
|
|
return new Tuple(new Cons({
|
|
func: nat(func.value0),
|
|
count
|
|
}, fStack), valStack);
|
|
}
|
|
;
|
|
if (func instanceof Ap) {
|
|
return goLeft(dictApplicative)(fStack)(cons3(func.value1)(valStack))(nat)(func.value0)(count + 1 | 0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 102, column 41 - line 105, column 81): " + [func.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var goApply = function(dictApplicative) {
|
|
var apply6 = apply(dictApplicative.Apply0());
|
|
return function(fStack) {
|
|
return function(vals) {
|
|
return function(gVal) {
|
|
if (fStack instanceof Nil) {
|
|
return new Left(gVal);
|
|
}
|
|
;
|
|
if (fStack instanceof Cons) {
|
|
var gRes = apply6(fStack.value0.func)(gVal);
|
|
var $31 = fStack.value0.count === 1;
|
|
if ($31) {
|
|
if (fStack.value1 instanceof Nil) {
|
|
return new Left(gRes);
|
|
}
|
|
;
|
|
return goApply(dictApplicative)(fStack.value1)(vals)(gRes);
|
|
}
|
|
;
|
|
if (vals instanceof Nil) {
|
|
return new Left(gRes);
|
|
}
|
|
;
|
|
if (vals instanceof Cons) {
|
|
return new Right(new Tuple(new Cons({
|
|
func: gRes,
|
|
count: fStack.value0.count - 1 | 0
|
|
}, fStack.value1), new NonEmpty(vals.value0, vals.value1)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 83, column 11 - line 88, column 50): " + [vals.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 72, column 3 - line 88, column 50): " + [fStack.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var functorFreeAp = {
|
|
map: function(f) {
|
|
return function(x) {
|
|
return mkAp(new Pure(f))(x);
|
|
};
|
|
}
|
|
};
|
|
var foldFreeAp = function(dictApplicative) {
|
|
var goApply1 = goApply(dictApplicative);
|
|
var pure23 = pure(dictApplicative);
|
|
var goLeft1 = goLeft(dictApplicative);
|
|
return function(nat) {
|
|
return function(z) {
|
|
var go2 = function($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
if (v.value1.value0 instanceof Pure) {
|
|
var v1 = goApply1(v.value0)(v.value1.value1)(pure23(v.value1.value0.value0));
|
|
if (v1 instanceof Left) {
|
|
$tco_done = true;
|
|
return v1.value0;
|
|
}
|
|
;
|
|
if (v1 instanceof Right) {
|
|
$copy_v = v1.value0;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 54, column 17 - line 56, column 24): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
if (v.value1.value0 instanceof Lift) {
|
|
var v1 = goApply1(v.value0)(v.value1.value1)(nat(v.value1.value0.value0));
|
|
if (v1 instanceof Left) {
|
|
$tco_done = true;
|
|
return v1.value0;
|
|
}
|
|
;
|
|
if (v1 instanceof Right) {
|
|
$copy_v = v1.value0;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 57, column 17 - line 59, column 24): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
if (v.value1.value0 instanceof Ap) {
|
|
var nextVals = new NonEmpty(v.value1.value0.value1, v.value1.value1);
|
|
$copy_v = goLeft1(v.value0)(nextVals)(nat)(v.value1.value0.value0)(1);
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Applicative.Free (line 53, column 5 - line 62, column 47): " + [v.value1.value0.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
return go2(new Tuple(Nil.value, singleton6(z)));
|
|
};
|
|
};
|
|
};
|
|
var retractFreeAp = function(dictApplicative) {
|
|
return foldFreeAp(dictApplicative)(identity9);
|
|
};
|
|
var applyFreeAp = {
|
|
apply: function(fba) {
|
|
return function(fb) {
|
|
return mkAp(fba)(fb);
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorFreeAp;
|
|
}
|
|
};
|
|
var applicativeFreeAp = /* @__PURE__ */ function() {
|
|
return {
|
|
pure: Pure.create,
|
|
Apply0: function() {
|
|
return applyFreeAp;
|
|
}
|
|
};
|
|
}();
|
|
var foldFreeAp1 = /* @__PURE__ */ foldFreeAp(applicativeFreeAp);
|
|
var hoistFreeAp = function(f) {
|
|
return foldFreeAp1(function($54) {
|
|
return liftFreeAp(f($54));
|
|
});
|
|
};
|
|
|
|
// output/Data.CatQueue/index.js
|
|
var CatQueue = /* @__PURE__ */ function() {
|
|
function CatQueue2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
CatQueue2.create = function(value0) {
|
|
return function(value1) {
|
|
return new CatQueue2(value0, value1);
|
|
};
|
|
};
|
|
return CatQueue2;
|
|
}();
|
|
var uncons3 = function($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
if (v.value0 instanceof Nil && v.value1 instanceof Nil) {
|
|
$tco_done = true;
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
if (v.value0 instanceof Nil) {
|
|
$copy_v = new CatQueue(reverse2(v.value1), Nil.value);
|
|
return;
|
|
}
|
|
;
|
|
if (v.value0 instanceof Cons) {
|
|
$tco_done = true;
|
|
return new Just(new Tuple(v.value0.value0, new CatQueue(v.value0.value1, v.value1)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.CatQueue (line 82, column 1 - line 82, column 63): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
var snoc4 = function(v) {
|
|
return function(a2) {
|
|
return new CatQueue(v.value0, new Cons(a2, v.value1));
|
|
};
|
|
};
|
|
var $$null3 = function(v) {
|
|
if (v.value0 instanceof Nil && v.value1 instanceof Nil) {
|
|
return true;
|
|
}
|
|
;
|
|
return false;
|
|
};
|
|
var empty4 = /* @__PURE__ */ function() {
|
|
return new CatQueue(Nil.value, Nil.value);
|
|
}();
|
|
|
|
// output/Data.CatList/index.js
|
|
var CatNil = /* @__PURE__ */ function() {
|
|
function CatNil2() {
|
|
}
|
|
;
|
|
CatNil2.value = new CatNil2();
|
|
return CatNil2;
|
|
}();
|
|
var CatCons = /* @__PURE__ */ function() {
|
|
function CatCons2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
CatCons2.create = function(value0) {
|
|
return function(value1) {
|
|
return new CatCons2(value0, value1);
|
|
};
|
|
};
|
|
return CatCons2;
|
|
}();
|
|
var link = function(v) {
|
|
return function(v1) {
|
|
if (v instanceof CatNil) {
|
|
return v1;
|
|
}
|
|
;
|
|
if (v1 instanceof CatNil) {
|
|
return v;
|
|
}
|
|
;
|
|
if (v instanceof CatCons) {
|
|
return new CatCons(v.value0, snoc4(v.value1)(v1));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.CatList (line 108, column 1 - line 108, column 54): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
var foldr4 = function(k) {
|
|
return function(b2) {
|
|
return function(q2) {
|
|
var foldl4 = function($copy_v) {
|
|
return function($copy_v1) {
|
|
return function($copy_v2) {
|
|
var $tco_var_v = $copy_v;
|
|
var $tco_var_v1 = $copy_v1;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v, v1, v2) {
|
|
if (v2 instanceof Nil) {
|
|
$tco_done = true;
|
|
return v1;
|
|
}
|
|
;
|
|
if (v2 instanceof Cons) {
|
|
$tco_var_v = v;
|
|
$tco_var_v1 = v(v1)(v2.value0);
|
|
$copy_v2 = v2.value1;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.CatList (line 124, column 3 - line 124, column 59): " + [v.constructor.name, v1.constructor.name, v2.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_v, $tco_var_v1, $copy_v2);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
};
|
|
var go2 = function($copy_xs) {
|
|
return function($copy_ys) {
|
|
var $tco_var_xs = $copy_xs;
|
|
var $tco_done1 = false;
|
|
var $tco_result;
|
|
function $tco_loop(xs, ys) {
|
|
var v = uncons3(xs);
|
|
if (v instanceof Nothing) {
|
|
$tco_done1 = true;
|
|
return foldl4(function(x) {
|
|
return function(i2) {
|
|
return i2(x);
|
|
};
|
|
})(b2)(ys);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
$tco_var_xs = v.value0.value1;
|
|
$copy_ys = new Cons(k(v.value0.value0), ys);
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.CatList (line 120, column 14 - line 122, column 67): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done1) {
|
|
$tco_result = $tco_loop($tco_var_xs, $copy_ys);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go2(q2)(Nil.value);
|
|
};
|
|
};
|
|
};
|
|
var uncons4 = function(v) {
|
|
if (v instanceof CatNil) {
|
|
return Nothing.value;
|
|
}
|
|
;
|
|
if (v instanceof CatCons) {
|
|
return new Just(new Tuple(v.value0, function() {
|
|
var $66 = $$null3(v.value1);
|
|
if ($66) {
|
|
return CatNil.value;
|
|
}
|
|
;
|
|
return foldr4(link)(CatNil.value)(v.value1);
|
|
}()));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.CatList (line 99, column 1 - line 99, column 61): " + [v.constructor.name]);
|
|
};
|
|
var empty5 = /* @__PURE__ */ function() {
|
|
return CatNil.value;
|
|
}();
|
|
var append3 = link;
|
|
var semigroupCatList = {
|
|
append: append3
|
|
};
|
|
var snoc5 = function(cat) {
|
|
return function(a2) {
|
|
return append3(cat)(new CatCons(a2, empty4));
|
|
};
|
|
};
|
|
|
|
// output/Control.Monad.Free/index.js
|
|
var $runtime_lazy6 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var append4 = /* @__PURE__ */ append(semigroupCatList);
|
|
var map19 = /* @__PURE__ */ map(functorFn);
|
|
var Free = /* @__PURE__ */ function() {
|
|
function Free2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Free2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Free2(value0, value1);
|
|
};
|
|
};
|
|
return Free2;
|
|
}();
|
|
var Return = /* @__PURE__ */ function() {
|
|
function Return2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Return2.create = function(value0) {
|
|
return new Return2(value0);
|
|
};
|
|
return Return2;
|
|
}();
|
|
var Bind = /* @__PURE__ */ function() {
|
|
function Bind2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Bind2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Bind2(value0, value1);
|
|
};
|
|
};
|
|
return Bind2;
|
|
}();
|
|
var toView = function($copy_v) {
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(v) {
|
|
var runExpF = function(v22) {
|
|
return v22;
|
|
};
|
|
var concatF = function(v22) {
|
|
return function(r) {
|
|
return new Free(v22.value0, append4(v22.value1)(r));
|
|
};
|
|
};
|
|
if (v.value0 instanceof Return) {
|
|
var v2 = uncons4(v.value1);
|
|
if (v2 instanceof Nothing) {
|
|
$tco_done = true;
|
|
return new Return(v.value0.value0);
|
|
}
|
|
;
|
|
if (v2 instanceof Just) {
|
|
$copy_v = concatF(runExpF(v2.value0.value0)(v.value0.value0))(v2.value0.value1);
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 227, column 7 - line 231, column 64): " + [v2.constructor.name]);
|
|
}
|
|
;
|
|
if (v.value0 instanceof Bind) {
|
|
$tco_done = true;
|
|
return new Bind(v.value0.value0, function(a2) {
|
|
return concatF(v.value0.value1(a2))(v.value1);
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 225, column 3 - line 233, column 56): " + [v.value0.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($copy_v);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
var fromView = function(f) {
|
|
return new Free(f, empty5);
|
|
};
|
|
var freeMonad = {
|
|
Applicative0: function() {
|
|
return freeApplicative;
|
|
},
|
|
Bind1: function() {
|
|
return freeBind;
|
|
}
|
|
};
|
|
var freeFunctor = {
|
|
map: function(k) {
|
|
return function(f) {
|
|
return bindFlipped(freeBind)(function() {
|
|
var $189 = pure(freeApplicative);
|
|
return function($190) {
|
|
return $189(k($190));
|
|
};
|
|
}())(f);
|
|
};
|
|
}
|
|
};
|
|
var freeBind = {
|
|
bind: function(v) {
|
|
return function(k) {
|
|
return new Free(v.value0, snoc5(v.value1)(k));
|
|
};
|
|
},
|
|
Apply0: function() {
|
|
return $lazy_freeApply(0);
|
|
}
|
|
};
|
|
var freeApplicative = {
|
|
pure: function($191) {
|
|
return fromView(Return.create($191));
|
|
},
|
|
Apply0: function() {
|
|
return $lazy_freeApply(0);
|
|
}
|
|
};
|
|
var $lazy_freeApply = /* @__PURE__ */ $runtime_lazy6("freeApply", "Control.Monad.Free", function() {
|
|
return {
|
|
apply: ap(freeMonad),
|
|
Functor0: function() {
|
|
return freeFunctor;
|
|
}
|
|
};
|
|
});
|
|
var bind3 = /* @__PURE__ */ bind(freeBind);
|
|
var pure7 = /* @__PURE__ */ pure(freeApplicative);
|
|
var liftF = function(f) {
|
|
return fromView(new Bind(f, function($192) {
|
|
return pure7($192);
|
|
}));
|
|
};
|
|
var substFree = function(k) {
|
|
var go2 = function(f) {
|
|
var v = toView(f);
|
|
if (v instanceof Return) {
|
|
return pure7(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Bind) {
|
|
return bind3(k(v.value0))(map19(go2)(v.value1));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 168, column 10 - line 170, column 33): " + [v.constructor.name]);
|
|
};
|
|
return go2;
|
|
};
|
|
var hoistFree = function(k) {
|
|
return substFree(function($193) {
|
|
return liftF(k($193));
|
|
});
|
|
};
|
|
var foldFree = function(dictMonadRec) {
|
|
var Monad0 = dictMonadRec.Monad0();
|
|
var map116 = map(Monad0.Bind1().Apply0().Functor0());
|
|
var pure111 = pure(Monad0.Applicative0());
|
|
var tailRecM4 = tailRecM(dictMonadRec);
|
|
return function(k) {
|
|
var go2 = function(f) {
|
|
var v = toView(f);
|
|
if (v instanceof Return) {
|
|
return map116(Done.create)(pure111(v.value0));
|
|
}
|
|
;
|
|
if (v instanceof Bind) {
|
|
return map116(function($199) {
|
|
return Loop.create(v.value1($199));
|
|
})(k(v.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Control.Monad.Free (line 158, column 10 - line 160, column 37): " + [v.constructor.name]);
|
|
};
|
|
return tailRecM4(go2);
|
|
};
|
|
};
|
|
|
|
// output/Halogen.Data.OrdBox/index.js
|
|
var OrdBox = /* @__PURE__ */ function() {
|
|
function OrdBox2(value0, value1, value22) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
}
|
|
;
|
|
OrdBox2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return new OrdBox2(value0, value1, value22);
|
|
};
|
|
};
|
|
};
|
|
return OrdBox2;
|
|
}();
|
|
var mkOrdBox = function(dictOrd) {
|
|
return OrdBox.create(eq(dictOrd.Eq0()))(compare(dictOrd));
|
|
};
|
|
var eqOrdBox = {
|
|
eq: function(v) {
|
|
return function(v1) {
|
|
return v.value0(v.value2)(v1.value2);
|
|
};
|
|
}
|
|
};
|
|
var ordOrdBox = {
|
|
compare: function(v) {
|
|
return function(v1) {
|
|
return v.value1(v.value2)(v1.value2);
|
|
};
|
|
},
|
|
Eq0: function() {
|
|
return eqOrdBox;
|
|
}
|
|
};
|
|
|
|
// output/Halogen.Data.Slot/index.js
|
|
var ordTuple2 = /* @__PURE__ */ ordTuple(ordString)(ordOrdBox);
|
|
var pop1 = /* @__PURE__ */ pop(ordTuple2);
|
|
var lookup1 = /* @__PURE__ */ lookup2(ordTuple2);
|
|
var insert1 = /* @__PURE__ */ insert3(ordTuple2);
|
|
var pop2 = function() {
|
|
return function(dictIsSymbol) {
|
|
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var mkOrdBox2 = mkOrdBox(dictOrd);
|
|
return function(sym) {
|
|
return function(key) {
|
|
return function(v) {
|
|
return pop1(new Tuple(reflectSymbol2(sym), mkOrdBox2(key)))(v);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var lookup3 = function() {
|
|
return function(dictIsSymbol) {
|
|
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var mkOrdBox2 = mkOrdBox(dictOrd);
|
|
return function(sym) {
|
|
return function(key) {
|
|
return function(v) {
|
|
return lookup1(new Tuple(reflectSymbol2(sym), mkOrdBox2(key)))(v);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var insert5 = function() {
|
|
return function(dictIsSymbol) {
|
|
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var mkOrdBox2 = mkOrdBox(dictOrd);
|
|
return function(sym) {
|
|
return function(key) {
|
|
return function(val) {
|
|
return function(v) {
|
|
return insert1(new Tuple(reflectSymbol2(sym), mkOrdBox2(key)))(val)(v);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var foreachSlot = function(dictApplicative) {
|
|
var traverse_7 = traverse_(dictApplicative)(foldableMap);
|
|
return function(v) {
|
|
return function(k) {
|
|
return traverse_7(function($54) {
|
|
return k($54);
|
|
})(v);
|
|
};
|
|
};
|
|
};
|
|
var empty6 = empty3;
|
|
|
|
// output/Halogen.Query.ChildQuery/index.js
|
|
var ChildQuery = /* @__PURE__ */ function() {
|
|
function ChildQuery3(value0, value1, value22) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
}
|
|
;
|
|
ChildQuery3.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return new ChildQuery3(value0, value1, value22);
|
|
};
|
|
};
|
|
};
|
|
return ChildQuery3;
|
|
}();
|
|
var unChildQueryBox = unsafeCoerce2;
|
|
var mkChildQueryBox = unsafeCoerce2;
|
|
|
|
// output/Unsafe.Reference/foreign.js
|
|
function reallyUnsafeRefEq(a2) {
|
|
return function(b2) {
|
|
return a2 === b2;
|
|
};
|
|
}
|
|
|
|
// output/Unsafe.Reference/index.js
|
|
var unsafeRefEq = reallyUnsafeRefEq;
|
|
|
|
// output/Halogen.Subscription/index.js
|
|
var $$void4 = /* @__PURE__ */ $$void(functorEffect);
|
|
var coerce3 = /* @__PURE__ */ coerce();
|
|
var bind4 = /* @__PURE__ */ bind(bindEffect);
|
|
var append5 = /* @__PURE__ */ append(semigroupArray);
|
|
var traverse_2 = /* @__PURE__ */ traverse_(applicativeEffect);
|
|
var traverse_1 = /* @__PURE__ */ traverse_2(foldableArray);
|
|
var unsubscribe = function(v) {
|
|
return v;
|
|
};
|
|
var subscribe = function(v) {
|
|
return function(k) {
|
|
return v(function($76) {
|
|
return $$void4(k($76));
|
|
});
|
|
};
|
|
};
|
|
var notify = function(v) {
|
|
return function(a2) {
|
|
return v(a2);
|
|
};
|
|
};
|
|
var makeEmitter = coerce3;
|
|
var functorEmitter = {
|
|
map: function(f) {
|
|
return function(v) {
|
|
return function(k) {
|
|
return v(function($77) {
|
|
return k(f($77));
|
|
});
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var create = function __do() {
|
|
var subscribers = $$new([])();
|
|
return {
|
|
emitter: function(k) {
|
|
return function __do2() {
|
|
modify_(function(v) {
|
|
return append5(v)([k]);
|
|
})(subscribers)();
|
|
return modify_(deleteBy(unsafeRefEq)(k))(subscribers);
|
|
};
|
|
},
|
|
listener: function(a2) {
|
|
return bind4(read(subscribers))(traverse_1(function(k) {
|
|
return k(a2);
|
|
}));
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/Halogen.Query.HalogenM/index.js
|
|
var identity10 = /* @__PURE__ */ identity(categoryFn);
|
|
var lookup4 = /* @__PURE__ */ lookup3();
|
|
var over2 = /* @__PURE__ */ over()();
|
|
var SubscriptionId = function(x) {
|
|
return x;
|
|
};
|
|
var ForkId = function(x) {
|
|
return x;
|
|
};
|
|
var State = /* @__PURE__ */ function() {
|
|
function State2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
State2.create = function(value0) {
|
|
return new State2(value0);
|
|
};
|
|
return State2;
|
|
}();
|
|
var Subscribe = /* @__PURE__ */ function() {
|
|
function Subscribe2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Subscribe2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Subscribe2(value0, value1);
|
|
};
|
|
};
|
|
return Subscribe2;
|
|
}();
|
|
var Unsubscribe = /* @__PURE__ */ function() {
|
|
function Unsubscribe2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Unsubscribe2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Unsubscribe2(value0, value1);
|
|
};
|
|
};
|
|
return Unsubscribe2;
|
|
}();
|
|
var Lift2 = /* @__PURE__ */ function() {
|
|
function Lift3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Lift3.create = function(value0) {
|
|
return new Lift3(value0);
|
|
};
|
|
return Lift3;
|
|
}();
|
|
var ChildQuery2 = /* @__PURE__ */ function() {
|
|
function ChildQuery3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ChildQuery3.create = function(value0) {
|
|
return new ChildQuery3(value0);
|
|
};
|
|
return ChildQuery3;
|
|
}();
|
|
var Raise = /* @__PURE__ */ function() {
|
|
function Raise3(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Raise3.create = function(value0) {
|
|
return function(value1) {
|
|
return new Raise3(value0, value1);
|
|
};
|
|
};
|
|
return Raise3;
|
|
}();
|
|
var Par = /* @__PURE__ */ function() {
|
|
function Par2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Par2.create = function(value0) {
|
|
return new Par2(value0);
|
|
};
|
|
return Par2;
|
|
}();
|
|
var Fork = /* @__PURE__ */ function() {
|
|
function Fork2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Fork2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Fork2(value0, value1);
|
|
};
|
|
};
|
|
return Fork2;
|
|
}();
|
|
var Join = /* @__PURE__ */ function() {
|
|
function Join2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Join2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Join2(value0, value1);
|
|
};
|
|
};
|
|
return Join2;
|
|
}();
|
|
var Kill = /* @__PURE__ */ function() {
|
|
function Kill2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Kill2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Kill2(value0, value1);
|
|
};
|
|
};
|
|
return Kill2;
|
|
}();
|
|
var GetRef = /* @__PURE__ */ function() {
|
|
function GetRef2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
GetRef2.create = function(value0) {
|
|
return function(value1) {
|
|
return new GetRef2(value0, value1);
|
|
};
|
|
};
|
|
return GetRef2;
|
|
}();
|
|
var HalogenAp = function(x) {
|
|
return x;
|
|
};
|
|
var HalogenM = function(x) {
|
|
return x;
|
|
};
|
|
var subscribe2 = function(es) {
|
|
return liftF(new Subscribe(function(v) {
|
|
return es;
|
|
}, identity10));
|
|
};
|
|
var raise = function(o) {
|
|
return liftF(new Raise(o, unit));
|
|
};
|
|
var query = function() {
|
|
return function(dictIsSymbol) {
|
|
var lookup13 = lookup4(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var lookup23 = lookup13(dictOrd);
|
|
return function(label5) {
|
|
return function(p2) {
|
|
return function(q2) {
|
|
return liftF(new ChildQuery2(mkChildQueryBox(new ChildQuery(function(dictApplicative) {
|
|
var pure111 = pure(dictApplicative);
|
|
return function(k) {
|
|
var $177 = maybe(pure111(Nothing.value))(k);
|
|
var $178 = lookup23(label5)(p2);
|
|
return function($179) {
|
|
return $177($178($179));
|
|
};
|
|
};
|
|
}, q2, identity10))));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var ordSubscriptionId = ordInt;
|
|
var ordForkId = ordInt;
|
|
var monadTransHalogenM = {
|
|
lift: function(dictMonad) {
|
|
return function($180) {
|
|
return HalogenM(liftF(Lift2.create($180)));
|
|
};
|
|
}
|
|
};
|
|
var monadHalogenM = freeMonad;
|
|
var monadStateHalogenM = {
|
|
state: function($181) {
|
|
return HalogenM(liftF(State.create($181)));
|
|
},
|
|
Monad0: function() {
|
|
return monadHalogenM;
|
|
}
|
|
};
|
|
var monadEffectHalogenM = function(dictMonadEffect) {
|
|
return {
|
|
liftEffect: function() {
|
|
var $186 = liftEffect(dictMonadEffect);
|
|
return function($187) {
|
|
return HalogenM(liftF(Lift2.create($186($187))));
|
|
};
|
|
}(),
|
|
Monad0: function() {
|
|
return monadHalogenM;
|
|
}
|
|
};
|
|
};
|
|
var monadAffHalogenM = function(dictMonadAff) {
|
|
var monadEffectHalogenM1 = monadEffectHalogenM(dictMonadAff.MonadEffect0());
|
|
return {
|
|
liftAff: function() {
|
|
var $188 = liftAff(dictMonadAff);
|
|
return function($189) {
|
|
return HalogenM(liftF(Lift2.create($188($189))));
|
|
};
|
|
}(),
|
|
MonadEffect0: function() {
|
|
return monadEffectHalogenM1;
|
|
}
|
|
};
|
|
};
|
|
var hoist = function(dictFunctor) {
|
|
return function(nat) {
|
|
return function(v) {
|
|
var go2 = function(v1) {
|
|
if (v1 instanceof State) {
|
|
return new State(v1.value0);
|
|
}
|
|
;
|
|
if (v1 instanceof Subscribe) {
|
|
return new Subscribe(v1.value0, v1.value1);
|
|
}
|
|
;
|
|
if (v1 instanceof Unsubscribe) {
|
|
return new Unsubscribe(v1.value0, v1.value1);
|
|
}
|
|
;
|
|
if (v1 instanceof Lift2) {
|
|
return new Lift2(nat(v1.value0));
|
|
}
|
|
;
|
|
if (v1 instanceof ChildQuery2) {
|
|
return new ChildQuery2(v1.value0);
|
|
}
|
|
;
|
|
if (v1 instanceof Raise) {
|
|
return new Raise(v1.value0, v1.value1);
|
|
}
|
|
;
|
|
if (v1 instanceof Par) {
|
|
return new Par(over2(HalogenAp)(hoistFreeAp(hoist(dictFunctor)(nat)))(v1.value0));
|
|
}
|
|
;
|
|
if (v1 instanceof Fork) {
|
|
return new Fork(hoist(dictFunctor)(nat)(v1.value0), v1.value1);
|
|
}
|
|
;
|
|
if (v1 instanceof Join) {
|
|
return new Join(v1.value0, v1.value1);
|
|
}
|
|
;
|
|
if (v1 instanceof Kill) {
|
|
return new Kill(v1.value0, v1.value1);
|
|
}
|
|
;
|
|
if (v1 instanceof GetRef) {
|
|
return new GetRef(v1.value0, v1.value1);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Query.HalogenM (line 312, column 8 - line 323, column 29): " + [v1.constructor.name]);
|
|
};
|
|
return hoistFree(go2)(v);
|
|
};
|
|
};
|
|
};
|
|
var functorHalogenM = freeFunctor;
|
|
var bindHalogenM = freeBind;
|
|
var applicativeHalogenM = freeApplicative;
|
|
|
|
// output/Data.Bifoldable/index.js
|
|
var bifoldableTuple = {
|
|
bifoldMap: function(dictMonoid) {
|
|
var append9 = append(dictMonoid.Semigroup0());
|
|
return function(f) {
|
|
return function(g) {
|
|
return function(v) {
|
|
return append9(f(v.value0))(g(v.value1));
|
|
};
|
|
};
|
|
};
|
|
},
|
|
bifoldr: function(f) {
|
|
return function(g) {
|
|
return function(z) {
|
|
return function(v) {
|
|
return f(v.value0)(g(v.value1)(z));
|
|
};
|
|
};
|
|
};
|
|
},
|
|
bifoldl: function(f) {
|
|
return function(g) {
|
|
return function(z) {
|
|
return function(v) {
|
|
return g(f(z)(v.value0))(v.value1);
|
|
};
|
|
};
|
|
};
|
|
}
|
|
};
|
|
|
|
// output/Data.Bitraversable/index.js
|
|
var bitraverse = function(dict) {
|
|
return dict.bitraverse;
|
|
};
|
|
var ltraverse = function(dictBitraversable) {
|
|
var bitraverse1 = bitraverse(dictBitraversable);
|
|
return function(dictApplicative) {
|
|
var bitraverse22 = bitraverse1(dictApplicative);
|
|
var pure23 = pure(dictApplicative);
|
|
return function(f) {
|
|
return bitraverse22(f)(pure23);
|
|
};
|
|
};
|
|
};
|
|
var bitraversableTuple = {
|
|
bitraverse: function(dictApplicative) {
|
|
var Apply0 = dictApplicative.Apply0();
|
|
var apply6 = apply(Apply0);
|
|
var map41 = map(Apply0.Functor0());
|
|
return function(f) {
|
|
return function(g) {
|
|
return function(v) {
|
|
return apply6(map41(Tuple.create)(f(v.value0)))(g(v.value1));
|
|
};
|
|
};
|
|
};
|
|
},
|
|
bisequence: function(dictApplicative) {
|
|
var Apply0 = dictApplicative.Apply0();
|
|
var apply6 = apply(Apply0);
|
|
var map41 = map(Apply0.Functor0());
|
|
return function(v) {
|
|
return apply6(map41(Tuple.create)(v.value0))(v.value1);
|
|
};
|
|
},
|
|
Bifunctor0: function() {
|
|
return bifunctorTuple;
|
|
},
|
|
Bifoldable1: function() {
|
|
return bifoldableTuple;
|
|
}
|
|
};
|
|
|
|
// output/JSURI/foreign.js
|
|
function encodeURIComponent_to_RFC3986(input3) {
|
|
return input3.replace(/[!'()*]/g, function(c) {
|
|
return "%" + c.charCodeAt(0).toString(16);
|
|
});
|
|
}
|
|
function _encodeURIComponent(fail4, succeed, input3) {
|
|
try {
|
|
return succeed(encodeURIComponent_to_RFC3986(encodeURIComponent(input3)));
|
|
} catch (err) {
|
|
return fail4(err);
|
|
}
|
|
}
|
|
function _encodeFormURLComponent(fail4, succeed, input3) {
|
|
try {
|
|
return succeed(encodeURIComponent_to_RFC3986(encodeURIComponent(input3)).replace(/%20/g, "+"));
|
|
} catch (err) {
|
|
return fail4(err);
|
|
}
|
|
}
|
|
function _decodeURIComponent(fail4, succeed, input3) {
|
|
try {
|
|
return succeed(decodeURIComponent(input3));
|
|
} catch (err) {
|
|
return fail4(err);
|
|
}
|
|
}
|
|
|
|
// output/JSURI/index.js
|
|
var $$encodeURIComponent = /* @__PURE__ */ function() {
|
|
return runFn3(_encodeURIComponent)($$const(Nothing.value))(Just.create);
|
|
}();
|
|
var encodeFormURLComponent = /* @__PURE__ */ function() {
|
|
return runFn3(_encodeFormURLComponent)($$const(Nothing.value))(Just.create);
|
|
}();
|
|
var $$decodeURIComponent = /* @__PURE__ */ function() {
|
|
return runFn3(_decodeURIComponent)($$const(Nothing.value))(Just.create);
|
|
}();
|
|
|
|
// output/Routing.Duplex.Types/index.js
|
|
var emptyRouteState = {
|
|
segments: [],
|
|
params: [],
|
|
hash: ""
|
|
};
|
|
|
|
// output/Routing.Duplex.Parser/index.js
|
|
var $runtime_lazy7 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var bitraverse2 = /* @__PURE__ */ bitraverse(bitraversableTuple)(applicativeEither);
|
|
var traverse2 = /* @__PURE__ */ traverse(traversableArray)(applicativeEither);
|
|
var map20 = /* @__PURE__ */ map(functorNonEmptyArray);
|
|
var map110 = /* @__PURE__ */ map(functorFn);
|
|
var foldl3 = /* @__PURE__ */ foldl(foldableNonEmptyArray);
|
|
var composeKleisli2 = /* @__PURE__ */ composeKleisli(bindEither);
|
|
var append6 = /* @__PURE__ */ append(semigroupNonEmptyArray);
|
|
var Expected = /* @__PURE__ */ function() {
|
|
function Expected2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Expected2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Expected2(value0, value1);
|
|
};
|
|
};
|
|
return Expected2;
|
|
}();
|
|
var ExpectedEndOfPath = /* @__PURE__ */ function() {
|
|
function ExpectedEndOfPath2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ExpectedEndOfPath2.create = function(value0) {
|
|
return new ExpectedEndOfPath2(value0);
|
|
};
|
|
return ExpectedEndOfPath2;
|
|
}();
|
|
var MalformedURIComponent = /* @__PURE__ */ function() {
|
|
function MalformedURIComponent2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
MalformedURIComponent2.create = function(value0) {
|
|
return new MalformedURIComponent2(value0);
|
|
};
|
|
return MalformedURIComponent2;
|
|
}();
|
|
var EndOfPath = /* @__PURE__ */ function() {
|
|
function EndOfPath2() {
|
|
}
|
|
;
|
|
EndOfPath2.value = new EndOfPath2();
|
|
return EndOfPath2;
|
|
}();
|
|
var Fail = /* @__PURE__ */ function() {
|
|
function Fail3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Fail3.create = function(value0) {
|
|
return new Fail3(value0);
|
|
};
|
|
return Fail3;
|
|
}();
|
|
var Success = /* @__PURE__ */ function() {
|
|
function Success3(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Success3.create = function(value0) {
|
|
return function(value1) {
|
|
return new Success3(value0, value1);
|
|
};
|
|
};
|
|
return Success3;
|
|
}();
|
|
var Alt = /* @__PURE__ */ function() {
|
|
function Alt2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Alt2.create = function(value0) {
|
|
return new Alt2(value0);
|
|
};
|
|
return Alt2;
|
|
}();
|
|
var Chomp = /* @__PURE__ */ function() {
|
|
function Chomp2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Chomp2.create = function(value0) {
|
|
return new Chomp2(value0);
|
|
};
|
|
return Chomp2;
|
|
}();
|
|
var Prefix = /* @__PURE__ */ function() {
|
|
function Prefix2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Prefix2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Prefix2(value0, value1);
|
|
};
|
|
};
|
|
return Prefix2;
|
|
}();
|
|
var take4 = /* @__PURE__ */ function() {
|
|
return new Chomp(function(state3) {
|
|
var v = uncons(state3.segments);
|
|
if (v instanceof Just) {
|
|
return new Success({
|
|
params: state3.params,
|
|
hash: state3.hash,
|
|
segments: v.value0.tail
|
|
}, v.value0.head);
|
|
}
|
|
;
|
|
return new Fail(EndOfPath.value);
|
|
});
|
|
}();
|
|
var prefix = /* @__PURE__ */ function() {
|
|
return Prefix.create;
|
|
}();
|
|
var parsePath = /* @__PURE__ */ function() {
|
|
var toRouteState = function(v) {
|
|
return {
|
|
segments: v.value0.value0,
|
|
params: v.value0.value1,
|
|
hash: v.value1
|
|
};
|
|
};
|
|
var splitNonEmpty = function(v) {
|
|
return function(v1) {
|
|
if (v1 === "") {
|
|
return [];
|
|
}
|
|
;
|
|
return split(v)(v1);
|
|
};
|
|
};
|
|
var splitAt4 = function(k) {
|
|
return function(p2) {
|
|
return function(str) {
|
|
var v = indexOf(p2)(str);
|
|
if (v instanceof Just) {
|
|
return new Tuple(take3(v.value0)(str), drop3(v.value0 + length3(p2) | 0)(str));
|
|
}
|
|
;
|
|
if (v instanceof Nothing) {
|
|
return k(str);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 191, column 5 - line 193, column 23): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var decodeURIComponent$prime = function(str) {
|
|
var v = $$decodeURIComponent(str);
|
|
if (v instanceof Nothing) {
|
|
return new Left(new MalformedURIComponent(str));
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return new Right(v.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 195, column 29 - line 197, column 22): " + [v.constructor.name]);
|
|
};
|
|
var splitKeyValue = function() {
|
|
var $349 = bitraverse2(decodeURIComponent$prime)(decodeURIComponent$prime);
|
|
var $350 = splitAt4(flip(Tuple.create)(""))("=");
|
|
return function($351) {
|
|
return $349($350($351));
|
|
};
|
|
}();
|
|
var splitParams = function() {
|
|
var $352 = traverse2(splitKeyValue);
|
|
var $353 = splitNonEmpty("&");
|
|
return function($354) {
|
|
return $352($353($354));
|
|
};
|
|
}();
|
|
var splitSegments = function() {
|
|
var $355 = splitNonEmpty("/");
|
|
return function($356) {
|
|
return function(v) {
|
|
if (v.length === 2 && (v[0] === "" && v[1] === "")) {
|
|
return new Right([""]);
|
|
}
|
|
;
|
|
return traverse2(decodeURIComponent$prime)(v);
|
|
}($355($356));
|
|
};
|
|
}();
|
|
var splitPath = function() {
|
|
var $357 = bitraverse2(splitSegments)(splitParams);
|
|
var $358 = splitAt4(flip(Tuple.create)(""))("?");
|
|
return function($359) {
|
|
return $357($358($359));
|
|
};
|
|
}();
|
|
var $360 = map(functorEither)(toRouteState);
|
|
var $361 = ltraverse(bitraversableTuple)(applicativeEither)(splitPath);
|
|
var $362 = splitAt4(flip(Tuple.create)(""))("#");
|
|
return function($363) {
|
|
return $360($361($362($363)));
|
|
};
|
|
}();
|
|
var functorRouteResult = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
if (m instanceof Fail) {
|
|
return new Fail(m.value0);
|
|
}
|
|
;
|
|
if (m instanceof Success) {
|
|
return new Success(m.value0, f(m.value1));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 0, column 0 - line 0, column 0): " + [m.constructor.name]);
|
|
};
|
|
}
|
|
};
|
|
var map23 = /* @__PURE__ */ map(functorRouteResult);
|
|
var functorRouteParser = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
if (m instanceof Alt) {
|
|
return new Alt(map20(map(functorRouteParser)(f))(m.value0));
|
|
}
|
|
;
|
|
if (m instanceof Chomp) {
|
|
return new Chomp(map110(map23(f))(m.value0));
|
|
}
|
|
;
|
|
if (m instanceof Prefix) {
|
|
return new Prefix(m.value0, map(functorRouteParser)(f)(m.value1));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 0, column 0 - line 0, column 0): " + [m.constructor.name]);
|
|
};
|
|
}
|
|
};
|
|
var end = /* @__PURE__ */ function() {
|
|
return new Chomp(function(state3) {
|
|
var v = head(state3.segments);
|
|
if (v instanceof Nothing) {
|
|
return new Success(state3, unit);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return new Fail(new ExpectedEndOfPath(v.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 266, column 3 - line 268, column 45): " + [v.constructor.name]);
|
|
});
|
|
}();
|
|
var chompPrefix = function(pre2) {
|
|
return function(state3) {
|
|
var v = head(state3.segments);
|
|
if (v instanceof Just && pre2 === v.value0) {
|
|
return new Success({
|
|
params: state3.params,
|
|
hash: state3.hash,
|
|
segments: drop(1)(state3.segments)
|
|
}, unit);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return new Fail(new Expected(pre2, v.value0));
|
|
}
|
|
;
|
|
return new Fail(EndOfPath.value);
|
|
};
|
|
};
|
|
var $lazy_runRouteParser = /* @__PURE__ */ $runtime_lazy7("runRouteParser", "Routing.Duplex.Parser", function() {
|
|
var goAlt = function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v1 instanceof Fail) {
|
|
return $lazy_runRouteParser(161)(v)(v2);
|
|
}
|
|
;
|
|
return v1;
|
|
};
|
|
};
|
|
};
|
|
var go2 = function($copy_state) {
|
|
return function($copy_v) {
|
|
var $tco_var_state = $copy_state;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(state3, v) {
|
|
if (v instanceof Alt) {
|
|
$tco_done = true;
|
|
return foldl3(goAlt(state3))(new Fail(EndOfPath.value))(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Chomp) {
|
|
$tco_done = true;
|
|
return v.value0(state3);
|
|
}
|
|
;
|
|
if (v instanceof Prefix) {
|
|
var v1 = chompPrefix(v.value0)(state3);
|
|
if (v1 instanceof Fail) {
|
|
$tco_done = true;
|
|
return new Fail(v1.value0);
|
|
}
|
|
;
|
|
if (v1 instanceof Success) {
|
|
$tco_var_state = v1.value0;
|
|
$copy_v = v.value1;
|
|
return;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 157, column 7 - line 159, column 40): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 153, column 14 - line 159, column 40): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_state, $copy_v);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
return go2;
|
|
});
|
|
var runRouteParser = /* @__PURE__ */ $lazy_runRouteParser(150);
|
|
var run3 = function(p2) {
|
|
return composeKleisli2(parsePath)(function() {
|
|
var $366 = flip(runRouteParser)(p2);
|
|
return function($367) {
|
|
return function(v) {
|
|
if (v instanceof Fail) {
|
|
return new Left(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Success) {
|
|
return new Right(v.value1);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 200, column 49 - line 202, column 29): " + [v.constructor.name]);
|
|
}($366($367));
|
|
};
|
|
}());
|
|
};
|
|
var applyRouteParser = {
|
|
apply: function(fx) {
|
|
return function(x) {
|
|
return new Chomp(function(state3) {
|
|
var v = runRouteParser(state3)(fx);
|
|
if (v instanceof Fail) {
|
|
return new Fail(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Success) {
|
|
return map23(v.value1)(runRouteParser(v.value0)(x));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 81, column 5 - line 83, column 56): " + [v.constructor.name]);
|
|
});
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorRouteParser;
|
|
}
|
|
};
|
|
var applicativeRouteParser = {
|
|
pure: /* @__PURE__ */ function() {
|
|
var $368 = flip(Success.create);
|
|
return function($369) {
|
|
return Chomp.create($368($369));
|
|
};
|
|
}(),
|
|
Apply0: function() {
|
|
return applyRouteParser;
|
|
}
|
|
};
|
|
var altSnoc = function(v) {
|
|
return function(v1) {
|
|
var v2 = function(v3) {
|
|
return snoc2(v)(v1);
|
|
};
|
|
if (v1 instanceof Prefix) {
|
|
var $310 = last2(v);
|
|
if ($310 instanceof Prefix) {
|
|
var $311 = v1.value0 === $310.value0;
|
|
if ($311) {
|
|
return snoc$prime(init2(v))(new Prefix(v1.value0, alt(altRouteParser)($310.value1)(v1.value1)));
|
|
}
|
|
;
|
|
return v2(true);
|
|
}
|
|
;
|
|
return v2(true);
|
|
}
|
|
;
|
|
return v2(true);
|
|
};
|
|
};
|
|
var altRouteParser = {
|
|
alt: function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Alt && v1 instanceof Alt) {
|
|
return new Alt(altAppend(v.value0)(v1.value0));
|
|
}
|
|
;
|
|
if (v instanceof Alt) {
|
|
return new Alt(altSnoc(v.value0)(v1));
|
|
}
|
|
;
|
|
if (v1 instanceof Alt) {
|
|
return new Alt(altCons(v)(v1.value0));
|
|
}
|
|
;
|
|
if (v instanceof Prefix && (v1 instanceof Prefix && v.value0 === v1.value0)) {
|
|
return new Prefix(v.value0, alt(altRouteParser)(v.value1)(v1.value1));
|
|
}
|
|
;
|
|
return new Alt(cons2(v)(singleton5(v1)));
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorRouteParser;
|
|
}
|
|
};
|
|
var altCons = function(v) {
|
|
return function(v1) {
|
|
var v2 = function(v3) {
|
|
return cons2(v)(v1);
|
|
};
|
|
if (v instanceof Prefix) {
|
|
var $330 = head2(v1);
|
|
if ($330 instanceof Prefix) {
|
|
var $331 = v.value0 === $330.value0;
|
|
if ($331) {
|
|
return cons$prime(new Prefix(v.value0, alt(altRouteParser)(v.value1)($330.value1)))(tail2(v1));
|
|
}
|
|
;
|
|
return v2(true);
|
|
}
|
|
;
|
|
return v2(true);
|
|
}
|
|
;
|
|
return v2(true);
|
|
};
|
|
};
|
|
var altAppend = function($copy_ls) {
|
|
return function($copy_rs) {
|
|
var $tco_var_ls = $copy_ls;
|
|
var $tco_done = false;
|
|
var $tco_result;
|
|
function $tco_loop(ls, rs) {
|
|
var v = function(v12) {
|
|
if (otherwise) {
|
|
return append6(ls)(rs);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 103, column 1 - line 107, column 35): " + [ls.constructor.name, rs.constructor.name]);
|
|
};
|
|
var $340 = last2(ls);
|
|
if ($340 instanceof Prefix) {
|
|
var $341 = head2(rs);
|
|
if ($341 instanceof Prefix) {
|
|
var $342 = $340.value0 === $341.value0;
|
|
if ($342) {
|
|
var rs$prime = cons$prime(new Prefix($340.value0, alt(altRouteParser)($340.value1)($341.value1)))(tail2(rs));
|
|
var v1 = fromArray(init2(ls));
|
|
if (v1 instanceof Just) {
|
|
$tco_var_ls = v1.value0;
|
|
$copy_rs = rs$prime;
|
|
return;
|
|
}
|
|
;
|
|
if (v1 instanceof Nothing) {
|
|
$tco_done = true;
|
|
return rs$prime;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Parser (line 116, column 9 - line 118, column 25): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
$tco_done = true;
|
|
return v(true);
|
|
}
|
|
;
|
|
$tco_done = true;
|
|
return v(true);
|
|
}
|
|
;
|
|
$tco_done = true;
|
|
return v(true);
|
|
}
|
|
;
|
|
while (!$tco_done) {
|
|
$tco_result = $tco_loop($tco_var_ls, $copy_rs);
|
|
}
|
|
;
|
|
return $tco_result;
|
|
};
|
|
};
|
|
|
|
// output/Routing.Duplex.Printer/index.js
|
|
var append7 = /* @__PURE__ */ append(/* @__PURE__ */ semigroupMaybe(semigroupString));
|
|
var semigroupRoutePrinter = {
|
|
append: function(v) {
|
|
return function(v1) {
|
|
return function($33) {
|
|
return v1(v($33));
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var put2 = function(str) {
|
|
return function(state3) {
|
|
return {
|
|
params: state3.params,
|
|
hash: state3.hash,
|
|
segments: snoc(state3.segments)(str)
|
|
};
|
|
};
|
|
};
|
|
var printPath = function(v) {
|
|
var printSegments = function(v1) {
|
|
if (v1.length === 1 && v1[0] === "") {
|
|
return "/";
|
|
}
|
|
;
|
|
return joinWith("/")(mapMaybe($$encodeURIComponent)(v1));
|
|
};
|
|
var printParam = function(v1) {
|
|
return function(v2) {
|
|
if (v2 === "") {
|
|
return $$encodeURIComponent(v1);
|
|
}
|
|
;
|
|
return append7($$encodeURIComponent(v1))(append7(new Just("="))($$encodeURIComponent(v2)));
|
|
};
|
|
};
|
|
var printParams = function(v1) {
|
|
if (v1.length === 0) {
|
|
return "";
|
|
}
|
|
;
|
|
return "?" + joinWith("&")(mapMaybe(uncurry(printParam))(v1));
|
|
};
|
|
var printHash = function(v1) {
|
|
if (v1 === "") {
|
|
return "";
|
|
}
|
|
;
|
|
return "#" + v1;
|
|
};
|
|
return printSegments(v.segments) + (printParams(v.params) + printHash(v.hash));
|
|
};
|
|
var run4 = /* @__PURE__ */ function() {
|
|
var $34 = applyFlipped(emptyRouteState);
|
|
var $35 = unwrap();
|
|
return function($36) {
|
|
return printPath($34($35($36)));
|
|
};
|
|
}();
|
|
var monoidRoutePRinter = {
|
|
mempty: /* @__PURE__ */ identity(categoryFn),
|
|
Semigroup0: function() {
|
|
return semigroupRoutePrinter;
|
|
}
|
|
};
|
|
|
|
// output/Routing.Duplex/index.js
|
|
var append8 = /* @__PURE__ */ append(semigroupRoutePrinter);
|
|
var applyFirst2 = /* @__PURE__ */ applyFirst(applyRouteParser);
|
|
var pure8 = /* @__PURE__ */ pure(applicativeRouteParser);
|
|
var apply3 = /* @__PURE__ */ apply(applyRouteParser);
|
|
var map21 = /* @__PURE__ */ map(functorRouteParser);
|
|
var mempty2 = /* @__PURE__ */ mempty(monoidRoutePRinter);
|
|
var apply1 = /* @__PURE__ */ apply(applyFn);
|
|
var map111 = /* @__PURE__ */ map(functorFn);
|
|
var RouteDuplex = /* @__PURE__ */ function() {
|
|
function RouteDuplex2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
RouteDuplex2.create = function(value0) {
|
|
return function(value1) {
|
|
return new RouteDuplex2(value0, value1);
|
|
};
|
|
};
|
|
return RouteDuplex2;
|
|
}();
|
|
var segment = /* @__PURE__ */ function() {
|
|
return new RouteDuplex(put2, take4);
|
|
}();
|
|
var profunctorRouteDuplex = {
|
|
dimap: function(f) {
|
|
return function(g) {
|
|
return function(v) {
|
|
return new RouteDuplex(function($137) {
|
|
return v.value0(f($137));
|
|
}, map21(g)(v.value1));
|
|
};
|
|
};
|
|
}
|
|
};
|
|
var print = function(v) {
|
|
return function($138) {
|
|
return run4(v.value0($138));
|
|
};
|
|
};
|
|
var prefix2 = function(s) {
|
|
return function(v) {
|
|
return new RouteDuplex(function(a2) {
|
|
return append8(put2(s))(v.value0(a2));
|
|
}, prefix(s)(v.value1));
|
|
};
|
|
};
|
|
var path = /* @__PURE__ */ function() {
|
|
var $139 = flip(foldr(foldableArray)(prefix2));
|
|
var $140 = split("/");
|
|
return function($141) {
|
|
return $139($140($141));
|
|
};
|
|
}();
|
|
var root = /* @__PURE__ */ path("");
|
|
var parse = function(v) {
|
|
return run3(v.value1);
|
|
};
|
|
var functorRouteDuplex = {
|
|
map: function(f) {
|
|
return function(m) {
|
|
return new RouteDuplex(m.value0, map21(f)(m.value1));
|
|
};
|
|
}
|
|
};
|
|
var end2 = function(v) {
|
|
return new RouteDuplex(v.value0, applyFirst2(v.value1)(end));
|
|
};
|
|
var applyRouteDuplex = {
|
|
apply: function(v) {
|
|
return function(v1) {
|
|
return new RouteDuplex(apply1(map111(append8)(v.value0))(v1.value0), apply3(v.value1)(v1.value1));
|
|
};
|
|
},
|
|
Functor0: function() {
|
|
return functorRouteDuplex;
|
|
}
|
|
};
|
|
var applicativeRouteDuplex = {
|
|
pure: /* @__PURE__ */ function() {
|
|
var $143 = RouteDuplex.create($$const(mempty2));
|
|
return function($144) {
|
|
return $143(pure8($144));
|
|
};
|
|
}(),
|
|
Apply0: function() {
|
|
return applyRouteDuplex;
|
|
}
|
|
};
|
|
|
|
// output/Routing.Duplex.Generic/index.js
|
|
var identity11 = /* @__PURE__ */ identity(categoryFn);
|
|
var map24 = /* @__PURE__ */ map(functorRouteParser);
|
|
var alt2 = /* @__PURE__ */ alt(altRouteParser);
|
|
var dimap2 = /* @__PURE__ */ dimap(profunctorRouteDuplex);
|
|
var noArgs = /* @__PURE__ */ function() {
|
|
return pure(applicativeRouteDuplex)(NoArguments.value);
|
|
}();
|
|
var gRouteNoArguments = {
|
|
gRouteDuplexCtr: identity11
|
|
};
|
|
var gRouteDuplexCtr = function(dict) {
|
|
return dict.gRouteDuplexCtr;
|
|
};
|
|
var gRouteDuplex = function(dict) {
|
|
return dict.gRouteDuplex;
|
|
};
|
|
var gRouteSum = function(dictGRouteDuplex) {
|
|
var gRouteDuplex1 = gRouteDuplex(dictGRouteDuplex);
|
|
return function(dictGRouteDuplex1) {
|
|
var gRouteDuplex2 = gRouteDuplex(dictGRouteDuplex1);
|
|
return {
|
|
gRouteDuplex: function(end$prime) {
|
|
return function(r) {
|
|
var v = gRouteDuplex1(end$prime)(r);
|
|
var v1 = gRouteDuplex2(end$prime)(r);
|
|
var enc = function(v2) {
|
|
if (v2 instanceof Inl) {
|
|
return v.value0(v2.value0);
|
|
}
|
|
;
|
|
if (v2 instanceof Inr) {
|
|
return v1.value0(v2.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Routing.Duplex.Generic (line 51, column 11 - line 53, column 22): " + [v2.constructor.name]);
|
|
};
|
|
var dec = alt2(map24(Inl.create)(v.value1))(map24(Inr.create)(v1.value1));
|
|
return new RouteDuplex(enc, dec);
|
|
};
|
|
}
|
|
};
|
|
};
|
|
};
|
|
var sum2 = function(dictGeneric) {
|
|
var from3 = from(dictGeneric);
|
|
var to2 = to(dictGeneric);
|
|
return function(dictGRouteDuplex) {
|
|
var $71 = dimap2(from3)(to2);
|
|
var $72 = gRouteDuplex(dictGRouteDuplex)(end2);
|
|
return function($73) {
|
|
return $71($72($73));
|
|
};
|
|
};
|
|
};
|
|
var gRouteConstructor = function(dictIsSymbol) {
|
|
var get7 = get2(dictIsSymbol)();
|
|
return function() {
|
|
return function(dictGRouteDuplexCtr) {
|
|
var gRouteDuplexCtr1 = gRouteDuplexCtr(dictGRouteDuplexCtr);
|
|
return {
|
|
gRouteDuplex: function(end$prime) {
|
|
return function(r) {
|
|
var v = end$prime(gRouteDuplexCtr1(get7($$Proxy.value)(r)));
|
|
var enc = function(v1) {
|
|
return v.value0(v1);
|
|
};
|
|
var dec = map24(Constructor)(v.value1);
|
|
return new RouteDuplex(enc, dec);
|
|
};
|
|
}
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var gRouteArgument = {
|
|
gRouteDuplexCtr: identity11
|
|
};
|
|
var gRouteAll = {
|
|
gRouteDuplexCtr: function(v) {
|
|
return new RouteDuplex(function(v1) {
|
|
return v.value0(v1);
|
|
}, map24(Argument)(v.value1));
|
|
}
|
|
};
|
|
|
|
// output/Routing.Duplex.Generic.Syntax/index.js
|
|
var gsepStringRoute = function(dictGRouteDuplexCtr) {
|
|
var gRouteDuplexCtr2 = gRouteDuplexCtr(dictGRouteDuplexCtr);
|
|
return {
|
|
gsep: function(a2) {
|
|
var $15 = prefix2(a2);
|
|
return function($16) {
|
|
return $15(gRouteDuplexCtr2($16));
|
|
};
|
|
}
|
|
};
|
|
};
|
|
var gsep = function(dict) {
|
|
return dict.gsep;
|
|
};
|
|
|
|
// output/Exblo.Navigate/index.js
|
|
var lift5 = /* @__PURE__ */ lift(monadTransHalogenM);
|
|
var Home = /* @__PURE__ */ function() {
|
|
function Home2() {
|
|
}
|
|
;
|
|
Home2.value = new Home2();
|
|
return Home2;
|
|
}();
|
|
var Tx = /* @__PURE__ */ function() {
|
|
function Tx2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Tx2.create = function(value0) {
|
|
return new Tx2(value0);
|
|
};
|
|
return Tx2;
|
|
}();
|
|
var navigate = function(dict) {
|
|
return dict.navigate;
|
|
};
|
|
var navigateHalogenM = function(dictNavigate) {
|
|
return {
|
|
navigate: function() {
|
|
var $47 = lift5(dictNavigate.Monad0());
|
|
var $48 = navigate(dictNavigate);
|
|
return function($49) {
|
|
return $47($48($49));
|
|
};
|
|
}(),
|
|
Monad0: function() {
|
|
return monadHalogenM;
|
|
}
|
|
};
|
|
};
|
|
var genericRoute = {
|
|
to: function(x) {
|
|
if (x instanceof Inl) {
|
|
return Home.value;
|
|
}
|
|
;
|
|
if (x instanceof Inr) {
|
|
return new Tx(x.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Navigate (line 24, column 1 - line 24, column 48): " + [x.constructor.name]);
|
|
},
|
|
from: function(x) {
|
|
if (x instanceof Home) {
|
|
return new Inl(NoArguments.value);
|
|
}
|
|
;
|
|
if (x instanceof Tx) {
|
|
return new Inr(x.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Navigate (line 24, column 1 - line 24, column 48): " + [x.constructor.name]);
|
|
}
|
|
};
|
|
var routeCodec = /* @__PURE__ */ root(/* @__PURE__ */ sum2(genericRoute)(/* @__PURE__ */ gRouteSum(/* @__PURE__ */ gRouteConstructor({
|
|
reflectSymbol: function() {
|
|
return "Home";
|
|
}
|
|
})()(gRouteNoArguments))(/* @__PURE__ */ gRouteConstructor({
|
|
reflectSymbol: function() {
|
|
return "Tx";
|
|
}
|
|
})()(gRouteArgument)))({
|
|
Home: noArgs,
|
|
Tx: /* @__PURE__ */ gsep(/* @__PURE__ */ gsepStringRoute(gRouteAll))("tx")(segment)
|
|
}));
|
|
var eqRoute = {
|
|
eq: function(x) {
|
|
return function(y) {
|
|
if (x instanceof Home && y instanceof Home) {
|
|
return true;
|
|
}
|
|
;
|
|
if (x instanceof Tx && y instanceof Tx) {
|
|
return x.value0 === y.value0;
|
|
}
|
|
;
|
|
return false;
|
|
};
|
|
}
|
|
};
|
|
|
|
// output/Exblo.Store/index.js
|
|
var Dev = /* @__PURE__ */ function() {
|
|
function Dev2() {
|
|
}
|
|
;
|
|
Dev2.value = new Dev2();
|
|
return Dev2;
|
|
}();
|
|
var SetInfo = /* @__PURE__ */ function() {
|
|
function SetInfo2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
SetInfo2.create = function(value0) {
|
|
return new SetInfo2(value0);
|
|
};
|
|
return SetInfo2;
|
|
}();
|
|
var Logout = /* @__PURE__ */ function() {
|
|
function Logout2() {
|
|
}
|
|
;
|
|
Logout2.value = new Logout2();
|
|
return Logout2;
|
|
}();
|
|
var reduce = function(store) {
|
|
return function(v) {
|
|
if (v instanceof SetInfo) {
|
|
return {
|
|
logLevel: store.logLevel,
|
|
baseUrl: store.baseUrl,
|
|
network: v.value0.net,
|
|
zebraVersion: v.value0.zebra,
|
|
version: v.value0.version
|
|
};
|
|
}
|
|
;
|
|
if (v instanceof Logout) {
|
|
return store;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Store (line 24, column 16 - line 26, column 18): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
|
|
// output/Control.Monad.Fork.Class/index.js
|
|
var monadForkAff = {
|
|
suspend: suspendAff,
|
|
fork: forkAff,
|
|
join: joinFiber,
|
|
Monad0: function() {
|
|
return monadAff;
|
|
},
|
|
Functor1: function() {
|
|
return functorFiber;
|
|
}
|
|
};
|
|
var fork = function(dict) {
|
|
return dict.fork;
|
|
};
|
|
|
|
// output/Data.Exists/index.js
|
|
var runExists = unsafeCoerce2;
|
|
var mkExists = unsafeCoerce2;
|
|
|
|
// output/Data.Coyoneda/index.js
|
|
var CoyonedaF = /* @__PURE__ */ function() {
|
|
function CoyonedaF2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
CoyonedaF2.create = function(value0) {
|
|
return function(value1) {
|
|
return new CoyonedaF2(value0, value1);
|
|
};
|
|
};
|
|
return CoyonedaF2;
|
|
}();
|
|
var unCoyoneda = function(f) {
|
|
return function(v) {
|
|
return runExists(function(v1) {
|
|
return f(v1.value0)(v1.value1);
|
|
})(v);
|
|
};
|
|
};
|
|
var coyoneda = function(k) {
|
|
return function(fi) {
|
|
return mkExists(new CoyonedaF(k, fi));
|
|
};
|
|
};
|
|
var functorCoyoneda = {
|
|
map: function(f) {
|
|
return function(v) {
|
|
return runExists(function(v1) {
|
|
return coyoneda(function($180) {
|
|
return f(v1.value0($180));
|
|
})(v1.value1);
|
|
})(v);
|
|
};
|
|
}
|
|
};
|
|
var liftCoyoneda = /* @__PURE__ */ coyoneda(/* @__PURE__ */ identity(categoryFn));
|
|
|
|
// output/Halogen.Query.HalogenQ/index.js
|
|
var Initialize = /* @__PURE__ */ function() {
|
|
function Initialize6(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Initialize6.create = function(value0) {
|
|
return new Initialize6(value0);
|
|
};
|
|
return Initialize6;
|
|
}();
|
|
var Finalize = /* @__PURE__ */ function() {
|
|
function Finalize2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Finalize2.create = function(value0) {
|
|
return new Finalize2(value0);
|
|
};
|
|
return Finalize2;
|
|
}();
|
|
var Receive = /* @__PURE__ */ function() {
|
|
function Receive6(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Receive6.create = function(value0) {
|
|
return function(value1) {
|
|
return new Receive6(value0, value1);
|
|
};
|
|
};
|
|
return Receive6;
|
|
}();
|
|
var Action2 = /* @__PURE__ */ function() {
|
|
function Action3(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Action3.create = function(value0) {
|
|
return function(value1) {
|
|
return new Action3(value0, value1);
|
|
};
|
|
};
|
|
return Action3;
|
|
}();
|
|
var Query = /* @__PURE__ */ function() {
|
|
function Query3(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Query3.create = function(value0) {
|
|
return function(value1) {
|
|
return new Query3(value0, value1);
|
|
};
|
|
};
|
|
return Query3;
|
|
}();
|
|
|
|
// output/Halogen.VDom.Thunk/index.js
|
|
var $runtime_lazy8 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var Thunk = /* @__PURE__ */ function() {
|
|
function Thunk2(value0, value1, value22, value32) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
this.value2 = value22;
|
|
this.value3 = value32;
|
|
}
|
|
;
|
|
Thunk2.create = function(value0) {
|
|
return function(value1) {
|
|
return function(value22) {
|
|
return function(value32) {
|
|
return new Thunk2(value0, value1, value22, value32);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return Thunk2;
|
|
}();
|
|
var unsafeEqThunk = function(v, v1) {
|
|
return refEq2(v.value0, v1.value0) && (refEq2(v.value1, v1.value1) && v.value1(v.value3, v1.value3));
|
|
};
|
|
var runThunk = function(v) {
|
|
return v.value2(v.value3);
|
|
};
|
|
var mapThunk = function(k) {
|
|
return function(v) {
|
|
return new Thunk(v.value0, v.value1, function($51) {
|
|
return k(v.value2($51));
|
|
}, v.value3);
|
|
};
|
|
};
|
|
var hoist2 = mapThunk;
|
|
var buildThunk = function(toVDom) {
|
|
var haltThunk = function(state3) {
|
|
return halt(state3.vdom);
|
|
};
|
|
var $lazy_patchThunk = $runtime_lazy8("patchThunk", "Halogen.VDom.Thunk", function() {
|
|
return function(state3, t2) {
|
|
var $48 = unsafeEqThunk(state3.thunk, t2);
|
|
if ($48) {
|
|
return mkStep(new Step(extract2(state3.vdom), state3, $lazy_patchThunk(112), haltThunk));
|
|
}
|
|
;
|
|
var vdom = step(state3.vdom, toVDom(runThunk(t2)));
|
|
return mkStep(new Step(extract2(vdom), {
|
|
vdom,
|
|
thunk: t2
|
|
}, $lazy_patchThunk(115), haltThunk));
|
|
};
|
|
});
|
|
var patchThunk = $lazy_patchThunk(108);
|
|
var renderThunk = function(spec) {
|
|
return function(t) {
|
|
var vdom = buildVDom(spec)(toVDom(runThunk(t)));
|
|
return mkStep(new Step(extract2(vdom), {
|
|
thunk: t,
|
|
vdom
|
|
}, patchThunk, haltThunk));
|
|
};
|
|
};
|
|
return renderThunk;
|
|
};
|
|
|
|
// output/Halogen.Component/index.js
|
|
var voidLeft2 = /* @__PURE__ */ voidLeft(functorHalogenM);
|
|
var traverse_3 = /* @__PURE__ */ traverse_(applicativeHalogenM)(foldableMaybe);
|
|
var map25 = /* @__PURE__ */ map(functorHalogenM);
|
|
var lmap3 = /* @__PURE__ */ lmap(bifunctorHTML);
|
|
var pure9 = /* @__PURE__ */ pure(applicativeHalogenM);
|
|
var lookup6 = /* @__PURE__ */ lookup3();
|
|
var pop3 = /* @__PURE__ */ pop2();
|
|
var insert6 = /* @__PURE__ */ insert5();
|
|
var ComponentSlot = /* @__PURE__ */ function() {
|
|
function ComponentSlot2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ComponentSlot2.create = function(value0) {
|
|
return new ComponentSlot2(value0);
|
|
};
|
|
return ComponentSlot2;
|
|
}();
|
|
var ThunkSlot = /* @__PURE__ */ function() {
|
|
function ThunkSlot2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ThunkSlot2.create = function(value0) {
|
|
return new ThunkSlot2(value0);
|
|
};
|
|
return ThunkSlot2;
|
|
}();
|
|
var unComponentSlot = unsafeCoerce2;
|
|
var unComponent = unsafeCoerce2;
|
|
var mkEval = function(args) {
|
|
return function(v) {
|
|
if (v instanceof Initialize) {
|
|
return voidLeft2(traverse_3(args.handleAction)(args.initialize))(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Finalize) {
|
|
return voidLeft2(traverse_3(args.handleAction)(args.finalize))(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Receive) {
|
|
return voidLeft2(traverse_3(args.handleAction)(args.receive(v.value0)))(v.value1);
|
|
}
|
|
;
|
|
if (v instanceof Action2) {
|
|
return voidLeft2(args.handleAction(v.value0))(v.value1);
|
|
}
|
|
;
|
|
if (v instanceof Query) {
|
|
return unCoyoneda(function(g) {
|
|
var $45 = map25(maybe(v.value1(unit))(g));
|
|
return function($46) {
|
|
return $45(args.handleQuery($46));
|
|
};
|
|
})(v.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Component (line 182, column 15 - line 192, column 71): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
var mkComponentSlot = unsafeCoerce2;
|
|
var mkComponent = unsafeCoerce2;
|
|
var hoistSlot = function(dictFunctor) {
|
|
return function(nat) {
|
|
return function(v) {
|
|
if (v instanceof ComponentSlot) {
|
|
return unComponentSlot(function(slot3) {
|
|
return new ComponentSlot(mkComponentSlot({
|
|
get: slot3.get,
|
|
pop: slot3.pop,
|
|
set: slot3.set,
|
|
input: slot3.input,
|
|
output: slot3.output,
|
|
component: hoist3(dictFunctor)(nat)(slot3.component)
|
|
}));
|
|
})(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof ThunkSlot) {
|
|
return new ThunkSlot(hoist2(lmap3(hoistSlot(dictFunctor)(nat)))(v.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Component (line 279, column 17 - line 284, column 53): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var hoist3 = function(dictFunctor) {
|
|
var hoist1 = hoist(dictFunctor);
|
|
return function(nat) {
|
|
return unComponent(function(c) {
|
|
return mkComponent({
|
|
initialState: c.initialState,
|
|
render: function() {
|
|
var $47 = lmap3(hoistSlot(dictFunctor)(nat));
|
|
return function($48) {
|
|
return $47(c.render($48));
|
|
};
|
|
}(),
|
|
"eval": function() {
|
|
var $49 = hoist1(nat);
|
|
return function($50) {
|
|
return $49(c["eval"]($50));
|
|
};
|
|
}()
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var defaultEval = /* @__PURE__ */ function() {
|
|
return {
|
|
handleAction: $$const(pure9(unit)),
|
|
handleQuery: $$const(pure9(Nothing.value)),
|
|
receive: $$const(Nothing.value),
|
|
initialize: Nothing.value,
|
|
finalize: Nothing.value
|
|
};
|
|
}();
|
|
var componentSlot = function() {
|
|
return function(dictIsSymbol) {
|
|
var lookup13 = lookup6(dictIsSymbol);
|
|
var pop12 = pop3(dictIsSymbol);
|
|
var insert13 = insert6(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var lookup23 = lookup13(dictOrd);
|
|
var pop22 = pop12(dictOrd);
|
|
var insert22 = insert13(dictOrd);
|
|
return function(label5) {
|
|
return function(p2) {
|
|
return function(comp) {
|
|
return function(input3) {
|
|
return function(output2) {
|
|
return mkComponentSlot({
|
|
get: lookup23(label5)(p2),
|
|
pop: pop22(label5)(p2),
|
|
set: insert22(label5)(p2),
|
|
component: comp,
|
|
input: input3,
|
|
output: output2
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Web.HTML.HTMLElement/foreign.js
|
|
function _read(nothing, just, value15) {
|
|
var tag = Object.prototype.toString.call(value15);
|
|
if (tag.indexOf("[object HTML") === 0 && tag.indexOf("Element]") === tag.length - 8) {
|
|
return just(value15);
|
|
} else {
|
|
return nothing;
|
|
}
|
|
}
|
|
|
|
// output/Web.HTML.HTMLElement/index.js
|
|
var toNode2 = unsafeCoerce2;
|
|
var fromElement = function(x) {
|
|
return _read(Nothing.value, Just.create, x);
|
|
};
|
|
|
|
// output/Halogen.Query/index.js
|
|
var mkTell = function(act) {
|
|
return act(unit);
|
|
};
|
|
|
|
// output/Halogen.Store.Select/index.js
|
|
var unless2 = /* @__PURE__ */ unless(applicativeEffect);
|
|
var Selector = function(x) {
|
|
return x;
|
|
};
|
|
var selectEq = function(dictEq) {
|
|
var eq4 = eq(dictEq);
|
|
return function($14) {
|
|
return Selector(/* @__PURE__ */ function(v) {
|
|
return {
|
|
eq: eq4,
|
|
select: v
|
|
};
|
|
}($14));
|
|
};
|
|
};
|
|
var selectEmitter = function(v) {
|
|
return function(emitter) {
|
|
return makeEmitter(function(push2) {
|
|
return function __do2() {
|
|
var previousDerivedRef = $$new(Nothing.value)();
|
|
var subscription = subscribe(emitter)(function(store) {
|
|
return function __do3() {
|
|
var previousDerived = read(previousDerivedRef)();
|
|
var newDerived = v.select(store);
|
|
var isUnchanged = maybe(false)(v.eq(newDerived))(previousDerived);
|
|
return unless2(isUnchanged)(function __do4() {
|
|
write(new Just(newDerived))(previousDerivedRef)();
|
|
return push2(newDerived)();
|
|
})();
|
|
};
|
|
})();
|
|
return unsubscribe(subscription);
|
|
};
|
|
});
|
|
};
|
|
};
|
|
var selectAll = {
|
|
eq: unsafeRefEq,
|
|
select: /* @__PURE__ */ identity(categoryFn)
|
|
};
|
|
|
|
// output/Halogen.Store.Monad/index.js
|
|
var bind12 = /* @__PURE__ */ bind(bindAff);
|
|
var liftEffect3 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var pure1 = /* @__PURE__ */ pure(applicativeAff);
|
|
var map26 = /* @__PURE__ */ map(functorAff);
|
|
var lift6 = /* @__PURE__ */ lift(monadTransHalogenM);
|
|
var monadStoreT = function(dictMonad) {
|
|
return monadReaderT(dictMonad);
|
|
};
|
|
var monadEffectStoreT = function(dictMonadEffect) {
|
|
return monadEffectReader(dictMonadEffect);
|
|
};
|
|
var monadStoreStoreT = function(dictMonadEffect) {
|
|
var Monad0 = dictMonadEffect.Monad0();
|
|
var bind22 = bind(bindReaderT(Monad0.Bind1()));
|
|
var ask2 = ask(monadAskReaderT(Monad0));
|
|
var liftEffect12 = liftEffect(monadEffectReader(dictMonadEffect));
|
|
var pure23 = pure(Monad0.Applicative0());
|
|
var monadEffectStoreT1 = monadEffectStoreT(dictMonadEffect);
|
|
return {
|
|
getStore: bind22(ask2)(function(store) {
|
|
return liftEffect12(read(store.value));
|
|
}),
|
|
updateStore: function(action2) {
|
|
return bind22(ask2)(function(store) {
|
|
return liftEffect12(function __do2() {
|
|
var current = read(store.value)();
|
|
var newStore = store.reducer(current)(action2);
|
|
write(newStore)(store.value)();
|
|
return notify(store.listener)(newStore)();
|
|
});
|
|
});
|
|
},
|
|
emitSelected: function(selector) {
|
|
var $247 = selectEmitter(selector);
|
|
return function($248) {
|
|
return pure23($247(function(v) {
|
|
return v.emitter;
|
|
}($248)));
|
|
};
|
|
},
|
|
MonadEffect0: function() {
|
|
return monadEffectStoreT1;
|
|
}
|
|
};
|
|
};
|
|
var monadAffStoreT = function(dictMonadAff) {
|
|
return monadAffReader(dictMonadAff);
|
|
};
|
|
var updateStore = function(dict) {
|
|
return dict.updateStore;
|
|
};
|
|
var runAndEmitStoreT = function(dictMonad) {
|
|
var hoist4 = hoist3(dictMonad.Bind1().Apply0().Functor0());
|
|
return function(initialStore) {
|
|
return function(reducer) {
|
|
return function(component5) {
|
|
return bind12(liftEffect3(function __do2() {
|
|
var value15 = $$new(initialStore)();
|
|
var v = create();
|
|
return {
|
|
value: value15,
|
|
emitter: v.emitter,
|
|
listener: v.listener,
|
|
reducer
|
|
};
|
|
}))(function(hs) {
|
|
return pure1({
|
|
emitter: hs.emitter,
|
|
component: hoist4(function(v) {
|
|
return runReaderT(v)(hs);
|
|
})(component5)
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var runStoreT = function(dictMonad) {
|
|
var runAndEmitStoreT1 = runAndEmitStoreT(dictMonad);
|
|
return function(initialStore) {
|
|
return function(reducer) {
|
|
return function(component5) {
|
|
return map26(function(v) {
|
|
return v.component;
|
|
})(runAndEmitStoreT1(initialStore)(reducer)(component5));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var getStore = function(dict) {
|
|
return dict.getStore;
|
|
};
|
|
var emitSelected = function(dict) {
|
|
return dict.emitSelected;
|
|
};
|
|
var monadStoreHalogenM = function(dictMonadStore) {
|
|
var MonadEffect0 = dictMonadStore.MonadEffect0();
|
|
var lift9 = lift6(MonadEffect0.Monad0());
|
|
var monadEffectHalogenM2 = monadEffectHalogenM(MonadEffect0);
|
|
return {
|
|
getStore: lift9(getStore(dictMonadStore)),
|
|
updateStore: function() {
|
|
var $251 = updateStore(dictMonadStore);
|
|
return function($252) {
|
|
return lift9($251($252));
|
|
};
|
|
}(),
|
|
emitSelected: function() {
|
|
var $253 = emitSelected(dictMonadStore);
|
|
return function($254) {
|
|
return lift9($253($254));
|
|
};
|
|
}(),
|
|
MonadEffect0: function() {
|
|
return monadEffectHalogenM2;
|
|
}
|
|
};
|
|
};
|
|
|
|
// output/Web.HTML/foreign.js
|
|
var windowImpl = function() {
|
|
return window;
|
|
};
|
|
|
|
// output/Web.HTML.HTMLDocument/foreign.js
|
|
function _readyState(doc) {
|
|
return doc.readyState;
|
|
}
|
|
|
|
// output/Web.HTML.HTMLDocument.ReadyState/index.js
|
|
var Loading = /* @__PURE__ */ function() {
|
|
function Loading3() {
|
|
}
|
|
;
|
|
Loading3.value = new Loading3();
|
|
return Loading3;
|
|
}();
|
|
var Interactive = /* @__PURE__ */ function() {
|
|
function Interactive2() {
|
|
}
|
|
;
|
|
Interactive2.value = new Interactive2();
|
|
return Interactive2;
|
|
}();
|
|
var Complete = /* @__PURE__ */ function() {
|
|
function Complete2() {
|
|
}
|
|
;
|
|
Complete2.value = new Complete2();
|
|
return Complete2;
|
|
}();
|
|
var parse3 = function(v) {
|
|
if (v === "loading") {
|
|
return new Just(Loading.value);
|
|
}
|
|
;
|
|
if (v === "interactive") {
|
|
return new Just(Interactive.value);
|
|
}
|
|
;
|
|
if (v === "complete") {
|
|
return new Just(Complete.value);
|
|
}
|
|
;
|
|
return Nothing.value;
|
|
};
|
|
|
|
// output/Web.HTML.HTMLDocument/index.js
|
|
var map27 = /* @__PURE__ */ map(functorEffect);
|
|
var toParentNode = unsafeCoerce2;
|
|
var toDocument = unsafeCoerce2;
|
|
var readyState = function(doc) {
|
|
return map27(function() {
|
|
var $4 = fromMaybe(Loading.value);
|
|
return function($5) {
|
|
return $4(parse3($5));
|
|
};
|
|
}())(function() {
|
|
return _readyState(doc);
|
|
});
|
|
};
|
|
|
|
// output/Effect.Uncurried/foreign.js
|
|
var runEffectFn1 = function runEffectFn12(fn) {
|
|
return function(a2) {
|
|
return function() {
|
|
return fn(a2);
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Web.HTML.Location/foreign.js
|
|
function hash3(location2) {
|
|
return function() {
|
|
return location2.hash;
|
|
};
|
|
}
|
|
function setHash(hash4) {
|
|
return function(location2) {
|
|
return function() {
|
|
location2.hash = hash4;
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Web.HTML.Window/foreign.js
|
|
function document(window2) {
|
|
return function() {
|
|
return window2.document;
|
|
};
|
|
}
|
|
function location(window2) {
|
|
return function() {
|
|
return window2.location;
|
|
};
|
|
}
|
|
|
|
// output/Web.HTML.Window/index.js
|
|
var toEventTarget = unsafeCoerce2;
|
|
|
|
// output/Web.HTML.Event.HashChangeEvent.EventTypes/index.js
|
|
var hashchange = "hashchange";
|
|
|
|
// output/Routing.Hash/index.js
|
|
var bind5 = /* @__PURE__ */ bind(bindEffect);
|
|
var map28 = /* @__PURE__ */ map(functorEffect);
|
|
var bindFlipped4 = /* @__PURE__ */ bindFlipped(bindEffect);
|
|
var join3 = /* @__PURE__ */ join(bindEffect);
|
|
var apply4 = /* @__PURE__ */ apply(applyEffect);
|
|
var pure10 = /* @__PURE__ */ pure(applicativeEffect);
|
|
var voidRight2 = /* @__PURE__ */ voidRight(functorEffect);
|
|
var setHash2 = function(h) {
|
|
return bind5(bind5(windowImpl)(location))(setHash(h));
|
|
};
|
|
var getHash = /* @__PURE__ */ bind5(/* @__PURE__ */ bind5(windowImpl)(location))(/* @__PURE__ */ function() {
|
|
var $16 = map28(function() {
|
|
var $18 = fromMaybe("");
|
|
var $19 = stripPrefix("#");
|
|
return function($20) {
|
|
return $18($19($20));
|
|
};
|
|
}());
|
|
return function($17) {
|
|
return $16(hash3($17));
|
|
};
|
|
}());
|
|
var foldHashes = function(cb) {
|
|
return function(init4) {
|
|
return function __do2() {
|
|
var ref2 = bindFlipped4($$new)(bindFlipped4(init4)(getHash))();
|
|
var win = map28(toEventTarget)(windowImpl)();
|
|
var listener = eventListener(function(v) {
|
|
return bindFlipped4(flip(write)(ref2))(join3(apply4(map28(cb)(read(ref2)))(getHash)));
|
|
})();
|
|
addEventListener2(hashchange)(listener)(false)(win)();
|
|
return removeEventListener2(hashchange)(listener)(false)(win);
|
|
};
|
|
};
|
|
};
|
|
var matchesWith = function(dictFoldable) {
|
|
var indexl2 = indexl(dictFoldable);
|
|
return function(parser) {
|
|
return function(cb) {
|
|
var go2 = function(a2) {
|
|
var $21 = maybe(pure10(a2))(function(b2) {
|
|
return voidRight2(new Just(b2))(cb(a2)(b2));
|
|
});
|
|
var $22 = indexl2(0);
|
|
return function($23) {
|
|
return $21($22(parser($23)));
|
|
};
|
|
};
|
|
return foldHashes(go2)(go2(Nothing.value));
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Exblo.AppM/index.js
|
|
var runStoreT2 = /* @__PURE__ */ runStoreT(monadAff);
|
|
var coerce4 = /* @__PURE__ */ coerce();
|
|
var runAppM = function(store) {
|
|
var $12 = runStoreT2(store)(reduce);
|
|
return function($13) {
|
|
return $12(coerce4($13));
|
|
};
|
|
};
|
|
var monadStoreAppM = /* @__PURE__ */ monadStoreStoreT(monadEffectAff);
|
|
var monadEffectAppM = /* @__PURE__ */ monadEffectStoreT(monadEffectAff);
|
|
var monadAppM = /* @__PURE__ */ monadStoreT(monadAff);
|
|
var navigateAppM = {
|
|
navigate: /* @__PURE__ */ function() {
|
|
var $14 = liftEffect(monadEffectAppM);
|
|
var $15 = print(routeCodec);
|
|
return function($16) {
|
|
return $14(setHash2($15($16)));
|
|
};
|
|
}(),
|
|
Monad0: function() {
|
|
return monadAppM;
|
|
}
|
|
};
|
|
var monadAffAppM = /* @__PURE__ */ monadAffStoreT(monadAffAff);
|
|
|
|
// output/Affjax/foreign.js
|
|
function _ajax(platformSpecificDriver, timeoutErrorMessageIdent, requestFailedMessageIdent, mkHeader, options2) {
|
|
return function(errback, callback) {
|
|
var xhr = platformSpecificDriver.newXHR();
|
|
var fixedUrl = platformSpecificDriver.fixupUrl(options2.url, xhr);
|
|
xhr.open(options2.method || "GET", fixedUrl, true, options2.username, options2.password);
|
|
if (options2.headers) {
|
|
try {
|
|
for (var i2 = 0, header2; (header2 = options2.headers[i2]) != null; i2++) {
|
|
xhr.setRequestHeader(header2.field, header2.value);
|
|
}
|
|
} catch (e) {
|
|
errback(e);
|
|
}
|
|
}
|
|
var onerror = function(msgIdent) {
|
|
return function() {
|
|
errback(new Error(msgIdent));
|
|
};
|
|
};
|
|
xhr.onerror = onerror(requestFailedMessageIdent);
|
|
xhr.ontimeout = onerror(timeoutErrorMessageIdent);
|
|
xhr.onload = function() {
|
|
callback({
|
|
status: xhr.status,
|
|
statusText: xhr.statusText,
|
|
headers: xhr.getAllResponseHeaders().split("\r\n").filter(function(header3) {
|
|
return header3.length > 0;
|
|
}).map(function(header3) {
|
|
var i3 = header3.indexOf(":");
|
|
return mkHeader(header3.substring(0, i3))(header3.substring(i3 + 2));
|
|
}),
|
|
body: xhr.response
|
|
});
|
|
};
|
|
xhr.responseType = options2.responseType;
|
|
xhr.withCredentials = options2.withCredentials;
|
|
xhr.timeout = options2.timeout;
|
|
xhr.send(options2.content);
|
|
return function(error4, cancelErrback, cancelCallback) {
|
|
try {
|
|
xhr.abort();
|
|
} catch (e) {
|
|
return cancelErrback(e);
|
|
}
|
|
return cancelCallback();
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Data.MediaType.Common/index.js
|
|
var applicationJSON = "application/json";
|
|
var applicationFormURLEncoded = "application/x-www-form-urlencoded";
|
|
|
|
// output/Affjax.RequestBody/index.js
|
|
var ArrayView = /* @__PURE__ */ function() {
|
|
function ArrayView2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ArrayView2.create = function(value0) {
|
|
return new ArrayView2(value0);
|
|
};
|
|
return ArrayView2;
|
|
}();
|
|
var Blob = /* @__PURE__ */ function() {
|
|
function Blob3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Blob3.create = function(value0) {
|
|
return new Blob3(value0);
|
|
};
|
|
return Blob3;
|
|
}();
|
|
var Document = /* @__PURE__ */ function() {
|
|
function Document3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Document3.create = function(value0) {
|
|
return new Document3(value0);
|
|
};
|
|
return Document3;
|
|
}();
|
|
var $$String = /* @__PURE__ */ function() {
|
|
function $$String3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
$$String3.create = function(value0) {
|
|
return new $$String3(value0);
|
|
};
|
|
return $$String3;
|
|
}();
|
|
var FormData = /* @__PURE__ */ function() {
|
|
function FormData2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
FormData2.create = function(value0) {
|
|
return new FormData2(value0);
|
|
};
|
|
return FormData2;
|
|
}();
|
|
var FormURLEncoded = /* @__PURE__ */ function() {
|
|
function FormURLEncoded2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
FormURLEncoded2.create = function(value0) {
|
|
return new FormURLEncoded2(value0);
|
|
};
|
|
return FormURLEncoded2;
|
|
}();
|
|
var Json = /* @__PURE__ */ function() {
|
|
function Json3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Json3.create = function(value0) {
|
|
return new Json3(value0);
|
|
};
|
|
return Json3;
|
|
}();
|
|
var toMediaType = function(v) {
|
|
if (v instanceof FormURLEncoded) {
|
|
return new Just(applicationFormURLEncoded);
|
|
}
|
|
;
|
|
if (v instanceof Json) {
|
|
return new Just(applicationJSON);
|
|
}
|
|
;
|
|
return Nothing.value;
|
|
};
|
|
|
|
// output/Affjax.RequestHeader/index.js
|
|
var unwrap3 = /* @__PURE__ */ unwrap();
|
|
var Accept = /* @__PURE__ */ function() {
|
|
function Accept2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Accept2.create = function(value0) {
|
|
return new Accept2(value0);
|
|
};
|
|
return Accept2;
|
|
}();
|
|
var ContentType = /* @__PURE__ */ function() {
|
|
function ContentType2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
ContentType2.create = function(value0) {
|
|
return new ContentType2(value0);
|
|
};
|
|
return ContentType2;
|
|
}();
|
|
var RequestHeader = /* @__PURE__ */ function() {
|
|
function RequestHeader2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
RequestHeader2.create = function(value0) {
|
|
return function(value1) {
|
|
return new RequestHeader2(value0, value1);
|
|
};
|
|
};
|
|
return RequestHeader2;
|
|
}();
|
|
var value13 = function(v) {
|
|
if (v instanceof Accept) {
|
|
return unwrap3(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof ContentType) {
|
|
return unwrap3(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof RequestHeader) {
|
|
return v.value1;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax.RequestHeader (line 26, column 1 - line 26, column 33): " + [v.constructor.name]);
|
|
};
|
|
var name15 = function(v) {
|
|
if (v instanceof Accept) {
|
|
return "Accept";
|
|
}
|
|
;
|
|
if (v instanceof ContentType) {
|
|
return "Content-Type";
|
|
}
|
|
;
|
|
if (v instanceof RequestHeader) {
|
|
return v.value0;
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax.RequestHeader (line 21, column 1 - line 21, column 32): " + [v.constructor.name]);
|
|
};
|
|
|
|
// output/Affjax.ResponseFormat/index.js
|
|
var identity12 = /* @__PURE__ */ identity(categoryFn);
|
|
var $$ArrayBuffer = /* @__PURE__ */ function() {
|
|
function $$ArrayBuffer2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
$$ArrayBuffer2.create = function(value0) {
|
|
return new $$ArrayBuffer2(value0);
|
|
};
|
|
return $$ArrayBuffer2;
|
|
}();
|
|
var Blob2 = /* @__PURE__ */ function() {
|
|
function Blob3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Blob3.create = function(value0) {
|
|
return new Blob3(value0);
|
|
};
|
|
return Blob3;
|
|
}();
|
|
var Document2 = /* @__PURE__ */ function() {
|
|
function Document3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Document3.create = function(value0) {
|
|
return new Document3(value0);
|
|
};
|
|
return Document3;
|
|
}();
|
|
var Json2 = /* @__PURE__ */ function() {
|
|
function Json3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Json3.create = function(value0) {
|
|
return new Json3(value0);
|
|
};
|
|
return Json3;
|
|
}();
|
|
var $$String2 = /* @__PURE__ */ function() {
|
|
function $$String3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
$$String3.create = function(value0) {
|
|
return new $$String3(value0);
|
|
};
|
|
return $$String3;
|
|
}();
|
|
var Ignore = /* @__PURE__ */ function() {
|
|
function Ignore2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Ignore2.create = function(value0) {
|
|
return new Ignore2(value0);
|
|
};
|
|
return Ignore2;
|
|
}();
|
|
var toResponseType = function(v) {
|
|
if (v instanceof $$ArrayBuffer) {
|
|
return "arraybuffer";
|
|
}
|
|
;
|
|
if (v instanceof Blob2) {
|
|
return "blob";
|
|
}
|
|
;
|
|
if (v instanceof Document2) {
|
|
return "document";
|
|
}
|
|
;
|
|
if (v instanceof Json2) {
|
|
return "text";
|
|
}
|
|
;
|
|
if (v instanceof $$String2) {
|
|
return "text";
|
|
}
|
|
;
|
|
if (v instanceof Ignore) {
|
|
return "";
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax.ResponseFormat (line 44, column 3 - line 50, column 19): " + [v.constructor.name]);
|
|
};
|
|
var toMediaType2 = function(v) {
|
|
if (v instanceof Json2) {
|
|
return new Just(applicationJSON);
|
|
}
|
|
;
|
|
return Nothing.value;
|
|
};
|
|
var string = /* @__PURE__ */ function() {
|
|
return new $$String2(identity12);
|
|
}();
|
|
var ignore = /* @__PURE__ */ function() {
|
|
return new Ignore(identity12);
|
|
}();
|
|
|
|
// output/Affjax.ResponseHeader/index.js
|
|
var ResponseHeader = /* @__PURE__ */ function() {
|
|
function ResponseHeader2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
ResponseHeader2.create = function(value0) {
|
|
return function(value1) {
|
|
return new ResponseHeader2(value0, value1);
|
|
};
|
|
};
|
|
return ResponseHeader2;
|
|
}();
|
|
|
|
// output/Control.Monad.Except/index.js
|
|
var unwrap4 = /* @__PURE__ */ unwrap();
|
|
var withExcept = /* @__PURE__ */ withExceptT(functorIdentity);
|
|
var runExcept = function($3) {
|
|
return unwrap4(runExceptT($3));
|
|
};
|
|
|
|
// output/Data.Argonaut.Parser/foreign.js
|
|
function _jsonParser(fail4, succ2, s) {
|
|
try {
|
|
return succ2(JSON.parse(s));
|
|
} catch (e) {
|
|
return fail4(e.message);
|
|
}
|
|
}
|
|
|
|
// output/Data.Argonaut.Parser/index.js
|
|
var jsonParser = function(j) {
|
|
return _jsonParser(Left.create, Right.create, j);
|
|
};
|
|
|
|
// output/Data.FormURLEncoded/index.js
|
|
var apply5 = /* @__PURE__ */ apply(applyMaybe);
|
|
var map29 = /* @__PURE__ */ map(functorMaybe);
|
|
var traverse3 = /* @__PURE__ */ traverse(traversableArray)(applicativeMaybe);
|
|
var toArray3 = function(v) {
|
|
return v;
|
|
};
|
|
var encode = /* @__PURE__ */ function() {
|
|
var encodePart = function(v) {
|
|
if (v.value1 instanceof Nothing) {
|
|
return encodeFormURLComponent(v.value0);
|
|
}
|
|
;
|
|
if (v.value1 instanceof Just) {
|
|
return apply5(map29(function(key) {
|
|
return function(val) {
|
|
return key + ("=" + val);
|
|
};
|
|
})(encodeFormURLComponent(v.value0)))(encodeFormURLComponent(v.value1.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.FormURLEncoded (line 37, column 16 - line 39, column 114): " + [v.constructor.name]);
|
|
};
|
|
var $37 = map29(joinWith("&"));
|
|
var $38 = traverse3(encodePart);
|
|
return function($39) {
|
|
return $37($38(toArray3($39)));
|
|
};
|
|
}();
|
|
|
|
// output/Data.HTTP.Method/index.js
|
|
var OPTIONS = /* @__PURE__ */ function() {
|
|
function OPTIONS2() {
|
|
}
|
|
;
|
|
OPTIONS2.value = new OPTIONS2();
|
|
return OPTIONS2;
|
|
}();
|
|
var GET2 = /* @__PURE__ */ function() {
|
|
function GET3() {
|
|
}
|
|
;
|
|
GET3.value = new GET3();
|
|
return GET3;
|
|
}();
|
|
var HEAD = /* @__PURE__ */ function() {
|
|
function HEAD2() {
|
|
}
|
|
;
|
|
HEAD2.value = new HEAD2();
|
|
return HEAD2;
|
|
}();
|
|
var POST2 = /* @__PURE__ */ function() {
|
|
function POST3() {
|
|
}
|
|
;
|
|
POST3.value = new POST3();
|
|
return POST3;
|
|
}();
|
|
var PUT = /* @__PURE__ */ function() {
|
|
function PUT2() {
|
|
}
|
|
;
|
|
PUT2.value = new PUT2();
|
|
return PUT2;
|
|
}();
|
|
var DELETE = /* @__PURE__ */ function() {
|
|
function DELETE2() {
|
|
}
|
|
;
|
|
DELETE2.value = new DELETE2();
|
|
return DELETE2;
|
|
}();
|
|
var TRACE = /* @__PURE__ */ function() {
|
|
function TRACE2() {
|
|
}
|
|
;
|
|
TRACE2.value = new TRACE2();
|
|
return TRACE2;
|
|
}();
|
|
var CONNECT = /* @__PURE__ */ function() {
|
|
function CONNECT2() {
|
|
}
|
|
;
|
|
CONNECT2.value = new CONNECT2();
|
|
return CONNECT2;
|
|
}();
|
|
var PROPFIND = /* @__PURE__ */ function() {
|
|
function PROPFIND2() {
|
|
}
|
|
;
|
|
PROPFIND2.value = new PROPFIND2();
|
|
return PROPFIND2;
|
|
}();
|
|
var PROPPATCH = /* @__PURE__ */ function() {
|
|
function PROPPATCH2() {
|
|
}
|
|
;
|
|
PROPPATCH2.value = new PROPPATCH2();
|
|
return PROPPATCH2;
|
|
}();
|
|
var MKCOL = /* @__PURE__ */ function() {
|
|
function MKCOL2() {
|
|
}
|
|
;
|
|
MKCOL2.value = new MKCOL2();
|
|
return MKCOL2;
|
|
}();
|
|
var COPY = /* @__PURE__ */ function() {
|
|
function COPY2() {
|
|
}
|
|
;
|
|
COPY2.value = new COPY2();
|
|
return COPY2;
|
|
}();
|
|
var MOVE = /* @__PURE__ */ function() {
|
|
function MOVE2() {
|
|
}
|
|
;
|
|
MOVE2.value = new MOVE2();
|
|
return MOVE2;
|
|
}();
|
|
var LOCK = /* @__PURE__ */ function() {
|
|
function LOCK2() {
|
|
}
|
|
;
|
|
LOCK2.value = new LOCK2();
|
|
return LOCK2;
|
|
}();
|
|
var UNLOCK = /* @__PURE__ */ function() {
|
|
function UNLOCK2() {
|
|
}
|
|
;
|
|
UNLOCK2.value = new UNLOCK2();
|
|
return UNLOCK2;
|
|
}();
|
|
var PATCH = /* @__PURE__ */ function() {
|
|
function PATCH2() {
|
|
}
|
|
;
|
|
PATCH2.value = new PATCH2();
|
|
return PATCH2;
|
|
}();
|
|
var unCustomMethod = function(v) {
|
|
return v;
|
|
};
|
|
var showMethod = {
|
|
show: function(v) {
|
|
if (v instanceof OPTIONS) {
|
|
return "OPTIONS";
|
|
}
|
|
;
|
|
if (v instanceof GET2) {
|
|
return "GET";
|
|
}
|
|
;
|
|
if (v instanceof HEAD) {
|
|
return "HEAD";
|
|
}
|
|
;
|
|
if (v instanceof POST2) {
|
|
return "POST";
|
|
}
|
|
;
|
|
if (v instanceof PUT) {
|
|
return "PUT";
|
|
}
|
|
;
|
|
if (v instanceof DELETE) {
|
|
return "DELETE";
|
|
}
|
|
;
|
|
if (v instanceof TRACE) {
|
|
return "TRACE";
|
|
}
|
|
;
|
|
if (v instanceof CONNECT) {
|
|
return "CONNECT";
|
|
}
|
|
;
|
|
if (v instanceof PROPFIND) {
|
|
return "PROPFIND";
|
|
}
|
|
;
|
|
if (v instanceof PROPPATCH) {
|
|
return "PROPPATCH";
|
|
}
|
|
;
|
|
if (v instanceof MKCOL) {
|
|
return "MKCOL";
|
|
}
|
|
;
|
|
if (v instanceof COPY) {
|
|
return "COPY";
|
|
}
|
|
;
|
|
if (v instanceof MOVE) {
|
|
return "MOVE";
|
|
}
|
|
;
|
|
if (v instanceof LOCK) {
|
|
return "LOCK";
|
|
}
|
|
;
|
|
if (v instanceof UNLOCK) {
|
|
return "UNLOCK";
|
|
}
|
|
;
|
|
if (v instanceof PATCH) {
|
|
return "PATCH";
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Data.HTTP.Method (line 43, column 1 - line 59, column 23): " + [v.constructor.name]);
|
|
}
|
|
};
|
|
var print7 = /* @__PURE__ */ either(/* @__PURE__ */ show(showMethod))(unCustomMethod);
|
|
|
|
// output/Effect.Aff.Compat/index.js
|
|
var fromEffectFnAff = function(v) {
|
|
return makeAff(function(k) {
|
|
return function __do2() {
|
|
var v1 = v(function($9) {
|
|
return k(Left.create($9))();
|
|
}, function($10) {
|
|
return k(Right.create($10))();
|
|
});
|
|
return function(e) {
|
|
return makeAff(function(k2) {
|
|
return function __do3() {
|
|
v1(e, function($11) {
|
|
return k2(Left.create($11))();
|
|
}, function($12) {
|
|
return k2(Right.create($12))();
|
|
});
|
|
return nonCanceler;
|
|
};
|
|
});
|
|
};
|
|
};
|
|
});
|
|
};
|
|
|
|
// output/Affjax/index.js
|
|
var pure11 = /* @__PURE__ */ pure(/* @__PURE__ */ applicativeExceptT(monadIdentity));
|
|
var fail2 = /* @__PURE__ */ fail(monadIdentity);
|
|
var unsafeReadTagged2 = /* @__PURE__ */ unsafeReadTagged(monadIdentity);
|
|
var alt6 = /* @__PURE__ */ alt(/* @__PURE__ */ altExceptT(semigroupNonEmptyList)(monadIdentity));
|
|
var composeKleisliFlipped3 = /* @__PURE__ */ composeKleisliFlipped(/* @__PURE__ */ bindExceptT(monadIdentity));
|
|
var map30 = /* @__PURE__ */ map(functorMaybe);
|
|
var any3 = /* @__PURE__ */ any(foldableArray)(heytingAlgebraBoolean);
|
|
var eq3 = /* @__PURE__ */ eq(eqString);
|
|
var bindFlipped5 = /* @__PURE__ */ bindFlipped(bindMaybe);
|
|
var map112 = /* @__PURE__ */ map(functorArray);
|
|
var mapFlipped2 = /* @__PURE__ */ mapFlipped(functorAff);
|
|
var $$try4 = /* @__PURE__ */ $$try2(monadErrorAff);
|
|
var pure12 = /* @__PURE__ */ pure(applicativeAff);
|
|
var RequestContentError = /* @__PURE__ */ function() {
|
|
function RequestContentError2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
RequestContentError2.create = function(value0) {
|
|
return new RequestContentError2(value0);
|
|
};
|
|
return RequestContentError2;
|
|
}();
|
|
var ResponseBodyError = /* @__PURE__ */ function() {
|
|
function ResponseBodyError2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
ResponseBodyError2.create = function(value0) {
|
|
return function(value1) {
|
|
return new ResponseBodyError2(value0, value1);
|
|
};
|
|
};
|
|
return ResponseBodyError2;
|
|
}();
|
|
var TimeoutError = /* @__PURE__ */ function() {
|
|
function TimeoutError2() {
|
|
}
|
|
;
|
|
TimeoutError2.value = new TimeoutError2();
|
|
return TimeoutError2;
|
|
}();
|
|
var RequestFailedError = /* @__PURE__ */ function() {
|
|
function RequestFailedError2() {
|
|
}
|
|
;
|
|
RequestFailedError2.value = new RequestFailedError2();
|
|
return RequestFailedError2;
|
|
}();
|
|
var XHROtherError = /* @__PURE__ */ function() {
|
|
function XHROtherError2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
XHROtherError2.create = function(value0) {
|
|
return new XHROtherError2(value0);
|
|
};
|
|
return XHROtherError2;
|
|
}();
|
|
var request = function(driver2) {
|
|
return function(req) {
|
|
var parseJSON2 = function(v2) {
|
|
if (v2 === "") {
|
|
return pure11(jsonEmptyObject);
|
|
}
|
|
;
|
|
return either(function($74) {
|
|
return fail2(ForeignError.create($74));
|
|
})(pure11)(jsonParser(v2));
|
|
};
|
|
var fromResponse = function() {
|
|
if (req.responseFormat instanceof $$ArrayBuffer) {
|
|
return unsafeReadTagged2("ArrayBuffer");
|
|
}
|
|
;
|
|
if (req.responseFormat instanceof Blob2) {
|
|
return unsafeReadTagged2("Blob");
|
|
}
|
|
;
|
|
if (req.responseFormat instanceof Document2) {
|
|
return function(x) {
|
|
return alt6(unsafeReadTagged2("Document")(x))(alt6(unsafeReadTagged2("XMLDocument")(x))(unsafeReadTagged2("HTMLDocument")(x)));
|
|
};
|
|
}
|
|
;
|
|
if (req.responseFormat instanceof Json2) {
|
|
return composeKleisliFlipped3(function($75) {
|
|
return req.responseFormat.value0(parseJSON2($75));
|
|
})(unsafeReadTagged2("String"));
|
|
}
|
|
;
|
|
if (req.responseFormat instanceof $$String2) {
|
|
return unsafeReadTagged2("String");
|
|
}
|
|
;
|
|
if (req.responseFormat instanceof Ignore) {
|
|
return $$const(req.responseFormat.value0(pure11(unit)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 274, column 18 - line 283, column 57): " + [req.responseFormat.constructor.name]);
|
|
}();
|
|
var extractContent = function(v2) {
|
|
if (v2 instanceof ArrayView) {
|
|
return new Right(v2.value0(unsafeToForeign));
|
|
}
|
|
;
|
|
if (v2 instanceof Blob) {
|
|
return new Right(unsafeToForeign(v2.value0));
|
|
}
|
|
;
|
|
if (v2 instanceof Document) {
|
|
return new Right(unsafeToForeign(v2.value0));
|
|
}
|
|
;
|
|
if (v2 instanceof $$String) {
|
|
return new Right(unsafeToForeign(v2.value0));
|
|
}
|
|
;
|
|
if (v2 instanceof FormData) {
|
|
return new Right(unsafeToForeign(v2.value0));
|
|
}
|
|
;
|
|
if (v2 instanceof FormURLEncoded) {
|
|
return note("Body contains values that cannot be encoded as application/x-www-form-urlencoded")(map30(unsafeToForeign)(encode(v2.value0)));
|
|
}
|
|
;
|
|
if (v2 instanceof Json) {
|
|
return new Right(unsafeToForeign(stringify(v2.value0)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 235, column 20 - line 250, column 69): " + [v2.constructor.name]);
|
|
};
|
|
var addHeader = function(mh) {
|
|
return function(hs) {
|
|
if (mh instanceof Just && !any3(on(eq3)(name15)(mh.value0))(hs)) {
|
|
return snoc(hs)(mh.value0);
|
|
}
|
|
;
|
|
return hs;
|
|
};
|
|
};
|
|
var headers = function(reqContent) {
|
|
return addHeader(map30(ContentType.create)(bindFlipped5(toMediaType)(reqContent)))(addHeader(map30(Accept.create)(toMediaType2(req.responseFormat)))(req.headers));
|
|
};
|
|
var ajaxRequest = function(v2) {
|
|
return {
|
|
method: print7(req.method),
|
|
url: req.url,
|
|
headers: map112(function(h) {
|
|
return {
|
|
field: name15(h),
|
|
value: value13(h)
|
|
};
|
|
})(headers(req.content)),
|
|
content: v2,
|
|
responseType: toResponseType(req.responseFormat),
|
|
username: toNullable(req.username),
|
|
password: toNullable(req.password),
|
|
withCredentials: req.withCredentials,
|
|
timeout: fromMaybe(0)(map30(function(v1) {
|
|
return v1;
|
|
})(req.timeout))
|
|
};
|
|
};
|
|
var send = function(content3) {
|
|
return mapFlipped2($$try4(fromEffectFnAff(_ajax(driver2, "AffjaxTimeoutErrorMessageIdent", "AffjaxRequestFailedMessageIdent", ResponseHeader.create, ajaxRequest(content3)))))(function(v2) {
|
|
if (v2 instanceof Right) {
|
|
var v1 = runExcept(fromResponse(v2.value0.body));
|
|
if (v1 instanceof Left) {
|
|
return new Left(new ResponseBodyError(head3(v1.value0), v2.value0));
|
|
}
|
|
;
|
|
if (v1 instanceof Right) {
|
|
return new Right({
|
|
headers: v2.value0.headers,
|
|
status: v2.value0.status,
|
|
statusText: v2.value0.statusText,
|
|
body: v1.value0
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 209, column 9 - line 211, column 52): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
if (v2 instanceof Left) {
|
|
return new Left(function() {
|
|
var message2 = message(v2.value0);
|
|
var $61 = message2 === "AffjaxTimeoutErrorMessageIdent";
|
|
if ($61) {
|
|
return TimeoutError.value;
|
|
}
|
|
;
|
|
var $62 = message2 === "AffjaxRequestFailedMessageIdent";
|
|
if ($62) {
|
|
return RequestFailedError.value;
|
|
}
|
|
;
|
|
return new XHROtherError(v2.value0);
|
|
}());
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 207, column 144 - line 219, column 28): " + [v2.constructor.name]);
|
|
});
|
|
};
|
|
if (req.content instanceof Nothing) {
|
|
return send(toNullable(Nothing.value));
|
|
}
|
|
;
|
|
if (req.content instanceof Just) {
|
|
var v = extractContent(req.content.value0);
|
|
if (v instanceof Right) {
|
|
return send(toNullable(new Just(v.value0)));
|
|
}
|
|
;
|
|
if (v instanceof Left) {
|
|
return pure12(new Left(new RequestContentError(v.value0)));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 199, column 7 - line 203, column 48): " + [v.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 195, column 3 - line 203, column 48): " + [req.content.constructor.name]);
|
|
};
|
|
};
|
|
var printError = function(v) {
|
|
if (v instanceof RequestContentError) {
|
|
return "There was a problem with the request content: " + v.value0;
|
|
}
|
|
;
|
|
if (v instanceof ResponseBodyError) {
|
|
return "There was a problem with the response body: " + renderForeignError(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof TimeoutError) {
|
|
return "There was a problem making the request: timeout";
|
|
}
|
|
;
|
|
if (v instanceof RequestFailedError) {
|
|
return "There was a problem making the request: request failed";
|
|
}
|
|
;
|
|
if (v instanceof XHROtherError) {
|
|
return "There was a problem making the request: " + message(v.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Affjax (line 113, column 14 - line 123, column 66): " + [v.constructor.name]);
|
|
};
|
|
var defaultRequest = /* @__PURE__ */ function() {
|
|
return {
|
|
method: new Left(GET2.value),
|
|
url: "/",
|
|
headers: [],
|
|
content: Nothing.value,
|
|
username: Nothing.value,
|
|
password: Nothing.value,
|
|
withCredentials: false,
|
|
responseFormat: ignore,
|
|
timeout: Nothing.value
|
|
};
|
|
}();
|
|
var get3 = function(driver2) {
|
|
return function(rf) {
|
|
return function(u2) {
|
|
return request(driver2)({
|
|
method: defaultRequest.method,
|
|
headers: defaultRequest.headers,
|
|
content: defaultRequest.content,
|
|
username: defaultRequest.username,
|
|
password: defaultRequest.password,
|
|
withCredentials: defaultRequest.withCredentials,
|
|
timeout: defaultRequest.timeout,
|
|
url: u2,
|
|
responseFormat: rf
|
|
});
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Affjax.Web/foreign.js
|
|
var driver = {
|
|
newXHR: function() {
|
|
return new XMLHttpRequest();
|
|
},
|
|
fixupUrl: function(url) {
|
|
return url || "/";
|
|
}
|
|
};
|
|
|
|
// output/Affjax.Web/index.js
|
|
var get4 = /* @__PURE__ */ get3(driver);
|
|
|
|
// output/Data.Argonaut.Decode.Parser/index.js
|
|
var parseJson = /* @__PURE__ */ function() {
|
|
var $3 = lmap(bifunctorEither)(function(v) {
|
|
return new TypeMismatch("JSON");
|
|
});
|
|
return function($4) {
|
|
return $3(jsonParser($4));
|
|
};
|
|
}();
|
|
|
|
// output/Effect.Console/foreign.js
|
|
var log2 = function(s) {
|
|
return function() {
|
|
console.log(s);
|
|
};
|
|
};
|
|
var warn = function(s) {
|
|
return function() {
|
|
console.warn(s);
|
|
};
|
|
};
|
|
|
|
// output/Effect.Class.Console/index.js
|
|
var log3 = function(dictMonadEffect) {
|
|
var $67 = liftEffect(dictMonadEffect);
|
|
return function($68) {
|
|
return $67(log2($68));
|
|
};
|
|
};
|
|
|
|
// output/Exblo.Utils/index.js
|
|
var css = function($1) {
|
|
return class_(ClassName($1));
|
|
};
|
|
|
|
// output/Halogen.HTML.Elements/index.js
|
|
var element2 = /* @__PURE__ */ function() {
|
|
return element(Nothing.value);
|
|
}();
|
|
var form = /* @__PURE__ */ element2("form");
|
|
var h1 = /* @__PURE__ */ element2("h1");
|
|
var h1_ = /* @__PURE__ */ h1([]);
|
|
var h3 = /* @__PURE__ */ element2("h3");
|
|
var h3_ = /* @__PURE__ */ h3([]);
|
|
var i = /* @__PURE__ */ element2("i");
|
|
var input = function(props) {
|
|
return element2("input")(props)([]);
|
|
};
|
|
var p = /* @__PURE__ */ element2("p");
|
|
var p_ = /* @__PURE__ */ p([]);
|
|
var table = /* @__PURE__ */ element2("table");
|
|
var table_ = /* @__PURE__ */ table([]);
|
|
var td = /* @__PURE__ */ element2("td");
|
|
var td_ = /* @__PURE__ */ td([]);
|
|
var th = /* @__PURE__ */ element2("th");
|
|
var th_ = /* @__PURE__ */ th([]);
|
|
var tr = /* @__PURE__ */ element2("tr");
|
|
var tr_ = /* @__PURE__ */ tr([]);
|
|
var div2 = /* @__PURE__ */ element2("div");
|
|
var div_ = /* @__PURE__ */ div2([]);
|
|
var button = /* @__PURE__ */ element2("button");
|
|
var br = function(props) {
|
|
return element2("br")(props)([]);
|
|
};
|
|
var br_ = /* @__PURE__ */ br([]);
|
|
var a = /* @__PURE__ */ element2("a");
|
|
|
|
// output/Foreign.Index/foreign.js
|
|
function unsafeReadPropImpl(f, s, key, value15) {
|
|
return value15 == null ? f : s(value15[key]);
|
|
}
|
|
|
|
// output/Foreign.Index/index.js
|
|
var unsafeReadProp = function(dictMonad) {
|
|
var fail4 = fail(dictMonad);
|
|
var pure23 = pure(applicativeExceptT(dictMonad));
|
|
return function(k) {
|
|
return function(value15) {
|
|
return unsafeReadPropImpl(fail4(new TypeMismatch2("object", typeOf(value15))), pure23, k, value15);
|
|
};
|
|
};
|
|
};
|
|
var readProp = function(dictMonad) {
|
|
return unsafeReadProp(dictMonad);
|
|
};
|
|
|
|
// output/Web.Event.Event/foreign.js
|
|
function _currentTarget(e) {
|
|
return e.currentTarget;
|
|
}
|
|
function preventDefault(e) {
|
|
return function() {
|
|
return e.preventDefault();
|
|
};
|
|
}
|
|
|
|
// output/Web.Event.Event/index.js
|
|
var currentTarget = function($5) {
|
|
return toMaybe(_currentTarget($5));
|
|
};
|
|
|
|
// output/Web.HTML.Event.EventTypes/index.js
|
|
var input2 = "input";
|
|
var domcontentloaded = "DOMContentLoaded";
|
|
|
|
// output/Web.UIEvent.MouseEvent.EventTypes/index.js
|
|
var click2 = "click";
|
|
|
|
// output/Halogen.HTML.Events/index.js
|
|
var map31 = /* @__PURE__ */ map(functorMaybe);
|
|
var composeKleisli3 = /* @__PURE__ */ composeKleisli(bindMaybe);
|
|
var composeKleisliFlipped4 = /* @__PURE__ */ composeKleisliFlipped(/* @__PURE__ */ bindExceptT(monadIdentity));
|
|
var readProp2 = /* @__PURE__ */ readProp(monadIdentity);
|
|
var readString2 = /* @__PURE__ */ readString(monadIdentity);
|
|
var mouseHandler = unsafeCoerce2;
|
|
var handler$prime = function(et) {
|
|
return function(f) {
|
|
return handler(et)(function(ev) {
|
|
return map31(Action.create)(f(ev));
|
|
});
|
|
};
|
|
};
|
|
var handler2 = function(et) {
|
|
return function(f) {
|
|
return handler(et)(function(ev) {
|
|
return new Just(new Action(f(ev)));
|
|
});
|
|
};
|
|
};
|
|
var onClick = /* @__PURE__ */ function() {
|
|
var $15 = handler2(click2);
|
|
return function($16) {
|
|
return $15(mouseHandler($16));
|
|
};
|
|
}();
|
|
var onSubmit = /* @__PURE__ */ handler2("submit");
|
|
var addForeignPropHandler = function(key) {
|
|
return function(prop3) {
|
|
return function(reader) {
|
|
return function(f) {
|
|
var go2 = function(a2) {
|
|
return composeKleisliFlipped4(reader)(readProp2(prop3))(unsafeToForeign(a2));
|
|
};
|
|
return handler$prime(key)(composeKleisli3(currentTarget)(function(e) {
|
|
return either($$const(Nothing.value))(function($85) {
|
|
return Just.create(f($85));
|
|
})(runExcept(go2(e)));
|
|
}));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var onValueInput = /* @__PURE__ */ addForeignPropHandler(input2)("value")(readString2);
|
|
|
|
// output/Halogen.HTML/index.js
|
|
var componentSlot2 = /* @__PURE__ */ componentSlot();
|
|
var slot_ = function() {
|
|
return function(dictIsSymbol) {
|
|
var componentSlot1 = componentSlot2(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var componentSlot22 = componentSlot1(dictOrd);
|
|
return function(label5) {
|
|
return function(p2) {
|
|
return function(component5) {
|
|
return function(input3) {
|
|
return widget(new ComponentSlot(componentSlot22(label5)(p2)(component5)(input3)($$const(Nothing.value))));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var slot = function() {
|
|
return function(dictIsSymbol) {
|
|
var componentSlot1 = componentSlot2(dictIsSymbol);
|
|
return function(dictOrd) {
|
|
var componentSlot22 = componentSlot1(dictOrd);
|
|
return function(label5) {
|
|
return function(p2) {
|
|
return function(component5) {
|
|
return function(input3) {
|
|
return function(outputQuery) {
|
|
return widget(new ComponentSlot(componentSlot22(label5)(p2)(component5)(input3)(function($11) {
|
|
return Just.create(outputQuery($11));
|
|
})));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Halogen.Store.Connect/index.js
|
|
var bind6 = /* @__PURE__ */ bind(bindHalogenM);
|
|
var $$void5 = /* @__PURE__ */ $$void(functorHalogenM);
|
|
var map33 = /* @__PURE__ */ map(functorEmitter);
|
|
var innerIsSymbol = {
|
|
reflectSymbol: function() {
|
|
return "inner";
|
|
}
|
|
};
|
|
var slot2 = /* @__PURE__ */ slot()(innerIsSymbol)(ordUnit);
|
|
var discard2 = /* @__PURE__ */ discard(discardUnit)(bindHalogenM);
|
|
var map113 = /* @__PURE__ */ map(functorHalogenM);
|
|
var modify_3 = /* @__PURE__ */ modify_2(monadStateHalogenM);
|
|
var gets2 = /* @__PURE__ */ gets(monadStateHalogenM);
|
|
var unless3 = /* @__PURE__ */ unless(applicativeHalogenM);
|
|
var pure13 = /* @__PURE__ */ pure(applicativeHalogenM);
|
|
var query2 = /* @__PURE__ */ query()(innerIsSymbol)(ordUnit);
|
|
var Initialize2 = /* @__PURE__ */ function() {
|
|
function Initialize6() {
|
|
}
|
|
;
|
|
Initialize6.value = new Initialize6();
|
|
return Initialize6;
|
|
}();
|
|
var Receive2 = /* @__PURE__ */ function() {
|
|
function Receive6(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Receive6.create = function(value0) {
|
|
return new Receive6(value0);
|
|
};
|
|
return Receive6;
|
|
}();
|
|
var Update = /* @__PURE__ */ function() {
|
|
function Update2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Update2.create = function(value0) {
|
|
return new Update2(value0);
|
|
};
|
|
return Update2;
|
|
}();
|
|
var Raise2 = /* @__PURE__ */ function() {
|
|
function Raise3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Raise3.create = function(value0) {
|
|
return new Raise3(value0);
|
|
};
|
|
return Raise3;
|
|
}();
|
|
var subscribe3 = function(dictMonadStore) {
|
|
var emitSelected2 = emitSelected(monadStoreHalogenM(dictMonadStore));
|
|
return function(selector) {
|
|
return function(action2) {
|
|
return bind6(emitSelected2(selector))(function(emitter) {
|
|
return $$void5(subscribe2(map33(action2)(emitter)));
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var connect = function(dictMonadEffect) {
|
|
return function(dictMonadStore) {
|
|
var subscribe1 = subscribe3(dictMonadStore);
|
|
var getStore2 = getStore(monadStoreHalogenM(dictMonadStore));
|
|
return function(v) {
|
|
return function(component5) {
|
|
var renderInner = function(input3) {
|
|
return function(context) {
|
|
return slot2($$Proxy.value)(unit)(component5)({
|
|
input: input3,
|
|
context
|
|
})(Raise2.create);
|
|
};
|
|
};
|
|
var render4 = function(state3) {
|
|
if (state3.context instanceof Just) {
|
|
return renderInner(state3.input)(state3.context.value0);
|
|
}
|
|
;
|
|
return text("");
|
|
};
|
|
var initialState = function(input3) {
|
|
return {
|
|
context: Nothing.value,
|
|
initialized: false,
|
|
input: input3
|
|
};
|
|
};
|
|
var handleAction4 = function(v1) {
|
|
if (v1 instanceof Initialize2) {
|
|
return discard2(subscribe1(v)(Update.create))(function() {
|
|
return bind6(map113(v.select)(getStore2))(function(context) {
|
|
return modify_3(function(v2) {
|
|
var $39 = {};
|
|
for (var $40 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $40)) {
|
|
$39[$40] = v2[$40];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$39.context = new Just(context);
|
|
return $39;
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Receive2) {
|
|
return bind6(gets2(function(v2) {
|
|
return v2.input;
|
|
}))(function(oldInput) {
|
|
return unless3(unsafeRefEq(oldInput)(v1.value0))(modify_3(function(v2) {
|
|
var $42 = {};
|
|
for (var $43 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $43)) {
|
|
$42[$43] = v2[$43];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$42.input = v1.value0;
|
|
return $42;
|
|
}));
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Update) {
|
|
return bind6(gets2(function(v2) {
|
|
return v2.context;
|
|
}))(function(v2) {
|
|
if (v2 instanceof Just && unsafeRefEq(v2.value0)(v1.value0)) {
|
|
return pure13(unit);
|
|
}
|
|
;
|
|
return modify_3(function(v3) {
|
|
var $48 = {};
|
|
for (var $49 in v3) {
|
|
if ({}.hasOwnProperty.call(v3, $49)) {
|
|
$48[$49] = v3[$49];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$48.context = new Just(v1.value0);
|
|
return $48;
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Raise2) {
|
|
return raise(v1.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Store.Connect (line 74, column 18 - line 91, column 21): " + [v1.constructor.name]);
|
|
};
|
|
return mkComponent({
|
|
initialState,
|
|
render: render4,
|
|
"eval": mkEval({
|
|
handleAction: handleAction4,
|
|
handleQuery: query2($$Proxy.value)(unit),
|
|
initialize: new Just(Initialize2.value),
|
|
finalize: Nothing.value,
|
|
receive: function($53) {
|
|
return Just.create(Receive2.create($53));
|
|
}
|
|
})
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Network.RemoteData/index.js
|
|
var NotAsked = /* @__PURE__ */ function() {
|
|
function NotAsked2() {
|
|
}
|
|
;
|
|
NotAsked2.value = new NotAsked2();
|
|
return NotAsked2;
|
|
}();
|
|
var Loading2 = /* @__PURE__ */ function() {
|
|
function Loading3() {
|
|
}
|
|
;
|
|
Loading3.value = new Loading3();
|
|
return Loading3;
|
|
}();
|
|
var Failure = /* @__PURE__ */ function() {
|
|
function Failure2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Failure2.create = function(value0) {
|
|
return new Failure2(value0);
|
|
};
|
|
return Failure2;
|
|
}();
|
|
var Success2 = /* @__PURE__ */ function() {
|
|
function Success3(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Success3.create = function(value0) {
|
|
return new Success3(value0);
|
|
};
|
|
return Success3;
|
|
}();
|
|
|
|
// output/Simple.JSON/foreign.js
|
|
var _parseJSON = JSON.parse;
|
|
|
|
// output/Record.Builder/foreign.js
|
|
function copyRecord(rec) {
|
|
var copy2 = {};
|
|
for (var key in rec) {
|
|
if ({}.hasOwnProperty.call(rec, key)) {
|
|
copy2[key] = rec[key];
|
|
}
|
|
}
|
|
return copy2;
|
|
}
|
|
function unsafeInsert(l) {
|
|
return function(a2) {
|
|
return function(rec) {
|
|
rec[l] = a2;
|
|
return rec;
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Record.Builder/index.js
|
|
var semigroupoidBuilder = semigroupoidFn;
|
|
var insert7 = function() {
|
|
return function() {
|
|
return function(dictIsSymbol) {
|
|
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
|
|
return function(l) {
|
|
return function(a2) {
|
|
return function(r1) {
|
|
return unsafeInsert(reflectSymbol2(l))(a2)(r1);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var categoryBuilder = categoryFn;
|
|
var build = function(v) {
|
|
return function(r1) {
|
|
return v(copyRecord(r1));
|
|
};
|
|
};
|
|
|
|
// output/Simple.JSON/index.js
|
|
var applicativeExceptT2 = /* @__PURE__ */ applicativeExceptT(monadIdentity);
|
|
var pure14 = /* @__PURE__ */ pure(applicativeExceptT2);
|
|
var map114 = /* @__PURE__ */ map(/* @__PURE__ */ functorExceptT(functorIdentity));
|
|
var map210 = /* @__PURE__ */ map(functorNonEmptyList);
|
|
var bindExceptT2 = /* @__PURE__ */ bindExceptT(monadIdentity);
|
|
var bindFlipped6 = /* @__PURE__ */ bindFlipped(bindExceptT2);
|
|
var map34 = /* @__PURE__ */ map(functorFn);
|
|
var traverse4 = /* @__PURE__ */ traverse(traversableMaybe)(applicativeExceptT2);
|
|
var readNull2 = /* @__PURE__ */ readNull(monadIdentity);
|
|
var composeKleisliFlipped5 = /* @__PURE__ */ composeKleisliFlipped(bindExceptT2);
|
|
var identity13 = /* @__PURE__ */ identity(categoryBuilder);
|
|
var traverseWithIndex2 = /* @__PURE__ */ traverseWithIndex(traversableWithIndexArray)(applicativeExceptT2);
|
|
var readArray1 = /* @__PURE__ */ readArray(monadIdentity);
|
|
var bind7 = /* @__PURE__ */ bind(bindExceptT2);
|
|
var compose1 = /* @__PURE__ */ compose(semigroupoidBuilder);
|
|
var insert8 = /* @__PURE__ */ insert7()();
|
|
var readProp3 = /* @__PURE__ */ readProp(monadIdentity);
|
|
var readString3 = {
|
|
readImpl: /* @__PURE__ */ readString(monadIdentity)
|
|
};
|
|
var readNumber2 = {
|
|
readImpl: /* @__PURE__ */ readNumber(monadIdentity)
|
|
};
|
|
var readInt2 = {
|
|
readImpl: /* @__PURE__ */ readInt(monadIdentity)
|
|
};
|
|
var readImpl = function(dict) {
|
|
return dict.readImpl;
|
|
};
|
|
var readNullable = function(dictReadForeign) {
|
|
var readImpl2 = readImpl(dictReadForeign);
|
|
return {
|
|
readImpl: function(o) {
|
|
var reformat = function(error4) {
|
|
if (error4 instanceof TypeMismatch2) {
|
|
return new TypeMismatch2("Nullable " + error4.value0, error4.value1);
|
|
}
|
|
;
|
|
return error4;
|
|
};
|
|
return withExcept(map210(reformat))(bindFlipped6(map34(map114(toNullable))(traverse4(readImpl2)))(readNull2(o)));
|
|
}
|
|
};
|
|
};
|
|
var readFieldsNil = {
|
|
getFields: function(v) {
|
|
return function(v1) {
|
|
return pure14(identity13);
|
|
};
|
|
}
|
|
};
|
|
var readBoolean2 = {
|
|
readImpl: /* @__PURE__ */ readBoolean(monadIdentity)
|
|
};
|
|
var readArray2 = function(dictReadForeign) {
|
|
var readImpl2 = readImpl(dictReadForeign);
|
|
return {
|
|
readImpl: function() {
|
|
var readAtIdx = function(i2) {
|
|
return function(f) {
|
|
return withExcept(map210(ErrorAtIndex.create(i2)))(readImpl2(f));
|
|
};
|
|
};
|
|
return composeKleisliFlipped5(traverseWithIndex2(readAtIdx))(readArray1);
|
|
}()
|
|
};
|
|
};
|
|
var parseJSON = /* @__PURE__ */ function() {
|
|
var $205 = lmap(bifunctorEither)(function() {
|
|
var $208 = pure(applicativeNonEmptyList);
|
|
return function($209) {
|
|
return $208(ForeignError.create(message($209)));
|
|
};
|
|
}());
|
|
var $206 = runEffectFn1(_parseJSON);
|
|
return function($207) {
|
|
return ExceptT(Identity($205(unsafePerformEffect($$try($206($207))))));
|
|
};
|
|
}();
|
|
var readJSON = function(dictReadForeign) {
|
|
var $210 = composeKleisliFlipped5(readImpl(dictReadForeign))(parseJSON);
|
|
return function($211) {
|
|
return runExcept($210($211));
|
|
};
|
|
};
|
|
var getFields = function(dict) {
|
|
return dict.getFields;
|
|
};
|
|
var readRecord = function() {
|
|
return function(dictReadForeignFields) {
|
|
var getFields1 = getFields(dictReadForeignFields);
|
|
return {
|
|
readImpl: function(o) {
|
|
return map114(flip(build)({}))(getFields1($$Proxy.value)(o));
|
|
}
|
|
};
|
|
};
|
|
};
|
|
var applyEither2 = function(dictSemigroup) {
|
|
var append12 = append(dictSemigroup);
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (v instanceof Left && v1 instanceof Right) {
|
|
return new Left(v.value0);
|
|
}
|
|
;
|
|
if (v instanceof Left && v1 instanceof Left) {
|
|
return new Left(append12(v.value0)(v1.value0));
|
|
}
|
|
;
|
|
if (v instanceof Right && v1 instanceof Left) {
|
|
return new Left(v1.value0);
|
|
}
|
|
;
|
|
if (v instanceof Right && v1 instanceof Right) {
|
|
return new Right(v.value0(v1.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Simple.JSON (line 241, column 1 - line 241, column 90): " + [v.constructor.name, v1.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var exceptTApply = function(dictSemigroup) {
|
|
var applyEither1 = applyEither2(dictSemigroup);
|
|
return function(dictApplicative) {
|
|
var Apply0 = dictApplicative.Apply0();
|
|
var apply6 = apply(Apply0);
|
|
var map42 = map(Apply0.Functor0());
|
|
return function(fun) {
|
|
return function(a2) {
|
|
return apply6(map42(applyEither1)(runExceptT(fun)))(runExceptT(a2));
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var exceptTApply1 = /* @__PURE__ */ exceptTApply(semigroupNonEmptyList)(applicativeIdentity);
|
|
var readFieldsCons = function(dictIsSymbol) {
|
|
var reflectSymbol2 = reflectSymbol(dictIsSymbol);
|
|
var insert13 = insert8(dictIsSymbol);
|
|
return function(dictReadForeign) {
|
|
var readImpl2 = readImpl(dictReadForeign);
|
|
return function(dictReadForeignFields) {
|
|
var getFields1 = getFields(dictReadForeignFields);
|
|
return function() {
|
|
return function() {
|
|
return {
|
|
getFields: function(v) {
|
|
return function(obj) {
|
|
var rest2 = getFields1($$Proxy.value)(obj);
|
|
var name16 = reflectSymbol2($$Proxy.value);
|
|
var withExcept$prime = withExcept(map210(ErrorAtProperty.create(name16)));
|
|
var first2 = bind7(withExcept$prime(bindFlipped6(readImpl2)(readProp3(name16)(obj))))(function(value15) {
|
|
return pure14(insert13($$Proxy.value)(value15));
|
|
});
|
|
return exceptTApply1(map114(compose1)(first2))(rest2);
|
|
};
|
|
}
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Exblo.Home/index.js
|
|
var forever2 = /* @__PURE__ */ forever(monadRecAff);
|
|
var discard3 = /* @__PURE__ */ discard(discardUnit);
|
|
var discard1 = /* @__PURE__ */ discard3(bindAff);
|
|
var liftEffect4 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var show4 = /* @__PURE__ */ show(showInt);
|
|
var value14 = /* @__PURE__ */ value(isPropString);
|
|
var type_19 = /* @__PURE__ */ type_(isPropButtonType);
|
|
var show13 = /* @__PURE__ */ show(showZcashNet);
|
|
var bind8 = /* @__PURE__ */ bind(bindHalogenM);
|
|
var bindFlipped7 = /* @__PURE__ */ bindFlipped(bindHalogenM);
|
|
var discard22 = /* @__PURE__ */ discard3(bindHalogenM);
|
|
var modify_4 = /* @__PURE__ */ modify_2(monadStateHalogenM);
|
|
var readJSON2 = /* @__PURE__ */ readJSON(readInt2);
|
|
var show22 = /* @__PURE__ */ show(/* @__PURE__ */ showNonEmptyList(showForeignError));
|
|
var gets3 = /* @__PURE__ */ gets(monadStateHalogenM);
|
|
var Initialize3 = /* @__PURE__ */ function() {
|
|
function Initialize6() {
|
|
}
|
|
;
|
|
Initialize6.value = new Initialize6();
|
|
return Initialize6;
|
|
}();
|
|
var Refresh = /* @__PURE__ */ function() {
|
|
function Refresh2() {
|
|
}
|
|
;
|
|
Refresh2.value = new Refresh2();
|
|
return Refresh2;
|
|
}();
|
|
var Receive3 = /* @__PURE__ */ function() {
|
|
function Receive6(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Receive6.create = function(value0) {
|
|
return new Receive6(value0);
|
|
};
|
|
return Receive6;
|
|
}();
|
|
var Search = /* @__PURE__ */ function() {
|
|
function Search2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Search2.create = function(value0) {
|
|
return new Search2(value0);
|
|
};
|
|
return Search2;
|
|
}();
|
|
var SetTerm = /* @__PURE__ */ function() {
|
|
function SetTerm2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
SetTerm2.create = function(value0) {
|
|
return new SetTerm2(value0);
|
|
};
|
|
return SetTerm2;
|
|
}();
|
|
var timer = function(dictMonadAff) {
|
|
var MonadEffect0 = dictMonadAff.MonadEffect0();
|
|
var Monad0 = MonadEffect0.Monad0();
|
|
var bind18 = bind(Monad0.Bind1());
|
|
var liftEffect12 = liftEffect(MonadEffect0);
|
|
var liftAff2 = liftAff(dictMonadAff);
|
|
var pure23 = pure(Monad0.Applicative0());
|
|
return function(val) {
|
|
return bind18(liftEffect12(create))(function(v) {
|
|
return bind18(liftAff2(forkAff(forever2(discard1(delay(6e4))(function() {
|
|
return liftEffect4(notify(v.listener)(val));
|
|
})))))(function() {
|
|
return pure23(v.emitter);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var render = function(state3) {
|
|
return div2([css("bigcard")])([h1_([text("exblo")]), div2([css("card")])([h3_([text("latest block")]), p_([text(function() {
|
|
if (state3.block instanceof NotAsked) {
|
|
return "N/A";
|
|
}
|
|
;
|
|
if (state3.block instanceof Loading2) {
|
|
return "Loading";
|
|
}
|
|
;
|
|
if (state3.block instanceof Failure) {
|
|
return state3.block.value0;
|
|
}
|
|
;
|
|
if (state3.block instanceof Success2) {
|
|
return show4(state3.block.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Home (line 72, column 17 - line 76, column 38): " + [state3.block.constructor.name]);
|
|
}())])]), form([onSubmit(function(ev) {
|
|
return new Search(ev);
|
|
})])([p_([input([css("input"), value14(state3.term), placeholder("Search TX ID..."), onValueInput(function(str) {
|
|
return new SetTerm(str);
|
|
})]), button([css("btn-primary raised"), type_19(ButtonSubmit.value)])([i([css("ri-search-line ri-xl")])([])])])]), table([css("footer")])([tr_([td([css("footer")])([p_([text("Made with "), a([href("https://www.purescript.org/")])([text("PureScript")])])]), td([css("footer")])([p_([i([css("ri-copyright-line")])([]), text("2024 Vergara Technologies LLC")])]), td([css("footer")])([p([])([text("Network: "), text(show13(state3.network)), br_, text("Version: "), text(state3.version), br_, text("Zebra Node: "), text(state3.zebra)])])])])]);
|
|
};
|
|
var handleAction = function(dictMonadAff) {
|
|
var monadAffHalogenM2 = monadAffHalogenM(dictMonadAff);
|
|
var timer1 = timer(monadAffHalogenM2);
|
|
var liftAff2 = liftAff(monadAffHalogenM2);
|
|
var monadEffectHalogenM2 = monadEffectHalogenM(dictMonadAff.MonadEffect0());
|
|
var log4 = log3(monadEffectHalogenM2);
|
|
var liftEffect12 = liftEffect(monadEffectHalogenM2);
|
|
return function(dictNavigate) {
|
|
var navigate2 = navigate(navigateHalogenM(dictNavigate));
|
|
return function(dictMonadStore) {
|
|
var getStore2 = getStore(monadStoreHalogenM(dictMonadStore));
|
|
return function(v) {
|
|
if (v instanceof Initialize3) {
|
|
return bind8(bindFlipped7(subscribe2)(timer1(Refresh.value)))(function() {
|
|
return bind8(getStore2)(function(st) {
|
|
return discard22(modify_4(function(v1) {
|
|
var $72 = {};
|
|
for (var $73 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $73)) {
|
|
$72[$73] = v1[$73];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$72.network = st.network;
|
|
$72.zebra = st.zebraVersion;
|
|
$72.version = st.version;
|
|
return $72;
|
|
}))(function() {
|
|
return handleAction(dictMonadAff)(dictNavigate)(dictMonadStore)(Refresh.value);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof Refresh) {
|
|
return discard22(modify_4(function(v1) {
|
|
var $75 = {};
|
|
for (var $76 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $76)) {
|
|
$75[$76] = v1[$76];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$75.block = Loading2.value;
|
|
return $75;
|
|
}))(function() {
|
|
return bind8(liftAff2(get4(string)("https://api.exblo.app/getblock")))(function(res) {
|
|
if (res instanceof Left) {
|
|
return log4("/block response failed to decode: " + printError(res.value0));
|
|
}
|
|
;
|
|
if (res instanceof Right) {
|
|
var v1 = readJSON2(res.value0.body);
|
|
if (v1 instanceof Right) {
|
|
return modify_4(function(v2) {
|
|
var $81 = {};
|
|
for (var $82 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $82)) {
|
|
$81[$82] = v2[$82];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$81.block = new Success2(v1.value0);
|
|
return $81;
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Left) {
|
|
return discard22(log4("Can't parse JSON. " + show22(v1.value0)))(function() {
|
|
return modify_4(function(v2) {
|
|
var $85 = {};
|
|
for (var $86 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $86)) {
|
|
$85[$86] = v2[$86];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$85.block = new Failure("Failed to parse response");
|
|
return $85;
|
|
});
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Home (line 146, column 9 - line 154, column 61): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Home (line 142, column 5 - line 154, column 61): " + [res.constructor.name]);
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof SetTerm) {
|
|
return modify_4(function(v1) {
|
|
var $90 = {};
|
|
for (var $91 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $91)) {
|
|
$90[$91] = v1[$91];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$90.term = v.value0;
|
|
return $90;
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof Receive3) {
|
|
return modify_4(function(v1) {
|
|
var $94 = {};
|
|
for (var $95 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $95)) {
|
|
$94[$95] = v1[$95];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$94.network = v.value0.context.network;
|
|
$94.zebra = v.value0.context.zebraVersion;
|
|
$94.version = v.value0.context.version;
|
|
return $94;
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof Search) {
|
|
return discard22(liftEffect12(preventDefault(v.value0)))(function() {
|
|
return bind8(gets3(function(v1) {
|
|
return v1.term;
|
|
}))(function(term) {
|
|
return navigate2(new Tx(term));
|
|
});
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Home (line 133, column 16 - line 162, column 23): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var component = function(dictMonadAff) {
|
|
var connect2 = connect(dictMonadAff.MonadEffect0());
|
|
var handleAction1 = handleAction(dictMonadAff);
|
|
return function(dictMonadStore) {
|
|
var connect1 = connect2(dictMonadStore);
|
|
return function(dictNavigate) {
|
|
return connect1(selectAll)(mkComponent({
|
|
initialState: function(v) {
|
|
return {
|
|
block: NotAsked.value,
|
|
term: "",
|
|
network: TestNet.value,
|
|
zebra: "",
|
|
version: ""
|
|
};
|
|
},
|
|
render,
|
|
"eval": mkEval({
|
|
handleQuery: defaultEval.handleQuery,
|
|
finalize: defaultEval.finalize,
|
|
handleAction: handleAction1(dictNavigate)(dictMonadStore),
|
|
receive: function($106) {
|
|
return Just.create(Receive3.create($106));
|
|
},
|
|
initialize: new Just(Initialize3.value)
|
|
})
|
|
}));
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Exblo.Tx/index.js
|
|
var show5 = /* @__PURE__ */ show(showInt);
|
|
var discard4 = /* @__PURE__ */ discard(discardUnit)(bindHalogenM);
|
|
var modify_5 = /* @__PURE__ */ modify_2(monadStateHalogenM);
|
|
var bind9 = /* @__PURE__ */ bind(bindHalogenM);
|
|
var gets4 = /* @__PURE__ */ gets(monadStateHalogenM);
|
|
var readRecord2 = /* @__PURE__ */ readRecord();
|
|
var readFieldsCons2 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "cv";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons1 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "encCiphertext";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons22 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "ephemeralKey";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons3 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "nullifier";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons4 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "outCiphertext";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons5 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "rk";
|
|
}
|
|
})(readString3)(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "spendAuthSig";
|
|
}
|
|
})(readString3)(readFieldsNil)()())()();
|
|
var readFieldsCons6 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "anchor";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons7 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "proof";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons8 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "sig";
|
|
}
|
|
})(readString3);
|
|
var readFieldsCons9 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "value";
|
|
}
|
|
})(readInt2)(readFieldsNil)()();
|
|
var readFieldsCons10 = /* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "txid";
|
|
}
|
|
})(readString3)(readFieldsNil)()();
|
|
var readJSON3 = /* @__PURE__ */ readJSON(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "confirmations";
|
|
}
|
|
})(readInt2)(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "expiry";
|
|
}
|
|
})(readInt2)(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "height";
|
|
}
|
|
})(readInt2)(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "orchard";
|
|
}
|
|
})(/* @__PURE__ */ readNullable(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "actions";
|
|
}
|
|
})(/* @__PURE__ */ readArray2(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "cmx";
|
|
}
|
|
})(readString3)(/* @__PURE__ */ readFieldsCons2(/* @__PURE__ */ readFieldsCons1(/* @__PURE__ */ readFieldsCons22(/* @__PURE__ */ readFieldsCons3(/* @__PURE__ */ readFieldsCons4(readFieldsCons5)()())()())()())()())()())()())))(/* @__PURE__ */ readFieldsCons6(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "flags";
|
|
}
|
|
})(/* @__PURE__ */ readArray2(readBoolean2))(/* @__PURE__ */ readFieldsCons7(/* @__PURE__ */ readFieldsCons8(readFieldsCons9)()())()())()())()())()())))(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "sapling";
|
|
}
|
|
})(/* @__PURE__ */ readNullable(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "outputs";
|
|
}
|
|
})(/* @__PURE__ */ readArray2(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "cmu";
|
|
}
|
|
})(readString3)(/* @__PURE__ */ readFieldsCons2(/* @__PURE__ */ readFieldsCons1(/* @__PURE__ */ readFieldsCons22(/* @__PURE__ */ readFieldsCons4(/* @__PURE__ */ readFieldsCons7(readFieldsNil)()())()())()())()())()())()())))(/* @__PURE__ */ readFieldsCons8(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "spends";
|
|
}
|
|
})(/* @__PURE__ */ readArray2(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons6(/* @__PURE__ */ readFieldsCons2(/* @__PURE__ */ readFieldsCons3(/* @__PURE__ */ readFieldsCons7(readFieldsCons5)()())()())()())()())))(readFieldsCons9)()())()())()())))(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "transparent";
|
|
}
|
|
})(/* @__PURE__ */ readNullable(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "coinbase";
|
|
}
|
|
})(readBoolean2)(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "vin";
|
|
}
|
|
})(/* @__PURE__ */ readArray2(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "inputscript";
|
|
}
|
|
})(readString3)(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "prevoutput";
|
|
}
|
|
})(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "index";
|
|
}
|
|
})(readNumber2)(readFieldsCons10)()()))(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "sequence";
|
|
}
|
|
})(readNumber2)(readFieldsNil)()())()())()())))(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "vout";
|
|
}
|
|
})(/* @__PURE__ */ readArray2(/* @__PURE__ */ readRecord2(/* @__PURE__ */ readFieldsCons({
|
|
reflectSymbol: function() {
|
|
return "outputscript";
|
|
}
|
|
})(readString3)(readFieldsCons9)()())))(readFieldsNil)()())()())()())))(readFieldsCons10)()())()())()())()())()())()()));
|
|
var show14 = /* @__PURE__ */ show(/* @__PURE__ */ showNonEmptyList(showForeignError));
|
|
var get5 = /* @__PURE__ */ get(monadStateHalogenM);
|
|
var selectEq2 = /* @__PURE__ */ selectEq(eqZcashNet);
|
|
var Initialize4 = /* @__PURE__ */ function() {
|
|
function Initialize6() {
|
|
}
|
|
;
|
|
Initialize6.value = new Initialize6();
|
|
return Initialize6;
|
|
}();
|
|
var Receive4 = /* @__PURE__ */ function() {
|
|
function Receive6(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Receive6.create = function(value0) {
|
|
return new Receive6(value0);
|
|
};
|
|
return Receive6;
|
|
}();
|
|
var Close = /* @__PURE__ */ function() {
|
|
function Close2(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Close2.create = function(value0) {
|
|
return new Close2(value0);
|
|
};
|
|
return Close2;
|
|
}();
|
|
var render2 = function(state3) {
|
|
return div2([css("bigcard")])([h1_([text("exblo")]), function() {
|
|
if (state3.tx instanceof NotAsked) {
|
|
return p_([text("Explore the Zcash blockchain")]);
|
|
}
|
|
;
|
|
if (state3.tx instanceof Loading2) {
|
|
return p_([text("Processing Zebra response...")]);
|
|
}
|
|
;
|
|
if (state3.tx instanceof Failure) {
|
|
return p_([text(state3.tx.value0)]);
|
|
}
|
|
;
|
|
if (state3.tx instanceof Success2) {
|
|
return div2([css("card")])([table_([tr_([th_([text("tx id")]), td_([text(state3.tx.value0.txid)])]), tr_([th_([text("block")]), td_([text(show5(state3.tx.value0.height))])]), tr_([th_([text("confirmations")]), td_([text(show5(state3.tx.value0.confirmations))])]), tr_([th_([text("expiry")]), td_([text(show5(state3.tx.value0.expiry))])]), tr_([th_([text("fee")]), td_([text(show5(sumBundles(state3.tx.value0.transparent)(state3.tx.value0.sapling)(state3.tx.value0.orchard)))])]), function() {
|
|
var v = toMaybe(state3.tx.value0.orchard);
|
|
if (v instanceof Nothing) {
|
|
return p_([]);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return tr_([th_([text("orchard")]), table_([tr_([th_([text("actions")]), td_([text(show5(length(v.value0.actions)))])]), tr_([th_([text("value")]), td_([text(show5(v.value0.value))])])])]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 78, column 19 - line 93, column 26): " + [v.constructor.name]);
|
|
}(), function() {
|
|
var v = toMaybe(state3.tx.value0.sapling);
|
|
if (v instanceof Nothing) {
|
|
return p_([]);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return tr_([th_([text("sapling")]), table_([tr_([th_([text("spends")]), td_([text(show5(length(v.value0.spends)))])]), tr_([th_([text("outputs")]), td_([text(show5(length(v.value0.outputs)))])]), tr_([th_([text("value")]), td_([text(show5(v.value0.value))])])])]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 94, column 19 - line 113, column 26): " + [v.constructor.name]);
|
|
}(), function() {
|
|
var v = toMaybe(state3.tx.value0.transparent);
|
|
if (v instanceof Nothing) {
|
|
return p_([]);
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return tr_([th_([text("transparent"), function() {
|
|
if (v.value0.coinbase) {
|
|
return i([css("ri-money-dollar-circle-line ri-xl")])([]);
|
|
}
|
|
;
|
|
return p_([]);
|
|
}()]), table_([tr_([th_([text("inputs")]), td_([text(show5(length(v.value0.vin)))])]), tr_([th_([text("outputs")]), td_([text(show5(length(v.value0.vout)))])]), tr_([th_([text("value")]), td_([text(show5(foldl2(function(a2) {
|
|
return function(b2) {
|
|
return a2 + b2.value | 0;
|
|
};
|
|
})(0)(v.value0.vout)))])])])]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 114, column 19 - line 137, column 26): " + [v.constructor.name]);
|
|
}()]), button([css("btn-primary raised"), onClick(function(ev) {
|
|
return new Close(ev);
|
|
})])([i([css("ri-arrow-go-back-fill ri-lg")])([]), text("Back")])]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 65, column 7 - line 146, column 14): " + [state3.tx.constructor.name]);
|
|
}(), p_([i([css("ri-copyright-line")])([]), text("2024 Vergara Technologies LLC")])]);
|
|
};
|
|
var handleAction2 = function(dictMonadAff) {
|
|
var liftAff2 = liftAff(monadAffHalogenM(dictMonadAff));
|
|
return function(dictNavigate) {
|
|
var navigate2 = navigate(navigateHalogenM(dictNavigate));
|
|
return function(v) {
|
|
if (v instanceof Initialize4) {
|
|
return discard4(modify_5(function(v1) {
|
|
var $297 = {};
|
|
for (var $298 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $298)) {
|
|
$297[$298] = v1[$298];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$297.tx = Loading2.value;
|
|
return $297;
|
|
}))(function() {
|
|
return bind9(gets4(function(v1) {
|
|
return v1.hex;
|
|
}))(function(term) {
|
|
return bind9(liftAff2(get4(string)("https://api.exblo.app/gettransaction/" + term)))(function(res) {
|
|
if (res instanceof Left) {
|
|
return modify_5(function(v12) {
|
|
var $301 = {};
|
|
for (var $302 in v12) {
|
|
if ({}.hasOwnProperty.call(v12, $302)) {
|
|
$301[$302] = v12[$302];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$301.tx = new Failure(printError(res.value0));
|
|
return $301;
|
|
});
|
|
}
|
|
;
|
|
if (res instanceof Right) {
|
|
var v1 = readJSON3(res.value0.body);
|
|
if (v1 instanceof Right) {
|
|
return modify_5(function(v2) {
|
|
var $306 = {};
|
|
for (var $307 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $307)) {
|
|
$306[$307] = v2[$307];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$306.tx = new Success2(v1.value0);
|
|
return $306;
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Left) {
|
|
return modify_5(function(v2) {
|
|
var $310 = {};
|
|
for (var $311 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $311)) {
|
|
$310[$311] = v2[$311];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$310.tx = new Failure(show14(v1.value0));
|
|
return $310;
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 164, column 12 - line 167, column 63): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 160, column 5 - line 167, column 63): " + [res.constructor.name]);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof Receive4) {
|
|
return bind9(get5)(function(st) {
|
|
var $315 = st.hex !== v.value0.input;
|
|
if ($315) {
|
|
return discard4(modify_5(function(v1) {
|
|
var $316 = {};
|
|
for (var $317 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $317)) {
|
|
$316[$317] = v1[$317];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$316.hex = v.value0.input;
|
|
$316.network = v.value0.context;
|
|
return $316;
|
|
}))(function() {
|
|
return handleAction2(dictMonadAff)(dictNavigate)(Initialize4.value);
|
|
});
|
|
}
|
|
;
|
|
return modify_5(function(v1) {
|
|
var $319 = {};
|
|
for (var $320 in v1) {
|
|
if ({}.hasOwnProperty.call(v1, $320)) {
|
|
$319[$320] = v1[$320];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$319.network = v.value0.context;
|
|
return $319;
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof Close) {
|
|
return navigate2(Home.value);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Tx (line 155, column 16 - line 175, column 27): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
var component2 = function(dictMonadAff) {
|
|
var connect2 = connect(dictMonadAff.MonadEffect0());
|
|
var handleAction1 = handleAction2(dictMonadAff);
|
|
return function(dictMonadStore) {
|
|
var connect1 = connect2(dictMonadStore);
|
|
return function(dictNavigate) {
|
|
var initialState = function(v) {
|
|
return {
|
|
tx: NotAsked.value,
|
|
network: v.context,
|
|
hex: v.input
|
|
};
|
|
};
|
|
return connect1(selectEq2(function(v) {
|
|
return v.network;
|
|
}))(mkComponent({
|
|
initialState,
|
|
render: render2,
|
|
"eval": mkEval({
|
|
handleQuery: defaultEval.handleQuery,
|
|
finalize: defaultEval.finalize,
|
|
handleAction: handleAction1(dictNavigate),
|
|
receive: function($329) {
|
|
return Just.create(Receive4.create($329));
|
|
},
|
|
initialize: new Just(Initialize4.value)
|
|
})
|
|
}));
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Exblo.Router/index.js
|
|
var slot_2 = /* @__PURE__ */ slot_();
|
|
var slot_1 = /* @__PURE__ */ slot_2({
|
|
reflectSymbol: function() {
|
|
return "home";
|
|
}
|
|
})(ordUnit);
|
|
var slot_22 = /* @__PURE__ */ slot_2({
|
|
reflectSymbol: function() {
|
|
return "transaction";
|
|
}
|
|
})(ordUnit);
|
|
var bind10 = /* @__PURE__ */ bind(bindHalogenM);
|
|
var get6 = /* @__PURE__ */ get(monadStateHalogenM);
|
|
var discard5 = /* @__PURE__ */ discard(discardUnit)(bindHalogenM);
|
|
var when2 = /* @__PURE__ */ when(applicativeHalogenM);
|
|
var notEq2 = /* @__PURE__ */ notEq(/* @__PURE__ */ eqMaybe(eqRoute));
|
|
var modify_6 = /* @__PURE__ */ modify_2(monadStateHalogenM);
|
|
var pure15 = /* @__PURE__ */ pure(applicativeHalogenM);
|
|
var bindFlipped8 = /* @__PURE__ */ bindFlipped(bindEither);
|
|
var decodeJson3 = /* @__PURE__ */ decodeJson(decodeJsonExbloInfo);
|
|
var show6 = /* @__PURE__ */ show(showJsonDecodeError);
|
|
var map35 = /* @__PURE__ */ map(functorHalogenM);
|
|
var Navigate = /* @__PURE__ */ function() {
|
|
function Navigate2(value0, value1) {
|
|
this.value0 = value0;
|
|
this.value1 = value1;
|
|
}
|
|
;
|
|
Navigate2.create = function(value0) {
|
|
return function(value1) {
|
|
return new Navigate2(value0, value1);
|
|
};
|
|
};
|
|
return Navigate2;
|
|
}();
|
|
var Initialize5 = /* @__PURE__ */ function() {
|
|
function Initialize6() {
|
|
}
|
|
;
|
|
Initialize6.value = new Initialize6();
|
|
return Initialize6;
|
|
}();
|
|
var Receive5 = /* @__PURE__ */ function() {
|
|
function Receive6(value0) {
|
|
this.value0 = value0;
|
|
}
|
|
;
|
|
Receive6.create = function(value0) {
|
|
return new Receive6(value0);
|
|
};
|
|
return Receive6;
|
|
}();
|
|
var render3 = function(dictMonadAff) {
|
|
var component1 = component(dictMonadAff);
|
|
var component22 = component2(dictMonadAff);
|
|
return function(dictMonadStore) {
|
|
var component32 = component1(dictMonadStore);
|
|
var component42 = component22(dictMonadStore);
|
|
return function(dictNavigate) {
|
|
var component5 = component32(dictNavigate);
|
|
var component6 = component42(dictNavigate);
|
|
return function(v) {
|
|
if (v.route instanceof Just) {
|
|
if (v.route.value0 instanceof Home) {
|
|
return slot_1($$Proxy.value)(unit)(component5)(unit);
|
|
}
|
|
;
|
|
if (v.route.value0 instanceof Tx) {
|
|
return slot_22($$Proxy.value)(unit)(component6)(v.route.value0.value0);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Router (line 62, column 9 - line 64, column 80): " + [v.route.value0.constructor.name]);
|
|
}
|
|
;
|
|
if (v.route instanceof Nothing) {
|
|
return div_([text("Page not found.")]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Router (line 60, column 3 - line 65, column 55): " + [v.route.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var handleQuery = function(v) {
|
|
return bind10(get6)(function(v1) {
|
|
return discard5(when2(notEq2(v1.route)(new Just(v.value0)))(modify_6(function(v2) {
|
|
var $73 = {};
|
|
for (var $74 in v2) {
|
|
if ({}.hasOwnProperty.call(v2, $74)) {
|
|
$73[$74] = v2[$74];
|
|
}
|
|
;
|
|
}
|
|
;
|
|
$73.route = new Just(v.value0);
|
|
return $73;
|
|
})))(function() {
|
|
return pure15(new Just(v.value1));
|
|
});
|
|
});
|
|
};
|
|
var handleAction3 = function(dictMonadAff) {
|
|
var liftAff2 = liftAff(monadAffHalogenM(dictMonadAff));
|
|
var monadEffectHalogenM2 = monadEffectHalogenM(dictMonadAff.MonadEffect0());
|
|
var log4 = log3(monadEffectHalogenM2);
|
|
var liftEffect10 = liftEffect(monadEffectHalogenM2);
|
|
return function(dictNavigate) {
|
|
var navigate2 = navigate(navigateHalogenM(dictNavigate));
|
|
return function(dictMonadStore) {
|
|
var monadStoreHalogenM2 = monadStoreHalogenM(dictMonadStore);
|
|
var getStore2 = getStore(monadStoreHalogenM2);
|
|
var updateStore2 = updateStore(monadStoreHalogenM2);
|
|
return function(v) {
|
|
if (v instanceof Initialize5) {
|
|
return bind10(getStore2)(function(s) {
|
|
return bind10(liftAff2(get4(string)(s.baseUrl + "/getinfo")))(function(res) {
|
|
return discard5(function() {
|
|
if (res instanceof Left) {
|
|
return log4("/getinfo response failed " + printError(res.value0));
|
|
}
|
|
;
|
|
if (res instanceof Right) {
|
|
var v1 = bindFlipped8(decodeJson3)(parseJson(res.value0.body));
|
|
if (v1 instanceof Right) {
|
|
return updateStore2(new SetInfo(v1.value0));
|
|
}
|
|
;
|
|
if (v1 instanceof Left) {
|
|
return log4("/getinfo JSON decode failed " + show6(v1.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Router (line 76, column 12 - line 79, column 74): " + [v1.constructor.name]);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Router (line 72, column 5 - line 79, column 74): " + [res.constructor.name]);
|
|
}())(function() {
|
|
return bind10(map35(function() {
|
|
var $90 = parse(routeCodec);
|
|
return function($91) {
|
|
return hush($90($91));
|
|
};
|
|
}())(liftEffect10(getHash)))(function(initialRoute) {
|
|
return navigate2(fromMaybe(Home.value)(initialRoute));
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v instanceof Receive5) {
|
|
return pure15(unit);
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Exblo.Router (line 68, column 16 - line 82, column 44): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var deriveState = function(v) {
|
|
return {
|
|
route: Nothing.value
|
|
};
|
|
};
|
|
var component3 = function(dictMonadAff) {
|
|
var connect2 = connect(dictMonadAff.MonadEffect0());
|
|
var render1 = render3(dictMonadAff);
|
|
var handleAction1 = handleAction3(dictMonadAff);
|
|
return function(dictNavigate) {
|
|
var handleAction22 = handleAction1(dictNavigate);
|
|
return function(dictMonadStore) {
|
|
return connect2(dictMonadStore)(selectAll)(mkComponent({
|
|
initialState: deriveState,
|
|
render: render1(dictMonadStore)(dictNavigate),
|
|
"eval": mkEval({
|
|
finalize: defaultEval.finalize,
|
|
handleAction: handleAction22(dictMonadStore),
|
|
handleQuery,
|
|
receive: function($92) {
|
|
return Just.create(Receive5.create($92));
|
|
},
|
|
initialize: new Just(Initialize5.value)
|
|
})
|
|
}));
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Halogen.Aff.Util/index.js
|
|
var bind11 = /* @__PURE__ */ bind(bindAff);
|
|
var liftEffect5 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var bindFlipped9 = /* @__PURE__ */ bindFlipped(bindEffect);
|
|
var composeKleisliFlipped6 = /* @__PURE__ */ composeKleisliFlipped(bindEffect);
|
|
var pure16 = /* @__PURE__ */ pure(applicativeAff);
|
|
var bindFlipped1 = /* @__PURE__ */ bindFlipped(bindMaybe);
|
|
var pure17 = /* @__PURE__ */ pure(applicativeEffect);
|
|
var map36 = /* @__PURE__ */ map(functorEffect);
|
|
var discard6 = /* @__PURE__ */ discard(discardUnit);
|
|
var throwError2 = /* @__PURE__ */ throwError(monadThrowAff);
|
|
var selectElement = function(query3) {
|
|
return bind11(liftEffect5(bindFlipped9(composeKleisliFlipped6(function() {
|
|
var $16 = querySelector(query3);
|
|
return function($17) {
|
|
return $16(toParentNode($17));
|
|
};
|
|
}())(document))(windowImpl)))(function(mel) {
|
|
return pure16(bindFlipped1(fromElement)(mel));
|
|
});
|
|
};
|
|
var runHalogenAff = /* @__PURE__ */ runAff_(/* @__PURE__ */ either(throwException)(/* @__PURE__ */ $$const(/* @__PURE__ */ pure17(unit))));
|
|
var awaitLoad = /* @__PURE__ */ makeAff(function(callback) {
|
|
return function __do2() {
|
|
var rs = bindFlipped9(readyState)(bindFlipped9(document)(windowImpl))();
|
|
if (rs instanceof Loading) {
|
|
var et = map36(toEventTarget)(windowImpl)();
|
|
var listener = eventListener(function(v) {
|
|
return callback(new Right(unit));
|
|
})();
|
|
addEventListener2(domcontentloaded)(listener)(false)(et)();
|
|
return effectCanceler(removeEventListener2(domcontentloaded)(listener)(false)(et));
|
|
}
|
|
;
|
|
callback(new Right(unit))();
|
|
return nonCanceler;
|
|
};
|
|
});
|
|
var awaitBody = /* @__PURE__ */ discard6(bindAff)(awaitLoad)(function() {
|
|
return bind11(selectElement("body"))(function(body2) {
|
|
return maybe(throwError2(error("Could not find body")))(pure16)(body2);
|
|
});
|
|
});
|
|
|
|
// output/Halogen.Aff.Driver.State/index.js
|
|
var unRenderStateX = unsafeCoerce2;
|
|
var unDriverStateX = unsafeCoerce2;
|
|
var renderStateX_ = function(dictApplicative) {
|
|
var traverse_7 = traverse_(dictApplicative)(foldableMaybe);
|
|
return function(f) {
|
|
return unDriverStateX(function(st) {
|
|
return traverse_7(f)(st.rendering);
|
|
});
|
|
};
|
|
};
|
|
var mkRenderStateX = unsafeCoerce2;
|
|
var renderStateX = function(dictFunctor) {
|
|
return function(f) {
|
|
return unDriverStateX(function(st) {
|
|
return mkRenderStateX(f(st.rendering));
|
|
});
|
|
};
|
|
};
|
|
var mkDriverStateXRef = unsafeCoerce2;
|
|
var mapDriverState = function(f) {
|
|
return function(v) {
|
|
return f(v);
|
|
};
|
|
};
|
|
var initDriverState = function(component5) {
|
|
return function(input3) {
|
|
return function(handler3) {
|
|
return function(lchs) {
|
|
return function __do2() {
|
|
var selfRef = $$new({})();
|
|
var childrenIn = $$new(empty6)();
|
|
var childrenOut = $$new(empty6)();
|
|
var handlerRef = $$new(handler3)();
|
|
var pendingQueries = $$new(new Just(Nil.value))();
|
|
var pendingOuts = $$new(new Just(Nil.value))();
|
|
var pendingHandlers = $$new(Nothing.value)();
|
|
var fresh2 = $$new(1)();
|
|
var subscriptions = $$new(new Just(empty3))();
|
|
var forks = $$new(empty3)();
|
|
var ds = {
|
|
component: component5,
|
|
state: component5.initialState(input3),
|
|
refs: empty3,
|
|
children: empty6,
|
|
childrenIn,
|
|
childrenOut,
|
|
selfRef,
|
|
handlerRef,
|
|
pendingQueries,
|
|
pendingOuts,
|
|
pendingHandlers,
|
|
rendering: Nothing.value,
|
|
fresh: fresh2,
|
|
subscriptions,
|
|
forks,
|
|
lifecycleHandlers: lchs
|
|
};
|
|
write(ds)(selfRef)();
|
|
return mkDriverStateXRef(selfRef);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Halogen.Aff.Driver.Eval/index.js
|
|
var traverse_4 = /* @__PURE__ */ traverse_(applicativeEffect)(foldableMaybe);
|
|
var bindFlipped10 = /* @__PURE__ */ bindFlipped(bindMaybe);
|
|
var lookup8 = /* @__PURE__ */ lookup2(ordSubscriptionId);
|
|
var bind13 = /* @__PURE__ */ bind(bindAff);
|
|
var liftEffect6 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var discard7 = /* @__PURE__ */ discard(discardUnit);
|
|
var discard12 = /* @__PURE__ */ discard7(bindAff);
|
|
var traverse_12 = /* @__PURE__ */ traverse_(applicativeAff);
|
|
var traverse_22 = /* @__PURE__ */ traverse_12(foldableList);
|
|
var fork3 = /* @__PURE__ */ fork(monadForkAff);
|
|
var parSequence_2 = /* @__PURE__ */ parSequence_(parallelAff)(applicativeParAff)(foldableList);
|
|
var pure18 = /* @__PURE__ */ pure(applicativeAff);
|
|
var map37 = /* @__PURE__ */ map(functorCoyoneda);
|
|
var parallel3 = /* @__PURE__ */ parallel(parallelAff);
|
|
var map115 = /* @__PURE__ */ map(functorAff);
|
|
var sequential2 = /* @__PURE__ */ sequential(parallelAff);
|
|
var map211 = /* @__PURE__ */ map(functorMaybe);
|
|
var insert9 = /* @__PURE__ */ insert3(ordSubscriptionId);
|
|
var retractFreeAp2 = /* @__PURE__ */ retractFreeAp(applicativeParAff);
|
|
var $$delete4 = /* @__PURE__ */ $$delete2(ordForkId);
|
|
var unlessM2 = /* @__PURE__ */ unlessM(monadEffect);
|
|
var insert12 = /* @__PURE__ */ insert3(ordForkId);
|
|
var traverse_32 = /* @__PURE__ */ traverse_12(foldableMaybe);
|
|
var lookup12 = /* @__PURE__ */ lookup2(ordForkId);
|
|
var lookup22 = /* @__PURE__ */ lookup2(ordString);
|
|
var foldFree2 = /* @__PURE__ */ foldFree(monadRecAff);
|
|
var alter2 = /* @__PURE__ */ alter(ordString);
|
|
var unsubscribe3 = function(sid) {
|
|
return function(ref2) {
|
|
return function __do2() {
|
|
var v = read(ref2)();
|
|
var subs = read(v.subscriptions)();
|
|
return traverse_4(unsubscribe)(bindFlipped10(lookup8(sid))(subs))();
|
|
};
|
|
};
|
|
};
|
|
var queueOrRun = function(ref2) {
|
|
return function(au) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v) {
|
|
if (v instanceof Nothing) {
|
|
return au;
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return liftEffect6(write(new Just(new Cons(au, v.value0)))(ref2));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 188, column 33 - line 190, column 57): " + [v.constructor.name]);
|
|
});
|
|
};
|
|
};
|
|
var handleLifecycle = function(lchs) {
|
|
return function(f) {
|
|
return discard12(liftEffect6(write({
|
|
initializers: Nil.value,
|
|
finalizers: Nil.value
|
|
})(lchs)))(function() {
|
|
return bind13(liftEffect6(f))(function(result) {
|
|
return bind13(liftEffect6(read(lchs)))(function(v) {
|
|
return discard12(traverse_22(fork3)(v.finalizers))(function() {
|
|
return discard12(parSequence_2(v.initializers))(function() {
|
|
return pure18(result);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
var handleAff = /* @__PURE__ */ runAff_(/* @__PURE__ */ either(throwException)(/* @__PURE__ */ $$const(/* @__PURE__ */ pure(applicativeEffect)(unit))));
|
|
var fresh = function(f) {
|
|
return function(ref2) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v) {
|
|
return liftEffect6(modify$prime(function(i2) {
|
|
return {
|
|
state: i2 + 1 | 0,
|
|
value: f(i2)
|
|
};
|
|
})(v.fresh));
|
|
});
|
|
};
|
|
};
|
|
var evalQ = function(render4) {
|
|
return function(ref2) {
|
|
return function(q2) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v) {
|
|
return evalM(render4)(ref2)(v["component"]["eval"](new Query(map37(Just.create)(liftCoyoneda(q2)), $$const(Nothing.value))));
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var evalM = function(render4) {
|
|
return function(initRef) {
|
|
return function(v) {
|
|
var evalChildQuery = function(ref2) {
|
|
return function(cqb) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v1) {
|
|
return unChildQueryBox(function(v2) {
|
|
var evalChild = function(v3) {
|
|
return parallel3(bind13(liftEffect6(read(v3)))(function(dsx) {
|
|
return unDriverStateX(function(ds) {
|
|
return evalQ(render4)(ds.selfRef)(v2.value1);
|
|
})(dsx);
|
|
}));
|
|
};
|
|
return map115(v2.value2)(sequential2(v2.value0(applicativeParAff)(evalChild)(v1.children)));
|
|
})(cqb);
|
|
});
|
|
};
|
|
};
|
|
var go2 = function(ref2) {
|
|
return function(v1) {
|
|
if (v1 instanceof State) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
var v3 = v1.value0(v2.state);
|
|
if (unsafeRefEq(v2.state)(v3.value1)) {
|
|
return pure18(v3.value0);
|
|
}
|
|
;
|
|
if (otherwise) {
|
|
return discard12(liftEffect6(write({
|
|
component: v2.component,
|
|
refs: v2.refs,
|
|
children: v2.children,
|
|
childrenIn: v2.childrenIn,
|
|
childrenOut: v2.childrenOut,
|
|
selfRef: v2.selfRef,
|
|
handlerRef: v2.handlerRef,
|
|
pendingQueries: v2.pendingQueries,
|
|
pendingOuts: v2.pendingOuts,
|
|
pendingHandlers: v2.pendingHandlers,
|
|
rendering: v2.rendering,
|
|
fresh: v2.fresh,
|
|
subscriptions: v2.subscriptions,
|
|
forks: v2.forks,
|
|
lifecycleHandlers: v2.lifecycleHandlers,
|
|
state: v3.value1
|
|
})(ref2)))(function() {
|
|
return discard12(handleLifecycle(v2.lifecycleHandlers)(render4(v2.lifecycleHandlers)(ref2)))(function() {
|
|
return pure18(v3.value0);
|
|
});
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 86, column 7 - line 92, column 21): " + [v3.constructor.name]);
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Subscribe) {
|
|
return bind13(fresh(SubscriptionId)(ref2))(function(sid) {
|
|
return bind13(liftEffect6(subscribe(v1.value0(sid))(function(act) {
|
|
return handleAff(evalF(render4)(ref2)(new Action(act)));
|
|
})))(function(finalize) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
return discard12(liftEffect6(modify_(map211(insert9(sid)(finalize)))(v2.subscriptions)))(function() {
|
|
return pure18(v1.value1(sid));
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Unsubscribe) {
|
|
return discard12(liftEffect6(unsubscribe3(v1.value0)(ref2)))(function() {
|
|
return pure18(v1.value1);
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Lift2) {
|
|
return v1.value0;
|
|
}
|
|
;
|
|
if (v1 instanceof ChildQuery2) {
|
|
return evalChildQuery(ref2)(v1.value0);
|
|
}
|
|
;
|
|
if (v1 instanceof Raise) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
return bind13(liftEffect6(read(v2.handlerRef)))(function(handler3) {
|
|
return discard12(queueOrRun(v2.pendingOuts)(handler3(v1.value0)))(function() {
|
|
return pure18(v1.value1);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Par) {
|
|
return sequential2(retractFreeAp2(hoistFreeAp(function() {
|
|
var $119 = evalM(render4)(ref2);
|
|
return function($120) {
|
|
return parallel3($119($120));
|
|
};
|
|
}())(v1.value0)));
|
|
}
|
|
;
|
|
if (v1 instanceof Fork) {
|
|
return bind13(fresh(ForkId)(ref2))(function(fid) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
return bind13(liftEffect6($$new(false)))(function(doneRef) {
|
|
return bind13(fork3($$finally(liftEffect6(function __do2() {
|
|
modify_($$delete4(fid))(v2.forks)();
|
|
return write(true)(doneRef)();
|
|
}))(evalM(render4)(ref2)(v1.value0))))(function(fiber) {
|
|
return discard12(liftEffect6(unlessM2(read(doneRef))(modify_(insert12(fid)(fiber))(v2.forks))))(function() {
|
|
return pure18(v1.value1(fid));
|
|
});
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Join) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
return bind13(liftEffect6(read(v2.forks)))(function(forkMap) {
|
|
return discard12(traverse_32(joinFiber)(lookup12(v1.value0)(forkMap)))(function() {
|
|
return pure18(v1.value1);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof Kill) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
return bind13(liftEffect6(read(v2.forks)))(function(forkMap) {
|
|
return discard12(traverse_32(killFiber(error("Cancelled")))(lookup12(v1.value0)(forkMap)))(function() {
|
|
return pure18(v1.value1);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
;
|
|
if (v1 instanceof GetRef) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v2) {
|
|
return pure18(v1.value1(lookup22(v1.value0)(v2.refs)));
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 83, column 12 - line 139, column 33): " + [v1.constructor.name]);
|
|
};
|
|
};
|
|
return foldFree2(go2(initRef))(v);
|
|
};
|
|
};
|
|
};
|
|
var evalF = function(render4) {
|
|
return function(ref2) {
|
|
return function(v) {
|
|
if (v instanceof RefUpdate) {
|
|
return liftEffect6(flip(modify_)(ref2)(mapDriverState(function(st) {
|
|
return {
|
|
component: st.component,
|
|
state: st.state,
|
|
children: st.children,
|
|
childrenIn: st.childrenIn,
|
|
childrenOut: st.childrenOut,
|
|
selfRef: st.selfRef,
|
|
handlerRef: st.handlerRef,
|
|
pendingQueries: st.pendingQueries,
|
|
pendingOuts: st.pendingOuts,
|
|
pendingHandlers: st.pendingHandlers,
|
|
rendering: st.rendering,
|
|
fresh: st.fresh,
|
|
subscriptions: st.subscriptions,
|
|
forks: st.forks,
|
|
lifecycleHandlers: st.lifecycleHandlers,
|
|
refs: alter2($$const(v.value1))(v.value0)(st.refs)
|
|
};
|
|
})));
|
|
}
|
|
;
|
|
if (v instanceof Action) {
|
|
return bind13(liftEffect6(read(ref2)))(function(v1) {
|
|
return evalM(render4)(ref2)(v1["component"]["eval"](new Action2(v.value0, unit)));
|
|
});
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver.Eval (line 52, column 20 - line 58, column 62): " + [v.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Halogen.Aff.Driver/index.js
|
|
var bind14 = /* @__PURE__ */ bind(bindEffect);
|
|
var discard8 = /* @__PURE__ */ discard(discardUnit);
|
|
var for_2 = /* @__PURE__ */ for_(applicativeEffect)(foldableMaybe);
|
|
var traverse_5 = /* @__PURE__ */ traverse_(applicativeAff)(foldableList);
|
|
var fork4 = /* @__PURE__ */ fork(monadForkAff);
|
|
var bindFlipped11 = /* @__PURE__ */ bindFlipped(bindEffect);
|
|
var traverse_13 = /* @__PURE__ */ traverse_(applicativeEffect);
|
|
var traverse_23 = /* @__PURE__ */ traverse_13(foldableMaybe);
|
|
var traverse_33 = /* @__PURE__ */ traverse_13(foldableMap);
|
|
var discard23 = /* @__PURE__ */ discard8(bindAff);
|
|
var parSequence_3 = /* @__PURE__ */ parSequence_(parallelAff)(applicativeParAff)(foldableList);
|
|
var liftEffect7 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var pure19 = /* @__PURE__ */ pure(applicativeEffect);
|
|
var map38 = /* @__PURE__ */ map(functorEffect);
|
|
var pure110 = /* @__PURE__ */ pure(applicativeAff);
|
|
var when3 = /* @__PURE__ */ when(applicativeEffect);
|
|
var renderStateX2 = /* @__PURE__ */ renderStateX(functorEffect);
|
|
var $$void6 = /* @__PURE__ */ $$void(functorAff);
|
|
var foreachSlot2 = /* @__PURE__ */ foreachSlot(applicativeEffect);
|
|
var renderStateX_2 = /* @__PURE__ */ renderStateX_(applicativeEffect);
|
|
var tailRecM3 = /* @__PURE__ */ tailRecM(monadRecEffect);
|
|
var voidLeft3 = /* @__PURE__ */ voidLeft(functorEffect);
|
|
var bind15 = /* @__PURE__ */ bind(bindAff);
|
|
var liftEffect1 = /* @__PURE__ */ liftEffect(monadEffectEffect);
|
|
var newLifecycleHandlers = /* @__PURE__ */ function() {
|
|
return $$new({
|
|
initializers: Nil.value,
|
|
finalizers: Nil.value
|
|
});
|
|
}();
|
|
var handlePending = function(ref2) {
|
|
return function __do2() {
|
|
var queue = read(ref2)();
|
|
write(Nothing.value)(ref2)();
|
|
return for_2(queue)(function() {
|
|
var $59 = traverse_5(fork4);
|
|
return function($60) {
|
|
return handleAff($59(reverse2($60)));
|
|
};
|
|
}())();
|
|
};
|
|
};
|
|
var cleanupSubscriptionsAndForks = function(v) {
|
|
return function __do2() {
|
|
bindFlipped11(traverse_23(traverse_33(unsubscribe)))(read(v.subscriptions))();
|
|
write(Nothing.value)(v.subscriptions)();
|
|
bindFlipped11(traverse_33(function() {
|
|
var $61 = killFiber(error("finalized"));
|
|
return function($62) {
|
|
return handleAff($61($62));
|
|
};
|
|
}()))(read(v.forks))();
|
|
return write(empty3)(v.forks)();
|
|
};
|
|
};
|
|
var runUI = function(renderSpec2) {
|
|
return function(component5) {
|
|
return function(i2) {
|
|
var squashChildInitializers = function(lchs) {
|
|
return function(preInits) {
|
|
return unDriverStateX(function(st) {
|
|
var parentInitializer = evalM(render4)(st.selfRef)(st["component"]["eval"](new Initialize(unit)));
|
|
return modify_(function(handlers) {
|
|
return {
|
|
initializers: new Cons(discard23(parSequence_3(reverse2(handlers.initializers)))(function() {
|
|
return discard23(parentInitializer)(function() {
|
|
return liftEffect7(function __do2() {
|
|
handlePending(st.pendingQueries)();
|
|
return handlePending(st.pendingOuts)();
|
|
});
|
|
});
|
|
}), preInits),
|
|
finalizers: handlers.finalizers
|
|
};
|
|
})(lchs);
|
|
});
|
|
};
|
|
};
|
|
var runComponent = function(lchs) {
|
|
return function(handler3) {
|
|
return function(j) {
|
|
return unComponent(function(c) {
|
|
return function __do2() {
|
|
var lchs$prime = newLifecycleHandlers();
|
|
var $$var2 = initDriverState(c)(j)(handler3)(lchs$prime)();
|
|
var pre2 = read(lchs)();
|
|
write({
|
|
initializers: Nil.value,
|
|
finalizers: pre2.finalizers
|
|
})(lchs)();
|
|
bindFlipped11(unDriverStateX(function() {
|
|
var $63 = render4(lchs);
|
|
return function($64) {
|
|
return $63(function(v) {
|
|
return v.selfRef;
|
|
}($64));
|
|
};
|
|
}()))(read($$var2))();
|
|
bindFlipped11(squashChildInitializers(lchs)(pre2.initializers))(read($$var2))();
|
|
return $$var2;
|
|
};
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var renderChild = function(lchs) {
|
|
return function(handler3) {
|
|
return function(childrenInRef) {
|
|
return function(childrenOutRef) {
|
|
return unComponentSlot(function(slot3) {
|
|
return function __do2() {
|
|
var childrenIn = map38(slot3.pop)(read(childrenInRef))();
|
|
var $$var2 = function() {
|
|
if (childrenIn instanceof Just) {
|
|
write(childrenIn.value0.value1)(childrenInRef)();
|
|
var dsx = read(childrenIn.value0.value0)();
|
|
unDriverStateX(function(st) {
|
|
return function __do3() {
|
|
flip(write)(st.handlerRef)(function() {
|
|
var $65 = maybe(pure110(unit))(handler3);
|
|
return function($66) {
|
|
return $65(slot3.output($66));
|
|
};
|
|
}())();
|
|
return handleAff(evalM(render4)(st.selfRef)(st["component"]["eval"](new Receive(slot3.input, unit))))();
|
|
};
|
|
})(dsx)();
|
|
return childrenIn.value0.value0;
|
|
}
|
|
;
|
|
if (childrenIn instanceof Nothing) {
|
|
return runComponent(lchs)(function() {
|
|
var $67 = maybe(pure110(unit))(handler3);
|
|
return function($68) {
|
|
return $67(slot3.output($68));
|
|
};
|
|
}())(slot3.input)(slot3.component)();
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver (line 213, column 14 - line 222, column 98): " + [childrenIn.constructor.name]);
|
|
}();
|
|
var isDuplicate = map38(function($69) {
|
|
return isJust(slot3.get($69));
|
|
})(read(childrenOutRef))();
|
|
when3(isDuplicate)(warn("Halogen: Duplicate slot address was detected during rendering, unexpected results may occur"))();
|
|
modify_(slot3.set($$var2))(childrenOutRef)();
|
|
return bind14(read($$var2))(renderStateX2(function(v) {
|
|
if (v instanceof Nothing) {
|
|
return $$throw("Halogen internal error: child was not initialized in renderChild");
|
|
}
|
|
;
|
|
if (v instanceof Just) {
|
|
return pure19(renderSpec2.renderChild(v.value0));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.Aff.Driver (line 227, column 37 - line 229, column 50): " + [v.constructor.name]);
|
|
}))();
|
|
};
|
|
});
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var render4 = function(lchs) {
|
|
return function($$var2) {
|
|
return function __do2() {
|
|
var v = read($$var2)();
|
|
var shouldProcessHandlers = map38(isNothing)(read(v.pendingHandlers))();
|
|
when3(shouldProcessHandlers)(write(new Just(Nil.value))(v.pendingHandlers))();
|
|
write(empty6)(v.childrenOut)();
|
|
write(v.children)(v.childrenIn)();
|
|
var handler3 = function() {
|
|
var $70 = queueOrRun(v.pendingHandlers);
|
|
var $71 = evalF(render4)(v.selfRef);
|
|
return function($72) {
|
|
return $70($$void6($71($72)));
|
|
};
|
|
}();
|
|
var childHandler = function() {
|
|
var $73 = queueOrRun(v.pendingQueries);
|
|
return function($74) {
|
|
return $73(handler3(Action.create($74)));
|
|
};
|
|
}();
|
|
var rendering = renderSpec2.render(function($75) {
|
|
return handleAff(handler3($75));
|
|
})(renderChild(lchs)(childHandler)(v.childrenIn)(v.childrenOut))(v.component.render(v.state))(v.rendering)();
|
|
var children2 = read(v.childrenOut)();
|
|
var childrenIn = read(v.childrenIn)();
|
|
foreachSlot2(childrenIn)(function(v1) {
|
|
return function __do3() {
|
|
var childDS = read(v1)();
|
|
renderStateX_2(renderSpec2.removeChild)(childDS)();
|
|
return finalize(lchs)(childDS)();
|
|
};
|
|
})();
|
|
flip(modify_)(v.selfRef)(mapDriverState(function(ds$prime) {
|
|
return {
|
|
component: ds$prime.component,
|
|
state: ds$prime.state,
|
|
refs: ds$prime.refs,
|
|
childrenIn: ds$prime.childrenIn,
|
|
childrenOut: ds$prime.childrenOut,
|
|
selfRef: ds$prime.selfRef,
|
|
handlerRef: ds$prime.handlerRef,
|
|
pendingQueries: ds$prime.pendingQueries,
|
|
pendingOuts: ds$prime.pendingOuts,
|
|
pendingHandlers: ds$prime.pendingHandlers,
|
|
fresh: ds$prime.fresh,
|
|
subscriptions: ds$prime.subscriptions,
|
|
forks: ds$prime.forks,
|
|
lifecycleHandlers: ds$prime.lifecycleHandlers,
|
|
rendering: new Just(rendering),
|
|
children: children2
|
|
};
|
|
}))();
|
|
return when3(shouldProcessHandlers)(flip(tailRecM3)(unit)(function(v1) {
|
|
return function __do3() {
|
|
var handlers = read(v.pendingHandlers)();
|
|
write(new Just(Nil.value))(v.pendingHandlers)();
|
|
traverse_23(function() {
|
|
var $76 = traverse_5(fork4);
|
|
return function($77) {
|
|
return handleAff($76(reverse2($77)));
|
|
};
|
|
}())(handlers)();
|
|
var mmore = read(v.pendingHandlers)();
|
|
var $52 = maybe(false)($$null2)(mmore);
|
|
if ($52) {
|
|
return voidLeft3(write(Nothing.value)(v.pendingHandlers))(new Done(unit))();
|
|
}
|
|
;
|
|
return new Loop(unit);
|
|
};
|
|
}))();
|
|
};
|
|
};
|
|
};
|
|
var finalize = function(lchs) {
|
|
return unDriverStateX(function(st) {
|
|
return function __do2() {
|
|
cleanupSubscriptionsAndForks(st)();
|
|
var f = evalM(render4)(st.selfRef)(st["component"]["eval"](new Finalize(unit)));
|
|
modify_(function(handlers) {
|
|
return {
|
|
initializers: handlers.initializers,
|
|
finalizers: new Cons(f, handlers.finalizers)
|
|
};
|
|
})(lchs)();
|
|
return foreachSlot2(st.children)(function(v) {
|
|
return function __do3() {
|
|
var dsx = read(v)();
|
|
return finalize(lchs)(dsx)();
|
|
};
|
|
})();
|
|
};
|
|
});
|
|
};
|
|
var evalDriver = function(disposed) {
|
|
return function(ref2) {
|
|
return function(q2) {
|
|
return bind15(liftEffect7(read(disposed)))(function(v) {
|
|
if (v) {
|
|
return pure110(Nothing.value);
|
|
}
|
|
;
|
|
return evalQ(render4)(ref2)(q2);
|
|
});
|
|
};
|
|
};
|
|
};
|
|
var dispose = function(disposed) {
|
|
return function(lchs) {
|
|
return function(dsx) {
|
|
return handleLifecycle(lchs)(function __do2() {
|
|
var v = read(disposed)();
|
|
if (v) {
|
|
return unit;
|
|
}
|
|
;
|
|
write(true)(disposed)();
|
|
finalize(lchs)(dsx)();
|
|
return unDriverStateX(function(v1) {
|
|
return function __do3() {
|
|
var v2 = liftEffect1(read(v1.selfRef))();
|
|
return for_2(v2.rendering)(renderSpec2.dispose)();
|
|
};
|
|
})(dsx)();
|
|
});
|
|
};
|
|
};
|
|
};
|
|
return bind15(liftEffect7(newLifecycleHandlers))(function(lchs) {
|
|
return bind15(liftEffect7($$new(false)))(function(disposed) {
|
|
return handleLifecycle(lchs)(function __do2() {
|
|
var sio = create();
|
|
var dsx = bindFlipped11(read)(runComponent(lchs)(function() {
|
|
var $78 = notify(sio.listener);
|
|
return function($79) {
|
|
return liftEffect7($78($79));
|
|
};
|
|
}())(i2)(component5))();
|
|
return unDriverStateX(function(st) {
|
|
return pure19({
|
|
query: evalDriver(disposed)(st.selfRef),
|
|
messages: sio.emitter,
|
|
dispose: dispose(disposed)(lchs)(dsx)
|
|
});
|
|
})(dsx)();
|
|
});
|
|
});
|
|
});
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Web.DOM.Node/foreign.js
|
|
var getEffProp2 = function(name16) {
|
|
return function(node) {
|
|
return function() {
|
|
return node[name16];
|
|
};
|
|
};
|
|
};
|
|
var baseURI = getEffProp2("baseURI");
|
|
var _ownerDocument = getEffProp2("ownerDocument");
|
|
var _parentNode = getEffProp2("parentNode");
|
|
var _parentElement = getEffProp2("parentElement");
|
|
var childNodes = getEffProp2("childNodes");
|
|
var _firstChild = getEffProp2("firstChild");
|
|
var _lastChild = getEffProp2("lastChild");
|
|
var _previousSibling = getEffProp2("previousSibling");
|
|
var _nextSibling = getEffProp2("nextSibling");
|
|
var _nodeValue = getEffProp2("nodeValue");
|
|
var textContent = getEffProp2("textContent");
|
|
function insertBefore(node1) {
|
|
return function(node2) {
|
|
return function(parent2) {
|
|
return function() {
|
|
parent2.insertBefore(node1, node2);
|
|
};
|
|
};
|
|
};
|
|
}
|
|
function appendChild(node) {
|
|
return function(parent2) {
|
|
return function() {
|
|
parent2.appendChild(node);
|
|
};
|
|
};
|
|
}
|
|
function removeChild2(node) {
|
|
return function(parent2) {
|
|
return function() {
|
|
parent2.removeChild(node);
|
|
};
|
|
};
|
|
}
|
|
|
|
// output/Web.DOM.Node/index.js
|
|
var map39 = /* @__PURE__ */ map(functorEffect);
|
|
var parentNode2 = /* @__PURE__ */ function() {
|
|
var $6 = map39(toMaybe);
|
|
return function($7) {
|
|
return $6(_parentNode($7));
|
|
};
|
|
}();
|
|
var nextSibling = /* @__PURE__ */ function() {
|
|
var $15 = map39(toMaybe);
|
|
return function($16) {
|
|
return $15(_nextSibling($16));
|
|
};
|
|
}();
|
|
|
|
// output/Halogen.VDom.Driver/index.js
|
|
var $runtime_lazy9 = function(name16, moduleName, init4) {
|
|
var state3 = 0;
|
|
var val;
|
|
return function(lineNumber) {
|
|
if (state3 === 2)
|
|
return val;
|
|
if (state3 === 1)
|
|
throw new ReferenceError(name16 + " was needed before it finished initializing (module " + moduleName + ", line " + lineNumber + ")", moduleName, lineNumber);
|
|
state3 = 1;
|
|
val = init4();
|
|
state3 = 2;
|
|
return val;
|
|
};
|
|
};
|
|
var $$void7 = /* @__PURE__ */ $$void(functorEffect);
|
|
var pure20 = /* @__PURE__ */ pure(applicativeEffect);
|
|
var traverse_6 = /* @__PURE__ */ traverse_(applicativeEffect)(foldableMaybe);
|
|
var unwrap5 = /* @__PURE__ */ unwrap();
|
|
var when4 = /* @__PURE__ */ when(applicativeEffect);
|
|
var not2 = /* @__PURE__ */ not(/* @__PURE__ */ heytingAlgebraFunction(/* @__PURE__ */ heytingAlgebraFunction(heytingAlgebraBoolean)));
|
|
var identity14 = /* @__PURE__ */ identity(categoryFn);
|
|
var bind16 = /* @__PURE__ */ bind(bindAff);
|
|
var liftEffect8 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var map40 = /* @__PURE__ */ map(functorEffect);
|
|
var bindFlipped12 = /* @__PURE__ */ bindFlipped(bindEffect);
|
|
var substInParent = function(v) {
|
|
return function(v1) {
|
|
return function(v2) {
|
|
if (v1 instanceof Just && v2 instanceof Just) {
|
|
return $$void7(insertBefore(v)(v1.value0)(v2.value0));
|
|
}
|
|
;
|
|
if (v1 instanceof Nothing && v2 instanceof Just) {
|
|
return $$void7(appendChild(v)(v2.value0));
|
|
}
|
|
;
|
|
return pure20(unit);
|
|
};
|
|
};
|
|
};
|
|
var removeChild3 = function(v) {
|
|
return function __do2() {
|
|
var npn = parentNode2(v.node)();
|
|
return traverse_6(function(pn) {
|
|
return removeChild2(v.node)(pn);
|
|
})(npn)();
|
|
};
|
|
};
|
|
var mkSpec = function(handler3) {
|
|
return function(renderChildRef) {
|
|
return function(document2) {
|
|
var getNode = unRenderStateX(function(v) {
|
|
return v.node;
|
|
});
|
|
var done = function(st) {
|
|
if (st instanceof Just) {
|
|
return halt(st.value0);
|
|
}
|
|
;
|
|
return unit;
|
|
};
|
|
var buildWidget2 = function(spec) {
|
|
var buildThunk2 = buildThunk(unwrap5)(spec);
|
|
var $lazy_patch = $runtime_lazy9("patch", "Halogen.VDom.Driver", function() {
|
|
return function(st, slot3) {
|
|
if (st instanceof Just) {
|
|
if (slot3 instanceof ComponentSlot) {
|
|
halt(st.value0);
|
|
return $lazy_renderComponentSlot(100)(slot3.value0);
|
|
}
|
|
;
|
|
if (slot3 instanceof ThunkSlot) {
|
|
var step$prime = step(st.value0, slot3.value0);
|
|
return mkStep(new Step(extract2(step$prime), new Just(step$prime), $lazy_patch(103), done));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.Driver (line 97, column 22 - line 103, column 79): " + [slot3.constructor.name]);
|
|
}
|
|
;
|
|
return $lazy_render(104)(slot3);
|
|
};
|
|
});
|
|
var $lazy_render = $runtime_lazy9("render", "Halogen.VDom.Driver", function() {
|
|
return function(slot3) {
|
|
if (slot3 instanceof ComponentSlot) {
|
|
return $lazy_renderComponentSlot(86)(slot3.value0);
|
|
}
|
|
;
|
|
if (slot3 instanceof ThunkSlot) {
|
|
var step4 = buildThunk2(slot3.value0);
|
|
return mkStep(new Step(extract2(step4), new Just(step4), $lazy_patch(89), done));
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.Driver (line 84, column 7 - line 89, column 75): " + [slot3.constructor.name]);
|
|
};
|
|
});
|
|
var $lazy_renderComponentSlot = $runtime_lazy9("renderComponentSlot", "Halogen.VDom.Driver", function() {
|
|
return function(cs) {
|
|
var renderChild = read(renderChildRef)();
|
|
var rsx = renderChild(cs)();
|
|
var node = getNode(rsx);
|
|
return mkStep(new Step(node, Nothing.value, $lazy_patch(117), done));
|
|
};
|
|
});
|
|
var patch2 = $lazy_patch(91);
|
|
var render4 = $lazy_render(82);
|
|
var renderComponentSlot = $lazy_renderComponentSlot(109);
|
|
return render4;
|
|
};
|
|
var buildAttributes = buildProp(handler3);
|
|
return {
|
|
buildWidget: buildWidget2,
|
|
buildAttributes,
|
|
document: document2
|
|
};
|
|
};
|
|
};
|
|
};
|
|
var renderSpec = function(document2) {
|
|
return function(container) {
|
|
var render4 = function(handler3) {
|
|
return function(child) {
|
|
return function(v) {
|
|
return function(v1) {
|
|
if (v1 instanceof Nothing) {
|
|
return function __do2() {
|
|
var renderChildRef = $$new(child)();
|
|
var spec = mkSpec(handler3)(renderChildRef)(document2);
|
|
var machine = buildVDom(spec)(v);
|
|
var node = extract2(machine);
|
|
$$void7(appendChild(node)(toNode2(container)))();
|
|
return {
|
|
machine,
|
|
node,
|
|
renderChildRef
|
|
};
|
|
};
|
|
}
|
|
;
|
|
if (v1 instanceof Just) {
|
|
return function __do2() {
|
|
write(child)(v1.value0.renderChildRef)();
|
|
var parent2 = parentNode2(v1.value0.node)();
|
|
var nextSib = nextSibling(v1.value0.node)();
|
|
var machine$prime = step(v1.value0.machine, v);
|
|
var newNode = extract2(machine$prime);
|
|
when4(not2(unsafeRefEq)(v1.value0.node)(newNode))(substInParent(newNode)(nextSib)(parent2))();
|
|
return {
|
|
machine: machine$prime,
|
|
node: newNode,
|
|
renderChildRef: v1.value0.renderChildRef
|
|
};
|
|
};
|
|
}
|
|
;
|
|
throw new Error("Failed pattern match at Halogen.VDom.Driver (line 157, column 5 - line 173, column 80): " + [v1.constructor.name]);
|
|
};
|
|
};
|
|
};
|
|
};
|
|
return {
|
|
render: render4,
|
|
renderChild: identity14,
|
|
removeChild: removeChild3,
|
|
dispose: removeChild3
|
|
};
|
|
};
|
|
};
|
|
var runUI2 = function(component5) {
|
|
return function(i2) {
|
|
return function(element3) {
|
|
return bind16(liftEffect8(map40(toDocument)(bindFlipped12(document)(windowImpl))))(function(document2) {
|
|
return runUI(renderSpec(document2)(element3))(component5)(i2);
|
|
});
|
|
};
|
|
};
|
|
};
|
|
|
|
// output/Main/index.js
|
|
var bind17 = /* @__PURE__ */ bind(bindAff);
|
|
var component4 = /* @__PURE__ */ component3(monadAffAppM)(navigateAppM)(monadStoreAppM);
|
|
var $$void8 = /* @__PURE__ */ $$void(functorAff);
|
|
var liftEffect9 = /* @__PURE__ */ liftEffect(monadEffectAff);
|
|
var matchesWith2 = /* @__PURE__ */ matchesWith(foldableEither);
|
|
var when5 = /* @__PURE__ */ when(applicativeEffect);
|
|
var notEq3 = /* @__PURE__ */ notEq(/* @__PURE__ */ eqMaybe(eqRoute));
|
|
var pure21 = /* @__PURE__ */ pure(applicativeAff);
|
|
var main2 = /* @__PURE__ */ runHalogenAff(/* @__PURE__ */ bind17(awaitBody)(function(body2) {
|
|
var initialStore = {
|
|
baseUrl: "https://api.exblo.app",
|
|
logLevel: Dev.value,
|
|
network: TestNet.value,
|
|
zebraVersion: "",
|
|
version: ""
|
|
};
|
|
return bind17(runAppM(initialStore)(component4))(function(rootComponent) {
|
|
return bind17(runUI2(rootComponent)(unit)(body2))(function(halogenIO) {
|
|
return $$void8(liftEffect9(matchesWith2(parse(routeCodec))(function(old) {
|
|
return function($$new2) {
|
|
return when5(notEq3(old)(new Just($$new2)))(launchAff_(bind17(halogenIO.query(mkTell(Navigate.create($$new2))))(function(_response) {
|
|
return pure21(unit);
|
|
})));
|
|
};
|
|
})));
|
|
});
|
|
});
|
|
}));
|
|
|
|
// <stdin>
|
|
main2();
|
|
})();
|