diff --git a/backend/node_modules/effect/dist/cjs/Arbitrary.js b/backend/node_modules/effect/dist/cjs/Arbitrary.js
new file mode 100644
index 0000000000000000000000000000000000000000..8d009c4bb6e9554f725f2d417e95829f7d7edab2
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Arbitrary.js
@@ -0,0 +1,813 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.makeStringConstraints = exports.makeNumberConstraints = exports.makeLazy = exports.makeDateConstraints = exports.makeBigIntConstraints = exports.makeArrayConstraints = exports.make = exports.getDescription = void 0;
+var Arr = _interopRequireWildcard(require("./Array.js"));
+var FastCheck = _interopRequireWildcard(require("./FastCheck.js"));
+var _GlobalValue = require("./GlobalValue.js");
+var errors_ = _interopRequireWildcard(require("./internal/schema/errors.js"));
+var schemaId_ = _interopRequireWildcard(require("./internal/schema/schemaId.js"));
+var util_ = _interopRequireWildcard(require("./internal/schema/util.js"));
+var Option = _interopRequireWildcard(require("./Option.js"));
+var Predicate = _interopRequireWildcard(require("./Predicate.js"));
+var SchemaAST = _interopRequireWildcard(require("./SchemaAST.js"));
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * @since 3.10.0
+ */
+
+/**
+ * Returns a LazyArbitrary for the `A` type of the provided schema.
+ *
+ * @category arbitrary
+ * @since 3.10.0
+ */
+const makeLazy = schema => {
+ const description = getDescription(schema.ast, []);
+ return go(description, {
+ maxDepth: 2
+ });
+};
+/**
+ * Returns a fast-check Arbitrary for the `A` type of the provided schema.
+ *
+ * @category arbitrary
+ * @since 3.10.0
+ */
+exports.makeLazy = makeLazy;
+const make = schema => makeLazy(schema)(FastCheck);
+/** @internal */
+exports.make = make;
+const makeStringConstraints = options => {
+ const out = {
+ _tag: "StringConstraints",
+ constraints: {}
+ };
+ if (Predicate.isNumber(options.minLength)) {
+ out.constraints.minLength = options.minLength;
+ }
+ if (Predicate.isNumber(options.maxLength)) {
+ out.constraints.maxLength = options.maxLength;
+ }
+ if (Predicate.isString(options.pattern)) {
+ out.pattern = options.pattern;
+ }
+ return out;
+};
+/** @internal */
+exports.makeStringConstraints = makeStringConstraints;
+const makeNumberConstraints = options => {
+ const out = {
+ _tag: "NumberConstraints",
+ constraints: {},
+ isInteger: options.isInteger ?? false
+ };
+ if (Predicate.isNumber(options.min)) {
+ out.constraints.min = Math.fround(options.min);
+ }
+ if (Predicate.isBoolean(options.minExcluded)) {
+ out.constraints.minExcluded = options.minExcluded;
+ }
+ if (Predicate.isNumber(options.max)) {
+ out.constraints.max = Math.fround(options.max);
+ }
+ if (Predicate.isBoolean(options.maxExcluded)) {
+ out.constraints.maxExcluded = options.maxExcluded;
+ }
+ if (Predicate.isBoolean(options.noNaN)) {
+ out.constraints.noNaN = options.noNaN;
+ }
+ if (Predicate.isBoolean(options.noDefaultInfinity)) {
+ out.constraints.noDefaultInfinity = options.noDefaultInfinity;
+ }
+ return out;
+};
+/** @internal */
+exports.makeNumberConstraints = makeNumberConstraints;
+const makeBigIntConstraints = options => {
+ const out = {
+ _tag: "BigIntConstraints",
+ constraints: {}
+ };
+ if (Predicate.isBigInt(options.min)) {
+ out.constraints.min = options.min;
+ }
+ if (Predicate.isBigInt(options.max)) {
+ out.constraints.max = options.max;
+ }
+ return out;
+};
+/** @internal */
+exports.makeBigIntConstraints = makeBigIntConstraints;
+const makeArrayConstraints = options => {
+ const out = {
+ _tag: "ArrayConstraints",
+ constraints: {}
+ };
+ if (Predicate.isNumber(options.minLength)) {
+ out.constraints.minLength = options.minLength;
+ }
+ if (Predicate.isNumber(options.maxLength)) {
+ out.constraints.maxLength = options.maxLength;
+ }
+ return out;
+};
+/** @internal */
+exports.makeArrayConstraints = makeArrayConstraints;
+const makeDateConstraints = options => {
+ const out = {
+ _tag: "DateConstraints",
+ constraints: {}
+ };
+ if (Predicate.isDate(options.min)) {
+ out.constraints.min = options.min;
+ }
+ if (Predicate.isDate(options.max)) {
+ out.constraints.max = options.max;
+ }
+ if (Predicate.isBoolean(options.noInvalidDate)) {
+ out.constraints.noInvalidDate = options.noInvalidDate;
+ }
+ return out;
+};
+exports.makeDateConstraints = makeDateConstraints;
+const getArbitraryAnnotation = /*#__PURE__*/SchemaAST.getAnnotation(SchemaAST.ArbitraryAnnotationId);
+const getASTConstraints = ast => {
+ const TypeAnnotationId = ast.annotations[SchemaAST.SchemaIdAnnotationId];
+ if (Predicate.isPropertyKey(TypeAnnotationId)) {
+ const out = ast.annotations[TypeAnnotationId];
+ if (Predicate.isReadonlyRecord(out)) {
+ return out;
+ }
+ }
+};
+const idMemoMap = /*#__PURE__*/(0, _GlobalValue.globalValue)(/*#__PURE__*/Symbol.for("effect/Arbitrary/IdMemoMap"), () => new Map());
+let counter = 0;
+function wrapGetDescription(f, g) {
+ return (ast, path) => f(ast, g(ast, path));
+}
+function parseMeta(ast) {
+ const jsonSchema = SchemaAST.getJSONSchemaAnnotation(ast).pipe(Option.filter(Predicate.isReadonlyRecord), Option.getOrUndefined);
+ const schemaId = Option.getOrElse(SchemaAST.getSchemaIdAnnotation(ast), () => undefined);
+ const schemaParams = Option.fromNullable(schemaId).pipe(Option.map(id => ast.annotations[id]), Option.filter(Predicate.isReadonlyRecord), Option.getOrUndefined);
+ return [schemaId, {
+ ...schemaParams,
+ ...jsonSchema
+ }];
+}
+/** @internal */
+const getDescription = exports.getDescription = /*#__PURE__*/wrapGetDescription((ast, description) => {
+ const annotation = getArbitraryAnnotation(ast);
+ if (Option.isSome(annotation)) {
+ return {
+ ...description,
+ annotations: [...description.annotations, annotation.value]
+ };
+ }
+ return description;
+}, (ast, path) => {
+ const [schemaId, meta] = parseMeta(ast);
+ switch (ast._tag) {
+ case "Refinement":
+ {
+ const from = getDescription(ast.from, path);
+ switch (from._tag) {
+ case "StringKeyword":
+ return {
+ ...from,
+ constraints: [...from.constraints, makeStringConstraints(meta)],
+ refinements: [...from.refinements, ast]
+ };
+ case "NumberKeyword":
+ {
+ const c = schemaId === schemaId_.NonNaNSchemaId ? makeNumberConstraints({
+ noNaN: true
+ }) : schemaId === schemaId_.FiniteSchemaId || schemaId === schemaId_.JsonNumberSchemaId ? makeNumberConstraints({
+ noDefaultInfinity: true,
+ noNaN: true
+ }) : makeNumberConstraints({
+ isInteger: "type" in meta && meta.type === "integer",
+ noNaN: undefined,
+ noDefaultInfinity: undefined,
+ min: meta.exclusiveMinimum ?? meta.minimum,
+ minExcluded: "exclusiveMinimum" in meta ? true : undefined,
+ max: meta.exclusiveMaximum ?? meta.maximum,
+ maxExcluded: "exclusiveMaximum" in meta ? true : undefined
+ });
+ return {
+ ...from,
+ constraints: [...from.constraints, c],
+ refinements: [...from.refinements, ast]
+ };
+ }
+ case "BigIntKeyword":
+ {
+ const c = getASTConstraints(ast);
+ return {
+ ...from,
+ constraints: c !== undefined ? [...from.constraints, makeBigIntConstraints(c)] : from.constraints,
+ refinements: [...from.refinements, ast]
+ };
+ }
+ case "TupleType":
+ return {
+ ...from,
+ constraints: [...from.constraints, makeArrayConstraints({
+ minLength: meta.minItems,
+ maxLength: meta.maxItems
+ })],
+ refinements: [...from.refinements, ast]
+ };
+ case "DateFromSelf":
+ return {
+ ...from,
+ constraints: [...from.constraints, makeDateConstraints(meta)],
+ refinements: [...from.refinements, ast]
+ };
+ default:
+ return {
+ ...from,
+ refinements: [...from.refinements, ast]
+ };
+ }
+ }
+ case "Declaration":
+ {
+ if (schemaId === schemaId_.DateFromSelfSchemaId) {
+ return {
+ _tag: "DateFromSelf",
+ constraints: [makeDateConstraints(meta)],
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ return {
+ _tag: "Declaration",
+ typeParameters: ast.typeParameters.map(ast => getDescription(ast, path)),
+ path,
+ refinements: [],
+ annotations: [],
+ ast
+ };
+ }
+ case "Literal":
+ {
+ return {
+ _tag: "Literal",
+ literal: ast.literal,
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ case "UniqueSymbol":
+ {
+ return {
+ _tag: "UniqueSymbol",
+ symbol: ast.symbol,
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ case "Enums":
+ {
+ return {
+ _tag: "Enums",
+ enums: ast.enums,
+ path,
+ refinements: [],
+ annotations: [],
+ ast
+ };
+ }
+ case "TemplateLiteral":
+ {
+ return {
+ _tag: "TemplateLiteral",
+ head: ast.head,
+ spans: ast.spans.map(span => ({
+ description: getDescription(span.type, path),
+ literal: span.literal
+ })),
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ case "StringKeyword":
+ return {
+ _tag: "StringKeyword",
+ constraints: [],
+ path,
+ refinements: [],
+ annotations: []
+ };
+ case "NumberKeyword":
+ return {
+ _tag: "NumberKeyword",
+ constraints: [],
+ path,
+ refinements: [],
+ annotations: []
+ };
+ case "BigIntKeyword":
+ return {
+ _tag: "BigIntKeyword",
+ constraints: [],
+ path,
+ refinements: [],
+ annotations: []
+ };
+ case "TupleType":
+ return {
+ _tag: "TupleType",
+ constraints: [],
+ elements: ast.elements.map((element, i) => ({
+ isOptional: element.isOptional,
+ description: getDescription(element.type, [...path, i])
+ })),
+ rest: ast.rest.map((element, i) => getDescription(element.type, [...path, i])),
+ path,
+ refinements: [],
+ annotations: []
+ };
+ case "TypeLiteral":
+ return {
+ _tag: "TypeLiteral",
+ propertySignatures: ast.propertySignatures.map(ps => ({
+ isOptional: ps.isOptional,
+ name: ps.name,
+ value: getDescription(ps.type, [...path, ps.name])
+ })),
+ indexSignatures: ast.indexSignatures.map(is => ({
+ parameter: getDescription(is.parameter, path),
+ value: getDescription(is.type, path)
+ })),
+ path,
+ refinements: [],
+ annotations: []
+ };
+ case "Union":
+ return {
+ _tag: "Union",
+ members: ast.types.map((member, i) => getDescription(member, [...path, i])),
+ path,
+ refinements: [],
+ annotations: []
+ };
+ case "Suspend":
+ {
+ const memoId = idMemoMap.get(ast);
+ if (memoId !== undefined) {
+ return {
+ _tag: "Ref",
+ id: memoId,
+ ast,
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ counter++;
+ const id = `__id-${counter}__`;
+ idMemoMap.set(ast, id);
+ return {
+ _tag: "Suspend",
+ id,
+ ast,
+ description: () => getDescription(ast.f(), path),
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ case "Transformation":
+ return getDescription(ast.to, path);
+ case "NeverKeyword":
+ return {
+ _tag: "NeverKeyword",
+ path,
+ refinements: [],
+ annotations: [],
+ ast
+ };
+ default:
+ {
+ return {
+ _tag: "Keyword",
+ value: ast._tag,
+ path,
+ refinements: [],
+ annotations: []
+ };
+ }
+ }
+});
+function getMax(n1, n2) {
+ return n1 === undefined ? n2 : n2 === undefined ? n1 : n1 <= n2 ? n2 : n1;
+}
+function getMin(n1, n2) {
+ return n1 === undefined ? n2 : n2 === undefined ? n1 : n1 <= n2 ? n1 : n2;
+}
+const getOr = (a, b) => {
+ return a === undefined ? b : b === undefined ? a : a || b;
+};
+function mergePattern(pattern1, pattern2) {
+ if (pattern1 === undefined) {
+ return pattern2;
+ }
+ if (pattern2 === undefined) {
+ return pattern1;
+ }
+ return `(?:${pattern1})|(?:${pattern2})`;
+}
+function mergeStringConstraints(c1, c2) {
+ return makeStringConstraints({
+ minLength: getMax(c1.constraints.minLength, c2.constraints.minLength),
+ maxLength: getMin(c1.constraints.maxLength, c2.constraints.maxLength),
+ pattern: mergePattern(c1.pattern, c2.pattern)
+ });
+}
+function buildStringConstraints(description) {
+ return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeStringConstraints);
+}
+function mergeNumberConstraints(c1, c2) {
+ return makeNumberConstraints({
+ isInteger: c1.isInteger || c2.isInteger,
+ min: getMax(c1.constraints.min, c2.constraints.min),
+ minExcluded: getOr(c1.constraints.minExcluded, c2.constraints.minExcluded),
+ max: getMin(c1.constraints.max, c2.constraints.max),
+ maxExcluded: getOr(c1.constraints.maxExcluded, c2.constraints.maxExcluded),
+ noNaN: getOr(c1.constraints.noNaN, c2.constraints.noNaN),
+ noDefaultInfinity: getOr(c1.constraints.noDefaultInfinity, c2.constraints.noDefaultInfinity)
+ });
+}
+function buildNumberConstraints(description) {
+ return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeNumberConstraints);
+}
+function mergeBigIntConstraints(c1, c2) {
+ return makeBigIntConstraints({
+ min: getMax(c1.constraints.min, c2.constraints.min),
+ max: getMin(c1.constraints.max, c2.constraints.max)
+ });
+}
+function buildBigIntConstraints(description) {
+ return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeBigIntConstraints);
+}
+function mergeDateConstraints(c1, c2) {
+ return makeDateConstraints({
+ min: getMax(c1.constraints.min, c2.constraints.min),
+ max: getMin(c1.constraints.max, c2.constraints.max),
+ noInvalidDate: getOr(c1.constraints.noInvalidDate, c2.constraints.noInvalidDate)
+ });
+}
+function buildDateConstraints(description) {
+ return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeDateConstraints);
+}
+const constArrayConstraints = /*#__PURE__*/makeArrayConstraints({});
+function mergeArrayConstraints(c1, c2) {
+ return makeArrayConstraints({
+ minLength: getMax(c1.constraints.minLength, c2.constraints.minLength),
+ maxLength: getMin(c1.constraints.maxLength, c2.constraints.maxLength)
+ });
+}
+function buildArrayConstraints(description) {
+ return description.constraints.length === 0 ? undefined : description.constraints.reduce(mergeArrayConstraints);
+}
+const arbitraryMemoMap = /*#__PURE__*/(0, _GlobalValue.globalValue)(/*#__PURE__*/Symbol.for("effect/Arbitrary/arbitraryMemoMap"), () => new WeakMap());
+function applyFilters(filters, arb) {
+ return fc => filters.reduce((arb, filter) => arb.filter(filter), arb(fc));
+}
+function absurd(message) {
+ return () => {
+ throw new Error(message);
+ };
+}
+function getContextConstraints(description) {
+ switch (description._tag) {
+ case "StringKeyword":
+ return buildStringConstraints(description);
+ case "NumberKeyword":
+ return buildNumberConstraints(description);
+ case "BigIntKeyword":
+ return buildBigIntConstraints(description);
+ case "DateFromSelf":
+ return buildDateConstraints(description);
+ case "TupleType":
+ return buildArrayConstraints(description);
+ }
+}
+function wrapGo(f, g) {
+ return (description, ctx) => f(description, ctx, g(description, ctx));
+}
+const go = /*#__PURE__*/wrapGo((description, ctx, lazyArb) => {
+ const annotation = description.annotations[description.annotations.length - 1];
+ // error handling
+ if (annotation === undefined) {
+ switch (description._tag) {
+ case "Declaration":
+ case "NeverKeyword":
+ throw new Error(errors_.getArbitraryMissingAnnotationErrorMessage(description.path, description.ast));
+ case "Enums":
+ if (description.enums.length === 0) {
+ throw new Error(errors_.getArbitraryEmptyEnumErrorMessage(description.path));
+ }
+ }
+ }
+ const filters = description.refinements.map(ast => a => Option.isNone(ast.filter(a, SchemaAST.defaultParseOption, ast)));
+ if (annotation === undefined) {
+ return applyFilters(filters, lazyArb);
+ }
+ const constraints = getContextConstraints(description);
+ if (constraints !== undefined) {
+ ctx = {
+ ...ctx,
+ constraints
+ };
+ }
+ if (description._tag === "Declaration") {
+ return applyFilters(filters, annotation(...description.typeParameters.map(p => go(p, ctx)), ctx));
+ }
+ if (description.refinements.length > 0) {
+ // TODO(4.0): remove the `lazyArb` parameter
+ return applyFilters(filters, annotation(lazyArb, ctx));
+ }
+ return annotation(ctx);
+}, (description, ctx) => {
+ switch (description._tag) {
+ case "DateFromSelf":
+ {
+ const constraints = buildDateConstraints(description);
+ return fc => fc.date(constraints?.constraints);
+ }
+ case "Declaration":
+ case "NeverKeyword":
+ return absurd(`BUG: cannot generate an arbitrary for ${description._tag}`);
+ case "Literal":
+ return fc => fc.constant(description.literal);
+ case "UniqueSymbol":
+ return fc => fc.constant(description.symbol);
+ case "Keyword":
+ {
+ switch (description.value) {
+ case "UndefinedKeyword":
+ return fc => fc.constant(undefined);
+ case "VoidKeyword":
+ case "UnknownKeyword":
+ case "AnyKeyword":
+ return fc => fc.anything();
+ case "BooleanKeyword":
+ return fc => fc.boolean();
+ case "SymbolKeyword":
+ return fc => fc.string().map(s => Symbol.for(s));
+ case "ObjectKeyword":
+ return fc => fc.oneof(fc.object(), fc.array(fc.anything()));
+ }
+ }
+ case "Enums":
+ return fc => fc.oneof(...description.enums.map(([_, value]) => fc.constant(value)));
+ case "TemplateLiteral":
+ {
+ return fc => {
+ const string = fc.string({
+ maxLength: 5
+ });
+ const number = fc.float({
+ noDefaultInfinity: true,
+ noNaN: true
+ });
+ const getTemplateLiteralArb = description => {
+ const components = description.head !== "" ? [fc.constant(description.head)] : [];
+ const getTemplateLiteralSpanTypeArb = description => {
+ switch (description._tag) {
+ case "StringKeyword":
+ return string;
+ case "NumberKeyword":
+ return number;
+ case "Literal":
+ return fc.constant(String(description.literal));
+ case "Union":
+ return fc.oneof(...description.members.map(getTemplateLiteralSpanTypeArb));
+ case "TemplateLiteral":
+ return getTemplateLiteralArb(description);
+ default:
+ return fc.constant("");
+ }
+ };
+ description.spans.forEach(span => {
+ components.push(getTemplateLiteralSpanTypeArb(span.description));
+ if (span.literal !== "") {
+ components.push(fc.constant(span.literal));
+ }
+ });
+ return fc.tuple(...components).map(spans => spans.join(""));
+ };
+ return getTemplateLiteralArb(description);
+ };
+ }
+ case "StringKeyword":
+ {
+ const constraints = buildStringConstraints(description);
+ const pattern = constraints?.pattern;
+ return pattern !== undefined ? fc => fc.stringMatching(new RegExp(pattern)) : fc => fc.string(constraints?.constraints);
+ }
+ case "NumberKeyword":
+ {
+ const constraints = buildNumberConstraints(description);
+ return constraints?.isInteger ? fc => fc.integer(constraints.constraints) : fc => fc.float(constraints?.constraints);
+ }
+ case "BigIntKeyword":
+ {
+ const constraints = buildBigIntConstraints(description);
+ return fc => fc.bigInt(constraints?.constraints ?? {});
+ }
+ case "TupleType":
+ {
+ const elements = [];
+ let hasOptionals = false;
+ for (const element of description.elements) {
+ elements.push(go(element.description, ctx));
+ if (element.isOptional) {
+ hasOptionals = true;
+ }
+ }
+ const rest = description.rest.map(d => go(d, ctx));
+ return fc => {
+ // ---------------------------------------------
+ // handle elements
+ // ---------------------------------------------
+ let output = fc.tuple(...elements.map(arb => arb(fc)));
+ if (hasOptionals) {
+ const indexes = fc.tuple(...description.elements.map(element => element.isOptional ? fc.boolean() : fc.constant(true)));
+ output = output.chain(tuple => indexes.map(booleans => {
+ for (const [i, b] of booleans.reverse().entries()) {
+ if (!b) {
+ tuple.splice(booleans.length - i, 1);
+ }
+ }
+ return tuple;
+ }));
+ }
+ // ---------------------------------------------
+ // handle rest element
+ // ---------------------------------------------
+ if (Arr.isNonEmptyReadonlyArray(rest)) {
+ const constraints = buildArrayConstraints(description) ?? constArrayConstraints;
+ const [head, ...tail] = rest;
+ const item = head(fc);
+ output = output.chain(as => {
+ const len = as.length;
+ // We must adjust the constraints for the rest element
+ // because the elements might have generated some values
+ const restArrayConstraints = subtractElementsLength(constraints.constraints, len);
+ if (restArrayConstraints.maxLength === 0) {
+ return fc.constant(as);
+ }
+ /*
+ `getSuspendedArray` is used to generate less values in
+ the context of a recursive schema. Without it, the following schema
+ would generate an big amount of values possibly leading to a stack
+ overflow:
+ ```ts
+ type A = ReadonlyArray
+ const schema = S.Array(
+ S.NullOr(S.suspend((): S.Schema => schema))
+ )
+ ```
+ */
+ const arr = ctx.depthIdentifier !== undefined ? getSuspendedArray(fc, ctx.depthIdentifier, ctx.maxDepth, item, restArrayConstraints) : fc.array(item, restArrayConstraints);
+ if (len === 0) {
+ return arr;
+ }
+ return arr.map(rest => [...as, ...rest]);
+ });
+ // ---------------------------------------------
+ // handle post rest elements
+ // ---------------------------------------------
+ for (let j = 0; j < tail.length; j++) {
+ output = output.chain(as => tail[j](fc).map(a => [...as, a]));
+ }
+ }
+ return output;
+ };
+ }
+ case "TypeLiteral":
+ {
+ const propertySignatures = [];
+ const requiredKeys = [];
+ for (const ps of description.propertySignatures) {
+ if (!ps.isOptional) {
+ requiredKeys.push(ps.name);
+ }
+ propertySignatures.push(go(ps.value, ctx));
+ }
+ const indexSignatures = description.indexSignatures.map(is => [go(is.parameter, ctx), go(is.value, ctx)]);
+ return fc => {
+ const pps = {};
+ for (let i = 0; i < propertySignatures.length; i++) {
+ const ps = description.propertySignatures[i];
+ pps[ps.name] = propertySignatures[i](fc);
+ }
+ let output = fc.record(pps, {
+ requiredKeys
+ });
+ // ---------------------------------------------
+ // handle index signatures
+ // ---------------------------------------------
+ for (let i = 0; i < indexSignatures.length; i++) {
+ const key = indexSignatures[i][0](fc);
+ const value = indexSignatures[i][1](fc);
+ output = output.chain(o => {
+ const item = fc.tuple(key, value);
+ /*
+ `getSuspendedArray` is used to generate less key/value pairs in
+ the context of a recursive schema. Without it, the following schema
+ would generate an big amount of values possibly leading to a stack
+ overflow:
+ ```ts
+ type A = { [_: string]: A }
+ const schema = S.Record({ key: S.String, value: S.suspend((): S.Schema => schema) })
+ ```
+ */
+ const arr = ctx.depthIdentifier !== undefined ? getSuspendedArray(fc, ctx.depthIdentifier, ctx.maxDepth, item, {
+ maxLength: 2
+ }) : fc.array(item);
+ return arr.map(tuples => ({
+ ...Object.fromEntries(tuples),
+ ...o
+ }));
+ });
+ }
+ return output;
+ };
+ }
+ case "Union":
+ {
+ const members = description.members.map(member => go(member, ctx));
+ return fc => fc.oneof(...members.map(arb => arb(fc)));
+ }
+ case "Suspend":
+ {
+ const memo = arbitraryMemoMap.get(description.ast);
+ if (memo) {
+ return memo;
+ }
+ if (ctx.depthIdentifier === undefined) {
+ ctx = {
+ ...ctx,
+ depthIdentifier: description.id
+ };
+ }
+ const get = util_.memoizeThunk(() => {
+ return go(description.description(), ctx);
+ });
+ const out = fc => fc.constant(null).chain(() => get()(fc));
+ arbitraryMemoMap.set(description.ast, out);
+ return out;
+ }
+ case "Ref":
+ {
+ const memo = arbitraryMemoMap.get(description.ast);
+ if (memo) {
+ return memo;
+ }
+ throw new Error(`BUG: Ref ${JSON.stringify(description.id)} not found`);
+ }
+ }
+});
+function subtractElementsLength(constraints, len) {
+ if (len === 0 || constraints.minLength === undefined && constraints.maxLength === undefined) {
+ return constraints;
+ }
+ const out = {
+ ...constraints
+ };
+ if (out.minLength !== undefined) {
+ out.minLength = Math.max(out.minLength - len, 0);
+ }
+ if (out.maxLength !== undefined) {
+ out.maxLength = Math.max(out.maxLength - len, 0);
+ }
+ return out;
+}
+const getSuspendedArray = (fc, depthIdentifier, maxDepth, item, constraints) => {
+ // In the context of a recursive schema, we don't want a `maxLength` greater than 2.
+ // The only exception is when `minLength` is also set, in which case we set
+ // `maxLength` to the minimum value, which is `minLength`.
+ const maxLengthLimit = Math.max(2, constraints.minLength ?? 0);
+ if (constraints.maxLength !== undefined && constraints.maxLength > maxLengthLimit) {
+ constraints = {
+ ...constraints,
+ maxLength: maxLengthLimit
+ };
+ }
+ return fc.oneof({
+ maxDepth,
+ depthIdentifier
+ }, fc.constant([]), fc.array(item, constraints));
+};
+//# sourceMappingURL=Arbitrary.js.map
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Array.js b/backend/node_modules/effect/dist/cjs/Array.js
new file mode 100644
index 0000000000000000000000000000000000000000..c0d4a6bc4cc0c41a6fd0f53b02fd838b60c39e0d
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Array.js
@@ -0,0 +1,2695 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.replaceOption = exports.replace = exports.removeOption = exports.remove = exports.reduceRight = exports.reduce = exports.range = exports.prependAll = exports.prepend = exports.partitionMap = exports.partition = exports.pad = exports.of = exports.modifyOption = exports.modifyNonEmptyLast = exports.modifyNonEmptyHead = exports.modify = exports.min = exports.max = exports.matchRight = exports.matchLeft = exports.match = exports.mapAccum = exports.map = exports.makeBy = exports.make = exports.liftPredicate = exports.liftOption = exports.liftNullable = exports.liftEither = exports.let = exports.length = exports.lastNonEmpty = exports.last = exports.join = exports.isNonEmptyReadonlyArray = exports.isNonEmptyArray = exports.isEmptyReadonlyArray = exports.isEmptyArray = exports.isArray = exports.intersperse = exports.intersectionWith = exports.intersection = exports.insertAt = exports.initNonEmpty = exports.init = exports.headNonEmpty = exports.head = exports.groupWith = exports.groupBy = exports.group = exports.getSomes = exports.getRights = exports.getOrder = exports.getLefts = exports.getEquivalence = exports.get = exports.fromRecord = exports.fromOption = exports.fromNullable = exports.fromIterable = exports.forEach = exports.flatten = exports.flatMapNullable = exports.flatMap = exports.findLastIndex = exports.findLast = exports.findFirstWithIndex = exports.findFirstIndex = exports.findFirst = exports.filterMapWhile = exports.filterMap = exports.filter = exports.extend = exports.every = exports.ensure = exports.empty = exports.dropWhile = exports.dropRight = exports.drop = exports.differenceWith = exports.difference = exports.dedupeWith = exports.dedupeAdjacentWith = exports.dedupeAdjacent = exports.dedupe = exports.countBy = exports.copy = exports.containsWith = exports.contains = exports.chunksOf = exports.chop = exports.cartesianWith = exports.cartesian = exports.bindTo = exports.bind = exports.appendAll = exports.append = exports.allocate = exports.Do = void 0;
+exports.zipWith = exports.zip = exports.window = exports.unzip = exports.unsafeGet = exports.unprepend = exports.unionWith = exports.union = exports.unfold = exports.unappend = exports.takeWhile = exports.takeRight = exports.take = exports.tailNonEmpty = exports.tail = exports.splitWhere = exports.splitNonEmptyAt = exports.splitAt = exports.split = exports.span = exports.sortWith = exports.sortBy = exports.sort = exports.some = exports.setNonEmptyLast = exports.setNonEmptyHead = exports.separate = exports.scanRight = exports.scan = exports.rotate = exports.reverse = exports.replicate = void 0;
+var Either = _interopRequireWildcard(require("./Either.js"));
+var Equal = _interopRequireWildcard(require("./Equal.js"));
+var Equivalence = _interopRequireWildcard(require("./Equivalence.js"));
+var _Function = require("./Function.js");
+var internalArray = _interopRequireWildcard(require("./internal/array.js"));
+var internalDoNotation = _interopRequireWildcard(require("./internal/doNotation.js"));
+var moduleIterable = _interopRequireWildcard(require("./Iterable.js"));
+var Option = _interopRequireWildcard(require("./Option.js"));
+var Order = _interopRequireWildcard(require("./Order.js"));
+var Predicate = _interopRequireWildcard(require("./Predicate.js"));
+var Record = _interopRequireWildcard(require("./Record.js"));
+var Tuple = _interopRequireWildcard(require("./Tuple.js"));
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * This module provides utility functions for working with arrays in TypeScript.
+ *
+ * @since 2.0.0
+ */
+
+/**
+ * Builds a `NonEmptyArray` from an non-empty collection of elements.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.make(1, 2, 3)
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+const make = (...elements) => elements;
+/**
+ * Creates a new `Array` of the specified length.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.allocate(3)
+ * console.log(result) // [ <3 empty items> ]
+ * ```
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+exports.make = make;
+const allocate = n => new Array(n);
+/**
+ * Return a `NonEmptyArray` of length `n` with element `i` initialized with `f(i)`.
+ *
+ * **Note**. `n` is normalized to an integer >= 1.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { makeBy } from "effect/Array"
+ *
+ * const result = makeBy(5, n => n * 2)
+ * console.log(result) // [0, 2, 4, 6, 8]
+ * ```
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+exports.allocate = allocate;
+const makeBy = exports.makeBy = /*#__PURE__*/(0, _Function.dual)(2, (n, f) => {
+ const max = Math.max(1, Math.floor(n));
+ const out = new Array(max);
+ for (let i = 0; i < max; i++) {
+ out[i] = f(i);
+ }
+ return out;
+});
+/**
+ * Return a `NonEmptyArray` containing a range of integers, including both endpoints.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { range } from "effect/Array"
+ *
+ * const result = range(1, 3)
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+const range = (start, end) => start <= end ? makeBy(end - start + 1, i => start + i) : [start];
+/**
+ * Return a `NonEmptyArray` containing a value repeated the specified number of times.
+ *
+ * **Note**. `n` is normalized to an integer >= 1.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.replicate("a", 3)
+ * console.log(result) // ["a", "a", "a"]
+ * ```
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+exports.range = range;
+const replicate = exports.replicate = /*#__PURE__*/(0, _Function.dual)(2, (a, n) => makeBy(n, () => a));
+/**
+ * Creates a new `Array` from an iterable collection of values.
+ * If the input is already an array, it returns the input as-is.
+ * Otherwise, it converts the iterable collection to an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.fromIterable(new Set([1, 2, 3]))
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+const fromIterable = collection => Array.isArray(collection) ? collection : Array.from(collection);
+/**
+ * Creates a new `Array` from a value that might not be an iterable.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * console.log(Array.ensure("a")) // ["a"]
+ * console.log(Array.ensure(["a"])) // ["a"]
+ * console.log(Array.ensure(["a", "b", "c"])) // ["a", "b", "c"]
+ * ```
+ *
+ * @category constructors
+ * @since 3.3.0
+ */
+exports.fromIterable = fromIterable;
+const ensure = self => Array.isArray(self) ? self : [self];
+/**
+ * Takes a record and returns an array of tuples containing its keys and values.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.fromRecord({ a: 1, b: 2, c: 3 })
+ * console.log(result) // [["a", 1], ["b", 2], ["c", 3]]
+ * ```
+ *
+ * @category conversions
+ * @since 2.0.0
+ */
+exports.ensure = ensure;
+const fromRecord = exports.fromRecord = Record.toEntries;
+/**
+ * Converts an `Option` to an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Option } from "effect"
+ *
+ * console.log(Array.fromOption(Option.some(1))) // [1]
+ * console.log(Array.fromOption(Option.none())) // []
+ * ```
+ *
+ * @category conversions
+ * @since 2.0.0
+ */
+const fromOption = exports.fromOption = Option.toArray;
+/**
+ * Matches the elements of an array, applying functions to cases of empty and non-empty arrays.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const match = Array.match({
+ * onEmpty: () => "empty",
+ * onNonEmpty: ([head, ...tail]) => `head: ${head}, tail: ${tail.length}`
+ * })
+ * console.log(match([])) // "empty"
+ * console.log(match([1, 2, 3])) // "head: 1, tail: 2"
+ * ```
+ *
+ * @category pattern matching
+ * @since 2.0.0
+ */
+const match = exports.match = /*#__PURE__*/(0, _Function.dual)(2, (self, {
+ onEmpty,
+ onNonEmpty
+}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());
+/**
+ * Matches the elements of an array from the left, applying functions to cases of empty and non-empty arrays.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const matchLeft = Array.matchLeft({
+ * onEmpty: () => "empty",
+ * onNonEmpty: (head, tail) => `head: ${head}, tail: ${tail.length}`
+ * })
+ * console.log(matchLeft([])) // "empty"
+ * console.log(matchLeft([1, 2, 3])) // "head: 1, tail: 2"
+ * ```
+ *
+ * @category pattern matching
+ * @since 2.0.0
+ */
+const matchLeft = exports.matchLeft = /*#__PURE__*/(0, _Function.dual)(2, (self, {
+ onEmpty,
+ onNonEmpty
+}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());
+/**
+ * Matches the elements of an array from the right, applying functions to cases of empty and non-empty arrays.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const matchRight = Array.matchRight({
+ * onEmpty: () => "empty",
+ * onNonEmpty: (init, last) => `init: ${init.length}, last: ${last}`
+ * })
+ * console.log(matchRight([])) // "empty"
+ * console.log(matchRight([1, 2, 3])) // "init: 2, last: 3"
+ * ```
+ *
+ * @category pattern matching
+ * @since 2.0.0
+ */
+const matchRight = exports.matchRight = /*#__PURE__*/(0, _Function.dual)(2, (self, {
+ onEmpty,
+ onNonEmpty
+}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());
+/**
+ * Prepend an element to the front of an `Iterable`, creating a new `NonEmptyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.prepend([2, 3, 4], 1)
+ * console.log(result) // [1, 2, 3, 4]
+ * ```
+ *
+ * @category concatenating
+ * @since 2.0.0
+ */
+const prepend = exports.prepend = /*#__PURE__*/(0, _Function.dual)(2, (self, head) => [head, ...self]);
+/**
+ * Prepends the specified prefix array (or iterable) to the beginning of the specified array (or iterable).
+ * If either array is non-empty, the result is also a non-empty array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.prependAll([2, 3], [0, 1])
+ * console.log(result) // [0, 1, 2, 3]
+ * ```
+ *
+ * @category concatenating
+ * @since 2.0.0
+ */
+const prependAll = exports.prependAll = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => fromIterable(that).concat(fromIterable(self)));
+/**
+ * Append an element to the end of an `Iterable`, creating a new `NonEmptyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.append([1, 2, 3], 4);
+ * console.log(result) // [1, 2, 3, 4]
+ * ```
+ *
+ * @category concatenating
+ * @since 2.0.0
+ */
+const append = exports.append = /*#__PURE__*/(0, _Function.dual)(2, (self, last) => [...self, last]);
+/**
+ * Concatenates two arrays (or iterables), combining their elements.
+ * If either array is non-empty, the result is also a non-empty array.
+ *
+ * @category concatenating
+ * @since 2.0.0
+ */
+const appendAll = exports.appendAll = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => fromIterable(self).concat(fromIterable(that)));
+/**
+ * Accumulates values from an `Iterable` starting from the left, storing
+ * each intermediate result in an array. Useful for tracking the progression of
+ * a value through a series of transformations.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect";
+ *
+ * const result = Array.scan([1, 2, 3, 4], 0, (acc, value) => acc + value)
+ * console.log(result) // [0, 1, 3, 6, 10]
+ *
+ * // Explanation:
+ * // This function starts with the initial value (0 in this case)
+ * // and adds each element of the array to this accumulator one by one,
+ * // keeping track of the cumulative sum after each addition.
+ * // Each of these sums is captured in the resulting array.
+ * ```
+ *
+ * @category folding
+ * @since 2.0.0
+ */
+const scan = exports.scan = /*#__PURE__*/(0, _Function.dual)(3, (self, b, f) => {
+ const out = [b];
+ let i = 0;
+ for (const a of self) {
+ out[i + 1] = f(out[i], a);
+ i++;
+ }
+ return out;
+});
+/**
+ * Accumulates values from an `Iterable` starting from the right, storing
+ * each intermediate result in an array. Useful for tracking the progression of
+ * a value through a series of transformations.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect";
+ *
+ * const result = Array.scanRight([1, 2, 3, 4], 0, (acc, value) => acc + value)
+ * console.log(result) // [10, 9, 7, 4, 0]
+ * ```
+ *
+ * @category folding
+ * @since 2.0.0
+ */
+const scanRight = exports.scanRight = /*#__PURE__*/(0, _Function.dual)(3, (self, b, f) => {
+ const input = fromIterable(self);
+ const out = new Array(input.length + 1);
+ out[input.length] = b;
+ for (let i = input.length - 1; i >= 0; i--) {
+ out[i] = f(out[i + 1], input[i]);
+ }
+ return out;
+});
+/**
+ * Determine if `unknown` is an Array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * console.log(Array.isArray(null)) // false
+ * console.log(Array.isArray([1, 2, 3])) // true
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+const isArray = exports.isArray = Array.isArray;
+/**
+ * Determine if an `Array` is empty narrowing down the type to `[]`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * console.log(Array.isEmptyArray([])) // true
+ * console.log(Array.isEmptyArray([1, 2, 3])) // false
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+const isEmptyArray = self => self.length === 0;
+/**
+ * Determine if a `ReadonlyArray` is empty narrowing down the type to `readonly []`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * console.log(Array.isEmptyReadonlyArray([])) // true
+ * console.log(Array.isEmptyReadonlyArray([1, 2, 3])) // false
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+exports.isEmptyArray = isEmptyArray;
+const isEmptyReadonlyArray = exports.isEmptyReadonlyArray = isEmptyArray;
+/**
+ * Determine if an `Array` is non empty narrowing down the type to `NonEmptyArray`.
+ *
+ * An `Array` is considered to be a `NonEmptyArray` if it contains at least one element.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * console.log(Array.isNonEmptyArray([])) // false
+ * console.log(Array.isNonEmptyArray([1, 2, 3])) // true
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+const isNonEmptyArray = exports.isNonEmptyArray = internalArray.isNonEmptyArray;
+/**
+ * Determine if a `ReadonlyArray` is non empty narrowing down the type to `NonEmptyReadonlyArray`.
+ *
+ * A `ReadonlyArray` is considered to be a `NonEmptyReadonlyArray` if it contains at least one element.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * console.log(Array.isNonEmptyReadonlyArray([])) // false
+ * console.log(Array.isNonEmptyReadonlyArray([1, 2, 3])) // true
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+const isNonEmptyReadonlyArray = exports.isNonEmptyReadonlyArray = internalArray.isNonEmptyArray;
+/**
+ * Return the number of elements in a `ReadonlyArray`.
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const length = self => self.length;
+exports.length = length;
+const isOutOfBounds = (i, as) => i < 0 || i >= as.length;
+const clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));
+/**
+ * This function provides a safe way to read a value at a particular index from a `ReadonlyArray`.
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const get = exports.get = /*#__PURE__*/(0, _Function.dual)(2, (self, index) => {
+ const i = Math.floor(index);
+ return isOutOfBounds(i, self) ? Option.none() : Option.some(self[i]);
+});
+/**
+ * Gets an element unsafely, will throw on out of bounds.
+ *
+ * @since 2.0.0
+ * @category unsafe
+ */
+const unsafeGet = exports.unsafeGet = /*#__PURE__*/(0, _Function.dual)(2, (self, index) => {
+ const i = Math.floor(index);
+ if (isOutOfBounds(i, self)) {
+ throw new Error(`Index ${i} out of bounds`);
+ }
+ return self[i];
+});
+/**
+ * Return a tuple containing the first element, and a new `Array` of the remaining elements, if any.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect";
+ *
+ * const result = Array.unprepend([1, 2, 3, 4])
+ * console.log(result) // [1, [2, 3, 4]]
+ * ```
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+const unprepend = self => [headNonEmpty(self), tailNonEmpty(self)];
+/**
+ * Return a tuple containing a copy of the `NonEmptyReadonlyArray` without its last element, and that last element.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect";
+ *
+ * const result = Array.unappend([1, 2, 3, 4])
+ * console.log(result) // [[1, 2, 3], 4]
+ * ```
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+exports.unprepend = unprepend;
+const unappend = self => [initNonEmpty(self), lastNonEmpty(self)];
+/**
+ * Get the first element of a `ReadonlyArray`, or `None` if the `ReadonlyArray` is empty.
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.unappend = unappend;
+const head = exports.head = /*#__PURE__*/get(0);
+/**
+ * Get the first element of a non empty array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.headNonEmpty([1, 2, 3, 4])
+ * console.log(result) // 1
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const headNonEmpty = exports.headNonEmpty = /*#__PURE__*/unsafeGet(0);
+/**
+ * Get the last element in a `ReadonlyArray`, or `None` if the `ReadonlyArray` is empty.
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const last = self => isNonEmptyReadonlyArray(self) ? Option.some(lastNonEmpty(self)) : Option.none();
+/**
+ * Get the last element of a non empty array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.lastNonEmpty([1, 2, 3, 4])
+ * console.log(result) // 4
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.last = last;
+const lastNonEmpty = self => self[self.length - 1];
+/**
+ * Get all but the first element of an `Iterable`, creating a new `Array`, or `None` if the `Iterable` is empty.
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.lastNonEmpty = lastNonEmpty;
+const tail = self => {
+ const input = fromIterable(self);
+ return isNonEmptyReadonlyArray(input) ? Option.some(tailNonEmpty(input)) : Option.none();
+};
+/**
+ * Get all but the first element of a `NonEmptyReadonlyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.tailNonEmpty([1, 2, 3, 4])
+ * console.log(result) // [2, 3, 4]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.tail = tail;
+const tailNonEmpty = self => self.slice(1);
+/**
+ * Get all but the last element of an `Iterable`, creating a new `Array`, or `None` if the `Iterable` is empty.
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.tailNonEmpty = tailNonEmpty;
+const init = self => {
+ const input = fromIterable(self);
+ return isNonEmptyReadonlyArray(input) ? Option.some(initNonEmpty(input)) : Option.none();
+};
+/**
+ * Get all but the last element of a non empty array, creating a new array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.initNonEmpty([1, 2, 3, 4])
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.init = init;
+const initNonEmpty = self => self.slice(0, -1);
+/**
+ * Keep only a max number of elements from the start of an `Iterable`, creating a new `Array`.
+ *
+ * **Note**. `n` is normalized to a non negative integer.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.take([1, 2, 3, 4, 5], 3)
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+exports.initNonEmpty = initNonEmpty;
+const take = exports.take = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ return input.slice(0, clamp(n, input));
+});
+/**
+ * Keep only a max number of elements from the end of an `Iterable`, creating a new `Array`.
+ *
+ * **Note**. `n` is normalized to a non negative integer.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.takeRight([1, 2, 3, 4, 5], 3)
+ * console.log(result) // [3, 4, 5]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const takeRight = exports.takeRight = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ const i = clamp(n, input);
+ return i === 0 ? [] : input.slice(-i);
+});
+/**
+ * Calculate the longest initial subarray for which all element satisfy the specified predicate, creating a new `Array`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.takeWhile([1, 3, 2, 4, 1, 2], x => x < 4)
+ * console.log(result) // [1, 3, 2]
+ *
+ * // Explanation:
+ * // - The function starts with the first element (`1`), which is less than `4`, so it adds `1` to the result.
+ * // - The next element (`3`) is also less than `4`, so it adds `3`.
+ * // - The next element (`2`) is again less than `4`, so it adds `2`.
+ * // - The function then encounters `4`, which is not less than `4`. At this point, it stops checking further elements and finalizes the result.
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const takeWhile = exports.takeWhile = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => {
+ let i = 0;
+ const out = [];
+ for (const a of self) {
+ if (!predicate(a, i)) {
+ break;
+ }
+ out.push(a);
+ i++;
+ }
+ return out;
+});
+const spanIndex = (self, predicate) => {
+ let i = 0;
+ for (const a of self) {
+ if (!predicate(a, i)) {
+ break;
+ }
+ i++;
+ }
+ return i;
+};
+/**
+ * Split an `Iterable` into two parts:
+ *
+ * 1. the longest initial subarray for which all elements satisfy the specified predicate
+ * 2. the remaining elements
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+const span = exports.span = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
+/**
+ * Drop a max number of elements from the start of an `Iterable`, creating a new `Array`.
+ *
+ * **Note**. `n` is normalized to a non negative integer.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.drop([1, 2, 3, 4, 5], 2)
+ * console.log(result) // [3, 4, 5]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const drop = exports.drop = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ return input.slice(clamp(n, input), input.length);
+});
+/**
+ * Drop a max number of elements from the end of an `Iterable`, creating a new `Array`.
+ *
+ * **Note**. `n` is normalized to a non negative integer.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.dropRight([1, 2, 3, 4, 5], 2)
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const dropRight = exports.dropRight = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ return input.slice(0, input.length - clamp(n, input));
+});
+/**
+ * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new `Array`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.dropWhile([1, 2, 3, 4, 5], x => x < 4)
+ * console.log(result) // [4, 5]
+ * ```
+ *
+ * @category getters
+ * @since 2.0.0
+ */
+const dropWhile = exports.dropWhile = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => fromIterable(self).slice(spanIndex(self, predicate)));
+/**
+ * Return the first index for which a predicate holds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.findFirstIndex([5, 3, 8, 9], x => x > 5)
+ * console.log(result) // Option.some(2)
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const findFirstIndex = exports.findFirstIndex = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => {
+ let i = 0;
+ for (const a of self) {
+ if (predicate(a, i)) {
+ return Option.some(i);
+ }
+ i++;
+ }
+ return Option.none();
+});
+/**
+ * Return the last index for which a predicate holds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.findLastIndex([1, 3, 8, 9], x => x < 5)
+ * console.log(result) // Option.some(1)
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const findLastIndex = exports.findLastIndex = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => {
+ const input = fromIterable(self);
+ for (let i = input.length - 1; i >= 0; i--) {
+ if (predicate(input[i], i)) {
+ return Option.some(i);
+ }
+ }
+ return Option.none();
+});
+/**
+ * Returns the first element that satisfies the specified
+ * predicate, or `None` if no such element exists.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.findFirst([1, 2, 3, 4, 5], x => x > 3)
+ * console.log(result) // Option.some(4)
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const findFirst = exports.findFirst = moduleIterable.findFirst;
+/**
+ * Finds the last element in an iterable collection that satisfies the given predicate or refinement.
+ * Returns an `Option` containing the found element, or `Option.none` if no element matches.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.findLast([1, 2, 3, 4, 5], n => n % 2 === 0)
+ * console.log(result) // Option.some(4)
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const findLast = exports.findLast = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ const input = fromIterable(self);
+ for (let i = input.length - 1; i >= 0; i--) {
+ const a = input[i];
+ const o = f(a, i);
+ if (Predicate.isBoolean(o)) {
+ if (o) {
+ return Option.some(a);
+ }
+ } else {
+ if (Option.isSome(o)) {
+ return o;
+ }
+ }
+ }
+ return Option.none();
+});
+/**
+ * Returns a tuple of the first element that satisfies the specified
+ * predicate and its index, or `None` if no such element exists.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.findFirstWithIndex([1, 2, 3, 4, 5], x => x > 3)
+ * console.log(result) // Option.some([4, 3])
+ * ```
+ *
+ * @category elements
+ * @since 3.17.0
+ */
+const findFirstWithIndex = exports.findFirstWithIndex = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ let i = 0;
+ for (const a of self) {
+ const o = f(a, i);
+ if (Predicate.isBoolean(o)) {
+ if (o) {
+ return Option.some([a, i]);
+ }
+ } else {
+ if (Option.isSome(o)) {
+ return Option.some([o.value, i]);
+ }
+ }
+ i++;
+ }
+ return Option.none();
+});
+/**
+ * Counts all the element of the given array that pass the given predicate
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.countBy([1, 2, 3, 4, 5], n => n % 2 === 0)
+ * console.log(result) // 2
+ * ```
+ *
+ * @category folding
+ * @since 3.16.0
+ */
+const countBy = exports.countBy = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ let count = 0;
+ const as = fromIterable(self);
+ for (let i = 0; i < as.length; i++) {
+ const a = as[i];
+ if (f(a, i)) {
+ count++;
+ }
+ }
+ return count;
+});
+/**
+ * Insert an element at the specified index, creating a new `NonEmptyArray`,
+ * or return `None` if the index is out of bounds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.insertAt(['a', 'b', 'c', 'e'], 3, 'd')
+ * console.log(result) // Option.some(['a', 'b', 'c', 'd', 'e'])
+ * ```
+ *
+ * @since 2.0.0
+ */
+const insertAt = exports.insertAt = /*#__PURE__*/(0, _Function.dual)(3, (self, i, b) => {
+ const out = Array.from(self);
+ // v--- `= self.length` is ok, it means inserting in last position
+ if (i < 0 || i > out.length) {
+ return Option.none();
+ }
+ out.splice(i, 0, b);
+ return Option.some(out);
+});
+/**
+ * Change the element at the specified index, creating a new `Array`,
+ * or return a copy of the input if the index is out of bounds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.replace(['a', 'b', 'c', 'd'], 1, 'z')
+ * console.log(result) // ['a', 'z', 'c', 'd']
+ * ```
+ *
+ * @since 2.0.0
+ */
+const replace = exports.replace = /*#__PURE__*/(0, _Function.dual)(3, (self, i, b) => modify(self, i, () => b));
+/**
+ * Replaces an element in an array with the given value, returning an option of the updated array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.replaceOption([1, 2, 3], 1, 4)
+ * console.log(result) // Option.some([1, 4, 3])
+ * ```
+ *
+ * @since 2.0.0
+ */
+const replaceOption = exports.replaceOption = /*#__PURE__*/(0, _Function.dual)(3, (self, i, b) => modifyOption(self, i, () => b));
+/**
+ * Apply a function to the element at the specified index, creating a new `Array`,
+ * or return a copy of the input if the index is out of bounds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.modify([1, 2, 3, 4], 2, (n) => n * 2)
+ * console.log(result) // [1, 2, 6, 4]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const modify = exports.modify = /*#__PURE__*/(0, _Function.dual)(3, (self, i, f) => {
+ const out = Array.from(self);
+ if (isOutOfBounds(i, out)) {
+ return out;
+ }
+ const b = f(out[i]);
+ out[i] = b;
+ return out;
+});
+/**
+ * Apply a function to the element at the specified index, creating a new `Array`,
+ * or return `None` if the index is out of bounds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const input = [1, 2, 3, 4]
+ * const result = Array.modifyOption(input, 2, (n) => n * 2)
+ * console.log(result) // Option.some([1, 2, 6, 4])
+ *
+ * const outOfBoundsResult = Array.modifyOption(input, 5, (n) => n * 2)
+ * console.log(outOfBoundsResult) // Option.none()
+ * ```
+ *
+ * @since 2.0.0
+ */
+const modifyOption = exports.modifyOption = /*#__PURE__*/(0, _Function.dual)(3, (self, i, f) => {
+ const arr = fromIterable(self);
+ if (isOutOfBounds(i, arr)) {
+ return Option.none();
+ }
+ const out = Array.isArray(self) ? self.slice() : arr;
+ const b = f(arr[i]);
+ out[i] = b;
+ return Option.some(out);
+});
+/**
+ * Delete the element at the specified index, creating a new `Array`,
+ * or return a copy of the input if the index is out of bounds.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const input = [1, 2, 3, 4]
+ * const result = Array.remove(input, 2)
+ * console.log(result) // [1, 2, 4]
+ *
+ * const outOfBoundsResult = Array.remove(input, 5)
+ * console.log(outOfBoundsResult) // [1, 2, 3, 4]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const remove = exports.remove = /*#__PURE__*/(0, _Function.dual)(2, (self, i) => {
+ const out = Array.from(self);
+ if (isOutOfBounds(i, out)) {
+ return out;
+ }
+ out.splice(i, 1);
+ return out;
+});
+/**
+ * Delete the element at the specified index, creating a new `Array`,
+ * or return `None` if the index is out of bounds.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { Array, Option } from "effect"
+ *
+ * const numbers = [1, 2, 3, 4]
+ * const result = Array.removeOption(numbers, 2)
+ * assert.deepStrictEqual(result, Option.some([1, 2, 4]))
+ *
+ * const outOfBoundsResult = Array.removeOption(numbers, 5)
+ * assert.deepStrictEqual(outOfBoundsResult, Option.none())
+ * ```
+ *
+ * @since 3.16.0
+ */
+const removeOption = exports.removeOption = /*#__PURE__*/(0, _Function.dual)(2, (self, i) => {
+ const arr = fromIterable(self);
+ if (isOutOfBounds(i, arr)) {
+ return Option.none();
+ }
+ const out = Array.isArray(self) ? self.slice() : arr;
+ out.splice(i, 1);
+ return Option.some(out);
+});
+/**
+ * Reverse an `Iterable`, creating a new `Array`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.reverse([1, 2, 3, 4])
+ * console.log(result) // [4, 3, 2, 1]
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const reverse = self => Array.from(self).reverse();
+/**
+ * Create a new array with elements sorted in increasing order based on the specified comparator.
+ * If the input is a `NonEmptyReadonlyArray`, the output will also be a `NonEmptyReadonlyArray`.
+ *
+ * @category sorting
+ * @since 2.0.0
+ */
+exports.reverse = reverse;
+const sort = exports.sort = /*#__PURE__*/(0, _Function.dual)(2, (self, O) => {
+ const out = Array.from(self);
+ out.sort(O);
+ return out;
+});
+/**
+ * Sorts an array based on a provided mapping function and order. The mapping
+ * function transforms the elements into a value that can be compared, and the
+ * order defines how those values should be sorted.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Order } from "effect"
+ *
+ * const result = Array.sortWith(["aaa", "b", "cc"], (s) => s.length, Order.number)
+ * console.log(result) // ["b", "cc", "aaa"]
+ *
+ * // Explanation:
+ * // The array of strings is sorted based on their lengths. The mapping function `(s) => s.length`
+ * // converts each string into its length, and the `Order.number` specifies that the lengths should
+ * // be sorted in ascending order.
+ * ```
+ *
+ * @since 2.0.0
+ * @category elements
+ */
+const sortWith = exports.sortWith = /*#__PURE__*/(0, _Function.dual)(3, (self, f, order) => Array.from(self).map(a => [a, f(a)]).sort(([, a], [, b]) => order(a, b)).map(([_]) => _));
+/**
+ * Sorts the elements of an `Iterable` in increasing order based on the provided
+ * orders. The elements are compared using the first order in `orders`, then the
+ * second order if the first comparison is equal, and so on.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Order, pipe } from "effect"
+ *
+ * const users = [
+ * { name: "Alice", age: 30 },
+ * { name: "Bob", age: 25 },
+ * { name: "Charlie", age: 30 }
+ * ]
+ *
+ * const result = pipe(
+ * users,
+ * Array.sortBy(
+ * Order.mapInput(Order.number, (user: (typeof users)[number]) => user.age),
+ * Order.mapInput(Order.string, (user: (typeof users)[number]) => user.name)
+ * )
+ * )
+ *
+ * console.log(result)
+ * // [
+ * // { name: "Bob", age: 25 },
+ * // { name: "Alice", age: 30 },
+ * // { name: "Charlie", age: 30 }
+ * // ]
+ *
+ * // Explanation:
+ * // The array of users is sorted first by age in ascending order. When ages are equal,
+ * // the users are further sorted by name in ascending order.
+ * ```
+ *
+ * @category sorting
+ * @since 2.0.0
+ */
+const sortBy = (...orders) => {
+ const sortByAll = sort(Order.combineAll(orders));
+ return self => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ return sortByAll(input);
+ }
+ return [];
+ };
+};
+/**
+ * Takes two `Iterable`s and returns an `Array` of corresponding pairs.
+ * If one input `Iterable` is short, excess elements of the
+ * longer `Iterable` are discarded.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.zip([1, 2, 3], ['a', 'b'])
+ * console.log(result) // [[1, 'a'], [2, 'b']]
+ * ```
+ *
+ * @category zipping
+ * @since 2.0.0
+ */
+exports.sortBy = sortBy;
+const zip = exports.zip = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => zipWith(self, that, Tuple.make));
+/**
+ * Apply a function to pairs of elements at the same index in two `Iterable`s, collecting the results in a new `Array`. If one
+ * input `Iterable` is short, excess elements of the longer `Iterable` are discarded.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.zipWith([1, 2, 3], [4, 5, 6], (a, b) => a + b)
+ * console.log(result) // [5, 7, 9]
+ * ```
+ *
+ * @category zipping
+ * @since 2.0.0
+ */
+const zipWith = exports.zipWith = /*#__PURE__*/(0, _Function.dual)(3, (self, that, f) => {
+ const as = fromIterable(self);
+ const bs = fromIterable(that);
+ if (isNonEmptyReadonlyArray(as) && isNonEmptyReadonlyArray(bs)) {
+ const out = [f(headNonEmpty(as), headNonEmpty(bs))];
+ const len = Math.min(as.length, bs.length);
+ for (let i = 1; i < len; i++) {
+ out[i] = f(as[i], bs[i]);
+ }
+ return out;
+ }
+ return [];
+});
+/**
+ * This function is the inverse of `zip`. Takes an `Iterable` of pairs and return two corresponding `Array`s.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.unzip([[1, "a"], [2, "b"], [3, "c"]])
+ * console.log(result) // [[1, 2, 3], ['a', 'b', 'c']]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const unzip = self => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ const fa = [input[0][0]];
+ const fb = [input[0][1]];
+ for (let i = 1; i < input.length; i++) {
+ fa[i] = input[i][0];
+ fb[i] = input[i][1];
+ }
+ return [fa, fb];
+ }
+ return [[], []];
+};
+/**
+ * Places an element in between members of an `Iterable`.
+ * If the input is a non-empty array, the result is also a non-empty array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.intersperse([1, 2, 3], 0)
+ * console.log(result) // [1, 0, 2, 0, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+exports.unzip = unzip;
+const intersperse = exports.intersperse = /*#__PURE__*/(0, _Function.dual)(2, (self, middle) => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ const out = [headNonEmpty(input)];
+ const tail = tailNonEmpty(input);
+ for (let i = 0; i < tail.length; i++) {
+ if (i < tail.length) {
+ out.push(middle);
+ }
+ out.push(tail[i]);
+ }
+ return out;
+ }
+ return [];
+});
+/**
+ * Apply a function to the head, creating a new `NonEmptyReadonlyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.modifyNonEmptyHead([1, 2, 3], n => n * 10)
+ * console.log(result) // [10, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const modifyNonEmptyHead = exports.modifyNonEmptyHead = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => [f(headNonEmpty(self)), ...tailNonEmpty(self)]);
+/**
+ * Change the head, creating a new `NonEmptyReadonlyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.setNonEmptyHead([1, 2, 3], 10)
+ * console.log(result) // [10, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const setNonEmptyHead = exports.setNonEmptyHead = /*#__PURE__*/(0, _Function.dual)(2, (self, b) => modifyNonEmptyHead(self, () => b));
+/**
+ * Apply a function to the last element, creating a new `NonEmptyReadonlyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.modifyNonEmptyLast([1, 2, 3], n => n * 2)
+ * console.log(result) // [1, 2, 6]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const modifyNonEmptyLast = exports.modifyNonEmptyLast = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => append(initNonEmpty(self), f(lastNonEmpty(self))));
+/**
+ * Change the last element, creating a new `NonEmptyReadonlyArray`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.setNonEmptyLast([1, 2, 3], 4)
+ * console.log(result) // [1, 2, 4]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const setNonEmptyLast = exports.setNonEmptyLast = /*#__PURE__*/(0, _Function.dual)(2, (self, b) => modifyNonEmptyLast(self, () => b));
+/**
+ * Rotate an `Iterable` by `n` steps.
+ * If the input is a non-empty array, the result is also a non-empty array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.rotate(['a', 'b', 'c', 'd', 'e'], 2)
+ * console.log(result) // [ 'd', 'e', 'a', 'b', 'c' ]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const rotate = exports.rotate = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ const len = input.length;
+ const m = Math.round(n) % len;
+ if (isOutOfBounds(Math.abs(m), input) || m === 0) {
+ return copy(input);
+ }
+ if (m < 0) {
+ const [f, s] = splitNonEmptyAt(input, -m);
+ return appendAll(s, f);
+ } else {
+ return rotate(self, m - len);
+ }
+ }
+ return [];
+});
+/**
+ * Returns a function that checks if a `ReadonlyArray` contains a given value using a provided `isEquivalent` function.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, pipe } from "effect"
+ *
+ * const isEquivalent = (a: number, b: number) => a === b
+ * const containsNumber = Array.containsWith(isEquivalent)
+ * const result = pipe([1, 2, 3, 4], containsNumber(3))
+ * console.log(result) // true
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const containsWith = isEquivalent => (0, _Function.dual)(2, (self, a) => {
+ for (const i of self) {
+ if (isEquivalent(a, i)) {
+ return true;
+ }
+ }
+ return false;
+});
+exports.containsWith = containsWith;
+const _equivalence = /*#__PURE__*/Equal.equivalence();
+/**
+ * Returns a function that checks if a `ReadonlyArray` contains a given value using the default `Equivalence`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, pipe } from "effect"
+ *
+ * const result = pipe(['a', 'b', 'c', 'd'], Array.contains('c'))
+ * console.log(result) // true
+ * ```
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const contains = exports.contains = /*#__PURE__*/containsWith(_equivalence);
+/**
+ * A useful recursion pattern for processing an `Iterable` to produce a new `Array`, often used for "chopping" up the input
+ * `Iterable`. Typically chop is called with some function that will consume an initial prefix of the `Iterable` and produce a
+ * value and the rest of the `Array`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.chop([1, 2, 3, 4, 5], (as): [number, Array] => [as[0] * 2, as.slice(1)])
+ * console.log(result) // [2, 4, 6, 8, 10]
+ *
+ * // Explanation:
+ * // The `chopFunction` takes the first element of the array, doubles it, and then returns it along with the rest of the array.
+ * // The `chop` function applies this `chopFunction` recursively to the input array `[1, 2, 3, 4, 5]`,
+ * // resulting in a new array `[2, 4, 6, 8, 10]`.
+ * ```
+ *
+ * @since 2.0.0
+ */
+const chop = exports.chop = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ const [b, rest] = f(input);
+ const out = [b];
+ let next = rest;
+ while (internalArray.isNonEmptyArray(next)) {
+ const [b, rest] = f(next);
+ out.push(b);
+ next = rest;
+ }
+ return out;
+ }
+ return [];
+});
+/**
+ * Splits an `Iterable` into two segments, with the first segment containing a maximum of `n` elements.
+ * The value of `n` can be `0`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.splitAt([1, 2, 3, 4, 5], 3)
+ * console.log(result) // [[1, 2, 3], [4, 5]]
+ * ```
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+const splitAt = exports.splitAt = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = Array.from(self);
+ const _n = Math.floor(n);
+ if (isNonEmptyReadonlyArray(input)) {
+ if (_n >= 1) {
+ return splitNonEmptyAt(input, _n);
+ }
+ return [[], input];
+ }
+ return [input, []];
+});
+/**
+ * Splits a `NonEmptyReadonlyArray` into two segments, with the first segment containing a maximum of `n` elements.
+ * The value of `n` must be `>= 1`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.splitNonEmptyAt(["a", "b", "c", "d", "e"], 3)
+ * console.log(result) // [["a", "b", "c"], ["d", "e"]]
+ * ```
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+const splitNonEmptyAt = exports.splitNonEmptyAt = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const _n = Math.max(1, Math.floor(n));
+ return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
+});
+/**
+ * Splits this iterable into `n` equally sized arrays.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.split([1, 2, 3, 4, 5, 6, 7, 8], 3)
+ * console.log(result) // [[1, 2, 3], [4, 5, 6], [7, 8]]
+ * ```
+ *
+ * @since 2.0.0
+ * @category splitting
+ */
+const split = exports.split = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ return chunksOf(input, Math.ceil(input.length / Math.floor(n)));
+});
+/**
+ * Splits this iterable on the first element that matches this predicate.
+ * Returns a tuple containing two arrays: the first one is before the match, and the second one is from the match onward.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.splitWhere([1, 2, 3, 4, 5], n => n > 3)
+ * console.log(result) // [[1, 2, 3], [4, 5]]
+ * ```
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+const splitWhere = exports.splitWhere = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => span(self, (a, i) => !predicate(a, i)));
+/**
+ * Copies an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.copy([1, 2, 3])
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const copy = self => self.slice();
+/**
+ * Pads an array.
+ * Returns a new array of length `n` with the elements of `array` followed by `fill` elements if `array` is shorter than `n`.
+ * If `array` is longer than `n`, the returned array will be a slice of `array` containing the `n` first elements of `array`.
+ * If `n` is less than or equal to 0, the returned array will be an empty array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.pad([1, 2, 3], 6, 0)
+ * console.log(result) // [1, 2, 3, 0, 0, 0]
+ * ```
+ *
+ * @since 3.8.4
+ */
+exports.copy = copy;
+const pad = exports.pad = /*#__PURE__*/(0, _Function.dual)(3, (self, n, fill) => {
+ if (self.length >= n) {
+ return take(self, n);
+ }
+ return appendAll(self, makeBy(n - self.length, () => fill));
+});
+/**
+ * Splits an `Iterable` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of
+ * the `Iterable`. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive
+ * definition of `chunksOf`; it satisfies the property that
+ *
+ * ```ts skip-type-checking
+ * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))
+ * ```
+ *
+ * whenever `n` evenly divides the length of `self`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.chunksOf([1, 2, 3, 4, 5], 2)
+ * console.log(result) // [[1, 2], [3, 4], [5]]
+ *
+ * // Explanation:
+ * // The `chunksOf` function takes an array of numbers `[1, 2, 3, 4, 5]` and a number `2`.
+ * // It splits the array into chunks of length 2. Since the array length is not evenly divisible by 2,
+ * // the last chunk contains the remaining elements.
+ * // The result is `[[1, 2], [3, 4], [5]]`.
+ * ```
+ *
+ * @category splitting
+ * @since 2.0.0
+ */
+const chunksOf = exports.chunksOf = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ return chop(input, splitNonEmptyAt(n));
+ }
+ return [];
+});
+/**
+ * Creates sliding windows of size `n` from an `Iterable`.
+ * If the number of elements is less than `n` or if `n` is not greater than zero,
+ * an empty array is returned.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { Array } from "effect"
+ *
+ * const numbers = [1, 2, 3, 4, 5]
+ * assert.deepStrictEqual(Array.window(numbers, 3), [[1, 2, 3], [2, 3, 4], [3, 4, 5]])
+ * assert.deepStrictEqual(Array.window(numbers, 6), [])
+ * ```
+ *
+ * @category splitting
+ * @since 3.13.2
+ */
+const window = exports.window = /*#__PURE__*/(0, _Function.dual)(2, (self, n) => {
+ const input = fromIterable(self);
+ if (n > 0 && isNonEmptyReadonlyArray(input)) {
+ return Array.from({
+ length: input.length - (n - 1)
+ }, (_, index) => input.slice(index, index + n));
+ }
+ return [];
+});
+/**
+ * Group equal, consecutive elements of a `NonEmptyReadonlyArray` into `NonEmptyArray`s using the provided `isEquivalent` function.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.groupWith(["a", "a", "b", "b", "b", "c", "a"], (x, y) => x === y)
+ * console.log(result) // [["a", "a"], ["b", "b", "b"], ["c"], ["a"]]
+ * ```
+ *
+ * @category grouping
+ * @since 2.0.0
+ */
+const groupWith = exports.groupWith = /*#__PURE__*/(0, _Function.dual)(2, (self, isEquivalent) => chop(self, as => {
+ const h = headNonEmpty(as);
+ const out = [h];
+ let i = 1;
+ for (; i < as.length; i++) {
+ const a = as[i];
+ if (isEquivalent(a, h)) {
+ out.push(a);
+ } else {
+ break;
+ }
+ }
+ return [out, as.slice(i)];
+}));
+/**
+ * Group equal, consecutive elements of a `NonEmptyReadonlyArray` into `NonEmptyArray`s.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.group([1, 1, 2, 2, 2, 3, 1])
+ * console.log(result) // [[1, 1], [2, 2, 2], [3], [1]]
+ * ```
+ *
+ * @category grouping
+ * @since 2.0.0
+ */
+const group = exports.group = /*#__PURE__*/groupWith(/*#__PURE__*/Equal.equivalence());
+/**
+ * Splits an `Iterable` into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning
+ * function on each element, and grouping the results according to values returned
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const people = [
+ * { name: "Alice", group: "A" },
+ * { name: "Bob", group: "B" },
+ * { name: "Charlie", group: "A" }
+ * ]
+ *
+ * const result = Array.groupBy(people, person => person.group)
+ * console.log(result)
+ * // {
+ * // A: [{ name: "Alice", group: "A" }, { name: "Charlie", group: "A" }],
+ * // B: [{ name: "Bob", group: "B" }]
+ * // }
+ * ```
+ *
+ * @category grouping
+ * @since 2.0.0
+ */
+const groupBy = exports.groupBy = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ const out = {};
+ for (const a of self) {
+ const k = f(a);
+ if (Object.prototype.hasOwnProperty.call(out, k)) {
+ out[k].push(a);
+ } else {
+ out[k] = [a];
+ }
+ }
+ return out;
+});
+/**
+ * Calculates the union of two arrays using the provided equivalence relation.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const union = Array.unionWith([1, 2], [2, 3], (a, b) => a === b)
+ * console.log(union) // [1, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const unionWith = exports.unionWith = /*#__PURE__*/(0, _Function.dual)(3, (self, that, isEquivalent) => {
+ const a = fromIterable(self);
+ const b = fromIterable(that);
+ if (isNonEmptyReadonlyArray(a)) {
+ if (isNonEmptyReadonlyArray(b)) {
+ const dedupe = dedupeWith(isEquivalent);
+ return dedupe(appendAll(a, b));
+ }
+ return a;
+ }
+ return b;
+});
+/**
+ * Creates a union of two arrays, removing duplicates.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.union([1, 2], [2, 3])
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const union = exports.union = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => unionWith(self, that, _equivalence));
+/**
+ * Creates an `Array` of unique values that are included in all given `Iterable`s using the provided `isEquivalent` function.
+ * The order and references of result values are determined by the first `Iterable`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]
+ * const array2 = [{ id: 3 }, { id: 4 }, { id: 1 }]
+ * const isEquivalent = (a: { id: number }, b: { id: number }) => a.id === b.id
+ * const result = Array.intersectionWith(isEquivalent)(array2)(array1)
+ * console.log(result) // [{ id: 1 }, { id: 3 }]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const intersectionWith = isEquivalent => {
+ const has = containsWith(isEquivalent);
+ return (0, _Function.dual)(2, (self, that) => {
+ const bs = fromIterable(that);
+ return fromIterable(self).filter(a => has(bs, a));
+ });
+};
+/**
+ * Creates an `Array` of unique values that are included in all given `Iterable`s.
+ * The order and references of result values are determined by the first `Iterable`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.intersection([1, 2, 3], [3, 4, 1])
+ * console.log(result) // [1, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+exports.intersectionWith = intersectionWith;
+const intersection = exports.intersection = /*#__PURE__*/intersectionWith(_equivalence);
+/**
+ * Creates a `Array` of values not included in the other given `Iterable` using the provided `isEquivalent` function.
+ * The order and references of result values are determined by the first `Iterable`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const array1 = [1, 2, 3]
+ * const array2 = [2, 3, 4]
+ * const difference = Array.differenceWith((a, b) => a === b)(array1, array2)
+ * console.log(difference) // [1]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const differenceWith = isEquivalent => {
+ const has = containsWith(isEquivalent);
+ return (0, _Function.dual)(2, (self, that) => {
+ const bs = fromIterable(that);
+ return fromIterable(self).filter(a => !has(bs, a));
+ });
+};
+/**
+ * Creates a `Array` of values not included in the other given `Iterable`.
+ * The order and references of result values are determined by the first `Iterable`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const difference = Array.difference([1, 2, 3], [2, 3, 4])
+ * console.log(difference) // [1]
+ * ```
+ *
+ * @since 2.0.0
+ */
+exports.differenceWith = differenceWith;
+const difference = exports.difference = /*#__PURE__*/differenceWith(_equivalence);
+/**
+ * @category constructors
+ * @since 2.0.0
+ */
+const empty = () => [];
+/**
+ * Constructs a new `NonEmptyArray` from the specified value.
+ *
+ * @category constructors
+ * @since 2.0.0
+ */
+exports.empty = empty;
+const of = a => [a];
+/**
+ * @category mapping
+ * @since 2.0.0
+ */
+exports.of = of;
+const map = exports.map = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => self.map(f));
+/**
+ * Applies a function to each element in an array and returns a new array containing the concatenated mapped elements.
+ *
+ * @category sequencing
+ * @since 2.0.0
+ */
+const flatMap = exports.flatMap = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ if (isEmptyReadonlyArray(self)) {
+ return [];
+ }
+ const out = [];
+ for (let i = 0; i < self.length; i++) {
+ const inner = f(self[i], i);
+ for (let j = 0; j < inner.length; j++) {
+ out.push(inner[j]);
+ }
+ }
+ return out;
+});
+/**
+ * Combines multiple arrays into a single array by concatenating all elements
+ * from each nested array. This function ensures that the structure of nested
+ * arrays is collapsed into a single, flat array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.flatten([[1, 2], [], [3, 4], [], [5, 6]])
+ * console.log(result) // [1, 2, 3, 4, 5, 6]
+ * ```
+ *
+ * @category sequencing
+ * @since 2.0.0
+ */
+const flatten = exports.flatten = /*#__PURE__*/flatMap(_Function.identity);
+/**
+ * Applies a function to each element of the `Iterable` and filters based on the result, keeping the transformed values where the function returns `Some`.
+ * This method combines filtering and mapping functionalities, allowing transformations and filtering of elements based on a single function pass.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Option } from "effect"
+ *
+ * const evenSquares = (x: number) => x % 2 === 0 ? Option.some(x * x) : Option.none()
+ *
+ * const result = Array.filterMap([1, 2, 3, 4, 5], evenSquares);
+ * console.log(result) // [4, 16]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const filterMap = exports.filterMap = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ const as = fromIterable(self);
+ const out = [];
+ for (let i = 0; i < as.length; i++) {
+ const o = f(as[i], i);
+ if (Option.isSome(o)) {
+ out.push(o.value);
+ }
+ }
+ return out;
+});
+/**
+ * Applies a function to each element of the array and filters based on the result, stopping when a condition is not met.
+ * This method combines filtering and mapping in a single pass, and short-circuits, i.e., stops processing, as soon as the function returns `None`.
+ * This is useful when you need to transform an array but only up to the point where a certain condition holds true.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Option } from "effect"
+ *
+ * const toSquareTillOdd = (x: number) => x % 2 === 0 ? Option.some(x * x) : Option.none()
+ *
+ * const result = Array.filterMapWhile([2, 4, 5], toSquareTillOdd)
+ * console.log(result) // [4, 16]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const filterMapWhile = exports.filterMapWhile = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ let i = 0;
+ const out = [];
+ for (const a of self) {
+ const b = f(a, i);
+ if (Option.isSome(b)) {
+ out.push(b.value);
+ } else {
+ break;
+ }
+ i++;
+ }
+ return out;
+});
+/**
+ * Applies a function to each element of the `Iterable`, categorizing the results into two separate arrays.
+ * This function is particularly useful for operations where each element can result in two possible types,
+ * and you want to separate these types into different collections. For instance, separating validation results
+ * into successes and failures.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Either } from "effect";
+ *
+ * const isEven = (x: number) => x % 2 === 0
+ *
+ * const result = Array.partitionMap([1, 2, 3, 4, 5], x =>
+ * isEven(x) ? Either.right(x) : Either.left(x)
+ * )
+ * console.log(result)
+ * // [
+ * // [1, 3, 5],
+ * // [2, 4]
+ * // ]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const partitionMap = exports.partitionMap = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => {
+ const left = [];
+ const right = [];
+ const as = fromIterable(self);
+ for (let i = 0; i < as.length; i++) {
+ const e = f(as[i], i);
+ if (Either.isLeft(e)) {
+ left.push(e.left);
+ } else {
+ right.push(e.right);
+ }
+ }
+ return [left, right];
+});
+/**
+ * Retrieves the `Some` values from an `Iterable` of `Option`s, collecting them into an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Option } from "effect"
+ *
+ * const result = Array.getSomes([Option.some(1), Option.none(), Option.some(2)])
+ * console.log(result) // [1, 2]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const getSomes = exports.getSomes = /*#__PURE__*/filterMap(_Function.identity);
+/**
+ * Retrieves the `Left` values from an `Iterable` of `Either`s, collecting them into an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Either } from "effect"
+ *
+ * const result = Array.getLefts([Either.right(1), Either.left("err"), Either.right(2)])
+ * console.log(result) // ["err"]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const getLefts = self => {
+ const out = [];
+ for (const a of self) {
+ if (Either.isLeft(a)) {
+ out.push(a.left);
+ }
+ }
+ return out;
+};
+/**
+ * Retrieves the `Right` values from an `Iterable` of `Either`s, collecting them into an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Either } from "effect"
+ *
+ * const result = Array.getRights([Either.right(1), Either.left("err"), Either.right(2)])
+ * console.log(result) // [1, 2]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+exports.getLefts = getLefts;
+const getRights = self => {
+ const out = [];
+ for (const a of self) {
+ if (Either.isRight(a)) {
+ out.push(a.right);
+ }
+ }
+ return out;
+};
+/**
+ * @category filtering
+ * @since 2.0.0
+ */
+exports.getRights = getRights;
+const filter = exports.filter = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => {
+ const as = fromIterable(self);
+ const out = [];
+ for (let i = 0; i < as.length; i++) {
+ if (predicate(as[i], i)) {
+ out.push(as[i]);
+ }
+ }
+ return out;
+});
+/**
+ * Separate elements based on a predicate that also exposes the index of the element.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.partition([1, 2, 3, 4], n => n % 2 === 0)
+ * console.log(result) // [[1, 3], [2, 4]]
+ * ```
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const partition = exports.partition = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => {
+ const left = [];
+ const right = [];
+ const as = fromIterable(self);
+ for (let i = 0; i < as.length; i++) {
+ if (predicate(as[i], i)) {
+ right.push(as[i]);
+ } else {
+ left.push(as[i]);
+ }
+ }
+ return [left, right];
+});
+/**
+ * Separates an `Iterable` into two arrays based on a predicate.
+ *
+ * @category filtering
+ * @since 2.0.0
+ */
+const separate = exports.separate = /*#__PURE__*/partitionMap(_Function.identity);
+/**
+ * Reduces an array from the left.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.reduce([1, 2, 3], 0, (acc, n) => acc + n)
+ * console.log(result) // 6
+ * ```
+ *
+ * @category folding
+ * @since 2.0.0
+ */
+const reduce = exports.reduce = /*#__PURE__*/(0, _Function.dual)(3, (self, b, f) => fromIterable(self).reduce((b, a, i) => f(b, a, i), b));
+/**
+ * Reduces an array from the right.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.reduceRight([1, 2, 3], 0, (acc, n) => acc + n)
+ * console.log(result) // 6
+ * ```
+ *
+ * @category folding
+ * @since 2.0.0
+ */
+const reduceRight = exports.reduceRight = /*#__PURE__*/(0, _Function.dual)(3, (self, b, f) => fromIterable(self).reduceRight((b, a, i) => f(b, a, i), b));
+/**
+ * Lifts a predicate into an array.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const isEven = (n: number) => n % 2 === 0
+ * const to = Array.liftPredicate(isEven)
+ * console.log(to(1)) // []
+ * console.log(to(2)) // [2]
+ * ```
+ *
+ * @category lifting
+ * @since 2.0.0
+ */
+const liftPredicate = predicate => b => predicate(b) ? [b] : [];
+/**
+ * @category lifting
+ * @since 2.0.0
+ */
+exports.liftPredicate = liftPredicate;
+const liftOption = f => (...a) => fromOption(f(...a));
+/**
+ * @category conversions
+ * @since 2.0.0
+ */
+exports.liftOption = liftOption;
+const fromNullable = a => a == null ? empty() : [a];
+/**
+ * @category lifting
+ * @since 2.0.0
+ */
+exports.fromNullable = fromNullable;
+const liftNullable = f => (...a) => fromNullable(f(...a));
+/**
+ * Maps over an array and flattens the result, removing null and undefined values.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.flatMapNullable([1, 2, 3], n => (n % 2 === 0 ? null : n))
+ * console.log(result) // [1, 3]
+ *
+ * // Explanation:
+ * // The array of numbers [1, 2, 3] is mapped with a function that returns null for even numbers
+ * // and the number itself for odd numbers. The resulting array [1, null, 3] is then flattened
+ * // to remove null values, resulting in [1, 3].
+ * ```
+ *
+ * @category sequencing
+ * @since 2.0.0
+ */
+exports.liftNullable = liftNullable;
+const flatMapNullable = exports.flatMapNullable = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => flatMap(self, a => fromNullable(f(a))));
+/**
+ * Lifts a function that returns an `Either` into a function that returns an array.
+ * If the `Either` is a left, it returns an empty array.
+ * If the `Either` is a right, it returns an array with the right value.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Either } from "effect"
+ *
+ * const parseNumber = (s: string): Either.Either =>
+ * isNaN(Number(s)) ? Either.left(new Error("Not a number")) : Either.right(Number(s))
+ *
+ * const liftedParseNumber = Array.liftEither(parseNumber)
+ *
+ * const result1 = liftedParseNumber("42")
+ * console.log(result1) // [42]
+ *
+ * const result2 = liftedParseNumber("not a number")
+ * console.log(result2) // []
+ *
+ * // Explanation:
+ * // The function parseNumber is lifted to return an array.
+ * // When parsing "42", it returns an Either.left with the number 42, resulting in [42].
+ * // When parsing "not a number", it returns an Either.right with an error, resulting in an empty array [].
+ * ```
+ *
+ * @category lifting
+ * @since 2.0.0
+ */
+const liftEither = f => (...a) => {
+ const e = f(...a);
+ return Either.isLeft(e) ? [] : [e.right];
+};
+/**
+ * Check if a predicate holds true for every `ReadonlyArray` element.
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+exports.liftEither = liftEither;
+const every = exports.every = /*#__PURE__*/(0, _Function.dual)(2, (self, refinement) => self.every(refinement));
+/**
+ * Check if a predicate holds true for some `ReadonlyArray` element.
+ *
+ * @category elements
+ * @since 2.0.0
+ */
+const some = exports.some = /*#__PURE__*/(0, _Function.dual)(2, (self, predicate) => self.some(predicate));
+/**
+ * Extends an array with a function that maps each subarray to a value.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.extend([1, 2, 3], as => as.length)
+ * console.log(result) // [3, 2, 1]
+ *
+ * // Explanation:
+ * // The function maps each subarray starting from each element to its length.
+ * // The subarrays are: [1, 2, 3], [2, 3], [3].
+ * // The lengths are: 3, 2, 1.
+ * // Therefore, the result is [3, 2, 1].
+ * ```
+ *
+ * @since 2.0.0
+ */
+const extend = exports.extend = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => self.map((_, i, as) => f(as.slice(i))));
+/**
+ * Finds the minimum element in an array based on a comparator.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Order } from "effect"
+ *
+ * const result = Array.min([3, 1, 2], Order.number)
+ * console.log(result) // 1
+ * ```
+ *
+ * @since 2.0.0
+ */
+const min = exports.min = /*#__PURE__*/(0, _Function.dual)(2, (self, O) => self.reduce(Order.min(O)));
+/**
+ * Finds the maximum element in an array based on a comparator.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, Order } from "effect"
+ *
+ * const result = Array.max([3, 1, 2], Order.number)
+ * console.log(result) // 3
+ * ```
+ *
+ * @since 2.0.0
+ */
+const max = exports.max = /*#__PURE__*/(0, _Function.dual)(2, (self, O) => self.reduce(Order.max(O)));
+/**
+ * @category constructors
+ * @since 2.0.0
+ */
+const unfold = (b, f) => {
+ const out = [];
+ let next = b;
+ let o;
+ while (Option.isSome(o = f(next))) {
+ const [a, b] = o.value;
+ out.push(a);
+ next = b;
+ }
+ return out;
+};
+/**
+ * This function creates and returns a new `Order` for an array of values based on a given `Order` for the elements of the array.
+ * The returned `Order` compares two arrays by applying the given `Order` to each element in the arrays.
+ * If all elements are equal, the arrays are then compared based on their length.
+ * It is useful when you need to compare two arrays of the same type and you have a specific way of comparing each element of the array.
+ *
+ * @category instances
+ * @since 2.0.0
+ */
+exports.unfold = unfold;
+const getOrder = exports.getOrder = Order.array;
+/**
+ * Creates an equivalence relation for arrays.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const eq = Array.getEquivalence((a, b) => a === b)
+ * console.log(eq([1, 2, 3], [1, 2, 3])) // true
+ * ```
+ *
+ * @category instances
+ * @since 2.0.0
+ */
+const getEquivalence = exports.getEquivalence = Equivalence.array;
+/**
+ * Performs a side-effect for each element of the `Iterable`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * Array.forEach([1, 2, 3], n => console.log(n)) // 1, 2, 3
+ * ```
+ *
+ * @since 2.0.0
+ */
+const forEach = exports.forEach = /*#__PURE__*/(0, _Function.dual)(2, (self, f) => fromIterable(self).forEach((a, i) => f(a, i)));
+/**
+ * Remove duplicates from an `Iterable` using the provided `isEquivalent` function,
+ * preserving the order of the first occurrence of each element.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.dedupeWith([1, 2, 2, 3, 3, 3], (a, b) => a === b)
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const dedupeWith = exports.dedupeWith = /*#__PURE__*/(0, _Function.dual)(2, (self, isEquivalent) => {
+ const input = fromIterable(self);
+ if (isNonEmptyReadonlyArray(input)) {
+ const out = [headNonEmpty(input)];
+ const rest = tailNonEmpty(input);
+ for (const r of rest) {
+ if (out.every(a => !isEquivalent(r, a))) {
+ out.push(r);
+ }
+ }
+ return out;
+ }
+ return [];
+});
+/**
+ * Remove duplicates from an `Iterable`, preserving the order of the first occurrence of each element.
+ * The equivalence used to compare elements is provided by `Equal.equivalence()` from the `Equal` module.
+ *
+ * @since 2.0.0
+ */
+const dedupe = self => dedupeWith(self, Equal.equivalence());
+/**
+ * Deduplicates adjacent elements that are identical using the provided `isEquivalent` function.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.dedupeAdjacentWith([1, 1, 2, 2, 3, 3], (a, b) => a === b)
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+exports.dedupe = dedupe;
+const dedupeAdjacentWith = exports.dedupeAdjacentWith = /*#__PURE__*/(0, _Function.dual)(2, (self, isEquivalent) => {
+ const out = [];
+ let lastA = Option.none();
+ for (const a of self) {
+ if (Option.isNone(lastA) || !isEquivalent(a, lastA.value)) {
+ out.push(a);
+ lastA = Option.some(a);
+ }
+ }
+ return out;
+});
+/**
+ * Deduplicates adjacent elements that are identical.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.dedupeAdjacent([1, 1, 2, 2, 3, 3])
+ * console.log(result) // [1, 2, 3]
+ * ```
+ *
+ * @since 2.0.0
+ */
+const dedupeAdjacent = exports.dedupeAdjacent = /*#__PURE__*/dedupeAdjacentWith(/*#__PURE__*/Equal.equivalence());
+/**
+ * Joins the elements together with "sep" in the middle.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const strings = ["a", "b", "c"]
+ * const joined = Array.join(strings, "-")
+ * console.log(joined) // "a-b-c"
+ * ```
+ *
+ * @since 2.0.0
+ * @category folding
+ */
+const join = exports.join = /*#__PURE__*/(0, _Function.dual)(2, (self, sep) => fromIterable(self).join(sep));
+/**
+ * Statefully maps over the chunk, producing new elements of type `B`.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.mapAccum([1, 2, 3], 0, (acc, n) => [acc + n, acc + n])
+ * console.log(result) // [6, [1, 3, 6]]
+ * ```
+ *
+ * @since 2.0.0
+ * @category folding
+ */
+const mapAccum = exports.mapAccum = /*#__PURE__*/(0, _Function.dual)(3, (self, s, f) => {
+ let i = 0;
+ let s1 = s;
+ const out = [];
+ for (const a of self) {
+ const r = f(s1, a, i);
+ s1 = r[0];
+ out.push(r[1]);
+ i++;
+ }
+ return [s1, out];
+});
+/**
+ * Zips this chunk crosswise with the specified chunk using the specified combiner.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.cartesianWith([1, 2], ["a", "b"], (a, b) => `${a}-${b}`)
+ * console.log(result) // ["1-a", "1-b", "2-a", "2-b"]
+ * ```
+ *
+ * @since 2.0.0
+ * @category elements
+ */
+const cartesianWith = exports.cartesianWith = /*#__PURE__*/(0, _Function.dual)(3, (self, that, f) => flatMap(self, a => map(that, b => f(a, b))));
+/**
+ * Zips this chunk crosswise with the specified chunk.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array } from "effect"
+ *
+ * const result = Array.cartesian([1, 2], ["a", "b"])
+ * console.log(result) // [[1, "a"], [1, "b"], [2, "a"], [2, "b"]]
+ * ```
+ *
+ * @since 2.0.0
+ * @category elements
+ */
+const cartesian = exports.cartesian = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => cartesianWith(self, that, (a, b) => [a, b]));
+// -------------------------------------------------------------------------------------
+// do notation
+// -------------------------------------------------------------------------------------
+/**
+ * The "do simulation" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.
+ *
+ * It can be used to simulate "array comprehension".
+ * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.
+ *
+ * Here's how the do simulation works:
+ *
+ * 1. Start the do simulation using the `Do` value
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
+ * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, pipe } from "effect"
+ *
+ * const doResult = pipe(
+ * Array.Do,
+ * Array.bind("x", () => [1, 3, 5]),
+ * Array.bind("y", () => [2, 4, 6]),
+ * Array.filter(({ x, y }) => x < y), // condition
+ * Array.map(({ x, y }) => [x, y] as const) // transformation
+ * )
+ * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]
+ *
+ * // equivalent
+ * const x = [1, 3, 5],
+ * y = [2, 4, 6],
+ * result = [];
+ * for(let i = 0; i < x.length; i++) {
+ * for(let j = 0; j < y.length; j++) {
+ * const _x = x[i], _y = y[j];
+ * if(_x < _y) result.push([_x, _y] as const)
+ * }
+ * }
+ * ```
+ *
+ * @see {@link bindTo}
+ * @see {@link bind}
+ * @see {@link let_ let}
+ *
+ * @category do notation
+ * @since 3.2.0
+ */
+const Do = exports.Do = /*#__PURE__*/of({});
+/**
+ * The "do simulation" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.
+ *
+ * It can be used to simulate "array comprehension".
+ * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.
+ *
+ * Here's how the do simulation works:
+ *
+ * 1. Start the do simulation using the `Do` value
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
+ * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, pipe } from "effect"
+ *
+ * const doResult = pipe(
+ * Array.Do,
+ * Array.bind("x", () => [1, 3, 5]),
+ * Array.bind("y", () => [2, 4, 6]),
+ * Array.filter(({ x, y }) => x < y), // condition
+ * Array.map(({ x, y }) => [x, y] as const) // transformation
+ * )
+ * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]
+ *
+ * // equivalent
+ * const x = [1, 3, 5],
+ * y = [2, 4, 6],
+ * result = [];
+ * for(let i = 0; i < x.length; i++) {
+ * for(let j = 0; j < y.length; j++) {
+ * const _x = x[i], _y = y[j];
+ * if(_x < _y) result.push([_x, _y] as const)
+ * }
+ * }
+ * ```
+ *
+ * @see {@link bindTo}
+ * @see {@link Do}
+ * @see {@link let_ let}
+ *
+ * @category do notation
+ * @since 3.2.0
+ */
+const bind = exports.bind = /*#__PURE__*/internalDoNotation.bind(map, flatMap);
+/**
+ * The "do simulation" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.
+ *
+ * It can be used to simulate "array comprehension".
+ * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.
+ *
+ * Here's how the do simulation works:
+ *
+ * 1. Start the do simulation using the `Do` value
+ * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values
+ * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope
+ * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values
+ * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope
+ *
+ * **Example**
+ *
+ * ```ts
+ * import { Array, pipe } from "effect"
+ *
+ * const doResult = pipe(
+ * Array.Do,
+ * Array.bind("x", () => [1, 3, 5]),
+ * Array.bind("y", () => [2, 4, 6]),
+ * Array.filter(({ x, y }) => x < y), // condition
+ * Array.map(({ x, y }) => [x, y] as const) // transformation
+ * )
+ * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]
+ *
+ * // equivalent
+ * const x = [1, 3, 5],
+ * y = [2, 4, 6],
+ * result = [];
+ * for(let i = 0; i < x.length; i++) {
+ * for(let j = 0; j < y.length; j++) {
+ * const _x = x[i], _y = y[j];
+ * if(_x < _y) result.push([_x, _y] as const)
+ * }
+ * }
+ * ```
+ *
+ * @see {@link bindTo}
+ * @see {@link Do}
+ * @see {@link let_ let}
+ *
+ * @category do notation
+ * @since 3.2.0
+ */
+const bindTo = exports.bindTo = /*#__PURE__*/internalDoNotation.bindTo(map);
+const let_ = exports.let = /*#__PURE__*/internalDoNotation.let_(map);
+//# sourceMappingURL=Array.js.map
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/BigDecimal.js b/backend/node_modules/effect/dist/cjs/BigDecimal.js
new file mode 100644
index 0000000000000000000000000000000000000000..d6e0d8b3f7a8d0d34e8c22a91695a9f688773d63
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/BigDecimal.js
@@ -0,0 +1,1116 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.unsafeToNumber = exports.unsafeRemainder = exports.unsafeMakeNormalized = exports.unsafeFromString = exports.unsafeFromNumber = exports.unsafeDivide = exports.truncate = exports.toExponential = exports.sumAll = exports.sum = exports.subtract = exports.sign = exports.scale = exports.safeFromNumber = exports.roundTerminal = exports.round = exports.remainder = exports.normalize = exports.negate = exports.multiply = exports.min = exports.max = exports.make = exports.lessThanOrEqualTo = exports.lessThan = exports.isZero = exports.isPositive = exports.isNegative = exports.isInteger = exports.isBigDecimal = exports.greaterThanOrEqualTo = exports.greaterThan = exports.fromString = exports.fromNumber = exports.fromBigInt = exports.format = exports.floor = exports.equals = exports.divide = exports.digitAt = exports.clamp = exports.ceil = exports.between = exports.abs = exports.TypeId = exports.Order = exports.Equivalence = void 0;
+var Equal = _interopRequireWildcard(require("./Equal.js"));
+var equivalence = _interopRequireWildcard(require("./Equivalence.js"));
+var _Function = require("./Function.js");
+var Hash = _interopRequireWildcard(require("./Hash.js"));
+var _Inspectable = require("./Inspectable.js");
+var Option = _interopRequireWildcard(require("./Option.js"));
+var order = _interopRequireWildcard(require("./Order.js"));
+var _Pipeable = require("./Pipeable.js");
+var _Predicate = require("./Predicate.js");
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * This module provides utility functions and type class instances for working with the `BigDecimal` type in TypeScript.
+ * It includes functions for basic arithmetic operations, as well as type class instances for `Equivalence` and `Order`.
+ *
+ * A `BigDecimal` allows storing any real number to arbitrary precision; which avoids common floating point errors
+ * (such as 0.1 + 0.2 ≠ 0.3) at the cost of complexity.
+ *
+ * Internally, `BigDecimal` uses a `BigInt` object, paired with a 64-bit integer which determines the position of the
+ * decimal point. Therefore, the precision *is not* actually arbitrary, but limited to 263 decimal places.
+ *
+ * It is not recommended to convert a floating point number to a decimal directly, as the floating point representation
+ * may be unexpected.
+ *
+ * @module BigDecimal
+ * @since 2.0.0
+ * @see {@link module:BigInt} for more similar operations on `bigint` types
+ * @see {@link module:Number} for more similar operations on `number` types
+ */
+
+const DEFAULT_PRECISION = 100;
+const FINITE_INT_REGEX = /^[+-]?\d+$/;
+/**
+ * @since 2.0.0
+ * @category symbols
+ */
+const TypeId = exports.TypeId = /*#__PURE__*/Symbol.for("effect/BigDecimal");
+const BigDecimalProto = {
+ [TypeId]: TypeId,
+ [Hash.symbol]() {
+ const normalized = normalize(this);
+ return (0, _Function.pipe)(Hash.hash(normalized.value), Hash.combine(Hash.number(normalized.scale)), Hash.cached(this));
+ },
+ [Equal.symbol](that) {
+ return isBigDecimal(that) && equals(this, that);
+ },
+ toString() {
+ return `BigDecimal(${format(this)})`;
+ },
+ toJSON() {
+ return {
+ _id: "BigDecimal",
+ value: String(this.value),
+ scale: this.scale
+ };
+ },
+ [_Inspectable.NodeInspectSymbol]() {
+ return this.toJSON();
+ },
+ pipe() {
+ return (0, _Pipeable.pipeArguments)(this, arguments);
+ }
+};
+/**
+ * Checks if a given value is a `BigDecimal`.
+ *
+ * @since 2.0.0
+ * @category guards
+ */
+const isBigDecimal = u => (0, _Predicate.hasProperty)(u, TypeId);
+/**
+ * Creates a `BigDecimal` from a `bigint` value and a scale.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+exports.isBigDecimal = isBigDecimal;
+const make = (value, scale) => {
+ const o = Object.create(BigDecimalProto);
+ o.value = value;
+ o.scale = scale;
+ return o;
+};
+/**
+ * Internal function used to create pre-normalized `BigDecimal`s.
+ *
+ * @internal
+ */
+exports.make = make;
+const unsafeMakeNormalized = (value, scale) => {
+ if (value !== bigint0 && value % bigint10 === bigint0) {
+ throw new RangeError("Value must be normalized");
+ }
+ const o = make(value, scale);
+ o.normalized = o;
+ return o;
+};
+exports.unsafeMakeNormalized = unsafeMakeNormalized;
+const bigint0 = /*#__PURE__*/BigInt(0);
+const bigint1 = /*#__PURE__*/BigInt(1);
+const bigint10 = /*#__PURE__*/BigInt(10);
+const zero = /*#__PURE__*/unsafeMakeNormalized(bigint0, 0);
+/**
+ * Normalizes a given `BigDecimal` by removing trailing zeros.
+ *
+ * **Example**
+ *
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { normalize, make, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(normalize(unsafeFromString("123.00000")), normalize(make(123n, 0)))
+ * assert.deepStrictEqual(normalize(unsafeFromString("12300000")), normalize(make(123n, -5)))
+ * ```
+ *
+ * @since 2.0.0
+ * @category scaling
+ */
+const normalize = self => {
+ if (self.normalized === undefined) {
+ if (self.value === bigint0) {
+ self.normalized = zero;
+ } else {
+ const digits = `${self.value}`;
+ let trail = 0;
+ for (let i = digits.length - 1; i >= 0; i--) {
+ if (digits[i] === "0") {
+ trail++;
+ } else {
+ break;
+ }
+ }
+ if (trail === 0) {
+ self.normalized = self;
+ }
+ const value = BigInt(digits.substring(0, digits.length - trail));
+ const scale = self.scale - trail;
+ self.normalized = unsafeMakeNormalized(value, scale);
+ }
+ }
+ return self.normalized;
+};
+/**
+ * Scales a given `BigDecimal` to the specified scale.
+ *
+ * If the given scale is smaller than the current scale, the value will be rounded down to
+ * the nearest integer.
+ *
+ * @since 2.0.0
+ * @category scaling
+ */
+exports.normalize = normalize;
+const scale = exports.scale = /*#__PURE__*/(0, _Function.dual)(2, (self, scale) => {
+ if (scale > self.scale) {
+ return make(self.value * bigint10 ** BigInt(scale - self.scale), scale);
+ }
+ if (scale < self.scale) {
+ return make(self.value / bigint10 ** BigInt(self.scale - scale), scale);
+ }
+ return self;
+});
+/**
+ * Provides an addition operation on `BigDecimal`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { sum, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(sum(unsafeFromString("2"), unsafeFromString("3")), unsafeFromString("5"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const sum = exports.sum = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => {
+ if (that.value === bigint0) {
+ return self;
+ }
+ if (self.value === bigint0) {
+ return that;
+ }
+ if (self.scale > that.scale) {
+ return make(scale(that, self.scale).value + self.value, self.scale);
+ }
+ if (self.scale < that.scale) {
+ return make(scale(self, that.scale).value + that.value, that.scale);
+ }
+ return make(self.value + that.value, self.scale);
+});
+/**
+ * Provides a multiplication operation on `BigDecimal`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { multiply, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(multiply(unsafeFromString("2"), unsafeFromString("3")), unsafeFromString("6"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const multiply = exports.multiply = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => {
+ if (that.value === bigint0 || self.value === bigint0) {
+ return zero;
+ }
+ return make(self.value * that.value, self.scale + that.scale);
+});
+/**
+ * Provides a subtraction operation on `BigDecimal`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { subtract, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(subtract(unsafeFromString("2"), unsafeFromString("3")), unsafeFromString("-1"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const subtract = exports.subtract = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => {
+ if (that.value === bigint0) {
+ return self;
+ }
+ if (self.value === bigint0) {
+ return make(-that.value, that.scale);
+ }
+ if (self.scale > that.scale) {
+ return make(self.value - scale(that, self.scale).value, self.scale);
+ }
+ if (self.scale < that.scale) {
+ return make(scale(self, that.scale).value - that.value, that.scale);
+ }
+ return make(self.value - that.value, self.scale);
+});
+/**
+ * Internal function used for arbitrary precision division.
+ */
+const divideWithPrecision = (num, den, scale, precision) => {
+ const numNegative = num < bigint0;
+ const denNegative = den < bigint0;
+ const negateResult = numNegative !== denNegative;
+ num = numNegative ? -num : num;
+ den = denNegative ? -den : den;
+ // Shift digits until numerator is larger than denominator (set scale appropriately).
+ while (num < den) {
+ num *= bigint10;
+ scale++;
+ }
+ // First division.
+ let quotient = num / den;
+ let remainder = num % den;
+ if (remainder === bigint0) {
+ // No remainder, return immediately.
+ return make(negateResult ? -quotient : quotient, scale);
+ }
+ // The quotient is guaranteed to be non-negative at this point. No need to consider sign.
+ let count = `${quotient}`.length;
+ // Shift the remainder by 1 decimal; The quotient will be 1 digit upon next division.
+ remainder *= bigint10;
+ while (remainder !== bigint0 && count < precision) {
+ const q = remainder / den;
+ const r = remainder % den;
+ quotient = quotient * bigint10 + q;
+ remainder = r * bigint10;
+ count++;
+ scale++;
+ }
+ if (remainder !== bigint0) {
+ // Round final number with remainder.
+ quotient += roundTerminal(remainder / den);
+ }
+ return make(negateResult ? -quotient : quotient, scale);
+};
+/**
+ * Internal function used for rounding.
+ *
+ * Returns 1 if the most significant digit is >= 5, otherwise 0.
+ *
+ * This is used after dividing a number by a power of ten and rounding the last digit.
+ *
+ * @internal
+ */
+const roundTerminal = n => {
+ const pos = n >= bigint0 ? 0 : 1;
+ return Number(`${n}`[pos]) < 5 ? bigint0 : bigint1;
+};
+/**
+ * Provides a division operation on `BigDecimal`s.
+ *
+ * If the dividend is not a multiple of the divisor the result will be a `BigDecimal` value
+ * which represents the integer division rounded down to the nearest integer.
+ *
+ * If the divisor is `0`, the result will be `None`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigDecimal, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BigDecimal.divide(BigDecimal.unsafeFromString("6"), BigDecimal.unsafeFromString("3")), Option.some(BigDecimal.unsafeFromString("2")))
+ * assert.deepStrictEqual(BigDecimal.divide(BigDecimal.unsafeFromString("6"), BigDecimal.unsafeFromString("4")), Option.some(BigDecimal.unsafeFromString("1.5")))
+ * assert.deepStrictEqual(BigDecimal.divide(BigDecimal.unsafeFromString("6"), BigDecimal.unsafeFromString("0")), Option.none())
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+exports.roundTerminal = roundTerminal;
+const divide = exports.divide = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => {
+ if (that.value === bigint0) {
+ return Option.none();
+ }
+ if (self.value === bigint0) {
+ return Option.some(zero);
+ }
+ const scale = self.scale - that.scale;
+ if (self.value === that.value) {
+ return Option.some(make(bigint1, scale));
+ }
+ return Option.some(divideWithPrecision(self.value, that.value, scale, DEFAULT_PRECISION));
+});
+/**
+ * Provides an unsafe division operation on `BigDecimal`s.
+ *
+ * If the dividend is not a multiple of the divisor the result will be a `BigDecimal` value
+ * which represents the integer division rounded down to the nearest integer.
+ *
+ * Throws a `RangeError` if the divisor is `0`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeDivide, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(unsafeDivide(unsafeFromString("6"), unsafeFromString("3")), unsafeFromString("2"))
+ * assert.deepStrictEqual(unsafeDivide(unsafeFromString("6"), unsafeFromString("4")), unsafeFromString("1.5"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const unsafeDivide = exports.unsafeDivide = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => {
+ if (that.value === bigint0) {
+ throw new RangeError("Division by zero");
+ }
+ if (self.value === bigint0) {
+ return zero;
+ }
+ const scale = self.scale - that.scale;
+ if (self.value === that.value) {
+ return make(bigint1, scale);
+ }
+ return divideWithPrecision(self.value, that.value, scale, DEFAULT_PRECISION);
+});
+/**
+ * @since 2.0.0
+ * @category instances
+ */
+const Order = exports.Order = /*#__PURE__*/order.make((self, that) => {
+ const scmp = order.number(sign(self), sign(that));
+ if (scmp !== 0) {
+ return scmp;
+ }
+ if (self.scale > that.scale) {
+ return order.bigint(self.value, scale(that, self.scale).value);
+ }
+ if (self.scale < that.scale) {
+ return order.bigint(scale(self, that.scale).value, that.value);
+ }
+ return order.bigint(self.value, that.value);
+});
+/**
+ * Returns `true` if the first argument is less than the second, otherwise `false`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { lessThan, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(lessThan(unsafeFromString("2"), unsafeFromString("3")), true)
+ * assert.deepStrictEqual(lessThan(unsafeFromString("3"), unsafeFromString("3")), false)
+ * assert.deepStrictEqual(lessThan(unsafeFromString("4"), unsafeFromString("3")), false)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+const lessThan = exports.lessThan = /*#__PURE__*/order.lessThan(Order);
+/**
+ * Checks if a given `BigDecimal` is less than or equal to the provided one.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { lessThanOrEqualTo, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(lessThanOrEqualTo(unsafeFromString("2"), unsafeFromString("3")), true)
+ * assert.deepStrictEqual(lessThanOrEqualTo(unsafeFromString("3"), unsafeFromString("3")), true)
+ * assert.deepStrictEqual(lessThanOrEqualTo(unsafeFromString("4"), unsafeFromString("3")), false)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+const lessThanOrEqualTo = exports.lessThanOrEqualTo = /*#__PURE__*/order.lessThanOrEqualTo(Order);
+/**
+ * Returns `true` if the first argument is greater than the second, otherwise `false`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { greaterThan, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(greaterThan(unsafeFromString("2"), unsafeFromString("3")), false)
+ * assert.deepStrictEqual(greaterThan(unsafeFromString("3"), unsafeFromString("3")), false)
+ * assert.deepStrictEqual(greaterThan(unsafeFromString("4"), unsafeFromString("3")), true)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+const greaterThan = exports.greaterThan = /*#__PURE__*/order.greaterThan(Order);
+/**
+ * Checks if a given `BigDecimal` is greater than or equal to the provided one.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { greaterThanOrEqualTo, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(greaterThanOrEqualTo(unsafeFromString("2"), unsafeFromString("3")), false)
+ * assert.deepStrictEqual(greaterThanOrEqualTo(unsafeFromString("3"), unsafeFromString("3")), true)
+ * assert.deepStrictEqual(greaterThanOrEqualTo(unsafeFromString("4"), unsafeFromString("3")), true)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+const greaterThanOrEqualTo = exports.greaterThanOrEqualTo = /*#__PURE__*/order.greaterThanOrEqualTo(Order);
+/**
+ * Checks if a `BigDecimal` is between a `minimum` and `maximum` value (inclusive).
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigDecimal } from "effect"
+ *
+ * const between = BigDecimal.between({
+ * minimum: BigDecimal.unsafeFromString("1"),
+ * maximum: BigDecimal.unsafeFromString("5") }
+ * )
+ *
+ * assert.deepStrictEqual(between(BigDecimal.unsafeFromString("3")), true)
+ * assert.deepStrictEqual(between(BigDecimal.unsafeFromString("0")), false)
+ * assert.deepStrictEqual(between(BigDecimal.unsafeFromString("6")), false)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+const between = exports.between = /*#__PURE__*/order.between(Order);
+/**
+ * Restricts the given `BigDecimal` to be within the range specified by the `minimum` and `maximum` values.
+ *
+ * - If the `BigDecimal` is less than the `minimum` value, the function returns the `minimum` value.
+ * - If the `BigDecimal` is greater than the `maximum` value, the function returns the `maximum` value.
+ * - Otherwise, it returns the original `BigDecimal`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigDecimal } from "effect"
+ *
+ * const clamp = BigDecimal.clamp({
+ * minimum: BigDecimal.unsafeFromString("1"),
+ * maximum: BigDecimal.unsafeFromString("5") }
+ * )
+ *
+ * assert.deepStrictEqual(clamp(BigDecimal.unsafeFromString("3")), BigDecimal.unsafeFromString("3"))
+ * assert.deepStrictEqual(clamp(BigDecimal.unsafeFromString("0")), BigDecimal.unsafeFromString("1"))
+ * assert.deepStrictEqual(clamp(BigDecimal.unsafeFromString("6")), BigDecimal.unsafeFromString("5"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const clamp = exports.clamp = /*#__PURE__*/order.clamp(Order);
+/**
+ * Returns the minimum between two `BigDecimal`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { min, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(min(unsafeFromString("2"), unsafeFromString("3")), unsafeFromString("2"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const min = exports.min = /*#__PURE__*/order.min(Order);
+/**
+ * Returns the maximum between two `BigDecimal`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { max, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(max(unsafeFromString("2"), unsafeFromString("3")), unsafeFromString("3"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const max = exports.max = /*#__PURE__*/order.max(Order);
+/**
+ * Determines the sign of a given `BigDecimal`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { sign, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(sign(unsafeFromString("-5")), -1)
+ * assert.deepStrictEqual(sign(unsafeFromString("0")), 0)
+ * assert.deepStrictEqual(sign(unsafeFromString("5")), 1)
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const sign = n => n.value === bigint0 ? 0 : n.value < bigint0 ? -1 : 1;
+/**
+ * Determines the absolute value of a given `BigDecimal`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { abs, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(abs(unsafeFromString("-5")), unsafeFromString("5"))
+ * assert.deepStrictEqual(abs(unsafeFromString("0")), unsafeFromString("0"))
+ * assert.deepStrictEqual(abs(unsafeFromString("5")), unsafeFromString("5"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+exports.sign = sign;
+const abs = n => n.value < bigint0 ? make(-n.value, n.scale) : n;
+/**
+ * Provides a negate operation on `BigDecimal`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { negate, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(negate(unsafeFromString("3")), unsafeFromString("-3"))
+ * assert.deepStrictEqual(negate(unsafeFromString("-6")), unsafeFromString("6"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+exports.abs = abs;
+const negate = n => make(-n.value, n.scale);
+/**
+ * Returns the remainder left over when one operand is divided by a second operand.
+ *
+ * If the divisor is `0`, the result will be `None`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigDecimal, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BigDecimal.remainder(BigDecimal.unsafeFromString("2"), BigDecimal.unsafeFromString("2")), Option.some(BigDecimal.unsafeFromString("0")))
+ * assert.deepStrictEqual(BigDecimal.remainder(BigDecimal.unsafeFromString("3"), BigDecimal.unsafeFromString("2")), Option.some(BigDecimal.unsafeFromString("1")))
+ * assert.deepStrictEqual(BigDecimal.remainder(BigDecimal.unsafeFromString("-4"), BigDecimal.unsafeFromString("2")), Option.some(BigDecimal.unsafeFromString("0")))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+exports.negate = negate;
+const remainder = exports.remainder = /*#__PURE__*/(0, _Function.dual)(2, (self, divisor) => {
+ if (divisor.value === bigint0) {
+ return Option.none();
+ }
+ const max = Math.max(self.scale, divisor.scale);
+ return Option.some(make(scale(self, max).value % scale(divisor, max).value, max));
+});
+/**
+ * Returns the remainder left over when one operand is divided by a second operand.
+ *
+ * Throws a `RangeError` if the divisor is `0`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeRemainder, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(unsafeRemainder(unsafeFromString("2"), unsafeFromString("2")), unsafeFromString("0"))
+ * assert.deepStrictEqual(unsafeRemainder(unsafeFromString("3"), unsafeFromString("2")), unsafeFromString("1"))
+ * assert.deepStrictEqual(unsafeRemainder(unsafeFromString("-4"), unsafeFromString("2")), unsafeFromString("0"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category math
+ */
+const unsafeRemainder = exports.unsafeRemainder = /*#__PURE__*/(0, _Function.dual)(2, (self, divisor) => {
+ if (divisor.value === bigint0) {
+ throw new RangeError("Division by zero");
+ }
+ const max = Math.max(self.scale, divisor.scale);
+ return make(scale(self, max).value % scale(divisor, max).value, max);
+});
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+const Equivalence = exports.Equivalence = /*#__PURE__*/equivalence.make((self, that) => {
+ if (self.scale > that.scale) {
+ return scale(that, self.scale).value === self.value;
+ }
+ if (self.scale < that.scale) {
+ return scale(self, that.scale).value === that.value;
+ }
+ return self.value === that.value;
+});
+/**
+ * Checks if two `BigDecimal`s are equal.
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+const equals = exports.equals = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => Equivalence(self, that));
+/**
+ * Creates a `BigDecimal` from a `bigint` value.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+const fromBigInt = n => make(n, 0);
+/**
+ * Creates a `BigDecimal` from a `number` value.
+ *
+ * It is not recommended to convert a floating point number to a decimal directly,
+ * as the floating point representation may be unexpected.
+ *
+ * Throws a `RangeError` if the number is not finite (`NaN`, `+Infinity` or `-Infinity`).
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeFromNumber, make } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(unsafeFromNumber(123), make(123n, 0))
+ * assert.deepStrictEqual(unsafeFromNumber(123.456), make(123456n, 3))
+ * ```
+ *
+ * @since 3.11.0
+ * @category constructors
+ */
+exports.fromBigInt = fromBigInt;
+const unsafeFromNumber = n => Option.getOrThrowWith(safeFromNumber(n), () => new RangeError(`Number must be finite, got ${n}`));
+/**
+ * Creates a `BigDecimal` from a `number` value.
+ *
+ * It is not recommended to convert a floating point number to a decimal directly,
+ * as the floating point representation may be unexpected.
+ *
+ * Throws a `RangeError` if the number is not finite (`NaN`, `+Infinity` or `-Infinity`).
+ *
+ * @since 2.0.0
+ * @category constructors
+ * @deprecated Use {@link unsafeFromNumber} instead.
+ */
+exports.unsafeFromNumber = unsafeFromNumber;
+const fromNumber = exports.fromNumber = unsafeFromNumber;
+// TODO(4.0): Rename this to `fromNumber` after removing the current, unsafe implementation of `fromNumber`.
+/**
+ * Creates a `BigDecimal` from a `number` value.
+ *
+ * It is not recommended to convert a floating point number to a decimal directly,
+ * as the floating point representation may be unexpected.
+ *
+ * Returns `None` if the number is not finite (`NaN`, `+Infinity` or `-Infinity`).
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigDecimal, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BigDecimal.safeFromNumber(123), Option.some(BigDecimal.make(123n, 0)))
+ * assert.deepStrictEqual(BigDecimal.safeFromNumber(123.456), Option.some(BigDecimal.make(123456n, 3)))
+ * assert.deepStrictEqual(BigDecimal.safeFromNumber(Infinity), Option.none())
+ * ```
+ *
+ * @since 3.11.0
+ * @category constructors
+ */
+const safeFromNumber = n => {
+ if (!Number.isFinite(n)) {
+ return Option.none();
+ }
+ const string = `${n}`;
+ if (string.includes("e")) {
+ return fromString(string);
+ }
+ const [lead, trail = ""] = string.split(".");
+ return Option.some(make(BigInt(`${lead}${trail}`), trail.length));
+};
+/**
+ * Parses a numerical `string` into a `BigDecimal`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigDecimal, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BigDecimal.fromString("123"), Option.some(BigDecimal.make(123n, 0)))
+ * assert.deepStrictEqual(BigDecimal.fromString("123.456"), Option.some(BigDecimal.make(123456n, 3)))
+ * assert.deepStrictEqual(BigDecimal.fromString("123.abc"), Option.none())
+ * ```
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+exports.safeFromNumber = safeFromNumber;
+const fromString = s => {
+ if (s === "") {
+ return Option.some(zero);
+ }
+ let base;
+ let exp;
+ const seperator = s.search(/[eE]/);
+ if (seperator !== -1) {
+ const trail = s.slice(seperator + 1);
+ base = s.slice(0, seperator);
+ exp = Number(trail);
+ if (base === "" || !Number.isSafeInteger(exp) || !FINITE_INT_REGEX.test(trail)) {
+ return Option.none();
+ }
+ } else {
+ base = s;
+ exp = 0;
+ }
+ let digits;
+ let offset;
+ const dot = base.search(/\./);
+ if (dot !== -1) {
+ const lead = base.slice(0, dot);
+ const trail = base.slice(dot + 1);
+ digits = `${lead}${trail}`;
+ offset = trail.length;
+ } else {
+ digits = base;
+ offset = 0;
+ }
+ if (!FINITE_INT_REGEX.test(digits)) {
+ return Option.none();
+ }
+ const scale = offset - exp;
+ if (!Number.isSafeInteger(scale)) {
+ return Option.none();
+ }
+ return Option.some(make(BigInt(digits), scale));
+};
+/**
+ * Parses a numerical `string` into a `BigDecimal`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeFromString, make } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(unsafeFromString("123"), make(123n, 0))
+ * assert.deepStrictEqual(unsafeFromString("123.456"), make(123456n, 3))
+ * assert.throws(() => unsafeFromString("123.abc"))
+ * ```
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+exports.fromString = fromString;
+const unsafeFromString = s => Option.getOrThrowWith(fromString(s), () => new Error("Invalid numerical string"));
+/**
+ * Formats a given `BigDecimal` as a `string`.
+ *
+ * If the scale of the `BigDecimal` is greater than or equal to 16, the `BigDecimal` will
+ * be formatted in scientific notation.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { format, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(format(unsafeFromString("-5")), "-5")
+ * assert.deepStrictEqual(format(unsafeFromString("123.456")), "123.456")
+ * assert.deepStrictEqual(format(unsafeFromString("-0.00000123")), "-0.00000123")
+ * ```
+ *
+ * @since 2.0.0
+ * @category conversions
+ */
+exports.unsafeFromString = unsafeFromString;
+const format = n => {
+ const normalized = normalize(n);
+ if (Math.abs(normalized.scale) >= 16) {
+ return toExponential(normalized);
+ }
+ const negative = normalized.value < bigint0;
+ const absolute = negative ? `${normalized.value}`.substring(1) : `${normalized.value}`;
+ let before;
+ let after;
+ if (normalized.scale >= absolute.length) {
+ before = "0";
+ after = "0".repeat(normalized.scale - absolute.length) + absolute;
+ } else {
+ const location = absolute.length - normalized.scale;
+ if (location > absolute.length) {
+ const zeros = location - absolute.length;
+ before = `${absolute}${"0".repeat(zeros)}`;
+ after = "";
+ } else {
+ after = absolute.slice(location);
+ before = absolute.slice(0, location);
+ }
+ }
+ const complete = after === "" ? before : `${before}.${after}`;
+ return negative ? `-${complete}` : complete;
+};
+/**
+ * Formats a given `BigDecimal` as a `string` in scientific notation.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { toExponential, make } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(toExponential(make(123456n, -5)), "1.23456e+10")
+ * ```
+ *
+ * @since 3.11.0
+ * @category conversions
+ */
+exports.format = format;
+const toExponential = n => {
+ if (isZero(n)) {
+ return "0e+0";
+ }
+ const normalized = normalize(n);
+ const digits = `${abs(normalized).value}`;
+ const head = digits.slice(0, 1);
+ const tail = digits.slice(1);
+ let output = `${isNegative(normalized) ? "-" : ""}${head}`;
+ if (tail !== "") {
+ output += `.${tail}`;
+ }
+ const exp = tail.length - normalized.scale;
+ return `${output}e${exp >= 0 ? "+" : ""}${exp}`;
+};
+/**
+ * Converts a `BigDecimal` to a `number`.
+ *
+ * This function will produce incorrect results if the `BigDecimal` exceeds the 64-bit range of a `number`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeToNumber, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(unsafeToNumber(unsafeFromString("123.456")), 123.456)
+ * ```
+ *
+ * @since 2.0.0
+ * @category conversions
+ */
+exports.toExponential = toExponential;
+const unsafeToNumber = n => Number(format(n));
+/**
+ * Checks if a given `BigDecimal` is an integer.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { isInteger, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(isInteger(unsafeFromString("0")), true)
+ * assert.deepStrictEqual(isInteger(unsafeFromString("1")), true)
+ * assert.deepStrictEqual(isInteger(unsafeFromString("1.1")), false)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+exports.unsafeToNumber = unsafeToNumber;
+const isInteger = n => normalize(n).scale <= 0;
+/**
+ * Checks if a given `BigDecimal` is `0`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { isZero, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(isZero(unsafeFromString("0")), true)
+ * assert.deepStrictEqual(isZero(unsafeFromString("1")), false)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+exports.isInteger = isInteger;
+const isZero = n => n.value === bigint0;
+/**
+ * Checks if a given `BigDecimal` is negative.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { isNegative, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(isNegative(unsafeFromString("-1")), true)
+ * assert.deepStrictEqual(isNegative(unsafeFromString("0")), false)
+ * assert.deepStrictEqual(isNegative(unsafeFromString("1")), false)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+exports.isZero = isZero;
+const isNegative = n => n.value < bigint0;
+/**
+ * Checks if a given `BigDecimal` is positive.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { isPositive, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(isPositive(unsafeFromString("-1")), false)
+ * assert.deepStrictEqual(isPositive(unsafeFromString("0")), false)
+ * assert.deepStrictEqual(isPositive(unsafeFromString("1")), true)
+ * ```
+ *
+ * @since 2.0.0
+ * @category predicates
+ */
+exports.isNegative = isNegative;
+const isPositive = n => n.value > bigint0;
+exports.isPositive = isPositive;
+const isBigDecimalArgs = args => isBigDecimal(args[0]);
+/**
+ * Calculate the ceiling of a `BigDecimal` at the given scale.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { ceil, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(ceil(unsafeFromString("145"), -1), unsafeFromString("150"))
+ * assert.deepStrictEqual(ceil(unsafeFromString("-14.5")), unsafeFromString("-14"))
+ * ```
+ *
+ * @since 3.16.0
+ * @category math
+ */
+const ceil = exports.ceil = /*#__PURE__*/(0, _Function.dual)(isBigDecimalArgs, (self, scale = 0) => {
+ const truncated = truncate(self, scale);
+ if (isPositive(self) && lessThan(truncated, self)) {
+ return sum(truncated, make(1n, scale));
+ }
+ return truncated;
+});
+/**
+ * Calculate the floor of a `BigDecimal` at the given scale.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { floor, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(floor(unsafeFromString("145"), -1), unsafeFromString("140"))
+ * assert.deepStrictEqual(floor(unsafeFromString("-14.5")), unsafeFromString("-15"))
+ * ```
+ *
+ * @since 3.16.0
+ * @category math
+ */
+const floor = exports.floor = /*#__PURE__*/(0, _Function.dual)(isBigDecimalArgs, (self, scale = 0) => {
+ const truncated = truncate(self, scale);
+ if (isNegative(self) && greaterThan(truncated, self)) {
+ return sum(truncated, make(-1n, scale));
+ }
+ return truncated;
+});
+/**
+ * Truncate a `BigDecimal` at the given scale. This is the same operation as rounding away from zero.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { truncate, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(truncate(unsafeFromString("145"), -1), unsafeFromString("140"))
+ * assert.deepStrictEqual(truncate(unsafeFromString("-14.5")), unsafeFromString("-14"))
+ * ```
+ *
+ * @since 3.16.0
+ * @category math
+ */
+const truncate = exports.truncate = /*#__PURE__*/(0, _Function.dual)(isBigDecimalArgs, (self, scale = 0) => {
+ if (self.scale <= scale) {
+ return self;
+ }
+ // BigInt division truncates towards zero
+ return make(self.value / 10n ** BigInt(self.scale - scale), scale);
+});
+/**
+ * Internal function used by `round` for `half-even` and `half-odd` rounding modes.
+ *
+ * Returns the digit at the position of the given `scale` within the `BigDecimal`.
+ *
+ * @internal
+ */
+const digitAt = exports.digitAt = /*#__PURE__*/(0, _Function.dual)(2, (self, scale) => {
+ if (self.scale < scale) {
+ return 0n;
+ }
+ const scaled = self.value / 10n ** BigInt(self.scale - scale);
+ return scaled % 10n;
+});
+/**
+ * Rounds a `BigDecimal` at the given scale with the specified rounding mode.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { round, unsafeFromString } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(round(unsafeFromString("145"), { mode: "from-zero", scale: -1 }), unsafeFromString("150"))
+ * assert.deepStrictEqual(round(unsafeFromString("-14.5")), unsafeFromString("-15"))
+ * ```
+ *
+ * @since 3.16.0
+ * @category math
+ */
+const round = exports.round = /*#__PURE__*/(0, _Function.dual)(isBigDecimalArgs, (self, options) => {
+ const mode = options?.mode ?? "half-from-zero";
+ const scale = options?.scale ?? 0;
+ switch (mode) {
+ case "ceil":
+ return ceil(self, scale);
+ case "floor":
+ return floor(self, scale);
+ case "to-zero":
+ return truncate(self, scale);
+ case "from-zero":
+ return isPositive(self) ? ceil(self, scale) : floor(self, scale);
+ case "half-ceil":
+ return floor(sum(self, make(5n, scale + 1)), scale);
+ case "half-floor":
+ return ceil(sum(self, make(-5n, scale + 1)), scale);
+ case "half-to-zero":
+ return isNegative(self) ? floor(sum(self, make(5n, scale + 1)), scale) : ceil(sum(self, make(-5n, scale + 1)), scale);
+ case "half-from-zero":
+ return isNegative(self) ? ceil(sum(self, make(-5n, scale + 1)), scale) : floor(sum(self, make(5n, scale + 1)), scale);
+ }
+ const halfCeil = floor(sum(self, make(5n, scale + 1)), scale);
+ const halfFloor = ceil(sum(self, make(-5n, scale + 1)), scale);
+ const digit = digitAt(halfCeil, scale);
+ switch (mode) {
+ case "half-even":
+ return equals(halfCeil, halfFloor) ? halfCeil : digit % 2n === 0n ? halfCeil : halfFloor;
+ case "half-odd":
+ return equals(halfCeil, halfFloor) ? halfCeil : digit % 2n === 0n ? halfFloor : halfCeil;
+ }
+});
+/**
+ * Takes an `Iterable` of `BigDecimal`s and returns their sum as a single `BigDecimal`
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeFromString, sumAll } from "effect/BigDecimal"
+ *
+ * assert.deepStrictEqual(sumAll([unsafeFromString("2"), unsafeFromString("3"), unsafeFromString("4")]), unsafeFromString("9"))
+ * ```
+ *
+ * @category math
+ * @since 3.16.0
+ */
+const sumAll = collection => {
+ let out = zero;
+ for (const n of collection) {
+ out = sum(out, n);
+ }
+ return out;
+};
+exports.sumAll = sumAll;
+//# sourceMappingURL=BigDecimal.js.map
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/BigDecimal.js.map b/backend/node_modules/effect/dist/cjs/BigDecimal.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..db821eb28acd38a6562386eb97b37d01b3920447
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/BigDecimal.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"BigDecimal.js","names":["Equal","_interopRequireWildcard","require","equivalence","_Function","Hash","_Inspectable","Option","order","_Pipeable","_Predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_PRECISION","FINITE_INT_REGEX","TypeId","exports","Symbol","for","BigDecimalProto","symbol","normalized","normalize","pipe","hash","value","combine","number","scale","cached","that","isBigDecimal","equals","toString","format","toJSON","_id","String","NodeInspectSymbol","pipeArguments","arguments","u","hasProperty","make","create","unsafeMakeNormalized","bigint0","bigint10","RangeError","BigInt","bigint1","zero","self","undefined","digits","trail","length","substring","dual","sum","multiply","subtract","divideWithPrecision","num","den","precision","numNegative","denNegative","negateResult","quotient","remainder","count","q","roundTerminal","pos","Number","divide","none","some","unsafeDivide","Order","scmp","sign","bigint","lessThan","lessThanOrEqualTo","greaterThan","greaterThanOrEqualTo","between","clamp","min","max","abs","negate","divisor","Math","unsafeRemainder","Equivalence","fromBigInt","unsafeFromNumber","getOrThrowWith","safeFromNumber","fromNumber","isFinite","string","includes","fromString","lead","split","s","base","exp","seperator","search","slice","isSafeInteger","test","offset","dot","unsafeFromString","Error","toExponential","negative","absolute","before","after","repeat","location","zeros","complete","isZero","head","tail","output","isNegative","unsafeToNumber","isInteger","isPositive","isBigDecimalArgs","args","ceil","truncated","truncate","floor","digitAt","scaled","round","options","mode","halfCeil","halfFloor","digit","sumAll","collection","out"],"sources":["../../src/BigDecimal.ts"],"sourcesContent":[null],"mappings":";;;;;;AAmBA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,KAAA,GAAAP,uBAAA,CAAAC,OAAA;AAEA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAA4C,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAU,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,C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,IAAI,CAAC,CAAC,EAAE,EAAEf,KAAK,GAAG,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC;EAC9D,MAAM2H,KAAK,GAAGP,OAAO,CAACK,QAAQ,EAAEzH,KAAK,CAAC;EAEtC,QAAQwH,IAAI;IACV,KAAK,WAAW;MACd,OAAOpH,MAAM,CAACqH,QAAQ,EAAEC,SAAS,CAAC,GAAGD,QAAQ,GAAIE,KAAK,GAAG,EAAE,KAAK,EAAE,GAAIF,QAAQ,GAAGC,SAAS;IAE5F,KAAK,UAAU;MACb,OAAOtH,MAAM,CAACqH,QAAQ,EAAEC,SAAS,CAAC,GAAGD,QAAQ,GAAIE,KAAK,GAAG,EAAE,KAAK,EAAE,GAAID,SAAS,GAAGD,QAAQ;EAC9F;AACF,CAAC,CAAC;AAEF;;;;;;;;;;;;;;AAcO,MAAMG,MAAM,GAAIC,UAAgC,IAAgB;EACrE,IAAIC,GAAG,GAAGvG,IAAI;EACd,KAAK,MAAMrD,CAAC,IAAI2J,UAAU,EAAE;IAC1BC,GAAG,GAAG/F,GAAG,CAAC+F,GAAG,EAAE5J,CAAC,CAAC;EACnB;EAEA,OAAO4J,GAAG;AACZ,CAAC;AAAA1I,OAAA,CAAAwI,MAAA,GAAAA,MAAA","ignoreList":[]}
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/BigInt.js b/backend/node_modules/effect/dist/cjs/BigInt.js
new file mode 100644
index 0000000000000000000000000000000000000000..d32b5dffaa9c61da9fc8704f3b45f6221dd582e4
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/BigInt.js
@@ -0,0 +1,567 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.unsafeSqrt = exports.unsafeDivide = exports.toNumber = exports.sumAll = exports.sum = exports.subtract = exports.sqrt = exports.sign = exports.multiplyAll = exports.multiply = exports.min = exports.max = exports.lessThanOrEqualTo = exports.lessThan = exports.lcm = exports.isBigInt = exports.increment = exports.greaterThanOrEqualTo = exports.greaterThan = exports.gcd = exports.fromString = exports.fromNumber = exports.divide = exports.decrement = exports.clamp = exports.between = exports.abs = exports.Order = exports.Equivalence = void 0;
+var equivalence = _interopRequireWildcard(require("./Equivalence.js"));
+var _Function = require("./Function.js");
+var Option = _interopRequireWildcard(require("./Option.js"));
+var order = _interopRequireWildcard(require("./Order.js"));
+var predicate = _interopRequireWildcard(require("./Predicate.js"));
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * This module provides utility functions and type class instances for working with the `bigint` type in TypeScript.
+ * It includes functions for basic arithmetic operations, as well as type class instances for
+ * `Equivalence` and `Order`.
+ *
+ * @module BigInt
+ * @since 2.0.0
+ * @see {@link module:BigDecimal} for more similar operations on `BigDecimal` types
+ * @see {@link module:Number} for more similar operations on `number` types
+ */
+
+const bigint0 = /*#__PURE__*/BigInt(0);
+const bigint1 = /*#__PURE__*/BigInt(1);
+const bigint2 = /*#__PURE__*/BigInt(2);
+/**
+ * Tests if a value is a `bigint`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { isBigInt } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(isBigInt(1n), true)
+ * assert.deepStrictEqual(isBigInt(1), false)
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+const isBigInt = exports.isBigInt = predicate.isBigInt;
+/**
+ * Provides an addition operation on `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { sum } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(sum(2n, 3n), 5n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const sum = exports.sum = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self + that);
+/**
+ * Provides a multiplication operation on `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { multiply } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(multiply(2n, 3n), 6n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const multiply = exports.multiply = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self * that);
+/**
+ * Provides a subtraction operation on `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { subtract } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(subtract(2n, 3n), -1n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const subtract = exports.subtract = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self - that);
+/**
+ * Provides a division operation on `bigint`s.
+ *
+ * If the dividend is not a multiple of the divisor the result will be a `bigint` value
+ * which represents the integer division rounded down to the nearest integer.
+ *
+ * Returns `None` if the divisor is `0n`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BigInt.divide(6n, 3n), Option.some(2n))
+ * assert.deepStrictEqual(BigInt.divide(6n, 0n), Option.none())
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const divide = exports.divide = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => that === bigint0 ? Option.none() : Option.some(self / that));
+/**
+ * Provides a division operation on `bigint`s.
+ *
+ * If the dividend is not a multiple of the divisor the result will be a `bigint` value
+ * which represents the integer division rounded down to the nearest integer.
+ *
+ * Throws a `RangeError` if the divisor is `0n`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeDivide } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(unsafeDivide(6n, 3n), 2n)
+ * assert.deepStrictEqual(unsafeDivide(6n, 4n), 1n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const unsafeDivide = exports.unsafeDivide = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self / that);
+/**
+ * Returns the result of adding `1n` to a given number.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { increment } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(increment(2n), 3n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const increment = n => n + bigint1;
+/**
+ * Decrements a number by `1n`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { decrement } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(decrement(3n), 2n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+exports.increment = increment;
+const decrement = n => n - bigint1;
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+exports.decrement = decrement;
+const Equivalence = exports.Equivalence = equivalence.bigint;
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+const Order = exports.Order = order.bigint;
+/**
+ * Returns `true` if the first argument is less than the second, otherwise `false`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { lessThan } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(lessThan(2n, 3n), true)
+ * assert.deepStrictEqual(lessThan(3n, 3n), false)
+ * assert.deepStrictEqual(lessThan(4n, 3n), false)
+ * ```
+ *
+ * @category predicates
+ * @since 2.0.0
+ */
+const lessThan = exports.lessThan = /*#__PURE__*/order.lessThan(Order);
+/**
+ * Returns a function that checks if a given `bigint` is less than or equal to the provided one.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { lessThanOrEqualTo } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(lessThanOrEqualTo(2n, 3n), true)
+ * assert.deepStrictEqual(lessThanOrEqualTo(3n, 3n), true)
+ * assert.deepStrictEqual(lessThanOrEqualTo(4n, 3n), false)
+ * ```
+ *
+ * @category predicates
+ * @since 2.0.0
+ */
+const lessThanOrEqualTo = exports.lessThanOrEqualTo = /*#__PURE__*/order.lessThanOrEqualTo(Order);
+/**
+ * Returns `true` if the first argument is greater than the second, otherwise `false`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { greaterThan } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(greaterThan(2n, 3n), false)
+ * assert.deepStrictEqual(greaterThan(3n, 3n), false)
+ * assert.deepStrictEqual(greaterThan(4n, 3n), true)
+ * ```
+ *
+ * @category predicates
+ * @since 2.0.0
+ */
+const greaterThan = exports.greaterThan = /*#__PURE__*/order.greaterThan(Order);
+/**
+ * Returns a function that checks if a given `bigint` is greater than or equal to the provided one.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { greaterThanOrEqualTo } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(greaterThanOrEqualTo(2n, 3n), false)
+ * assert.deepStrictEqual(greaterThanOrEqualTo(3n, 3n), true)
+ * assert.deepStrictEqual(greaterThanOrEqualTo(4n, 3n), true)
+ * ```
+ *
+ * @category predicates
+ * @since 2.0.0
+ */
+const greaterThanOrEqualTo = exports.greaterThanOrEqualTo = /*#__PURE__*/order.greaterThanOrEqualTo(Order);
+/**
+ * Checks if a `bigint` is between a `minimum` and `maximum` value (inclusive).
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt } from "effect"
+ *
+ * const between = BigInt.between({ minimum: 0n, maximum: 5n })
+ *
+ * assert.deepStrictEqual(between(3n), true)
+ * assert.deepStrictEqual(between(-1n), false)
+ * assert.deepStrictEqual(between(6n), false)
+ * ```
+ *
+ * @category predicates
+ * @since 2.0.0
+ */
+const between = exports.between = /*#__PURE__*/order.between(Order);
+/**
+ * Restricts the given `bigint` to be within the range specified by the `minimum` and `maximum` values.
+ *
+ * - If the `bigint` is less than the `minimum` value, the function returns the `minimum` value.
+ * - If the `bigint` is greater than the `maximum` value, the function returns the `maximum` value.
+ * - Otherwise, it returns the original `bigint`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt } from "effect"
+ *
+ * const clamp = BigInt.clamp({ minimum: 1n, maximum: 5n })
+ *
+ * assert.equal(clamp(3n), 3n)
+ * assert.equal(clamp(0n), 1n)
+ * assert.equal(clamp(6n), 5n)
+ * ```
+ *
+ * @since 2.0.0
+ */
+const clamp = exports.clamp = /*#__PURE__*/order.clamp(Order);
+/**
+ * Returns the minimum between two `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { min } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(min(2n, 3n), 2n)
+ * ```
+ *
+ * @since 2.0.0
+ */
+const min = exports.min = /*#__PURE__*/order.min(Order);
+/**
+ * Returns the maximum between two `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { max } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(max(2n, 3n), 3n)
+ * ```
+ *
+ * @since 2.0.0
+ */
+const max = exports.max = /*#__PURE__*/order.max(Order);
+/**
+ * Determines the sign of a given `bigint`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { sign } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(sign(-5n), -1)
+ * assert.deepStrictEqual(sign(0n), 0)
+ * assert.deepStrictEqual(sign(5n), 1)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const sign = n => Order(n, bigint0);
+/**
+ * Determines the absolute value of a given `bigint`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { abs } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(abs(-5n), 5n)
+ * assert.deepStrictEqual(abs(0n), 0n)
+ * assert.deepStrictEqual(abs(5n), 5n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+exports.sign = sign;
+const abs = n => n < bigint0 ? -n : n;
+/**
+ * Determines the greatest common divisor of two `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { gcd } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(gcd(2n, 3n), 1n)
+ * assert.deepStrictEqual(gcd(2n, 4n), 2n)
+ * assert.deepStrictEqual(gcd(16n, 24n), 8n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+exports.abs = abs;
+const gcd = exports.gcd = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => {
+ while (that !== bigint0) {
+ const t = that;
+ that = self % that;
+ self = t;
+ }
+ return self;
+});
+/**
+ * Determines the least common multiple of two `bigint`s.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { lcm } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(lcm(2n, 3n), 6n)
+ * assert.deepStrictEqual(lcm(2n, 4n), 4n)
+ * assert.deepStrictEqual(lcm(16n, 24n), 48n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const lcm = exports.lcm = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self * that / gcd(self, that));
+/**
+ * Determines the square root of a given `bigint` unsafely. Throws if the given `bigint` is negative.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { unsafeSqrt } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(unsafeSqrt(4n), 2n)
+ * assert.deepStrictEqual(unsafeSqrt(9n), 3n)
+ * assert.deepStrictEqual(unsafeSqrt(16n), 4n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+const unsafeSqrt = n => {
+ if (n < bigint0) {
+ throw new RangeError("Cannot take the square root of a negative number");
+ }
+ if (n < bigint2) {
+ return n;
+ }
+ let x = n / bigint2;
+ while (x * x > n) {
+ x = (n / x + x) / bigint2;
+ }
+ return x;
+};
+/**
+ * Determines the square root of a given `bigint` safely. Returns `none` if the given `bigint` is negative.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BigInt.sqrt(4n), Option.some(2n))
+ * assert.deepStrictEqual(BigInt.sqrt(9n), Option.some(3n))
+ * assert.deepStrictEqual(BigInt.sqrt(16n), Option.some(4n))
+ * assert.deepStrictEqual(BigInt.sqrt(-1n), Option.none())
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+exports.unsafeSqrt = unsafeSqrt;
+const sqrt = n => greaterThanOrEqualTo(n, bigint0) ? Option.some(unsafeSqrt(n)) : Option.none();
+/**
+ * Takes an `Iterable` of `bigint`s and returns their sum as a single `bigint
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { sumAll } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(sumAll([2n, 3n, 4n]), 9n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+exports.sqrt = sqrt;
+const sumAll = collection => {
+ let out = bigint0;
+ for (const n of collection) {
+ out += n;
+ }
+ return out;
+};
+/**
+ * Takes an `Iterable` of `bigint`s and returns their multiplication as a single `number`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { multiplyAll } from "effect/BigInt"
+ *
+ * assert.deepStrictEqual(multiplyAll([2n, 3n, 4n]), 24n)
+ * ```
+ *
+ * @category math
+ * @since 2.0.0
+ */
+exports.sumAll = sumAll;
+const multiplyAll = collection => {
+ let out = bigint1;
+ for (const n of collection) {
+ if (n === bigint0) {
+ return bigint0;
+ }
+ out *= n;
+ }
+ return out;
+};
+/**
+ * Takes a `bigint` and returns an `Option` of `number`.
+ *
+ * If the `bigint` is outside the safe integer range for JavaScript (`Number.MAX_SAFE_INTEGER`
+ * and `Number.MIN_SAFE_INTEGER`), it returns `Option.none()`. Otherwise, it converts the `bigint`
+ * to a number and returns `Option.some(number)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt as BI, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BI.toNumber(BigInt(42)), Option.some(42))
+ * assert.deepStrictEqual(BI.toNumber(BigInt(Number.MAX_SAFE_INTEGER) + BigInt(1)), Option.none())
+ * assert.deepStrictEqual(BI.toNumber(BigInt(Number.MIN_SAFE_INTEGER) - BigInt(1)), Option.none())
+ * ```
+ *
+ * @category conversions
+ * @since 2.0.0
+ */
+exports.multiplyAll = multiplyAll;
+const toNumber = b => {
+ if (b > BigInt(Number.MAX_SAFE_INTEGER) || b < BigInt(Number.MIN_SAFE_INTEGER)) {
+ return Option.none();
+ }
+ return Option.some(Number(b));
+};
+/**
+ * Takes a string and returns an `Option` of `bigint`.
+ *
+ * If the string is empty or contains characters that cannot be converted into a `bigint`,
+ * it returns `Option.none()`, otherwise, it returns `Option.some(bigint)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt as BI, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BI.fromString("42"), Option.some(BigInt(42)))
+ * assert.deepStrictEqual(BI.fromString(" "), Option.none())
+ * assert.deepStrictEqual(BI.fromString("a"), Option.none())
+ * ```
+ *
+ * @category conversions
+ * @since 2.4.12
+ */
+exports.toNumber = toNumber;
+const fromString = s => {
+ try {
+ return s.trim() === "" ? Option.none() : Option.some(BigInt(s));
+ } catch {
+ return Option.none();
+ }
+};
+/**
+ * Takes a number and returns an `Option` of `bigint`.
+ *
+ * If the number is outside the safe integer range for JavaScript (`Number.MAX_SAFE_INTEGER`
+ * and `Number.MIN_SAFE_INTEGER`), it returns `Option.none()`. Otherwise, it attempts to
+ * convert the number to a `bigint` and returns `Option.some(bigint)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { BigInt as BI, Option } from "effect"
+ *
+ * assert.deepStrictEqual(BI.fromNumber(42), Option.some(BigInt(42)))
+ * assert.deepStrictEqual(BI.fromNumber(Number.MAX_SAFE_INTEGER + 1), Option.none())
+ * assert.deepStrictEqual(BI.fromNumber(Number.MIN_SAFE_INTEGER - 1), Option.none())
+ * ```
+ *
+ * @category conversions
+ * @since 2.4.12
+ */
+exports.fromString = fromString;
+const fromNumber = n => {
+ if (n > Number.MAX_SAFE_INTEGER || n < Number.MIN_SAFE_INTEGER) {
+ return Option.none();
+ }
+ try {
+ return Option.some(BigInt(n));
+ } catch {
+ return Option.none();
+ }
+};
+exports.fromNumber = fromNumber;
+//# sourceMappingURL=BigInt.js.map
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/BigInt.js.map b/backend/node_modules/effect/dist/cjs/BigInt.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..ea94d1234e46a401e31bee0b9e236a9266cbc18a
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/BigInt.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"BigInt.js","names":["equivalence","_interopRequireWildcard","require","_Function","Option","order","predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","bigint0","BigInt","bigint1","bigint2","isBigInt","exports","sum","dual","self","that","multiply","subtract","divide","none","some","unsafeDivide","increment","decrement","Equivalence","bigint","Order","lessThan","lessThanOrEqualTo","greaterThan","greaterThanOrEqualTo","between","clamp","min","max","sign","abs","gcd","lcm","unsafeSqrt","RangeError","x","sqrt","sumAll","collection","out","multiplyAll","toNumber","b","Number","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","fromString","s","trim","fromNumber"],"sources":["../../src/BigInt.ts"],"sourcesContent":[null],"mappings":";;;;;;AAWA,IAAAA,WAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAEA,IAAAI,SAAA,GAAAL,uBAAA,CAAAC,OAAA;AAA2C,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAA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AAC,CAACC,IAAI,EAAE,KAAK,EAAE,GAClBtE,MAAM,CAACmC,IAAI,EAAE,GACbnC,MAAM,CAACoC,IAAI,CAACb,MAAM,CAAC8C,CAAC,CAAC,CAAC;EAC5B,CAAC,CAAC,MAAM;IACN,OAAOrE,MAAM,CAACmC,IAAI,EAAE;EACtB;AACF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;AAAAR,OAAA,CAAAyC,UAAA,GAAAA,UAAA;AAoBO,MAAMG,UAAU,GAAIhE,CAAS,IAA2B;EAC7D,IAAIA,CAAC,GAAG0D,MAAM,CAACC,gBAAgB,IAAI3D,CAAC,GAAG0D,MAAM,CAACE,gBAAgB,EAAE;IAC9D,OAAOnE,MAAM,CAACmC,IAAI,EAAE;EACtB;EAEA,IAAI;IACF,OAAOnC,MAAM,CAACoC,IAAI,CAACb,MAAM,CAAChB,CAAC,CAAC,CAAC;EAC/B,CAAC,CAAC,MAAM;IACN,OAAOP,MAAM,CAACmC,IAAI,EAAE;EACtB;AACF,CAAC;AAAAR,OAAA,CAAA4C,UAAA,GAAAA,UAAA","ignoreList":[]}
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Boolean.js b/backend/node_modules/effect/dist/cjs/Boolean.js
new file mode 100644
index 0000000000000000000000000000000000000000..2fe5ba260a8c2e5fd28d915c398b460b74703d55
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Boolean.js
@@ -0,0 +1,251 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.xor = exports.some = exports.or = exports.not = exports.nor = exports.nand = exports.match = exports.isBoolean = exports.implies = exports.every = exports.eqv = exports.and = exports.Order = exports.Equivalence = void 0;
+var equivalence = _interopRequireWildcard(require("./Equivalence.js"));
+var _Function = require("./Function.js");
+var order = _interopRequireWildcard(require("./Order.js"));
+var predicate = _interopRequireWildcard(require("./Predicate.js"));
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * This module provides utility functions and type class instances for working with the `boolean` type in TypeScript.
+ * It includes functions for basic boolean operations, as well as type class instances for
+ * `Equivalence` and `Order`.
+ *
+ * @since 2.0.0
+ */
+
+/**
+ * Tests if a value is a `boolean`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { isBoolean } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(isBoolean(true), true)
+ * assert.deepStrictEqual(isBoolean("true"), false)
+ * ```
+ *
+ * @category guards
+ * @since 2.0.0
+ */
+const isBoolean = exports.isBoolean = predicate.isBoolean;
+/**
+ * This function returns the result of either of the given functions depending on the value of the boolean parameter.
+ * It is useful when you have to run one of two functions depending on the boolean value.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { Boolean } from "effect"
+ *
+ * assert.deepStrictEqual(Boolean.match(true, { onFalse: () => "It's false!", onTrue: () => "It's true!" }), "It's true!")
+ * ```
+ *
+ * @category pattern matching
+ * @since 2.0.0
+ */
+const match = exports.match = /*#__PURE__*/(0, _Function.dual)(2, (value, options) => value ? options.onTrue() : options.onFalse());
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+const Equivalence = exports.Equivalence = equivalence.boolean;
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+const Order = exports.Order = order.boolean;
+/**
+ * Negates the given boolean: `!self`
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { not } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(not(true), false)
+ * assert.deepStrictEqual(not(false), true)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const not = self => !self;
+/**
+ * Combines two boolean using AND: `self && that`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { and } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(and(true, true), true)
+ * assert.deepStrictEqual(and(true, false), false)
+ * assert.deepStrictEqual(and(false, true), false)
+ * assert.deepStrictEqual(and(false, false), false)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+exports.not = not;
+const and = exports.and = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self && that);
+/**
+ * Combines two boolean using NAND: `!(self && that)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { nand } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(nand(true, true), false)
+ * assert.deepStrictEqual(nand(true, false), true)
+ * assert.deepStrictEqual(nand(false, true), true)
+ * assert.deepStrictEqual(nand(false, false), true)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const nand = exports.nand = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => !(self && that));
+/**
+ * Combines two boolean using OR: `self || that`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { or } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(or(true, true), true)
+ * assert.deepStrictEqual(or(true, false), true)
+ * assert.deepStrictEqual(or(false, true), true)
+ * assert.deepStrictEqual(or(false, false), false)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const or = exports.or = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self || that);
+/**
+ * Combines two booleans using NOR: `!(self || that)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { nor } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(nor(true, true), false)
+ * assert.deepStrictEqual(nor(true, false), false)
+ * assert.deepStrictEqual(nor(false, true), false)
+ * assert.deepStrictEqual(nor(false, false), true)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const nor = exports.nor = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => !(self || that));
+/**
+ * Combines two booleans using XOR: `(!self && that) || (self && !that)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { xor } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(xor(true, true), false)
+ * assert.deepStrictEqual(xor(true, false), true)
+ * assert.deepStrictEqual(xor(false, true), true)
+ * assert.deepStrictEqual(xor(false, false), false)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const xor = exports.xor = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => !self && that || self && !that);
+/**
+ * Combines two booleans using EQV (aka XNOR): `!xor(self, that)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { eqv } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(eqv(true, true), true)
+ * assert.deepStrictEqual(eqv(true, false), false)
+ * assert.deepStrictEqual(eqv(false, true), false)
+ * assert.deepStrictEqual(eqv(false, false), true)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const eqv = exports.eqv = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => !xor(self, that));
+/**
+ * Combines two booleans using an implication: `(!self || that)`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { implies } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(implies(true, true), true)
+ * assert.deepStrictEqual(implies(true, false), false)
+ * assert.deepStrictEqual(implies(false, true), true)
+ * assert.deepStrictEqual(implies(false, false), true)
+ * ```
+ *
+ * @category combinators
+ * @since 2.0.0
+ */
+const implies = exports.implies = /*#__PURE__*/(0, _Function.dual)(2, (self, that) => self ? that : true);
+/**
+ * This utility function is used to check if all the elements in a collection of boolean values are `true`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { every } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(every([true, true, true]), true)
+ * assert.deepStrictEqual(every([true, false, true]), false)
+ * ```
+ *
+ * @since 2.0.0
+ */
+const every = collection => {
+ for (const b of collection) {
+ if (!b) {
+ return false;
+ }
+ }
+ return true;
+};
+/**
+ * This utility function is used to check if at least one of the elements in a collection of boolean values is `true`.
+ *
+ * @example
+ * ```ts
+ * import * as assert from "node:assert"
+ * import { some } from "effect/Boolean"
+ *
+ * assert.deepStrictEqual(some([true, false, true]), true)
+ * assert.deepStrictEqual(some([false, false, false]), false)
+ * ```
+ *
+ * @since 2.0.0
+ */
+exports.every = every;
+const some = collection => {
+ for (const b of collection) {
+ if (b) {
+ return true;
+ }
+ }
+ return false;
+};
+exports.some = some;
+//# sourceMappingURL=Boolean.js.map
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Boolean.js.map b/backend/node_modules/effect/dist/cjs/Boolean.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5cb30313829c6b16f4c1a36b92170a51f962126
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Boolean.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Boolean.js","names":["equivalence","_interopRequireWildcard","require","_Function","order","predicate","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isBoolean","exports","match","dual","value","options","onTrue","onFalse","Equivalence","boolean","Order","not","self","and","that","nand","or","nor","xor","eqv","implies","every","collection","b","some"],"sources":["../../src/Boolean.ts"],"sourcesContent":[null],"mappings":";;;;;;AAOA,IAAAA,WAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA2C,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,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AqCZ,IAAAhB,cAAI,EAAC,CAAC,EAAE,CAACS,IAAa,EAAEE,IAAa,KAAc,CAACI,GAAG,CAACN,IAAI,EAAEE,IAAI,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;AAiBO,MAAMM,OAAO,GAAAnB,OAAA,CAAAmB,OAAA,gBAqChB,IAAAjB,cAAI,EAAC,CAAC,EAAE,CAACS,IAAI,EAAEE,IAAI,KAAKF,IAAI,GAAGE,IAAI,GAAG,IAAI,CAAC;AAE/C;;;;;;;;;;;;;;AAcO,MAAMO,KAAK,GAAIC,UAA6B,IAAa;EAC9D,KAAK,MAAMC,CAAC,IAAID,UAAU,EAAE;IAC1B,IAAI,CAACC,CAAC,EAAE;MACN,OAAO,KAAK;IACd;EACF;EACA,OAAO,IAAI;AACb,CAAC;AAED;;;;;;;;;;;;;;AAAAtB,OAAA,CAAAoB,KAAA,GAAAA,KAAA;AAcO,MAAMG,IAAI,GAAIF,UAA6B,IAAa;EAC7D,KAAK,MAAMC,CAAC,IAAID,UAAU,EAAE;IAC1B,IAAIC,CAAC,EAAE;MACL,OAAO,IAAI;IACb;EACF;EACA,OAAO,KAAK;AACd,CAAC;AAAAtB,OAAA,CAAAuB,IAAA,GAAAA,IAAA","ignoreList":[]}
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Brand.js.map b/backend/node_modules/effect/dist/cjs/Brand.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..186cbfe354e7c99ee6a25454042ccb966b800d2a
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Brand.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Brand.js","names":["Arr","_interopRequireWildcard","require","Either","_Function","Option","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BrandTypeId","exports","Symbol","for","RefinedConstructorsTypeId","error","message","meta","errors","flatten","refined","args","either","length","unbranded","right","left","match","onNone","onSome","assign","getOrThrowWith","identity","option","getRight","is","isRight","nominal","some","_args","all","brands","result","brand","nextResult","isLeft","onLeft","onRight","unsafeCoerce"],"sources":["../../src/Brand.ts"],"sourcesContent":[null],"mappings":";;;;;;;;AAkBA,IAAAA,GAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,uBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAAqC,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,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B,MAAM,GAAGtD,MAAM,CAACyD,MAAM,CAACH,MAAM,CAAC,GAAGA,MAAM,GAAGE,UAAU;MACtD;IACF;IACA,OAAOF,MAAM;EACf,CAAC;EACD;EACA,OAAOnC,MAAM,CAACuB,MAAM,CAAET,IAAI,IACxBjC,MAAM,CAACuC,KAAK,CAACL,MAAM,CAACD,IAAI,CAAC,EAAE;IACzByB,MAAM,EAAGvD,CAAC,IAAI;MACZ,MAAMA,CAAC;IACT,CAAC;IACDwD,OAAO,EAAEf;GACV,CAAC,EAAE;IACJ,CAAClB,yBAAyB,GAAGA,yBAAyB;IACtDmB,MAAM,EAAGZ,IAAS,IAAK/B,MAAM,CAAC4C,QAAQ,CAACZ,MAAM,CAACD,IAAI,CAAC,CAAC;IACpDC,MAAM;IACNa,EAAE,EAAGd,IAAS,IAAkBjC,MAAM,CAACgD,OAAO,CAACd,MAAM,CAACD,IAAI,CAAC;GAC5D,CAAC;AACJ,CAAC;AAED;;;;;;AAAAV,OAAA,CAAA6B,GAAA,GAAAA,GAAA;AAMO,MAAMhB,SAAS,GAAAb,OAAA,CAAAa,SAAA,GAA6DwB,sBAAY","ignoreList":[]}
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Cache.js b/backend/node_modules/effect/dist/cjs/Cache.js
new file mode 100644
index 0000000000000000000000000000000000000000..163dfdc4d3c2b5860ecfc0e5137d0a9db9f7825e
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Cache.js
@@ -0,0 +1,50 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.makeWith = exports.makeEntryStats = exports.makeCacheStats = exports.make = exports.ConsumerCacheTypeId = exports.CacheTypeId = void 0;
+var internal = _interopRequireWildcard(require("./internal/cache.js"));
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * @since 2.0.0
+ * @category symbols
+ */
+const CacheTypeId = exports.CacheTypeId = internal.CacheTypeId;
+/**
+ * @since 3.6.4
+ * @category symbols
+ */
+const ConsumerCacheTypeId = exports.ConsumerCacheTypeId = internal.ConsumerCacheTypeId;
+/**
+ * Constructs a new cache with the specified capacity, time to live, and
+ * lookup function.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+const make = exports.make = internal.make;
+/**
+ * Constructs a new cache with the specified capacity, time to live, and
+ * lookup function, where the time to live can depend on the `Exit` value
+ * returned by the lookup function.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+const makeWith = exports.makeWith = internal.makeWith;
+/**
+ * Constructs a new `CacheStats` from the specified values.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+const makeCacheStats = exports.makeCacheStats = internal.makeCacheStats;
+/**
+ * Constructs a new `EntryStats` from the specified values.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+const makeEntryStats = exports.makeEntryStats = internal.makeEntryStats;
+//# sourceMappingURL=Cache.js.map
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Cache.js.map b/backend/node_modules/effect/dist/cjs/Cache.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..5b37ff8eb87ba49d53de6ea350afc5f1e5f52c66
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Cache.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Cache.js","names":["internal","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","CacheTypeId","exports","ConsumerCacheTypeId","make","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AQ,CAACwB,mBAAmB;AAsK9E;;;;;;;AAOO,MAAMC,IAAI,GAAAF,OAAA,CAAAE,IAAA,GAMkDzB,QAAQ,CAACyB,IAAI;AAEhF;;;;;;;;AAQO,MAAMC,QAAQ,GAAAH,OAAA,CAAAG,QAAA,GAM8C1B,QAAQ,CAAC0B,QAAQ;AAepF;;;;;;AAMO,MAAMC,cAAc,GAAAJ,OAAA,CAAAI,cAAA,GAMT3B,QAAQ,CAAC2B,cAAc;AAYzC;;;;;;AAMO,MAAMC,cAAc,GAAAL,OAAA,CAAAK,cAAA,GAAyC5B,QAAQ,CAAC4B,cAAc","ignoreList":[]}
\ No newline at end of file
diff --git a/backend/node_modules/effect/dist/cjs/Cause.js b/backend/node_modules/effect/dist/cjs/Cause.js
new file mode 100644
index 0000000000000000000000000000000000000000..e39f0dc7dc9ae87cb4de3eff9fa50e60453b6a2b
--- /dev/null
+++ b/backend/node_modules/effect/dist/cjs/Cause.js
@@ -0,0 +1,1011 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.stripSomeDefects = exports.stripFailures = exports.squashWith = exports.squash = exports.size = exports.sequential = exports.reduceWithContext = exports.reduce = exports.prettyErrors = exports.pretty = exports.parallel = exports.originalError = exports.match = exports.map = exports.linearize = exports.keepDefects = exports.isUnknownException = exports.isTimeoutException = exports.isSequentialType = exports.isRuntimeException = exports.isParallelType = exports.isNoSuchElementException = exports.isInterruptedOnly = exports.isInterruptedException = exports.isInterrupted = exports.isInterruptType = exports.isIllegalArgumentException = exports.isFailure = exports.isFailType = exports.isExceededCapacityException = exports.isEmptyType = exports.isEmpty = exports.isDieType = exports.isDie = exports.isCause = exports.interruptors = exports.interruptOption = exports.interrupt = exports.flipCauseOption = exports.flatten = exports.flatMap = exports.find = exports.filter = exports.failures = exports.failureOrCause = exports.failureOption = exports.fail = exports.empty = exports.dieOption = exports.die = exports.defects = exports.contains = exports.as = exports.andThen = exports.YieldableError = exports.UnknownExceptionTypeId = exports.UnknownException = exports.TimeoutExceptionTypeId = exports.TimeoutException = exports.RuntimeExceptionTypeId = exports.RuntimeException = exports.NoSuchElementExceptionTypeId = exports.NoSuchElementException = exports.InvalidPubSubCapacityExceptionTypeId = exports.InterruptedExceptionTypeId = exports.InterruptedException = exports.IllegalArgumentExceptionTypeId = exports.IllegalArgumentException = exports.ExceededCapacityExceptionTypeId = exports.ExceededCapacityException = exports.CauseTypeId = void 0;
+var internal = _interopRequireWildcard(require("./internal/cause.js"));
+var core = _interopRequireWildcard(require("./internal/core.js"));
+function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
+/**
+ * A unique symbol identifying the `Cause` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that helps identify instances of the `Cause` data
+ * type. This can be used for advanced operations such as refining types or
+ * building internal utilities that check whether an unknown value is a `Cause`.
+ *
+ * @see {@link isCause} Check if a value is a `Cause`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const CauseTypeId = exports.CauseTypeId = internal.CauseTypeId;
+/**
+ * A unique symbol identifying the `RuntimeException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies a `RuntimeException`. This is
+ * typically used internally by the library to recognize checked exceptions that
+ * occur during runtime.
+ *
+ * @see {@link RuntimeException} Create or work with a `RuntimeException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const RuntimeExceptionTypeId = exports.RuntimeExceptionTypeId = core.RuntimeExceptionTypeId;
+/**
+ * A unique symbol identifying the `InterruptedException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies an `InterruptedException`. This is
+ * typically used internally to recognize when a fiber has been interrupted,
+ * helping the framework handle interruption logic correctly.
+ *
+ * @see {@link InterruptedException} Create or work with an `InterruptedException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const InterruptedExceptionTypeId = exports.InterruptedExceptionTypeId = core.InterruptedExceptionTypeId;
+/**
+ * A unique symbol identifying the `IllegalArgumentException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies an `IllegalArgumentException`. This is
+ * often used in scenarios where invalid arguments are supplied to methods that
+ * expect specific input.
+ *
+ * @see {@link IllegalArgumentException} Create or work with an `IllegalArgumentException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const IllegalArgumentExceptionTypeId = exports.IllegalArgumentExceptionTypeId = core.IllegalArgumentExceptionTypeId;
+/**
+ * A unique symbol identifying the `NoSuchElementException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies a `NoSuchElementException`. It helps
+ * differentiate cases where a required element is missing within a data
+ * structure.
+ *
+ * @see {@link NoSuchElementException} Create or work with a `NoSuchElementException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const NoSuchElementExceptionTypeId = exports.NoSuchElementExceptionTypeId = core.NoSuchElementExceptionTypeId;
+/**
+ * A unique symbol identifying the `InvalidPubSubCapacityException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies an `InvalidPubSubCapacityException`.
+ * It indicates an error related to an invalid capacity passed to a `PubSub`
+ * structure.
+ *
+ * @see {@link InvalidPubSubCapacityException} Create or work with an `InvalidPubSubCapacityException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const InvalidPubSubCapacityExceptionTypeId = exports.InvalidPubSubCapacityExceptionTypeId = core.InvalidPubSubCapacityExceptionTypeId;
+/**
+ * A unique symbol identifying the `ExceededCapacityException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies an `ExceededCapacityException`. It
+ * denotes situations where a resource has exceeded its configured capacity
+ * limit.
+ *
+ * @see {@link ExceededCapacityException} Create or work with an `ExceededCapacityException`
+ *
+ * @since 3.5.0
+ * @category Symbols
+ */
+const ExceededCapacityExceptionTypeId = exports.ExceededCapacityExceptionTypeId = core.ExceededCapacityExceptionTypeId;
+/**
+ * A unique symbol identifying the `TimeoutException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies a `TimeoutException`. It helps the
+ * framework recognize errors related to operations that fail to complete within
+ * a given timeframe.
+ *
+ * @see {@link TimeoutException} Create or work with a `TimeoutException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const TimeoutExceptionTypeId = exports.TimeoutExceptionTypeId = core.TimeoutExceptionTypeId;
+/**
+ * A unique symbol identifying the `UnknownException` type.
+ *
+ * **Details**
+ *
+ * This provides a symbol that identifies an `UnknownException`. It is typically
+ * used for generic or unexpected errors that do not fit other specific
+ * exception categories.
+ *
+ * @see {@link UnknownException} Create or work with an `UnknownException`
+ *
+ * @since 2.0.0
+ * @category Symbols
+ */
+const UnknownExceptionTypeId = exports.UnknownExceptionTypeId = core.UnknownExceptionTypeId;
+/**
+ * Creates an error that occurs at runtime, extendable for other exception
+ * types.
+ *
+ * @since 2.0.0
+ * @category Errors
+ */
+const YieldableError = exports.YieldableError = core.YieldableError;
+/**
+ * Creates an `Empty` cause.
+ *
+ * **Details**
+ *
+ * This function returns a cause that signifies "no error." It's commonly used
+ * to represent an absence of failure conditions.
+ *
+ * @see {@link isEmpty} Check if a `Cause` is empty
+ *
+ * @since 2.0.0
+ * @category Constructors
+ */
+const empty = exports.empty = internal.empty;
+/**
+ * Creates a `Fail` cause from an expected error.
+ *
+ * **Details**
+ *
+ * This function constructs a `Cause` carrying an error of type `E`. It's used
+ * when you want to represent a known or anticipated failure in your effectful
+ * computations.
+ *
+ * @see {@link isFailure} Check if a `Cause` contains a failure
+ *
+ * @since 2.0.0
+ * @category Constructors
+ */
+const fail = exports.fail = internal.fail;
+/**
+ * Creates a `Die` cause from an unexpected error.
+ *
+ * **Details**
+ *
+ * This function wraps an unhandled or unknown defect (like a runtime crash)
+ * into a `Cause`. It's useful for capturing unforeseen issues in a structured
+ * way.
+ *
+ * @see {@link isDie} Check if a `Cause` contains a defect
+ *
+ * @since 2.0.0
+ * @category Constructors
+ */
+const die = exports.die = internal.die;
+/**
+ * Creates an `Interrupt` cause from a `FiberId`.
+ *
+ * **Details**
+ *
+ * This function represents a fiber that has been interrupted. It stores the
+ * identifier of the interrupted fiber, enabling precise tracking of concurrent
+ * cancellations.
+ *
+ * @see {@link isInterrupted} Check if a `Cause` contains an interruption
+ *
+ * @since 2.0.0
+ * @category Constructors
+ */
+const interrupt = exports.interrupt = internal.interrupt;
+/**
+ * Combines two `Cause`s in parallel.
+ *
+ * **Details**
+ *
+ * This function merges two errors that occurred simultaneously. Instead of
+ * discarding one error, both are retained, allowing for richer error reporting
+ * and debugging.
+ *
+ * @see {@link isParallelType} Check if a `Cause` is a `Parallel`
+ *
+ * @since 2.0.0
+ * @category Constructors
+ */
+const parallel = exports.parallel = internal.parallel;
+/**
+ * Combines two `Cause`s sequentially.
+ *
+ * **Details**
+ *
+ * This function merges two errors that occurred in sequence, such as a main
+ * error followed by a finalization error. It preserves both errors for complete
+ * failure information.
+ *
+ * @see {@link isSequentialType} Check if a `Cause` is a `Sequential`
+ *
+ * @since 2.0.0
+ * @category Constructors
+ */
+const sequential = exports.sequential = internal.sequential;
+/**
+ * Checks if a value is a `Cause`.
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isCause = exports.isCause = internal.isCause;
+/**
+ * Checks if a `Cause` is an `Empty` type.
+ *
+ * @see {@link empty} Create a new `Empty` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isEmptyType = exports.isEmptyType = internal.isEmptyType;
+/**
+ * Checks if a `Cause` is a `Fail` type.
+ *
+ * @see {@link fail} Create a new `Fail` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isFailType = exports.isFailType = internal.isFailType;
+/**
+ * Checks if a `Cause` is a `Die` type.
+ *
+ * @see {@link die} Create a new `Die` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isDieType = exports.isDieType = internal.isDieType;
+/**
+ * Checks if a `Cause` is an `Interrupt` type.
+ *
+ * @see {@link interrupt} Create an `Interrupt` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isInterruptType = exports.isInterruptType = internal.isInterruptType;
+/**
+ * Checks if a `Cause` is a `Sequential` type.
+ *
+ * @see {@link sequential} Combine two `Cause`s sequentially
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isSequentialType = exports.isSequentialType = internal.isSequentialType;
+/**
+ * Checks if a `Cause` is a `Parallel` type.
+ *
+ * @see {@link parallel} Combine two `Cause`s in parallel
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+const isParallelType = exports.isParallelType = internal.isParallelType;
+/**
+ * Calculates the size of a `Cause`.
+ *
+ * **Details**
+ *
+ * This function returns the total number of `Cause` nodes in the semiring
+ * structure, reflecting how many individual error elements are recorded.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const size = exports.size = internal.size;
+/**
+ * Checks if a `Cause` is entirely empty.
+ *
+ * **Details**
+ *
+ * This function returns `true` if the `Cause` contains no errors, defects, or
+ * interruptions. It's helpful for verifying if a computation truly had no
+ * failures.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const isEmpty = exports.isEmpty = internal.isEmpty;
+/**
+ * Checks if a `Cause` contains a failure.
+ *
+ * **Details**
+ *
+ * This function returns `true` if the `Cause` includes any `Fail` error. It's
+ * commonly used to confirm whether a workflow encountered an anticipated error
+ * versus just defects or interruptions.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const isFailure = exports.isFailure = internal.isFailure;
+/**
+ * Checks if a `Cause` contains a defect.
+ *
+ * **Details**
+ *
+ * This function returns `true` if the `Cause` includes any unexpected or
+ * unhandled errors (`Die`). It's useful for differentiating known failures from
+ * unexpected ones.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const isDie = exports.isDie = internal.isDie;
+/**
+ * Checks if a `Cause` contains an interruption.
+ *
+ * **Details**
+ *
+ * This function returns `true` if the `Cause` includes any fiber interruptions.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const isInterrupted = exports.isInterrupted = internal.isInterrupted;
+/**
+ * Checks if a `Cause` contains only interruptions.
+ *
+ * **Details**
+ *
+ * This function returns `true` if the `Cause` has been interrupted but does not
+ * contain any other failures, such as `Fail` or `Die`. It's helpful for
+ * verifying purely "cancellation" scenarios.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const isInterruptedOnly = exports.isInterruptedOnly = internal.isInterruptedOnly;
+/**
+ * Extracts all recoverable errors of type `E` from a `Cause`.
+ *
+ * **Details**
+ *
+ * This function returns a chunk of errors, providing a list of all `Fail`
+ * values found in the cause. It's useful for collecting all known failures for
+ * logging or combined error handling.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const failures = exports.failures = internal.failures;
+/**
+ * Extracts all unrecoverable defects from a `Cause`.
+ *
+ * **Details**
+ *
+ * This function returns a chunk of values representing unexpected errors
+ * (`Die`). It's handy for capturing or logging unanticipated failures that
+ * might need special handling, such as bug reports.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const defects = exports.defects = internal.defects;
+/**
+ * Collects all `FiberId`s responsible for interrupting a fiber.
+ *
+ * **Details**
+ *
+ * This function returns a set of IDs indicating which fibers caused
+ * interruptions within this `Cause`. It's useful for debugging concurrency
+ * issues or tracing cancellations.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const interruptors = exports.interruptors = internal.interruptors;
+/**
+ * Retrieves the first `Fail` error in a `Cause`, if present.
+ *
+ * **Details**
+ *
+ * This function returns an `Option` containing the first recoverable error
+ * (`E`) from the cause. It's often used to quickly check if there's a primary
+ * error to handle or display.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const failureOption = exports.failureOption = internal.failureOption;
+/**
+ * Splits a `Cause` into either its first `Fail` error or the rest of the cause
+ * (which might only contain `Die` or `Interrupt`).
+ *
+ * **Details**
+ *
+ * This function either returns the checked error (`E`) or the remaining
+ * `Cause` with defects/interruptions. It helps you decide if there's a
+ * recoverable path or if only unhandled issues remain.
+ *
+ * @since 2.0.0
+ * @category Getters
+ */
+const failureOrCause = exports.failureOrCause = internal.failureOrCause;
+/**
+ * Strips out failures with an error of `None` from a `Cause