diff --git a/backend/node_modules/effect/src/Arbitrary.ts b/backend/node_modules/effect/src/Arbitrary.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a46e96b37a2474ee1df4fd4d5718aeb89b3e0f2e
--- /dev/null
+++ b/backend/node_modules/effect/src/Arbitrary.ts
@@ -0,0 +1,1101 @@
+/**
+ * @since 3.10.0
+ */
+
+import * as Arr from "./Array.js"
+import * as FastCheck from "./FastCheck.js"
+import { globalValue } from "./GlobalValue.js"
+import * as errors_ from "./internal/schema/errors.js"
+import * as schemaId_ from "./internal/schema/schemaId.js"
+import * as util_ from "./internal/schema/util.js"
+import * as Option from "./Option.js"
+import * as Predicate from "./Predicate.js"
+import type * as Schema from "./Schema.js"
+import * as SchemaAST from "./SchemaAST.js"
+import type * as Types from "./Types.js"
+
+/**
+ * @category model
+ * @since 3.10.0
+ */
+export interface LazyArbitrary {
+ (fc: typeof FastCheck): FastCheck.Arbitrary
+}
+
+/**
+ * @category annotations
+ * @since 3.10.0
+ */
+export interface ArbitraryGenerationContext {
+ readonly maxDepth: number
+ readonly depthIdentifier?: string
+ readonly constraints?: StringConstraints | NumberConstraints | BigIntConstraints | DateConstraints | ArrayConstraints
+}
+
+/**
+ * @category annotations
+ * @since 3.10.0
+ */
+export type ArbitraryAnnotation = readonly []> = (
+ ...arbitraries: [
+ ...{ readonly [K in keyof TypeParameters]: LazyArbitrary },
+ ctx: ArbitraryGenerationContext
+ ]
+) => LazyArbitrary
+
+/**
+ * Returns a LazyArbitrary for the `A` type of the provided schema.
+ *
+ * @category arbitrary
+ * @since 3.10.0
+ */
+export const makeLazy = (schema: Schema.Schema): LazyArbitrary => {
+ 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
+ */
+export const make = (schema: Schema.Schema): FastCheck.Arbitrary => makeLazy(schema)(FastCheck)
+
+interface StringConstraints {
+ readonly _tag: "StringConstraints"
+ readonly constraints: FastCheck.StringSharedConstraints
+ readonly pattern?: string
+}
+
+/** @internal */
+export const makeStringConstraints = (options: {
+ readonly minLength?: number | undefined
+ readonly maxLength?: number | undefined
+ readonly pattern?: string | undefined
+}): StringConstraints => {
+ const out: Types.Mutable = {
+ _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
+}
+
+interface NumberConstraints {
+ readonly _tag: "NumberConstraints"
+ readonly constraints: FastCheck.FloatConstraints
+ readonly isInteger: boolean
+}
+
+/** @internal */
+export const makeNumberConstraints = (options: {
+ readonly isInteger?: boolean | undefined
+ readonly min?: unknown
+ readonly minExcluded?: boolean | undefined
+ readonly max?: unknown
+ readonly maxExcluded?: boolean | undefined
+ readonly noNaN?: boolean | undefined
+ readonly noDefaultInfinity?: boolean | undefined
+}): NumberConstraints => {
+ const out: Types.Mutable = {
+ _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
+}
+
+interface BigIntConstraints {
+ readonly _tag: "BigIntConstraints"
+ readonly constraints: FastCheck.BigIntConstraints
+}
+
+/** @internal */
+export const makeBigIntConstraints = (options: {
+ readonly min?: bigint | undefined
+ readonly max?: bigint | undefined
+}): BigIntConstraints => {
+ const out: Types.Mutable = {
+ _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
+}
+
+interface ArrayConstraints {
+ readonly _tag: "ArrayConstraints"
+ readonly constraints: FastCheck.ArrayConstraints
+}
+
+/** @internal */
+export const makeArrayConstraints = (options: {
+ readonly minLength?: unknown
+ readonly maxLength?: unknown
+}): ArrayConstraints => {
+ const out: Types.Mutable = {
+ _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
+}
+
+interface DateConstraints {
+ readonly _tag: "DateConstraints"
+ readonly constraints: FastCheck.DateConstraints
+}
+
+/** @internal */
+export const makeDateConstraints = (options: {
+ readonly min?: Date | undefined
+ readonly max?: Date | undefined
+ readonly noInvalidDate?: boolean | undefined
+}): DateConstraints => {
+ const out: Types.Mutable = {
+ _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
+}
+
+type Refinements = ReadonlyArray
+
+interface Base {
+ readonly path: ReadonlyArray
+ readonly refinements: Refinements
+ readonly annotations: ReadonlyArray>
+}
+
+interface StringKeyword extends Base {
+ readonly _tag: "StringKeyword"
+ readonly constraints: ReadonlyArray
+}
+
+interface NumberKeyword extends Base {
+ readonly _tag: "NumberKeyword"
+ readonly constraints: ReadonlyArray
+}
+
+interface BigIntKeyword extends Base {
+ readonly _tag: "BigIntKeyword"
+ readonly constraints: ReadonlyArray
+}
+
+interface DateFromSelf extends Base {
+ readonly _tag: "DateFromSelf"
+ readonly constraints: ReadonlyArray
+}
+
+interface Declaration extends Base {
+ readonly _tag: "Declaration"
+ readonly typeParameters: ReadonlyArray
+ readonly ast: SchemaAST.AST
+}
+
+interface TupleType extends Base {
+ readonly _tag: "TupleType"
+ readonly constraints: ReadonlyArray
+ readonly elements: ReadonlyArray<{
+ readonly isOptional: boolean
+ readonly description: Description
+ }>
+ readonly rest: ReadonlyArray
+}
+
+interface TypeLiteral extends Base {
+ readonly _tag: "TypeLiteral"
+ readonly propertySignatures: ReadonlyArray<{
+ readonly isOptional: boolean
+ readonly name: PropertyKey
+ readonly value: Description
+ }>
+ readonly indexSignatures: ReadonlyArray<{
+ readonly parameter: Description
+ readonly value: Description
+ }>
+}
+
+interface Union extends Base {
+ readonly _tag: "Union"
+ readonly members: ReadonlyArray
+}
+
+interface Suspend extends Base {
+ readonly _tag: "Suspend"
+ readonly id: string
+ readonly ast: SchemaAST.AST
+ readonly description: () => Description
+}
+
+interface Ref extends Base {
+ readonly _tag: "Ref"
+ readonly id: string
+ readonly ast: SchemaAST.AST
+}
+
+interface NeverKeyword extends Base {
+ readonly _tag: "NeverKeyword"
+ readonly ast: SchemaAST.AST
+}
+
+interface Keyword extends Base {
+ readonly _tag: "Keyword"
+ readonly value:
+ | "UndefinedKeyword"
+ | "VoidKeyword"
+ | "UnknownKeyword"
+ | "AnyKeyword"
+ | "BooleanKeyword"
+ | "SymbolKeyword"
+ | "ObjectKeyword"
+}
+
+interface Literal extends Base {
+ readonly _tag: "Literal"
+ readonly literal: SchemaAST.LiteralValue
+}
+
+interface UniqueSymbol extends Base {
+ readonly _tag: "UniqueSymbol"
+ readonly symbol: symbol
+}
+
+interface Enums extends Base {
+ readonly _tag: "Enums"
+ readonly enums: ReadonlyArray
+ readonly ast: SchemaAST.AST
+}
+
+interface TemplateLiteral extends Base {
+ readonly _tag: "TemplateLiteral"
+ readonly head: string
+ readonly spans: ReadonlyArray<{
+ readonly description: Description
+ readonly literal: string
+ }>
+}
+
+type Description =
+ | Declaration
+ | NeverKeyword
+ | Keyword
+ | Literal
+ | UniqueSymbol
+ | Enums
+ | TemplateLiteral
+ | StringKeyword
+ | NumberKeyword
+ | BigIntKeyword
+ | DateFromSelf
+ | TupleType
+ | TypeLiteral
+ | Union
+ | Suspend
+ | Ref
+
+const getArbitraryAnnotation = SchemaAST.getAnnotation>(SchemaAST.ArbitraryAnnotationId)
+
+const getASTConstraints = (ast: SchemaAST.AST) => {
+ const TypeAnnotationId = ast.annotations[SchemaAST.SchemaIdAnnotationId]
+ if (Predicate.isPropertyKey(TypeAnnotationId)) {
+ const out = ast.annotations[TypeAnnotationId]
+ if (Predicate.isReadonlyRecord(out)) {
+ return out
+ }
+ }
+}
+
+const idMemoMap = globalValue(
+ Symbol.for("effect/Arbitrary/IdMemoMap"),
+ () => new Map()
+)
+
+let counter = 0
+
+function wrapGetDescription(
+ f: (ast: SchemaAST.AST, description: Description) => Description,
+ g: (ast: SchemaAST.AST, path: ReadonlyArray) => Description
+): (ast: SchemaAST.AST, path: ReadonlyArray) => Description {
+ return (ast, path) => f(ast, g(ast, path))
+}
+
+function parseMeta(ast: SchemaAST.AST): [SchemaAST.SchemaIdAnnotation | undefined, Record] {
+ 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 */
+export const getDescription = 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: Date | undefined, n2: Date | undefined): Date | undefined
+function getMax(n1: bigint | undefined, n2: bigint | undefined): bigint | undefined
+function getMax(n1: number | undefined, n2: number | undefined): number | undefined
+function getMax(
+ n1: bigint | number | Date | undefined,
+ n2: bigint | number | Date | undefined
+): bigint | number | Date | undefined {
+ return n1 === undefined ? n2 : n2 === undefined ? n1 : n1 <= n2 ? n2 : n1
+}
+
+function getMin(n1: Date | undefined, n2: Date | undefined): Date | undefined
+function getMin(n1: bigint | undefined, n2: bigint | undefined): bigint | undefined
+function getMin(n1: number | undefined, n2: number | undefined): number | undefined
+function getMin(
+ n1: bigint | number | Date | undefined,
+ n2: bigint | number | Date | undefined
+): bigint | number | Date | undefined {
+ return n1 === undefined ? n2 : n2 === undefined ? n1 : n1 <= n2 ? n1 : n2
+}
+
+const getOr = (a: boolean | undefined, b: boolean | undefined): boolean | undefined => {
+ return a === undefined ? b : b === undefined ? a : a || b
+}
+
+function mergePattern(pattern1: string | undefined, pattern2: string | undefined): string | undefined {
+ if (pattern1 === undefined) {
+ return pattern2
+ }
+ if (pattern2 === undefined) {
+ return pattern1
+ }
+ return `(?:${pattern1})|(?:${pattern2})`
+}
+
+function mergeStringConstraints(c1: StringConstraints, c2: StringConstraints): StringConstraints {
+ 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: StringKeyword): StringConstraints | undefined {
+ return description.constraints.length === 0
+ ? undefined
+ : description.constraints.reduce(mergeStringConstraints)
+}
+
+function mergeNumberConstraints(c1: NumberConstraints, c2: NumberConstraints): NumberConstraints {
+ 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: NumberKeyword): NumberConstraints | undefined {
+ return description.constraints.length === 0
+ ? undefined
+ : description.constraints.reduce(mergeNumberConstraints)
+}
+
+function mergeBigIntConstraints(c1: BigIntConstraints, c2: BigIntConstraints): BigIntConstraints {
+ return makeBigIntConstraints({
+ min: getMax(c1.constraints.min, c2.constraints.min),
+ max: getMin(c1.constraints.max, c2.constraints.max)
+ })
+}
+
+function buildBigIntConstraints(description: BigIntKeyword): BigIntConstraints | undefined {
+ return description.constraints.length === 0
+ ? undefined
+ : description.constraints.reduce(mergeBigIntConstraints)
+}
+
+function mergeDateConstraints(c1: DateConstraints, c2: DateConstraints): DateConstraints {
+ 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: DateFromSelf): DateConstraints | undefined {
+ return description.constraints.length === 0
+ ? undefined
+ : description.constraints.reduce(mergeDateConstraints)
+}
+
+const constArrayConstraints = makeArrayConstraints({})
+
+function mergeArrayConstraints(c1: ArrayConstraints, c2: ArrayConstraints): ArrayConstraints {
+ return makeArrayConstraints({
+ minLength: getMax(c1.constraints.minLength, c2.constraints.minLength),
+ maxLength: getMin(c1.constraints.maxLength, c2.constraints.maxLength)
+ })
+}
+
+function buildArrayConstraints(description: TupleType): ArrayConstraints | undefined {
+ return description.constraints.length === 0
+ ? undefined
+ : description.constraints.reduce(mergeArrayConstraints)
+}
+
+const arbitraryMemoMap = globalValue(
+ Symbol.for("effect/Arbitrary/arbitraryMemoMap"),
+ () => new WeakMap>()
+)
+
+function applyFilters(filters: ReadonlyArray>, arb: LazyArbitrary): LazyArbitrary {
+ return (fc) => filters.reduce((arb, filter) => arb.filter(filter), arb(fc))
+}
+
+function absurd(message: string): LazyArbitrary {
+ return () => {
+ throw new Error(message)
+ }
+}
+
+function getContextConstraints(description: Description): ArbitraryGenerationContext["constraints"] {
+ 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: (description: Description, ctx: ArbitraryGenerationContext, lazyArb: LazyArbitrary) => LazyArbitrary,
+ g: (description: Description, ctx: ArbitraryGenerationContext) => LazyArbitrary
+): (description: Description, ctx: ArbitraryGenerationContext) => LazyArbitrary {
+ return (description, ctx) => f(description, ctx, g(description, ctx))
+}
+
+const go = wrapGo(
+ (description, ctx, lazyArb) => {
+ const annotation: ArbitraryAnnotation | undefined =
+ 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: any) =>
+ 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: TemplateLiteral) => {
+ const components: Array> = description.head !== ""
+ ? [fc.constant(description.head)]
+ : []
+
+ const getTemplateLiteralSpanTypeArb = (
+ description: Description
+ ): FastCheck.Arbitrary => {
+ 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: Array> = []
+ 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: Array> = []
+ const requiredKeys: Array = []
+ 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)] as const
+ )
+ return (fc) => {
+ const pps: any = {}
+ 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: LazyArbitrary = (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: FastCheck.ArrayConstraints,
+ len: number
+): FastCheck.ArrayConstraints {
+ 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: typeof FastCheck,
+ depthIdentifier: string,
+ maxDepth: number,
+ item: FastCheck.Arbitrary,
+ constraints: FastCheck.ArrayConstraints
+) => {
+ // 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)
+ )
+}
diff --git a/backend/node_modules/effect/src/BigInt.ts b/backend/node_modules/effect/src/BigInt.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aa187ed5eedf995058ec069a28e80cb9ac03da8a
--- /dev/null
+++ b/backend/node_modules/effect/src/BigInt.ts
@@ -0,0 +1,1139 @@
+/**
+ * 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
+ */
+
+import * as equivalence from "./Equivalence.js"
+import { dual } from "./Function.js"
+import * as Option from "./Option.js"
+import * as order from "./Order.js"
+import type { Ordering } from "./Ordering.js"
+import * as predicate from "./Predicate.js"
+
+const bigint0 = BigInt(0)
+const bigint1 = BigInt(1)
+const bigint2 = 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
+ */
+export const isBigInt: (u: unknown) => u is bigint = 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
+ */
+export const sum: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = dual(2, (self: bigint, that: bigint): bigint => 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
+ */
+export const multiply: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = dual(2, (self: bigint, that: bigint): bigint => 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
+ */
+export const subtract: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = dual(2, (self: bigint, that: bigint): bigint => 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
+ */
+export const divide: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => Option.Option
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): Option.Option
+} = dual(
+ 2,
+ (self: bigint, that: bigint): Option.Option => 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
+ */
+export const unsafeDivide: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = dual(2, (self: bigint, that: bigint): bigint => 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
+ */
+export const increment = (n: bigint): bigint => 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
+ */
+export const decrement = (n: bigint): bigint => n - bigint1
+
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+export const Equivalence: equivalence.Equivalence = equivalence.bigint
+
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+export const Order: order.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
+ */
+export const lessThan: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => boolean
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): boolean
+} = 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
+ */
+export const lessThanOrEqualTo: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => boolean
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): boolean
+} = 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
+ */
+export const greaterThan: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => boolean
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): boolean
+} = 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
+ */
+export const greaterThanOrEqualTo: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => boolean
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): boolean
+} = 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
+ */
+export const between: {
+ /**
+ * 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
+ */
+ (
+ options: {
+ minimum: bigint
+ maximum: bigint
+ }
+ ): (self: bigint) => boolean
+ /**
+ * 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
+ */
+ (
+ self: bigint,
+ options: {
+ minimum: bigint
+ maximum: bigint
+ }
+ ): boolean
+} = 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
+ */
+export const clamp: {
+ /**
+ * 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
+ */
+ (
+ options: {
+ minimum: bigint
+ maximum: bigint
+ }
+ ): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (
+ self: bigint,
+ options: {
+ minimum: bigint
+ maximum: bigint
+ }
+ ): bigint
+} = 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
+ */
+export const min: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = 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
+ */
+export const max: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = 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
+ */
+export const sign = (n: bigint): Ordering => 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
+ */
+export const abs = (n: bigint): bigint => (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
+ */
+export const gcd: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = dual(2, (self: bigint, that: bigint): bigint => {
+ 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
+ */
+export const lcm: {
+ /**
+ * 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
+ */
+ (that: bigint): (self: bigint) => bigint
+ /**
+ * 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
+ */
+ (self: bigint, that: bigint): bigint
+} = dual(2, (self: bigint, that: bigint): bigint => (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
+ */
+export const unsafeSqrt = (n: bigint): bigint => {
+ 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
+ */
+export const sqrt = (n: bigint): Option.Option =>
+ 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
+ */
+export const sumAll = (collection: Iterable): bigint => {
+ 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
+ */
+export const multiplyAll = (collection: Iterable): bigint => {
+ 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
+ */
+export const toNumber = (b: bigint): Option.Option => {
+ 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
+ */
+export const fromString = (s: string): Option.Option => {
+ 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
+ */
+export const fromNumber = (n: number): Option.Option => {
+ if (n > Number.MAX_SAFE_INTEGER || n < Number.MIN_SAFE_INTEGER) {
+ return Option.none()
+ }
+
+ try {
+ return Option.some(BigInt(n))
+ } catch {
+ return Option.none()
+ }
+}
diff --git a/backend/node_modules/effect/src/Boolean.ts b/backend/node_modules/effect/src/Boolean.ts
new file mode 100644
index 0000000000000000000000000000000000000000..57c59b2de4d684df3c9f8f8cba21bdb8c28a3549
--- /dev/null
+++ b/backend/node_modules/effect/src/Boolean.ts
@@ -0,0 +1,560 @@
+/**
+ * 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
+ */
+import * as equivalence from "./Equivalence.js"
+import type { LazyArg } from "./Function.js"
+import { dual } from "./Function.js"
+import * as order from "./Order.js"
+import * as predicate from "./Predicate.js"
+
+/**
+ * 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
+ */
+export const isBoolean: (input: unknown) => input is boolean = 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
+ */
+export const match: {
+ /**
+ * 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
+ */
+ (
+ options: {
+ readonly onFalse: LazyArg
+ readonly onTrue: LazyArg
+ }
+ ): (value: boolean) => A | B
+ /**
+ * 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
+ */
+ (
+ value: boolean,
+ options: {
+ readonly onFalse: LazyArg
+ readonly onTrue: LazyArg
+ }
+ ): A | B
+} = dual(2, (value: boolean, options: {
+ readonly onFalse: LazyArg
+ readonly onTrue: LazyArg
+}): A | B => value ? options.onTrue() : options.onFalse())
+
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+export const Equivalence: equivalence.Equivalence = equivalence.boolean
+
+/**
+ * @category instances
+ * @since 2.0.0
+ */
+export const Order: order.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
+ */
+export const not = (self: boolean): boolean => !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
+ */
+export const and: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = dual(2, (self: boolean, that: boolean): boolean => 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
+ */
+export const nand: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = dual(2, (self: boolean, that: boolean): boolean => !(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
+ */
+export const or: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = dual(2, (self: boolean, that: boolean): boolean => 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
+ */
+export const nor: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = dual(2, (self: boolean, that: boolean): boolean => !(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
+ */
+export const xor: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = dual(2, (self: boolean, that: boolean): boolean => (!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
+ */
+export const eqv: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = dual(2, (self: boolean, that: boolean): boolean => !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
+ */
+export const implies: {
+ /**
+ * 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
+ */
+ (that: boolean): (self: boolean) => boolean
+ /**
+ * 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
+ */
+ (self: boolean, that: boolean): boolean
+} = 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
+ */
+export const every = (collection: Iterable): boolean => {
+ 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
+ */
+export const some = (collection: Iterable): boolean => {
+ for (const b of collection) {
+ if (b) {
+ return true
+ }
+ }
+ return false
+}
diff --git a/backend/node_modules/effect/src/Cache.ts b/backend/node_modules/effect/src/Cache.ts
new file mode 100644
index 0000000000000000000000000000000000000000..876a92dfb9a83c42e983fc1b693158515afba6d0
--- /dev/null
+++ b/backend/node_modules/effect/src/Cache.ts
@@ -0,0 +1,281 @@
+/**
+ * @since 2.0.0
+ */
+import type * as Duration from "./Duration.js"
+import type * as Effect from "./Effect.js"
+import type { Either } from "./Either.js"
+import type * as Exit from "./Exit.js"
+import * as internal from "./internal/cache.js"
+import type * as Option from "./Option.js"
+import type * as Predicate from "./Predicate.js"
+import type * as Types from "./Types.js"
+
+/**
+ * @since 2.0.0
+ * @category symbols
+ */
+export const CacheTypeId: unique symbol = internal.CacheTypeId
+
+/**
+ * @since 2.0.0
+ * @category symbols
+ */
+export type CacheTypeId = typeof CacheTypeId
+
+/**
+ * @since 3.6.4
+ * @category symbols
+ */
+export const ConsumerCacheTypeId: unique symbol = internal.ConsumerCacheTypeId
+
+/**
+ * @since 3.6.4
+ * @category symbols
+ */
+export type ConsumerCacheTypeId = typeof ConsumerCacheTypeId
+
+/**
+ * A `Cache` is defined in terms of a lookup function that, given a key of
+ * type `Key`, can either fail with an error of type `Error` or succeed with a
+ * value of type `Value`. Getting a value from the cache will either return
+ * the previous result of the lookup function if it is available or else
+ * compute a new result with the lookup function, put it in the cache, and
+ * return it.
+ *
+ * A cache also has a specified capacity and time to live. When the cache is
+ * at capacity the least recently accessed values in the cache will be
+ * removed to make room for new values. Getting a value with a life older than
+ * the specified time to live will result in a new value being computed with
+ * the lookup function and returned when available.
+ *
+ * The cache is safe for concurrent access. If multiple fibers attempt to get
+ * the same key the lookup function will only be computed once and the result
+ * will be returned to all fibers.
+ *
+ * @since 2.0.0
+ * @category models
+ */
+export interface Cache
+ extends ConsumerCache, Cache.Variance
+{
+ /**
+ * Retrieves the value associated with the specified key if it exists.
+ * Otherwise computes the value with the lookup function, puts it in the
+ * cache, and returns it.
+ */
+ get(key: Key): Effect.Effect
+
+ /**
+ * Retrieves the value associated with the specified key if it exists as a left.
+ * Otherwise computes the value with the lookup function, puts it in the
+ * cache, and returns it as a right.
+ */
+ getEither(key: Key): Effect.Effect, Error>
+
+ /**
+ * Computes the value associated with the specified key, with the lookup
+ * function, and puts it in the cache. The difference between this and
+ * `get` method is that `refresh` triggers (re)computation of the value
+ * without invalidating it in the cache, so any request to the associated
+ * key can still be served while the value is being re-computed/retrieved
+ * by the lookup function. Additionally, `refresh` always triggers the
+ * lookup function, disregarding the last `Error`.
+ */
+ refresh(key: Key): Effect.Effect
+
+ /**
+ * Associates the specified value with the specified key in the cache.
+ */
+ set(key: Key, value: Value): Effect.Effect
+}
+
+/**
+ * A ConsumerCache models a portion of a cache which is safe to share without allowing to create new values or access existing ones.
+ *
+ * It can be used safely to give over control for request management without leaking writer side details.
+ *
+ * @since 2.0.0
+ * @category models
+ */
+export interface ConsumerCache
+ extends Cache.ConsumerVariance
+{
+ /**
+ * Retrieves the value associated with the specified key if it exists.
+ * Otherwise returns `Option.none`.
+ */
+ getOption(key: Key): Effect.Effect, Error>
+
+ /**
+ * Retrieves the value associated with the specified key if it exists and the
+ * lookup function has completed. Otherwise returns `Option.none`.
+ */
+ getOptionComplete(key: Key): Effect.Effect>
+
+ /**
+ * Returns statistics for this cache.
+ */
+ readonly cacheStats: Effect.Effect
+
+ /**
+ * Returns whether a value associated with the specified key exists in the
+ * cache.
+ */
+ contains(key: Key): Effect.Effect
+
+ /**
+ * Returns statistics for the specified entry.
+ */
+ entryStats(key: Key): Effect.Effect>
+
+ /**
+ * Invalidates the value associated with the specified key.
+ */
+ invalidate(key: Key): Effect.Effect
+
+ /**
+ * Invalidates the value associated with the specified key if the predicate holds.
+ */
+ invalidateWhen(key: Key, predicate: Predicate.Predicate): Effect.Effect
+
+ /**
+ * Invalidates all values in the cache.
+ */
+ readonly invalidateAll: Effect.Effect
+
+ /**
+ * Returns the approximate number of values in the cache.
+ */
+ readonly size: Effect.Effect
+
+ /**
+ * Returns an approximation of the values in the cache.
+ */
+ readonly keys: Effect.Effect>
+
+ /**
+ * Returns an approximation of the values in the cache.
+ */
+ readonly values: Effect.Effect>
+
+ /**
+ * Returns an approximation of the values in the cache.
+ */
+ readonly entries: Effect.Effect>
+}
+
+/**
+ * @since 2.0.0
+ */
+export declare namespace Cache {
+ /**
+ * @since 2.0.0
+ * @category models
+ */
+ export interface Variance {
+ readonly [CacheTypeId]: {
+ readonly _Key: Types.Invariant
+ readonly _Error: Types.Covariant
+ readonly _Value: Types.Invariant
+ }
+ }
+ /**
+ * @since 3.6.4
+ * @category models
+ */
+ export interface ConsumerVariance {
+ readonly [ConsumerCacheTypeId]: {
+ readonly _Key: Types.Invariant
+ readonly _Error: Types.Covariant
+ readonly _Value: Types.Covariant
+ }
+ }
+}
+
+/**
+ * Constructs a new cache with the specified capacity, time to live, and
+ * lookup function.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+export const make: (
+ options: {
+ readonly capacity: number
+ readonly timeToLive: Duration.DurationInput
+ readonly lookup: Lookup
+ }
+) => Effect.Effect, never, Environment> = 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
+ */
+export const makeWith: (
+ options: {
+ readonly capacity: number
+ readonly lookup: Lookup
+ readonly timeToLive: (exit: Exit.Exit) => Duration.DurationInput
+ }
+) => Effect.Effect, never, Environment> = internal.makeWith
+
+/**
+ * `CacheStats` represents a snapshot of statistics for the cache as of a
+ * point in time.
+ *
+ * @since 2.0.0
+ * @category models
+ */
+export interface CacheStats {
+ readonly hits: number
+ readonly misses: number
+ readonly size: number
+}
+
+/**
+ * Constructs a new `CacheStats` from the specified values.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+export const makeCacheStats: (
+ options: {
+ readonly hits: number
+ readonly misses: number
+ readonly size: number
+ }
+) => CacheStats = internal.makeCacheStats
+
+/**
+ * Represents a snapshot of statistics for an entry in the cache.
+ *
+ * @since 2.0.0
+ * @category models
+ */
+export interface EntryStats {
+ readonly loadedMillis: number
+}
+
+/**
+ * Constructs a new `EntryStats` from the specified values.
+ *
+ * @since 2.0.0
+ * @category constructors
+ */
+export const makeEntryStats: (loadedMillis: number) => EntryStats = internal.makeEntryStats
+
+/**
+ * A `Lookup` represents a lookup function that, given a key of type `Key`, can
+ * return an effect that will either produce a value of type `Value` or fail
+ * with an error of type `Error` using an environment of type `Environment`.
+ *
+ * @since 2.0.0
+ * @category models
+ */
+export type Lookup = (
+ key: Key
+) => Effect.Effect
diff --git a/backend/node_modules/effect/src/Cause.ts b/backend/node_modules/effect/src/Cause.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8664f7bd21bf87d46ff04840bb1ee98a4d2d7467
--- /dev/null
+++ b/backend/node_modules/effect/src/Cause.ts
@@ -0,0 +1,2049 @@
+/**
+ * The `Effect` type is polymorphic in values of type `E` and we can
+ * work with any error type that we want. However, there is a lot of information
+ * that is not inside an arbitrary `E` value. So as a result, an `Effect` needs
+ * somewhere to store things like unexpected errors or defects, stack and
+ * execution traces, causes of fiber interruptions, and so forth.
+ *
+ * Effect-TS is very strict about preserving the full information related to a
+ * failure. It captures all type of errors into the `Cause` data type. `Effect`
+ * uses the `Cause` data type to store the full story of failure. So its
+ * error model is lossless. It doesn't throw information related to the failure
+ * result. So we can figure out exactly what happened during the operation of
+ * our effects.
+ *
+ * It is important to note that `Cause` is an underlying data type representing
+ * errors occuring within an `Effect` workflow. Thus, we don't usually deal with
+ * `Cause`s directly. Even though it is not a data type that we deal with very
+ * often, the `Cause` of a failing `Effect` workflow can be accessed at any
+ * time, which gives us total access to all parallel and sequential errors in
+ * occurring within our codebase.
+ *
+ * @since 2.0.0
+ */
+import type * as Channel from "./Channel.js"
+import type * as Chunk from "./Chunk.js"
+import type * as Effect from "./Effect.js"
+import type * as Either from "./Either.js"
+import type * as Equal from "./Equal.js"
+import type * as FiberId from "./FiberId.js"
+import type * as HashSet from "./HashSet.js"
+import type { Inspectable } from "./Inspectable.js"
+import * as internal from "./internal/cause.js"
+import * as core from "./internal/core.js"
+import type * as Option from "./Option.js"
+import type { Pipeable } from "./Pipeable.js"
+import type { Predicate, Refinement } from "./Predicate.js"
+import type * as Sink from "./Sink.js"
+import type * as Stream from "./Stream.js"
+import type { Span } from "./Tracer.js"
+import type { Covariant, NoInfer } from "./Types.js"
+
+/**
+ * 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
+ */
+export const CauseTypeId: unique symbol = internal.CauseTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type CauseTypeId = typeof 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
+ */
+export const RuntimeExceptionTypeId: unique symbol = core.RuntimeExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type RuntimeExceptionTypeId = typeof 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
+ */
+export const InterruptedExceptionTypeId: unique symbol = core.InterruptedExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type InterruptedExceptionTypeId = typeof 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
+ */
+export const IllegalArgumentExceptionTypeId: unique symbol = core.IllegalArgumentExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type IllegalArgumentExceptionTypeId = typeof 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
+ */
+export const NoSuchElementExceptionTypeId: unique symbol = core.NoSuchElementExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type NoSuchElementExceptionTypeId = typeof 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
+ */
+export const InvalidPubSubCapacityExceptionTypeId: unique symbol = core.InvalidPubSubCapacityExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type InvalidPubSubCapacityExceptionTypeId = typeof 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
+ */
+export const ExceededCapacityExceptionTypeId: unique symbol = core.ExceededCapacityExceptionTypeId
+
+/**
+ * @since 3.5.0
+ * @category Symbols
+ */
+export type ExceededCapacityExceptionTypeId = typeof 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
+ */
+export const TimeoutExceptionTypeId: unique symbol = core.TimeoutExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type TimeoutExceptionTypeId = typeof 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
+ */
+export const UnknownExceptionTypeId: unique symbol = core.UnknownExceptionTypeId
+
+/**
+ * @since 2.0.0
+ * @category Symbols
+ */
+export type UnknownExceptionTypeId = typeof UnknownExceptionTypeId
+
+/**
+ * Represents the full history of a failure within an `Effect`.
+ *
+ * **Details**
+ *
+ * This type is a data structure that captures all information about why and how
+ * an effect has failed, including parallel errors, sequential errors, defects,
+ * and interruptions. It enables a "lossless" error model: no error-related
+ * information is discarded, which helps in debugging and understanding the root
+ * cause of failures.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export type Cause =
+ | Empty
+ | Fail
+ | Die
+ | Interrupt
+ | Sequential
+ | Parallel
+
+/**
+ * @since 2.0.0
+ */
+export declare namespace Cause {
+ /**
+ * This interface is used internally to manage the type variance of `Cause`.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+ export interface Variance {
+ readonly [CauseTypeId]: {
+ readonly _E: Covariant
+ }
+ }
+}
+
+/**
+ * Describes methods for reducing a `Cause` into a value of type `Z` with
+ * access to contextual information.
+ *
+ * **Details**
+ *
+ * This interface is meant for advanced transformations of `Cause`. By
+ * implementing each method, you can define how different parts of the `Cause`
+ * structure (like `Fail`, `Die`, or `Interrupt`) should be transformed into a
+ * final type `Z`. The `context` parameter carries additional data needed during
+ * this reduction.
+ *
+ * @see {@link reduceWithContext} Apply a `CauseReducer` to transform a `Cause`
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface CauseReducer {
+ emptyCase(context: C): Z
+ failCase(context: C, error: E): Z
+ dieCase(context: C, defect: unknown): Z
+ interruptCase(context: C, fiberId: FiberId.FiberId): Z
+ sequentialCase(context: C, left: Z, right: Z): Z
+ parallelCase(context: C, left: Z, right: Z): Z
+}
+
+/**
+ * Represents an error object that can be yielded in `Effect.gen`.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface YieldableError extends Pipeable, Inspectable, Error {
+ readonly [Effect.EffectTypeId]: Effect.Effect.VarianceStruct
+ readonly [Stream.StreamTypeId]: Stream.Stream.VarianceStruct
+ readonly [Sink.SinkTypeId]: Sink.Sink.VarianceStruct
+ readonly [Channel.ChannelTypeId]: Channel.Channel.VarianceStruct
+ [Symbol.iterator](): Effect.EffectGenerator>
+}
+
+/**
+ * Creates an error that occurs at runtime, extendable for other exception
+ * types.
+ *
+ * @since 2.0.0
+ * @category Errors
+ */
+export const YieldableError: new(message?: string | undefined) => YieldableError = core.YieldableError
+
+/**
+ * An error representing a runtime error.
+ *
+ * **Details**
+ *
+ * This interface is used for errors that occur at runtime but are still
+ * considered recoverable or typed.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface RuntimeException extends YieldableError {
+ readonly _tag: "RuntimeException"
+ readonly [RuntimeExceptionTypeId]: RuntimeExceptionTypeId
+}
+
+/**
+ * An error representing fiber interruption.
+ *
+ * **Details**
+ *
+ * This interface represents errors that occur when a fiber is forcefully
+ * interrupted. Interruption can happen for various reasons, including
+ * cancellations or system directives to halt operations. Code that deals with
+ * concurrency might need to catch or handle these to ensure proper cleanup.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface InterruptedException extends YieldableError {
+ readonly _tag: "InterruptedException"
+ readonly [InterruptedExceptionTypeId]: InterruptedExceptionTypeId
+}
+
+/**
+ * An error representing an invalid argument passed to a method.
+ *
+ * **Details**
+ *
+ * This interface is used for signaling that a function or method received an
+ * argument that does not meet its preconditions.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface IllegalArgumentException extends YieldableError {
+ readonly _tag: "IllegalArgumentException"
+ readonly [IllegalArgumentExceptionTypeId]: IllegalArgumentExceptionTypeId
+}
+
+/**
+ * An error that occurs when an expected element is missing.
+ *
+ * **Details**
+ *
+ * This interface indicates scenarios like looking up an item in a collection
+ * or searching for data that should be present but isn't. It helps your code
+ * signal a more specific issue rather than a general error.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface NoSuchElementException extends YieldableError {
+ readonly _tag: "NoSuchElementException"
+ readonly [NoSuchElementExceptionTypeId]: NoSuchElementExceptionTypeId
+}
+
+/**
+ * An error indicating invalid capacity for a `PubSub`.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface InvalidPubSubCapacityException extends YieldableError {
+ readonly _tag: "InvalidPubSubCapacityException"
+ readonly [InvalidPubSubCapacityExceptionTypeId]: InvalidPubSubCapacityExceptionTypeId
+}
+
+/**
+ * An error that occurs when resource capacity is exceeded.
+ *
+ * @since 3.5.0
+ * @category Models
+ */
+export interface ExceededCapacityException extends YieldableError {
+ readonly _tag: "ExceededCapacityException"
+ readonly [ExceededCapacityExceptionTypeId]: ExceededCapacityExceptionTypeId
+}
+
+/**
+ * An error representing a computation that timed out.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface TimeoutException extends YieldableError {
+ readonly _tag: "TimeoutException"
+ readonly [TimeoutExceptionTypeId]: TimeoutExceptionTypeId
+}
+
+/**
+ * A checked exception for handling unknown or unexpected errors.
+ *
+ * **Details**
+ *
+ * This interface captures errors that don't fall under known categories. It is
+ * especially helpful for wrapping low-level or third-party library errors that
+ * might provide little or no context, such as from a rejected promise.
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface UnknownException extends YieldableError {
+ readonly _tag: "UnknownException"
+ readonly [UnknownExceptionTypeId]: UnknownExceptionTypeId
+ readonly error: unknown
+}
+
+/**
+ * Represents a lack of errors within a `Cause`.
+ *
+ * @see {@link empty} Construct a new `Empty` cause
+ * @see {@link isEmptyType} Check if a `Cause` is an `Empty` type
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface Empty extends Cause.Variance, Equal.Equal, Pipeable, Inspectable {
+ readonly _tag: "Empty"
+}
+
+/**
+ * Represents an expected error within a `Cause`.
+ *
+ * **Details**
+ *
+ * This interface models a `Cause` that carries an expected or known error of
+ * type `E`. For example, if you validate user input and find it invalid, you
+ * might store that error within a `Fail`.
+ *
+ * @see {@link fail} Construct a `Fail` cause
+ * @see {@link isFailType} Check if a `Cause` is a `Fail`
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface Fail extends Cause.Variance, Equal.Equal, Pipeable, Inspectable {
+ readonly _tag: "Fail"
+ readonly error: E
+}
+
+/**
+ * Represents an unexpected defect within a `Cause`.
+ *
+ * **Details**
+ *
+ * This interface models a `Cause` for errors that are typically unrecoverable or
+ * unanticipated—like runtime exceptions or bugs. When code "dies," it indicates a
+ * severe failure that wasn't accounted for.
+ *
+ * @see {@link die} Construct a `Die` cause
+ * @see {@link isDieType} Check if a `Cause` is a `Die`
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface Die extends Cause.Variance, Equal.Equal, Pipeable, Inspectable {
+ readonly _tag: "Die"
+ readonly defect: unknown
+}
+
+/**
+ * Represents fiber interruption within a `Cause`.
+ *
+ * **Details**
+ *
+ * This interface models a scenario where an effect was halted by an external
+ * signal, carrying a `FiberId` that identifies which fiber was interrupted.
+ * Interruption is a normal part of concurrency, used for cancellation or
+ * resource cleanup.
+ *
+ * @see {@link interrupt} Construct an `Interrupt` cause
+ * @see {@link isInterruptType} Check if a `Cause` is an `Interrupt`
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface Interrupt extends Cause.Variance, Equal.Equal, Pipeable, Inspectable {
+ readonly _tag: "Interrupt"
+ readonly fiberId: FiberId.FiberId
+}
+
+/**
+ * Represents parallel composition of two `Cause`s.
+ *
+ * **Details**
+ *
+ * This interface captures failures that happen simultaneously. In scenarios
+ * with concurrency, more than one operation can fail in parallel. Instead of
+ * losing information, this structure stores both errors together.
+ *
+ * @see {@link parallel} Combine two `Cause`s in parallel
+ * @see {@link isParallelType} Check if a `Cause` is a `Parallel`
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface Parallel extends Cause.Variance, Equal.Equal, Pipeable, Inspectable {
+ readonly _tag: "Parallel"
+ readonly left: Cause
+ readonly right: Cause
+}
+
+/**
+ * Represents sequential composition of two `Cause`s.
+ *
+ * **Details**
+ *
+ * This interface models the scenario where one error follows another in
+ * sequence, such as when a main effect fails and then a finalizer also fails.
+ * It ensures both errors are retained in the final `Cause`.
+ *
+ * @see {@link sequential} Combine two `Cause`s sequentially
+ * @see {@link isSequentialType} Check if a `Cause` is a `Sequential`
+ *
+ * @since 2.0.0
+ * @category Models
+ */
+export interface Sequential extends Cause.Variance, Equal.Equal, Pipeable, Inspectable {
+ readonly _tag: "Sequential"
+ readonly left: Cause
+ readonly right: Cause
+}
+
+/**
+ * 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
+ */
+export const empty: Cause = 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
+ */
+export const fail: (error: E) => Cause = 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
+ */
+export const die: (defect: unknown) => Cause = 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
+ */
+export const interrupt: (fiberId: FiberId.FiberId) => Cause = 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
+ */
+export const parallel: (left: Cause, right: Cause) => Cause = 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
+ */
+export const sequential: (left: Cause, right: Cause) => Cause = internal.sequential
+
+/**
+ * Checks if a value is a `Cause`.
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+export const isCause: (u: unknown) => u is Cause = internal.isCause
+
+/**
+ * Checks if a `Cause` is an `Empty` type.
+ *
+ * @see {@link empty} Create a new `Empty` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+export const isEmptyType: (self: Cause) => self is Empty = internal.isEmptyType
+
+/**
+ * Checks if a `Cause` is a `Fail` type.
+ *
+ * @see {@link fail} Create a new `Fail` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+export const isFailType: (self: Cause) => self is Fail = internal.isFailType
+
+/**
+ * Checks if a `Cause` is a `Die` type.
+ *
+ * @see {@link die} Create a new `Die` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+export const isDieType: (self: Cause) => self is Die = internal.isDieType
+
+/**
+ * Checks if a `Cause` is an `Interrupt` type.
+ *
+ * @see {@link interrupt} Create an `Interrupt` cause
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+export const isInterruptType: (self: Cause) => self is Interrupt = internal.isInterruptType
+
+/**
+ * Checks if a `Cause` is a `Sequential` type.
+ *
+ * @see {@link sequential} Combine two `Cause`s sequentially
+ *
+ * @since 2.0.0
+ * @category Guards
+ */
+export const isSequentialType: (self: Cause) => self is Sequential = 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
+ */
+export const isParallelType: (self: Cause) => self is Parallel = 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
+ */
+export const size: (self: Cause) => number = 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
+ */
+export const isEmpty: (self: Cause) => boolean = 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
+ */
+export const isFailure: (self: Cause) => boolean = 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
+ */
+export const isDie: (self: Cause) => boolean = 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
+ */
+export const isInterrupted: (self: Cause) => boolean = 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
+ */
+export const isInterruptedOnly: (self: Cause) => boolean = 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
+ */
+export const failures: (self: Cause) => Chunk.Chunk = 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
+ */
+export const defects: (self: Cause) => Chunk.Chunk = 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
+ */
+export const interruptors: (self: Cause) => HashSet.HashSet = 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
+ */
+export const failureOption: (self: Cause) => Option.Option = 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
+ */
+export const failureOrCause: (self: Cause) => Either.Either, E> = internal.failureOrCause
+
+/**
+ * Strips out failures with an error of `None` from a `Cause