kuvio
Version:
Create string patterns and derive things from them, such as regexes
1,514 lines (1,500 loc) • 265 kB
JavaScript
"use strict";
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/function.js
var require_function = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/function.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEndomorphismMonoid = exports.not = exports.SK = exports.hole = exports.pipe = exports.untupled = exports.tupled = exports.absurd = exports.decrement = exports.increment = exports.tuple = exports.flow = exports.flip = exports.constVoid = exports.constUndefined = exports.constNull = exports.constFalse = exports.constTrue = exports.constant = exports.unsafeCoerce = exports.identity = exports.apply = exports.getRing = exports.getSemiring = exports.getMonoid = exports.getSemigroup = exports.getBooleanAlgebra = void 0;
var getBooleanAlgebra = function(B) {
return function() {
return {
meet: function(x, y) {
return function(a) {
return B.meet(x(a), y(a));
};
},
join: function(x, y) {
return function(a) {
return B.join(x(a), y(a));
};
},
zero: function() {
return B.zero;
},
one: function() {
return B.one;
},
implies: function(x, y) {
return function(a) {
return B.implies(x(a), y(a));
};
},
not: function(x) {
return function(a) {
return B.not(x(a));
};
}
};
};
};
exports.getBooleanAlgebra = getBooleanAlgebra;
var getSemigroup = function(S) {
return function() {
return {
concat: function(f, g) {
return function(a) {
return S.concat(f(a), g(a));
};
}
};
};
};
exports.getSemigroup = getSemigroup;
var getMonoid = function(M) {
var getSemigroupM = (0, exports.getSemigroup)(M);
return function() {
return {
concat: getSemigroupM().concat,
empty: function() {
return M.empty;
}
};
};
};
exports.getMonoid = getMonoid;
var getSemiring = function(S) {
return {
add: function(f, g) {
return function(x) {
return S.add(f(x), g(x));
};
},
zero: function() {
return S.zero;
},
mul: function(f, g) {
return function(x) {
return S.mul(f(x), g(x));
};
},
one: function() {
return S.one;
}
};
};
exports.getSemiring = getSemiring;
var getRing = function(R) {
var S = (0, exports.getSemiring)(R);
return {
add: S.add,
mul: S.mul,
one: S.one,
zero: S.zero,
sub: function(f, g) {
return function(x) {
return R.sub(f(x), g(x));
};
}
};
};
exports.getRing = getRing;
var apply = function(a) {
return function(f) {
return f(a);
};
};
exports.apply = apply;
function identity2(a) {
return a;
}
exports.identity = identity2;
exports.unsafeCoerce = identity2;
function constant2(a) {
return function() {
return a;
};
}
exports.constant = constant2;
exports.constTrue = constant2(true);
exports.constFalse = constant2(false);
exports.constNull = constant2(null);
exports.constUndefined = constant2(void 0);
exports.constVoid = exports.constUndefined;
function flip(f) {
return function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (args.length > 1) {
return f(args[1], args[0]);
}
return function(a) {
return f(a)(args[0]);
};
};
}
exports.flip = flip;
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
switch (arguments.length) {
case 1:
return ab;
case 2:
return function() {
return bc(ab.apply(this, arguments));
};
case 3:
return function() {
return cd(bc(ab.apply(this, arguments)));
};
case 4:
return function() {
return de(cd(bc(ab.apply(this, arguments))));
};
case 5:
return function() {
return ef(de(cd(bc(ab.apply(this, arguments)))));
};
case 6:
return function() {
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
};
case 7:
return function() {
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
};
case 8:
return function() {
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
};
case 9:
return function() {
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
};
}
return;
}
exports.flow = flow;
function tuple2() {
var t = [];
for (var _i = 0; _i < arguments.length; _i++) {
t[_i] = arguments[_i];
}
return t;
}
exports.tuple = tuple2;
function increment(n) {
return n + 1;
}
exports.increment = increment;
function decrement(n) {
return n - 1;
}
exports.decrement = decrement;
function absurd(_) {
throw new Error("Called `absurd` function which should be uncallable");
}
exports.absurd = absurd;
function tupled(f) {
return function(a) {
return f.apply(void 0, a);
};
}
exports.tupled = tupled;
function untupled(f) {
return function() {
var a = [];
for (var _i = 0; _i < arguments.length; _i++) {
a[_i] = arguments[_i];
}
return f(a);
};
}
exports.untupled = untupled;
function pipe2(a, ab, bc, cd, de, ef, fg, gh, hi) {
switch (arguments.length) {
case 1:
return a;
case 2:
return ab(a);
case 3:
return bc(ab(a));
case 4:
return cd(bc(ab(a)));
case 5:
return de(cd(bc(ab(a))));
case 6:
return ef(de(cd(bc(ab(a)))));
case 7:
return fg(ef(de(cd(bc(ab(a))))));
case 8:
return gh(fg(ef(de(cd(bc(ab(a)))))));
case 9:
return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
default: {
var ret = arguments[0];
for (var i = 1; i < arguments.length; i++) {
ret = arguments[i](ret);
}
return ret;
}
}
}
exports.pipe = pipe2;
exports.hole = absurd;
var SK = function(_, b) {
return b;
};
exports.SK = SK;
function not(predicate) {
return function(a) {
return !predicate(a);
};
}
exports.not = not;
var getEndomorphismMonoid = function() {
return {
concat: function(first, second) {
return flow(first, second);
},
empty: identity2
};
};
exports.getEndomorphismMonoid = getEndomorphismMonoid;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/internal.js
var require_internal = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/internal.js"(exports) {
"use strict";
var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
if (pack || arguments.length === 2)
for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar)
ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fromReadonlyNonEmptyArray = exports.has = exports.emptyRecord = exports.emptyReadonlyArray = exports.tail = exports.head = exports.isNonEmpty = exports.singleton = exports.right = exports.left = exports.isRight = exports.isLeft = exports.some = exports.none = exports.isSome = exports.isNone = void 0;
var isNone = function(fa) {
return fa._tag === "None";
};
exports.isNone = isNone;
var isSome = function(fa) {
return fa._tag === "Some";
};
exports.isSome = isSome;
exports.none = { _tag: "None" };
var some2 = function(a) {
return { _tag: "Some", value: a };
};
exports.some = some2;
var isLeft = function(ma) {
return ma._tag === "Left";
};
exports.isLeft = isLeft;
var isRight = function(ma) {
return ma._tag === "Right";
};
exports.isRight = isRight;
var left = function(e) {
return { _tag: "Left", left: e };
};
exports.left = left;
var right = function(a) {
return { _tag: "Right", right: a };
};
exports.right = right;
var singleton2 = function(a) {
return [a];
};
exports.singleton = singleton2;
var isNonEmpty4 = function(as) {
return as.length > 0;
};
exports.isNonEmpty = isNonEmpty4;
var head3 = function(as) {
return as[0];
};
exports.head = head3;
var tail3 = function(as) {
return as.slice(1);
};
exports.tail = tail3;
exports.emptyReadonlyArray = [];
exports.emptyRecord = {};
exports.has = Object.prototype.hasOwnProperty;
var fromReadonlyNonEmptyArray2 = function(as) {
return __spreadArray([as[0]], as.slice(1), true);
};
exports.fromReadonlyNonEmptyArray = fromReadonlyNonEmptyArray2;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Apply.js
var require_Apply = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Apply.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m[k];
} };
}
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
o[k2] = m[k];
});
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) {
o["default"] = v;
});
var __importStar = exports && exports.__importStar || function(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null) {
for (var k in mod)
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
__createBinding(result, mod, k);
}
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.sequenceS = exports.sequenceT = exports.getApplySemigroup = exports.apS = exports.apSecond = exports.apFirst = exports.ap = void 0;
var function_1 = require_function();
var _ = __importStar(require_internal());
function ap(F, G) {
return function(fa) {
return function(fab) {
return F.ap(F.map(fab, function(gab) {
return function(ga) {
return G.ap(gab, ga);
};
}), fa);
};
};
}
exports.ap = ap;
function apFirst(A) {
return function(second) {
return function(first) {
return A.ap(A.map(first, function(a) {
return function() {
return a;
};
}), second);
};
};
}
exports.apFirst = apFirst;
function apSecond(A) {
return function(second) {
return function(first) {
return A.ap(A.map(first, function() {
return function(b) {
return b;
};
}), second);
};
};
}
exports.apSecond = apSecond;
function apS(F) {
return function(name, fb) {
return function(fa) {
return F.ap(F.map(fa, function(a) {
return function(b) {
var _a;
return Object.assign({}, a, (_a = {}, _a[name] = b, _a));
};
}), fb);
};
};
}
exports.apS = apS;
function getApplySemigroup(F) {
return function(S) {
return {
concat: function(first, second) {
return F.ap(F.map(first, function(x) {
return function(y) {
return S.concat(x, y);
};
}), second);
}
};
};
}
exports.getApplySemigroup = getApplySemigroup;
function curried(f, n, acc) {
return function(x) {
var combined = Array(acc.length + 1);
for (var i = 0; i < acc.length; i++) {
combined[i] = acc[i];
}
combined[acc.length] = x;
return n === 0 ? f.apply(null, combined) : curried(f, n - 1, combined);
};
}
var tupleConstructors = {
1: function(a) {
return [a];
},
2: function(a) {
return function(b) {
return [a, b];
};
},
3: function(a) {
return function(b) {
return function(c) {
return [a, b, c];
};
};
},
4: function(a) {
return function(b) {
return function(c) {
return function(d) {
return [a, b, c, d];
};
};
};
},
5: function(a) {
return function(b) {
return function(c) {
return function(d) {
return function(e) {
return [a, b, c, d, e];
};
};
};
};
}
};
function getTupleConstructor(len) {
if (!_.has.call(tupleConstructors, len)) {
tupleConstructors[len] = curried(function_1.tuple, len - 1, []);
}
return tupleConstructors[len];
}
function sequenceT(F) {
return function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var len = args.length;
var f = getTupleConstructor(len);
var fas = F.map(args[0], f);
for (var i = 1; i < len; i++) {
fas = F.ap(fas, args[i]);
}
return fas;
};
}
exports.sequenceT = sequenceT;
function getRecordConstructor(keys) {
var len = keys.length;
switch (len) {
case 1:
return function(a) {
var _a;
return _a = {}, _a[keys[0]] = a, _a;
};
case 2:
return function(a) {
return function(b) {
var _a;
return _a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a;
};
};
case 3:
return function(a) {
return function(b) {
return function(c) {
var _a;
return _a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a[keys[2]] = c, _a;
};
};
};
case 4:
return function(a) {
return function(b) {
return function(c) {
return function(d) {
var _a;
return _a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a[keys[2]] = c, _a[keys[3]] = d, _a;
};
};
};
};
case 5:
return function(a) {
return function(b) {
return function(c) {
return function(d) {
return function(e) {
var _a;
return _a = {}, _a[keys[0]] = a, _a[keys[1]] = b, _a[keys[2]] = c, _a[keys[3]] = d, _a[keys[4]] = e, _a;
};
};
};
};
};
default:
return curried(function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var r = {};
for (var i = 0; i < len; i++) {
r[keys[i]] = args[i];
}
return r;
}, len - 1, []);
}
}
function sequenceS(F) {
return function(r) {
var keys = Object.keys(r);
var len = keys.length;
var f = getRecordConstructor(keys);
var fr = F.map(r[keys[0]], f);
for (var i = 1; i < len; i++) {
fr = F.ap(fr, r[keys[i]]);
}
return fr;
};
}
exports.sequenceS = sequenceS;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Functor.js
var require_Functor = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Functor.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFunctorComposition = exports.let = exports.bindTo = exports.flap = exports.map = void 0;
var function_1 = require_function();
function map(F, G) {
return function(f) {
return function(fa) {
return F.map(fa, function(ga) {
return G.map(ga, f);
});
};
};
}
exports.map = map;
function flap(F) {
return function(a) {
return function(fab) {
return F.map(fab, function(f) {
return f(a);
});
};
};
}
exports.flap = flap;
function bindTo(F) {
return function(name) {
return function(fa) {
return F.map(fa, function(a) {
var _a;
return _a = {}, _a[name] = a, _a;
});
};
};
}
exports.bindTo = bindTo;
function let_(F) {
return function(name, f) {
return function(fa) {
return F.map(fa, function(a) {
var _a;
return Object.assign({}, a, (_a = {}, _a[name] = f(a), _a));
});
};
};
}
exports.let = let_;
function getFunctorComposition(F, G) {
var _map = map(F, G);
return {
map: function(fga, f) {
return (0, function_1.pipe)(fga, _map(f));
}
};
}
exports.getFunctorComposition = getFunctorComposition;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Applicative.js
var require_Applicative = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Applicative.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getApplicativeComposition = exports.getApplicativeMonoid = void 0;
var Apply_1 = require_Apply();
var function_1 = require_function();
var Functor_1 = require_Functor();
function getApplicativeMonoid(F) {
var f = (0, Apply_1.getApplySemigroup)(F);
return function(M) {
return {
concat: f(M).concat,
empty: F.of(M.empty)
};
};
}
exports.getApplicativeMonoid = getApplicativeMonoid;
function getApplicativeComposition(F, G) {
var map = (0, Functor_1.getFunctorComposition)(F, G).map;
var _ap = (0, Apply_1.ap)(F, G);
return {
map,
of: function(a) {
return F.of(G.of(a));
},
ap: function(fgab, fga) {
return (0, function_1.pipe)(fgab, _ap(fga));
}
};
}
exports.getApplicativeComposition = getApplicativeComposition;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Chain.js
var require_Chain = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Chain.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bind = exports.chainFirst = void 0;
function chainFirst(M) {
return function(f) {
return function(first) {
return M.chain(first, function(a) {
return M.map(f(a), function() {
return a;
});
});
};
};
}
exports.chainFirst = chainFirst;
function bind(M) {
return function(name, f) {
return function(ma) {
return M.chain(ma, function(a) {
return M.map(f(a), function(b) {
var _a;
return Object.assign({}, a, (_a = {}, _a[name] = b, _a));
});
});
};
};
}
exports.bind = bind;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/FromEither.js
var require_FromEither = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/FromEither.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m[k];
} };
}
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
o[k2] = m[k];
});
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) {
o["default"] = v;
});
var __importStar = exports && exports.__importStar || function(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null) {
for (var k in mod)
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
__createBinding(result, mod, k);
}
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterOrElse = exports.chainFirstEitherK = exports.chainEitherK = exports.fromEitherK = exports.chainOptionK = exports.fromOptionK = exports.fromPredicate = exports.fromOption = void 0;
var Chain_1 = require_Chain();
var function_1 = require_function();
var _ = __importStar(require_internal());
function fromOption(F) {
return function(onNone) {
return function(ma) {
return F.fromEither(_.isNone(ma) ? _.left(onNone()) : _.right(ma.value));
};
};
}
exports.fromOption = fromOption;
function fromPredicate(F) {
return function(predicate, onFalse) {
return function(a) {
return F.fromEither(predicate(a) ? _.right(a) : _.left(onFalse(a)));
};
};
}
exports.fromPredicate = fromPredicate;
function fromOptionK(F) {
var fromOptionF = fromOption(F);
return function(onNone) {
var from = fromOptionF(onNone);
return function(f) {
return (0, function_1.flow)(f, from);
};
};
}
exports.fromOptionK = fromOptionK;
function chainOptionK(F, M) {
var fromOptionKF = fromOptionK(F);
return function(onNone) {
var from = fromOptionKF(onNone);
return function(f) {
return function(ma) {
return M.chain(ma, from(f));
};
};
};
}
exports.chainOptionK = chainOptionK;
function fromEitherK(F) {
return function(f) {
return (0, function_1.flow)(f, F.fromEither);
};
}
exports.fromEitherK = fromEitherK;
function chainEitherK(F, M) {
var fromEitherKF = fromEitherK(F);
return function(f) {
return function(ma) {
return M.chain(ma, fromEitherKF(f));
};
};
}
exports.chainEitherK = chainEitherK;
function chainFirstEitherK(F, M) {
return (0, function_1.flow)(fromEitherK(F), (0, Chain_1.chainFirst)(M));
}
exports.chainFirstEitherK = chainFirstEitherK;
function filterOrElse(F, M) {
return function(predicate, onFalse) {
return function(ma) {
return M.chain(ma, function(a) {
return F.fromEither(predicate(a) ? _.right(a) : _.left(onFalse(a)));
});
};
};
}
exports.filterOrElse = filterOrElse;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Predicate.js
var require_Predicate = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Predicate.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.and = exports.or = exports.not = exports.Contravariant = exports.getMonoidAll = exports.getSemigroupAll = exports.getMonoidAny = exports.getSemigroupAny = exports.URI = exports.contramap = void 0;
var function_1 = require_function();
var contramap_ = function(predicate, f) {
return (0, function_1.pipe)(predicate, (0, exports.contramap)(f));
};
var contramap = function(f) {
return function(predicate) {
return (0, function_1.flow)(f, predicate);
};
};
exports.contramap = contramap;
exports.URI = "Predicate";
var getSemigroupAny = function() {
return {
concat: function(first, second) {
return (0, function_1.pipe)(first, (0, exports.or)(second));
}
};
};
exports.getSemigroupAny = getSemigroupAny;
var getMonoidAny = function() {
return {
concat: (0, exports.getSemigroupAny)().concat,
empty: function_1.constFalse
};
};
exports.getMonoidAny = getMonoidAny;
var getSemigroupAll = function() {
return {
concat: function(first, second) {
return (0, function_1.pipe)(first, (0, exports.and)(second));
}
};
};
exports.getSemigroupAll = getSemigroupAll;
var getMonoidAll = function() {
return {
concat: (0, exports.getSemigroupAll)().concat,
empty: function_1.constTrue
};
};
exports.getMonoidAll = getMonoidAll;
exports.Contravariant = {
URI: exports.URI,
contramap: contramap_
};
var not = function(predicate) {
return function(a) {
return !predicate(a);
};
};
exports.not = not;
var or = function(second) {
return function(first) {
return function(a) {
return first(a) || second(a);
};
};
};
exports.or = or;
var and = function(second) {
return function(first) {
return function(a) {
return first(a) && second(a);
};
};
};
exports.and = and;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Magma.js
var require_Magma = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Magma.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.concatAll = exports.endo = exports.filterSecond = exports.filterFirst = exports.reverse = void 0;
var reverse = function(M) {
return {
concat: function(first, second) {
return M.concat(second, first);
}
};
};
exports.reverse = reverse;
var filterFirst = function(predicate) {
return function(M) {
return {
concat: function(first, second) {
return predicate(first) ? M.concat(first, second) : second;
}
};
};
};
exports.filterFirst = filterFirst;
var filterSecond = function(predicate) {
return function(M) {
return {
concat: function(first, second) {
return predicate(second) ? M.concat(first, second) : first;
}
};
};
};
exports.filterSecond = filterSecond;
var endo = function(f) {
return function(M) {
return {
concat: function(first, second) {
return M.concat(f(first), f(second));
}
};
};
};
exports.endo = endo;
var concatAll = function(M) {
return function(startWith) {
return function(as) {
return as.reduce(function(a, acc) {
return M.concat(a, acc);
}, startWith);
};
};
};
exports.concatAll = concatAll;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Eq.js
var require_Eq = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Eq.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.eqDate = exports.eqNumber = exports.eqString = exports.eqBoolean = exports.eq = exports.strictEqual = exports.getStructEq = exports.getTupleEq = exports.Contravariant = exports.getMonoid = exports.getSemigroup = exports.eqStrict = exports.URI = exports.contramap = exports.tuple = exports.struct = exports.fromEquals = void 0;
var function_1 = require_function();
var fromEquals = function(equals) {
return {
equals: function(x, y) {
return x === y || equals(x, y);
}
};
};
exports.fromEquals = fromEquals;
var struct = function(eqs) {
return (0, exports.fromEquals)(function(first, second) {
for (var key in eqs) {
if (!eqs[key].equals(first[key], second[key])) {
return false;
}
}
return true;
});
};
exports.struct = struct;
var tuple2 = function() {
var eqs = [];
for (var _i = 0; _i < arguments.length; _i++) {
eqs[_i] = arguments[_i];
}
return (0, exports.fromEquals)(function(first, second) {
return eqs.every(function(E, i) {
return E.equals(first[i], second[i]);
});
});
};
exports.tuple = tuple2;
var contramap_ = function(fa, f) {
return (0, function_1.pipe)(fa, (0, exports.contramap)(f));
};
var contramap = function(f) {
return function(fa) {
return (0, exports.fromEquals)(function(x, y) {
return fa.equals(f(x), f(y));
});
};
};
exports.contramap = contramap;
exports.URI = "Eq";
exports.eqStrict = {
equals: function(a, b) {
return a === b;
}
};
var empty2 = {
equals: function() {
return true;
}
};
var getSemigroup = function() {
return {
concat: function(x, y) {
return (0, exports.fromEquals)(function(a, b) {
return x.equals(a, b) && y.equals(a, b);
});
}
};
};
exports.getSemigroup = getSemigroup;
var getMonoid = function() {
return {
concat: (0, exports.getSemigroup)().concat,
empty: empty2
};
};
exports.getMonoid = getMonoid;
exports.Contravariant = {
URI: exports.URI,
contramap: contramap_
};
exports.getTupleEq = exports.tuple;
exports.getStructEq = exports.struct;
exports.strictEqual = exports.eqStrict.equals;
exports.eq = exports.Contravariant;
exports.eqBoolean = exports.eqStrict;
exports.eqString = exports.eqStrict;
exports.eqNumber = exports.eqStrict;
exports.eqDate = {
equals: function(first, second) {
return first.valueOf() === second.valueOf();
}
};
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Ord.js
var require_Ord = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Ord.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ordDate = exports.ordNumber = exports.ordString = exports.ordBoolean = exports.ord = exports.getDualOrd = exports.getTupleOrd = exports.between = exports.clamp = exports.max = exports.min = exports.geq = exports.leq = exports.gt = exports.lt = exports.equals = exports.trivial = exports.Contravariant = exports.getMonoid = exports.getSemigroup = exports.URI = exports.contramap = exports.reverse = exports.tuple = exports.fromCompare = exports.equalsDefault = void 0;
var Eq_1 = require_Eq();
var function_1 = require_function();
var equalsDefault = function(compare2) {
return function(first, second) {
return first === second || compare2(first, second) === 0;
};
};
exports.equalsDefault = equalsDefault;
var fromCompare = function(compare2) {
return {
equals: (0, exports.equalsDefault)(compare2),
compare: function(first, second) {
return first === second ? 0 : compare2(first, second);
}
};
};
exports.fromCompare = fromCompare;
var tuple2 = function() {
var ords = [];
for (var _i = 0; _i < arguments.length; _i++) {
ords[_i] = arguments[_i];
}
return (0, exports.fromCompare)(function(first, second) {
var i = 0;
for (; i < ords.length - 1; i++) {
var r = ords[i].compare(first[i], second[i]);
if (r !== 0) {
return r;
}
}
return ords[i].compare(first[i], second[i]);
});
};
exports.tuple = tuple2;
var reverse = function(O) {
return (0, exports.fromCompare)(function(first, second) {
return O.compare(second, first);
});
};
exports.reverse = reverse;
var contramap_ = function(fa, f) {
return (0, function_1.pipe)(fa, (0, exports.contramap)(f));
};
var contramap = function(f) {
return function(fa) {
return (0, exports.fromCompare)(function(first, second) {
return fa.compare(f(first), f(second));
});
};
};
exports.contramap = contramap;
exports.URI = "Ord";
var getSemigroup = function() {
return {
concat: function(first, second) {
return (0, exports.fromCompare)(function(a, b) {
var ox = first.compare(a, b);
return ox !== 0 ? ox : second.compare(a, b);
});
}
};
};
exports.getSemigroup = getSemigroup;
var getMonoid = function() {
return {
concat: (0, exports.getSemigroup)().concat,
empty: (0, exports.fromCompare)(function() {
return 0;
})
};
};
exports.getMonoid = getMonoid;
exports.Contravariant = {
URI: exports.URI,
contramap: contramap_
};
exports.trivial = {
equals: function_1.constTrue,
compare: /* @__PURE__ */ (0, function_1.constant)(0)
};
var equals = function(O) {
return function(second) {
return function(first) {
return first === second || O.compare(first, second) === 0;
};
};
};
exports.equals = equals;
var lt = function(O) {
return function(first, second) {
return O.compare(first, second) === -1;
};
};
exports.lt = lt;
var gt = function(O) {
return function(first, second) {
return O.compare(first, second) === 1;
};
};
exports.gt = gt;
var leq = function(O) {
return function(first, second) {
return O.compare(first, second) !== 1;
};
};
exports.leq = leq;
var geq = function(O) {
return function(first, second) {
return O.compare(first, second) !== -1;
};
};
exports.geq = geq;
var min = function(O) {
return function(first, second) {
return first === second || O.compare(first, second) < 1 ? first : second;
};
};
exports.min = min;
var max = function(O) {
return function(first, second) {
return first === second || O.compare(first, second) > -1 ? first : second;
};
};
exports.max = max;
var clamp = function(O) {
var minO = (0, exports.min)(O);
var maxO = (0, exports.max)(O);
return function(low, hi) {
return function(a) {
return maxO(minO(a, hi), low);
};
};
};
exports.clamp = clamp;
var between = function(O) {
var ltO = (0, exports.lt)(O);
var gtO = (0, exports.gt)(O);
return function(low, hi) {
return function(a) {
return ltO(a, low) || gtO(a, hi) ? false : true;
};
};
};
exports.between = between;
exports.getTupleOrd = exports.tuple;
exports.getDualOrd = exports.reverse;
exports.ord = exports.Contravariant;
function compare(first, second) {
return first < second ? -1 : first > second ? 1 : 0;
}
var strictOrd = {
equals: Eq_1.eqStrict.equals,
compare
};
exports.ordBoolean = strictOrd;
exports.ordString = strictOrd;
exports.ordNumber = strictOrd;
exports.ordDate = (0, function_1.pipe)(
exports.ordNumber,
/* @__PURE__ */ (0, exports.contramap)(function(date2) {
return date2.valueOf();
})
);
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Semigroup.js
var require_Semigroup = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Semigroup.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m[k];
} };
}
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
o[k2] = m[k];
});
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) {
o["default"] = v;
});
var __importStar = exports && exports.__importStar || function(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null) {
for (var k in mod)
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
__createBinding(result, mod, k);
}
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.semigroupProduct = exports.semigroupSum = exports.semigroupString = exports.getFunctionSemigroup = exports.semigroupAny = exports.semigroupAll = exports.fold = exports.getIntercalateSemigroup = exports.getMeetSemigroup = exports.getJoinSemigroup = exports.getDualSemigroup = exports.getStructSemigroup = exports.getTupleSemigroup = exports.getFirstSemigroup = exports.getLastSemigroup = exports.getObjectSemigroup = exports.semigroupVoid = exports.concatAll = exports.last = exports.first = exports.intercalate = exports.tuple = exports.struct = exports.reverse = exports.constant = exports.max = exports.min = void 0;
var function_1 = require_function();
var _ = __importStar(require_internal());
var M = __importStar(require_Magma());
var Or = __importStar(require_Ord());
var min = function(O) {
return {
concat: Or.min(O)
};
};
exports.min = min;
var max = function(O) {
return {
concat: Or.max(O)
};
};
exports.max = max;
var constant2 = function(a) {
return {
concat: function() {
return a;
}
};
};
exports.constant = constant2;
exports.reverse = M.reverse;
var struct = function(semigroups) {
return {
concat: function(first2, second) {
var r = {};
for (var k in semigroups) {
if (_.has.call(semigroups, k)) {
r[k] = semigroups[k].concat(first2[k], second[k]);
}
}
return r;
}
};
};
exports.struct = struct;
var tuple2 = function() {
var semigroups = [];
for (var _i = 0; _i < arguments.length; _i++) {
semigroups[_i] = arguments[_i];
}
return {
concat: function(first2, second) {
return semigroups.map(function(s, i) {
return s.concat(first2[i], second[i]);
});
}
};
};
exports.tuple = tuple2;
var intercalate2 = function(middle) {
return function(S) {
return {
concat: function(x, y) {
return S.concat(x, S.concat(middle, y));
}
};
};
};
exports.intercalate = intercalate2;
var first = function() {
return { concat: function_1.identity };
};
exports.first = first;
var last2 = function() {
return { concat: function(_2, y) {
return y;
} };
};
exports.last = last2;
exports.concatAll = M.concatAll;
exports.semigroupVoid = (0, exports.constant)(void 0);
var getObjectSemigroup = function() {
return {
concat: function(first2, second) {
return Object.assign({}, first2, second);
}
};
};
exports.getObjectSemigroup = getObjectSemigroup;
exports.getLastSemigroup = exports.last;
exports.getFirstSemigroup = exports.first;
exports.getTupleSemigroup = exports.tuple;
exports.getStructSemigroup = exports.struct;
exports.getDualSemigroup = exports.reverse;
exports.getJoinSemigroup = exports.max;
exports.getMeetSemigroup = exports.min;
exports.getIntercalateSemigroup = exports.intercalate;
function fold(S) {
var concatAllS = (0, exports.concatAll)(S);
return function(startWith, as) {
return as === void 0 ? concatAllS(startWith) : concatAllS(startWith)(as);
};
}
exports.fold = fold;
exports.semigroupAll = {
concat: function(x, y) {
return x && y;
}
};
exports.semigroupAny = {
concat: function(x, y) {
return x || y;
}
};
exports.getFunctionSemigroup = function_1.getSemigroup;
exports.semigroupString = {
concat: function(x, y) {
return x + y;
}
};
exports.semigroupSum = {
concat: function(x, y) {
return x + y;
}
};
exports.semigroupProduct = {
concat: function(x, y) {
return x * y;
}
};
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Separated.js
var require_Separated = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Separated.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.right = exports.left = exports.flap = exports.Functor = exports.Bifunctor = exports.URI = exports.bimap = exports.mapLeft = exports.map = exports.separated = void 0;
var function_1 = require_function();
var Functor_1 = require_Functor();
var separated = function(left2, right2) {
return { left: left2, right: right2 };
};
exports.separated = separated;
var _map = function(fa, f) {
return (0, function_1.pipe)(fa, (0, exports.map)(f));
};
var _mapLeft = function(fa, f) {
return (0, function_1.pipe)(fa, (0, exports.mapLeft)(f));
};
var _bimap = function(fa, g, f) {
return (0, function_1.pipe)(fa, (0, exports.bimap)(g, f));
};
var map = function(f) {
return function(fa) {
return (0, exports.separated)((0, exports.left)(fa), f((0, exports.right)(fa)));
};
};
exports.map = map;
var mapLeft = function(f) {
return function(fa) {
return (0, exports.separated)(f((0, exports.left)(fa)), (0, exports.right)(fa));
};
};
exports.mapLeft = mapLeft;
var bimap = function(f, g) {
return function(fa) {
return (0, exports.separated)(f((0, exports.left)(fa)), g((0, exports.right)(fa)));
};
};
exports.bimap = bimap;
exports.URI = "Separated";
exports.Bifunctor = {
URI: exports.URI,
mapLeft: _mapLeft,
bimap: _bimap
};
exports.Functor = {
URI: exports.URI,
map: _map
};
exports.flap = (0, Functor_1.flap)(exports.Functor);
var left = function(s) {
return s.left;
};
exports.left = left;
var right = function(s) {
return s.right;
};
exports.right = right;
}
});
// node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Witherable.js
var require_Witherable = __commonJS({
"node_modules/.pnpm/fp-ts@2.13.1/node_modules/fp-ts/lib/Witherable.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m[k];
} };
}
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (k2 === void 0)
k2 = k;
o[k2] = m[k];
});
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
} : function(o, v) {
o["default"] = v;
});
var __importStar = exports && exports.__importStar || function(mod) {
if (mod