@lmvz-ds/components 0.12.5-alpha.1 → 0.12.5-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +1 -1
- package/package.json +4 -4
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/assets-Cswkqk_c.js +0 -18971
- package/dist/cjs/assets-Cswkqk_c.js.map +0 -1
- package/dist/cjs/axe-C2rxi-K2.js +0 -32837
- package/dist/cjs/axe-C2rxi-K2.js.map +0 -1
- package/dist/cjs/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-BTL_B6qg.js +0 -3665
- package/dist/cjs/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-BTL_B6qg.js.map +0 -1
- package/dist/cjs/header-integration_6.cjs.entry.js +0 -18
- package/dist/cjs/header-integration_6.cjs.entry.js.map +0 -1
- package/dist/cjs/icons-jn_Uak9B.js +0 -1063
- package/dist/cjs/icons-jn_Uak9B.js.map +0 -1
- package/dist/cjs/index-DpBPf1cE.js +0 -2112
- package/dist/cjs/index-DpBPf1cE.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/lmvz-action.cjs.entry.js.map +0 -1
- package/dist/cjs/lmvz-card.cjs.entry.js.map +0 -1
- package/dist/cjs/lmvz-chip.cjs.entry.js.map +0 -1
- package/dist/cjs/lmvz-components.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/collection/api/ds.constants.js.map +0 -1
- package/dist/collection/api/index.js.map +0 -1
- package/dist/collection/components/lmvz-action/lmvz-action.js.map +0 -1
- package/dist/collection/components/lmvz-button/lmvz-button.js.map +0 -1
- package/dist/collection/components/lmvz-card/lmvz-card.js.map +0 -1
- package/dist/collection/components/lmvz-chip/lmvz-chip.js.map +0 -1
- package/dist/collection/components/lmvz-header/lmvz-header.js.map +0 -1
- package/dist/collection/components/lmvz-icon/icons.js.map +0 -1
- package/dist/collection/components/lmvz-icon/lmvz-icon.js.map +0 -1
- package/dist/collection/components/lmvz-icon/public.js.map +0 -1
- package/dist/collection/components/lmvz-icon/test/icons.unit.js.map +0 -1
- package/dist/collection/components/lmvz-input/lmvz-input.js.map +0 -1
- package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/integration/header-integration.js.map +0 -1
- package/dist/collection/utils/assets.js.map +0 -1
- package/dist/collection/utils/component.js.map +0 -1
- package/dist/collection/utils/effect.js.map +0 -1
- package/dist/collection/utils/element-activation-controller.js.map +0 -1
- package/dist/collection/utils/environment.js.map +0 -1
- package/dist/collection/utils/http.js.map +0 -1
- package/dist/collection/utils/http.test.js.map +0 -1
- package/dist/collection/utils/list-keyboard-controller.js.map +0 -1
- package/dist/collection/utils/public.js.map +0 -1
- package/dist/collection/utils/reactive-controller-host.js.map +0 -1
- package/dist/collection/utils/typing.js.map +0 -1
- package/dist/collection/utils/validation/aria-validation-controller.js.map +0 -1
- package/dist/collection/utils/validation/svg.js.map +0 -1
- package/dist/components/header-integration.d.ts +0 -11
- package/dist/components/header-integration.js +0 -2
- package/dist/components/header-integration.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/lmvz-action.js.map +0 -1
- package/dist/components/lmvz-button.js.map +0 -1
- package/dist/components/lmvz-card.js.map +0 -1
- package/dist/components/lmvz-chip.js.map +0 -1
- package/dist/components/lmvz-header.js.map +0 -1
- package/dist/components/lmvz-icon.js.map +0 -1
- package/dist/components/lmvz-input.js.map +0 -1
- package/dist/components/lmvz-menuitem.js.map +0 -1
- package/dist/components/p-B3JVFwO1.js.map +0 -1
- package/dist/components/p-B85MJLTf.js.map +0 -1
- package/dist/components/p-CN0JX9-m.js.map +0 -1
- package/dist/components/p-Cd4nH2vx.js +0 -2
- package/dist/components/p-Cd4nH2vx.js.map +0 -1
- package/dist/components/p-CdofjRtQ.js.map +0 -1
- package/dist/components/p-CkTUjPwD.js +0 -2
- package/dist/components/p-CkTUjPwD.js.map +0 -1
- package/dist/components/p-CpI4KFOu.js +0 -2
- package/dist/components/p-CpI4KFOu.js.map +0 -1
- package/dist/components/p-D1HbKFuh.js.map +0 -1
- package/dist/components/p-D7xthqTT.js +0 -2
- package/dist/components/p-D7xthqTT.js.map +0 -1
- package/dist/components/p-DBeynNeU.js +0 -2
- package/dist/components/p-DBeynNeU.js.map +0 -1
- package/dist/components/p-DMLRPGid.js.map +0 -1
- package/dist/components/p-UiqQVZhU.js +0 -2
- package/dist/components/p-UiqQVZhU.js.map +0 -1
- package/dist/components/p-Xq267cFM.js +0 -2
- package/dist/components/p-Xq267cFM.js.map +0 -1
- package/dist/components/p-glDDybgu.js +0 -2
- package/dist/components/p-glDDybgu.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/assets-K2FHD9qn.js +0 -18770
- package/dist/esm/assets-K2FHD9qn.js.map +0 -1
- package/dist/esm/axe-CZ0Rtkog.js +0 -32835
- package/dist/esm/axe-CZ0Rtkog.js.map +0 -1
- package/dist/esm/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-CW3FGLZC.js +0 -3657
- package/dist/esm/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-CW3FGLZC.js.map +0 -1
- package/dist/esm/header-integration_6.entry.js +0 -7
- package/dist/esm/header-integration_6.entry.js.map +0 -1
- package/dist/esm/icons-BITzEzmq.js +0 -1032
- package/dist/esm/icons-BITzEzmq.js.map +0 -1
- package/dist/esm/index-D2eyw7iv.js +0 -2101
- package/dist/esm/index-D2eyw7iv.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lmvz-action.entry.js.map +0 -1
- package/dist/esm/lmvz-card.entry.js.map +0 -1
- package/dist/esm/lmvz-chip.entry.js.map +0 -1
- package/dist/esm/lmvz-components.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/lmvz-components/index.esm.js.map +0 -1
- package/dist/lmvz-components/lmvz-components.esm.js.map +0 -1
- package/dist/lmvz-components/p-366a01f8.entry.js +0 -2
- package/dist/lmvz-components/p-366a01f8.entry.js.map +0 -1
- package/dist/lmvz-components/p-84ee7919.entry.js +0 -2
- package/dist/lmvz-components/p-84ee7919.entry.js.map +0 -1
- package/dist/lmvz-components/p-BLwPC3DQ.js +0 -2
- package/dist/lmvz-components/p-BLwPC3DQ.js.map +0 -1
- package/dist/lmvz-components/p-D2eyw7iv.js +0 -3
- package/dist/lmvz-components/p-D2eyw7iv.js.map +0 -1
- package/dist/lmvz-components/p-DANVVVBd.js +0 -7
- package/dist/lmvz-components/p-DANVVVBd.js.map +0 -1
- package/dist/lmvz-components/p-DQuL1Twl.js.map +0 -1
- package/dist/lmvz-components/p-DlDurXvX.js +0 -2
- package/dist/lmvz-components/p-DlDurXvX.js.map +0 -1
- package/dist/lmvz-components/p-Hc4uxoTU.js +0 -13
- package/dist/lmvz-components/p-Hc4uxoTU.js.map +0 -1
- package/dist/lmvz-components/p-a4200b26.entry.js +0 -2
- package/dist/lmvz-components/p-a4200b26.entry.js.map +0 -1
- package/dist/lmvz-components/p-d3243bae.entry.js +0 -2
- package/dist/lmvz-components/p-d3243bae.entry.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assets-K2FHD9qn.js","sources":["../../node_modules/effect/dist/esm/Function.js","../../node_modules/effect/dist/esm/Equivalence.js","../../node_modules/effect/dist/esm/GlobalValue.js","../../node_modules/effect/dist/esm/Predicate.js","../../node_modules/effect/dist/esm/internal/errors.js","../../node_modules/effect/dist/esm/Utils.js","../../node_modules/effect/dist/esm/Hash.js","../../node_modules/effect/dist/esm/Equal.js","../../node_modules/effect/dist/esm/Inspectable.js","../../node_modules/effect/dist/esm/Pipeable.js","../../node_modules/effect/dist/esm/internal/opCodes/effect.js","../../node_modules/effect/dist/esm/internal/version.js","../../node_modules/effect/dist/esm/internal/effectable.js","../../node_modules/effect/dist/esm/internal/option.js","../../node_modules/effect/dist/esm/internal/either.js","../../node_modules/effect/dist/esm/Either.js","../../node_modules/effect/dist/esm/internal/array.js","../../node_modules/effect/dist/esm/Order.js","../../node_modules/effect/dist/esm/Option.js","../../node_modules/effect/dist/esm/Tuple.js","../../node_modules/effect/dist/esm/Array.js","../../node_modules/effect/dist/esm/Number.js","../../node_modules/effect/dist/esm/RegExp.js","../../node_modules/effect/dist/esm/internal/context.js","../../node_modules/effect/dist/esm/Context.js","../../node_modules/effect/dist/esm/Chunk.js","../../node_modules/effect/dist/esm/Duration.js","../../node_modules/effect/dist/esm/internal/hashMap/config.js","../../node_modules/effect/dist/esm/internal/hashMap/bitwise.js","../../node_modules/effect/dist/esm/internal/stack.js","../../node_modules/effect/dist/esm/internal/hashMap/array.js","../../node_modules/effect/dist/esm/internal/hashMap/node.js","../../node_modules/effect/dist/esm/internal/hashMap.js","../../node_modules/effect/dist/esm/internal/hashSet.js","../../node_modules/effect/dist/esm/HashSet.js","../../node_modules/effect/dist/esm/MutableRef.js","../../node_modules/effect/dist/esm/internal/fiberId.js","../../node_modules/effect/dist/esm/FiberId.js","../../node_modules/effect/dist/esm/HashMap.js","../../node_modules/effect/dist/esm/List.js","../../node_modules/effect/dist/esm/internal/data.js","../../node_modules/effect/dist/esm/internal/differ/contextPatch.js","../../node_modules/effect/dist/esm/internal/differ/hashSetPatch.js","../../node_modules/effect/dist/esm/internal/differ/readonlyArrayPatch.js","../../node_modules/effect/dist/esm/internal/differ.js","../../node_modules/effect/dist/esm/internal/runtimeFlagsPatch.js","../../node_modules/effect/dist/esm/internal/runtimeFlags.js","../../node_modules/effect/dist/esm/RuntimeFlagsPatch.js","../../node_modules/effect/dist/esm/internal/blockedRequests.js","../../node_modules/effect/dist/esm/internal/opCodes/cause.js","../../node_modules/effect/dist/esm/internal/cause.js","../../node_modules/effect/dist/esm/internal/opCodes/deferred.js","../../node_modules/effect/dist/esm/internal/deferred.js","../../node_modules/effect/dist/esm/internal/singleShotGen.js","../../node_modules/effect/dist/esm/internal/core.js","../../node_modules/effect/dist/esm/MutableHashMap.js","../../node_modules/effect/dist/esm/internal/clock.js","../../node_modules/effect/dist/esm/internal/opCodes/configError.js","../../node_modules/effect/dist/esm/internal/configError.js","../../node_modules/effect/dist/esm/internal/configProvider/pathPatch.js","../../node_modules/effect/dist/esm/internal/opCodes/config.js","../../node_modules/effect/dist/esm/internal/configProvider.js","../../node_modules/effect/dist/esm/internal/defaultServices/console.js","../../node_modules/effect/dist/esm/internal/random.js","../../node_modules/effect/dist/esm/internal/tracer.js","../../node_modules/effect/dist/esm/internal/defaultServices.js","../../node_modules/effect/dist/esm/Clock.js","../../node_modules/effect/dist/esm/internal/fiberRefs.js","../../node_modules/effect/dist/esm/FiberRefs.js","../../node_modules/effect/dist/esm/LogLevel.js","../../node_modules/effect/dist/esm/internal/logSpan.js","../../node_modules/effect/dist/esm/Effectable.js","../../node_modules/effect/dist/esm/Readable.js","../../node_modules/effect/dist/esm/internal/ref.js","../../node_modules/effect/dist/esm/internal/fiberRefs/patch.js","../../node_modules/effect/dist/esm/internal/metric/label.js","../../node_modules/effect/dist/esm/internal/core-effect.js","../../node_modules/effect/dist/esm/internal/executionStrategy.js","../../node_modules/effect/dist/esm/ExecutionStrategy.js","../../node_modules/effect/dist/esm/FiberRefsPatch.js","../../node_modules/effect/dist/esm/internal/fiberStatus.js","../../node_modules/effect/dist/esm/FiberStatus.js","../../node_modules/effect/dist/esm/Micro.js","../../node_modules/effect/dist/esm/Scheduler.js","../../node_modules/effect/dist/esm/internal/completedRequestMap.js","../../node_modules/effect/dist/esm/internal/concurrency.js","../../node_modules/effect/dist/esm/internal/fiberMessage.js","../../node_modules/effect/dist/esm/internal/fiberScope.js","../../node_modules/effect/dist/esm/internal/fiber.js","../../node_modules/effect/dist/esm/internal/logger.js","../../node_modules/effect/dist/esm/internal/metric/boundaries.js","../../node_modules/effect/dist/esm/internal/metric/keyType.js","../../node_modules/effect/dist/esm/internal/metric/key.js","../../node_modules/effect/dist/esm/internal/metric/state.js","../../node_modules/effect/dist/esm/internal/metric/hook.js","../../node_modules/effect/dist/esm/internal/metric/pair.js","../../node_modules/effect/dist/esm/internal/metric/registry.js","../../node_modules/effect/dist/esm/internal/metric.js","../../node_modules/effect/dist/esm/internal/request.js","../../node_modules/effect/dist/esm/internal/supervisor.js","../../node_modules/effect/dist/esm/Differ.js","../../node_modules/effect/dist/esm/internal/supervisor/patch.js","../../node_modules/effect/dist/esm/internal/fiberRuntime.js","../../node_modules/effect/dist/esm/internal/schedule/interval.js","../../node_modules/effect/dist/esm/ScheduleInterval.js","../../node_modules/effect/dist/esm/internal/schedule/intervals.js","../../node_modules/effect/dist/esm/ScheduleIntervals.js","../../node_modules/effect/dist/esm/internal/schedule/decision.js","../../node_modules/effect/dist/esm/ScheduleDecision.js","../../node_modules/effect/dist/esm/Scope.js","../../node_modules/effect/dist/esm/internal/effect/circular.js","../../node_modules/effect/dist/esm/internal/managedRuntime/circular.js","../../node_modules/effect/dist/esm/internal/opCodes/layer.js","../../node_modules/effect/dist/esm/internal/runtime.js","../../node_modules/effect/dist/esm/internal/synchronizedRef.js","../../node_modules/effect/dist/esm/internal/layer.js","../../node_modules/effect/dist/esm/Data.js","../../node_modules/effect/dist/esm/internal/schedule.js","../../node_modules/effect/dist/esm/Effect.js","src/utils/environment.ts","src/utils/assets.ts"],"sourcesContent":["/**\n * Tests if a value is a `function`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isFunction } from \"effect/Predicate\"\n *\n * assert.deepStrictEqual(isFunction(isFunction), true)\n * assert.deepStrictEqual(isFunction(\"function\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isFunction = input => typeof input === \"function\";\n/**\n * Creates a function that can be used in a data-last (aka `pipe`able) or\n * data-first style.\n *\n * The first parameter to `dual` is either the arity of the uncurried function\n * or a predicate that determines if the function is being used in a data-first\n * or data-last style.\n *\n * Using the arity is the most common use case, but there are some cases where\n * you may want to use a predicate. For example, if you have a function that\n * takes an optional argument, you can use a predicate to determine if the\n * function is being used in a data-first or data-last style.\n *\n * You can pass either the arity of the uncurried function or a predicate\n * which determines if the function is being used in a data-first or\n * data-last style.\n *\n * **Example** (Using arity to determine data-first or data-last style)\n *\n * ```ts\n * import { dual, pipe } from \"effect/Function\"\n *\n * const sum = dual<\n * (that: number) => (self: number) => number,\n * (self: number, that: number) => number\n * >(2, (self, that) => self + that)\n *\n * console.log(sum(2, 3)) // 5\n * console.log(pipe(2, sum(3))) // 5\n * ```\n *\n * **Example** (Using call signatures to define the overloads)\n *\n * ```ts\n * import { dual, pipe } from \"effect/Function\"\n *\n * const sum: {\n * (that: number): (self: number) => number\n * (self: number, that: number): number\n * } = dual(2, (self: number, that: number): number => self + that)\n *\n * console.log(sum(2, 3)) // 5\n * console.log(pipe(2, sum(3))) // 5\n * ```\n *\n * **Example** (Using a predicate to determine data-first or data-last style)\n *\n * ```ts\n * import { dual, pipe } from \"effect/Function\"\n *\n * const sum = dual<\n * (that: number) => (self: number) => number,\n * (self: number, that: number) => number\n * >(\n * (args) => args.length === 2,\n * (self, that) => self + that\n * )\n *\n * console.log(sum(2, 3)) // 5\n * console.log(pipe(2, sum(3))) // 5\n * ```\n *\n * @since 2.0.0\n */\nexport const dual = function (arity, body) {\n if (typeof arity === \"function\") {\n return function () {\n if (arity(arguments)) {\n // @ts-expect-error\n return body.apply(this, arguments);\n }\n return self => body(self, ...arguments);\n };\n }\n switch (arity) {\n case 0:\n case 1:\n throw new RangeError(`Invalid arity ${arity}`);\n case 2:\n return function (a, b) {\n if (arguments.length >= 2) {\n return body(a, b);\n }\n return function (self) {\n return body(self, a);\n };\n };\n case 3:\n return function (a, b, c) {\n if (arguments.length >= 3) {\n return body(a, b, c);\n }\n return function (self) {\n return body(self, a, b);\n };\n };\n case 4:\n return function (a, b, c, d) {\n if (arguments.length >= 4) {\n return body(a, b, c, d);\n }\n return function (self) {\n return body(self, a, b, c);\n };\n };\n case 5:\n return function (a, b, c, d, e) {\n if (arguments.length >= 5) {\n return body(a, b, c, d, e);\n }\n return function (self) {\n return body(self, a, b, c, d);\n };\n };\n default:\n return function () {\n if (arguments.length >= arity) {\n // @ts-expect-error\n return body.apply(this, arguments);\n }\n const args = arguments;\n return function (self) {\n return body(self, ...args);\n };\n };\n }\n};\n/**\n * Apply a function to given values.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, apply } from \"effect/Function\"\n * import { length } from \"effect/String\"\n *\n * assert.deepStrictEqual(pipe(length, apply(\"hello\")), 5)\n * ```\n *\n * @since 2.0.0\n */\nexport const apply = (...a) => self => self(...a);\n/**\n * The identity function, i.e. A function that returns its input argument.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { identity } from \"effect/Function\"\n *\n * assert.deepStrictEqual(identity(5), 5)\n * ```\n *\n * @since 2.0.0\n */\nexport const identity = a => a;\n/**\n * A function that ensures that the type of an expression matches some type,\n * without changing the resulting type of that expression.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { satisfies } from \"effect/Function\"\n *\n * const test1 = satisfies<number>()(5 as const)\n * //^? const test: 5\n * // @ts-expect-error\n * const test2 = satisfies<string>()(5)\n * //^? Argument of type 'number' is not assignable to parameter of type 'string'\n *\n * assert.deepStrictEqual(satisfies<number>()(5), 5)\n * ```\n *\n * @since 2.0.0\n */\nexport const satisfies = () => b => b;\n/**\n * Casts the result to the specified type.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { unsafeCoerce, identity } from \"effect/Function\"\n *\n * assert.deepStrictEqual(unsafeCoerce, identity)\n * ```\n *\n * @since 2.0.0\n */\nexport const unsafeCoerce = identity;\n/**\n * Creates a constant value that never changes.\n *\n * This is useful when you want to pass a value to a higher-order function (a function that takes another function as its argument)\n * and want that inner function to always use the same value, no matter how many times it is called.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { constant } from \"effect/Function\"\n *\n * const constNull = constant(null)\n *\n * assert.deepStrictEqual(constNull(), null)\n * assert.deepStrictEqual(constNull(), null)\n * ```\n *\n * @since 2.0.0\n */\nexport const constant = value => () => value;\n/**\n * A thunk that returns always `true`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { constTrue } from \"effect/Function\"\n *\n * assert.deepStrictEqual(constTrue(), true)\n * ```\n *\n * @since 2.0.0\n */\nexport const constTrue = /*#__PURE__*/constant(true);\n/**\n * A thunk that returns always `false`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { constFalse } from \"effect/Function\"\n *\n * assert.deepStrictEqual(constFalse(), false)\n * ```\n *\n * @since 2.0.0\n */\nexport const constFalse = /*#__PURE__*/constant(false);\n/**\n * A thunk that returns always `null`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { constNull } from \"effect/Function\"\n *\n * assert.deepStrictEqual(constNull(), null)\n * ```\n *\n * @since 2.0.0\n */\nexport const constNull = /*#__PURE__*/constant(null);\n/**\n * A thunk that returns always `undefined`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { constUndefined } from \"effect/Function\"\n *\n * assert.deepStrictEqual(constUndefined(), undefined)\n * ```\n *\n * @since 2.0.0\n */\nexport const constUndefined = /*#__PURE__*/constant(undefined);\n/**\n * A thunk that returns always `void`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { constVoid } from \"effect/Function\"\n *\n * assert.deepStrictEqual(constVoid(), undefined)\n * ```\n *\n * @since 2.0.0\n */\nexport const constVoid = constUndefined;\n/**\n * Reverses the order of arguments for a curried function.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { flip } from \"effect/Function\"\n *\n * const f = (a: number) => (b: string) => a - b.length\n *\n * assert.deepStrictEqual(flip(f)('aaa')(2), -1)\n * ```\n *\n * @since 2.0.0\n */\nexport const flip = f => (...b) => (...a) => f(...a)(...b);\n/**\n * Composes two functions, `ab` and `bc` into a single function that takes in an argument `a` of type `A` and returns a result of type `C`.\n * The result is obtained by first applying the `ab` function to `a` and then applying the `bc` function to the result of `ab`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { compose } from \"effect/Function\"\n *\n * const increment = (n: number) => n + 1;\n * const square = (n: number) => n * n;\n *\n * assert.strictEqual(compose(increment, square)(2), 9);\n * ```\n *\n * @since 2.0.0\n */\nexport const compose = /*#__PURE__*/dual(2, (ab, bc) => a => bc(ab(a)));\n/**\n * The `absurd` function is a stub for cases where a value of type `never` is encountered in your code,\n * meaning that it should be impossible for this code to be executed.\n *\n * This function is particularly useful when it's necessary to specify that certain cases are impossible.\n *\n * @since 2.0.0\n */\nexport const absurd = _ => {\n throw new Error(\"Called `absurd` function which should be uncallable\");\n};\n/**\n * Creates a version of this function: instead of `n` arguments, it accepts a single tuple argument.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { tupled } from \"effect/Function\"\n *\n * const sumTupled = tupled((x: number, y: number): number => x + y)\n *\n * assert.deepStrictEqual(sumTupled([1, 2]), 3)\n * ```\n *\n * @since 2.0.0\n */\nexport const tupled = f => a => f(...a);\n/**\n * Inverse function of `tupled`\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { untupled } from \"effect/Function\"\n *\n * const getFirst = untupled(<A, B>(tuple: [A, B]): A => tuple[0])\n *\n * assert.deepStrictEqual(getFirst(1, 2), 1)\n * ```\n *\n * @since 2.0.0\n */\nexport const untupled = f => (...a) => f(a);\nexport function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {\n switch (arguments.length) {\n case 1:\n return a;\n case 2:\n return ab(a);\n case 3:\n return bc(ab(a));\n case 4:\n return cd(bc(ab(a)));\n case 5:\n return de(cd(bc(ab(a))));\n case 6:\n return ef(de(cd(bc(ab(a)))));\n case 7:\n return fg(ef(de(cd(bc(ab(a))))));\n case 8:\n return gh(fg(ef(de(cd(bc(ab(a)))))));\n case 9:\n return hi(gh(fg(ef(de(cd(bc(ab(a))))))));\n default:\n {\n let ret = arguments[0];\n for (let i = 1; i < arguments.length; i++) {\n ret = arguments[i](ret);\n }\n return ret;\n }\n }\n}\nexport function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {\n switch (arguments.length) {\n case 1:\n return ab;\n case 2:\n return function () {\n return bc(ab.apply(this, arguments));\n };\n case 3:\n return function () {\n return cd(bc(ab.apply(this, arguments)));\n };\n case 4:\n return function () {\n return de(cd(bc(ab.apply(this, arguments))));\n };\n case 5:\n return function () {\n return ef(de(cd(bc(ab.apply(this, arguments)))));\n };\n case 6:\n return function () {\n return fg(ef(de(cd(bc(ab.apply(this, arguments))))));\n };\n case 7:\n return function () {\n return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));\n };\n case 8:\n return function () {\n return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));\n };\n case 9:\n return function () {\n return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));\n };\n }\n return;\n}\n/**\n * Type hole simulation.\n *\n * @since 2.0.0\n */\nexport const hole = /*#__PURE__*/unsafeCoerce(absurd);\n/**\n * The SK combinator, also known as the \"S-K combinator\" or \"S-combinator\", is a fundamental combinator in the\n * lambda calculus and the SKI combinator calculus.\n *\n * This function is useful for discarding the first argument passed to it and returning the second argument.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { SK } from \"effect/Function\";\n *\n * assert.deepStrictEqual(SK(0, \"hello\"), \"hello\")\n * ```\n *\n * @since 2.0.0\n */\nexport const SK = (_, b) => b;\n//# sourceMappingURL=Function.js.map","/**\n * This module provides an implementation of the `Equivalence` type class, which defines a binary relation\n * that is reflexive, symmetric, and transitive. In other words, it defines a notion of equivalence between values of a certain type.\n * These properties are also known in mathematics as an \"equivalence relation\".\n *\n * @since 2.0.0\n */\nimport { dual } from \"./Function.js\";\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const make = isEquivalent => (self, that) => self === that || isEquivalent(self, that);\nconst isStrictEquivalent = (x, y) => x === y;\n/**\n * Return an `Equivalence` that uses strict equality (===) to compare values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const strict = () => isStrictEquivalent;\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const string = /*#__PURE__*/strict();\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const number = /*#__PURE__*/strict();\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const boolean = /*#__PURE__*/strict();\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const bigint = /*#__PURE__*/strict();\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const symbol = /*#__PURE__*/strict();\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const combine = /*#__PURE__*/dual(2, (self, that) => make((x, y) => self(x, y) && that(x, y)));\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const combineMany = /*#__PURE__*/dual(2, (self, collection) => make((x, y) => {\n if (!self(x, y)) {\n return false;\n }\n for (const equivalence of collection) {\n if (!equivalence(x, y)) {\n return false;\n }\n }\n return true;\n}));\nconst isAlwaysEquivalent = (_x, _y) => true;\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const combineAll = collection => combineMany(isAlwaysEquivalent, collection);\n/**\n * @category mapping\n * @since 2.0.0\n */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => make((x, y) => self(f(x), f(y))));\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const Date = /*#__PURE__*/mapInput(number, date => date.getTime());\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const product = /*#__PURE__*/dual(2, (self, that) => make(([xa, xb], [ya, yb]) => self(xa, ya) && that(xb, yb)));\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const all = collection => {\n return make((x, y) => {\n const len = Math.min(x.length, y.length);\n let collectionLength = 0;\n for (const equivalence of collection) {\n if (collectionLength >= len) {\n break;\n }\n if (!equivalence(x[collectionLength], y[collectionLength])) {\n return false;\n }\n collectionLength++;\n }\n return true;\n });\n};\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const productMany = (self, collection) => {\n const equivalence = all(collection);\n return make((x, y) => !self(x[0], y[0]) ? false : equivalence(x.slice(1), y.slice(1)));\n};\n/**\n * Similar to `Promise.all` but operates on `Equivalence`s.\n *\n * ```ts skip-type-checking\n * [Equivalence<A>, Equivalence<B>, ...] -> Equivalence<[A, B, ...]>\n * ```\n *\n * Given a tuple of `Equivalence`s returns a new `Equivalence` that compares values of a tuple\n * by applying each `Equivalence` to the corresponding element of the tuple.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const tuple = (...elements) => all(elements);\n/**\n * Creates a new `Equivalence` for an array of values based on a given `Equivalence` for the elements of the array.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const array = item => make((self, that) => {\n if (self.length !== that.length) {\n return false;\n }\n for (let i = 0; i < self.length; i++) {\n const isEq = item(self[i], that[i]);\n if (!isEq) {\n return false;\n }\n }\n return true;\n});\n/**\n * Given a struct of `Equivalence`s returns a new `Equivalence` that compares values of a struct\n * by applying each `Equivalence` to the corresponding property of the struct.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const struct = fields => {\n const keys = Object.keys(fields);\n return make((self, that) => {\n for (const key of keys) {\n if (!fields[key](self[key], that[key])) {\n return false;\n }\n }\n return true;\n });\n};\n//# sourceMappingURL=Equivalence.js.map","/**\n * The `GlobalValue` module ensures that a single instance of a value is created globally,\n * even when modules are imported multiple times (e.g., due to mixing CommonJS and ESM builds)\n * or during hot-reloading in development environments like Next.js or Remix.\n *\n * It achieves this by using a versioned global store, identified by a unique `Symbol` tied to\n * the current version of the `effect` library. The store holds values that are keyed by an identifier,\n * allowing the reuse of previously computed instances across imports or reloads.\n *\n * This pattern is particularly useful in scenarios where frequent reloading can cause services or\n * single-instance objects to be recreated unnecessarily, such as in development environments with hot-reloading.\n *\n * @since 2.0.0\n */\nconst globalStoreId = `effect/GlobalValue`;\nlet globalStore;\n/**\n * Retrieves or computes a global value associated with the given `id`. If the value for this `id`\n * has already been computed, it will be returned from the global store. If it does not exist yet,\n * the provided `compute` function will be executed to compute the value, store it, and then return it.\n *\n * This ensures that even in cases where the module is imported multiple times (e.g., in mixed environments\n * like CommonJS and ESM, or during hot-reloading in development), the value is computed only once and reused\n * thereafter.\n *\n * @example\n * ```ts\n * import { globalValue } from \"effect/GlobalValue\"\n *\n * // This cache will persist as long as the module is running,\n * // even if reloaded or imported elsewhere\n * const myCache = globalValue(\n * Symbol.for(\"myCache\"),\n * () => new WeakMap<object, number>()\n * )\n * ```\n *\n * @since 2.0.0\n */\nexport const globalValue = (id, compute) => {\n if (!globalStore) {\n // @ts-expect-error\n globalThis[globalStoreId] ??= new Map();\n // @ts-expect-error\n globalStore = globalThis[globalStoreId];\n }\n if (!globalStore.has(id)) {\n globalStore.set(id, compute());\n }\n return globalStore.get(id);\n};\n//# sourceMappingURL=GlobalValue.js.map","/**\n * This module provides a collection of functions for working with predicates and refinements.\n *\n * A `Predicate<A>` is a function that takes a value of type `A` and returns a boolean.\n * It is used to check if a value satisfies a certain condition.\n *\n * A `Refinement<A, B>` is a special type of predicate that not only checks a condition\n * but also provides a type guard, allowing TypeScript to narrow the type of the input\n * value from `A` to a more specific type `B` within a conditional block.\n *\n * The module includes:\n * - Basic predicates and refinements for common types (e.g., `isString`, `isNumber`).\n * - Combinators to create new predicates from existing ones (e.g., `and`, `or`, `not`).\n * - Advanced combinators for working with data structures (e.g., `tuple`, `struct`).\n * - Type-level utilities for inspecting predicate and refinement types.\n *\n * @since 2.0.0\n */\nimport { dual, isFunction as isFunction_ } from \"./Function.js\";\n/**\n * Transforms a `Predicate<A>` into a `Predicate<B>` by applying a function `(b: B) => A`\n * to the input before passing it to the predicate. This is also known as \"contramap\" or\n * \"pre-composition\".\n *\n * @example\n * ```ts\n * import { Predicate, Number } from \"effect\"\n * import * as assert from \"node:assert\"\n *\n * // A predicate on numbers\n * const isPositive: Predicate.Predicate<number> = Number.greaterThan(0)\n *\n * // A function from `string` to `number`\n * const stringLength = (s: string): number => s.length\n *\n * // Create a new predicate on strings by mapping the input\n * const hasPositiveLength = Predicate.mapInput(isPositive, stringLength)\n *\n * assert.strictEqual(hasPositiveLength(\"hello\"), true)\n * assert.strictEqual(hasPositiveLength(\"\"), false)\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => b => self(f(b)));\n/**\n * A refinement that checks if a `ReadonlyArray<T>` is a tuple with exactly `N` elements.\n * If the check is successful, the type is narrowed to `TupleOf<N, T>`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isTupleOf } from \"effect/Predicate\"\n *\n * const isTupleOf3 = isTupleOf(3)\n *\n * assert.strictEqual(isTupleOf3([1, 2, 3]), true);\n * assert.strictEqual(isTupleOf3([1, 2]), false);\n *\n * const arr: number[] = [1, 2, 3];\n * if (isTupleOf(arr, 3)) {\n * // The type of arr is now [number, number, number]\n * const [a, b, c] = arr;\n * assert.deepStrictEqual([a, b, c], [1, 2, 3])\n * }\n * ```\n *\n * @category guards\n * @since 3.3.0\n */\nexport const isTupleOf = /*#__PURE__*/dual(2, (self, n) => self.length === n);\n/**\n * A refinement that checks if a `ReadonlyArray<T>` is a tuple with at least `N` elements.\n * If the check is successful, the type is narrowed to `TupleOfAtLeast<N, T>`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isTupleOfAtLeast } from \"effect/Predicate\"\n *\n * const isTupleOfAtLeast3 = isTupleOfAtLeast(3)\n *\n * assert.strictEqual(isTupleOfAtLeast3([1, 2, 3]), true);\n * assert.strictEqual(isTupleOfAtLeast3([1, 2, 3, 4]), true);\n * assert.strictEqual(isTupleOfAtLeast3([1, 2]), false);\n *\n * const arr: number[] = [1, 2, 3, 4];\n * if (isTupleOfAtLeast(arr, 3)) {\n * // The type of arr is now [number, number, number, ...number[]]\n * const [a, b, c] = arr;\n * assert.deepStrictEqual([a, b, c], [1, 2, 3])\n * }\n * ```\n *\n * @category guards\n * @since 3.3.0\n */\nexport const isTupleOfAtLeast = /*#__PURE__*/dual(2, (self, n) => self.length >= n);\n/**\n * A predicate that checks if a value is \"truthy\" in JavaScript.\n * Fails for `false`, `0`, `-0`, `0n`, `\"\"`, `null`, `undefined`, and `NaN`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isTruthy } from \"effect/Predicate\"\n *\n * assert.strictEqual(isTruthy(1), true)\n * assert.strictEqual(isTruthy(\"hello\"), true)\n * assert.strictEqual(isTruthy({}), true)\n *\n * assert.strictEqual(isTruthy(0), false)\n * assert.strictEqual(isTruthy(\"\"), false)\n * assert.strictEqual(isTruthy(null), false)\n * assert.strictEqual(isTruthy(undefined), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isTruthy = input => !!input;\n/**\n * A refinement that checks if a value is a `Set`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isSet } from \"effect/Predicate\"\n *\n * assert.strictEqual(isSet(new Set([1, 2])), true)\n * assert.strictEqual(isSet(new Set()), true)\n *\n * assert.strictEqual(isSet({}), false)\n * assert.strictEqual(isSet([1, 2]), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isSet = input => input instanceof Set;\n/**\n * A refinement that checks if a value is a `Map`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isMap } from \"effect/Predicate\"\n *\n * assert.strictEqual(isMap(new Map()), true)\n *\n * assert.strictEqual(isMap({}), false)\n * assert.strictEqual(isMap(new Set()), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isMap = input => input instanceof Map;\n/**\n * A refinement that checks if a value is a `string`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isString } from \"effect/Predicate\"\n *\n * assert.strictEqual(isString(\"hello\"), true)\n * assert.strictEqual(isString(\"\"), true)\n *\n * assert.strictEqual(isString(123), false)\n * assert.strictEqual(isString(null), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isString = input => typeof input === \"string\";\n/**\n * A refinement that checks if a value is a `number`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNumber } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNumber(123), true)\n * assert.strictEqual(isNumber(0), true)\n * assert.strictEqual(isNumber(-1.5), true)\n * assert.strictEqual(isNumber(NaN), true)\n *\n * assert.strictEqual(isNumber(\"123\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNumber = input => typeof input === \"number\";\n/**\n * A refinement that checks if a value is a `boolean`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isBoolean } from \"effect/Predicate\"\n *\n * assert.strictEqual(isBoolean(true), true)\n * assert.strictEqual(isBoolean(false), true)\n *\n * assert.strictEqual(isBoolean(\"true\"), false)\n * assert.strictEqual(isBoolean(0), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isBoolean = input => typeof input === \"boolean\";\n/**\n * A refinement that checks if a value is a `bigint`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isBigInt } from \"effect/Predicate\"\n *\n * assert.strictEqual(isBigInt(1n), true)\n *\n * assert.strictEqual(isBigInt(1), false)\n * assert.strictEqual(isBigInt(\"1\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isBigInt = input => typeof input === \"bigint\";\n/**\n * A refinement that checks if a value is a `symbol`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isSymbol } from \"effect/Predicate\"\n *\n * assert.strictEqual(isSymbol(Symbol.for(\"a\")), true)\n *\n * assert.strictEqual(isSymbol(\"a\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isSymbol = input => typeof input === \"symbol\";\n// TODO: make public\n/**\n * A refinement that checks if a value is a valid `PropertyKey` (a `string`, `number`, or `symbol`).\n * @internal\n */\nexport const isPropertyKey = u => isString(u) || isNumber(u) || isSymbol(u);\n/**\n * A refinement that checks if a value is a `Function`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isFunction } from \"effect/Predicate\"\n *\n * assert.strictEqual(isFunction(() => {}), true)\n * assert.strictEqual(isFunction(isFunction), true)\n *\n * assert.strictEqual(isFunction(\"function\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isFunction = isFunction_;\n/**\n * A refinement that checks if a value is `undefined`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isUndefined } from \"effect/Predicate\"\n *\n * assert.strictEqual(isUndefined(undefined), true)\n *\n * assert.strictEqual(isUndefined(null), false)\n * assert.strictEqual(isUndefined(\"undefined\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isUndefined = input => input === undefined;\n/**\n * A refinement that checks if a value is not `undefined`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNotUndefined } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNotUndefined(null), true)\n * assert.strictEqual(isNotUndefined(\"value\"), true)\n *\n * assert.strictEqual(isNotUndefined(undefined), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNotUndefined = input => input !== undefined;\n/**\n * A refinement that checks if a value is `null`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNull } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNull(null), true)\n *\n * assert.strictEqual(isNull(undefined), false)\n * assert.strictEqual(isNull(\"null\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNull = input => input === null;\n/**\n * A refinement that checks if a value is not `null`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNotNull } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNotNull(undefined), true)\n * assert.strictEqual(isNotNull(\"value\"), true)\n *\n * assert.strictEqual(isNotNull(null), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNotNull = input => input !== null;\n/**\n * A refinement that always returns `false`. The type is narrowed to `never`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNever } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNever(1), false)\n * assert.strictEqual(isNever(null), false)\n * assert.strictEqual(isNever({}), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNever = _ => false;\n/**\n * A refinement that always returns `true`. The type is narrowed to `unknown`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isUnknown } from \"effect/Predicate\"\n *\n * assert.strictEqual(isUnknown(1), true)\n * assert.strictEqual(isUnknown(null), true)\n * assert.strictEqual(isUnknown({}), true)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isUnknown = _ => true;\n/**\n * Checks if the input is an object or an array.\n * @internal\n */\nexport const isRecordOrArray = input => typeof input === \"object\" && input !== null;\n/**\n * A refinement that checks if a value is an `object`. Note that in JavaScript,\n * arrays and functions are also considered objects.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isObject } from \"effect/Predicate\"\n *\n * assert.strictEqual(isObject({}), true)\n * assert.strictEqual(isObject([]), true)\n * assert.strictEqual(isObject(() => {}), true)\n *\n * assert.strictEqual(isObject(null), false)\n * assert.strictEqual(isObject(\"hello\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n * @see isRecord to check for plain objects (excluding arrays and functions).\n */\nexport const isObject = input => isRecordOrArray(input) || isFunction(input);\n/**\n * A refinement that checks if a value is an object-like value and has a specific property key.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { hasProperty } from \"effect/Predicate\"\n *\n * assert.strictEqual(hasProperty({ a: 1 }, \"a\"), true)\n * assert.strictEqual(hasProperty({ a: 1 }, \"b\"), false)\n *\n * const value: unknown = { name: \"Alice\" };\n * if (hasProperty(value, \"name\")) {\n * // The type of `value` is narrowed to `{ name: unknown }`\n * // and we can safely access `value.name`\n * console.log(value.name)\n * }\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const hasProperty = /*#__PURE__*/dual(2, (self, property) => isObject(self) && property in self);\n/**\n * A refinement that checks if a value is an object with a `_tag` property\n * that matches the given tag. This is a powerful tool for working with\n * discriminated union types.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isTagged } from \"effect/Predicate\"\n *\n * type Shape = { _tag: \"circle\"; radius: number } | { _tag: \"square\"; side: number }\n *\n * const isCircle = isTagged(\"circle\")\n *\n * const shape1: Shape = { _tag: \"circle\", radius: 10 }\n * const shape2: Shape = { _tag: \"square\", side: 5 }\n *\n * assert.strictEqual(isCircle(shape1), true)\n * assert.strictEqual(isCircle(shape2), false)\n *\n * if (isCircle(shape1)) {\n * // shape1 is now narrowed to { _tag: \"circle\"; radius: number }\n * assert.strictEqual(shape1.radius, 10)\n * }\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isTagged = /*#__PURE__*/dual(2, (self, tag) => hasProperty(self, \"_tag\") && self[\"_tag\"] === tag);\n/**\n * A refinement that checks if a value is either `null` or `undefined`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNullable } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNullable(null), true)\n * assert.strictEqual(isNullable(undefined), true)\n *\n * assert.strictEqual(isNullable(0), false)\n * assert.strictEqual(isNullable(\"\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n * @see isNotNullable\n */\nexport const isNullable = input => input === null || input === undefined;\n/**\n * A refinement that checks if a value is neither `null` nor `undefined`.\n * The type is narrowed to `NonNullable<A>`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isNotNullable } from \"effect/Predicate\"\n *\n * assert.strictEqual(isNotNullable(0), true)\n * assert.strictEqual(isNotNullable(\"hello\"), true)\n *\n * assert.strictEqual(isNotNullable(null), false)\n * assert.strictEqual(isNotNullable(undefined), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n * @see isNullable\n */\nexport const isNotNullable = input => input !== null && input !== undefined;\n/**\n * A refinement that checks if a value is an instance of `Error`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isError } from \"effect/Predicate\"\n *\n * assert.strictEqual(isError(new Error(\"boom\")), true)\n * assert.strictEqual(isError(new TypeError(\"boom\")), true)\n *\n * assert.strictEqual(isError({ message: \"boom\" }), false)\n * assert.strictEqual(isError(\"boom\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isError = input => input instanceof Error;\n/**\n * A refinement that checks if a value is a `Uint8Array`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isUint8Array } from \"effect/Predicate\"\n *\n * assert.strictEqual(isUint8Array(new Uint8Array()), true)\n *\n * assert.strictEqual(isUint8Array(new Uint16Array()), false)\n * assert.strictEqual(isUint8Array([1, 2, 3]), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isUint8Array = input => input instanceof Uint8Array;\n/**\n * A refinement that checks if a value is a `Date` object.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isDate } from \"effect/Predicate\"\n *\n * assert.strictEqual(isDate(new Date()), true)\n *\n * assert.strictEqual(isDate(Date.now()), false) // `Date.now()` returns a number\n * assert.strictEqual(isDate(\"2023-01-01\"), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isDate = input => input instanceof Date;\n/**\n * A refinement that checks if a value is an `Iterable`.\n * Many built-in types are iterable, such as `Array`, `string`, `Map`, and `Set`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isIterable } from \"effect/Predicate\"\n *\n * assert.strictEqual(isIterable([]), true)\n * assert.strictEqual(isIterable(\"hello\"), true)\n * assert.strictEqual(isIterable(new Set()), true)\n *\n * assert.strictEqual(isIterable({}), false)\n * assert.strictEqual(isIterable(123), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isIterable = input => typeof input === \"string\" || hasProperty(input, Symbol.iterator);\n/**\n * A refinement that checks if a value is a record (i.e., a plain object).\n * This check returns `false` for arrays, `null`, and functions.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isRecord } from \"effect/Predicate\"\n *\n * assert.strictEqual(isRecord({}), true)\n * assert.strictEqual(isRecord({ a: 1 }), true)\n *\n * assert.strictEqual(isRecord([]), false)\n * assert.strictEqual(isRecord(new Date()), false)\n * assert.strictEqual(isRecord(null), false)\n * assert.strictEqual(isRecord(() => null), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n * @see isObject\n */\nexport const isRecord = input => isRecordOrArray(input) && !Array.isArray(input);\n/**\n * A refinement that checks if a value is a readonly record (i.e., a plain object).\n * This check returns `false` for arrays, `null`, and functions.\n *\n * This is an alias for `isRecord`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isReadonlyRecord } from \"effect/Predicate\"\n *\n * assert.strictEqual(isReadonlyRecord({}), true)\n * assert.strictEqual(isReadonlyRecord({ a: 1 }), true)\n *\n * assert.strictEqual(isReadonlyRecord([]), false)\n * assert.strictEqual(isReadonlyRecord(null), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isReadonlyRecord = isRecord;\n/**\n * A refinement that checks if a value is a `Promise`. It performs a duck-typing check\n * for `.then` and `.catch` methods.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isPromise } from \"effect/Predicate\"\n *\n * assert.strictEqual(isPromise(Promise.resolve(1)), true)\n * assert.strictEqual(isPromise(new Promise(() => {})), true)\n *\n * assert.strictEqual(isPromise({ then() {} }), false) // Missing .catch\n * assert.strictEqual(isPromise({}), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n * @see isPromiseLike\n */\nexport const isPromise = input => hasProperty(input, \"then\") && \"catch\" in input && isFunction(input.then) && isFunction(input.catch);\n/**\n * A refinement that checks if a value is `PromiseLike`. It performs a duck-typing\n * check for a `.then` method.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isPromiseLike } from \"effect/Predicate\"\n *\n * assert.strictEqual(isPromiseLike(Promise.resolve(1)), true)\n * assert.strictEqual(isPromiseLike({ then: () => {} }), true)\n *\n * assert.strictEqual(isPromiseLike({}), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n * @see isPromise\n */\nexport const isPromiseLike = input => hasProperty(input, \"then\") && isFunction(input.then);\n/**\n * A refinement that checks if a value is a `RegExp`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * assert.strictEqual(Predicate.isRegExp(/a/), true)\n * assert.strictEqual(Predicate.isRegExp(new RegExp(\"a\")), true)\n *\n * assert.strictEqual(Predicate.isRegExp(\"/a/\"), false)\n * ```\n *\n * @category guards\n * @since 3.9.0\n */\nexport const isRegExp = input => input instanceof RegExp;\n/**\n * Composes a `Refinement` with another `Refinement` or `Predicate`.\n *\n * This can be used to chain checks. The first refinement is applied, and if it\n * passes, the second check is applied to the same value, potentially refining\n * the type further.\n *\n * @example\n * ```ts\n * import { Predicate } from \"effect\"\n * import * as assert from \"node:assert\"\n *\n * const isString = (u: unknown): u is string => typeof u === \"string\"\n * const minLength = (n: number) => (s: string): boolean => s.length >= n\n *\n * // Create a refinement that checks for a string with a minimum length of 3\n * const isLongString = Predicate.compose(isString, minLength(3))\n *\n * let value: unknown = \"hello\"\n *\n * assert.strictEqual(isLongString(value), true)\n * if (isLongString(value)) {\n * // value is narrowed to string\n * assert.strictEqual(value.toUpperCase(), \"HELLO\")\n * }\n * assert.strictEqual(isLongString(\"hi\"), false)\n * ```\n *\n * @since 2.0.0\n */\nexport const compose = /*#__PURE__*/dual(2, (ab, bc) => a => ab(a) && bc(a));\n/**\n * Combines two predicates to test a tuple of two values. The first predicate tests the\n * first element of the tuple, and the second predicate tests the second element.\n *\n * @category combining\n * @since 2.0.0\n */\nexport const product = (self, that) => ([a, b]) => self(a) && that(b);\n/**\n * Takes an iterable of predicates and returns a new predicate that tests an array of values.\n * The new predicate returns `true` if each predicate at a given index is satisfied by the\n * value at the same index in the array. The check stops at the length of the shorter of\n * the two iterables (predicates or values).\n *\n * @category combining\n * @since 2.0.0\n * @see tuple for a more powerful, variadic version.\n */\nexport const all = collection => {\n return as => {\n let collectionIndex = 0;\n for (const p of collection) {\n if (collectionIndex >= as.length) {\n break;\n }\n if (p(as[collectionIndex]) === false) {\n return false;\n }\n collectionIndex++;\n }\n return true;\n };\n};\n/**\n * Combines a predicate for a single value and an iterable of predicates for the rest of an array.\n * Useful for checking the head and tail of an array separately.\n *\n * @category combining\n * @since 2.0.0\n */\nexport const productMany = (self, collection) => {\n const rest = all(collection);\n return ([head, ...tail]) => self(head) === false ? false : rest(tail);\n};\n/**\n * Combines an array of predicates into a single predicate that tests an array of values.\n * This function is highly type-aware and will produce a `Refinement` if any of the provided\n * predicates are `Refinement`s, allowing for powerful type-narrowing of tuples.\n *\n * - If all predicates are `Predicate<T>`, the result is `Predicate<[T, T, ...]>`.\n * - If any predicate is a `Refinement<A, B>`, the result is a `Refinement` that narrows\n * the input tuple type to a more specific tuple type.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isString = (u: unknown): u is string => typeof u === \"string\"\n * const isNumber = (u: unknown): u is number => typeof u === \"number\"\n *\n * // Create a refinement for a [string, number] tuple\n * const isStringNumberTuple = Predicate.tuple(isString, isNumber)\n *\n * const value: [unknown, unknown] = [\"hello\", 123]\n * if (isStringNumberTuple(value)) {\n * // value is narrowed to [string, number]\n * const [s, n] = value\n * assert.strictEqual(s.toUpperCase(), \"HELLO\")\n * assert.strictEqual(n.toFixed(2), \"123.00\")\n * }\n * assert.strictEqual(isStringNumberTuple([\"hello\", \"123\"]), false)\n * ```\n *\n * @since 2.0.0\n */\nexport const tuple = (...elements) => all(elements);\n/**\n * Combines a record of predicates into a single predicate that tests a record of values.\n * This function is highly type-aware and will produce a `Refinement` if any of the provided\n * predicates are `Refinement`s, allowing for powerful type-narrowing of structs.\n *\n * - If all predicates are `Predicate<T>`, the result is `Predicate<{ k: T, ... }>`.\n * - If any predicate is a `Refinement<A, B>`, the result is a `Refinement` that narrows\n * the input record type to a more specific record type.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isString = (u: unknown): u is string => typeof u === \"string\"\n * const isNumber = (u: unknown): u is number => typeof u === \"number\"\n *\n * const personPredicate = Predicate.struct({\n * name: isString,\n * age: isNumber\n * })\n *\n * const value: { name: unknown; age: unknown } = { name: \"Alice\", age: 30 }\n * if (personPredicate(value)) {\n * // value is narrowed to { name: string; age: number }\n * assert.strictEqual(value.name.toUpperCase(), \"ALICE\")\n * assert.strictEqual(value.age.toFixed(0), \"30\")\n * }\n * assert.strictEqual(personPredicate({ name: \"Bob\", age: \"40\" }), false)\n * ```\n *\n * @since 2.0.0\n */\nexport const struct = fields => {\n const keys = Object.keys(fields);\n return a => {\n for (const key of keys) {\n if (!fields[key](a[key])) {\n return false;\n }\n }\n return true;\n };\n};\n/**\n * Returns a new predicate that is the logical negation of the given predicate.\n *\n * **Note**: If the input is a `Refinement`, the resulting predicate will be a\n * simple `Predicate`, as TypeScript cannot infer the negative type.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate, Number } from \"effect\"\n *\n * const isNonPositive = Predicate.not(Number.greaterThan(0))\n *\n * assert.strictEqual(isNonPositive(-1), true)\n * assert.strictEqual(isNonPositive(0), true)\n * assert.strictEqual(isNonPositive(1), false)\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const not = self => a => !self(a);\n/**\n * Combines two predicates with a logical \"OR\". The resulting predicate returns `true`\n * if at least one of the predicates returns `true`.\n *\n * If both predicates are `Refinement`s, the resulting predicate is a `Refinement` to the\n * union of their target types (`B | C`).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isString = (u: unknown): u is string => typeof u === \"string\"\n * const isNumber = (u: unknown): u is number => typeof u === \"number\"\n *\n * const isStringOrNumber = Predicate.or(isString, isNumber)\n *\n * assert.strictEqual(isStringOrNumber(\"hello\"), true)\n * assert.strictEqual(isStringOrNumber(123), true)\n * assert.strictEqual(isStringOrNumber(null), false)\n *\n * const value: unknown = \"world\"\n * if (isStringOrNumber(value)) {\n * // value is narrowed to string | number\n * console.log(value)\n * }\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const or = /*#__PURE__*/dual(2, (self, that) => a => self(a) || that(a));\n/**\n * Combines two predicates with a logical \"AND\". The resulting predicate returns `true`\n * only if both of the predicates return `true`.\n *\n * If both predicates are `Refinement`s, the resulting predicate is a `Refinement` to the\n * intersection of their target types (`B & C`).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * type Person = { name: string }\n * type Employee = { id: number }\n *\n * const hasName = (u: unknown): u is Person => Predicate.hasProperty(u, \"name\") && typeof (u as any).name === \"string\"\n * const hasId = (u: unknown): u is Employee => Predicate.hasProperty(u, \"id\") && typeof (u as any).id === \"number\"\n *\n * const isPersonAndEmployee = Predicate.and(hasName, hasId)\n *\n * const val: unknown = { name: \"Alice\", id: 123 }\n * if (isPersonAndEmployee(val)) {\n * // val is narrowed to Person & Employee\n * assert.strictEqual(val.name, \"Alice\")\n * assert.strictEqual(val.id, 123)\n * }\n *\n * assert.strictEqual(isPersonAndEmployee({ name: \"Bob\" }), false) // Missing id\n * assert.strictEqual(isPersonAndEmployee({ id: 456 }), false) // Missing name\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const and = /*#__PURE__*/dual(2, (self, that) => a => self(a) && that(a));\n/**\n * Combines two predicates with a logical \"XOR\" (exclusive OR). The resulting predicate\n * returns `true` if one of the predicates returns `true`, but not both.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isPositive = (n: number) => n > 0\n * const isEven = (n: number) => n % 2 === 0\n *\n * const isPositiveXorEven = Predicate.xor(isPositive, isEven)\n *\n * assert.strictEqual(isPositiveXorEven(4), false) // both true -> false\n * assert.strictEqual(isPositiveXorEven(3), true) // one true -> true\n * assert.strictEqual(isPositiveXorEven(-2), true) // one true -> true\n * assert.strictEqual(isPositiveXorEven(-1), false) // both false -> false\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const xor = /*#__PURE__*/dual(2, (self, that) => a => self(a) !== that(a));\n/**\n * Combines two predicates with a logical \"EQV\" (equivalence). The resulting predicate\n * returns `true` if both predicates return the same boolean value (both `true` or both `false`).\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isPositive = (n: number) => n > 0\n * const isEven = (n: number) => n % 2 === 0\n *\n * const isPositiveEqvEven = Predicate.eqv(isPositive, isEven)\n *\n * assert.strictEqual(isPositiveEqvEven(4), true) // both true -> true\n * assert.strictEqual(isPositiveEqvEven(3), false) // different -> false\n * assert.strictEqual(isPositiveEqvEven(-2), false) // different -> false\n * assert.strictEqual(isPositiveEqvEven(-1), true) // both false -> true\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const eqv = /*#__PURE__*/dual(2, (self, that) => a => self(a) === that(a));\n/**\n * Creates a predicate that represents a logical \"if-then\" rule.\n *\n * Think of it as a conditional promise: **\"If `antecedent` holds true, then I promise `consequent` will also be true.\"**\n *\n * This function is invaluable for defining complex validation logic where one condition dictates another.\n *\n * ### How It Works\n *\n * The rule only fails (returns `false`) when the \"if\" part is `true`, but the \"then\" part is `false`.\n * In all other cases, the promise is considered kept, and the result is `true`.\n *\n * This includes the concept of **\"vacuous truth\"**: if the \"if\" part is `false`, the rule doesn't apply,\n * so the promise isn't broken, and the result is `true`. (e.g., \"If it rains, I'll bring an umbrella.\"\n * If it doesn't rain, you haven't broken your promise, no matter what).\n *\n * ### Key Details\n *\n * - **Logical Equivalence**: `implies(p, q)` is the same as `not(p).or(q)`, or simply `!p || q`\n * in plain JavaScript. This can be a helpful way to reason about its behavior.\n *\n * - **Type-Safety Warning**: This function always returns a `Predicate`, never a type-narrowing\n * `Refinement`. A `true` result doesn't guarantee the `consequent` passed (it could be `true`\n * simply because the `antecedent` was `false`), so it cannot be used to safely narrow a type.\n *\n * @example\n * ```ts\n * // Rule: A user can only be an admin if they also belong to the \"staff\" group.\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * type User = {\n * isStaff: boolean\n * isAdmin: boolean\n * }\n *\n * const isValidUserPermission = Predicate.implies(\n * // antecedent: \"if\" the user is an admin...\n * (user: User) => user.isAdmin,\n * // consequent: \"then\" they must be staff.\n * (user: User) => user.isStaff\n * )\n *\n * // A non-admin who is not staff. Rule doesn't apply (antecedent is false).\n * assert.strictEqual(isValidUserPermission({ isStaff: false, isAdmin: false }), true)\n *\n * // A staff member who is not an admin. Rule doesn't apply (antecedent is false).\n * assert.strictEqual(isValidUserPermission({ isStaff: true, isAdmin: false }), true)\n *\n * // An admin who is also staff. The rule was followed.\n * assert.strictEqual(isValidUserPermission({ isStaff: true, isAdmin: true }), true)\n *\n * // An admin who is NOT staff. The rule was broken!\n * assert.strictEqual(isValidUserPermission({ isStaff: false, isAdmin: true }), false)\n * ```\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const implies = /*#__PURE__*/dual(2, (antecedent, consequent) => a => antecedent(a) ? consequent(a) : true);\n/**\n * Combines two predicates with a logical \"NOR\" (negated OR). The resulting predicate\n * returns `true` only if both predicates return `false`.\n * This is equivalent to `not(or(p, q))`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const nor = /*#__PURE__*/dual(2, (self, that) => a => !(self(a) || that(a)));\n/**\n * Combines two predicates with a logical \"NAND\" (negated AND). The resulting predicate\n * returns `true` if at least one of the predicates returns `false`.\n * This is equivalent to `not(and(p, q))`.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const nand = /*#__PURE__*/dual(2, (self, that) => a => !(self(a) && that(a)));\n/**\n * Takes an iterable of predicates and returns a new predicate. The new predicate\n * returns `true` if all predicates in the collection return `true` for a given value.\n *\n * This is like `Array.prototype.every` but for a collection of predicates.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isPositive = (n: number) => n > 0\n * const isEven = (n: number) => n % 2 === 0\n *\n * const isPositiveAndEven = Predicate.every([isPositive, isEven])\n *\n * assert.strictEqual(isPositiveAndEven(4), true)\n * assert.strictEqual(isPositiveAndEven(3), false)\n * assert.strictEqual(isPositiveAndEven(-2), false)\n * ```\n *\n * @category elements\n * @since 2.0.0\n * @see some\n */\nexport const every = collection => a => {\n for (const p of collection) {\n if (!p(a)) {\n return false;\n }\n }\n return true;\n};\n/**\n * Takes an iterable of predicates and returns a new predicate. The new predicate\n * returns `true` if at least one predicate in the collection returns `true` for a given value.\n *\n * This is like `Array.prototype.some` but for a collection of predicates.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Predicate } from \"effect\"\n *\n * const isNegative = (n: number) => n < 0\n * const isOdd = (n: number) => n % 2 !== 0\n *\n * const isNegativeOrOdd = Predicate.some([isNegative, isOdd])\n *\n * assert.strictEqual(isNegativeOrOdd(-2), true) // isNegative is true\n * assert.strictEqual(isNegativeOrOdd(3), true) // isOdd is true\n * assert.strictEqual(isNegativeOrOdd(4), false) // both are false\n * ```\n *\n * @category elements\n * @since 2.0.0\n * @see every\n */\nexport const some = collection => a => {\n for (const p of collection) {\n if (p(a)) {\n return true;\n }\n }\n return false;\n};\n//# sourceMappingURL=Predicate.js.map","/**\n * @since 2.0.0\n */\n/** @internal */\nexport const getBugErrorMessage = message => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;\n//# sourceMappingURL=errors.js.map","/**\n * @since 2.0.0\n */\nimport { identity } from \"./Function.js\";\nimport { globalValue } from \"./GlobalValue.js\";\nimport { getBugErrorMessage } from \"./internal/errors.js\";\nimport { isNullable, isObject } from \"./Predicate.js\";\n/*\n * Copyright 2014 Thom Chiovoloni, released under the MIT license.\n *\n * A random number generator based on the basic implementation of the PCG algorithm,\n * as described here: http://www.pcg-random.org/\n *\n * Adapted for TypeScript from Thom's original code at https://github.com/thomcc/pcg-random\n *\n * forked from https://github.com/frptools\n *\n * @since 2.0.0\n */\n/**\n * @category symbols\n * @since 2.0.0\n */\nexport const GenKindTypeId = /*#__PURE__*/Symbol.for(\"effect/Gen/GenKind\");\n/**\n * @category predicates\n * @since 3.0.6\n */\nexport const isGenKind = u => isObject(u) && GenKindTypeId in u;\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport class GenKindImpl {\n value;\n constructor(\n /**\n * @since 2.0.0\n */\n value) {\n this.value = value;\n }\n /**\n * @since 2.0.0\n */\n get _F() {\n return identity;\n }\n /**\n * @since 2.0.0\n */\n get _R() {\n return _ => _;\n }\n /**\n * @since 2.0.0\n */\n get _O() {\n return _ => _;\n }\n /**\n * @since 2.0.0\n */\n get _E() {\n return _ => _;\n }\n /**\n * @since 2.0.0\n */\n [GenKindTypeId] = GenKindTypeId;\n /**\n * @since 2.0.0\n */\n [Symbol.iterator]() {\n return new SingleShotGen(this);\n }\n}\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport class SingleShotGen {\n self;\n called = false;\n constructor(self) {\n this.self = self;\n }\n /**\n * @since 2.0.0\n */\n next(a) {\n return this.called ? {\n value: a,\n done: true\n } : (this.called = true, {\n value: this.self,\n done: false\n });\n }\n /**\n * @since 2.0.0\n */\n return(a) {\n return {\n value: a,\n done: true\n };\n }\n /**\n * @since 2.0.0\n */\n throw(e) {\n throw e;\n }\n /**\n * @since 2.0.0\n */\n [Symbol.iterator]() {\n return new SingleShotGen(this.self);\n }\n}\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const makeGenKind = kind => new GenKindImpl(kind);\n/**\n * @category adapters\n * @since 2.0.0\n */\nexport const adapter = () => function () {\n let x = arguments[0];\n for (let i = 1; i < arguments.length; i++) {\n x = arguments[i](x);\n }\n return new GenKindImpl(x);\n};\nconst defaultIncHi = 0x14057b7e;\nconst defaultIncLo = 0xf767814f;\nconst MUL_HI = 0x5851f42d >>> 0;\nconst MUL_LO = 0x4c957f2d >>> 0;\nconst BIT_53 = 9007199254740992.0;\nconst BIT_27 = 134217728.0;\n/**\n * PCG is a family of simple fast space-efficient statistically good algorithms\n * for random number generation. Unlike many general-purpose RNGs, they are also\n * hard to predict.\n *\n * @category model\n * @since 2.0.0\n */\nexport class PCGRandom {\n _state;\n constructor(seedHi, seedLo, incHi, incLo) {\n if (isNullable(seedLo) && isNullable(seedHi)) {\n seedLo = Math.random() * 0xffffffff >>> 0;\n seedHi = 0;\n } else if (isNullable(seedLo)) {\n seedLo = seedHi;\n seedHi = 0;\n }\n if (isNullable(incLo) && isNullable(incHi)) {\n incLo = this._state ? this._state[3] : defaultIncLo;\n incHi = this._state ? this._state[2] : defaultIncHi;\n } else if (isNullable(incLo)) {\n incLo = incHi;\n incHi = 0;\n }\n this._state = new Int32Array([0, 0, incHi >>> 0, ((incLo || 0) | 1) >>> 0]);\n this._next();\n add64(this._state, this._state[0], this._state[1], seedHi >>> 0, seedLo >>> 0);\n this._next();\n return this;\n }\n /**\n * Returns a copy of the internal state of this random number generator as a\n * JavaScript Array.\n *\n * @category getters\n * @since 2.0.0\n */\n getState() {\n return [this._state[0], this._state[1], this._state[2], this._state[3]];\n }\n /**\n * Restore state previously retrieved using `getState()`.\n *\n * @since 2.0.0\n */\n setState(state) {\n this._state[0] = state[0];\n this._state[1] = state[1];\n this._state[2] = state[2];\n this._state[3] = state[3] | 1;\n }\n /**\n * Get a uniformly distributed 32 bit integer between [0, max).\n *\n * @category getter\n * @since 2.0.0\n */\n integer(max) {\n return Math.round(this.number() * Number.MAX_SAFE_INTEGER) % max;\n }\n /**\n * Get a uniformly distributed IEEE-754 double between 0.0 and 1.0, with\n * 53 bits of precision (every bit of the mantissa is randomized).\n *\n * @category getters\n * @since 2.0.0\n */\n number() {\n const hi = (this._next() & 0x03ffffff) * 1.0;\n const lo = (this._next() & 0x07ffffff) * 1.0;\n return (hi * BIT_27 + lo) / BIT_53;\n }\n /** @internal */\n _next() {\n // save current state (what we'll use for this number)\n const oldHi = this._state[0] >>> 0;\n const oldLo = this._state[1] >>> 0;\n // churn LCG.\n mul64(this._state, oldHi, oldLo, MUL_HI, MUL_LO);\n add64(this._state, this._state[0], this._state[1], this._state[2], this._state[3]);\n // get least sig. 32 bits of ((oldstate >> 18) ^ oldstate) >> 27\n let xsHi = oldHi >>> 18;\n let xsLo = (oldLo >>> 18 | oldHi << 14) >>> 0;\n xsHi = (xsHi ^ oldHi) >>> 0;\n xsLo = (xsLo ^ oldLo) >>> 0;\n const xorshifted = (xsLo >>> 27 | xsHi << 5) >>> 0;\n // rotate xorshifted right a random amount, based on the most sig. 5 bits\n // bits of the old state.\n const rot = oldHi >>> 27;\n const rot2 = (-rot >>> 0 & 31) >>> 0;\n return (xorshifted >>> rot | xorshifted << rot2) >>> 0;\n }\n}\nfunction mul64(out, aHi, aLo, bHi, bLo) {\n let c1 = (aLo >>> 16) * (bLo & 0xffff) >>> 0;\n let c0 = (aLo & 0xffff) * (bLo >>> 16) >>> 0;\n let lo = (aLo & 0xffff) * (bLo & 0xffff) >>> 0;\n let hi = (aLo >>> 16) * (bLo >>> 16) + ((c0 >>> 16) + (c1 >>> 16)) >>> 0;\n c0 = c0 << 16 >>> 0;\n lo = lo + c0 >>> 0;\n if (lo >>> 0 < c0 >>> 0) {\n hi = hi + 1 >>> 0;\n }\n c1 = c1 << 16 >>> 0;\n lo = lo + c1 >>> 0;\n if (lo >>> 0 < c1 >>> 0) {\n hi = hi + 1 >>> 0;\n }\n hi = hi + Math.imul(aLo, bHi) >>> 0;\n hi = hi + Math.imul(aHi, bLo) >>> 0;\n out[0] = hi;\n out[1] = lo;\n}\n// add two 64 bit numbers (given in parts), and store the result in `out`.\nfunction add64(out, aHi, aLo, bHi, bLo) {\n let hi = aHi + bHi >>> 0;\n const lo = aLo + bLo >>> 0;\n if (lo >>> 0 < aLo >>> 0) {\n hi = hi + 1 | 0;\n }\n out[0] = hi;\n out[1] = lo;\n}\n/**\n * @since 3.0.6\n */\nexport const YieldWrapTypeId = /*#__PURE__*/Symbol.for(\"effect/Utils/YieldWrap\");\n/**\n * @since 3.0.6\n */\nexport class YieldWrap {\n /**\n * @since 3.0.6\n */\n #value;\n constructor(value) {\n this.#value = value;\n }\n /**\n * @since 3.0.6\n */\n [YieldWrapTypeId]() {\n return this.#value;\n }\n}\n/**\n * @since 3.0.6\n */\nexport function yieldWrapGet(self) {\n if (typeof self === \"object\" && self !== null && YieldWrapTypeId in self) {\n return self[YieldWrapTypeId]();\n }\n throw new Error(getBugErrorMessage(\"yieldWrapGet\"));\n}\n/**\n * Note: this is an experimental feature made available to allow custom matchers in tests, not to be directly used yet in user code\n *\n * @since 3.1.1\n * @status experimental\n * @category modifiers\n */\nexport const structuralRegionState = /*#__PURE__*/globalValue(\"effect/Utils/isStructuralRegion\", () => ({\n enabled: false,\n tester: undefined\n}));\n/**\n * Note: this is an experimental feature made available to allow custom matchers in tests, not to be directly used yet in user code\n *\n * @since 3.1.1\n * @status experimental\n * @category modifiers\n */\nexport const structuralRegion = (body, tester) => {\n const current = structuralRegionState.enabled;\n const currentTester = structuralRegionState.tester;\n structuralRegionState.enabled = true;\n if (tester) {\n structuralRegionState.tester = tester;\n }\n try {\n return body();\n } finally {\n structuralRegionState.enabled = current;\n structuralRegionState.tester = currentTester;\n }\n};\nconst standard = {\n effect_internal_function: body => {\n return body();\n }\n};\nconst forced = {\n effect_internal_function: body => {\n try {\n return body();\n } finally {\n //\n }\n }\n};\nconst isNotOptimizedAway = /*#__PURE__*/standard.effect_internal_function(() => new Error().stack)?.includes(\"effect_internal_function\") === true;\n/**\n * @since 3.2.2\n * @status experimental\n * @category tracing\n */\nexport const internalCall = isNotOptimizedAway ? standard.effect_internal_function : forced.effect_internal_function;\nconst genConstructor = function* () {}.constructor;\n/**\n * @since 3.11.0\n */\nexport const isGeneratorFunction = u => isObject(u) && u.constructor === genConstructor;\n//# sourceMappingURL=Utils.js.map","/**\n * @since 2.0.0\n */\nimport { pipe } from \"./Function.js\";\nimport { globalValue } from \"./GlobalValue.js\";\nimport { hasProperty } from \"./Predicate.js\";\nimport { structuralRegionState } from \"./Utils.js\";\n/** @internal */\nconst randomHashCache = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Hash/randomHashCache\"), () => new WeakMap());\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const symbol = /*#__PURE__*/Symbol.for(\"effect/Hash\");\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const hash = self => {\n if (structuralRegionState.enabled === true) {\n return 0;\n }\n switch (typeof self) {\n case \"number\":\n return number(self);\n case \"bigint\":\n return string(self.toString(10));\n case \"boolean\":\n return string(String(self));\n case \"symbol\":\n return string(String(self));\n case \"string\":\n return string(self);\n case \"undefined\":\n return string(\"undefined\");\n case \"function\":\n case \"object\":\n {\n if (self === null) {\n return string(\"null\");\n } else if (self instanceof Date) {\n if (Number.isNaN(self.getTime())) {\n return string(\"Invalid Date\");\n }\n return hash(self.toISOString());\n } else if (self instanceof URL) {\n return hash(self.href);\n } else if (isHash(self)) {\n return self[symbol]();\n } else {\n return random(self);\n }\n }\n default:\n throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);\n }\n};\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const random = self => {\n if (!randomHashCache.has(self)) {\n randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));\n }\n return randomHashCache.get(self);\n};\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const combine = b => self => self * 53 ^ b;\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const optimize = n => n & 0xbfffffff | n >>> 1 & 0x40000000;\n/**\n * @since 2.0.0\n * @category guards\n */\nexport const isHash = u => hasProperty(u, symbol);\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const number = n => {\n if (n !== n || n === Infinity) {\n return 0;\n }\n let h = n | 0;\n if (h !== n) {\n h ^= n * 0xffffffff;\n }\n while (n > 0xffffffff) {\n h ^= n /= 0xffffffff;\n }\n return optimize(h);\n};\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const string = str => {\n let h = 5381,\n i = str.length;\n while (i) {\n h = h * 33 ^ str.charCodeAt(--i);\n }\n return optimize(h);\n};\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const structureKeys = (o, keys) => {\n let h = 12289;\n for (let i = 0; i < keys.length; i++) {\n h ^= pipe(string(keys[i]), combine(hash(o[keys[i]])));\n }\n return optimize(h);\n};\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const structure = o => structureKeys(o, Object.keys(o));\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const array = arr => {\n let h = 6151;\n for (let i = 0; i < arr.length; i++) {\n h = pipe(h, combine(hash(arr[i])));\n }\n return optimize(h);\n};\n/**\n * @since 2.0.0\n * @category hashing\n */\nexport const cached = function () {\n if (arguments.length === 1) {\n const self = arguments[0];\n return function (hash) {\n Object.defineProperty(self, symbol, {\n value() {\n return hash;\n },\n enumerable: false\n });\n return hash;\n };\n }\n const self = arguments[0];\n const hash = arguments[1];\n Object.defineProperty(self, symbol, {\n value() {\n return hash;\n },\n enumerable: false\n });\n return hash;\n};\n//# sourceMappingURL=Hash.js.map","import * as Hash from \"./Hash.js\";\nimport { hasProperty } from \"./Predicate.js\";\nimport { structuralRegionState } from \"./Utils.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const symbol = /*#__PURE__*/Symbol.for(\"effect/Equal\");\nexport function equals() {\n if (arguments.length === 1) {\n return self => compareBoth(self, arguments[0]);\n }\n return compareBoth(arguments[0], arguments[1]);\n}\nfunction compareBoth(self, that) {\n if (self === that) {\n return true;\n }\n const selfType = typeof self;\n if (selfType !== typeof that) {\n return false;\n }\n if (selfType === \"object\" || selfType === \"function\") {\n if (self !== null && that !== null) {\n if (isEqual(self) && isEqual(that)) {\n if (Hash.hash(self) === Hash.hash(that) && self[symbol](that)) {\n return true;\n } else {\n return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;\n }\n } else if (self instanceof Date && that instanceof Date) {\n const t1 = self.getTime();\n const t2 = that.getTime();\n return t1 === t2 || Number.isNaN(t1) && Number.isNaN(t2);\n } else if (self instanceof URL && that instanceof URL) {\n return self.href === that.href;\n }\n }\n if (structuralRegionState.enabled) {\n if (Array.isArray(self) && Array.isArray(that)) {\n return self.length === that.length && self.every((v, i) => compareBoth(v, that[i]));\n }\n if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {\n const keysSelf = Object.keys(self);\n const keysThat = Object.keys(that);\n if (keysSelf.length === keysThat.length) {\n for (const key of keysSelf) {\n // @ts-expect-error\n if (!(key in that && compareBoth(self[key], that[key]))) {\n return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;\n }\n }\n return true;\n }\n }\n return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;\n }\n }\n return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;\n}\n/**\n * @since 2.0.0\n * @category guards\n */\nexport const isEqual = u => hasProperty(u, symbol);\n/**\n * @since 2.0.0\n * @category instances\n */\nexport const equivalence = () => equals;\n//# sourceMappingURL=Equal.js.map","import { globalValue } from \"./GlobalValue.js\";\nimport * as Predicate from \"./Predicate.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const NodeInspectSymbol = /*#__PURE__*/Symbol.for(\"nodejs.util.inspect.custom\");\n/**\n * @since 2.0.0\n */\nexport const toJSON = x => {\n try {\n if (Predicate.hasProperty(x, \"toJSON\") && Predicate.isFunction(x[\"toJSON\"]) && x[\"toJSON\"].length === 0) {\n return x.toJSON();\n } else if (Array.isArray(x)) {\n return x.map(toJSON);\n }\n } catch {\n return {};\n }\n return redact(x);\n};\nconst CIRCULAR = \"[Circular]\";\n/** @internal */\nexport function formatDate(date) {\n try {\n return date.toISOString();\n } catch {\n return \"Invalid Date\";\n }\n}\nfunction safeToString(input) {\n try {\n const s = input.toString();\n return typeof s === \"string\" ? s : String(s);\n } catch {\n return \"[toString threw]\";\n }\n}\n/** @internal */\nexport function formatPropertyKey(name) {\n return Predicate.isString(name) ? JSON.stringify(name) : String(name);\n}\n/** @internal */\nexport function formatUnknown(input, options) {\n const space = options?.space ?? 0;\n const seen = new WeakSet();\n const gap = !space ? \"\" : Predicate.isNumber(space) ? \" \".repeat(space) : space;\n const ind = d => gap.repeat(d);\n const wrap = (v, body) => {\n const ctor = v?.constructor;\n return ctor && ctor !== Object.prototype.constructor && ctor.name ? `${ctor.name}(${body})` : body;\n };\n const ownKeys = o => {\n try {\n return Reflect.ownKeys(o);\n } catch {\n return [\"[ownKeys threw]\"];\n }\n };\n function go(v, d = 0) {\n if (Array.isArray(v)) {\n if (seen.has(v)) return CIRCULAR;\n seen.add(v);\n if (!gap || v.length <= 1) return `[${v.map(x => go(x, d)).join(\",\")}]`;\n const inner = v.map(x => go(x, d + 1)).join(\",\\n\" + ind(d + 1));\n return `[\\n${ind(d + 1)}${inner}\\n${ind(d)}]`;\n }\n if (Predicate.isDate(v)) return formatDate(v);\n if (!options?.ignoreToString && Predicate.hasProperty(v, \"toString\") && Predicate.isFunction(v[\"toString\"]) && v[\"toString\"] !== Object.prototype.toString && v[\"toString\"] !== Array.prototype.toString) {\n const s = safeToString(v);\n if (v instanceof Error && v.cause) {\n return `${s} (cause: ${go(v.cause, d)})`;\n }\n return s;\n }\n if (Predicate.isString(v)) return JSON.stringify(v);\n if (Predicate.isNumber(v) || v == null || Predicate.isBoolean(v) || Predicate.isSymbol(v)) return String(v);\n if (Predicate.isBigInt(v)) return String(v) + \"n\";\n if (v instanceof Set || v instanceof Map) {\n if (seen.has(v)) return CIRCULAR;\n seen.add(v);\n return `${v.constructor.name}(${go(Array.from(v), d)})`;\n }\n if (Predicate.isObject(v)) {\n if (seen.has(v)) return CIRCULAR;\n seen.add(v);\n const keys = ownKeys(v);\n if (!gap || keys.length <= 1) {\n const body = `{${keys.map(k => `${formatPropertyKey(k)}:${go(v[k], d)}`).join(\",\")}}`;\n return wrap(v, body);\n }\n const body = `{\\n${keys.map(k => `${ind(d + 1)}${formatPropertyKey(k)}: ${go(v[k], d + 1)}`).join(\",\\n\")}\\n${ind(d)}}`;\n return wrap(v, body);\n }\n return String(v);\n }\n return go(input, 0);\n}\n/**\n * @since 2.0.0\n */\nexport const format = x => JSON.stringify(x, null, 2);\n/**\n * @since 2.0.0\n */\nexport const BaseProto = {\n toJSON() {\n return toJSON(this);\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n toString() {\n return format(this.toJSON());\n }\n};\n/**\n * @since 2.0.0\n */\nexport class Class {\n /**\n * @since 2.0.0\n */\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n /**\n * @since 2.0.0\n */\n toString() {\n return format(this.toJSON());\n }\n}\n/**\n * @since 2.0.0\n */\nexport const toStringUnknown = (u, whitespace = 2) => {\n if (typeof u === \"string\") {\n return u;\n }\n try {\n return typeof u === \"object\" ? stringifyCircular(u, whitespace) : String(u);\n } catch {\n return String(u);\n }\n};\n/**\n * @since 2.0.0\n */\nexport const stringifyCircular = (obj, whitespace) => {\n let cache = [];\n const retVal = JSON.stringify(obj, (_key, value) => typeof value === \"object\" && value !== null ? cache.includes(value) ? undefined // circular reference\n : cache.push(value) && (redactableState.fiberRefs !== undefined && isRedactable(value) ? value[symbolRedactable](redactableState.fiberRefs) : value) : value, whitespace);\n cache = undefined;\n return retVal;\n};\n/**\n * @since 3.10.0\n * @category redactable\n */\nexport const symbolRedactable = /*#__PURE__*/Symbol.for(\"effect/Inspectable/Redactable\");\n/**\n * @since 3.10.0\n * @category redactable\n */\nexport const isRedactable = u => typeof u === \"object\" && u !== null && symbolRedactable in u;\nconst redactableState = /*#__PURE__*/globalValue(\"effect/Inspectable/redactableState\", () => ({\n fiberRefs: undefined\n}));\n/**\n * @since 3.10.0\n * @category redactable\n */\nexport const withRedactableContext = (context, f) => {\n const prev = redactableState.fiberRefs;\n redactableState.fiberRefs = context;\n try {\n return f();\n } finally {\n redactableState.fiberRefs = prev;\n }\n};\n/**\n * @since 3.10.0\n * @category redactable\n */\nexport const redact = u => {\n if (isRedactable(u) && redactableState.fiberRefs !== undefined) {\n return u[symbolRedactable](redactableState.fiberRefs);\n }\n return u;\n};\n//# sourceMappingURL=Inspectable.js.map","/**\n * @since 2.0.0\n */\n/**\n * @since 2.0.0\n */\nexport const pipeArguments = (self, args) => {\n switch (args.length) {\n case 0:\n return self;\n case 1:\n return args[0](self);\n case 2:\n return args[1](args[0](self));\n case 3:\n return args[2](args[1](args[0](self)));\n case 4:\n return args[3](args[2](args[1](args[0](self))));\n case 5:\n return args[4](args[3](args[2](args[1](args[0](self)))));\n case 6:\n return args[5](args[4](args[3](args[2](args[1](args[0](self))))));\n case 7:\n return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))));\n case 8:\n return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));\n case 9:\n return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));\n default:\n {\n let ret = self;\n for (let i = 0, len = args.length; i < len; i++) {\n ret = args[i](ret);\n }\n return ret;\n }\n }\n};\n/**\n * @since 3.15.0\n * @category Prototypes\n */\nexport const Prototype = {\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst Base = /*#__PURE__*/function () {\n function PipeableBase() {}\n PipeableBase.prototype = Prototype;\n return PipeableBase;\n}();\n/**\n * @since 3.15.0\n * @category Constructors\n */\nexport const Class = klass => klass ? class extends klass {\n pipe() {\n return pipeArguments(this, arguments);\n }\n} : Base;\n//# sourceMappingURL=Pipeable.js.map","/** @internal */\nexport const OP_ASYNC = \"Async\";\n/** @internal */\nexport const OP_COMMIT = \"Commit\";\n/** @internal */\nexport const OP_FAILURE = \"Failure\";\n/** @internal */\nexport const OP_ON_FAILURE = \"OnFailure\";\n/** @internal */\nexport const OP_ON_SUCCESS = \"OnSuccess\";\n/** @internal */\nexport const OP_ON_SUCCESS_AND_FAILURE = \"OnSuccessAndFailure\";\n/** @internal */\nexport const OP_SUCCESS = \"Success\";\n/** @internal */\nexport const OP_SYNC = \"Sync\";\n/** @internal */\nexport const OP_TAG = \"Tag\";\n/** @internal */\nexport const OP_UPDATE_RUNTIME_FLAGS = \"UpdateRuntimeFlags\";\n/** @internal */\nexport const OP_WHILE = \"While\";\n/** @internal */\nexport const OP_ITERATOR = \"Iterator\";\n/** @internal */\nexport const OP_WITH_RUNTIME = \"WithRuntime\";\n/** @internal */\nexport const OP_YIELD = \"Yield\";\n/** @internal */\nexport const OP_REVERT_FLAGS = \"RevertFlags\";\n//# sourceMappingURL=effect.js.map","let moduleVersion = \"3.19.14\";\nexport const getCurrentVersion = () => moduleVersion;\nexport const setCurrentVersion = version => {\n moduleVersion = version;\n};\n//# sourceMappingURL=version.js.map","import * as Equal from \"../Equal.js\";\nimport * as Hash from \"../Hash.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { SingleShotGen, YieldWrap } from \"../Utils.js\";\nimport * as OpCodes from \"./opCodes/effect.js\";\nimport * as version from \"./version.js\";\n/** @internal */\nexport const EffectTypeId = /*#__PURE__*/Symbol.for(\"effect/Effect\");\n/** @internal */\nexport const StreamTypeId = /*#__PURE__*/Symbol.for(\"effect/Stream\");\n/** @internal */\nexport const SinkTypeId = /*#__PURE__*/Symbol.for(\"effect/Sink\");\n/** @internal */\nexport const ChannelTypeId = /*#__PURE__*/Symbol.for(\"effect/Channel\");\n/** @internal */\nexport const effectVariance = {\n /* c8 ignore next */\n _R: _ => _,\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _A: _ => _,\n _V: /*#__PURE__*/version.getCurrentVersion()\n};\nconst sinkVariance = {\n /* c8 ignore next */\n _A: _ => _,\n /* c8 ignore next */\n _In: _ => _,\n /* c8 ignore next */\n _L: _ => _,\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _R: _ => _\n};\nconst channelVariance = {\n /* c8 ignore next */\n _Env: _ => _,\n /* c8 ignore next */\n _InErr: _ => _,\n /* c8 ignore next */\n _InElem: _ => _,\n /* c8 ignore next */\n _InDone: _ => _,\n /* c8 ignore next */\n _OutErr: _ => _,\n /* c8 ignore next */\n _OutElem: _ => _,\n /* c8 ignore next */\n _OutDone: _ => _\n};\n/** @internal */\nexport const EffectPrototype = {\n [EffectTypeId]: effectVariance,\n [StreamTypeId]: effectVariance,\n [SinkTypeId]: sinkVariance,\n [ChannelTypeId]: channelVariance,\n [Equal.symbol](that) {\n return this === that;\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.random(this));\n },\n [Symbol.iterator]() {\n return new SingleShotGen(new YieldWrap(this));\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const StructuralPrototype = {\n [Hash.symbol]() {\n return Hash.cached(this, Hash.structure(this));\n },\n [Equal.symbol](that) {\n const selfKeys = Object.keys(this);\n const thatKeys = Object.keys(that);\n if (selfKeys.length !== thatKeys.length) {\n return false;\n }\n for (const key of selfKeys) {\n if (!(key in that && Equal.equals(this[key], that[key]))) {\n return false;\n }\n }\n return true;\n }\n};\n/** @internal */\nexport const CommitPrototype = {\n ...EffectPrototype,\n _op: OpCodes.OP_COMMIT\n};\n/** @internal */\nexport const StructuralCommitPrototype = {\n ...CommitPrototype,\n ...StructuralPrototype\n};\n/** @internal */\nexport const Base = /*#__PURE__*/function () {\n function Base() {}\n Base.prototype = CommitPrototype;\n return Base;\n}();\n/** @internal */\nexport const StructuralBase = /*#__PURE__*/function () {\n function Base() {}\n Base.prototype = StructuralCommitPrototype;\n return Base;\n}();\n//# sourceMappingURL=effectable.js.map","/**\n * @since 2.0.0\n */\nimport * as Equal from \"../Equal.js\";\nimport * as Hash from \"../Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport { EffectPrototype } from \"./effectable.js\";\nconst TypeId = /*#__PURE__*/Symbol.for(\"effect/Option\");\nconst CommonProto = {\n ...EffectPrototype,\n [TypeId]: {\n _A: _ => _\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n toString() {\n return format(this.toJSON());\n }\n};\nconst SomeProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonProto), {\n _tag: \"Some\",\n _op: \"Some\",\n [Equal.symbol](that) {\n return isOption(that) && isSome(that) && Equal.equals(this.value, that.value);\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.combine(Hash.hash(this._tag))(Hash.hash(this.value)));\n },\n toJSON() {\n return {\n _id: \"Option\",\n _tag: this._tag,\n value: toJSON(this.value)\n };\n }\n});\nconst NoneHash = /*#__PURE__*/Hash.hash(\"None\");\nconst NoneProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonProto), {\n _tag: \"None\",\n _op: \"None\",\n [Equal.symbol](that) {\n return isOption(that) && isNone(that);\n },\n [Hash.symbol]() {\n return NoneHash;\n },\n toJSON() {\n return {\n _id: \"Option\",\n _tag: this._tag\n };\n }\n});\n/** @internal */\nexport const isOption = input => hasProperty(input, TypeId);\n/** @internal */\nexport const isNone = fa => fa._tag === \"None\";\n/** @internal */\nexport const isSome = fa => fa._tag === \"Some\";\n/** @internal */\nexport const none = /*#__PURE__*/Object.create(NoneProto);\n/** @internal */\nexport const some = value => {\n const a = Object.create(SomeProto);\n a.value = value;\n return a;\n};\n//# sourceMappingURL=option.js.map","/**\n * @since 2.0.0\n */\nimport * as Equal from \"../Equal.js\";\nimport { dual } from \"../Function.js\";\nimport * as Hash from \"../Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport { EffectPrototype } from \"./effectable.js\";\nimport * as option from \"./option.js\";\n/**\n * @internal\n */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/Either\");\nconst CommonProto = {\n ...EffectPrototype,\n [TypeId]: {\n _R: _ => _\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n toString() {\n return format(this.toJSON());\n }\n};\nconst RightProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonProto), {\n _tag: \"Right\",\n _op: \"Right\",\n [Equal.symbol](that) {\n return isEither(that) && isRight(that) && Equal.equals(this.right, that.right);\n },\n [Hash.symbol]() {\n return Hash.combine(Hash.hash(this._tag))(Hash.hash(this.right));\n },\n toJSON() {\n return {\n _id: \"Either\",\n _tag: this._tag,\n right: toJSON(this.right)\n };\n }\n});\nconst LeftProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(CommonProto), {\n _tag: \"Left\",\n _op: \"Left\",\n [Equal.symbol](that) {\n return isEither(that) && isLeft(that) && Equal.equals(this.left, that.left);\n },\n [Hash.symbol]() {\n return Hash.combine(Hash.hash(this._tag))(Hash.hash(this.left));\n },\n toJSON() {\n return {\n _id: \"Either\",\n _tag: this._tag,\n left: toJSON(this.left)\n };\n }\n});\n/** @internal */\nexport const isEither = input => hasProperty(input, TypeId);\n/** @internal */\nexport const isLeft = ma => ma._tag === \"Left\";\n/** @internal */\nexport const isRight = ma => ma._tag === \"Right\";\n/** @internal */\nexport const left = left => {\n const a = Object.create(LeftProto);\n a.left = left;\n return a;\n};\n/** @internal */\nexport const right = right => {\n const a = Object.create(RightProto);\n a.right = right;\n return a;\n};\n/** @internal */\nexport const getLeft = self => isRight(self) ? option.none : option.some(self.left);\n/** @internal */\nexport const getRight = self => isLeft(self) ? option.none : option.some(self.right);\n/** @internal */\nexport const fromOption = /*#__PURE__*/dual(2, (self, onNone) => option.isNone(self) ? left(onNone()) : right(self.value));\n//# sourceMappingURL=either.js.map","/**\n * @since 2.0.0\n */\nimport * as Equivalence from \"./Equivalence.js\";\nimport { constNull, constUndefined, dual, identity } from \"./Function.js\";\nimport * as doNotation from \"./internal/doNotation.js\";\nimport * as either from \"./internal/either.js\";\nimport * as option_ from \"./internal/option.js\";\nimport { isFunction } from \"./Predicate.js\";\nimport * as Gen from \"./Utils.js\";\n/**\n * @category symbols\n * @since 2.0.0\n */\nexport const TypeId = either.TypeId;\n/**\n * Constructs a new `Either` holding a `Right` value. This usually represents a successful value due to the right bias\n * of this structure.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const right = either.right;\nconst void_ = /*#__PURE__*/right(void 0);\nexport {\n/**\n * @category constructors\n * @since 3.13.0\n */\nvoid_ as void };\n/**\n * Constructs a new `Either` holding a `Left` value. This usually represents a failure, due to the right-bias of this\n * structure.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const left = either.left;\n/**\n * Takes a lazy default and a nullable value, if the value is not nully (`null` or `undefined`), turn it into a `Right`, if the value is nully use\n * the provided default as a `Left`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.fromNullable(1, () => 'fallback'), Either.right(1))\n * assert.deepStrictEqual(Either.fromNullable(null, () => 'fallback'), Either.left('fallback'))\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const fromNullable = /*#__PURE__*/dual(2, (self, onNullable) => self == null ? left(onNullable(self)) : right(self));\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, Option } from \"effect\"\n *\n * assert.deepStrictEqual(Either.fromOption(Option.some(1), () => 'error'), Either.right(1))\n * assert.deepStrictEqual(Either.fromOption(Option.none(), () => 'error'), Either.left('error'))\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const fromOption = either.fromOption;\nconst try_ = evaluate => {\n if (isFunction(evaluate)) {\n try {\n return right(evaluate());\n } catch (e) {\n return left(e);\n }\n } else {\n try {\n return right(evaluate.try());\n } catch (e) {\n return left(evaluate.catch(e));\n }\n }\n};\nexport {\n/**\n * Imports a synchronous side-effect into a pure `Either` value, translating any\n * thrown exceptions into typed failed eithers creating with `Either.left`.\n *\n * @category constructors\n * @since 2.0.0\n */\ntry_ as try };\n/**\n * Tests if a value is a `Either`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.isEither(Either.right(1)), true)\n * assert.deepStrictEqual(Either.isEither(Either.left(\"a\")), true)\n * assert.deepStrictEqual(Either.isEither({ right: 1 }), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isEither = either.isEither;\n/**\n * Determine if a `Either` is a `Left`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.isLeft(Either.right(1)), false)\n * assert.deepStrictEqual(Either.isLeft(Either.left(\"a\")), true)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isLeft = either.isLeft;\n/**\n * Determine if a `Either` is a `Right`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.isRight(Either.right(1)), true)\n * assert.deepStrictEqual(Either.isRight(Either.left(\"a\")), false)\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isRight = either.isRight;\n/**\n * Converts a `Either` to an `Option` discarding the `Left`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, Option } from \"effect\"\n *\n * assert.deepStrictEqual(Either.getRight(Either.right('ok')), Option.some('ok'))\n * assert.deepStrictEqual(Either.getRight(Either.left('err')), Option.none())\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getRight = either.getRight;\n/**\n * Converts a `Either` to an `Option` discarding the value.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, Option } from \"effect\"\n *\n * assert.deepStrictEqual(Either.getLeft(Either.right('ok')), Option.none())\n * assert.deepStrictEqual(Either.getLeft(Either.left('err')), Option.some('err'))\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getLeft = either.getLeft;\n/**\n * @category equivalence\n * @since 2.0.0\n */\nexport const getEquivalence = ({\n left,\n right\n}) => Equivalence.make((x, y) => isLeft(x) ? isLeft(y) && left(x.left, y.left) : isRight(y) && right(x.right, y.right));\n/**\n * @category mapping\n * @since 2.0.0\n */\nexport const mapBoth = /*#__PURE__*/dual(2, (self, {\n onLeft,\n onRight\n}) => isLeft(self) ? left(onLeft(self.left)) : right(onRight(self.right)));\n/**\n * Maps the `Left` side of an `Either` value to a new `Either` value.\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const mapLeft = /*#__PURE__*/dual(2, (self, f) => isLeft(self) ? left(f(self.left)) : right(self.right));\n/**\n * Maps the `Right` side of an `Either` value to a new `Either` value.\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => isRight(self) ? right(f(self.right)) : left(self.left));\n/**\n * Takes two functions and an `Either` value, if the value is a `Left` the inner value is applied to the `onLeft function,\n * if the value is a `Right` the inner value is applied to the `onRight` function.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, Either } from \"effect\"\n *\n * const onLeft = (strings: ReadonlyArray<string>): string => `strings: ${strings.join(', ')}`\n *\n * const onRight = (value: number): string => `Ok: ${value}`\n *\n * assert.deepStrictEqual(pipe(Either.right(1), Either.match({ onLeft, onRight })), 'Ok: 1')\n * assert.deepStrictEqual(\n * pipe(Either.left(['string 1', 'string 2']), Either.match({ onLeft, onRight })),\n * 'strings: string 1, string 2'\n * )\n * ```\n *\n * @category pattern matching\n * @since 2.0.0\n */\nexport const match = /*#__PURE__*/dual(2, (self, {\n onLeft,\n onRight\n}) => isLeft(self) ? onLeft(self.left) : onRight(self.right));\n/**\n * Transforms a `Predicate` function into a `Right` of the input value if the predicate returns `true`\n * or `Left` of the result of the provided function if the predicate returns false\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, Either } from \"effect\"\n *\n * const isPositive = (n: number): boolean => n > 0\n * const isPositiveEither = Either.liftPredicate(isPositive, n => `${n} is not positive`)\n *\n * assert.deepStrictEqual(\n * isPositiveEither(1),\n * Either.right(1)\n * )\n * assert.deepStrictEqual(\n * isPositiveEither(0),\n * Either.left(\"0 is not positive\")\n * )\n * ```\n *\n * @category lifting\n * @since 3.4.0\n */\nexport const liftPredicate = /*#__PURE__*/dual(3, (a, predicate, orLeftWith) => predicate(a) ? right(a) : left(orLeftWith(a)));\n/**\n * Filter the right value with the provided function.\n * If the predicate fails, set the left value with the result of the provided function.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, Either } from \"effect\"\n *\n * const isPositive = (n: number): boolean => n > 0\n *\n * assert.deepStrictEqual(\n * pipe(\n * Either.right(1),\n * Either.filterOrLeft(isPositive, n => `${n} is not positive`)\n * ),\n * Either.right(1)\n * )\n * assert.deepStrictEqual(\n * pipe(\n * Either.right(0),\n * Either.filterOrLeft(isPositive, n => `${n} is not positive`)\n * ),\n * Either.left(\"0 is not positive\")\n * )\n * ```\n *\n * @since 2.0.0\n * @category filtering & conditionals\n */\nexport const filterOrLeft = /*#__PURE__*/dual(3, (self, predicate, orLeftWith) => flatMap(self, r => predicate(r) ? right(r) : left(orLeftWith(r))));\n/**\n * @category getters\n * @since 2.0.0\n */\nexport const merge = /*#__PURE__*/match({\n onLeft: identity,\n onRight: identity\n});\n/**\n * Returns the wrapped value if it's a `Right` or a default value if is a `Left`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.getOrElse(Either.right(1), (error) => error + \"!\"), 1)\n * assert.deepStrictEqual(Either.getOrElse(Either.left(\"not a number\"), (error) => error + \"!\"), \"not a number!\")\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getOrElse = /*#__PURE__*/dual(2, (self, onLeft) => isLeft(self) ? onLeft(self.left) : self.right);\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.getOrNull(Either.right(1)), 1)\n * assert.deepStrictEqual(Either.getOrNull(Either.left(\"a\")), null)\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getOrNull = /*#__PURE__*/getOrElse(constNull);\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.getOrUndefined(Either.right(1)), 1)\n * assert.deepStrictEqual(Either.getOrUndefined(Either.left(\"a\")), undefined)\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getOrUndefined = /*#__PURE__*/getOrElse(constUndefined);\n/**\n * Extracts the value of an `Either` or throws if the `Either` is `Left`.\n *\n * If a default error is sufficient for your use case and you don't need to configure the thrown error, see {@link getOrThrow}.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(\n * Either.getOrThrowWith(Either.right(1), () => new Error('Unexpected Left')),\n * 1\n * )\n * assert.throws(() => Either.getOrThrowWith(Either.left(\"error\"), () => new Error('Unexpected Left')))\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getOrThrowWith = /*#__PURE__*/dual(2, (self, onLeft) => {\n if (isRight(self)) {\n return self.right;\n }\n throw onLeft(self.left);\n});\n// TODO(4.0): by default should throw `L` (i.e getOrThrowWith with the identity function)\n/**\n * Extracts the value of an `Either` or throws if the `Either` is `Left`.\n *\n * The thrown error is a default error. To configure the error thrown, see {@link getOrThrowWith}.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.getOrThrow(Either.right(1)), 1)\n * assert.throws(() => Either.getOrThrow(Either.left(\"error\")))\n * ```\n *\n * @throws `Error(\"getOrThrow called on a Left\")`\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getOrThrow = /*#__PURE__*/getOrThrowWith(() => new Error(\"getOrThrow called on a Left\"));\n/**\n * Returns `self` if it is a `Right` or `that` otherwise.\n *\n * @category error handling\n * @since 2.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => isLeft(self) ? that(self.left) : right(self.right));\n/**\n * @category sequencing\n * @since 2.0.0\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => isLeft(self) ? left(self.left) : f(self.right));\n/**\n * Executes a sequence of two `Either`s. The second `Either` can be dependent on the result of the first `Either`.\n *\n * @category sequencing\n * @since 2.0.0\n */\nexport const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {\n const b = isFunction(f) ? f(a) : f;\n return isEither(b) ? b : right(b);\n}));\n/**\n * @category zipping\n * @since 2.0.0\n */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(self, r => map(that, r2 => f(r, r2))));\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const ap = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));\n/**\n * Takes a structure of `Either`s and returns an `Either` of values with the same structure.\n *\n * - If a tuple is supplied, then the returned `Either` will contain a tuple with the same length.\n * - If a struct is supplied, then the returned `Either` will contain a struct with the same keys.\n * - If an iterable is supplied, then the returned `Either` will contain an array.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either } from \"effect\"\n *\n * assert.deepStrictEqual(Either.all([Either.right(1), Either.right(2)]), Either.right([1, 2]))\n * assert.deepStrictEqual(Either.all({ right: Either.right(1), b: Either.right(\"hello\") }), Either.right({ right: 1, b: \"hello\" }))\n * assert.deepStrictEqual(Either.all({ right: Either.right(1), b: Either.left(\"error\") }), Either.left(\"error\"))\n * ```\n *\n * @category combining\n * @since 2.0.0\n */\n// @ts-expect-error\nexport const all = input => {\n if (Symbol.iterator in input) {\n const out = [];\n for (const e of input) {\n if (isLeft(e)) {\n return e;\n }\n out.push(e.right);\n }\n return right(out);\n }\n const out = {};\n for (const key of Object.keys(input)) {\n const e = input[key];\n if (isLeft(e)) {\n return e;\n }\n out[key] = e.right;\n }\n return right(out);\n};\n/**\n * Returns an `Either` that swaps the error/success cases. This allows you to\n * use all methods on the error channel, possibly before flipping back.\n *\n * @since 2.0.0\n * @category mapping\n */\nexport const flip = self => isLeft(self) ? right(self.left) : left(self.right);\nconst adapter = /*#__PURE__*/Gen.adapter();\n/**\n * @category generators\n * @since 2.0.0\n */\nexport const gen = (...args) => {\n const f = args.length === 1 ? args[0] : args[1].bind(args[0]);\n const iterator = f(adapter);\n let state = iterator.next();\n while (!state.done) {\n const current = Gen.isGenKind(state.value) ? state.value.value : Gen.yieldWrapGet(state.value);\n if (isLeft(current)) {\n return current;\n }\n state = iterator.next(current.right);\n }\n return right(state.value);\n};\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, pipe } from \"effect\"\n *\n * const result = pipe(\n * Either.Do,\n * Either.bind(\"x\", () => Either.right(2)),\n * Either.bind(\"y\", () => Either.right(3)),\n * Either.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link bind}\n * @see {@link bindTo}\n * @see {@link let_ let}\n *\n * @category do notation\n * @since 2.0.0\n */\nexport const Do = /*#__PURE__*/right({});\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, pipe } from \"effect\"\n *\n * const result = pipe(\n * Either.Do,\n * Either.bind(\"x\", () => Either.right(2)),\n * Either.bind(\"y\", () => Either.right(3)),\n * Either.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link Do}\n * @see {@link bindTo}\n * @see {@link let_ let}\n *\n * @category do notation\n * @since 2.0.0\n */\nexport const bind = /*#__PURE__*/doNotation.bind(map, flatMap);\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, pipe } from \"effect\"\n *\n * const result = pipe(\n * Either.Do,\n * Either.bind(\"x\", () => Either.right(2)),\n * Either.bind(\"y\", () => Either.right(3)),\n * Either.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link Do}\n * @see {@link bind}\n * @see {@link let_ let}\n *\n * @category do notation\n * @since 2.0.0\n */\nexport const bindTo = /*#__PURE__*/doNotation.bindTo(map);\nconst let_ = /*#__PURE__*/doNotation.let_(map);\nexport {\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Either` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Either, pipe } from \"effect\"\n *\n * const result = pipe(\n * Either.Do,\n * Either.bind(\"x\", () => Either.right(2)),\n * Either.bind(\"y\", () => Either.right(3)),\n * Either.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(result, Either.right({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link Do}\n * @see {@link bindTo}\n * @see {@link bind}\n *\n * @category do notation\n * @since 2.0.0\n */\nlet_ as let };\n/**\n * Converts an `Option` of an `Either` into an `Either` of an `Option`.\n *\n * **Details**\n *\n * This function transforms an `Option<Either<A, E>>` into an\n * `Either<Option<A>, E>`. If the `Option` is `None`, the resulting `Either`\n * will be a `Right` with a `None` value. If the `Option` is `Some`, the\n * inner `Either` will be executed, and its result wrapped in a `Some`.\n *\n * @example\n * ```ts\n * import { Effect, Either, Option } from \"effect\"\n *\n * // ┌─── Option<Either<number, never>>\n * // ▼\n * const maybe = Option.some(Either.right(42))\n *\n * // ┌─── Either<Option<number>, never, never>\n * // ▼\n * const result = Either.transposeOption(maybe)\n *\n * console.log(Effect.runSync(result))\n * // Output: { _id: 'Option', _tag: 'Some', value: 42 }\n * ```\n *\n * @since 3.14.0\n * @category Optional Wrapping & Unwrapping\n */\nexport const transposeOption = self => {\n return option_.isNone(self) ? right(option_.none) : map(self.value, option_.some);\n};\n/**\n * Applies an `Either` on an `Option` and transposes the result.\n *\n * **Details**\n *\n * If the `Option` is `None`, the resulting `Either` will immediately succeed with a `Right` value of `None`.\n * If the `Option` is `Some`, the transformation function will be applied to the inner value, and its result wrapped in a `Some`.\n *\n * @example\n * ```ts\n * import { Either, Option, pipe } from \"effect\"\n *\n * // ┌─── Either<Option<number>, never>>\n * // ▼\n * const noneResult = pipe(\n * Option.none(),\n * Either.transposeMapOption(() => Either.right(42)) // will not be executed\n * )\n * console.log(noneResult)\n * // Output: { _id: 'Either', _tag: 'Right', right: { _id: 'Option', _tag: 'None' } }\n *\n * // ┌─── Either<Option<number>, never>>\n * // ▼\n * const someRightResult = pipe(\n * Option.some(42),\n * Either.transposeMapOption((value) => Either.right(value * 2))\n * )\n * console.log(someRightResult)\n * // Output: { _id: 'Either', _tag: 'Right', right: { _id: 'Option', _tag: 'Some', value: 84 } }\n * ```\n *\n * @since 3.15.0\n * @category Optional Wrapping & Unwrapping\n */\nexport const transposeMapOption = /*#__PURE__*/dual(2, (self, f) => option_.isNone(self) ? right(option_.none) : map(f(self.value), option_.some));\n//# sourceMappingURL=Either.js.map","/**\n * @since 2.0.0\n */\n/** @internal */\nexport const isNonEmptyArray = self => self.length > 0;\n//# sourceMappingURL=array.js.map","/**\n * This module provides an implementation of the `Order` type class which is used to define a total ordering on some type `A`.\n * An order is defined by a relation `<=`, which obeys the following laws:\n *\n * - either `x <= y` or `y <= x` (totality)\n * - if `x <= y` and `y <= x`, then `x == y` (antisymmetry)\n * - if `x <= y` and `y <= z`, then `x <= z` (transitivity)\n *\n * The truth table for compare is defined as follows:\n *\n * | `x <= y` | `x >= y` | Ordering | |\n * | -------- | -------- | -------- | --------------------- |\n * | `true` | `true` | `0` | corresponds to x == y |\n * | `true` | `false` | `< 0` | corresponds to x < y |\n * | `false` | `true` | `> 0` | corresponds to x > y |\n *\n * @since 2.0.0\n */\nimport { dual } from \"./Function.js\";\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const make = compare => (self, that) => self === that ? 0 : compare(self, that);\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const string = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const number = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const boolean = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const bigint = /*#__PURE__*/make((self, that) => self < that ? -1 : 1);\n/**\n * @since 2.0.0\n */\nexport const reverse = O => make((self, that) => O(that, self));\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const combine = /*#__PURE__*/dual(2, (self, that) => make((a1, a2) => {\n const out = self(a1, a2);\n if (out !== 0) {\n return out;\n }\n return that(a1, a2);\n}));\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const combineMany = /*#__PURE__*/dual(2, (self, collection) => make((a1, a2) => {\n let out = self(a1, a2);\n if (out !== 0) {\n return out;\n }\n for (const O of collection) {\n out = O(a1, a2);\n if (out !== 0) {\n return out;\n }\n }\n return out;\n}));\n/**\n * @since 2.0.0\n */\nexport const empty = () => make(() => 0);\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const combineAll = collection => combineMany(empty(), collection);\n/**\n * @category mapping\n * @since 2.0.0\n */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => make((b1, b2) => self(f(b1), f(b2))));\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const Date = /*#__PURE__*/mapInput(number, date => date.getTime());\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const product = /*#__PURE__*/dual(2, (self, that) => make(([xa, xb], [ya, yb]) => {\n const o = self(xa, ya);\n return o !== 0 ? o : that(xb, yb);\n}));\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const all = collection => {\n return make((x, y) => {\n const len = Math.min(x.length, y.length);\n let collectionLength = 0;\n for (const O of collection) {\n if (collectionLength >= len) {\n break;\n }\n const o = O(x[collectionLength], y[collectionLength]);\n if (o !== 0) {\n return o;\n }\n collectionLength++;\n }\n return 0;\n });\n};\n/**\n * @category combining\n * @since 2.0.0\n */\nexport const productMany = /*#__PURE__*/dual(2, (self, collection) => {\n const O = all(collection);\n return make((x, y) => {\n const o = self(x[0], y[0]);\n return o !== 0 ? o : O(x.slice(1), y.slice(1));\n });\n});\n/**\n * Similar to `Promise.all` but operates on `Order`s.\n *\n * ```\n * [Order<A>, Order<B>, ...] -> Order<[A, B, ...]>\n * ```\n *\n * This function creates and returns a new `Order` for a tuple of values based on the given `Order`s for each element in the tuple.\n * The returned `Order` compares two tuples of the same type by applying the corresponding `Order` to each element in the tuple.\n * It is useful when you need to compare two tuples of the same type and you have a specific way of comparing each element\n * of the tuple.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const tuple = (...elements) => all(elements);\n/**\n * This function creates and returns a new `Order` for an array of values based on a given `Order` for the elements of the array.\n * The returned `Order` compares two arrays by applying the given `Order` to each element in the arrays.\n * If all elements are equal, the arrays are then compared based on their length.\n * It is useful when you need to compare two arrays of the same type and you have a specific way of comparing each element of the array.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const array = O => make((self, that) => {\n const aLen = self.length;\n const bLen = that.length;\n const len = Math.min(aLen, bLen);\n for (let i = 0; i < len; i++) {\n const o = O(self[i], that[i]);\n if (o !== 0) {\n return o;\n }\n }\n return number(aLen, bLen);\n});\n/**\n * This function creates and returns a new `Order` for a struct of values based on the given `Order`s\n * for each property in the struct.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const struct = fields => {\n const keys = Object.keys(fields);\n return make((self, that) => {\n for (const key of keys) {\n const o = fields[key](self[key], that[key]);\n if (o !== 0) {\n return o;\n }\n }\n return 0;\n });\n};\n/**\n * Test whether one value is _strictly less than_ another.\n *\n * @since 2.0.0\n */\nexport const lessThan = O => dual(2, (self, that) => O(self, that) === -1);\n/**\n * Test whether one value is _strictly greater than_ another.\n *\n * @since 2.0.0\n */\nexport const greaterThan = O => dual(2, (self, that) => O(self, that) === 1);\n/**\n * Test whether one value is _non-strictly less than_ another.\n *\n * @since 2.0.0\n */\nexport const lessThanOrEqualTo = O => dual(2, (self, that) => O(self, that) !== 1);\n/**\n * Test whether one value is _non-strictly greater than_ another.\n *\n * @since 2.0.0\n */\nexport const greaterThanOrEqualTo = O => dual(2, (self, that) => O(self, that) !== -1);\n/**\n * Take the minimum of two values. If they are considered equal, the first argument is chosen.\n *\n * @since 2.0.0\n */\nexport const min = O => dual(2, (self, that) => self === that || O(self, that) < 1 ? self : that);\n/**\n * Take the maximum of two values. If they are considered equal, the first argument is chosen.\n *\n * @since 2.0.0\n */\nexport const max = O => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);\n/**\n * Clamp a value between a minimum and a maximum.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Order, Number } from \"effect\"\n *\n * const clamp = Order.clamp(Number.Order)({ minimum: 1, maximum: 5 })\n *\n * assert.equal(clamp(3), 3)\n * assert.equal(clamp(0), 1)\n * assert.equal(clamp(6), 5)\n * ```\n *\n * @since 2.0.0\n */\nexport const clamp = O => dual(2, (self, options) => min(O)(options.maximum, max(O)(options.minimum, self)));\n/**\n * Test whether a value is between a minimum and a maximum (inclusive).\n *\n * @since 2.0.0\n */\nexport const between = O => dual(2, (self, options) => !lessThan(O)(self, options.minimum) && !greaterThan(O)(self, options.maximum));\n//# sourceMappingURL=Order.js.map","import * as Equal from \"./Equal.js\";\nimport * as Equivalence from \"./Equivalence.js\";\nimport { constNull, constUndefined, dual, identity, isFunction } from \"./Function.js\";\nimport * as doNotation from \"./internal/doNotation.js\";\nimport * as either from \"./internal/either.js\";\nimport * as option from \"./internal/option.js\";\nimport * as order from \"./Order.js\";\nimport * as Gen from \"./Utils.js\";\n/**\n * @category Symbols\n * @since 2.0.0\n */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/Option\");\n/**\n * Represents the absence of a value by creating an empty `Option`.\n *\n * `Option.none` returns an `Option<never>`, which is a subtype of `Option<A>`.\n * This means you can use it in place of any `Option<A>` regardless of the type\n * `A`.\n *\n * **Example** (Creating an Option with No Value)\n *\n * ```ts\n * import { Option } from \"effect\"\n *\n * // An Option holding no value\n * //\n * // ┌─── Option<never>\n * // ▼\n * const noValue = Option.none()\n *\n * console.log(noValue)\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @see {@link some} for the opposite operation.\n *\n * @category Constructors\n * @since 2.0.0\n */\nexport const none = () => option.none;\n/**\n * Wraps the given value into an `Option` to represent its presence.\n *\n * **Example** (Creating an Option with a Value)\n *\n * ```ts\n * import { Option } from \"effect\"\n *\n * // An Option holding the number 1\n * //\n * // ┌─── Option<number>\n * // ▼\n * const value = Option.some(1)\n *\n * console.log(value)\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n * ```\n *\n * @see {@link none} for the opposite operation.\n *\n * @category Constructors\n * @since 2.0.0\n */\nexport const some = option.some;\n/**\n * Determines whether the given value is an `Option`.\n *\n * **Details**\n *\n * This function checks if a value is an instance of `Option`. It returns `true`\n * if the value is either `Option.some` or `Option.none`, and `false` otherwise.\n * This is particularly useful when working with unknown values or when you need\n * to ensure type safety in your code.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.isOption(Option.some(1)))\n * // Output: true\n *\n * console.log(Option.isOption(Option.none()))\n * // Output: true\n *\n * console.log(Option.isOption({}))\n * // Output: false\n * ```\n *\n * @category Guards\n * @since 2.0.0\n */\nexport const isOption = option.isOption;\n/**\n * Checks whether an `Option` represents the absence of a value (`None`).\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.isNone(Option.some(1)))\n * // Output: false\n *\n * console.log(Option.isNone(Option.none()))\n * // Output: true\n * ```\n *\n * @see {@link isSome} for the opposite check.\n *\n * @category Guards\n * @since 2.0.0\n */\nexport const isNone = option.isNone;\n/**\n * Checks whether an `Option` contains a value (`Some`).\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.isSome(Option.some(1)))\n * // Output: true\n *\n * console.log(Option.isSome(Option.none()))\n * // Output: false\n * ```\n *\n * @see {@link isNone} for the opposite check.\n *\n * @category Guards\n * @since 2.0.0\n */\nexport const isSome = option.isSome;\n/**\n * Performs pattern matching on an `Option` to handle both `Some` and `None`\n * cases.\n *\n * **Details**\n *\n * This function allows you to match against an `Option` and handle both\n * scenarios: when the `Option` is `None` (i.e., contains no value), and when\n * the `Option` is `Some` (i.e., contains a value). It executes one of the\n * provided functions based on the case:\n *\n * - If the `Option` is `None`, the `onNone` function is executed and its result\n * is returned.\n * - If the `Option` is `Some`, the `onSome` function is executed with the\n * contained value, and its result is returned.\n *\n * This function provides a concise and functional way to handle optional values\n * without resorting to `if` or manual checks, making your code more declarative\n * and readable.\n *\n * **Example** (Pattern Matching with Option)\n *\n * ```ts\n * import { Option } from \"effect\"\n *\n * const foo = Option.some(1)\n *\n * const message = Option.match(foo, {\n * onNone: () => \"Option is empty\",\n * onSome: (value) => `Option has a value: ${value}`\n * })\n *\n * console.log(message)\n * // Output: \"Option has a value: 1\"\n * ```\n *\n * @category Pattern matching\n * @since 2.0.0\n */\nexport const match = /*#__PURE__*/dual(2, (self, {\n onNone,\n onSome\n}) => isNone(self) ? onNone() : onSome(self.value));\n/**\n * Converts an `Option`-returning function into a type guard.\n *\n * **Details**\n *\n * This function transforms a function that returns an `Option` into a type\n * guard, ensuring type safety when validating or narrowing types. The returned\n * type guard function checks whether the input satisfies the condition defined\n * in the original `Option`-returning function.\n *\n * If the original function returns `Option.some`, the type guard evaluates to\n * `true`, confirming the input is of the desired type. If the function returns\n * `Option.none`, the type guard evaluates to `false`.\n *\n * This utility is especially useful for validating types in union types,\n * filtering arrays, or ensuring safe handling of specific subtypes.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * type MyData = string | number\n *\n * const parseString = (data: MyData): Option.Option<string> =>\n * typeof data === \"string\" ? Option.some(data) : Option.none()\n *\n * // ┌─── (a: MyData) => a is string\n * // ▼\n * const isString = Option.toRefinement(parseString)\n *\n * console.log(isString(\"a\"))\n * // Output: true\n *\n * console.log(isString(1))\n * // Output: false\n * ```\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const toRefinement = f => a => isSome(f(a));\n/**\n * Converts an `Iterable` into an `Option`, wrapping the first element if it\n * exists.\n *\n * **Details**\n *\n * This function takes an `Iterable` (e.g., an array, a generator, or any object\n * implementing the `Iterable` interface) and returns an `Option` based on its\n * content:\n *\n * - If the `Iterable` contains at least one element, the first element is\n * wrapped in a `Some` and returned.\n * - If the `Iterable` is empty, `None` is returned, representing the absence of\n * a value.\n *\n * This utility is useful for safely handling collections that might be empty,\n * ensuring you explicitly handle both cases where a value exists or doesn't.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.fromIterable([1, 2, 3]))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n *\n * console.log(Option.fromIterable([]))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Constructors\n * @since 2.0.0\n */\nexport const fromIterable = collection => {\n for (const a of collection) {\n return some(a);\n }\n return none();\n};\n/**\n * Converts an `Either` into an `Option` by discarding the error and extracting\n * the right value.\n *\n * **Details**\n *\n * This function takes an `Either` and returns an `Option` based on its value:\n *\n * - If the `Either` is a `Right`, its value is wrapped in a `Some` and\n * returned.\n * - If the `Either` is a `Left`, the error is discarded, and `None` is\n * returned.\n *\n * This is particularly useful when you only care about the success case\n * (`Right`) of an `Either` and want to handle the result using `Option`. By\n * using this function, you can convert `Either` into a simpler structure for\n * cases where error handling is not required.\n *\n * @example\n * ```ts\n * import { Either, Option } from \"effect\"\n *\n * console.log(Option.getRight(Either.right(\"ok\")))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'ok' }\n *\n * console.log(Option.getRight(Either.left(\"err\")))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @see {@link getLeft} for the opposite operation.\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const getRight = either.getRight;\n/**\n * Converts an `Either` into an `Option` by discarding the right value and\n * extracting the left value.\n *\n * **Details**\n *\n * This function transforms an `Either` into an `Option` as follows:\n *\n * - If the `Either` is a `Left`, its value is wrapped in a `Some` and returned.\n * - If the `Either` is a `Right`, the value is discarded, and `None` is\n * returned.\n *\n * This utility is useful when you only care about the error case (`Left`) of an\n * `Either` and want to handle it as an `Option`. By discarding the right value,\n * it simplifies error-focused workflows.\n *\n * @example\n * ```ts\n * import { Either, Option } from \"effect\"\n *\n * console.log(Option.getLeft(Either.right(\"ok\")))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(Option.getLeft(Either.left(\"err\")))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'err' }\n * ```\n *\n * @see {@link getRight} for the opposite operation.\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const getLeft = either.getLeft;\n/**\n * Returns the value contained in the `Option` if it is `Some`, otherwise\n * evaluates and returns the result of `onNone`.\n *\n * **Details**\n *\n * This function allows you to provide a fallback value or computation for when\n * an `Option` is `None`. If the `Option` contains a value (`Some`), that value\n * is returned. If it is empty (`None`), the `onNone` function is executed, and\n * its result is returned instead.\n *\n * This utility is helpful for safely handling `Option` values by ensuring you\n * always receive a meaningful result, whether or not the `Option` contains a\n * value. It is particularly useful for providing default values or alternative\n * logic when working with optional values.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.some(1).pipe(Option.getOrElse(() => 0)))\n * // Output: 1\n *\n * console.log(Option.none().pipe(Option.getOrElse(() => 0)))\n * // Output: 0\n * ```\n *\n * @see {@link getOrNull} for a version that returns `null` instead of executing a function.\n * @see {@link getOrUndefined} for a version that returns `undefined` instead of executing a function.\n *\n * @category Getters\n * @since 2.0.0\n */\nexport const getOrElse = /*#__PURE__*/dual(2, (self, onNone) => isNone(self) ? onNone() : self.value);\n/**\n * Returns the provided `Option` `that` if the current `Option` (`self`) is\n * `None`; otherwise, it returns `self`.\n *\n * **Details**\n *\n * This function provides a fallback mechanism for `Option` values. If the\n * current `Option` is `None` (i.e., it contains no value), the `that` function\n * is evaluated, and its resulting `Option` is returned. If the current `Option`\n * is `Some` (i.e., it contains a value), the original `Option` is returned\n * unchanged.\n *\n * This is particularly useful for chaining fallback values or computations,\n * allowing you to provide alternative `Option` values when the first one is\n * empty.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.none().pipe(Option.orElse(() => Option.none())))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(Option.some(\"a\").pipe(Option.orElse(() => Option.none())))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }\n *\n * console.log(Option.none().pipe(Option.orElse(() => Option.some(\"b\"))))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }\n *\n * console.log(Option.some(\"a\").pipe(Option.orElse(() => Option.some(\"b\"))))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }\n * ```\n *\n * @category Error handling\n * @since 2.0.0\n */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => isNone(self) ? that() : self);\n/**\n * Returns the provided default value wrapped in `Some` if the current `Option`\n * (`self`) is `None`; otherwise, returns `self`.\n *\n * **Details**\n *\n * This function provides a way to supply a default value for cases where an\n * `Option` is `None`. If the current `Option` is empty (`None`), the `onNone`\n * function is executed to compute the default value, which is then wrapped in a\n * `Some`. If the current `Option` contains a value (`Some`), it is returned as\n * is.\n *\n * This is particularly useful for handling optional values where a fallback\n * default needs to be provided explicitly in case of absence.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.none().pipe(Option.orElseSome(() => \"b\")))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'b' }\n *\n * console.log(Option.some(\"a\").pipe(Option.orElseSome(() => \"b\")))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }\n * ```\n *\n * @category Error handling\n * @since 2.0.0\n */\nexport const orElseSome = /*#__PURE__*/dual(2, (self, onNone) => isNone(self) ? some(onNone()) : self);\n/**\n * Similar to {@link orElse}, but returns an `Either` wrapped in an `Option` to\n * indicate the source of the value.\n *\n * **Details**\n *\n * This function allows you to provide a fallback `Option` in case the current\n * `Option` (`self`) is `None`. However, unlike `orElse`, it returns the value\n * wrapped in an `Either` object, providing additional information about where\n * the value came from:\n *\n * - If the value is from the fallback `Option` (`that`), it is wrapped in an\n * `Either.right`.\n * - If the value is from the original `Option` (`self`), it is wrapped in an\n * `Either.left`.\n *\n * This is especially useful when you need to differentiate between values\n * originating from the primary `Option` and those coming from the fallback,\n * while still maintaining the `Option`-style handling.\n *\n * @category Error handling\n * @since 2.0.0\n */\nexport const orElseEither = /*#__PURE__*/dual(2, (self, that) => isNone(self) ? map(that(), either.right) : map(self, either.left));\n/**\n * Returns the first `Some` value found in an `Iterable` collection of\n * `Option`s, or `None` if no `Some` is found.\n *\n * **Details**\n *\n * This function iterates over a collection of `Option` values and returns the\n * first `Some` it encounters. If the collection contains only `None` values,\n * the result will also be `None`. This utility is useful for efficiently\n * finding the first valid value in a sequence of potentially empty or invalid\n * options.\n *\n * The iteration stops as soon as a `Some` is found, making this function\n * efficient for large collections.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.firstSomeOf([\n * Option.none(),\n * Option.some(1),\n * Option.some(2)\n * ]))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n * ```\n *\n * @category Error handling\n * @since 2.0.0\n */\nexport const firstSomeOf = collection => {\n let out = none();\n for (out of collection) {\n if (isSome(out)) {\n return out;\n }\n }\n return out;\n};\n/**\n * Converts a nullable value into an `Option`. Returns `None` if the value is\n * `null` or `undefined`, otherwise wraps the value in a `Some`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.fromNullable(undefined))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(Option.fromNullable(null))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(Option.fromNullable(1))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n * ```\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const fromNullable = nullableValue => nullableValue == null ? none() : some(nullableValue);\n/**\n * Lifts a function that returns `null` or `undefined` into the `Option`\n * context.\n *\n * **Details**\n *\n * This function takes a function `f` that might return `null` or `undefined`\n * and transforms it into a function that returns an `Option`. The resulting\n * function will return:\n * - `Some` if the original function produces a non-null, non-undefined value.\n * - `None` if the original function produces `null` or `undefined`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const parse = (s: string): number | undefined => {\n * const n = parseFloat(s)\n * return isNaN(n) ? undefined : n\n * }\n *\n * const parseOption = Option.liftNullable(parse)\n *\n * console.log(parseOption(\"1\"))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n *\n * console.log(parseOption(\"not a number\"))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const liftNullable = f => (...a) => fromNullable(f(...a));\n/**\n * Returns the value contained in the `Option` if it is `Some`; otherwise,\n * returns `null`.\n *\n * **Details**\n *\n * This function provides a way to extract the value of an `Option` while\n * falling back to `null` if the `Option` is `None`.\n *\n * It is particularly useful in scenarios where `null` is an acceptable\n * placeholder for the absence of a value, such as when interacting with APIs or\n * systems that use `null` as a default for missing values.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.getOrNull(Option.some(1)))\n * // Output: 1\n *\n * console.log(Option.getOrNull(Option.none()))\n * // Output: null\n * ```\n *\n * @category Getters\n * @since 2.0.0\n */\nexport const getOrNull = /*#__PURE__*/getOrElse(constNull);\n/**\n * Returns the value contained in the `Option` if it is `Some`; otherwise,\n * returns `undefined`.\n *\n * **Details**\n *\n * This function provides a way to extract the value of an `Option` while\n * falling back to `undefined` if the `Option` is `None`.\n *\n * It is particularly useful in scenarios where `undefined` is an acceptable\n * placeholder for the absence of a value, such as when interacting with APIs or\n * systems that use `undefined` as a default for missing values.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.getOrUndefined(Option.some(1)))\n * // Output: 1\n *\n * console.log(Option.getOrUndefined(Option.none()))\n * // Output: undefined\n * ```\n *\n * @category Getters\n * @since 2.0.0\n */\nexport const getOrUndefined = /*#__PURE__*/getOrElse(constUndefined);\n/**\n * Lifts a function that throws exceptions into a function that returns an\n * `Option`.\n *\n * **Details**\n *\n * This utility function takes a function `f` that might throw an exception and\n * transforms it into a safer function that returns an `Option`. If the original\n * function executes successfully, the result is wrapped in a `Some`. If an\n * exception is thrown, the result is `None`, allowing the developer to handle\n * errors in a functional, type-safe way.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const parse = Option.liftThrowable(JSON.parse)\n *\n * console.log(parse(\"1\"))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n *\n * console.log(parse(\"\"))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const liftThrowable = f => (...a) => {\n try {\n return some(f(...a));\n } catch {\n return none();\n }\n};\n/**\n * Extracts the value of an `Option` or throws an error if the `Option` is\n * `None`, using a custom error factory.\n *\n * **Details**\n *\n * This function allows you to extract the value of an `Option` when it is\n * `Some`. If the `Option` is `None`, it throws an error generated by the\n * provided `onNone` function. This utility is particularly useful when you need\n * a fail-fast behavior for empty `Option` values and want to provide a custom\n * error message or object.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Option } from \"effect\"\n *\n * assert.deepStrictEqual(\n * Option.getOrThrowWith(Option.some(1), () => new Error('Unexpected None')),\n * 1\n * )\n * assert.throws(() => Option.getOrThrowWith(Option.none(), () => new Error('Unexpected None')))\n * ```\n *\n * @see {@link getOrThrow} for a version that throws a default error.\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const getOrThrowWith = /*#__PURE__*/dual(2, (self, onNone) => {\n if (isSome(self)) {\n return self.value;\n }\n throw onNone();\n});\n/**\n * Extracts the value of an `Option` or throws a default error if the `Option`\n * is `None`.\n *\n * **Details**\n *\n * This function extracts the value from an `Option` if it is `Some`. If the\n * `Option` is `None`, it throws a default error. It is useful for fail-fast\n * scenarios where the absence of a value is treated as an exceptional case and\n * a default error is sufficient.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Option } from \"effect\"\n *\n * assert.deepStrictEqual(Option.getOrThrow(Option.some(1)), 1)\n * assert.throws(() => Option.getOrThrow(Option.none()))\n * ```\n *\n * @see {@link getOrThrowWith} for a version that allows you to provide a custom error.\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const getOrThrow = /*#__PURE__*/getOrThrowWith(() => new Error(\"getOrThrow called on a None\"));\n/**\n * Transforms the value inside a `Some` to a new value using the provided\n * function, while leaving `None` unchanged.\n *\n * **Details**\n *\n * This function applies a mapping function `f` to the value inside an `Option`\n * if it is a `Some`. If the `Option` is `None`, it remains unchanged. The\n * result is a new `Option` with the transformed value (if it was a `Some`) or\n * still `None`.\n *\n * This utility is particularly useful for chaining transformations in a\n * functional way without needing to manually handle `None` cases.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * // Mapping over a `Some`\n * const someValue = Option.some(2)\n *\n * console.log(Option.map(someValue, (n) => n * 2))\n * // Output: { _id: 'Option', _tag: 'Some', value: 4 }\n *\n * // Mapping over a `None`\n * const noneValue = Option.none<number>()\n *\n * console.log(Option.map(noneValue, (n) => n * 2))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Mapping\n * @since 2.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : some(f(self.value)));\n/**\n * Replaces the value inside a `Some` with the specified constant value, leaving\n * `None` unchanged.\n *\n * **Details**\n *\n * This function transforms an `Option` by replacing the value inside a `Some`\n * with the given constant value `b`. If the `Option` is `None`, it remains\n * unchanged.\n *\n * This is useful when you want to preserve the presence of a value (`Some`) but\n * replace its content with a fixed value.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * // Replacing the value of a `Some`\n * const someValue = Option.some(42)\n *\n * console.log(Option.as(someValue, \"new value\"))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'new value' }\n *\n * // Replacing a `None` (no effect)\n * const noneValue = Option.none<number>()\n *\n * console.log(Option.as(noneValue, \"new value\"))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Mapping\n * @since 2.0.0\n */\nexport const as = /*#__PURE__*/dual(2, (self, b) => map(self, () => b));\n/**\n * Replaces the value inside a `Some` with the constant value `void`, leaving\n * `None` unchanged.\n *\n * **Details**\n *\n * This function transforms an `Option` by replacing the value inside a `Some`\n * with `void`. If the `Option` is `None`, it remains unchanged.\n *\n * This is particularly useful in scenarios where the presence or absence of a\n * value is significant, but the actual content of the value is irrelevant.\n *\n * @category Mapping\n * @since 2.0.0\n */\nexport const asVoid = /*#__PURE__*/as(undefined);\nconst void_ = /*#__PURE__*/some(undefined);\nexport {\n/**\n * @since 2.0.0\n */\nvoid_ as void };\n/**\n * Applies a function to the value of a `Some` and flattens the resulting\n * `Option`. If the input is `None`, it remains `None`.\n *\n * **Details**\n *\n * This function allows you to chain computations that return `Option` values.\n * If the input `Option` is `Some`, the provided function `f` is applied to the\n * contained value, and the resulting `Option` is returned. If the input is\n * `None`, the function is not applied, and the result remains `None`.\n *\n * This utility is particularly useful for sequencing operations that may fail\n * or produce optional results, enabling clean and concise workflows for\n * handling such cases.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * interface Address {\n * readonly city: string\n * readonly street: Option.Option<string>\n * }\n *\n * interface User {\n * readonly id: number\n * readonly username: string\n * readonly email: Option.Option<string>\n * readonly address: Option.Option<Address>\n * }\n *\n * const user: User = {\n * id: 1,\n * username: \"john_doe\",\n * email: Option.some(\"john.doe@example.com\"),\n * address: Option.some({\n * city: \"New York\",\n * street: Option.some(\"123 Main St\")\n * })\n * }\n *\n * // Use flatMap to extract the street value\n * const street = user.address.pipe(\n * Option.flatMap((address) => address.street)\n * )\n *\n * console.log(street)\n * // Output: { _id: 'Option', _tag: 'Some', value: '123 Main St' }\n * ```\n *\n * @category Sequencing\n * @since 2.0.0\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : f(self.value));\n/**\n * Chains two `Option`s together. The second `Option` can either be a static\n * value or depend on the result of the first `Option`.\n *\n * **Details**\n *\n * This function enables sequencing of two `Option` computations. If the first\n * `Option` is `Some`, the second `Option` is evaluated. The second `Option` can\n * either:\n *\n * - Be a static `Option` value.\n * - Be a function that produces an `Option`, optionally based on the value of\n * the first `Option`.\n *\n * If the first `Option` is `None`, the function skips the evaluation of the\n * second `Option` and directly returns `None`.\n *\n * @category Sequencing\n * @since 2.0.0\n */\nexport const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {\n const b = isFunction(f) ? f(a) : f;\n return isOption(b) ? b : some(b);\n}));\n/**\n * Combines `flatMap` and `fromNullable`, transforming the value inside a `Some`\n * using a function that may return `null` or `undefined`.\n *\n * **Details**\n *\n * This function applies a transformation function `f` to the value inside a\n * `Some`. The function `f` may return a value, `null`, or `undefined`. If `f`\n * returns a value, it is wrapped in a `Some`. If `f` returns `null` or\n * `undefined`, the result is `None`. If the input `Option` is `None`, the\n * function is not applied, and `None` is returned.\n *\n * This utility is particularly useful when working with deeply nested optional\n * values or chaining computations that may result in `null` or `undefined` at\n * some point.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * interface Employee {\n * company?: {\n * address?: {\n * street?: {\n * name?: string\n * }\n * }\n * }\n * }\n *\n * const employee1: Employee = { company: { address: { street: { name: \"high street\" } } } }\n *\n * // Extracting a deeply nested property\n * console.log(\n * Option.some(employee1)\n * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))\n * )\n * // Output: { _id: 'Option', _tag: 'Some', value: 'high street' }\n *\n * const employee2: Employee = { company: { address: { street: {} } } }\n *\n * // Property does not exist\n * console.log(\n * Option.some(employee2)\n * .pipe(Option.flatMapNullable((employee) => employee.company?.address?.street?.name))\n * )\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Sequencing\n * @since 2.0.0\n */\nexport const flatMapNullable = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : fromNullable(f(self.value)));\n/**\n * Flattens an `Option` of `Option` into a single `Option`.\n *\n * **Details**\n *\n * This function takes an `Option` that wraps another `Option` and flattens it\n * into a single `Option`. If the outer `Option` is `Some`, the function\n * extracts the inner `Option`. If the outer `Option` is `None`, the result\n * remains `None`.\n *\n * This is useful for simplifying nested `Option` structures that may arise\n * during functional operations.\n *\n * @category Sequencing\n * @since 2.0.0\n */\nexport const flatten = /*#__PURE__*/flatMap(identity);\n/**\n * Combines two `Option`s, keeping the value from the second `Option` if both\n * are `Some`.\n *\n * **Details**\n *\n * This function takes two `Option`s and returns the second one if the first is\n * `Some`. If the first `Option` is `None`, the result will also be `None`,\n * regardless of the second `Option`. It effectively \"zips\" the two `Option`s\n * while discarding the value from the first `Option`.\n *\n * This is particularly useful when sequencing computations where the result of\n * the first computation is not needed, and you only care about the result of\n * the second computation.\n *\n * @category Zipping\n * @since 2.0.0\n */\nexport const zipRight = /*#__PURE__*/dual(2, (self, that) => flatMap(self, () => that));\n/**\n * Combines two `Option`s, keeping the value from the first `Option` if both are\n * `Some`.\n *\n * **Details**\n *\n * This function takes two `Option`s and returns the first one if it is `Some`.\n * If either the first `Option` or the second `Option` is `None`, the result\n * will be `None`. This operation \"zips\" the two `Option`s while discarding the\n * value from the second `Option`.\n *\n * This is useful when sequencing computations where the second `Option`\n * represents a dependency or condition that must hold, but its value is\n * irrelevant.\n *\n * @category Zipping\n * @since 2.0.0\n */\nexport const zipLeft = /*#__PURE__*/dual(2, (self, that) => tap(self, () => that));\n/**\n * Composes two functions that return `Option` values, creating a new function\n * that chains them together.\n *\n * **Details**\n *\n * This function allows you to compose two computations, each represented by a\n * function that returns an `Option`. The result of the first function is passed\n * to the second function if it is `Some`. If the first function returns `None`,\n * the composed function short-circuits and returns `None` without invoking the\n * second function.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const parse = (s: string): Option.Option<number> => isNaN(Number(s)) ? Option.none() : Option.some(Number(s))\n *\n * const double = (n: number): Option.Option<number> => n > 0 ? Option.some(n * 2) : Option.none()\n *\n * const parseAndDouble = Option.composeK(parse, double)\n *\n * console.log(parseAndDouble(\"42\"))\n * // Output: { _id: 'Option', _tag: 'Some', value: 84 }\n *\n * console.log(parseAndDouble(\"not a number\"))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Sequencing\n * @since 2.0.0\n */\nexport const composeK = /*#__PURE__*/dual(2, (afb, bfc) => a => flatMap(afb(a), bfc));\n/**\n * Applies the provided function `f` to the value of the `Option` if it is\n * `Some` and returns the original `Option`, unless `f` returns `None`, in which\n * case it returns `None`.\n *\n * **Details**\n *\n * This function allows you to perform additional computations on the value of\n * an `Option` without modifying its original value. If the `Option` is `Some`,\n * the provided function `f` is executed with the value, and its result\n * determines whether the original `Option` is returned (`Some`) or the result\n * is `None` if `f` returns `None`. If the input `Option` is `None`, the\n * function is not executed, and `None` is returned.\n *\n * This is particularly useful for applying side conditions or performing\n * validation checks while retaining the original `Option`'s value.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const getInteger = (n: number) => Number.isInteger(n) ? Option.some(n) : Option.none()\n *\n * console.log(Option.tap(Option.none(), getInteger))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(Option.tap(Option.some(1), getInteger))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n *\n * console.log(Option.tap(Option.some(1.14), getInteger))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Sequencing\n * @since 2.0.0\n */\nexport const tap = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => map(f(a), () => a)));\n/**\n * Combines two `Option` values into a single `Option` containing a tuple of\n * their values if both are `Some`.\n *\n * **Details**\n *\n * This function takes two `Option`s and combines their values into a tuple `[A,\n * B]` if both are `Some`. If either of the `Option`s is `None`, the result is\n * `None`. This is particularly useful for combining multiple `Option` values\n * into a single one, ensuring both contain valid values.\n *\n * @category Combining\n * @since 2.0.0\n */\nexport const product = (self, that) => isSome(self) && isSome(that) ? some([self.value, that.value]) : none();\n/**\n * Combines an `Option` with a collection of `Option`s into a single `Option`\n * containing a tuple of their values if all are `Some`.\n *\n * **Details**\n *\n * This function takes a primary `Option` and a collection of `Option`s and\n * combines their values into a tuple `[A, ...Array<A>]` if all are `Some`. If\n * the primary `Option` or any `Option` in the collection is `None`, the result\n * is `None`.\n *\n * @category Combining\n * @since 2.0.0\n */\nexport const productMany = (self, collection) => {\n if (isNone(self)) {\n return none();\n }\n const out = [self.value];\n for (const o of collection) {\n if (isNone(o)) {\n return none();\n }\n out.push(o.value);\n }\n return some(out);\n};\n/**\n * Combines a structure of `Option`s into a single `Option` containing the\n * values with the same structure.\n *\n * **Details**\n *\n * This function takes a structure of `Option`s (a tuple, struct, or iterable)\n * and produces a single `Option` that contains the values from the input\n * structure if all `Option`s are `Some`. If any `Option` in the input is\n * `None`, the result is `None`. The structure of the input is preserved in the\n * output.\n *\n * - If the input is a tuple (e.g., an array), the result will be an `Option`\n * containing a tuple with the same length.\n * - If the input is a struct (e.g., an object), the result will be an `Option`\n * containing a struct with the same keys.\n * - If the input is an iterable, the result will be an `Option` containing an\n * array.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const maybeName: Option.Option<string> = Option.some(\"John\")\n * const maybeAge: Option.Option<number> = Option.some(25)\n *\n * // ┌─── Option<[string, number]>\n * // ▼\n * const tuple = Option.all([maybeName, maybeAge])\n * console.log(tuple)\n * // Output:\n * // { _id: 'Option', _tag: 'Some', value: [ 'John', 25 ] }\n *\n * // ┌─── Option<{ name: string; age: number; }>\n * // ▼\n * const struct = Option.all({ name: maybeName, age: maybeAge })\n * console.log(struct)\n * // Output:\n * // { _id: 'Option', _tag: 'Some', value: { name: 'John', age: 25 } }\n * ```\n *\n * @category Combining\n * @since 2.0.0\n */\n// @ts-expect-error\nexport const all = input => {\n if (Symbol.iterator in input) {\n const out = [];\n for (const o of input) {\n if (isNone(o)) {\n return none();\n }\n out.push(o.value);\n }\n return some(out);\n }\n const out = {};\n for (const key of Object.keys(input)) {\n const o = input[key];\n if (isNone(o)) {\n return none();\n }\n out[key] = o.value;\n }\n return some(out);\n};\n/**\n * Combines two `Option` values into a new `Option` by applying a provided\n * function to their values.\n *\n * **Details**\n *\n * This function takes two `Option` values (`self` and `that`) and a combining\n * function `f`. If both `Option` values are `Some`, the function `f` is applied\n * to their values, and the result is wrapped in a new `Some`. If either\n * `Option` is `None`, the result is `None`.\n *\n * This utility is useful for combining two optional computations into a single\n * result while maintaining type safety and avoiding explicit checks for `None`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const maybeName: Option.Option<string> = Option.some(\"John\")\n * const maybeAge: Option.Option<number> = Option.some(25)\n *\n * // Combine the name and age into a person object\n * const person = Option.zipWith(maybeName, maybeAge, (name, age) => ({\n * name: name.toUpperCase(),\n * age\n * }))\n *\n * console.log(person)\n * // Output:\n * // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }\n * ```\n *\n * @category Zipping\n * @since 2.0.0\n */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => map(product(self, that), ([a, b]) => f(a, b)));\n/**\n * Applies a function inside a `Some` to a value inside another `Some`,\n * combining them into a new `Option`.\n *\n * **Details**\n *\n * This function allows you to apply a function wrapped in an `Option` (`self`)\n * to a value wrapped in another `Option` (`that`). If both `Option`s are\n * `Some`, the function is applied to the value, and the result is wrapped in a\n * new `Some`. If either `Option` is `None`, the result is `None`.\n *\n * @category Combining\n * @since 2.0.0\n */\nexport const ap = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));\n/**\n * Reduces an `Iterable` of `Option<A>` to a single value of type `B`, ignoring\n * elements that are `None`.\n *\n * **Details**\n *\n * This function takes an initial value of type `B` and a reducing function `f`\n * that combines the accumulator with values of type `A`. It processes an\n * iterable of `Option<A>`, applying `f` only to the `Some` values while\n * ignoring the `None` values. The result is a single value of type `B`.\n *\n * This utility is particularly useful for aggregating values from an iterable\n * of `Option`s while skipping the absent (`None`) values.\n *\n * @example\n * ```ts\n * import { Option, pipe } from \"effect\"\n *\n * const iterable = [Option.some(1), Option.none(), Option.some(2), Option.none()]\n *\n * console.log(pipe(iterable, Option.reduceCompact(0, (b, a) => b + a)))\n * // Output: 3\n * ```\n *\n * @category Reducing\n * @since 2.0.0\n */\nexport const reduceCompact = /*#__PURE__*/dual(3, (self, b, f) => {\n let out = b;\n for (const oa of self) {\n if (isSome(oa)) {\n out = f(out, oa.value);\n }\n }\n return out;\n});\n/**\n * Converts an `Option` into an `Array`.\n * If the input is `None`, an empty array is returned.\n * If the input is `Some`, its value is wrapped in a single-element array.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.toArray(Option.some(1)))\n * // Output: [1]\n *\n * console.log(Option.toArray(Option.none()))\n * // Output: []\n * ```\n *\n * @category Conversions\n * @since 2.0.0\n */\nexport const toArray = self => isNone(self) ? [] : [self.value];\n/**\n * Splits an `Option` into two `Option`s based on the result of a mapping\n * function that produces an `Either`.\n *\n * **Details**\n *\n * This function takes an `Option` and a mapping function `f` that converts its\n * value into an `Either`. It returns a tuple of two `Option`s:\n *\n * - The first `Option` (`left`) contains the value from the `Left` side of the\n * `Either` if it exists, otherwise `None`.\n * - The second `Option` (`right`) contains the value from the `Right` side of\n * the `Either` if it exists, otherwise `None`.\n *\n * If the input `Option` is `None`, both returned `Option`s are `None`.\n *\n * This utility is useful for filtering and categorizing the contents of an\n * `Option` based on a bifurcating computation.\n *\n * @category Filtering\n * @since 2.0.0\n */\nexport const partitionMap = /*#__PURE__*/dual(2, (self, f) => {\n if (isNone(self)) {\n return [none(), none()];\n }\n const e = f(self.value);\n return either.isLeft(e) ? [some(e.left), none()] : [none(), some(e.right)];\n});\n// TODO(4.0): remove?\n/**\n * Alias of {@link flatMap}.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * // Transform and filter numbers\n * const transformEven = (n: Option.Option<number>): Option.Option<string> =>\n * Option.filterMap(n, (n) => (n % 2 === 0 ? Option.some(`Even: ${n}`) : Option.none()))\n *\n * console.log(transformEven(Option.none()))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(transformEven(Option.some(1)))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(transformEven(Option.some(2)))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'Even: 2' }\n * ```\n *\n * @category Filtering\n * @since 2.0.0\n */\nexport const filterMap = flatMap;\n/**\n * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.\n *\n * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const removeEmptyString = (input: Option.Option<string>) =>\n * Option.filter(input, (value) => value !== \"\")\n *\n * console.log(removeEmptyString(Option.none()))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(removeEmptyString(Option.some(\"\")))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * console.log(removeEmptyString(Option.some(\"a\")))\n * // Output: { _id: 'Option', _tag: 'Some', value: 'a' }\n * ```\n *\n * @category Filtering\n * @since 2.0.0\n */\nexport const filter = /*#__PURE__*/dual(2, (self, predicate) => filterMap(self, b => predicate(b) ? option.some(b) : option.none));\n/**\n * Creates an `Equivalence` instance for comparing `Option` values, using a\n * provided `Equivalence` for the inner type.\n *\n * **Details**\n *\n * This function takes an `Equivalence` instance for a specific type `A` and\n * produces an `Equivalence` instance for `Option<A>`. The resulting\n * `Equivalence` determines whether two `Option` values are equivalent:\n *\n * - Two `None`s are considered equivalent.\n * - A `Some` and a `None` are not equivalent.\n * - Two `Some` values are equivalent if their inner values are equivalent\n * according to the provided `Equivalence`.\n *\n * **Example** (Comparing Optional Numbers for Equivalence)\n *\n * ```ts\n * import { Number, Option } from \"effect\"\n *\n * const isEquivalent = Option.getEquivalence(Number.Equivalence)\n *\n * console.log(isEquivalent(Option.none(), Option.none()))\n * // Output: true\n *\n * console.log(isEquivalent(Option.none(), Option.some(1)))\n * // Output: false\n *\n * console.log(isEquivalent(Option.some(1), Option.none()))\n * // Output: false\n *\n * console.log(isEquivalent(Option.some(1), Option.some(2)))\n * // Output: false\n *\n * console.log(isEquivalent(Option.some(1), Option.some(1)))\n * // Output: true\n * ```\n *\n * @category Equivalence\n * @since 2.0.0\n */\nexport const getEquivalence = isEquivalent => Equivalence.make((x, y) => isNone(x) ? isNone(y) : isNone(y) ? false : isEquivalent(x.value, y.value));\n/**\n * Creates an `Order` instance for comparing `Option` values, using a provided\n * `Order` for the inner type.\n *\n * **Details**\n *\n * This function produces an `Order` instance for `Option<A>`, allowing `Option`\n * values to be compared:\n *\n * - `None` is always considered less than any `Some` value.\n * - If both are `Some`, their inner values are compared using the provided\n * `Order` instance.\n *\n * @example\n * ```ts\n * import { Number, Option } from \"effect\"\n *\n * const order = Option.getOrder(Number.Order)\n *\n * console.log(order(Option.none(), Option.none()))\n * // Output: 0\n *\n * console.log(order(Option.none(), Option.some(1)))\n * // Output: -1\n *\n * console.log(order(Option.some(1), Option.none()))\n * // Output: 1\n *\n * console.log(order(Option.some(1), Option.some(2)))\n * // Output: -1\n *\n * console.log(order(Option.some(1), Option.some(1)))\n * // Output: 0\n * ```\n *\n * @category Sorting\n * @since 2.0.0\n */\nexport const getOrder = O => order.make((self, that) => isSome(self) ? isSome(that) ? O(self.value, that.value) : 1 : -1);\n/**\n * Lifts a binary function to work with `Option` values, allowing the function\n * to operate on two `Option`s.\n *\n * **Details**\n *\n * This function takes a binary function `f` and returns a new function that\n * applies `f` to the values of two `Option`s (`self` and `that`). If both\n * `Option`s are `Some`, the binary function `f` is applied to their values, and\n * the result is wrapped in a new `Some`. If either `Option` is `None`, the\n * result is `None`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * // A binary function to add two numbers\n * const add = (a: number, b: number): number => a + b\n *\n * // Lift the `add` function to work with `Option` values\n * const addOptions = Option.lift2(add)\n *\n * // Both `Option`s are `Some`\n * console.log(addOptions(Option.some(2), Option.some(3)))\n * // Output: { _id: 'Option', _tag: 'Some', value: 5 }\n *\n * // One `Option` is `None`\n * console.log(addOptions(Option.some(2), Option.none()))\n * // Output: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Lifting\n * @since 2.0.0\n */\nexport const lift2 = f => dual(2, (self, that) => zipWith(self, that, f));\n/**\n * Lifts a `Predicate` or `Refinement` into the `Option` context, returning a\n * `Some` of the input value if the predicate is satisfied, or `None` otherwise.\n *\n * **Details**\n *\n * This function transforms a `Predicate` (or a more specific `Refinement`) into\n * a function that produces an `Option`. If the predicate evaluates to `true`,\n * the input value is wrapped in a `Some`. If the predicate evaluates to\n * `false`, the result is `None`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * // Check if a number is positive\n * const isPositive = (n: number) => n > 0\n *\n * // ┌─── (b: number) => Option<number>\n * // ▼\n * const parsePositive = Option.liftPredicate(isPositive)\n *\n * console.log(parsePositive(1))\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n *\n * console.log(parsePositive(-1))\n * // OUtput: { _id: 'Option', _tag: 'None' }\n * ```\n *\n * @category Lifting\n * @since 2.0.0\n */\nexport const liftPredicate = /*#__PURE__*/dual(2, (b, predicate) => predicate(b) ? some(b) : none());\n/**\n * Returns a function that checks if an `Option` contains a specified value,\n * using a provided equivalence function.\n *\n * **Details**\n *\n * This function allows you to check whether an `Option` contains a specific\n * value. It uses an equivalence function `isEquivalent` to compare the value\n * inside the `Option` to the provided value. If the `Option` is `Some` and the\n * equivalence function returns `true`, the result is `true`. If the `Option` is\n * `None` or the values are not equivalent, the result is `false`.\n *\n * @example\n * ```ts\n * import { Number, Option } from \"effect\"\n *\n * const contains = Option.containsWith(Number.Equivalence)\n *\n * console.log(Option.some(2).pipe(contains(2)))\n * // Output: true\n *\n * console.log(Option.some(1).pipe(contains(2)))\n * // Output: false\n *\n * console.log(Option.none().pipe(contains(2)))\n * // Output: false\n * ```\n *\n * @see {@link contains} for a version that uses the default `Equivalence`.\n *\n * @category Elements\n * @since 2.0.0\n */\nexport const containsWith = isEquivalent => dual(2, (self, a) => isNone(self) ? false : isEquivalent(self.value, a));\nconst _equivalence = /*#__PURE__*/Equal.equivalence();\n/**\n * Returns a function that checks if an `Option` contains a specified value\n * using the default `Equivalence`.\n *\n * **Details**\n *\n * This function allows you to check whether an `Option` contains a specific\n * value. It uses the default `Equivalence` for equality comparison. If the\n * `Option` is `Some` and its value is equivalent to the provided value, the\n * result is `true`. If the `Option` is `None` or the values are not equivalent,\n * the result is `false`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * console.log(Option.some(2).pipe(Option.contains(2)))\n * // Output: true\n *\n * console.log(Option.some(1).pipe(Option.contains(2)))\n * // Output: false\n *\n * console.log(Option.none().pipe(Option.contains(2)))\n * // Output: false\n * ```\n *\n * @see {@link containsWith} for a version that allows you to specify a custom equivalence function.\n *\n * @category Elements\n * @since 2.0.0\n */\nexport const contains = /*#__PURE__*/containsWith(_equivalence);\n/**\n * Checks if a value in an `Option` satisfies a given predicate or refinement.\n *\n * **Details**\n *\n * This function allows you to check if a value inside a `Some` meets a\n * specified condition. If the `Option` is `None`, the result is `false`. If the\n * `Option` is `Some`, the provided predicate or refinement is applied to the\n * value:\n *\n * - If the condition is met, the result is `true`.\n * - If the condition is not met, the result is `false`.\n *\n * @example\n * ```ts\n * import { Option } from \"effect\"\n *\n * const isEven = (n: number) => n % 2 === 0\n *\n * console.log(Option.some(2).pipe(Option.exists(isEven)))\n * // Output: true\n *\n * console.log(Option.some(1).pipe(Option.exists(isEven)))\n * // Output: false\n *\n * console.log(Option.none().pipe(Option.exists(isEven)))\n * // Output: false\n * ```\n *\n * @category Elements\n * @since 2.0.0\n */\nexport const exists = /*#__PURE__*/dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Option, pipe } from \"effect\"\n *\n * const result = pipe(\n * Option.Do,\n * Option.bind(\"x\", () => Option.some(2)),\n * Option.bind(\"y\", () => Option.some(3)),\n * Option.let(\"sum\", ({ x, y }) => x + y),\n * Option.filter(({ x, y }) => x * y > 5)\n * )\n * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link Do}\n * @see {@link bind}\n * @see {@link let_ let}\n *\n * @category Do notation\n * @since 2.0.0\n */\nexport const bindTo = /*#__PURE__*/doNotation.bindTo(map);\nconst let_ = /*#__PURE__*/doNotation.let_(map);\nexport {\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Option, pipe } from \"effect\"\n *\n * const result = pipe(\n * Option.Do,\n * Option.bind(\"x\", () => Option.some(2)),\n * Option.bind(\"y\", () => Option.some(3)),\n * Option.let(\"sum\", ({ x, y }) => x + y),\n * Option.filter(({ x, y }) => x * y > 5)\n * )\n * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link Do}\n * @see {@link bind}\n * @see {@link bindTo}\n *\n * @category Do notation\n * @since 2.0.0\n */\nlet_ as let };\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Option, pipe } from \"effect\"\n *\n * const result = pipe(\n * Option.Do,\n * Option.bind(\"x\", () => Option.some(2)),\n * Option.bind(\"y\", () => Option.some(3)),\n * Option.let(\"sum\", ({ x, y }) => x + y),\n * Option.filter(({ x, y }) => x * y > 5)\n * )\n * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link Do}\n * @see {@link bindTo}\n * @see {@link let_ let}\n *\n * @category Do notation\n * @since 2.0.0\n */\nexport const bind = /*#__PURE__*/doNotation.bind(map, flatMap);\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Option` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Option` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Option, pipe } from \"effect\"\n *\n * const result = pipe(\n * Option.Do,\n * Option.bind(\"x\", () => Option.some(2)),\n * Option.bind(\"y\", () => Option.some(3)),\n * Option.let(\"sum\", ({ x, y }) => x + y),\n * Option.filter(({ x, y }) => x * y > 5)\n * )\n * assert.deepStrictEqual(result, Option.some({ x: 2, y: 3, sum: 5 }))\n * ```\n *\n * @see {@link bindTo}\n * @see {@link bind}\n * @see {@link let_ let}\n *\n * @category Do notation\n * @since 2.0.0\n */\nexport const Do = /*#__PURE__*/some({});\nconst adapter = /*#__PURE__*/Gen.adapter();\n/**\n * Similar to `Effect.gen`, `Option.gen` provides a more readable,\n * generator-based syntax for working with `Option` values, making code that\n * involves `Option` easier to write and understand. This approach is similar to\n * using `async/await` but tailored for `Option`.\n *\n * **Example** (Using `Option.gen` to Create a Combined Value)\n *\n * ```ts\n * import { Option } from \"effect\"\n *\n * const maybeName: Option.Option<string> = Option.some(\"John\")\n * const maybeAge: Option.Option<number> = Option.some(25)\n *\n * const person = Option.gen(function* () {\n * const name = (yield* maybeName).toUpperCase()\n * const age = yield* maybeAge\n * return { name, age }\n * })\n *\n * console.log(person)\n * // Output:\n * // { _id: 'Option', _tag: 'Some', value: { name: 'JOHN', age: 25 } }\n * ```\n *\n * @category Generators\n * @since 2.0.0\n */\nexport const gen = (...args) => {\n const f = args.length === 1 ? args[0] : args[1].bind(args[0]);\n const iterator = f(adapter);\n let state = iterator.next();\n while (!state.done) {\n const current = Gen.isGenKind(state.value) ? state.value.value : Gen.yieldWrapGet(state.value);\n if (isNone(current)) {\n return current;\n }\n state = iterator.next(current.value);\n }\n return some(state.value);\n};\n/**\n * Merges two optional values, applying a function if both exist.\n * Unlike {@link zipWith}, this function returns `None` only if both inputs are `None`.\n *\n * @internal\n */\nexport const mergeWith = f => (o1, o2) => {\n if (isNone(o1)) {\n return o2;\n } else if (isNone(o2)) {\n return o1;\n }\n return some(f(o1.value, o2.value));\n};\n//# sourceMappingURL=Option.js.map","/**\n * This module provides utility functions for working with tuples in TypeScript.\n *\n * @since 2.0.0\n */\nimport * as Equivalence from \"./Equivalence.js\";\nimport { dual } from \"./Function.js\";\nimport * as order from \"./Order.js\";\n/**\n * Constructs a new tuple from the provided values.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { make } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(make(1, 'hello', true), [1, 'hello', true])\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const make = (...elements) => elements;\n/**\n * Return the first element from a tuple with two elements.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { getFirst } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(getFirst([\"hello\", 42]), \"hello\")\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getFirst = self => self[0];\n/**\n * Return the second element from a tuple with two elements.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { getSecond } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(getSecond([\"hello\", 42]), 42)\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const getSecond = self => self[1];\n/**\n * Transforms each element of tuple using the given function, treating tuple homomorphically\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, Tuple } from \"effect\"\n *\n * const result = pipe(\n * [\"a\", 1, false] as const,\n * Tuple.map((el) => el.toString().toUpperCase())\n * )\n * assert.deepStrictEqual(result, ['A', '1', 'FALSE'])\n * ```\n *\n * @category mapping\n * @since 3.9.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, fn) => self.map(element => fn(element)));\n/**\n * Transforms both elements of a tuple with two elements using the given functions.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { mapBoth } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(\n * mapBoth([\"hello\", 42], { onFirst: s => s.toUpperCase(), onSecond: n => n.toString() }),\n * [\"HELLO\", \"42\"]\n * )\n * ```\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const mapBoth = /*#__PURE__*/dual(2, (self, {\n onFirst,\n onSecond\n}) => [onFirst(self[0]), onSecond(self[1])]);\n/**\n * Transforms the first component of a tuple with two elements using a given function.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { mapFirst } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(\n * mapFirst([\"hello\", 42], s => s.toUpperCase()),\n * [\"HELLO\", 42]\n * )\n * ```\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const mapFirst = /*#__PURE__*/dual(2, (self, f) => [f(self[0]), self[1]]);\n/**\n * Transforms the second component of a tuple with two elements using a given function.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { mapSecond } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(\n * mapSecond([\"hello\", 42], n => n.toString()),\n * [\"hello\", \"42\"]\n * )\n * ```\n *\n * @category mapping\n * @since 2.0.0\n */\nexport const mapSecond = /*#__PURE__*/dual(2, (self, f) => [self[0], f(self[1])]);\n/**\n * Swaps the elements of a tuple with two elements.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { swap } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(swap([\"hello\", 42]), [42, \"hello\"])\n * ```\n *\n * @since 2.0.0\n */\nexport const swap = self => [self[1], self[0]];\n/**\n * Given a tuple of `Equivalence`s returns a new `Equivalence` that compares values of a tuple\n * by applying each `Equivalence` to the corresponding element of the tuple.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const getEquivalence = Equivalence.tuple;\n/**\n * This function creates and returns a new `Order` for a tuple of values based on the given `Order`s for each element in the tuple.\n * The returned `Order` compares two tuples of the same type by applying the corresponding `Order` to each element in the tuple.\n * It is useful when you need to compare two tuples of the same type and you have a specific way of comparing each element\n * of the tuple.\n *\n * @category combinators\n * @since 2.0.0\n */\nexport const getOrder = order.tuple;\n/**\n * Appends an element to the end of a tuple.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const appendElement = /*#__PURE__*/dual(2, (self, that) => [...self, that]);\n/**\n * Retrieves the element at a specified index from a tuple.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Tuple } from \"effect\"\n *\n * assert.deepStrictEqual(Tuple.at([1, 'hello', true], 1), 'hello')\n * ```\n *\n * @category getters\n * @since 3.4.0\n */\nexport const at = /*#__PURE__*/dual(2, (self, index) => self[index]);\nexport {\n/**\n * Determine if an `Array` is a tuple with exactly `N` elements, narrowing down the type to `TupleOf`.\n *\n * An `Array` is considered to be a `TupleOf` if its length is exactly `N`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isTupleOf } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(isTupleOf([1, 2, 3], 3), true);\n * assert.deepStrictEqual(isTupleOf([1, 2, 3], 2), false);\n * assert.deepStrictEqual(isTupleOf([1, 2, 3], 4), false);\n *\n * const arr: number[] = [1, 2, 3];\n * if (isTupleOf(arr, 3)) {\n * console.log(arr);\n * // ^? [number, number, number]\n * }\n *\n * ```\n * @category guards\n * @since 3.3.0\n */\nisTupleOf,\n/**\n * Determine if an `Array` is a tuple with at least `N` elements, narrowing down the type to `TupleOfAtLeast`.\n *\n * An `Array` is considered to be a `TupleOfAtLeast` if its length is at least `N`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { isTupleOfAtLeast } from \"effect/Tuple\"\n *\n * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 3), true);\n * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 2), true);\n * assert.deepStrictEqual(isTupleOfAtLeast([1, 2, 3], 4), false);\n *\n * const arr: number[] = [1, 2, 3, 4];\n * if (isTupleOfAtLeast(arr, 3)) {\n * console.log(arr);\n * // ^? [number, number, number, ...number[]]\n * }\n *\n * ```\n * @category guards\n * @since 3.3.0\n */\nisTupleOfAtLeast } from \"./Predicate.js\";\n//# sourceMappingURL=Tuple.js.map","/**\n * This module provides utility functions for working with arrays in TypeScript.\n *\n * @since 2.0.0\n */\nimport * as Either from \"./Either.js\";\nimport * as Equal from \"./Equal.js\";\nimport * as Equivalence from \"./Equivalence.js\";\nimport { dual, identity } from \"./Function.js\";\nimport * as internalArray from \"./internal/array.js\";\nimport * as internalDoNotation from \"./internal/doNotation.js\";\nimport * as moduleIterable from \"./Iterable.js\";\nimport * as Option from \"./Option.js\";\nimport * as Order from \"./Order.js\";\nimport * as Predicate from \"./Predicate.js\";\nimport * as Record from \"./Record.js\";\nimport * as Tuple from \"./Tuple.js\";\n/**\n * Builds a `NonEmptyArray` from an non-empty collection of elements.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.make(1, 2, 3)\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const make = (...elements) => elements;\n/**\n * Creates a new `Array` of the specified length.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.allocate<number>(3)\n * console.log(result) // [ <3 empty items> ]\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const allocate = n => new Array(n);\n/**\n * Return a `NonEmptyArray` of length `n` with element `i` initialized with `f(i)`.\n *\n * **Note**. `n` is normalized to an integer >= 1.\n *\n * **Example**\n *\n * ```ts\n * import { makeBy } from \"effect/Array\"\n *\n * const result = makeBy(5, n => n * 2)\n * console.log(result) // [0, 2, 4, 6, 8]\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const makeBy = /*#__PURE__*/dual(2, (n, f) => {\n const max = Math.max(1, Math.floor(n));\n const out = new Array(max);\n for (let i = 0; i < max; i++) {\n out[i] = f(i);\n }\n return out;\n});\n/**\n * Return a `NonEmptyArray` containing a range of integers, including both endpoints.\n *\n * **Example**\n *\n * ```ts\n * import { range } from \"effect/Array\"\n *\n * const result = range(1, 3)\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const range = (start, end) => start <= end ? makeBy(end - start + 1, i => start + i) : [start];\n/**\n * Return a `NonEmptyArray` containing a value repeated the specified number of times.\n *\n * **Note**. `n` is normalized to an integer >= 1.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.replicate(\"a\", 3)\n * console.log(result) // [\"a\", \"a\", \"a\"]\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const replicate = /*#__PURE__*/dual(2, (a, n) => makeBy(n, () => a));\n/**\n * Creates a new `Array` from an iterable collection of values.\n * If the input is already an array, it returns the input as-is.\n * Otherwise, it converts the iterable collection to an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.fromIterable(new Set([1, 2, 3]))\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const fromIterable = collection => Array.isArray(collection) ? collection : Array.from(collection);\n/**\n * Creates a new `Array` from a value that might not be an iterable.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * console.log(Array.ensure(\"a\")) // [\"a\"]\n * console.log(Array.ensure([\"a\"])) // [\"a\"]\n * console.log(Array.ensure([\"a\", \"b\", \"c\"])) // [\"a\", \"b\", \"c\"]\n * ```\n *\n * @category constructors\n * @since 3.3.0\n */\nexport const ensure = self => Array.isArray(self) ? self : [self];\n/**\n * Takes a record and returns an array of tuples containing its keys and values.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.fromRecord({ a: 1, b: 2, c: 3 })\n * console.log(result) // [[\"a\", 1], [\"b\", 2], [\"c\", 3]]\n * ```\n *\n * @category conversions\n * @since 2.0.0\n */\nexport const fromRecord = Record.toEntries;\n/**\n * Converts an `Option` to an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Option } from \"effect\"\n *\n * console.log(Array.fromOption(Option.some(1))) // [1]\n * console.log(Array.fromOption(Option.none())) // []\n * ```\n *\n * @category conversions\n * @since 2.0.0\n */\nexport const fromOption = Option.toArray;\n/**\n * Matches the elements of an array, applying functions to cases of empty and non-empty arrays.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const match = Array.match({\n * onEmpty: () => \"empty\",\n * onNonEmpty: ([head, ...tail]) => `head: ${head}, tail: ${tail.length}`\n * })\n * console.log(match([])) // \"empty\"\n * console.log(match([1, 2, 3])) // \"head: 1, tail: 2\"\n * ```\n *\n * @category pattern matching\n * @since 2.0.0\n */\nexport const match = /*#__PURE__*/dual(2, (self, {\n onEmpty,\n onNonEmpty\n}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());\n/**\n * Matches the elements of an array from the left, applying functions to cases of empty and non-empty arrays.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const matchLeft = Array.matchLeft({\n * onEmpty: () => \"empty\",\n * onNonEmpty: (head, tail) => `head: ${head}, tail: ${tail.length}`\n * })\n * console.log(matchLeft([])) // \"empty\"\n * console.log(matchLeft([1, 2, 3])) // \"head: 1, tail: 2\"\n * ```\n *\n * @category pattern matching\n * @since 2.0.0\n */\nexport const matchLeft = /*#__PURE__*/dual(2, (self, {\n onEmpty,\n onNonEmpty\n}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());\n/**\n * Matches the elements of an array from the right, applying functions to cases of empty and non-empty arrays.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const matchRight = Array.matchRight({\n * onEmpty: () => \"empty\",\n * onNonEmpty: (init, last) => `init: ${init.length}, last: ${last}`\n * })\n * console.log(matchRight([])) // \"empty\"\n * console.log(matchRight([1, 2, 3])) // \"init: 2, last: 3\"\n * ```\n *\n * @category pattern matching\n * @since 2.0.0\n */\nexport const matchRight = /*#__PURE__*/dual(2, (self, {\n onEmpty,\n onNonEmpty\n}) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());\n/**\n * Prepend an element to the front of an `Iterable`, creating a new `NonEmptyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.prepend([2, 3, 4], 1)\n * console.log(result) // [1, 2, 3, 4]\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prepend = /*#__PURE__*/dual(2, (self, head) => [head, ...self]);\n/**\n * Prepends the specified prefix array (or iterable) to the beginning of the specified array (or iterable).\n * If either array is non-empty, the result is also a non-empty array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.prependAll([2, 3], [0, 1])\n * console.log(result) // [0, 1, 2, 3]\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prependAll = /*#__PURE__*/dual(2, (self, that) => fromIterable(that).concat(fromIterable(self)));\n/**\n * Append an element to the end of an `Iterable`, creating a new `NonEmptyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.append([1, 2, 3], 4);\n * console.log(result) // [1, 2, 3, 4]\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const append = /*#__PURE__*/dual(2, (self, last) => [...self, last]);\n/**\n * Concatenates two arrays (or iterables), combining their elements.\n * If either array is non-empty, the result is also a non-empty array.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const appendAll = /*#__PURE__*/dual(2, (self, that) => fromIterable(self).concat(fromIterable(that)));\n/**\n * Accumulates values from an `Iterable` starting from the left, storing\n * each intermediate result in an array. Useful for tracking the progression of\n * a value through a series of transformations.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\";\n *\n * const result = Array.scan([1, 2, 3, 4], 0, (acc, value) => acc + value)\n * console.log(result) // [0, 1, 3, 6, 10]\n *\n * // Explanation:\n * // This function starts with the initial value (0 in this case)\n * // and adds each element of the array to this accumulator one by one,\n * // keeping track of the cumulative sum after each addition.\n * // Each of these sums is captured in the resulting array.\n * ```\n *\n * @category folding\n * @since 2.0.0\n */\nexport const scan = /*#__PURE__*/dual(3, (self, b, f) => {\n const out = [b];\n let i = 0;\n for (const a of self) {\n out[i + 1] = f(out[i], a);\n i++;\n }\n return out;\n});\n/**\n * Accumulates values from an `Iterable` starting from the right, storing\n * each intermediate result in an array. Useful for tracking the progression of\n * a value through a series of transformations.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\";\n *\n * const result = Array.scanRight([1, 2, 3, 4], 0, (acc, value) => acc + value)\n * console.log(result) // [10, 9, 7, 4, 0]\n * ```\n *\n * @category folding\n * @since 2.0.0\n */\nexport const scanRight = /*#__PURE__*/dual(3, (self, b, f) => {\n const input = fromIterable(self);\n const out = new Array(input.length + 1);\n out[input.length] = b;\n for (let i = input.length - 1; i >= 0; i--) {\n out[i] = f(out[i + 1], input[i]);\n }\n return out;\n});\n/**\n * Determine if `unknown` is an Array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * console.log(Array.isArray(null)) // false\n * console.log(Array.isArray([1, 2, 3])) // true\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isArray = Array.isArray;\n/**\n * Determine if an `Array` is empty narrowing down the type to `[]`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * console.log(Array.isEmptyArray([])) // true\n * console.log(Array.isEmptyArray([1, 2, 3])) // false\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isEmptyArray = self => self.length === 0;\n/**\n * Determine if a `ReadonlyArray` is empty narrowing down the type to `readonly []`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * console.log(Array.isEmptyReadonlyArray([])) // true\n * console.log(Array.isEmptyReadonlyArray([1, 2, 3])) // false\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isEmptyReadonlyArray = isEmptyArray;\n/**\n * Determine if an `Array` is non empty narrowing down the type to `NonEmptyArray`.\n *\n * An `Array` is considered to be a `NonEmptyArray` if it contains at least one element.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * console.log(Array.isNonEmptyArray([])) // false\n * console.log(Array.isNonEmptyArray([1, 2, 3])) // true\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNonEmptyArray = internalArray.isNonEmptyArray;\n/**\n * Determine if a `ReadonlyArray` is non empty narrowing down the type to `NonEmptyReadonlyArray`.\n *\n * A `ReadonlyArray` is considered to be a `NonEmptyReadonlyArray` if it contains at least one element.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * console.log(Array.isNonEmptyReadonlyArray([])) // false\n * console.log(Array.isNonEmptyReadonlyArray([1, 2, 3])) // true\n * ```\n *\n * @category guards\n * @since 2.0.0\n */\nexport const isNonEmptyReadonlyArray = internalArray.isNonEmptyArray;\n/**\n * Return the number of elements in a `ReadonlyArray`.\n *\n * @category getters\n * @since 2.0.0\n */\nexport const length = self => self.length;\nconst isOutOfBounds = (i, as) => i < 0 || i >= as.length;\nconst clamp = (i, as) => Math.floor(Math.min(Math.max(0, i), as.length));\n/**\n * This function provides a safe way to read a value at a particular index from a `ReadonlyArray`.\n *\n * @category getters\n * @since 2.0.0\n */\nexport const get = /*#__PURE__*/dual(2, (self, index) => {\n const i = Math.floor(index);\n return isOutOfBounds(i, self) ? Option.none() : Option.some(self[i]);\n});\n/**\n * Gets an element unsafely, will throw on out of bounds.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeGet = /*#__PURE__*/dual(2, (self, index) => {\n const i = Math.floor(index);\n if (isOutOfBounds(i, self)) {\n throw new Error(`Index ${i} out of bounds`);\n }\n return self[i];\n});\n/**\n * Return a tuple containing the first element, and a new `Array` of the remaining elements, if any.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\";\n *\n * const result = Array.unprepend([1, 2, 3, 4])\n * console.log(result) // [1, [2, 3, 4]]\n * ```\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const unprepend = self => [headNonEmpty(self), tailNonEmpty(self)];\n/**\n * Return a tuple containing a copy of the `NonEmptyReadonlyArray` without its last element, and that last element.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\";\n *\n * const result = Array.unappend([1, 2, 3, 4])\n * console.log(result) // [[1, 2, 3], 4]\n * ```\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const unappend = self => [initNonEmpty(self), lastNonEmpty(self)];\n/**\n * Get the first element of a `ReadonlyArray`, or `None` if the `ReadonlyArray` is empty.\n *\n * @category getters\n * @since 2.0.0\n */\nexport const head = /*#__PURE__*/get(0);\n/**\n * Get the first element of a non empty array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.headNonEmpty([1, 2, 3, 4])\n * console.log(result) // 1\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const headNonEmpty = /*#__PURE__*/unsafeGet(0);\n/**\n * Get the last element in a `ReadonlyArray`, or `None` if the `ReadonlyArray` is empty.\n *\n * @category getters\n * @since 2.0.0\n */\nexport const last = self => isNonEmptyReadonlyArray(self) ? Option.some(lastNonEmpty(self)) : Option.none();\n/**\n * Get the last element of a non empty array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.lastNonEmpty([1, 2, 3, 4])\n * console.log(result) // 4\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const lastNonEmpty = self => self[self.length - 1];\n/**\n * Get all but the first element of an `Iterable`, creating a new `Array`, or `None` if the `Iterable` is empty.\n *\n * @category getters\n * @since 2.0.0\n */\nexport const tail = self => {\n const input = fromIterable(self);\n return isNonEmptyReadonlyArray(input) ? Option.some(tailNonEmpty(input)) : Option.none();\n};\n/**\n * Get all but the first element of a `NonEmptyReadonlyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.tailNonEmpty([1, 2, 3, 4])\n * console.log(result) // [2, 3, 4]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const tailNonEmpty = self => self.slice(1);\n/**\n * Get all but the last element of an `Iterable`, creating a new `Array`, or `None` if the `Iterable` is empty.\n *\n * @category getters\n * @since 2.0.0\n */\nexport const init = self => {\n const input = fromIterable(self);\n return isNonEmptyReadonlyArray(input) ? Option.some(initNonEmpty(input)) : Option.none();\n};\n/**\n * Get all but the last element of a non empty array, creating a new array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.initNonEmpty([1, 2, 3, 4])\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const initNonEmpty = self => self.slice(0, -1);\n/**\n * Keep only a max number of elements from the start of an `Iterable`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.take([1, 2, 3, 4, 5], 3)\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const take = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n return input.slice(0, clamp(n, input));\n});\n/**\n * Keep only a max number of elements from the end of an `Iterable`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.takeRight([1, 2, 3, 4, 5], 3)\n * console.log(result) // [3, 4, 5]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const takeRight = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n const i = clamp(n, input);\n return i === 0 ? [] : input.slice(-i);\n});\n/**\n * Calculate the longest initial subarray for which all element satisfy the specified predicate, creating a new `Array`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.takeWhile([1, 3, 2, 4, 1, 2], x => x < 4)\n * console.log(result) // [1, 3, 2]\n *\n * // Explanation:\n * // - The function starts with the first element (`1`), which is less than `4`, so it adds `1` to the result.\n * // - The next element (`3`) is also less than `4`, so it adds `3`.\n * // - The next element (`2`) is again less than `4`, so it adds `2`.\n * // - The function then encounters `4`, which is not less than `4`. At this point, it stops checking further elements and finalizes the result.\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const takeWhile = /*#__PURE__*/dual(2, (self, predicate) => {\n let i = 0;\n const out = [];\n for (const a of self) {\n if (!predicate(a, i)) {\n break;\n }\n out.push(a);\n i++;\n }\n return out;\n});\nconst spanIndex = (self, predicate) => {\n let i = 0;\n for (const a of self) {\n if (!predicate(a, i)) {\n break;\n }\n i++;\n }\n return i;\n};\n/**\n * Split an `Iterable` into two parts:\n *\n * 1. the longest initial subarray for which all elements satisfy the specified predicate\n * 2. the remaining elements\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const span = /*#__PURE__*/dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));\n/**\n * Drop a max number of elements from the start of an `Iterable`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.drop([1, 2, 3, 4, 5], 2)\n * console.log(result) // [3, 4, 5]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const drop = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n return input.slice(clamp(n, input), input.length);\n});\n/**\n * Drop a max number of elements from the end of an `Iterable`, creating a new `Array`.\n *\n * **Note**. `n` is normalized to a non negative integer.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.dropRight([1, 2, 3, 4, 5], 2)\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const dropRight = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n return input.slice(0, input.length - clamp(n, input));\n});\n/**\n * Remove the longest initial subarray for which all element satisfy the specified predicate, creating a new `Array`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.dropWhile([1, 2, 3, 4, 5], x => x < 4)\n * console.log(result) // [4, 5]\n * ```\n *\n * @category getters\n * @since 2.0.0\n */\nexport const dropWhile = /*#__PURE__*/dual(2, (self, predicate) => fromIterable(self).slice(spanIndex(self, predicate)));\n/**\n * Return the first index for which a predicate holds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.findFirstIndex([5, 3, 8, 9], x => x > 5)\n * console.log(result) // Option.some(2)\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findFirstIndex = /*#__PURE__*/dual(2, (self, predicate) => {\n let i = 0;\n for (const a of self) {\n if (predicate(a, i)) {\n return Option.some(i);\n }\n i++;\n }\n return Option.none();\n});\n/**\n * Return the last index for which a predicate holds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.findLastIndex([1, 3, 8, 9], x => x < 5)\n * console.log(result) // Option.some(1)\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findLastIndex = /*#__PURE__*/dual(2, (self, predicate) => {\n const input = fromIterable(self);\n for (let i = input.length - 1; i >= 0; i--) {\n if (predicate(input[i], i)) {\n return Option.some(i);\n }\n }\n return Option.none();\n});\n/**\n * Returns the first element that satisfies the specified\n * predicate, or `None` if no such element exists.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.findFirst([1, 2, 3, 4, 5], x => x > 3)\n * console.log(result) // Option.some(4)\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findFirst = moduleIterable.findFirst;\n/**\n * Finds the last element in an iterable collection that satisfies the given predicate or refinement.\n * Returns an `Option` containing the found element, or `Option.none` if no element matches.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.findLast([1, 2, 3, 4, 5], n => n % 2 === 0)\n * console.log(result) // Option.some(4)\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findLast = /*#__PURE__*/dual(2, (self, f) => {\n const input = fromIterable(self);\n for (let i = input.length - 1; i >= 0; i--) {\n const a = input[i];\n const o = f(a, i);\n if (Predicate.isBoolean(o)) {\n if (o) {\n return Option.some(a);\n }\n } else {\n if (Option.isSome(o)) {\n return o;\n }\n }\n }\n return Option.none();\n});\n/**\n * Returns a tuple of the first element that satisfies the specified\n * predicate and its index, or `None` if no such element exists.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.findFirstWithIndex([1, 2, 3, 4, 5], x => x > 3)\n * console.log(result) // Option.some([4, 3])\n * ```\n *\n * @category elements\n * @since 3.17.0\n */\nexport const findFirstWithIndex = /*#__PURE__*/dual(2, (self, f) => {\n let i = 0;\n for (const a of self) {\n const o = f(a, i);\n if (Predicate.isBoolean(o)) {\n if (o) {\n return Option.some([a, i]);\n }\n } else {\n if (Option.isSome(o)) {\n return Option.some([o.value, i]);\n }\n }\n i++;\n }\n return Option.none();\n});\n/**\n * Counts all the element of the given array that pass the given predicate\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.countBy([1, 2, 3, 4, 5], n => n % 2 === 0)\n * console.log(result) // 2\n * ```\n *\n * @category folding\n * @since 3.16.0\n */\nexport const countBy = /*#__PURE__*/dual(2, (self, f) => {\n let count = 0;\n const as = fromIterable(self);\n for (let i = 0; i < as.length; i++) {\n const a = as[i];\n if (f(a, i)) {\n count++;\n }\n }\n return count;\n});\n/**\n * Insert an element at the specified index, creating a new `NonEmptyArray`,\n * or return `None` if the index is out of bounds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.insertAt(['a', 'b', 'c', 'e'], 3, 'd')\n * console.log(result) // Option.some(['a', 'b', 'c', 'd', 'e'])\n * ```\n *\n * @since 2.0.0\n */\nexport const insertAt = /*#__PURE__*/dual(3, (self, i, b) => {\n const out = Array.from(self);\n // v--- `= self.length` is ok, it means inserting in last position\n if (i < 0 || i > out.length) {\n return Option.none();\n }\n out.splice(i, 0, b);\n return Option.some(out);\n});\n/**\n * Change the element at the specified index, creating a new `Array`,\n * or return a copy of the input if the index is out of bounds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.replace(['a', 'b', 'c', 'd'], 1, 'z')\n * console.log(result) // ['a', 'z', 'c', 'd']\n * ```\n *\n * @since 2.0.0\n */\nexport const replace = /*#__PURE__*/dual(3, (self, i, b) => modify(self, i, () => b));\n/**\n * Replaces an element in an array with the given value, returning an option of the updated array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.replaceOption([1, 2, 3], 1, 4)\n * console.log(result) // Option.some([1, 4, 3])\n * ```\n *\n * @since 2.0.0\n */\nexport const replaceOption = /*#__PURE__*/dual(3, (self, i, b) => modifyOption(self, i, () => b));\n/**\n * Apply a function to the element at the specified index, creating a new `Array`,\n * or return a copy of the input if the index is out of bounds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.modify([1, 2, 3, 4], 2, (n) => n * 2)\n * console.log(result) // [1, 2, 6, 4]\n * ```\n *\n * @since 2.0.0\n */\nexport const modify = /*#__PURE__*/dual(3, (self, i, f) => {\n const out = Array.from(self);\n if (isOutOfBounds(i, out)) {\n return out;\n }\n const b = f(out[i]);\n out[i] = b;\n return out;\n});\n/**\n * Apply a function to the element at the specified index, creating a new `Array`,\n * or return `None` if the index is out of bounds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const input = [1, 2, 3, 4]\n * const result = Array.modifyOption(input, 2, (n) => n * 2)\n * console.log(result) // Option.some([1, 2, 6, 4])\n *\n * const outOfBoundsResult = Array.modifyOption(input, 5, (n) => n * 2)\n * console.log(outOfBoundsResult) // Option.none()\n * ```\n *\n * @since 2.0.0\n */\nexport const modifyOption = /*#__PURE__*/dual(3, (self, i, f) => {\n const arr = fromIterable(self);\n if (isOutOfBounds(i, arr)) {\n return Option.none();\n }\n const out = Array.isArray(self) ? self.slice() : arr;\n const b = f(arr[i]);\n out[i] = b;\n return Option.some(out);\n});\n/**\n * Delete the element at the specified index, creating a new `Array`,\n * or return a copy of the input if the index is out of bounds.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const input = [1, 2, 3, 4]\n * const result = Array.remove(input, 2)\n * console.log(result) // [1, 2, 4]\n *\n * const outOfBoundsResult = Array.remove(input, 5)\n * console.log(outOfBoundsResult) // [1, 2, 3, 4]\n * ```\n *\n * @since 2.0.0\n */\nexport const remove = /*#__PURE__*/dual(2, (self, i) => {\n const out = Array.from(self);\n if (isOutOfBounds(i, out)) {\n return out;\n }\n out.splice(i, 1);\n return out;\n});\n/**\n * Delete the element at the specified index, creating a new `Array`,\n * or return `None` if the index is out of bounds.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Array, Option } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4]\n * const result = Array.removeOption(numbers, 2)\n * assert.deepStrictEqual(result, Option.some([1, 2, 4]))\n *\n * const outOfBoundsResult = Array.removeOption(numbers, 5)\n * assert.deepStrictEqual(outOfBoundsResult, Option.none())\n * ```\n *\n * @since 3.16.0\n */\nexport const removeOption = /*#__PURE__*/dual(2, (self, i) => {\n const arr = fromIterable(self);\n if (isOutOfBounds(i, arr)) {\n return Option.none();\n }\n const out = Array.isArray(self) ? self.slice() : arr;\n out.splice(i, 1);\n return Option.some(out);\n});\n/**\n * Reverse an `Iterable`, creating a new `Array`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.reverse([1, 2, 3, 4])\n * console.log(result) // [4, 3, 2, 1]\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const reverse = self => Array.from(self).reverse();\n/**\n * Create a new array with elements sorted in increasing order based on the specified comparator.\n * If the input is a `NonEmptyReadonlyArray`, the output will also be a `NonEmptyReadonlyArray`.\n *\n * @category sorting\n * @since 2.0.0\n */\nexport const sort = /*#__PURE__*/dual(2, (self, O) => {\n const out = Array.from(self);\n out.sort(O);\n return out;\n});\n/**\n * Sorts an array based on a provided mapping function and order. The mapping\n * function transforms the elements into a value that can be compared, and the\n * order defines how those values should be sorted.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Order } from \"effect\"\n *\n * const result = Array.sortWith([\"aaa\", \"b\", \"cc\"], (s) => s.length, Order.number)\n * console.log(result) // [\"b\", \"cc\", \"aaa\"]\n *\n * // Explanation:\n * // The array of strings is sorted based on their lengths. The mapping function `(s) => s.length`\n * // converts each string into its length, and the `Order.number` specifies that the lengths should\n * // be sorted in ascending order.\n * ```\n *\n * @since 2.0.0\n * @category elements\n */\nexport const sortWith = /*#__PURE__*/dual(3, (self, f, order) => Array.from(self).map(a => [a, f(a)]).sort(([, a], [, b]) => order(a, b)).map(([_]) => _));\n/**\n * Sorts the elements of an `Iterable` in increasing order based on the provided\n * orders. The elements are compared using the first order in `orders`, then the\n * second order if the first comparison is equal, and so on.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Order, pipe } from \"effect\"\n *\n * const users = [\n * { name: \"Alice\", age: 30 },\n * { name: \"Bob\", age: 25 },\n * { name: \"Charlie\", age: 30 }\n * ]\n *\n * const result = pipe(\n * users,\n * Array.sortBy(\n * Order.mapInput(Order.number, (user: (typeof users)[number]) => user.age),\n * Order.mapInput(Order.string, (user: (typeof users)[number]) => user.name)\n * )\n * )\n *\n * console.log(result)\n * // [\n * // { name: \"Bob\", age: 25 },\n * // { name: \"Alice\", age: 30 },\n * // { name: \"Charlie\", age: 30 }\n * // ]\n *\n * // Explanation:\n * // The array of users is sorted first by age in ascending order. When ages are equal,\n * // the users are further sorted by name in ascending order.\n * ```\n *\n * @category sorting\n * @since 2.0.0\n */\nexport const sortBy = (...orders) => {\n const sortByAll = sort(Order.combineAll(orders));\n return self => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n return sortByAll(input);\n }\n return [];\n };\n};\n/**\n * Takes two `Iterable`s and returns an `Array` of corresponding pairs.\n * If one input `Iterable` is short, excess elements of the\n * longer `Iterable` are discarded.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.zip([1, 2, 3], ['a', 'b'])\n * console.log(result) // [[1, 'a'], [2, 'b']]\n * ```\n *\n * @category zipping\n * @since 2.0.0\n */\nexport const zip = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, Tuple.make));\n/**\n * Apply a function to pairs of elements at the same index in two `Iterable`s, collecting the results in a new `Array`. If one\n * input `Iterable` is short, excess elements of the longer `Iterable` are discarded.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.zipWith([1, 2, 3], [4, 5, 6], (a, b) => a + b)\n * console.log(result) // [5, 7, 9]\n * ```\n *\n * @category zipping\n * @since 2.0.0\n */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => {\n const as = fromIterable(self);\n const bs = fromIterable(that);\n if (isNonEmptyReadonlyArray(as) && isNonEmptyReadonlyArray(bs)) {\n const out = [f(headNonEmpty(as), headNonEmpty(bs))];\n const len = Math.min(as.length, bs.length);\n for (let i = 1; i < len; i++) {\n out[i] = f(as[i], bs[i]);\n }\n return out;\n }\n return [];\n});\n/**\n * This function is the inverse of `zip`. Takes an `Iterable` of pairs and return two corresponding `Array`s.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.unzip([[1, \"a\"], [2, \"b\"], [3, \"c\"]])\n * console.log(result) // [[1, 2, 3], ['a', 'b', 'c']]\n * ```\n *\n * @since 2.0.0\n */\nexport const unzip = self => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n const fa = [input[0][0]];\n const fb = [input[0][1]];\n for (let i = 1; i < input.length; i++) {\n fa[i] = input[i][0];\n fb[i] = input[i][1];\n }\n return [fa, fb];\n }\n return [[], []];\n};\n/**\n * Places an element in between members of an `Iterable`.\n * If the input is a non-empty array, the result is also a non-empty array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.intersperse([1, 2, 3], 0)\n * console.log(result) // [1, 0, 2, 0, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const intersperse = /*#__PURE__*/dual(2, (self, middle) => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n const out = [headNonEmpty(input)];\n const tail = tailNonEmpty(input);\n for (let i = 0; i < tail.length; i++) {\n if (i < tail.length) {\n out.push(middle);\n }\n out.push(tail[i]);\n }\n return out;\n }\n return [];\n});\n/**\n * Apply a function to the head, creating a new `NonEmptyReadonlyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.modifyNonEmptyHead([1, 2, 3], n => n * 10)\n * console.log(result) // [10, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const modifyNonEmptyHead = /*#__PURE__*/dual(2, (self, f) => [f(headNonEmpty(self)), ...tailNonEmpty(self)]);\n/**\n * Change the head, creating a new `NonEmptyReadonlyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.setNonEmptyHead([1, 2, 3], 10)\n * console.log(result) // [10, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const setNonEmptyHead = /*#__PURE__*/dual(2, (self, b) => modifyNonEmptyHead(self, () => b));\n/**\n * Apply a function to the last element, creating a new `NonEmptyReadonlyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.modifyNonEmptyLast([1, 2, 3], n => n * 2)\n * console.log(result) // [1, 2, 6]\n * ```\n *\n * @since 2.0.0\n */\nexport const modifyNonEmptyLast = /*#__PURE__*/dual(2, (self, f) => append(initNonEmpty(self), f(lastNonEmpty(self))));\n/**\n * Change the last element, creating a new `NonEmptyReadonlyArray`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.setNonEmptyLast([1, 2, 3], 4)\n * console.log(result) // [1, 2, 4]\n * ```\n *\n * @since 2.0.0\n */\nexport const setNonEmptyLast = /*#__PURE__*/dual(2, (self, b) => modifyNonEmptyLast(self, () => b));\n/**\n * Rotate an `Iterable` by `n` steps.\n * If the input is a non-empty array, the result is also a non-empty array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.rotate(['a', 'b', 'c', 'd', 'e'], 2)\n * console.log(result) // [ 'd', 'e', 'a', 'b', 'c' ]\n * ```\n *\n * @since 2.0.0\n */\nexport const rotate = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n const len = input.length;\n const m = Math.round(n) % len;\n if (isOutOfBounds(Math.abs(m), input) || m === 0) {\n return copy(input);\n }\n if (m < 0) {\n const [f, s] = splitNonEmptyAt(input, -m);\n return appendAll(s, f);\n } else {\n return rotate(self, m - len);\n }\n }\n return [];\n});\n/**\n * Returns a function that checks if a `ReadonlyArray` contains a given value using a provided `isEquivalent` function.\n *\n * **Example**\n *\n * ```ts\n * import { Array, pipe } from \"effect\"\n *\n * const isEquivalent = (a: number, b: number) => a === b\n * const containsNumber = Array.containsWith(isEquivalent)\n * const result = pipe([1, 2, 3, 4], containsNumber(3))\n * console.log(result) // true\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const containsWith = isEquivalent => dual(2, (self, a) => {\n for (const i of self) {\n if (isEquivalent(a, i)) {\n return true;\n }\n }\n return false;\n});\nconst _equivalence = /*#__PURE__*/Equal.equivalence();\n/**\n * Returns a function that checks if a `ReadonlyArray` contains a given value using the default `Equivalence`.\n *\n * **Example**\n *\n * ```ts\n * import { Array, pipe } from \"effect\"\n *\n * const result = pipe(['a', 'b', 'c', 'd'], Array.contains('c'))\n * console.log(result) // true\n * ```\n *\n * @category elements\n * @since 2.0.0\n */\nexport const contains = /*#__PURE__*/containsWith(_equivalence);\n/**\n * A useful recursion pattern for processing an `Iterable` to produce a new `Array`, often used for \"chopping\" up the input\n * `Iterable`. Typically chop is called with some function that will consume an initial prefix of the `Iterable` and produce a\n * value and the rest of the `Array`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.chop([1, 2, 3, 4, 5], (as): [number, Array<number>] => [as[0] * 2, as.slice(1)])\n * console.log(result) // [2, 4, 6, 8, 10]\n *\n * // Explanation:\n * // The `chopFunction` takes the first element of the array, doubles it, and then returns it along with the rest of the array.\n * // The `chop` function applies this `chopFunction` recursively to the input array `[1, 2, 3, 4, 5]`,\n * // resulting in a new array `[2, 4, 6, 8, 10]`.\n * ```\n *\n * @since 2.0.0\n */\nexport const chop = /*#__PURE__*/dual(2, (self, f) => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n const [b, rest] = f(input);\n const out = [b];\n let next = rest;\n while (internalArray.isNonEmptyArray(next)) {\n const [b, rest] = f(next);\n out.push(b);\n next = rest;\n }\n return out;\n }\n return [];\n});\n/**\n * Splits an `Iterable` into two segments, with the first segment containing a maximum of `n` elements.\n * The value of `n` can be `0`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.splitAt([1, 2, 3, 4, 5], 3)\n * console.log(result) // [[1, 2, 3], [4, 5]]\n * ```\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const splitAt = /*#__PURE__*/dual(2, (self, n) => {\n const input = Array.from(self);\n const _n = Math.floor(n);\n if (isNonEmptyReadonlyArray(input)) {\n if (_n >= 1) {\n return splitNonEmptyAt(input, _n);\n }\n return [[], input];\n }\n return [input, []];\n});\n/**\n * Splits a `NonEmptyReadonlyArray` into two segments, with the first segment containing a maximum of `n` elements.\n * The value of `n` must be `>= 1`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.splitNonEmptyAt([\"a\", \"b\", \"c\", \"d\", \"e\"], 3)\n * console.log(result) // [[\"a\", \"b\", \"c\"], [\"d\", \"e\"]]\n * ```\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const splitNonEmptyAt = /*#__PURE__*/dual(2, (self, n) => {\n const _n = Math.max(1, Math.floor(n));\n return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];\n});\n/**\n * Splits this iterable into `n` equally sized arrays.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.split([1, 2, 3, 4, 5, 6, 7, 8], 3)\n * console.log(result) // [[1, 2, 3], [4, 5, 6], [7, 8]]\n * ```\n *\n * @since 2.0.0\n * @category splitting\n */\nexport const split = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n return chunksOf(input, Math.ceil(input.length / Math.floor(n)));\n});\n/**\n * Splits this iterable on the first element that matches this predicate.\n * Returns a tuple containing two arrays: the first one is before the match, and the second one is from the match onward.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.splitWhere([1, 2, 3, 4, 5], n => n > 3)\n * console.log(result) // [[1, 2, 3], [4, 5]]\n * ```\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const splitWhere = /*#__PURE__*/dual(2, (self, predicate) => span(self, (a, i) => !predicate(a, i)));\n/**\n * Copies an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.copy([1, 2, 3])\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const copy = self => self.slice();\n/**\n * Pads an array.\n * Returns a new array of length `n` with the elements of `array` followed by `fill` elements if `array` is shorter than `n`.\n * If `array` is longer than `n`, the returned array will be a slice of `array` containing the `n` first elements of `array`.\n * If `n` is less than or equal to 0, the returned array will be an empty array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.pad([1, 2, 3], 6, 0)\n * console.log(result) // [1, 2, 3, 0, 0, 0]\n * ```\n *\n * @since 3.8.4\n */\nexport const pad = /*#__PURE__*/dual(3, (self, n, fill) => {\n if (self.length >= n) {\n return take(self, n);\n }\n return appendAll(self, makeBy(n - self.length, () => fill));\n});\n/**\n * Splits an `Iterable` into length-`n` pieces. The last piece will be shorter if `n` does not evenly divide the length of\n * the `Iterable`. Note that `chunksOf(n)([])` is `[]`, not `[[]]`. This is intentional, and is consistent with a recursive\n * definition of `chunksOf`; it satisfies the property that\n *\n * ```ts skip-type-checking\n * chunksOf(n)(xs).concat(chunksOf(n)(ys)) == chunksOf(n)(xs.concat(ys)))\n * ```\n *\n * whenever `n` evenly divides the length of `self`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.chunksOf([1, 2, 3, 4, 5], 2)\n * console.log(result) // [[1, 2], [3, 4], [5]]\n *\n * // Explanation:\n * // The `chunksOf` function takes an array of numbers `[1, 2, 3, 4, 5]` and a number `2`.\n * // It splits the array into chunks of length 2. Since the array length is not evenly divisible by 2,\n * // the last chunk contains the remaining elements.\n * // The result is `[[1, 2], [3, 4], [5]]`.\n * ```\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const chunksOf = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n return chop(input, splitNonEmptyAt(n));\n }\n return [];\n});\n/**\n * Creates sliding windows of size `n` from an `Iterable`.\n * If the number of elements is less than `n` or if `n` is not greater than zero,\n * an empty array is returned.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Array } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5]\n * assert.deepStrictEqual(Array.window(numbers, 3), [[1, 2, 3], [2, 3, 4], [3, 4, 5]])\n * assert.deepStrictEqual(Array.window(numbers, 6), [])\n * ```\n *\n * @category splitting\n * @since 3.13.2\n */\nexport const window = /*#__PURE__*/dual(2, (self, n) => {\n const input = fromIterable(self);\n if (n > 0 && isNonEmptyReadonlyArray(input)) {\n return Array.from({\n length: input.length - (n - 1)\n }, (_, index) => input.slice(index, index + n));\n }\n return [];\n});\n/**\n * Group equal, consecutive elements of a `NonEmptyReadonlyArray` into `NonEmptyArray`s using the provided `isEquivalent` function.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.groupWith([\"a\", \"a\", \"b\", \"b\", \"b\", \"c\", \"a\"], (x, y) => x === y)\n * console.log(result) // [[\"a\", \"a\"], [\"b\", \"b\", \"b\"], [\"c\"], [\"a\"]]\n * ```\n *\n * @category grouping\n * @since 2.0.0\n */\nexport const groupWith = /*#__PURE__*/dual(2, (self, isEquivalent) => chop(self, as => {\n const h = headNonEmpty(as);\n const out = [h];\n let i = 1;\n for (; i < as.length; i++) {\n const a = as[i];\n if (isEquivalent(a, h)) {\n out.push(a);\n } else {\n break;\n }\n }\n return [out, as.slice(i)];\n}));\n/**\n * Group equal, consecutive elements of a `NonEmptyReadonlyArray` into `NonEmptyArray`s.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.group([1, 1, 2, 2, 2, 3, 1])\n * console.log(result) // [[1, 1], [2, 2, 2], [3], [1]]\n * ```\n *\n * @category grouping\n * @since 2.0.0\n */\nexport const group = /*#__PURE__*/groupWith(/*#__PURE__*/Equal.equivalence());\n/**\n * Splits an `Iterable` into sub-non-empty-arrays stored in an object, based on the result of calling a `string`-returning\n * function on each element, and grouping the results according to values returned\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const people = [\n * { name: \"Alice\", group: \"A\" },\n * { name: \"Bob\", group: \"B\" },\n * { name: \"Charlie\", group: \"A\" }\n * ]\n *\n * const result = Array.groupBy(people, person => person.group)\n * console.log(result)\n * // {\n * // A: [{ name: \"Alice\", group: \"A\" }, { name: \"Charlie\", group: \"A\" }],\n * // B: [{ name: \"Bob\", group: \"B\" }]\n * // }\n * ```\n *\n * @category grouping\n * @since 2.0.0\n */\nexport const groupBy = /*#__PURE__*/dual(2, (self, f) => {\n const out = {};\n for (const a of self) {\n const k = f(a);\n if (Object.prototype.hasOwnProperty.call(out, k)) {\n out[k].push(a);\n } else {\n out[k] = [a];\n }\n }\n return out;\n});\n/**\n * Calculates the union of two arrays using the provided equivalence relation.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const union = Array.unionWith([1, 2], [2, 3], (a, b) => a === b)\n * console.log(union) // [1, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const unionWith = /*#__PURE__*/dual(3, (self, that, isEquivalent) => {\n const a = fromIterable(self);\n const b = fromIterable(that);\n if (isNonEmptyReadonlyArray(a)) {\n if (isNonEmptyReadonlyArray(b)) {\n const dedupe = dedupeWith(isEquivalent);\n return dedupe(appendAll(a, b));\n }\n return a;\n }\n return b;\n});\n/**\n * Creates a union of two arrays, removing duplicates.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.union([1, 2], [2, 3])\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that, _equivalence));\n/**\n * Creates an `Array` of unique values that are included in all given `Iterable`s using the provided `isEquivalent` function.\n * The order and references of result values are determined by the first `Iterable`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]\n * const array2 = [{ id: 3 }, { id: 4 }, { id: 1 }]\n * const isEquivalent = (a: { id: number }, b: { id: number }) => a.id === b.id\n * const result = Array.intersectionWith(isEquivalent)(array2)(array1)\n * console.log(result) // [{ id: 1 }, { id: 3 }]\n * ```\n *\n * @since 2.0.0\n */\nexport const intersectionWith = isEquivalent => {\n const has = containsWith(isEquivalent);\n return dual(2, (self, that) => {\n const bs = fromIterable(that);\n return fromIterable(self).filter(a => has(bs, a));\n });\n};\n/**\n * Creates an `Array` of unique values that are included in all given `Iterable`s.\n * The order and references of result values are determined by the first `Iterable`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.intersection([1, 2, 3], [3, 4, 1])\n * console.log(result) // [1, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const intersection = /*#__PURE__*/intersectionWith(_equivalence);\n/**\n * Creates a `Array` of values not included in the other given `Iterable` using the provided `isEquivalent` function.\n * The order and references of result values are determined by the first `Iterable`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const array1 = [1, 2, 3]\n * const array2 = [2, 3, 4]\n * const difference = Array.differenceWith<number>((a, b) => a === b)(array1, array2)\n * console.log(difference) // [1]\n * ```\n *\n * @since 2.0.0\n */\nexport const differenceWith = isEquivalent => {\n const has = containsWith(isEquivalent);\n return dual(2, (self, that) => {\n const bs = fromIterable(that);\n return fromIterable(self).filter(a => !has(bs, a));\n });\n};\n/**\n * Creates a `Array` of values not included in the other given `Iterable`.\n * The order and references of result values are determined by the first `Iterable`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const difference = Array.difference([1, 2, 3], [2, 3, 4])\n * console.log(difference) // [1]\n * ```\n *\n * @since 2.0.0\n */\nexport const difference = /*#__PURE__*/differenceWith(_equivalence);\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const empty = () => [];\n/**\n * Constructs a new `NonEmptyArray<A>` from the specified value.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const of = a => [a];\n/**\n * @category mapping\n * @since 2.0.0\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => self.map(f));\n/**\n * Applies a function to each element in an array and returns a new array containing the concatenated mapped elements.\n *\n * @category sequencing\n * @since 2.0.0\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n if (isEmptyReadonlyArray(self)) {\n return [];\n }\n const out = [];\n for (let i = 0; i < self.length; i++) {\n const inner = f(self[i], i);\n for (let j = 0; j < inner.length; j++) {\n out.push(inner[j]);\n }\n }\n return out;\n});\n/**\n * Combines multiple arrays into a single array by concatenating all elements\n * from each nested array. This function ensures that the structure of nested\n * arrays is collapsed into a single, flat array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.flatten([[1, 2], [], [3, 4], [], [5, 6]])\n * console.log(result) // [1, 2, 3, 4, 5, 6]\n * ```\n *\n * @category sequencing\n * @since 2.0.0\n */\nexport const flatten = /*#__PURE__*/flatMap(identity);\n/**\n * Applies a function to each element of the `Iterable` and filters based on the result, keeping the transformed values where the function returns `Some`.\n * This method combines filtering and mapping functionalities, allowing transformations and filtering of elements based on a single function pass.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Option } from \"effect\"\n *\n * const evenSquares = (x: number) => x % 2 === 0 ? Option.some(x * x) : Option.none()\n *\n * const result = Array.filterMap([1, 2, 3, 4, 5], evenSquares);\n * console.log(result) // [4, 16]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const filterMap = /*#__PURE__*/dual(2, (self, f) => {\n const as = fromIterable(self);\n const out = [];\n for (let i = 0; i < as.length; i++) {\n const o = f(as[i], i);\n if (Option.isSome(o)) {\n out.push(o.value);\n }\n }\n return out;\n});\n/**\n * Applies a function to each element of the array and filters based on the result, stopping when a condition is not met.\n * This method combines filtering and mapping in a single pass, and short-circuits, i.e., stops processing, as soon as the function returns `None`.\n * This is useful when you need to transform an array but only up to the point where a certain condition holds true.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Option } from \"effect\"\n *\n * const toSquareTillOdd = (x: number) => x % 2 === 0 ? Option.some(x * x) : Option.none()\n *\n * const result = Array.filterMapWhile([2, 4, 5], toSquareTillOdd)\n * console.log(result) // [4, 16]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const filterMapWhile = /*#__PURE__*/dual(2, (self, f) => {\n let i = 0;\n const out = [];\n for (const a of self) {\n const b = f(a, i);\n if (Option.isSome(b)) {\n out.push(b.value);\n } else {\n break;\n }\n i++;\n }\n return out;\n});\n/**\n * Applies a function to each element of the `Iterable`, categorizing the results into two separate arrays.\n * This function is particularly useful for operations where each element can result in two possible types,\n * and you want to separate these types into different collections. For instance, separating validation results\n * into successes and failures.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Either } from \"effect\";\n *\n * const isEven = (x: number) => x % 2 === 0\n *\n * const result = Array.partitionMap([1, 2, 3, 4, 5], x =>\n * isEven(x) ? Either.right(x) : Either.left(x)\n * )\n * console.log(result)\n * // [\n * // [1, 3, 5],\n * // [2, 4]\n * // ]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const partitionMap = /*#__PURE__*/dual(2, (self, f) => {\n const left = [];\n const right = [];\n const as = fromIterable(self);\n for (let i = 0; i < as.length; i++) {\n const e = f(as[i], i);\n if (Either.isLeft(e)) {\n left.push(e.left);\n } else {\n right.push(e.right);\n }\n }\n return [left, right];\n});\n/**\n * Retrieves the `Some` values from an `Iterable` of `Option`s, collecting them into an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Option } from \"effect\"\n *\n * const result = Array.getSomes([Option.some(1), Option.none(), Option.some(2)])\n * console.log(result) // [1, 2]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const getSomes = /*#__PURE__*/filterMap(identity);\n/**\n * Retrieves the `Left` values from an `Iterable` of `Either`s, collecting them into an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Either } from \"effect\"\n *\n * const result = Array.getLefts([Either.right(1), Either.left(\"err\"), Either.right(2)])\n * console.log(result) // [\"err\"]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const getLefts = self => {\n const out = [];\n for (const a of self) {\n if (Either.isLeft(a)) {\n out.push(a.left);\n }\n }\n return out;\n};\n/**\n * Retrieves the `Right` values from an `Iterable` of `Either`s, collecting them into an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Either } from \"effect\"\n *\n * const result = Array.getRights([Either.right(1), Either.left(\"err\"), Either.right(2)])\n * console.log(result) // [1, 2]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const getRights = self => {\n const out = [];\n for (const a of self) {\n if (Either.isRight(a)) {\n out.push(a.right);\n }\n }\n return out;\n};\n/**\n * @category filtering\n * @since 2.0.0\n */\nexport const filter = /*#__PURE__*/dual(2, (self, predicate) => {\n const as = fromIterable(self);\n const out = [];\n for (let i = 0; i < as.length; i++) {\n if (predicate(as[i], i)) {\n out.push(as[i]);\n }\n }\n return out;\n});\n/**\n * Separate elements based on a predicate that also exposes the index of the element.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.partition([1, 2, 3, 4], n => n % 2 === 0)\n * console.log(result) // [[1, 3], [2, 4]]\n * ```\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const partition = /*#__PURE__*/dual(2, (self, predicate) => {\n const left = [];\n const right = [];\n const as = fromIterable(self);\n for (let i = 0; i < as.length; i++) {\n if (predicate(as[i], i)) {\n right.push(as[i]);\n } else {\n left.push(as[i]);\n }\n }\n return [left, right];\n});\n/**\n * Separates an `Iterable` into two arrays based on a predicate.\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const separate = /*#__PURE__*/partitionMap(identity);\n/**\n * Reduces an array from the left.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.reduce([1, 2, 3], 0, (acc, n) => acc + n)\n * console.log(result) // 6\n * ```\n *\n * @category folding\n * @since 2.0.0\n */\nexport const reduce = /*#__PURE__*/dual(3, (self, b, f) => fromIterable(self).reduce((b, a, i) => f(b, a, i), b));\n/**\n * Reduces an array from the right.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.reduceRight([1, 2, 3], 0, (acc, n) => acc + n)\n * console.log(result) // 6\n * ```\n *\n * @category folding\n * @since 2.0.0\n */\nexport const reduceRight = /*#__PURE__*/dual(3, (self, b, f) => fromIterable(self).reduceRight((b, a, i) => f(b, a, i), b));\n/**\n * Lifts a predicate into an array.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const isEven = (n: number) => n % 2 === 0\n * const to = Array.liftPredicate(isEven)\n * console.log(to(1)) // []\n * console.log(to(2)) // [2]\n * ```\n *\n * @category lifting\n * @since 2.0.0\n */\nexport const liftPredicate = predicate => b => predicate(b) ? [b] : [];\n/**\n * @category lifting\n * @since 2.0.0\n */\nexport const liftOption = f => (...a) => fromOption(f(...a));\n/**\n * @category conversions\n * @since 2.0.0\n */\nexport const fromNullable = a => a == null ? empty() : [a];\n/**\n * @category lifting\n * @since 2.0.0\n */\nexport const liftNullable = f => (...a) => fromNullable(f(...a));\n/**\n * Maps over an array and flattens the result, removing null and undefined values.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.flatMapNullable([1, 2, 3], n => (n % 2 === 0 ? null : n))\n * console.log(result) // [1, 3]\n *\n * // Explanation:\n * // The array of numbers [1, 2, 3] is mapped with a function that returns null for even numbers\n * // and the number itself for odd numbers. The resulting array [1, null, 3] is then flattened\n * // to remove null values, resulting in [1, 3].\n * ```\n *\n * @category sequencing\n * @since 2.0.0\n */\nexport const flatMapNullable = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => fromNullable(f(a))));\n/**\n * Lifts a function that returns an `Either` into a function that returns an array.\n * If the `Either` is a left, it returns an empty array.\n * If the `Either` is a right, it returns an array with the right value.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Either } from \"effect\"\n *\n * const parseNumber = (s: string): Either.Either<number, Error> =>\n * isNaN(Number(s)) ? Either.left(new Error(\"Not a number\")) : Either.right(Number(s))\n *\n * const liftedParseNumber = Array.liftEither(parseNumber)\n *\n * const result1 = liftedParseNumber(\"42\")\n * console.log(result1) // [42]\n *\n * const result2 = liftedParseNumber(\"not a number\")\n * console.log(result2) // []\n *\n * // Explanation:\n * // The function parseNumber is lifted to return an array.\n * // When parsing \"42\", it returns an Either.left with the number 42, resulting in [42].\n * // When parsing \"not a number\", it returns an Either.right with an error, resulting in an empty array [].\n * ```\n *\n * @category lifting\n * @since 2.0.0\n */\nexport const liftEither = f => (...a) => {\n const e = f(...a);\n return Either.isLeft(e) ? [] : [e.right];\n};\n/**\n * Check if a predicate holds true for every `ReadonlyArray` element.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const every = /*#__PURE__*/dual(2, (self, refinement) => self.every(refinement));\n/**\n * Check if a predicate holds true for some `ReadonlyArray` element.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const some = /*#__PURE__*/dual(2, (self, predicate) => self.some(predicate));\n/**\n * Extends an array with a function that maps each subarray to a value.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.extend([1, 2, 3], as => as.length)\n * console.log(result) // [3, 2, 1]\n *\n * // Explanation:\n * // The function maps each subarray starting from each element to its length.\n * // The subarrays are: [1, 2, 3], [2, 3], [3].\n * // The lengths are: 3, 2, 1.\n * // Therefore, the result is [3, 2, 1].\n * ```\n *\n * @since 2.0.0\n */\nexport const extend = /*#__PURE__*/dual(2, (self, f) => self.map((_, i, as) => f(as.slice(i))));\n/**\n * Finds the minimum element in an array based on a comparator.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Order } from \"effect\"\n *\n * const result = Array.min([3, 1, 2], Order.number)\n * console.log(result) // 1\n * ```\n *\n * @since 2.0.0\n */\nexport const min = /*#__PURE__*/dual(2, (self, O) => self.reduce(Order.min(O)));\n/**\n * Finds the maximum element in an array based on a comparator.\n *\n * **Example**\n *\n * ```ts\n * import { Array, Order } from \"effect\"\n *\n * const result = Array.max([3, 1, 2], Order.number)\n * console.log(result) // 3\n * ```\n *\n * @since 2.0.0\n */\nexport const max = /*#__PURE__*/dual(2, (self, O) => self.reduce(Order.max(O)));\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const unfold = (b, f) => {\n const out = [];\n let next = b;\n let o;\n while (Option.isSome(o = f(next))) {\n const [a, b] = o.value;\n out.push(a);\n next = b;\n }\n return out;\n};\n/**\n * This function creates and returns a new `Order` for an array of values based on a given `Order` for the elements of the array.\n * The returned `Order` compares two arrays by applying the given `Order` to each element in the arrays.\n * If all elements are equal, the arrays are then compared based on their length.\n * It is useful when you need to compare two arrays of the same type and you have a specific way of comparing each element of the array.\n *\n * @category instances\n * @since 2.0.0\n */\nexport const getOrder = Order.array;\n/**\n * Creates an equivalence relation for arrays.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const eq = Array.getEquivalence<number>((a, b) => a === b)\n * console.log(eq([1, 2, 3], [1, 2, 3])) // true\n * ```\n *\n * @category instances\n * @since 2.0.0\n */\nexport const getEquivalence = Equivalence.array;\n/**\n * Performs a side-effect for each element of the `Iterable`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * Array.forEach([1, 2, 3], n => console.log(n)) // 1, 2, 3\n * ```\n *\n * @since 2.0.0\n */\nexport const forEach = /*#__PURE__*/dual(2, (self, f) => fromIterable(self).forEach((a, i) => f(a, i)));\n/**\n * Remove duplicates from an `Iterable` using the provided `isEquivalent` function,\n * preserving the order of the first occurrence of each element.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.dedupeWith([1, 2, 2, 3, 3, 3], (a, b) => a === b)\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const dedupeWith = /*#__PURE__*/dual(2, (self, isEquivalent) => {\n const input = fromIterable(self);\n if (isNonEmptyReadonlyArray(input)) {\n const out = [headNonEmpty(input)];\n const rest = tailNonEmpty(input);\n for (const r of rest) {\n if (out.every(a => !isEquivalent(r, a))) {\n out.push(r);\n }\n }\n return out;\n }\n return [];\n});\n/**\n * Remove duplicates from an `Iterable`, preserving the order of the first occurrence of each element.\n * The equivalence used to compare elements is provided by `Equal.equivalence()` from the `Equal` module.\n *\n * @since 2.0.0\n */\nexport const dedupe = self => dedupeWith(self, Equal.equivalence());\n/**\n * Deduplicates adjacent elements that are identical using the provided `isEquivalent` function.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.dedupeAdjacentWith([1, 1, 2, 2, 3, 3], (a, b) => a === b)\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const dedupeAdjacentWith = /*#__PURE__*/dual(2, (self, isEquivalent) => {\n const out = [];\n let lastA = Option.none();\n for (const a of self) {\n if (Option.isNone(lastA) || !isEquivalent(a, lastA.value)) {\n out.push(a);\n lastA = Option.some(a);\n }\n }\n return out;\n});\n/**\n * Deduplicates adjacent elements that are identical.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.dedupeAdjacent([1, 1, 2, 2, 3, 3])\n * console.log(result) // [1, 2, 3]\n * ```\n *\n * @since 2.0.0\n */\nexport const dedupeAdjacent = /*#__PURE__*/dedupeAdjacentWith(/*#__PURE__*/Equal.equivalence());\n/**\n * Joins the elements together with \"sep\" in the middle.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const strings = [\"a\", \"b\", \"c\"]\n * const joined = Array.join(strings, \"-\")\n * console.log(joined) // \"a-b-c\"\n * ```\n *\n * @since 2.0.0\n * @category folding\n */\nexport const join = /*#__PURE__*/dual(2, (self, sep) => fromIterable(self).join(sep));\n/**\n * Statefully maps over the chunk, producing new elements of type `B`.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.mapAccum([1, 2, 3], 0, (acc, n) => [acc + n, acc + n])\n * console.log(result) // [6, [1, 3, 6]]\n * ```\n *\n * @since 2.0.0\n * @category folding\n */\nexport const mapAccum = /*#__PURE__*/dual(3, (self, s, f) => {\n let i = 0;\n let s1 = s;\n const out = [];\n for (const a of self) {\n const r = f(s1, a, i);\n s1 = r[0];\n out.push(r[1]);\n i++;\n }\n return [s1, out];\n});\n/**\n * Zips this chunk crosswise with the specified chunk using the specified combiner.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.cartesianWith([1, 2], [\"a\", \"b\"], (a, b) => `${a}-${b}`)\n * console.log(result) // [\"1-a\", \"1-b\", \"2-a\", \"2-b\"]\n * ```\n *\n * @since 2.0.0\n * @category elements\n */\nexport const cartesianWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(self, a => map(that, b => f(a, b))));\n/**\n * Zips this chunk crosswise with the specified chunk.\n *\n * **Example**\n *\n * ```ts\n * import { Array } from \"effect\"\n *\n * const result = Array.cartesian([1, 2], [\"a\", \"b\"])\n * console.log(result) // [[1, \"a\"], [1, \"b\"], [2, \"a\"], [2, \"b\"]]\n * ```\n *\n * @since 2.0.0\n * @category elements\n */\nexport const cartesian = /*#__PURE__*/dual(2, (self, that) => cartesianWith(self, that, (a, b) => [a, b]));\n// -------------------------------------------------------------------------------------\n// do notation\n// -------------------------------------------------------------------------------------\n/**\n * The \"do simulation\" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.\n *\n * It can be used to simulate \"array comprehension\".\n * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * **Example**\n *\n * ```ts\n * import { Array, pipe } from \"effect\"\n *\n * const doResult = pipe(\n * Array.Do,\n * Array.bind(\"x\", () => [1, 3, 5]),\n * Array.bind(\"y\", () => [2, 4, 6]),\n * Array.filter(({ x, y }) => x < y), // condition\n * Array.map(({ x, y }) => [x, y] as const) // transformation\n * )\n * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]\n *\n * // equivalent\n * const x = [1, 3, 5],\n * y = [2, 4, 6],\n * result = [];\n * for(let i = 0; i < x.length; i++) {\n * for(let j = 0; j < y.length; j++) {\n * const _x = x[i], _y = y[j];\n * if(_x < _y) result.push([_x, _y] as const)\n * }\n * }\n * ```\n *\n * @see {@link bindTo}\n * @see {@link bind}\n * @see {@link let_ let}\n *\n * @category do notation\n * @since 3.2.0\n */\nexport const Do = /*#__PURE__*/of({});\n/**\n * The \"do simulation\" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.\n *\n * It can be used to simulate \"array comprehension\".\n * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * **Example**\n *\n * ```ts\n * import { Array, pipe } from \"effect\"\n *\n * const doResult = pipe(\n * Array.Do,\n * Array.bind(\"x\", () => [1, 3, 5]),\n * Array.bind(\"y\", () => [2, 4, 6]),\n * Array.filter(({ x, y }) => x < y), // condition\n * Array.map(({ x, y }) => [x, y] as const) // transformation\n * )\n * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]\n *\n * // equivalent\n * const x = [1, 3, 5],\n * y = [2, 4, 6],\n * result = [];\n * for(let i = 0; i < x.length; i++) {\n * for(let j = 0; j < y.length; j++) {\n * const _x = x[i], _y = y[j];\n * if(_x < _y) result.push([_x, _y] as const)\n * }\n * }\n * ```\n *\n * @see {@link bindTo}\n * @see {@link Do}\n * @see {@link let_ let}\n *\n * @category do notation\n * @since 3.2.0\n */\nexport const bind = /*#__PURE__*/internalDoNotation.bind(map, flatMap);\n/**\n * The \"do simulation\" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.\n *\n * It can be used to simulate \"array comprehension\".\n * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * **Example**\n *\n * ```ts\n * import { Array, pipe } from \"effect\"\n *\n * const doResult = pipe(\n * Array.Do,\n * Array.bind(\"x\", () => [1, 3, 5]),\n * Array.bind(\"y\", () => [2, 4, 6]),\n * Array.filter(({ x, y }) => x < y), // condition\n * Array.map(({ x, y }) => [x, y] as const) // transformation\n * )\n * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]\n *\n * // equivalent\n * const x = [1, 3, 5],\n * y = [2, 4, 6],\n * result = [];\n * for(let i = 0; i < x.length; i++) {\n * for(let j = 0; j < y.length; j++) {\n * const _x = x[i], _y = y[j];\n * if(_x < _y) result.push([_x, _y] as const)\n * }\n * }\n * ```\n *\n * @see {@link bindTo}\n * @see {@link Do}\n * @see {@link let_ let}\n *\n * @category do notation\n * @since 3.2.0\n */\nexport const bindTo = /*#__PURE__*/internalDoNotation.bindTo(map);\nconst let_ = /*#__PURE__*/internalDoNotation.let_(map);\nexport {\n/**\n * The \"do simulation\" for array allows you to sequentially apply operations to the elements of arrays, just as nested loops allow you to go through all combinations of elements in an arrays.\n *\n * It can be used to simulate \"array comprehension\".\n * It's a technique that allows you to create new arrays by iterating over existing ones and applying specific **conditions** or **transformations** to the elements. It's like assembling a new collection from pieces of other collections based on certain rules.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Array` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n * 5. Regular `Array` functions like `map` and `filter` can still be used within the do simulation. These functions will receive the accumulated variables as arguments within the scope\n *\n * **Example**\n *\n * ```ts\n * import { Array, pipe } from \"effect\"\n *\n * const doResult = pipe(\n * Array.Do,\n * Array.bind(\"x\", () => [1, 3, 5]),\n * Array.bind(\"y\", () => [2, 4, 6]),\n * Array.filter(({ x, y }) => x < y), // condition\n * Array.map(({ x, y }) => [x, y] as const) // transformation\n * )\n * console.log(doResult) // [[1, 2], [1, 4], [1, 6], [3, 4], [3, 6], [5, 6]]\n *\n * // equivalent\n * const x = [1, 3, 5],\n * y = [2, 4, 6],\n * result = [];\n * for(let i = 0; i < x.length; i++) {\n * for(let j = 0; j < y.length; j++) {\n * const _x = x[i], _y = y[j];\n * if(_x < _y) result.push([_x, _y] as const)\n * }\n * }\n *\n * ```\n *\n * @see {@link bindTo}\n * @see {@link bind}\n * @see {@link Do}\n *\n * @category do notation\n * @since 3.2.0\n */\nlet_ as let };\n//# sourceMappingURL=Array.js.map","/**\n * # Number\n *\n * This module provides utility functions and type class instances for working\n * with the `number` type in TypeScript. It includes functions for basic\n * arithmetic operations, as well as type class instances for `Equivalence` and\n * `Order`.\n *\n * ## Operations Reference\n *\n * | Category | Operation | Description | Domain | Co-domain |\n * | ------------ | ------------------------------------------ | ------------------------------------------------------- | ------------------------------ | --------------------- |\n * | constructors | {@link module:Number.parse} | Safely parses a string to a number | `string` | `Option<number>` |\n * | | | | | |\n * | math | {@link module:Number.sum} | Adds two numbers | `number`, `number` | `number` |\n * | math | {@link module:Number.sumAll} | Sums all numbers in a collection | `Iterable<number>` | `number` |\n * | math | {@link module:Number.subtract} | Subtracts one number from another | `number`, `number` | `number` |\n * | math | {@link module:Number.multiply} | Multiplies two numbers | `number`, `number` | `number` |\n * | math | {@link module:Number.multiplyAll} | Multiplies all numbers in a collection | `Iterable<number>` | `number` |\n * | math | {@link module:Number.divide} | Safely divides handling division by zero | `number`, `number` | `Option<number>` |\n * | math | {@link module:Number.unsafeDivide} | Divides but misbehaves for division by zero | `number`, `number` | `number` |\n * | math | {@link module:Number.remainder} | Calculates remainder of division | `number`, `number` | `number` |\n * | math | {@link module:Number.increment} | Adds 1 to a number | `number` | `number` |\n * | math | {@link module:Number.decrement} | Subtracts 1 from a number | `number` | `number` |\n * | math | {@link module:Number.sign} | Determines the sign of a number | `number` | `Ordering` |\n * | math | {@link module:Number.nextPow2} | Finds the next power of 2 | `number` | `number` |\n * | math | {@link module:Number.round} | Rounds a number with specified precision | `number`, `number` | `number` |\n * | | | | | |\n * | predicates | {@link module:Number.between} | Checks if a number is in a range | `number`, `{minimum, maximum}` | `boolean` |\n * | predicates | {@link module:Number.lessThan} | Checks if one number is less than another | `number`, `number` | `boolean` |\n * | predicates | {@link module:Number.lessThanOrEqualTo} | Checks if one number is less than or equal | `number`, `number` | `boolean` |\n * | predicates | {@link module:Number.greaterThan} | Checks if one number is greater than another | `number`, `number` | `boolean` |\n * | predicates | {@link module:Number.greaterThanOrEqualTo} | Checks if one number is greater or equal | `number`, `number` | `boolean` |\n * | | | | | |\n * | guards | {@link module:Number.isNumber} | Type guard for JavaScript numbers | `unknown` | `boolean` |\n * | | | | | |\n * | comparison | {@link module:Number.min} | Returns the minimum of two numbers | `number`, `number` | `number` |\n * | comparison | {@link module:Number.max} | Returns the maximum of two numbers | `number`, `number` | `number` |\n * | comparison | {@link module:Number.clamp} | Restricts a number to a range | `number`, `{minimum, maximum}` | `number` |\n * | | | | | |\n * | instances | {@link module:Number.Equivalence} | Equivalence instance for numbers | | `Equivalence<number>` |\n * | instances | {@link module:Number.Order} | Order instance for numbers | | `Order<number>` |\n * | | | | | |\n * | errors | {@link module:Number.DivisionByZeroError} | Error thrown by unsafeDivide | | |\n *\n * ## Composition Patterns and Type Safety\n *\n * When building function pipelines, understanding how types flow through\n * operations is critical:\n *\n * ### Composing with type-preserving operations\n *\n * Most operations in this module are type-preserving (`number → number`),\n * making them easily composable in pipelines:\n *\n * ```ts\n * import { pipe } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * const result = pipe(\n * 10,\n * Number.increment, // number → number\n * Number.multiply(2), // number → number\n * Number.round(1) // number → number\n * ) // Result: number (21)\n * ```\n *\n * ### Working with Option results\n *\n * Operations that might fail (like division by zero) return Option types and\n * require Option combinators:\n *\n * ```ts\n * import { pipe, Option } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * const result = pipe(\n * 10,\n * Number.divide(0), // number → Option<number>\n * Option.getOrElse(() => 0) // Option<number> → number\n * ) // Result: number (0)\n * ```\n *\n * ### Composition best practices\n *\n * - Chain type-preserving operations for maximum composability\n * - Use Option combinators when working with potentially failing operations\n * - Consider using Effect for operations that might fail with specific errors\n * - Remember that all operations maintain JavaScript's floating-point precision\n * limitations\n *\n * @module Number\n * @since 2.0.0\n * @see {@link module:BigInt} for more similar operations on `bigint` types\n * @see {@link module:BigDecimal} for more similar operations on `BigDecimal` types\n */\nimport * as equivalence from \"./Equivalence.js\";\nimport { dual } from \"./Function.js\";\nimport * as option from \"./internal/option.js\";\nimport * as _Iterable from \"./Iterable.js\";\nimport * as order from \"./Order.js\";\nimport * as predicate from \"./Predicate.js\";\n/**\n * Type guard that tests if a value is a member of the set of JavaScript\n * numbers.\n *\n * @memberof Number\n * @since 2.0.0\n * @category guards\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import * as Number from \"effect/Number\"\n *\n * // Regular numbers\n * assert.equal(Number.isNumber(2), true)\n * assert.equal(Number.isNumber(-3.14), true)\n * assert.equal(Number.isNumber(0), true)\n *\n * // Special numeric values\n * assert.equal(Number.isNumber(Infinity), true)\n * assert.equal(Number.isNumber(NaN), true)\n *\n * // Non-number values\n * assert.equal(Number.isNumber(\"2\"), false)\n * assert.equal(Number.isNumber(true), false)\n * assert.equal(Number.isNumber(null), false)\n * assert.equal(Number.isNumber(undefined), false)\n * assert.equal(Number.isNumber({}), false)\n * assert.equal(Number.isNumber([]), false)\n *\n * // Using as a type guard in conditionals\n * function processValue(value: unknown): string {\n * if (Number.isNumber(value)) {\n * // TypeScript now knows 'value' is a number\n * return `Numeric value: ${value.toFixed(2)}`\n * }\n * return \"Not a number\"\n * }\n *\n * assert.strictEqual(processValue(42), \"Numeric value: 42.00\")\n * assert.strictEqual(processValue(\"hello\"), \"Not a number\")\n *\n * // Filtering for numbers in an array\n * const mixed = [1, \"two\", 3, false, 5]\n * const onlyNumbers = mixed.filter(Number.isNumber)\n * assert.equal(onlyNumbers, [1, 3, 5])\n * ```\n *\n * @param input - The value to test for membership in the set of JavaScript\n * numbers\n *\n * @returns `true` if the input is a JavaScript number, `false` otherwise\n */\nexport const isNumber = predicate.isNumber;\n/**\n * Returns the additive inverse of a number, effectively negating it.\n *\n * @memberof Number\n * @since 3.14.6\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { pipe } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * assert.equal(\n * Number.negate(5), //\n * -5\n * )\n *\n * assert.equal(\n * Number.negate(-5), //\n * 5\n * )\n *\n * assert.equal(\n * Number.negate(0), //\n * 0\n * )\n * ```\n *\n * @param n - The number value to be negated.\n *\n * @returns The negated number value.\n */\nexport const negate = n => multiply(n, -1);\n/**\n * Performs addition in the set of JavaScript numbers.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { pipe } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * // Data-first style (direct application)\n * assert.equal(Number.sum(2, 3), 5)\n * assert.equal(Number.sum(-10, 5), -5)\n * assert.equal(Number.sum(0.1, 0.2), 0.30000000000000004) // Note: floating-point precision limitation\n *\n * // Data-last style (pipeable)\n * assert.equal(\n * pipe(\n * 10,\n * Number.sum(5) // 10 + 5 = 15\n * ),\n * 15\n * )\n *\n * // Chaining multiple additions\n * assert.equal(\n * pipe(\n * 1,\n * Number.sum(2), // 1 + 2 = 3\n * Number.sum(3), // 3 + 3 = 6\n * Number.sum(4) // 6 + 4 = 10\n * ),\n * 10\n * )\n *\n * // Identity property: a + 0 = a\n * assert.equal(Number.sum(42, 0), 42)\n *\n * // Commutative property: a + b = b + a\n * assert.equal(Number.sum(5, 3), Number.sum(3, 5))\n * ```\n */\nexport const sum = /*#__PURE__*/dual(2, (self, that) => self + that);\n/**\n * Computes the sum of all elements in an iterable collection of numbers.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import * as Number from \"effect/Number\"\n *\n * // Basic sums\n * assert.equal(Number.sumAll([2, 3, 4]), 9) // 2 + 3 + 4 = 9\n * assert.equal(Number.sumAll([1.1, 2.2, 3.3]), 6.6) // 1.1 + 2.2 + 3.3 = 6.6\n *\n * // Empty collection returns the additive identity (0)\n * assert.equal(Number.sumAll([]), 0)\n *\n * // Single element collection\n * assert.equal(Number.sumAll([42]), 42)\n *\n * // Sums with negative numbers\n * assert.equal(Number.sumAll([2, -3, 4]), 3) // 2 + (-3) + 4 = 3\n * assert.equal(Number.sumAll([-2, -3, -4]), -9) // (-2) + (-3) + (-4) = -9\n *\n * // Works with any iterable\n * assert.equal(Number.sumAll(new Set([2, 3, 4])), 9)\n *\n * // Using with generated sequences\n * function* range(start: number, end: number) {\n * for (let i = start; i <= end; i++) yield i\n * }\n *\n * // Compute sum of first 5 natural numbers: 1 + 2 + 3 + 4 + 5 = 15\n * assert.equal(Number.sumAll(range(1, 5)), 15)\n *\n * // Floating point precision example\n * assert.equal(\n * Number.sumAll([0.1, 0.2]),\n * 0.30000000000000004 // Note IEEE 754 precision limitation\n * )\n * ```\n *\n * @param collection - An `iterable` containing the `numbers` to sum\n *\n * @returns The sum of all numbers in the collection, or 0 if the collection is\n * empty\n */\nexport const sumAll = collection => _Iterable.reduce(collection, 0, sum);\n/**\n * Performs subtraction in the set of JavaScript numbers.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { pipe } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * // Data-first style (direct application)\n * assert.equal(Number.subtract(2, 3), -1) // 2 - 3 = -1\n * assert.equal(Number.subtract(10, 5), 5) // 10 - 5 = 5\n * assert.equal(Number.subtract(0.3, 0.1), 0.19999999999999998) // Note: floating-point precision limitation\n *\n * // Data-last style (pipeable)\n * assert.equal(\n * pipe(\n * 10,\n * Number.subtract(5) // 10 - 5 = 5\n * ),\n * 5\n * )\n *\n * // Chaining multiple subtractions\n * assert.equal(\n * pipe(\n * 20,\n * Number.subtract(5), // 20 - 5 = 15\n * Number.subtract(3), // 15 - 3 = 12\n * Number.subtract(2) // 12 - 2 = 10\n * ),\n * 10\n * )\n *\n * // Right identity property: a - 0 = a\n * assert.equal(Number.subtract(42, 0), 42)\n *\n * // Self-annihilation property: a - a = 0\n * assert.equal(Number.subtract(42, 42), 0)\n *\n * // Non-commutative property: a - b ≠ b - a\n * assert.equal(Number.subtract(5, 3), 2) // 5 - 3 = 2\n * assert.equal(Number.subtract(3, 5), -2) // 3 - 5 = -2\n *\n * // Inverse relation: a - b = -(b - a)\n * assert.equal(Number.subtract(5, 3), -Number.subtract(3, 5))\n * ```\n */\nexport const subtract = /*#__PURE__*/dual(2, (minuend, subtrahend) => minuend - subtrahend);\n/**\n * Performs **multiplication** in the set of JavaScript numbers.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { pipe } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * // Data-first style (direct application)\n * assert.equal(Number.multiply(2, 3), 6) // 2 × 3 = 6\n * assert.equal(Number.multiply(-4, 5), -20) // (-4) × 5 = -20\n * assert.equal(Number.multiply(-3, -2), 6) // (-3) × (-2) = 6\n * assert.equal(Number.multiply(0.1, 0.2), 0.020000000000000004) // Note: floating-point precision limitation\n *\n * // Data-last style (pipeable)\n * assert.equal(\n * pipe(\n * 10,\n * Number.multiply(5) // 10 × 5 = 50\n * ),\n * 50\n * )\n *\n * // Chaining multiple multiplications\n * assert.equal(\n * pipe(\n * 2,\n * Number.multiply(3), // 2 × 3 = 6\n * Number.multiply(4), // 6 × 4 = 24\n * Number.multiply(0.5) // 24 × 0.5 = 12\n * ),\n * 12\n * )\n *\n * // Identity property: a × 1 = a\n * assert.equal(Number.multiply(42, 1), 42)\n *\n * // Zero property: a × 0 = 0\n * assert.equal(Number.multiply(42, 0), 0)\n *\n * // Commutative property: a × b = b × a\n * assert.equal(Number.multiply(5, 3), Number.multiply(3, 5))\n *\n * // Associative property: (a × b) × c = a × (b × c)\n * const a = 2,\n * b = 3,\n * c = 4\n * assert.equal(\n * Number.multiply(Number.multiply(a, b), c),\n * Number.multiply(a, Number.multiply(b, c))\n * )\n * ```\n */\nexport const multiply = /*#__PURE__*/dual(2, (multiplier, multiplicand) => multiplier * multiplicand);\n/**\n * Computes the product of all elements in an iterable collection of numbers.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import * as Number from \"effect/Number\"\n *\n * // Basic products\n * assert.equal(Number.multiplyAll([2, 3, 4]), 24) // 2 × 3 × 4 = 24\n * assert.equal(Number.multiplyAll([1.5, 2, 3]), 9) // 1.5 × 2 × 3 = 9\n *\n * // Empty collection returns the multiplicative identity (1)\n * assert.equal(Number.multiplyAll([]), 1)\n *\n * // Single element collection\n * assert.equal(Number.multiplyAll([42]), 42)\n *\n * // Products with negative numbers\n * assert.equal(Number.multiplyAll([2, -3, 4]), -24) // 2 × (-3) × 4 = -24\n * assert.equal(Number.multiplyAll([-2, -3]), 6) // (-2) × (-3) = 6\n *\n * // Zero property - if any element is zero, product is zero\n * assert.equal(Number.multiplyAll([2, 0, 3]), 0)\n *\n * // Works with any iterable\n * assert.equal(Number.multiplyAll(new Set([2, 3, 4])), 24)\n *\n * // Using with generated sequences\n * function* range(start: number, end: number) {\n * for (let i = start; i <= end; i++) yield i\n * }\n *\n * // Compute factorial: 5! = 5 × 4 × 3 × 2 × 1 = 120\n * assert.equal(Number.multiplyAll(range(1, 5)), 120)\n * ```\n *\n * @param collection - An `iterable` containing the `numbers` to multiply\n *\n * @returns The product of all numbers in the collection, or 1 if the collection\n * is empty\n */\nexport const multiplyAll = collection => {\n let out = 1;\n for (const n of collection) {\n if (n === 0) {\n return 0;\n }\n out *= n;\n }\n return out;\n};\n/**\n * Performs division in the set of JavaScript numbers, returning the result\n * wrapped in an `Option` to handle division by zero.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { pipe, Option } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * // Data-first style (direct application)\n * assert.equal(Number.divide(6, 3), Option.some(2)) // 6 ÷ 3 = 2\n * assert.equal(Number.divide(-8, 4), Option.some(-2)) // (-8) ÷ 4 = -2\n * assert.equal(Number.divide(-10, -5), Option.some(2)) // (-10) ÷ (-5) = 2\n * assert.equal(Number.divide(1, 3), Option.some(0.3333333333333333)) // Note: floating-point approximation\n *\n * // Handling division by zero\n * assert.equal(Number.divide(6, 0), Option.none()) // 6 ÷ 0 is undefined\n *\n * // Data-last style (pipeable)\n * assert.equal(\n * pipe(\n * 10,\n * Number.divide(2) // 10 ÷ 2 = 5\n * ),\n * Option.some(5)\n * )\n *\n * // Chaining multiple divisions using Option combinators\n * assert.equal(\n * pipe(\n * Option.some(24),\n * Option.flatMap((n) => Number.divide(n, 2)), // 24 ÷ 2 = 12\n * Option.flatMap(Number.divide(3)), // 12 ÷ 3 = 4\n * Option.flatMap(Number.divide(2)) // 4 ÷ 2 = 2\n * ),\n * Option.some(2)\n * )\n *\n * // Division-by-one property: a ÷ 1 = a\n * assert.equal(Number.divide(42, 1), Option.some(42))\n *\n * // Self-division property: a ÷ a = 1 (for a ≠ 0)\n * assert.equal(Number.divide(42, 42), Option.some(1))\n *\n * // Non-commutative property: a ÷ b ≠ b ÷ a\n * assert.notDeepStrictEqual(\n * Number.divide(6, 3), // 6 ÷ 3 = 2\n * Number.divide(3, 6) // 3 ÷ 6 = 0.5\n * )\n * ```\n */\nexport const divide = /*#__PURE__*/dual(2, (dividend, divisor) => divisor === 0 ? option.none : option.some(dividend / divisor));\n/**\n * Performs division in the set of JavaScript numbers, but misbehaves for\n * division by zero.\n *\n * Unlike {@link module:Number.divide} which returns an Option, this function\n * directly returns a number or `Infinity` or `NaN`.\n *\n * - If the `divisor` is zero, it returns `Infinity`.\n * - If both the `dividend` and the `divisor` are zero, then it returns `NaN`.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { pipe } from \"effect\"\n * import * as Number from \"effect/Number\"\n *\n * // Data-first style (direct application)\n * assert.equal(Number.unsafeDivide(6, 3), 2) // 6 ÷ 3 = 2\n * assert.equal(Number.unsafeDivide(-8, 4), -2) // (-8) ÷ 4 = -2\n * assert.equal(Number.unsafeDivide(-10, -5), 2) // (-10) ÷ (-5) = 2\n * assert.equal(Number.unsafeDivide(1, 3), 0.3333333333333333)\n *\n * // Data-last style (pipeable)\n * assert.equal(\n * pipe(\n * 10,\n * Number.unsafeDivide(2) // 10 ÷ 2 = 5\n * ),\n * 5\n * )\n *\n * // Chaining multiple divisions\n * assert.equal(\n * pipe(\n * 24,\n * Number.unsafeDivide(2), // 24 ÷ 2 = 12\n * Number.unsafeDivide(3), // 12 ÷ 3 = 4\n * Number.unsafeDivide(2) // 4 ÷ 2 = 2\n * ),\n * 2\n * )\n *\n * assert.equal(Number.unsafeDivide(6, 0), Infinity)\n *\n * assert.equal(Number.unsafeDivide(0, 0), NaN)\n *\n * // Compare with safe division\n * const safeResult = Number.divide(6, 3) // Option.some(2)\n * const unsafeResult = Number.unsafeDivide(6, 3) // 2 directly\n * ```\n *\n * @throws - An {@link module:Number.DivisionByZeroError} if the divisor is zero.\n * @see {@link module:Number.divide} - Safe division returning an Option\n */\nexport const unsafeDivide = /*#__PURE__*/dual(2, (dividend, divisor) => dividend / divisor);\n/**\n * Returns the result of adding `1` to a given number.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { increment } from \"effect/Number\"\n *\n * assert.equal(increment(2), 3)\n * ```\n */\nexport const increment = n => sum(n, 1);\n/**\n * Decrements a number by `1`.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { decrement } from \"effect/Number\"\n *\n * assert.equal(decrement(3), 2)\n * ```\n */\nexport const decrement = n => subtract(n, 1);\n/**\n * @memberof Number\n * @since 2.0.0\n * @category instances\n */\nexport const Equivalence = equivalence.number;\n/**\n * @memberof Number\n * @since 2.0.0\n * @category instances\n */\nexport const Order = order.number;\n/**\n * Returns `true` if the first argument is less than the second, otherwise\n * `false`.\n *\n * @memberof Number\n * @since 2.0.0\n * @category predicates\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { lessThan } from \"effect/Number\"\n *\n * assert.equal(lessThan(2, 3), true)\n * assert.equal(lessThan(3, 3), false)\n * assert.equal(lessThan(4, 3), false)\n * ```\n */\nexport const lessThan = /*#__PURE__*/order.lessThan(Order);\n/**\n * Returns a function that checks if a given `number` is less than or equal to\n * the provided one.\n *\n * @memberof Number\n * @since 2.0.0\n * @category predicates\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { lessThanOrEqualTo } from \"effect/Number\"\n *\n * assert.equal(lessThanOrEqualTo(2, 3), true)\n * assert.equal(lessThanOrEqualTo(3, 3), true)\n * assert.equal(lessThanOrEqualTo(4, 3), false)\n * ```\n */\nexport const lessThanOrEqualTo = /*#__PURE__*/order.lessThanOrEqualTo(Order);\n/**\n * Returns `true` if the first argument is greater than the second, otherwise\n * `false`.\n *\n * @memberof Number\n * @since 2.0.0\n * @category predicates\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { greaterThan } from \"effect/Number\"\n *\n * assert.equal(greaterThan(2, 3), false)\n * assert.equal(greaterThan(3, 3), false)\n * assert.equal(greaterThan(4, 3), true)\n * ```\n */\nexport const greaterThan = /*#__PURE__*/order.greaterThan(Order);\n/**\n * Returns a function that checks if a given `number` is greater than or equal\n * to the provided one.\n *\n * @memberof Number\n * @since 2.0.0\n * @category predicates\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { greaterThanOrEqualTo } from \"effect/Number\"\n *\n * assert.equal(greaterThanOrEqualTo(2, 3), false)\n * assert.equal(greaterThanOrEqualTo(3, 3), true)\n * assert.equal(greaterThanOrEqualTo(4, 3), true)\n * ```\n */\nexport const greaterThanOrEqualTo = /*#__PURE__*/order.greaterThanOrEqualTo(Order);\n/**\n * Checks if a `number` is between a `minimum` and `maximum` value (inclusive).\n *\n * @memberof Number\n * @since 2.0.0\n * @category predicates\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { Number } from \"effect\"\n *\n * const between = Number.between({ minimum: 0, maximum: 5 })\n *\n * assert.equal(between(3), true)\n * assert.equal(between(-1), false)\n * assert.equal(between(6), false)\n * ```\n */\nexport const between = /*#__PURE__*/order.between(Order);\n/**\n * Restricts the given `number` to be within the range specified by the\n * `minimum` and `maximum` values.\n *\n * - If the `number` is less than the `minimum` value, the function returns the\n * `minimum` value.\n * - If the `number` is greater than the `maximum` value, the function returns the\n * `maximum` value.\n * - Otherwise, it returns the original `number`.\n *\n * @memberof Number\n * @since 2.0.0\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { Number } from \"effect\"\n *\n * const clamp = Number.clamp({ minimum: 1, maximum: 5 })\n *\n * assert.equal(clamp(3), 3)\n * assert.equal(clamp(0), 1)\n * assert.equal(clamp(6), 5)\n * ```\n */\nexport const clamp = /*#__PURE__*/order.clamp(Order);\n/**\n * Returns the minimum between two `number`s.\n *\n * @memberof Number\n * @since 2.0.0\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { min } from \"effect/Number\"\n *\n * assert.equal(min(2, 3), 2)\n * ```\n */\nexport const min = /*#__PURE__*/order.min(Order);\n/**\n * Returns the maximum between two `number`s.\n *\n * @memberof Number\n * @since 2.0.0\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { max } from \"effect/Number\"\n *\n * assert.equal(max(2, 3), 3)\n * ```\n */\nexport const max = /*#__PURE__*/order.max(Order);\n/**\n * Determines the sign of a given `number`.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { sign } from \"effect/Number\"\n *\n * assert.equal(sign(-5), -1)\n * assert.equal(sign(0), 0)\n * assert.equal(sign(5), 1)\n * ```\n */\nexport const sign = n => Order(n, 0);\n/**\n * Returns the remainder left over when one operand is divided by a second\n * operand.\n *\n * It always takes the sign of the dividend.\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { remainder } from \"effect/Number\"\n *\n * assert.equal(remainder(2, 2), 0)\n * assert.equal(remainder(3, 2), 1)\n * assert.equal(remainder(-4, 2), -0)\n * ```\n */\nexport const remainder = /*#__PURE__*/dual(2, (dividend, divisor) => {\n // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\n const selfDecCount = (dividend.toString().split(\".\")[1] || \"\").length;\n const divisorDecCount = (divisor.toString().split(\".\")[1] || \"\").length;\n const decCount = selfDecCount > divisorDecCount ? selfDecCount : divisorDecCount;\n const selfInt = parseInt(dividend.toFixed(decCount).replace(\".\", \"\"));\n const divisorInt = parseInt(divisor.toFixed(decCount).replace(\".\", \"\"));\n return selfInt % divisorInt / Math.pow(10, decCount);\n});\n/**\n * Returns the next power of 2 greater than or equal to the given number.\n *\n * - For `positive` inputs, returns the smallest power of 2 that is >= the input\n * - For `zero`, returns 2\n * - For `negative` inputs, returns NaN (as logarithms of negative numbers are\n * undefined)\n * - For `NaN` input, returns NaN\n * - For `Infinity`, returns Infinity\n *\n * @memberof Number\n * @since 2.0.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { nextPow2 } from \"effect/Number\"\n *\n * assert.equal(nextPow2(5), 8)\n * assert.equal(nextPow2(17), 32)\n * assert.equal(nextPow2(0), 2)\n * assert.equal(Number.isNaN(nextPow2(-1)), true) // Negative inputs result in NaN\n * ```\n */\nexport const nextPow2 = n => {\n const nextPow = Math.ceil(Math.log(n) / Math.log(2));\n return Math.max(Math.pow(2, nextPow), 2);\n};\n/**\n * Tries to parse a `number` from a `string` using the `Number()` function. The\n * following special string values are supported: \"NaN\", \"Infinity\",\n * \"-Infinity\".\n *\n * @memberof Number\n * @since 2.0.0\n * @category constructors\n */\nexport const parse = s => {\n if (s === \"NaN\") {\n return option.some(NaN);\n }\n if (s === \"Infinity\") {\n return option.some(Infinity);\n }\n if (s === \"-Infinity\") {\n return option.some(-Infinity);\n }\n if (s.trim() === \"\") {\n return option.none;\n }\n const n = Number(s);\n return Number.isNaN(n) ? option.none : option.some(n);\n};\n/**\n * Returns the number rounded with the given precision.\n *\n * @memberof Number\n * @since 3.8.0\n * @category math\n * @example\n *\n * ```ts\n * import * as assert from \"node:assert/strict\"\n * import { round } from \"effect/Number\"\n *\n * assert.equal(round(1.1234, 2), 1.12)\n * assert.equal(round(1.567, 2), 1.57)\n * ```\n */\nexport const round = /*#__PURE__*/dual(2, (self, precision) => {\n const factor = Math.pow(10, precision);\n return Math.round(self * factor) / factor;\n});\n//# sourceMappingURL=Number.js.map","/**\n * This module provides utility functions for working with RegExp in TypeScript.\n *\n * @since 2.0.0\n */\nimport * as predicate from \"./Predicate.js\";\n/**\n * Tests if a value is a `RegExp`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { RegExp } from \"effect\"\n *\n * assert.deepStrictEqual(RegExp.isRegExp(/a/), true)\n * assert.deepStrictEqual(RegExp.isRegExp(\"a\"), false)\n * ```\n *\n * @category guards\n * @since 3.9.0\n */\nexport const isRegExp = predicate.isRegExp;\n/**\n * Escapes special characters in a regular expression pattern.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { RegExp } from \"effect\"\n *\n * assert.deepStrictEqual(RegExp.escape(\"a*b\"), \"a\\\\*b\")\n * ```\n *\n * @since 2.0.0\n */\nexport const escape = string => string.replace(/[/\\\\^$*+?.()|[\\]{}]/g, \"\\\\$&\");\n//# sourceMappingURL=RegExp.js.map","import * as Equal from \"../Equal.js\";\nimport { dual } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as Hash from \"../Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport { EffectPrototype, effectVariance } from \"./effectable.js\";\nimport * as option from \"./option.js\";\n/** @internal */\nexport const TagTypeId = /*#__PURE__*/Symbol.for(\"effect/Context/Tag\");\n/** @internal */\nexport const ReferenceTypeId = /*#__PURE__*/Symbol.for(\"effect/Context/Reference\");\n/** @internal */\nconst STMSymbolKey = \"effect/STM\";\n/** @internal */\nexport const STMTypeId = /*#__PURE__*/Symbol.for(STMSymbolKey);\n/** @internal */\nexport const TagProto = {\n ...EffectPrototype,\n _op: \"Tag\",\n [STMTypeId]: effectVariance,\n [TagTypeId]: {\n _Service: _ => _,\n _Identifier: _ => _\n },\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"Tag\",\n key: this.key,\n stack: this.stack\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n of(self) {\n return self;\n },\n context(self) {\n return make(this, self);\n }\n};\nexport const ReferenceProto = {\n ...TagProto,\n [ReferenceTypeId]: ReferenceTypeId\n};\n/** @internal */\nexport const makeGenericTag = key => {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const creationError = new Error();\n Error.stackTraceLimit = limit;\n const tag = Object.create(TagProto);\n Object.defineProperty(tag, \"stack\", {\n get() {\n return creationError.stack;\n }\n });\n tag.key = key;\n return tag;\n};\n/** @internal */\nexport const Tag = id => () => {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const creationError = new Error();\n Error.stackTraceLimit = limit;\n function TagClass() {}\n Object.setPrototypeOf(TagClass, TagProto);\n TagClass.key = id;\n Object.defineProperty(TagClass, \"stack\", {\n get() {\n return creationError.stack;\n }\n });\n return TagClass;\n};\n/** @internal */\nexport const Reference = () => (id, options) => {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const creationError = new Error();\n Error.stackTraceLimit = limit;\n function ReferenceClass() {}\n Object.setPrototypeOf(ReferenceClass, ReferenceProto);\n ReferenceClass.key = id;\n ReferenceClass.defaultValue = options.defaultValue;\n Object.defineProperty(ReferenceClass, \"stack\", {\n get() {\n return creationError.stack;\n }\n });\n return ReferenceClass;\n};\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/Context\");\n/** @internal */\nexport const ContextProto = {\n [TypeId]: {\n _Services: _ => _\n },\n [Equal.symbol](that) {\n if (isContext(that)) {\n if (this.unsafeMap.size === that.unsafeMap.size) {\n for (const k of this.unsafeMap.keys()) {\n if (!that.unsafeMap.has(k) || !Equal.equals(this.unsafeMap.get(k), that.unsafeMap.get(k))) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.number(this.unsafeMap.size));\n },\n pipe() {\n return pipeArguments(this, arguments);\n },\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"Context\",\n services: Array.from(this.unsafeMap).map(toJSON)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n};\n/** @internal */\nexport const makeContext = unsafeMap => {\n const context = Object.create(ContextProto);\n context.unsafeMap = unsafeMap;\n return context;\n};\nconst serviceNotFoundError = tag => {\n const error = new Error(`Service not found${tag.key ? `: ${String(tag.key)}` : \"\"}`);\n if (tag.stack) {\n const lines = tag.stack.split(\"\\n\");\n if (lines.length > 2) {\n const afterAt = lines[2].match(/at (.*)/);\n if (afterAt) {\n error.message = error.message + ` (defined at ${afterAt[1]})`;\n }\n }\n }\n if (error.stack) {\n const lines = error.stack.split(\"\\n\");\n lines.splice(1, 3);\n error.stack = lines.join(\"\\n\");\n }\n return error;\n};\n/** @internal */\nexport const isContext = u => hasProperty(u, TypeId);\n/** @internal */\nexport const isTag = u => hasProperty(u, TagTypeId);\n/** @internal */\nexport const isReference = u => hasProperty(u, ReferenceTypeId);\nconst _empty = /*#__PURE__*/makeContext(/*#__PURE__*/new Map());\n/** @internal */\nexport const empty = () => _empty;\n/** @internal */\nexport const make = (tag, service) => makeContext(new Map([[tag.key, service]]));\n/** @internal */\nexport const add = /*#__PURE__*/dual(3, (self, tag, service) => {\n const map = new Map(self.unsafeMap);\n map.set(tag.key, service);\n return makeContext(map);\n});\nconst defaultValueCache = /*#__PURE__*/globalValue(\"effect/Context/defaultValueCache\", () => new Map());\nconst getDefaultValue = tag => {\n if (defaultValueCache.has(tag.key)) {\n return defaultValueCache.get(tag.key);\n }\n const value = tag.defaultValue();\n defaultValueCache.set(tag.key, value);\n return value;\n};\n/** @internal */\nexport const unsafeGetReference = (self, tag) => {\n return self.unsafeMap.has(tag.key) ? self.unsafeMap.get(tag.key) : getDefaultValue(tag);\n};\n/** @internal */\nexport const unsafeGet = /*#__PURE__*/dual(2, (self, tag) => {\n if (!self.unsafeMap.has(tag.key)) {\n if (ReferenceTypeId in tag) return getDefaultValue(tag);\n throw serviceNotFoundError(tag);\n }\n return self.unsafeMap.get(tag.key);\n});\n/** @internal */\nexport const get = unsafeGet;\n/** @internal */\nexport const getOrElse = /*#__PURE__*/dual(3, (self, tag, orElse) => {\n if (!self.unsafeMap.has(tag.key)) {\n return isReference(tag) ? getDefaultValue(tag) : orElse();\n }\n return self.unsafeMap.get(tag.key);\n});\n/** @internal */\nexport const getOption = /*#__PURE__*/dual(2, (self, tag) => {\n if (!self.unsafeMap.has(tag.key)) {\n return isReference(tag) ? option.some(getDefaultValue(tag)) : option.none;\n }\n return option.some(self.unsafeMap.get(tag.key));\n});\n/** @internal */\nexport const merge = /*#__PURE__*/dual(2, (self, that) => {\n const map = new Map(self.unsafeMap);\n for (const [tag, s] of that.unsafeMap) {\n map.set(tag, s);\n }\n return makeContext(map);\n});\n/** @internal */\nexport const mergeAll = (...ctxs) => {\n const map = new Map();\n for (let i = 0; i < ctxs.length; i++) {\n ctxs[i].unsafeMap.forEach((value, key) => {\n map.set(key, value);\n });\n }\n return makeContext(map);\n};\n/** @internal */\nexport const pick = (...tags) => self => {\n const tagSet = new Set(tags.map(_ => _.key));\n const newEnv = new Map();\n for (const [tag, s] of self.unsafeMap.entries()) {\n if (tagSet.has(tag)) {\n newEnv.set(tag, s);\n }\n }\n return makeContext(newEnv);\n};\n/** @internal */\nexport const omit = (...tags) => self => {\n const newEnv = new Map(self.unsafeMap);\n for (const tag of tags) {\n newEnv.delete(tag.key);\n }\n return makeContext(newEnv);\n};\n//# sourceMappingURL=context.js.map","import * as internal from \"./internal/context.js\";\n/**\n * @since 2.0.0\n * @category symbol\n */\nexport const TagTypeId = internal.TagTypeId;\n/**\n * @since 3.11.0\n * @category symbol\n */\nexport const ReferenceTypeId = internal.ReferenceTypeId;\n/**\n * Creates a new `Tag` instance with an optional key parameter.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * assert.strictEqual(Context.GenericTag(\"PORT\").key === Context.GenericTag(\"PORT\").key, true)\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const GenericTag = internal.makeGenericTag;\nconst TypeId = internal.TypeId;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const unsafeMake = internal.makeContext;\n/**\n * Checks if the provided argument is a `Context`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * assert.strictEqual(Context.isContext(Context.empty()), true)\n * ```\n *\n * @since 2.0.0\n * @category guards\n */\nexport const isContext = internal.isContext;\n/**\n * Checks if the provided argument is a `Tag`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * assert.strictEqual(Context.isTag(Context.GenericTag(\"Tag\")), true)\n * ```\n *\n * @since 2.0.0\n * @category guards\n */\nexport const isTag = internal.isTag;\n/**\n * Checks if the provided argument is a `Reference`.\n *\n * @since 3.11.0\n * @category guards\n * @experimental\n */\nexport const isReference = internal.isReference;\n/**\n * Returns an empty `Context`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * assert.strictEqual(Context.isContext(Context.empty()), true)\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = internal.empty;\n/**\n * Creates a new `Context` with a single service associated to the tag.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n *\n * const Services = Context.make(Port, { PORT: 8080 })\n *\n * assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * Adds a service to a given `Context`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context, pipe } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n *\n * const someContext = Context.make(Port, { PORT: 8080 })\n *\n * const Services = pipe(\n * someContext,\n * Context.add(Timeout, { TIMEOUT: 5000 })\n * )\n *\n * assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })\n * assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })\n * ```\n *\n * @since 2.0.0\n */\nexport const add = internal.add;\n/**\n * Get a service from the context that corresponds to the given tag.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, Context } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n *\n * const Services = pipe(\n * Context.make(Port, { PORT: 8080 }),\n * Context.add(Timeout, { TIMEOUT: 5000 })\n * )\n *\n * assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })\n * ```\n *\n * @since 2.0.0\n * @category getters\n */\nexport const get = internal.get;\n/**\n * Get a service from the context that corresponds to the given tag, or\n * use the fallback value.\n *\n * @since 3.7.0\n * @category getters\n */\nexport const getOrElse = internal.getOrElse;\n/**\n * Get a service from the context that corresponds to the given tag.\n * This function is unsafe because if the tag is not present in the context, a runtime error will be thrown.\n *\n * For a safer version see {@link getOption}.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n *\n * const Services = Context.make(Port, { PORT: 8080 })\n *\n * assert.deepStrictEqual(Context.unsafeGet(Services, Port), { PORT: 8080 })\n * assert.throws(() => Context.unsafeGet(Services, Timeout))\n * ```\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeGet = internal.unsafeGet;\n/**\n * Get the value associated with the specified tag from the context wrapped in an `Option` object. If the tag is not\n * found, the `Option` object will be `None`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context, Option } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n *\n * const Services = Context.make(Port, { PORT: 8080 })\n *\n * assert.deepStrictEqual(Context.getOption(Services, Port), Option.some({ PORT: 8080 }))\n * assert.deepStrictEqual(Context.getOption(Services, Timeout), Option.none())\n * ```\n *\n * @since 2.0.0\n * @category getters\n */\nexport const getOption = internal.getOption;\n/**\n * Merges two `Context`s, returning a new `Context` containing the services of both.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n *\n * const firstContext = Context.make(Port, { PORT: 8080 })\n * const secondContext = Context.make(Timeout, { TIMEOUT: 5000 })\n *\n * const Services = Context.merge(firstContext, secondContext)\n *\n * assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })\n * assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })\n * ```\n *\n * @since 2.0.0\n */\nexport const merge = internal.merge;\n/**\n * Merges any number of `Context`s, returning a new `Context` containing the services of all.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n * const Host = Context.GenericTag<{ HOST: string }>(\"Host\")\n *\n * const firstContext = Context.make(Port, { PORT: 8080 })\n * const secondContext = Context.make(Timeout, { TIMEOUT: 5000 })\n * const thirdContext = Context.make(Host, { HOST: \"localhost\" })\n *\n * const Services = Context.mergeAll(firstContext, secondContext, thirdContext)\n *\n * assert.deepStrictEqual(Context.get(Services, Port), { PORT: 8080 })\n * assert.deepStrictEqual(Context.get(Services, Timeout), { TIMEOUT: 5000 })\n * assert.deepStrictEqual(Context.get(Services, Host), { HOST: \"localhost\" })\n * ```\n *\n * @since 3.12.0\n */\nexport const mergeAll = internal.mergeAll;\n/**\n * Returns a new `Context` that contains only the specified services.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { pipe, Context, Option } from \"effect\"\n *\n * const Port = Context.GenericTag<{ PORT: number }>(\"Port\")\n * const Timeout = Context.GenericTag<{ TIMEOUT: number }>(\"Timeout\")\n *\n * const someContext = pipe(\n * Context.make(Port, { PORT: 8080 }),\n * Context.add(Timeout, { TIMEOUT: 5000 })\n * )\n *\n * const Services = pipe(someContext, Context.pick(Port))\n *\n * assert.deepStrictEqual(Context.getOption(Services, Port), Option.some({ PORT: 8080 }))\n * assert.deepStrictEqual(Context.getOption(Services, Timeout), Option.none())\n * ```\n *\n * @since 2.0.0\n */\nexport const pick = internal.pick;\n/**\n * @since 2.0.0\n */\nexport const omit = internal.omit;\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context, Layer } from \"effect\"\n *\n * class MyTag extends Context.Tag(\"MyTag\")<\n * MyTag,\n * { readonly myNum: number }\n * >() {\n * static Live = Layer.succeed(this, { myNum: 108 })\n * }\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const Tag = internal.Tag;\n/**\n * Creates a context tag with a default value.\n *\n * **Details**\n *\n * `Context.Reference` allows you to create a tag that can hold a value. You can\n * provide a default value for the service, which will automatically be used\n * when the context is accessed, or override it with a custom implementation\n * when needed.\n *\n * **Example** (Declaring a Tag with a default value)\n *\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Context, Effect } from \"effect\"\n *\n * class SpecialNumber extends Context.Reference<SpecialNumber>()(\n * \"SpecialNumber\",\n * { defaultValue: () => 2048 }\n * ) {}\n *\n * // ┌─── Effect<void, never, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const specialNumber = yield* SpecialNumber\n * console.log(`The special number is ${specialNumber}`)\n * })\n *\n * // No need to provide the SpecialNumber implementation\n * Effect.runPromise(program)\n * // Output: The special number is 2048\n * ```\n *\n * **Example** (Overriding the default value)\n *\n * ```ts\n * import { Context, Effect } from \"effect\"\n *\n * class SpecialNumber extends Context.Reference<SpecialNumber>()(\n * \"SpecialNumber\",\n * { defaultValue: () => 2048 }\n * ) {}\n *\n * const program = Effect.gen(function* () {\n * const specialNumber = yield* SpecialNumber\n * console.log(`The special number is ${specialNumber}`)\n * })\n *\n * Effect.runPromise(program.pipe(Effect.provideService(SpecialNumber, -1)))\n * // Output: The special number is -1\n * ```\n *\n * @since 3.11.0\n * @category constructors\n * @experimental\n */\nexport const Reference = internal.Reference;\n//# sourceMappingURL=Context.js.map","/**\n * @since 2.0.0\n */\nimport * as RA from \"./Array.js\";\nimport * as Equal from \"./Equal.js\";\nimport * as Equivalence from \"./Equivalence.js\";\nimport { dual, identity, pipe } from \"./Function.js\";\nimport * as Hash from \"./Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"./Inspectable.js\";\nimport * as O from \"./Option.js\";\nimport * as Order from \"./Order.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nimport { hasProperty } from \"./Predicate.js\";\nconst TypeId = /*#__PURE__*/Symbol.for(\"effect/Chunk\");\nfunction copy(src, srcPos, dest, destPos, len) {\n for (let i = srcPos; i < Math.min(src.length, srcPos + len); i++) {\n dest[destPos + i - srcPos] = src[i];\n }\n return dest;\n}\nconst emptyArray = [];\n/**\n * Compares the two chunks of equal length using the specified function\n *\n * @category equivalence\n * @since 2.0.0\n */\nexport const getEquivalence = isEquivalent => Equivalence.make((self, that) => self.length === that.length && toReadonlyArray(self).every((value, i) => isEquivalent(value, unsafeGet(that, i))));\nconst _equivalence = /*#__PURE__*/getEquivalence(Equal.equals);\nconst ChunkProto = {\n [TypeId]: {\n _A: _ => _\n },\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"Chunk\",\n values: toReadonlyArray(this).map(toJSON)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n [Equal.symbol](that) {\n return isChunk(that) && _equivalence(this, that);\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.array(toReadonlyArray(this)));\n },\n [Symbol.iterator]() {\n switch (this.backing._tag) {\n case \"IArray\":\n {\n return this.backing.array[Symbol.iterator]();\n }\n case \"IEmpty\":\n {\n return emptyArray[Symbol.iterator]();\n }\n default:\n {\n return toReadonlyArray(this)[Symbol.iterator]();\n }\n }\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst makeChunk = backing => {\n const chunk = Object.create(ChunkProto);\n chunk.backing = backing;\n switch (backing._tag) {\n case \"IEmpty\":\n {\n chunk.length = 0;\n chunk.depth = 0;\n chunk.left = chunk;\n chunk.right = chunk;\n break;\n }\n case \"IConcat\":\n {\n chunk.length = backing.left.length + backing.right.length;\n chunk.depth = 1 + Math.max(backing.left.depth, backing.right.depth);\n chunk.left = backing.left;\n chunk.right = backing.right;\n break;\n }\n case \"IArray\":\n {\n chunk.length = backing.array.length;\n chunk.depth = 0;\n chunk.left = _empty;\n chunk.right = _empty;\n break;\n }\n case \"ISingleton\":\n {\n chunk.length = 1;\n chunk.depth = 0;\n chunk.left = _empty;\n chunk.right = _empty;\n break;\n }\n case \"ISlice\":\n {\n chunk.length = backing.length;\n chunk.depth = backing.chunk.depth + 1;\n chunk.left = _empty;\n chunk.right = _empty;\n break;\n }\n }\n return chunk;\n};\n/**\n * Checks if `u` is a `Chunk<unknown>`\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const isChunk = u => hasProperty(u, TypeId);\nconst _empty = /*#__PURE__*/makeChunk({\n _tag: \"IEmpty\"\n});\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const empty = () => _empty;\n/**\n * Builds a `NonEmptyChunk` from an non-empty collection of elements.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const make = (...as) => unsafeFromNonEmptyArray(as);\n/**\n * Builds a `NonEmptyChunk` from a single element.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const of = a => makeChunk({\n _tag: \"ISingleton\",\n a\n});\n/**\n * Creates a new `Chunk` from an iterable collection of values.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const fromIterable = self => isChunk(self) ? self : unsafeFromArray(RA.fromIterable(self));\nconst copyToArray = (self, array, initial) => {\n switch (self.backing._tag) {\n case \"IArray\":\n {\n copy(self.backing.array, 0, array, initial, self.length);\n break;\n }\n case \"IConcat\":\n {\n copyToArray(self.left, array, initial);\n copyToArray(self.right, array, initial + self.left.length);\n break;\n }\n case \"ISingleton\":\n {\n array[initial] = self.backing.a;\n break;\n }\n case \"ISlice\":\n {\n let i = 0;\n let j = initial;\n while (i < self.length) {\n array[j] = unsafeGet(self, i);\n i += 1;\n j += 1;\n }\n break;\n }\n }\n};\nconst toArray_ = self => toReadonlyArray(self).slice();\n/**\n * Converts a `Chunk` into an `Array`. If the provided `Chunk` is non-empty\n * (`NonEmptyChunk`), the function will return a `NonEmptyArray`, ensuring the\n * non-empty property is preserved.\n *\n * @category conversions\n * @since 2.0.0\n */\nexport const toArray = toArray_;\nconst toReadonlyArray_ = self => {\n switch (self.backing._tag) {\n case \"IEmpty\":\n {\n return emptyArray;\n }\n case \"IArray\":\n {\n return self.backing.array;\n }\n default:\n {\n const arr = new Array(self.length);\n copyToArray(self, arr, 0);\n self.backing = {\n _tag: \"IArray\",\n array: arr\n };\n self.left = _empty;\n self.right = _empty;\n self.depth = 0;\n return arr;\n }\n }\n};\n/**\n * Converts a `Chunk` into a `ReadonlyArray`. If the provided `Chunk` is\n * non-empty (`NonEmptyChunk`), the function will return a\n * `NonEmptyReadonlyArray`, ensuring the non-empty property is preserved.\n *\n * @category conversions\n * @since 2.0.0\n */\nexport const toReadonlyArray = toReadonlyArray_;\nconst reverseChunk = self => {\n switch (self.backing._tag) {\n case \"IEmpty\":\n case \"ISingleton\":\n return self;\n case \"IArray\":\n {\n return makeChunk({\n _tag: \"IArray\",\n array: RA.reverse(self.backing.array)\n });\n }\n case \"IConcat\":\n {\n return makeChunk({\n _tag: \"IConcat\",\n left: reverse(self.backing.right),\n right: reverse(self.backing.left)\n });\n }\n case \"ISlice\":\n return unsafeFromArray(RA.reverse(toReadonlyArray(self)));\n }\n};\n/**\n * Reverses the order of elements in a `Chunk`.\n * Importantly, if the input chunk is a `NonEmptyChunk`, the reversed chunk will also be a `NonEmptyChunk`.\n *\n * **Example**\n *\n * ```ts\n * import { Chunk } from \"effect\"\n *\n * const chunk = Chunk.make(1, 2, 3)\n * const result = Chunk.reverse(chunk)\n *\n * console.log(result)\n * // { _id: 'Chunk', values: [ 3, 2, 1 ] }\n * ```\n *\n * @since 2.0.0\n * @category elements\n */\nexport const reverse = reverseChunk;\n/**\n * This function provides a safe way to read a value at a particular index from a `Chunk`.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const get = /*#__PURE__*/dual(2, (self, index) => index < 0 || index >= self.length ? O.none() : O.some(unsafeGet(self, index)));\n/**\n * Wraps an array into a chunk without copying, unsafe on mutable arrays\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeFromArray = self => self.length === 0 ? empty() : self.length === 1 ? of(self[0]) : makeChunk({\n _tag: \"IArray\",\n array: self\n});\n/**\n * Wraps an array into a chunk without copying, unsafe on mutable arrays\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeFromNonEmptyArray = self => unsafeFromArray(self);\n/**\n * Gets an element unsafely, will throw on out of bounds\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeGet = /*#__PURE__*/dual(2, (self, index) => {\n switch (self.backing._tag) {\n case \"IEmpty\":\n {\n throw new Error(`Index out of bounds`);\n }\n case \"ISingleton\":\n {\n if (index !== 0) {\n throw new Error(`Index out of bounds`);\n }\n return self.backing.a;\n }\n case \"IArray\":\n {\n if (index >= self.length || index < 0) {\n throw new Error(`Index out of bounds`);\n }\n return self.backing.array[index];\n }\n case \"IConcat\":\n {\n return index < self.left.length ? unsafeGet(self.left, index) : unsafeGet(self.right, index - self.left.length);\n }\n case \"ISlice\":\n {\n return unsafeGet(self.backing.chunk, index + self.backing.offset);\n }\n }\n});\n/**\n * Appends the specified element to the end of the `Chunk`.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const append = /*#__PURE__*/dual(2, (self, a) => appendAll(self, of(a)));\n/**\n * Prepend an element to the front of a `Chunk`, creating a new `NonEmptyChunk`.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prepend = /*#__PURE__*/dual(2, (self, elem) => appendAll(of(elem), self));\n/**\n * Takes the first up to `n` elements from the chunk\n *\n * @since 2.0.0\n */\nexport const take = /*#__PURE__*/dual(2, (self, n) => {\n if (n <= 0) {\n return _empty;\n } else if (n >= self.length) {\n return self;\n } else {\n switch (self.backing._tag) {\n case \"ISlice\":\n {\n return makeChunk({\n _tag: \"ISlice\",\n chunk: self.backing.chunk,\n length: n,\n offset: self.backing.offset\n });\n }\n case \"IConcat\":\n {\n if (n > self.left.length) {\n return makeChunk({\n _tag: \"IConcat\",\n left: self.left,\n right: take(self.right, n - self.left.length)\n });\n }\n return take(self.left, n);\n }\n default:\n {\n return makeChunk({\n _tag: \"ISlice\",\n chunk: self,\n offset: 0,\n length: n\n });\n }\n }\n }\n});\n/**\n * Drops the first up to `n` elements from the chunk\n *\n * @since 2.0.0\n */\nexport const drop = /*#__PURE__*/dual(2, (self, n) => {\n if (n <= 0) {\n return self;\n } else if (n >= self.length) {\n return _empty;\n } else {\n switch (self.backing._tag) {\n case \"ISlice\":\n {\n return makeChunk({\n _tag: \"ISlice\",\n chunk: self.backing.chunk,\n offset: self.backing.offset + n,\n length: self.backing.length - n\n });\n }\n case \"IConcat\":\n {\n if (n > self.left.length) {\n return drop(self.right, n - self.left.length);\n }\n return makeChunk({\n _tag: \"IConcat\",\n left: drop(self.left, n),\n right: self.right\n });\n }\n default:\n {\n return makeChunk({\n _tag: \"ISlice\",\n chunk: self,\n offset: n,\n length: self.length - n\n });\n }\n }\n }\n});\n/**\n * Drops the last `n` elements.\n *\n * @since 2.0.0\n */\nexport const dropRight = /*#__PURE__*/dual(2, (self, n) => take(self, Math.max(0, self.length - n)));\n/**\n * Drops all elements so long as the predicate returns true.\n *\n * @since 2.0.0\n */\nexport const dropWhile = /*#__PURE__*/dual(2, (self, predicate) => {\n const arr = toReadonlyArray(self);\n const len = arr.length;\n let i = 0;\n while (i < len && predicate(arr[i])) {\n i++;\n }\n return drop(self, i);\n});\n/**\n * Prepends the specified prefix chunk to the beginning of the specified chunk.\n * If either chunk is non-empty, the result is also a non-empty chunk.\n *\n * **Example**\n *\n * ```ts\n * import { Chunk } from \"effect\"\n *\n * const result = Chunk.make(1, 2).pipe(Chunk.prependAll(Chunk.make(\"a\", \"b\")), Chunk.toArray)\n *\n * console.log(result)\n * // [ \"a\", \"b\", 1, 2 ]\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prependAll = /*#__PURE__*/dual(2, (self, that) => appendAll(that, self));\n/**\n * Concatenates two chunks, combining their elements.\n * If either chunk is non-empty, the result is also a non-empty chunk.\n *\n * **Example**\n *\n * ```ts\n * import { Chunk } from \"effect\"\n *\n * const result = Chunk.make(1, 2).pipe(Chunk.appendAll(Chunk.make(\"a\", \"b\")), Chunk.toArray)\n *\n * console.log(result)\n * // [ 1, 2, \"a\", \"b\" ]\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const appendAll = /*#__PURE__*/dual(2, (self, that) => {\n if (self.backing._tag === \"IEmpty\") {\n return that;\n }\n if (that.backing._tag === \"IEmpty\") {\n return self;\n }\n const diff = that.depth - self.depth;\n if (Math.abs(diff) <= 1) {\n return makeChunk({\n _tag: \"IConcat\",\n left: self,\n right: that\n });\n } else if (diff < -1) {\n if (self.left.depth >= self.right.depth) {\n const nr = appendAll(self.right, that);\n return makeChunk({\n _tag: \"IConcat\",\n left: self.left,\n right: nr\n });\n } else {\n const nrr = appendAll(self.right.right, that);\n if (nrr.depth === self.depth - 3) {\n const nr = makeChunk({\n _tag: \"IConcat\",\n left: self.right.left,\n right: nrr\n });\n return makeChunk({\n _tag: \"IConcat\",\n left: self.left,\n right: nr\n });\n } else {\n const nl = makeChunk({\n _tag: \"IConcat\",\n left: self.left,\n right: self.right.left\n });\n return makeChunk({\n _tag: \"IConcat\",\n left: nl,\n right: nrr\n });\n }\n }\n } else {\n if (that.right.depth >= that.left.depth) {\n const nl = appendAll(self, that.left);\n return makeChunk({\n _tag: \"IConcat\",\n left: nl,\n right: that.right\n });\n } else {\n const nll = appendAll(self, that.left.left);\n if (nll.depth === that.depth - 3) {\n const nl = makeChunk({\n _tag: \"IConcat\",\n left: nll,\n right: that.left.right\n });\n return makeChunk({\n _tag: \"IConcat\",\n left: nl,\n right: that.right\n });\n } else {\n const nr = makeChunk({\n _tag: \"IConcat\",\n left: that.left.right,\n right: that.right\n });\n return makeChunk({\n _tag: \"IConcat\",\n left: nll,\n right: nr\n });\n }\n }\n }\n});\n/**\n * Returns a filtered and mapped subset of the elements.\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const filterMap = /*#__PURE__*/dual(2, (self, f) => unsafeFromArray(RA.filterMap(self, f)));\n/**\n * Returns a filtered and mapped subset of the elements.\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const filter = /*#__PURE__*/dual(2, (self, predicate) => unsafeFromArray(RA.filter(self, predicate)));\n/**\n * Transforms all elements of the chunk for as long as the specified function returns some value\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const filterMapWhile = /*#__PURE__*/dual(2, (self, f) => unsafeFromArray(RA.filterMapWhile(self, f)));\n/**\n * Filter out optional values\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const compact = self => filterMap(self, identity);\n/**\n * Applies a function to each element in a chunk and returns a new chunk containing the concatenated mapped elements.\n *\n * @since 2.0.0\n * @category sequencing\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n if (self.backing._tag === \"ISingleton\") {\n return f(self.backing.a, 0);\n }\n let out = _empty;\n let i = 0;\n for (const k of self) {\n out = appendAll(out, f(k, i++));\n }\n return out;\n});\n/**\n * Iterates over each element of a `Chunk` and applies a function to it.\n *\n * **Details**\n *\n * This function processes every element of the given `Chunk`, calling the\n * provided function `f` on each element. It does not return a new value;\n * instead, it is primarily used for side effects, such as logging or\n * accumulating data in an external variable.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const forEach = /*#__PURE__*/dual(2, (self, f) => toReadonlyArray(self).forEach(f));\n/**\n * Flattens a chunk of chunks into a single chunk by concatenating all chunks.\n *\n * @since 2.0.0\n * @category sequencing\n */\nexport const flatten = /*#__PURE__*/flatMap(identity);\n/**\n * Groups elements in chunks of up to `n` elements.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const chunksOf = /*#__PURE__*/dual(2, (self, n) => {\n const gr = [];\n let current = [];\n toReadonlyArray(self).forEach(a => {\n current.push(a);\n if (current.length >= n) {\n gr.push(unsafeFromArray(current));\n current = [];\n }\n });\n if (current.length > 0) {\n gr.push(unsafeFromArray(current));\n }\n return unsafeFromArray(gr);\n});\n/**\n * Creates a Chunk of unique values that are included in all given Chunks.\n *\n * The order and references of result values are determined by the Chunk.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const intersection = /*#__PURE__*/dual(2, (self, that) => unsafeFromArray(RA.intersection(toReadonlyArray(self), toReadonlyArray(that))));\n/**\n * Determines if the chunk is empty.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const isEmpty = self => self.length === 0;\n/**\n * Determines if the chunk is not empty.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const isNonEmpty = self => self.length > 0;\n/**\n * Returns the first element of this chunk if it exists.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const head = /*#__PURE__*/get(0);\n/**\n * Returns the first element of this chunk.\n *\n * It will throw an error if the chunk is empty.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeHead = self => unsafeGet(self, 0);\n/**\n * Returns the first element of this non empty chunk.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const headNonEmpty = unsafeHead;\n/**\n * Returns the last element of this chunk if it exists.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const last = self => get(self, self.length - 1);\n/**\n * Returns the last element of this chunk.\n *\n * It will throw an error if the chunk is empty.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeLast = self => unsafeGet(self, self.length - 1);\n/**\n * Returns the last element of this non empty chunk.\n *\n * @since 3.4.0\n * @category elements\n */\nexport const lastNonEmpty = unsafeLast;\n/**\n * Transforms the elements of a chunk using the specified mapping function.\n * If the input chunk is non-empty, the resulting chunk will also be non-empty.\n *\n * **Example**\n *\n * ```ts\n * import { Chunk } from \"effect\"\n *\n * const result = Chunk.map(Chunk.make(1, 2), (n) => n + 1)\n *\n * console.log(result)\n * // { _id: 'Chunk', values: [ 2, 3 ] }\n * ```\n *\n * @since 2.0.0\n * @category mapping\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => self.backing._tag === \"ISingleton\" ? of(f(self.backing.a, 0)) : unsafeFromArray(pipe(toReadonlyArray(self), RA.map((a, i) => f(a, i)))));\n/**\n * Statefully maps over the chunk, producing new elements of type `B`.\n *\n * @since 2.0.0\n * @category folding\n */\nexport const mapAccum = /*#__PURE__*/dual(3, (self, s, f) => {\n const [s1, as] = RA.mapAccum(self, s, f);\n return [s1, unsafeFromArray(as)];\n});\n/**\n * Separate elements based on a predicate that also exposes the index of the element.\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const partition = /*#__PURE__*/dual(2, (self, predicate) => pipe(RA.partition(toReadonlyArray(self), predicate), ([l, r]) => [unsafeFromArray(l), unsafeFromArray(r)]));\n/**\n * Partitions the elements of this chunk into two chunks using f.\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const partitionMap = /*#__PURE__*/dual(2, (self, f) => pipe(RA.partitionMap(toReadonlyArray(self), f), ([l, r]) => [unsafeFromArray(l), unsafeFromArray(r)]));\n/**\n * Partitions the elements of this chunk into two chunks.\n *\n * @category filtering\n * @since 2.0.0\n */\nexport const separate = self => pipe(RA.separate(toReadonlyArray(self)), ([l, r]) => [unsafeFromArray(l), unsafeFromArray(r)]);\n/**\n * Retireves the size of the chunk\n *\n * @since 2.0.0\n * @category elements\n */\nexport const size = self => self.length;\n/**\n * Sort the elements of a Chunk in increasing order, creating a new Chunk.\n *\n * @since 2.0.0\n * @category sorting\n */\nexport const sort = /*#__PURE__*/dual(2, (self, O) => unsafeFromArray(RA.sort(toReadonlyArray(self), O)));\n/**\n * @since 2.0.0\n * @category sorting\n */\nexport const sortWith = /*#__PURE__*/dual(3, (self, f, order) => sort(self, Order.mapInput(order, f)));\n/**\n * Returns two splits of this chunk at the specified index.\n *\n * @since 2.0.0\n * @category splitting\n */\nexport const splitAt = /*#__PURE__*/dual(2, (self, n) => [take(self, n), drop(self, n)]);\n/**\n * Splits a `NonEmptyChunk` into two segments, with the first segment containing a maximum of `n` elements.\n * The value of `n` must be `>= 1`.\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const splitNonEmptyAt = /*#__PURE__*/dual(2, (self, n) => {\n const _n = Math.max(1, Math.floor(n));\n return _n >= self.length ? [self, empty()] : [take(self, _n), drop(self, _n)];\n});\n/**\n * Splits this chunk into `n` equally sized chunks.\n *\n * @since 2.0.0\n * @category splitting\n */\nexport const split = /*#__PURE__*/dual(2, (self, n) => chunksOf(self, Math.ceil(self.length / Math.floor(n))));\n/**\n * Splits this chunk on the first element that matches this predicate.\n * Returns a tuple containing two chunks: the first one is before the match, and the second one is from the match onward.\n *\n * @category splitting\n * @since 2.0.0\n */\nexport const splitWhere = /*#__PURE__*/dual(2, (self, predicate) => {\n let i = 0;\n for (const a of toReadonlyArray(self)) {\n if (predicate(a)) {\n break;\n } else {\n i++;\n }\n }\n return splitAt(self, i);\n});\n/**\n * Returns every elements after the first.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const tail = self => self.length > 0 ? O.some(drop(self, 1)) : O.none();\n/**\n * Returns every elements after the first.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const tailNonEmpty = self => drop(self, 1);\n/**\n * Takes the last `n` elements.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const takeRight = /*#__PURE__*/dual(2, (self, n) => drop(self, self.length - n));\n/**\n * Takes all elements so long as the predicate returns true.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const takeWhile = /*#__PURE__*/dual(2, (self, predicate) => {\n const out = [];\n for (const a of toReadonlyArray(self)) {\n if (predicate(a)) {\n out.push(a);\n } else {\n break;\n }\n }\n return unsafeFromArray(out);\n});\n/**\n * Creates a Chunks of unique values, in order, from all given Chunks.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const union = /*#__PURE__*/dual(2, (self, that) => unsafeFromArray(RA.union(toReadonlyArray(self), toReadonlyArray(that))));\n/**\n * Remove duplicates from an array, keeping the first occurrence of an element.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const dedupe = self => unsafeFromArray(RA.dedupe(toReadonlyArray(self)));\n/**\n * Deduplicates adjacent elements that are identical.\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const dedupeAdjacent = self => unsafeFromArray(RA.dedupeAdjacent(self));\n/**\n * Takes a `Chunk` of pairs and return two corresponding `Chunk`s.\n *\n * Note: The function is reverse of `zip`.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const unzip = self => {\n const [left, right] = RA.unzip(self);\n return [unsafeFromArray(left), unsafeFromArray(right)];\n};\n/**\n * Zips this chunk pointwise with the specified chunk using the specified combiner.\n *\n * @since 2.0.0\n * @category zipping\n */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => unsafeFromArray(RA.zipWith(self, that, f)));\n/**\n * Zips this chunk pointwise with the specified chunk.\n *\n * @since 2.0.0\n * @category zipping\n */\nexport const zip = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, (a, b) => [a, b]));\n/**\n * Delete the element at the specified index, creating a new `Chunk`.\n *\n * @since 2.0.0\n */\nexport const remove = /*#__PURE__*/dual(2, (self, i) => {\n if (i < 0 || i >= self.length) return self;\n return unsafeFromArray(RA.remove(toReadonlyArray(self), i));\n});\n/**\n * @since 3.16.0\n */\nexport const removeOption = /*#__PURE__*/dual(2, (self, i) => {\n if (i < 0 || i >= self.length) return O.none();\n return O.some(unsafeFromArray(RA.remove(toReadonlyArray(self), i)));\n});\n/**\n * @since 2.0.0\n */\nexport const modifyOption = /*#__PURE__*/dual(3, (self, i, f) => {\n if (i < 0 || i >= self.length) return O.none();\n return O.some(unsafeFromArray(RA.modify(toReadonlyArray(self), i, f)));\n});\n/**\n * Apply a function to the element at the specified index, creating a new `Chunk`,\n * or returning the input if the index is out of bounds.\n *\n * @since 2.0.0\n */\nexport const modify = /*#__PURE__*/dual(3, (self, i, f) => O.getOrElse(modifyOption(self, i, f), () => self));\n/**\n * Change the element at the specified index, creating a new `Chunk`,\n * or returning the input if the index is out of bounds.\n *\n * @since 2.0.0\n */\nexport const replace = /*#__PURE__*/dual(3, (self, i, b) => modify(self, i, () => b));\n/**\n * @since 2.0.0\n */\nexport const replaceOption = /*#__PURE__*/dual(3, (self, i, b) => modifyOption(self, i, () => b));\n/**\n * Return a Chunk of length n with element i initialized with f(i).\n *\n * **Note**. `n` is normalized to an integer >= 1.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const makeBy = /*#__PURE__*/dual(2, (n, f) => fromIterable(RA.makeBy(n, f)));\n/**\n * Create a non empty `Chunk` containing a range of integers, including both endpoints.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const range = (start, end) => start <= end ? makeBy(end - start + 1, i => start + i) : of(start);\n// -------------------------------------------------------------------------------------\n// re-exports from ReadonlyArray\n// -------------------------------------------------------------------------------------\n/**\n * Returns a function that checks if a `Chunk` contains a given value using the default `Equivalence`.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const contains = RA.contains;\n/**\n * Returns a function that checks if a `Chunk` contains a given value using a provided `isEquivalent` function.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const containsWith = RA.containsWith;\n/**\n * Returns the first element that satisfies the specified\n * predicate, or `None` if no such element exists.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findFirst = RA.findFirst;\n/**\n * Return the first index for which a predicate holds.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findFirstIndex = RA.findFirstIndex;\n/**\n * Find the last element for which a predicate holds.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findLast = RA.findLast;\n/**\n * Return the last index for which a predicate holds.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findLastIndex = RA.findLastIndex;\n/**\n * Check if a predicate holds true for every `Chunk` element.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const every = /*#__PURE__*/dual(2, (self, refinement) => RA.fromIterable(self).every(refinement));\n/**\n * Check if a predicate holds true for some `Chunk` element.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const some = /*#__PURE__*/dual(2, (self, predicate) => RA.fromIterable(self).some(predicate));\n/**\n * Joins the elements together with \"sep\" in the middle.\n *\n * @category folding\n * @since 2.0.0\n */\nexport const join = RA.join;\n/**\n * @category folding\n * @since 2.0.0\n */\nexport const reduce = RA.reduce;\n/**\n * @category folding\n * @since 2.0.0\n */\nexport const reduceRight = RA.reduceRight;\n/**\n * Creates a `Chunk` of values not included in the other given `Chunk` using the provided `isEquivalent` function.\n * The order and references of result values are determined by the first `Chunk`.\n *\n * @since 3.2.0\n */\nexport const differenceWith = isEquivalent => {\n return dual(2, (self, that) => unsafeFromArray(RA.differenceWith(isEquivalent)(that, self)));\n};\n/**\n * Creates a `Chunk` of values not included in the other given `Chunk`.\n * The order and references of result values are determined by the first `Chunk`.\n *\n * @since 3.2.0\n */\nexport const difference = /*#__PURE__*/dual(2, (self, that) => unsafeFromArray(RA.difference(that, self)));\n//# sourceMappingURL=Chunk.js.map","/**\n * @since 2.0.0\n */\nimport * as Equal from \"./Equal.js\";\nimport { dual } from \"./Function.js\";\nimport * as Hash from \"./Hash.js\";\nimport { NodeInspectSymbol } from \"./Inspectable.js\";\nimport * as Option from \"./Option.js\";\nimport * as order from \"./Order.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nimport { hasProperty, isBigInt, isNumber, isString } from \"./Predicate.js\";\nconst TypeId = /*#__PURE__*/Symbol.for(\"effect/Duration\");\nconst bigint0 = /*#__PURE__*/BigInt(0);\nconst bigint24 = /*#__PURE__*/BigInt(24);\nconst bigint60 = /*#__PURE__*/BigInt(60);\nconst bigint1e3 = /*#__PURE__*/BigInt(1_000);\nconst bigint1e6 = /*#__PURE__*/BigInt(1_000_000);\nconst bigint1e9 = /*#__PURE__*/BigInt(1_000_000_000);\nconst DURATION_REGEX = /^(-?\\d+(?:\\.\\d+)?)\\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;\n/**\n * @since 2.0.0\n */\nexport const decode = input => {\n if (isDuration(input)) {\n return input;\n } else if (isNumber(input)) {\n return millis(input);\n } else if (isBigInt(input)) {\n return nanos(input);\n } else if (Array.isArray(input) && input.length === 2 && input.every(isNumber)) {\n if (input[0] === -Infinity || input[1] === -Infinity || Number.isNaN(input[0]) || Number.isNaN(input[1])) {\n return zero;\n }\n if (input[0] === Infinity || input[1] === Infinity) {\n return infinity;\n }\n return nanos(BigInt(Math.round(input[0] * 1_000_000_000)) + BigInt(Math.round(input[1])));\n } else if (isString(input)) {\n const match = DURATION_REGEX.exec(input);\n if (match) {\n const [_, valueStr, unit] = match;\n const value = Number(valueStr);\n switch (unit) {\n case \"nano\":\n case \"nanos\":\n return nanos(BigInt(valueStr));\n case \"micro\":\n case \"micros\":\n return micros(BigInt(valueStr));\n case \"milli\":\n case \"millis\":\n return millis(value);\n case \"second\":\n case \"seconds\":\n return seconds(value);\n case \"minute\":\n case \"minutes\":\n return minutes(value);\n case \"hour\":\n case \"hours\":\n return hours(value);\n case \"day\":\n case \"days\":\n return days(value);\n case \"week\":\n case \"weeks\":\n return weeks(value);\n }\n }\n }\n throw new Error(\"Invalid DurationInput\");\n};\n/**\n * @since 2.5.0\n */\nexport const decodeUnknown = /*#__PURE__*/Option.liftThrowable(decode);\nconst zeroValue = {\n _tag: \"Millis\",\n millis: 0\n};\nconst infinityValue = {\n _tag: \"Infinity\"\n};\nconst DurationProto = {\n [TypeId]: TypeId,\n [Hash.symbol]() {\n return Hash.cached(this, Hash.structure(this.value));\n },\n [Equal.symbol](that) {\n return isDuration(that) && equals(this, that);\n },\n toString() {\n return `Duration(${format(this)})`;\n },\n toJSON() {\n switch (this.value._tag) {\n case \"Millis\":\n return {\n _id: \"Duration\",\n _tag: \"Millis\",\n millis: this.value.millis\n };\n case \"Nanos\":\n return {\n _id: \"Duration\",\n _tag: \"Nanos\",\n hrtime: toHrTime(this)\n };\n case \"Infinity\":\n return {\n _id: \"Duration\",\n _tag: \"Infinity\"\n };\n }\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst make = input => {\n const duration = Object.create(DurationProto);\n if (isNumber(input)) {\n if (isNaN(input) || input <= 0) {\n duration.value = zeroValue;\n } else if (!Number.isFinite(input)) {\n duration.value = infinityValue;\n } else if (!Number.isInteger(input)) {\n duration.value = {\n _tag: \"Nanos\",\n nanos: BigInt(Math.round(input * 1_000_000))\n };\n } else {\n duration.value = {\n _tag: \"Millis\",\n millis: input\n };\n }\n } else if (input <= bigint0) {\n duration.value = zeroValue;\n } else {\n duration.value = {\n _tag: \"Nanos\",\n nanos: input\n };\n }\n return duration;\n};\n/**\n * @since 2.0.0\n * @category guards\n */\nexport const isDuration = u => hasProperty(u, TypeId);\n/**\n * @since 2.0.0\n * @category guards\n */\nexport const isFinite = self => self.value._tag !== \"Infinity\";\n/**\n * @since 3.5.0\n * @category guards\n */\nexport const isZero = self => {\n switch (self.value._tag) {\n case \"Millis\":\n {\n return self.value.millis === 0;\n }\n case \"Nanos\":\n {\n return self.value.nanos === bigint0;\n }\n case \"Infinity\":\n {\n return false;\n }\n }\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const zero = /*#__PURE__*/make(0);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const infinity = /*#__PURE__*/make(Infinity);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const nanos = nanos => make(nanos);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const micros = micros => make(micros * bigint1e3);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const millis = millis => make(millis);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const seconds = seconds => make(seconds * 1000);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const minutes = minutes => make(minutes * 60_000);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const hours = hours => make(hours * 3_600_000);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const days = days => make(days * 86_400_000);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const weeks = weeks => make(weeks * 604_800_000);\n/**\n * @since 2.0.0\n * @category getters\n */\nexport const toMillis = self => match(self, {\n onMillis: millis => millis,\n onNanos: nanos => Number(nanos) / 1_000_000\n});\n/**\n * @since 2.0.0\n * @category getters\n */\nexport const toSeconds = self => match(self, {\n onMillis: millis => millis / 1_000,\n onNanos: nanos => Number(nanos) / 1_000_000_000\n});\n/**\n * @since 3.8.0\n * @category getters\n */\nexport const toMinutes = self => match(self, {\n onMillis: millis => millis / 60_000,\n onNanos: nanos => Number(nanos) / 60_000_000_000\n});\n/**\n * @since 3.8.0\n * @category getters\n */\nexport const toHours = self => match(self, {\n onMillis: millis => millis / 3_600_000,\n onNanos: nanos => Number(nanos) / 3_600_000_000_000\n});\n/**\n * @since 3.8.0\n * @category getters\n */\nexport const toDays = self => match(self, {\n onMillis: millis => millis / 86_400_000,\n onNanos: nanos => Number(nanos) / 86_400_000_000_000\n});\n/**\n * @since 3.8.0\n * @category getters\n */\nexport const toWeeks = self => match(self, {\n onMillis: millis => millis / 604_800_000,\n onNanos: nanos => Number(nanos) / 604_800_000_000_000\n});\n/**\n * Get the duration in nanoseconds as a bigint.\n *\n * If the duration is infinite, returns `Option.none()`\n *\n * @since 2.0.0\n * @category getters\n */\nexport const toNanos = self => {\n const _self = decode(self);\n switch (_self.value._tag) {\n case \"Infinity\":\n return Option.none();\n case \"Nanos\":\n return Option.some(_self.value.nanos);\n case \"Millis\":\n return Option.some(BigInt(Math.round(_self.value.millis * 1_000_000)));\n }\n};\n/**\n * Get the duration in nanoseconds as a bigint.\n *\n * If the duration is infinite, it throws an error.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const unsafeToNanos = self => {\n const _self = decode(self);\n switch (_self.value._tag) {\n case \"Infinity\":\n throw new Error(\"Cannot convert infinite duration to nanos\");\n case \"Nanos\":\n return _self.value.nanos;\n case \"Millis\":\n return BigInt(Math.round(_self.value.millis * 1_000_000));\n }\n};\n/**\n * @since 2.0.0\n * @category getters\n */\nexport const toHrTime = self => {\n const _self = decode(self);\n switch (_self.value._tag) {\n case \"Infinity\":\n return [Infinity, 0];\n case \"Nanos\":\n return [Number(_self.value.nanos / bigint1e9), Number(_self.value.nanos % bigint1e9)];\n case \"Millis\":\n return [Math.floor(_self.value.millis / 1000), Math.round(_self.value.millis % 1000 * 1_000_000)];\n }\n};\n/**\n * @since 2.0.0\n * @category pattern matching\n */\nexport const match = /*#__PURE__*/dual(2, (self, options) => {\n const _self = decode(self);\n switch (_self.value._tag) {\n case \"Nanos\":\n return options.onNanos(_self.value.nanos);\n case \"Infinity\":\n return options.onMillis(Infinity);\n case \"Millis\":\n return options.onMillis(_self.value.millis);\n }\n});\n/**\n * @since 2.0.0\n * @category pattern matching\n */\nexport const matchWith = /*#__PURE__*/dual(3, (self, that, options) => {\n const _self = decode(self);\n const _that = decode(that);\n if (_self.value._tag === \"Infinity\" || _that.value._tag === \"Infinity\") {\n return options.onMillis(toMillis(_self), toMillis(_that));\n } else if (_self.value._tag === \"Nanos\" || _that.value._tag === \"Nanos\") {\n const selfNanos = _self.value._tag === \"Nanos\" ? _self.value.nanos : BigInt(Math.round(_self.value.millis * 1_000_000));\n const thatNanos = _that.value._tag === \"Nanos\" ? _that.value.nanos : BigInt(Math.round(_that.value.millis * 1_000_000));\n return options.onNanos(selfNanos, thatNanos);\n }\n return options.onMillis(_self.value.millis, _that.value.millis);\n});\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const Order = /*#__PURE__*/order.make((self, that) => matchWith(self, that, {\n onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,\n onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0\n}));\n/**\n * Checks if a `Duration` is between a `minimum` and `maximum` value.\n *\n * @category predicates\n * @since 2.0.0\n */\nexport const between = /*#__PURE__*/order.between(/*#__PURE__*/order.mapInput(Order, decode));\n/**\n * @category instances\n * @since 2.0.0\n */\nexport const Equivalence = (self, that) => matchWith(self, that, {\n onMillis: (self, that) => self === that,\n onNanos: (self, that) => self === that\n});\nconst _min = /*#__PURE__*/order.min(Order);\n/**\n * @since 2.0.0\n */\nexport const min = /*#__PURE__*/dual(2, (self, that) => _min(decode(self), decode(that)));\nconst _max = /*#__PURE__*/order.max(Order);\n/**\n * @since 2.0.0\n * @category order\n */\nexport const max = /*#__PURE__*/dual(2, (self, that) => _max(decode(self), decode(that)));\nconst _clamp = /*#__PURE__*/order.clamp(Order);\n/**\n * @since 2.0.0\n * @category order\n */\nexport const clamp = /*#__PURE__*/dual(2, (self, options) => _clamp(decode(self), {\n minimum: decode(options.minimum),\n maximum: decode(options.maximum)\n}));\n/**\n * @since 2.4.19\n * @category math\n */\nexport const divide = /*#__PURE__*/dual(2, (self, by) => match(self, {\n onMillis: millis => {\n if (by === 0 || isNaN(by) || !Number.isFinite(by)) {\n return Option.none();\n }\n return Option.some(make(millis / by));\n },\n onNanos: nanos => {\n if (isNaN(by) || by <= 0 || !Number.isFinite(by)) {\n return Option.none();\n }\n try {\n return Option.some(make(nanos / BigInt(by)));\n } catch {\n return Option.none();\n }\n }\n}));\n/**\n * @since 2.4.19\n * @category math\n */\nexport const unsafeDivide = /*#__PURE__*/dual(2, (self, by) => match(self, {\n onMillis: millis => make(millis / by),\n onNanos: nanos => {\n if (isNaN(by) || by < 0 || Object.is(by, -0)) {\n return zero;\n } else if (Object.is(by, 0) || !Number.isFinite(by)) {\n return infinity;\n }\n return make(nanos / BigInt(by));\n }\n}));\n/**\n * @since 2.0.0\n * @category math\n */\nexport const times = /*#__PURE__*/dual(2, (self, times) => match(self, {\n onMillis: millis => make(millis * times),\n onNanos: nanos => make(nanos * BigInt(times))\n}));\n/**\n * @since 2.0.0\n * @category math\n */\nexport const subtract = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {\n onMillis: (self, that) => make(self - that),\n onNanos: (self, that) => make(self - that)\n}));\n/**\n * @since 2.0.0\n * @category math\n */\nexport const sum = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {\n onMillis: (self, that) => make(self + that),\n onNanos: (self, that) => make(self + that)\n}));\n/**\n * @since 2.0.0\n * @category predicates\n */\nexport const lessThan = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {\n onMillis: (self, that) => self < that,\n onNanos: (self, that) => self < that\n}));\n/**\n * @since 2.0.0\n * @category predicates\n */\nexport const lessThanOrEqualTo = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {\n onMillis: (self, that) => self <= that,\n onNanos: (self, that) => self <= that\n}));\n/**\n * @since 2.0.0\n * @category predicates\n */\nexport const greaterThan = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {\n onMillis: (self, that) => self > that,\n onNanos: (self, that) => self > that\n}));\n/**\n * @since 2.0.0\n * @category predicates\n */\nexport const greaterThanOrEqualTo = /*#__PURE__*/dual(2, (self, that) => matchWith(self, that, {\n onMillis: (self, that) => self >= that,\n onNanos: (self, that) => self >= that\n}));\n/**\n * @since 2.0.0\n * @category predicates\n */\nexport const equals = /*#__PURE__*/dual(2, (self, that) => Equivalence(decode(self), decode(that)));\n/**\n * Converts a `Duration` to its parts.\n *\n * @since 3.8.0\n * @category conversions\n */\nexport const parts = self => {\n const duration = decode(self);\n if (duration.value._tag === \"Infinity\") {\n return {\n days: Infinity,\n hours: Infinity,\n minutes: Infinity,\n seconds: Infinity,\n millis: Infinity,\n nanos: Infinity\n };\n }\n const nanos = unsafeToNanos(duration);\n const ms = nanos / bigint1e6;\n const sec = ms / bigint1e3;\n const min = sec / bigint60;\n const hr = min / bigint60;\n const days = hr / bigint24;\n return {\n days: Number(days),\n hours: Number(hr % bigint24),\n minutes: Number(min % bigint60),\n seconds: Number(sec % bigint60),\n millis: Number(ms % bigint1e3),\n nanos: Number(nanos % bigint1e6)\n };\n};\n/**\n * Converts a `Duration` to a human readable string.\n *\n * @since 2.0.0\n * @category conversions\n * @example\n * ```ts\n * import { Duration } from \"effect\"\n *\n * Duration.format(Duration.millis(1000)) // \"1s\"\n * Duration.format(Duration.millis(1001)) // \"1s 1ms\"\n * ```\n */\nexport const format = self => {\n const duration = decode(self);\n if (duration.value._tag === \"Infinity\") {\n return \"Infinity\";\n }\n if (isZero(duration)) {\n return \"0\";\n }\n const fragments = parts(duration);\n const pieces = [];\n if (fragments.days !== 0) {\n pieces.push(`${fragments.days}d`);\n }\n if (fragments.hours !== 0) {\n pieces.push(`${fragments.hours}h`);\n }\n if (fragments.minutes !== 0) {\n pieces.push(`${fragments.minutes}m`);\n }\n if (fragments.seconds !== 0) {\n pieces.push(`${fragments.seconds}s`);\n }\n if (fragments.millis !== 0) {\n pieces.push(`${fragments.millis}ms`);\n }\n if (fragments.nanos !== 0) {\n pieces.push(`${fragments.nanos}ns`);\n }\n return pieces.join(\" \");\n};\n/**\n * Formats a Duration into an ISO8601 duration string.\n *\n * Months are assumed to be 30 days and years are assumed to be 365 days.\n *\n * Milliseconds and nanoseconds are expressed as fractional seconds.\n *\n * @example\n * ```ts\n * import { Duration } from \"effect\"\n *\n * Duration.unsafeFormatIso(Duration.days(1)) // => \"P1D\"\n * Duration.unsafeFormatIso(Duration.minutes(90)) // => \"PT1H30M\"\n * Duration.unsafeFormatIso(Duration.millis(1500)) // => \"PT1.5S\"\n * ```\n *\n * @throws `RangeError` If the duration is not finite.\n *\n * @since 3.13.0\n * @category conversions\n */\nexport const unsafeFormatIso = self => {\n const duration = decode(self);\n if (!isFinite(duration)) {\n throw new RangeError(\"Cannot format infinite duration\");\n }\n const fragments = [];\n const {\n days,\n hours,\n millis,\n minutes,\n nanos,\n seconds\n } = parts(duration);\n let rest = days;\n if (rest >= 365) {\n const years = Math.floor(rest / 365);\n rest %= 365;\n fragments.push(`${years}Y`);\n }\n if (rest >= 30) {\n const months = Math.floor(rest / 30);\n rest %= 30;\n fragments.push(`${months}M`);\n }\n if (rest >= 7) {\n const weeks = Math.floor(rest / 7);\n rest %= 7;\n fragments.push(`${weeks}W`);\n }\n if (rest > 0) {\n fragments.push(`${rest}D`);\n }\n if (hours !== 0 || minutes !== 0 || seconds !== 0 || millis !== 0 || nanos !== 0) {\n fragments.push(\"T\");\n if (hours !== 0) {\n fragments.push(`${hours}H`);\n }\n if (minutes !== 0) {\n fragments.push(`${minutes}M`);\n }\n if (seconds !== 0 || millis !== 0 || nanos !== 0) {\n const total = BigInt(seconds) * bigint1e9 + BigInt(millis) * bigint1e6 + BigInt(nanos);\n const str = (Number(total) / 1e9).toFixed(9).replace(/\\.?0+$/, \"\");\n fragments.push(`${str}S`);\n }\n }\n return `P${fragments.join(\"\") || \"T0S\"}`;\n};\n/**\n * Formats a Duration into an ISO8601 duration string.\n *\n * Months are assumed to be 30 days and years are assumed to be 365 days.\n *\n * Returns `Option.none()` if the duration is infinite.\n *\n * @example\n * ```ts\n * import { Duration, Option } from \"effect\"\n *\n * Duration.formatIso(Duration.days(1)) // => Option.some(\"P1D\")\n * Duration.formatIso(Duration.minutes(90)) // => Option.some(\"PT1H30M\")\n * Duration.formatIso(Duration.millis(1500)) // => Option.some(\"PT1.5S\")\n * Duration.formatIso(Duration.infinity) // => Option.none()\n * ```\n *\n * @since 3.13.0\n * @category conversions\n */\nexport const formatIso = self => {\n const duration = decode(self);\n return isFinite(duration) ? Option.some(unsafeFormatIso(duration)) : Option.none();\n};\n/**\n * Parses an ISO8601 duration string into a `Duration`.\n *\n * Months are assumed to be 30 days and years are assumed to be 365 days.\n *\n * @example\n * ```ts\n * import { Duration, Option } from \"effect\"\n *\n * Duration.fromIso(\"P1D\") // => Option.some(Duration.days(1))\n * Duration.fromIso(\"PT1H\") // => Option.some(Duration.hours(1))\n * Duration.fromIso(\"PT1M\") // => Option.some(Duration.minutes(1))\n * Duration.fromIso(\"PT1.5S\") // => Option.some(Duration.seconds(1.5))\n * ```\n *\n * @since 3.13.0\n * @category conversions\n */\nexport const fromIso = iso => {\n const result = DURATION_ISO_REGEX.exec(iso);\n if (result == null) {\n return Option.none();\n }\n const [years, months, weeks, days, hours, mins, secs] = result.slice(1, 8).map(_ => _ ? Number(_) : 0);\n const value = years * 365 * 24 * 60 * 60 + months * 30 * 24 * 60 * 60 + weeks * 7 * 24 * 60 * 60 + days * 24 * 60 * 60 + hours * 60 * 60 + mins * 60 + secs;\n return Option.some(seconds(value));\n};\nconst DURATION_ISO_REGEX = /^P(?!$)(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?!$)(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+(?:\\.\\d+)?)S)?)?$/;\n//# sourceMappingURL=Duration.js.map","/** @internal */\nexport const SIZE = 5;\n/** @internal */\nexport const BUCKET_SIZE = /*#__PURE__*/Math.pow(2, SIZE);\n/** @internal */\nexport const MASK = BUCKET_SIZE - 1;\n/** @internal */\nexport const MAX_INDEX_NODE = BUCKET_SIZE / 2;\n/** @internal */\nexport const MIN_ARRAY_NODE = BUCKET_SIZE / 4;\n//# sourceMappingURL=config.js.map","import { MASK } from \"./config.js\";\n/**\n * Hamming weight.\n *\n * Taken from: http://jsperf.com/hamming-weight\n *\n * @internal\n */\nexport function popcount(x) {\n x -= x >> 1 & 0x55555555;\n x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n x = x + (x >> 4) & 0x0f0f0f0f;\n x += x >> 8;\n x += x >> 16;\n return x & 0x7f;\n}\n/** @internal */\nexport function hashFragment(shift, h) {\n return h >>> shift & MASK;\n}\n/** @internal */\nexport function toBitmap(x) {\n return 1 << x;\n}\n/** @internal */\nexport function fromBitmap(bitmap, bit) {\n return popcount(bitmap & bit - 1);\n}\n//# sourceMappingURL=bitwise.js.map","export const make = (value, previous) => ({\n value,\n previous\n});\n//# sourceMappingURL=stack.js.map","/** @internal */\nexport function arrayUpdate(mutate, at, v, arr) {\n let out = arr;\n if (!mutate) {\n const len = arr.length;\n out = new Array(len);\n for (let i = 0; i < len; ++i) out[i] = arr[i];\n }\n out[at] = v;\n return out;\n}\n/** @internal */\nexport function arraySpliceOut(mutate, at, arr) {\n const newLen = arr.length - 1;\n let i = 0;\n let g = 0;\n let out = arr;\n if (mutate) {\n i = g = at;\n } else {\n out = new Array(newLen);\n while (i < at) out[g++] = arr[i++];\n }\n ++i;\n while (i <= newLen) out[g++] = arr[i++];\n if (mutate) {\n out.length = newLen;\n }\n return out;\n}\n/** @internal */\nexport function arraySpliceIn(mutate, at, v, arr) {\n const len = arr.length;\n if (mutate) {\n let i = len;\n while (i >= at) arr[i--] = arr[i];\n arr[at] = v;\n return arr;\n }\n let i = 0,\n g = 0;\n const out = new Array(len + 1);\n while (i < at) out[g++] = arr[i++];\n out[at] = v;\n while (i < len) out[++g] = arr[i++];\n return out;\n}\n//# sourceMappingURL=array.js.map","import { equals } from \"../../Equal.js\";\nimport * as O from \"../../Option.js\";\nimport { isTagged } from \"../../Predicate.js\";\nimport * as Stack from \"../stack.js\";\nimport { arraySpliceIn, arraySpliceOut, arrayUpdate } from \"./array.js\";\nimport { fromBitmap, hashFragment, toBitmap } from \"./bitwise.js\";\nimport { MAX_INDEX_NODE, MIN_ARRAY_NODE, SIZE } from \"./config.js\";\n/** @internal */\nexport class EmptyNode {\n _tag = \"EmptyNode\";\n modify(edit, _shift, f, hash, key, size) {\n const v = f(O.none());\n if (O.isNone(v)) return new EmptyNode();\n ++size.value;\n return new LeafNode(edit, hash, key, v);\n }\n}\n/** @internal */\nexport function isEmptyNode(a) {\n return isTagged(a, \"EmptyNode\");\n}\n/** @internal */\nexport function isLeafNode(node) {\n return isEmptyNode(node) || node._tag === \"LeafNode\" || node._tag === \"CollisionNode\";\n}\n/** @internal */\nexport function canEditNode(node, edit) {\n return isEmptyNode(node) ? false : edit === node.edit;\n}\n/** @internal */\nexport class LeafNode {\n edit;\n hash;\n key;\n value;\n _tag = \"LeafNode\";\n constructor(edit, hash, key, value) {\n this.edit = edit;\n this.hash = hash;\n this.key = key;\n this.value = value;\n }\n modify(edit, shift, f, hash, key, size) {\n if (equals(key, this.key)) {\n const v = f(this.value);\n if (v === this.value) return this;else if (O.isNone(v)) {\n --size.value;\n return new EmptyNode();\n }\n if (canEditNode(this, edit)) {\n this.value = v;\n return this;\n }\n return new LeafNode(edit, hash, key, v);\n }\n const v = f(O.none());\n if (O.isNone(v)) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, hash, new LeafNode(edit, hash, key, v));\n }\n}\n/** @internal */\nexport class CollisionNode {\n edit;\n hash;\n children;\n _tag = \"CollisionNode\";\n constructor(edit, hash, children) {\n this.edit = edit;\n this.hash = hash;\n this.children = children;\n }\n modify(edit, shift, f, hash, key, size) {\n if (hash === this.hash) {\n const canEdit = canEditNode(this, edit);\n const list = this.updateCollisionList(canEdit, edit, this.hash, this.children, f, key, size);\n if (list === this.children) return this;\n return list.length > 1 ? new CollisionNode(edit, this.hash, list) : list[0]; // collapse single element collision list\n }\n const v = f(O.none());\n if (O.isNone(v)) return this;\n ++size.value;\n return mergeLeaves(edit, shift, this.hash, this, hash, new LeafNode(edit, hash, key, v));\n }\n updateCollisionList(mutate, edit, hash, list, f, key, size) {\n const len = list.length;\n for (let i = 0; i < len; ++i) {\n const child = list[i];\n if (\"key\" in child && equals(key, child.key)) {\n const value = child.value;\n const newValue = f(value);\n if (newValue === value) return list;\n if (O.isNone(newValue)) {\n --size.value;\n return arraySpliceOut(mutate, i, list);\n }\n return arrayUpdate(mutate, i, new LeafNode(edit, hash, key, newValue), list);\n }\n }\n const newValue = f(O.none());\n if (O.isNone(newValue)) return list;\n ++size.value;\n return arrayUpdate(mutate, len, new LeafNode(edit, hash, key, newValue), list);\n }\n}\n/** @internal */\nexport class IndexedNode {\n edit;\n mask;\n children;\n _tag = \"IndexedNode\";\n constructor(edit, mask, children) {\n this.edit = edit;\n this.mask = mask;\n this.children = children;\n }\n modify(edit, shift, f, hash, key, size) {\n const mask = this.mask;\n const children = this.children;\n const frag = hashFragment(shift, hash);\n const bit = toBitmap(frag);\n const indx = fromBitmap(mask, bit);\n const exists = mask & bit;\n const canEdit = canEditNode(this, edit);\n if (!exists) {\n const _newChild = new EmptyNode().modify(edit, shift + SIZE, f, hash, key, size);\n if (!_newChild) return this;\n return children.length >= MAX_INDEX_NODE ? expand(edit, frag, _newChild, mask, children) : new IndexedNode(edit, mask | bit, arraySpliceIn(canEdit, indx, _newChild, children));\n }\n const current = children[indx];\n const child = current.modify(edit, shift + SIZE, f, hash, key, size);\n if (current === child) return this;\n let bitmap = mask;\n let newChildren;\n if (isEmptyNode(child)) {\n // remove\n bitmap &= ~bit;\n if (!bitmap) return new EmptyNode();\n if (children.length <= 2 && isLeafNode(children[indx ^ 1])) {\n return children[indx ^ 1]; // collapse\n }\n newChildren = arraySpliceOut(canEdit, indx, children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, indx, child, children);\n }\n if (canEdit) {\n this.mask = bitmap;\n this.children = newChildren;\n return this;\n }\n return new IndexedNode(edit, bitmap, newChildren);\n }\n}\n/** @internal */\nexport class ArrayNode {\n edit;\n size;\n children;\n _tag = \"ArrayNode\";\n constructor(edit, size, children) {\n this.edit = edit;\n this.size = size;\n this.children = children;\n }\n modify(edit, shift, f, hash, key, size) {\n let count = this.size;\n const children = this.children;\n const frag = hashFragment(shift, hash);\n const child = children[frag];\n const newChild = (child || new EmptyNode()).modify(edit, shift + SIZE, f, hash, key, size);\n if (child === newChild) return this;\n const canEdit = canEditNode(this, edit);\n let newChildren;\n if (isEmptyNode(child) && !isEmptyNode(newChild)) {\n // add\n ++count;\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n } else if (!isEmptyNode(child) && isEmptyNode(newChild)) {\n // remove\n --count;\n if (count <= MIN_ARRAY_NODE) {\n return pack(edit, count, frag, children);\n }\n newChildren = arrayUpdate(canEdit, frag, new EmptyNode(), children);\n } else {\n // modify\n newChildren = arrayUpdate(canEdit, frag, newChild, children);\n }\n if (canEdit) {\n this.size = count;\n this.children = newChildren;\n return this;\n }\n return new ArrayNode(edit, count, newChildren);\n }\n}\nfunction pack(edit, count, removed, elements) {\n const children = new Array(count - 1);\n let g = 0;\n let bitmap = 0;\n for (let i = 0, len = elements.length; i < len; ++i) {\n if (i !== removed) {\n const elem = elements[i];\n if (elem && !isEmptyNode(elem)) {\n children[g++] = elem;\n bitmap |= 1 << i;\n }\n }\n }\n return new IndexedNode(edit, bitmap, children);\n}\nfunction expand(edit, frag, child, bitmap, subNodes) {\n const arr = [];\n let bit = bitmap;\n let count = 0;\n for (let i = 0; bit; ++i) {\n if (bit & 1) arr[i] = subNodes[count++];\n bit >>>= 1;\n }\n arr[frag] = child;\n return new ArrayNode(edit, count + 1, arr);\n}\nfunction mergeLeavesInner(edit, shift, h1, n1, h2, n2) {\n if (h1 === h2) return new CollisionNode(edit, h1, [n2, n1]);\n const subH1 = hashFragment(shift, h1);\n const subH2 = hashFragment(shift, h2);\n if (subH1 === subH2) {\n return child => new IndexedNode(edit, toBitmap(subH1) | toBitmap(subH2), [child]);\n } else {\n const children = subH1 < subH2 ? [n1, n2] : [n2, n1];\n return new IndexedNode(edit, toBitmap(subH1) | toBitmap(subH2), children);\n }\n}\nfunction mergeLeaves(edit, shift, h1, n1, h2, n2) {\n let stack = undefined;\n let currentShift = shift;\n while (true) {\n const res = mergeLeavesInner(edit, currentShift, h1, n1, h2, n2);\n if (typeof res === \"function\") {\n stack = Stack.make(res, stack);\n currentShift = currentShift + SIZE;\n } else {\n let final = res;\n while (stack != null) {\n final = stack.value(final);\n stack = stack.previous;\n }\n return final;\n }\n }\n}\n//# sourceMappingURL=node.js.map","import * as Equal from \"../Equal.js\";\nimport * as Dual from \"../Function.js\";\nimport { identity, pipe } from \"../Function.js\";\nimport * as Hash from \"../Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport { fromBitmap, hashFragment, toBitmap } from \"./hashMap/bitwise.js\";\nimport { SIZE } from \"./hashMap/config.js\";\nimport * as Node from \"./hashMap/node.js\";\nconst HashMapSymbolKey = \"effect/HashMap\";\n/** @internal */\nexport const HashMapTypeId = /*#__PURE__*/Symbol.for(HashMapSymbolKey);\nconst HashMapProto = {\n [HashMapTypeId]: HashMapTypeId,\n [Symbol.iterator]() {\n return new HashMapIterator(this, (k, v) => [k, v]);\n },\n [Hash.symbol]() {\n let hash = Hash.hash(HashMapSymbolKey);\n for (const item of this) {\n hash ^= pipe(Hash.hash(item[0]), Hash.combine(Hash.hash(item[1])));\n }\n return Hash.cached(this, hash);\n },\n [Equal.symbol](that) {\n if (isHashMap(that)) {\n if (that._size !== this._size) {\n return false;\n }\n for (const item of this) {\n const elem = pipe(that, getHash(item[0], Hash.hash(item[0])));\n if (Option.isNone(elem)) {\n return false;\n } else {\n if (!Equal.equals(item[1], elem.value)) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n },\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"HashMap\",\n values: Array.from(this).map(toJSON)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst makeImpl = (editable, edit, root, size) => {\n const map = Object.create(HashMapProto);\n map._editable = editable;\n map._edit = edit;\n map._root = root;\n map._size = size;\n return map;\n};\nclass HashMapIterator {\n map;\n f;\n v;\n constructor(map, f) {\n this.map = map;\n this.f = f;\n this.v = visitLazy(this.map._root, this.f, undefined);\n }\n next() {\n if (Option.isNone(this.v)) {\n return {\n done: true,\n value: undefined\n };\n }\n const v0 = this.v.value;\n this.v = applyCont(v0.cont);\n return {\n done: false,\n value: v0.value\n };\n }\n [Symbol.iterator]() {\n return new HashMapIterator(this.map, this.f);\n }\n}\nconst applyCont = cont => cont ? visitLazyChildren(cont[0], cont[1], cont[2], cont[3], cont[4]) : Option.none();\nconst visitLazy = (node, f, cont = undefined) => {\n switch (node._tag) {\n case \"LeafNode\":\n {\n if (Option.isSome(node.value)) {\n return Option.some({\n value: f(node.key, node.value.value),\n cont\n });\n }\n return applyCont(cont);\n }\n case \"CollisionNode\":\n case \"ArrayNode\":\n case \"IndexedNode\":\n {\n const children = node.children;\n return visitLazyChildren(children.length, children, 0, f, cont);\n }\n default:\n {\n return applyCont(cont);\n }\n }\n};\nconst visitLazyChildren = (len, children, i, f, cont) => {\n while (i < len) {\n const child = children[i++];\n if (child && !Node.isEmptyNode(child)) {\n return visitLazy(child, f, [len, children, i, f, cont]);\n }\n }\n return applyCont(cont);\n};\nconst _empty = /*#__PURE__*/makeImpl(false, 0, /*#__PURE__*/new Node.EmptyNode(), 0);\n/** @internal */\nexport const empty = () => _empty;\n/** @internal */\nexport const make = (...entries) => fromIterable(entries);\n/** @internal */\nexport const fromIterable = entries => {\n const map = beginMutation(empty());\n for (const entry of entries) {\n set(map, entry[0], entry[1]);\n }\n return endMutation(map);\n};\n/** @internal */\nexport const isHashMap = u => hasProperty(u, HashMapTypeId);\n/** @internal */\nexport const isEmpty = self => self && Node.isEmptyNode(self._root);\n/** @internal */\nexport const get = /*#__PURE__*/Dual.dual(2, (self, key) => getHash(self, key, Hash.hash(key)));\n/** @internal */\nexport const getHash = /*#__PURE__*/Dual.dual(3, (self, key, hash) => {\n let node = self._root;\n let shift = 0;\n while (true) {\n switch (node._tag) {\n case \"LeafNode\":\n {\n return Equal.equals(key, node.key) ? node.value : Option.none();\n }\n case \"CollisionNode\":\n {\n if (hash === node.hash) {\n const children = node.children;\n for (let i = 0, len = children.length; i < len; ++i) {\n const child = children[i];\n if (\"key\" in child && Equal.equals(key, child.key)) {\n return child.value;\n }\n }\n }\n return Option.none();\n }\n case \"IndexedNode\":\n {\n const frag = hashFragment(shift, hash);\n const bit = toBitmap(frag);\n if (node.mask & bit) {\n node = node.children[fromBitmap(node.mask, bit)];\n shift += SIZE;\n break;\n }\n return Option.none();\n }\n case \"ArrayNode\":\n {\n node = node.children[hashFragment(shift, hash)];\n if (node) {\n shift += SIZE;\n break;\n }\n return Option.none();\n }\n default:\n return Option.none();\n }\n }\n});\n/** @internal */\nexport const unsafeGet = /*#__PURE__*/Dual.dual(2, (self, key) => {\n const element = getHash(self, key, Hash.hash(key));\n if (Option.isNone(element)) {\n throw new Error(\"Expected map to contain key\");\n }\n return element.value;\n});\n/** @internal */\nexport const has = /*#__PURE__*/Dual.dual(2, (self, key) => Option.isSome(getHash(self, key, Hash.hash(key))));\n/** @internal */\nexport const hasHash = /*#__PURE__*/Dual.dual(3, (self, key, hash) => Option.isSome(getHash(self, key, hash)));\n/** @internal */\nexport const hasBy = /*#__PURE__*/Dual.dual(2, (self, predicate) => Option.isSome(findFirst(self, predicate)));\n/** @internal */\nexport const set = /*#__PURE__*/Dual.dual(3, (self, key, value) => modifyAt(self, key, () => Option.some(value)));\n/** @internal */\nexport const setTree = /*#__PURE__*/Dual.dual(3, (self, newRoot, newSize) => {\n if (self._editable) {\n ;\n self._root = newRoot;\n self._size = newSize;\n return self;\n }\n return newRoot === self._root ? self : makeImpl(self._editable, self._edit, newRoot, newSize);\n});\n/** @internal */\nexport const keys = self => new HashMapIterator(self, key => key);\n/** @internal */\nexport const values = self => new HashMapIterator(self, (_, value) => value);\n/** @internal */\nexport const entries = self => new HashMapIterator(self, (key, value) => [key, value]);\n/** @internal */\nexport const size = self => self._size;\n/** @internal */\nexport const countBy = /*#__PURE__*/Dual.dual(2, (self, f) => {\n let count = 0;\n for (const [k, a] of self) {\n if (f(a, k)) {\n count++;\n }\n }\n return count;\n});\n/** @internal */\nexport const beginMutation = self => makeImpl(true, self._edit + 1, self._root, self._size);\n/** @internal */\nexport const endMutation = self => {\n ;\n self._editable = false;\n return self;\n};\n/** @internal */\nexport const mutate = /*#__PURE__*/Dual.dual(2, (self, f) => {\n const transient = beginMutation(self);\n f(transient);\n return endMutation(transient);\n});\n/** @internal */\nexport const modifyAt = /*#__PURE__*/Dual.dual(3, (self, key, f) => modifyHash(self, key, Hash.hash(key), f));\n/** @internal */\nexport const modifyHash = /*#__PURE__*/Dual.dual(4, (self, key, hash, f) => {\n const size = {\n value: self._size\n };\n const newRoot = self._root.modify(self._editable ? self._edit : NaN, 0, f, hash, key, size);\n return pipe(self, setTree(newRoot, size.value));\n});\n/** @internal */\nexport const modify = /*#__PURE__*/Dual.dual(3, (self, key, f) => modifyAt(self, key, Option.map(f)));\n/** @internal */\nexport const union = /*#__PURE__*/Dual.dual(2, (self, that) => {\n const result = beginMutation(self);\n forEach(that, (v, k) => set(result, k, v));\n return endMutation(result);\n});\n/** @internal */\nexport const remove = /*#__PURE__*/Dual.dual(2, (self, key) => modifyAt(self, key, Option.none));\n/** @internal */\nexport const removeMany = /*#__PURE__*/Dual.dual(2, (self, keys) => mutate(self, map => {\n for (const key of keys) {\n remove(key)(map);\n }\n}));\n/**\n * Maps over the entries of the `HashMap` using the specified function.\n *\n * @since 2.0.0\n * @category mapping\n */\nexport const map = /*#__PURE__*/Dual.dual(2, (self, f) => reduce(self, empty(), (map, value, key) => set(map, key, f(value, key))));\n/** @internal */\nexport const flatMap = /*#__PURE__*/Dual.dual(2, (self, f) => reduce(self, empty(), (zero, value, key) => mutate(zero, map => forEach(f(value, key), (value, key) => set(map, key, value)))));\n/** @internal */\nexport const forEach = /*#__PURE__*/Dual.dual(2, (self, f) => reduce(self, void 0, (_, value, key) => f(value, key)));\n/** @internal */\nexport const reduce = /*#__PURE__*/Dual.dual(3, (self, zero, f) => {\n const root = self._root;\n if (root._tag === \"LeafNode\") {\n return Option.isSome(root.value) ? f(zero, root.value.value, root.key) : zero;\n }\n if (root._tag === \"EmptyNode\") {\n return zero;\n }\n const toVisit = [root.children];\n let children;\n while (children = toVisit.pop()) {\n for (let i = 0, len = children.length; i < len;) {\n const child = children[i++];\n if (child && !Node.isEmptyNode(child)) {\n if (child._tag === \"LeafNode\") {\n if (Option.isSome(child.value)) {\n zero = f(zero, child.value.value, child.key);\n }\n } else {\n toVisit.push(child.children);\n }\n }\n }\n }\n return zero;\n});\n/** @internal */\nexport const filter = /*#__PURE__*/Dual.dual(2, (self, f) => mutate(empty(), map => {\n for (const [k, a] of self) {\n if (f(a, k)) {\n set(map, k, a);\n }\n }\n}));\n/** @internal */\nexport const compact = self => filterMap(self, identity);\n/** @internal */\nexport const filterMap = /*#__PURE__*/Dual.dual(2, (self, f) => mutate(empty(), map => {\n for (const [k, a] of self) {\n const option = f(a, k);\n if (Option.isSome(option)) {\n set(map, k, option.value);\n }\n }\n}));\n/** @internal */\nexport const findFirst = /*#__PURE__*/Dual.dual(2, (self, predicate) => {\n for (const ka of self) {\n if (predicate(ka[1], ka[0])) {\n return Option.some(ka);\n }\n }\n return Option.none();\n});\n/** @internal */\nexport const some = /*#__PURE__*/Dual.dual(2, (self, predicate) => {\n for (const ka of self) {\n if (predicate(ka[1], ka[0])) {\n return true;\n }\n }\n return false;\n});\n/** @internal */\nexport const every = /*#__PURE__*/Dual.dual(2, (self, predicate) => !some(self, (a, k) => !predicate(a, k)));\n//# sourceMappingURL=hashMap.js.map","import * as Equal from \"../Equal.js\";\nimport { dual } from \"../Function.js\";\nimport * as Hash from \"../Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as HM from \"./hashMap.js\";\nconst HashSetSymbolKey = \"effect/HashSet\";\n/** @internal */\nexport const HashSetTypeId = /*#__PURE__*/Symbol.for(HashSetSymbolKey);\nconst HashSetProto = {\n [HashSetTypeId]: HashSetTypeId,\n [Symbol.iterator]() {\n return HM.keys(this._keyMap);\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.combine(Hash.hash(this._keyMap))(Hash.hash(HashSetSymbolKey)));\n },\n [Equal.symbol](that) {\n if (isHashSet(that)) {\n return HM.size(this._keyMap) === HM.size(that._keyMap) && Equal.equals(this._keyMap, that._keyMap);\n }\n return false;\n },\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"HashSet\",\n values: Array.from(this).map(toJSON)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const makeImpl = keyMap => {\n const set = Object.create(HashSetProto);\n set._keyMap = keyMap;\n return set;\n};\n/** @internal */\nexport const isHashSet = u => hasProperty(u, HashSetTypeId);\nconst _empty = /*#__PURE__*/makeImpl(/*#__PURE__*/HM.empty());\n/** @internal */\nexport const empty = () => _empty;\n/** @internal */\nexport const fromIterable = elements => {\n const set = beginMutation(empty());\n for (const value of elements) {\n add(set, value);\n }\n return endMutation(set);\n};\n/** @internal */\nexport const make = (...elements) => {\n const set = beginMutation(empty());\n for (const value of elements) {\n add(set, value);\n }\n return endMutation(set);\n};\n/** @internal */\nexport const has = /*#__PURE__*/dual(2, (self, value) => HM.has(self._keyMap, value));\n/** @internal */\nexport const some = /*#__PURE__*/dual(2, (self, f) => {\n let found = false;\n for (const value of self) {\n found = f(value);\n if (found) {\n break;\n }\n }\n return found;\n});\n/** @internal */\nexport const every = /*#__PURE__*/dual(2, (self, refinement) => !some(self, a => !refinement(a)));\n/** @internal */\nexport const isSubset = /*#__PURE__*/dual(2, (self, that) => every(self, value => has(that, value)));\n/** @internal */\nexport const values = self => HM.keys(self._keyMap);\n/** @internal */\nexport const size = self => HM.size(self._keyMap);\n/** @internal */\nexport const beginMutation = self => makeImpl(HM.beginMutation(self._keyMap));\n/** @internal */\nexport const endMutation = self => {\n ;\n self._keyMap._editable = false;\n return self;\n};\n/** @internal */\nexport const mutate = /*#__PURE__*/dual(2, (self, f) => {\n const transient = beginMutation(self);\n f(transient);\n return endMutation(transient);\n});\n/** @internal */\nexport const add = /*#__PURE__*/dual(2, (self, value) => self._keyMap._editable ? (HM.set(value, true)(self._keyMap), self) : makeImpl(HM.set(value, true)(self._keyMap)));\n/** @internal */\nexport const remove = /*#__PURE__*/dual(2, (self, value) => self._keyMap._editable ? (HM.remove(value)(self._keyMap), self) : makeImpl(HM.remove(value)(self._keyMap)));\n/** @internal */\nexport const difference = /*#__PURE__*/dual(2, (self, that) => mutate(self, set => {\n for (const value of that) {\n remove(set, value);\n }\n}));\n/** @internal */\nexport const intersection = /*#__PURE__*/dual(2, (self, that) => mutate(empty(), set => {\n for (const value of that) {\n if (has(value)(self)) {\n add(value)(set);\n }\n }\n}));\n/** @internal */\nexport const union = /*#__PURE__*/dual(2, (self, that) => mutate(empty(), set => {\n forEach(self, value => add(set, value));\n for (const value of that) {\n add(set, value);\n }\n}));\n/** @internal */\nexport const toggle = /*#__PURE__*/dual(2, (self, value) => has(self, value) ? remove(self, value) : add(self, value));\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => mutate(empty(), set => {\n forEach(self, a => {\n const b = f(a);\n if (!has(set, b)) {\n add(set, b);\n }\n });\n}));\n/** @internal */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => mutate(empty(), set => {\n forEach(self, a => {\n for (const b of f(a)) {\n if (!has(set, b)) {\n add(set, b);\n }\n }\n });\n}));\n/** @internal */\nexport const forEach = /*#__PURE__*/dual(2, (self, f) => HM.forEach(self._keyMap, (_, k) => f(k)));\n/** @internal */\nexport const reduce = /*#__PURE__*/dual(3, (self, zero, f) => HM.reduce(self._keyMap, zero, (z, _, a) => f(z, a)));\n/** @internal */\nexport const filter = /*#__PURE__*/dual(2, (self, f) => {\n return mutate(empty(), set => {\n const iterator = values(self);\n let next;\n while (!(next = iterator.next()).done) {\n const value = next.value;\n if (f(value)) {\n add(set, value);\n }\n }\n });\n});\n/** @internal */\nexport const partition = /*#__PURE__*/dual(2, (self, predicate) => {\n const iterator = values(self);\n let next;\n const right = beginMutation(empty());\n const left = beginMutation(empty());\n while (!(next = iterator.next()).done) {\n const value = next.value;\n if (predicate(value)) {\n add(right, value);\n } else {\n add(left, value);\n }\n }\n return [endMutation(left), endMutation(right)];\n});\n//# sourceMappingURL=hashSet.js.map","/**\n * # HashSet\n *\n * An immutable `HashSet` provides a collection of unique values with efficient\n * lookup, insertion and removal. Once created, a `HashSet` cannot be modified;\n * any operation that would alter the set instead returns a new `HashSet` with\n * the changes. This immutability offers benefits like predictable state\n * management and easier reasoning about your code.\n *\n * ## What Problem Does It Solve?\n *\n * `HashSet` solves the problem of maintaining an unsorted collection where each\n * value appears exactly once, with fast operations for checking membership and\n * adding/removing values.\n *\n * ## When to Use\n *\n * Use `HashSet` when you need:\n *\n * - A collection with no duplicate values\n * - Efficient membership testing (**`O(1)`** average complexity)\n * - Set operations like union, intersection, and difference\n * - An immutable data structure that preserves functional programming patterns\n *\n * ## Advanced Features\n *\n * HashSet provides operations for:\n *\n * - Transforming sets with map and flatMap\n * - Filtering elements with filter\n * - Combining sets with union, intersection and difference\n * - Performance optimizations via mutable operations in controlled contexts\n *\n * ## Performance Characteristics\n *\n * - **Lookup** operations ({@link module:HashSet.has}): **`O(1)`** average time\n * complexity\n * - **Insertion** operations ({@link module:HashSet.add}): **`O(1)`** average time\n * complexity\n * - **Removal** operations ({@link module:HashSet.remove}): **`O(1)`** average\n * time complexity\n * - **Set** operations ({@link module:HashSet.union},\n * {@link module:HashSet.intersection}): **`O(n)`** where n is the size of the\n * smaller set\n * - **Iteration**: **`O(n)`** where n is the size of the set\n *\n * The HashSet data structure implements the following traits:\n *\n * - {@link Iterable}: allows iterating over the values in the set\n * - {@link Equal}: allows comparing two sets for value-based equality\n * - {@link Pipeable}: allows chaining operations with the pipe operator\n * - {@link Inspectable}: allows inspecting the contents of the set\n *\n * ## Operations Reference\n *\n * | Category | Operation | Description | Complexity |\n * | ------------ | ----------------------------------- | ------------------------------------------- | ---------- |\n * | constructors | {@link module:HashSet.empty} | Creates an empty HashSet | O(1) |\n * | constructors | {@link module:HashSet.fromIterable} | Creates a HashSet from an iterable | O(n) |\n * | constructors | {@link module:HashSet.make} | Creates a HashSet from multiple values | O(n) |\n * | | | | |\n * | elements | {@link module:HashSet.has} | Checks if a value exists in the set | O(1) avg |\n * | elements | {@link module:HashSet.some} | Checks if any element satisfies a predicate | O(n) |\n * | elements | {@link module:HashSet.every} | Checks if all elements satisfy a predicate | O(n) |\n * | elements | {@link module:HashSet.isSubset} | Checks if a set is a subset of another | O(n) |\n * | | | | |\n * | getters | {@link module:HashSet.values} | Gets an iterator of all values | O(1) |\n * | getters | {@link module:HashSet.toValues} | Gets an array of all values | O(n) |\n * | getters | {@link module:HashSet.size} | Gets the number of elements | O(1) |\n * | | | | |\n * | mutations | {@link module:HashSet.add} | Adds a value to the set | O(1) avg |\n * | mutations | {@link module:HashSet.remove} | Removes a value from the set | O(1) avg |\n * | mutations | {@link module:HashSet.toggle} | Toggles a value's presence | O(1) avg |\n * | | | | |\n * | operations | {@link module:HashSet.difference} | Computes set difference (A - B) | O(n) |\n * | operations | {@link module:HashSet.intersection} | Computes set intersection (A ∩ B) | O(n) |\n * | operations | {@link module:HashSet.union} | Computes set union (A ∪ B) | O(n) |\n * | | | | |\n * | mapping | {@link module:HashSet.map} | Transforms each element | O(n) |\n * | | | | |\n * | sequencing | {@link module:HashSet.flatMap} | Transforms and flattens elements | O(n) |\n * | | | | |\n * | traversing | {@link module:HashSet.forEach} | Applies a function to each element | O(n) |\n * | | | | |\n * | folding | {@link module:HashSet.reduce} | Reduces the set to a single value | O(n) |\n * | | | | |\n * | filtering | {@link module:HashSet.filter} | Keeps elements that satisfy a predicate | O(n) |\n * | | | | |\n * | partitioning | {@link module:HashSet.partition} | Splits into two sets by a predicate | O(n) |\n *\n * ## Notes\n *\n * ### Composability with the Effect Ecosystem:\n *\n * This `HashSet` is designed to work seamlessly within the Effect ecosystem. It\n * implements the {@link Iterable}, {@link Equal}, {@link Pipeable}, and\n * {@link Inspectable} traits from Effect. This ensures compatibility with other\n * Effect data structures and functionalities. For example, you can easily use\n * Effect's `pipe` method to chain operations on the `HashSet`.\n *\n * **Equality of Elements with Effect's {@link Equal `Equal`} Trait:**\n *\n * This `HashSet` relies on Effect's {@link Equal} trait to determine the\n * uniqueness of elements within the set. The way equality is checked depends on\n * the type of the elements:\n *\n * - **Primitive Values:** For primitive JavaScript values like strings, numbers,\n * booleans, `null`, and `undefined`, equality is determined by their value\n * (similar to the `===` operator).\n * - **Objects and Custom Types:** For objects and other custom types, equality is\n * determined by whether those types implement the {@link Equal} interface\n * themselves. If an element type implements `Equal`, the `HashSet` will\n * delegate to that implementation to perform the equality check. This allows\n * you to define custom logic for determining when two instances of your\n * objects should be considered equal based on their properties, rather than\n * just their object identity.\n *\n * ```ts\n * import { Equal, Hash, HashSet } from \"effect\"\n *\n * class Person implements Equal.Equal {\n * constructor(\n * readonly id: number, // Unique identifier\n * readonly name: string,\n * readonly age: number\n * ) {}\n *\n * // Define equality based on id, name, and age\n * [Equal.symbol](that: Equal.Equal): boolean {\n * if (that instanceof Person) {\n * return (\n * Equal.equals(this.id, that.id) &&\n * Equal.equals(this.name, that.name) &&\n * Equal.equals(this.age, that.age)\n * )\n * }\n * return false\n * }\n *\n * // Generate a hash code based on the unique id\n * [Hash.symbol](): number {\n * return Hash.hash(this.id)\n * }\n * }\n *\n * // Creating a HashSet with objects that implement the Equal interface\n * const set = HashSet.empty().pipe(\n * HashSet.add(new Person(1, \"Alice\", 30)),\n * HashSet.add(new Person(1, \"Alice\", 30))\n * )\n *\n * // HashSet recognizes them as equal, so only one element is stored\n * console.log(HashSet.size(set))\n * // Output: 1\n * ```\n *\n * **Simplifying Equality and Hashing with `Data` and `Schema`:**\n *\n * Effect's {@link Data} and {@link Schema `Schema.Data`} modules offer powerful\n * ways to automatically handle the implementation of both the {@link Equal} and\n * {@link Hash} traits for your custom data structures.\n *\n * - **`Data` Module:** By using constructors like `Data.struct`, `Data.tuple`,\n * `Data.array`, or `Data.case` to define your data types, Effect\n * automatically generates the necessary implementations for value-based\n * equality and consistent hashing. This significantly reduces boilerplate and\n * ensures correctness.\n *\n * ```ts\n * import { HashSet, Data, Equal } from \"effect\"\n * import assert from \"node:assert/strict\"\n *\n * // Data.* implements the `Equal` traits for us\n * const person1 = Data.struct({ id: 1, name: \"Alice\", age: 30 })\n * const person2 = Data.struct({ id: 1, name: \"Alice\", age: 30 })\n *\n * assert(Equal.equals(person1, person2))\n *\n * const set = HashSet.empty().pipe(\n * HashSet.add(person1),\n * HashSet.add(person2)\n * )\n *\n * // HashSet recognizes them as equal, so only one element is stored\n * console.log(HashSet.size(set)) // Output: 1\n * ```\n *\n * - **`Schema` Module:** When defining data schemas using the {@link Schema}\n * module, you can use `Schema.Data` to automatically include the `Equal` and\n * `Hash` traits in the decoded objects. This is particularly important when\n * working with `HashSet`. **For decoded objects to be correctly recognized as\n * equal within a `HashSet`, ensure that the schema for those objects is\n * defined using `Schema.Data`.**\n *\n * ```ts\n * import { Equal, HashSet, Schema } from \"effect\"\n * import assert from \"node:assert/strict\"\n *\n * // Schema.Data implements the `Equal` traits for us\n * const PersonSchema = Schema.Data(\n * Schema.Struct({\n * id: Schema.Number,\n * name: Schema.String,\n * age: Schema.Number\n * })\n * )\n *\n * const Person = Schema.decode(PersonSchema)\n *\n * const person1 = Person({ id: 1, name: \"Alice\", age: 30 })\n * const person2 = Person({ id: 1, name: \"Alice\", age: 30 })\n *\n * assert(Equal.equals(person1, person2)) // Output: true\n *\n * const set = HashSet.empty().pipe(\n * HashSet.add(person1),\n * HashSet.add(person2)\n * )\n *\n * // HashSet thanks to Schema.Data implementation of the `Equal` trait, recognizes the two Person as equal, so only one element is stored\n * console.log(HashSet.size(set)) // Output: 1\n * ```\n *\n * ### Interoperability with the JavaScript Runtime:\n *\n * To interoperate with the regular JavaScript runtime, Effect's `HashSet`\n * provides methods to access its elements in formats readily usable by\n * JavaScript APIs: {@link values `HashSet.values`},\n * {@link toValues `HashSet.toValues`}\n *\n * ```ts\n * import { HashSet } from \"effect\"\n *\n * const hashSet: HashSet.HashSet<number> = HashSet.make(1, 2, 3)\n *\n * // Using HashSet.values to convert HashSet.HashSet<A> to IterableIterator<A>\n * const iterable: IterableIterator<number> = HashSet.values(hashSet)\n *\n * console.log(...iterable) // Logs: 1 2 3\n *\n * // Using HashSet.toValues to convert HashSet.HashSet<A> to Array<A>\n * const array: Array<number> = HashSet.toValues(hashSet)\n *\n * console.log(array) // Logs: [ 1, 2, 3 ]\n * ```\n *\n * Be mindful of performance implications (both time and space complexity) when\n * frequently converting between Effect's immutable HashSet and mutable\n * JavaScript data structures, especially for large collections.\n *\n * @module HashSet\n * @since 2.0.0\n */\nimport * as HS from \"./internal/hashSet.js\";\nconst TypeId = HS.HashSetTypeId;\n/**\n * @memberof HashSet\n * @since 2.0.0\n * @category refinements\n */\nexport const isHashSet = HS.isHashSet;\n/**\n * Creates an empty `HashSet`.\n *\n * Time complexity: **`O(1)`**\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category constructors\n * @example\n *\n * ```ts\n * import { HashSet, pipe } from \"effect\"\n *\n * console.log(\n * pipe(\n * // Provide a type argument to create a HashSet of a specific type\n * HashSet.empty<number>(),\n * HashSet.add(1),\n * HashSet.add(1), // Notice the duplicate\n * HashSet.add(2),\n * HashSet.toValues\n * )\n * ) // Output: [1, 2]\n * ```\n *\n * @see Other `HashSet` constructors are {@link module:HashSet.make} {@link module:HashSet.fromIterable}\n */\nexport const empty = HS.empty;\n/**\n * Creates a new `HashSet` from an iterable collection of values.\n *\n * Time complexity: **`O(n)`** where n is the number of elements in the iterable\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category constructors\n * @example\n *\n * ```ts\n * // Creating a HashSet from an Array\n * import { HashSet, pipe } from \"effect\"\n *\n * console.log(\n * pipe(\n * [1, 2, 3, 4, 5, 1, 2, 3], // Array<number> is an Iterable<number>; Note the duplicates.\n * HashSet.fromIterable,\n * HashSet.toValues\n * )\n * ) // Output: [1, 2, 3, 4, 5]\n * ```\n *\n * @example\n *\n * ```ts\n * // Creating a HashSet from a Set\n * import { HashSet, pipe } from \"effect\"\n *\n * console.log(\n * pipe(\n * new Set([\"apple\", \"banana\", \"orange\", \"apple\"]), // Set<string> is an Iterable<string>\n * HashSet.fromIterable,\n * HashSet.toValues\n * )\n * ) // Output: [\"apple\", \"banana\", \"orange\"]\n * ```\n *\n * @example\n *\n * ```ts\n * // Creating a HashSet from a Generator\n * import { HashSet } from \"effect\"\n *\n * // Generator functions return iterables\n * function* fibonacci(n: number): Generator<number, void, unknown> {\n * let [a, b] = [0, 1]\n * for (let i = 0; i < n; i++) {\n * yield a\n * ;[a, b] = [b, a + b]\n * }\n * }\n *\n * // Create a HashSet from the first 10 Fibonacci numbers\n * const fibonacciSet = HashSet.fromIterable(fibonacci(10))\n *\n * console.log(HashSet.toValues(fibonacciSet))\n * // Outputs: [0, 1, 2, 3, 5, 8, 13, 21, 34] but in unsorted order\n * ```\n *\n * @example\n *\n * ```ts\n * // Creating a HashSet from another HashSet\n * import { HashSet, pipe } from \"effect\"\n *\n * console.log(\n * pipe(\n * // since HashSet implements the Iterable interface, we can use it to create a new HashSet\n * HashSet.make(1, 2, 3, 4),\n * HashSet.fromIterable,\n * HashSet.toValues // turns the HashSet back into an array\n * )\n * ) // Output: [1, 2, 3, 4]\n * ```\n *\n * @example\n *\n * ```ts\n * // Creating a HashSet from other Effect's data structures like Chunk\n * import { Chunk, HashSet, pipe } from \"effect\"\n *\n * console.log(\n * pipe(\n * Chunk.make(1, 2, 3, 4), // Iterable<number>\n * HashSet.fromIterable,\n * HashSet.toValues // turns the HashSet back into an array\n * )\n * ) // Outputs: [1, 2, 3, 4]\n * ```\n *\n * @see Other `HashSet` constructors are {@link module:HashSet.empty} {@link module:HashSet.make}\n */\nexport const fromIterable = HS.fromIterable;\n/**\n * Construct a new `HashSet` from a variable number of values.\n *\n * Time complexity: **`O(n)`** where n is the number of elements\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category constructors\n * @example\n *\n * ```ts\n * import { Equal, Hash, HashSet, pipe } from \"effect\"\n * import assert from \"node:assert/strict\"\n *\n * class Character implements Equal.Equal {\n * readonly name: string\n * readonly trait: string\n *\n * constructor(name: string, trait: string) {\n * this.name = name\n * this.trait = trait\n * }\n *\n * // Define equality based on name, and trait\n * [Equal.symbol](that: Equal.Equal): boolean {\n * if (that instanceof Character) {\n * return (\n * Equal.equals(this.name, that.name) &&\n * Equal.equals(this.trait, that.trait)\n * )\n * }\n * return false\n * }\n *\n * // Generate a hash code based on the sum of the character's name and trait\n * [Hash.symbol](): number {\n * return Hash.hash(this.name + this.trait)\n * }\n *\n * static readonly of = (name: string, trait: string): Character => {\n * return new Character(name, trait)\n * }\n * }\n *\n * assert.strictEqual(\n * Equal.equals(\n * HashSet.make(\n * Character.of(\"Alice\", \"Curious\"),\n * Character.of(\"Alice\", \"Curious\"),\n * Character.of(\"White Rabbit\", \"Always late\"),\n * Character.of(\"Mad Hatter\", \"Tea enthusiast\")\n * ),\n * // Is the same as adding each character to an empty set\n * pipe(\n * HashSet.empty(),\n * HashSet.add(Character.of(\"Alice\", \"Curious\")),\n * HashSet.add(Character.of(\"Alice\", \"Curious\")), // Alice tried to attend twice!\n * HashSet.add(Character.of(\"White Rabbit\", \"Always late\")),\n * HashSet.add(Character.of(\"Mad Hatter\", \"Tea enthusiast\"))\n * )\n * ),\n * true,\n * \"`HashSet.make` and `HashSet.empty() + HashSet.add()` should be equal\"\n * )\n *\n * assert.strictEqual(\n * Equal.equals(\n * HashSet.make(\n * Character.of(\"Alice\", \"Curious\"),\n * Character.of(\"Alice\", \"Curious\"),\n * Character.of(\"White Rabbit\", \"Always late\"),\n * Character.of(\"Mad Hatter\", \"Tea enthusiast\")\n * ),\n * HashSet.fromIterable([\n * Character.of(\"Alice\", \"Curious\"),\n * Character.of(\"Alice\", \"Curious\"),\n * Character.of(\"White Rabbit\", \"Always late\"),\n * Character.of(\"Mad Hatter\", \"Tea enthusiast\")\n * ])\n * ),\n * true,\n * \"`HashSet.make` and `HashSet.fromIterable` should be equal\"\n * )\n * ```\n *\n * @see Other `HashSet` constructors are {@link module:HashSet.fromIterable} {@link module:HashSet.empty}\n */\nexport const make = HS.make;\n/**\n * Checks if the specified value exists in the `HashSet`.\n *\n * Time complexity: **`O(1)`** average\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category elements\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(HashSet.make(0, 1, 2), HashSet.has(3)) // false\n *\n * // or piped with the pipe function\n * HashSet.make(0, 1, 2).pipe(HashSet.has(3)) // false\n *\n * // or with `data-first` API\n * HashSet.has(HashSet.make(0, 1, 2), 3) // false\n * ```\n *\n * @returns A `boolean` signaling the presence of the value in the HashSet\n * @see Other `HashSet` elements are {@link module:HashSet.some} {@link module:HashSet.every} {@link module:HashSet.isSubset}\n */\nexport const has = HS.has;\n/**\n * Check if a predicate holds true for some `HashSet` element.\n *\n * Time complexity: **`O(n)`** where n is the number of elements in the set\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category elements\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * const set: HashSet.HashSet<number> = HashSet.make(0, 1, 2)\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * set,\n * HashSet.some((n) => n > 0)\n * ) // true\n *\n * // or piped with the pipe function\n * set.pipe(HashSet.some((n) => n > 0)) // true\n *\n * // or with `data-first` API\n * HashSet.some(set, (n) => n > 0) // true\n * ```\n *\n * @see Other `HashSet` elements are {@link module:HashSet.has} {@link module:HashSet.every} {@link module:HashSet.isSubset}\n */\nexport const some = HS.some;\n/**\n * Check if a predicate holds true for every `HashSet` element.\n *\n * Time complexity is **`O(n)`** as it needs to traverse the whole HashSet\n * collection\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category elements\n * @example\n *\n * ```ts\n * // Syntax with Refinement\n * import { HashSet, pipe, Predicate } from \"effect\"\n *\n * const numberOrString = HashSet.make(1, \"1\", \"one\", \"uno\")\n *\n * // with `data-last`, a.k.a. `pipeable` API and `Refinement`\n * pipe(\n * numberOrString, // HashSet.HashSet<number | string>\n * HashSet.every(Predicate.isString)\n * ) // HashSet.HashSet<string>\n *\n * // or piped with the pipe function and `Refinement`\n * numberOrString // HashSet.HashSet<number | string>\n * .pipe(HashSet.every(Predicate.isString)) // HashSet.HashSet<string>\n *\n * // or with `data-first` API and `Refinement`\n * HashSet.every(\n * numberOrString, // HashSet.HashSet<number | string>\n * Predicate.isString\n * ) // HashSet.HashSet<string>\n * ```\n *\n * @example\n *\n * ```ts\n * // Syntax with Predicate\n * import { HashSet, pipe } from \"effect\"\n *\n * const set = HashSet.make(1, 2, 3)\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * set,\n * HashSet.every((n) => n >= 0)\n * ) // true\n *\n * // or piped with the pipe function\n * set.pipe(HashSet.every((n) => n >= 0)) // true\n *\n * // or with `data-first` API\n * HashSet.every(set, (n) => n >= 0) // true\n * ```\n *\n * @returns A boolean once it has evaluated that whole collection fulfill the\n * Predicate function\n * @see Other `HashSet` elements are {@link module:HashSet.has} {@link module:HashSet.some} {@link module:HashSet.isSubset}\n */\nexport const every = HS.every;\n/**\n * Returns `true` if and only if every element in the this `HashSet` is an\n * element of the second set,\n *\n * **NOTE**: the hash and equal of both sets must be the same.\n *\n * Time complexity analysis is of **`O(n)`**\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category elements\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * const set1 = HashSet.make(0, 1)\n * const set2 = HashSet.make(1, 2)\n * const set3 = HashSet.make(0, 1, 2)\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(set1, HashSet.isSubset(set2)) // false\n * pipe(set1, HashSet.isSubset(set3)) // true\n *\n * // or piped with the pipe function\n * set1.pipe(HashSet.isSubset(set2)) // false\n * set1.pipe(HashSet.isSubset(set3)) // true\n *\n * // or with `data-first` API\n * HashSet.isSubset(set1, set2) // false\n * HashSet.isSubset(set1, set3) // true)\n * ```\n *\n * @see Other `HashSet` elements are {@link module:HashSet.has} {@link module:HashSet.some} {@link module:HashSet.every}\n */\nexport const isSubset = HS.isSubset;\n/**\n * Returns an `IterableIterator` of the values in the `HashSet`.\n *\n * Time complexity: **`O(1)`**\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category getters\n * @example\n *\n * ```ts\n * import { HashSet, pipe } from \"effect\"\n *\n * const numberIterable = pipe(\n * HashSet.make(0, 1, 1, 2), // HashSet.HashSet<number>\n * HashSet.values // takes an HashSet<A> and returns an IterableIterator<A>\n * )\n *\n * for (const number of numberIterable) {\n * console.log(number) // it will logs: 0, 1, 2\n * }\n * ```\n *\n * @see Other `HashSet` getters are {@link module:HashSet.toValues} {@link module:HashSet.size}\n */\nexport const values = HS.values;\n/**\n * Returns an `Array` of the values within the `HashSet`.\n *\n * Time complexity: **`O(n)`** where n is the number of elements in the set\n *\n * @memberof HashSet\n * @since 3.13.0\n * @category getters\n * @example\n *\n * ```ts\n * import { HashSet, pipe } from \"effect\"\n * import { deepStrictEqual } from \"node:assert/strict\"\n *\n * deepStrictEqual(\n * pipe(\n * HashSet.make(0, 1, 1, 2), // HashSet<number>\n * HashSet.toValues // takes an HashSet<A> and returns an Array<A>\n * ),\n * Array.of(0, 1, 2)\n * )\n * ```\n *\n * @see Other `HashSet` getters are {@link module:HashSet.values} {@link module:HashSet.size}\n */\nexport const toValues = self => Array.from(values(self));\n/**\n * Calculates the number of values in the `HashSet`.\n *\n * Time complexity: **`O(1)`**\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category getters\n * @example\n *\n * ```ts\n * import { HashSet, pipe } from \"effect\"\n * import assert from \"node:assert/strict\"\n *\n * assert.deepStrictEqual(pipe(HashSet.empty(), HashSet.size), 0)\n *\n * assert.deepStrictEqual(\n * pipe(HashSet.make(1, 2, 2, 3, 4, 3), HashSet.size),\n * 4\n * )\n * ```\n *\n * @see Other `HashSet` getters are {@link module:HashSet.values} {@link module:HashSet.toValues}\n */\nexport const size = HS.size;\n/**\n * Creates a new mutable version of the `HashSet`\n *\n * When a `HashSet` is mutable, operations like {@link add} and {@link remove}\n * modify the data structure in place instead of creating a new one, which is\n * more efficient when performing multiple operations.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * import { HashSet } from \"effect\"\n * import assert from \"node:assert/strict\"\n *\n * const UPPER_BOUND = 10_000\n *\n * const immutableSet = HashSet.empty<number>().pipe(HashSet.add(0))\n *\n * // Create a mutable version of the immutableSet\n * const mutableSet = HashSet.beginMutation(immutableSet)\n *\n * for (let i = 1; i < UPPER_BOUND; i++) {\n * // Operations now modify the set in place instead of creating new instances\n * // This is more efficient when making multiple changes\n * const pointerToMutableSet = HashSet.add(mutableSet, i)\n *\n * // the two sets have the same identity, hence `add` is mutating mutableSet and not returning a new HashSet instance\n * assert(Object.is(mutableSet, pointerToMutableSet))\n * assert.equal(HashSet.has(mutableSet, i), true) // `i` is in the mutableSet\n * assert.equal(HashSet.has(immutableSet, i), false) // `i` is not in the immutableSet\n * }\n *\n * const next = UPPER_BOUND + 1\n * // When done, mark the set as immutable again\n * HashSet.endMutation(mutableSet).pipe(\n * HashSet.add(next) // since this returns a new HashSet, it will not be logged as part of the mutableSet\n * )\n * assert.equal(HashSet.has(mutableSet, next), false)\n *\n * console.log(HashSet.toValues(immutableSet)) // [0]\n * console.log(HashSet.toValues(mutableSet).sort((a, b) => a - b)) // [0, 1, 2, 3, ...rest]\n * ```\n *\n * @see Other `HashSet` mutations are {@link module:HashSet.add} {@link module:HashSet.remove} {@link module:HashSet.toggle} {@link module:HashSet.endMutation} {@link module:HashSet.mutate}\n */\nexport const beginMutation = HS.beginMutation;\n/**\n * Makes the `HashSet` immutable again.\n *\n * After calling `endMutation`, operations like {@link add} and {@link remove}\n * will create new instances of the `HashSet` instead of modifying the existing\n * one.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * import { HashSet } from \"effect\"\n * import assert from \"node:assert/strict\"\n *\n * // Create a mutable set\n * const mutableSet = HashSet.beginMutation(HashSet.empty<number>())\n *\n * // Add some elements to the mutable set\n * HashSet.add(mutableSet, 1)\n * HashSet.add(mutableSet, 2)\n *\n * // Before endMutation, operations modify the set in place\n * const sameSet = HashSet.add(mutableSet, 3)\n * assert(Object.is(mutableSet, sameSet)) // true - same object reference\n * assert.deepStrictEqual(HashSet.toValues(mutableSet).sort(), [1, 2, 3])\n *\n * // Make the set immutable again\n * const immutableSet = HashSet.endMutation(mutableSet)\n *\n * // endMutation returns the same set instance, now made immutable\n * assert(Object.is(mutableSet, immutableSet)) // true - same object reference\n *\n * // After endMutation, operations create new instances\n * const newSet = HashSet.add(immutableSet, 4)\n * assert(!Object.is(immutableSet, newSet)) // false - different object references\n *\n * // The original set remains unchanged\n * assert.deepStrictEqual(HashSet.toValues(immutableSet).sort(), [1, 2, 3])\n *\n * // The new set contains the added element\n * assert.deepStrictEqual(HashSet.toValues(newSet).sort(), [1, 2, 3, 4])\n * ```\n *\n * @see Other `HashSet` mutations are {@link module:HashSet.add} {@link module:HashSet.remove} {@link module:HashSet.toggle} {@link module:HashSet.beginMutation} {@link module:HashSet.mutate}\n */\nexport const endMutation = HS.endMutation;\n/**\n * Mutates the `HashSet` within the context of the provided function.\n *\n * You can consider it a functional abstraction on top of the lower-level\n * mutation primitives of {@link module:HashSet.beginMutation} `->` `mutable\n * context` `->` {@link HashSet.endMutation}.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with data-last, a.k.a. pipeable API\n * pipe(\n * HashSet.make(1, 2, 3),\n * HashSet.mutate((set) => {\n * HashSet.add(set, 4)\n * HashSet.remove(set, 1)\n * })\n * )\n *\n * // or piped with the pipe function\n * HashSet.make(1, 2, 3).pipe(\n * HashSet.mutate((set) => {\n * HashSet.add(set, 4)\n * HashSet.remove(set, 1)\n * })\n * )\n *\n * // or with data-first API\n * HashSet.mutate(HashSet.make(1, 2, 3), (set) => {\n * HashSet.add(set, 4)\n * HashSet.remove(set, 1)\n * })\n * ```\n *\n * @see Other `HashSet` mutations are {@link module:HashSet.add} {@link module:HashSet.remove} {@link module:HashSet.toggle} {@link module:HashSet.beginMutation} {@link module:HashSet.endMutation}\n */\nexport const mutate = HS.mutate;\n/**\n * Adds a value to the `HashSet`.\n *\n * Time complexity: **`O(1)`** average\n *\n * @remarks\n * Remember that a `HashSet` is a collection of unique values, so adding a value\n * that already exists in the `HashSet` will not add a duplicate.\n *\n * Remember that HashSet is an immutable data structure, so the `add` function,\n * like all other functions that modify the HashSet, will return a new HashSet\n * with the added value.\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with data-last, a.k.a. pipeable API\n * pipe(HashSet.empty(), HashSet.add(0), HashSet.add(0))\n *\n * // or piped with the pipe function\n * HashSet.empty().pipe(HashSet.add(0))\n *\n * // or with data-first API\n * HashSet.add(HashSet.empty(), 0)\n * ```\n *\n * @see Other `HashSet` mutations are {@link module:HashSet.remove} {@link module:HashSet.toggle} {@link module:HashSet.beginMutation} {@link module:HashSet.endMutation} {@link module:HashSet.mutate}\n */\nexport const add = HS.add;\n/**\n * Removes a value from the `HashSet`.\n *\n * Time complexity: **`O(1)`** average\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(HashSet.make(0, 1, 2), HashSet.remove(0))\n *\n * // or piped with the pipe function\n * HashSet.make(0, 1, 2).pipe(HashSet.remove(0))\n *\n * // or with `data-first` API\n * HashSet.remove(HashSet.make(0, 1, 2), 0)\n * ```\n *\n * @see Other `HashSet` mutations are {@link module:HashSet.add} {@link module:HashSet.toggle} {@link module:HashSet.beginMutation} {@link module:HashSet.endMutation} {@link module:HashSet.mutate}\n */\nexport const remove = HS.remove;\n/**\n * Computes the set difference `(A - B)` between this `HashSet` and the\n * specified `Iterable<A>`.\n *\n * Time complexity: **`O(n)`** where n is the number of elements in the set\n *\n * **NOTE**: the hash and equal of the values in both the set and the iterable\n * must be the same; meaning we cannot compute a difference between a `HashSet\n * of bananas` and a `HashSet of elephants` as they are not the same type and\n * won't implement the Equal trait in the same way.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with data-last, a.k.a. pipeable API\n * pipe(HashSet.make(1, 2, 3), HashSet.difference(HashSet.make(3, 4, 5)))\n *\n * // or piped with the pipe function\n * HashSet.make(1, 2, 3).pipe(HashSet.difference(HashSet.make(3, 4, 5)))\n *\n * // or with data-first API\n * HashSet.difference(HashSet.make(1, 2, 3), HashSet.make(3, 4, 5))\n * ```\n *\n * @see Other `HashSet` operations are {@link module:HashSet.intersection} {@link module:HashSet.union}\n */\nexport const difference = HS.difference;\n/**\n * Returns a `HashSet` of values which are present in both this set and that\n * `Iterable<A>`. Computes set intersection (A ∩ B)\n *\n * Time complexity: **`O(n)`** where n is the number of elements in the smaller\n * set\n *\n * **NOTE**: the hash and equal of the values in both the set and the iterable\n * must be the same.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with data-last, a.k.a. pipeable API\n * pipe(HashSet.make(1, 2, 3), HashSet.intersection(HashSet.make(2, 3, 4)))\n *\n * // or piped with the pipe function\n * HashSet.make(1, 2, 3).pipe(HashSet.intersection(HashSet.make(2, 3, 4)))\n *\n * // or with data-first API\n * HashSet.intersection(HashSet.make(1, 2, 3), HashSet.make(2, 3, 4))\n * ```\n *\n * @see Other `HashSet` operations are {@link module:HashSet.difference} {@link module:HashSet.union}\n */\nexport const intersection = HS.intersection;\n/**\n * Computes the set union `( self ∪ that )` between this `HashSet` and the\n * specified `Iterable<A>`.\n *\n * Time complexity: **`O(n)`** where n is the number of elements in the set\n *\n * **NOTE**: the hash and equal of the values in both the set and the iterable\n * must be the same.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with data-last, a.k.a. pipeable API\n * pipe(HashSet.make(1, 2, 3), HashSet.union(HashSet.make(3, 4, 5)))\n *\n * // or piped with the pipe function\n * HashSet.make(1, 2, 3).pipe(HashSet.union(HashSet.make(3, 4, 5)))\n *\n * // or with data-first API\n * HashSet.union(HashSet.make(1, 2, 3), HashSet.make(3, 4, 5))\n * ```\n *\n * @see Other `HashSet` operations are {@link module:HashSet.difference} {@link module:HashSet.intersection}\n */\nexport const union = HS.union;\n/**\n * Checks if a value is present in the `HashSet`. If it is present, the value\n * will be removed from the `HashSet`, otherwise the value will be added to the\n * `HashSet`.\n *\n * Time complexity: **`O(1)`** average\n *\n * @memberof HashSet\n * @since 2.0.0\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(HashSet.make(0, 1, 2), HashSet.toggle(0))\n *\n * // or piped with the pipe function\n * HashSet.make(0, 1, 2).pipe(HashSet.toggle(0))\n *\n * // or with `data-first` API\n * HashSet.toggle(HashSet.make(0, 1, 2), 0)\n * ```\n *\n * @returns A new `HashSet` where the toggled value is being either added or\n * removed based on the initial `HashSet` state.\n * @see Other `HashSet` mutations are {@link module:HashSet.add} {@link module:HashSet.remove} {@link module:HashSet.beginMutation} {@link module:HashSet.endMutation} {@link module:HashSet.mutate}\n */\nexport const toggle = HS.toggle;\n/**\n * Maps over the values of the `HashSet` using the specified function.\n *\n * The time complexity is of **`O(n)`**.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category mapping\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * HashSet.make(0, 1, 2), // HashSet.HashSet<number>\n * HashSet.map(String) // HashSet.HashSet<string>\n * )\n *\n * // or piped with the pipe method\n * HashSet.make(0, 1, 2).pipe(HashSet.map(String))\n *\n * // or with `data-first` API\n * HashSet.map(HashSet.make(0, 1, 2), String)\n * ```\n */\nexport const map = HS.map;\n/**\n * Chains over the values of the `HashSet` using the specified function.\n *\n * The time complexity is of **`O(n)`**.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category sequencing\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * HashSet.make(0, 1, 2), // HashSet.HashSet<number>\n * HashSet.flatMap((n) => Array.of(String(n))) // HashSet.HashSet<string>\n * )\n *\n * // or piped with the pipe method\n * HashSet.make(0, 1, 2) // HashSet.HashSet<number>\n * .pipe(\n * HashSet.flatMap((n) => Array.of(String(n))) // HashSet.HashSet<string>\n * )\n *\n * // or with `data-first` API\n * HashSet.flatMap(HashSet.make(0, 1, 2), (n) => Array.of(String(n)))\n * ```\n */\nexport const flatMap = HS.flatMap;\n/**\n * Applies the specified function to the values of the `HashSet`.\n *\n * The time complexity is of **`O(n)`**.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category traversing\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(HashSet.make(0, 1, 2), HashSet.forEach(console.log)) // logs: 0 1 2\n *\n * // or piped with the pipe method\n * HashSet.make(0, 1, 2).pipe(HashSet.forEach(console.log)) // logs: 0 1 2\n *\n * // or with `data-first` API\n * HashSet.forEach(HashSet.make(0, 1, 2), console.log) // logs: 0 1 2\n * ```\n */\nexport const forEach = HS.forEach;\n/**\n * Reduces the specified state over the values of the `HashSet`.\n *\n * The time complexity is of **`O(n)`**.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category folding\n * @example\n *\n * ```ts\n * // Syntax\n * import { HashSet, pipe } from \"effect\"\n *\n * const sum = (a: number, b: number): number => a + b\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(HashSet.make(0, 1, 2), HashSet.reduce(0, sum))\n *\n * // or with the pipe method\n * HashSet.make(0, 1, 2).pipe(HashSet.reduce(0, sum))\n *\n * // or with `data-first` API\n * HashSet.reduce(HashSet.make(0, 1, 2), 0, sum)\n * ```\n */\nexport const reduce = HS.reduce;\n/**\n * Filters values out of a `HashSet` using the specified predicate.\n *\n * The time complexity is of **`O(n)`**.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category filtering\n * @example\n *\n * ```ts\n * // Syntax with Predicate\n * import { HashSet, type Predicate, pipe } from \"effect\"\n *\n * const filterPositiveNumbers: Predicate.Predicate<number> = (n) => n > 0\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * HashSet.make(-2, -1, 0, 1, 2),\n * HashSet.filter(filterPositiveNumbers)\n * )\n *\n * // or with the pipe method\n * HashSet.make(-2, -1, 0, 1, 2).pipe(HashSet.filter(filterPositiveNumbers))\n *\n * // or with `data-first` API\n * HashSet.filter(HashSet.make(-2, -1, 0, 1, 2), filterPositiveNumbers)\n * ```\n *\n * @example\n *\n * ```ts\n * /// Syntax with Refinement\n * import { HashSet, pipe } from \"effect\"\n *\n * const stringRefinement = (value: unknown): value is string =>\n * typeof value === \"string\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * HashSet.make(1, \"unos\", 2, \"two\", 3, \"trois\", 4, \"vier\"), // // HashSet.HashSet<number | string>\n * HashSet.filter(stringRefinement)\n * ) // HashSet.HashSet<string>\n *\n * // or with the pipe method\n * HashSet.make(1, \"unos\", 2, \"two\", 3, \"trois\", 4, \"vier\") // HashSet.HashSet<number | string>\n * .pipe(HashSet.filter(stringRefinement)) // HashSet.HashSet<string>\n *\n * // or with `data-first` API\n * HashSet.filter(\n * HashSet.make(1, \"unos\", 2, \"two\", 3, \"trois\", 4, \"vier\"), // HashSet.HashSet<number | string>\n * stringRefinement\n * ) // HashSet.HashSet<string>\n * ```\n */\nexport const filter = HS.filter;\n/**\n * Partition the values of a `HashSet` using the specified predicate.\n *\n * If a value matches the predicate, it will be placed into the `HashSet` on the\n * right side of the resulting `Tuple`, otherwise the value will be placed into\n * the left side.\n *\n * Time complexity is of **`O(n)`**.\n *\n * @memberof HashSet\n * @since 2.0.0\n * @category partitioning\n * @example\n *\n * ```ts\n * // Syntax with Predicate\n * import { HashSet, pipe, Predicate } from \"effect\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * HashSet.make(0, 1, 2, 3, 4, 5),\n * HashSet.partition((n) => n % 2 === 0)\n * )\n *\n * // or with the pipe method\n * HashSet.make(0, 1, 2, 3, 4, 5).pipe(\n * HashSet.partition((n) => n % 2 === 0)\n * )\n *\n * // or with `data-first` API\n * HashSet.partition(HashSet.make(0, 1, 2, 3, 4, 5), (n) => n % 2 === 0)\n * ```\n *\n * @example\n *\n * ```ts\n * // Syntax with Refinement\n * import { HashSet, pipe, Predicate } from \"effect\"\n *\n * const stringRefinement: Predicate.Refinement<string | number, string> = (\n * value\n * ) => typeof value === \"string\"\n *\n * // with `data-last`, a.k.a. `pipeable` API\n * pipe(\n * HashSet.make(1, \"unos\", 2, \"two\", 3, \"trois\", 4, \"vier\"),\n * HashSet.partition(stringRefinement)\n * )\n *\n * // or with the pipe method\n * HashSet.make(1, \"unos\", 2, \"two\", 3, \"trois\", 4, \"vier\").pipe(\n * HashSet.partition(stringRefinement)\n * )\n *\n * // or with `data-first` API\n * HashSet.partition(\n * HashSet.make(1, \"unos\", 2, \"two\", 3, \"trois\", 4, \"vier\"),\n * stringRefinement\n * )\n * ```\n */\nexport const partition = HS.partition;\n//# sourceMappingURL=HashSet.js.map","/**\n * @since 2.0.0\n */\nimport * as Equal from \"./Equal.js\";\nimport * as Dual from \"./Function.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"./Inspectable.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nconst TypeId = /*#__PURE__*/Symbol.for(\"effect/MutableRef\");\nconst MutableRefProto = {\n [TypeId]: TypeId,\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"MutableRef\",\n current: toJSON(this.current)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const make = value => {\n const ref = Object.create(MutableRefProto);\n ref.current = value;\n return ref;\n};\n/**\n * @since 2.0.0\n * @category general\n */\nexport const compareAndSet = /*#__PURE__*/Dual.dual(3, (self, oldValue, newValue) => {\n if (Equal.equals(oldValue, self.current)) {\n self.current = newValue;\n return true;\n }\n return false;\n});\n/**\n * @since 2.0.0\n * @category numeric\n */\nexport const decrement = self => update(self, n => n - 1);\n/**\n * @since 2.0.0\n * @category numeric\n */\nexport const decrementAndGet = self => updateAndGet(self, n => n - 1);\n/**\n * @since 2.0.0\n * @category general\n */\nexport const get = self => self.current;\n/**\n * @since 2.0.0\n * @category numeric\n */\nexport const getAndDecrement = self => getAndUpdate(self, n => n - 1);\n/**\n * @since 2.0.0\n * @category numeric\n */\nexport const getAndIncrement = self => getAndUpdate(self, n => n + 1);\n/**\n * @since 2.0.0\n * @category general\n */\nexport const getAndSet = /*#__PURE__*/Dual.dual(2, (self, value) => {\n const ret = self.current;\n self.current = value;\n return ret;\n});\n/**\n * @since 2.0.0\n * @category general\n */\nexport const getAndUpdate = /*#__PURE__*/Dual.dual(2, (self, f) => getAndSet(self, f(get(self))));\n/**\n * @since 2.0.0\n * @category numeric\n */\nexport const increment = self => update(self, n => n + 1);\n/**\n * @since 2.0.0\n * @category numeric\n */\nexport const incrementAndGet = self => updateAndGet(self, n => n + 1);\n/**\n * @since 2.0.0\n * @category general\n */\nexport const set = /*#__PURE__*/Dual.dual(2, (self, value) => {\n self.current = value;\n return self;\n});\n/**\n * @since 2.0.0\n * @category general\n */\nexport const setAndGet = /*#__PURE__*/Dual.dual(2, (self, value) => {\n self.current = value;\n return self.current;\n});\n/**\n * @since 2.0.0\n * @category general\n */\nexport const update = /*#__PURE__*/Dual.dual(2, (self, f) => set(self, f(get(self))));\n/**\n * @since 2.0.0\n * @category general\n */\nexport const updateAndGet = /*#__PURE__*/Dual.dual(2, (self, f) => setAndGet(self, f(get(self))));\n/**\n * @since 2.0.0\n * @category boolean\n */\nexport const toggle = self => update(self, _ => !_);\n//# sourceMappingURL=MutableRef.js.map","import * as Equal from \"../Equal.js\";\nimport { dual, pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as Hash from \"../Hash.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport * as MutableRef from \"../MutableRef.js\";\nimport * as Option from \"../Option.js\";\nimport { hasProperty } from \"../Predicate.js\";\n/** @internal */\nconst FiberIdSymbolKey = \"effect/FiberId\";\n/** @internal */\nexport const FiberIdTypeId = /*#__PURE__*/Symbol.for(FiberIdSymbolKey);\n/** @internal */\nconst OP_NONE = \"None\";\n/** @internal */\nconst OP_RUNTIME = \"Runtime\";\n/** @internal */\nconst OP_COMPOSITE = \"Composite\";\nconst emptyHash = /*#__PURE__*/Hash.string(`${FiberIdSymbolKey}-${OP_NONE}`);\n/** @internal */\nclass None {\n [FiberIdTypeId] = FiberIdTypeId;\n _tag = OP_NONE;\n id = -1;\n startTimeMillis = -1;\n [Hash.symbol]() {\n return emptyHash;\n }\n [Equal.symbol](that) {\n return isFiberId(that) && that._tag === OP_NONE;\n }\n toString() {\n return format(this.toJSON());\n }\n toJSON() {\n return {\n _id: \"FiberId\",\n _tag: this._tag\n };\n }\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n}\n/** @internal */\nclass Runtime {\n id;\n startTimeMillis;\n [FiberIdTypeId] = FiberIdTypeId;\n _tag = OP_RUNTIME;\n constructor(id, startTimeMillis) {\n this.id = id;\n this.startTimeMillis = startTimeMillis;\n }\n [Hash.symbol]() {\n return Hash.cached(this, Hash.string(`${FiberIdSymbolKey}-${this._tag}-${this.id}-${this.startTimeMillis}`));\n }\n [Equal.symbol](that) {\n return isFiberId(that) && that._tag === OP_RUNTIME && this.id === that.id && this.startTimeMillis === that.startTimeMillis;\n }\n toString() {\n return format(this.toJSON());\n }\n toJSON() {\n return {\n _id: \"FiberId\",\n _tag: this._tag,\n id: this.id,\n startTimeMillis: this.startTimeMillis\n };\n }\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n}\n/** @internal */\nclass Composite {\n left;\n right;\n [FiberIdTypeId] = FiberIdTypeId;\n _tag = OP_COMPOSITE;\n constructor(left, right) {\n this.left = left;\n this.right = right;\n }\n _hash;\n [Hash.symbol]() {\n return pipe(Hash.string(`${FiberIdSymbolKey}-${this._tag}`), Hash.combine(Hash.hash(this.left)), Hash.combine(Hash.hash(this.right)), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isFiberId(that) && that._tag === OP_COMPOSITE && Equal.equals(this.left, that.left) && Equal.equals(this.right, that.right);\n }\n toString() {\n return format(this.toJSON());\n }\n toJSON() {\n return {\n _id: \"FiberId\",\n _tag: this._tag,\n left: toJSON(this.left),\n right: toJSON(this.right)\n };\n }\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n}\n/** @internal */\nexport const none = /*#__PURE__*/new None();\n/** @internal */\nexport const runtime = (id, startTimeMillis) => {\n return new Runtime(id, startTimeMillis);\n};\n/** @internal */\nexport const composite = (left, right) => {\n return new Composite(left, right);\n};\n/** @internal */\nexport const isFiberId = self => hasProperty(self, FiberIdTypeId);\n/** @internal */\nexport const isNone = self => {\n return self._tag === OP_NONE || pipe(toSet(self), HashSet.every(id => isNone(id)));\n};\n/** @internal */\nexport const isRuntime = self => {\n return self._tag === OP_RUNTIME;\n};\n/** @internal */\nexport const isComposite = self => {\n return self._tag === OP_COMPOSITE;\n};\n/** @internal */\nexport const combine = /*#__PURE__*/dual(2, (self, that) => {\n if (self._tag === OP_NONE) {\n return that;\n }\n if (that._tag === OP_NONE) {\n return self;\n }\n return new Composite(self, that);\n});\n/** @internal */\nexport const combineAll = fiberIds => {\n return pipe(fiberIds, HashSet.reduce(none, (a, b) => combine(b)(a)));\n};\n/** @internal */\nexport const getOrElse = /*#__PURE__*/dual(2, (self, that) => isNone(self) ? that : self);\n/** @internal */\nexport const ids = self => {\n switch (self._tag) {\n case OP_NONE:\n {\n return HashSet.empty();\n }\n case OP_RUNTIME:\n {\n return HashSet.make(self.id);\n }\n case OP_COMPOSITE:\n {\n return pipe(ids(self.left), HashSet.union(ids(self.right)));\n }\n }\n};\nconst _fiberCounter = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Fiber/Id/_fiberCounter\"), () => MutableRef.make(0));\n/** @internal */\nexport const make = (id, startTimeSeconds) => {\n return new Runtime(id, startTimeSeconds);\n};\n/** @internal */\nexport const threadName = self => {\n const identifiers = Array.from(ids(self)).map(n => `#${n}`).join(\",\");\n return identifiers;\n};\n/** @internal */\nexport const toOption = self => {\n const fiberIds = toSet(self);\n if (HashSet.size(fiberIds) === 0) {\n return Option.none();\n }\n let first = true;\n let acc;\n for (const fiberId of fiberIds) {\n if (first) {\n acc = fiberId;\n first = false;\n } else {\n // @ts-expect-error\n acc = pipe(acc, combine(fiberId));\n }\n }\n // @ts-expect-error\n return Option.some(acc);\n};\n/** @internal */\nexport const toSet = self => {\n switch (self._tag) {\n case OP_NONE:\n {\n return HashSet.empty();\n }\n case OP_RUNTIME:\n {\n return HashSet.make(self);\n }\n case OP_COMPOSITE:\n {\n return pipe(toSet(self.left), HashSet.union(toSet(self.right)));\n }\n }\n};\n/** @internal */\nexport const unsafeMake = () => {\n const id = MutableRef.get(_fiberCounter);\n pipe(_fiberCounter, MutableRef.set(id + 1));\n return new Runtime(id, Date.now());\n};\n//# sourceMappingURL=fiberId.js.map","import * as internal from \"./internal/fiberId.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const FiberIdTypeId = internal.FiberIdTypeId;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const none = internal.none;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const runtime = internal.runtime;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const composite = internal.composite;\n/**\n * Returns `true` if the specified unknown value is a `FiberId`, `false`\n * otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isFiberId = internal.isFiberId;\n/**\n * Returns `true` if the `FiberId` is a `None`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isNone = internal.isNone;\n/**\n * Returns `true` if the `FiberId` is a `Runtime`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isRuntime = internal.isRuntime;\n/**\n * Returns `true` if the `FiberId` is a `Composite`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isComposite = internal.isComposite;\n/**\n * Combine two `FiberId`s.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const combine = internal.combine;\n/**\n * Combines a set of `FiberId`s into a single `FiberId`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const combineAll = internal.combineAll;\n/**\n * Returns this `FiberId` if it is not `None`, otherwise returns that `FiberId`.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const getOrElse = internal.getOrElse;\n/**\n * Get the set of identifiers for this `FiberId`.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const ids = internal.ids;\n/**\n * Creates a new `FiberId`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * Creates a string representing the name of the current thread of execution\n * represented by the specified `FiberId`.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const threadName = internal.threadName;\n/**\n * Convert a `FiberId` into an `Option<FiberId>`.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const toOption = internal.toOption;\n/**\n * Convert a `FiberId` into a `HashSet<FiberId>`.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const toSet = internal.toSet;\n/**\n * Unsafely creates a new `FiberId`.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeMake = internal.unsafeMake;\n//# sourceMappingURL=FiberId.js.map","/**\n * @since 2.0.0\n */\nimport * as HM from \"./internal/hashMap.js\";\nimport * as keySet_ from \"./internal/hashMap/keySet.js\";\nconst TypeId = HM.HashMapTypeId;\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isHashMap = HM.isHashMap;\n/**\n * Creates a new `HashMap`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = HM.empty;\n/**\n * Constructs a new `HashMap` from an array of key/value pairs.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = HM.make;\n/**\n * Creates a new `HashMap` from an iterable collection of key/value pairs.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const fromIterable = HM.fromIterable;\n/**\n * Checks if the `HashMap` contains any entries.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const isEmpty = HM.isEmpty;\n/**\n * Safely lookup the value for the specified key in the `HashMap` using the\n * internal hashing function.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const get = HM.get;\n/**\n * Lookup the value for the specified key in the `HashMap` using a custom hash.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const getHash = HM.getHash;\n/**\n * Unsafely lookup the value for the specified key in the `HashMap` using the\n * internal hashing function.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeGet = HM.unsafeGet;\n/**\n * Checks if the specified key has an entry in the `HashMap`.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const has = HM.has;\n/**\n * Checks if the specified key has an entry in the `HashMap` using a custom\n * hash.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const hasHash = HM.hasHash;\n/**\n * Checks if an element matching the given predicate exists in the given `HashMap`.\n *\n * @example\n * ```ts\n * import { HashMap } from \"effect\"\n *\n * const hm = HashMap.make([1, 'a'])\n * HashMap.hasBy(hm, (value, key) => value === 'a' && key === 1); // -> true\n * HashMap.hasBy(hm, (value) => value === 'b'); // -> false\n *\n * ```\n *\n * @since 3.16.0\n * @category elements\n */\nexport const hasBy = HM.hasBy;\n/**\n * Sets the specified key to the specified value using the internal hashing\n * function.\n *\n * @since 2.0.0\n */\nexport const set = HM.set;\n/**\n * Returns an `IterableIterator` of the keys within the `HashMap`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const keys = HM.keys;\n/**\n * Returns a `HashSet` of keys within the `HashMap`.\n *\n * @since 2.0.0\n * @category getter\n */\nexport const keySet = keySet_.keySet;\n/**\n * Returns an `IterableIterator` of the values within the `HashMap`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const values = HM.values;\n/**\n * Returns an `Array` of the values within the `HashMap`.\n *\n * @since 3.13.0\n * @category getters\n */\nexport const toValues = self => Array.from(values(self));\n/**\n * Returns an `IterableIterator` of the entries within the `HashMap`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const entries = HM.entries;\n/**\n * Returns an `Array<[K, V]>` of the entries within the `HashMap`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const toEntries = self => Array.from(entries(self));\n/**\n * Returns the number of entries within the `HashMap`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const size = HM.size;\n/**\n * Counts all the element of the given HashMap that pass the given predicate\n *\n * **Example**\n *\n * ```ts\n * import { HashMap } from \"effect\"\n *\n * const map = HashMap.make([1, \"a\"], [2, \"b\"], [3, \"c\"])\n * const result = HashMap.countBy(map, (_v, key) => key % 2 === 1)\n * console.log(result) // 2\n * ```\n *\n * @since 3.17.0\n * @category folding\n */\nexport const countBy = HM.countBy;\n/**\n * Marks the `HashMap` as mutable.\n *\n * @since 2.0.0\n */\nexport const beginMutation = HM.beginMutation;\n/**\n * Marks the `HashMap` as immutable.\n *\n * @since 2.0.0\n */\nexport const endMutation = HM.endMutation;\n/**\n * Mutates the `HashMap` within the context of the provided function.\n *\n * @since 2.0.0\n */\nexport const mutate = HM.mutate;\n/**\n * Set or remove the specified key in the `HashMap` using the specified\n * update function. The value of the specified key will be computed using the\n * provided hash.\n *\n * The update function will be invoked with the current value of the key if it\n * exists, or `None` if no such value exists.\n *\n * @since 2.0.0\n */\nexport const modifyAt = HM.modifyAt;\n/**\n * Alter the value of the specified key in the `HashMap` using the specified\n * update function. The value of the specified key will be computed using the\n * provided hash.\n *\n * The update function will be invoked with the current value of the key if it\n * exists, or `None` if no such value exists.\n *\n * This function will always either update or insert a value into the `HashMap`.\n *\n * @since 2.0.0\n */\nexport const modifyHash = HM.modifyHash;\n/**\n * Updates the value of the specified key within the `HashMap` if it exists.\n *\n * @since 2.0.0\n */\nexport const modify = HM.modify;\n/**\n * Performs a union of this `HashMap` and that `HashMap`.\n *\n * @since 2.0.0\n */\nexport const union = HM.union;\n/**\n * Remove the entry for the specified key in the `HashMap` using the internal\n * hashing function.\n *\n * @since 2.0.0\n */\nexport const remove = HM.remove;\n/**\n * Removes all entries in the `HashMap` which have the specified keys.\n *\n * @since 2.0.0\n */\nexport const removeMany = HM.removeMany;\n/**\n * Maps over the entries of the `HashMap` using the specified function.\n *\n * @since 2.0.0\n * @category mapping\n */\nexport const map = HM.map;\n/**\n * Chains over the entries of the `HashMap` using the specified function.\n *\n * **NOTE**: the hash and equal of both maps have to be the same.\n *\n * @since 2.0.0\n * @category sequencing\n */\nexport const flatMap = HM.flatMap;\n/**\n * Applies the specified function to the entries of the `HashMap`.\n *\n * @since 2.0.0\n * @category traversing\n */\nexport const forEach = HM.forEach;\n/**\n * Reduces the specified state over the entries of the `HashMap`.\n *\n * @since 2.0.0\n * @category folding\n */\nexport const reduce = HM.reduce;\n/**\n * Filters entries out of a `HashMap` using the specified predicate.\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const filter = HM.filter;\n/**\n * Filters out `None` values from a `HashMap` of `Options`s.\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const compact = HM.compact;\n/**\n * Maps over the entries of the `HashMap` using the specified partial function\n * and filters out `None` values.\n *\n * @since 2.0.0\n * @category filtering\n */\nexport const filterMap = HM.filterMap;\n/**\n * Returns the first element that satisfies the specified\n * predicate, or `None` if no such element exists.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findFirst = HM.findFirst;\n/**\n * Checks if any entry in a hashmap meets a specific condition.\n *\n * @since 3.13.0\n * @category elements\n */\nexport const some = HM.some;\n/**\n * Checks if all entries in a hashmap meets a specific condition.\n *\n * @param self - The hashmap to check.\n * @param predicate - The condition to test entries (value, key).\n *\n * @since 3.14.0\n * @category elements\n */\nexport const every = HM.every;\n//# sourceMappingURL=HashMap.js.map","/**\n * A data type for immutable linked lists representing ordered collections of elements of type `A`.\n *\n * This data type is optimal for last-in-first-out (LIFO), stack-like access patterns. If you need another access pattern, for example, random access or FIFO, consider using a collection more suited to this than `List`.\n *\n * **Performance**\n *\n * - Time: `List` has `O(1)` prepend and head/tail access. Most other operations are `O(n)` on the number of elements in the list. This includes the index-based lookup of elements, `length`, `append` and `reverse`.\n * - Space: `List` implements structural sharing of the tail list. This means that many operations are either zero- or constant-memory cost.\n *\n * @since 2.0.0\n */\n/**\n * This file is ported from\n *\n * Scala (https://www.scala-lang.org)\n *\n * Copyright EPFL and Lightbend, Inc.\n *\n * Licensed under Apache License 2.0\n * (http://www.apache.org/licenses/LICENSE-2.0).\n */\nimport * as Arr from \"./Array.js\";\nimport * as Chunk from \"./Chunk.js\";\nimport * as Either from \"./Either.js\";\nimport * as Equal from \"./Equal.js\";\nimport * as Equivalence from \"./Equivalence.js\";\nimport { dual, identity, unsafeCoerce } from \"./Function.js\";\nimport * as Hash from \"./Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"./Inspectable.js\";\nimport * as Option from \"./Option.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nimport { hasProperty } from \"./Predicate.js\";\n/**\n * @since 2.0.0\n * @category symbol\n */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/List\");\n/**\n * Converts the specified `List` to an `Array`.\n *\n * @category conversions\n * @since 2.0.0\n */\nexport const toArray = self => Arr.fromIterable(self);\n/**\n * @category equivalence\n * @since 2.0.0\n */\nexport const getEquivalence = isEquivalent => Equivalence.mapInput(Arr.getEquivalence(isEquivalent), toArray);\nconst _equivalence = /*#__PURE__*/getEquivalence(Equal.equals);\nconst ConsProto = {\n [TypeId]: TypeId,\n _tag: \"Cons\",\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"List\",\n _tag: \"Cons\",\n values: toArray(this).map(toJSON)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n [Equal.symbol](that) {\n return isList(that) && this._tag === that._tag && _equivalence(this, that);\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.array(toArray(this)));\n },\n [Symbol.iterator]() {\n let done = false;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let self = this;\n return {\n next() {\n if (done) {\n return this.return();\n }\n if (self._tag === \"Nil\") {\n done = true;\n return this.return();\n }\n const value = self.head;\n self = self.tail;\n return {\n done,\n value\n };\n },\n return(value) {\n if (!done) {\n done = true;\n }\n return {\n done: true,\n value\n };\n }\n };\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst makeCons = (head, tail) => {\n const cons = Object.create(ConsProto);\n cons.head = head;\n cons.tail = tail;\n return cons;\n};\nconst NilHash = /*#__PURE__*/Hash.string(\"Nil\");\nconst NilProto = {\n [TypeId]: TypeId,\n _tag: \"Nil\",\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"List\",\n _tag: \"Nil\"\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n [Hash.symbol]() {\n return NilHash;\n },\n [Equal.symbol](that) {\n return isList(that) && this._tag === that._tag;\n },\n [Symbol.iterator]() {\n return {\n next() {\n return {\n done: true,\n value: undefined\n };\n }\n };\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nconst _Nil = /*#__PURE__*/Object.create(NilProto);\n/**\n * Returns `true` if the specified value is a `List`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isList = u => hasProperty(u, TypeId);\n/**\n * Returns `true` if the specified value is a `List.Nil<A>`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isNil = self => self._tag === \"Nil\";\n/**\n * Returns `true` if the specified value is a `List.Cons<A>`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isCons = self => self._tag === \"Cons\";\n/**\n * Returns the number of elements contained in the specified `List`\n *\n * @since 2.0.0\n * @category getters\n */\nexport const size = self => {\n let these = self;\n let len = 0;\n while (!isNil(these)) {\n len += 1;\n these = these.tail;\n }\n return len;\n};\n/**\n * Constructs a new empty `List<A>`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const nil = () => _Nil;\n/**\n * Constructs a new `List.Cons<A>` from the specified `head` and `tail` values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const cons = (head, tail) => makeCons(head, tail);\n/**\n * Constructs a new empty `List<A>`.\n *\n * Alias of {@link nil}.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = nil;\n/**\n * Constructs a new `List<A>` from the specified value.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const of = value => makeCons(value, _Nil);\n/**\n * Creates a new `List` from an iterable collection of values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const fromIterable = prefix => {\n const iterator = prefix[Symbol.iterator]();\n let next;\n if ((next = iterator.next()) && !next.done) {\n const result = makeCons(next.value, _Nil);\n let curr = result;\n while ((next = iterator.next()) && !next.done) {\n const temp = makeCons(next.value, _Nil);\n curr.tail = temp;\n curr = temp;\n }\n return result;\n } else {\n return _Nil;\n }\n};\n/**\n * Constructs a new `List<A>` from the specified values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = (...elements) => fromIterable(elements);\n/**\n * Appends the specified element to the end of the `List`, creating a new `Cons`.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const append = /*#__PURE__*/dual(2, (self, element) => appendAll(self, of(element)));\n/**\n * Concatenates two lists, combining their elements.\n * If either list is non-empty, the result is also a non-empty list.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { List } from \"effect\"\n *\n * assert.deepStrictEqual(\n * List.make(1, 2).pipe(List.appendAll(List.make(\"a\", \"b\")), List.toArray),\n * [1, 2, \"a\", \"b\"]\n * )\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const appendAll = /*#__PURE__*/dual(2, (self, that) => prependAll(that, self));\n/**\n * Prepends the specified element to the beginning of the list.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prepend = /*#__PURE__*/dual(2, (self, element) => cons(element, self));\n/**\n * Prepends the specified prefix list to the beginning of the specified list.\n * If either list is non-empty, the result is also a non-empty list.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { List } from \"effect\"\n *\n * assert.deepStrictEqual(\n * List.make(1, 2).pipe(List.prependAll(List.make(\"a\", \"b\")), List.toArray),\n * [\"a\", \"b\", 1, 2]\n * )\n * ```\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prependAll = /*#__PURE__*/dual(2, (self, prefix) => {\n if (isNil(self)) {\n return prefix;\n } else if (isNil(prefix)) {\n return self;\n } else {\n const result = makeCons(prefix.head, self);\n let curr = result;\n let that = prefix.tail;\n while (!isNil(that)) {\n const temp = makeCons(that.head, self);\n curr.tail = temp;\n curr = temp;\n that = that.tail;\n }\n return result;\n }\n});\n/**\n * Prepends the specified prefix list (in reverse order) to the beginning of the\n * specified list.\n *\n * @category concatenating\n * @since 2.0.0\n */\nexport const prependAllReversed = /*#__PURE__*/dual(2, (self, prefix) => {\n let out = self;\n let pres = prefix;\n while (isCons(pres)) {\n out = makeCons(pres.head, out);\n pres = pres.tail;\n }\n return out;\n});\n/**\n * Drops the first `n` elements from the specified list.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const drop = /*#__PURE__*/dual(2, (self, n) => {\n if (n <= 0) {\n return self;\n }\n if (n >= size(self)) {\n return _Nil;\n }\n let these = self;\n let i = 0;\n while (!isNil(these) && i < n) {\n these = these.tail;\n i += 1;\n }\n return these;\n});\n/**\n * Check if a predicate holds true for every `List` element.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const every = /*#__PURE__*/dual(2, (self, refinement) => {\n for (const a of self) {\n if (!refinement(a)) {\n return false;\n }\n }\n return true;\n});\n/**\n * Check if a predicate holds true for some `List` element.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const some = /*#__PURE__*/dual(2, (self, predicate) => {\n let these = self;\n while (!isNil(these)) {\n if (predicate(these.head)) {\n return true;\n }\n these = these.tail;\n }\n return false;\n});\n/**\n * Filters a list using the specified predicate.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const filter = /*#__PURE__*/dual(2, (self, predicate) => noneIn(self, predicate, false));\n// everything seen so far is not included\nconst noneIn = (self, predicate, isFlipped) => {\n while (true) {\n if (isNil(self)) {\n return _Nil;\n } else {\n if (predicate(self.head) !== isFlipped) {\n return allIn(self, self.tail, predicate, isFlipped);\n } else {\n self = self.tail;\n }\n }\n }\n};\n// everything from 'start' is included, if everything from this point is in we can return the origin\n// start otherwise if we discover an element that is out we must create a new partial list.\nconst allIn = (start, remaining, predicate, isFlipped) => {\n while (true) {\n if (isNil(remaining)) {\n return start;\n } else {\n if (predicate(remaining.head) !== isFlipped) {\n remaining = remaining.tail;\n } else {\n return partialFill(start, remaining, predicate, isFlipped);\n }\n }\n }\n};\n// we have seen elements that should be included then one that should be excluded, start building\nconst partialFill = (origStart, firstMiss, predicate, isFlipped) => {\n const newHead = makeCons(unsafeHead(origStart), _Nil);\n let toProcess = unsafeTail(origStart);\n let currentLast = newHead;\n // we know that all elements are :: until at least firstMiss.tail\n while (!(toProcess === firstMiss)) {\n const newElem = makeCons(unsafeHead(toProcess), _Nil);\n currentLast.tail = newElem;\n currentLast = unsafeCoerce(newElem);\n toProcess = unsafeCoerce(toProcess.tail);\n }\n // at this point newHead points to a list which is a duplicate of all the 'in' elements up to the first miss.\n // currentLast is the last element in that list.\n // now we are going to try and share as much of the tail as we can, only moving elements across when we have to.\n let next = firstMiss.tail;\n let nextToCopy = unsafeCoerce(next); // the next element we would need to copy to our list if we cant share.\n while (!isNil(next)) {\n // generally recommended is next.isNonEmpty but this incurs an extra method call.\n const head = unsafeHead(next);\n if (predicate(head) !== isFlipped) {\n next = next.tail;\n } else {\n // its not a match - do we have outstanding elements?\n while (!(nextToCopy === next)) {\n const newElem = makeCons(unsafeHead(nextToCopy), _Nil);\n currentLast.tail = newElem;\n currentLast = newElem;\n nextToCopy = unsafeCoerce(nextToCopy.tail);\n }\n nextToCopy = unsafeCoerce(next.tail);\n next = next.tail;\n }\n }\n // we have remaining elements - they are unchanged attach them to the end\n if (!isNil(nextToCopy)) {\n currentLast.tail = nextToCopy;\n }\n return newHead;\n};\n/**\n * Filters and maps a list using the specified partial function. The resulting\n * list may be smaller than the input list due to the possibility of the partial\n * function not being defined for some elements.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const filterMap = /*#__PURE__*/dual(2, (self, f) => {\n const bs = [];\n for (const a of self) {\n const oa = f(a);\n if (Option.isSome(oa)) {\n bs.push(oa.value);\n }\n }\n return fromIterable(bs);\n});\n/**\n * Removes all `None` values from the specified list.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const compact = self => filterMap(self, identity);\n/**\n * Returns the first element that satisfies the specified\n * predicate, or `None` if no such element exists.\n *\n * @category elements\n * @since 2.0.0\n */\nexport const findFirst = /*#__PURE__*/dual(2, (self, predicate) => {\n let these = self;\n while (!isNil(these)) {\n if (predicate(these.head)) {\n return Option.some(these.head);\n }\n these = these.tail;\n }\n return Option.none();\n});\n/**\n * Applies a function to each element in a list and returns a new list containing the concatenated mapped elements.\n *\n * @since 2.0.0\n * @category sequencing\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n let rest = self;\n let head = undefined;\n let tail = undefined;\n while (!isNil(rest)) {\n let bs = f(rest.head);\n while (!isNil(bs)) {\n const next = makeCons(bs.head, _Nil);\n if (tail === undefined) {\n head = next;\n } else {\n tail.tail = next;\n }\n tail = next;\n bs = bs.tail;\n }\n rest = rest.tail;\n }\n if (head === undefined) {\n return _Nil;\n }\n return head;\n});\n/**\n * Applies the specified function to each element of the `List`.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const forEach = /*#__PURE__*/dual(2, (self, f) => {\n let these = self;\n while (!isNil(these)) {\n f(these.head);\n these = these.tail;\n }\n});\n/**\n * Returns the first element of the specified list, or `None` if the list is\n * empty.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const head = self => isNil(self) ? Option.none() : Option.some(self.head);\n/**\n * Returns the last element of the specified list, or `None` if the list is\n * empty.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const last = self => isNil(self) ? Option.none() : Option.some(unsafeLast(self));\n/**\n * Applies the specified mapping function to each element of the list.\n *\n * @since 2.0.0\n * @category mapping\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => {\n if (isNil(self)) {\n return self;\n } else {\n let i = 0;\n const head = makeCons(f(self.head, i++), _Nil);\n let nextHead = head;\n let rest = self.tail;\n while (!isNil(rest)) {\n const next = makeCons(f(rest.head, i++), _Nil);\n nextHead.tail = next;\n nextHead = next;\n rest = rest.tail;\n }\n return head;\n }\n});\n/**\n * Partition a list into two lists, where the first list contains all elements\n * that did not satisfy the specified predicate, and the second list contains\n * all elements that did satisfy the specified predicate.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const partition = /*#__PURE__*/dual(2, (self, predicate) => {\n const left = [];\n const right = [];\n for (const a of self) {\n if (predicate(a)) {\n right.push(a);\n } else {\n left.push(a);\n }\n }\n return [fromIterable(left), fromIterable(right)];\n});\n/**\n * Partition a list into two lists, where the first list contains all elements\n * for which the specified function returned a `Left`, and the second list\n * contains all elements for which the specified function returned a `Right`.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const partitionMap = /*#__PURE__*/dual(2, (self, f) => {\n const left = [];\n const right = [];\n for (const a of self) {\n const e = f(a);\n if (Either.isLeft(e)) {\n left.push(e.left);\n } else {\n right.push(e.right);\n }\n }\n return [fromIterable(left), fromIterable(right)];\n});\n/**\n * Folds over the elements of the list using the specified function, using the\n * specified initial value.\n *\n * @since 2.0.0\n * @category folding\n */\nexport const reduce = /*#__PURE__*/dual(3, (self, zero, f) => {\n let acc = zero;\n let these = self;\n while (!isNil(these)) {\n acc = f(acc, these.head);\n these = these.tail;\n }\n return acc;\n});\n/**\n * Folds over the elements of the list using the specified function, beginning\n * with the last element of the list, using the specified initial value.\n *\n * @since 2.0.0\n * @category folding\n */\nexport const reduceRight = /*#__PURE__*/dual(3, (self, zero, f) => {\n let acc = zero;\n let these = reverse(self);\n while (!isNil(these)) {\n acc = f(acc, these.head);\n these = these.tail;\n }\n return acc;\n});\n/**\n * Returns a new list with the elements of the specified list in reverse order.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const reverse = self => {\n let result = empty();\n let these = self;\n while (!isNil(these)) {\n result = prepend(result, these.head);\n these = these.tail;\n }\n return result;\n};\n/**\n * Splits the specified list into two lists at the specified index.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const splitAt = /*#__PURE__*/dual(2, (self, n) => [take(self, n), drop(self, n)]);\n/**\n * Returns the tail of the specified list, or `None` if the list is empty.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const tail = self => isNil(self) ? Option.none() : Option.some(self.tail);\n/**\n * Takes the specified number of elements from the beginning of the specified\n * list.\n *\n * @since 2.0.0\n * @category combinators\n */\nexport const take = /*#__PURE__*/dual(2, (self, n) => {\n if (n <= 0) {\n return _Nil;\n }\n if (n >= size(self)) {\n return self;\n }\n let these = make(unsafeHead(self));\n let current = unsafeTail(self);\n for (let i = 1; i < n; i++) {\n these = makeCons(unsafeHead(current), these);\n current = unsafeTail(current);\n }\n return reverse(these);\n});\n/**\n * Converts the specified `List` to a `Chunk`.\n *\n * @since 2.0.0\n * @category conversions\n */\nexport const toChunk = self => Chunk.fromIterable(self);\nconst getExpectedListToBeNonEmptyErrorMessage = \"Expected List to be non-empty\";\n/**\n * Unsafely returns the first element of the specified `List`.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeHead = self => {\n if (isNil(self)) {\n throw new Error(getExpectedListToBeNonEmptyErrorMessage);\n }\n return self.head;\n};\n/**\n * Unsafely returns the last element of the specified `List`.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeLast = self => {\n if (isNil(self)) {\n throw new Error(getExpectedListToBeNonEmptyErrorMessage);\n }\n let these = self;\n let scout = self.tail;\n while (!isNil(scout)) {\n these = scout;\n scout = scout.tail;\n }\n return these.head;\n};\n/**\n * Unsafely returns the tail of the specified `List`.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeTail = self => {\n if (isNil(self)) {\n throw new Error(getExpectedListToBeNonEmptyErrorMessage);\n }\n return self.tail;\n};\n//# sourceMappingURL=List.js.map","import * as Equal from \"../Equal.js\";\nimport * as Hash from \"../Hash.js\";\nimport { StructuralPrototype } from \"./effectable.js\";\n/** @internal */\nexport const ArrayProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(Array.prototype), {\n [Hash.symbol]() {\n return Hash.cached(this, Hash.array(this));\n },\n [Equal.symbol](that) {\n if (Array.isArray(that) && this.length === that.length) {\n return this.every((v, i) => Equal.equals(v, that[i]));\n } else {\n return false;\n }\n }\n});\n/** @internal */\nexport const Structural = /*#__PURE__*/function () {\n function Structural(args) {\n if (args) {\n Object.assign(this, args);\n }\n }\n Structural.prototype = StructuralPrototype;\n return Structural;\n}();\n/** @internal */\nexport const struct = as => Object.assign(Object.create(StructuralPrototype), as);\n//# sourceMappingURL=data.js.map","import * as Chunk from \"../../Chunk.js\";\nimport * as Equal from \"../../Equal.js\";\nimport * as Dual from \"../../Function.js\";\nimport { makeContext } from \"../context.js\";\nimport { Structural } from \"../data.js\";\n/** @internal */\nexport const ContextPatchTypeId = /*#__PURE__*/Symbol.for(\"effect/DifferContextPatch\");\nfunction variance(a) {\n return a;\n}\n/** @internal */\nconst PatchProto = {\n ...Structural.prototype,\n [ContextPatchTypeId]: {\n _Value: variance,\n _Patch: variance\n }\n};\nconst EmptyProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Empty\"\n});\nconst _empty = /*#__PURE__*/Object.create(EmptyProto);\n/**\n * @internal\n */\nexport const empty = () => _empty;\nconst AndThenProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"AndThen\"\n});\nconst makeAndThen = (first, second) => {\n const o = Object.create(AndThenProto);\n o.first = first;\n o.second = second;\n return o;\n};\nconst AddServiceProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"AddService\"\n});\nconst makeAddService = (key, service) => {\n const o = Object.create(AddServiceProto);\n o.key = key;\n o.service = service;\n return o;\n};\nconst RemoveServiceProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"RemoveService\"\n});\nconst makeRemoveService = key => {\n const o = Object.create(RemoveServiceProto);\n o.key = key;\n return o;\n};\nconst UpdateServiceProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"UpdateService\"\n});\nconst makeUpdateService = (key, update) => {\n const o = Object.create(UpdateServiceProto);\n o.key = key;\n o.update = update;\n return o;\n};\n/** @internal */\nexport const diff = (oldValue, newValue) => {\n const missingServices = new Map(oldValue.unsafeMap);\n let patch = empty();\n for (const [tag, newService] of newValue.unsafeMap.entries()) {\n if (missingServices.has(tag)) {\n const old = missingServices.get(tag);\n missingServices.delete(tag);\n if (!Equal.equals(old, newService)) {\n patch = combine(makeUpdateService(tag, () => newService))(patch);\n }\n } else {\n missingServices.delete(tag);\n patch = combine(makeAddService(tag, newService))(patch);\n }\n }\n for (const [tag] of missingServices.entries()) {\n patch = combine(makeRemoveService(tag))(patch);\n }\n return patch;\n};\n/** @internal */\nexport const combine = /*#__PURE__*/Dual.dual(2, (self, that) => makeAndThen(self, that));\n/** @internal */\nexport const patch = /*#__PURE__*/Dual.dual(2, (self, context) => {\n if (self._tag === \"Empty\") {\n return context;\n }\n let wasServiceUpdated = false;\n let patches = Chunk.of(self);\n const updatedContext = new Map(context.unsafeMap);\n while (Chunk.isNonEmpty(patches)) {\n const head = Chunk.headNonEmpty(patches);\n const tail = Chunk.tailNonEmpty(patches);\n switch (head._tag) {\n case \"Empty\":\n {\n patches = tail;\n break;\n }\n case \"AddService\":\n {\n updatedContext.set(head.key, head.service);\n patches = tail;\n break;\n }\n case \"AndThen\":\n {\n patches = Chunk.prepend(Chunk.prepend(tail, head.second), head.first);\n break;\n }\n case \"RemoveService\":\n {\n updatedContext.delete(head.key);\n patches = tail;\n break;\n }\n case \"UpdateService\":\n {\n updatedContext.set(head.key, head.update(updatedContext.get(head.key)));\n wasServiceUpdated = true;\n patches = tail;\n break;\n }\n }\n }\n if (!wasServiceUpdated) {\n return makeContext(updatedContext);\n }\n const map = new Map();\n for (const [tag] of context.unsafeMap) {\n if (updatedContext.has(tag)) {\n map.set(tag, updatedContext.get(tag));\n updatedContext.delete(tag);\n }\n }\n for (const [tag, s] of updatedContext) {\n map.set(tag, s);\n }\n return makeContext(map);\n});\n//# sourceMappingURL=contextPatch.js.map","import * as Chunk from \"../../Chunk.js\";\nimport * as Dual from \"../../Function.js\";\nimport * as HashSet from \"../../HashSet.js\";\nimport { Structural } from \"../data.js\";\n/** @internal */\nexport const HashSetPatchTypeId = /*#__PURE__*/Symbol.for(\"effect/DifferHashSetPatch\");\nfunction variance(a) {\n return a;\n}\n/** @internal */\nconst PatchProto = {\n ...Structural.prototype,\n [HashSetPatchTypeId]: {\n _Value: variance,\n _Key: variance,\n _Patch: variance\n }\n};\nconst EmptyProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Empty\"\n});\nconst _empty = /*#__PURE__*/Object.create(EmptyProto);\n/** @internal */\nexport const empty = () => _empty;\nconst AndThenProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"AndThen\"\n});\n/** @internal */\nexport const makeAndThen = (first, second) => {\n const o = Object.create(AndThenProto);\n o.first = first;\n o.second = second;\n return o;\n};\nconst AddProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Add\"\n});\n/** @internal */\nexport const makeAdd = value => {\n const o = Object.create(AddProto);\n o.value = value;\n return o;\n};\nconst RemoveProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Remove\"\n});\n/** @internal */\nexport const makeRemove = value => {\n const o = Object.create(RemoveProto);\n o.value = value;\n return o;\n};\n/** @internal */\nexport const diff = (oldValue, newValue) => {\n const [removed, patch] = HashSet.reduce([oldValue, empty()], ([set, patch], value) => {\n if (HashSet.has(value)(set)) {\n return [HashSet.remove(value)(set), patch];\n }\n return [set, combine(makeAdd(value))(patch)];\n })(newValue);\n return HashSet.reduce(patch, (patch, value) => combine(makeRemove(value))(patch))(removed);\n};\n/** @internal */\nexport const combine = /*#__PURE__*/Dual.dual(2, (self, that) => makeAndThen(self, that));\n/** @internal */\nexport const patch = /*#__PURE__*/Dual.dual(2, (self, oldValue) => {\n if (self._tag === \"Empty\") {\n return oldValue;\n }\n let set = oldValue;\n let patches = Chunk.of(self);\n while (Chunk.isNonEmpty(patches)) {\n const head = Chunk.headNonEmpty(patches);\n const tail = Chunk.tailNonEmpty(patches);\n switch (head._tag) {\n case \"Empty\":\n {\n patches = tail;\n break;\n }\n case \"AndThen\":\n {\n patches = Chunk.prepend(head.first)(Chunk.prepend(head.second)(tail));\n break;\n }\n case \"Add\":\n {\n set = HashSet.add(head.value)(set);\n patches = tail;\n break;\n }\n case \"Remove\":\n {\n set = HashSet.remove(head.value)(set);\n patches = tail;\n }\n }\n }\n return set;\n});\n//# sourceMappingURL=hashSetPatch.js.map","import * as Arr from \"../../Array.js\";\nimport * as Equal from \"../../Equal.js\";\nimport * as Dual from \"../../Function.js\";\nimport * as Data from \"../data.js\";\n/** @internal */\nexport const ReadonlyArrayPatchTypeId = /*#__PURE__*/Symbol.for(\"effect/DifferReadonlyArrayPatch\");\nfunction variance(a) {\n return a;\n}\nconst PatchProto = {\n ...Data.Structural.prototype,\n [ReadonlyArrayPatchTypeId]: {\n _Value: variance,\n _Patch: variance\n }\n};\nconst EmptyProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Empty\"\n});\nconst _empty = /*#__PURE__*/Object.create(EmptyProto);\n/**\n * @internal\n */\nexport const empty = () => _empty;\nconst AndThenProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"AndThen\"\n});\nconst makeAndThen = (first, second) => {\n const o = Object.create(AndThenProto);\n o.first = first;\n o.second = second;\n return o;\n};\nconst AppendProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Append\"\n});\nconst makeAppend = values => {\n const o = Object.create(AppendProto);\n o.values = values;\n return o;\n};\nconst SliceProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Slice\"\n});\nconst makeSlice = (from, until) => {\n const o = Object.create(SliceProto);\n o.from = from;\n o.until = until;\n return o;\n};\nconst UpdateProto = /*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(PatchProto), {\n _tag: \"Update\"\n});\nconst makeUpdate = (index, patch) => {\n const o = Object.create(UpdateProto);\n o.index = index;\n o.patch = patch;\n return o;\n};\n/** @internal */\nexport const diff = options => {\n let i = 0;\n let patch = empty();\n while (i < options.oldValue.length && i < options.newValue.length) {\n const oldElement = options.oldValue[i];\n const newElement = options.newValue[i];\n const valuePatch = options.differ.diff(oldElement, newElement);\n if (!Equal.equals(valuePatch, options.differ.empty)) {\n patch = combine(patch, makeUpdate(i, valuePatch));\n }\n i = i + 1;\n }\n if (i < options.oldValue.length) {\n patch = combine(patch, makeSlice(0, i));\n }\n if (i < options.newValue.length) {\n patch = combine(patch, makeAppend(Arr.drop(i)(options.newValue)));\n }\n return patch;\n};\n/** @internal */\nexport const combine = /*#__PURE__*/Dual.dual(2, (self, that) => makeAndThen(self, that));\n/** @internal */\nexport const patch = /*#__PURE__*/Dual.dual(3, (self, oldValue, differ) => {\n if (self._tag === \"Empty\") {\n return oldValue;\n }\n let readonlyArray = oldValue.slice();\n let patches = Arr.of(self);\n while (Arr.isNonEmptyArray(patches)) {\n const head = Arr.headNonEmpty(patches);\n const tail = Arr.tailNonEmpty(patches);\n switch (head._tag) {\n case \"Empty\":\n {\n patches = tail;\n break;\n }\n case \"AndThen\":\n {\n tail.unshift(head.first, head.second);\n patches = tail;\n break;\n }\n case \"Append\":\n {\n for (const value of head.values) {\n readonlyArray.push(value);\n }\n patches = tail;\n break;\n }\n case \"Slice\":\n {\n readonlyArray = readonlyArray.slice(head.from, head.until);\n patches = tail;\n break;\n }\n case \"Update\":\n {\n readonlyArray[head.index] = differ.patch(head.patch, readonlyArray[head.index]);\n patches = tail;\n break;\n }\n }\n }\n return readonlyArray;\n});\n//# sourceMappingURL=readonlyArrayPatch.js.map","import * as Equal from \"../Equal.js\";\nimport * as Dual from \"../Function.js\";\nimport { constant, identity } from \"../Function.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as ChunkPatch from \"./differ/chunkPatch.js\";\nimport * as ContextPatch from \"./differ/contextPatch.js\";\nimport * as HashMapPatch from \"./differ/hashMapPatch.js\";\nimport * as HashSetPatch from \"./differ/hashSetPatch.js\";\nimport * as OrPatch from \"./differ/orPatch.js\";\nimport * as ReadonlyArrayPatch from \"./differ/readonlyArrayPatch.js\";\n/** @internal */\nexport const DifferTypeId = /*#__PURE__*/Symbol.for(\"effect/Differ\");\n/** @internal */\nexport const DifferProto = {\n [DifferTypeId]: {\n _P: identity,\n _V: identity\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const make = params => {\n const differ = Object.create(DifferProto);\n differ.empty = params.empty;\n differ.diff = params.diff;\n differ.combine = params.combine;\n differ.patch = params.patch;\n return differ;\n};\n/** @internal */\nexport const environment = () => make({\n empty: ContextPatch.empty(),\n combine: (first, second) => ContextPatch.combine(second)(first),\n diff: (oldValue, newValue) => ContextPatch.diff(oldValue, newValue),\n patch: (patch, oldValue) => ContextPatch.patch(oldValue)(patch)\n});\n/** @internal */\nexport const chunk = differ => make({\n empty: ChunkPatch.empty(),\n combine: (first, second) => ChunkPatch.combine(second)(first),\n diff: (oldValue, newValue) => ChunkPatch.diff({\n oldValue,\n newValue,\n differ\n }),\n patch: (patch, oldValue) => ChunkPatch.patch(oldValue, differ)(patch)\n});\n/** @internal */\nexport const hashMap = differ => make({\n empty: HashMapPatch.empty(),\n combine: (first, second) => HashMapPatch.combine(second)(first),\n diff: (oldValue, newValue) => HashMapPatch.diff({\n oldValue,\n newValue,\n differ\n }),\n patch: (patch, oldValue) => HashMapPatch.patch(oldValue, differ)(patch)\n});\n/** @internal */\nexport const hashSet = () => make({\n empty: HashSetPatch.empty(),\n combine: (first, second) => HashSetPatch.combine(second)(first),\n diff: (oldValue, newValue) => HashSetPatch.diff(oldValue, newValue),\n patch: (patch, oldValue) => HashSetPatch.patch(oldValue)(patch)\n});\n/** @internal */\nexport const orElseEither = /*#__PURE__*/Dual.dual(2, (self, that) => make({\n empty: OrPatch.empty(),\n combine: (first, second) => OrPatch.combine(first, second),\n diff: (oldValue, newValue) => OrPatch.diff({\n oldValue,\n newValue,\n left: self,\n right: that\n }),\n patch: (patch, oldValue) => OrPatch.patch(patch, {\n oldValue,\n left: self,\n right: that\n })\n}));\n/** @internal */\nexport const readonlyArray = differ => make({\n empty: ReadonlyArrayPatch.empty(),\n combine: (first, second) => ReadonlyArrayPatch.combine(first, second),\n diff: (oldValue, newValue) => ReadonlyArrayPatch.diff({\n oldValue,\n newValue,\n differ\n }),\n patch: (patch, oldValue) => ReadonlyArrayPatch.patch(patch, oldValue, differ)\n});\n/** @internal */\nexport const transform = /*#__PURE__*/Dual.dual(2, (self, {\n toNew,\n toOld\n}) => make({\n empty: self.empty,\n combine: (first, second) => self.combine(first, second),\n diff: (oldValue, newValue) => self.diff(toOld(oldValue), toOld(newValue)),\n patch: (patch, oldValue) => toNew(self.patch(patch, toOld(oldValue)))\n}));\n/** @internal */\nexport const update = () => updateWith((_, a) => a);\n/** @internal */\nexport const updateWith = f => make({\n empty: identity,\n combine: (first, second) => {\n if (first === identity) {\n return second;\n }\n if (second === identity) {\n return first;\n }\n return a => second(first(a));\n },\n diff: (oldValue, newValue) => {\n if (Equal.equals(oldValue, newValue)) {\n return identity;\n }\n return constant(newValue);\n },\n patch: (patch, oldValue) => f(oldValue, patch(oldValue))\n});\n/** @internal */\nexport const zip = /*#__PURE__*/Dual.dual(2, (self, that) => make({\n empty: [self.empty, that.empty],\n combine: (first, second) => [self.combine(first[0], second[0]), that.combine(first[1], second[1])],\n diff: (oldValue, newValue) => [self.diff(oldValue[0], newValue[0]), that.diff(oldValue[1], newValue[1])],\n patch: (patch, oldValue) => [self.patch(patch[0], oldValue[0]), that.patch(patch[1], oldValue[1])]\n}));\n//# sourceMappingURL=differ.js.map","import { dual } from \"../Function.js\";\n/** @internal */\nconst BIT_MASK = 0xff;\n/** @internal */\nconst BIT_SHIFT = 0x08;\n/** @internal */\nexport const active = patch => patch & BIT_MASK;\n/** @internal */\nexport const enabled = patch => patch >> BIT_SHIFT & BIT_MASK;\n/** @internal */\nexport const make = (active, enabled) => (active & BIT_MASK) + ((enabled & active & BIT_MASK) << BIT_SHIFT);\n/** @internal */\nexport const empty = /*#__PURE__*/make(0, 0);\n/** @internal */\nexport const enable = flag => make(flag, flag);\n/** @internal */\nexport const disable = flag => make(flag, 0);\n/** @internal */\nexport const isEmpty = patch => patch === 0;\n/** @internal */\nexport const isActive = /*#__PURE__*/dual(2, (self, flag) => (active(self) & flag) !== 0);\n/** @internal */\nexport const isEnabled = /*#__PURE__*/dual(2, (self, flag) => (enabled(self) & flag) !== 0);\n/** @internal */\nexport const isDisabled = /*#__PURE__*/dual(2, (self, flag) => (active(self) & flag) !== 0 && (enabled(self) & flag) === 0);\n/** @internal */\nexport const exclude = /*#__PURE__*/dual(2, (self, flag) => make(active(self) & ~flag, enabled(self)));\n/** @internal */\nexport const both = /*#__PURE__*/dual(2, (self, that) => make(active(self) | active(that), enabled(self) & enabled(that)));\n/** @internal */\nexport const either = /*#__PURE__*/dual(2, (self, that) => make(active(self) | active(that), enabled(self) | enabled(that)));\n/** @internal */\nexport const andThen = /*#__PURE__*/dual(2, (self, that) => self | that);\n/** @internal */\nexport const inverse = patch => make(enabled(patch), invert(active(patch)));\n/** @internal */\nexport const invert = n => ~n >>> 0 & BIT_MASK;\n//# sourceMappingURL=runtimeFlagsPatch.js.map","import { dual } from \"../Function.js\";\nimport * as internalDiffer from \"./differ.js\";\nimport * as runtimeFlagsPatch from \"./runtimeFlagsPatch.js\";\n/** @internal */\nexport const None = 0;\n/** @internal */\nexport const Interruption = 1 << 0;\n/** @internal */\nexport const OpSupervision = 1 << 1;\n/** @internal */\nexport const RuntimeMetrics = 1 << 2;\n/** @internal */\nexport const WindDown = 1 << 4;\n/** @internal */\nexport const CooperativeYielding = 1 << 5;\n/** @internal */\nexport const allFlags = [None, Interruption, OpSupervision, RuntimeMetrics, WindDown, CooperativeYielding];\nconst print = flag => {\n switch (flag) {\n case CooperativeYielding:\n {\n return \"CooperativeYielding\";\n }\n case WindDown:\n {\n return \"WindDown\";\n }\n case RuntimeMetrics:\n {\n return \"RuntimeMetrics\";\n }\n case OpSupervision:\n {\n return \"OpSupervision\";\n }\n case Interruption:\n {\n return \"Interruption\";\n }\n case None:\n {\n return \"None\";\n }\n }\n};\n/** @internal */\nexport const cooperativeYielding = self => isEnabled(self, CooperativeYielding);\n/** @internal */\nexport const disable = /*#__PURE__*/dual(2, (self, flag) => self & ~flag);\n/** @internal */\nexport const disableAll = /*#__PURE__*/dual(2, (self, flags) => self & ~flags);\n/** @internal */\nexport const enable = /*#__PURE__*/dual(2, (self, flag) => self | flag);\n/** @internal */\nexport const enableAll = /*#__PURE__*/dual(2, (self, flags) => self | flags);\n/** @internal */\nexport const interruptible = self => interruption(self) && !windDown(self);\n/** @internal */\nexport const interruption = self => isEnabled(self, Interruption);\n/** @internal */\nexport const isDisabled = /*#__PURE__*/dual(2, (self, flag) => !isEnabled(self, flag));\n/** @internal */\nexport const isEnabled = /*#__PURE__*/dual(2, (self, flag) => (self & flag) !== 0);\n/** @internal */\nexport const make = (...flags) => flags.reduce((a, b) => a | b, 0);\n/** @internal */\nexport const none = /*#__PURE__*/make(None);\n/** @internal */\nexport const opSupervision = self => isEnabled(self, OpSupervision);\n/** @internal */\nexport const render = self => {\n const active = [];\n allFlags.forEach(flag => {\n if (isEnabled(self, flag)) {\n active.push(`${print(flag)}`);\n }\n });\n return `RuntimeFlags(${active.join(\", \")})`;\n};\n/** @internal */\nexport const runtimeMetrics = self => isEnabled(self, RuntimeMetrics);\n/** @internal */\nexport const toSet = self => new Set(allFlags.filter(flag => isEnabled(self, flag)));\nexport const windDown = self => isEnabled(self, WindDown);\n// circular with RuntimeFlagsPatch\n/** @internal */\nexport const enabledSet = self => toSet(runtimeFlagsPatch.active(self) & runtimeFlagsPatch.enabled(self));\n/** @internal */\nexport const disabledSet = self => toSet(runtimeFlagsPatch.active(self) & ~runtimeFlagsPatch.enabled(self));\n/** @internal */\nexport const diff = /*#__PURE__*/dual(2, (self, that) => runtimeFlagsPatch.make(self ^ that, that));\n/** @internal */\nexport const patch = /*#__PURE__*/dual(2, (self, patch) => self & (runtimeFlagsPatch.invert(runtimeFlagsPatch.active(patch)) | runtimeFlagsPatch.enabled(patch)) | runtimeFlagsPatch.active(patch) & runtimeFlagsPatch.enabled(patch));\n/** @internal */\nexport const renderPatch = self => {\n const enabled = Array.from(enabledSet(self)).map(flag => print(flag)).join(\", \");\n const disabled = Array.from(disabledSet(self)).map(flag => print(flag)).join(\", \");\n return `RuntimeFlagsPatch(enabled = (${enabled}), disabled = (${disabled}))`;\n};\n/** @internal */\nexport const differ = /*#__PURE__*/internalDiffer.make({\n empty: runtimeFlagsPatch.empty,\n diff: (oldValue, newValue) => diff(oldValue, newValue),\n combine: (first, second) => runtimeFlagsPatch.andThen(second)(first),\n patch: (_patch, oldValue) => patch(oldValue, _patch)\n});\n//# sourceMappingURL=runtimeFlags.js.map","/**\n * @since 2.0.0\n */\nimport * as runtimeFlags from \"./internal/runtimeFlags.js\";\nimport * as internal from \"./internal/runtimeFlagsPatch.js\";\n/**\n * The empty `RuntimeFlagsPatch`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = internal.empty;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * Creates a `RuntimeFlagsPatch` describing enabling the provided `RuntimeFlag`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const enable = internal.enable;\n/**\n * Creates a `RuntimeFlagsPatch` describing disabling the provided `RuntimeFlag`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const disable = internal.disable;\n/**\n * Returns `true` if the specified `RuntimeFlagsPatch` is empty.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const isEmpty = internal.isEmpty;\n/**\n * Returns `true` if the `RuntimeFlagsPatch` describes the specified\n * `RuntimeFlag` as active.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const isActive = internal.isActive;\n/**\n * Returns `true` if the `RuntimeFlagsPatch` describes the specified\n * `RuntimeFlag` as enabled.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const isEnabled = internal.isEnabled;\n/**\n * Returns `true` if the `RuntimeFlagsPatch` describes the specified\n * `RuntimeFlag` as disabled.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const isDisabled = internal.isDisabled;\n/**\n * Returns `true` if the `RuntimeFlagsPatch` includes the specified\n * `RuntimeFlag`, `false` otherwise.\n *\n * @since 2.0.0\n * @category elements\n */\nexport const includes = internal.isActive;\n/**\n * Creates a `RuntimeFlagsPatch` describing the application of the `self` patch,\n * followed by `that` patch.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const andThen = internal.andThen;\n/**\n * Creates a `RuntimeFlagsPatch` describing application of both the `self` patch\n * and `that` patch.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const both = internal.both;\n/**\n * Creates a `RuntimeFlagsPatch` describing application of either the `self`\n * patch or `that` patch.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const either = internal.either;\n/**\n * Creates a `RuntimeFlagsPatch` which describes exclusion of the specified\n * `RuntimeFlag` from the set of `RuntimeFlags`.\n *\n * @category utils\n * @since 2.0.0\n */\nexport const exclude = internal.exclude;\n/**\n * Creates a `RuntimeFlagsPatch` which describes the inverse of the patch\n * specified by the provided `RuntimeFlagsPatch`.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const inverse = internal.inverse;\n/**\n * Returns a `ReadonlySet<number>` containing the `RuntimeFlags` described as\n * enabled by the specified `RuntimeFlagsPatch`.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const enabledSet = runtimeFlags.enabledSet;\n/**\n * Returns a `ReadonlySet<number>` containing the `RuntimeFlags` described as\n * disabled by the specified `RuntimeFlagsPatch`.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const disabledSet = runtimeFlags.disabledSet;\n/**\n * Renders the provided `RuntimeFlagsPatch` to a string.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const render = runtimeFlags.renderPatch;\n//# sourceMappingURL=RuntimeFlagsPatch.js.map","import * as Chunk from \"../Chunk.js\";\nimport * as Either from \"../Either.js\";\nimport * as Equal from \"../Equal.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport * as List from \"../List.js\";\nimport * as Option from \"../Option.js\";\nimport { hasProperty } from \"../Predicate.js\";\n/** @internal */\nexport const empty = {\n _tag: \"Empty\"\n};\n/**\n * Combines this collection of blocked requests with the specified collection\n * of blocked requests, in parallel.\n *\n * @internal\n */\nexport const par = (self, that) => ({\n _tag: \"Par\",\n left: self,\n right: that\n});\n/**\n * Combines this collection of blocked requests with the specified collection\n * of blocked requests, in sequence.\n *\n * @internal\n */\nexport const seq = (self, that) => ({\n _tag: \"Seq\",\n left: self,\n right: that\n});\n/**\n * Constructs a collection of blocked requests from the specified blocked\n * request and data source.\n *\n * @internal\n */\nexport const single = (dataSource, blockedRequest) => ({\n _tag: \"Single\",\n dataSource: dataSource,\n blockedRequest\n});\n/** @internal */\nexport const MapRequestResolversReducer = f => ({\n emptyCase: () => empty,\n parCase: (left, right) => par(left, right),\n seqCase: (left, right) => seq(left, right),\n singleCase: (dataSource, blockedRequest) => single(f(dataSource), blockedRequest)\n});\n/**\n * Transforms all data sources with the specified data source aspect, which\n * can change the environment type of data sources but must preserve the\n * request type of each data source.\n *\n * @internal\n */\nexport const mapRequestResolvers = (self, f) => reduce(self, MapRequestResolversReducer(f));\n/**\n * Folds over the cases of this collection of blocked requests with the\n * specified functions.\n *\n * @internal\n */\nexport const reduce = (self, reducer) => {\n let input = List.of(self);\n let output = List.empty();\n while (List.isCons(input)) {\n const current = input.head;\n switch (current._tag) {\n case \"Empty\":\n {\n output = List.cons(Either.right(reducer.emptyCase()), output);\n input = input.tail;\n break;\n }\n case \"Par\":\n {\n output = List.cons(Either.left({\n _tag: \"ParCase\"\n }), output);\n input = List.cons(current.left, List.cons(current.right, input.tail));\n break;\n }\n case \"Seq\":\n {\n output = List.cons(Either.left({\n _tag: \"SeqCase\"\n }), output);\n input = List.cons(current.left, List.cons(current.right, input.tail));\n break;\n }\n case \"Single\":\n {\n const result = reducer.singleCase(current.dataSource, current.blockedRequest);\n output = List.cons(Either.right(result), output);\n input = input.tail;\n break;\n }\n }\n }\n const result = List.reduce(output, List.empty(), (acc, current) => {\n switch (current._tag) {\n case \"Left\":\n {\n const left = List.unsafeHead(acc);\n const right = List.unsafeHead(List.unsafeTail(acc));\n const tail = List.unsafeTail(List.unsafeTail(acc));\n switch (current.left._tag) {\n case \"ParCase\":\n {\n return List.cons(reducer.parCase(left, right), tail);\n }\n case \"SeqCase\":\n {\n return List.cons(reducer.seqCase(left, right), tail);\n }\n }\n }\n case \"Right\":\n {\n return List.cons(current.right, acc);\n }\n }\n });\n if (List.isNil(result)) {\n throw new Error(\"BUG: BlockedRequests.reduce - please report an issue at https://github.com/Effect-TS/effect/issues\");\n }\n return result.head;\n};\n/**\n * Flattens a collection of blocked requests into a collection of pipelined\n * and batched requests that can be submitted for execution.\n *\n * @internal\n */\nexport const flatten = self => {\n let current = List.of(self);\n let updated = List.empty();\n // eslint-disable-next-line no-constant-condition\n while (1) {\n const [parallel, sequential] = List.reduce(current, [parallelCollectionEmpty(), List.empty()], ([parallel, sequential], blockedRequest) => {\n const [par, seq] = step(blockedRequest);\n return [parallelCollectionCombine(parallel, par), List.appendAll(sequential, seq)];\n });\n updated = merge(updated, parallel);\n if (List.isNil(sequential)) {\n return List.reverse(updated);\n }\n current = sequential;\n }\n throw new Error(\"BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues\");\n};\n/**\n * Takes one step in evaluating a collection of blocked requests, returning a\n * collection of blocked requests that can be performed in parallel and a list\n * of blocked requests that must be performed sequentially after those\n * requests.\n */\nconst step = requests => {\n let current = requests;\n let parallel = parallelCollectionEmpty();\n let stack = List.empty();\n let sequential = List.empty();\n // eslint-disable-next-line no-constant-condition\n while (1) {\n switch (current._tag) {\n case \"Empty\":\n {\n if (List.isNil(stack)) {\n return [parallel, sequential];\n }\n current = stack.head;\n stack = stack.tail;\n break;\n }\n case \"Par\":\n {\n stack = List.cons(current.right, stack);\n current = current.left;\n break;\n }\n case \"Seq\":\n {\n const left = current.left;\n const right = current.right;\n switch (left._tag) {\n case \"Empty\":\n {\n current = right;\n break;\n }\n case \"Par\":\n {\n const l = left.left;\n const r = left.right;\n current = par(seq(l, right), seq(r, right));\n break;\n }\n case \"Seq\":\n {\n const l = left.left;\n const r = left.right;\n current = seq(l, seq(r, right));\n break;\n }\n case \"Single\":\n {\n current = left;\n sequential = List.cons(right, sequential);\n break;\n }\n }\n break;\n }\n case \"Single\":\n {\n parallel = parallelCollectionAdd(parallel, current);\n if (List.isNil(stack)) {\n return [parallel, sequential];\n }\n current = stack.head;\n stack = stack.tail;\n break;\n }\n }\n }\n throw new Error(\"BUG: BlockedRequests.step - please report an issue at https://github.com/Effect-TS/effect/issues\");\n};\n/**\n * Merges a collection of requests that must be executed sequentially with a\n * collection of requests that can be executed in parallel. If the collections\n * are both from the same single data source then the requests can be\n * pipelined while preserving ordering guarantees.\n */\nconst merge = (sequential, parallel) => {\n if (List.isNil(sequential)) {\n return List.of(parallelCollectionToSequentialCollection(parallel));\n }\n if (parallelCollectionIsEmpty(parallel)) {\n return sequential;\n }\n const seqHeadKeys = sequentialCollectionKeys(sequential.head);\n const parKeys = parallelCollectionKeys(parallel);\n if (seqHeadKeys.length === 1 && parKeys.length === 1 && Equal.equals(seqHeadKeys[0], parKeys[0])) {\n return List.cons(sequentialCollectionCombine(sequential.head, parallelCollectionToSequentialCollection(parallel)), sequential.tail);\n }\n return List.cons(parallelCollectionToSequentialCollection(parallel), sequential);\n};\n//\n// circular\n//\n/** @internal */\nexport const EntryTypeId = /*#__PURE__*/Symbol.for(\"effect/RequestBlock/Entry\");\n/** @internal */\nclass EntryImpl {\n request;\n result;\n listeners;\n ownerId;\n state;\n [EntryTypeId] = blockedRequestVariance;\n constructor(request, result, listeners, ownerId, state) {\n this.request = request;\n this.result = result;\n this.listeners = listeners;\n this.ownerId = ownerId;\n this.state = state;\n }\n}\nconst blockedRequestVariance = {\n /* c8 ignore next */\n _R: _ => _\n};\n/** @internal */\nexport const isEntry = u => hasProperty(u, EntryTypeId);\n/** @internal */\nexport const makeEntry = options => new EntryImpl(options.request, options.result, options.listeners, options.ownerId, options.state);\n/** @internal */\nexport const RequestBlockParallelTypeId = /*#__PURE__*/Symbol.for(\"effect/RequestBlock/RequestBlockParallel\");\nconst parallelVariance = {\n /* c8 ignore next */\n _R: _ => _\n};\nclass ParallelImpl {\n map;\n [RequestBlockParallelTypeId] = parallelVariance;\n constructor(map) {\n this.map = map;\n }\n}\n/** @internal */\nexport const parallelCollectionEmpty = () => new ParallelImpl(HashMap.empty());\n/** @internal */\nexport const parallelCollectionMake = (dataSource, blockedRequest) => new ParallelImpl(HashMap.make([dataSource, Chunk.of(blockedRequest)]));\n/** @internal */\nexport const parallelCollectionAdd = (self, blockedRequest) => new ParallelImpl(HashMap.modifyAt(self.map, blockedRequest.dataSource, _ => Option.orElseSome(Option.map(_, Chunk.append(blockedRequest.blockedRequest)), () => Chunk.of(blockedRequest.blockedRequest))));\n/** @internal */\nexport const parallelCollectionCombine = (self, that) => new ParallelImpl(HashMap.reduce(self.map, that.map, (map, value, key) => HashMap.set(map, key, Option.match(HashMap.get(map, key), {\n onNone: () => value,\n onSome: other => Chunk.appendAll(value, other)\n}))));\n/** @internal */\nexport const parallelCollectionIsEmpty = self => HashMap.isEmpty(self.map);\n/** @internal */\nexport const parallelCollectionKeys = self => Array.from(HashMap.keys(self.map));\n/** @internal */\nexport const parallelCollectionToSequentialCollection = self => sequentialCollectionMake(HashMap.map(self.map, x => Chunk.of(x)));\n// TODO\n// /** @internal */\n// export const parallelCollectionToChunk = <R>(\n// self: ParallelCollection<R>\n// ): Array<[RequestResolver.RequestResolver<unknown, R>, Array<Request.Entry<unknown>>]> => Array.from(self.map) as any\n/** @internal */\nexport const SequentialCollectionTypeId = /*#__PURE__*/Symbol.for(\"effect/RequestBlock/RequestBlockSequential\");\nconst sequentialVariance = {\n /* c8 ignore next */\n _R: _ => _\n};\nclass SequentialImpl {\n map;\n [SequentialCollectionTypeId] = sequentialVariance;\n constructor(map) {\n this.map = map;\n }\n}\n/** @internal */\nexport const sequentialCollectionMake = map => new SequentialImpl(map);\n/** @internal */\nexport const sequentialCollectionCombine = (self, that) => new SequentialImpl(HashMap.reduce(that.map, self.map, (map, value, key) => HashMap.set(map, key, Option.match(HashMap.get(map, key), {\n onNone: () => Chunk.empty(),\n onSome: a => Chunk.appendAll(a, value)\n}))));\n/** @internal */\nexport const sequentialCollectionIsEmpty = self => HashMap.isEmpty(self.map);\n/** @internal */\nexport const sequentialCollectionKeys = self => Array.from(HashMap.keys(self.map));\n/** @internal */\nexport const sequentialCollectionToChunk = self => Array.from(self.map);\n//# sourceMappingURL=blockedRequests.js.map","/** @internal */\nexport const OP_DIE = \"Die\";\n/** @internal */\nexport const OP_EMPTY = \"Empty\";\n/** @internal */\nexport const OP_FAIL = \"Fail\";\n/** @internal */\nexport const OP_INTERRUPT = \"Interrupt\";\n/** @internal */\nexport const OP_PARALLEL = \"Parallel\";\n/** @internal */\nexport const OP_SEQUENTIAL = \"Sequential\";\n//# sourceMappingURL=cause.js.map","import * as Arr from \"../Array.js\";\nimport * as Chunk from \"../Chunk.js\";\nimport * as Either from \"../Either.js\";\nimport * as Equal from \"../Equal.js\";\nimport { constFalse, constTrue, dual, identity, pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as Hash from \"../Hash.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport { NodeInspectSymbol, stringifyCircular, toJSON } from \"../Inspectable.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty, isFunction } from \"../Predicate.js\";\nimport { getBugErrorMessage } from \"./errors.js\";\nimport * as OpCodes from \"./opCodes/cause.js\";\n// -----------------------------------------------------------------------------\n// Models\n// -----------------------------------------------------------------------------\n/** @internal */\nconst CauseSymbolKey = \"effect/Cause\";\n/** @internal */\nexport const CauseTypeId = /*#__PURE__*/Symbol.for(CauseSymbolKey);\nconst variance = {\n /* c8 ignore next */\n _E: _ => _\n};\n/** @internal */\nconst proto = {\n [CauseTypeId]: variance,\n [Hash.symbol]() {\n return pipe(Hash.hash(CauseSymbolKey), Hash.combine(Hash.hash(flattenCause(this))), Hash.cached(this));\n },\n [Equal.symbol](that) {\n return isCause(that) && causeEquals(this, that);\n },\n pipe() {\n return pipeArguments(this, arguments);\n },\n toJSON() {\n switch (this._tag) {\n case \"Empty\":\n return {\n _id: \"Cause\",\n _tag: this._tag\n };\n case \"Die\":\n return {\n _id: \"Cause\",\n _tag: this._tag,\n defect: toJSON(this.defect)\n };\n case \"Interrupt\":\n return {\n _id: \"Cause\",\n _tag: this._tag,\n fiberId: this.fiberId.toJSON()\n };\n case \"Fail\":\n return {\n _id: \"Cause\",\n _tag: this._tag,\n failure: toJSON(this.error)\n };\n case \"Sequential\":\n case \"Parallel\":\n return {\n _id: \"Cause\",\n _tag: this._tag,\n left: toJSON(this.left),\n right: toJSON(this.right)\n };\n }\n },\n toString() {\n return pretty(this);\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n};\n// -----------------------------------------------------------------------------\n// Constructors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const empty = /*#__PURE__*/(() => {\n const o = /*#__PURE__*/Object.create(proto);\n o._tag = OpCodes.OP_EMPTY;\n return o;\n})();\n/** @internal */\nexport const fail = error => {\n const o = Object.create(proto);\n o._tag = OpCodes.OP_FAIL;\n o.error = error;\n return o;\n};\n/** @internal */\nexport const die = defect => {\n const o = Object.create(proto);\n o._tag = OpCodes.OP_DIE;\n o.defect = defect;\n return o;\n};\n/** @internal */\nexport const interrupt = fiberId => {\n const o = Object.create(proto);\n o._tag = OpCodes.OP_INTERRUPT;\n o.fiberId = fiberId;\n return o;\n};\n/** @internal */\nexport const parallel = (left, right) => {\n const o = Object.create(proto);\n o._tag = OpCodes.OP_PARALLEL;\n o.left = left;\n o.right = right;\n return o;\n};\n/** @internal */\nexport const sequential = (left, right) => {\n const o = Object.create(proto);\n o._tag = OpCodes.OP_SEQUENTIAL;\n o.left = left;\n o.right = right;\n return o;\n};\n// -----------------------------------------------------------------------------\n// Refinements\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const isCause = u => hasProperty(u, CauseTypeId);\n/** @internal */\nexport const isEmptyType = self => self._tag === OpCodes.OP_EMPTY;\n/** @internal */\nexport const isFailType = self => self._tag === OpCodes.OP_FAIL;\n/** @internal */\nexport const isDieType = self => self._tag === OpCodes.OP_DIE;\n/** @internal */\nexport const isInterruptType = self => self._tag === OpCodes.OP_INTERRUPT;\n/** @internal */\nexport const isSequentialType = self => self._tag === OpCodes.OP_SEQUENTIAL;\n/** @internal */\nexport const isParallelType = self => self._tag === OpCodes.OP_PARALLEL;\n// -----------------------------------------------------------------------------\n// Getters\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const size = self => reduceWithContext(self, void 0, SizeCauseReducer);\n/** @internal */\nexport const isEmpty = self => {\n if (self._tag === OpCodes.OP_EMPTY) {\n return true;\n }\n return reduce(self, true, (acc, cause) => {\n switch (cause._tag) {\n case OpCodes.OP_EMPTY:\n {\n return Option.some(acc);\n }\n case OpCodes.OP_DIE:\n case OpCodes.OP_FAIL:\n case OpCodes.OP_INTERRUPT:\n {\n return Option.some(false);\n }\n default:\n {\n return Option.none();\n }\n }\n });\n};\n/** @internal */\nexport const isFailure = self => Option.isSome(failureOption(self));\n/** @internal */\nexport const isDie = self => Option.isSome(dieOption(self));\n/** @internal */\nexport const isInterrupted = self => Option.isSome(interruptOption(self));\n/** @internal */\nexport const isInterruptedOnly = self => reduceWithContext(undefined, IsInterruptedOnlyCauseReducer)(self);\n/** @internal */\nexport const failures = self => Chunk.reverse(reduce(self, Chunk.empty(), (list, cause) => cause._tag === OpCodes.OP_FAIL ? Option.some(pipe(list, Chunk.prepend(cause.error))) : Option.none()));\n/** @internal */\nexport const defects = self => Chunk.reverse(reduce(self, Chunk.empty(), (list, cause) => cause._tag === OpCodes.OP_DIE ? Option.some(pipe(list, Chunk.prepend(cause.defect))) : Option.none()));\n/** @internal */\nexport const interruptors = self => reduce(self, HashSet.empty(), (set, cause) => cause._tag === OpCodes.OP_INTERRUPT ? Option.some(pipe(set, HashSet.add(cause.fiberId))) : Option.none());\n/** @internal */\nexport const failureOption = self => find(self, cause => cause._tag === OpCodes.OP_FAIL ? Option.some(cause.error) : Option.none());\n/** @internal */\nexport const failureOrCause = self => {\n const option = failureOption(self);\n switch (option._tag) {\n case \"None\":\n {\n // no `E` inside this `Cause`, so it can be safely cast to `never`\n return Either.right(self);\n }\n case \"Some\":\n {\n return Either.left(option.value);\n }\n }\n};\n/** @internal */\nexport const dieOption = self => find(self, cause => cause._tag === OpCodes.OP_DIE ? Option.some(cause.defect) : Option.none());\n/** @internal */\nexport const flipCauseOption = self => match(self, {\n onEmpty: Option.some(empty),\n onFail: Option.map(fail),\n onDie: defect => Option.some(die(defect)),\n onInterrupt: fiberId => Option.some(interrupt(fiberId)),\n onSequential: Option.mergeWith(sequential),\n onParallel: Option.mergeWith(parallel)\n});\n/** @internal */\nexport const interruptOption = self => find(self, cause => cause._tag === OpCodes.OP_INTERRUPT ? Option.some(cause.fiberId) : Option.none());\n/** @internal */\nexport const keepDefects = self => match(self, {\n onEmpty: Option.none(),\n onFail: () => Option.none(),\n onDie: defect => Option.some(die(defect)),\n onInterrupt: () => Option.none(),\n onSequential: Option.mergeWith(sequential),\n onParallel: Option.mergeWith(parallel)\n});\n/** @internal */\nexport const keepDefectsAndElectFailures = self => match(self, {\n onEmpty: Option.none(),\n onFail: failure => Option.some(die(failure)),\n onDie: defect => Option.some(die(defect)),\n onInterrupt: () => Option.none(),\n onSequential: Option.mergeWith(sequential),\n onParallel: Option.mergeWith(parallel)\n});\n/** @internal */\nexport const linearize = self => match(self, {\n onEmpty: HashSet.empty(),\n onFail: error => HashSet.make(fail(error)),\n onDie: defect => HashSet.make(die(defect)),\n onInterrupt: fiberId => HashSet.make(interrupt(fiberId)),\n onSequential: (leftSet, rightSet) => HashSet.flatMap(leftSet, leftCause => HashSet.map(rightSet, rightCause => sequential(leftCause, rightCause))),\n onParallel: (leftSet, rightSet) => HashSet.flatMap(leftSet, leftCause => HashSet.map(rightSet, rightCause => parallel(leftCause, rightCause)))\n});\n/** @internal */\nexport const stripFailures = self => match(self, {\n onEmpty: empty,\n onFail: () => empty,\n onDie: die,\n onInterrupt: interrupt,\n onSequential: sequential,\n onParallel: parallel\n});\n/** @internal */\nexport const electFailures = self => match(self, {\n onEmpty: empty,\n onFail: die,\n onDie: die,\n onInterrupt: interrupt,\n onSequential: sequential,\n onParallel: parallel\n});\n/** @internal */\nexport const stripSomeDefects = /*#__PURE__*/dual(2, (self, pf) => match(self, {\n onEmpty: Option.some(empty),\n onFail: error => Option.some(fail(error)),\n onDie: defect => {\n const option = pf(defect);\n return Option.isSome(option) ? Option.none() : Option.some(die(defect));\n },\n onInterrupt: fiberId => Option.some(interrupt(fiberId)),\n onSequential: Option.mergeWith(sequential),\n onParallel: Option.mergeWith(parallel)\n}));\n// -----------------------------------------------------------------------------\n// Mapping\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const as = /*#__PURE__*/dual(2, (self, error) => map(self, () => error));\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, e => fail(f(e))));\n// -----------------------------------------------------------------------------\n// Sequencing\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => match(self, {\n onEmpty: empty,\n onFail: error => f(error),\n onDie: defect => die(defect),\n onInterrupt: fiberId => interrupt(fiberId),\n onSequential: (left, right) => sequential(left, right),\n onParallel: (left, right) => parallel(left, right)\n}));\n/** @internal */\nexport const flatten = self => flatMap(self, identity);\n/** @internal */\nexport const andThen = /*#__PURE__*/dual(2, (self, f) => isFunction(f) ? flatMap(self, f) : flatMap(self, () => f));\n// -----------------------------------------------------------------------------\n// Equality\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const contains = /*#__PURE__*/dual(2, (self, that) => {\n if (that._tag === OpCodes.OP_EMPTY || self === that) {\n return true;\n }\n return reduce(self, false, (accumulator, cause) => {\n return Option.some(accumulator || causeEquals(cause, that));\n });\n});\n/** @internal */\nconst causeEquals = (left, right) => {\n let leftStack = Chunk.of(left);\n let rightStack = Chunk.of(right);\n while (Chunk.isNonEmpty(leftStack) && Chunk.isNonEmpty(rightStack)) {\n const [leftParallel, leftSequential] = pipe(Chunk.headNonEmpty(leftStack), reduce([HashSet.empty(), Chunk.empty()], ([parallel, sequential], cause) => {\n const [par, seq] = evaluateCause(cause);\n return Option.some([pipe(parallel, HashSet.union(par)), pipe(sequential, Chunk.appendAll(seq))]);\n }));\n const [rightParallel, rightSequential] = pipe(Chunk.headNonEmpty(rightStack), reduce([HashSet.empty(), Chunk.empty()], ([parallel, sequential], cause) => {\n const [par, seq] = evaluateCause(cause);\n return Option.some([pipe(parallel, HashSet.union(par)), pipe(sequential, Chunk.appendAll(seq))]);\n }));\n if (!Equal.equals(leftParallel, rightParallel)) {\n return false;\n }\n leftStack = leftSequential;\n rightStack = rightSequential;\n }\n return true;\n};\n// -----------------------------------------------------------------------------\n// Flattening\n// -----------------------------------------------------------------------------\n/**\n * Flattens a cause to a sequence of sets of causes, where each set represents\n * causes that fail in parallel and sequential sets represent causes that fail\n * after each other.\n *\n * @internal\n */\nconst flattenCause = cause => {\n return flattenCauseLoop(Chunk.of(cause), Chunk.empty());\n};\n/** @internal */\nconst flattenCauseLoop = (causes, flattened) => {\n // eslint-disable-next-line no-constant-condition\n while (1) {\n const [parallel, sequential] = pipe(causes, Arr.reduce([HashSet.empty(), Chunk.empty()], ([parallel, sequential], cause) => {\n const [par, seq] = evaluateCause(cause);\n return [pipe(parallel, HashSet.union(par)), pipe(sequential, Chunk.appendAll(seq))];\n }));\n const updated = HashSet.size(parallel) > 0 ? pipe(flattened, Chunk.prepend(parallel)) : flattened;\n if (Chunk.isEmpty(sequential)) {\n return Chunk.reverse(updated);\n }\n causes = sequential;\n flattened = updated;\n }\n throw new Error(getBugErrorMessage(\"Cause.flattenCauseLoop\"));\n};\n// -----------------------------------------------------------------------------\n// Finding\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const find = /*#__PURE__*/dual(2, (self, pf) => {\n const stack = [self];\n while (stack.length > 0) {\n const item = stack.pop();\n const option = pf(item);\n switch (option._tag) {\n case \"None\":\n {\n switch (item._tag) {\n case OpCodes.OP_SEQUENTIAL:\n case OpCodes.OP_PARALLEL:\n {\n stack.push(item.right);\n stack.push(item.left);\n break;\n }\n }\n break;\n }\n case \"Some\":\n {\n return option;\n }\n }\n }\n return Option.none();\n});\n// -----------------------------------------------------------------------------\n// Filtering\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const filter = /*#__PURE__*/dual(2, (self, predicate) => reduceWithContext(self, void 0, FilterCauseReducer(predicate)));\n// -----------------------------------------------------------------------------\n// Evaluation\n// -----------------------------------------------------------------------------\n/**\n * Takes one step in evaluating a cause, returning a set of causes that fail\n * in parallel and a list of causes that fail sequentially after those causes.\n *\n * @internal\n */\nconst evaluateCause = self => {\n let cause = self;\n const stack = [];\n let _parallel = HashSet.empty();\n let _sequential = Chunk.empty();\n while (cause !== undefined) {\n switch (cause._tag) {\n case OpCodes.OP_EMPTY:\n {\n if (stack.length === 0) {\n return [_parallel, _sequential];\n }\n cause = stack.pop();\n break;\n }\n case OpCodes.OP_FAIL:\n {\n _parallel = HashSet.add(_parallel, Chunk.make(cause._tag, cause.error));\n if (stack.length === 0) {\n return [_parallel, _sequential];\n }\n cause = stack.pop();\n break;\n }\n case OpCodes.OP_DIE:\n {\n _parallel = HashSet.add(_parallel, Chunk.make(cause._tag, cause.defect));\n if (stack.length === 0) {\n return [_parallel, _sequential];\n }\n cause = stack.pop();\n break;\n }\n case OpCodes.OP_INTERRUPT:\n {\n _parallel = HashSet.add(_parallel, Chunk.make(cause._tag, cause.fiberId));\n if (stack.length === 0) {\n return [_parallel, _sequential];\n }\n cause = stack.pop();\n break;\n }\n case OpCodes.OP_SEQUENTIAL:\n {\n switch (cause.left._tag) {\n case OpCodes.OP_EMPTY:\n {\n cause = cause.right;\n break;\n }\n case OpCodes.OP_SEQUENTIAL:\n {\n cause = sequential(cause.left.left, sequential(cause.left.right, cause.right));\n break;\n }\n case OpCodes.OP_PARALLEL:\n {\n cause = parallel(sequential(cause.left.left, cause.right), sequential(cause.left.right, cause.right));\n break;\n }\n default:\n {\n _sequential = Chunk.prepend(_sequential, cause.right);\n cause = cause.left;\n break;\n }\n }\n break;\n }\n case OpCodes.OP_PARALLEL:\n {\n stack.push(cause.right);\n cause = cause.left;\n break;\n }\n }\n }\n throw new Error(getBugErrorMessage(\"Cause.evaluateCauseLoop\"));\n};\n// -----------------------------------------------------------------------------\n// Reducing\n// -----------------------------------------------------------------------------\n/** @internal */\nconst SizeCauseReducer = {\n emptyCase: () => 0,\n failCase: () => 1,\n dieCase: () => 1,\n interruptCase: () => 1,\n sequentialCase: (_, left, right) => left + right,\n parallelCase: (_, left, right) => left + right\n};\n/** @internal */\nconst IsInterruptedOnlyCauseReducer = {\n emptyCase: constTrue,\n failCase: constFalse,\n dieCase: constFalse,\n interruptCase: constTrue,\n sequentialCase: (_, left, right) => left && right,\n parallelCase: (_, left, right) => left && right\n};\n/** @internal */\nconst FilterCauseReducer = predicate => ({\n emptyCase: () => empty,\n failCase: (_, error) => fail(error),\n dieCase: (_, defect) => die(defect),\n interruptCase: (_, fiberId) => interrupt(fiberId),\n sequentialCase: (_, left, right) => {\n if (predicate(left)) {\n if (predicate(right)) {\n return sequential(left, right);\n }\n return left;\n }\n if (predicate(right)) {\n return right;\n }\n return empty;\n },\n parallelCase: (_, left, right) => {\n if (predicate(left)) {\n if (predicate(right)) {\n return parallel(left, right);\n }\n return left;\n }\n if (predicate(right)) {\n return right;\n }\n return empty;\n }\n});\nconst OP_SEQUENTIAL_CASE = \"SequentialCase\";\nconst OP_PARALLEL_CASE = \"ParallelCase\";\n/** @internal */\nexport const match = /*#__PURE__*/dual(2, (self, {\n onDie,\n onEmpty,\n onFail,\n onInterrupt,\n onParallel,\n onSequential\n}) => {\n return reduceWithContext(self, void 0, {\n emptyCase: () => onEmpty,\n failCase: (_, error) => onFail(error),\n dieCase: (_, defect) => onDie(defect),\n interruptCase: (_, fiberId) => onInterrupt(fiberId),\n sequentialCase: (_, left, right) => onSequential(left, right),\n parallelCase: (_, left, right) => onParallel(left, right)\n });\n});\n/** @internal */\nexport const reduce = /*#__PURE__*/dual(3, (self, zero, pf) => {\n let accumulator = zero;\n let cause = self;\n const causes = [];\n while (cause !== undefined) {\n const option = pf(accumulator, cause);\n accumulator = Option.isSome(option) ? option.value : accumulator;\n switch (cause._tag) {\n case OpCodes.OP_SEQUENTIAL:\n {\n causes.push(cause.right);\n cause = cause.left;\n break;\n }\n case OpCodes.OP_PARALLEL:\n {\n causes.push(cause.right);\n cause = cause.left;\n break;\n }\n default:\n {\n cause = undefined;\n break;\n }\n }\n if (cause === undefined && causes.length > 0) {\n cause = causes.pop();\n }\n }\n return accumulator;\n});\n/** @internal */\nexport const reduceWithContext = /*#__PURE__*/dual(3, (self, context, reducer) => {\n const input = [self];\n const output = [];\n while (input.length > 0) {\n const cause = input.pop();\n switch (cause._tag) {\n case OpCodes.OP_EMPTY:\n {\n output.push(Either.right(reducer.emptyCase(context)));\n break;\n }\n case OpCodes.OP_FAIL:\n {\n output.push(Either.right(reducer.failCase(context, cause.error)));\n break;\n }\n case OpCodes.OP_DIE:\n {\n output.push(Either.right(reducer.dieCase(context, cause.defect)));\n break;\n }\n case OpCodes.OP_INTERRUPT:\n {\n output.push(Either.right(reducer.interruptCase(context, cause.fiberId)));\n break;\n }\n case OpCodes.OP_SEQUENTIAL:\n {\n input.push(cause.right);\n input.push(cause.left);\n output.push(Either.left({\n _tag: OP_SEQUENTIAL_CASE\n }));\n break;\n }\n case OpCodes.OP_PARALLEL:\n {\n input.push(cause.right);\n input.push(cause.left);\n output.push(Either.left({\n _tag: OP_PARALLEL_CASE\n }));\n break;\n }\n }\n }\n const accumulator = [];\n while (output.length > 0) {\n const either = output.pop();\n switch (either._tag) {\n case \"Left\":\n {\n switch (either.left._tag) {\n case OP_SEQUENTIAL_CASE:\n {\n const left = accumulator.pop();\n const right = accumulator.pop();\n const value = reducer.sequentialCase(context, left, right);\n accumulator.push(value);\n break;\n }\n case OP_PARALLEL_CASE:\n {\n const left = accumulator.pop();\n const right = accumulator.pop();\n const value = reducer.parallelCase(context, left, right);\n accumulator.push(value);\n break;\n }\n }\n break;\n }\n case \"Right\":\n {\n accumulator.push(either.right);\n break;\n }\n }\n }\n if (accumulator.length === 0) {\n throw new Error(\"BUG: Cause.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues\");\n }\n return accumulator.pop();\n});\n// -----------------------------------------------------------------------------\n// Pretty Printing\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const pretty = (cause, options) => {\n if (isInterruptedOnly(cause)) {\n return \"All fibers interrupted without errors.\";\n }\n return prettyErrors(cause).map(function (e) {\n if (options?.renderErrorCause !== true || e.cause === undefined) {\n return e.stack;\n }\n return `${e.stack} {\\n${renderErrorCause(e.cause, \" \")}\\n}`;\n }).join(\"\\n\");\n};\nconst renderErrorCause = (cause, prefix) => {\n const lines = cause.stack.split(\"\\n\");\n let stack = `${prefix}[cause]: ${lines[0]}`;\n for (let i = 1, len = lines.length; i < len; i++) {\n stack += `\\n${prefix}${lines[i]}`;\n }\n if (cause.cause) {\n stack += ` {\\n${renderErrorCause(cause.cause, `${prefix} `)}\\n${prefix}}`;\n }\n return stack;\n};\n/** @internal */\nexport class PrettyError extends globalThis.Error {\n span = undefined;\n constructor(originalError) {\n const originalErrorIsObject = typeof originalError === \"object\" && originalError !== null;\n const prevLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 1;\n super(prettyErrorMessage(originalError), originalErrorIsObject && \"cause\" in originalError && typeof originalError.cause !== \"undefined\" ? {\n cause: new PrettyError(originalError.cause)\n } : undefined);\n if (this.message === \"\") {\n this.message = \"An error has occurred\";\n }\n Error.stackTraceLimit = prevLimit;\n this.name = originalError instanceof Error ? originalError.name : \"Error\";\n if (originalErrorIsObject) {\n if (spanSymbol in originalError) {\n this.span = originalError[spanSymbol];\n }\n Object.keys(originalError).forEach(key => {\n if (!(key in this)) {\n // @ts-expect-error\n this[key] = originalError[key];\n }\n });\n }\n this.stack = prettyErrorStack(`${this.name}: ${this.message}`, originalError instanceof Error && originalError.stack ? originalError.stack : \"\", this.span);\n }\n}\n/**\n * A utility function for generating human-readable error messages from a generic error of type `unknown`.\n *\n * Rules:\n *\n * 1) If the input `u` is already a string, it's considered a message.\n * 2) If `u` is an Error instance with a message defined, it uses the message.\n * 3) If `u` has a user-defined `toString()` method, it uses that method.\n * 4) Otherwise, it uses `Inspectable.stringifyCircular` to produce a string representation and uses it as the error message,\n * with \"Error\" added as a prefix.\n *\n * @internal\n */\nexport const prettyErrorMessage = u => {\n // 1)\n if (typeof u === \"string\") {\n return u;\n }\n // 2)\n if (typeof u === \"object\" && u !== null && u instanceof Error) {\n return u.message;\n }\n // 3)\n try {\n if (hasProperty(u, \"toString\") && isFunction(u[\"toString\"]) && u[\"toString\"] !== Object.prototype.toString && u[\"toString\"] !== globalThis.Array.prototype.toString) {\n return u[\"toString\"]();\n }\n } catch {\n // something's off, rollback to json\n }\n // 4)\n return stringifyCircular(u);\n};\nconst locationRegex = /\\((.*)\\)/g;\n/** @internal */\nexport const spanToTrace = /*#__PURE__*/globalValue(\"effect/Tracer/spanToTrace\", () => new WeakMap());\nconst prettyErrorStack = (message, stack, span) => {\n const out = [message];\n const lines = stack.startsWith(message) ? stack.slice(message.length).split(\"\\n\") : stack.split(\"\\n\");\n for (let i = 1; i < lines.length; i++) {\n if (lines[i].includes(\" at new BaseEffectError\") || lines[i].includes(\" at new YieldableError\")) {\n i++;\n continue;\n }\n if (lines[i].includes(\"Generator.next\")) {\n break;\n }\n if (lines[i].includes(\"effect_internal_function\")) {\n break;\n }\n out.push(lines[i].replace(/at .*effect_instruction_i.*\\((.*)\\)/, \"at $1\").replace(/EffectPrimitive\\.\\w+/, \"<anonymous>\"));\n }\n if (span) {\n let current = span;\n let i = 0;\n while (current && current._tag === \"Span\" && i < 10) {\n const stackFn = spanToTrace.get(current);\n if (typeof stackFn === \"function\") {\n const stack = stackFn();\n if (typeof stack === \"string\") {\n const locationMatchAll = stack.matchAll(locationRegex);\n let match = false;\n for (const [, location] of locationMatchAll) {\n match = true;\n out.push(` at ${current.name} (${location})`);\n }\n if (!match) {\n out.push(` at ${current.name} (${stack.replace(/^at /, \"\")})`);\n }\n } else {\n out.push(` at ${current.name}`);\n }\n } else {\n out.push(` at ${current.name}`);\n }\n current = Option.getOrUndefined(current.parent);\n i++;\n }\n }\n return out.join(\"\\n\");\n};\n/** @internal */\nexport const spanSymbol = /*#__PURE__*/Symbol.for(\"effect/SpanAnnotation\");\n/** @internal */\nexport const prettyErrors = cause => reduceWithContext(cause, void 0, {\n emptyCase: () => [],\n dieCase: (_, unknownError) => {\n return [new PrettyError(unknownError)];\n },\n failCase: (_, error) => {\n return [new PrettyError(error)];\n },\n interruptCase: () => [],\n parallelCase: (_, l, r) => [...l, ...r],\n sequentialCase: (_, l, r) => [...l, ...r]\n});\n//# sourceMappingURL=cause.js.map","/** @internal */\nexport const OP_STATE_PENDING = \"Pending\";\n/** @internal */\nexport const OP_STATE_DONE = \"Done\";\n//# sourceMappingURL=deferred.js.map","import * as OpCodes from \"./opCodes/deferred.js\";\n/** @internal */\nconst DeferredSymbolKey = \"effect/Deferred\";\n/** @internal */\nexport const DeferredTypeId = /*#__PURE__*/Symbol.for(DeferredSymbolKey);\n/** @internal */\nexport const deferredVariance = {\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _A: _ => _\n};\n/** @internal */\nexport const pending = joiners => {\n return {\n _tag: OpCodes.OP_STATE_PENDING,\n joiners\n };\n};\n/** @internal */\nexport const done = effect => {\n return {\n _tag: OpCodes.OP_STATE_DONE,\n effect\n };\n};\n//# sourceMappingURL=deferred.js.map","/** @internal */\nexport class SingleShotGen {\n self;\n called = false;\n constructor(self) {\n this.self = self;\n }\n next(a) {\n return this.called ? {\n value: a,\n done: true\n } : (this.called = true, {\n value: this.self,\n done: false\n });\n }\n return(a) {\n return {\n value: a,\n done: true\n };\n }\n throw(e) {\n throw e;\n }\n [Symbol.iterator]() {\n return new SingleShotGen(this.self);\n }\n}\n//# sourceMappingURL=singleShotGen.js.map","import * as Arr from \"../Array.js\";\nimport * as Chunk from \"../Chunk.js\";\nimport * as Context from \"../Context.js\";\nimport * as Duration from \"../Duration.js\";\nimport * as Either from \"../Either.js\";\nimport * as Equal from \"../Equal.js\";\nimport * as FiberId from \"../FiberId.js\";\nimport { dual, identity, pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as Hash from \"../Hash.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"../Inspectable.js\";\nimport * as List from \"../List.js\";\nimport * as MutableRef from \"../MutableRef.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty, isObject, isPromiseLike } from \"../Predicate.js\";\nimport * as RuntimeFlagsPatch from \"../RuntimeFlagsPatch.js\";\nimport { internalCall, YieldWrap } from \"../Utils.js\";\nimport * as blockedRequests_ from \"./blockedRequests.js\";\nimport * as internalCause from \"./cause.js\";\nimport * as deferred from \"./deferred.js\";\nimport * as internalDiffer from \"./differ.js\";\nimport { CommitPrototype, effectVariance, StructuralCommitPrototype } from \"./effectable.js\";\nimport { getBugErrorMessage } from \"./errors.js\";\nimport * as DeferredOpCodes from \"./opCodes/deferred.js\";\nimport * as OpCodes from \"./opCodes/effect.js\";\nimport * as runtimeFlags_ from \"./runtimeFlags.js\";\nimport { SingleShotGen } from \"./singleShotGen.js\";\n// -----------------------------------------------------------------------------\n// Effect\n// -----------------------------------------------------------------------------\n/**\n * @internal\n */\nexport const blocked = (blockedRequests, _continue) => {\n const effect = new EffectPrimitive(\"Blocked\");\n effect.effect_instruction_i0 = blockedRequests;\n effect.effect_instruction_i1 = _continue;\n return effect;\n};\n/**\n * @internal\n */\nexport const runRequestBlock = blockedRequests => {\n const effect = new EffectPrimitive(\"RunBlocked\");\n effect.effect_instruction_i0 = blockedRequests;\n return effect;\n};\n/** @internal */\nexport const EffectTypeId = /*#__PURE__*/Symbol.for(\"effect/Effect\");\n/** @internal */\nexport class RevertFlags {\n patch;\n op;\n _op = OpCodes.OP_REVERT_FLAGS;\n constructor(patch, op) {\n this.patch = patch;\n this.op = op;\n }\n}\nclass EffectPrimitive {\n _op;\n effect_instruction_i0 = undefined;\n effect_instruction_i1 = undefined;\n effect_instruction_i2 = undefined;\n trace = undefined;\n [EffectTypeId] = effectVariance;\n constructor(_op) {\n this._op = _op;\n }\n [Equal.symbol](that) {\n return this === that;\n }\n [Hash.symbol]() {\n return Hash.cached(this, Hash.random(this));\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n toJSON() {\n return {\n _id: \"Effect\",\n _op: this._op,\n effect_instruction_i0: toJSON(this.effect_instruction_i0),\n effect_instruction_i1: toJSON(this.effect_instruction_i1),\n effect_instruction_i2: toJSON(this.effect_instruction_i2)\n };\n }\n toString() {\n return format(this.toJSON());\n }\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n [Symbol.iterator]() {\n return new SingleShotGen(new YieldWrap(this));\n }\n}\n/** @internal */\nclass EffectPrimitiveFailure {\n _op;\n effect_instruction_i0 = undefined;\n effect_instruction_i1 = undefined;\n effect_instruction_i2 = undefined;\n trace = undefined;\n [EffectTypeId] = effectVariance;\n constructor(_op) {\n this._op = _op;\n // @ts-expect-error\n this._tag = _op;\n }\n [Equal.symbol](that) {\n return exitIsExit(that) && that._op === \"Failure\" &&\n // @ts-expect-error\n Equal.equals(this.effect_instruction_i0, that.effect_instruction_i0);\n }\n [Hash.symbol]() {\n return pipe(\n // @ts-expect-error\n Hash.string(this._tag),\n // @ts-expect-error\n Hash.combine(Hash.hash(this.effect_instruction_i0)), Hash.cached(this));\n }\n get cause() {\n return this.effect_instruction_i0;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n toJSON() {\n return {\n _id: \"Exit\",\n _tag: this._op,\n cause: this.cause.toJSON()\n };\n }\n toString() {\n return format(this.toJSON());\n }\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n [Symbol.iterator]() {\n return new SingleShotGen(new YieldWrap(this));\n }\n}\n/** @internal */\nclass EffectPrimitiveSuccess {\n _op;\n effect_instruction_i0 = undefined;\n effect_instruction_i1 = undefined;\n effect_instruction_i2 = undefined;\n trace = undefined;\n [EffectTypeId] = effectVariance;\n constructor(_op) {\n this._op = _op;\n // @ts-expect-error\n this._tag = _op;\n }\n [Equal.symbol](that) {\n return exitIsExit(that) && that._op === \"Success\" &&\n // @ts-expect-error\n Equal.equals(this.effect_instruction_i0, that.effect_instruction_i0);\n }\n [Hash.symbol]() {\n return pipe(\n // @ts-expect-error\n Hash.string(this._tag),\n // @ts-expect-error\n Hash.combine(Hash.hash(this.effect_instruction_i0)), Hash.cached(this));\n }\n get value() {\n return this.effect_instruction_i0;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n toJSON() {\n return {\n _id: \"Exit\",\n _tag: this._op,\n value: toJSON(this.value)\n };\n }\n toString() {\n return format(this.toJSON());\n }\n [NodeInspectSymbol]() {\n return this.toJSON();\n }\n [Symbol.iterator]() {\n return new SingleShotGen(new YieldWrap(this));\n }\n}\n/** @internal */\nexport const isEffect = u => hasProperty(u, EffectTypeId);\n/* @internal */\nexport const withFiberRuntime = withRuntime => {\n const effect = new EffectPrimitive(OpCodes.OP_WITH_RUNTIME);\n effect.effect_instruction_i0 = withRuntime;\n return effect;\n};\n/* @internal */\nexport const acquireUseRelease = /*#__PURE__*/dual(3, (acquire, use, release) => uninterruptibleMask(restore => flatMap(acquire, a => flatMap(exit(suspend(() => restore(use(a)))), exit => {\n return suspend(() => release(a, exit)).pipe(matchCauseEffect({\n onFailure: cause => {\n switch (exit._tag) {\n case OpCodes.OP_FAILURE:\n return failCause(internalCause.sequential(exit.effect_instruction_i0, cause));\n case OpCodes.OP_SUCCESS:\n return failCause(cause);\n }\n },\n onSuccess: () => exit\n }));\n}))));\n/* @internal */\nexport const as = /*#__PURE__*/dual(2, (self, value) => flatMap(self, () => succeed(value)));\n/* @internal */\nexport const asVoid = self => as(self, void 0);\n/* @internal */\nexport const custom = function () {\n const wrapper = new EffectPrimitive(OpCodes.OP_COMMIT);\n switch (arguments.length) {\n case 2:\n {\n wrapper.effect_instruction_i0 = arguments[0];\n wrapper.commit = arguments[1];\n break;\n }\n case 3:\n {\n wrapper.effect_instruction_i0 = arguments[0];\n wrapper.effect_instruction_i1 = arguments[1];\n wrapper.commit = arguments[2];\n break;\n }\n case 4:\n {\n wrapper.effect_instruction_i0 = arguments[0];\n wrapper.effect_instruction_i1 = arguments[1];\n wrapper.effect_instruction_i2 = arguments[2];\n wrapper.commit = arguments[3];\n break;\n }\n default:\n {\n throw new Error(getBugErrorMessage(\"you're not supposed to end up here\"));\n }\n }\n return wrapper;\n};\n/* @internal */\nexport const unsafeAsync = (register, blockingOn = FiberId.none) => {\n const effect = new EffectPrimitive(OpCodes.OP_ASYNC);\n let cancelerRef = undefined;\n effect.effect_instruction_i0 = resume => {\n cancelerRef = register(resume);\n };\n effect.effect_instruction_i1 = blockingOn;\n return onInterrupt(effect, _ => isEffect(cancelerRef) ? cancelerRef : void_);\n};\n/* @internal */\nexport const asyncInterrupt = (register, blockingOn = FiberId.none) => suspend(() => unsafeAsync(register, blockingOn));\nconst async_ = (resume, blockingOn = FiberId.none) => {\n return custom(resume, function () {\n let backingResume = undefined;\n let pendingEffect = undefined;\n function proxyResume(effect) {\n if (backingResume) {\n backingResume(effect);\n } else if (pendingEffect === undefined) {\n pendingEffect = effect;\n }\n }\n const effect = new EffectPrimitive(OpCodes.OP_ASYNC);\n effect.effect_instruction_i0 = resume => {\n backingResume = resume;\n if (pendingEffect) {\n resume(pendingEffect);\n }\n };\n effect.effect_instruction_i1 = blockingOn;\n let cancelerRef = undefined;\n let controllerRef = undefined;\n if (this.effect_instruction_i0.length !== 1) {\n controllerRef = new AbortController();\n cancelerRef = internalCall(() => this.effect_instruction_i0(proxyResume, controllerRef.signal));\n } else {\n cancelerRef = internalCall(() => this.effect_instruction_i0(proxyResume));\n }\n return cancelerRef || controllerRef ? onInterrupt(effect, _ => {\n if (controllerRef) {\n controllerRef.abort();\n }\n return cancelerRef ?? void_;\n }) : effect;\n });\n};\nexport { /** @internal */\nasync_ as async };\n/* @internal */\nexport const catchAllCause = /*#__PURE__*/dual(2, (self, f) => {\n const effect = new EffectPrimitive(OpCodes.OP_ON_FAILURE);\n effect.effect_instruction_i0 = self;\n effect.effect_instruction_i1 = f;\n return effect;\n});\n/* @internal */\nexport const catchAll = /*#__PURE__*/dual(2, (self, f) => matchEffect(self, {\n onFailure: f,\n onSuccess: succeed\n}));\n/* @internal */\nexport const catchIf = /*#__PURE__*/dual(3, (self, predicate, f) => catchAllCause(self, cause => {\n const either = internalCause.failureOrCause(cause);\n switch (either._tag) {\n case \"Left\":\n return predicate(either.left) ? f(either.left) : failCause(cause);\n case \"Right\":\n return failCause(either.right);\n }\n}));\n/* @internal */\nexport const catchSome = /*#__PURE__*/dual(2, (self, pf) => catchAllCause(self, cause => {\n const either = internalCause.failureOrCause(cause);\n switch (either._tag) {\n case \"Left\":\n return pipe(pf(either.left), Option.getOrElse(() => failCause(cause)));\n case \"Right\":\n return failCause(either.right);\n }\n}));\n/* @internal */\nexport const checkInterruptible = f => withFiberRuntime((_, status) => f(runtimeFlags_.interruption(status.runtimeFlags)));\nconst originalSymbol = /*#__PURE__*/Symbol.for(\"effect/OriginalAnnotation\");\n/* @internal */\nexport const originalInstance = obj => {\n if (hasProperty(obj, originalSymbol)) {\n // @ts-expect-error\n return obj[originalSymbol];\n }\n return obj;\n};\n/* @internal */\nexport const capture = (obj, span) => {\n if (Option.isSome(span)) {\n return new Proxy(obj, {\n has(target, p) {\n return p === internalCause.spanSymbol || p === originalSymbol || p in target;\n },\n get(target, p) {\n if (p === internalCause.spanSymbol) {\n return span.value;\n }\n if (p === originalSymbol) {\n return obj;\n }\n // @ts-expect-error\n return target[p];\n }\n });\n }\n return obj;\n};\n/* @internal */\nexport const die = defect => isObject(defect) && !(internalCause.spanSymbol in defect) ? withFiberRuntime(fiber => failCause(internalCause.die(capture(defect, currentSpanFromFiber(fiber))))) : failCause(internalCause.die(defect));\n/* @internal */\nexport const dieMessage = message => failCauseSync(() => internalCause.die(new RuntimeException(message)));\n/* @internal */\nexport const dieSync = evaluate => flatMap(sync(evaluate), die);\n/* @internal */\nexport const either = self => matchEffect(self, {\n onFailure: e => succeed(Either.left(e)),\n onSuccess: a => succeed(Either.right(a))\n});\n/* @internal */\nexport const exit = self => matchCause(self, {\n onFailure: exitFailCause,\n onSuccess: exitSucceed\n});\n/* @internal */\nexport const fail = error => isObject(error) && !(internalCause.spanSymbol in error) ? withFiberRuntime(fiber => failCause(internalCause.fail(capture(error, currentSpanFromFiber(fiber))))) : failCause(internalCause.fail(error));\n/* @internal */\nexport const failSync = evaluate => flatMap(sync(evaluate), fail);\n/* @internal */\nexport const failCause = cause => {\n const effect = new EffectPrimitiveFailure(OpCodes.OP_FAILURE);\n effect.effect_instruction_i0 = cause;\n return effect;\n};\n/* @internal */\nexport const failCauseSync = evaluate => flatMap(sync(evaluate), failCause);\n/* @internal */\nexport const fiberId = /*#__PURE__*/withFiberRuntime(state => succeed(state.id()));\n/* @internal */\nexport const fiberIdWith = f => withFiberRuntime(state => f(state.id()));\n/* @internal */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n const effect = new EffectPrimitive(OpCodes.OP_ON_SUCCESS);\n effect.effect_instruction_i0 = self;\n effect.effect_instruction_i1 = f;\n return effect;\n});\n/* @internal */\nexport const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {\n const b = typeof f === \"function\" ? f(a) : f;\n if (isEffect(b)) {\n return b;\n } else if (isPromiseLike(b)) {\n return unsafeAsync(resume => {\n b.then(a => resume(succeed(a)), e => resume(fail(new UnknownException(e, \"An unknown error occurred in Effect.andThen\"))));\n });\n }\n return succeed(b);\n}));\n/* @internal */\nexport const step = self => {\n const effect = new EffectPrimitive(\"OnStep\");\n effect.effect_instruction_i0 = self;\n return effect;\n};\n/* @internal */\nexport const flatten = self => flatMap(self, identity);\n/* @internal */\nexport const flip = self => matchEffect(self, {\n onFailure: succeed,\n onSuccess: fail\n});\n/* @internal */\nexport const matchCause = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect(self, {\n onFailure: cause => succeed(options.onFailure(cause)),\n onSuccess: a => succeed(options.onSuccess(a))\n}));\n/* @internal */\nexport const matchCauseEffect = /*#__PURE__*/dual(2, (self, options) => {\n const effect = new EffectPrimitive(OpCodes.OP_ON_SUCCESS_AND_FAILURE);\n effect.effect_instruction_i0 = self;\n effect.effect_instruction_i1 = options.onFailure;\n effect.effect_instruction_i2 = options.onSuccess;\n return effect;\n});\n/* @internal */\nexport const matchEffect = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect(self, {\n onFailure: cause => {\n const defects = internalCause.defects(cause);\n if (defects.length > 0) {\n return failCause(internalCause.electFailures(cause));\n }\n const failures = internalCause.failures(cause);\n if (failures.length > 0) {\n return options.onFailure(Chunk.unsafeHead(failures));\n }\n return failCause(cause);\n },\n onSuccess: options.onSuccess\n}));\n/* @internal */\nexport const forEachSequential = /*#__PURE__*/dual(2, (self, f) => suspend(() => {\n const arr = Arr.fromIterable(self);\n const ret = Arr.allocate(arr.length);\n let i = 0;\n return as(whileLoop({\n while: () => i < arr.length,\n body: () => f(arr[i], i),\n step: b => {\n ret[i++] = b;\n }\n }), ret);\n}));\n/* @internal */\nexport const forEachSequentialDiscard = /*#__PURE__*/dual(2, (self, f) => suspend(() => {\n const arr = Arr.fromIterable(self);\n let i = 0;\n return whileLoop({\n while: () => i < arr.length,\n body: () => f(arr[i], i),\n step: () => {\n i++;\n }\n });\n}));\n/* @internal */\nexport const if_ = /*#__PURE__*/dual(args => typeof args[0] === \"boolean\" || isEffect(args[0]), (self, options) => isEffect(self) ? flatMap(self, b => b ? options.onTrue() : options.onFalse()) : self ? options.onTrue() : options.onFalse());\n/* @internal */\nexport const interrupt = /*#__PURE__*/flatMap(fiberId, fiberId => interruptWith(fiberId));\n/* @internal */\nexport const interruptWith = fiberId => failCause(internalCause.interrupt(fiberId));\n/* @internal */\nexport const interruptible = self => {\n const effect = new EffectPrimitive(OpCodes.OP_UPDATE_RUNTIME_FLAGS);\n effect.effect_instruction_i0 = RuntimeFlagsPatch.enable(runtimeFlags_.Interruption);\n effect.effect_instruction_i1 = () => self;\n return effect;\n};\n/* @internal */\nexport const interruptibleMask = f => custom(f, function () {\n const effect = new EffectPrimitive(OpCodes.OP_UPDATE_RUNTIME_FLAGS);\n effect.effect_instruction_i0 = RuntimeFlagsPatch.enable(runtimeFlags_.Interruption);\n effect.effect_instruction_i1 = oldFlags => runtimeFlags_.interruption(oldFlags) ? internalCall(() => this.effect_instruction_i0(interruptible)) : internalCall(() => this.effect_instruction_i0(uninterruptible));\n return effect;\n});\n/* @internal */\nexport const intoDeferred = /*#__PURE__*/dual(2, (self, deferred) => uninterruptibleMask(restore => flatMap(exit(restore(self)), exit => deferredDone(deferred, exit))));\n/* @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => sync(() => f(a))));\n/* @internal */\nexport const mapBoth = /*#__PURE__*/dual(2, (self, options) => matchEffect(self, {\n onFailure: e => failSync(() => options.onFailure(e)),\n onSuccess: a => sync(() => options.onSuccess(a))\n}));\n/* @internal */\nexport const mapError = /*#__PURE__*/dual(2, (self, f) => matchCauseEffect(self, {\n onFailure: cause => {\n const either = internalCause.failureOrCause(cause);\n switch (either._tag) {\n case \"Left\":\n {\n return failSync(() => f(either.left));\n }\n case \"Right\":\n {\n return failCause(either.right);\n }\n }\n },\n onSuccess: succeed\n}));\n/* @internal */\nexport const onError = /*#__PURE__*/dual(2, (self, cleanup) => onExit(self, exit => exitIsSuccess(exit) ? void_ : cleanup(exit.effect_instruction_i0)));\n/* @internal */\nexport const onExit = /*#__PURE__*/dual(2, (self, cleanup) => uninterruptibleMask(restore => matchCauseEffect(restore(self), {\n onFailure: cause1 => {\n const result = exitFailCause(cause1);\n return matchCauseEffect(cleanup(result), {\n onFailure: cause2 => exitFailCause(internalCause.sequential(cause1, cause2)),\n onSuccess: () => result\n });\n },\n onSuccess: success => {\n const result = exitSucceed(success);\n return zipRight(cleanup(result), result);\n }\n})));\n/* @internal */\nexport const onInterrupt = /*#__PURE__*/dual(2, (self, cleanup) => onExit(self, exitMatch({\n onFailure: cause => internalCause.isInterruptedOnly(cause) ? asVoid(cleanup(internalCause.interruptors(cause))) : void_,\n onSuccess: () => void_\n})));\n/* @internal */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => attemptOrElse(self, that, succeed));\n/* @internal */\nexport const orDie = self => orDieWith(self, identity);\n/* @internal */\nexport const orDieWith = /*#__PURE__*/dual(2, (self, f) => matchEffect(self, {\n onFailure: e => die(f(e)),\n onSuccess: succeed\n}));\n/* @internal */\nexport const partitionMap = Arr.partitionMap;\n/* @internal */\nexport const runtimeFlags = /*#__PURE__*/withFiberRuntime((_, status) => succeed(status.runtimeFlags));\n/* @internal */\nexport const succeed = value => {\n const effect = new EffectPrimitiveSuccess(OpCodes.OP_SUCCESS);\n effect.effect_instruction_i0 = value;\n return effect;\n};\n/* @internal */\nexport const suspend = evaluate => {\n const effect = new EffectPrimitive(OpCodes.OP_COMMIT);\n effect.commit = evaluate;\n return effect;\n};\n/* @internal */\nexport const sync = thunk => {\n const effect = new EffectPrimitive(OpCodes.OP_SYNC);\n effect.effect_instruction_i0 = thunk;\n return effect;\n};\n/* @internal */\nexport const tap = /*#__PURE__*/dual(args => args.length === 3 || args.length === 2 && !(isObject(args[1]) && \"onlyEffect\" in args[1]), (self, f) => flatMap(self, a => {\n const b = typeof f === \"function\" ? f(a) : f;\n if (isEffect(b)) {\n return as(b, a);\n } else if (isPromiseLike(b)) {\n return unsafeAsync(resume => {\n b.then(_ => resume(succeed(a)), e => resume(fail(new UnknownException(e, \"An unknown error occurred in Effect.tap\"))));\n });\n }\n return succeed(a);\n}));\n/* @internal */\nexport const transplant = f => withFiberRuntime(state => {\n const scopeOverride = state.getFiberRef(currentForkScopeOverride);\n const scope = pipe(scopeOverride, Option.getOrElse(() => state.scope()));\n return f(fiberRefLocally(currentForkScopeOverride, Option.some(scope)));\n});\n/* @internal */\nexport const attemptOrElse = /*#__PURE__*/dual(3, (self, that, onSuccess) => matchCauseEffect(self, {\n onFailure: cause => {\n const defects = internalCause.defects(cause);\n if (defects.length > 0) {\n return failCause(Option.getOrThrow(internalCause.keepDefectsAndElectFailures(cause)));\n }\n return that();\n },\n onSuccess\n}));\n/* @internal */\nexport const uninterruptible = self => {\n const effect = new EffectPrimitive(OpCodes.OP_UPDATE_RUNTIME_FLAGS);\n effect.effect_instruction_i0 = RuntimeFlagsPatch.disable(runtimeFlags_.Interruption);\n effect.effect_instruction_i1 = () => self;\n return effect;\n};\n/* @internal */\nexport const uninterruptibleMask = f => custom(f, function () {\n const effect = new EffectPrimitive(OpCodes.OP_UPDATE_RUNTIME_FLAGS);\n effect.effect_instruction_i0 = RuntimeFlagsPatch.disable(runtimeFlags_.Interruption);\n effect.effect_instruction_i1 = oldFlags => runtimeFlags_.interruption(oldFlags) ? internalCall(() => this.effect_instruction_i0(interruptible)) : internalCall(() => this.effect_instruction_i0(uninterruptible));\n return effect;\n});\nconst void_ = /*#__PURE__*/succeed(void 0);\nexport { /* @internal */\nvoid_ as void };\n/* @internal */\nexport const updateRuntimeFlags = patch => {\n const effect = new EffectPrimitive(OpCodes.OP_UPDATE_RUNTIME_FLAGS);\n effect.effect_instruction_i0 = patch;\n effect.effect_instruction_i1 = void 0;\n return effect;\n};\n/* @internal */\nexport const whenEffect = /*#__PURE__*/dual(2, (self, condition) => flatMap(condition, b => {\n if (b) {\n return pipe(self, map(Option.some));\n }\n return succeed(Option.none());\n}));\n/* @internal */\nexport const whileLoop = options => {\n const effect = new EffectPrimitive(OpCodes.OP_WHILE);\n effect.effect_instruction_i0 = options.while;\n effect.effect_instruction_i1 = options.body;\n effect.effect_instruction_i2 = options.step;\n return effect;\n};\n/* @internal */\nexport const fromIterator = iterator => suspend(() => {\n const effect = new EffectPrimitive(OpCodes.OP_ITERATOR);\n effect.effect_instruction_i0 = iterator();\n return effect;\n});\n/* @internal */\nexport const gen = function () {\n const f = arguments.length === 1 ? arguments[0] : arguments[1].bind(arguments[0]);\n return fromIterator(() => f(pipe));\n};\n/** @internal */\nexport const fnUntraced = (body, ...pipeables) => Object.defineProperty(pipeables.length === 0 ? function (...args) {\n return fromIterator(() => body.apply(this, args));\n} : function (...args) {\n let effect = fromIterator(() => body.apply(this, args));\n for (const x of pipeables) {\n effect = x(effect, ...args);\n }\n return effect;\n}, \"length\", {\n value: body.length,\n configurable: true\n});\n/* @internal */\nexport const withConcurrency = /*#__PURE__*/dual(2, (self, concurrency) => fiberRefLocally(self, currentConcurrency, concurrency));\n/* @internal */\nexport const withRequestBatching = /*#__PURE__*/dual(2, (self, requestBatching) => fiberRefLocally(self, currentRequestBatching, requestBatching));\n/* @internal */\nexport const withRuntimeFlags = /*#__PURE__*/dual(2, (self, update) => {\n const effect = new EffectPrimitive(OpCodes.OP_UPDATE_RUNTIME_FLAGS);\n effect.effect_instruction_i0 = update;\n effect.effect_instruction_i1 = () => self;\n return effect;\n});\n/** @internal */\nexport const withTracerEnabled = /*#__PURE__*/dual(2, (effect, enabled) => fiberRefLocally(effect, currentTracerEnabled, enabled));\n/** @internal */\nexport const withTracerTiming = /*#__PURE__*/dual(2, (effect, enabled) => fiberRefLocally(effect, currentTracerTimingEnabled, enabled));\n/* @internal */\nexport const yieldNow = options => {\n const effect = new EffectPrimitive(OpCodes.OP_YIELD);\n return typeof options?.priority !== \"undefined\" ? withSchedulingPriority(effect, options.priority) : effect;\n};\n/* @internal */\nexport const zip = /*#__PURE__*/dual(2, (self, that) => flatMap(self, a => map(that, b => [a, b])));\n/* @internal */\nexport const zipFlatten = /*#__PURE__*/dual(2, (self, that) => flatMap(self, a => map(that, b => [...a, b])));\n/* @internal */\nexport const zipLeft = /*#__PURE__*/dual(2, (self, that) => flatMap(self, a => as(that, a)));\n/* @internal */\nexport const zipRight = /*#__PURE__*/dual(2, (self, that) => flatMap(self, () => that));\n/* @internal */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => flatMap(self, a => map(that, b => f(a, b))));\n/* @internal */\nexport const never = /*#__PURE__*/asyncInterrupt(() => {\n const interval = setInterval(() => {\n //\n }, 2 ** 31 - 1);\n return sync(() => clearInterval(interval));\n});\n// -----------------------------------------------------------------------------\n// Fiber\n// -----------------------------------------------------------------------------\n/* @internal */\nexport const interruptFiber = self => flatMap(fiberId, fiberId => pipe(self, interruptAsFiber(fiberId)));\n/* @internal */\nexport const interruptAsFiber = /*#__PURE__*/dual(2, (self, fiberId) => flatMap(self.interruptAsFork(fiberId), () => self.await));\n// -----------------------------------------------------------------------------\n// LogLevel\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const logLevelAll = {\n _tag: \"All\",\n syslog: 0,\n label: \"ALL\",\n ordinal: Number.MIN_SAFE_INTEGER,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelFatal = {\n _tag: \"Fatal\",\n syslog: 2,\n label: \"FATAL\",\n ordinal: 50000,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelError = {\n _tag: \"Error\",\n syslog: 3,\n label: \"ERROR\",\n ordinal: 40000,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelWarning = {\n _tag: \"Warning\",\n syslog: 4,\n label: \"WARN\",\n ordinal: 30000,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelInfo = {\n _tag: \"Info\",\n syslog: 6,\n label: \"INFO\",\n ordinal: 20000,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelDebug = {\n _tag: \"Debug\",\n syslog: 7,\n label: \"DEBUG\",\n ordinal: 10000,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelTrace = {\n _tag: \"Trace\",\n syslog: 7,\n label: \"TRACE\",\n ordinal: 0,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const logLevelNone = {\n _tag: \"None\",\n syslog: 7,\n label: \"OFF\",\n ordinal: Number.MAX_SAFE_INTEGER,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const allLogLevels = [logLevelAll, logLevelTrace, logLevelDebug, logLevelInfo, logLevelWarning, logLevelError, logLevelFatal, logLevelNone];\n// -----------------------------------------------------------------------------\n// FiberRef\n// -----------------------------------------------------------------------------\n/** @internal */\nconst FiberRefSymbolKey = \"effect/FiberRef\";\n/** @internal */\nexport const FiberRefTypeId = /*#__PURE__*/Symbol.for(FiberRefSymbolKey);\nconst fiberRefVariance = {\n /* c8 ignore next */\n _A: _ => _\n};\n/* @internal */\nexport const fiberRefGet = self => withFiberRuntime(fiber => exitSucceed(fiber.getFiberRef(self)));\n/* @internal */\nexport const fiberRefGetAndSet = /*#__PURE__*/dual(2, (self, value) => fiberRefModify(self, v => [v, value]));\n/* @internal */\nexport const fiberRefGetAndUpdate = /*#__PURE__*/dual(2, (self, f) => fiberRefModify(self, v => [v, f(v)]));\n/* @internal */\nexport const fiberRefGetAndUpdateSome = /*#__PURE__*/dual(2, (self, pf) => fiberRefModify(self, v => [v, Option.getOrElse(pf(v), () => v)]));\n/* @internal */\nexport const fiberRefGetWith = /*#__PURE__*/dual(2, (self, f) => flatMap(fiberRefGet(self), f));\n/* @internal */\nexport const fiberRefSet = /*#__PURE__*/dual(2, (self, value) => fiberRefModify(self, () => [void 0, value]));\n/* @internal */\nexport const fiberRefDelete = self => withFiberRuntime(state => {\n state.unsafeDeleteFiberRef(self);\n return void_;\n});\n/* @internal */\nexport const fiberRefReset = self => fiberRefSet(self, self.initial);\n/* @internal */\nexport const fiberRefModify = /*#__PURE__*/dual(2, (self, f) => withFiberRuntime(state => {\n const [b, a] = f(state.getFiberRef(self));\n state.setFiberRef(self, a);\n return succeed(b);\n}));\n/* @internal */\nexport const fiberRefModifySome = (self, def, f) => fiberRefModify(self, v => Option.getOrElse(f(v), () => [def, v]));\n/* @internal */\nexport const fiberRefUpdate = /*#__PURE__*/dual(2, (self, f) => fiberRefModify(self, v => [void 0, f(v)]));\n/* @internal */\nexport const fiberRefUpdateSome = /*#__PURE__*/dual(2, (self, pf) => fiberRefModify(self, v => [void 0, Option.getOrElse(pf(v), () => v)]));\n/* @internal */\nexport const fiberRefUpdateAndGet = /*#__PURE__*/dual(2, (self, f) => fiberRefModify(self, v => {\n const result = f(v);\n return [result, result];\n}));\n/* @internal */\nexport const fiberRefUpdateSomeAndGet = /*#__PURE__*/dual(2, (self, pf) => fiberRefModify(self, v => {\n const result = Option.getOrElse(pf(v), () => v);\n return [result, result];\n}));\n// circular\n/** @internal */\nconst RequestResolverSymbolKey = \"effect/RequestResolver\";\n/** @internal */\nexport const RequestResolverTypeId = /*#__PURE__*/Symbol.for(RequestResolverSymbolKey);\nconst requestResolverVariance = {\n /* c8 ignore next */\n _A: _ => _,\n /* c8 ignore next */\n _R: _ => _\n};\n/** @internal */\nexport class RequestResolverImpl {\n runAll;\n target;\n [RequestResolverTypeId] = requestResolverVariance;\n constructor(runAll, target) {\n this.runAll = runAll;\n this.target = target;\n }\n [Hash.symbol]() {\n return Hash.cached(this, this.target ? Hash.hash(this.target) : Hash.random(this));\n }\n [Equal.symbol](that) {\n return this.target ? isRequestResolver(that) && Equal.equals(this.target, that.target) : this === that;\n }\n identified(...ids) {\n return new RequestResolverImpl(this.runAll, Chunk.fromIterable(ids));\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const isRequestResolver = u => hasProperty(u, RequestResolverTypeId);\n// end\n/** @internal */\nexport const resolverLocally = /*#__PURE__*/dual(3, (use, self, value) => new RequestResolverImpl(requests => fiberRefLocally(use.runAll(requests), self, value), Chunk.make(\"Locally\", use, self, value)));\n/** @internal */\nexport const requestBlockLocally = (self, ref, value) => blockedRequests_.reduce(self, LocallyReducer(ref, value));\nconst LocallyReducer = (ref, value) => ({\n emptyCase: () => blockedRequests_.empty,\n parCase: (left, right) => blockedRequests_.par(left, right),\n seqCase: (left, right) => blockedRequests_.seq(left, right),\n singleCase: (dataSource, blockedRequest) => blockedRequests_.single(resolverLocally(dataSource, ref, value), blockedRequest)\n});\n/* @internal */\nexport const fiberRefLocally = /*#__PURE__*/dual(3, (use, self, value) => acquireUseRelease(zipLeft(fiberRefGet(self), fiberRefSet(self, value)), () => use, oldValue => fiberRefSet(self, oldValue)));\n/* @internal */\nexport const fiberRefLocallyWith = /*#__PURE__*/dual(3, (use, self, f) => fiberRefGetWith(self, a => fiberRefLocally(use, self, f(a))));\n/** @internal */\nexport const fiberRefUnsafeMake = (initial, options) => fiberRefUnsafeMakePatch(initial, {\n differ: internalDiffer.update(),\n fork: options?.fork ?? identity,\n join: options?.join\n});\n/** @internal */\nexport const fiberRefUnsafeMakeHashSet = initial => {\n const differ = internalDiffer.hashSet();\n return fiberRefUnsafeMakePatch(initial, {\n differ,\n fork: differ.empty\n });\n};\n/** @internal */\nexport const fiberRefUnsafeMakeReadonlyArray = initial => {\n const differ = internalDiffer.readonlyArray(internalDiffer.update());\n return fiberRefUnsafeMakePatch(initial, {\n differ,\n fork: differ.empty\n });\n};\n/** @internal */\nexport const fiberRefUnsafeMakeContext = initial => {\n const differ = internalDiffer.environment();\n return fiberRefUnsafeMakePatch(initial, {\n differ,\n fork: differ.empty\n });\n};\n/** @internal */\nexport const fiberRefUnsafeMakePatch = (initial, options) => {\n const _fiberRef = {\n ...CommitPrototype,\n [FiberRefTypeId]: fiberRefVariance,\n initial,\n commit() {\n return fiberRefGet(this);\n },\n diff: (oldValue, newValue) => options.differ.diff(oldValue, newValue),\n combine: (first, second) => options.differ.combine(first, second),\n patch: patch => oldValue => options.differ.patch(patch, oldValue),\n fork: options.fork,\n join: options.join ?? ((_, n) => n)\n };\n return _fiberRef;\n};\n/** @internal */\nexport const fiberRefUnsafeMakeRuntimeFlags = initial => fiberRefUnsafeMakePatch(initial, {\n differ: runtimeFlags_.differ,\n fork: runtimeFlags_.differ.empty\n});\n/** @internal */\nexport const currentContext = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentContext\"), () => fiberRefUnsafeMakeContext(Context.empty()));\n/** @internal */\nexport const currentSchedulingPriority = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentSchedulingPriority\"), () => fiberRefUnsafeMake(0));\n/** @internal */\nexport const currentMaxOpsBeforeYield = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentMaxOpsBeforeYield\"), () => fiberRefUnsafeMake(2048));\n/** @internal */\nexport const currentLogAnnotations = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentLogAnnotation\"), () => fiberRefUnsafeMake(HashMap.empty()));\n/** @internal */\nexport const currentLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentLogLevel\"), () => fiberRefUnsafeMake(logLevelInfo));\n/** @internal */\nexport const currentLogSpan = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentLogSpan\"), () => fiberRefUnsafeMake(List.empty()));\n/** @internal */\nexport const withSchedulingPriority = /*#__PURE__*/dual(2, (self, scheduler) => fiberRefLocally(self, currentSchedulingPriority, scheduler));\n/** @internal */\nexport const withMaxOpsBeforeYield = /*#__PURE__*/dual(2, (self, scheduler) => fiberRefLocally(self, currentMaxOpsBeforeYield, scheduler));\n/** @internal */\nexport const currentConcurrency = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentConcurrency\"), () => fiberRefUnsafeMake(\"unbounded\"));\n/**\n * @internal\n */\nexport const currentRequestBatching = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentRequestBatching\"), () => fiberRefUnsafeMake(true));\n/** @internal */\nexport const currentUnhandledErrorLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentUnhandledErrorLogLevel\"), () => fiberRefUnsafeMake(Option.some(logLevelDebug)));\n/** @internal */\nexport const currentVersionMismatchErrorLogLevel = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/versionMismatchErrorLogLevel\"), () => fiberRefUnsafeMake(Option.some(logLevelWarning)));\n/** @internal */\nexport const withUnhandledErrorLogLevel = /*#__PURE__*/dual(2, (self, level) => fiberRefLocally(self, currentUnhandledErrorLogLevel, level));\n/** @internal */\nexport const currentMetricLabels = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentMetricLabels\"), () => fiberRefUnsafeMakeReadonlyArray(Arr.empty()));\n/* @internal */\nexport const metricLabels = /*#__PURE__*/fiberRefGet(currentMetricLabels);\n/** @internal */\nexport const currentForkScopeOverride = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentForkScopeOverride\"), () => fiberRefUnsafeMake(Option.none(), {\n fork: () => Option.none(),\n join: (parent, _) => parent\n}));\n/** @internal */\nexport const currentInterruptedCause = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentInterruptedCause\"), () => fiberRefUnsafeMake(internalCause.empty, {\n fork: () => internalCause.empty,\n join: (parent, _) => parent\n}));\n/** @internal */\nexport const currentTracerEnabled = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentTracerEnabled\"), () => fiberRefUnsafeMake(true));\n/** @internal */\nexport const currentTracerTimingEnabled = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentTracerTiming\"), () => fiberRefUnsafeMake(true));\n/** @internal */\nexport const currentTracerSpanAnnotations = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentTracerSpanAnnotations\"), () => fiberRefUnsafeMake(HashMap.empty()));\n/** @internal */\nexport const currentTracerSpanLinks = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentTracerSpanLinks\"), () => fiberRefUnsafeMake(Chunk.empty()));\n// -----------------------------------------------------------------------------\n// Scope\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const ScopeTypeId = /*#__PURE__*/Symbol.for(\"effect/Scope\");\n/** @internal */\nexport const CloseableScopeTypeId = /*#__PURE__*/Symbol.for(\"effect/CloseableScope\");\n/* @internal */\nexport const scopeAddFinalizer = (self, finalizer) => self.addFinalizer(() => asVoid(finalizer));\n/* @internal */\nexport const scopeAddFinalizerExit = (self, finalizer) => self.addFinalizer(finalizer);\n/* @internal */\nexport const scopeClose = (self, exit) => self.close(exit);\n/* @internal */\nexport const scopeFork = (self, strategy) => self.fork(strategy);\n// -----------------------------------------------------------------------------\n// Cause\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const causeSquash = self => {\n return causeSquashWith(identity)(self);\n};\n/** @internal */\nexport const causeSquashWith = /*#__PURE__*/dual(2, (self, f) => {\n const option = pipe(self, internalCause.failureOption, Option.map(f));\n switch (option._tag) {\n case \"None\":\n {\n return pipe(internalCause.defects(self), Chunk.head, Option.match({\n onNone: () => {\n const interrupts = Arr.fromIterable(internalCause.interruptors(self)).flatMap(fiberId => Arr.fromIterable(FiberId.ids(fiberId)).map(id => `#${id}`));\n return new InterruptedException(interrupts ? `Interrupted by fibers: ${interrupts.join(\", \")}` : void 0);\n },\n onSome: identity\n }));\n }\n case \"Some\":\n {\n return option.value;\n }\n }\n});\n// -----------------------------------------------------------------------------\n// Errors\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const YieldableError = /*#__PURE__*/function () {\n class YieldableError extends globalThis.Error {\n commit() {\n return fail(this);\n }\n toJSON() {\n const obj = {\n ...this\n };\n if (this.message) obj.message = this.message;\n if (this.cause) obj.cause = this.cause;\n return obj;\n }\n [NodeInspectSymbol]() {\n if (this.toString !== globalThis.Error.prototype.toString) {\n return this.stack ? `${this.toString()}\\n${this.stack.split(\"\\n\").slice(1).join(\"\\n\")}` : this.toString();\n } else if (\"Bun\" in globalThis) {\n return internalCause.pretty(internalCause.fail(this), {\n renderErrorCause: true\n });\n }\n return this;\n }\n }\n // @effect-diagnostics-next-line floatingEffect:off\n Object.assign(YieldableError.prototype, StructuralCommitPrototype);\n return YieldableError;\n}();\nconst makeException = (proto, tag) => {\n class Base extends YieldableError {\n _tag = tag;\n }\n Object.assign(Base.prototype, proto);\n Base.prototype.name = tag;\n return Base;\n};\n/** @internal */\nexport const RuntimeExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/RuntimeException\");\n/** @internal */\nexport const RuntimeException = /*#__PURE__*/makeException({\n [RuntimeExceptionTypeId]: RuntimeExceptionTypeId\n}, \"RuntimeException\");\n/** @internal */\nexport const isRuntimeException = u => hasProperty(u, RuntimeExceptionTypeId);\n/** @internal */\nexport const InterruptedExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/InterruptedException\");\n/** @internal */\nexport const InterruptedException = /*#__PURE__*/makeException({\n [InterruptedExceptionTypeId]: InterruptedExceptionTypeId\n}, \"InterruptedException\");\n/** @internal */\nexport const isInterruptedException = u => hasProperty(u, InterruptedExceptionTypeId);\n/** @internal */\nexport const IllegalArgumentExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/IllegalArgument\");\n/** @internal */\nexport const IllegalArgumentException = /*#__PURE__*/makeException({\n [IllegalArgumentExceptionTypeId]: IllegalArgumentExceptionTypeId\n}, \"IllegalArgumentException\");\n/** @internal */\nexport const isIllegalArgumentException = u => hasProperty(u, IllegalArgumentExceptionTypeId);\n/** @internal */\nexport const NoSuchElementExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/NoSuchElement\");\n/** @internal */\nexport const NoSuchElementException = /*#__PURE__*/makeException({\n [NoSuchElementExceptionTypeId]: NoSuchElementExceptionTypeId\n}, \"NoSuchElementException\");\n/** @internal */\nexport const isNoSuchElementException = u => hasProperty(u, NoSuchElementExceptionTypeId);\n/** @internal */\nexport const InvalidPubSubCapacityExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/InvalidPubSubCapacityException\");\n/** @internal */\nexport const InvalidPubSubCapacityException = /*#__PURE__*/makeException({\n [InvalidPubSubCapacityExceptionTypeId]: InvalidPubSubCapacityExceptionTypeId\n}, \"InvalidPubSubCapacityException\");\n/** @internal */\nexport const ExceededCapacityExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/ExceededCapacityException\");\n/** @internal */\nexport const ExceededCapacityException = /*#__PURE__*/makeException({\n [ExceededCapacityExceptionTypeId]: ExceededCapacityExceptionTypeId\n}, \"ExceededCapacityException\");\n/** @internal */\nexport const isExceededCapacityException = u => hasProperty(u, ExceededCapacityExceptionTypeId);\n/** @internal */\nexport const isInvalidCapacityError = u => hasProperty(u, InvalidPubSubCapacityExceptionTypeId);\n/** @internal */\nexport const TimeoutExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/Timeout\");\n/** @internal */\nexport const TimeoutException = /*#__PURE__*/makeException({\n [TimeoutExceptionTypeId]: TimeoutExceptionTypeId\n}, \"TimeoutException\");\n/** @internal */\nexport const timeoutExceptionFromDuration = duration => new TimeoutException(`Operation timed out after '${Duration.format(duration)}'`);\n/** @internal */\nexport const isTimeoutException = u => hasProperty(u, TimeoutExceptionTypeId);\n/** @internal */\nexport const UnknownExceptionTypeId = /*#__PURE__*/Symbol.for(\"effect/Cause/errors/UnknownException\");\n/** @internal */\nexport const UnknownException = /*#__PURE__*/function () {\n class UnknownException extends YieldableError {\n _tag = \"UnknownException\";\n error;\n constructor(cause, message) {\n super(message ?? \"An unknown error occurred\", {\n cause\n });\n this.error = cause;\n }\n }\n Object.assign(UnknownException.prototype, {\n [UnknownExceptionTypeId]: UnknownExceptionTypeId,\n name: \"UnknownException\"\n });\n return UnknownException;\n}();\n/** @internal */\nexport const isUnknownException = u => hasProperty(u, UnknownExceptionTypeId);\n// -----------------------------------------------------------------------------\n// Exit\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const exitIsExit = u => isEffect(u) && \"_tag\" in u && (u._tag === \"Success\" || u._tag === \"Failure\");\n/** @internal */\nexport const exitIsFailure = self => self._tag === \"Failure\";\n/** @internal */\nexport const exitIsSuccess = self => self._tag === \"Success\";\n/** @internal */\nexport const exitIsInterrupted = self => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return internalCause.isInterrupted(self.effect_instruction_i0);\n case OpCodes.OP_SUCCESS:\n return false;\n }\n};\n/** @internal */\nexport const exitAs = /*#__PURE__*/dual(2, (self, value) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n {\n return exitFailCause(self.effect_instruction_i0);\n }\n case OpCodes.OP_SUCCESS:\n {\n return exitSucceed(value);\n }\n }\n});\n/** @internal */\nexport const exitAsVoid = self => exitAs(self, void 0);\n/** @internal */\nexport const exitCauseOption = self => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return Option.some(self.effect_instruction_i0);\n case OpCodes.OP_SUCCESS:\n return Option.none();\n }\n};\n/** @internal */\nexport const exitCollectAll = (exits, options) => exitCollectAllInternal(exits, options?.parallel ? internalCause.parallel : internalCause.sequential);\n/** @internal */\nexport const exitDie = defect => exitFailCause(internalCause.die(defect));\n/** @internal */\nexport const exitExists = /*#__PURE__*/dual(2, (self, refinement) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return false;\n case OpCodes.OP_SUCCESS:\n return refinement(self.effect_instruction_i0);\n }\n});\n/** @internal */\nexport const exitFail = error => exitFailCause(internalCause.fail(error));\n/** @internal */\nexport const exitFailCause = cause => {\n const effect = new EffectPrimitiveFailure(OpCodes.OP_FAILURE);\n effect.effect_instruction_i0 = cause;\n return effect;\n};\n/** @internal */\nexport const exitFlatMap = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n {\n return exitFailCause(self.effect_instruction_i0);\n }\n case OpCodes.OP_SUCCESS:\n {\n return f(self.effect_instruction_i0);\n }\n }\n});\n/** @internal */\nexport const exitFlatMapEffect = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n {\n return succeed(exitFailCause(self.effect_instruction_i0));\n }\n case OpCodes.OP_SUCCESS:\n {\n return f(self.effect_instruction_i0);\n }\n }\n});\n/** @internal */\nexport const exitFlatten = self => pipe(self, exitFlatMap(identity));\n/** @internal */\nexport const exitForEachEffect = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n {\n return succeed(exitFailCause(self.effect_instruction_i0));\n }\n case OpCodes.OP_SUCCESS:\n {\n return exit(f(self.effect_instruction_i0));\n }\n }\n});\n/** @internal */\nexport const exitFromEither = either => {\n switch (either._tag) {\n case \"Left\":\n return exitFail(either.left);\n case \"Right\":\n return exitSucceed(either.right);\n }\n};\n/** @internal */\nexport const exitFromOption = option => {\n switch (option._tag) {\n case \"None\":\n return exitFail(void 0);\n case \"Some\":\n return exitSucceed(option.value);\n }\n};\n/** @internal */\nexport const exitGetOrElse = /*#__PURE__*/dual(2, (self, orElse) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return orElse(self.effect_instruction_i0);\n case OpCodes.OP_SUCCESS:\n return self.effect_instruction_i0;\n }\n});\n/** @internal */\nexport const exitInterrupt = fiberId => exitFailCause(internalCause.interrupt(fiberId));\n/** @internal */\nexport const exitMap = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return exitFailCause(self.effect_instruction_i0);\n case OpCodes.OP_SUCCESS:\n return exitSucceed(f(self.effect_instruction_i0));\n }\n});\n/** @internal */\nexport const exitMapBoth = /*#__PURE__*/dual(2, (self, {\n onFailure,\n onSuccess\n}) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return exitFailCause(pipe(self.effect_instruction_i0, internalCause.map(onFailure)));\n case OpCodes.OP_SUCCESS:\n return exitSucceed(onSuccess(self.effect_instruction_i0));\n }\n});\n/** @internal */\nexport const exitMapError = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return exitFailCause(pipe(self.effect_instruction_i0, internalCause.map(f)));\n case OpCodes.OP_SUCCESS:\n return exitSucceed(self.effect_instruction_i0);\n }\n});\n/** @internal */\nexport const exitMapErrorCause = /*#__PURE__*/dual(2, (self, f) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return exitFailCause(f(self.effect_instruction_i0));\n case OpCodes.OP_SUCCESS:\n return exitSucceed(self.effect_instruction_i0);\n }\n});\n/** @internal */\nexport const exitMatch = /*#__PURE__*/dual(2, (self, {\n onFailure,\n onSuccess\n}) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return onFailure(self.effect_instruction_i0);\n case OpCodes.OP_SUCCESS:\n return onSuccess(self.effect_instruction_i0);\n }\n});\n/** @internal */\nexport const exitMatchEffect = /*#__PURE__*/dual(2, (self, {\n onFailure,\n onSuccess\n}) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n return onFailure(self.effect_instruction_i0);\n case OpCodes.OP_SUCCESS:\n return onSuccess(self.effect_instruction_i0);\n }\n});\n/** @internal */\nexport const exitSucceed = value => {\n const effect = new EffectPrimitiveSuccess(OpCodes.OP_SUCCESS);\n effect.effect_instruction_i0 = value;\n return effect;\n};\n/** @internal */\nexport const exitVoid = /*#__PURE__*/exitSucceed(void 0);\n/** @internal */\nexport const exitZip = /*#__PURE__*/dual(2, (self, that) => exitZipWith(self, that, {\n onSuccess: (a, a2) => [a, a2],\n onFailure: internalCause.sequential\n}));\n/** @internal */\nexport const exitZipLeft = /*#__PURE__*/dual(2, (self, that) => exitZipWith(self, that, {\n onSuccess: (a, _) => a,\n onFailure: internalCause.sequential\n}));\n/** @internal */\nexport const exitZipRight = /*#__PURE__*/dual(2, (self, that) => exitZipWith(self, that, {\n onSuccess: (_, a2) => a2,\n onFailure: internalCause.sequential\n}));\n/** @internal */\nexport const exitZipPar = /*#__PURE__*/dual(2, (self, that) => exitZipWith(self, that, {\n onSuccess: (a, a2) => [a, a2],\n onFailure: internalCause.parallel\n}));\n/** @internal */\nexport const exitZipParLeft = /*#__PURE__*/dual(2, (self, that) => exitZipWith(self, that, {\n onSuccess: (a, _) => a,\n onFailure: internalCause.parallel\n}));\n/** @internal */\nexport const exitZipParRight = /*#__PURE__*/dual(2, (self, that) => exitZipWith(self, that, {\n onSuccess: (_, a2) => a2,\n onFailure: internalCause.parallel\n}));\n/** @internal */\nexport const exitZipWith = /*#__PURE__*/dual(3, (self, that, {\n onFailure,\n onSuccess\n}) => {\n switch (self._tag) {\n case OpCodes.OP_FAILURE:\n {\n switch (that._tag) {\n case OpCodes.OP_SUCCESS:\n return exitFailCause(self.effect_instruction_i0);\n case OpCodes.OP_FAILURE:\n {\n return exitFailCause(onFailure(self.effect_instruction_i0, that.effect_instruction_i0));\n }\n }\n }\n case OpCodes.OP_SUCCESS:\n {\n switch (that._tag) {\n case OpCodes.OP_SUCCESS:\n return exitSucceed(onSuccess(self.effect_instruction_i0, that.effect_instruction_i0));\n case OpCodes.OP_FAILURE:\n return exitFailCause(that.effect_instruction_i0);\n }\n }\n }\n});\nconst exitCollectAllInternal = (exits, combineCauses) => {\n const list = Chunk.fromIterable(exits);\n if (!Chunk.isNonEmpty(list)) {\n return Option.none();\n }\n return pipe(Chunk.tailNonEmpty(list), Arr.reduce(pipe(Chunk.headNonEmpty(list), exitMap(Chunk.of)), (accumulator, current) => pipe(accumulator, exitZipWith(current, {\n onSuccess: (list, value) => pipe(list, Chunk.prepend(value)),\n onFailure: combineCauses\n }))), exitMap(Chunk.reverse), exitMap(chunk => Chunk.toReadonlyArray(chunk)), Option.some);\n};\n// -----------------------------------------------------------------------------\n// Deferred\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const deferredUnsafeMake = fiberId => {\n const _deferred = {\n ...CommitPrototype,\n [deferred.DeferredTypeId]: deferred.deferredVariance,\n state: MutableRef.make(deferred.pending([])),\n commit() {\n return deferredAwait(this);\n },\n blockingOn: fiberId\n };\n return _deferred;\n};\n/* @internal */\nexport const deferredMake = () => flatMap(fiberId, id => deferredMakeAs(id));\n/* @internal */\nexport const deferredMakeAs = fiberId => sync(() => deferredUnsafeMake(fiberId));\n/* @internal */\nexport const deferredAwait = self => asyncInterrupt(resume => {\n const state = MutableRef.get(self.state);\n switch (state._tag) {\n case DeferredOpCodes.OP_STATE_DONE:\n {\n return resume(state.effect);\n }\n case DeferredOpCodes.OP_STATE_PENDING:\n {\n // we can push here as the internal state is mutable\n state.joiners.push(resume);\n return deferredInterruptJoiner(self, resume);\n }\n }\n}, self.blockingOn);\n/* @internal */\nexport const deferredComplete = /*#__PURE__*/dual(2, (self, effect) => intoDeferred(effect, self));\n/* @internal */\nexport const deferredCompleteWith = /*#__PURE__*/dual(2, (self, effect) => sync(() => {\n const state = MutableRef.get(self.state);\n switch (state._tag) {\n case DeferredOpCodes.OP_STATE_DONE:\n {\n return false;\n }\n case DeferredOpCodes.OP_STATE_PENDING:\n {\n MutableRef.set(self.state, deferred.done(effect));\n for (let i = 0, len = state.joiners.length; i < len; i++) {\n state.joiners[i](effect);\n }\n return true;\n }\n }\n}));\n/* @internal */\nexport const deferredDone = /*#__PURE__*/dual(2, (self, exit) => deferredCompleteWith(self, exit));\n/* @internal */\nexport const deferredFail = /*#__PURE__*/dual(2, (self, error) => deferredCompleteWith(self, fail(error)));\n/* @internal */\nexport const deferredFailSync = /*#__PURE__*/dual(2, (self, evaluate) => deferredCompleteWith(self, failSync(evaluate)));\n/* @internal */\nexport const deferredFailCause = /*#__PURE__*/dual(2, (self, cause) => deferredCompleteWith(self, failCause(cause)));\n/* @internal */\nexport const deferredFailCauseSync = /*#__PURE__*/dual(2, (self, evaluate) => deferredCompleteWith(self, failCauseSync(evaluate)));\n/* @internal */\nexport const deferredDie = /*#__PURE__*/dual(2, (self, defect) => deferredCompleteWith(self, die(defect)));\n/* @internal */\nexport const deferredDieSync = /*#__PURE__*/dual(2, (self, evaluate) => deferredCompleteWith(self, dieSync(evaluate)));\n/* @internal */\nexport const deferredInterrupt = self => flatMap(fiberId, fiberId => deferredCompleteWith(self, interruptWith(fiberId)));\n/* @internal */\nexport const deferredInterruptWith = /*#__PURE__*/dual(2, (self, fiberId) => deferredCompleteWith(self, interruptWith(fiberId)));\n/* @internal */\nexport const deferredIsDone = self => sync(() => MutableRef.get(self.state)._tag === DeferredOpCodes.OP_STATE_DONE);\n/* @internal */\nexport const deferredPoll = self => sync(() => {\n const state = MutableRef.get(self.state);\n switch (state._tag) {\n case DeferredOpCodes.OP_STATE_DONE:\n {\n return Option.some(state.effect);\n }\n case DeferredOpCodes.OP_STATE_PENDING:\n {\n return Option.none();\n }\n }\n});\n/* @internal */\nexport const deferredSucceed = /*#__PURE__*/dual(2, (self, value) => deferredCompleteWith(self, succeed(value)));\n/* @internal */\nexport const deferredSync = /*#__PURE__*/dual(2, (self, evaluate) => deferredCompleteWith(self, sync(evaluate)));\n/** @internal */\nexport const deferredUnsafeDone = (self, effect) => {\n const state = MutableRef.get(self.state);\n if (state._tag === DeferredOpCodes.OP_STATE_PENDING) {\n MutableRef.set(self.state, deferred.done(effect));\n for (let i = 0, len = state.joiners.length; i < len; i++) {\n state.joiners[i](effect);\n }\n }\n};\nconst deferredInterruptJoiner = (self, joiner) => sync(() => {\n const state = MutableRef.get(self.state);\n if (state._tag === DeferredOpCodes.OP_STATE_PENDING) {\n const index = state.joiners.indexOf(joiner);\n if (index >= 0) {\n // we can splice here as the internal state is mutable\n state.joiners.splice(index, 1);\n }\n }\n});\n// -----------------------------------------------------------------------------\n// Context\n// -----------------------------------------------------------------------------\nconst constContext = /*#__PURE__*/withFiberRuntime(fiber => exitSucceed(fiber.currentContext));\n/* @internal */\nexport const context = () => constContext;\n/* @internal */\nexport const contextWith = f => map(context(), f);\n/* @internal */\nexport const contextWithEffect = f => flatMap(context(), f);\n/* @internal */\nexport const provideContext = /*#__PURE__*/dual(2, (self, context) => fiberRefLocally(currentContext, context)(self));\n/* @internal */\nexport const provideSomeContext = /*#__PURE__*/dual(2, (self, context) => fiberRefLocallyWith(currentContext, parent => Context.merge(parent, context))(self));\n/* @internal */\nexport const mapInputContext = /*#__PURE__*/dual(2, (self, f) => contextWithEffect(context => provideContext(self, f(context))));\n// -----------------------------------------------------------------------------\n// Filtering\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const filterEffectOrElse = /*#__PURE__*/dual(2, (self, options) => flatMap(self, a => flatMap(options.predicate(a), pass => pass ? succeed(a) : options.orElse(a))));\n/** @internal */\nexport const filterEffectOrFail = /*#__PURE__*/dual(2, (self, options) => filterEffectOrElse(self, {\n predicate: options.predicate,\n orElse: a => fail(options.orFailWith(a))\n}));\n// -----------------------------------------------------------------------------\n// Tracing\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const currentSpanFromFiber = fiber => {\n const span = fiber.currentSpan;\n return span !== undefined && span._tag === \"Span\" ? Option.some(span) : Option.none();\n};\nconst NoopSpanProto = {\n _tag: \"Span\",\n spanId: \"noop\",\n traceId: \"noop\",\n sampled: false,\n status: {\n _tag: \"Ended\",\n startTime: /*#__PURE__*/BigInt(0),\n endTime: /*#__PURE__*/BigInt(0),\n exit: exitVoid\n },\n attributes: /*#__PURE__*/new Map(),\n links: [],\n kind: \"internal\",\n attribute() {},\n event() {},\n end() {},\n addLinks() {}\n};\n/** @internal */\nexport const noopSpan = options => Object.assign(Object.create(NoopSpanProto), options);\n//# sourceMappingURL=core.js.map","import * as Equal from \"./Equal.js\";\nimport { dual } from \"./Function.js\";\nimport * as Hash from \"./Hash.js\";\nimport { format, NodeInspectSymbol, toJSON } from \"./Inspectable.js\";\nimport * as Option from \"./Option.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nconst TypeId = /*#__PURE__*/Symbol.for(\"effect/MutableHashMap\");\nconst MutableHashMapProto = {\n [TypeId]: TypeId,\n [Symbol.iterator]() {\n return new MutableHashMapIterator(this);\n },\n toString() {\n return format(this.toJSON());\n },\n toJSON() {\n return {\n _id: \"MutableHashMap\",\n values: Array.from(this).map(toJSON)\n };\n },\n [NodeInspectSymbol]() {\n return this.toJSON();\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\nclass MutableHashMapIterator {\n self;\n referentialIterator;\n bucketIterator;\n constructor(self) {\n this.self = self;\n this.referentialIterator = self.referential[Symbol.iterator]();\n }\n next() {\n if (this.bucketIterator !== undefined) {\n return this.bucketIterator.next();\n }\n const result = this.referentialIterator.next();\n if (result.done) {\n this.bucketIterator = new BucketIterator(this.self.buckets.values());\n return this.next();\n }\n return result;\n }\n [Symbol.iterator]() {\n return new MutableHashMapIterator(this.self);\n }\n}\nclass BucketIterator {\n backing;\n constructor(backing) {\n this.backing = backing;\n }\n currentBucket;\n next() {\n if (this.currentBucket === undefined) {\n const result = this.backing.next();\n if (result.done) {\n return result;\n }\n this.currentBucket = result.value[Symbol.iterator]();\n }\n const result = this.currentBucket.next();\n if (result.done) {\n this.currentBucket = undefined;\n return this.next();\n }\n return result;\n }\n}\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = () => {\n const self = Object.create(MutableHashMapProto);\n self.referential = new Map();\n self.buckets = new Map();\n self.bucketsSize = 0;\n return self;\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const make = (...entries) => fromIterable(entries);\n/**\n * Creates a new `MutableHashMap` from an iterable collection of key/value pairs.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const fromIterable = entries => {\n const self = empty();\n for (const [key, value] of entries) {\n set(self, key, value);\n }\n return self;\n};\n/**\n * @since 2.0.0\n * @category elements\n */\nexport const get = /*#__PURE__*/dual(2, (self, key) => {\n if (Equal.isEqual(key) === false) {\n return self.referential.has(key) ? Option.some(self.referential.get(key)) : Option.none();\n }\n const hash = key[Hash.symbol]();\n const bucket = self.buckets.get(hash);\n if (bucket === undefined) {\n return Option.none();\n }\n return getFromBucket(self, bucket, key);\n});\n/**\n * @since 3.8.0\n * @category elements\n */\nexport const keys = self => {\n const keys = Array.from(self.referential.keys());\n for (const bucket of self.buckets.values()) {\n for (let i = 0, len = bucket.length; i < len; i++) {\n keys.push(bucket[i][0]);\n }\n }\n return keys;\n};\n/**\n * @since 3.8.0\n * @category elements\n */\nexport const values = self => {\n const values = Array.from(self.referential.values());\n for (const bucket of self.buckets.values()) {\n for (let i = 0, len = bucket.length; i < len; i++) {\n values.push(bucket[i][1]);\n }\n }\n return values;\n};\nconst getFromBucket = (self, bucket, key, remove = false) => {\n for (let i = 0, len = bucket.length; i < len; i++) {\n if (key[Equal.symbol](bucket[i][0])) {\n const value = bucket[i][1];\n if (remove) {\n bucket.splice(i, 1);\n self.bucketsSize--;\n }\n return Option.some(value);\n }\n }\n return Option.none();\n};\n/**\n * @since 2.0.0\n * @category elements\n */\nexport const has = /*#__PURE__*/dual(2, (self, key) => Option.isSome(get(self, key)));\n/**\n * @since 2.0.0\n */\nexport const set = /*#__PURE__*/dual(3, (self, key, value) => {\n if (Equal.isEqual(key) === false) {\n self.referential.set(key, value);\n return self;\n }\n const hash = key[Hash.symbol]();\n const bucket = self.buckets.get(hash);\n if (bucket === undefined) {\n self.buckets.set(hash, [[key, value]]);\n self.bucketsSize++;\n return self;\n }\n removeFromBucket(self, bucket, key);\n bucket.push([key, value]);\n self.bucketsSize++;\n return self;\n});\nconst removeFromBucket = (self, bucket, key) => {\n for (let i = 0, len = bucket.length; i < len; i++) {\n if (key[Equal.symbol](bucket[i][0])) {\n bucket.splice(i, 1);\n self.bucketsSize--;\n return;\n }\n }\n};\n/**\n * Updates the value of the specified key within the `MutableHashMap` if it exists.\n *\n * @since 2.0.0\n */\nexport const modify = /*#__PURE__*/dual(3, (self, key, f) => {\n if (Equal.isEqual(key) === false) {\n if (self.referential.has(key)) {\n self.referential.set(key, f(self.referential.get(key)));\n }\n return self;\n }\n const hash = key[Hash.symbol]();\n const bucket = self.buckets.get(hash);\n if (bucket === undefined) {\n return self;\n }\n const value = getFromBucket(self, bucket, key, true);\n if (Option.isNone(value)) {\n return self;\n }\n bucket.push([key, f(value.value)]);\n self.bucketsSize++;\n return self;\n});\n/**\n * Set or remove the specified key in the `MutableHashMap` using the specified\n * update function.\n *\n * @since 2.0.0\n */\nexport const modifyAt = /*#__PURE__*/dual(3, (self, key, f) => {\n if (Equal.isEqual(key) === false) {\n const result = f(get(self, key));\n if (Option.isSome(result)) {\n set(self, key, result.value);\n } else {\n remove(self, key);\n }\n return self;\n }\n const hash = key[Hash.symbol]();\n const bucket = self.buckets.get(hash);\n if (bucket === undefined) {\n const result = f(Option.none());\n return Option.isSome(result) ? set(self, key, result.value) : self;\n }\n const result = f(getFromBucket(self, bucket, key, true));\n if (Option.isNone(result)) {\n if (bucket.length === 0) {\n self.buckets.delete(hash);\n }\n return self;\n }\n bucket.push([key, result.value]);\n self.bucketsSize++;\n return self;\n});\n/**\n * @since 2.0.0\n */\nexport const remove = /*#__PURE__*/dual(2, (self, key) => {\n if (Equal.isEqual(key) === false) {\n self.referential.delete(key);\n return self;\n }\n const hash = key[Hash.symbol]();\n const bucket = self.buckets.get(hash);\n if (bucket === undefined) {\n return self;\n }\n removeFromBucket(self, bucket, key);\n if (bucket.length === 0) {\n self.buckets.delete(hash);\n }\n return self;\n});\n/**\n * @since 2.0.0\n */\nexport const clear = self => {\n self.referential.clear();\n self.buckets.clear();\n self.bucketsSize = 0;\n return self;\n};\n/**\n * @since 2.0.0\n * @category elements\n */\nexport const size = self => {\n return self.referential.size + self.bucketsSize;\n};\n/**\n * @since 2.0.0\n */\nexport const isEmpty = self => size(self) === 0;\n/**\n * @since 2.0.0\n */\nexport const forEach = /*#__PURE__*/dual(2, (self, f) => {\n self.referential.forEach(f);\n for (const bucket of self.buckets.values()) {\n for (const [key, value] of bucket) {\n f(value, key);\n }\n }\n});\n//# sourceMappingURL=MutableHashMap.js.map","import * as Context from \"../Context.js\";\nimport * as Duration from \"../Duration.js\";\nimport { constFalse } from \"../Function.js\";\nimport * as core from \"./core.js\";\n/** @internal */\nconst ClockSymbolKey = \"effect/Clock\";\n/** @internal */\nexport const ClockTypeId = /*#__PURE__*/Symbol.for(ClockSymbolKey);\n/** @internal */\nexport const clockTag = /*#__PURE__*/Context.GenericTag(\"effect/Clock\");\n/** @internal */\nexport const MAX_TIMER_MILLIS = 2 ** 31 - 1;\n/** @internal */\nexport const globalClockScheduler = {\n unsafeSchedule(task, duration) {\n const millis = Duration.toMillis(duration);\n // If the duration is greater than the value allowable by the JS timer\n // functions, treat the value as an infinite duration\n if (millis > MAX_TIMER_MILLIS) {\n return constFalse;\n }\n let completed = false;\n const handle = setTimeout(() => {\n completed = true;\n task();\n }, millis);\n return () => {\n clearTimeout(handle);\n return !completed;\n };\n }\n};\nconst performanceNowNanos = /*#__PURE__*/function () {\n const bigint1e6 = /*#__PURE__*/BigInt(1_000_000);\n if (typeof performance === \"undefined\" || typeof performance.now !== \"function\") {\n return () => BigInt(Date.now()) * bigint1e6;\n }\n let origin;\n return () => {\n if (origin === undefined) {\n origin = BigInt(Date.now()) * bigint1e6 - BigInt(Math.round(performance.now() * 1_000_000));\n }\n return origin + BigInt(Math.round(performance.now() * 1000000));\n };\n}();\nconst processOrPerformanceNow = /*#__PURE__*/function () {\n const processHrtime = typeof process === \"object\" && \"hrtime\" in process && typeof process.hrtime.bigint === \"function\" ? process.hrtime : undefined;\n if (!processHrtime) {\n return performanceNowNanos;\n }\n const origin = /*#__PURE__*/performanceNowNanos() - /*#__PURE__*/processHrtime.bigint();\n return () => origin + processHrtime.bigint();\n}();\n/** @internal */\nclass ClockImpl {\n [ClockTypeId] = ClockTypeId;\n unsafeCurrentTimeMillis() {\n return Date.now();\n }\n unsafeCurrentTimeNanos() {\n return processOrPerformanceNow();\n }\n currentTimeMillis = /*#__PURE__*/core.sync(() => this.unsafeCurrentTimeMillis());\n currentTimeNanos = /*#__PURE__*/core.sync(() => this.unsafeCurrentTimeNanos());\n scheduler() {\n return core.succeed(globalClockScheduler);\n }\n sleep(duration) {\n return core.async(resume => {\n const canceler = globalClockScheduler.unsafeSchedule(() => resume(core.void), duration);\n return core.asVoid(core.sync(canceler));\n });\n }\n}\n/** @internal */\nexport const make = () => new ClockImpl();\n//# sourceMappingURL=clock.js.map","/** @internal */\nexport const OP_AND = \"And\";\n/** @internal */\nexport const OP_OR = \"Or\";\n/** @internal */\nexport const OP_INVALID_DATA = \"InvalidData\";\n/** @internal */\nexport const OP_MISSING_DATA = \"MissingData\";\n/** @internal */\nexport const OP_SOURCE_UNAVAILABLE = \"SourceUnavailable\";\n/** @internal */\nexport const OP_UNSUPPORTED = \"Unsupported\";\n//# sourceMappingURL=configError.js.map","import * as RA from \"../Array.js\";\nimport * as Either from \"../Either.js\";\nimport { constFalse, constTrue, dual, pipe } from \"../Function.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as OpCodes from \"./opCodes/configError.js\";\n/** @internal */\nconst ConfigErrorSymbolKey = \"effect/ConfigError\";\n/** @internal */\nexport const ConfigErrorTypeId = /*#__PURE__*/Symbol.for(ConfigErrorSymbolKey);\n/** @internal */\nexport const proto = {\n _tag: \"ConfigError\",\n [ConfigErrorTypeId]: ConfigErrorTypeId\n};\n/** @internal */\nexport const And = (self, that) => {\n const error = Object.create(proto);\n error._op = OpCodes.OP_AND;\n error.left = self;\n error.right = that;\n Object.defineProperty(error, \"toString\", {\n enumerable: false,\n value() {\n return `${this.left} and ${this.right}`;\n }\n });\n Object.defineProperty(error, \"message\", {\n enumerable: false,\n get() {\n return this.toString();\n }\n });\n return error;\n};\n/** @internal */\nexport const Or = (self, that) => {\n const error = Object.create(proto);\n error._op = OpCodes.OP_OR;\n error.left = self;\n error.right = that;\n Object.defineProperty(error, \"toString\", {\n enumerable: false,\n value() {\n return `${this.left} or ${this.right}`;\n }\n });\n Object.defineProperty(error, \"message\", {\n enumerable: false,\n get() {\n return this.toString();\n }\n });\n return error;\n};\n/** @internal */\nexport const InvalidData = (path, message, options = {\n pathDelim: \".\"\n}) => {\n const error = Object.create(proto);\n error._op = OpCodes.OP_INVALID_DATA;\n error.path = path;\n error.message = message;\n Object.defineProperty(error, \"toString\", {\n enumerable: false,\n value() {\n const path = pipe(this.path, RA.join(options.pathDelim));\n return `(Invalid data at ${path}: \"${this.message}\")`;\n }\n });\n return error;\n};\n/** @internal */\nexport const MissingData = (path, message, options = {\n pathDelim: \".\"\n}) => {\n const error = Object.create(proto);\n error._op = OpCodes.OP_MISSING_DATA;\n error.path = path;\n error.message = message;\n Object.defineProperty(error, \"toString\", {\n enumerable: false,\n value() {\n const path = pipe(this.path, RA.join(options.pathDelim));\n return `(Missing data at ${path}: \"${this.message}\")`;\n }\n });\n return error;\n};\n/** @internal */\nexport const SourceUnavailable = (path, message, cause, options = {\n pathDelim: \".\"\n}) => {\n const error = Object.create(proto);\n error._op = OpCodes.OP_SOURCE_UNAVAILABLE;\n error.path = path;\n error.message = message;\n error.cause = cause;\n Object.defineProperty(error, \"toString\", {\n enumerable: false,\n value() {\n const path = pipe(this.path, RA.join(options.pathDelim));\n return `(Source unavailable at ${path}: \"${this.message}\")`;\n }\n });\n return error;\n};\n/** @internal */\nexport const Unsupported = (path, message, options = {\n pathDelim: \".\"\n}) => {\n const error = Object.create(proto);\n error._op = OpCodes.OP_UNSUPPORTED;\n error.path = path;\n error.message = message;\n Object.defineProperty(error, \"toString\", {\n enumerable: false,\n value() {\n const path = pipe(this.path, RA.join(options.pathDelim));\n return `(Unsupported operation at ${path}: \"${this.message}\")`;\n }\n });\n return error;\n};\n/** @internal */\nexport const isConfigError = u => hasProperty(u, ConfigErrorTypeId);\n/** @internal */\nexport const isAnd = self => self._op === OpCodes.OP_AND;\n/** @internal */\nexport const isOr = self => self._op === OpCodes.OP_OR;\n/** @internal */\nexport const isInvalidData = self => self._op === OpCodes.OP_INVALID_DATA;\n/** @internal */\nexport const isMissingData = self => self._op === OpCodes.OP_MISSING_DATA;\n/** @internal */\nexport const isSourceUnavailable = self => self._op === OpCodes.OP_SOURCE_UNAVAILABLE;\n/** @internal */\nexport const isUnsupported = self => self._op === OpCodes.OP_UNSUPPORTED;\n/** @internal */\nexport const prefixed = /*#__PURE__*/dual(2, (self, prefix) => {\n switch (self._op) {\n case OpCodes.OP_AND:\n {\n return And(prefixed(self.left, prefix), prefixed(self.right, prefix));\n }\n case OpCodes.OP_OR:\n {\n return Or(prefixed(self.left, prefix), prefixed(self.right, prefix));\n }\n case OpCodes.OP_INVALID_DATA:\n {\n return InvalidData([...prefix, ...self.path], self.message);\n }\n case OpCodes.OP_MISSING_DATA:\n {\n return MissingData([...prefix, ...self.path], self.message);\n }\n case OpCodes.OP_SOURCE_UNAVAILABLE:\n {\n return SourceUnavailable([...prefix, ...self.path], self.message, self.cause);\n }\n case OpCodes.OP_UNSUPPORTED:\n {\n return Unsupported([...prefix, ...self.path], self.message);\n }\n }\n});\n/** @internal */\nconst IsMissingDataOnlyReducer = {\n andCase: (_, left, right) => left && right,\n orCase: (_, left, right) => left && right,\n invalidDataCase: constFalse,\n missingDataCase: constTrue,\n sourceUnavailableCase: constFalse,\n unsupportedCase: constFalse\n};\n/** @internal */\nexport const reduceWithContext = /*#__PURE__*/dual(3, (self, context, reducer) => {\n const input = [self];\n const output = [];\n while (input.length > 0) {\n const error = input.pop();\n switch (error._op) {\n case OpCodes.OP_AND:\n {\n input.push(error.right);\n input.push(error.left);\n output.push(Either.left({\n _op: \"AndCase\"\n }));\n break;\n }\n case OpCodes.OP_OR:\n {\n input.push(error.right);\n input.push(error.left);\n output.push(Either.left({\n _op: \"OrCase\"\n }));\n break;\n }\n case OpCodes.OP_INVALID_DATA:\n {\n output.push(Either.right(reducer.invalidDataCase(context, error.path, error.message)));\n break;\n }\n case OpCodes.OP_MISSING_DATA:\n {\n output.push(Either.right(reducer.missingDataCase(context, error.path, error.message)));\n break;\n }\n case OpCodes.OP_SOURCE_UNAVAILABLE:\n {\n output.push(Either.right(reducer.sourceUnavailableCase(context, error.path, error.message, error.cause)));\n break;\n }\n case OpCodes.OP_UNSUPPORTED:\n {\n output.push(Either.right(reducer.unsupportedCase(context, error.path, error.message)));\n break;\n }\n }\n }\n const accumulator = [];\n while (output.length > 0) {\n const either = output.pop();\n switch (either._op) {\n case \"Left\":\n {\n switch (either.left._op) {\n case \"AndCase\":\n {\n const left = accumulator.pop();\n const right = accumulator.pop();\n const value = reducer.andCase(context, left, right);\n accumulator.push(value);\n break;\n }\n case \"OrCase\":\n {\n const left = accumulator.pop();\n const right = accumulator.pop();\n const value = reducer.orCase(context, left, right);\n accumulator.push(value);\n break;\n }\n }\n break;\n }\n case \"Right\":\n {\n accumulator.push(either.right);\n break;\n }\n }\n }\n if (accumulator.length === 0) {\n throw new Error(\"BUG: ConfigError.reduceWithContext - please report an issue at https://github.com/Effect-TS/effect/issues\");\n }\n return accumulator.pop();\n});\n/** @internal */\nexport const isMissingDataOnly = self => reduceWithContext(self, void 0, IsMissingDataOnlyReducer);\n//# sourceMappingURL=configError.js.map","import * as RA from \"../../Array.js\";\nimport * as Either from \"../../Either.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as List from \"../../List.js\";\nimport * as Option from \"../../Option.js\";\nimport * as configError from \"../configError.js\";\n/** @internal */\nexport const empty = {\n _tag: \"Empty\"\n};\n/** @internal */\nexport const andThen = /*#__PURE__*/dual(2, (self, that) => ({\n _tag: \"AndThen\",\n first: self,\n second: that\n}));\n/** @internal */\nexport const mapName = /*#__PURE__*/dual(2, (self, f) => andThen(self, {\n _tag: \"MapName\",\n f\n}));\n/** @internal */\nexport const nested = /*#__PURE__*/dual(2, (self, name) => andThen(self, {\n _tag: \"Nested\",\n name\n}));\n/** @internal */\nexport const unnested = /*#__PURE__*/dual(2, (self, name) => andThen(self, {\n _tag: \"Unnested\",\n name\n}));\n/** @internal */\nexport const patch = /*#__PURE__*/dual(2, (path, patch) => {\n let input = List.of(patch);\n let output = path;\n while (List.isCons(input)) {\n const patch = input.head;\n switch (patch._tag) {\n case \"Empty\":\n {\n input = input.tail;\n break;\n }\n case \"AndThen\":\n {\n input = List.cons(patch.first, List.cons(patch.second, input.tail));\n break;\n }\n case \"MapName\":\n {\n output = RA.map(output, patch.f);\n input = input.tail;\n break;\n }\n case \"Nested\":\n {\n output = RA.prepend(output, patch.name);\n input = input.tail;\n break;\n }\n case \"Unnested\":\n {\n const containsName = pipe(RA.head(output), Option.contains(patch.name));\n if (containsName) {\n output = RA.tailNonEmpty(output);\n input = input.tail;\n } else {\n return Either.left(configError.MissingData(output, `Expected ${patch.name} to be in path in ConfigProvider#unnested`));\n }\n break;\n }\n }\n }\n return Either.right(output);\n});\n//# sourceMappingURL=pathPatch.js.map","/** @internal */\nexport const OP_CONSTANT = \"Constant\";\n/** @internal */\nexport const OP_FAIL = \"Fail\";\n/** @internal */\nexport const OP_FALLBACK = \"Fallback\";\n/** @internal */\nexport const OP_DESCRIBED = \"Described\";\n/** @internal */\nexport const OP_LAZY = \"Lazy\";\n/** @internal */\nexport const OP_MAP_OR_FAIL = \"MapOrFail\";\n/** @internal */\nexport const OP_NESTED = \"Nested\";\n/** @internal */\nexport const OP_PRIMITIVE = \"Primitive\";\n/** @internal */\nexport const OP_SEQUENCE = \"Sequence\";\n/** @internal */\nexport const OP_HASHMAP = \"HashMap\";\n/** @internal */\nexport const OP_ZIP_WITH = \"ZipWith\";\n//# sourceMappingURL=config.js.map","import * as Arr from \"../Array.js\";\nimport * as Context from \"../Context.js\";\nimport * as Either from \"../Either.js\";\nimport { dual, pipe } from \"../Function.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport * as number from \"../Number.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as Predicate from \"../Predicate.js\";\nimport * as regexp from \"../RegExp.js\";\nimport * as configError from \"./configError.js\";\nimport * as pathPatch from \"./configProvider/pathPatch.js\";\nimport * as core from \"./core.js\";\nimport * as OpCodes from \"./opCodes/config.js\";\nimport * as StringUtils from \"./string-utils.js\";\nconst concat = (l, r) => [...l, ...r];\n/** @internal */\nconst ConfigProviderSymbolKey = \"effect/ConfigProvider\";\n/** @internal */\nexport const ConfigProviderTypeId = /*#__PURE__*/Symbol.for(ConfigProviderSymbolKey);\n/** @internal */\nexport const configProviderTag = /*#__PURE__*/Context.GenericTag(\"effect/ConfigProvider\");\n/** @internal */\nconst FlatConfigProviderSymbolKey = \"effect/ConfigProviderFlat\";\n/** @internal */\nexport const FlatConfigProviderTypeId = /*#__PURE__*/Symbol.for(FlatConfigProviderSymbolKey);\n/** @internal */\nexport const make = options => ({\n [ConfigProviderTypeId]: ConfigProviderTypeId,\n pipe() {\n return pipeArguments(this, arguments);\n },\n ...options\n});\n/** @internal */\nexport const makeFlat = options => ({\n [FlatConfigProviderTypeId]: FlatConfigProviderTypeId,\n patch: options.patch,\n load: (path, config, split = true) => options.load(path, config, split),\n enumerateChildren: options.enumerateChildren\n});\n/** @internal */\nexport const fromFlat = flat => make({\n load: config => core.flatMap(fromFlatLoop(flat, Arr.empty(), config, false), chunk => Option.match(Arr.head(chunk), {\n onNone: () => core.fail(configError.MissingData(Arr.empty(), `Expected a single value having structure: ${config}`)),\n onSome: core.succeed\n })),\n flattened: flat\n});\n/** @internal */\nexport const fromEnv = options => {\n const {\n pathDelim,\n seqDelim\n } = Object.assign({}, {\n pathDelim: \"_\",\n seqDelim: \",\"\n }, options);\n const makePathString = path => pipe(path, Arr.join(pathDelim));\n const unmakePathString = pathString => pathString.split(pathDelim);\n const getEnv = () => typeof process !== \"undefined\" && \"env\" in process && typeof process.env === \"object\" ? process.env : {};\n const load = (path, primitive, split = true) => {\n const pathString = makePathString(path);\n const current = getEnv();\n const valueOpt = pathString in current ? Option.some(current[pathString]) : Option.none();\n return pipe(valueOpt, core.mapError(() => configError.MissingData(path, `Expected ${pathString} to exist in the process context`)), core.flatMap(value => parsePrimitive(value, path, primitive, seqDelim, split)));\n };\n const enumerateChildren = path => core.sync(() => {\n const current = getEnv();\n const keys = Object.keys(current);\n const keyPaths = keys.map(value => unmakePathString(value.toUpperCase()));\n const filteredKeyPaths = keyPaths.filter(keyPath => {\n for (let i = 0; i < path.length; i++) {\n const pathComponent = pipe(path, Arr.unsafeGet(i));\n const currentElement = keyPath[i];\n if (currentElement === undefined || pathComponent !== currentElement) {\n return false;\n }\n }\n return true;\n }).flatMap(keyPath => keyPath.slice(path.length, path.length + 1));\n return HashSet.fromIterable(filteredKeyPaths);\n });\n return fromFlat(makeFlat({\n load,\n enumerateChildren,\n patch: pathPatch.empty\n }));\n};\n/** @internal */\nexport const fromMap = (map, config) => {\n const {\n pathDelim,\n seqDelim\n } = Object.assign({\n seqDelim: \",\",\n pathDelim: \".\"\n }, config);\n const makePathString = path => pipe(path, Arr.join(pathDelim));\n const unmakePathString = pathString => pathString.split(pathDelim);\n const mapWithIndexSplit = splitIndexInKeys(map, str => unmakePathString(str), makePathString);\n const load = (path, primitive, split = true) => {\n const pathString = makePathString(path);\n const valueOpt = mapWithIndexSplit.has(pathString) ? Option.some(mapWithIndexSplit.get(pathString)) : Option.none();\n return pipe(valueOpt, core.mapError(() => configError.MissingData(path, `Expected ${pathString} to exist in the provided map`)), core.flatMap(value => parsePrimitive(value, path, primitive, seqDelim, split)));\n };\n const enumerateChildren = path => core.sync(() => {\n const keyPaths = Arr.fromIterable(mapWithIndexSplit.keys()).map(unmakePathString);\n const filteredKeyPaths = keyPaths.filter(keyPath => {\n for (let i = 0; i < path.length; i++) {\n const pathComponent = pipe(path, Arr.unsafeGet(i));\n const currentElement = keyPath[i];\n if (currentElement === undefined || pathComponent !== currentElement) {\n return false;\n }\n }\n return true;\n }).flatMap(keyPath => keyPath.slice(path.length, path.length + 1));\n return HashSet.fromIterable(filteredKeyPaths);\n });\n return fromFlat(makeFlat({\n load,\n enumerateChildren,\n patch: pathPatch.empty\n }));\n};\nconst extend = (leftDef, rightDef, left, right) => {\n const leftPad = Arr.unfold(left.length, index => index >= right.length ? Option.none() : Option.some([leftDef(index), index + 1]));\n const rightPad = Arr.unfold(right.length, index => index >= left.length ? Option.none() : Option.some([rightDef(index), index + 1]));\n const leftExtension = concat(left, leftPad);\n const rightExtension = concat(right, rightPad);\n return [leftExtension, rightExtension];\n};\nconst appendConfigPath = (path, config) => {\n let op = config;\n if (op._tag === \"Nested\") {\n const out = path.slice();\n while (op._tag === \"Nested\") {\n out.push(op.name);\n op = op.config;\n }\n return out;\n }\n return path;\n};\nconst fromFlatLoop = (flat, prefix, config, split) => {\n const op = config;\n switch (op._tag) {\n case OpCodes.OP_CONSTANT:\n {\n return core.succeed(Arr.of(op.value));\n }\n case OpCodes.OP_DESCRIBED:\n {\n return core.suspend(() => fromFlatLoop(flat, prefix, op.config, split));\n }\n case OpCodes.OP_FAIL:\n {\n return core.fail(configError.MissingData(prefix, op.message));\n }\n case OpCodes.OP_FALLBACK:\n {\n return pipe(core.suspend(() => fromFlatLoop(flat, prefix, op.first, split)), core.catchAll(error1 => {\n if (op.condition(error1)) {\n return pipe(fromFlatLoop(flat, prefix, op.second, split), core.catchAll(error2 => core.fail(configError.Or(error1, error2))));\n }\n return core.fail(error1);\n }));\n }\n case OpCodes.OP_LAZY:\n {\n return core.suspend(() => fromFlatLoop(flat, prefix, op.config(), split));\n }\n case OpCodes.OP_MAP_OR_FAIL:\n {\n return core.suspend(() => pipe(fromFlatLoop(flat, prefix, op.original, split), core.flatMap(core.forEachSequential(a => pipe(op.mapOrFail(a), core.mapError(configError.prefixed(appendConfigPath(prefix, op.original))))))));\n }\n case OpCodes.OP_NESTED:\n {\n return core.suspend(() => fromFlatLoop(flat, concat(prefix, Arr.of(op.name)), op.config, split));\n }\n case OpCodes.OP_PRIMITIVE:\n {\n return pipe(pathPatch.patch(prefix, flat.patch), core.flatMap(prefix => pipe(flat.load(prefix, op, split), core.flatMap(values => {\n if (values.length === 0) {\n const name = pipe(Arr.last(prefix), Option.getOrElse(() => \"<n/a>\"));\n return core.fail(configError.MissingData([], `Expected ${op.description} with name ${name}`));\n }\n return core.succeed(values);\n }))));\n }\n case OpCodes.OP_SEQUENCE:\n {\n return pipe(pathPatch.patch(prefix, flat.patch), core.flatMap(patchedPrefix => pipe(flat.enumerateChildren(patchedPrefix), core.flatMap(indicesFrom), core.flatMap(indices => {\n if (indices.length === 0) {\n return core.suspend(() => core.map(fromFlatLoop(flat, prefix, op.config, true), Arr.of));\n }\n return pipe(core.forEachSequential(indices, index => fromFlatLoop(flat, Arr.append(prefix, `[${index}]`), op.config, true)), core.map(chunkChunk => {\n const flattened = Arr.flatten(chunkChunk);\n if (flattened.length === 0) {\n return Arr.of(Arr.empty());\n }\n return Arr.of(flattened);\n }));\n }))));\n }\n case OpCodes.OP_HASHMAP:\n {\n return core.suspend(() => pipe(pathPatch.patch(prefix, flat.patch), core.flatMap(prefix => pipe(flat.enumerateChildren(prefix), core.flatMap(keys => {\n return pipe(keys, core.forEachSequential(key => fromFlatLoop(flat, concat(prefix, Arr.of(key)), op.valueConfig, split)), core.map(matrix => {\n if (matrix.length === 0) {\n return Arr.of(HashMap.empty());\n }\n return pipe(transpose(matrix), Arr.map(values => HashMap.fromIterable(Arr.zip(Arr.fromIterable(keys), values))));\n }));\n })))));\n }\n case OpCodes.OP_ZIP_WITH:\n {\n return core.suspend(() => pipe(fromFlatLoop(flat, prefix, op.left, split), core.either, core.flatMap(left => pipe(fromFlatLoop(flat, prefix, op.right, split), core.either, core.flatMap(right => {\n if (Either.isLeft(left) && Either.isLeft(right)) {\n return core.fail(configError.And(left.left, right.left));\n }\n if (Either.isLeft(left) && Either.isRight(right)) {\n return core.fail(left.left);\n }\n if (Either.isRight(left) && Either.isLeft(right)) {\n return core.fail(right.left);\n }\n if (Either.isRight(left) && Either.isRight(right)) {\n const path = pipe(prefix, Arr.join(\".\"));\n const fail = fromFlatLoopFail(prefix, path);\n const [lefts, rights] = extend(fail, fail, pipe(left.right, Arr.map(Either.right)), pipe(right.right, Arr.map(Either.right)));\n return pipe(lefts, Arr.zip(rights), core.forEachSequential(([left, right]) => pipe(core.zip(left, right), core.map(([left, right]) => op.zip(left, right)))));\n }\n throw new Error(\"BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues\");\n })))));\n }\n }\n};\nconst fromFlatLoopFail = (prefix, path) => index => Either.left(configError.MissingData(prefix, `The element at index ${index} in a sequence at path \"${path}\" was missing`));\n/** @internal */\nexport const mapInputPath = /*#__PURE__*/dual(2, (self, f) => fromFlat(mapInputPathFlat(self.flattened, f)));\nconst mapInputPathFlat = (self, f) => makeFlat({\n load: (path, config, split = true) => self.load(path, config, split),\n enumerateChildren: path => self.enumerateChildren(path),\n patch: pathPatch.mapName(self.patch, f)\n});\n/** @internal */\nexport const nested = /*#__PURE__*/dual(2, (self, name) => fromFlat(makeFlat({\n load: (path, config) => self.flattened.load(path, config, true),\n enumerateChildren: path => self.flattened.enumerateChildren(path),\n patch: pathPatch.nested(self.flattened.patch, name)\n})));\n/** @internal */\nexport const unnested = /*#__PURE__*/dual(2, (self, name) => fromFlat(makeFlat({\n load: (path, config) => self.flattened.load(path, config, true),\n enumerateChildren: path => self.flattened.enumerateChildren(path),\n patch: pathPatch.unnested(self.flattened.patch, name)\n})));\n/** @internal */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => fromFlat(orElseFlat(self.flattened, () => that().flattened)));\nconst orElseFlat = (self, that) => makeFlat({\n load: (path, config, split) => pipe(pathPatch.patch(path, self.patch), core.flatMap(patch => self.load(patch, config, split)), core.catchAll(error1 => pipe(core.sync(that), core.flatMap(that => pipe(pathPatch.patch(path, that.patch), core.flatMap(patch => that.load(patch, config, split)), core.catchAll(error2 => core.fail(configError.Or(error1, error2)))))))),\n enumerateChildren: path => pipe(pathPatch.patch(path, self.patch), core.flatMap(patch => self.enumerateChildren(patch)), core.either, core.flatMap(left => pipe(core.sync(that), core.flatMap(that => pipe(pathPatch.patch(path, that.patch), core.flatMap(patch => that.enumerateChildren(patch)), core.either, core.flatMap(right => {\n if (Either.isLeft(left) && Either.isLeft(right)) {\n return core.fail(configError.And(left.left, right.left));\n }\n if (Either.isLeft(left) && Either.isRight(right)) {\n return core.succeed(right.right);\n }\n if (Either.isRight(left) && Either.isLeft(right)) {\n return core.succeed(left.right);\n }\n if (Either.isRight(left) && Either.isRight(right)) {\n return core.succeed(pipe(left.right, HashSet.union(right.right)));\n }\n throw new Error(\"BUG: ConfigProvider.orElseFlat - please report an issue at https://github.com/Effect-TS/effect/issues\");\n })))))),\n patch: pathPatch.empty\n});\n/** @internal */\nexport const constantCase = self => mapInputPath(self, StringUtils.constantCase);\n/** @internal */\nexport const kebabCase = self => mapInputPath(self, StringUtils.kebabCase);\n/** @internal */\nexport const lowerCase = self => mapInputPath(self, StringUtils.lowerCase);\n/** @internal */\nexport const snakeCase = self => mapInputPath(self, StringUtils.snakeCase);\n/** @internal */\nexport const upperCase = self => mapInputPath(self, StringUtils.upperCase);\n/** @internal */\nexport const within = /*#__PURE__*/dual(3, (self, path, f) => {\n const unnest = Arr.reduce(path, self, (provider, name) => unnested(provider, name));\n const nest = Arr.reduceRight(path, f(unnest), (provider, name) => nested(provider, name));\n return orElse(nest, () => self);\n});\nconst splitPathString = (text, delim) => {\n const split = text.split(new RegExp(`\\\\s*${regexp.escape(delim)}\\\\s*`));\n return split;\n};\nconst parsePrimitive = (text, path, primitive, delimiter, split) => {\n if (!split) {\n return pipe(primitive.parse(text), core.mapBoth({\n onFailure: configError.prefixed(path),\n onSuccess: Arr.of\n }));\n }\n return pipe(splitPathString(text, delimiter), core.forEachSequential(char => primitive.parse(char.trim())), core.mapError(configError.prefixed(path)));\n};\nconst transpose = array => {\n return Object.keys(array[0]).map(column => array.map(row => row[column]));\n};\nconst indicesFrom = quotedIndices => pipe(core.forEachSequential(quotedIndices, parseQuotedIndex), core.mapBoth({\n onFailure: () => Arr.empty(),\n onSuccess: Arr.sort(number.Order)\n}), core.either, core.map(Either.merge));\nconst STR_INDEX_REGEX = /(^.+)(\\[(\\d+)\\])$/;\nconst QUOTED_INDEX_REGEX = /^(\\[(\\d+)\\])$/;\nconst parseQuotedIndex = str => {\n const match = str.match(QUOTED_INDEX_REGEX);\n if (match !== null) {\n const matchedIndex = match[2];\n return pipe(matchedIndex !== undefined && matchedIndex.length > 0 ? Option.some(matchedIndex) : Option.none(), Option.flatMap(parseInteger));\n }\n return Option.none();\n};\nconst splitIndexInKeys = (map, unmakePathString, makePathString) => {\n const newMap = new Map();\n for (const [pathString, value] of map) {\n const keyWithIndex = pipe(unmakePathString(pathString), Arr.flatMap(key => Option.match(splitIndexFrom(key), {\n onNone: () => Arr.of(key),\n onSome: ([key, index]) => Arr.make(key, `[${index}]`)\n })));\n newMap.set(makePathString(keyWithIndex), value);\n }\n return newMap;\n};\nconst splitIndexFrom = key => {\n const match = key.match(STR_INDEX_REGEX);\n if (match !== null) {\n const matchedString = match[1];\n const matchedIndex = match[3];\n const optionalString = matchedString !== undefined && matchedString.length > 0 ? Option.some(matchedString) : Option.none();\n const optionalIndex = pipe(matchedIndex !== undefined && matchedIndex.length > 0 ? Option.some(matchedIndex) : Option.none(), Option.flatMap(parseInteger));\n return Option.all([optionalString, optionalIndex]);\n }\n return Option.none();\n};\nconst parseInteger = str => {\n const parsedIndex = Number.parseInt(str);\n return Number.isNaN(parsedIndex) ? Option.none() : Option.some(parsedIndex);\n};\nconst keyName = name => ({\n _tag: \"KeyName\",\n name\n});\nconst keyIndex = index => ({\n _tag: \"KeyIndex\",\n index\n});\n/** @internal */\nexport const fromJson = json => {\n const hiddenDelimiter = \"\\ufeff\";\n const indexedEntries = Arr.map(getIndexedEntries(json), ([key, value]) => [configPathToString(key).join(hiddenDelimiter), value]);\n return fromMap(new Map(indexedEntries), {\n pathDelim: hiddenDelimiter,\n seqDelim: hiddenDelimiter\n });\n};\nconst configPathToString = path => {\n const output = [];\n let i = 0;\n while (i < path.length) {\n const component = path[i];\n if (component._tag === \"KeyName\") {\n if (i + 1 < path.length) {\n const nextComponent = path[i + 1];\n if (nextComponent._tag === \"KeyIndex\") {\n output.push(`${component.name}[${nextComponent.index}]`);\n i += 2;\n } else {\n output.push(component.name);\n i += 1;\n }\n } else {\n output.push(component.name);\n i += 1;\n }\n }\n }\n return output;\n};\nconst getIndexedEntries = config => {\n const loopAny = (path, value) => {\n if (typeof value === \"string\") {\n return Arr.make([path, value]);\n }\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return Arr.make([path, String(value)]);\n }\n if (Arr.isArray(value)) {\n return loopArray(path, value);\n }\n if (typeof value === \"object\" && value !== null) {\n return loopObject(path, value);\n }\n return Arr.empty();\n };\n const loopArray = (path, values) => Arr.match(values, {\n onEmpty: () => Arr.make([path, \"<nil>\"]),\n onNonEmpty: Arr.flatMap((value, index) => loopAny(Arr.append(path, keyIndex(index)), value))\n });\n const loopObject = (path, value) => Object.entries(value).filter(([, value]) => Predicate.isNotNullable(value)).flatMap(([key, value]) => {\n const newPath = Arr.append(path, keyName(key));\n const result = loopAny(newPath, value);\n if (Arr.isEmptyReadonlyArray(result)) {\n return Arr.make([newPath, \"\"]);\n }\n return result;\n });\n return loopObject(Arr.empty(), config);\n};\n//# sourceMappingURL=configProvider.js.map","import * as Context from \"../../Context.js\";\nimport * as core from \"../core.js\";\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/Console\");\n/** @internal */\nexport const consoleTag = /*#__PURE__*/Context.GenericTag(\"effect/Console\");\n/** @internal */\nexport const defaultConsole = {\n [TypeId]: TypeId,\n assert(condition, ...args) {\n return core.sync(() => {\n console.assert(condition, ...args);\n });\n },\n clear: /*#__PURE__*/core.sync(() => {\n console.clear();\n }),\n count(label) {\n return core.sync(() => {\n console.count(label);\n });\n },\n countReset(label) {\n return core.sync(() => {\n console.countReset(label);\n });\n },\n debug(...args) {\n return core.sync(() => {\n console.debug(...args);\n });\n },\n dir(item, options) {\n return core.sync(() => {\n console.dir(item, options);\n });\n },\n dirxml(...args) {\n return core.sync(() => {\n console.dirxml(...args);\n });\n },\n error(...args) {\n return core.sync(() => {\n console.error(...args);\n });\n },\n group(options) {\n return options?.collapsed ? core.sync(() => console.groupCollapsed(options?.label)) : core.sync(() => console.group(options?.label));\n },\n groupEnd: /*#__PURE__*/core.sync(() => {\n console.groupEnd();\n }),\n info(...args) {\n return core.sync(() => {\n console.info(...args);\n });\n },\n log(...args) {\n return core.sync(() => {\n console.log(...args);\n });\n },\n table(tabularData, properties) {\n return core.sync(() => {\n console.table(tabularData, properties);\n });\n },\n time(label) {\n return core.sync(() => console.time(label));\n },\n timeEnd(label) {\n return core.sync(() => console.timeEnd(label));\n },\n timeLog(label, ...args) {\n return core.sync(() => {\n console.timeLog(label, ...args);\n });\n },\n trace(...args) {\n return core.sync(() => {\n console.trace(...args);\n });\n },\n warn(...args) {\n return core.sync(() => {\n console.warn(...args);\n });\n },\n unsafe: console\n};\n//# sourceMappingURL=console.js.map","import * as Chunk from \"../Chunk.js\";\nimport * as Context from \"../Context.js\";\nimport { pipe } from \"../Function.js\";\nimport * as Hash from \"../Hash.js\";\nimport * as PCGRandom from \"../Utils.js\";\nimport * as core from \"./core.js\";\n/** @internal */\nconst RandomSymbolKey = \"effect/Random\";\n/** @internal */\nexport const RandomTypeId = /*#__PURE__*/Symbol.for(RandomSymbolKey);\n/** @internal */\nexport const randomTag = /*#__PURE__*/Context.GenericTag(\"effect/Random\");\n/** @internal */\nclass RandomImpl {\n seed;\n [RandomTypeId] = RandomTypeId;\n PRNG;\n constructor(seed) {\n this.seed = seed;\n this.PRNG = new PCGRandom.PCGRandom(seed);\n }\n get next() {\n return core.sync(() => this.PRNG.number());\n }\n get nextBoolean() {\n return core.map(this.next, n => n > 0.5);\n }\n get nextInt() {\n return core.sync(() => this.PRNG.integer(Number.MAX_SAFE_INTEGER));\n }\n nextRange(min, max) {\n return core.map(this.next, n => (max - min) * n + min);\n }\n nextIntBetween(min, max) {\n return core.sync(() => this.PRNG.integer(max - min) + min);\n }\n shuffle(elements) {\n return shuffleWith(elements, n => this.nextIntBetween(0, n));\n }\n}\nconst shuffleWith = (elements, nextIntBounded) => {\n return core.suspend(() => pipe(core.sync(() => Array.from(elements)), core.flatMap(buffer => {\n const numbers = [];\n for (let i = buffer.length; i >= 2; i = i - 1) {\n numbers.push(i);\n }\n return pipe(numbers, core.forEachSequentialDiscard(n => pipe(nextIntBounded(n), core.map(k => swap(buffer, n - 1, k)))), core.as(Chunk.fromIterable(buffer)));\n })));\n};\nconst swap = (buffer, index1, index2) => {\n const tmp = buffer[index1];\n buffer[index1] = buffer[index2];\n buffer[index2] = tmp;\n return buffer;\n};\nexport const make = seed => new RandomImpl(Hash.hash(seed));\n/** @internal */\nclass FixedRandomImpl {\n values;\n [RandomTypeId] = RandomTypeId;\n index = 0;\n constructor(values) {\n this.values = values;\n if (values.length === 0) {\n throw new Error(\"Requires at least one value\");\n }\n }\n getNextValue() {\n const value = this.values[this.index];\n this.index = (this.index + 1) % this.values.length;\n return value;\n }\n get next() {\n return core.sync(() => {\n const value = this.getNextValue();\n if (typeof value === \"number\") {\n return Math.max(0, Math.min(1, value));\n }\n return Hash.hash(value) / 2147483647;\n });\n }\n get nextBoolean() {\n return core.sync(() => {\n const value = this.getNextValue();\n if (typeof value === \"boolean\") {\n return value;\n }\n return Hash.hash(value) % 2 === 0;\n });\n }\n get nextInt() {\n return core.sync(() => {\n const value = this.getNextValue();\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return Math.round(value);\n }\n return Math.abs(Hash.hash(value));\n });\n }\n nextRange(min, max) {\n return core.map(this.next, n => (max - min) * n + min);\n }\n nextIntBetween(min, max) {\n return core.sync(() => {\n const value = this.getNextValue();\n if (typeof value === \"number\" && Number.isFinite(value)) {\n return Math.max(min, Math.min(max - 1, Math.round(value)));\n }\n const hash = Math.abs(Hash.hash(value));\n return min + hash % (max - min);\n });\n }\n shuffle(elements) {\n return shuffleWith(elements, n => this.nextIntBetween(0, n));\n }\n}\n/** @internal */\nexport const fixed = values => new FixedRandomImpl(values);\n//# sourceMappingURL=random.js.map","/**\n * @since 2.0.0\n */\nimport * as Context from \"../Context.js\";\nimport { constFalse } from \"../Function.js\";\n/** @internal */\nexport const TracerTypeId = /*#__PURE__*/Symbol.for(\"effect/Tracer\");\n/** @internal */\nexport const make = options => ({\n [TracerTypeId]: TracerTypeId,\n ...options\n});\n/** @internal */\nexport const tracerTag = /*#__PURE__*/Context.GenericTag(\"effect/Tracer\");\n/** @internal */\nexport const spanTag = /*#__PURE__*/Context.GenericTag(\"effect/ParentSpan\");\nconst randomHexString = /*#__PURE__*/function () {\n const characters = \"abcdef0123456789\";\n const charactersLength = characters.length;\n return function (length) {\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n };\n}();\n/** @internal */\nexport class NativeSpan {\n name;\n parent;\n context;\n startTime;\n kind;\n _tag = \"Span\";\n spanId;\n traceId = \"native\";\n sampled = true;\n status;\n attributes;\n events = [];\n links;\n constructor(name, parent, context, links, startTime, kind) {\n this.name = name;\n this.parent = parent;\n this.context = context;\n this.startTime = startTime;\n this.kind = kind;\n this.status = {\n _tag: \"Started\",\n startTime\n };\n this.attributes = new Map();\n this.traceId = parent._tag === \"Some\" ? parent.value.traceId : randomHexString(32);\n this.spanId = randomHexString(16);\n this.links = Array.from(links);\n }\n end(endTime, exit) {\n this.status = {\n _tag: \"Ended\",\n endTime,\n exit,\n startTime: this.status.startTime\n };\n }\n attribute(key, value) {\n this.attributes.set(key, value);\n }\n event(name, startTime, attributes) {\n this.events.push([name, startTime, attributes ?? {}]);\n }\n addLinks(links) {\n // eslint-disable-next-line no-restricted-syntax\n this.links.push(...links);\n }\n}\n/** @internal */\nexport const nativeTracer = /*#__PURE__*/make({\n span: (name, parent, context, links, startTime, kind) => new NativeSpan(name, parent, context, links, startTime, kind),\n context: f => f()\n});\n/** @internal */\nexport const externalSpan = options => ({\n _tag: \"ExternalSpan\",\n spanId: options.spanId,\n traceId: options.traceId,\n sampled: options.sampled ?? true,\n context: options.context ?? Context.empty()\n});\n/** @internal */\nexport const addSpanStackTrace = options => {\n if (options?.captureStackTrace === false) {\n return options;\n } else if (options?.captureStackTrace !== undefined && typeof options.captureStackTrace !== \"boolean\") {\n return options;\n }\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 3;\n const traceError = new Error();\n Error.stackTraceLimit = limit;\n let cache = false;\n return {\n ...options,\n captureStackTrace: () => {\n if (cache !== false) {\n return cache;\n }\n if (traceError.stack !== undefined) {\n const stack = traceError.stack.split(\"\\n\");\n if (stack[3] !== undefined) {\n cache = stack[3].trim();\n return cache;\n }\n }\n }\n };\n};\n/** @internal */\nexport const DisablePropagation = /*#__PURE__*/Context.Reference()(\"effect/Tracer/DisablePropagation\", {\n defaultValue: constFalse\n});\n//# sourceMappingURL=tracer.js.map","import * as Array from \"../Array.js\";\nimport * as Context from \"../Context.js\";\nimport * as Duration from \"../Duration.js\";\nimport { dual, pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as clock from \"./clock.js\";\nimport * as configProvider from \"./configProvider.js\";\nimport * as core from \"./core.js\";\nimport * as console_ from \"./defaultServices/console.js\";\nimport * as random from \"./random.js\";\nimport * as tracer from \"./tracer.js\";\n/** @internal */\nexport const liveServices = /*#__PURE__*/pipe(/*#__PURE__*/Context.empty(), /*#__PURE__*/Context.add(clock.clockTag, /*#__PURE__*/clock.make()), /*#__PURE__*/Context.add(console_.consoleTag, console_.defaultConsole), /*#__PURE__*/Context.add(random.randomTag, /*#__PURE__*/random.make(/*#__PURE__*/Math.random())), /*#__PURE__*/Context.add(configProvider.configProviderTag, /*#__PURE__*/configProvider.fromEnv()), /*#__PURE__*/Context.add(tracer.tracerTag, tracer.nativeTracer));\n/**\n * The `FiberRef` holding the default `Effect` services.\n *\n * @since 2.0.0\n * @category fiberRefs\n */\nexport const currentServices = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/DefaultServices/currentServices\"), () => core.fiberRefUnsafeMakeContext(liveServices));\n// circular with Clock\n/** @internal */\nexport const sleep = duration => {\n const decodedDuration = Duration.decode(duration);\n return clockWith(clock => clock.sleep(decodedDuration));\n};\n/** @internal */\nexport const defaultServicesWith = f => core.withFiberRuntime(fiber => f(fiber.currentDefaultServices));\n/** @internal */\nexport const clockWith = f => defaultServicesWith(services => f(services.unsafeMap.get(clock.clockTag.key)));\n/** @internal */\nexport const currentTimeMillis = /*#__PURE__*/clockWith(clock => clock.currentTimeMillis);\n/** @internal */\nexport const currentTimeNanos = /*#__PURE__*/clockWith(clock => clock.currentTimeNanos);\n/** @internal */\nexport const withClock = /*#__PURE__*/dual(2, (effect, c) => core.fiberRefLocallyWith(currentServices, Context.add(clock.clockTag, c))(effect));\n// circular with ConfigProvider\n/** @internal */\nexport const withConfigProvider = /*#__PURE__*/dual(2, (self, provider) => core.fiberRefLocallyWith(currentServices, Context.add(configProvider.configProviderTag, provider))(self));\n/** @internal */\nexport const configProviderWith = f => defaultServicesWith(services => f(services.unsafeMap.get(configProvider.configProviderTag.key)));\n/** @internal */\nexport const config = config => configProviderWith(_ => _.load(config));\n/** @internal */\nexport const configOrDie = config => core.orDie(configProviderWith(_ => _.load(config)));\n// circular with Random\n/** @internal */\nexport const randomWith = f => defaultServicesWith(services => f(services.unsafeMap.get(random.randomTag.key)));\n/** @internal */\nexport const withRandom = /*#__PURE__*/dual(2, (effect, value) => core.fiberRefLocallyWith(currentServices, Context.add(random.randomTag, value))(effect));\n/** @internal */\nexport const next = /*#__PURE__*/randomWith(random => random.next);\n/** @internal */\nexport const nextInt = /*#__PURE__*/randomWith(random => random.nextInt);\n/** @internal */\nexport const nextBoolean = /*#__PURE__*/randomWith(random => random.nextBoolean);\n/** @internal */\nexport const nextRange = (min, max) => randomWith(random => random.nextRange(min, max));\n/** @internal */\nexport const nextIntBetween = (min, max) => randomWith(random => random.nextIntBetween(min, max));\n/** @internal */\nexport const shuffle = elements => randomWith(random => random.shuffle(elements));\n/** @internal */\nexport const choice = elements => {\n const array = Array.fromIterable(elements);\n return core.map(array.length === 0 ? core.fail(new core.NoSuchElementException(\"Cannot select a random element from an empty array\")) : randomWith(random => random.nextIntBetween(0, array.length)), i => array[i]);\n};\n// circular with Tracer\n/** @internal */\nexport const tracerWith = f => defaultServicesWith(services => f(services.unsafeMap.get(tracer.tracerTag.key)));\n/** @internal */\nexport const withTracer = /*#__PURE__*/dual(2, (effect, value) => core.fiberRefLocallyWith(currentServices, Context.add(tracer.tracerTag, value))(effect));\n//# sourceMappingURL=defaultServices.js.map","import * as internal from \"./internal/clock.js\";\nimport * as defaultServices from \"./internal/defaultServices.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const ClockTypeId = internal.ClockTypeId;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const sleep = defaultServices.sleep;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const currentTimeMillis = defaultServices.currentTimeMillis;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const currentTimeNanos = defaultServices.currentTimeNanos;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const clockWith = defaultServices.clockWith;\n/**\n * @since 2.0.0\n * @category context\n */\nexport const Clock = internal.clockTag;\n//# sourceMappingURL=Clock.js.map","import * as Arr from \"../Array.js\";\nimport * as Equal from \"../Equal.js\";\nimport { dual, pipe } from \"../Function.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as core from \"./core.js\";\n/** @internal */\nexport function unsafeMake(fiberRefLocals) {\n return new FiberRefsImpl(fiberRefLocals);\n}\n/** @internal */\nexport function empty() {\n return unsafeMake(new Map());\n}\n/** @internal */\nexport const FiberRefsSym = /*#__PURE__*/Symbol.for(\"effect/FiberRefs\");\n/** @internal */\nexport class FiberRefsImpl {\n locals;\n [FiberRefsSym] = FiberRefsSym;\n constructor(locals) {\n this.locals = locals;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nconst findAncestor = (_ref, _parentStack, _childStack, _childModified = false) => {\n const ref = _ref;\n let parentStack = _parentStack;\n let childStack = _childStack;\n let childModified = _childModified;\n let ret = undefined;\n while (ret === undefined) {\n if (Arr.isNonEmptyReadonlyArray(parentStack) && Arr.isNonEmptyReadonlyArray(childStack)) {\n const parentFiberId = Arr.headNonEmpty(parentStack)[0];\n const parentAncestors = Arr.tailNonEmpty(parentStack);\n const childFiberId = Arr.headNonEmpty(childStack)[0];\n const childRefValue = Arr.headNonEmpty(childStack)[1];\n const childAncestors = Arr.tailNonEmpty(childStack);\n if (parentFiberId.startTimeMillis < childFiberId.startTimeMillis) {\n childStack = childAncestors;\n childModified = true;\n } else if (parentFiberId.startTimeMillis > childFiberId.startTimeMillis) {\n parentStack = parentAncestors;\n } else {\n if (parentFiberId.id < childFiberId.id) {\n childStack = childAncestors;\n childModified = true;\n } else if (parentFiberId.id > childFiberId.id) {\n parentStack = parentAncestors;\n } else {\n ret = [childRefValue, childModified];\n }\n }\n } else {\n ret = [ref.initial, true];\n }\n }\n return ret;\n};\n/** @internal */\nexport const joinAs = /*#__PURE__*/dual(3, (self, fiberId, that) => {\n const parentFiberRefs = new Map(self.locals);\n that.locals.forEach((childStack, fiberRef) => {\n const childValue = childStack[0][1];\n if (!childStack[0][0][Equal.symbol](fiberId)) {\n if (!parentFiberRefs.has(fiberRef)) {\n if (Equal.equals(childValue, fiberRef.initial)) {\n return;\n }\n parentFiberRefs.set(fiberRef, [[fiberId, fiberRef.join(fiberRef.initial, childValue)]]);\n return;\n }\n const parentStack = parentFiberRefs.get(fiberRef);\n const [ancestor, wasModified] = findAncestor(fiberRef, parentStack, childStack);\n if (wasModified) {\n const patch = fiberRef.diff(ancestor, childValue);\n const oldValue = parentStack[0][1];\n const newValue = fiberRef.join(oldValue, fiberRef.patch(patch)(oldValue));\n if (!Equal.equals(oldValue, newValue)) {\n let newStack;\n const parentFiberId = parentStack[0][0];\n if (parentFiberId[Equal.symbol](fiberId)) {\n newStack = [[parentFiberId, newValue], ...parentStack.slice(1)];\n } else {\n newStack = [[fiberId, newValue], ...parentStack];\n }\n parentFiberRefs.set(fiberRef, newStack);\n }\n }\n }\n });\n return new FiberRefsImpl(parentFiberRefs);\n});\n/** @internal */\nexport const forkAs = /*#__PURE__*/dual(2, (self, childId) => {\n const map = new Map();\n unsafeForkAs(self, map, childId);\n return new FiberRefsImpl(map);\n});\nconst unsafeForkAs = (self, map, fiberId) => {\n self.locals.forEach((stack, fiberRef) => {\n const oldValue = stack[0][1];\n const newValue = fiberRef.patch(fiberRef.fork)(oldValue);\n if (Equal.equals(oldValue, newValue)) {\n map.set(fiberRef, stack);\n } else {\n map.set(fiberRef, [[fiberId, newValue], ...stack]);\n }\n });\n};\n/** @internal */\nexport const fiberRefs = self => HashSet.fromIterable(self.locals.keys());\n/** @internal */\nexport const setAll = self => core.forEachSequentialDiscard(fiberRefs(self), fiberRef => core.fiberRefSet(fiberRef, getOrDefault(self, fiberRef)));\n/** @internal */\nexport const delete_ = /*#__PURE__*/dual(2, (self, fiberRef) => {\n const locals = new Map(self.locals);\n locals.delete(fiberRef);\n return new FiberRefsImpl(locals);\n});\n/** @internal */\nexport const get = /*#__PURE__*/dual(2, (self, fiberRef) => {\n if (!self.locals.has(fiberRef)) {\n return Option.none();\n }\n return Option.some(Arr.headNonEmpty(self.locals.get(fiberRef))[1]);\n});\n/** @internal */\nexport const getOrDefault = /*#__PURE__*/dual(2, (self, fiberRef) => pipe(get(self, fiberRef), Option.getOrElse(() => fiberRef.initial)));\n/** @internal */\nexport const updateAs = /*#__PURE__*/dual(2, (self, {\n fiberId,\n fiberRef,\n value\n}) => {\n if (self.locals.size === 0) {\n return new FiberRefsImpl(new Map([[fiberRef, [[fiberId, value]]]]));\n }\n const locals = new Map(self.locals);\n unsafeUpdateAs(locals, fiberId, fiberRef, value);\n return new FiberRefsImpl(locals);\n});\nconst unsafeUpdateAs = (locals, fiberId, fiberRef, value) => {\n const oldStack = locals.get(fiberRef) ?? [];\n let newStack;\n if (Arr.isNonEmptyReadonlyArray(oldStack)) {\n const [currentId, currentValue] = Arr.headNonEmpty(oldStack);\n if (currentId[Equal.symbol](fiberId)) {\n if (Equal.equals(currentValue, value)) {\n return;\n } else {\n newStack = [[fiberId, value], ...oldStack.slice(1)];\n }\n } else {\n newStack = [[fiberId, value], ...oldStack];\n }\n } else {\n newStack = [[fiberId, value]];\n }\n locals.set(fiberRef, newStack);\n};\n/** @internal */\nexport const updateManyAs = /*#__PURE__*/dual(2, (self, {\n entries,\n forkAs\n}) => {\n if (self.locals.size === 0) {\n return new FiberRefsImpl(new Map(entries));\n }\n const locals = new Map(self.locals);\n if (forkAs !== undefined) {\n unsafeForkAs(self, locals, forkAs);\n }\n entries.forEach(([fiberRef, values]) => {\n if (values.length === 1) {\n unsafeUpdateAs(locals, values[0][0], fiberRef, values[0][1]);\n } else {\n values.forEach(([fiberId, value]) => {\n unsafeUpdateAs(locals, fiberId, fiberRef, value);\n });\n }\n });\n return new FiberRefsImpl(locals);\n});\n//# sourceMappingURL=fiberRefs.js.map","import * as internal from \"./internal/fiberRefs.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const FiberRefsSym = internal.FiberRefsSym;\nconst delete_ = internal.delete_;\nexport {\n/**\n * Deletes the specified `FiberRef` from the `FibterRefs`.\n *\n * @since 2.0.0\n * @category utils\n */\ndelete_ as delete };\n/**\n * Returns a set of each `FiberRef` in this collection.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const fiberRefs = internal.fiberRefs;\n/**\n * Forks this collection of fiber refs as the specified child fiber id. This\n * will potentially modify the value of the fiber refs, as determined by the\n * individual fiber refs that make up the collection.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const forkAs = internal.forkAs;\n/**\n * Gets the value of the specified `FiberRef` in this collection of `FiberRef`\n * values if it exists or `None` otherwise.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const get = internal.get;\n/**\n * Gets the value of the specified `FiberRef` in this collection of `FiberRef`\n * values if it exists or the `initial` value of the `FiberRef` otherwise.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const getOrDefault = internal.getOrDefault;\n/**\n * Joins this collection of fiber refs to the specified collection, as the\n * specified fiber id. This will perform diffing and merging to ensure\n * preservation of maximum information from both child and parent refs.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const joinAs = internal.joinAs;\n/**\n * Set each ref to either its value or its default.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const setAll = internal.setAll;\n/**\n * Updates the value of the specified `FiberRef` using the provided `FiberId`\n *\n * @since 2.0.0\n * @category utils\n */\nexport const updateAs = internal.updateAs;\n/**\n * Updates the values of the specified `FiberRef` & value pairs using the provided `FiberId`\n *\n * @since 2.0.0\n * @category utils\n */\nexport const updateManyAs = internal.updateManyAs;\n/**\n * Note: it will not copy the provided Map, make sure to provide a fresh one.\n *\n * @since 2.0.0\n * @category unsafe\n */\nexport const unsafeMake = internal.unsafeMake;\n/**\n * The empty collection of `FiberRef` values.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const empty = internal.empty;\n//# sourceMappingURL=FiberRefs.js.map","import { dual, pipe } from \"./Function.js\";\nimport * as core from \"./internal/core.js\";\nimport * as number from \"./Number.js\";\nimport * as order from \"./Order.js\";\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const All = core.logLevelAll;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Fatal = core.logLevelFatal;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Error = core.logLevelError;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Warning = core.logLevelWarning;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Info = core.logLevelInfo;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Debug = core.logLevelDebug;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Trace = core.logLevelTrace;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const None = core.logLevelNone;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const allLevels = core.allLogLevels;\n/**\n * Temporarily sets a `LogLevel` for an `Effect` workflow.\n *\n * **Details**\n *\n * This function allows you to apply a specific `LogLevel` locally to an\n * `Effect` workflow. Once the workflow completes, the `LogLevel` reverts to its\n * previous state.\n *\n * **When to Use**\n *\n * This is particularly useful when you want to adjust the verbosity of logging\n * for specific parts of your program without affecting the global log level.\n *\n * @example\n * ```ts\n * import { Effect, LogLevel } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * yield* Effect.log(\"message1\")\n * yield* Effect.gen(function*() {\n * yield* Effect.log(\"message2\")\n * yield* Effect.log(\"message3\")\n * }).pipe(LogLevel.locally(LogLevel.Warning))\n * })\n *\n * Effect.runFork(program)\n * // timestamp=... level=INFO fiber=#0 message=message1\n * // timestamp=... level=WARN fiber=#0 message=message2\n * // timestamp=... level=WARN fiber=#0 message=message3\n * ```\n *\n * @since 2.0.0\n * @category utils\n */\nexport const locally = /*#__PURE__*/dual(2, (use, self) => core.fiberRefLocally(use, core.currentLogLevel, self));\n/**\n * @since 2.0.0\n * @category instances\n */\nexport const Order = /*#__PURE__*/pipe(number.Order, /*#__PURE__*/order.mapInput(level => level.ordinal));\n/**\n * @since 2.0.0\n * @category ordering\n */\nexport const lessThan = /*#__PURE__*/order.lessThan(Order);\n/**\n * @since 2.0.0\n * @category ordering\n */\nexport const lessThanEqual = /*#__PURE__*/order.lessThanOrEqualTo(Order);\n/**\n * @since 2.0.0\n * @category ordering\n */\nexport const greaterThan = /*#__PURE__*/order.greaterThan(Order);\n/**\n * @since 2.0.0\n * @category ordering\n */\nexport const greaterThanEqual = /*#__PURE__*/order.greaterThanOrEqualTo(Order);\n/**\n * @since 2.0.0\n * @category conversions\n */\nexport const fromLiteral = literal => {\n switch (literal) {\n case \"All\":\n return All;\n case \"Debug\":\n return Debug;\n case \"Error\":\n return Error;\n case \"Fatal\":\n return Fatal;\n case \"Info\":\n return Info;\n case \"Trace\":\n return Trace;\n case \"None\":\n return None;\n case \"Warning\":\n return Warning;\n }\n};\n//# sourceMappingURL=LogLevel.js.map","/** @internal */\nexport const make = (label, startTime) => ({\n label,\n startTime\n});\n/**\n * Sanitize a given string by replacing spaces, equal signs, and double quotes with underscores.\n *\n * @internal\n */\nexport const formatLabel = key => key.replace(/[\\s=\"]/g, \"_\");\n/** @internal */\nexport const render = now => self => {\n const label = formatLabel(self.label);\n return `${label}=${now - self.startTime}ms`;\n};\n//# sourceMappingURL=logSpan.js.map","import * as internal from \"./internal/effectable.js\";\n/**\n * @since 2.0.0\n * @category type ids\n */\nexport const EffectTypeId = internal.EffectTypeId;\n/**\n * @since 2.0.0\n * @category type ids\n */\nexport const StreamTypeId = internal.StreamTypeId;\n/**\n * @since 2.0.0\n * @category type ids\n */\nexport const SinkTypeId = internal.SinkTypeId;\n/**\n * @since 2.0.0\n * @category type ids\n */\nexport const ChannelTypeId = internal.ChannelTypeId;\n/**\n * @since 2.0.0\n * @category prototypes\n */\nexport const EffectPrototype = internal.EffectPrototype;\n/**\n * @since 2.0.0\n * @category prototypes\n */\nexport const CommitPrototype = internal.CommitPrototype;\n/**\n * @since 2.0.0\n * @category prototypes\n */\nexport const StructuralCommitPrototype = internal.StructuralCommitPrototype;\nconst Base = internal.Base;\nconst StructuralBase = internal.StructuralBase;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport class Class extends Base {}\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport class StructuralClass extends StructuralBase {}\n//# sourceMappingURL=Effectable.js.map","import { dual } from \"./Function.js\";\nimport * as core from \"./internal/core.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nimport { hasProperty } from \"./Predicate.js\";\n/**\n * @since 2.0.0\n * @category type ids\n */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/Readable\");\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isReadable = u => hasProperty(u, TypeId);\nconst Proto = {\n [TypeId]: TypeId,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const make = get => {\n const self = Object.create(Proto);\n self.get = get;\n return self;\n};\n/**\n * @since 2.0.0\n * @category combinators\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => make(core.map(self.get, f)));\n/**\n * @since 2.0.0\n * @category combinators\n */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => make(core.flatMap(self.get, f)));\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const unwrap = effect => make(core.flatMap(effect, s => s.get));\n//# sourceMappingURL=Readable.js.map","import * as Effectable from \"../Effectable.js\";\nimport { dual } from \"../Function.js\";\nimport * as MutableRef from \"../MutableRef.js\";\nimport * as Option from \"../Option.js\";\nimport * as Readable from \"../Readable.js\";\nimport * as core from \"./core.js\";\n/** @internal */\nexport const RefTypeId = /*#__PURE__*/Symbol.for(\"effect/Ref\");\n/** @internal */\nexport const refVariance = {\n /* c8 ignore next */\n _A: _ => _\n};\nclass RefImpl extends Effectable.Class {\n ref;\n commit() {\n return this.get;\n }\n [RefTypeId] = refVariance;\n [Readable.TypeId] = Readable.TypeId;\n constructor(ref) {\n super();\n this.ref = ref;\n this.get = core.sync(() => MutableRef.get(this.ref));\n }\n get;\n modify(f) {\n return core.sync(() => {\n const current = MutableRef.get(this.ref);\n const [b, a] = f(current);\n if (current !== a) {\n MutableRef.set(a)(this.ref);\n }\n return b;\n });\n }\n}\n/** @internal */\nexport const unsafeMake = value => new RefImpl(MutableRef.make(value));\n/** @internal */\nexport const make = value => core.sync(() => unsafeMake(value));\n/** @internal */\nexport const get = self => self.get;\n/** @internal */\nexport const set = /*#__PURE__*/dual(2, (self, value) => self.modify(() => [void 0, value]));\n/** @internal */\nexport const getAndSet = /*#__PURE__*/dual(2, (self, value) => self.modify(a => [a, value]));\n/** @internal */\nexport const getAndUpdate = /*#__PURE__*/dual(2, (self, f) => self.modify(a => [a, f(a)]));\n/** @internal */\nexport const getAndUpdateSome = /*#__PURE__*/dual(2, (self, pf) => self.modify(value => {\n const option = pf(value);\n switch (option._tag) {\n case \"None\":\n {\n return [value, value];\n }\n case \"Some\":\n {\n return [value, option.value];\n }\n }\n}));\n/** @internal */\nexport const setAndGet = /*#__PURE__*/dual(2, (self, value) => self.modify(() => [value, value]));\n/** @internal */\nexport const modify = /*#__PURE__*/dual(2, (self, f) => self.modify(f));\n/** @internal */\nexport const modifySome = /*#__PURE__*/dual(3, (self, fallback, pf) => self.modify(value => {\n const option = pf(value);\n switch (option._tag) {\n case \"None\":\n {\n return [fallback, value];\n }\n case \"Some\":\n {\n return option.value;\n }\n }\n}));\n/** @internal */\nexport const update = /*#__PURE__*/dual(2, (self, f) => self.modify(a => [void 0, f(a)]));\n/** @internal */\nexport const updateAndGet = /*#__PURE__*/dual(2, (self, f) => self.modify(a => {\n const result = f(a);\n return [result, result];\n}));\n/** @internal */\nexport const updateSome = /*#__PURE__*/dual(2, (self, f) => self.modify(a => [void 0, Option.match(f(a), {\n onNone: () => a,\n onSome: b => b\n})]));\n/** @internal */\nexport const updateSomeAndGet = /*#__PURE__*/dual(2, (self, pf) => self.modify(value => {\n const option = pf(value);\n switch (option._tag) {\n case \"None\":\n {\n return [value, value];\n }\n case \"Some\":\n {\n return [option.value, option.value];\n }\n }\n}));\n/** @internal */\nexport const unsafeGet = self => MutableRef.get(self.ref);\n//# sourceMappingURL=ref.js.map","import * as Arr from \"../../Array.js\";\nimport { equals } from \"../../Equal.js\";\nimport { dual } from \"../../Function.js\";\nimport * as fiberRefs_ from \"../fiberRefs.js\";\n/** @internal */\nexport const OP_EMPTY = \"Empty\";\n/** @internal */\nexport const OP_ADD = \"Add\";\n/** @internal */\nexport const OP_REMOVE = \"Remove\";\n/** @internal */\nexport const OP_UPDATE = \"Update\";\n/** @internal */\nexport const OP_AND_THEN = \"AndThen\";\n/** @internal */\nexport const empty = {\n _tag: OP_EMPTY\n};\n/** @internal */\nexport const diff = (oldValue, newValue) => {\n const missingLocals = new Map(oldValue.locals);\n let patch = empty;\n for (const [fiberRef, pairs] of newValue.locals.entries()) {\n const newValue = Arr.headNonEmpty(pairs)[1];\n const old = missingLocals.get(fiberRef);\n if (old !== undefined) {\n const oldValue = Arr.headNonEmpty(old)[1];\n if (!equals(oldValue, newValue)) {\n patch = combine({\n _tag: OP_UPDATE,\n fiberRef,\n patch: fiberRef.diff(oldValue, newValue)\n })(patch);\n }\n } else {\n patch = combine({\n _tag: OP_ADD,\n fiberRef,\n value: newValue\n })(patch);\n }\n missingLocals.delete(fiberRef);\n }\n for (const [fiberRef] of missingLocals.entries()) {\n patch = combine({\n _tag: OP_REMOVE,\n fiberRef\n })(patch);\n }\n return patch;\n};\n/** @internal */\nexport const combine = /*#__PURE__*/dual(2, (self, that) => ({\n _tag: OP_AND_THEN,\n first: self,\n second: that\n}));\n/** @internal */\nexport const patch = /*#__PURE__*/dual(3, (self, fiberId, oldValue) => {\n let fiberRefs = oldValue;\n let patches = Arr.of(self);\n while (Arr.isNonEmptyReadonlyArray(patches)) {\n const head = Arr.headNonEmpty(patches);\n const tail = Arr.tailNonEmpty(patches);\n switch (head._tag) {\n case OP_EMPTY:\n {\n patches = tail;\n break;\n }\n case OP_ADD:\n {\n fiberRefs = fiberRefs_.updateAs(fiberRefs, {\n fiberId,\n fiberRef: head.fiberRef,\n value: head.value\n });\n patches = tail;\n break;\n }\n case OP_REMOVE:\n {\n fiberRefs = fiberRefs_.delete_(fiberRefs, head.fiberRef);\n patches = tail;\n break;\n }\n case OP_UPDATE:\n {\n const value = fiberRefs_.getOrDefault(fiberRefs, head.fiberRef);\n fiberRefs = fiberRefs_.updateAs(fiberRefs, {\n fiberId,\n fiberRef: head.fiberRef,\n value: head.fiberRef.patch(head.patch)(value)\n });\n patches = tail;\n break;\n }\n case OP_AND_THEN:\n {\n patches = Arr.prepend(head.first)(Arr.prepend(head.second)(tail));\n break;\n }\n }\n }\n return fiberRefs;\n});\n//# sourceMappingURL=patch.js.map","import * as Equal from \"../../Equal.js\";\nimport * as Hash from \"../../Hash.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport { hasProperty } from \"../../Predicate.js\";\n/** @internal */\nconst MetricLabelSymbolKey = \"effect/MetricLabel\";\n/** @internal */\nexport const MetricLabelTypeId = /*#__PURE__*/Symbol.for(MetricLabelSymbolKey);\n/** @internal */\nclass MetricLabelImpl {\n key;\n value;\n [MetricLabelTypeId] = MetricLabelTypeId;\n _hash;\n constructor(key, value) {\n this.key = key;\n this.value = value;\n this._hash = Hash.string(MetricLabelSymbolKey + this.key + this.value);\n }\n [Hash.symbol]() {\n return this._hash;\n }\n [Equal.symbol](that) {\n return isMetricLabel(that) && this.key === that.key && this.value === that.value;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const make = (key, value) => {\n return new MetricLabelImpl(key, value);\n};\n/** @internal */\nexport const isMetricLabel = u => hasProperty(u, MetricLabelTypeId);\n//# sourceMappingURL=label.js.map","import * as Arr from \"../Array.js\";\nimport * as Chunk from \"../Chunk.js\";\nimport * as Clock from \"../Clock.js\";\nimport * as Context from \"../Context.js\";\nimport * as Duration from \"../Duration.js\";\nimport * as FiberRefs from \"../FiberRefs.js\";\nimport { constFalse, constTrue, constVoid, dual, identity, pipe } from \"../Function.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport * as List from \"../List.js\";\nimport * as LogLevel from \"../LogLevel.js\";\nimport * as LogSpan from \"../LogSpan.js\";\nimport * as Option from \"../Option.js\";\nimport * as Predicate from \"../Predicate.js\";\nimport * as Ref from \"../Ref.js\";\nimport * as Tracer from \"../Tracer.js\";\nimport { internalCall } from \"../Utils.js\";\nimport * as internalCause from \"./cause.js\";\nimport { clockTag } from \"./clock.js\";\nimport * as core from \"./core.js\";\nimport * as defaultServices from \"./defaultServices.js\";\nimport * as doNotation from \"./doNotation.js\";\nimport * as fiberRefsPatch from \"./fiberRefs/patch.js\";\nimport * as metricLabel from \"./metric/label.js\";\nimport * as runtimeFlags from \"./runtimeFlags.js\";\nimport * as internalTracer from \"./tracer.js\";\n/* @internal */\nexport const annotateLogs = /*#__PURE__*/dual(args => core.isEffect(args[0]), function () {\n const args = arguments;\n return core.fiberRefLocallyWith(args[0], core.currentLogAnnotations, typeof args[1] === \"string\" ? HashMap.set(args[1], args[2]) : annotations => Object.entries(args[1]).reduce((acc, [key, value]) => HashMap.set(acc, key, value), annotations));\n});\n/* @internal */\nexport const asSome = self => core.map(self, Option.some);\n/* @internal */\nexport const asSomeError = self => core.mapError(self, Option.some);\n/* @internal */\nexport const try_ = arg => {\n let evaluate;\n let onFailure = undefined;\n if (typeof arg === \"function\") {\n evaluate = arg;\n } else {\n evaluate = arg.try;\n onFailure = arg.catch;\n }\n return core.suspend(() => {\n try {\n return core.succeed(internalCall(evaluate));\n } catch (error) {\n return core.fail(onFailure ? internalCall(() => onFailure(error)) : new core.UnknownException(error, \"An unknown error occurred in Effect.try\"));\n }\n });\n};\n/* @internal */\nexport const _catch = /*#__PURE__*/dual(3, (self, tag, options) => core.catchAll(self, e => {\n if (Predicate.hasProperty(e, tag) && e[tag] === options.failure) {\n return options.onFailure(e);\n }\n return core.fail(e);\n}));\n/* @internal */\nexport const catchAllDefect = /*#__PURE__*/dual(2, (self, f) => core.catchAllCause(self, cause => {\n const option = internalCause.find(cause, _ => internalCause.isDieType(_) ? Option.some(_) : Option.none());\n switch (option._tag) {\n case \"None\":\n {\n return core.failCause(cause);\n }\n case \"Some\":\n {\n return f(option.value.defect);\n }\n }\n}));\n/* @internal */\nexport const catchSomeCause = /*#__PURE__*/dual(2, (self, f) => core.matchCauseEffect(self, {\n onFailure: cause => {\n const option = f(cause);\n switch (option._tag) {\n case \"None\":\n {\n return core.failCause(cause);\n }\n case \"Some\":\n {\n return option.value;\n }\n }\n },\n onSuccess: core.succeed\n}));\n/* @internal */\nexport const catchSomeDefect = /*#__PURE__*/dual(2, (self, pf) => core.catchAllCause(self, cause => {\n const option = internalCause.find(cause, _ => internalCause.isDieType(_) ? Option.some(_) : Option.none());\n switch (option._tag) {\n case \"None\":\n {\n return core.failCause(cause);\n }\n case \"Some\":\n {\n const optionEffect = pf(option.value.defect);\n return optionEffect._tag === \"Some\" ? optionEffect.value : core.failCause(cause);\n }\n }\n}));\n/* @internal */\nexport const catchTag = /*#__PURE__*/dual(args => core.isEffect(args[0]), (self, ...args) => {\n const f = args[args.length - 1];\n let predicate;\n if (args.length === 2) {\n predicate = Predicate.isTagged(args[0]);\n } else {\n predicate = e => {\n const tag = Predicate.hasProperty(e, \"_tag\") ? e[\"_tag\"] : undefined;\n if (!tag) return false;\n for (let i = 0; i < args.length - 1; i++) {\n if (args[i] === tag) return true;\n }\n return false;\n };\n }\n return core.catchIf(self, predicate, f);\n});\n/** @internal */\nexport const catchTags = /*#__PURE__*/dual(2, (self, cases) => {\n let keys;\n return core.catchIf(self, e => {\n keys ??= Object.keys(cases);\n return Predicate.hasProperty(e, \"_tag\") && Predicate.isString(e[\"_tag\"]) && keys.includes(e[\"_tag\"]);\n }, e => cases[e[\"_tag\"]](e));\n});\n/* @internal */\nexport const cause = self => core.matchCause(self, {\n onFailure: identity,\n onSuccess: () => internalCause.empty\n});\n/* @internal */\nexport const clockWith = Clock.clockWith;\n/* @internal */\nexport const clock = /*#__PURE__*/clockWith(core.succeed);\n/* @internal */\nexport const delay = /*#__PURE__*/dual(2, (self, duration) => core.zipRight(Clock.sleep(duration), self));\n/* @internal */\nexport const descriptorWith = f => core.withFiberRuntime((state, status) => f({\n id: state.id(),\n status,\n interruptors: internalCause.interruptors(state.getFiberRef(core.currentInterruptedCause))\n}));\n/* @internal */\nexport const allowInterrupt = /*#__PURE__*/descriptorWith(descriptor => HashSet.size(descriptor.interruptors) > 0 ? core.interrupt : core.void);\n/* @internal */\nexport const descriptor = /*#__PURE__*/descriptorWith(core.succeed);\n/* @internal */\nexport const diffFiberRefs = self => summarized(self, fiberRefs, fiberRefsPatch.diff);\n/* @internal */\nexport const diffFiberRefsAndRuntimeFlags = self => summarized(self, core.zip(fiberRefs, core.runtimeFlags), ([refs, flags], [refsNew, flagsNew]) => [fiberRefsPatch.diff(refs, refsNew), runtimeFlags.diff(flags, flagsNew)]);\n/* @internal */\nexport const Do = /*#__PURE__*/core.succeed({});\n/* @internal */\nexport const bind = /*#__PURE__*/doNotation.bind(core.map, core.flatMap);\n/* @internal */\nexport const bindTo = /*#__PURE__*/doNotation.bindTo(core.map);\n/* @internal */\nexport const let_ = /*#__PURE__*/doNotation.let_(core.map);\n/* @internal */\nexport const dropUntil = /*#__PURE__*/dual(2, (elements, predicate) => core.suspend(() => {\n const iterator = elements[Symbol.iterator]();\n const builder = [];\n let next;\n let dropping = core.succeed(false);\n let i = 0;\n while ((next = iterator.next()) && !next.done) {\n const a = next.value;\n const index = i++;\n dropping = core.flatMap(dropping, bool => {\n if (bool) {\n builder.push(a);\n return core.succeed(true);\n }\n return predicate(a, index);\n });\n }\n return core.map(dropping, () => builder);\n}));\n/* @internal */\nexport const dropWhile = /*#__PURE__*/dual(2, (elements, predicate) => core.suspend(() => {\n const iterator = elements[Symbol.iterator]();\n const builder = [];\n let next;\n let dropping = core.succeed(true);\n let i = 0;\n while ((next = iterator.next()) && !next.done) {\n const a = next.value;\n const index = i++;\n dropping = core.flatMap(dropping, d => core.map(d ? predicate(a, index) : core.succeed(false), b => {\n if (!b) {\n builder.push(a);\n }\n return b;\n }));\n }\n return core.map(dropping, () => builder);\n}));\n/* @internal */\nexport const contextWith = f => core.map(core.context(), f);\n/* @internal */\nexport const eventually = self => core.orElse(self, () => core.flatMap(core.yieldNow(), () => eventually(self)));\n/* @internal */\nexport const filterMap = /*#__PURE__*/dual(2, (elements, pf) => core.map(core.forEachSequential(elements, identity), Arr.filterMap(pf)));\n/* @internal */\nexport const filterOrDie = /*#__PURE__*/dual(3, (self, predicate, orDieWith) => filterOrElse(self, predicate, a => core.dieSync(() => orDieWith(a))));\n/* @internal */\nexport const filterOrDieMessage = /*#__PURE__*/dual(3, (self, predicate, message) => filterOrElse(self, predicate, () => core.dieMessage(message)));\n/* @internal */\nexport const filterOrElse = /*#__PURE__*/dual(3, (self, predicate, orElse) => core.flatMap(self, a => predicate(a) ? core.succeed(a) : orElse(a)));\n/** @internal */\nexport const liftPredicate = /*#__PURE__*/dual(3, (self, predicate, orFailWith) => core.suspend(() => predicate(self) ? core.succeed(self) : core.fail(orFailWith(self))));\n/* @internal */\nexport const filterOrFail = /*#__PURE__*/dual(args => core.isEffect(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, a => orFailWith === undefined ? core.fail(new core.NoSuchElementException()) : core.failSync(() => orFailWith(a))));\n/* @internal */\nexport const findFirst = /*#__PURE__*/dual(2, (elements, predicate) => core.suspend(() => {\n const iterator = elements[Symbol.iterator]();\n const next = iterator.next();\n if (!next.done) {\n return findLoop(iterator, 0, predicate, next.value);\n }\n return core.succeed(Option.none());\n}));\nconst findLoop = (iterator, index, f, value) => core.flatMap(f(value, index), result => {\n if (result) {\n return core.succeed(Option.some(value));\n }\n const next = iterator.next();\n if (!next.done) {\n return findLoop(iterator, index + 1, f, next.value);\n }\n return core.succeed(Option.none());\n});\n/* @internal */\nexport const firstSuccessOf = effects => core.suspend(() => {\n const list = Chunk.fromIterable(effects);\n if (!Chunk.isNonEmpty(list)) {\n return core.dieSync(() => new core.IllegalArgumentException(`Received an empty collection of effects`));\n }\n return pipe(Chunk.tailNonEmpty(list), Arr.reduce(Chunk.headNonEmpty(list), (left, right) => core.orElse(left, () => right)));\n});\n/* @internal */\nexport const flipWith = /*#__PURE__*/dual(2, (self, f) => core.flip(f(core.flip(self))));\n/* @internal */\nexport const match = /*#__PURE__*/dual(2, (self, options) => core.matchEffect(self, {\n onFailure: e => core.succeed(options.onFailure(e)),\n onSuccess: a => core.succeed(options.onSuccess(a))\n}));\n/* @internal */\nexport const every = /*#__PURE__*/dual(2, (elements, predicate) => core.suspend(() => forAllLoop(elements[Symbol.iterator](), 0, predicate)));\nconst forAllLoop = (iterator, index, f) => {\n const next = iterator.next();\n return next.done ? core.succeed(true) : core.flatMap(f(next.value, index), b => b ? forAllLoop(iterator, index + 1, f) : core.succeed(b));\n};\n/* @internal */\nexport const forever = self => {\n const loop = core.flatMap(core.flatMap(self, () => core.yieldNow()), () => loop);\n return loop;\n};\n/* @internal */\nexport const fiberRefs = /*#__PURE__*/core.withFiberRuntime(state => core.succeed(state.getFiberRefs()));\n/* @internal */\nexport const head = self => core.flatMap(self, as => {\n const iterator = as[Symbol.iterator]();\n const next = iterator.next();\n if (next.done) {\n return core.fail(new core.NoSuchElementException());\n }\n return core.succeed(next.value);\n});\n/* @internal */\nexport const ignore = self => match(self, {\n onFailure: constVoid,\n onSuccess: constVoid\n});\n/* @internal */\nexport const ignoreLogged = self => core.matchCauseEffect(self, {\n onFailure: cause => logDebug(cause, \"An error was silently ignored because it is not anticipated to be useful\"),\n onSuccess: () => core.void\n});\n/* @internal */\nexport const inheritFiberRefs = childFiberRefs => updateFiberRefs((parentFiberId, parentFiberRefs) => FiberRefs.joinAs(parentFiberRefs, parentFiberId, childFiberRefs));\n/* @internal */\nexport const isFailure = self => match(self, {\n onFailure: constTrue,\n onSuccess: constFalse\n});\n/* @internal */\nexport const isSuccess = self => match(self, {\n onFailure: constFalse,\n onSuccess: constTrue\n});\n/* @internal */\nexport const iterate = (initial, options) => core.suspend(() => {\n if (options.while(initial)) {\n return core.flatMap(options.body(initial), z2 => iterate(z2, options));\n }\n return core.succeed(initial);\n});\n/** @internal */\nexport const logWithLevel = level => (...message) => {\n const levelOption = Option.fromNullable(level);\n let cause = undefined;\n for (let i = 0, len = message.length; i < len; i++) {\n const msg = message[i];\n if (internalCause.isCause(msg)) {\n if (cause !== undefined) {\n cause = internalCause.sequential(cause, msg);\n } else {\n cause = msg;\n }\n message = [...message.slice(0, i), ...message.slice(i + 1)];\n i--;\n }\n }\n if (cause === undefined) {\n cause = internalCause.empty;\n }\n return core.withFiberRuntime(fiberState => {\n fiberState.log(message, cause, levelOption);\n return core.void;\n });\n};\n/** @internal */\nexport const log = /*#__PURE__*/logWithLevel();\n/** @internal */\nexport const logTrace = /*#__PURE__*/logWithLevel(LogLevel.Trace);\n/** @internal */\nexport const logDebug = /*#__PURE__*/logWithLevel(LogLevel.Debug);\n/** @internal */\nexport const logInfo = /*#__PURE__*/logWithLevel(LogLevel.Info);\n/** @internal */\nexport const logWarning = /*#__PURE__*/logWithLevel(LogLevel.Warning);\n/** @internal */\nexport const logError = /*#__PURE__*/logWithLevel(LogLevel.Error);\n/** @internal */\nexport const logFatal = /*#__PURE__*/logWithLevel(LogLevel.Fatal);\n/* @internal */\nexport const withLogSpan = /*#__PURE__*/dual(2, (effect, label) => core.flatMap(Clock.currentTimeMillis, now => core.fiberRefLocallyWith(effect, core.currentLogSpan, List.prepend(LogSpan.make(label, now)))));\n/* @internal */\nexport const logAnnotations = /*#__PURE__*/core.fiberRefGet(core.currentLogAnnotations);\n/* @internal */\nexport const loop = (initial, options) => options.discard ? loopDiscard(initial, options.while, options.step, options.body) : core.map(loopInternal(initial, options.while, options.step, options.body), Arr.fromIterable);\nconst loopInternal = (initial, cont, inc, body) => core.suspend(() => cont(initial) ? core.flatMap(body(initial), a => core.map(loopInternal(inc(initial), cont, inc, body), List.prepend(a))) : core.sync(() => List.empty()));\nconst loopDiscard = (initial, cont, inc, body) => core.suspend(() => cont(initial) ? core.flatMap(body(initial), () => loopDiscard(inc(initial), cont, inc, body)) : core.void);\n/* @internal */\nexport const mapAccum = /*#__PURE__*/dual(3, (elements, initial, f) => core.suspend(() => {\n const iterator = elements[Symbol.iterator]();\n const builder = [];\n let result = core.succeed(initial);\n let next;\n let i = 0;\n while (!(next = iterator.next()).done) {\n const index = i++;\n const value = next.value;\n result = core.flatMap(result, state => core.map(f(state, value, index), ([z, b]) => {\n builder.push(b);\n return z;\n }));\n }\n return core.map(result, z => [z, builder]);\n}));\n/* @internal */\nexport const mapErrorCause = /*#__PURE__*/dual(2, (self, f) => core.matchCauseEffect(self, {\n onFailure: c => core.failCauseSync(() => f(c)),\n onSuccess: core.succeed\n}));\n/* @internal */\nexport const memoize = self => pipe(core.deferredMake(), core.flatMap(deferred => pipe(diffFiberRefsAndRuntimeFlags(self), core.intoDeferred(deferred), once, core.map(complete => core.zipRight(complete, pipe(core.deferredAwait(deferred), core.flatMap(([patch, a]) => core.as(core.zip(patchFiberRefs(patch[0]), core.updateRuntimeFlags(patch[1])), a))))))));\n/* @internal */\nexport const merge = self => core.matchEffect(self, {\n onFailure: e => core.succeed(e),\n onSuccess: core.succeed\n});\n/* @internal */\nexport const negate = self => core.map(self, b => !b);\n/* @internal */\nexport const none = self => core.flatMap(self, option => {\n switch (option._tag) {\n case \"None\":\n return core.void;\n case \"Some\":\n return core.fail(new core.NoSuchElementException());\n }\n});\n/* @internal */\nexport const once = self => core.map(Ref.make(true), ref => core.asVoid(core.whenEffect(self, Ref.getAndSet(ref, false))));\n/* @internal */\nexport const option = self => core.matchEffect(self, {\n onFailure: () => core.succeed(Option.none()),\n onSuccess: a => core.succeed(Option.some(a))\n});\n/* @internal */\nexport const orElseFail = /*#__PURE__*/dual(2, (self, evaluate) => core.orElse(self, () => core.failSync(evaluate)));\n/* @internal */\nexport const orElseSucceed = /*#__PURE__*/dual(2, (self, evaluate) => core.orElse(self, () => core.sync(evaluate)));\n/* @internal */\nexport const parallelErrors = self => core.matchCauseEffect(self, {\n onFailure: cause => {\n const errors = Arr.fromIterable(internalCause.failures(cause));\n return errors.length === 0 ? core.failCause(cause) : core.fail(errors);\n },\n onSuccess: core.succeed\n});\n/* @internal */\nexport const patchFiberRefs = patch => updateFiberRefs((fiberId, fiberRefs) => pipe(patch, fiberRefsPatch.patch(fiberId, fiberRefs)));\n/* @internal */\nexport const promise = evaluate => evaluate.length >= 1 ? core.async((resolve, signal) => {\n try {\n evaluate(signal).then(a => resolve(core.succeed(a)), e => resolve(core.die(e)));\n } catch (e) {\n resolve(core.die(e));\n }\n}) : core.async(resolve => {\n try {\n ;\n evaluate().then(a => resolve(core.succeed(a)), e => resolve(core.die(e)));\n } catch (e) {\n resolve(core.die(e));\n }\n});\n/* @internal */\nexport const provideService = /*#__PURE__*/dual(3, (self, tag, service) => core.contextWithEffect(env => core.provideContext(self, Context.add(env, tag, service))));\n/* @internal */\nexport const provideServiceEffect = /*#__PURE__*/dual(3, (self, tag, effect) => core.contextWithEffect(env => core.flatMap(effect, service => core.provideContext(self, pipe(env, Context.add(tag, service))))));\n/* @internal */\nexport const random = /*#__PURE__*/defaultServices.randomWith(core.succeed);\n/* @internal */\nexport const reduce = /*#__PURE__*/dual(3, (elements, zero, f) => Arr.fromIterable(elements).reduce((acc, el, i) => core.flatMap(acc, a => f(a, el, i)), core.succeed(zero)));\n/* @internal */\nexport const reduceRight = /*#__PURE__*/dual(3, (elements, zero, f) => Arr.fromIterable(elements).reduceRight((acc, el, i) => core.flatMap(acc, a => f(el, a, i)), core.succeed(zero)));\n/* @internal */\nexport const reduceWhile = /*#__PURE__*/dual(3, (elements, zero, options) => core.flatMap(core.sync(() => elements[Symbol.iterator]()), iterator => reduceWhileLoop(iterator, 0, zero, options.while, options.body)));\nconst reduceWhileLoop = (iterator, index, state, predicate, f) => {\n const next = iterator.next();\n if (!next.done && predicate(state)) {\n return core.flatMap(f(state, next.value, index), nextState => reduceWhileLoop(iterator, index + 1, nextState, predicate, f));\n }\n return core.succeed(state);\n};\n/* @internal */\nexport const repeatN = /*#__PURE__*/dual(2, (self, n) => core.suspend(() => repeatNLoop(self, n)));\n/* @internal */\nconst repeatNLoop = (self, n) => core.flatMap(self, a => n <= 0 ? core.succeed(a) : core.zipRight(core.yieldNow(), repeatNLoop(self, n - 1)));\n/* @internal */\nexport const sandbox = self => core.matchCauseEffect(self, {\n onFailure: core.fail,\n onSuccess: core.succeed\n});\n/* @internal */\nexport const setFiberRefs = fiberRefs => core.suspend(() => FiberRefs.setAll(fiberRefs));\n/* @internal */\nexport const sleep = Clock.sleep;\n/* @internal */\nexport const succeedNone = /*#__PURE__*/core.succeed(/*#__PURE__*/Option.none());\n/* @internal */\nexport const succeedSome = value => core.succeed(Option.some(value));\n/* @internal */\nexport const summarized = /*#__PURE__*/dual(3, (self, summary, f) => core.flatMap(summary, start => core.flatMap(self, value => core.map(summary, end => [f(start, end), value]))));\n/* @internal */\nexport const tagMetrics = /*#__PURE__*/dual(args => core.isEffect(args[0]), function () {\n return labelMetrics(arguments[0], typeof arguments[1] === \"string\" ? [metricLabel.make(arguments[1], arguments[2])] : Object.entries(arguments[1]).map(([k, v]) => metricLabel.make(k, v)));\n});\n/* @internal */\nexport const labelMetrics = /*#__PURE__*/dual(2, (self, labels) => core.fiberRefLocallyWith(self, core.currentMetricLabels, old => Arr.union(old, labels)));\n/* @internal */\nexport const takeUntil = /*#__PURE__*/dual(2, (elements, predicate) => core.suspend(() => {\n const iterator = elements[Symbol.iterator]();\n const builder = [];\n let next;\n let effect = core.succeed(false);\n let i = 0;\n while ((next = iterator.next()) && !next.done) {\n const a = next.value;\n const index = i++;\n effect = core.flatMap(effect, bool => {\n if (bool) {\n return core.succeed(true);\n }\n builder.push(a);\n return predicate(a, index);\n });\n }\n return core.map(effect, () => builder);\n}));\n/* @internal */\nexport const takeWhile = /*#__PURE__*/dual(2, (elements, predicate) => core.suspend(() => {\n const iterator = elements[Symbol.iterator]();\n const builder = [];\n let next;\n let taking = core.succeed(true);\n let i = 0;\n while ((next = iterator.next()) && !next.done) {\n const a = next.value;\n const index = i++;\n taking = core.flatMap(taking, taking => pipe(taking ? predicate(a, index) : core.succeed(false), core.map(bool => {\n if (bool) {\n builder.push(a);\n }\n return bool;\n })));\n }\n return core.map(taking, () => builder);\n}));\n/* @internal */\nexport const tapBoth = /*#__PURE__*/dual(2, (self, {\n onFailure,\n onSuccess\n}) => core.matchCauseEffect(self, {\n onFailure: cause => {\n const either = internalCause.failureOrCause(cause);\n switch (either._tag) {\n case \"Left\":\n {\n return core.zipRight(onFailure(either.left), core.failCause(cause));\n }\n case \"Right\":\n {\n return core.failCause(cause);\n }\n }\n },\n onSuccess: a => core.as(onSuccess(a), a)\n}));\n/* @internal */\nexport const tapDefect = /*#__PURE__*/dual(2, (self, f) => core.catchAllCause(self, cause => Option.match(internalCause.keepDefects(cause), {\n onNone: () => core.failCause(cause),\n onSome: a => core.zipRight(f(a), core.failCause(cause))\n})));\n/* @internal */\nexport const tapError = /*#__PURE__*/dual(2, (self, f) => core.matchCauseEffect(self, {\n onFailure: cause => {\n const either = internalCause.failureOrCause(cause);\n switch (either._tag) {\n case \"Left\":\n return core.zipRight(f(either.left), core.failCause(cause));\n case \"Right\":\n return core.failCause(cause);\n }\n },\n onSuccess: core.succeed\n}));\n/* @internal */\nexport const tapErrorTag = /*#__PURE__*/dual(3, (self, k, f) => tapError(self, e => {\n if (Predicate.isTagged(e, k)) {\n return f(e);\n }\n return core.void;\n}));\n/* @internal */\nexport const tapErrorCause = /*#__PURE__*/dual(2, (self, f) => core.matchCauseEffect(self, {\n onFailure: cause => core.zipRight(f(cause), core.failCause(cause)),\n onSuccess: core.succeed\n}));\n/* @internal */\nexport const timed = self => timedWith(self, Clock.currentTimeNanos);\n/* @internal */\nexport const timedWith = /*#__PURE__*/dual(2, (self, nanos) => summarized(self, nanos, (start, end) => Duration.nanos(end - start)));\n/* @internal */\nexport const tracerWith = Tracer.tracerWith;\n/** @internal */\nexport const tracer = /*#__PURE__*/tracerWith(core.succeed);\n/* @internal */\nexport const tryPromise = arg => {\n let evaluate;\n let catcher = undefined;\n if (typeof arg === \"function\") {\n evaluate = arg;\n } else {\n evaluate = arg.try;\n catcher = arg.catch;\n }\n const fail = e => catcher ? core.failSync(() => catcher(e)) : core.fail(new core.UnknownException(e, \"An unknown error occurred in Effect.tryPromise\"));\n if (evaluate.length >= 1) {\n return core.async((resolve, signal) => {\n try {\n evaluate(signal).then(a => resolve(core.succeed(a)), e => resolve(fail(e)));\n } catch (e) {\n resolve(fail(e));\n }\n });\n }\n return core.async(resolve => {\n try {\n evaluate().then(a => resolve(core.succeed(a)), e => resolve(fail(e)));\n } catch (e) {\n resolve(fail(e));\n }\n });\n};\n/* @internal */\nexport const tryMap = /*#__PURE__*/dual(2, (self, options) => core.flatMap(self, a => try_({\n try: () => options.try(a),\n catch: options.catch\n})));\n/* @internal */\nexport const tryMapPromise = /*#__PURE__*/dual(2, (self, options) => core.flatMap(self, a => tryPromise({\n try: options.try.length >= 1 ? signal => options.try(a, signal) : () => options.try(a),\n catch: options.catch\n})));\n/* @internal */\nexport const unless = /*#__PURE__*/dual(2, (self, condition) => core.suspend(() => condition() ? succeedNone : asSome(self)));\n/* @internal */\nexport const unlessEffect = /*#__PURE__*/dual(2, (self, condition) => core.flatMap(condition, b => b ? succeedNone : asSome(self)));\n/* @internal */\nexport const unsandbox = self => mapErrorCause(self, internalCause.flatten);\n/* @internal */\nexport const updateFiberRefs = f => core.withFiberRuntime(state => {\n state.setFiberRefs(f(state.id(), state.getFiberRefs()));\n return core.void;\n});\n/* @internal */\nexport const updateService = /*#__PURE__*/dual(3, (self, tag, f) => core.mapInputContext(self, context => Context.add(context, tag, f(Context.unsafeGet(context, tag)))));\n/* @internal */\nexport const when = /*#__PURE__*/dual(2, (self, condition) => core.suspend(() => condition() ? core.map(self, Option.some) : core.succeed(Option.none())));\n/* @internal */\nexport const whenFiberRef = /*#__PURE__*/dual(3, (self, fiberRef, predicate) => core.flatMap(core.fiberRefGet(fiberRef), s => predicate(s) ? core.map(self, a => [s, Option.some(a)]) : core.succeed([s, Option.none()])));\n/* @internal */\nexport const whenRef = /*#__PURE__*/dual(3, (self, ref, predicate) => core.flatMap(Ref.get(ref), s => predicate(s) ? core.map(self, a => [s, Option.some(a)]) : core.succeed([s, Option.none()])));\n/* @internal */\nexport const withMetric = /*#__PURE__*/dual(2, (self, metric) => metric(self));\n/** @internal */\nexport const serviceFunctionEffect = (getService, f) => (...args) => core.flatMap(getService, a => f(a)(...args));\n/** @internal */\nexport const serviceFunction = (getService, f) => (...args) => core.map(getService, a => f(a)(...args));\n/** @internal */\nexport const serviceFunctions = getService => new Proxy({}, {\n get(_target, prop, _receiver) {\n return (...args) => core.flatMap(getService, s => s[prop](...args));\n }\n});\n/** @internal */\nexport const serviceConstants = getService => new Proxy({}, {\n get(_target, prop, _receiver) {\n return core.flatMap(getService, s => core.isEffect(s[prop]) ? s[prop] : core.succeed(s[prop]));\n }\n});\n/** @internal */\nexport const serviceMembers = getService => ({\n functions: serviceFunctions(getService),\n constants: serviceConstants(getService)\n});\n/** @internal */\nexport const serviceOption = tag => core.map(core.context(), Context.getOption(tag));\n/** @internal */\nexport const serviceOptional = tag => core.flatMap(core.context(), Context.getOption(tag));\n// -----------------------------------------------------------------------------\n// tracing\n// -----------------------------------------------------------------------------\n/* @internal */\nexport const annotateCurrentSpan = function () {\n const args = arguments;\n return ignore(core.flatMap(currentSpan, span => core.sync(() => {\n if (typeof args[0] === \"string\") {\n span.attribute(args[0], args[1]);\n } else {\n for (const key in args[0]) {\n span.attribute(key, args[0][key]);\n }\n }\n })));\n};\n/* @internal */\nexport const linkSpanCurrent = function () {\n const args = arguments;\n const links = Array.isArray(args[0]) ? args[0] : [{\n _tag: \"SpanLink\",\n span: args[0],\n attributes: args[1] ?? {}\n }];\n return ignore(core.flatMap(currentSpan, span => core.sync(() => span.addLinks(links))));\n};\n/* @internal */\nexport const annotateSpans = /*#__PURE__*/dual(args => core.isEffect(args[0]), function () {\n const args = arguments;\n return core.fiberRefLocallyWith(args[0], core.currentTracerSpanAnnotations, typeof args[1] === \"string\" ? HashMap.set(args[1], args[2]) : annotations => Object.entries(args[1]).reduce((acc, [key, value]) => HashMap.set(acc, key, value), annotations));\n});\n/** @internal */\nexport const currentParentSpan = /*#__PURE__*/serviceOptional(internalTracer.spanTag);\n/** @internal */\nexport const currentSpan = /*#__PURE__*/core.flatMap(/*#__PURE__*/core.context(), context => {\n const span = context.unsafeMap.get(internalTracer.spanTag.key);\n return span !== undefined && span._tag === \"Span\" ? core.succeed(span) : core.fail(new core.NoSuchElementException());\n});\n/* @internal */\nexport const linkSpans = /*#__PURE__*/dual(args => core.isEffect(args[0]), (self, span, attributes) => core.fiberRefLocallyWith(self, core.currentTracerSpanLinks, Chunk.append({\n _tag: \"SpanLink\",\n span,\n attributes: attributes ?? {}\n})));\nconst bigint0 = /*#__PURE__*/BigInt(0);\nconst filterDisablePropagation = /*#__PURE__*/Option.flatMap(span => Context.get(span.context, internalTracer.DisablePropagation) ? span._tag === \"Span\" ? filterDisablePropagation(span.parent) : Option.none() : Option.some(span));\n/** @internal */\nexport const unsafeMakeSpan = (fiber, name, options) => {\n const disablePropagation = !fiber.getFiberRef(core.currentTracerEnabled) || options.context && Context.get(options.context, internalTracer.DisablePropagation);\n const context = fiber.getFiberRef(core.currentContext);\n const parent = options.parent ? Option.some(options.parent) : options.root ? Option.none() : filterDisablePropagation(Context.getOption(context, internalTracer.spanTag));\n let span;\n if (disablePropagation) {\n span = core.noopSpan({\n name,\n parent,\n context: Context.add(options.context ?? Context.empty(), internalTracer.DisablePropagation, true)\n });\n } else {\n const services = fiber.getFiberRef(defaultServices.currentServices);\n const tracer = Context.get(services, internalTracer.tracerTag);\n const clock = Context.get(services, Clock.Clock);\n const timingEnabled = fiber.getFiberRef(core.currentTracerTimingEnabled);\n const fiberRefs = fiber.getFiberRefs();\n const annotationsFromEnv = FiberRefs.get(fiberRefs, core.currentTracerSpanAnnotations);\n const linksFromEnv = FiberRefs.get(fiberRefs, core.currentTracerSpanLinks);\n const links = linksFromEnv._tag === \"Some\" ? options.links !== undefined ? [...Chunk.toReadonlyArray(linksFromEnv.value), ...(options.links ?? [])] : Chunk.toReadonlyArray(linksFromEnv.value) : options.links ?? Arr.empty();\n span = tracer.span(name, parent, options.context ?? Context.empty(), links, timingEnabled ? clock.unsafeCurrentTimeNanos() : bigint0, options.kind ?? \"internal\", options);\n if (annotationsFromEnv._tag === \"Some\") {\n HashMap.forEach(annotationsFromEnv.value, (value, key) => span.attribute(key, value));\n }\n if (options.attributes !== undefined) {\n Object.entries(options.attributes).forEach(([k, v]) => span.attribute(k, v));\n }\n }\n if (typeof options.captureStackTrace === \"function\") {\n internalCause.spanToTrace.set(span, options.captureStackTrace);\n }\n return span;\n};\n/** @internal */\nexport const makeSpan = (name, options) => {\n options = internalTracer.addSpanStackTrace(options);\n return core.withFiberRuntime(fiber => core.succeed(unsafeMakeSpan(fiber, name, options)));\n};\n/* @internal */\nexport const spanAnnotations = /*#__PURE__*/core.fiberRefGet(core.currentTracerSpanAnnotations);\n/* @internal */\nexport const spanLinks = /*#__PURE__*/core.fiberRefGet(core.currentTracerSpanLinks);\n/** @internal */\nexport const endSpan = (span, exit, clock, timingEnabled) => core.sync(() => {\n if (span.status._tag === \"Ended\") {\n return;\n }\n if (core.exitIsFailure(exit) && internalCause.spanToTrace.has(span)) {\n // https://opentelemetry.io/docs/specs/semconv/registry/attributes/code/#code-stacktrace\n span.attribute(\"code.stacktrace\", internalCause.spanToTrace.get(span)());\n }\n span.end(timingEnabled ? clock.unsafeCurrentTimeNanos() : bigint0, exit);\n});\n/** @internal */\nexport const useSpan = (name, ...args) => {\n const options = internalTracer.addSpanStackTrace(args.length === 1 ? undefined : args[0]);\n const evaluate = args[args.length - 1];\n return core.withFiberRuntime(fiber => {\n const span = unsafeMakeSpan(fiber, name, options);\n const timingEnabled = fiber.getFiberRef(core.currentTracerTimingEnabled);\n const clock = Context.get(fiber.getFiberRef(defaultServices.currentServices), clockTag);\n return core.onExit(evaluate(span), exit => endSpan(span, exit, clock, timingEnabled));\n });\n};\n/** @internal */\nexport const withParentSpan = /*#__PURE__*/dual(2, (self, span) => provideService(self, internalTracer.spanTag, span));\n/** @internal */\nexport const withSpan = function () {\n const dataFirst = typeof arguments[0] !== \"string\";\n const name = dataFirst ? arguments[1] : arguments[0];\n const options = internalTracer.addSpanStackTrace(dataFirst ? arguments[2] : arguments[1]);\n if (dataFirst) {\n const self = arguments[0];\n return useSpan(name, options, span => withParentSpan(self, span));\n }\n return self => useSpan(name, options, span => withParentSpan(self, span));\n};\nexport const functionWithSpan = options => function () {\n let captureStackTrace = options.captureStackTrace ?? false;\n if (options.captureStackTrace !== false) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const error = new Error();\n Error.stackTraceLimit = limit;\n let cache = false;\n captureStackTrace = () => {\n if (cache !== false) {\n return cache;\n }\n if (error.stack) {\n const stack = error.stack.trim().split(\"\\n\");\n cache = stack.slice(2).join(\"\\n\").trim();\n return cache;\n }\n };\n }\n return core.suspend(() => {\n const opts = typeof options.options === \"function\" ? options.options.apply(null, arguments) : options.options;\n return withSpan(core.suspend(() => internalCall(() => options.body.apply(this, arguments))), opts.name, {\n ...opts,\n captureStackTrace\n });\n });\n};\n// -------------------------------------------------------------------------------------\n// optionality\n// -------------------------------------------------------------------------------------\n/* @internal */\nexport const fromNullable = value => value == null ? core.fail(new core.NoSuchElementException()) : core.succeed(value);\n/* @internal */\nexport const optionFromOptional = self => core.catchAll(core.map(self, Option.some), error => core.isNoSuchElementException(error) ? succeedNone : core.fail(error));\n//# sourceMappingURL=core-effect.js.map","import { dual } from \"../Function.js\";\n/** @internal */\nexport const OP_SEQUENTIAL = \"Sequential\";\n/** @internal */\nexport const OP_PARALLEL = \"Parallel\";\n/** @internal */\nexport const OP_PARALLEL_N = \"ParallelN\";\n/** @internal */\nexport const sequential = {\n _tag: OP_SEQUENTIAL\n};\n/** @internal */\nexport const parallel = {\n _tag: OP_PARALLEL\n};\n/** @internal */\nexport const parallelN = parallelism => ({\n _tag: OP_PARALLEL_N,\n parallelism\n});\n/** @internal */\nexport const isSequential = self => self._tag === OP_SEQUENTIAL;\n/** @internal */\nexport const isParallel = self => self._tag === OP_PARALLEL;\n/** @internal */\nexport const isParallelN = self => self._tag === OP_PARALLEL_N;\n/** @internal */\nexport const match = /*#__PURE__*/dual(2, (self, options) => {\n switch (self._tag) {\n case OP_SEQUENTIAL:\n {\n return options.onSequential();\n }\n case OP_PARALLEL:\n {\n return options.onParallel();\n }\n case OP_PARALLEL_N:\n {\n return options.onParallelN(self.parallelism);\n }\n }\n});\n//# sourceMappingURL=executionStrategy.js.map","import * as internal from \"./internal/executionStrategy.js\";\n/**\n * Execute effects sequentially.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const sequential = internal.sequential;\n/**\n * Execute effects in parallel.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const parallel = internal.parallel;\n/**\n * Execute effects in parallel, up to the specified number of concurrent fibers.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const parallelN = internal.parallelN;\n/**\n * Returns `true` if the specified `ExecutionStrategy` is an instance of\n * `Sequential`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isSequential = internal.isSequential;\n/**\n * Returns `true` if the specified `ExecutionStrategy` is an instance of\n * `Sequential`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isParallel = internal.isParallel;\n/**\n * Returns `true` if the specified `ExecutionStrategy` is an instance of\n * `Sequential`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isParallelN = internal.isParallelN;\n/**\n * Folds over the specified `ExecutionStrategy` using the provided case\n * functions.\n *\n * @since 2.0.0\n * @category folding\n */\nexport const match = internal.match;\n//# sourceMappingURL=ExecutionStrategy.js.map","import * as internal from \"./internal/fiberRefs/patch.js\";\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = internal.empty;\n/**\n * Constructs a patch that describes the changes between the specified\n * collections of `FiberRef`\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const diff = internal.diff;\n/**\n * Combines this patch and the specified patch to create a new patch that\n * describes applying the changes from this patch and the specified patch\n * sequentially.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const combine = internal.combine;\n/**\n * Applies the changes described by this patch to the specified collection\n * of `FiberRef` values.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const patch = internal.patch;\n//# sourceMappingURL=FiberRefsPatch.js.map","import * as Equal from \"../Equal.js\";\nimport { pipe } from \"../Function.js\";\nimport * as Hash from \"../Hash.js\";\nimport { hasProperty } from \"../Predicate.js\";\nconst FiberStatusSymbolKey = \"effect/FiberStatus\";\n/** @internal */\nexport const FiberStatusTypeId = /*#__PURE__*/Symbol.for(FiberStatusSymbolKey);\n/** @internal */\nexport const OP_DONE = \"Done\";\n/** @internal */\nexport const OP_RUNNING = \"Running\";\n/** @internal */\nexport const OP_SUSPENDED = \"Suspended\";\nconst DoneHash = /*#__PURE__*/Hash.string(`${FiberStatusSymbolKey}-${OP_DONE}`);\n/** @internal */\nclass Done {\n [FiberStatusTypeId] = FiberStatusTypeId;\n _tag = OP_DONE;\n [Hash.symbol]() {\n return DoneHash;\n }\n [Equal.symbol](that) {\n return isFiberStatus(that) && that._tag === OP_DONE;\n }\n}\n/** @internal */\nclass Running {\n runtimeFlags;\n [FiberStatusTypeId] = FiberStatusTypeId;\n _tag = OP_RUNNING;\n constructor(runtimeFlags) {\n this.runtimeFlags = runtimeFlags;\n }\n [Hash.symbol]() {\n return pipe(Hash.hash(FiberStatusSymbolKey), Hash.combine(Hash.hash(this._tag)), Hash.combine(Hash.hash(this.runtimeFlags)), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isFiberStatus(that) && that._tag === OP_RUNNING && this.runtimeFlags === that.runtimeFlags;\n }\n}\n/** @internal */\nclass Suspended {\n runtimeFlags;\n blockingOn;\n [FiberStatusTypeId] = FiberStatusTypeId;\n _tag = OP_SUSPENDED;\n constructor(runtimeFlags, blockingOn) {\n this.runtimeFlags = runtimeFlags;\n this.blockingOn = blockingOn;\n }\n [Hash.symbol]() {\n return pipe(Hash.hash(FiberStatusSymbolKey), Hash.combine(Hash.hash(this._tag)), Hash.combine(Hash.hash(this.runtimeFlags)), Hash.combine(Hash.hash(this.blockingOn)), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isFiberStatus(that) && that._tag === OP_SUSPENDED && this.runtimeFlags === that.runtimeFlags && Equal.equals(this.blockingOn, that.blockingOn);\n }\n}\n/** @internal */\nexport const done = /*#__PURE__*/new Done();\n/** @internal */\nexport const running = runtimeFlags => new Running(runtimeFlags);\n/** @internal */\nexport const suspended = (runtimeFlags, blockingOn) => new Suspended(runtimeFlags, blockingOn);\n/** @internal */\nexport const isFiberStatus = u => hasProperty(u, FiberStatusTypeId);\n/** @internal */\nexport const isDone = self => self._tag === OP_DONE;\n/** @internal */\nexport const isRunning = self => self._tag === OP_RUNNING;\n/** @internal */\nexport const isSuspended = self => self._tag === OP_SUSPENDED;\n//# sourceMappingURL=fiberStatus.js.map","import * as internal from \"./internal/fiberStatus.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const FiberStatusTypeId = internal.FiberStatusTypeId;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const done = internal.done;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const running = internal.running;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const suspended = internal.suspended;\n/**\n * Returns `true` if the specified value is a `FiberStatus`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isFiberStatus = internal.isFiberStatus;\n/**\n * Returns `true` if the specified `FiberStatus` is `Done`, `false` otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isDone = internal.isDone;\n/**\n * Returns `true` if the specified `FiberStatus` is `Running`, `false`\n * otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isRunning = internal.isRunning;\n/**\n * Returns `true` if the specified `FiberStatus` is `Suspended`, `false`\n * otherwise.\n *\n * @since 2.0.0\n * @category refinements\n */\nexport const isSuspended = internal.isSuspended;\n//# sourceMappingURL=FiberStatus.js.map","/**\n * A lightweight alternative to the `Effect` data type, with a subset of the functionality.\n *\n * @since 3.4.0\n * @experimental\n */\nimport * as Arr from \"./Array.js\";\nimport * as Context from \"./Context.js\";\nimport * as Effectable from \"./Effectable.js\";\nimport * as Either from \"./Either.js\";\nimport * as Equal from \"./Equal.js\";\nimport { constTrue, constVoid, dual, identity } from \"./Function.js\";\nimport { globalValue } from \"./GlobalValue.js\";\nimport * as Hash from \"./Hash.js\";\nimport { format, NodeInspectSymbol, toStringUnknown } from \"./Inspectable.js\";\nimport * as InternalContext from \"./internal/context.js\";\nimport * as doNotation from \"./internal/doNotation.js\";\nimport { StructuralPrototype } from \"./internal/effectable.js\";\nimport * as Option from \"./Option.js\";\nimport { pipeArguments } from \"./Pipeable.js\";\nimport { hasProperty, isIterable, isTagged } from \"./Predicate.js\";\nimport { SingleShotGen, YieldWrap, yieldWrapGet } from \"./Utils.js\";\n/**\n * @since 3.4.0\n * @experimental\n * @category type ids\n */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/Micro\");\n/**\n * @since 3.4.0\n * @experimental\n * @category MicroExit\n */\nexport const MicroExitTypeId = /*#__PURE__*/Symbol.for(\"effect/Micro/MicroExit\");\n/**\n * @since 3.4.0\n * @experimental\n * @category guards\n */\nexport const isMicro = u => typeof u === \"object\" && u !== null && TypeId in u;\n// ----------------------------------------------------------------------------\n// MicroCause\n// ----------------------------------------------------------------------------\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const MicroCauseTypeId = /*#__PURE__*/Symbol.for(\"effect/Micro/MicroCause\");\n/**\n * @since 3.6.6\n * @experimental\n * @category guards\n */\nexport const isMicroCause = self => hasProperty(self, MicroCauseTypeId);\nconst microCauseVariance = {\n _E: identity\n};\nclass MicroCauseImpl extends globalThis.Error {\n _tag;\n traces;\n [MicroCauseTypeId];\n constructor(_tag, originalError, traces) {\n const causeName = `MicroCause.${_tag}`;\n let name;\n let message;\n let stack;\n if (originalError instanceof globalThis.Error) {\n name = `(${causeName}) ${originalError.name}`;\n message = originalError.message;\n const messageLines = message.split(\"\\n\").length;\n stack = originalError.stack ? `(${causeName}) ${originalError.stack.split(\"\\n\").slice(0, messageLines + 3).join(\"\\n\")}` : `${name}: ${message}`;\n } else {\n name = causeName;\n message = toStringUnknown(originalError, 0);\n stack = `${name}: ${message}`;\n }\n if (traces.length > 0) {\n stack += `\\n ${traces.join(\"\\n \")}`;\n }\n super(message);\n this._tag = _tag;\n this.traces = traces;\n this[MicroCauseTypeId] = microCauseVariance;\n this.name = name;\n this.stack = stack;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n toString() {\n return this.stack;\n }\n [NodeInspectSymbol]() {\n return this.stack;\n }\n}\nclass Fail extends MicroCauseImpl {\n error;\n constructor(error, traces = []) {\n super(\"Fail\", error, traces);\n this.error = error;\n }\n}\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeFail = (error, traces = []) => new Fail(error, traces);\nclass Die extends MicroCauseImpl {\n defect;\n constructor(defect, traces = []) {\n super(\"Die\", defect, traces);\n this.defect = defect;\n }\n}\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeDie = (defect, traces = []) => new Die(defect, traces);\nclass Interrupt extends MicroCauseImpl {\n constructor(traces = []) {\n super(\"Interrupt\", \"interrupted\", traces);\n }\n}\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeInterrupt = (traces = []) => new Interrupt(traces);\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeIsFail = self => self._tag === \"Fail\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeIsDie = self => self._tag === \"Die\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeIsInterrupt = self => self._tag === \"Interrupt\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeSquash = self => self._tag === \"Fail\" ? self.error : self._tag === \"Die\" ? self.defect : self;\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroCause\n */\nexport const causeWithTrace = /*#__PURE__*/dual(2, (self, trace) => {\n const traces = [...self.traces, trace];\n switch (self._tag) {\n case \"Die\":\n return causeDie(self.defect, traces);\n case \"Interrupt\":\n return causeInterrupt(traces);\n case \"Fail\":\n return causeFail(self.error, traces);\n }\n});\n// ----------------------------------------------------------------------------\n// MicroFiber\n// ----------------------------------------------------------------------------\n/**\n * @since 3.11.0\n * @experimental\n * @category MicroFiber\n */\nexport const MicroFiberTypeId = /*#__PURE__*/Symbol.for(\"effect/Micro/MicroFiber\");\nconst fiberVariance = {\n _A: identity,\n _E: identity\n};\nclass MicroFiberImpl {\n context;\n interruptible;\n [MicroFiberTypeId];\n _stack = [];\n _observers = [];\n _exit;\n _children;\n currentOpCount = 0;\n constructor(context, interruptible = true) {\n this.context = context;\n this.interruptible = interruptible;\n this[MicroFiberTypeId] = fiberVariance;\n }\n getRef(ref) {\n return InternalContext.unsafeGetReference(this.context, ref);\n }\n addObserver(cb) {\n if (this._exit) {\n cb(this._exit);\n return constVoid;\n }\n this._observers.push(cb);\n return () => {\n const index = this._observers.indexOf(cb);\n if (index >= 0) {\n this._observers.splice(index, 1);\n }\n };\n }\n _interrupted = false;\n unsafeInterrupt() {\n if (this._exit) {\n return;\n }\n this._interrupted = true;\n if (this.interruptible) {\n this.evaluate(exitInterrupt);\n }\n }\n unsafePoll() {\n return this._exit;\n }\n evaluate(effect) {\n if (this._exit) {\n return;\n } else if (this._yielded !== undefined) {\n const yielded = this._yielded;\n this._yielded = undefined;\n yielded();\n }\n const exit = this.runLoop(effect);\n if (exit === Yield) {\n return;\n }\n // the interruptChildren middlware is added in Micro.fork, so it can be\n // tree-shaken if not used\n const interruptChildren = fiberMiddleware.interruptChildren && fiberMiddleware.interruptChildren(this);\n if (interruptChildren !== undefined) {\n return this.evaluate(flatMap(interruptChildren, () => exit));\n }\n this._exit = exit;\n for (let i = 0; i < this._observers.length; i++) {\n this._observers[i](exit);\n }\n this._observers.length = 0;\n }\n runLoop(effect) {\n let yielding = false;\n let current = effect;\n this.currentOpCount = 0;\n try {\n while (true) {\n this.currentOpCount++;\n if (!yielding && this.getRef(CurrentScheduler).shouldYield(this)) {\n yielding = true;\n const prev = current;\n current = flatMap(yieldNow, () => prev);\n }\n current = current[evaluate](this);\n if (current === Yield) {\n const yielded = this._yielded;\n if (MicroExitTypeId in yielded) {\n this._yielded = undefined;\n return yielded;\n }\n return Yield;\n }\n }\n } catch (error) {\n if (!hasProperty(current, evaluate)) {\n return exitDie(`MicroFiber.runLoop: Not a valid effect: ${String(current)}`);\n }\n return exitDie(error);\n }\n }\n getCont(symbol) {\n while (true) {\n const op = this._stack.pop();\n if (!op) return undefined;\n const cont = op[ensureCont] && op[ensureCont](this);\n if (cont) return {\n [symbol]: cont\n };\n if (op[symbol]) return op;\n }\n }\n // cancel the yielded operation, or for the yielded exit value\n _yielded = undefined;\n yieldWith(value) {\n this._yielded = value;\n return Yield;\n }\n children() {\n return this._children ??= new Set();\n }\n}\nconst fiberMiddleware = /*#__PURE__*/globalValue(\"effect/Micro/fiberMiddleware\", () => ({\n interruptChildren: undefined\n}));\nconst fiberInterruptChildren = fiber => {\n if (fiber._children === undefined || fiber._children.size === 0) {\n return undefined;\n }\n return fiberInterruptAll(fiber._children);\n};\n/**\n * @since 3.11.0\n * @experimental\n * @category MicroFiber\n */\nexport const fiberAwait = self => async(resume => sync(self.addObserver(exit => resume(succeed(exit)))));\n/**\n * @since 3.11.2\n * @experimental\n * @category MicroFiber\n */\nexport const fiberJoin = self => flatten(fiberAwait(self));\n/**\n * @since 3.11.0\n * @experimental\n * @category MicroFiber\n */\nexport const fiberInterrupt = self => suspend(() => {\n self.unsafeInterrupt();\n return asVoid(fiberAwait(self));\n});\n/**\n * @since 3.11.0\n * @experimental\n * @category MicroFiber\n */\nexport const fiberInterruptAll = fibers => suspend(() => {\n for (const fiber of fibers) fiber.unsafeInterrupt();\n const iter = fibers[Symbol.iterator]();\n const wait = suspend(() => {\n let result = iter.next();\n while (!result.done) {\n if (result.value.unsafePoll()) {\n result = iter.next();\n continue;\n }\n const fiber = result.value;\n return async(resume => {\n fiber.addObserver(_ => {\n resume(wait);\n });\n });\n }\n return exitVoid;\n });\n return wait;\n});\nconst identifier = /*#__PURE__*/Symbol.for(\"effect/Micro/identifier\");\nconst args = /*#__PURE__*/Symbol.for(\"effect/Micro/args\");\nconst evaluate = /*#__PURE__*/Symbol.for(\"effect/Micro/evaluate\");\nconst successCont = /*#__PURE__*/Symbol.for(\"effect/Micro/successCont\");\nconst failureCont = /*#__PURE__*/Symbol.for(\"effect/Micro/failureCont\");\nconst ensureCont = /*#__PURE__*/Symbol.for(\"effect/Micro/ensureCont\");\nconst Yield = /*#__PURE__*/Symbol.for(\"effect/Micro/Yield\");\nconst microVariance = {\n _A: identity,\n _E: identity,\n _R: identity\n};\nconst MicroProto = {\n ...Effectable.EffectPrototype,\n _op: \"Micro\",\n [TypeId]: microVariance,\n pipe() {\n return pipeArguments(this, arguments);\n },\n [Symbol.iterator]() {\n return new SingleShotGen(new YieldWrap(this));\n },\n toJSON() {\n return {\n _id: \"Micro\",\n op: this[identifier],\n ...(args in this ? {\n args: this[args]\n } : undefined)\n };\n },\n toString() {\n return format(this);\n },\n [NodeInspectSymbol]() {\n return format(this);\n }\n};\nfunction defaultEvaluate(_fiber) {\n return exitDie(`Micro.evaluate: Not implemented`);\n}\nconst makePrimitiveProto = options => ({\n ...MicroProto,\n [identifier]: options.op,\n [evaluate]: options.eval ?? defaultEvaluate,\n [successCont]: options.contA,\n [failureCont]: options.contE,\n [ensureCont]: options.ensure\n});\nconst makePrimitive = options => {\n const Proto = makePrimitiveProto(options);\n return function () {\n const self = Object.create(Proto);\n self[args] = options.single === false ? arguments : arguments[0];\n return self;\n };\n};\nconst makeExit = options => {\n const Proto = {\n ...makePrimitiveProto(options),\n [MicroExitTypeId]: MicroExitTypeId,\n _tag: options.op,\n get [options.prop]() {\n return this[args];\n },\n toJSON() {\n return {\n _id: \"MicroExit\",\n _tag: options.op,\n [options.prop]: this[args]\n };\n },\n [Equal.symbol](that) {\n return isMicroExit(that) && that._tag === options.op && Equal.equals(this[args], that[args]);\n },\n [Hash.symbol]() {\n return Hash.cached(this, Hash.combine(Hash.string(options.op))(Hash.hash(this[args])));\n }\n };\n return function (value) {\n const self = Object.create(Proto);\n self[args] = value;\n self[successCont] = undefined;\n self[failureCont] = undefined;\n self[ensureCont] = undefined;\n return self;\n };\n};\n/**\n * Creates a `Micro` effect that will succeed with the specified constant value.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const succeed = /*#__PURE__*/makeExit({\n op: \"Success\",\n prop: \"value\",\n eval(fiber) {\n const cont = fiber.getCont(successCont);\n return cont ? cont[successCont](this[args], fiber) : fiber.yieldWith(this);\n }\n});\n/**\n * Creates a `Micro` effect that will fail with the specified `MicroCause`.\n *\n * @since 3.4.6\n * @experimental\n * @category constructors\n */\nexport const failCause = /*#__PURE__*/makeExit({\n op: \"Failure\",\n prop: \"cause\",\n eval(fiber) {\n let cont = fiber.getCont(failureCont);\n while (causeIsInterrupt(this[args]) && cont && fiber.interruptible) {\n cont = fiber.getCont(failureCont);\n }\n return cont ? cont[failureCont](this[args], fiber) : fiber.yieldWith(this);\n }\n});\n/**\n * Creates a `Micro` effect that fails with the given error.\n *\n * This results in a `Fail` variant of the `MicroCause` type, where the error is\n * tracked at the type level.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const fail = error => failCause(causeFail(error));\n/**\n * Creates a `Micro` effect that succeeds with a lazily evaluated value.\n *\n * If the evaluation of the value throws an error, the effect will fail with a\n * `Die` variant of the `MicroCause` type.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const sync = /*#__PURE__*/makePrimitive({\n op: \"Sync\",\n eval(fiber) {\n const value = this[args]();\n const cont = fiber.getCont(successCont);\n return cont ? cont[successCont](value, fiber) : fiber.yieldWith(exitSucceed(value));\n }\n});\n/**\n * Lazily creates a `Micro` effect from the given side-effect.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const suspend = /*#__PURE__*/makePrimitive({\n op: \"Suspend\",\n eval(_fiber) {\n return this[args]();\n }\n});\n/**\n * Pause the execution of the current `Micro` effect, and resume it on the next\n * scheduler tick.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const yieldNowWith = /*#__PURE__*/makePrimitive({\n op: \"Yield\",\n eval(fiber) {\n let resumed = false;\n fiber.getRef(CurrentScheduler).scheduleTask(() => {\n if (resumed) return;\n fiber.evaluate(exitVoid);\n }, this[args] ?? 0);\n return fiber.yieldWith(() => {\n resumed = true;\n });\n }\n});\n/**\n * Pause the execution of the current `Micro` effect, and resume it on the next\n * scheduler tick.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const yieldNow = /*#__PURE__*/yieldNowWith(0);\n/**\n * Creates a `Micro` effect that will succeed with the value wrapped in `Some`.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const succeedSome = a => succeed(Option.some(a));\n/**\n * Creates a `Micro` effect that succeeds with `None`.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const succeedNone = /*#__PURE__*/succeed(/*#__PURE__*/Option.none());\n/**\n * Creates a `Micro` effect that will fail with the lazily evaluated `MicroCause`.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const failCauseSync = evaluate => suspend(() => failCause(evaluate()));\n/**\n * Creates a `Micro` effect that will die with the specified error.\n *\n * This results in a `Die` variant of the `MicroCause` type, where the error is\n * not tracked at the type level.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const die = defect => exitDie(defect);\n/**\n * Creates a `Micro` effect that will fail with the lazily evaluated error.\n *\n * This results in a `Fail` variant of the `MicroCause` type, where the error is\n * tracked at the type level.\n *\n * @since 3.4.6\n * @experimental\n * @category constructors\n */\nexport const failSync = error => suspend(() => fail(error()));\n/**\n * Converts an `Option` into a `Micro` effect, that will fail with\n * `NoSuchElementException` if the option is `None`. Otherwise, it will succeed with the\n * value of the option.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const fromOption = option => option._tag === \"Some\" ? succeed(option.value) : fail(new NoSuchElementException({}));\n/**\n * Converts an `Either` into a `Micro` effect, that will fail with the left side\n * of the either if it is a `Left`. Otherwise, it will succeed with the right\n * side of the either.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const fromEither = either => either._tag === \"Right\" ? succeed(either.right) : fail(either.left);\nconst void_ = /*#__PURE__*/succeed(void 0);\nexport {\n/**\n * A `Micro` effect that will succeed with `void` (`undefined`).\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nvoid_ as void };\nconst try_ = options => suspend(() => {\n try {\n return succeed(options.try());\n } catch (err) {\n return fail(options.catch(err));\n }\n});\nexport {\n/**\n * The `Micro` equivalent of a try / catch block, which allows you to map\n * thrown errors to a specific error type.\n *\n * @example\n * ```ts\n * import { Micro } from \"effect\"\n *\n * Micro.try({\n * try: () => { throw new Error(\"boom\") },\n * catch: (cause) => new Error(\"caught\", { cause })\n * })\n * ```\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\ntry_ as try };\n/**\n * Wrap a `Promise` into a `Micro` effect.\n *\n * Any errors will result in a `Die` variant of the `MicroCause` type, where the\n * error is not tracked at the type level.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const promise = evaluate => asyncOptions(function (resume, signal) {\n evaluate(signal).then(a => resume(succeed(a)), e => resume(die(e)));\n}, evaluate.length !== 0);\n/**\n * Wrap a `Promise` into a `Micro` effect. Any errors will be caught and\n * converted into a specific error type.\n *\n * @example\n * ```ts\n * import { Micro } from \"effect\"\n *\n * Micro.tryPromise({\n * try: () => Promise.resolve(\"success\"),\n * catch: (cause) => new Error(\"caught\", { cause })\n * })\n * ```\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const tryPromise = options => asyncOptions(function (resume, signal) {\n try {\n options.try(signal).then(a => resume(succeed(a)), e => resume(fail(options.catch(e))));\n } catch (err) {\n resume(fail(options.catch(err)));\n }\n}, options.try.length !== 0);\n/**\n * Create a `Micro` effect using the current `MicroFiber`.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const withMicroFiber = /*#__PURE__*/makePrimitive({\n op: \"WithMicroFiber\",\n eval(fiber) {\n return this[args](fiber);\n }\n});\n/**\n * Flush any yielded effects that are waiting to be executed.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const yieldFlush = /*#__PURE__*/withMicroFiber(fiber => {\n fiber.getRef(CurrentScheduler).flush();\n return exitVoid;\n});\nconst asyncOptions = /*#__PURE__*/makePrimitive({\n op: \"Async\",\n single: false,\n eval(fiber) {\n const register = this[args][0];\n let resumed = false;\n let yielded = false;\n const controller = this[args][1] ? new AbortController() : undefined;\n const onCancel = register(effect => {\n if (resumed) return;\n resumed = true;\n if (yielded) {\n fiber.evaluate(effect);\n } else {\n yielded = effect;\n }\n }, controller?.signal);\n if (yielded !== false) return yielded;\n yielded = true;\n fiber._yielded = () => {\n resumed = true;\n };\n if (controller === undefined && onCancel === undefined) {\n return Yield;\n }\n fiber._stack.push(asyncFinalizer(() => {\n resumed = true;\n controller?.abort();\n return onCancel ?? exitVoid;\n }));\n return Yield;\n }\n});\nconst asyncFinalizer = /*#__PURE__*/makePrimitive({\n op: \"AsyncFinalizer\",\n ensure(fiber) {\n if (fiber.interruptible) {\n fiber.interruptible = false;\n fiber._stack.push(setInterruptible(true));\n }\n },\n contE(cause, _fiber) {\n return causeIsInterrupt(cause) ? flatMap(this[args](), () => failCause(cause)) : failCause(cause);\n }\n});\n/**\n * Create a `Micro` effect from an asynchronous computation.\n *\n * You can return a cleanup effect that will be run when the effect is aborted.\n * It is also passed an `AbortSignal` that is triggered when the effect is\n * aborted.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const async = register => asyncOptions(register, register.length >= 2);\n/**\n * A `Micro` that will never succeed or fail. It wraps `setInterval` to prevent\n * the Javascript runtime from exiting.\n *\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const never = /*#__PURE__*/async(function () {\n const interval = setInterval(constVoid, 2147483646);\n return sync(() => clearInterval(interval));\n});\n/**\n * @since 3.4.0\n * @experimental\n * @category constructors\n */\nexport const gen = (...args) => suspend(() => fromIterator(args.length === 1 ? args[0]() : args[1].call(args[0])));\nconst fromIterator = /*#__PURE__*/makePrimitive({\n op: \"Iterator\",\n contA(value, fiber) {\n const state = this[args].next(value);\n if (state.done) return succeed(state.value);\n fiber._stack.push(this);\n return yieldWrapGet(state.value);\n },\n eval(fiber) {\n return this[successCont](undefined, fiber);\n }\n});\n// ----------------------------------------------------------------------------\n// mapping & sequencing\n// ----------------------------------------------------------------------------\n/**\n * Create a `Micro` effect that will replace the success value of the given\n * effect.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const as = /*#__PURE__*/dual(2, (self, value) => map(self, _ => value));\n/**\n * Wrap the success value of this `Micro` effect in a `Some`.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const asSome = self => map(self, Option.some);\n/**\n * Swap the error and success types of the `Micro` effect.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const flip = self => matchEffect(self, {\n onFailure: succeed,\n onSuccess: fail\n});\n/**\n * A more flexible version of `flatMap` that combines `map` and `flatMap` into a\n * single API.\n *\n * It also lets you directly pass a `Micro` effect, which will be executed after\n * the current effect.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const andThen = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {\n const value = isMicro(f) ? f : typeof f === \"function\" ? f(a) : f;\n return isMicro(value) ? value : succeed(value);\n}));\n/**\n * Execute a side effect from the success value of the `Micro` effect.\n *\n * It is similar to the `andThen` api, but the success value is ignored.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const tap = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => {\n const value = isMicro(f) ? f : typeof f === \"function\" ? f(a) : f;\n return isMicro(value) ? as(value, a) : succeed(a);\n}));\n/**\n * Replace the success value of the `Micro` effect with `void`.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const asVoid = self => flatMap(self, _ => exitVoid);\n/**\n * Access the `MicroExit` of the given `Micro` effect.\n *\n * @since 3.4.6\n * @experimental\n * @category mapping & sequencing\n */\nexport const exit = self => matchCause(self, {\n onFailure: exitFailCause,\n onSuccess: exitSucceed\n});\n/**\n * Replace the error type of the given `Micro` with the full `MicroCause` object.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const sandbox = self => catchAllCause(self, fail);\n/**\n * Returns an effect that races all the specified effects,\n * yielding the value of the first effect to succeed with a value. Losers of\n * the race will be interrupted immediately\n *\n * @since 3.4.0\n * @experimental\n * @category sequencing\n */\nexport const raceAll = all => withMicroFiber(parent => async(resume => {\n const effects = Arr.fromIterable(all);\n const len = effects.length;\n let doneCount = 0;\n let done = false;\n const fibers = new Set();\n const causes = [];\n const onExit = exit => {\n doneCount++;\n if (exit._tag === \"Failure\") {\n causes.push(exit.cause);\n if (doneCount >= len) {\n resume(failCause(causes[0]));\n }\n return;\n }\n done = true;\n resume(fibers.size === 0 ? exit : flatMap(uninterruptible(fiberInterruptAll(fibers)), () => exit));\n };\n for (let i = 0; i < len; i++) {\n if (done) break;\n const fiber = unsafeFork(parent, interruptible(effects[i]), true, true);\n fibers.add(fiber);\n fiber.addObserver(exit => {\n fibers.delete(fiber);\n onExit(exit);\n });\n }\n return fiberInterruptAll(fibers);\n}));\n/**\n * Returns an effect that races all the specified effects,\n * yielding the value of the first effect to succeed or fail. Losers of\n * the race will be interrupted immediately.\n *\n * @since 3.4.0\n * @experimental\n * @category sequencing\n */\nexport const raceAllFirst = all => withMicroFiber(parent => async(resume => {\n let done = false;\n const fibers = new Set();\n const onExit = exit => {\n done = true;\n resume(fibers.size === 0 ? exit : flatMap(fiberInterruptAll(fibers), () => exit));\n };\n for (const effect of all) {\n if (done) break;\n const fiber = unsafeFork(parent, interruptible(effect), true, true);\n fibers.add(fiber);\n fiber.addObserver(exit => {\n fibers.delete(fiber);\n onExit(exit);\n });\n }\n return fiberInterruptAll(fibers);\n}));\n/**\n * Returns an effect that races two effects, yielding the value of the first\n * effect to succeed. Losers of the race will be interrupted immediately.\n *\n * @since 3.4.0\n * @experimental\n * @category sequencing\n */\nexport const race = /*#__PURE__*/dual(2, (self, that) => raceAll([self, that]));\n/**\n * Returns an effect that races two effects, yielding the value of the first\n * effect to succeed *or* fail. Losers of the race will be interrupted immediately.\n *\n * @since 3.4.0\n * @experimental\n * @category sequencing\n */\nexport const raceFirst = /*#__PURE__*/dual(2, (self, that) => raceAllFirst([self, that]));\n/**\n * Map the success value of this `Micro` effect to another `Micro` effect, then\n * flatten the result.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => {\n const onSuccess = Object.create(OnSuccessProto);\n onSuccess[args] = self;\n onSuccess[successCont] = f;\n return onSuccess;\n});\nconst OnSuccessProto = /*#__PURE__*/makePrimitiveProto({\n op: \"OnSuccess\",\n eval(fiber) {\n fiber._stack.push(this);\n return this[args];\n }\n});\n// ----------------------------------------------------------------------------\n// mapping & sequencing\n// ----------------------------------------------------------------------------\n/**\n * Flattens any nested `Micro` effects, merging the error and requirement types.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const flatten = self => flatMap(self, identity);\n/**\n * Transforms the success value of the `Micro` effect with the specified\n * function.\n *\n * @since 3.4.0\n * @experimental\n * @category mapping & sequencing\n */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, a => succeed(f(a))));\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const isMicroExit = u => hasProperty(u, MicroExitTypeId);\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitSucceed = succeed;\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitFailCause = failCause;\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitInterrupt = /*#__PURE__*/exitFailCause(/*#__PURE__*/causeInterrupt());\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitFail = e => exitFailCause(causeFail(e));\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitDie = defect => exitFailCause(causeDie(defect));\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitIsSuccess = self => self._tag === \"Success\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitIsFailure = self => self._tag === \"Failure\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitIsInterrupt = self => exitIsFailure(self) && self.cause._tag === \"Interrupt\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitIsFail = self => exitIsFailure(self) && self.cause._tag === \"Fail\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitIsDie = self => exitIsFailure(self) && self.cause._tag === \"Die\";\n/**\n * @since 3.4.6\n * @experimental\n * @category MicroExit\n */\nexport const exitVoid = /*#__PURE__*/exitSucceed(void 0);\n/**\n * @since 3.11.0\n * @experimental\n * @category MicroExit\n */\nexport const exitVoidAll = exits => {\n for (const exit of exits) {\n if (exit._tag === \"Failure\") {\n return exit;\n }\n }\n return exitVoid;\n};\nconst setImmediate = \"setImmediate\" in globalThis ? globalThis.setImmediate : f => setTimeout(f, 0);\n/**\n * @since 3.5.9\n * @experimental\n * @category scheduler\n */\nexport class MicroSchedulerDefault {\n tasks = [];\n running = false;\n /**\n * @since 3.5.9\n */\n scheduleTask(task, _priority) {\n this.tasks.push(task);\n if (!this.running) {\n this.running = true;\n setImmediate(this.afterScheduled);\n }\n }\n /**\n * @since 3.5.9\n */\n afterScheduled = () => {\n this.running = false;\n this.runTasks();\n };\n /**\n * @since 3.5.9\n */\n runTasks() {\n const tasks = this.tasks;\n this.tasks = [];\n for (let i = 0, len = tasks.length; i < len; i++) {\n tasks[i]();\n }\n }\n /**\n * @since 3.5.9\n */\n shouldYield(fiber) {\n return fiber.currentOpCount >= fiber.getRef(MaxOpsBeforeYield);\n }\n /**\n * @since 3.5.9\n */\n flush() {\n while (this.tasks.length > 0) {\n this.runTasks();\n }\n }\n}\n/**\n * Access the given `Context.Tag` from the environment.\n *\n * @since 3.4.0\n * @experimental\n * @category environment\n */\nexport const service = tag => withMicroFiber(fiber => succeed(Context.unsafeGet(fiber.context, tag)));\n/**\n * Access the given `Context.Tag` from the environment, without tracking the\n * dependency at the type level.\n *\n * It will return an `Option` of the service, depending on whether it is\n * available in the environment or not.\n *\n * @since 3.4.0\n * @experimental\n * @category environment\n */\nexport const serviceOption = tag => withMicroFiber(fiber => succeed(Context.getOption(fiber.context, tag)));\n/**\n * Update the Context with the given mapping function.\n *\n * @since 3.11.0\n * @experimental\n * @category environment\n */\nexport const updateContext = /*#__PURE__*/dual(2, (self, f) => withMicroFiber(fiber => {\n const prev = fiber.context;\n fiber.context = f(prev);\n return onExit(self, () => {\n fiber.context = prev;\n return void_;\n });\n}));\n/**\n * Update the service for the given `Context.Tag` in the environment.\n *\n * @since 3.11.0\n * @experimental\n * @category environment\n */\nexport const updateService = /*#__PURE__*/dual(3, (self, tag, f) => withMicroFiber(fiber => {\n const prev = Context.unsafeGet(fiber.context, tag);\n fiber.context = Context.add(fiber.context, tag, f(prev));\n return onExit(self, () => {\n fiber.context = Context.add(fiber.context, tag, prev);\n return void_;\n });\n}));\n/**\n * Access the current `Context` from the environment.\n *\n * @since 3.4.0\n * @experimental\n * @category environment\n */\nexport const context = () => getContext;\nconst getContext = /*#__PURE__*/withMicroFiber(fiber => succeed(fiber.context));\n/**\n * Merge the given `Context` with the current context.\n *\n * @since 3.4.0\n * @experimental\n * @category environment\n */\nexport const provideContext = /*#__PURE__*/dual(2, (self, provided) => updateContext(self, Context.merge(provided)));\n/**\n * Add the provided service to the current context.\n *\n * @since 3.4.0\n * @experimental\n * @category environment\n */\nexport const provideService = /*#__PURE__*/dual(3, (self, tag, service) => updateContext(self, Context.add(tag, service)));\n/**\n * Create a service using the provided `Micro` effect, and add it to the\n * current context.\n *\n * @since 3.4.6\n * @experimental\n * @category environment\n */\nexport const provideServiceEffect = /*#__PURE__*/dual(3, (self, tag, acquire) => flatMap(acquire, service => provideService(self, tag, service)));\n// ========================================================================\n// References\n// ========================================================================\n/**\n * @since 3.11.0\n * @experimental\n * @category references\n */\nexport class MaxOpsBeforeYield extends /*#__PURE__*/Context.Reference()(\"effect/Micro/currentMaxOpsBeforeYield\", {\n defaultValue: () => 2048\n}) {}\n/**\n * @since 3.11.0\n * @experimental\n * @category environment refs\n */\nexport class CurrentConcurrency extends /*#__PURE__*/Context.Reference()(\"effect/Micro/currentConcurrency\", {\n defaultValue: () => \"unbounded\"\n}) {}\n/**\n * @since 3.11.0\n * @experimental\n * @category environment refs\n */\nexport class CurrentScheduler extends /*#__PURE__*/Context.Reference()(\"effect/Micro/currentScheduler\", {\n defaultValue: () => new MicroSchedulerDefault()\n}) {}\n/**\n * If you have a `Micro` that uses `concurrency: \"inherit\"`, you can use this\n * api to control the concurrency of that `Micro` when it is run.\n *\n * @example\n * ```ts\n * import * as Micro from \"effect/Micro\"\n *\n * Micro.forEach([1, 2, 3], (n) => Micro.succeed(n), {\n * concurrency: \"inherit\"\n * }).pipe(\n * Micro.withConcurrency(2) // use a concurrency of 2\n * )\n * ```\n *\n * @since 3.4.0\n * @experimental\n * @category environment refs\n */\nexport const withConcurrency = /*#__PURE__*/dual(2, (self, concurrency) => provideService(self, CurrentConcurrency, concurrency));\n// ----------------------------------------------------------------------------\n// zipping\n// ----------------------------------------------------------------------------\n/**\n * Combine two `Micro` effects into a single effect that produces a tuple of\n * their results.\n *\n * @since 3.4.0\n * @experimental\n * @category zipping\n */\nexport const zip = /*#__PURE__*/dual(args => isMicro(args[1]), (self, that, options) => zipWith(self, that, (a, a2) => [a, a2], options));\n/**\n * The `Micro.zipWith` function combines two `Micro` effects and allows you to\n * apply a function to the results of the combined effects, transforming them\n * into a single value.\n *\n * @since 3.4.3\n * @experimental\n * @category zipping\n */\nexport const zipWith = /*#__PURE__*/dual(args => isMicro(args[1]), (self, that, f, options) => options?.concurrent\n// Use `all` exclusively for concurrent cases, as it introduces additional overhead due to the management of concurrency\n? map(all([self, that], {\n concurrency: 2\n}), ([a, a2]) => f(a, a2)) : flatMap(self, a => map(that, a2 => f(a, a2))));\n// ----------------------------------------------------------------------------\n// filtering & conditionals\n// ----------------------------------------------------------------------------\n/**\n * Filter the specified effect with the provided function, failing with specified\n * `MicroCause` if the predicate fails.\n *\n * In addition to the filtering capabilities discussed earlier, you have the option to further\n * refine and narrow down the type of the success channel by providing a\n *\n * @since 3.4.0\n * @experimental\n * @category filtering & conditionals\n */\nexport const filterOrFailCause = /*#__PURE__*/dual(args => isMicro(args[0]), (self, refinement, orFailWith) => flatMap(self, a => refinement(a) ? succeed(a) : failCause(orFailWith(a))));\n/**\n * Filter the specified effect with the provided function, failing with specified\n * error if the predicate fails.\n *\n * In addition to the filtering capabilities discussed earlier, you have the option to further\n * refine and narrow down the type of the success channel by providing a\n *\n * @since 3.4.0\n * @experimental\n * @category filtering & conditionals\n */\nexport const filterOrFail = /*#__PURE__*/dual(args => isMicro(args[0]), (self, refinement, orFailWith) => flatMap(self, a => refinement(a) ? succeed(a) : fail(orFailWith(a))));\n/**\n * The moral equivalent of `if (p) exp`.\n *\n * @since 3.4.0\n * @experimental\n * @category filtering & conditionals\n */\nexport const when = /*#__PURE__*/dual(2, (self, condition) => flatMap(isMicro(condition) ? condition : sync(condition), pass => pass ? asSome(self) : succeedNone));\n// ----------------------------------------------------------------------------\n// repetition\n// ----------------------------------------------------------------------------\n/**\n * Repeat the given `Micro` using the provided options.\n *\n * The `while` predicate will be checked after each iteration, and can use the\n * fall `MicroExit` of the effect to determine if the repetition should continue.\n *\n * @since 3.4.6\n * @experimental\n * @category repetition\n */\nexport const repeatExit = /*#__PURE__*/dual(2, (self, options) => suspend(() => {\n const startedAt = options.schedule ? Date.now() : 0;\n let attempt = 0;\n const loop = flatMap(exit(self), exit => {\n if (options.while !== undefined && !options.while(exit)) {\n return exit;\n } else if (options.times !== undefined && attempt >= options.times) {\n return exit;\n }\n attempt++;\n let delayEffect = yieldNow;\n if (options.schedule !== undefined) {\n const elapsed = Date.now() - startedAt;\n const duration = options.schedule(attempt, elapsed);\n if (Option.isNone(duration)) {\n return exit;\n }\n delayEffect = sleep(duration.value);\n }\n return flatMap(delayEffect, () => loop);\n });\n return loop;\n}));\n/**\n * Repeat the given `Micro` effect using the provided options. Only successful\n * results will be repeated.\n *\n * @since 3.4.0\n * @experimental\n * @category repetition\n */\nexport const repeat = /*#__PURE__*/dual(args => isMicro(args[0]), (self, options) => repeatExit(self, {\n ...options,\n while: exit => exit._tag === \"Success\" && (options?.while === undefined || options.while(exit.value))\n}));\n/**\n * Replicates the given effect `n` times.\n *\n * @since 3.11.0\n * @experimental\n * @category repetition\n */\nexport const replicate = /*#__PURE__*/dual(2, (self, n) => Array.from({\n length: n\n}, () => self));\n/**\n * Performs this effect the specified number of times and collects the\n * results.\n *\n * @since 3.11.0\n * @category repetition\n */\nexport const replicateEffect = /*#__PURE__*/dual(args => isMicro(args[0]), (self, n, options) => all(replicate(self, n), options));\n/**\n * Repeat the given `Micro` effect forever, only stopping if the effect fails.\n *\n * @since 3.4.0\n * @experimental\n * @category repetition\n */\nexport const forever = self => repeat(self);\n/**\n * Create a `MicroSchedule` that will stop repeating after the specified number\n * of attempts.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleRecurs = n => attempt => attempt <= n ? Option.some(0) : Option.none();\n/**\n * Create a `MicroSchedule` that will generate a constant delay.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleSpaced = millis => () => Option.some(millis);\n/**\n * Create a `MicroSchedule` that will generate a delay with an exponential backoff.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleExponential = (baseMillis, factor = 2) => attempt => Option.some(Math.pow(factor, attempt) * baseMillis);\n/**\n * Returns a new `MicroSchedule` with an added calculated delay to each delay\n * returned by this schedule.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleAddDelay = /*#__PURE__*/dual(2, (self, f) => (attempt, elapsed) => Option.map(self(attempt, elapsed), duration => duration + f()));\n/**\n * Transform a `MicroSchedule` to one that will have a delay that will never exceed\n * the specified maximum.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleWithMaxDelay = /*#__PURE__*/dual(2, (self, max) => (attempt, elapsed) => Option.map(self(attempt, elapsed), duration => Math.min(duration, max)));\n/**\n * Transform a `MicroSchedule` to one that will stop repeating after the specified\n * amount of time.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleWithMaxElapsed = /*#__PURE__*/dual(2, (self, max) => (attempt, elapsed) => elapsed < max ? self(attempt, elapsed) : Option.none());\n/**\n * Combines two `MicroSchedule`s, by recurring if either schedule wants to\n * recur, using the minimum of the two durations between recurrences.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleUnion = /*#__PURE__*/dual(2, (self, that) => (attempt, elapsed) => Option.zipWith(self(attempt, elapsed), that(attempt, elapsed), (d1, d2) => Math.min(d1, d2)));\n/**\n * Combines two `MicroSchedule`s, by recurring only if both schedules want to\n * recur, using the maximum of the two durations between recurrences.\n *\n * @since 3.4.6\n * @experimental\n * @category scheduling\n */\nexport const scheduleIntersect = /*#__PURE__*/dual(2, (self, that) => (attempt, elapsed) => Option.zipWith(self(attempt, elapsed), that(attempt, elapsed), (d1, d2) => Math.max(d1, d2)));\n// ----------------------------------------------------------------------------\n// error handling\n// ----------------------------------------------------------------------------\n/**\n * Catch the full `MicroCause` object of the given `Micro` effect, allowing you to\n * recover from any kind of cause.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const catchAllCause = /*#__PURE__*/dual(2, (self, f) => {\n const onFailure = Object.create(OnFailureProto);\n onFailure[args] = self;\n onFailure[failureCont] = f;\n return onFailure;\n});\nconst OnFailureProto = /*#__PURE__*/makePrimitiveProto({\n op: \"OnFailure\",\n eval(fiber) {\n fiber._stack.push(this);\n return this[args];\n }\n});\n/**\n * Selectively catch a `MicroCause` object of the given `Micro` effect,\n * using the provided predicate to determine if the failure should be caught.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const catchCauseIf = /*#__PURE__*/dual(3, (self, predicate, f) => catchAllCause(self, cause => predicate(cause) ? f(cause) : failCause(cause)));\n/**\n * Catch the error of the given `Micro` effect, allowing you to recover from it.\n *\n * It only catches expected errors.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const catchAll = /*#__PURE__*/dual(2, (self, f) => catchCauseIf(self, causeIsFail, cause => f(cause.error)));\n/**\n * Catch any unexpected errors of the given `Micro` effect, allowing you to recover from them.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const catchAllDefect = /*#__PURE__*/dual(2, (self, f) => catchCauseIf(self, causeIsDie, die => f(die.defect)));\n/**\n * Perform a side effect using the full `MicroCause` object of the given `Micro`.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const tapErrorCause = /*#__PURE__*/dual(2, (self, f) => tapErrorCauseIf(self, constTrue, f));\n/**\n * Perform a side effect using if a `MicroCause` object matches the specified\n * predicate.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const tapErrorCauseIf = /*#__PURE__*/dual(3, (self, refinement, f) => catchCauseIf(self, refinement, cause => andThen(f(cause), failCause(cause))));\n/**\n * Perform a side effect from expected errors of the given `Micro`.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const tapError = /*#__PURE__*/dual(2, (self, f) => tapErrorCauseIf(self, causeIsFail, fail => f(fail.error)));\n/**\n * Perform a side effect from unexpected errors of the given `Micro`.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const tapDefect = /*#__PURE__*/dual(2, (self, f) => tapErrorCauseIf(self, causeIsDie, die => f(die.defect)));\n/**\n * Catch any expected errors that match the specified predicate.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const catchIf = /*#__PURE__*/dual(3, (self, predicate, f) => catchCauseIf(self, f => causeIsFail(f) && predicate(f.error), fail => f(fail.error)));\n/**\n * Recovers from the specified tagged error.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const catchTag = /*#__PURE__*/dual(3, (self, k, f) => catchIf(self, isTagged(k), f));\n/**\n * Transform the full `MicroCause` object of the given `Micro` effect.\n *\n * @since 3.4.6\n * @experimental\n * @category error handling\n */\nexport const mapErrorCause = /*#__PURE__*/dual(2, (self, f) => catchAllCause(self, cause => failCause(f(cause))));\n/**\n * Transform any expected errors of the given `Micro` effect.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const mapError = /*#__PURE__*/dual(2, (self, f) => catchAll(self, error => fail(f(error))));\n/**\n * Elevate any expected errors of the given `Micro` effect to unexpected errors,\n * resulting in an error type of `never`.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const orDie = self => catchAll(self, die);\n/**\n * Recover from all errors by succeeding with the given value.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const orElseSucceed = /*#__PURE__*/dual(2, (self, f) => catchAll(self, _ => sync(f)));\n/**\n * Ignore any expected errors of the given `Micro` effect, returning `void`.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const ignore = self => matchEffect(self, {\n onFailure: _ => void_,\n onSuccess: _ => void_\n});\n/**\n * Ignore any expected errors of the given `Micro` effect, returning `void`.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const ignoreLogged = self => matchEffect(self, {\n // eslint-disable-next-line no-console\n onFailure: error => sync(() => console.error(error)),\n onSuccess: _ => void_\n});\n/**\n * Replace the success value of the given `Micro` effect with an `Option`,\n * wrapping the success value in `Some` and returning `None` if the effect fails\n * with an expected error.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const option = self => match(self, {\n onFailure: Option.none,\n onSuccess: Option.some\n});\n/**\n * Replace the success value of the given `Micro` effect with an `Either`,\n * wrapping the success value in `Right` and wrapping any expected errors with\n * a `Left`.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const either = self => match(self, {\n onFailure: Either.left,\n onSuccess: Either.right\n});\n/**\n * Retry the given `Micro` effect using the provided options.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const retry = /*#__PURE__*/dual(args => isMicro(args[0]), (self, options) => repeatExit(self, {\n ...options,\n while: exit => exit._tag === \"Failure\" && exit.cause._tag === \"Fail\" && (options?.while === undefined || options.while(exit.cause.error))\n}));\n/**\n * Add a stack trace to any failures that occur in the effect. The trace will be\n * added to the `traces` field of the `MicroCause` object.\n *\n * @since 3.4.0\n * @experimental\n * @category error handling\n */\nexport const withTrace = function () {\n const prevLimit = globalThis.Error.stackTraceLimit;\n globalThis.Error.stackTraceLimit = 2;\n const error = new globalThis.Error();\n globalThis.Error.stackTraceLimit = prevLimit;\n function generate(name, cause) {\n const stack = error.stack;\n if (!stack) {\n return cause;\n }\n const line = stack.split(\"\\n\")[2]?.trim().replace(/^at /, \"\");\n if (!line) {\n return cause;\n }\n const lineMatch = line.match(/\\((.*)\\)$/);\n return causeWithTrace(cause, `at ${name} (${lineMatch ? lineMatch[1] : line})`);\n }\n const f = name => self => onError(self, cause => failCause(generate(name, cause)));\n if (arguments.length === 2) {\n return f(arguments[1])(arguments[0]);\n }\n return f(arguments[0]);\n};\n// ----------------------------------------------------------------------------\n// pattern matching\n// ----------------------------------------------------------------------------\n/**\n * @since 3.4.6\n * @experimental\n * @category pattern matching\n */\nexport const matchCauseEffect = /*#__PURE__*/dual(2, (self, options) => {\n const primitive = Object.create(OnSuccessAndFailureProto);\n primitive[args] = self;\n primitive[successCont] = options.onSuccess;\n primitive[failureCont] = options.onFailure;\n return primitive;\n});\nconst OnSuccessAndFailureProto = /*#__PURE__*/makePrimitiveProto({\n op: \"OnSuccessAndFailure\",\n eval(fiber) {\n fiber._stack.push(this);\n return this[args];\n }\n});\n/**\n * @since 3.4.6\n * @experimental\n * @category pattern matching\n */\nexport const matchCause = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect(self, {\n onFailure: cause => sync(() => options.onFailure(cause)),\n onSuccess: value => sync(() => options.onSuccess(value))\n}));\n/**\n * @since 3.4.6\n * @experimental\n * @category pattern matching\n */\nexport const matchEffect = /*#__PURE__*/dual(2, (self, options) => matchCauseEffect(self, {\n onFailure: cause => cause._tag === \"Fail\" ? options.onFailure(cause.error) : failCause(cause),\n onSuccess: options.onSuccess\n}));\n/**\n * @since 3.4.0\n * @experimental\n * @category pattern matching\n */\nexport const match = /*#__PURE__*/dual(2, (self, options) => matchEffect(self, {\n onFailure: error => sync(() => options.onFailure(error)),\n onSuccess: value => sync(() => options.onSuccess(value))\n}));\n// ----------------------------------------------------------------------------\n// delays & timeouts\n// ----------------------------------------------------------------------------\n/**\n * Create a `Micro` effect that will sleep for the specified duration.\n *\n * @since 3.4.0\n * @experimental\n * @category delays & timeouts\n */\nexport const sleep = millis => async(resume => {\n const timeout = setTimeout(() => {\n resume(void_);\n }, millis);\n return sync(() => {\n clearTimeout(timeout);\n });\n});\n/**\n * Returns an effect that will delay the execution of this effect by the\n * specified duration.\n *\n * @since 3.4.0\n * @experimental\n * @category delays & timeouts\n */\nexport const delay = /*#__PURE__*/dual(2, (self, millis) => andThen(sleep(millis), self));\n/**\n * Returns an effect that will timeout this effect, that will execute the\n * fallback effect if the timeout elapses before the effect has produced a value.\n *\n * If the timeout elapses, the running effect will be safely interrupted.\n *\n * @since 3.4.0\n * @experimental\n * @category delays & timeouts\n */\nexport const timeoutOrElse = /*#__PURE__*/dual(2, (self, options) => raceFirst(self, andThen(interruptible(sleep(options.duration)), options.onTimeout)));\n/**\n * Returns an effect that will timeout this effect, that will fail with a\n * `TimeoutException` if the timeout elapses before the effect has produced a\n * value.\n *\n * If the timeout elapses, the running effect will be safely interrupted.\n *\n * @since 3.4.0\n * @experimental\n * @category delays & timeouts\n */\nexport const timeout = /*#__PURE__*/dual(2, (self, millis) => timeoutOrElse(self, {\n duration: millis,\n onTimeout: () => fail(new TimeoutException())\n}));\n/**\n * Returns an effect that will timeout this effect, succeeding with a `None`\n * if the timeout elapses before the effect has produced a value; and `Some` of\n * the produced value otherwise.\n *\n * If the timeout elapses, the running effect will be safely interrupted.\n *\n * @since 3.4.0\n * @experimental\n * @category delays & timeouts\n */\nexport const timeoutOption = /*#__PURE__*/dual(2, (self, millis) => raceFirst(asSome(self), as(interruptible(sleep(millis)), Option.none())));\n// ----------------------------------------------------------------------------\n// resources & finalization\n// ----------------------------------------------------------------------------\n/**\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const MicroScopeTypeId = /*#__PURE__*/Symbol.for(\"effect/Micro/MicroScope\");\n/**\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const MicroScope = /*#__PURE__*/Context.GenericTag(\"effect/Micro/MicroScope\");\nclass MicroScopeImpl {\n [MicroScopeTypeId];\n state = {\n _tag: \"Open\",\n finalizers: /*#__PURE__*/new Set()\n };\n constructor() {\n this[MicroScopeTypeId] = MicroScopeTypeId;\n }\n unsafeAddFinalizer(finalizer) {\n if (this.state._tag === \"Open\") {\n this.state.finalizers.add(finalizer);\n }\n }\n addFinalizer(finalizer) {\n return suspend(() => {\n if (this.state._tag === \"Open\") {\n this.state.finalizers.add(finalizer);\n return void_;\n }\n return finalizer(this.state.exit);\n });\n }\n unsafeRemoveFinalizer(finalizer) {\n if (this.state._tag === \"Open\") {\n this.state.finalizers.delete(finalizer);\n }\n }\n close(microExit) {\n return suspend(() => {\n if (this.state._tag === \"Open\") {\n const finalizers = Array.from(this.state.finalizers).reverse();\n this.state = {\n _tag: \"Closed\",\n exit: microExit\n };\n return flatMap(forEach(finalizers, finalizer => exit(finalizer(microExit))), exitVoidAll);\n }\n return void_;\n });\n }\n get fork() {\n return sync(() => {\n const newScope = new MicroScopeImpl();\n if (this.state._tag === \"Closed\") {\n newScope.state = this.state;\n return newScope;\n }\n function fin(exit) {\n return newScope.close(exit);\n }\n this.state.finalizers.add(fin);\n newScope.unsafeAddFinalizer(_ => sync(() => this.unsafeRemoveFinalizer(fin)));\n return newScope;\n });\n }\n}\n/**\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const scopeMake = /*#__PURE__*/sync(() => new MicroScopeImpl());\n/**\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const scopeUnsafeMake = () => new MicroScopeImpl();\n/**\n * Access the current `MicroScope`.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const scope = /*#__PURE__*/service(MicroScope);\n/**\n * Provide a `MicroScope` to an effect.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const provideScope = /*#__PURE__*/dual(2, (self, scope) => provideService(self, MicroScope, scope));\n/**\n * Provide a `MicroScope` to the given effect, closing it after the effect has\n * finished executing.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const scoped = self => suspend(() => {\n const scope = new MicroScopeImpl();\n return onExit(provideService(self, MicroScope, scope), exit => scope.close(exit));\n});\n/**\n * Create a resource with a cleanup `Micro` effect, ensuring the cleanup is\n * executed when the `MicroScope` is closed.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const acquireRelease = (acquire, release) => uninterruptible(flatMap(scope, scope => tap(acquire, a => scope.addFinalizer(exit => release(a, exit)))));\n/**\n * Add a finalizer to the current `MicroScope`.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const addFinalizer = finalizer => flatMap(scope, scope => scope.addFinalizer(finalizer));\n/**\n * When the `Micro` effect is completed, run the given finalizer effect with the\n * `MicroExit` of the executed effect.\n *\n * @since 3.4.6\n * @experimental\n * @category resources & finalization\n */\nexport const onExit = /*#__PURE__*/dual(2, (self, f) => uninterruptibleMask(restore => matchCauseEffect(restore(self), {\n onFailure: cause => flatMap(f(exitFailCause(cause)), () => failCause(cause)),\n onSuccess: a => flatMap(f(exitSucceed(a)), () => succeed(a))\n})));\n/**\n * Regardless of the result of the this `Micro` effect, run the finalizer effect.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => onExit(self, _ => finalizer));\n/**\n * When the `Micro` effect is completed, run the given finalizer effect if it\n * matches the specified predicate.\n *\n * @since 3.4.6\n * @experimental\n * @category resources & finalization\n */\nexport const onExitIf = /*#__PURE__*/dual(3, (self, refinement, f) => onExit(self, exit => refinement(exit) ? f(exit) : exitVoid));\n/**\n * When the `Micro` effect fails, run the given finalizer effect with the\n * `MicroCause` of the executed effect.\n *\n * @since 3.4.6\n * @experimental\n * @category resources & finalization\n */\nexport const onError = /*#__PURE__*/dual(2, (self, f) => onExitIf(self, exitIsFailure, exit => f(exit.cause)));\n/**\n * If this `Micro` effect is aborted, run the finalizer effect.\n *\n * @since 3.4.6\n * @experimental\n * @category resources & finalization\n */\nexport const onInterrupt = /*#__PURE__*/dual(2, (self, finalizer) => onExitIf(self, exitIsInterrupt, _ => finalizer));\n/**\n * Acquire a resource, use it, and then release the resource when the `use`\n * effect has completed.\n *\n * @since 3.4.0\n * @experimental\n * @category resources & finalization\n */\nexport const acquireUseRelease = (acquire, use, release) => uninterruptibleMask(restore => flatMap(acquire, a => flatMap(exit(restore(use(a))), exit => andThen(release(a, exit), exit))));\n// ----------------------------------------------------------------------------\n// interruption\n// ----------------------------------------------------------------------------\n/**\n * Abort the current `Micro` effect.\n *\n * @since 3.4.6\n * @experimental\n * @category interruption\n */\nexport const interrupt = /*#__PURE__*/failCause(/*#__PURE__*/causeInterrupt());\n/**\n * Flag the effect as uninterruptible, which means that when the effect is\n * interrupted, it will be allowed to continue running until completion.\n *\n * @since 3.4.0\n * @experimental\n * @category flags\n */\nexport const uninterruptible = self => withMicroFiber(fiber => {\n if (!fiber.interruptible) return self;\n fiber.interruptible = false;\n fiber._stack.push(setInterruptible(true));\n return self;\n});\nconst setInterruptible = /*#__PURE__*/makePrimitive({\n op: \"SetInterruptible\",\n ensure(fiber) {\n fiber.interruptible = this[args];\n if (fiber._interrupted && fiber.interruptible) {\n return () => exitInterrupt;\n }\n }\n});\n/**\n * Flag the effect as interruptible, which means that when the effect is\n * interrupted, it will be interrupted immediately.\n *\n * @since 3.4.0\n * @experimental\n * @category flags\n */\nexport const interruptible = self => withMicroFiber(fiber => {\n if (fiber.interruptible) return self;\n fiber.interruptible = true;\n fiber._stack.push(setInterruptible(false));\n if (fiber._interrupted) return exitInterrupt;\n return self;\n});\n/**\n * Wrap the given `Micro` effect in an uninterruptible region, preventing the\n * effect from being aborted.\n *\n * You can use the `restore` function to restore a `Micro` effect to the\n * interruptibility state before the `uninterruptibleMask` was applied.\n *\n * @example\n * ```ts\n * import * as Micro from \"effect/Micro\"\n *\n * Micro.uninterruptibleMask((restore) =>\n * Micro.sleep(1000).pipe( // uninterruptible\n * Micro.andThen(restore(Micro.sleep(1000))) // interruptible\n * )\n * )\n * ```\n *\n * @since 3.4.0\n * @experimental\n * @category interruption\n */\nexport const uninterruptibleMask = f => withMicroFiber(fiber => {\n if (!fiber.interruptible) return f(identity);\n fiber.interruptible = false;\n fiber._stack.push(setInterruptible(true));\n return f(interruptible);\n});\n/**\n * Runs all the provided effects in sequence respecting the structure provided in input.\n *\n * Supports multiple arguments, a single argument tuple / array or record / struct.\n *\n * @since 3.4.0\n * @experimental\n * @category collecting & elements\n */\nexport const all = (arg, options) => {\n if (Array.isArray(arg) || isIterable(arg)) {\n return forEach(arg, identity, options);\n } else if (options?.discard) {\n return forEach(Object.values(arg), identity, options);\n }\n return suspend(() => {\n const out = {};\n return as(forEach(Object.entries(arg), ([key, effect]) => map(effect, value => {\n out[key] = value;\n }), {\n discard: true,\n concurrency: options?.concurrency\n }), out);\n });\n};\n/**\n * @since 3.11.0\n * @experimental\n * @category collecting & elements\n */\nexport const whileLoop = /*#__PURE__*/makePrimitive({\n op: \"While\",\n contA(value, fiber) {\n this[args].step(value);\n if (this[args].while()) {\n fiber._stack.push(this);\n return this[args].body();\n }\n return exitVoid;\n },\n eval(fiber) {\n if (this[args].while()) {\n fiber._stack.push(this);\n return this[args].body();\n }\n return exitVoid;\n }\n});\n/**\n * For each element of the provided iterable, run the effect and collect the\n * results.\n *\n * If the `discard` option is set to `true`, the results will be discarded and\n * the effect will return `void`.\n *\n * The `concurrency` option can be set to control how many effects are run\n * concurrently. By default, the effects are run sequentially.\n *\n * @since 3.4.0\n * @experimental\n * @category collecting & elements\n */\nexport const forEach = (iterable, f, options) => withMicroFiber(parent => {\n const concurrencyOption = options?.concurrency === \"inherit\" ? parent.getRef(CurrentConcurrency) : options?.concurrency ?? 1;\n const concurrency = concurrencyOption === \"unbounded\" ? Number.POSITIVE_INFINITY : Math.max(1, concurrencyOption);\n const items = Arr.fromIterable(iterable);\n let length = items.length;\n if (length === 0) {\n return options?.discard ? void_ : succeed([]);\n }\n const out = options?.discard ? undefined : new Array(length);\n let index = 0;\n if (concurrency === 1) {\n return as(whileLoop({\n while: () => index < items.length,\n body: () => f(items[index], index),\n step: out ? b => out[index++] = b : _ => index++\n }), out);\n }\n return async(resume => {\n const fibers = new Set();\n let result = undefined;\n let inProgress = 0;\n let doneCount = 0;\n let pumping = false;\n let interrupted = false;\n function pump() {\n pumping = true;\n while (inProgress < concurrency && index < length) {\n const currentIndex = index;\n const item = items[currentIndex];\n index++;\n inProgress++;\n try {\n const child = unsafeFork(parent, f(item, currentIndex), true, true);\n fibers.add(child);\n child.addObserver(exit => {\n fibers.delete(child);\n if (interrupted) {\n return;\n } else if (exit._tag === \"Failure\") {\n if (result === undefined) {\n result = exit;\n length = index;\n fibers.forEach(fiber => fiber.unsafeInterrupt());\n }\n } else if (out !== undefined) {\n out[currentIndex] = exit.value;\n }\n doneCount++;\n inProgress--;\n if (doneCount === length) {\n resume(result ?? succeed(out));\n } else if (!pumping && inProgress < concurrency) {\n pump();\n }\n });\n } catch (err) {\n result = exitDie(err);\n length = index;\n fibers.forEach(fiber => fiber.unsafeInterrupt());\n }\n }\n pumping = false;\n }\n pump();\n return suspend(() => {\n interrupted = true;\n index = length;\n return fiberInterruptAll(fibers);\n });\n });\n});\n/**\n * Effectfully filter the elements of the provided iterable.\n *\n * Use the `concurrency` option to control how many elements are processed\n * concurrently.\n *\n * @since 3.4.0\n * @experimental\n * @category collecting & elements\n */\nexport const filter = (iterable, f, options) => filterMap(iterable, a => map(f(a), pass => {\n pass = options?.negate ? !pass : pass;\n return pass ? Option.some(a) : Option.none();\n}), options);\n/**\n * Effectfully filter the elements of the provided iterable.\n *\n * Use the `concurrency` option to control how many elements are processed\n * concurrently.\n *\n * @since 3.4.0\n * @experimental\n * @category collecting & elements\n */\nexport const filterMap = (iterable, f, options) => suspend(() => {\n const out = [];\n return as(forEach(iterable, a => map(f(a), o => {\n if (o._tag === \"Some\") {\n out.push(o.value);\n }\n }), {\n discard: true,\n concurrency: options?.concurrency\n }), out);\n});\n// ----------------------------------------------------------------------------\n// do notation\n// ----------------------------------------------------------------------------\n/**\n * Start a do notation block.\n *\n * @since 3.4.0\n * @experimental\n * @category do notation\n */\nexport const Do = /*#__PURE__*/succeed({});\n/**\n * Bind the success value of this `Micro` effect to the provided name.\n *\n * @since 3.4.0\n * @experimental\n * @category do notation\n */\nexport const bindTo = /*#__PURE__*/doNotation.bindTo(map);\n/**\n * Bind the success value of this `Micro` effect to the provided name.\n *\n * @since 3.4.0\n * @experimental\n * @category do notation\n */\nexport const bind = /*#__PURE__*/doNotation.bind(map, flatMap);\nconst let_ = /*#__PURE__*/doNotation.let_(map);\nexport {\n/**\n * Bind the result of a synchronous computation to the given name.\n *\n * @since 3.4.0\n * @experimental\n * @category do notation\n */\nlet_ as let };\n// ----------------------------------------------------------------------------\n// fibers & forking\n// ----------------------------------------------------------------------------\n/**\n * Run the `Micro` effect in a new `MicroFiber` that can be awaited, joined, or\n * aborted.\n *\n * When the parent `Micro` finishes, this `Micro` will be aborted.\n *\n * @since 3.4.0\n * @experimental\n * @category fiber & forking\n */\nexport const fork = self => withMicroFiber(fiber => {\n fiberMiddleware.interruptChildren ??= fiberInterruptChildren;\n return succeed(unsafeFork(fiber, self));\n});\nconst unsafeFork = (parent, effect, immediate = false, daemon = false) => {\n const child = new MicroFiberImpl(parent.context, parent.interruptible);\n if (!daemon) {\n parent.children().add(child);\n child.addObserver(() => parent.children().delete(child));\n }\n if (immediate) {\n child.evaluate(effect);\n } else {\n parent.getRef(CurrentScheduler).scheduleTask(() => child.evaluate(effect), 0);\n }\n return child;\n};\n/**\n * Run the `Micro` effect in a new `MicroFiber` that can be awaited, joined, or\n * aborted.\n *\n * It will not be aborted when the parent `Micro` finishes.\n *\n * @since 3.4.0\n * @experimental\n * @category fiber & forking\n */\nexport const forkDaemon = self => withMicroFiber(fiber => succeed(unsafeFork(fiber, self, false, true)));\n/**\n * Run the `Micro` effect in a new `MicroFiber` that can be awaited, joined, or\n * aborted.\n *\n * The lifetime of the handle will be attached to the provided `MicroScope`.\n *\n * @since 3.4.0\n * @experimental\n * @category fiber & forking\n */\nexport const forkIn = /*#__PURE__*/dual(2, (self, scope) => uninterruptibleMask(restore => flatMap(scope.fork, scope => tap(restore(forkDaemon(onExit(self, exit => scope.close(exit)))), fiber => scope.addFinalizer(_ => fiberInterrupt(fiber))))));\n/**\n * Run the `Micro` effect in a new `MicroFiber` that can be awaited, joined, or\n * aborted.\n *\n * The lifetime of the handle will be attached to the current `MicroScope`.\n *\n * @since 3.4.0\n * @experimental\n * @category fiber & forking\n */\nexport const forkScoped = self => flatMap(scope, scope => forkIn(self, scope));\n// ----------------------------------------------------------------------------\n// execution\n// ----------------------------------------------------------------------------\n/**\n * Execute the `Micro` effect and return a `MicroFiber` that can be awaited, joined,\n * or aborted.\n *\n * You can listen for the result by adding an observer using the handle's\n * `addObserver` method.\n *\n * @example\n * ```ts\n * import * as Micro from \"effect/Micro\"\n *\n * const handle = Micro.succeed(42).pipe(\n * Micro.delay(1000),\n * Micro.runFork\n * )\n *\n * handle.addObserver((exit) => {\n * console.log(exit)\n * })\n * ```\n *\n * @since 3.4.0\n * @experimental\n * @category execution\n */\nexport const runFork = (effect, options) => {\n const fiber = new MicroFiberImpl(CurrentScheduler.context(options?.scheduler ?? new MicroSchedulerDefault()));\n fiber.evaluate(effect);\n if (options?.signal) {\n if (options.signal.aborted) {\n fiber.unsafeInterrupt();\n } else {\n const abort = () => fiber.unsafeInterrupt();\n options.signal.addEventListener(\"abort\", abort, {\n once: true\n });\n fiber.addObserver(() => options.signal.removeEventListener(\"abort\", abort));\n }\n }\n return fiber;\n};\n/**\n * Execute the `Micro` effect and return a `Promise` that resolves with the\n * `MicroExit` of the computation.\n *\n * @since 3.4.6\n * @experimental\n * @category execution\n */\nexport const runPromiseExit = (effect, options) => new Promise((resolve, _reject) => {\n const handle = runFork(effect, options);\n handle.addObserver(resolve);\n});\n/**\n * Execute the `Micro` effect and return a `Promise` that resolves with the\n * successful value of the computation.\n *\n * @since 3.4.0\n * @experimental\n * @category execution\n */\nexport const runPromise = (effect, options) => runPromiseExit(effect, options).then(exit => {\n if (exit._tag === \"Failure\") {\n throw exit.cause;\n }\n return exit.value;\n});\n/**\n * Attempt to execute the `Micro` effect synchronously and return the `MicroExit`.\n *\n * If any asynchronous effects are encountered, the function will return a\n * `CauseDie` containing the `MicroFiber`.\n *\n * @since 3.4.6\n * @experimental\n * @category execution\n */\nexport const runSyncExit = effect => {\n const scheduler = new MicroSchedulerDefault();\n const fiber = runFork(effect, {\n scheduler\n });\n scheduler.flush();\n return fiber._exit ?? exitDie(fiber);\n};\n/**\n * Attempt to execute the `Micro` effect synchronously and return the success\n * value.\n *\n * @since 3.4.0\n * @experimental\n * @category execution\n */\nexport const runSync = effect => {\n const exit = runSyncExit(effect);\n if (exit._tag === \"Failure\") throw exit.cause;\n return exit.value;\n};\nconst YieldableError = /*#__PURE__*/function () {\n class YieldableError extends globalThis.Error {}\n // @effect-diagnostics-next-line floatingEffect:off\n Object.assign(YieldableError.prototype, MicroProto, StructuralPrototype, {\n [identifier]: \"Failure\",\n [evaluate]() {\n return fail(this);\n },\n toString() {\n return this.message ? `${this.name}: ${this.message}` : this.name;\n },\n toJSON() {\n return {\n ...this\n };\n },\n [NodeInspectSymbol]() {\n const stack = this.stack;\n if (stack) {\n return `${this.toString()}\\n${stack.split(\"\\n\").slice(1).join(\"\\n\")}`;\n }\n return this.toString();\n }\n });\n return YieldableError;\n}();\n/**\n * @since 3.4.0\n * @experimental\n * @category errors\n */\nexport const Error = /*#__PURE__*/function () {\n return class extends YieldableError {\n constructor(args) {\n super();\n if (args) {\n Object.assign(this, args);\n }\n }\n };\n}();\n/**\n * @since 3.4.0\n * @experimental\n * @category errors\n */\nexport const TaggedError = tag => {\n class Base extends Error {\n _tag = tag;\n }\n ;\n Base.prototype.name = tag;\n return Base;\n};\n/**\n * Represents a checked exception which occurs when an expected element was\n * unable to be found.\n *\n * @since 3.4.4\n * @experimental\n * @category errors\n */\nexport class NoSuchElementException extends /*#__PURE__*/TaggedError(\"NoSuchElementException\") {}\n/**\n * Represents a checked exception which occurs when a timeout occurs.\n *\n * @since 3.4.4\n * @experimental\n * @category errors\n */\nexport class TimeoutException extends /*#__PURE__*/TaggedError(\"TimeoutException\") {}\n//# sourceMappingURL=Micro.js.map","/**\n * @since 2.0.0\n */\nimport { dual } from \"./Function.js\";\nimport { globalValue } from \"./GlobalValue.js\";\nimport * as core from \"./internal/core.js\";\n/**\n * @since 2.0.0\n * @category utils\n */\nexport class PriorityBuckets {\n /**\n * @since 2.0.0\n */\n buckets = [];\n /**\n * @since 2.0.0\n */\n scheduleTask(task, priority) {\n const length = this.buckets.length;\n let bucket = undefined;\n let index = 0;\n for (; index < length; index++) {\n if (this.buckets[index][0] <= priority) {\n bucket = this.buckets[index];\n } else {\n break;\n }\n }\n if (bucket && bucket[0] === priority) {\n bucket[1].push(task);\n } else if (index === length) {\n this.buckets.push([priority, [task]]);\n } else {\n this.buckets.splice(index, 0, [priority, [task]]);\n }\n }\n}\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport class MixedScheduler {\n maxNextTickBeforeTimer;\n /**\n * @since 2.0.0\n */\n running = false;\n /**\n * @since 2.0.0\n */\n tasks = /*#__PURE__*/new PriorityBuckets();\n constructor(\n /**\n * @since 2.0.0\n */\n maxNextTickBeforeTimer) {\n this.maxNextTickBeforeTimer = maxNextTickBeforeTimer;\n }\n /**\n * @since 2.0.0\n */\n starveInternal(depth) {\n const tasks = this.tasks.buckets;\n this.tasks.buckets = [];\n for (const [_, toRun] of tasks) {\n for (let i = 0; i < toRun.length; i++) {\n toRun[i]();\n }\n }\n if (this.tasks.buckets.length === 0) {\n this.running = false;\n } else {\n this.starve(depth);\n }\n }\n /**\n * @since 2.0.0\n */\n starve(depth = 0) {\n if (depth >= this.maxNextTickBeforeTimer) {\n setTimeout(() => this.starveInternal(0), 0);\n } else {\n Promise.resolve(void 0).then(() => this.starveInternal(depth + 1));\n }\n }\n /**\n * @since 2.0.0\n */\n shouldYield(fiber) {\n return fiber.currentOpCount > fiber.getFiberRef(core.currentMaxOpsBeforeYield) ? fiber.getFiberRef(core.currentSchedulingPriority) : false;\n }\n /**\n * @since 2.0.0\n */\n scheduleTask(task, priority) {\n this.tasks.scheduleTask(task, priority);\n if (!this.running) {\n this.running = true;\n this.starve();\n }\n }\n}\n/**\n * @since 2.0.0\n * @category schedulers\n */\nexport const defaultScheduler = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Scheduler/defaultScheduler\"), () => new MixedScheduler(2048));\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport class SyncScheduler {\n /**\n * @since 2.0.0\n */\n tasks = /*#__PURE__*/new PriorityBuckets();\n /**\n * @since 2.0.0\n */\n deferred = false;\n /**\n * @since 2.0.0\n */\n scheduleTask(task, priority) {\n if (this.deferred) {\n defaultScheduler.scheduleTask(task, priority);\n } else {\n this.tasks.scheduleTask(task, priority);\n }\n }\n /**\n * @since 2.0.0\n */\n shouldYield(fiber) {\n return fiber.currentOpCount > fiber.getFiberRef(core.currentMaxOpsBeforeYield) ? fiber.getFiberRef(core.currentSchedulingPriority) : false;\n }\n /**\n * @since 2.0.0\n */\n flush() {\n while (this.tasks.buckets.length > 0) {\n const tasks = this.tasks.buckets;\n this.tasks.buckets = [];\n for (const [_, toRun] of tasks) {\n for (let i = 0; i < toRun.length; i++) {\n toRun[i]();\n }\n }\n }\n this.deferred = true;\n }\n}\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport class ControlledScheduler {\n /**\n * @since 2.0.0\n */\n tasks = /*#__PURE__*/new PriorityBuckets();\n /**\n * @since 2.0.0\n */\n deferred = false;\n /**\n * @since 2.0.0\n */\n scheduleTask(task, priority) {\n if (this.deferred) {\n defaultScheduler.scheduleTask(task, priority);\n } else {\n this.tasks.scheduleTask(task, priority);\n }\n }\n /**\n * @since 2.0.0\n */\n shouldYield(fiber) {\n return fiber.currentOpCount > fiber.getFiberRef(core.currentMaxOpsBeforeYield) ? fiber.getFiberRef(core.currentSchedulingPriority) : false;\n }\n /**\n * @since 2.0.0\n */\n step() {\n const tasks = this.tasks.buckets;\n this.tasks.buckets = [];\n for (const [_, toRun] of tasks) {\n for (let i = 0; i < toRun.length; i++) {\n toRun[i]();\n }\n }\n }\n}\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const makeMatrix = (...record) => {\n const index = record.sort(([p0], [p1]) => p0 < p1 ? -1 : p0 > p1 ? 1 : 0);\n return {\n shouldYield(fiber) {\n for (const scheduler of record) {\n const priority = scheduler[1].shouldYield(fiber);\n if (priority !== false) {\n return priority;\n }\n }\n return false;\n },\n scheduleTask(task, priority) {\n let scheduler = undefined;\n for (const i of index) {\n if (priority >= i[0]) {\n scheduler = i[1];\n } else {\n return (scheduler ?? defaultScheduler).scheduleTask(task, priority);\n }\n }\n return (scheduler ?? defaultScheduler).scheduleTask(task, priority);\n }\n };\n};\n/**\n * @since 2.0.0\n * @category utilities\n */\nexport const defaultShouldYield = fiber => {\n return fiber.currentOpCount > fiber.getFiberRef(core.currentMaxOpsBeforeYield) ? fiber.getFiberRef(core.currentSchedulingPriority) : false;\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const make = (scheduleTask, shouldYield = defaultShouldYield) => ({\n scheduleTask,\n shouldYield\n});\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const makeBatched = (callback, shouldYield = defaultShouldYield) => {\n let running = false;\n const tasks = new PriorityBuckets();\n const starveInternal = () => {\n const tasksToRun = tasks.buckets;\n tasks.buckets = [];\n for (const [_, toRun] of tasksToRun) {\n for (let i = 0; i < toRun.length; i++) {\n toRun[i]();\n }\n }\n if (tasks.buckets.length === 0) {\n running = false;\n } else {\n starve();\n }\n };\n const starve = () => callback(starveInternal);\n return make((task, priority) => {\n tasks.scheduleTask(task, priority);\n if (!running) {\n running = true;\n starve();\n }\n }, shouldYield);\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const timer = (ms, shouldYield = defaultShouldYield) => make(task => setTimeout(task, ms), shouldYield);\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const timerBatched = (ms, shouldYield = defaultShouldYield) => makeBatched(task => setTimeout(task, ms), shouldYield);\n/** @internal */\nexport const currentScheduler = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentScheduler\"), () => core.fiberRefUnsafeMake(defaultScheduler));\n/** @internal */\nexport const withScheduler = /*#__PURE__*/dual(2, (self, scheduler) => core.fiberRefLocally(self, currentScheduler, scheduler));\n//# sourceMappingURL=Scheduler.js.map","import { globalValue } from \"../GlobalValue.js\";\nimport { fiberRefUnsafeMake } from \"./core.js\";\n/** @internal */\nexport const currentRequestMap = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentRequestMap\"), () => fiberRefUnsafeMake(new Map()));\n//# sourceMappingURL=completedRequestMap.js.map","import * as core from \"./core.js\";\n/** @internal */\nexport const match = (concurrency, sequential, unbounded, bounded) => {\n switch (concurrency) {\n case undefined:\n return sequential();\n case \"unbounded\":\n return unbounded();\n case \"inherit\":\n return core.fiberRefGetWith(core.currentConcurrency, concurrency => concurrency === \"unbounded\" ? unbounded() : concurrency > 1 ? bounded(concurrency) : sequential());\n default:\n return concurrency > 1 ? bounded(concurrency) : sequential();\n }\n};\n/** @internal */\nexport const matchSimple = (concurrency, sequential, concurrent) => {\n switch (concurrency) {\n case undefined:\n return sequential();\n case \"unbounded\":\n return concurrent();\n case \"inherit\":\n return core.fiberRefGetWith(core.currentConcurrency, concurrency => concurrency === \"unbounded\" || concurrency > 1 ? concurrent() : sequential());\n default:\n return concurrency > 1 ? concurrent() : sequential();\n }\n};\n//# sourceMappingURL=concurrency.js.map","/** @internal */\nexport const OP_INTERRUPT_SIGNAL = \"InterruptSignal\";\n/** @internal */\nexport const OP_STATEFUL = \"Stateful\";\n/** @internal */\nexport const OP_RESUME = \"Resume\";\n/** @internal */\nexport const OP_YIELD_NOW = \"YieldNow\";\n/** @internal */\nexport const interruptSignal = cause => ({\n _tag: OP_INTERRUPT_SIGNAL,\n cause\n});\n/** @internal */\nexport const stateful = onFiber => ({\n _tag: OP_STATEFUL,\n onFiber\n});\n/** @internal */\nexport const resume = effect => ({\n _tag: OP_RESUME,\n effect\n});\n/** @internal */\nexport const yieldNow = () => ({\n _tag: OP_YIELD_NOW\n});\n//# sourceMappingURL=fiberMessage.js.map","import * as FiberId from \"../FiberId.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as FiberMessage from \"./fiberMessage.js\";\n/** @internal */\nconst FiberScopeSymbolKey = \"effect/FiberScope\";\n/** @internal */\nexport const FiberScopeTypeId = /*#__PURE__*/Symbol.for(FiberScopeSymbolKey);\n/** @internal */\nclass Global {\n [FiberScopeTypeId] = FiberScopeTypeId;\n fiberId = FiberId.none;\n roots = /*#__PURE__*/new Set();\n add(_runtimeFlags, child) {\n this.roots.add(child);\n child.addObserver(() => {\n this.roots.delete(child);\n });\n }\n}\n/** @internal */\nclass Local {\n fiberId;\n parent;\n [FiberScopeTypeId] = FiberScopeTypeId;\n constructor(fiberId, parent) {\n this.fiberId = fiberId;\n this.parent = parent;\n }\n add(_runtimeFlags, child) {\n this.parent.tell(FiberMessage.stateful(parentFiber => {\n parentFiber.addChild(child);\n child.addObserver(() => {\n parentFiber.removeChild(child);\n });\n }));\n }\n}\n/** @internal */\nexport const unsafeMake = fiber => {\n return new Local(fiber.id(), fiber);\n};\n/** @internal */\nexport const globalScope = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberScope/Global\"), () => new Global());\n//# sourceMappingURL=fiberScope.js.map","import * as Clock from \"../Clock.js\";\nimport * as Either from \"../Either.js\";\nimport * as Exit from \"../Exit.js\";\nimport * as FiberId from \"../FiberId.js\";\nimport * as FiberStatus from \"../FiberStatus.js\";\nimport { dual, pipe } from \"../Function.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport * as number from \"../Number.js\";\nimport * as Option from \"../Option.js\";\nimport * as order from \"../Order.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as core from \"./core.js\";\nimport * as effectable from \"./effectable.js\";\nimport * as fiberScope from \"./fiberScope.js\";\nimport * as runtimeFlags from \"./runtimeFlags.js\";\n/** @internal */\nconst FiberSymbolKey = \"effect/Fiber\";\n/** @internal */\nexport const FiberTypeId = /*#__PURE__*/Symbol.for(FiberSymbolKey);\n/** @internal */\nexport const fiberVariance = {\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _A: _ => _\n};\n/** @internal */\nconst fiberProto = {\n [FiberTypeId]: fiberVariance,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nconst RuntimeFiberSymbolKey = \"effect/Fiber\";\n/** @internal */\nexport const RuntimeFiberTypeId = /*#__PURE__*/Symbol.for(RuntimeFiberSymbolKey);\n/** @internal */\nexport const Order = /*#__PURE__*/pipe(/*#__PURE__*/order.tuple(number.Order, number.Order), /*#__PURE__*/order.mapInput(fiber => [fiber.id().startTimeMillis, fiber.id().id]));\n/** @internal */\nexport const isFiber = u => hasProperty(u, FiberTypeId);\n/** @internal */\nexport const isRuntimeFiber = self => RuntimeFiberTypeId in self;\n/** @internal */\nexport const _await = self => self.await;\n/** @internal */\nexport const children = self => self.children;\n/** @internal */\nexport const done = exit => {\n const _fiber = {\n ...effectable.CommitPrototype,\n commit() {\n return join(this);\n },\n ...fiberProto,\n id: () => FiberId.none,\n await: core.succeed(exit),\n children: core.succeed([]),\n inheritAll: core.void,\n poll: core.succeed(Option.some(exit)),\n interruptAsFork: () => core.void\n };\n return _fiber;\n};\n/** @internal */\nexport const dump = self => core.map(self.status, status => ({\n id: self.id(),\n status\n}));\n/** @internal */\nexport const dumpAll = fibers => core.forEachSequential(fibers, dump);\n/** @internal */\nexport const fail = error => done(Exit.fail(error));\n/** @internal */\nexport const failCause = cause => done(Exit.failCause(cause));\n/** @internal */\nexport const fromEffect = effect => core.map(core.exit(effect), done);\n/** @internal */\nexport const id = self => self.id();\n/** @internal */\nexport const inheritAll = self => self.inheritAll;\n/** @internal */\nexport const interrupted = fiberId => done(Exit.interrupt(fiberId));\n/** @internal */\nexport const interruptAll = fibers => core.flatMap(core.fiberId, fiberId => pipe(fibers, interruptAllAs(fiberId)));\n/** @internal */\nexport const interruptAllAs = /*#__PURE__*/dual(2, /*#__PURE__*/core.fnUntraced(function* (fibers, fiberId) {\n for (const fiber of fibers) {\n if (isRuntimeFiber(fiber)) {\n fiber.unsafeInterruptAsFork(fiberId);\n continue;\n }\n yield* fiber.interruptAsFork(fiberId);\n }\n for (const fiber of fibers) {\n if (isRuntimeFiber(fiber) && fiber.unsafePoll()) {\n continue;\n }\n yield* fiber.await;\n }\n}));\n/** @internal */\nexport const interruptAsFork = /*#__PURE__*/dual(2, (self, fiberId) => self.interruptAsFork(fiberId));\n/** @internal */\nexport const join = self => core.zipLeft(core.flatten(self.await), self.inheritAll);\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => mapEffect(self, a => core.sync(() => f(a))));\n/** @internal */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => {\n const _fiber = {\n ...effectable.CommitPrototype,\n commit() {\n return join(this);\n },\n ...fiberProto,\n id: () => self.id(),\n await: core.flatMap(self.await, Exit.forEachEffect(f)),\n children: self.children,\n inheritAll: self.inheritAll,\n poll: core.flatMap(self.poll, result => {\n switch (result._tag) {\n case \"None\":\n return core.succeed(Option.none());\n case \"Some\":\n return pipe(Exit.forEachEffect(result.value, f), core.map(Option.some));\n }\n }),\n interruptAsFork: id => self.interruptAsFork(id)\n };\n return _fiber;\n});\n/** @internal */\nexport const mapFiber = /*#__PURE__*/dual(2, (self, f) => core.map(self.await, Exit.match({\n onFailure: cause => failCause(cause),\n onSuccess: a => f(a)\n})));\n/** @internal */\nexport const match = /*#__PURE__*/dual(2, (self, {\n onFiber,\n onRuntimeFiber\n}) => {\n if (isRuntimeFiber(self)) {\n return onRuntimeFiber(self);\n }\n return onFiber(self);\n});\n/** @internal */\nconst _never = {\n ...effectable.CommitPrototype,\n commit() {\n return join(this);\n },\n ...fiberProto,\n id: () => FiberId.none,\n await: core.never,\n children: /*#__PURE__*/core.succeed([]),\n inheritAll: core.never,\n poll: /*#__PURE__*/core.succeed(/*#__PURE__*/Option.none()),\n interruptAsFork: () => core.never\n};\n/** @internal */\nexport const never = _never;\n/** @internal */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => ({\n ...effectable.CommitPrototype,\n commit() {\n return join(this);\n },\n ...fiberProto,\n id: () => FiberId.getOrElse(self.id(), that.id()),\n await: core.zipWith(self.await, that.await, (exit1, exit2) => Exit.isSuccess(exit1) ? exit1 : exit2),\n children: self.children,\n inheritAll: core.zipRight(that.inheritAll, self.inheritAll),\n poll: core.zipWith(self.poll, that.poll, (option1, option2) => {\n switch (option1._tag) {\n case \"None\":\n {\n return Option.none();\n }\n case \"Some\":\n {\n return Exit.isSuccess(option1.value) ? option1 : option2;\n }\n }\n }),\n interruptAsFork: id => pipe(core.interruptAsFiber(self, id), core.zipRight(pipe(that, core.interruptAsFiber(id))), core.asVoid)\n}));\n/** @internal */\nexport const orElseEither = /*#__PURE__*/dual(2, (self, that) => orElse(map(self, Either.left), map(that, Either.right)));\n/** @internal */\nexport const poll = self => self.poll;\n// forked from https://github.com/sindresorhus/parse-ms/blob/4da2ffbdba02c6e288c08236695bdece0adca173/index.js\n// MIT License\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)\n/** @internal */\nconst parseMs = milliseconds => {\n const roundTowardsZero = milliseconds > 0 ? Math.floor : Math.ceil;\n return {\n days: roundTowardsZero(milliseconds / 86400000),\n hours: roundTowardsZero(milliseconds / 3600000) % 24,\n minutes: roundTowardsZero(milliseconds / 60000) % 60,\n seconds: roundTowardsZero(milliseconds / 1000) % 60,\n milliseconds: roundTowardsZero(milliseconds) % 1000,\n microseconds: roundTowardsZero(milliseconds * 1000) % 1000,\n nanoseconds: roundTowardsZero(milliseconds * 1e6) % 1000\n };\n};\n/** @internal */\nconst renderStatus = status => {\n if (FiberStatus.isDone(status)) {\n return \"Done\";\n }\n if (FiberStatus.isRunning(status)) {\n return \"Running\";\n }\n const isInterruptible = runtimeFlags.interruptible(status.runtimeFlags) ? \"interruptible\" : \"uninterruptible\";\n return `Suspended(${isInterruptible})`;\n};\n/** @internal */\nexport const pretty = self => core.flatMap(Clock.currentTimeMillis, now => core.map(dump(self), dump => {\n const time = now - dump.id.startTimeMillis;\n const {\n days,\n hours,\n milliseconds,\n minutes,\n seconds\n } = parseMs(time);\n const lifeMsg = (days === 0 ? \"\" : `${days}d`) + (days === 0 && hours === 0 ? \"\" : `${hours}h`) + (days === 0 && hours === 0 && minutes === 0 ? \"\" : `${minutes}m`) + (days === 0 && hours === 0 && minutes === 0 && seconds === 0 ? \"\" : `${seconds}s`) + `${milliseconds}ms`;\n const waitMsg = FiberStatus.isSuspended(dump.status) ? (() => {\n const ids = FiberId.ids(dump.status.blockingOn);\n return HashSet.size(ids) > 0 ? `waiting on ` + Array.from(ids).map(id => `${id}`).join(\", \") : \"\";\n })() : \"\";\n const statusMsg = renderStatus(dump.status);\n return `[Fiber](#${dump.id.id}) (${lifeMsg}) ${waitMsg}\\n Status: ${statusMsg}`;\n}));\n/** @internal */\nexport const unsafeRoots = () => Array.from(fiberScope.globalScope.roots);\n/** @internal */\nexport const roots = /*#__PURE__*/core.sync(unsafeRoots);\n/** @internal */\nexport const status = self => self.status;\n/** @internal */\nexport const succeed = value => done(Exit.succeed(value));\nconst void_ = /*#__PURE__*/succeed(void 0);\nexport { /** @internal */\nvoid_ as void };\n/** @internal */\nexport const currentFiberURI = \"effect/FiberCurrent\";\n/** @internal */\nexport const getCurrentFiber = () => Option.fromNullable(globalThis[currentFiberURI]);\n//# sourceMappingURL=fiber.js.map","import * as Arr from \"../Array.js\";\nimport * as Context from \"../Context.js\";\nimport * as FiberRefs from \"../FiberRefs.js\";\nimport { constVoid, dual } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport * as Inspectable from \"../Inspectable.js\";\nimport * as List from \"../List.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as Cause from \"./cause.js\";\nimport * as defaultServices from \"./defaultServices.js\";\nimport { consoleTag } from \"./defaultServices/console.js\";\nimport * as fiberId_ from \"./fiberId.js\";\nimport * as logSpan_ from \"./logSpan.js\";\n/** @internal */\nconst LoggerSymbolKey = \"effect/Logger\";\n/** @internal */\nexport const LoggerTypeId = /*#__PURE__*/Symbol.for(LoggerSymbolKey);\nconst loggerVariance = {\n /* c8 ignore next */\n _Message: _ => _,\n /* c8 ignore next */\n _Output: _ => _\n};\n/** @internal */\nexport const makeLogger = log => ({\n [LoggerTypeId]: loggerVariance,\n log,\n pipe() {\n return pipeArguments(this, arguments);\n }\n});\n/** @internal */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => makeLogger(options => self.log({\n ...options,\n message: f(options.message)\n})));\n/** @internal */\nexport const mapInputOptions = /*#__PURE__*/dual(2, (self, f) => makeLogger(options => self.log(f(options))));\n/** @internal */\nexport const filterLogLevel = /*#__PURE__*/dual(2, (self, f) => makeLogger(options => f(options.logLevel) ? Option.some(self.log(options)) : Option.none()));\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => makeLogger(options => f(self.log(options))));\n/** @internal */\nexport const none = {\n [LoggerTypeId]: loggerVariance,\n log: constVoid,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nexport const simple = log => ({\n [LoggerTypeId]: loggerVariance,\n log: ({\n message\n }) => log(message),\n pipe() {\n return pipeArguments(this, arguments);\n }\n});\n/** @internal */\nexport const succeed = value => {\n return simple(() => value);\n};\n/** @internal */\nexport const sync = evaluate => {\n return simple(evaluate);\n};\n/** @internal */\nexport const zip = /*#__PURE__*/dual(2, (self, that) => makeLogger(options => [self.log(options), that.log(options)]));\n/** @internal */\nexport const zipLeft = /*#__PURE__*/dual(2, (self, that) => map(zip(self, that), tuple => tuple[0]));\n/** @internal */\nexport const zipRight = /*#__PURE__*/dual(2, (self, that) => map(zip(self, that), tuple => tuple[1]));\n/**\n * Match strings that do not contain any whitespace characters, double quotes,\n * or equal signs.\n *\n * @internal\n */\nconst textOnly = /^[^\\s\"=]*$/;\n/**\n * Used by both {@link stringLogger} and {@link logfmtLogger} to render a log\n * message.\n *\n * @internal\n */\nconst format = (quoteValue, whitespace) => ({\n annotations,\n cause,\n date,\n fiberId,\n logLevel,\n message,\n spans\n}) => {\n const formatValue = value => value.match(textOnly) ? value : quoteValue(value);\n const format = (label, value) => `${logSpan_.formatLabel(label)}=${formatValue(value)}`;\n const append = (label, value) => \" \" + format(label, value);\n let out = format(\"timestamp\", date.toISOString());\n out += append(\"level\", logLevel.label);\n out += append(\"fiber\", fiberId_.threadName(fiberId));\n const messages = Arr.ensure(message);\n for (let i = 0; i < messages.length; i++) {\n out += append(\"message\", Inspectable.toStringUnknown(messages[i], whitespace));\n }\n if (!Cause.isEmptyType(cause)) {\n out += append(\"cause\", Cause.pretty(cause, {\n renderErrorCause: true\n }));\n }\n for (const span of spans) {\n out += \" \" + logSpan_.render(date.getTime())(span);\n }\n for (const [label, value] of annotations) {\n out += append(label, Inspectable.toStringUnknown(value, whitespace));\n }\n return out;\n};\n/** @internal */\nconst escapeDoubleQuotes = s => `\"${s.replace(/\\\\([\\s\\S])|(\")/g, \"\\\\$1$2\")}\"`;\n/** @internal */\nexport const stringLogger = /*#__PURE__*/makeLogger(/*#__PURE__*/format(escapeDoubleQuotes));\n/** @internal */\nexport const logfmtLogger = /*#__PURE__*/makeLogger(/*#__PURE__*/format(JSON.stringify, 0));\n/** @internal */\nexport const structuredLogger = /*#__PURE__*/makeLogger(({\n annotations,\n cause,\n date,\n fiberId,\n logLevel,\n message,\n spans\n}) => {\n const now = date.getTime();\n const annotationsObj = {};\n const spansObj = {};\n if (HashMap.size(annotations) > 0) {\n for (const [k, v] of annotations) {\n annotationsObj[k] = structuredMessage(v);\n }\n }\n if (List.isCons(spans)) {\n for (const span of spans) {\n spansObj[span.label] = now - span.startTime;\n }\n }\n const messageArr = Arr.ensure(message);\n return {\n message: messageArr.length === 1 ? structuredMessage(messageArr[0]) : messageArr.map(structuredMessage),\n logLevel: logLevel.label,\n timestamp: date.toISOString(),\n cause: Cause.isEmpty(cause) ? undefined : Cause.pretty(cause, {\n renderErrorCause: true\n }),\n annotations: annotationsObj,\n spans: spansObj,\n fiberId: fiberId_.threadName(fiberId)\n };\n});\n/** @internal */\nexport const structuredMessage = u => {\n switch (typeof u) {\n case \"bigint\":\n case \"function\":\n case \"symbol\":\n {\n return String(u);\n }\n default:\n {\n return Inspectable.toJSON(u);\n }\n }\n};\n/** @internal */\nexport const jsonLogger = /*#__PURE__*/map(structuredLogger, Inspectable.stringifyCircular);\n/** @internal */\nexport const isLogger = u => {\n return typeof u === \"object\" && u != null && LoggerTypeId in u;\n};\nconst withColor = (text, ...colors) => {\n let out = \"\";\n for (let i = 0; i < colors.length; i++) {\n out += `\\x1b[${colors[i]}m`;\n }\n return out + text + \"\\x1b[0m\";\n};\nconst withColorNoop = (text, ..._colors) => text;\nconst colors = {\n bold: \"1\",\n red: \"31\",\n green: \"32\",\n yellow: \"33\",\n blue: \"34\",\n cyan: \"36\",\n white: \"37\",\n gray: \"90\",\n black: \"30\",\n bgBrightRed: \"101\"\n};\nconst logLevelColors = {\n None: [],\n All: [],\n Trace: [colors.gray],\n Debug: [colors.blue],\n Info: [colors.green],\n Warning: [colors.yellow],\n Error: [colors.red],\n Fatal: [colors.bgBrightRed, colors.black]\n};\nconst logLevelStyle = {\n None: \"\",\n All: \"\",\n Trace: \"color:gray\",\n Debug: \"color:blue\",\n Info: \"color:green\",\n Warning: \"color:orange\",\n Error: \"color:red\",\n Fatal: \"background-color:red;color:white\"\n};\nconst defaultDateFormat = date => `${date.getHours().toString().padStart(2, \"0\")}:${date.getMinutes().toString().padStart(2, \"0\")}:${date.getSeconds().toString().padStart(2, \"0\")}.${date.getMilliseconds().toString().padStart(3, \"0\")}`;\nconst hasProcessStdout = typeof process === \"object\" && process !== null && typeof process.stdout === \"object\" && process.stdout !== null;\nconst processStdoutIsTTY = hasProcessStdout && process.stdout.isTTY === true;\nconst hasProcessStdoutOrDeno = hasProcessStdout || \"Deno\" in globalThis;\n/** @internal */\nexport const prettyLogger = options => {\n const mode_ = options?.mode ?? \"auto\";\n const mode = mode_ === \"auto\" ? hasProcessStdoutOrDeno ? \"tty\" : \"browser\" : mode_;\n const isBrowser = mode === \"browser\";\n const showColors = typeof options?.colors === \"boolean\" ? options.colors : processStdoutIsTTY || isBrowser;\n const formatDate = options?.formatDate ?? defaultDateFormat;\n return isBrowser ? prettyLoggerBrowser({\n colors: showColors,\n formatDate\n }) : prettyLoggerTty({\n colors: showColors,\n formatDate,\n stderr: options?.stderr === true\n });\n};\nconst prettyLoggerTty = options => {\n const color = options.colors ? withColor : withColorNoop;\n return makeLogger(({\n annotations,\n cause,\n context,\n date,\n fiberId,\n logLevel,\n message: message_,\n spans\n }) => {\n const services = FiberRefs.getOrDefault(context, defaultServices.currentServices);\n const console = Context.get(services, consoleTag).unsafe;\n const log = options.stderr === true ? console.error : console.log;\n const message = Arr.ensure(message_);\n let firstLine = color(`[${options.formatDate(date)}]`, colors.white) + ` ${color(logLevel.label, ...logLevelColors[logLevel._tag])}` + ` (${fiberId_.threadName(fiberId)})`;\n if (List.isCons(spans)) {\n const now = date.getTime();\n const render = logSpan_.render(now);\n for (const span of spans) {\n firstLine += \" \" + render(span);\n }\n }\n firstLine += \":\";\n let messageIndex = 0;\n if (message.length > 0) {\n const firstMaybeString = structuredMessage(message[0]);\n if (typeof firstMaybeString === \"string\") {\n firstLine += \" \" + color(firstMaybeString, colors.bold, colors.cyan);\n messageIndex++;\n }\n }\n log(firstLine);\n console.group();\n if (!Cause.isEmpty(cause)) {\n log(Cause.pretty(cause, {\n renderErrorCause: true\n }));\n }\n if (messageIndex < message.length) {\n for (; messageIndex < message.length; messageIndex++) {\n log(Inspectable.redact(message[messageIndex]));\n }\n }\n if (HashMap.size(annotations) > 0) {\n for (const [key, value] of annotations) {\n log(color(`${key}:`, colors.bold, colors.white), Inspectable.redact(value));\n }\n }\n console.groupEnd();\n });\n};\nconst prettyLoggerBrowser = options => {\n const color = options.colors ? \"%c\" : \"\";\n return makeLogger(({\n annotations,\n cause,\n context,\n date,\n fiberId,\n logLevel,\n message: message_,\n spans\n }) => {\n const services = FiberRefs.getOrDefault(context, defaultServices.currentServices);\n const console = Context.get(services, consoleTag).unsafe;\n const message = Arr.ensure(message_);\n let firstLine = `${color}[${options.formatDate(date)}]`;\n const firstParams = [];\n if (options.colors) {\n firstParams.push(\"color:gray\");\n }\n firstLine += ` ${color}${logLevel.label}${color} (${fiberId_.threadName(fiberId)})`;\n if (options.colors) {\n firstParams.push(logLevelStyle[logLevel._tag], \"\");\n }\n if (List.isCons(spans)) {\n const now = date.getTime();\n const render = logSpan_.render(now);\n for (const span of spans) {\n firstLine += \" \" + render(span);\n }\n }\n firstLine += \":\";\n let messageIndex = 0;\n if (message.length > 0) {\n const firstMaybeString = structuredMessage(message[0]);\n if (typeof firstMaybeString === \"string\") {\n firstLine += ` ${color}${firstMaybeString}`;\n if (options.colors) {\n firstParams.push(\"color:deepskyblue\");\n }\n messageIndex++;\n }\n }\n console.groupCollapsed(firstLine, ...firstParams);\n if (!Cause.isEmpty(cause)) {\n console.error(Cause.pretty(cause, {\n renderErrorCause: true\n }));\n }\n if (messageIndex < message.length) {\n for (; messageIndex < message.length; messageIndex++) {\n console.log(Inspectable.redact(message[messageIndex]));\n }\n }\n if (HashMap.size(annotations) > 0) {\n for (const [key, value] of annotations) {\n const redacted = Inspectable.redact(value);\n if (options.colors) {\n console.log(`%c${key}:`, \"color:gray\", redacted);\n } else {\n console.log(`${key}:`, redacted);\n }\n }\n }\n console.groupEnd();\n });\n};\n/** @internal */\nexport const prettyLoggerDefault = /*#__PURE__*/globalValue(\"effect/Logger/prettyLoggerDefault\", () => prettyLogger());\n//# sourceMappingURL=logger.js.map","import * as Arr from \"../../Array.js\";\nimport * as Chunk from \"../../Chunk.js\";\nimport * as Equal from \"../../Equal.js\";\nimport { pipe } from \"../../Function.js\";\nimport * as Hash from \"../../Hash.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport { hasProperty } from \"../../Predicate.js\";\n/** @internal */\nconst MetricBoundariesSymbolKey = \"effect/MetricBoundaries\";\n/** @internal */\nexport const MetricBoundariesTypeId = /*#__PURE__*/Symbol.for(MetricBoundariesSymbolKey);\n/** @internal */\nclass MetricBoundariesImpl {\n values;\n [MetricBoundariesTypeId] = MetricBoundariesTypeId;\n constructor(values) {\n this.values = values;\n this._hash = pipe(Hash.string(MetricBoundariesSymbolKey), Hash.combine(Hash.array(this.values)));\n }\n _hash;\n [Hash.symbol]() {\n return this._hash;\n }\n [Equal.symbol](u) {\n return isMetricBoundaries(u) && Equal.equals(this.values, u.values);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const isMetricBoundaries = u => hasProperty(u, MetricBoundariesTypeId);\n/** @internal */\nexport const fromIterable = iterable => {\n const values = pipe(iterable, Arr.appendAll(Chunk.of(Number.POSITIVE_INFINITY)), Arr.dedupe);\n return new MetricBoundariesImpl(values);\n};\n/** @internal */\nexport const linear = options => pipe(Arr.makeBy(options.count - 1, i => options.start + i * options.width), Chunk.unsafeFromArray, fromIterable);\n/** @internal */\nexport const exponential = options => pipe(Arr.makeBy(options.count - 1, i => options.start * Math.pow(options.factor, i)), Chunk.unsafeFromArray, fromIterable);\n//# sourceMappingURL=boundaries.js.map","import * as Duration from \"../../Duration.js\";\nimport * as Equal from \"../../Equal.js\";\nimport { pipe } from \"../../Function.js\";\nimport * as Hash from \"../../Hash.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport { hasProperty } from \"../../Predicate.js\";\n/** @internal */\nconst MetricKeyTypeSymbolKey = \"effect/MetricKeyType\";\n/** @internal */\nexport const MetricKeyTypeTypeId = /*#__PURE__*/Symbol.for(MetricKeyTypeSymbolKey);\n/** @internal */\nconst CounterKeyTypeSymbolKey = \"effect/MetricKeyType/Counter\";\n/** @internal */\nexport const CounterKeyTypeTypeId = /*#__PURE__*/Symbol.for(CounterKeyTypeSymbolKey);\n/** @internal */\nconst FrequencyKeyTypeSymbolKey = \"effect/MetricKeyType/Frequency\";\n/** @internal */\nexport const FrequencyKeyTypeTypeId = /*#__PURE__*/Symbol.for(FrequencyKeyTypeSymbolKey);\n/** @internal */\nconst GaugeKeyTypeSymbolKey = \"effect/MetricKeyType/Gauge\";\n/** @internal */\nexport const GaugeKeyTypeTypeId = /*#__PURE__*/Symbol.for(GaugeKeyTypeSymbolKey);\n/** @internal */\nconst HistogramKeyTypeSymbolKey = \"effect/MetricKeyType/Histogram\";\n/** @internal */\nexport const HistogramKeyTypeTypeId = /*#__PURE__*/Symbol.for(HistogramKeyTypeSymbolKey);\n/** @internal */\nconst SummaryKeyTypeSymbolKey = \"effect/MetricKeyType/Summary\";\n/** @internal */\nexport const SummaryKeyTypeTypeId = /*#__PURE__*/Symbol.for(SummaryKeyTypeSymbolKey);\nconst metricKeyTypeVariance = {\n /* c8 ignore next */\n _In: _ => _,\n /* c8 ignore next */\n _Out: _ => _\n};\n/** @internal */\nclass CounterKeyType {\n incremental;\n bigint;\n [MetricKeyTypeTypeId] = metricKeyTypeVariance;\n [CounterKeyTypeTypeId] = CounterKeyTypeTypeId;\n constructor(incremental, bigint) {\n this.incremental = incremental;\n this.bigint = bigint;\n this._hash = Hash.string(CounterKeyTypeSymbolKey);\n }\n _hash;\n [Hash.symbol]() {\n return this._hash;\n }\n [Equal.symbol](that) {\n return isCounterKey(that);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\nconst FrequencyKeyTypeHash = /*#__PURE__*/Hash.string(FrequencyKeyTypeSymbolKey);\n/** @internal */\nclass FrequencyKeyType {\n preregisteredWords;\n [MetricKeyTypeTypeId] = metricKeyTypeVariance;\n [FrequencyKeyTypeTypeId] = FrequencyKeyTypeTypeId;\n constructor(preregisteredWords) {\n this.preregisteredWords = preregisteredWords;\n }\n [Hash.symbol]() {\n return FrequencyKeyTypeHash;\n }\n [Equal.symbol](that) {\n return isFrequencyKey(that);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\nconst GaugeKeyTypeHash = /*#__PURE__*/Hash.string(GaugeKeyTypeSymbolKey);\n/** @internal */\nclass GaugeKeyType {\n bigint;\n [MetricKeyTypeTypeId] = metricKeyTypeVariance;\n [GaugeKeyTypeTypeId] = GaugeKeyTypeTypeId;\n constructor(bigint) {\n this.bigint = bigint;\n }\n [Hash.symbol]() {\n return GaugeKeyTypeHash;\n }\n [Equal.symbol](that) {\n return isGaugeKey(that);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport class HistogramKeyType {\n boundaries;\n [MetricKeyTypeTypeId] = metricKeyTypeVariance;\n [HistogramKeyTypeTypeId] = HistogramKeyTypeTypeId;\n constructor(boundaries) {\n this.boundaries = boundaries;\n this._hash = pipe(Hash.string(HistogramKeyTypeSymbolKey), Hash.combine(Hash.hash(this.boundaries)));\n }\n _hash;\n [Hash.symbol]() {\n return this._hash;\n }\n [Equal.symbol](that) {\n return isHistogramKey(that) && Equal.equals(this.boundaries, that.boundaries);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nclass SummaryKeyType {\n maxAge;\n maxSize;\n error;\n quantiles;\n [MetricKeyTypeTypeId] = metricKeyTypeVariance;\n [SummaryKeyTypeTypeId] = SummaryKeyTypeTypeId;\n constructor(maxAge, maxSize, error, quantiles) {\n this.maxAge = maxAge;\n this.maxSize = maxSize;\n this.error = error;\n this.quantiles = quantiles;\n this._hash = pipe(Hash.string(SummaryKeyTypeSymbolKey), Hash.combine(Hash.hash(this.maxAge)), Hash.combine(Hash.hash(this.maxSize)), Hash.combine(Hash.hash(this.error)), Hash.combine(Hash.array(this.quantiles)));\n }\n _hash;\n [Hash.symbol]() {\n return this._hash;\n }\n [Equal.symbol](that) {\n return isSummaryKey(that) && Equal.equals(this.maxAge, that.maxAge) && this.maxSize === that.maxSize && this.error === that.error && Equal.equals(this.quantiles, that.quantiles);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const counter = options => new CounterKeyType(options?.incremental ?? false, options?.bigint ?? false);\n/** @internal */\nexport const frequency = options => new FrequencyKeyType(options?.preregisteredWords ?? []);\n/** @internal */\nexport const gauge = options => new GaugeKeyType(options?.bigint ?? false);\n/** @internal */\nexport const histogram = boundaries => {\n return new HistogramKeyType(boundaries);\n};\n/** @internal */\nexport const summary = options => {\n return new SummaryKeyType(Duration.decode(options.maxAge), options.maxSize, options.error, options.quantiles);\n};\n/** @internal */\nexport const isMetricKeyType = u => hasProperty(u, MetricKeyTypeTypeId);\n/** @internal */\nexport const isCounterKey = u => hasProperty(u, CounterKeyTypeTypeId);\n/** @internal */\nexport const isFrequencyKey = u => hasProperty(u, FrequencyKeyTypeTypeId);\n/** @internal */\nexport const isGaugeKey = u => hasProperty(u, GaugeKeyTypeTypeId);\n/** @internal */\nexport const isHistogramKey = u => hasProperty(u, HistogramKeyTypeTypeId);\n/** @internal */\nexport const isSummaryKey = u => hasProperty(u, SummaryKeyTypeTypeId);\n//# sourceMappingURL=keyType.js.map","import * as Arr from \"../../Array.js\";\nimport * as Equal from \"../../Equal.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as Hash from \"../../Hash.js\";\nimport * as Option from \"../../Option.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport { hasProperty } from \"../../Predicate.js\";\nimport * as metricKeyType from \"./keyType.js\";\nimport * as metricLabel from \"./label.js\";\n/** @internal */\nconst MetricKeySymbolKey = \"effect/MetricKey\";\n/** @internal */\nexport const MetricKeyTypeId = /*#__PURE__*/Symbol.for(MetricKeySymbolKey);\nconst metricKeyVariance = {\n /* c8 ignore next */\n _Type: _ => _\n};\nconst arrayEquivilence = /*#__PURE__*/Arr.getEquivalence(Equal.equals);\n/** @internal */\nclass MetricKeyImpl {\n name;\n keyType;\n description;\n tags;\n [MetricKeyTypeId] = metricKeyVariance;\n constructor(name, keyType, description, tags = []) {\n this.name = name;\n this.keyType = keyType;\n this.description = description;\n this.tags = tags;\n this._hash = pipe(Hash.string(this.name + this.description), Hash.combine(Hash.hash(this.keyType)), Hash.combine(Hash.array(this.tags)));\n }\n _hash;\n [Hash.symbol]() {\n return this._hash;\n }\n [Equal.symbol](u) {\n return isMetricKey(u) && this.name === u.name && Equal.equals(this.keyType, u.keyType) && Equal.equals(this.description, u.description) && arrayEquivilence(this.tags, u.tags);\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const isMetricKey = u => hasProperty(u, MetricKeyTypeId);\n/** @internal */\nexport const counter = (name, options) => new MetricKeyImpl(name, metricKeyType.counter(options), Option.fromNullable(options?.description));\n/** @internal */\nexport const frequency = (name, options) => new MetricKeyImpl(name, metricKeyType.frequency(options), Option.fromNullable(options?.description));\n/** @internal */\nexport const gauge = (name, options) => new MetricKeyImpl(name, metricKeyType.gauge(options), Option.fromNullable(options?.description));\n/** @internal */\nexport const histogram = (name, boundaries, description) => new MetricKeyImpl(name, metricKeyType.histogram(boundaries), Option.fromNullable(description));\n/** @internal */\nexport const summary = options => new MetricKeyImpl(options.name, metricKeyType.summary(options), Option.fromNullable(options.description));\n/** @internal */\nexport const tagged = /*#__PURE__*/dual(3, (self, key, value) => taggedWithLabels(self, [metricLabel.make(key, value)]));\n/** @internal */\nexport const taggedWithLabels = /*#__PURE__*/dual(2, (self, extraTags) => extraTags.length === 0 ? self : new MetricKeyImpl(self.name, self.keyType, self.description, Arr.union(self.tags, extraTags)));\n//# sourceMappingURL=key.js.map","import * as Arr from \"../../Array.js\";\nimport * as Equal from \"../../Equal.js\";\nimport { pipe } from \"../../Function.js\";\nimport * as Hash from \"../../Hash.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport { hasProperty } from \"../../Predicate.js\";\n/** @internal */\nconst MetricStateSymbolKey = \"effect/MetricState\";\n/** @internal */\nexport const MetricStateTypeId = /*#__PURE__*/Symbol.for(MetricStateSymbolKey);\n/** @internal */\nconst CounterStateSymbolKey = \"effect/MetricState/Counter\";\n/** @internal */\nexport const CounterStateTypeId = /*#__PURE__*/Symbol.for(CounterStateSymbolKey);\n/** @internal */\nconst FrequencyStateSymbolKey = \"effect/MetricState/Frequency\";\n/** @internal */\nexport const FrequencyStateTypeId = /*#__PURE__*/Symbol.for(FrequencyStateSymbolKey);\n/** @internal */\nconst GaugeStateSymbolKey = \"effect/MetricState/Gauge\";\n/** @internal */\nexport const GaugeStateTypeId = /*#__PURE__*/Symbol.for(GaugeStateSymbolKey);\n/** @internal */\nconst HistogramStateSymbolKey = \"effect/MetricState/Histogram\";\n/** @internal */\nexport const HistogramStateTypeId = /*#__PURE__*/Symbol.for(HistogramStateSymbolKey);\n/** @internal */\nconst SummaryStateSymbolKey = \"effect/MetricState/Summary\";\n/** @internal */\nexport const SummaryStateTypeId = /*#__PURE__*/Symbol.for(SummaryStateSymbolKey);\nconst metricStateVariance = {\n /* c8 ignore next */\n _A: _ => _\n};\n/** @internal */\nclass CounterState {\n count;\n [MetricStateTypeId] = metricStateVariance;\n [CounterStateTypeId] = CounterStateTypeId;\n constructor(count) {\n this.count = count;\n }\n [Hash.symbol]() {\n return pipe(Hash.hash(CounterStateSymbolKey), Hash.combine(Hash.hash(this.count)), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isCounterState(that) && this.count === that.count;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\nconst arrayEquals = /*#__PURE__*/Arr.getEquivalence(Equal.equals);\n/** @internal */\nclass FrequencyState {\n occurrences;\n [MetricStateTypeId] = metricStateVariance;\n [FrequencyStateTypeId] = FrequencyStateTypeId;\n constructor(occurrences) {\n this.occurrences = occurrences;\n }\n _hash;\n [Hash.symbol]() {\n return pipe(Hash.string(FrequencyStateSymbolKey), Hash.combine(Hash.array(Arr.fromIterable(this.occurrences.entries()))), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isFrequencyState(that) && arrayEquals(Arr.fromIterable(this.occurrences.entries()), Arr.fromIterable(that.occurrences.entries()));\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nclass GaugeState {\n value;\n [MetricStateTypeId] = metricStateVariance;\n [GaugeStateTypeId] = GaugeStateTypeId;\n constructor(value) {\n this.value = value;\n }\n [Hash.symbol]() {\n return pipe(Hash.hash(GaugeStateSymbolKey), Hash.combine(Hash.hash(this.value)), Hash.cached(this));\n }\n [Equal.symbol](u) {\n return isGaugeState(u) && this.value === u.value;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport class HistogramState {\n buckets;\n count;\n min;\n max;\n sum;\n [MetricStateTypeId] = metricStateVariance;\n [HistogramStateTypeId] = HistogramStateTypeId;\n constructor(buckets, count, min, max, sum) {\n this.buckets = buckets;\n this.count = count;\n this.min = min;\n this.max = max;\n this.sum = sum;\n }\n [Hash.symbol]() {\n return pipe(Hash.hash(HistogramStateSymbolKey), Hash.combine(Hash.hash(this.buckets)), Hash.combine(Hash.hash(this.count)), Hash.combine(Hash.hash(this.min)), Hash.combine(Hash.hash(this.max)), Hash.combine(Hash.hash(this.sum)), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isHistogramState(that) && Equal.equals(this.buckets, that.buckets) && this.count === that.count && this.min === that.min && this.max === that.max && this.sum === that.sum;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport class SummaryState {\n error;\n quantiles;\n count;\n min;\n max;\n sum;\n [MetricStateTypeId] = metricStateVariance;\n [SummaryStateTypeId] = SummaryStateTypeId;\n constructor(error, quantiles, count, min, max, sum) {\n this.error = error;\n this.quantiles = quantiles;\n this.count = count;\n this.min = min;\n this.max = max;\n this.sum = sum;\n }\n [Hash.symbol]() {\n return pipe(Hash.hash(SummaryStateSymbolKey), Hash.combine(Hash.hash(this.error)), Hash.combine(Hash.hash(this.quantiles)), Hash.combine(Hash.hash(this.count)), Hash.combine(Hash.hash(this.min)), Hash.combine(Hash.hash(this.max)), Hash.combine(Hash.hash(this.sum)), Hash.cached(this));\n }\n [Equal.symbol](that) {\n return isSummaryState(that) && this.error === that.error && Equal.equals(this.quantiles, that.quantiles) && this.count === that.count && this.min === that.min && this.max === that.max && this.sum === that.sum;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const counter = count => new CounterState(count);\n/** @internal */\nexport const frequency = occurrences => {\n return new FrequencyState(occurrences);\n};\n/** @internal */\nexport const gauge = count => new GaugeState(count);\n/** @internal */\nexport const histogram = options => new HistogramState(options.buckets, options.count, options.min, options.max, options.sum);\n/** @internal */\nexport const summary = options => new SummaryState(options.error, options.quantiles, options.count, options.min, options.max, options.sum);\n/** @internal */\nexport const isMetricState = u => hasProperty(u, MetricStateTypeId);\n/** @internal */\nexport const isCounterState = u => hasProperty(u, CounterStateTypeId);\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isFrequencyState = u => hasProperty(u, FrequencyStateTypeId);\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isGaugeState = u => hasProperty(u, GaugeStateTypeId);\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isHistogramState = u => hasProperty(u, HistogramStateTypeId);\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isSummaryState = u => hasProperty(u, SummaryStateTypeId);\n//# sourceMappingURL=state.js.map","import * as Arr from \"../../Array.js\";\nimport * as Duration from \"../../Duration.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as number from \"../../Number.js\";\nimport * as Option from \"../../Option.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport * as metricState from \"./state.js\";\n/** @internal */\nconst MetricHookSymbolKey = \"effect/MetricHook\";\n/** @internal */\nexport const MetricHookTypeId = /*#__PURE__*/Symbol.for(MetricHookSymbolKey);\nconst metricHookVariance = {\n /* c8 ignore next */\n _In: _ => _,\n /* c8 ignore next */\n _Out: _ => _\n};\n/** @internal */\nexport const make = options => ({\n [MetricHookTypeId]: metricHookVariance,\n pipe() {\n return pipeArguments(this, arguments);\n },\n ...options\n});\n/** @internal */\nexport const onModify = /*#__PURE__*/dual(2, (self, f) => ({\n [MetricHookTypeId]: metricHookVariance,\n pipe() {\n return pipeArguments(this, arguments);\n },\n get: self.get,\n update: self.update,\n modify: input => {\n self.modify(input);\n return f(input);\n }\n}));\n/** @internal */\nexport const onUpdate = /*#__PURE__*/dual(2, (self, f) => ({\n [MetricHookTypeId]: metricHookVariance,\n pipe() {\n return pipeArguments(this, arguments);\n },\n get: self.get,\n update: input => {\n self.update(input);\n return f(input);\n },\n modify: self.modify\n}));\nconst bigint0 = /*#__PURE__*/BigInt(0);\n/** @internal */\nexport const counter = key => {\n let sum = key.keyType.bigint ? bigint0 : 0;\n const canUpdate = key.keyType.incremental ? key.keyType.bigint ? value => value >= bigint0 : value => value >= 0 : _value => true;\n const update = value => {\n if (canUpdate(value)) {\n sum = sum + value;\n }\n };\n return make({\n get: () => metricState.counter(sum),\n update,\n modify: update\n });\n};\n/** @internal */\nexport const frequency = key => {\n const values = new Map();\n for (const word of key.keyType.preregisteredWords) {\n values.set(word, 0);\n }\n const update = word => {\n const slotCount = values.get(word) ?? 0;\n values.set(word, slotCount + 1);\n };\n return make({\n get: () => metricState.frequency(values),\n update,\n modify: update\n });\n};\n/** @internal */\nexport const gauge = (_key, startAt) => {\n let value = startAt;\n return make({\n get: () => metricState.gauge(value),\n update: v => {\n value = v;\n },\n modify: v => {\n value = value + v;\n }\n });\n};\n/** @internal */\nexport const histogram = key => {\n const bounds = key.keyType.boundaries.values;\n const size = bounds.length;\n const values = new Uint32Array(size + 1);\n // NOTE: while 64-bit floating point precision shoule be enough for any\n // practical histogram boundary values, there is still a small chance that\n // precision will be lost with very large / very small numbers. If we find\n // that is the case, a more complex approach storing the histogram boundary\n // values as a tuple of `[original: string, numeric: number]` may be warranted\n const boundaries = new Float64Array(size);\n let count = 0;\n let sum = 0;\n let min = Number.MAX_VALUE;\n let max = Number.MIN_VALUE;\n pipe(bounds, Arr.sort(number.Order), Arr.map((n, i) => {\n boundaries[i] = n;\n }));\n // Insert the value into the right bucket with a binary search\n const update = value => {\n let from = 0;\n let to = size;\n while (from !== to) {\n const mid = Math.floor(from + (to - from) / 2);\n const boundary = boundaries[mid];\n if (value <= boundary) {\n to = mid;\n } else {\n from = mid;\n }\n // The special case when to / from have a distance of one\n if (to === from + 1) {\n if (value <= boundaries[from]) {\n to = from;\n } else {\n from = to;\n }\n }\n }\n values[from] = values[from] + 1;\n count = count + 1;\n sum = sum + value;\n if (value < min) {\n min = value;\n }\n if (value > max) {\n max = value;\n }\n };\n const getBuckets = () => {\n const builder = Arr.allocate(size);\n let cumulated = 0;\n for (let i = 0; i < size; i++) {\n const boundary = boundaries[i];\n const value = values[i];\n cumulated = cumulated + value;\n builder[i] = [boundary, cumulated];\n }\n return builder;\n };\n return make({\n get: () => metricState.histogram({\n buckets: getBuckets(),\n count,\n min,\n max,\n sum\n }),\n update,\n modify: update\n });\n};\n/** @internal */\nexport const summary = key => {\n const {\n error,\n maxAge,\n maxSize,\n quantiles\n } = key.keyType;\n const sortedQuantiles = pipe(quantiles, Arr.sort(number.Order));\n const values = Arr.allocate(maxSize);\n let head = 0;\n let count = 0;\n let sum = 0;\n let min = 0;\n let max = 0;\n // Just before the snapshot we filter out all values older than maxAge\n const snapshot = now => {\n const builder = [];\n // If the buffer is not full yet it contains valid items at the 0..last\n // indices and null values at the rest of the positions.\n //\n // If the buffer is already full then all elements contains a valid\n // measurement with timestamp.\n //\n // At any given point in time we can enumerate all the non-null elements in\n // the buffer and filter them by timestamp to get a valid view of a time\n // window.\n //\n // The order does not matter because it gets sorted before passing to\n // `calculateQuantiles`.\n let i = 0;\n while (i !== maxSize - 1) {\n const item = values[i];\n if (item != null) {\n const [t, v] = item;\n const age = Duration.millis(now - t);\n if (Duration.greaterThanOrEqualTo(age, Duration.zero) && Duration.lessThanOrEqualTo(age, maxAge)) {\n builder.push(v);\n }\n }\n i = i + 1;\n }\n return calculateQuantiles(error, sortedQuantiles, Arr.sort(builder, number.Order));\n };\n const observe = (value, timestamp) => {\n if (maxSize > 0) {\n head = head + 1;\n const target = head % maxSize;\n values[target] = [timestamp, value];\n }\n min = count === 0 ? value : Math.min(min, value);\n max = count === 0 ? value : Math.max(max, value);\n count = count + 1;\n sum = sum + value;\n };\n return make({\n get: () => metricState.summary({\n error,\n quantiles: snapshot(Date.now()),\n count,\n min,\n max,\n sum\n }),\n update: ([value, timestamp]) => observe(value, timestamp),\n modify: ([value, timestamp]) => observe(value, timestamp)\n });\n};\n/** @internal */\nconst calculateQuantiles = (error, sortedQuantiles, sortedSamples) => {\n // The number of samples examined\n const sampleCount = sortedSamples.length;\n if (!Arr.isNonEmptyReadonlyArray(sortedQuantiles)) {\n return Arr.empty();\n }\n const head = sortedQuantiles[0];\n const tail = sortedQuantiles.slice(1);\n const resolvedHead = resolveQuantile(error, sampleCount, Option.none(), 0, head, sortedSamples);\n const resolved = Arr.of(resolvedHead);\n tail.forEach(quantile => {\n resolved.push(resolveQuantile(error, sampleCount, resolvedHead.value, resolvedHead.consumed, quantile, resolvedHead.rest));\n });\n return Arr.map(resolved, rq => [rq.quantile, rq.value]);\n};\n/** @internal */\nconst resolveQuantile = (error, sampleCount, current, consumed, quantile, rest) => {\n let error_1 = error;\n let sampleCount_1 = sampleCount;\n let current_1 = current;\n let consumed_1 = consumed;\n let quantile_1 = quantile;\n let rest_1 = rest;\n let error_2 = error;\n let sampleCount_2 = sampleCount;\n let current_2 = current;\n let consumed_2 = consumed;\n let quantile_2 = quantile;\n let rest_2 = rest;\n // eslint-disable-next-line no-constant-condition\n while (1) {\n // If the remaining list of samples is empty, there is nothing more to resolve\n if (!Arr.isNonEmptyReadonlyArray(rest_1)) {\n return {\n quantile: quantile_1,\n value: Option.none(),\n consumed: consumed_1,\n rest: []\n };\n }\n // If the quantile is the 100% quantile, we can take the maximum of all the\n // remaining values as the result\n if (quantile_1 === 1) {\n return {\n quantile: quantile_1,\n value: Option.some(Arr.lastNonEmpty(rest_1)),\n consumed: consumed_1 + rest_1.length,\n rest: []\n };\n }\n // Split into two chunks - the first chunk contains all elements of the same\n // value as the chunk head\n const headValue = Arr.headNonEmpty(rest_1); // Get head value since rest_1 is non-empty\n const sameHead = Arr.span(rest_1, n => n === headValue);\n // How many elements do we want to accept for this quantile\n const desired = quantile_1 * sampleCount_1;\n // The error margin\n const allowedError = error_1 / 2 * desired;\n // Taking into account the elements consumed from the samples so far and the\n // number of same elements at the beginning of the chunk, calculate the number\n // of elements we would have if we selected the current head as result\n const candConsumed = consumed_1 + sameHead[0].length;\n const candError = Math.abs(candConsumed - desired);\n // If we haven't got enough elements yet, recurse\n if (candConsumed < desired - allowedError) {\n error_2 = error_1;\n sampleCount_2 = sampleCount_1;\n current_2 = Arr.head(rest_1);\n consumed_2 = candConsumed;\n quantile_2 = quantile_1;\n rest_2 = sameHead[1];\n error_1 = error_2;\n sampleCount_1 = sampleCount_2;\n current_1 = current_2;\n consumed_1 = consumed_2;\n quantile_1 = quantile_2;\n rest_1 = rest_2;\n continue;\n }\n // If consuming this chunk leads to too many elements (rank is too high)\n if (candConsumed > desired + allowedError) {\n const valueToReturn = Option.isNone(current_1) ? Option.some(headValue) : current_1;\n return {\n quantile: quantile_1,\n value: valueToReturn,\n consumed: consumed_1,\n rest: rest_1\n };\n }\n // If we are in the target interval, select the current head and hand back the leftover after dropping all elements\n // from the sample chunk that are equal to the current head\n switch (current_1._tag) {\n case \"None\":\n {\n error_2 = error_1;\n sampleCount_2 = sampleCount_1;\n current_2 = Arr.head(rest_1);\n consumed_2 = candConsumed;\n quantile_2 = quantile_1;\n rest_2 = sameHead[1];\n error_1 = error_2;\n sampleCount_1 = sampleCount_2;\n current_1 = current_2;\n consumed_1 = consumed_2;\n quantile_1 = quantile_2;\n rest_1 = rest_2;\n continue;\n }\n case \"Some\":\n {\n const prevError = Math.abs(desired - current_1.value);\n if (candError < prevError) {\n error_2 = error_1;\n sampleCount_2 = sampleCount_1;\n current_2 = Arr.head(rest_1);\n consumed_2 = candConsumed;\n quantile_2 = quantile_1;\n rest_2 = sameHead[1];\n error_1 = error_2;\n sampleCount_1 = sampleCount_2;\n current_1 = current_2;\n consumed_1 = consumed_2;\n quantile_1 = quantile_2;\n rest_1 = rest_2;\n continue;\n }\n return {\n quantile: quantile_1,\n value: Option.some(current_1.value),\n consumed: consumed_1,\n rest: rest_1\n };\n }\n }\n }\n throw new Error(\"BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues\");\n};\n//# sourceMappingURL=hook.js.map","import { pipeArguments } from \"../../Pipeable.js\";\n/** @internal */\nconst MetricPairSymbolKey = \"effect/MetricPair\";\n/** @internal */\nexport const MetricPairTypeId = /*#__PURE__*/Symbol.for(MetricPairSymbolKey);\nconst metricPairVariance = {\n /* c8 ignore next */\n _Type: _ => _\n};\n/** @internal */\nexport const make = (metricKey, metricState) => {\n return {\n [MetricPairTypeId]: metricPairVariance,\n metricKey,\n metricState,\n pipe() {\n return pipeArguments(this, arguments);\n }\n };\n};\n/** @internal */\nexport const unsafeMake = (metricKey, metricState) => {\n return {\n [MetricPairTypeId]: metricPairVariance,\n metricKey,\n metricState,\n pipe() {\n return pipeArguments(this, arguments);\n }\n };\n};\n//# sourceMappingURL=pair.js.map","import { pipe } from \"../../Function.js\";\nimport * as MutableHashMap from \"../../MutableHashMap.js\";\nimport * as Option from \"../../Option.js\";\nimport * as metricHook from \"./hook.js\";\nimport * as metricKeyType from \"./keyType.js\";\nimport * as metricPair from \"./pair.js\";\n/** @internal */\nconst MetricRegistrySymbolKey = \"effect/MetricRegistry\";\n/** @internal */\nexport const MetricRegistryTypeId = /*#__PURE__*/Symbol.for(MetricRegistrySymbolKey);\n/** @internal */\nclass MetricRegistryImpl {\n [MetricRegistryTypeId] = MetricRegistryTypeId;\n map = /*#__PURE__*/MutableHashMap.empty();\n snapshot() {\n const result = [];\n for (const [key, hook] of this.map) {\n result.push(metricPair.unsafeMake(key, hook.get()));\n }\n return result;\n }\n get(key) {\n const hook = pipe(this.map, MutableHashMap.get(key), Option.getOrUndefined);\n if (hook == null) {\n if (metricKeyType.isCounterKey(key.keyType)) {\n return this.getCounter(key);\n }\n if (metricKeyType.isGaugeKey(key.keyType)) {\n return this.getGauge(key);\n }\n if (metricKeyType.isFrequencyKey(key.keyType)) {\n return this.getFrequency(key);\n }\n if (metricKeyType.isHistogramKey(key.keyType)) {\n return this.getHistogram(key);\n }\n if (metricKeyType.isSummaryKey(key.keyType)) {\n return this.getSummary(key);\n }\n throw new Error(\"BUG: MetricRegistry.get - unknown MetricKeyType - please report an issue at https://github.com/Effect-TS/effect/issues\");\n } else {\n return hook;\n }\n }\n getCounter(key) {\n let value = pipe(this.map, MutableHashMap.get(key), Option.getOrUndefined);\n if (value == null) {\n const counter = metricHook.counter(key);\n if (!pipe(this.map, MutableHashMap.has(key))) {\n pipe(this.map, MutableHashMap.set(key, counter));\n }\n value = counter;\n }\n return value;\n }\n getFrequency(key) {\n let value = pipe(this.map, MutableHashMap.get(key), Option.getOrUndefined);\n if (value == null) {\n const frequency = metricHook.frequency(key);\n if (!pipe(this.map, MutableHashMap.has(key))) {\n pipe(this.map, MutableHashMap.set(key, frequency));\n }\n value = frequency;\n }\n return value;\n }\n getGauge(key) {\n let value = pipe(this.map, MutableHashMap.get(key), Option.getOrUndefined);\n if (value == null) {\n const gauge = metricHook.gauge(key, key.keyType.bigint ? BigInt(0) : 0);\n if (!pipe(this.map, MutableHashMap.has(key))) {\n pipe(this.map, MutableHashMap.set(key, gauge));\n }\n value = gauge;\n }\n return value;\n }\n getHistogram(key) {\n let value = pipe(this.map, MutableHashMap.get(key), Option.getOrUndefined);\n if (value == null) {\n const histogram = metricHook.histogram(key);\n if (!pipe(this.map, MutableHashMap.has(key))) {\n pipe(this.map, MutableHashMap.set(key, histogram));\n }\n value = histogram;\n }\n return value;\n }\n getSummary(key) {\n let value = pipe(this.map, MutableHashMap.get(key), Option.getOrUndefined);\n if (value == null) {\n const summary = metricHook.summary(key);\n if (!pipe(this.map, MutableHashMap.has(key))) {\n pipe(this.map, MutableHashMap.set(key, summary));\n }\n value = summary;\n }\n return value;\n }\n}\n/** @internal */\nexport const make = () => {\n return new MetricRegistryImpl();\n};\n//# sourceMappingURL=registry.js.map","import * as Arr from \"../Array.js\";\nimport * as Clock from \"../Clock.js\";\nimport * as Duration from \"../Duration.js\";\nimport { constVoid, dual, identity, pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as Cause from \"./cause.js\";\nimport * as effect_ from \"./core-effect.js\";\nimport * as core from \"./core.js\";\nimport * as metricBoundaries from \"./metric/boundaries.js\";\nimport * as metricKey from \"./metric/key.js\";\nimport * as metricKeyType from \"./metric/keyType.js\";\nimport * as metricLabel from \"./metric/label.js\";\nimport * as metricRegistry from \"./metric/registry.js\";\n/** @internal */\nconst MetricSymbolKey = \"effect/Metric\";\n/** @internal */\nexport const MetricTypeId = /*#__PURE__*/Symbol.for(MetricSymbolKey);\nconst metricVariance = {\n /* c8 ignore next */\n _Type: _ => _,\n /* c8 ignore next */\n _In: _ => _,\n /* c8 ignore next */\n _Out: _ => _\n};\n/** @internal */\nexport const globalMetricRegistry = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Metric/globalMetricRegistry\"), () => metricRegistry.make());\n/** @internal */\nexport const make = function (keyType, unsafeUpdate, unsafeValue, unsafeModify) {\n const metric = Object.assign(effect => core.tap(effect, a => update(metric, a)), {\n [MetricTypeId]: metricVariance,\n keyType,\n unsafeUpdate,\n unsafeValue,\n unsafeModify,\n register() {\n this.unsafeValue([]);\n return this;\n },\n pipe() {\n return pipeArguments(this, arguments);\n }\n });\n return metric;\n};\n/** @internal */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => make(self.keyType, (input, extraTags) => self.unsafeUpdate(f(input), extraTags), self.unsafeValue, (input, extraTags) => self.unsafeModify(f(input), extraTags)));\n/** @internal */\nexport const counter = (name, options) => fromMetricKey(metricKey.counter(name, options));\n/** @internal */\nexport const frequency = (name, options) => fromMetricKey(metricKey.frequency(name, options));\n/** @internal */\nexport const withConstantInput = /*#__PURE__*/dual(2, (self, input) => mapInput(self, () => input));\n/** @internal */\nexport const fromMetricKey = key => {\n let untaggedHook;\n const hookCache = new WeakMap();\n const hook = extraTags => {\n if (extraTags.length === 0) {\n if (untaggedHook !== undefined) {\n return untaggedHook;\n }\n untaggedHook = globalMetricRegistry.get(key);\n return untaggedHook;\n }\n let hook = hookCache.get(extraTags);\n if (hook !== undefined) {\n return hook;\n }\n hook = globalMetricRegistry.get(metricKey.taggedWithLabels(key, extraTags));\n hookCache.set(extraTags, hook);\n return hook;\n };\n return make(key.keyType, (input, extraTags) => hook(extraTags).update(input), extraTags => hook(extraTags).get(), (input, extraTags) => hook(extraTags).modify(input));\n};\n/** @internal */\nexport const gauge = (name, options) => fromMetricKey(metricKey.gauge(name, options));\n/** @internal */\nexport const histogram = (name, boundaries, description) => fromMetricKey(metricKey.histogram(name, boundaries, description));\n/* @internal */\nexport const increment = self => metricKeyType.isCounterKey(self.keyType) ? update(self, self.keyType.bigint ? BigInt(1) : 1) : modify(self, self.keyType.bigint ? BigInt(1) : 1);\n/* @internal */\nexport const incrementBy = /*#__PURE__*/dual(2, (self, amount) => metricKeyType.isCounterKey(self.keyType) ? update(self, amount) : modify(self, amount));\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => make(self.keyType, self.unsafeUpdate, extraTags => f(self.unsafeValue(extraTags)), self.unsafeModify));\n/** @internal */\nexport const mapType = /*#__PURE__*/dual(2, (self, f) => make(f(self.keyType), self.unsafeUpdate, self.unsafeValue, self.unsafeModify));\n/** @internal */\nexport const modify = /*#__PURE__*/dual(2, (self, input) => core.fiberRefGetWith(core.currentMetricLabels, tags => core.sync(() => self.unsafeModify(input, tags))));\n/* @internal */\nexport const set = /*#__PURE__*/dual(2, (self, value) => update(self, value));\n/** @internal */\nexport const succeed = out => make(void 0, constVoid, () => out, constVoid);\n/** @internal */\nexport const sync = evaluate => make(void 0, constVoid, evaluate, constVoid);\n/** @internal */\nexport const summary = options => withNow(summaryTimestamp(options));\n/** @internal */\nexport const summaryTimestamp = options => fromMetricKey(metricKey.summary(options));\n/** @internal */\nexport const tagged = /*#__PURE__*/dual(3, (self, key, value) => taggedWithLabels(self, [metricLabel.make(key, value)]));\n/** @internal */\nexport const taggedWithLabelsInput = /*#__PURE__*/dual(2, (self, f) => map(make(self.keyType, (input, extraTags) => self.unsafeUpdate(input, Arr.union(f(input), extraTags)), self.unsafeValue, (input, extraTags) => self.unsafeModify(input, Arr.union(f(input), extraTags))), constVoid));\n/** @internal */\nexport const taggedWithLabels = /*#__PURE__*/dual(2, (self, extraTags) => {\n return make(self.keyType, (input, extraTags1) => self.unsafeUpdate(input, Arr.union(extraTags, extraTags1)), extraTags1 => self.unsafeValue(Arr.union(extraTags, extraTags1)), (input, extraTags1) => self.unsafeModify(input, Arr.union(extraTags, extraTags1)));\n});\n/** @internal */\nexport const timer = (name, description) => {\n const boundaries = metricBoundaries.exponential({\n start: 0.5,\n factor: 2,\n count: 35\n });\n const base = pipe(histogram(name, boundaries, description), tagged(\"time_unit\", \"milliseconds\"));\n return mapInput(base, Duration.toMillis);\n};\n/** @internal */\nexport const timerWithBoundaries = (name, boundaries, description) => {\n const base = pipe(histogram(name, metricBoundaries.fromIterable(boundaries), description), tagged(\"time_unit\", \"milliseconds\"));\n return mapInput(base, Duration.toMillis);\n};\n/* @internal */\nexport const trackAll = /*#__PURE__*/dual(2, (self, input) => effect => core.matchCauseEffect(effect, {\n onFailure: cause => core.zipRight(update(self, input), core.failCause(cause)),\n onSuccess: value => core.zipRight(update(self, input), core.succeed(value))\n}));\n/* @internal */\nexport const trackDefect = /*#__PURE__*/dual(2, (self, metric) => trackDefectWith(self, metric, identity));\n/* @internal */\nexport const trackDefectWith = /*#__PURE__*/dual(3, (self, metric, f) => {\n const updater = defect => update(metric, f(defect));\n return effect_.tapDefect(self, cause => core.forEachSequentialDiscard(Cause.defects(cause), updater));\n});\n/* @internal */\nexport const trackDuration = /*#__PURE__*/dual(2, (self, metric) => trackDurationWith(self, metric, identity));\n/* @internal */\nexport const trackDurationWith = /*#__PURE__*/dual(3, (self, metric, f) => Clock.clockWith(clock => {\n const startTime = clock.unsafeCurrentTimeNanos();\n return core.tap(self, _ => {\n const endTime = clock.unsafeCurrentTimeNanos();\n const duration = Duration.nanos(endTime - startTime);\n return update(metric, f(duration));\n });\n}));\n/* @internal */\nexport const trackError = /*#__PURE__*/dual(2, (self, metric) => trackErrorWith(self, metric, a => a));\n/* @internal */\nexport const trackErrorWith = /*#__PURE__*/dual(3, (self, metric, f) => {\n const updater = error => update(metric, f(error));\n return effect_.tapError(self, updater);\n});\n/* @internal */\nexport const trackSuccess = /*#__PURE__*/dual(2, (self, metric) => trackSuccessWith(self, metric, a => a));\n/* @internal */\nexport const trackSuccessWith = /*#__PURE__*/dual(3, (self, metric, f) => {\n const updater = value => update(metric, f(value));\n return core.tap(self, updater);\n});\n/* @internal */\nexport const update = /*#__PURE__*/dual(2, (self, input) => core.fiberRefGetWith(core.currentMetricLabels, tags => core.sync(() => self.unsafeUpdate(input, tags))));\n/* @internal */\nexport const value = self => core.fiberRefGetWith(core.currentMetricLabels, tags => core.sync(() => self.unsafeValue(tags)));\n/** @internal */\nexport const withNow = self => mapInput(self, input => [input, Date.now()]);\n/** @internal */\nexport const zip = /*#__PURE__*/dual(2, (self, that) => make([self.keyType, that.keyType], (input, extraTags) => {\n const [l, r] = input;\n self.unsafeUpdate(l, extraTags);\n that.unsafeUpdate(r, extraTags);\n}, extraTags => [self.unsafeValue(extraTags), that.unsafeValue(extraTags)], (input, extraTags) => {\n const [l, r] = input;\n self.unsafeModify(l, extraTags);\n that.unsafeModify(r, extraTags);\n}));\n/** @internal */\nexport const unsafeSnapshot = () => globalMetricRegistry.snapshot();\n/** @internal */\nexport const snapshot = /*#__PURE__*/core.sync(unsafeSnapshot);\n//# sourceMappingURL=metric.js.map","import { dual } from \"../Function.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as completedRequestMap from \"./completedRequestMap.js\";\nimport * as core from \"./core.js\";\nimport { StructuralPrototype } from \"./effectable.js\";\n/** @internal */\nconst RequestSymbolKey = \"effect/Request\";\n/** @internal */\nexport const RequestTypeId = /*#__PURE__*/Symbol.for(RequestSymbolKey);\nconst requestVariance = {\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _A: _ => _\n};\nconst RequestPrototype = {\n ...StructuralPrototype,\n [RequestTypeId]: requestVariance\n};\n/** @internal */\nexport const isRequest = u => hasProperty(u, RequestTypeId);\n/** @internal */\nexport const of = () => args => Object.assign(Object.create(RequestPrototype), args);\n/** @internal */\nexport const tagged = tag => args => {\n const request = Object.assign(Object.create(RequestPrototype), args);\n request._tag = tag;\n return request;\n};\n/** @internal */\nexport const Class = /*#__PURE__*/function () {\n function Class(args) {\n if (args) {\n Object.assign(this, args);\n }\n }\n Class.prototype = RequestPrototype;\n return Class;\n}();\n/** @internal */\nexport const TaggedClass = tag => {\n return class TaggedClass extends Class {\n _tag = tag;\n };\n};\n/** @internal */\nexport const complete = /*#__PURE__*/dual(2, (self, result) => core.fiberRefGetWith(completedRequestMap.currentRequestMap, map => core.sync(() => {\n if (map.has(self)) {\n const entry = map.get(self);\n if (!entry.state.completed) {\n entry.state.completed = true;\n core.deferredUnsafeDone(entry.result, result);\n }\n }\n})));\n/** @internal */\nexport const completeEffect = /*#__PURE__*/dual(2, (self, effect) => core.matchEffect(effect, {\n onFailure: error => complete(self, core.exitFail(error)),\n onSuccess: value => complete(self, core.exitSucceed(value))\n}));\n/** @internal */\nexport const fail = /*#__PURE__*/dual(2, (self, error) => complete(self, core.exitFail(error)));\n/** @internal */\nexport const failCause = /*#__PURE__*/dual(2, (self, cause) => complete(self, core.exitFailCause(cause)));\n/** @internal */\nexport const succeed = /*#__PURE__*/dual(2, (self, value) => complete(self, core.exitSucceed(value)));\n/** @internal */\nexport class Listeners {\n count = 0;\n observers = /*#__PURE__*/new Set();\n interrupted = false;\n addObserver(f) {\n this.observers.add(f);\n }\n removeObserver(f) {\n this.observers.delete(f);\n }\n increment() {\n this.count++;\n this.observers.forEach(f => f(this.count));\n }\n decrement() {\n this.count--;\n this.observers.forEach(f => f(this.count));\n }\n}\n/**\n * @internal\n */\nexport const filterOutCompleted = requests => core.fiberRefGetWith(completedRequestMap.currentRequestMap, map => core.succeed(requests.filter(request => !(map.get(request)?.state.completed === true))));\n//# sourceMappingURL=request.js.map","import { pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as MutableRef from \"../MutableRef.js\";\nimport { hasProperty, isTagged } from \"../Predicate.js\";\nimport * as SortedSet from \"../SortedSet.js\";\nimport * as core from \"./core.js\";\n/** @internal */\nconst SupervisorSymbolKey = \"effect/Supervisor\";\n/** @internal */\nexport const SupervisorTypeId = /*#__PURE__*/Symbol.for(SupervisorSymbolKey);\n/** @internal */\nexport const supervisorVariance = {\n /* c8 ignore next */\n _T: _ => _\n};\n/** @internal */\nexport class ProxySupervisor {\n underlying;\n value0;\n [SupervisorTypeId] = supervisorVariance;\n constructor(underlying, value0) {\n this.underlying = underlying;\n this.value0 = value0;\n }\n get value() {\n return this.value0;\n }\n onStart(context, effect, parent, fiber) {\n this.underlying.onStart(context, effect, parent, fiber);\n }\n onEnd(value, fiber) {\n this.underlying.onEnd(value, fiber);\n }\n onEffect(fiber, effect) {\n this.underlying.onEffect(fiber, effect);\n }\n onSuspend(fiber) {\n this.underlying.onSuspend(fiber);\n }\n onResume(fiber) {\n this.underlying.onResume(fiber);\n }\n map(f) {\n return new ProxySupervisor(this, pipe(this.value, core.map(f)));\n }\n zip(right) {\n return new Zip(this, right);\n }\n}\n/** @internal */\nexport class Zip {\n left;\n right;\n _tag = \"Zip\";\n [SupervisorTypeId] = supervisorVariance;\n constructor(left, right) {\n this.left = left;\n this.right = right;\n }\n get value() {\n return core.zip(this.left.value, this.right.value);\n }\n onStart(context, effect, parent, fiber) {\n this.left.onStart(context, effect, parent, fiber);\n this.right.onStart(context, effect, parent, fiber);\n }\n onEnd(value, fiber) {\n this.left.onEnd(value, fiber);\n this.right.onEnd(value, fiber);\n }\n onEffect(fiber, effect) {\n this.left.onEffect(fiber, effect);\n this.right.onEffect(fiber, effect);\n }\n onSuspend(fiber) {\n this.left.onSuspend(fiber);\n this.right.onSuspend(fiber);\n }\n onResume(fiber) {\n this.left.onResume(fiber);\n this.right.onResume(fiber);\n }\n map(f) {\n return new ProxySupervisor(this, pipe(this.value, core.map(f)));\n }\n zip(right) {\n return new Zip(this, right);\n }\n}\n/** @internal */\nexport const isZip = self => hasProperty(self, SupervisorTypeId) && isTagged(self, \"Zip\");\n/** @internal */\nexport class Track {\n [SupervisorTypeId] = supervisorVariance;\n fibers = /*#__PURE__*/new Set();\n get value() {\n return core.sync(() => Array.from(this.fibers));\n }\n onStart(_context, _effect, _parent, fiber) {\n this.fibers.add(fiber);\n }\n onEnd(_value, fiber) {\n this.fibers.delete(fiber);\n }\n onEffect(_fiber, _effect) {\n //\n }\n onSuspend(_fiber) {\n //\n }\n onResume(_fiber) {\n //\n }\n map(f) {\n return new ProxySupervisor(this, pipe(this.value, core.map(f)));\n }\n zip(right) {\n return new Zip(this, right);\n }\n onRun(execution, _fiber) {\n return execution();\n }\n}\n/** @internal */\nexport class Const {\n effect;\n [SupervisorTypeId] = supervisorVariance;\n constructor(effect) {\n this.effect = effect;\n }\n get value() {\n return this.effect;\n }\n onStart(_context, _effect, _parent, _fiber) {\n //\n }\n onEnd(_value, _fiber) {\n //\n }\n onEffect(_fiber, _effect) {\n //\n }\n onSuspend(_fiber) {\n //\n }\n onResume(_fiber) {\n //\n }\n map(f) {\n return new ProxySupervisor(this, pipe(this.value, core.map(f)));\n }\n zip(right) {\n return new Zip(this, right);\n }\n onRun(execution, _fiber) {\n return execution();\n }\n}\nclass FibersIn {\n ref;\n [SupervisorTypeId] = supervisorVariance;\n constructor(ref) {\n this.ref = ref;\n }\n get value() {\n return core.sync(() => MutableRef.get(this.ref));\n }\n onStart(_context, _effect, _parent, fiber) {\n pipe(this.ref, MutableRef.set(pipe(MutableRef.get(this.ref), SortedSet.add(fiber))));\n }\n onEnd(_value, fiber) {\n pipe(this.ref, MutableRef.set(pipe(MutableRef.get(this.ref), SortedSet.remove(fiber))));\n }\n onEffect(_fiber, _effect) {\n //\n }\n onSuspend(_fiber) {\n //\n }\n onResume(_fiber) {\n //\n }\n map(f) {\n return new ProxySupervisor(this, pipe(this.value, core.map(f)));\n }\n zip(right) {\n return new Zip(this, right);\n }\n onRun(execution, _fiber) {\n return execution();\n }\n}\n/** @internal */\nexport const unsafeTrack = () => {\n return new Track();\n};\n/** @internal */\nexport const track = /*#__PURE__*/core.sync(unsafeTrack);\n/** @internal */\nexport const fromEffect = effect => {\n return new Const(effect);\n};\n/** @internal */\nexport const none = /*#__PURE__*/globalValue(\"effect/Supervisor/none\", () => fromEffect(core.void));\n/** @internal */\nexport const fibersIn = ref => core.sync(() => new FibersIn(ref));\n//# sourceMappingURL=supervisor.js.map","import * as Dual from \"./Function.js\";\nimport * as internal from \"./internal/differ.js\";\nimport * as ChunkPatch from \"./internal/differ/chunkPatch.js\";\nimport * as ContextPatch from \"./internal/differ/contextPatch.js\";\nimport * as HashMapPatch from \"./internal/differ/hashMapPatch.js\";\nimport * as HashSetPatch from \"./internal/differ/hashSetPatch.js\";\nimport * as OrPatch from \"./internal/differ/orPatch.js\";\nimport * as ReadonlyArrayPatch from \"./internal/differ/readonlyArrayPatch.js\";\n/**\n * @since 2.0.0\n * @category symbol\n */\nexport const TypeId = internal.DifferTypeId;\nconst ChunkPatchTypeId = ChunkPatch.ChunkPatchTypeId;\nconst ContextPatchTypeId = ContextPatch.ContextPatchTypeId;\nconst HashMapPatchTypeId = HashMapPatch.HashMapPatchTypeId;\nconst HashSetPatchTypeId = HashSetPatch.HashSetPatchTypeId;\nconst OrPatchTypeId = OrPatch.OrPatchTypeId;\nconst ReadonlyArrayPatchTypeId = ReadonlyArrayPatch.ReadonlyArrayPatchTypeId;\n/**\n * An empty patch that describes no changes.\n *\n * @since 2.0.0\n * @category patch\n */\nexport const empty = self => self.empty;\n/**\n * @since 2.0.0\n * @category patch\n */\nexport const diff = /*#__PURE__*/Dual.dual(3, (self, oldValue, newValue) => self.diff(oldValue, newValue));\n/**\n * Combines two patches to produce a new patch that describes the updates of\n * the first patch and then the updates of the second patch. The combine\n * operation should be associative. In addition, if the combine operation is\n * commutative then joining multiple fibers concurrently will result in\n * deterministic `FiberRef` values.\n *\n * @since 2.0.0\n * @category patch\n */\nexport const combine = /*#__PURE__*/Dual.dual(3, (self, first, second) => self.combine(first, second));\n/**\n * Applies a patch to an old value to produce a new value that is equal to the\n * old value with the updates described by the patch.\n *\n * @since 2.0.0\n * @category patch\n */\nexport const patch = /*#__PURE__*/Dual.dual(3, (self, patch, oldValue) => self.patch(patch, oldValue));\n/**\n * Constructs a new `Differ`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * Constructs a differ that knows how to diff `Env` values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const environment = internal.environment;\n/**\n * Constructs a differ that knows how to diff a `Chunk` of values given a\n * differ that knows how to diff the values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const chunk = internal.chunk;\n/**\n * Constructs a differ that knows how to diff a `HashMap` of keys and values given\n * a differ that knows how to diff the values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const hashMap = internal.hashMap;\n/**\n * Constructs a differ that knows how to diff a `HashSet` of values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const hashSet = internal.hashSet;\n/**\n * Combines this differ and the specified differ to produce a differ that\n * knows how to diff the sum of their values.\n *\n * @since 2.0.0\n */\nexport const orElseEither = internal.orElseEither;\n/**\n * Constructs a differ that knows how to diff a `ReadonlyArray` of values.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const readonlyArray = internal.readonlyArray;\n/**\n * Transforms the type of values that this differ knows how to differ using\n * the specified functions that map the new and old value types to each other.\n *\n * @since 2.0.0\n */\nexport const transform = internal.transform;\n/**\n * Constructs a differ that just diffs two values by returning a function that\n * sets the value to the new value. This differ does not support combining\n * multiple updates to the value compositionally and should only be used when\n * there is no compositional way to update them.\n *\n * @since 2.0.0\n */\nexport const update = internal.update;\n/**\n * A variant of `update` that allows specifying the function that will be used\n * to combine old values with new values.\n *\n * @since 2.0.0\n */\nexport const updateWith = internal.updateWith;\n/**\n * Combines this differ and the specified differ to produce a new differ that\n * knows how to diff the product of their values.\n *\n * @since 2.0.0\n */\nexport const zip = internal.zip;\n//# sourceMappingURL=Differ.js.map","import * as Chunk from \"../../Chunk.js\";\nimport * as Differ from \"../../Differ.js\";\nimport * as Equal from \"../../Equal.js\";\nimport { pipe } from \"../../Function.js\";\nimport * as HashSet from \"../../HashSet.js\";\nimport * as supervisor from \"../supervisor.js\";\n/** @internal */\nexport const OP_EMPTY = \"Empty\";\n/** @internal */\nexport const OP_ADD_SUPERVISOR = \"AddSupervisor\";\n/** @internal */\nexport const OP_REMOVE_SUPERVISOR = \"RemoveSupervisor\";\n/** @internal */\nexport const OP_AND_THEN = \"AndThen\";\n/**\n * The empty `SupervisorPatch`.\n *\n * @internal\n */\nexport const empty = {\n _tag: OP_EMPTY\n};\n/**\n * Combines two patches to produce a new patch that describes applying the\n * updates from this patch and then the updates from the specified patch.\n *\n * @internal\n */\nexport const combine = (self, that) => {\n return {\n _tag: OP_AND_THEN,\n first: self,\n second: that\n };\n};\n/**\n * Applies a `SupervisorPatch` to a `Supervisor` to produce a new `Supervisor`.\n *\n * @internal\n */\nexport const patch = (self, supervisor) => {\n return patchLoop(supervisor, Chunk.of(self));\n};\n/** @internal */\nconst patchLoop = (_supervisor, _patches) => {\n let supervisor = _supervisor;\n let patches = _patches;\n while (Chunk.isNonEmpty(patches)) {\n const head = Chunk.headNonEmpty(patches);\n switch (head._tag) {\n case OP_EMPTY:\n {\n patches = Chunk.tailNonEmpty(patches);\n break;\n }\n case OP_ADD_SUPERVISOR:\n {\n supervisor = supervisor.zip(head.supervisor);\n patches = Chunk.tailNonEmpty(patches);\n break;\n }\n case OP_REMOVE_SUPERVISOR:\n {\n supervisor = removeSupervisor(supervisor, head.supervisor);\n patches = Chunk.tailNonEmpty(patches);\n break;\n }\n case OP_AND_THEN:\n {\n patches = Chunk.prepend(head.first)(Chunk.prepend(head.second)(Chunk.tailNonEmpty(patches)));\n break;\n }\n }\n }\n return supervisor;\n};\n/** @internal */\nconst removeSupervisor = (self, that) => {\n if (Equal.equals(self, that)) {\n return supervisor.none;\n } else {\n if (supervisor.isZip(self)) {\n return removeSupervisor(self.left, that).zip(removeSupervisor(self.right, that));\n } else {\n return self;\n }\n }\n};\n/** @internal */\nconst toSet = self => {\n if (Equal.equals(self, supervisor.none)) {\n return HashSet.empty();\n } else {\n if (supervisor.isZip(self)) {\n return pipe(toSet(self.left), HashSet.union(toSet(self.right)));\n } else {\n return HashSet.make(self);\n }\n }\n};\n/** @internal */\nexport const diff = (oldValue, newValue) => {\n if (Equal.equals(oldValue, newValue)) {\n return empty;\n }\n const oldSupervisors = toSet(oldValue);\n const newSupervisors = toSet(newValue);\n const added = pipe(newSupervisors, HashSet.difference(oldSupervisors), HashSet.reduce(empty, (patch, supervisor) => combine(patch, {\n _tag: OP_ADD_SUPERVISOR,\n supervisor\n })));\n const removed = pipe(oldSupervisors, HashSet.difference(newSupervisors), HashSet.reduce(empty, (patch, supervisor) => combine(patch, {\n _tag: OP_REMOVE_SUPERVISOR,\n supervisor\n })));\n return combine(added, removed);\n};\n/** @internal */\nexport const differ = /*#__PURE__*/Differ.make({\n empty,\n patch,\n combine,\n diff\n});\n//# sourceMappingURL=patch.js.map","import * as RA from \"../Array.js\";\nimport * as Boolean from \"../Boolean.js\";\nimport * as Chunk from \"../Chunk.js\";\nimport * as Context from \"../Context.js\";\nimport * as Effectable from \"../Effectable.js\";\nimport * as ExecutionStrategy from \"../ExecutionStrategy.js\";\nimport * as FiberId from \"../FiberId.js\";\nimport * as FiberRefs from \"../FiberRefs.js\";\nimport * as FiberRefsPatch from \"../FiberRefsPatch.js\";\nimport * as FiberStatus from \"../FiberStatus.js\";\nimport { dual, identity, pipe } from \"../Function.js\";\nimport { globalValue } from \"../GlobalValue.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport * as HashSet from \"../HashSet.js\";\nimport * as Inspectable from \"../Inspectable.js\";\nimport * as LogLevel from \"../LogLevel.js\";\nimport * as Micro from \"../Micro.js\";\nimport * as MRef from \"../MutableRef.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as Predicate from \"../Predicate.js\";\nimport * as Ref from \"../Ref.js\";\nimport * as RuntimeFlagsPatch from \"../RuntimeFlagsPatch.js\";\nimport { currentScheduler } from \"../Scheduler.js\";\nimport { internalCall, yieldWrapGet } from \"../Utils.js\";\nimport * as RequestBlock_ from \"./blockedRequests.js\";\nimport * as internalCause from \"./cause.js\";\nimport * as clock from \"./clock.js\";\nimport { currentRequestMap } from \"./completedRequestMap.js\";\nimport * as concurrency from \"./concurrency.js\";\nimport { configProviderTag } from \"./configProvider.js\";\nimport * as internalEffect from \"./core-effect.js\";\nimport * as core from \"./core.js\";\nimport * as defaultServices from \"./defaultServices.js\";\nimport { consoleTag } from \"./defaultServices/console.js\";\nimport * as executionStrategy from \"./executionStrategy.js\";\nimport * as internalFiber from \"./fiber.js\";\nimport * as FiberMessage from \"./fiberMessage.js\";\nimport * as fiberRefs from \"./fiberRefs.js\";\nimport * as fiberScope from \"./fiberScope.js\";\nimport * as internalLogger from \"./logger.js\";\nimport * as metric from \"./metric.js\";\nimport * as metricBoundaries from \"./metric/boundaries.js\";\nimport * as metricLabel from \"./metric/label.js\";\nimport * as OpCodes from \"./opCodes/effect.js\";\nimport { randomTag } from \"./random.js\";\nimport { complete } from \"./request.js\";\nimport * as runtimeFlags_ from \"./runtimeFlags.js\";\nimport { OpSupervision } from \"./runtimeFlags.js\";\nimport * as supervisor from \"./supervisor.js\";\nimport * as SupervisorPatch from \"./supervisor/patch.js\";\nimport * as tracer from \"./tracer.js\";\nimport * as version from \"./version.js\";\n/** @internal */\nexport const fiberStarted = /*#__PURE__*/metric.counter(\"effect_fiber_started\", {\n incremental: true\n});\n/** @internal */\nexport const fiberActive = /*#__PURE__*/metric.counter(\"effect_fiber_active\");\n/** @internal */\nexport const fiberSuccesses = /*#__PURE__*/metric.counter(\"effect_fiber_successes\", {\n incremental: true\n});\n/** @internal */\nexport const fiberFailures = /*#__PURE__*/metric.counter(\"effect_fiber_failures\", {\n incremental: true\n});\n/** @internal */\nexport const fiberLifetimes = /*#__PURE__*/metric.tagged(/*#__PURE__*/metric.histogram(\"effect_fiber_lifetimes\", /*#__PURE__*/metricBoundaries.exponential({\n start: 0.5,\n factor: 2,\n count: 35\n})), \"time_unit\", \"milliseconds\");\n/** @internal */\nconst EvaluationSignalContinue = \"Continue\";\n/** @internal */\nconst EvaluationSignalDone = \"Done\";\n/** @internal */\nconst EvaluationSignalYieldNow = \"Yield\";\nconst runtimeFiberVariance = {\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _A: _ => _\n};\nconst absurd = _ => {\n throw new Error(`BUG: FiberRuntime - ${Inspectable.toStringUnknown(_)} - please report an issue at https://github.com/Effect-TS/effect/issues`);\n};\nconst YieldedOp = /*#__PURE__*/Symbol.for(\"effect/internal/fiberRuntime/YieldedOp\");\nconst yieldedOpChannel = /*#__PURE__*/globalValue(\"effect/internal/fiberRuntime/yieldedOpChannel\", () => ({\n currentOp: null\n}));\nconst contOpSuccess = {\n [OpCodes.OP_ON_SUCCESS]: (_, cont, value) => {\n return internalCall(() => cont.effect_instruction_i1(value));\n },\n [\"OnStep\"]: (_, _cont, value) => {\n return core.exitSucceed(core.exitSucceed(value));\n },\n [OpCodes.OP_ON_SUCCESS_AND_FAILURE]: (_, cont, value) => {\n return internalCall(() => cont.effect_instruction_i2(value));\n },\n [OpCodes.OP_REVERT_FLAGS]: (self, cont, value) => {\n self.patchRuntimeFlags(self.currentRuntimeFlags, cont.patch);\n if (runtimeFlags_.interruptible(self.currentRuntimeFlags) && self.isInterrupted()) {\n return core.exitFailCause(self.getInterruptedCause());\n } else {\n return core.exitSucceed(value);\n }\n },\n [OpCodes.OP_WHILE]: (self, cont, value) => {\n internalCall(() => cont.effect_instruction_i2(value));\n if (internalCall(() => cont.effect_instruction_i0())) {\n self.pushStack(cont);\n return internalCall(() => cont.effect_instruction_i1());\n } else {\n return core.void;\n }\n },\n [OpCodes.OP_ITERATOR]: (self, cont, value) => {\n while (true) {\n const state = internalCall(() => cont.effect_instruction_i0.next(value));\n if (state.done) {\n return core.exitSucceed(state.value);\n }\n const primitive = yieldWrapGet(state.value);\n if (!core.exitIsExit(primitive)) {\n self.pushStack(cont);\n return primitive;\n } else if (primitive._tag === \"Failure\") {\n return primitive;\n }\n value = primitive.value;\n }\n }\n};\nconst drainQueueWhileRunningTable = {\n [FiberMessage.OP_INTERRUPT_SIGNAL]: (self, runtimeFlags, cur, message) => {\n self.processNewInterruptSignal(message.cause);\n return runtimeFlags_.interruptible(runtimeFlags) ? core.exitFailCause(message.cause) : cur;\n },\n [FiberMessage.OP_RESUME]: (_self, _runtimeFlags, _cur, _message) => {\n throw new Error(\"It is illegal to have multiple concurrent run loops in a single fiber\");\n },\n [FiberMessage.OP_STATEFUL]: (self, runtimeFlags, cur, message) => {\n message.onFiber(self, FiberStatus.running(runtimeFlags));\n return cur;\n },\n [FiberMessage.OP_YIELD_NOW]: (_self, _runtimeFlags, cur, _message) => {\n return core.flatMap(core.yieldNow(), () => cur);\n }\n};\n/**\n * Executes all requests, submitting requests to each data source in parallel.\n */\nconst runBlockedRequests = self => core.forEachSequentialDiscard(RequestBlock_.flatten(self), requestsByRequestResolver => forEachConcurrentDiscard(RequestBlock_.sequentialCollectionToChunk(requestsByRequestResolver), ([dataSource, sequential]) => {\n const map = new Map();\n const arr = [];\n for (const block of sequential) {\n arr.push(Chunk.toReadonlyArray(block));\n for (const entry of block) {\n map.set(entry.request, entry);\n }\n }\n const flat = arr.flat();\n return core.fiberRefLocally(invokeWithInterrupt(dataSource.runAll(arr), flat, () => flat.forEach(entry => {\n entry.listeners.interrupted = true;\n })), currentRequestMap, map);\n}, false, false));\nconst _version = /*#__PURE__*/version.getCurrentVersion();\n/** @internal */\nexport class FiberRuntime extends Effectable.Class {\n [internalFiber.FiberTypeId] = internalFiber.fiberVariance;\n [internalFiber.RuntimeFiberTypeId] = runtimeFiberVariance;\n _fiberRefs;\n _fiberId;\n _queue = /*#__PURE__*/new Array();\n _children = null;\n _observers = /*#__PURE__*/new Array();\n _running = false;\n _stack = [];\n _asyncInterruptor = null;\n _asyncBlockingOn = null;\n _exitValue = null;\n _steps = [];\n _isYielding = false;\n currentRuntimeFlags;\n currentOpCount = 0;\n currentSupervisor;\n currentScheduler;\n currentTracer;\n currentSpan;\n currentContext;\n currentDefaultServices;\n constructor(fiberId, fiberRefs0, runtimeFlags0) {\n super();\n this.currentRuntimeFlags = runtimeFlags0;\n this._fiberId = fiberId;\n this._fiberRefs = fiberRefs0;\n if (runtimeFlags_.runtimeMetrics(runtimeFlags0)) {\n const tags = this.getFiberRef(core.currentMetricLabels);\n fiberStarted.unsafeUpdate(1, tags);\n fiberActive.unsafeUpdate(1, tags);\n }\n this.refreshRefCache();\n }\n commit() {\n return internalFiber.join(this);\n }\n /**\n * The identity of the fiber.\n */\n id() {\n return this._fiberId;\n }\n /**\n * Begins execution of the effect associated with this fiber on in the\n * background. This can be called to \"kick off\" execution of a fiber after\n * it has been created.\n */\n resume(effect) {\n this.tell(FiberMessage.resume(effect));\n }\n /**\n * The status of the fiber.\n */\n get status() {\n return this.ask((_, status) => status);\n }\n /**\n * Gets the fiber runtime flags.\n */\n get runtimeFlags() {\n return this.ask((state, status) => {\n if (FiberStatus.isDone(status)) {\n return state.currentRuntimeFlags;\n }\n return status.runtimeFlags;\n });\n }\n /**\n * Returns the current `FiberScope` for the fiber.\n */\n scope() {\n return fiberScope.unsafeMake(this);\n }\n /**\n * Retrieves the immediate children of the fiber.\n */\n get children() {\n return this.ask(fiber => Array.from(fiber.getChildren()));\n }\n /**\n * Gets the fiber's set of children.\n */\n getChildren() {\n if (this._children === null) {\n this._children = new Set();\n }\n return this._children;\n }\n /**\n * Retrieves the interrupted cause of the fiber, which will be `Cause.empty`\n * if the fiber has not been interrupted.\n *\n * **NOTE**: This method is safe to invoke on any fiber, but if not invoked\n * on this fiber, then values derived from the fiber's state (including the\n * log annotations and log level) may not be up-to-date.\n */\n getInterruptedCause() {\n return this.getFiberRef(core.currentInterruptedCause);\n }\n /**\n * Retrieves the whole set of fiber refs.\n */\n fiberRefs() {\n return this.ask(fiber => fiber.getFiberRefs());\n }\n /**\n * Returns an effect that will contain information computed from the fiber\n * state and status while running on the fiber.\n *\n * This allows the outside world to interact safely with mutable fiber state\n * without locks or immutable data.\n */\n ask(f) {\n return core.suspend(() => {\n const deferred = core.deferredUnsafeMake(this._fiberId);\n this.tell(FiberMessage.stateful((fiber, status) => {\n core.deferredUnsafeDone(deferred, core.sync(() => f(fiber, status)));\n }));\n return core.deferredAwait(deferred);\n });\n }\n /**\n * Adds a message to be processed by the fiber on the fiber.\n */\n tell(message) {\n this._queue.push(message);\n if (!this._running) {\n this._running = true;\n this.drainQueueLaterOnExecutor();\n }\n }\n get await() {\n return core.async(resume => {\n const cb = exit => resume(core.succeed(exit));\n this.tell(FiberMessage.stateful((fiber, _) => {\n if (fiber._exitValue !== null) {\n cb(this._exitValue);\n } else {\n fiber.addObserver(cb);\n }\n }));\n return core.sync(() => this.tell(FiberMessage.stateful((fiber, _) => {\n fiber.removeObserver(cb);\n })));\n }, this.id());\n }\n get inheritAll() {\n return core.withFiberRuntime((parentFiber, parentStatus) => {\n const parentFiberId = parentFiber.id();\n const parentFiberRefs = parentFiber.getFiberRefs();\n const parentRuntimeFlags = parentStatus.runtimeFlags;\n const childFiberRefs = this.getFiberRefs();\n const updatedFiberRefs = fiberRefs.joinAs(parentFiberRefs, parentFiberId, childFiberRefs);\n parentFiber.setFiberRefs(updatedFiberRefs);\n const updatedRuntimeFlags = parentFiber.getFiberRef(currentRuntimeFlags);\n const patch = pipe(runtimeFlags_.diff(parentRuntimeFlags, updatedRuntimeFlags),\n // Do not inherit WindDown or Interruption!\n RuntimeFlagsPatch.exclude(runtimeFlags_.Interruption), RuntimeFlagsPatch.exclude(runtimeFlags_.WindDown));\n return core.updateRuntimeFlags(patch);\n });\n }\n /**\n * Tentatively observes the fiber, but returns immediately if it is not\n * already done.\n */\n get poll() {\n return core.sync(() => Option.fromNullable(this._exitValue));\n }\n /**\n * Unsafely observes the fiber, but returns immediately if it is not\n * already done.\n */\n unsafePoll() {\n return this._exitValue;\n }\n /**\n * In the background, interrupts the fiber as if interrupted from the specified fiber.\n */\n interruptAsFork(fiberId) {\n return core.sync(() => this.tell(FiberMessage.interruptSignal(internalCause.interrupt(fiberId))));\n }\n /**\n * In the background, interrupts the fiber as if interrupted from the specified fiber.\n */\n unsafeInterruptAsFork(fiberId) {\n this.tell(FiberMessage.interruptSignal(internalCause.interrupt(fiberId)));\n }\n /**\n * Adds an observer to the list of observers.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n addObserver(observer) {\n if (this._exitValue !== null) {\n observer(this._exitValue);\n } else {\n this._observers.push(observer);\n }\n }\n /**\n * Removes the specified observer from the list of observers that will be\n * notified when the fiber exits.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n removeObserver(observer) {\n this._observers = this._observers.filter(o => o !== observer);\n }\n /**\n * Retrieves all fiber refs of the fiber.\n *\n * **NOTE**: This method is safe to invoke on any fiber, but if not invoked\n * on this fiber, then values derived from the fiber's state (including the\n * log annotations and log level) may not be up-to-date.\n */\n getFiberRefs() {\n this.setFiberRef(currentRuntimeFlags, this.currentRuntimeFlags);\n return this._fiberRefs;\n }\n /**\n * Deletes the specified fiber ref.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n unsafeDeleteFiberRef(fiberRef) {\n this._fiberRefs = fiberRefs.delete_(this._fiberRefs, fiberRef);\n }\n /**\n * Retrieves the state of the fiber ref, or else its initial value.\n *\n * **NOTE**: This method is safe to invoke on any fiber, but if not invoked\n * on this fiber, then values derived from the fiber's state (including the\n * log annotations and log level) may not be up-to-date.\n */\n getFiberRef(fiberRef) {\n if (this._fiberRefs.locals.has(fiberRef)) {\n return this._fiberRefs.locals.get(fiberRef)[0][1];\n }\n return fiberRef.initial;\n }\n /**\n * Sets the fiber ref to the specified value.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n setFiberRef(fiberRef, value) {\n this._fiberRefs = fiberRefs.updateAs(this._fiberRefs, {\n fiberId: this._fiberId,\n fiberRef,\n value\n });\n this.refreshRefCache();\n }\n refreshRefCache() {\n this.currentDefaultServices = this.getFiberRef(defaultServices.currentServices);\n this.currentTracer = this.currentDefaultServices.unsafeMap.get(tracer.tracerTag.key);\n this.currentSupervisor = this.getFiberRef(currentSupervisor);\n this.currentScheduler = this.getFiberRef(currentScheduler);\n this.currentContext = this.getFiberRef(core.currentContext);\n this.currentSpan = this.currentContext.unsafeMap.get(tracer.spanTag.key);\n }\n /**\n * Wholesale replaces all fiber refs of this fiber.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n setFiberRefs(fiberRefs) {\n this._fiberRefs = fiberRefs;\n this.refreshRefCache();\n }\n /**\n * Adds a reference to the specified fiber inside the children set.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n addChild(child) {\n this.getChildren().add(child);\n }\n /**\n * Removes a reference to the specified fiber inside the children set.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n removeChild(child) {\n this.getChildren().delete(child);\n }\n /**\n * Transfers all children of this fiber that are currently running to the\n * specified fiber scope.\n *\n * **NOTE**: This method must be invoked by the fiber itself after it has\n * evaluated the effects but prior to exiting.\n */\n transferChildren(scope) {\n const children = this._children;\n // Clear the children of the current fiber\n this._children = null;\n if (children !== null && children.size > 0) {\n for (const child of children) {\n // If the child is still running, add it to the scope\n if (child._exitValue === null) {\n scope.add(this.currentRuntimeFlags, child);\n }\n }\n }\n }\n /**\n * On the current thread, executes all messages in the fiber's inbox. This\n * method may return before all work is done, in the event the fiber executes\n * an asynchronous operation.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n drainQueueOnCurrentThread() {\n let recurse = true;\n while (recurse) {\n let evaluationSignal = EvaluationSignalContinue;\n const prev = globalThis[internalFiber.currentFiberURI];\n globalThis[internalFiber.currentFiberURI] = this;\n try {\n while (evaluationSignal === EvaluationSignalContinue) {\n evaluationSignal = this._queue.length === 0 ? EvaluationSignalDone : this.evaluateMessageWhileSuspended(this._queue.splice(0, 1)[0]);\n }\n } finally {\n this._running = false;\n globalThis[internalFiber.currentFiberURI] = prev;\n }\n // Maybe someone added something to the queue between us checking, and us\n // giving up the drain. If so, we need to restart the draining, but only\n // if we beat everyone else to the restart:\n if (this._queue.length > 0 && !this._running) {\n this._running = true;\n if (evaluationSignal === EvaluationSignalYieldNow) {\n this.drainQueueLaterOnExecutor();\n recurse = false;\n } else {\n recurse = true;\n }\n } else {\n recurse = false;\n }\n }\n }\n /**\n * Schedules the execution of all messages in the fiber's inbox.\n *\n * This method will return immediately after the scheduling\n * operation is completed, but potentially before such messages have been\n * executed.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n drainQueueLaterOnExecutor() {\n this.currentScheduler.scheduleTask(this.run, this.getFiberRef(core.currentSchedulingPriority));\n }\n /**\n * Drains the fiber's message queue while the fiber is actively running,\n * returning the next effect to execute, which may be the input effect if no\n * additional effect needs to be executed.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n drainQueueWhileRunning(runtimeFlags, cur0) {\n let cur = cur0;\n while (this._queue.length > 0) {\n const message = this._queue.splice(0, 1)[0];\n // @ts-expect-error\n cur = drainQueueWhileRunningTable[message._tag](this, runtimeFlags, cur, message);\n }\n return cur;\n }\n /**\n * Determines if the fiber is interrupted.\n *\n * **NOTE**: This method is safe to invoke on any fiber, but if not invoked\n * on this fiber, then values derived from the fiber's state (including the\n * log annotations and log level) may not be up-to-date.\n */\n isInterrupted() {\n return !internalCause.isEmpty(this.getFiberRef(core.currentInterruptedCause));\n }\n /**\n * Adds an interruptor to the set of interruptors that are interrupting this\n * fiber.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n addInterruptedCause(cause) {\n const oldSC = this.getFiberRef(core.currentInterruptedCause);\n this.setFiberRef(core.currentInterruptedCause, internalCause.sequential(oldSC, cause));\n }\n /**\n * Processes a new incoming interrupt signal.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n processNewInterruptSignal(cause) {\n this.addInterruptedCause(cause);\n this.sendInterruptSignalToAllChildren();\n }\n /**\n * Interrupts all children of the current fiber, returning an effect that will\n * await the exit of the children. This method will return null if the fiber\n * has no children.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n sendInterruptSignalToAllChildren() {\n if (this._children === null || this._children.size === 0) {\n return false;\n }\n let told = false;\n for (const child of this._children) {\n child.tell(FiberMessage.interruptSignal(internalCause.interrupt(this.id())));\n told = true;\n }\n return told;\n }\n /**\n * Interrupts all children of the current fiber, returning an effect that will\n * await the exit of the children. This method will return null if the fiber\n * has no children.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n interruptAllChildren() {\n if (this.sendInterruptSignalToAllChildren()) {\n const it = this._children.values();\n this._children = null;\n let isDone = false;\n const body = () => {\n const next = it.next();\n if (!next.done) {\n return core.asVoid(next.value.await);\n } else {\n return core.sync(() => {\n isDone = true;\n });\n }\n };\n return core.whileLoop({\n while: () => !isDone,\n body,\n step: () => {\n //\n }\n });\n }\n return null;\n }\n reportExitValue(exit) {\n if (runtimeFlags_.runtimeMetrics(this.currentRuntimeFlags)) {\n const tags = this.getFiberRef(core.currentMetricLabels);\n const startTimeMillis = this.id().startTimeMillis;\n const endTimeMillis = Date.now();\n fiberLifetimes.unsafeUpdate(endTimeMillis - startTimeMillis, tags);\n fiberActive.unsafeUpdate(-1, tags);\n switch (exit._tag) {\n case OpCodes.OP_SUCCESS:\n {\n fiberSuccesses.unsafeUpdate(1, tags);\n break;\n }\n case OpCodes.OP_FAILURE:\n {\n fiberFailures.unsafeUpdate(1, tags);\n break;\n }\n }\n }\n if (exit._tag === \"Failure\") {\n const level = this.getFiberRef(core.currentUnhandledErrorLogLevel);\n if (!internalCause.isInterruptedOnly(exit.cause) && level._tag === \"Some\") {\n this.log(\"Fiber terminated with an unhandled error\", exit.cause, level);\n }\n }\n }\n setExitValue(exit) {\n this._exitValue = exit;\n this.reportExitValue(exit);\n for (let i = this._observers.length - 1; i >= 0; i--) {\n this._observers[i](exit);\n }\n this._observers = [];\n }\n getLoggers() {\n return this.getFiberRef(currentLoggers);\n }\n log(message, cause, overrideLogLevel) {\n const logLevel = Option.isSome(overrideLogLevel) ? overrideLogLevel.value : this.getFiberRef(core.currentLogLevel);\n const minimumLogLevel = this.getFiberRef(currentMinimumLogLevel);\n if (LogLevel.greaterThan(minimumLogLevel, logLevel)) {\n return;\n }\n const spans = this.getFiberRef(core.currentLogSpan);\n const annotations = this.getFiberRef(core.currentLogAnnotations);\n const loggers = this.getLoggers();\n const contextMap = this.getFiberRefs();\n if (HashSet.size(loggers) > 0) {\n const clockService = Context.get(this.getFiberRef(defaultServices.currentServices), clock.clockTag);\n const date = new Date(clockService.unsafeCurrentTimeMillis());\n Inspectable.withRedactableContext(contextMap, () => {\n for (const logger of loggers) {\n logger.log({\n fiberId: this.id(),\n logLevel,\n message,\n cause,\n context: contextMap,\n spans,\n annotations,\n date\n });\n }\n });\n }\n }\n /**\n * Evaluates a single message on the current thread, while the fiber is\n * suspended. This method should only be called while evaluation of the\n * fiber's effect is suspended due to an asynchronous operation.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n evaluateMessageWhileSuspended(message) {\n switch (message._tag) {\n case FiberMessage.OP_YIELD_NOW:\n {\n return EvaluationSignalYieldNow;\n }\n case FiberMessage.OP_INTERRUPT_SIGNAL:\n {\n this.processNewInterruptSignal(message.cause);\n if (this._asyncInterruptor !== null) {\n this._asyncInterruptor(core.exitFailCause(message.cause));\n this._asyncInterruptor = null;\n }\n return EvaluationSignalContinue;\n }\n case FiberMessage.OP_RESUME:\n {\n this._asyncInterruptor = null;\n this._asyncBlockingOn = null;\n this.evaluateEffect(message.effect);\n return EvaluationSignalContinue;\n }\n case FiberMessage.OP_STATEFUL:\n {\n message.onFiber(this, this._exitValue !== null ? FiberStatus.done : FiberStatus.suspended(this.currentRuntimeFlags, this._asyncBlockingOn));\n return EvaluationSignalContinue;\n }\n default:\n {\n return absurd(message);\n }\n }\n }\n /**\n * Evaluates an effect until completion, potentially asynchronously.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n evaluateEffect(effect0) {\n this.currentSupervisor.onResume(this);\n try {\n let effect = runtimeFlags_.interruptible(this.currentRuntimeFlags) && this.isInterrupted() ? core.exitFailCause(this.getInterruptedCause()) : effect0;\n while (effect !== null) {\n const eff = effect;\n const exit = this.runLoop(eff);\n if (exit === YieldedOp) {\n const op = yieldedOpChannel.currentOp;\n yieldedOpChannel.currentOp = null;\n if (op._op === OpCodes.OP_YIELD) {\n if (runtimeFlags_.cooperativeYielding(this.currentRuntimeFlags)) {\n this.tell(FiberMessage.yieldNow());\n this.tell(FiberMessage.resume(core.exitVoid));\n effect = null;\n } else {\n effect = core.exitVoid;\n }\n } else if (op._op === OpCodes.OP_ASYNC) {\n // Terminate this evaluation, async resumption will continue evaluation:\n effect = null;\n }\n } else {\n this.currentRuntimeFlags = pipe(this.currentRuntimeFlags, runtimeFlags_.enable(runtimeFlags_.WindDown));\n const interruption = this.interruptAllChildren();\n if (interruption !== null) {\n effect = core.flatMap(interruption, () => exit);\n } else {\n if (this._queue.length === 0) {\n // No more messages to process, so we will allow the fiber to end life:\n this.setExitValue(exit);\n } else {\n // There are messages, possibly added by the final op executed by\n // the fiber. To be safe, we should execute those now before we\n // allow the fiber to end life:\n this.tell(FiberMessage.resume(exit));\n }\n effect = null;\n }\n }\n }\n } finally {\n this.currentSupervisor.onSuspend(this);\n }\n }\n /**\n * Begins execution of the effect associated with this fiber on the current\n * thread. This can be called to \"kick off\" execution of a fiber after it has\n * been created, in hopes that the effect can be executed synchronously.\n *\n * This is not the normal way of starting a fiber, but it is useful when the\n * express goal of executing the fiber is to synchronously produce its exit.\n */\n start(effect) {\n if (!this._running) {\n this._running = true;\n const prev = globalThis[internalFiber.currentFiberURI];\n globalThis[internalFiber.currentFiberURI] = this;\n try {\n this.evaluateEffect(effect);\n } finally {\n this._running = false;\n globalThis[internalFiber.currentFiberURI] = prev;\n // Because we're special casing `start`, we have to be responsible\n // for spinning up the fiber if there were new messages added to\n // the queue between the completion of the effect and the transition\n // to the not running state.\n if (this._queue.length > 0) {\n this.drainQueueLaterOnExecutor();\n }\n }\n } else {\n this.tell(FiberMessage.resume(effect));\n }\n }\n /**\n * Begins execution of the effect associated with this fiber on in the\n * background, and on the correct thread pool. This can be called to \"kick\n * off\" execution of a fiber after it has been created, in hopes that the\n * effect can be executed synchronously.\n */\n startFork(effect) {\n this.tell(FiberMessage.resume(effect));\n }\n /**\n * Takes the current runtime flags, patches them to return the new runtime\n * flags, and then makes any changes necessary to fiber state based on the\n * specified patch.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n patchRuntimeFlags(oldRuntimeFlags, patch) {\n const newRuntimeFlags = runtimeFlags_.patch(oldRuntimeFlags, patch);\n globalThis[internalFiber.currentFiberURI] = this;\n this.currentRuntimeFlags = newRuntimeFlags;\n return newRuntimeFlags;\n }\n /**\n * Initiates an asynchronous operation, by building a callback that will\n * resume execution, and then feeding that callback to the registration\n * function, handling error cases and repeated resumptions appropriately.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n initiateAsync(runtimeFlags, asyncRegister) {\n let alreadyCalled = false;\n const callback = effect => {\n if (!alreadyCalled) {\n alreadyCalled = true;\n this.tell(FiberMessage.resume(effect));\n }\n };\n if (runtimeFlags_.interruptible(runtimeFlags)) {\n this._asyncInterruptor = callback;\n }\n try {\n asyncRegister(callback);\n } catch (e) {\n callback(core.failCause(internalCause.die(e)));\n }\n }\n pushStack(cont) {\n this._stack.push(cont);\n if (cont._op === \"OnStep\") {\n this._steps.push({\n refs: this.getFiberRefs(),\n flags: this.currentRuntimeFlags\n });\n }\n }\n popStack() {\n const item = this._stack.pop();\n if (item) {\n if (item._op === \"OnStep\") {\n this._steps.pop();\n }\n return item;\n }\n return;\n }\n getNextSuccessCont() {\n let frame = this.popStack();\n while (frame) {\n if (frame._op !== OpCodes.OP_ON_FAILURE) {\n return frame;\n }\n frame = this.popStack();\n }\n }\n getNextFailCont() {\n let frame = this.popStack();\n while (frame) {\n if (frame._op !== OpCodes.OP_ON_SUCCESS && frame._op !== OpCodes.OP_WHILE && frame._op !== OpCodes.OP_ITERATOR) {\n return frame;\n }\n frame = this.popStack();\n }\n }\n [OpCodes.OP_TAG](op) {\n return core.sync(() => Context.unsafeGet(this.currentContext, op));\n }\n [\"Left\"](op) {\n return core.fail(op.left);\n }\n [\"None\"](_) {\n return core.fail(new core.NoSuchElementException());\n }\n [\"Right\"](op) {\n return core.exitSucceed(op.right);\n }\n [\"Some\"](op) {\n return core.exitSucceed(op.value);\n }\n [\"Micro\"](op) {\n return core.unsafeAsync(microResume => {\n let resume = microResume;\n const fiber = Micro.runFork(Micro.provideContext(op, this.currentContext));\n fiber.addObserver(exit => {\n if (exit._tag === \"Success\") {\n return resume(core.exitSucceed(exit.value));\n }\n switch (exit.cause._tag) {\n case \"Interrupt\":\n {\n return resume(core.exitFailCause(internalCause.interrupt(FiberId.none)));\n }\n case \"Fail\":\n {\n return resume(core.fail(exit.cause.error));\n }\n case \"Die\":\n {\n return resume(core.die(exit.cause.defect));\n }\n }\n });\n return core.unsafeAsync(abortResume => {\n resume = _ => {\n abortResume(core.void);\n };\n fiber.unsafeInterrupt();\n });\n });\n }\n [OpCodes.OP_SYNC](op) {\n const value = internalCall(() => op.effect_instruction_i0());\n const cont = this.getNextSuccessCont();\n if (cont !== undefined) {\n if (!(cont._op in contOpSuccess)) {\n // @ts-expect-error\n absurd(cont);\n }\n // @ts-expect-error\n return contOpSuccess[cont._op](this, cont, value);\n } else {\n yieldedOpChannel.currentOp = core.exitSucceed(value);\n return YieldedOp;\n }\n }\n [OpCodes.OP_SUCCESS](op) {\n const oldCur = op;\n const cont = this.getNextSuccessCont();\n if (cont !== undefined) {\n if (!(cont._op in contOpSuccess)) {\n // @ts-expect-error\n absurd(cont);\n }\n // @ts-expect-error\n return contOpSuccess[cont._op](this, cont, oldCur.effect_instruction_i0);\n } else {\n yieldedOpChannel.currentOp = oldCur;\n return YieldedOp;\n }\n }\n [OpCodes.OP_FAILURE](op) {\n const cause = op.effect_instruction_i0;\n const cont = this.getNextFailCont();\n if (cont !== undefined) {\n switch (cont._op) {\n case OpCodes.OP_ON_FAILURE:\n case OpCodes.OP_ON_SUCCESS_AND_FAILURE:\n {\n if (!(runtimeFlags_.interruptible(this.currentRuntimeFlags) && this.isInterrupted())) {\n return internalCall(() => cont.effect_instruction_i1(cause));\n } else {\n return core.exitFailCause(internalCause.stripFailures(cause));\n }\n }\n case \"OnStep\":\n {\n if (!(runtimeFlags_.interruptible(this.currentRuntimeFlags) && this.isInterrupted())) {\n return core.exitSucceed(core.exitFailCause(cause));\n } else {\n return core.exitFailCause(internalCause.stripFailures(cause));\n }\n }\n case OpCodes.OP_REVERT_FLAGS:\n {\n this.patchRuntimeFlags(this.currentRuntimeFlags, cont.patch);\n if (runtimeFlags_.interruptible(this.currentRuntimeFlags) && this.isInterrupted()) {\n return core.exitFailCause(internalCause.sequential(cause, this.getInterruptedCause()));\n } else {\n return core.exitFailCause(cause);\n }\n }\n default:\n {\n absurd(cont);\n }\n }\n } else {\n yieldedOpChannel.currentOp = core.exitFailCause(cause);\n return YieldedOp;\n }\n }\n [OpCodes.OP_WITH_RUNTIME](op) {\n return internalCall(() => op.effect_instruction_i0(this, FiberStatus.running(this.currentRuntimeFlags)));\n }\n [\"Blocked\"](op) {\n const refs = this.getFiberRefs();\n const flags = this.currentRuntimeFlags;\n if (this._steps.length > 0) {\n const frames = [];\n const snap = this._steps[this._steps.length - 1];\n let frame = this.popStack();\n while (frame && frame._op !== \"OnStep\") {\n frames.push(frame);\n frame = this.popStack();\n }\n this.setFiberRefs(snap.refs);\n this.currentRuntimeFlags = snap.flags;\n const patchRefs = FiberRefsPatch.diff(snap.refs, refs);\n const patchFlags = runtimeFlags_.diff(snap.flags, flags);\n return core.exitSucceed(core.blocked(op.effect_instruction_i0, core.withFiberRuntime(newFiber => {\n while (frames.length > 0) {\n newFiber.pushStack(frames.pop());\n }\n newFiber.setFiberRefs(FiberRefsPatch.patch(newFiber.id(), newFiber.getFiberRefs())(patchRefs));\n newFiber.currentRuntimeFlags = runtimeFlags_.patch(patchFlags)(newFiber.currentRuntimeFlags);\n return op.effect_instruction_i1;\n })));\n }\n return core.uninterruptibleMask(restore => core.flatMap(forkDaemon(core.runRequestBlock(op.effect_instruction_i0)), () => restore(op.effect_instruction_i1)));\n }\n [\"RunBlocked\"](op) {\n return runBlockedRequests(op.effect_instruction_i0);\n }\n [OpCodes.OP_UPDATE_RUNTIME_FLAGS](op) {\n const updateFlags = op.effect_instruction_i0;\n const oldRuntimeFlags = this.currentRuntimeFlags;\n const newRuntimeFlags = runtimeFlags_.patch(oldRuntimeFlags, updateFlags);\n // One more chance to short circuit: if we're immediately going\n // to interrupt. Interruption will cause immediate reversion of\n // the flag, so as long as we \"peek ahead\", there's no need to\n // set them to begin with.\n if (runtimeFlags_.interruptible(newRuntimeFlags) && this.isInterrupted()) {\n return core.exitFailCause(this.getInterruptedCause());\n } else {\n // Impossible to short circuit, so record the changes\n this.patchRuntimeFlags(this.currentRuntimeFlags, updateFlags);\n if (op.effect_instruction_i1) {\n // Since we updated the flags, we need to revert them\n const revertFlags = runtimeFlags_.diff(newRuntimeFlags, oldRuntimeFlags);\n this.pushStack(new core.RevertFlags(revertFlags, op));\n return internalCall(() => op.effect_instruction_i1(oldRuntimeFlags));\n } else {\n return core.exitVoid;\n }\n }\n }\n [OpCodes.OP_ON_SUCCESS](op) {\n this.pushStack(op);\n return op.effect_instruction_i0;\n }\n [\"OnStep\"](op) {\n this.pushStack(op);\n return op.effect_instruction_i0;\n }\n [OpCodes.OP_ON_FAILURE](op) {\n this.pushStack(op);\n return op.effect_instruction_i0;\n }\n [OpCodes.OP_ON_SUCCESS_AND_FAILURE](op) {\n this.pushStack(op);\n return op.effect_instruction_i0;\n }\n [OpCodes.OP_ASYNC](op) {\n this._asyncBlockingOn = op.effect_instruction_i1;\n this.initiateAsync(this.currentRuntimeFlags, op.effect_instruction_i0);\n yieldedOpChannel.currentOp = op;\n return YieldedOp;\n }\n [OpCodes.OP_YIELD](op) {\n this._isYielding = false;\n yieldedOpChannel.currentOp = op;\n return YieldedOp;\n }\n [OpCodes.OP_WHILE](op) {\n const check = op.effect_instruction_i0;\n const body = op.effect_instruction_i1;\n if (check()) {\n this.pushStack(op);\n return body();\n } else {\n return core.exitVoid;\n }\n }\n [OpCodes.OP_ITERATOR](op) {\n return contOpSuccess[OpCodes.OP_ITERATOR](this, op, undefined);\n }\n [OpCodes.OP_COMMIT](op) {\n return internalCall(() => op.commit());\n }\n /**\n * The main run-loop for evaluating effects.\n *\n * **NOTE**: This method must be invoked by the fiber itself.\n */\n runLoop(effect0) {\n let cur = effect0;\n this.currentOpCount = 0;\n while (true) {\n if ((this.currentRuntimeFlags & OpSupervision) !== 0) {\n this.currentSupervisor.onEffect(this, cur);\n }\n if (this._queue.length > 0) {\n cur = this.drainQueueWhileRunning(this.currentRuntimeFlags, cur);\n }\n if (!this._isYielding) {\n this.currentOpCount += 1;\n const shouldYield = this.currentScheduler.shouldYield(this);\n if (shouldYield !== false) {\n this._isYielding = true;\n this.currentOpCount = 0;\n const oldCur = cur;\n cur = core.flatMap(core.yieldNow({\n priority: shouldYield\n }), () => oldCur);\n }\n }\n try {\n // @ts-expect-error\n cur = this.currentTracer.context(() => {\n if (_version !== cur[core.EffectTypeId]._V) {\n const level = this.getFiberRef(core.currentVersionMismatchErrorLogLevel);\n if (level._tag === \"Some\") {\n const effectVersion = cur[core.EffectTypeId]._V;\n this.log(`Executing an Effect versioned ${effectVersion} with a Runtime of version ${version.getCurrentVersion()}, you may want to dedupe the effect dependencies, you can use the language service plugin to detect this at compile time: https://github.com/Effect-TS/language-service`, internalCause.empty, level);\n }\n }\n // @ts-expect-error\n return this[cur._op](cur);\n }, this);\n if (cur === YieldedOp) {\n const op = yieldedOpChannel.currentOp;\n if (op._op === OpCodes.OP_YIELD || op._op === OpCodes.OP_ASYNC) {\n return YieldedOp;\n }\n yieldedOpChannel.currentOp = null;\n return op._op === OpCodes.OP_SUCCESS || op._op === OpCodes.OP_FAILURE ? op : core.exitFailCause(internalCause.die(op));\n }\n } catch (e) {\n if (cur !== YieldedOp && !Predicate.hasProperty(cur, \"_op\") || !(cur._op in this)) {\n cur = core.dieMessage(`Not a valid effect: ${Inspectable.toStringUnknown(cur)}`);\n } else if (core.isInterruptedException(e)) {\n cur = core.exitFailCause(internalCause.sequential(internalCause.die(e), internalCause.interrupt(FiberId.none)));\n } else {\n cur = core.die(e);\n }\n }\n }\n }\n run = () => {\n this.drainQueueOnCurrentThread();\n };\n}\n// circular with Logger\n/** @internal */\nexport const currentMinimumLogLevel = /*#__PURE__*/globalValue(\"effect/FiberRef/currentMinimumLogLevel\", () => core.fiberRefUnsafeMake(LogLevel.fromLiteral(\"Info\")));\n/** @internal */\nexport const loggerWithConsoleLog = self => internalLogger.makeLogger(opts => {\n const services = FiberRefs.getOrDefault(opts.context, defaultServices.currentServices);\n Context.get(services, consoleTag).unsafe.log(self.log(opts));\n});\n/** @internal */\nexport const loggerWithLeveledLog = self => internalLogger.makeLogger(opts => {\n const services = FiberRefs.getOrDefault(opts.context, defaultServices.currentServices);\n const unsafeLogger = Context.get(services, consoleTag).unsafe;\n switch (opts.logLevel._tag) {\n case \"Debug\":\n return unsafeLogger.debug(self.log(opts));\n case \"Info\":\n return unsafeLogger.info(self.log(opts));\n case \"Trace\":\n return unsafeLogger.trace(self.log(opts));\n case \"Warning\":\n return unsafeLogger.warn(self.log(opts));\n case \"Error\":\n case \"Fatal\":\n return unsafeLogger.error(self.log(opts));\n default:\n return unsafeLogger.log(self.log(opts));\n }\n});\n/** @internal */\nexport const loggerWithConsoleError = self => internalLogger.makeLogger(opts => {\n const services = FiberRefs.getOrDefault(opts.context, defaultServices.currentServices);\n Context.get(services, consoleTag).unsafe.error(self.log(opts));\n});\n/** @internal */\nexport const defaultLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Logger/defaultLogger\"), () => loggerWithConsoleLog(internalLogger.stringLogger));\n/** @internal */\nexport const jsonLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Logger/jsonLogger\"), () => loggerWithConsoleLog(internalLogger.jsonLogger));\n/** @internal */\nexport const logFmtLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Logger/logFmtLogger\"), () => loggerWithConsoleLog(internalLogger.logfmtLogger));\n/** @internal */\nexport const prettyLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Logger/prettyLogger\"), () => internalLogger.prettyLoggerDefault);\n/** @internal */\nexport const structuredLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Logger/structuredLogger\"), () => loggerWithConsoleLog(internalLogger.structuredLogger));\n/** @internal */\nexport const tracerLogger = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/Logger/tracerLogger\"), () => internalLogger.makeLogger(({\n annotations,\n cause,\n context,\n fiberId,\n logLevel,\n message\n}) => {\n const span = Context.getOption(fiberRefs.getOrDefault(context, core.currentContext), tracer.spanTag);\n if (span._tag === \"None\" || span.value._tag === \"ExternalSpan\") {\n return;\n }\n const clockService = Context.unsafeGet(fiberRefs.getOrDefault(context, defaultServices.currentServices), clock.clockTag);\n const attributes = {};\n for (const [key, value] of annotations) {\n attributes[key] = value;\n }\n attributes[\"effect.fiberId\"] = FiberId.threadName(fiberId);\n attributes[\"effect.logLevel\"] = logLevel.label;\n if (cause !== null && cause._tag !== \"Empty\") {\n attributes[\"effect.cause\"] = internalCause.pretty(cause, {\n renderErrorCause: true\n });\n }\n span.value.event(Inspectable.toStringUnknown(Array.isArray(message) && message.length === 1 ? message[0] : message), clockService.unsafeCurrentTimeNanos(), attributes);\n}));\n/** @internal */\nexport const loggerWithSpanAnnotations = self => internalLogger.mapInputOptions(self, options => {\n const span = Option.flatMap(fiberRefs.get(options.context, core.currentContext), Context.getOption(tracer.spanTag));\n if (span._tag === \"None\") {\n return options;\n }\n return {\n ...options,\n annotations: pipe(options.annotations, HashMap.set(\"effect.traceId\", span.value.traceId), HashMap.set(\"effect.spanId\", span.value.spanId), span.value._tag === \"Span\" ? HashMap.set(\"effect.spanName\", span.value.name) : identity)\n };\n});\n/** @internal */\nexport const currentLoggers = /*#__PURE__*/globalValue(/*#__PURE__*/Symbol.for(\"effect/FiberRef/currentLoggers\"), () => core.fiberRefUnsafeMakeHashSet(HashSet.make(defaultLogger, tracerLogger)));\n/** @internal */\nexport const batchedLogger = /*#__PURE__*/dual(3, (self, window, f) => core.flatMap(scope, scope => {\n let buffer = [];\n const flush = core.suspend(() => {\n if (buffer.length === 0) {\n return core.void;\n }\n const arr = buffer;\n buffer = [];\n return f(arr);\n });\n return core.uninterruptibleMask(restore => pipe(internalEffect.sleep(window), core.zipRight(flush), internalEffect.forever, restore, forkDaemon, core.flatMap(fiber => core.scopeAddFinalizer(scope, core.interruptFiber(fiber))), core.zipRight(addFinalizer(() => flush)), core.as(internalLogger.makeLogger(options => {\n buffer.push(self.log(options));\n }))));\n}));\nexport const annotateLogsScoped = function () {\n if (typeof arguments[0] === \"string\") {\n return fiberRefLocallyScopedWith(core.currentLogAnnotations, HashMap.set(arguments[0], arguments[1]));\n }\n const entries = Object.entries(arguments[0]);\n return fiberRefLocallyScopedWith(core.currentLogAnnotations, HashMap.mutate(annotations => {\n for (let i = 0; i < entries.length; i++) {\n const [key, value] = entries[i];\n HashMap.set(annotations, key, value);\n }\n return annotations;\n }));\n};\n/** @internal */\nexport const whenLogLevel = /*#__PURE__*/dual(2, (effect, level) => {\n const requiredLogLevel = typeof level === \"string\" ? LogLevel.fromLiteral(level) : level;\n return core.withFiberRuntime(fiberState => {\n const minimumLogLevel = fiberState.getFiberRef(currentMinimumLogLevel);\n // Imitate the behaviour of `FiberRuntime.log`\n if (LogLevel.greaterThan(minimumLogLevel, requiredLogLevel)) {\n return core.succeed(Option.none());\n }\n return core.map(effect, Option.some);\n });\n});\n// circular with Effect\n/* @internal */\nexport const acquireRelease = /*#__PURE__*/dual(args => core.isEffect(args[0]), (acquire, release) => core.uninterruptible(core.tap(acquire, a => addFinalizer(exit => release(a, exit)))));\n/* @internal */\nexport const acquireReleaseInterruptible = /*#__PURE__*/dual(args => core.isEffect(args[0]), (acquire, release) => ensuring(acquire, addFinalizer(exit => release(exit))));\n/* @internal */\nexport const addFinalizer = finalizer => core.withFiberRuntime(runtime => {\n const acquireRefs = runtime.getFiberRefs();\n const acquireFlags = runtimeFlags_.disable(runtime.currentRuntimeFlags, runtimeFlags_.Interruption);\n return core.flatMap(scope, scope => core.scopeAddFinalizerExit(scope, exit => core.withFiberRuntime(runtimeFinalizer => {\n const preRefs = runtimeFinalizer.getFiberRefs();\n const preFlags = runtimeFinalizer.currentRuntimeFlags;\n const patchRefs = FiberRefsPatch.diff(preRefs, acquireRefs);\n const patchFlags = runtimeFlags_.diff(preFlags, acquireFlags);\n const inverseRefs = FiberRefsPatch.diff(acquireRefs, preRefs);\n runtimeFinalizer.setFiberRefs(FiberRefsPatch.patch(patchRefs, runtimeFinalizer.id(), acquireRefs));\n return ensuring(core.withRuntimeFlags(finalizer(exit), patchFlags), core.sync(() => {\n runtimeFinalizer.setFiberRefs(FiberRefsPatch.patch(inverseRefs, runtimeFinalizer.id(), runtimeFinalizer.getFiberRefs()));\n }));\n })));\n});\n/* @internal */\nexport const daemonChildren = self => {\n const forkScope = core.fiberRefLocally(core.currentForkScopeOverride, Option.some(fiberScope.globalScope));\n return forkScope(self);\n};\n/** @internal */\nconst _existsParFound = /*#__PURE__*/Symbol.for(\"effect/Effect/existsPar/found\");\n/* @internal */\nexport const exists = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]) && !core.isEffect(args[0]), (elements, predicate, options) => concurrency.matchSimple(options?.concurrency, () => core.suspend(() => existsLoop(elements[Symbol.iterator](), 0, predicate)), () => core.matchEffect(forEach(elements, (a, i) => core.if_(predicate(a, i), {\n onTrue: () => core.fail(_existsParFound),\n onFalse: () => core.void\n}), options), {\n onFailure: e => e === _existsParFound ? core.succeed(true) : core.fail(e),\n onSuccess: () => core.succeed(false)\n})));\nconst existsLoop = (iterator, index, f) => {\n const next = iterator.next();\n if (next.done) {\n return core.succeed(false);\n }\n return core.flatMap(f(next.value, index), b => b ? core.succeed(b) : existsLoop(iterator, index + 1, f));\n};\n/* @internal */\nexport const filter = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]) && !core.isEffect(args[0]), (elements, predicate, options) => {\n const predicate_ = options?.negate ? (a, i) => core.map(predicate(a, i), Boolean.not) : predicate;\n return concurrency.matchSimple(options?.concurrency, () => core.suspend(() => RA.fromIterable(elements).reduceRight((effect, a, i) => core.zipWith(effect, core.suspend(() => predicate_(a, i)), (list, b) => b ? [a, ...list] : list), core.sync(() => new Array()))), () => core.map(forEach(elements, (a, i) => core.map(predicate_(a, i), b => b ? Option.some(a) : Option.none()), options), RA.getSomes));\n});\n// === all\nconst allResolveInput = input => {\n if (Array.isArray(input) || Predicate.isIterable(input)) {\n return [input, Option.none()];\n }\n const keys = Object.keys(input);\n const size = keys.length;\n return [keys.map(k => input[k]), Option.some(values => {\n const res = {};\n for (let i = 0; i < size; i++) {\n ;\n res[keys[i]] = values[i];\n }\n return res;\n })];\n};\nconst allValidate = (effects, reconcile, options) => {\n const eitherEffects = [];\n for (const effect of effects) {\n eitherEffects.push(core.either(effect));\n }\n return core.flatMap(forEach(eitherEffects, identity, {\n concurrency: options?.concurrency,\n batching: options?.batching,\n concurrentFinalizers: options?.concurrentFinalizers\n }), eithers => {\n const none = Option.none();\n const size = eithers.length;\n const errors = new Array(size);\n const successes = new Array(size);\n let errored = false;\n for (let i = 0; i < size; i++) {\n const either = eithers[i];\n if (either._tag === \"Left\") {\n errors[i] = Option.some(either.left);\n errored = true;\n } else {\n successes[i] = either.right;\n errors[i] = none;\n }\n }\n if (errored) {\n return reconcile._tag === \"Some\" ? core.fail(reconcile.value(errors)) : core.fail(errors);\n } else if (options?.discard) {\n return core.void;\n }\n return reconcile._tag === \"Some\" ? core.succeed(reconcile.value(successes)) : core.succeed(successes);\n });\n};\nconst allEither = (effects, reconcile, options) => {\n const eitherEffects = [];\n for (const effect of effects) {\n eitherEffects.push(core.either(effect));\n }\n if (options?.discard) {\n return forEach(eitherEffects, identity, {\n concurrency: options?.concurrency,\n batching: options?.batching,\n discard: true,\n concurrentFinalizers: options?.concurrentFinalizers\n });\n }\n return core.map(forEach(eitherEffects, identity, {\n concurrency: options?.concurrency,\n batching: options?.batching,\n concurrentFinalizers: options?.concurrentFinalizers\n }), eithers => reconcile._tag === \"Some\" ? reconcile.value(eithers) : eithers);\n};\n/* @internal */\nexport const all = (arg, options) => {\n const [effects, reconcile] = allResolveInput(arg);\n if (options?.mode === \"validate\") {\n return allValidate(effects, reconcile, options);\n } else if (options?.mode === \"either\") {\n return allEither(effects, reconcile, options);\n }\n return options?.discard !== true && reconcile._tag === \"Some\" ? core.map(forEach(effects, identity, options), reconcile.value) : forEach(effects, identity, options);\n};\n/* @internal */\nexport const allWith = options => arg => all(arg, options);\n/* @internal */\nexport const allSuccesses = (elements, options) => core.map(all(RA.fromIterable(elements).map(core.exit), options), RA.filterMap(exit => core.exitIsSuccess(exit) ? Option.some(exit.effect_instruction_i0) : Option.none()));\n/* @internal */\nexport const replicate = /*#__PURE__*/dual(2, (self, n) => Array.from({\n length: n\n}, () => self));\n/* @internal */\nexport const replicateEffect = /*#__PURE__*/dual(args => core.isEffect(args[0]), (self, n, options) => all(replicate(self, n), options));\n/* @internal */\nexport const forEach = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]), (self, f, options) => core.withFiberRuntime(r => {\n const isRequestBatchingEnabled = options?.batching === true || options?.batching === \"inherit\" && r.getFiberRef(core.currentRequestBatching);\n if (options?.discard) {\n return concurrency.match(options.concurrency, () => finalizersMaskInternal(ExecutionStrategy.sequential, options?.concurrentFinalizers)(restore => isRequestBatchingEnabled ? forEachConcurrentDiscard(self, (a, i) => restore(f(a, i)), true, false, 1) : core.forEachSequentialDiscard(self, (a, i) => restore(f(a, i)))), () => finalizersMaskInternal(ExecutionStrategy.parallel, options?.concurrentFinalizers)(restore => forEachConcurrentDiscard(self, (a, i) => restore(f(a, i)), isRequestBatchingEnabled, false)), n => finalizersMaskInternal(ExecutionStrategy.parallelN(n), options?.concurrentFinalizers)(restore => forEachConcurrentDiscard(self, (a, i) => restore(f(a, i)), isRequestBatchingEnabled, false, n)));\n }\n return concurrency.match(options?.concurrency, () => finalizersMaskInternal(ExecutionStrategy.sequential, options?.concurrentFinalizers)(restore => isRequestBatchingEnabled ? forEachParN(self, 1, (a, i) => restore(f(a, i)), true) : core.forEachSequential(self, (a, i) => restore(f(a, i)))), () => finalizersMaskInternal(ExecutionStrategy.parallel, options?.concurrentFinalizers)(restore => forEachParUnbounded(self, (a, i) => restore(f(a, i)), isRequestBatchingEnabled)), n => finalizersMaskInternal(ExecutionStrategy.parallelN(n), options?.concurrentFinalizers)(restore => forEachParN(self, n, (a, i) => restore(f(a, i)), isRequestBatchingEnabled)));\n}));\n/* @internal */\nexport const forEachParUnbounded = (self, f, batching) => core.suspend(() => {\n const as = RA.fromIterable(self);\n const array = new Array(as.length);\n const fn = (a, i) => core.flatMap(f(a, i), b => core.sync(() => array[i] = b));\n return core.zipRight(forEachConcurrentDiscard(as, fn, batching, false), core.succeed(array));\n});\n/** @internal */\nexport const forEachConcurrentDiscard = (self, f, batching, processAll, n) => core.uninterruptibleMask(restore => core.transplant(graft => core.withFiberRuntime(parent => {\n let todos = Array.from(self).reverse();\n let target = todos.length;\n if (target === 0) {\n return core.void;\n }\n let counter = 0;\n let interrupted = false;\n const fibersCount = n ? Math.min(todos.length, n) : todos.length;\n const fibers = new Set();\n const results = new Array();\n const interruptAll = () => fibers.forEach(fiber => {\n fiber.currentScheduler.scheduleTask(() => {\n fiber.unsafeInterruptAsFork(parent.id());\n }, 0);\n });\n const startOrder = new Array();\n const joinOrder = new Array();\n const residual = new Array();\n const collectExits = () => {\n const exits = results.filter(({\n exit\n }) => exit._tag === \"Failure\").sort((a, b) => a.index < b.index ? -1 : a.index === b.index ? 0 : 1).map(({\n exit\n }) => exit);\n if (exits.length === 0) {\n exits.push(core.exitVoid);\n }\n return exits;\n };\n const runFiber = (eff, interruptImmediately = false) => {\n const runnable = core.uninterruptible(graft(eff));\n const fiber = unsafeForkUnstarted(runnable, parent, parent.currentRuntimeFlags, fiberScope.globalScope);\n parent.currentScheduler.scheduleTask(() => {\n if (interruptImmediately) {\n fiber.unsafeInterruptAsFork(parent.id());\n }\n fiber.resume(runnable);\n }, 0);\n return fiber;\n };\n const onInterruptSignal = () => {\n if (!processAll) {\n target -= todos.length;\n todos = [];\n }\n interrupted = true;\n interruptAll();\n };\n const stepOrExit = batching ? core.step : core.exit;\n const processingFiber = runFiber(core.async(resume => {\n const pushResult = (res, index) => {\n if (res._op === \"Blocked\") {\n residual.push(res);\n } else {\n results.push({\n index,\n exit: res\n });\n if (res._op === \"Failure\" && !interrupted) {\n onInterruptSignal();\n }\n }\n };\n const next = () => {\n if (todos.length > 0) {\n const a = todos.pop();\n let index = counter++;\n const returnNextElement = () => {\n const a = todos.pop();\n index = counter++;\n return core.flatMap(core.yieldNow(), () => core.flatMap(stepOrExit(restore(f(a, index))), onRes));\n };\n const onRes = res => {\n if (todos.length > 0) {\n pushResult(res, index);\n if (todos.length > 0) {\n return returnNextElement();\n }\n }\n return core.succeed(res);\n };\n const todo = core.flatMap(stepOrExit(restore(f(a, index))), onRes);\n const fiber = runFiber(todo);\n startOrder.push(fiber);\n fibers.add(fiber);\n if (interrupted) {\n fiber.currentScheduler.scheduleTask(() => {\n fiber.unsafeInterruptAsFork(parent.id());\n }, 0);\n }\n fiber.addObserver(wrapped => {\n let exit;\n if (wrapped._op === \"Failure\") {\n exit = wrapped;\n } else {\n exit = wrapped.effect_instruction_i0;\n }\n joinOrder.push(fiber);\n fibers.delete(fiber);\n pushResult(exit, index);\n if (results.length === target) {\n resume(core.succeed(Option.getOrElse(core.exitCollectAll(collectExits(), {\n parallel: true\n }), () => core.exitVoid)));\n } else if (residual.length + results.length === target) {\n const exits = collectExits();\n const requests = residual.map(blocked => blocked.effect_instruction_i0).reduce(RequestBlock_.par);\n resume(core.succeed(core.blocked(requests, forEachConcurrentDiscard([Option.getOrElse(core.exitCollectAll(exits, {\n parallel: true\n }), () => core.exitVoid), ...residual.map(blocked => blocked.effect_instruction_i1)], i => i, batching, true, n))));\n } else {\n next();\n }\n });\n }\n };\n for (let i = 0; i < fibersCount; i++) {\n next();\n }\n }));\n return core.asVoid(core.onExit(core.flatten(restore(internalFiber.join(processingFiber))), core.exitMatch({\n onFailure: cause => {\n onInterruptSignal();\n const target = residual.length + 1;\n const concurrency = Math.min(typeof n === \"number\" ? n : residual.length, residual.length);\n const toPop = Array.from(residual);\n return core.async(cb => {\n const exits = [];\n let count = 0;\n let index = 0;\n const check = (index, hitNext) => exit => {\n exits[index] = exit;\n count++;\n if (count === target) {\n cb(core.exitSucceed(core.exitFailCause(cause)));\n }\n if (toPop.length > 0 && hitNext) {\n next();\n }\n };\n const next = () => {\n runFiber(toPop.pop(), true).addObserver(check(index, true));\n index++;\n };\n processingFiber.addObserver(check(index, false));\n index++;\n for (let i = 0; i < concurrency; i++) {\n next();\n }\n });\n },\n onSuccess: () => core.forEachSequential(joinOrder, f => f.inheritAll)\n })));\n})));\n/* @internal */\nexport const forEachParN = (self, n, f, batching) => core.suspend(() => {\n const as = RA.fromIterable(self);\n const array = new Array(as.length);\n const fn = (a, i) => core.map(f(a, i), b => array[i] = b);\n return core.zipRight(forEachConcurrentDiscard(as, fn, batching, false, n), core.succeed(array));\n});\n/* @internal */\nexport const fork = self => core.withFiberRuntime((state, status) => core.succeed(unsafeFork(self, state, status.runtimeFlags)));\n/* @internal */\nexport const forkDaemon = self => forkWithScopeOverride(self, fiberScope.globalScope);\n/* @internal */\nexport const forkWithErrorHandler = /*#__PURE__*/dual(2, (self, handler) => fork(core.onError(self, cause => {\n const either = internalCause.failureOrCause(cause);\n switch (either._tag) {\n case \"Left\":\n return handler(either.left);\n case \"Right\":\n return core.failCause(either.right);\n }\n})));\n/** @internal */\nexport const unsafeFork = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {\n const childFiber = unsafeMakeChildFiber(effect, parentFiber, parentRuntimeFlags, overrideScope);\n childFiber.resume(effect);\n return childFiber;\n};\n/** @internal */\nexport const unsafeForkUnstarted = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {\n const childFiber = unsafeMakeChildFiber(effect, parentFiber, parentRuntimeFlags, overrideScope);\n return childFiber;\n};\n/** @internal */\nexport const unsafeMakeChildFiber = (effect, parentFiber, parentRuntimeFlags, overrideScope = null) => {\n const childId = FiberId.unsafeMake();\n const parentFiberRefs = parentFiber.getFiberRefs();\n const childFiberRefs = fiberRefs.forkAs(parentFiberRefs, childId);\n const childFiber = new FiberRuntime(childId, childFiberRefs, parentRuntimeFlags);\n const childContext = fiberRefs.getOrDefault(childFiberRefs, core.currentContext);\n const supervisor = childFiber.currentSupervisor;\n supervisor.onStart(childContext, effect, Option.some(parentFiber), childFiber);\n childFiber.addObserver(exit => supervisor.onEnd(exit, childFiber));\n const parentScope = overrideScope !== null ? overrideScope : pipe(parentFiber.getFiberRef(core.currentForkScopeOverride), Option.getOrElse(() => parentFiber.scope()));\n parentScope.add(parentRuntimeFlags, childFiber);\n return childFiber;\n};\n/* @internal */\nconst forkWithScopeOverride = (self, scopeOverride) => core.withFiberRuntime((parentFiber, parentStatus) => core.succeed(unsafeFork(self, parentFiber, parentStatus.runtimeFlags, scopeOverride)));\n/* @internal */\nexport const mergeAll = /*#__PURE__*/dual(args => Predicate.isFunction(args[2]), (elements, zero, f, options) => concurrency.matchSimple(options?.concurrency, () => RA.fromIterable(elements).reduce((acc, a, i) => core.zipWith(acc, a, (acc, a) => f(acc, a, i)), core.succeed(zero)), () => core.flatMap(Ref.make(zero), acc => core.flatMap(forEach(elements, (effect, i) => core.flatMap(effect, a => Ref.update(acc, b => f(b, a, i))), options), () => Ref.get(acc)))));\n/* @internal */\nexport const partition = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]), (elements, f, options) => pipe(forEach(elements, (a, i) => core.either(f(a, i)), options), core.map(chunk => core.partitionMap(chunk, identity))));\n/* @internal */\nexport const validateAll = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]), (elements, f, options) => core.flatMap(partition(elements, f, {\n concurrency: options?.concurrency,\n batching: options?.batching,\n concurrentFinalizers: options?.concurrentFinalizers\n}), ([es, bs]) => RA.isNonEmptyArray(es) ? core.fail(es) : options?.discard ? core.void : core.succeed(bs)));\n/* @internal */\nexport const raceAll = all => core.withFiberRuntime((state, status) => core.async(resume => {\n const fibers = new Set();\n let winner;\n let failures = internalCause.empty;\n const interruptAll = () => {\n for (const fiber of fibers) {\n fiber.unsafeInterruptAsFork(state.id());\n }\n };\n let latch = false;\n let empty = true;\n for (const self of all) {\n empty = false;\n const fiber = unsafeFork(core.interruptible(self), state, status.runtimeFlags);\n fibers.add(fiber);\n fiber.addObserver(exit => {\n fibers.delete(fiber);\n if (!winner) {\n if (exit._tag === \"Success\") {\n latch = true;\n winner = fiber;\n failures = internalCause.empty;\n interruptAll();\n } else {\n failures = internalCause.parallel(exit.cause, failures);\n }\n }\n if (latch && fibers.size === 0) {\n resume(winner ? core.zipRight(internalFiber.inheritAll(winner), winner.unsafePoll()) : core.failCause(failures));\n }\n });\n if (winner) break;\n }\n if (empty) {\n return resume(core.dieSync(() => new core.IllegalArgumentException(`Received an empty collection of effects`)));\n }\n latch = true;\n return internalFiber.interruptAllAs(fibers, state.id());\n}));\n/* @internal */\nexport const reduceEffect = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]) && !core.isEffect(args[0]), (elements, zero, f, options) => concurrency.matchSimple(options?.concurrency, () => RA.fromIterable(elements).reduce((acc, a, i) => core.zipWith(acc, a, (acc, a) => f(acc, a, i)), zero), () => core.suspend(() => pipe(mergeAll([zero, ...elements], Option.none(), (acc, elem, i) => {\n switch (acc._tag) {\n case \"None\":\n {\n return Option.some(elem);\n }\n case \"Some\":\n {\n return Option.some(f(acc.value, elem, i));\n }\n }\n}, options), core.map(option => {\n switch (option._tag) {\n case \"None\":\n {\n throw new Error(\"BUG: Effect.reduceEffect - please report an issue at https://github.com/Effect-TS/effect/issues\");\n }\n case \"Some\":\n {\n return option.value;\n }\n }\n})))));\n/* @internal */\nexport const parallelFinalizers = self => core.contextWithEffect(context => Option.match(Context.getOption(context, scopeTag), {\n onNone: () => self,\n onSome: scope => {\n switch (scope.strategy._tag) {\n case \"Parallel\":\n return self;\n case \"Sequential\":\n case \"ParallelN\":\n return core.flatMap(core.scopeFork(scope, ExecutionStrategy.parallel), inner => scopeExtend(self, inner));\n }\n }\n}));\n/* @internal */\nexport const parallelNFinalizers = parallelism => self => core.contextWithEffect(context => Option.match(Context.getOption(context, scopeTag), {\n onNone: () => self,\n onSome: scope => {\n if (scope.strategy._tag === \"ParallelN\" && scope.strategy.parallelism === parallelism) {\n return self;\n }\n return core.flatMap(core.scopeFork(scope, ExecutionStrategy.parallelN(parallelism)), inner => scopeExtend(self, inner));\n }\n}));\n/* @internal */\nexport const finalizersMask = strategy => self => finalizersMaskInternal(strategy, true)(self);\n/* @internal */\nexport const finalizersMaskInternal = (strategy, concurrentFinalizers) => self => core.contextWithEffect(context => Option.match(Context.getOption(context, scopeTag), {\n onNone: () => self(identity),\n onSome: scope => {\n if (concurrentFinalizers === true) {\n const patch = strategy._tag === \"Parallel\" ? parallelFinalizers : strategy._tag === \"Sequential\" ? sequentialFinalizers : parallelNFinalizers(strategy.parallelism);\n switch (scope.strategy._tag) {\n case \"Parallel\":\n return patch(self(parallelFinalizers));\n case \"Sequential\":\n return patch(self(sequentialFinalizers));\n case \"ParallelN\":\n return patch(self(parallelNFinalizers(scope.strategy.parallelism)));\n }\n } else {\n return self(identity);\n }\n }\n}));\n/* @internal */\nexport const scopeWith = f => core.flatMap(scopeTag, f);\n/** @internal */\nexport const scopedWith = f => core.flatMap(scopeMake(), scope => core.onExit(f(scope), exit => scope.close(exit)));\n/* @internal */\nexport const scopedEffect = effect => core.flatMap(scopeMake(), scope => scopeUse(effect, scope));\n/* @internal */\nexport const sequentialFinalizers = self => core.contextWithEffect(context => Option.match(Context.getOption(context, scopeTag), {\n onNone: () => self,\n onSome: scope => {\n switch (scope.strategy._tag) {\n case \"Sequential\":\n return self;\n case \"Parallel\":\n case \"ParallelN\":\n return core.flatMap(core.scopeFork(scope, ExecutionStrategy.sequential), inner => scopeExtend(self, inner));\n }\n }\n}));\n/* @internal */\nexport const tagMetricsScoped = (key, value) => labelMetricsScoped([metricLabel.make(key, value)]);\n/* @internal */\nexport const labelMetricsScoped = labels => fiberRefLocallyScopedWith(core.currentMetricLabels, old => RA.union(old, labels));\n/* @internal */\nexport const using = /*#__PURE__*/dual(2, (self, use) => scopedWith(scope => core.flatMap(scopeExtend(self, scope), use)));\n/** @internal */\nexport const validate = /*#__PURE__*/dual(args => core.isEffect(args[1]), (self, that, options) => validateWith(self, that, (a, b) => [a, b], options));\n/** @internal */\nexport const validateWith = /*#__PURE__*/dual(args => core.isEffect(args[1]), (self, that, f, options) => core.flatten(zipWithOptions(core.exit(self), core.exit(that), (ea, eb) => core.exitZipWith(ea, eb, {\n onSuccess: f,\n onFailure: (ca, cb) => options?.concurrent ? internalCause.parallel(ca, cb) : internalCause.sequential(ca, cb)\n}), options)));\n/* @internal */\nexport const validateAllPar = /*#__PURE__*/dual(2, (elements, f) => core.flatMap(partition(elements, f), ([es, bs]) => es.length === 0 ? core.succeed(bs) : core.fail(es)));\n/* @internal */\nexport const validateAllParDiscard = /*#__PURE__*/dual(2, (elements, f) => core.flatMap(partition(elements, f), ([es, _]) => es.length === 0 ? core.void : core.fail(es)));\n/* @internal */\nexport const validateFirst = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]), (elements, f, options) => core.flip(forEach(elements, (a, i) => core.flip(f(a, i)), options)));\n/* @internal */\nexport const withClockScoped = c => fiberRefLocallyScopedWith(defaultServices.currentServices, Context.add(clock.clockTag, c));\n/* @internal */\nexport const withRandomScoped = value => fiberRefLocallyScopedWith(defaultServices.currentServices, Context.add(randomTag, value));\n/* @internal */\nexport const withConfigProviderScoped = provider => fiberRefLocallyScopedWith(defaultServices.currentServices, Context.add(configProviderTag, provider));\n/* @internal */\nexport const withEarlyRelease = self => scopeWith(parent => core.flatMap(core.scopeFork(parent, executionStrategy.sequential), child => pipe(self, scopeExtend(child), core.map(value => [core.fiberIdWith(fiberId => core.scopeClose(child, core.exitInterrupt(fiberId))), value]))));\n/** @internal */\nexport const zipOptions = /*#__PURE__*/dual(args => core.isEffect(args[1]), (self, that, options) => zipWithOptions(self, that, (a, b) => [a, b], options));\n/** @internal */\nexport const zipLeftOptions = /*#__PURE__*/dual(args => core.isEffect(args[1]), (self, that, options) => {\n if (options?.concurrent !== true && (options?.batching === undefined || options.batching === false)) {\n return core.zipLeft(self, that);\n }\n return zipWithOptions(self, that, (a, _) => a, options);\n});\n/** @internal */\nexport const zipRightOptions = /*#__PURE__*/dual(args => core.isEffect(args[1]), (self, that, options) => {\n if (options?.concurrent !== true && (options?.batching === undefined || options.batching === false)) {\n return core.zipRight(self, that);\n }\n return zipWithOptions(self, that, (_, b) => b, options);\n});\n/** @internal */\nexport const zipWithOptions = /*#__PURE__*/dual(args => core.isEffect(args[1]), (self, that, f, options) => core.map(all([self, that], {\n concurrency: options?.concurrent ? 2 : 1,\n batching: options?.batching,\n concurrentFinalizers: options?.concurrentFinalizers\n}), ([a, a2]) => f(a, a2)));\n/* @internal */\nexport const withRuntimeFlagsScoped = update => {\n if (update === RuntimeFlagsPatch.empty) {\n return core.void;\n }\n return pipe(core.runtimeFlags, core.flatMap(runtimeFlags => {\n const updatedRuntimeFlags = runtimeFlags_.patch(runtimeFlags, update);\n const revertRuntimeFlags = runtimeFlags_.diff(updatedRuntimeFlags, runtimeFlags);\n return pipe(core.updateRuntimeFlags(update), core.zipRight(addFinalizer(() => core.updateRuntimeFlags(revertRuntimeFlags))), core.asVoid);\n }), core.uninterruptible);\n};\n// circular with Scope\n/** @internal */\nexport const scopeTag = /*#__PURE__*/Context.GenericTag(\"effect/Scope\");\n/* @internal */\nexport const scope = scopeTag;\nconst scopeUnsafeAddFinalizer = (scope, fin) => {\n if (scope.state._tag === \"Open\") {\n scope.state.finalizers.set({}, fin);\n }\n};\nconst ScopeImplProto = {\n [core.ScopeTypeId]: core.ScopeTypeId,\n [core.CloseableScopeTypeId]: core.CloseableScopeTypeId,\n pipe() {\n return pipeArguments(this, arguments);\n },\n fork(strategy) {\n return core.sync(() => {\n const newScope = scopeUnsafeMake(strategy);\n if (this.state._tag === \"Closed\") {\n newScope.state = this.state;\n return newScope;\n }\n const key = {};\n const fin = exit => newScope.close(exit);\n this.state.finalizers.set(key, fin);\n scopeUnsafeAddFinalizer(newScope, _ => core.sync(() => {\n if (this.state._tag === \"Open\") {\n this.state.finalizers.delete(key);\n }\n }));\n return newScope;\n });\n },\n close(exit) {\n return core.suspend(() => {\n if (this.state._tag === \"Closed\") {\n return core.void;\n }\n const finalizers = Array.from(this.state.finalizers.values()).reverse();\n this.state = {\n _tag: \"Closed\",\n exit\n };\n if (finalizers.length === 0) {\n return core.void;\n }\n return executionStrategy.isSequential(this.strategy) ? pipe(core.forEachSequential(finalizers, fin => core.exit(fin(exit))), core.flatMap(results => pipe(core.exitCollectAll(results), Option.map(core.exitAsVoid), Option.getOrElse(() => core.exitVoid)))) : executionStrategy.isParallel(this.strategy) ? pipe(forEachParUnbounded(finalizers, fin => core.exit(fin(exit)), false), core.flatMap(results => pipe(core.exitCollectAll(results, {\n parallel: true\n }), Option.map(core.exitAsVoid), Option.getOrElse(() => core.exitVoid)))) : pipe(forEachParN(finalizers, this.strategy.parallelism, fin => core.exit(fin(exit)), false), core.flatMap(results => pipe(core.exitCollectAll(results, {\n parallel: true\n }), Option.map(core.exitAsVoid), Option.getOrElse(() => core.exitVoid))));\n });\n },\n addFinalizer(fin) {\n return core.suspend(() => {\n if (this.state._tag === \"Closed\") {\n return fin(this.state.exit);\n }\n this.state.finalizers.set({}, fin);\n return core.void;\n });\n }\n};\nconst scopeUnsafeMake = (strategy = executionStrategy.sequential) => {\n const scope = Object.create(ScopeImplProto);\n scope.strategy = strategy;\n scope.state = {\n _tag: \"Open\",\n finalizers: new Map()\n };\n return scope;\n};\n/* @internal */\nexport const scopeMake = (strategy = executionStrategy.sequential) => core.sync(() => scopeUnsafeMake(strategy));\n/* @internal */\nexport const scopeExtend = /*#__PURE__*/dual(2, (effect, scope) => core.mapInputContext(effect,\n// @ts-expect-error\nContext.merge(Context.make(scopeTag, scope))));\n/* @internal */\nexport const scopeUse = /*#__PURE__*/dual(2, (effect, scope) => pipe(effect, scopeExtend(scope), core.onExit(exit => scope.close(exit))));\n// circular with Supervisor\n/** @internal */\nexport const fiberRefUnsafeMakeSupervisor = initial => core.fiberRefUnsafeMakePatch(initial, {\n differ: SupervisorPatch.differ,\n fork: SupervisorPatch.empty\n});\n// circular with FiberRef\n/* @internal */\nexport const fiberRefLocallyScoped = /*#__PURE__*/dual(2, (self, value) => core.asVoid(acquireRelease(core.flatMap(core.fiberRefGet(self), oldValue => core.as(core.fiberRefSet(self, value), oldValue)), oldValue => core.fiberRefSet(self, oldValue))));\n/* @internal */\nexport const fiberRefLocallyScopedWith = /*#__PURE__*/dual(2, (self, f) => core.fiberRefGetWith(self, a => fiberRefLocallyScoped(self, f(a))));\n/* @internal */\nexport const fiberRefMake = (initial, options) => fiberRefMakeWith(() => core.fiberRefUnsafeMake(initial, options));\n/* @internal */\nexport const fiberRefMakeWith = ref => acquireRelease(core.tap(core.sync(ref), ref => core.fiberRefUpdate(ref, identity)), fiberRef => core.fiberRefDelete(fiberRef));\n/* @internal */\nexport const fiberRefMakeContext = initial => fiberRefMakeWith(() => core.fiberRefUnsafeMakeContext(initial));\n/* @internal */\nexport const fiberRefMakeRuntimeFlags = initial => fiberRefMakeWith(() => core.fiberRefUnsafeMakeRuntimeFlags(initial));\n/** @internal */\nexport const currentRuntimeFlags = /*#__PURE__*/core.fiberRefUnsafeMakeRuntimeFlags(runtimeFlags_.none);\n/** @internal */\nexport const currentSupervisor = /*#__PURE__*/fiberRefUnsafeMakeSupervisor(supervisor.none);\n// circular with Fiber\n/* @internal */\nexport const fiberAwaitAll = fibers => forEach(fibers, internalFiber._await);\n/** @internal */\nexport const fiberAll = fibers => {\n const _fiberAll = {\n ...Effectable.CommitPrototype,\n commit() {\n return internalFiber.join(this);\n },\n [internalFiber.FiberTypeId]: internalFiber.fiberVariance,\n id: () => RA.fromIterable(fibers).reduce((id, fiber) => FiberId.combine(id, fiber.id()), FiberId.none),\n await: core.exit(forEachParUnbounded(fibers, fiber => core.flatten(fiber.await), false)),\n children: core.map(forEachParUnbounded(fibers, fiber => fiber.children, false), RA.flatten),\n inheritAll: core.forEachSequentialDiscard(fibers, fiber => fiber.inheritAll),\n poll: core.map(core.forEachSequential(fibers, fiber => fiber.poll), RA.reduceRight(Option.some(core.exitSucceed(new Array())), (optionB, optionA) => {\n switch (optionA._tag) {\n case \"None\":\n {\n return Option.none();\n }\n case \"Some\":\n {\n switch (optionB._tag) {\n case \"None\":\n {\n return Option.none();\n }\n case \"Some\":\n {\n return Option.some(core.exitZipWith(optionA.value, optionB.value, {\n onSuccess: (a, chunk) => [a, ...chunk],\n onFailure: internalCause.parallel\n }));\n }\n }\n }\n }\n })),\n interruptAsFork: fiberId => core.forEachSequentialDiscard(fibers, fiber => fiber.interruptAsFork(fiberId))\n };\n return _fiberAll;\n};\n/* @internal */\nexport const fiberInterruptFork = self => core.asVoid(forkDaemon(core.interruptFiber(self)));\n/* @internal */\nexport const fiberJoinAll = fibers => internalFiber.join(fiberAll(fibers));\n/* @internal */\nexport const fiberScoped = self => acquireRelease(core.succeed(self), core.interruptFiber);\n//\n// circular race\n//\n/** @internal */\nexport const raceWith = /*#__PURE__*/dual(3, (self, other, options) => raceFibersWith(self, other, {\n onSelfWin: (winner, loser) => core.flatMap(winner.await, exit => {\n switch (exit._tag) {\n case OpCodes.OP_SUCCESS:\n {\n return core.flatMap(winner.inheritAll, () => options.onSelfDone(exit, loser));\n }\n case OpCodes.OP_FAILURE:\n {\n return options.onSelfDone(exit, loser);\n }\n }\n }),\n onOtherWin: (winner, loser) => core.flatMap(winner.await, exit => {\n switch (exit._tag) {\n case OpCodes.OP_SUCCESS:\n {\n return core.flatMap(winner.inheritAll, () => options.onOtherDone(exit, loser));\n }\n case OpCodes.OP_FAILURE:\n {\n return options.onOtherDone(exit, loser);\n }\n }\n })\n}));\n/** @internal */\nexport const disconnect = self => core.uninterruptibleMask(restore => core.fiberIdWith(fiberId => core.flatMap(forkDaemon(restore(self)), fiber => pipe(restore(internalFiber.join(fiber)), core.onInterrupt(() => pipe(fiber, internalFiber.interruptAsFork(fiberId)))))));\n/** @internal */\nexport const race = /*#__PURE__*/dual(2, (self, that) => core.fiberIdWith(parentFiberId => raceWith(self, that, {\n onSelfDone: (exit, right) => core.exitMatchEffect(exit, {\n onFailure: cause => pipe(internalFiber.join(right), internalEffect.mapErrorCause(cause2 => internalCause.parallel(cause, cause2))),\n onSuccess: value => pipe(right, core.interruptAsFiber(parentFiberId), core.as(value))\n }),\n onOtherDone: (exit, left) => core.exitMatchEffect(exit, {\n onFailure: cause => pipe(internalFiber.join(left), internalEffect.mapErrorCause(cause2 => internalCause.parallel(cause2, cause))),\n onSuccess: value => pipe(left, core.interruptAsFiber(parentFiberId), core.as(value))\n })\n})));\n/** @internal */\nexport const raceFibersWith = /*#__PURE__*/dual(3, (self, other, options) => core.withFiberRuntime((parentFiber, parentStatus) => {\n const parentRuntimeFlags = parentStatus.runtimeFlags;\n const raceIndicator = MRef.make(true);\n const leftFiber = unsafeMakeChildFiber(self, parentFiber, parentRuntimeFlags, options.selfScope);\n const rightFiber = unsafeMakeChildFiber(other, parentFiber, parentRuntimeFlags, options.otherScope);\n return core.async(cb => {\n leftFiber.addObserver(() => completeRace(leftFiber, rightFiber, options.onSelfWin, raceIndicator, cb));\n rightFiber.addObserver(() => completeRace(rightFiber, leftFiber, options.onOtherWin, raceIndicator, cb));\n leftFiber.startFork(self);\n rightFiber.startFork(other);\n }, FiberId.combine(leftFiber.id(), rightFiber.id()));\n}));\nconst completeRace = (winner, loser, cont, ab, cb) => {\n if (MRef.compareAndSet(true, false)(ab)) {\n cb(cont(winner, loser));\n }\n};\n/** @internal */\nexport const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => core.uninterruptibleMask(restore => core.matchCauseEffect(restore(self), {\n onFailure: cause1 => core.matchCauseEffect(finalizer, {\n onFailure: cause2 => core.failCause(internalCause.sequential(cause1, cause2)),\n onSuccess: () => core.failCause(cause1)\n }),\n onSuccess: a => core.as(finalizer, a)\n})));\n/** @internal */\nexport const invokeWithInterrupt = (self, entries, onInterrupt) => core.fiberIdWith(id => core.flatMap(core.flatMap(forkDaemon(core.interruptible(self)), processing => core.async(cb => {\n const counts = entries.map(_ => _.listeners.count);\n const checkDone = () => {\n if (counts.every(count => count === 0)) {\n if (entries.every(_ => {\n if (_.result.state.current._tag === \"Pending\") {\n return true;\n } else if (_.result.state.current._tag === \"Done\" && core.exitIsExit(_.result.state.current.effect) && _.result.state.current.effect._tag === \"Failure\" && internalCause.isInterrupted(_.result.state.current.effect.cause)) {\n return true;\n } else {\n return false;\n }\n })) {\n cleanup.forEach(f => f());\n onInterrupt?.();\n cb(core.interruptFiber(processing));\n }\n }\n };\n processing.addObserver(exit => {\n cleanup.forEach(f => f());\n cb(exit);\n });\n const cleanup = entries.map((r, i) => {\n const observer = count => {\n counts[i] = count;\n checkDone();\n };\n r.listeners.addObserver(observer);\n return () => r.listeners.removeObserver(observer);\n });\n checkDone();\n return core.sync(() => {\n cleanup.forEach(f => f());\n });\n})), () => core.suspend(() => {\n const residual = entries.flatMap(entry => {\n if (!entry.state.completed) {\n return [entry];\n }\n return [];\n });\n return core.forEachSequentialDiscard(residual, entry => complete(entry.request, core.exitInterrupt(id)));\n})));\n/** @internal */\nexport const interruptWhenPossible = /*#__PURE__*/dual(2, (self, all) => core.fiberRefGetWith(currentRequestMap, map => core.suspend(() => {\n const entries = RA.fromIterable(all).flatMap(_ => map.has(_) ? [map.get(_)] : []);\n return invokeWithInterrupt(self, entries);\n})));\n// circular Tracer\n/** @internal */\nexport const makeSpanScoped = (name, options) => {\n options = tracer.addSpanStackTrace(options);\n return core.uninterruptible(core.withFiberRuntime(fiber => {\n const scope = Context.unsafeGet(fiber.getFiberRef(core.currentContext), scopeTag);\n const span = internalEffect.unsafeMakeSpan(fiber, name, options);\n const timingEnabled = fiber.getFiberRef(core.currentTracerTimingEnabled);\n const clock_ = Context.get(fiber.getFiberRef(defaultServices.currentServices), clock.clockTag);\n return core.as(core.scopeAddFinalizerExit(scope, exit => internalEffect.endSpan(span, exit, clock_, timingEnabled)), span);\n }));\n};\n/* @internal */\nexport const withTracerScoped = value => fiberRefLocallyScopedWith(defaultServices.currentServices, Context.add(tracer.tracerTag, value));\n/** @internal */\nexport const withSpanScoped = function () {\n const dataFirst = typeof arguments[0] !== \"string\";\n const name = dataFirst ? arguments[1] : arguments[0];\n const options = tracer.addSpanStackTrace(dataFirst ? arguments[2] : arguments[1]);\n if (dataFirst) {\n const self = arguments[0];\n return core.flatMap(makeSpanScoped(name, tracer.addSpanStackTrace(options)), span => internalEffect.provideService(self, tracer.spanTag, span));\n }\n return self => core.flatMap(makeSpanScoped(name, tracer.addSpanStackTrace(options)), span => internalEffect.provideService(self, tracer.spanTag, span));\n};\n//# sourceMappingURL=fiberRuntime.js.map","import * as Duration from \"../../Duration.js\";\nimport { dual } from \"../../Function.js\";\nimport * as Option from \"../../Option.js\";\n/** @internal */\nconst IntervalSymbolKey = \"effect/ScheduleInterval\";\n/** @internal */\nexport const IntervalTypeId = /*#__PURE__*/Symbol.for(IntervalSymbolKey);\n/** @internal */\nexport const empty = {\n [IntervalTypeId]: IntervalTypeId,\n startMillis: 0,\n endMillis: 0\n};\n/** @internal */\nexport const make = (startMillis, endMillis) => {\n if (startMillis > endMillis) {\n return empty;\n }\n return {\n [IntervalTypeId]: IntervalTypeId,\n startMillis,\n endMillis\n };\n};\n/** @internal */\nexport const lessThan = /*#__PURE__*/dual(2, (self, that) => min(self, that) === self);\n/** @internal */\nexport const min = /*#__PURE__*/dual(2, (self, that) => {\n if (self.endMillis <= that.startMillis) return self;\n if (that.endMillis <= self.startMillis) return that;\n if (self.startMillis < that.startMillis) return self;\n if (that.startMillis < self.startMillis) return that;\n if (self.endMillis <= that.endMillis) return self;\n return that;\n});\n/** @internal */\nexport const max = /*#__PURE__*/dual(2, (self, that) => min(self, that) === self ? that : self);\n/** @internal */\nexport const isEmpty = self => {\n return self.startMillis >= self.endMillis;\n};\n/** @internal */\nexport const isNonEmpty = self => {\n return !isEmpty(self);\n};\n/** @internal */\nexport const intersect = /*#__PURE__*/dual(2, (self, that) => {\n const start = Math.max(self.startMillis, that.startMillis);\n const end = Math.min(self.endMillis, that.endMillis);\n return make(start, end);\n});\n/** @internal */\nexport const size = self => {\n return Duration.millis(self.endMillis - self.startMillis);\n};\n/** @internal */\nexport const union = /*#__PURE__*/dual(2, (self, that) => {\n const start = Math.max(self.startMillis, that.startMillis);\n const end = Math.min(self.endMillis, that.endMillis);\n return start < end ? Option.none() : Option.some(make(start, end));\n});\n/** @internal */\nexport const after = startMilliseconds => {\n return make(startMilliseconds, Number.POSITIVE_INFINITY);\n};\n/** @internal */\nexport const before = endMilliseconds => {\n return make(Number.NEGATIVE_INFINITY, endMilliseconds);\n};\n//# sourceMappingURL=interval.js.map","import * as internal from \"./internal/schedule/interval.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const IntervalTypeId = internal.IntervalTypeId;\n/**\n * Constructs a new interval from the two specified endpoints. If the start\n * endpoint greater than the end endpoint, then a zero size interval will be\n * returned.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * An `Interval` of zero-width.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = internal.empty;\n/**\n * Returns `true` if this `Interval` is less than `that` interval, `false`\n * otherwise.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const lessThan = internal.lessThan;\n/**\n * Returns the minimum of two `Interval`s.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const min = internal.min;\n/**\n * Returns the maximum of two `Interval`s.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const max = internal.max;\n/**\n * Returns `true` if the specified `Interval` is empty, `false` otherwise.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const isEmpty = internal.isEmpty;\n/**\n * Returns `true` if the specified `Interval` is non-empty, `false` otherwise.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const isNonEmpty = internal.isNonEmpty;\n/**\n * Computes a new `Interval` which is the intersection of this `Interval` and\n * that `Interval`.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const intersect = internal.intersect;\n/**\n * Calculates the size of the `Interval` as the `Duration` from the start of the\n * interval to the end of the interval.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const size = internal.size;\n/**\n * Computes a new `Interval` which is the union of this `Interval` and that\n * `Interval` as a `Some`, otherwise returns `None` if the two intervals cannot\n * form a union.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const union = internal.union;\n/**\n * Construct an `Interval` that includes all time equal to and after the\n * specified start time.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const after = internal.after;\n/**\n * Construct an `Interval` that includes all time equal to and before the\n * specified end time.\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const before = internal.before;\n//# sourceMappingURL=ScheduleInterval.js.map","import * as Chunk from \"../../Chunk.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as Option from \"../../Option.js\";\nimport * as Interval from \"../../ScheduleInterval.js\";\nimport { getBugErrorMessage } from \"../errors.js\";\n/** @internal */\nconst IntervalsSymbolKey = \"effect/ScheduleIntervals\";\n/** @internal */\nexport const IntervalsTypeId = /*#__PURE__*/Symbol.for(IntervalsSymbolKey);\n/** @internal */\nexport const make = intervals => {\n return {\n [IntervalsTypeId]: IntervalsTypeId,\n intervals\n };\n};\n/** @internal */\nexport const empty = /*#__PURE__*/make(/*#__PURE__*/Chunk.empty());\n/** @internal */\nexport const fromIterable = intervals => Array.from(intervals).reduce((intervals, interval) => pipe(intervals, union(make(Chunk.of(interval)))), empty);\n/** @internal */\nexport const union = /*#__PURE__*/dual(2, (self, that) => {\n if (!Chunk.isNonEmpty(that.intervals)) {\n return self;\n }\n if (!Chunk.isNonEmpty(self.intervals)) {\n return that;\n }\n if (Chunk.headNonEmpty(self.intervals).startMillis < Chunk.headNonEmpty(that.intervals).startMillis) {\n return unionLoop(Chunk.tailNonEmpty(self.intervals), that.intervals, Chunk.headNonEmpty(self.intervals), Chunk.empty());\n }\n return unionLoop(self.intervals, Chunk.tailNonEmpty(that.intervals), Chunk.headNonEmpty(that.intervals), Chunk.empty());\n});\n/** @internal */\nconst unionLoop = (_self, _that, _interval, _acc) => {\n let self = _self;\n let that = _that;\n let interval = _interval;\n let acc = _acc;\n while (Chunk.isNonEmpty(self) || Chunk.isNonEmpty(that)) {\n if (!Chunk.isNonEmpty(self) && Chunk.isNonEmpty(that)) {\n if (interval.endMillis < Chunk.headNonEmpty(that).startMillis) {\n acc = pipe(acc, Chunk.prepend(interval));\n interval = Chunk.headNonEmpty(that);\n that = Chunk.tailNonEmpty(that);\n self = Chunk.empty();\n } else {\n interval = Interval.make(interval.startMillis, Chunk.headNonEmpty(that).endMillis);\n that = Chunk.tailNonEmpty(that);\n self = Chunk.empty();\n }\n } else if (Chunk.isNonEmpty(self) && Chunk.isEmpty(that)) {\n if (interval.endMillis < Chunk.headNonEmpty(self).startMillis) {\n acc = pipe(acc, Chunk.prepend(interval));\n interval = Chunk.headNonEmpty(self);\n that = Chunk.empty();\n self = Chunk.tailNonEmpty(self);\n } else {\n interval = Interval.make(interval.startMillis, Chunk.headNonEmpty(self).endMillis);\n that = Chunk.empty();\n self = Chunk.tailNonEmpty(self);\n }\n } else if (Chunk.isNonEmpty(self) && Chunk.isNonEmpty(that)) {\n if (Chunk.headNonEmpty(self).startMillis < Chunk.headNonEmpty(that).startMillis) {\n if (interval.endMillis < Chunk.headNonEmpty(self).startMillis) {\n acc = pipe(acc, Chunk.prepend(interval));\n interval = Chunk.headNonEmpty(self);\n self = Chunk.tailNonEmpty(self);\n } else {\n interval = Interval.make(interval.startMillis, Chunk.headNonEmpty(self).endMillis);\n self = Chunk.tailNonEmpty(self);\n }\n } else if (interval.endMillis < Chunk.headNonEmpty(that).startMillis) {\n acc = pipe(acc, Chunk.prepend(interval));\n interval = Chunk.headNonEmpty(that);\n that = Chunk.tailNonEmpty(that);\n } else {\n interval = Interval.make(interval.startMillis, Chunk.headNonEmpty(that).endMillis);\n that = Chunk.tailNonEmpty(that);\n }\n } else {\n throw new Error(getBugErrorMessage(\"Intervals.unionLoop\"));\n }\n }\n return make(pipe(acc, Chunk.prepend(interval), Chunk.reverse));\n};\n/** @internal */\nexport const intersect = /*#__PURE__*/dual(2, (self, that) => intersectLoop(self.intervals, that.intervals, Chunk.empty()));\n/** @internal */\nconst intersectLoop = (_left, _right, _acc) => {\n let left = _left;\n let right = _right;\n let acc = _acc;\n while (Chunk.isNonEmpty(left) && Chunk.isNonEmpty(right)) {\n const interval = pipe(Chunk.headNonEmpty(left), Interval.intersect(Chunk.headNonEmpty(right)));\n const intervals = Interval.isEmpty(interval) ? acc : pipe(acc, Chunk.prepend(interval));\n if (pipe(Chunk.headNonEmpty(left), Interval.lessThan(Chunk.headNonEmpty(right)))) {\n left = Chunk.tailNonEmpty(left);\n } else {\n right = Chunk.tailNonEmpty(right);\n }\n acc = intervals;\n }\n return make(Chunk.reverse(acc));\n};\n/** @internal */\nexport const start = self => {\n return pipe(self.intervals, Chunk.head, Option.getOrElse(() => Interval.empty)).startMillis;\n};\n/** @internal */\nexport const end = self => {\n return pipe(self.intervals, Chunk.head, Option.getOrElse(() => Interval.empty)).endMillis;\n};\n/** @internal */\nexport const lessThan = /*#__PURE__*/dual(2, (self, that) => start(self) < start(that));\n/** @internal */\nexport const isNonEmpty = self => {\n return Chunk.isNonEmpty(self.intervals);\n};\n/** @internal */\nexport const max = /*#__PURE__*/dual(2, (self, that) => lessThan(self, that) ? that : self);\n//# sourceMappingURL=intervals.js.map","import * as internal from \"./internal/schedule/intervals.js\";\n/**\n * @since 2.0.0\n * @category symbols\n */\nexport const IntervalsTypeId = internal.IntervalsTypeId;\n/**\n * Creates a new `Intervals` from a `List` of `Interval`s.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = internal.make;\n/**\n * Constructs an empty list of `Interval`s.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const empty = internal.empty;\n/**\n * Creates `Intervals` from the specified `Iterable<Interval>`.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const fromIterable = internal.fromIterable;\n/**\n * Computes the union of this `Intervals` and that `Intervals`\n *\n * @since 2.0.0\n * @category utils\n */\nexport const union = internal.union;\n/**\n * Produces the intersection of this `Intervals` and that `Intervals`.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const intersect = internal.intersect;\n/**\n * The start of the earliest interval in the specified `Intervals`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const start = internal.start;\n/**\n * The end of the latest interval in the specified `Intervals`.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const end = internal.end;\n/**\n * Returns `true` if the start of this `Intervals` is before the start of that\n * `Intervals`, `false` otherwise.\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const lessThan = internal.lessThan;\n/**\n * Returns `true` if this `Intervals` is non-empty, `false` otherwise.\n *\n * @since 2.0.0\n * @category getters\n */\nexport const isNonEmpty = internal.isNonEmpty;\n/**\n * Returns the maximum of the two `Intervals` (i.e. which has the latest start).\n *\n * @since 2.0.0\n * @category ordering\n */\nexport const max = internal.max;\n//# sourceMappingURL=ScheduleIntervals.js.map","import * as Chunk from \"../../Chunk.js\";\nimport * as Intervals from \"../../ScheduleIntervals.js\";\n/** @internal */\nexport const OP_CONTINUE = \"Continue\";\n/** @internal */\nexport const OP_DONE = \"Done\";\n/** @internal */\nexport const _continue = intervals => {\n return {\n _tag: OP_CONTINUE,\n intervals\n };\n};\n/** @internal */\nexport const continueWith = interval => {\n return {\n _tag: OP_CONTINUE,\n intervals: Intervals.make(Chunk.of(interval))\n };\n};\n/** @internal */\nexport const done = {\n _tag: OP_DONE\n};\n/** @internal */\nexport const isContinue = self => {\n return self._tag === OP_CONTINUE;\n};\n/** @internal */\nexport const isDone = self => {\n return self._tag === OP_DONE;\n};\n//# sourceMappingURL=decision.js.map","/**\n * @since 2.0.0\n */\nimport * as internal from \"./internal/schedule/decision.js\";\nconst _continue = internal._continue;\nexport {\n/**\n * @since 2.0.0\n * @category constructors\n */\n_continue as continue };\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const continueWith = internal.continueWith;\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const done = internal.done;\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isContinue = internal.isContinue;\n/**\n * @since 2.0.0\n * @category refinements\n */\nexport const isDone = internal.isDone;\n//# sourceMappingURL=ScheduleDecision.js.map","/**\n * @since 2.0.0\n */\nimport * as core from \"./internal/core.js\";\nimport * as fiberRuntime from \"./internal/fiberRuntime.js\";\n/**\n * A unique identifier for the `Scope` type.\n *\n * @since 2.0.0\n * @category symbols\n */\nexport const ScopeTypeId = core.ScopeTypeId;\n/**\n * A unique identifier for the `CloseableScope` type.\n *\n * @since 2.0.0\n * @category symbols\n */\nexport const CloseableScopeTypeId = core.CloseableScopeTypeId;\n/**\n * A tag representing the current `Scope` in the environment.\n *\n * @since 2.0.0\n * @category context\n */\nexport const Scope = fiberRuntime.scopeTag;\n/**\n * Adds a finalizer to this scope. The finalizer is guaranteed to be run when\n * the scope is closed. Use this when the finalizer does not need to know the\n * `Exit` value that the scope is closed with.\n *\n * @see {@link addFinalizerExit}\n *\n * @since 2.0.0\n * @category utils\n */\nexport const addFinalizer = core.scopeAddFinalizer;\n/**\n * Adds a finalizer to this scope. The finalizer receives the `Exit` value\n * when the scope is closed, allowing it to perform different actions based\n * on the exit status.\n *\n * @see {@link addFinalizer}\n *\n * @since 2.0.0\n * @category utils\n */\nexport const addFinalizerExit = core.scopeAddFinalizerExit;\n/**\n * Closes this scope with the specified exit value, running all finalizers that\n * have been added to the scope.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const close = core.scopeClose;\n/**\n * Extends the scope of an `Effect` that requires a scope into this scope.\n * It provides this scope to the effect but does not close the scope when the\n * effect completes execution. This allows extending a scoped value into a\n * larger scope.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const extend = fiberRuntime.scopeExtend;\n/**\n * Forks a new child scope with the specified execution strategy. The child scope\n * will automatically be closed when this scope is closed.\n *\n * @since 2.0.0\n * @category utils\n */\nexport const fork = core.scopeFork;\n/**\n * Provides this closeable scope to an `Effect` that requires a scope,\n * guaranteeing that the scope is closed with the result of that effect as\n * soon as the effect completes execution, whether by success, failure, or\n * interruption.\n *\n * @since 2.0.0\n * @category destructors\n */\nexport const use = fiberRuntime.scopeUse;\n/**\n * Creates a new closeable scope where finalizers will run according to the\n * specified `ExecutionStrategy`. If no execution strategy is provided, `sequential`\n * will be used by default.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const make = fiberRuntime.scopeMake;\n//# sourceMappingURL=Scope.js.map","import * as Duration from \"../../Duration.js\";\nimport * as Effectable from \"../../Effectable.js\";\nimport * as Equal from \"../../Equal.js\";\nimport * as Exit from \"../../Exit.js\";\nimport * as FiberId from \"../../FiberId.js\";\nimport { dual, pipe } from \"../../Function.js\";\nimport * as Hash from \"../../Hash.js\";\nimport * as MutableHashMap from \"../../MutableHashMap.js\";\nimport * as Option from \"../../Option.js\";\nimport { pipeArguments } from \"../../Pipeable.js\";\nimport * as Predicate from \"../../Predicate.js\";\nimport * as Readable from \"../../Readable.js\";\nimport { currentScheduler } from \"../../Scheduler.js\";\nimport * as internalCause from \"../cause.js\";\nimport * as effect from \"../core-effect.js\";\nimport * as core from \"../core.js\";\nimport * as internalFiber from \"../fiber.js\";\nimport * as fiberRuntime from \"../fiberRuntime.js\";\nimport { globalScope } from \"../fiberScope.js\";\nimport * as internalRef from \"../ref.js\";\nimport * as supervisor from \"../supervisor.js\";\n/** @internal */\nclass Semaphore {\n permits;\n waiters = /*#__PURE__*/new Set();\n taken = 0;\n constructor(permits) {\n this.permits = permits;\n }\n get free() {\n return this.permits - this.taken;\n }\n take = n => core.asyncInterrupt(resume => {\n if (this.free < n) {\n const observer = () => {\n if (this.free < n) {\n return;\n }\n this.waiters.delete(observer);\n this.taken += n;\n resume(core.succeed(n));\n };\n this.waiters.add(observer);\n return core.sync(() => {\n this.waiters.delete(observer);\n });\n }\n this.taken += n;\n return resume(core.succeed(n));\n });\n updateTakenUnsafe(fiber, f) {\n this.taken = f(this.taken);\n if (this.waiters.size > 0) {\n fiber.getFiberRef(currentScheduler).scheduleTask(() => {\n const iter = this.waiters.values();\n let item = iter.next();\n while (item.done === false && this.free > 0) {\n item.value();\n item = iter.next();\n }\n }, fiber.getFiberRef(core.currentSchedulingPriority));\n }\n return core.succeed(this.free);\n }\n updateTaken(f) {\n return core.withFiberRuntime(fiber => this.updateTakenUnsafe(fiber, f));\n }\n resize = permits => core.asVoid(core.withFiberRuntime(fiber => {\n this.permits = permits;\n if (this.free < 0) {\n return core.void;\n }\n return this.updateTakenUnsafe(fiber, taken => taken);\n }));\n release = n => this.updateTaken(taken => taken - n);\n releaseAll = /*#__PURE__*/this.updateTaken(_ => 0);\n withPermits = n => self => core.uninterruptibleMask(restore => core.flatMap(restore(this.take(n)), permits => fiberRuntime.ensuring(restore(self), this.release(permits))));\n withPermitsIfAvailable = n => self => core.uninterruptibleMask(restore => core.suspend(() => {\n if (this.free < n) {\n return effect.succeedNone;\n }\n this.taken += n;\n return fiberRuntime.ensuring(restore(effect.asSome(self)), this.release(n));\n }));\n}\n/** @internal */\nexport const unsafeMakeSemaphore = permits => new Semaphore(permits);\n/** @internal */\nexport const makeSemaphore = permits => core.sync(() => unsafeMakeSemaphore(permits));\nclass Latch extends Effectable.Class {\n isOpen;\n waiters = [];\n scheduled = false;\n constructor(isOpen) {\n super();\n this.isOpen = isOpen;\n }\n commit() {\n return this.await;\n }\n unsafeSchedule(fiber) {\n if (this.scheduled || this.waiters.length === 0) {\n return core.void;\n }\n this.scheduled = true;\n fiber.currentScheduler.scheduleTask(this.flushWaiters, fiber.getFiberRef(core.currentSchedulingPriority));\n return core.void;\n }\n flushWaiters = () => {\n this.scheduled = false;\n const waiters = this.waiters;\n this.waiters = [];\n for (let i = 0; i < waiters.length; i++) {\n waiters[i](core.exitVoid);\n }\n };\n open = /*#__PURE__*/core.withFiberRuntime(fiber => {\n if (this.isOpen) {\n return core.void;\n }\n this.isOpen = true;\n return this.unsafeSchedule(fiber);\n });\n unsafeOpen() {\n if (this.isOpen) return;\n this.isOpen = true;\n this.flushWaiters();\n }\n release = /*#__PURE__*/core.withFiberRuntime(fiber => {\n if (this.isOpen) {\n return core.void;\n }\n return this.unsafeSchedule(fiber);\n });\n await = /*#__PURE__*/core.asyncInterrupt(resume => {\n if (this.isOpen) {\n return resume(core.void);\n }\n this.waiters.push(resume);\n return core.sync(() => {\n const index = this.waiters.indexOf(resume);\n if (index !== -1) {\n this.waiters.splice(index, 1);\n }\n });\n });\n unsafeClose() {\n this.isOpen = false;\n }\n close = /*#__PURE__*/core.sync(() => {\n this.isOpen = false;\n });\n whenOpen = self => {\n return core.zipRight(this.await, self);\n };\n}\n/** @internal */\nexport const unsafeMakeLatch = open => new Latch(open ?? false);\n/** @internal */\nexport const makeLatch = open => core.sync(() => unsafeMakeLatch(open));\n/** @internal */\nexport const awaitAllChildren = self => ensuringChildren(self, fiberRuntime.fiberAwaitAll);\n/** @internal */\nexport const cached = /*#__PURE__*/dual(2, (self, timeToLive) => core.map(cachedInvalidateWithTTL(self, timeToLive), tuple => tuple[0]));\n/** @internal */\nexport const cachedInvalidateWithTTL = /*#__PURE__*/dual(2, (self, timeToLive) => {\n const duration = Duration.decode(timeToLive);\n return core.flatMap(core.context(), env => core.map(makeSynchronized(Option.none()), cache => [core.provideContext(getCachedValue(self, duration, cache), env), invalidateCache(cache)]));\n});\n/** @internal */\nconst computeCachedValue = (self, timeToLive, start) => {\n const timeToLiveMillis = Duration.toMillis(Duration.decode(timeToLive));\n return pipe(core.deferredMake(), core.tap(deferred => core.intoDeferred(self, deferred)), core.map(deferred => Option.some([start + timeToLiveMillis, deferred])));\n};\n/** @internal */\nconst getCachedValue = (self, timeToLive, cache) => core.uninterruptibleMask(restore => pipe(effect.clockWith(clock => clock.currentTimeMillis), core.flatMap(time => updateSomeAndGetEffectSynchronized(cache, option => {\n switch (option._tag) {\n case \"None\":\n {\n return Option.some(computeCachedValue(self, timeToLive, time));\n }\n case \"Some\":\n {\n const [end] = option.value;\n return end - time <= 0 ? Option.some(computeCachedValue(self, timeToLive, time)) : Option.none();\n }\n }\n})), core.flatMap(option => Option.isNone(option) ? core.dieMessage(\"BUG: Effect.cachedInvalidate - please report an issue at https://github.com/Effect-TS/effect/issues\") : restore(core.deferredAwait(option.value[1])))));\n/** @internal */\nconst invalidateCache = cache => internalRef.set(cache, Option.none());\n/** @internal */\nexport const ensuringChild = /*#__PURE__*/dual(2, (self, f) => ensuringChildren(self, children => f(fiberRuntime.fiberAll(children))));\n/** @internal */\nexport const ensuringChildren = /*#__PURE__*/dual(2, (self, children) => core.flatMap(supervisor.track, supervisor => pipe(supervised(self, supervisor), fiberRuntime.ensuring(core.flatMap(supervisor.value, children)))));\n/** @internal */\nexport const forkAll = /*#__PURE__*/dual(args => Predicate.isIterable(args[0]), (effects, options) => options?.discard ? core.forEachSequentialDiscard(effects, fiberRuntime.fork) : core.map(core.forEachSequential(effects, fiberRuntime.fork), fiberRuntime.fiberAll));\n/** @internal */\nexport const forkIn = /*#__PURE__*/dual(2, (self, scope) => core.withFiberRuntime((parent, parentStatus) => {\n const scopeImpl = scope;\n const fiber = fiberRuntime.unsafeFork(self, parent, parentStatus.runtimeFlags, globalScope);\n if (scopeImpl.state._tag === \"Open\") {\n const finalizer = () => core.fiberIdWith(fiberId => Equal.equals(fiberId, fiber.id()) ? core.void : core.asVoid(core.interruptFiber(fiber)));\n const key = {};\n scopeImpl.state.finalizers.set(key, finalizer);\n fiber.addObserver(() => {\n if (scopeImpl.state._tag === \"Closed\") return;\n scopeImpl.state.finalizers.delete(key);\n });\n } else {\n fiber.unsafeInterruptAsFork(parent.id());\n }\n return core.succeed(fiber);\n}));\n/** @internal */\nexport const forkScoped = self => fiberRuntime.scopeWith(scope => forkIn(self, scope));\n/** @internal */\nexport const fromFiber = fiber => internalFiber.join(fiber);\n/** @internal */\nexport const fromFiberEffect = fiber => core.suspend(() => core.flatMap(fiber, internalFiber.join));\nconst memoKeySymbol = /*#__PURE__*/Symbol.for(\"effect/Effect/memoizeFunction.key\");\nclass Key {\n a;\n eq;\n [memoKeySymbol] = memoKeySymbol;\n constructor(a, eq) {\n this.a = a;\n this.eq = eq;\n }\n [Equal.symbol](that) {\n if (Predicate.hasProperty(that, memoKeySymbol)) {\n if (this.eq) {\n return this.eq(this.a, that.a);\n } else {\n return Equal.equals(this.a, that.a);\n }\n }\n return false;\n }\n [Hash.symbol]() {\n return this.eq ? 0 : Hash.cached(this, Hash.hash(this.a));\n }\n}\n/** @internal */\nexport const cachedFunction = (f, eq) => {\n return pipe(core.sync(() => MutableHashMap.empty()), core.flatMap(makeSynchronized), core.map(ref => a => pipe(ref.modifyEffect(map => {\n const result = pipe(map, MutableHashMap.get(new Key(a, eq)));\n if (Option.isNone(result)) {\n return pipe(core.deferredMake(), core.tap(deferred => pipe(effect.diffFiberRefs(f(a)), core.intoDeferred(deferred), fiberRuntime.fork)), core.map(deferred => [deferred, pipe(map, MutableHashMap.set(new Key(a, eq), deferred))]));\n }\n return core.succeed([result.value, map]);\n }), core.flatMap(core.deferredAwait), core.flatMap(([patch, b]) => pipe(effect.patchFiberRefs(patch), core.as(b))))));\n};\n/** @internal */\nexport const raceFirst = /*#__PURE__*/dual(2, (self, that) => pipe(core.exit(self), fiberRuntime.race(core.exit(that)), effect => core.flatten(effect)));\n/** @internal */\nexport const supervised = /*#__PURE__*/dual(2, (self, supervisor) => {\n const supervise = core.fiberRefLocallyWith(fiberRuntime.currentSupervisor, s => s.zip(supervisor));\n return supervise(self);\n});\n/** @internal */\nexport const timeout = /*#__PURE__*/dual(2, (self, duration) => timeoutFail(self, {\n onTimeout: () => core.timeoutExceptionFromDuration(duration),\n duration\n}));\n/** @internal */\nexport const timeoutFail = /*#__PURE__*/dual(2, (self, {\n duration,\n onTimeout\n}) => core.flatten(timeoutTo(self, {\n onTimeout: () => core.failSync(onTimeout),\n onSuccess: core.succeed,\n duration\n})));\n/** @internal */\nexport const timeoutFailCause = /*#__PURE__*/dual(2, (self, {\n duration,\n onTimeout\n}) => core.flatten(timeoutTo(self, {\n onTimeout: () => core.failCauseSync(onTimeout),\n onSuccess: core.succeed,\n duration\n})));\n/** @internal */\nexport const timeoutOption = /*#__PURE__*/dual(2, (self, duration) => timeoutTo(self, {\n duration,\n onSuccess: Option.some,\n onTimeout: Option.none\n}));\n/** @internal */\nexport const timeoutTo = /*#__PURE__*/dual(2, (self, {\n duration,\n onSuccess,\n onTimeout\n}) => core.fiberIdWith(parentFiberId => core.uninterruptibleMask(restore => fiberRuntime.raceFibersWith(restore(self), core.interruptible(effect.sleep(duration)), {\n onSelfWin: (winner, loser) => core.flatMap(winner.await, exit => {\n if (exit._tag === \"Success\") {\n return core.flatMap(winner.inheritAll, () => core.as(core.interruptAsFiber(loser, parentFiberId), onSuccess(exit.value)));\n } else {\n return core.flatMap(core.interruptAsFiber(loser, parentFiberId), () => core.exitFailCause(exit.cause));\n }\n }),\n onOtherWin: (winner, loser) => core.flatMap(winner.await, exit => {\n if (exit._tag === \"Success\") {\n return core.flatMap(winner.inheritAll, () => core.as(core.interruptAsFiber(loser, parentFiberId), onTimeout()));\n } else {\n return core.flatMap(core.interruptAsFiber(loser, parentFiberId), () => core.exitFailCause(exit.cause));\n }\n }),\n otherScope: globalScope\n}))));\n// circular with Synchronized\n/** @internal */\nconst SynchronizedSymbolKey = \"effect/Ref/SynchronizedRef\";\n/** @internal */\nexport const SynchronizedTypeId = /*#__PURE__*/Symbol.for(SynchronizedSymbolKey);\n/** @internal */\nexport const synchronizedVariance = {\n /* c8 ignore next */\n _A: _ => _\n};\n/** @internal */\nclass SynchronizedImpl extends Effectable.Class {\n ref;\n withLock;\n [SynchronizedTypeId] = synchronizedVariance;\n [internalRef.RefTypeId] = internalRef.refVariance;\n [Readable.TypeId] = Readable.TypeId;\n constructor(ref, withLock) {\n super();\n this.ref = ref;\n this.withLock = withLock;\n this.get = internalRef.get(this.ref);\n }\n get;\n commit() {\n return this.get;\n }\n modify(f) {\n return this.modifyEffect(a => core.succeed(f(a)));\n }\n modifyEffect(f) {\n return this.withLock(pipe(core.flatMap(internalRef.get(this.ref), f), core.flatMap(([b, a]) => core.as(internalRef.set(this.ref, a), b))));\n }\n}\n/** @internal */\nexport const makeSynchronized = value => core.sync(() => unsafeMakeSynchronized(value));\n/** @internal */\nexport const unsafeMakeSynchronized = value => {\n const ref = internalRef.unsafeMake(value);\n const sem = unsafeMakeSemaphore(1);\n return new SynchronizedImpl(ref, sem.withPermits(1));\n};\n/** @internal */\nexport const updateSomeAndGetEffectSynchronized = /*#__PURE__*/dual(2, (self, pf) => self.modifyEffect(value => {\n const result = pf(value);\n switch (result._tag) {\n case \"None\":\n {\n return core.succeed([value, value]);\n }\n case \"Some\":\n {\n return core.map(result.value, a => [a, a]);\n }\n }\n}));\n// circular with Fiber\n/** @internal */\nexport const zipFiber = /*#__PURE__*/dual(2, (self, that) => zipWithFiber(self, that, (a, b) => [a, b]));\n/** @internal */\nexport const zipLeftFiber = /*#__PURE__*/dual(2, (self, that) => zipWithFiber(self, that, (a, _) => a));\n/** @internal */\nexport const zipRightFiber = /*#__PURE__*/dual(2, (self, that) => zipWithFiber(self, that, (_, b) => b));\n/** @internal */\nexport const zipWithFiber = /*#__PURE__*/dual(3, (self, that, f) => ({\n ...Effectable.CommitPrototype,\n commit() {\n return internalFiber.join(this);\n },\n [internalFiber.FiberTypeId]: internalFiber.fiberVariance,\n id: () => pipe(self.id(), FiberId.getOrElse(that.id())),\n await: pipe(self.await, core.flatten, fiberRuntime.zipWithOptions(core.flatten(that.await), f, {\n concurrent: true\n }), core.exit),\n children: self.children,\n inheritAll: core.zipRight(that.inheritAll, self.inheritAll),\n poll: core.zipWith(self.poll, that.poll, (optionA, optionB) => pipe(optionA, Option.flatMap(exitA => pipe(optionB, Option.map(exitB => Exit.zipWith(exitA, exitB, {\n onSuccess: f,\n onFailure: internalCause.parallel\n })))))),\n interruptAsFork: id => core.zipRight(self.interruptAsFork(id), that.interruptAsFork(id)),\n pipe() {\n return pipeArguments(this, arguments);\n }\n}));\n/* @internal */\nexport const bindAll = /*#__PURE__*/dual(args => core.isEffect(args[0]), (self, f, options) => core.flatMap(self, a => fiberRuntime.all(f(a), options).pipe(core.map(record => Object.assign({}, a, record)))));\n//# sourceMappingURL=circular.js.map","// circular with Layer\n/** @internal */\nexport const TypeId = /*#__PURE__*/Symbol.for(\"effect/ManagedRuntime\");\n//# sourceMappingURL=circular.js.map","/** @internal */\nexport const OP_EXTEND_SCOPE = \"ExtendScope\";\n/** @internal */\nexport const OP_FOLD = \"Fold\";\n/** @internal */\nexport const OP_FRESH = \"Fresh\";\n/** @internal */\nexport const OP_FROM_EFFECT = \"FromEffect\";\n/** @internal */\nexport const OP_SCOPED = \"Scoped\";\n/** @internal */\nexport const OP_SUSPEND = \"Suspend\";\n/** @internal */\nexport const OP_PROVIDE = \"Provide\";\n/** @internal */\nexport const OP_PROVIDE_MERGE = \"ProvideMerge\";\n/** @internal */\nexport const OP_MERGE_ALL = \"MergeAll\";\n/** @internal */\nexport const OP_ZIP_WITH = \"ZipWith\";\n//# sourceMappingURL=layer.js.map","import * as Context from \"../Context.js\";\nimport { equals } from \"../Equal.js\";\nimport * as Exit from \"../Exit.js\";\nimport * as Fiber from \"../Fiber.js\";\nimport * as FiberId from \"../FiberId.js\";\nimport * as FiberRefs from \"../FiberRefs.js\";\nimport { dual, pipe } from \"../Function.js\";\nimport * as Inspectable from \"../Inspectable.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport * as Predicate from \"../Predicate.js\";\nimport * as scheduler_ from \"../Scheduler.js\";\nimport * as scope_ from \"../Scope.js\";\nimport * as InternalCause from \"./cause.js\";\nimport * as core from \"./core.js\";\nimport * as executionStrategy from \"./executionStrategy.js\";\nimport * as FiberRuntime from \"./fiberRuntime.js\";\nimport * as fiberScope from \"./fiberScope.js\";\nimport * as OpCodes from \"./opCodes/effect.js\";\nimport * as runtimeFlags from \"./runtimeFlags.js\";\nimport * as supervisor_ from \"./supervisor.js\";\nconst makeDual = f => function () {\n if (arguments.length === 1) {\n const runtime = arguments[0];\n return (effect, ...args) => f(runtime, effect, ...args);\n }\n return f.apply(this, arguments);\n};\n/** @internal */\nexport const unsafeFork = /*#__PURE__*/makeDual((runtime, self, options) => {\n const fiberId = FiberId.unsafeMake();\n const fiberRefUpdates = [[core.currentContext, [[fiberId, runtime.context]]]];\n if (options?.scheduler) {\n fiberRefUpdates.push([scheduler_.currentScheduler, [[fiberId, options.scheduler]]]);\n }\n let fiberRefs = FiberRefs.updateManyAs(runtime.fiberRefs, {\n entries: fiberRefUpdates,\n forkAs: fiberId\n });\n if (options?.updateRefs) {\n fiberRefs = options.updateRefs(fiberRefs, fiberId);\n }\n const fiberRuntime = new FiberRuntime.FiberRuntime(fiberId, fiberRefs, runtime.runtimeFlags);\n let effect = self;\n if (options?.scope) {\n effect = core.flatMap(scope_.fork(options.scope, executionStrategy.sequential), closeableScope => core.zipRight(core.scopeAddFinalizer(closeableScope, core.fiberIdWith(id => equals(id, fiberRuntime.id()) ? core.void : core.interruptAsFiber(fiberRuntime, id))), core.onExit(self, exit => scope_.close(closeableScope, exit))));\n }\n const supervisor = fiberRuntime.currentSupervisor;\n // we can compare by reference here as _supervisor.none is wrapped with globalValue\n if (supervisor !== supervisor_.none) {\n supervisor.onStart(runtime.context, effect, Option.none(), fiberRuntime);\n fiberRuntime.addObserver(exit => supervisor.onEnd(exit, fiberRuntime));\n }\n fiberScope.globalScope.add(runtime.runtimeFlags, fiberRuntime);\n // Only an explicit false will prevent immediate execution\n if (options?.immediate === false) {\n fiberRuntime.resume(effect);\n } else {\n fiberRuntime.start(effect);\n }\n return fiberRuntime;\n});\n/** @internal */\nexport const unsafeRunCallback = /*#__PURE__*/makeDual((runtime, effect, options = {}) => {\n const fiberRuntime = unsafeFork(runtime, effect, options);\n if (options.onExit) {\n fiberRuntime.addObserver(exit => {\n options.onExit(exit);\n });\n }\n return (id, cancelOptions) => unsafeRunCallback(runtime)(pipe(fiberRuntime, Fiber.interruptAs(id ?? FiberId.none)), {\n ...cancelOptions,\n onExit: cancelOptions?.onExit ? exit => cancelOptions.onExit(Exit.flatten(exit)) : undefined\n });\n});\n/** @internal */\nexport const unsafeRunSync = /*#__PURE__*/makeDual((runtime, effect) => {\n const result = unsafeRunSyncExit(runtime)(effect);\n if (result._tag === \"Failure\") {\n throw fiberFailure(result.effect_instruction_i0);\n }\n return result.effect_instruction_i0;\n});\nclass AsyncFiberExceptionImpl extends Error {\n fiber;\n _tag = \"AsyncFiberException\";\n constructor(fiber) {\n super(`Fiber #${fiber.id().id} cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work`);\n this.fiber = fiber;\n this.name = this._tag;\n this.stack = this.message;\n }\n}\nconst asyncFiberException = fiber => {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n const error = new AsyncFiberExceptionImpl(fiber);\n Error.stackTraceLimit = limit;\n return error;\n};\n/** @internal */\nexport const isAsyncFiberException = u => Predicate.isTagged(u, \"AsyncFiberException\") && \"fiber\" in u;\n/** @internal */\nexport const FiberFailureId = /*#__PURE__*/Symbol.for(\"effect/Runtime/FiberFailure\");\n/** @internal */\nexport const FiberFailureCauseId = /*#__PURE__*/Symbol.for(\"effect/Runtime/FiberFailure/Cause\");\nclass FiberFailureImpl extends Error {\n [FiberFailureId];\n [FiberFailureCauseId];\n constructor(cause) {\n const head = InternalCause.prettyErrors(cause)[0];\n super(head?.message || \"An error has occurred\");\n this[FiberFailureId] = FiberFailureId;\n this[FiberFailureCauseId] = cause;\n this.name = head ? `(FiberFailure) ${head.name}` : \"FiberFailure\";\n if (head?.stack) {\n this.stack = head.stack;\n }\n }\n toJSON() {\n return {\n _id: \"FiberFailure\",\n cause: this[FiberFailureCauseId].toJSON()\n };\n }\n toString() {\n return \"(FiberFailure) \" + InternalCause.pretty(this[FiberFailureCauseId], {\n renderErrorCause: true\n });\n }\n [Inspectable.NodeInspectSymbol]() {\n return this.toString();\n }\n}\n/** @internal */\nexport const fiberFailure = cause => {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 0;\n const error = new FiberFailureImpl(cause);\n Error.stackTraceLimit = limit;\n return error;\n};\n/** @internal */\nexport const isFiberFailure = u => Predicate.hasProperty(u, FiberFailureId);\nconst fastPath = effect => {\n const op = effect;\n switch (op._op) {\n case \"Failure\":\n case \"Success\":\n {\n // @ts-expect-error\n return op;\n }\n case \"Left\":\n {\n return core.exitFail(op.left);\n }\n case \"Right\":\n {\n return core.exitSucceed(op.right);\n }\n case \"Some\":\n {\n return core.exitSucceed(op.value);\n }\n case \"None\":\n {\n // @ts-expect-error\n return core.exitFail(new core.NoSuchElementException());\n }\n }\n};\n/** @internal */\nexport const unsafeRunSyncExit = /*#__PURE__*/makeDual((runtime, effect) => {\n const op = fastPath(effect);\n if (op) {\n return op;\n }\n const scheduler = new scheduler_.SyncScheduler();\n const fiberRuntime = unsafeFork(runtime)(effect, {\n scheduler\n });\n scheduler.flush();\n const result = fiberRuntime.unsafePoll();\n if (result) {\n return result;\n }\n return core.exitDie(core.capture(asyncFiberException(fiberRuntime), core.currentSpanFromFiber(fiberRuntime)));\n});\n/** @internal */\nexport const unsafeRunPromise = /*#__PURE__*/makeDual((runtime, effect, options) => unsafeRunPromiseExit(runtime, effect, options).then(result => {\n switch (result._tag) {\n case OpCodes.OP_SUCCESS:\n {\n return result.effect_instruction_i0;\n }\n case OpCodes.OP_FAILURE:\n {\n throw fiberFailure(result.effect_instruction_i0);\n }\n }\n}));\n/** @internal */\nexport const unsafeRunPromiseExit = /*#__PURE__*/makeDual((runtime, effect, options) => new Promise(resolve => {\n const op = fastPath(effect);\n if (op) {\n resolve(op);\n }\n const fiber = unsafeFork(runtime)(effect);\n fiber.addObserver(exit => {\n resolve(exit);\n });\n if (options?.signal !== undefined) {\n if (options.signal.aborted) {\n fiber.unsafeInterruptAsFork(fiber.id());\n } else {\n options.signal.addEventListener(\"abort\", () => {\n fiber.unsafeInterruptAsFork(fiber.id());\n }, {\n once: true\n });\n }\n }\n}));\n/** @internal */\nexport class RuntimeImpl {\n context;\n runtimeFlags;\n fiberRefs;\n constructor(context, runtimeFlags, fiberRefs) {\n this.context = context;\n this.runtimeFlags = runtimeFlags;\n this.fiberRefs = fiberRefs;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nexport const make = options => new RuntimeImpl(options.context, options.runtimeFlags, options.fiberRefs);\n/** @internal */\nexport const runtime = () => core.withFiberRuntime((state, status) => core.succeed(new RuntimeImpl(state.getFiberRef(core.currentContext), status.runtimeFlags, state.getFiberRefs())));\n/** @internal */\nexport const defaultRuntimeFlags = /*#__PURE__*/runtimeFlags.make(runtimeFlags.Interruption, runtimeFlags.CooperativeYielding, runtimeFlags.RuntimeMetrics);\n/** @internal */\nexport const defaultRuntime = /*#__PURE__*/make({\n context: /*#__PURE__*/Context.empty(),\n runtimeFlags: defaultRuntimeFlags,\n fiberRefs: /*#__PURE__*/FiberRefs.empty()\n});\n/** @internal */\nexport const updateRuntimeFlags = /*#__PURE__*/dual(2, (self, f) => make({\n context: self.context,\n runtimeFlags: f(self.runtimeFlags),\n fiberRefs: self.fiberRefs\n}));\n/** @internal */\nexport const disableRuntimeFlag = /*#__PURE__*/dual(2, (self, flag) => updateRuntimeFlags(self, runtimeFlags.disable(flag)));\n/** @internal */\nexport const enableRuntimeFlag = /*#__PURE__*/dual(2, (self, flag) => updateRuntimeFlags(self, runtimeFlags.enable(flag)));\n/** @internal */\nexport const updateContext = /*#__PURE__*/dual(2, (self, f) => make({\n context: f(self.context),\n runtimeFlags: self.runtimeFlags,\n fiberRefs: self.fiberRefs\n}));\n/** @internal */\nexport const provideService = /*#__PURE__*/dual(3, (self, tag, service) => updateContext(self, Context.add(tag, service)));\n/** @internal */\nexport const updateFiberRefs = /*#__PURE__*/dual(2, (self, f) => make({\n context: self.context,\n runtimeFlags: self.runtimeFlags,\n fiberRefs: f(self.fiberRefs)\n}));\n/** @internal */\nexport const setFiberRef = /*#__PURE__*/dual(3, (self, fiberRef, value) => updateFiberRefs(self, FiberRefs.updateAs({\n fiberId: FiberId.none,\n fiberRef,\n value\n})));\n/** @internal */\nexport const deleteFiberRef = /*#__PURE__*/dual(2, (self, fiberRef) => updateFiberRefs(self, FiberRefs.delete(fiberRef)));\n/** @internal */\nexport const unsafeRunEffect = /*#__PURE__*/unsafeRunCallback(defaultRuntime);\n/** @internal */\nexport const unsafeForkEffect = /*#__PURE__*/unsafeFork(defaultRuntime);\n/** @internal */\nexport const unsafeRunPromiseEffect = /*#__PURE__*/unsafeRunPromise(defaultRuntime);\n/** @internal */\nexport const unsafeRunPromiseExitEffect = /*#__PURE__*/unsafeRunPromiseExit(defaultRuntime);\n/** @internal */\nexport const unsafeRunSyncEffect = /*#__PURE__*/unsafeRunSync(defaultRuntime);\n/** @internal */\nexport const unsafeRunSyncExitEffect = /*#__PURE__*/unsafeRunSyncExit(defaultRuntime);\n// circular with Effect\n/** @internal */\nexport const asyncEffect = register => core.suspend(() => {\n let cleanup = undefined;\n return core.flatMap(core.deferredMake(), deferred => core.flatMap(runtime(), runtime => core.uninterruptibleMask(restore => core.zipRight(FiberRuntime.fork(restore(core.matchCauseEffect(register(cb => unsafeRunCallback(runtime)(core.intoDeferred(cb, deferred))), {\n onFailure: cause => core.deferredFailCause(deferred, cause),\n onSuccess: cleanup_ => {\n cleanup = cleanup_;\n return core.void;\n }\n }))), restore(core.onInterrupt(core.deferredAwait(deferred), () => cleanup ?? core.void))))));\n});\n//# sourceMappingURL=runtime.js.map","import { dual, pipe } from \"../Function.js\";\nimport * as Option from \"../Option.js\";\nimport * as core from \"./core.js\";\n/** @internal */\nexport const getAndUpdateEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(value => core.map(f(value), result => [value, result])));\n/** @internal */\nexport const getAndUpdateSomeEffect = /*#__PURE__*/dual(2, (self, pf) => self.modifyEffect(value => {\n const result = pf(value);\n switch (result._tag) {\n case \"None\":\n {\n return core.succeed([value, value]);\n }\n case \"Some\":\n {\n return core.map(result.value, newValue => [value, newValue]);\n }\n }\n}));\n/** @internal */\nexport const modify = /*#__PURE__*/dual(2, (self, f) => self.modify(f));\n/** @internal */\nexport const modifyEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(f));\n/** @internal */\nexport const modifySomeEffect = /*#__PURE__*/dual(3, (self, fallback, pf) => self.modifyEffect(value => pipe(pf(value), Option.getOrElse(() => core.succeed([fallback, value])))));\n/** @internal */\nexport const updateEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(value => core.map(f(value), result => [undefined, result])));\n/** @internal */\nexport const updateAndGetEffect = /*#__PURE__*/dual(2, (self, f) => self.modifyEffect(value => core.map(f(value), result => [result, result])));\n/** @internal */\nexport const updateSomeEffect = /*#__PURE__*/dual(2, (self, pf) => self.modifyEffect(value => {\n const result = pf(value);\n switch (result._tag) {\n case \"None\":\n {\n return core.succeed([void 0, value]);\n }\n case \"Some\":\n {\n return core.map(result.value, a => [void 0, a]);\n }\n }\n}));\n//# sourceMappingURL=synchronizedRef.js.map","import * as Cause from \"../Cause.js\";\nimport * as Clock from \"../Clock.js\";\nimport * as Context from \"../Context.js\";\nimport * as Duration from \"../Duration.js\";\nimport * as FiberRefsPatch from \"../FiberRefsPatch.js\";\nimport { constTrue, dual, pipe } from \"../Function.js\";\nimport * as HashMap from \"../HashMap.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as ScheduleDecision from \"../ScheduleDecision.js\";\nimport * as Intervals from \"../ScheduleIntervals.js\";\nimport * as Scope from \"../Scope.js\";\nimport * as effect from \"./core-effect.js\";\nimport * as core from \"./core.js\";\nimport * as circular from \"./effect/circular.js\";\nimport * as ExecutionStrategy from \"./executionStrategy.js\";\nimport * as fiberRuntime from \"./fiberRuntime.js\";\nimport * as circularManagedRuntime from \"./managedRuntime/circular.js\";\nimport * as EffectOpCodes from \"./opCodes/effect.js\";\nimport * as OpCodes from \"./opCodes/layer.js\";\nimport * as ref from \"./ref.js\";\nimport * as runtime from \"./runtime.js\";\nimport * as runtimeFlags from \"./runtimeFlags.js\";\nimport * as synchronized from \"./synchronizedRef.js\";\nimport * as tracer from \"./tracer.js\";\n/** @internal */\nconst LayerSymbolKey = \"effect/Layer\";\n/** @internal */\nexport const LayerTypeId = /*#__PURE__*/Symbol.for(LayerSymbolKey);\nconst layerVariance = {\n /* c8 ignore next */\n _RIn: _ => _,\n /* c8 ignore next */\n _E: _ => _,\n /* c8 ignore next */\n _ROut: _ => _\n};\n/** @internal */\nexport const proto = {\n [LayerTypeId]: layerVariance,\n pipe() {\n return pipeArguments(this, arguments);\n }\n};\n/** @internal */\nconst MemoMapTypeIdKey = \"effect/Layer/MemoMap\";\n/** @internal */\nexport const MemoMapTypeId = /*#__PURE__*/Symbol.for(MemoMapTypeIdKey);\n/** @internal */\nexport const CurrentMemoMap = /*#__PURE__*/Context.Reference()(\"effect/Layer/CurrentMemoMap\", {\n defaultValue: () => unsafeMakeMemoMap()\n});\n/** @internal */\nexport const isLayer = u => hasProperty(u, LayerTypeId);\n/** @internal */\nexport const isFresh = self => {\n return self._op_layer === OpCodes.OP_FRESH;\n};\n// -----------------------------------------------------------------------------\n// MemoMap\n// -----------------------------------------------------------------------------\n/** @internal */\nclass MemoMapImpl {\n ref;\n [MemoMapTypeId];\n constructor(ref) {\n this.ref = ref;\n this[MemoMapTypeId] = MemoMapTypeId;\n }\n /**\n * Checks the memo map to see if a layer exists. If it is, immediately\n * returns it. Otherwise, obtains the layer, stores it in the memo map,\n * and adds a finalizer to the `Scope`.\n */\n getOrElseMemoize(layer, scope) {\n return pipe(synchronized.modifyEffect(this.ref, map => {\n const inMap = map.get(layer);\n if (inMap !== undefined) {\n const [acquire, release] = inMap;\n const cached = pipe(acquire, core.flatMap(([patch, b]) => pipe(effect.patchFiberRefs(patch), core.as(b))), core.onExit(core.exitMatch({\n onFailure: () => core.void,\n onSuccess: () => core.scopeAddFinalizerExit(scope, release)\n })));\n return core.succeed([cached, map]);\n }\n return pipe(ref.make(0), core.flatMap(observers => pipe(core.deferredMake(), core.flatMap(deferred => pipe(ref.make(() => core.void), core.map(finalizerRef => {\n const resource = core.uninterruptibleMask(restore => pipe(fiberRuntime.scopeMake(), core.flatMap(innerScope => pipe(restore(core.flatMap(makeBuilder(layer, innerScope, true), f => effect.diffFiberRefs(f(this)))), core.exit, core.flatMap(exit => {\n switch (exit._tag) {\n case EffectOpCodes.OP_FAILURE:\n {\n return pipe(core.deferredFailCause(deferred, exit.effect_instruction_i0), core.zipRight(core.scopeClose(innerScope, exit)), core.zipRight(core.failCause(exit.effect_instruction_i0)));\n }\n case EffectOpCodes.OP_SUCCESS:\n {\n return pipe(ref.set(finalizerRef, exit => pipe(core.scopeClose(innerScope, exit), core.whenEffect(ref.modify(observers, n => [n === 1, n - 1])), core.asVoid)), core.zipRight(ref.update(observers, n => n + 1)), core.zipRight(core.scopeAddFinalizerExit(scope, exit => pipe(core.sync(() => map.delete(layer)), core.zipRight(ref.get(finalizerRef)), core.flatMap(finalizer => finalizer(exit))))), core.zipRight(core.deferredSucceed(deferred, exit.effect_instruction_i0)), core.as(exit.effect_instruction_i0[1]));\n }\n }\n })))));\n const memoized = [pipe(core.deferredAwait(deferred), core.onExit(core.exitMatchEffect({\n onFailure: () => core.void,\n onSuccess: () => ref.update(observers, n => n + 1)\n }))), exit => pipe(ref.get(finalizerRef), core.flatMap(finalizer => finalizer(exit)))];\n return [resource, isFresh(layer) ? map : map.set(layer, memoized)];\n }))))));\n }), core.flatten);\n }\n}\n/** @internal */\nexport const makeMemoMap = /*#__PURE__*/core.suspend(() => core.map(circular.makeSynchronized(new Map()), ref => new MemoMapImpl(ref)));\n/** @internal */\nexport const unsafeMakeMemoMap = () => new MemoMapImpl(circular.unsafeMakeSynchronized(new Map()));\n/** @internal */\nexport const build = self => fiberRuntime.scopeWith(scope => buildWithScope(self, scope));\n/** @internal */\nexport const buildWithScope = /*#__PURE__*/dual(2, (self, scope) => core.flatMap(makeMemoMap, memoMap => buildWithMemoMap(self, memoMap, scope)));\n/** @internal */\nexport const buildWithMemoMap = /*#__PURE__*/dual(3, (self, memoMap, scope) => core.flatMap(makeBuilder(self, scope), run => effect.provideService(run(memoMap), CurrentMemoMap, memoMap)));\nconst makeBuilder = (self, scope, inMemoMap = false) => {\n const op = self;\n switch (op._op_layer) {\n case \"Locally\":\n {\n return core.sync(() => memoMap => op.f(memoMap.getOrElseMemoize(op.self, scope)));\n }\n case \"ExtendScope\":\n {\n return core.sync(() => memoMap => fiberRuntime.scopeWith(scope => memoMap.getOrElseMemoize(op.layer, scope)));\n }\n case \"Fold\":\n {\n return core.sync(() => memoMap => pipe(memoMap.getOrElseMemoize(op.layer, scope), core.matchCauseEffect({\n onFailure: cause => memoMap.getOrElseMemoize(op.failureK(cause), scope),\n onSuccess: value => memoMap.getOrElseMemoize(op.successK(value), scope)\n })));\n }\n case \"Fresh\":\n {\n return core.sync(() => _ => pipe(op.layer, buildWithScope(scope)));\n }\n case \"FromEffect\":\n {\n return inMemoMap ? core.sync(() => _ => op.effect) : core.sync(() => memoMap => memoMap.getOrElseMemoize(self, scope));\n }\n case \"Provide\":\n {\n return core.sync(() => memoMap => pipe(memoMap.getOrElseMemoize(op.first, scope), core.flatMap(env => pipe(memoMap.getOrElseMemoize(op.second, scope), core.provideContext(env)))));\n }\n case \"Scoped\":\n {\n return inMemoMap ? core.sync(() => _ => fiberRuntime.scopeExtend(op.effect, scope)) : core.sync(() => memoMap => memoMap.getOrElseMemoize(self, scope));\n }\n case \"Suspend\":\n {\n return core.sync(() => memoMap => memoMap.getOrElseMemoize(op.evaluate(), scope));\n }\n case \"ProvideMerge\":\n {\n return core.sync(() => memoMap => pipe(memoMap.getOrElseMemoize(op.first, scope), core.zipWith(memoMap.getOrElseMemoize(op.second, scope), op.zipK)));\n }\n case \"ZipWith\":\n {\n return core.gen(function* () {\n const parallelScope = yield* core.scopeFork(scope, ExecutionStrategy.parallel);\n const firstScope = yield* core.scopeFork(parallelScope, ExecutionStrategy.sequential);\n const secondScope = yield* core.scopeFork(parallelScope, ExecutionStrategy.sequential);\n return memoMap => pipe(memoMap.getOrElseMemoize(op.first, firstScope), fiberRuntime.zipWithOptions(memoMap.getOrElseMemoize(op.second, secondScope), op.zipK, {\n concurrent: true\n }));\n });\n }\n case \"MergeAll\":\n {\n const layers = op.layers;\n return core.map(core.scopeFork(scope, ExecutionStrategy.parallel), parallelScope => memoMap => {\n const contexts = new Array(layers.length);\n return core.map(fiberRuntime.forEachConcurrentDiscard(layers, core.fnUntraced(function* (layer, i) {\n const scope = yield* core.scopeFork(parallelScope, ExecutionStrategy.sequential);\n const context = yield* memoMap.getOrElseMemoize(layer, scope);\n contexts[i] = context;\n }), false, false), () => Context.mergeAll(...contexts));\n });\n }\n }\n};\n// -----------------------------------------------------------------------------\n// Layer\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const catchAll = /*#__PURE__*/dual(2, (self, onFailure) => match(self, {\n onFailure,\n onSuccess: succeedContext\n}));\n/** @internal */\nexport const catchAllCause = /*#__PURE__*/dual(2, (self, onFailure) => matchCause(self, {\n onFailure,\n onSuccess: succeedContext\n}));\n/** @internal */\nexport const die = defect => failCause(Cause.die(defect));\n/** @internal */\nexport const dieSync = evaluate => failCauseSync(() => Cause.die(evaluate()));\n/** @internal */\nexport const discard = self => map(self, () => Context.empty());\n/** @internal */\nexport const context = () => fromEffectContext(core.context());\n/** @internal */\nexport const extendScope = self => {\n const extendScope = Object.create(proto);\n extendScope._op_layer = OpCodes.OP_EXTEND_SCOPE;\n extendScope.layer = self;\n return extendScope;\n};\n/** @internal */\nexport const fail = error => failCause(Cause.fail(error));\n/** @internal */\nexport const failSync = evaluate => failCauseSync(() => Cause.fail(evaluate()));\n/** @internal */\nexport const failCause = cause => fromEffectContext(core.failCause(cause));\n/** @internal */\nexport const failCauseSync = evaluate => fromEffectContext(core.failCauseSync(evaluate));\n/** @internal */\nexport const flatMap = /*#__PURE__*/dual(2, (self, f) => match(self, {\n onFailure: fail,\n onSuccess: f\n}));\n/** @internal */\nexport const flatten = /*#__PURE__*/dual(2, (self, tag) => flatMap(self, Context.get(tag)));\n/** @internal */\nexport const fresh = self => {\n const fresh = Object.create(proto);\n fresh._op_layer = OpCodes.OP_FRESH;\n fresh.layer = self;\n return fresh;\n};\n/** @internal */\nexport const fromEffect = /*#__PURE__*/dual(2, (a, b) => {\n const tagFirst = Context.isTag(a);\n const tag = tagFirst ? a : b;\n const effect = tagFirst ? b : a;\n return fromEffectContext(core.map(effect, service => Context.make(tag, service)));\n});\n/** @internal */\nexport const fromEffectDiscard = effect => fromEffectContext(core.map(effect, () => Context.empty()));\n/** @internal */\nexport function fromEffectContext(effect) {\n const fromEffect = Object.create(proto);\n fromEffect._op_layer = OpCodes.OP_FROM_EFFECT;\n fromEffect.effect = effect;\n return fromEffect;\n}\n/** @internal */\nexport const fiberRefLocally = /*#__PURE__*/dual(3, (self, ref, value) => locallyEffect(self, core.fiberRefLocally(ref, value)));\n/** @internal */\nexport const locallyEffect = /*#__PURE__*/dual(2, (self, f) => {\n const locally = Object.create(proto);\n locally._op_layer = \"Locally\";\n locally.self = self;\n locally.f = f;\n return locally;\n});\n/** @internal */\nexport const fiberRefLocallyWith = /*#__PURE__*/dual(3, (self, ref, value) => locallyEffect(self, core.fiberRefLocallyWith(ref, value)));\n/** @internal */\nexport const fiberRefLocallyScoped = (self, value) => scopedDiscard(fiberRuntime.fiberRefLocallyScoped(self, value));\n/** @internal */\nexport const fiberRefLocallyScopedWith = (self, value) => scopedDiscard(fiberRuntime.fiberRefLocallyScopedWith(self, value));\n/** @internal */\nexport const fromFunction = (tagA, tagB, f) => fromEffectContext(core.map(tagA, a => Context.make(tagB, f(a))));\n/** @internal */\nexport const launch = self => fiberRuntime.scopedEffect(core.zipRight(fiberRuntime.scopeWith(scope => pipe(self, buildWithScope(scope))), core.never));\n/** @internal */\nexport const mock = function () {\n if (arguments.length === 1) {\n return service => mockImpl(arguments[0], service);\n }\n return mockImpl(arguments[0], arguments[1]);\n};\nconst mockImpl = (tag, service) => succeed(tag, new Proxy({\n ...service\n}, {\n get(target, prop, _receiver) {\n if (prop in target) {\n return target[prop];\n }\n const prevLimit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const error = new Error(`${tag.key}: Unimplemented method \"${prop.toString()}\"`);\n Error.stackTraceLimit = prevLimit;\n error.name = \"UnimplementedError\";\n return makeUnimplemented(error);\n },\n has: constTrue\n}));\nconst makeUnimplemented = error => {\n const dead = core.die(error);\n function unimplemented() {\n return dead;\n }\n // @effect-diagnostics-next-line floatingEffect:off\n Object.assign(unimplemented, dead);\n Object.setPrototypeOf(unimplemented, Object.getPrototypeOf(dead));\n return unimplemented;\n};\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => flatMap(self, context => succeedContext(f(context))));\n/** @internal */\nexport const mapError = /*#__PURE__*/dual(2, (self, f) => catchAll(self, error => failSync(() => f(error))));\n/** @internal */\nexport const matchCause = /*#__PURE__*/dual(2, (self, {\n onFailure,\n onSuccess\n}) => {\n const fold = Object.create(proto);\n fold._op_layer = OpCodes.OP_FOLD;\n fold.layer = self;\n fold.failureK = onFailure;\n fold.successK = onSuccess;\n return fold;\n});\n/** @internal */\nexport const match = /*#__PURE__*/dual(2, (self, {\n onFailure,\n onSuccess\n}) => matchCause(self, {\n onFailure: cause => {\n const failureOrCause = Cause.failureOrCause(cause);\n switch (failureOrCause._tag) {\n case \"Left\":\n {\n return onFailure(failureOrCause.left);\n }\n case \"Right\":\n {\n return failCause(failureOrCause.right);\n }\n }\n },\n onSuccess\n}));\n/** @internal */\nexport const memoize = self => fiberRuntime.scopeWith(scope => core.map(effect.memoize(buildWithScope(self, scope)), fromEffectContext));\n/** @internal */\nexport const merge = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, (a, b) => Context.merge(a, b)));\n/** @internal */\nexport const mergeAll = (...layers) => {\n const mergeAll = Object.create(proto);\n mergeAll._op_layer = OpCodes.OP_MERGE_ALL;\n mergeAll.layers = layers;\n return mergeAll;\n};\n/** @internal */\nexport const orDie = self => catchAll(self, defect => die(defect));\n/** @internal */\nexport const orElse = /*#__PURE__*/dual(2, (self, that) => catchAll(self, that));\n/** @internal */\nexport const passthrough = self => merge(context(), self);\n/** @internal */\nexport const project = /*#__PURE__*/dual(4, (self, tagA, tagB, f) => map(self, context => Context.make(tagB, f(Context.unsafeGet(context, tagA)))));\n/** @internal */\nexport const retry = /*#__PURE__*/dual(2, (self, schedule) => suspend(() => {\n const stateTag = Context.GenericTag(\"effect/Layer/retry/{ state: unknown }\");\n return pipe(succeed(stateTag, {\n state: schedule.initial\n }), flatMap(env => retryLoop(self, schedule, stateTag, pipe(env, Context.get(stateTag)).state)));\n}));\nconst retryLoop = (self, schedule, stateTag, state) => {\n return pipe(self, catchAll(error => pipe(retryUpdate(schedule, stateTag, error, state), flatMap(env => fresh(retryLoop(self, schedule, stateTag, pipe(env, Context.get(stateTag)).state))))));\n};\nconst retryUpdate = (schedule, stateTag, error, state) => {\n return fromEffect(stateTag, pipe(Clock.currentTimeMillis, core.flatMap(now => pipe(schedule.step(now, error, state), core.flatMap(([state, _, decision]) => ScheduleDecision.isDone(decision) ? core.fail(error) : pipe(Clock.sleep(Duration.millis(Intervals.start(decision.intervals) - now)), core.as({\n state\n })))))));\n};\n/** @internal */\nexport const scoped = /*#__PURE__*/dual(2, (a, b) => {\n const tagFirst = Context.isTag(a);\n const tag = tagFirst ? a : b;\n const effect = tagFirst ? b : a;\n return scopedContext(core.map(effect, service => Context.make(tag, service)));\n});\n/** @internal */\nexport const scopedDiscard = effect => scopedContext(pipe(effect, core.as(Context.empty())));\n/** @internal */\nexport const scopedContext = effect => {\n const scoped = Object.create(proto);\n scoped._op_layer = OpCodes.OP_SCOPED;\n scoped.effect = effect;\n return scoped;\n};\n/** @internal */\nexport const scope = /*#__PURE__*/scopedContext(/*#__PURE__*/core.map(/*#__PURE__*/fiberRuntime.acquireRelease(/*#__PURE__*/fiberRuntime.scopeMake(), (scope, exit) => scope.close(exit)), scope => Context.make(Scope.Scope, scope)));\n/** @internal */\nexport const service = tag => fromEffect(tag, tag);\n/** @internal */\nexport const succeed = /*#__PURE__*/dual(2, (a, b) => {\n const tagFirst = Context.isTag(a);\n const tag = tagFirst ? a : b;\n const resource = tagFirst ? b : a;\n return fromEffectContext(core.succeed(Context.make(tag, resource)));\n});\n/** @internal */\nexport const succeedContext = context => {\n return fromEffectContext(core.succeed(context));\n};\n/** @internal */\nexport const empty = /*#__PURE__*/succeedContext(/*#__PURE__*/Context.empty());\n/** @internal */\nexport const suspend = evaluate => {\n const suspend = Object.create(proto);\n suspend._op_layer = OpCodes.OP_SUSPEND;\n suspend.evaluate = evaluate;\n return suspend;\n};\n/** @internal */\nexport const sync = /*#__PURE__*/dual(2, (a, b) => {\n const tagFirst = Context.isTag(a);\n const tag = tagFirst ? a : b;\n const evaluate = tagFirst ? b : a;\n return fromEffectContext(core.sync(() => Context.make(tag, evaluate())));\n});\n/** @internal */\nexport const syncContext = evaluate => {\n return fromEffectContext(core.sync(evaluate));\n};\n/** @internal */\nexport const tap = /*#__PURE__*/dual(2, (self, f) => flatMap(self, context => fromEffectContext(core.as(f(context), context))));\n/** @internal */\nexport const tapError = /*#__PURE__*/dual(2, (self, f) => catchAll(self, e => fromEffectContext(core.flatMap(f(e), () => core.fail(e)))));\n/** @internal */\nexport const tapErrorCause = /*#__PURE__*/dual(2, (self, f) => catchAllCause(self, cause => fromEffectContext(core.flatMap(f(cause), () => core.failCause(cause)))));\n/** @internal */\nexport const toRuntime = self => pipe(fiberRuntime.scopeWith(scope => buildWithScope(self, scope)), core.flatMap(context => pipe(runtime.runtime(), core.provideContext(context))));\n/** @internal */\nexport const toRuntimeWithMemoMap = /*#__PURE__*/dual(2, (self, memoMap) => core.flatMap(fiberRuntime.scopeWith(scope => buildWithMemoMap(self, memoMap, scope)), context => pipe(runtime.runtime(), core.provideContext(context))));\n/** @internal */\nexport const provide = /*#__PURE__*/dual(2, (self, that) => suspend(() => {\n const provideTo = Object.create(proto);\n provideTo._op_layer = OpCodes.OP_PROVIDE;\n provideTo.first = Object.create(proto, {\n _op_layer: {\n value: OpCodes.OP_PROVIDE_MERGE,\n enumerable: true\n },\n first: {\n value: context(),\n enumerable: true\n },\n second: {\n value: Array.isArray(that) ? mergeAll(...that) : that\n },\n zipK: {\n value: (a, b) => pipe(a, Context.merge(b))\n }\n });\n provideTo.second = self;\n return provideTo;\n}));\n/** @internal */\nexport const provideMerge = /*#__PURE__*/dual(2, (that, self) => {\n const zipWith = Object.create(proto);\n zipWith._op_layer = OpCodes.OP_PROVIDE_MERGE;\n zipWith.first = self;\n zipWith.second = provide(that, self);\n zipWith.zipK = (a, b) => {\n return pipe(a, Context.merge(b));\n };\n return zipWith;\n});\n/** @internal */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => suspend(() => {\n const zipWith = Object.create(proto);\n zipWith._op_layer = OpCodes.OP_ZIP_WITH;\n zipWith.first = self;\n zipWith.second = that;\n zipWith.zipK = f;\n return zipWith;\n}));\n/** @internal */\nexport const unwrapEffect = self => {\n const tag = Context.GenericTag(\"effect/Layer/unwrapEffect/Layer.Layer<R1, E1, A>\");\n return flatMap(fromEffect(tag, self), context => Context.get(context, tag));\n};\n/** @internal */\nexport const unwrapScoped = self => {\n const tag = Context.GenericTag(\"effect/Layer/unwrapScoped/Layer.Layer<R1, E1, A>\");\n return flatMap(scoped(tag, self), context => Context.get(context, tag));\n};\n// -----------------------------------------------------------------------------\n// logging\n// -----------------------------------------------------------------------------\nexport const annotateLogs = /*#__PURE__*/dual(args => isLayer(args[0]), function () {\n const args = arguments;\n return fiberRefLocallyWith(args[0], core.currentLogAnnotations, typeof args[1] === \"string\" ? HashMap.set(args[1], args[2]) : annotations => Object.entries(args[1]).reduce((acc, [key, value]) => HashMap.set(acc, key, value), annotations));\n});\n// -----------------------------------------------------------------------------\n// tracing\n// -----------------------------------------------------------------------------\nexport const annotateSpans = /*#__PURE__*/dual(args => isLayer(args[0]), function () {\n const args = arguments;\n return fiberRefLocallyWith(args[0], core.currentTracerSpanAnnotations, typeof args[1] === \"string\" ? HashMap.set(args[1], args[2]) : annotations => Object.entries(args[1]).reduce((acc, [key, value]) => HashMap.set(acc, key, value), annotations));\n});\n/** @internal */\nexport const withSpan = function () {\n const dataFirst = typeof arguments[0] !== \"string\";\n const name = dataFirst ? arguments[1] : arguments[0];\n const options = tracer.addSpanStackTrace(dataFirst ? arguments[2] : arguments[1]);\n if (dataFirst) {\n const self = arguments[0];\n return unwrapScoped(core.map(options?.onEnd ? core.tap(fiberRuntime.makeSpanScoped(name, options), span => fiberRuntime.addFinalizer(exit => options.onEnd(span, exit))) : fiberRuntime.makeSpanScoped(name, options), span => withParentSpan(self, span)));\n }\n return self => unwrapScoped(core.map(options?.onEnd ? core.tap(fiberRuntime.makeSpanScoped(name, options), span => fiberRuntime.addFinalizer(exit => options.onEnd(span, exit))) : fiberRuntime.makeSpanScoped(name, options), span => withParentSpan(self, span)));\n};\n/** @internal */\nexport const withParentSpan = /*#__PURE__*/dual(2, (self, span) => provide(self, succeedContext(Context.make(tracer.spanTag, span))));\n// circular with Effect\nconst provideSomeLayer = /*#__PURE__*/dual(2, (self, layer) => fiberRuntime.scopedWith(scope => core.flatMap(buildWithScope(layer, scope), context => core.provideSomeContext(self, context))));\nconst provideSomeRuntime = /*#__PURE__*/dual(2, (self, rt) => {\n const patchRefs = FiberRefsPatch.diff(runtime.defaultRuntime.fiberRefs, rt.fiberRefs);\n const patchFlags = runtimeFlags.diff(runtime.defaultRuntime.runtimeFlags, rt.runtimeFlags);\n return core.uninterruptibleMask(restore => core.withFiberRuntime(fiber => {\n const oldContext = fiber.getFiberRef(core.currentContext);\n const oldRefs = fiber.getFiberRefs();\n const newRefs = FiberRefsPatch.patch(fiber.id(), oldRefs)(patchRefs);\n const oldFlags = fiber.currentRuntimeFlags;\n const newFlags = runtimeFlags.patch(patchFlags)(oldFlags);\n const rollbackRefs = FiberRefsPatch.diff(newRefs, oldRefs);\n const rollbackFlags = runtimeFlags.diff(newFlags, oldFlags);\n fiber.setFiberRefs(newRefs);\n fiber.currentRuntimeFlags = newFlags;\n return fiberRuntime.ensuring(core.provideSomeContext(restore(self), Context.merge(oldContext, rt.context)), core.withFiberRuntime(fiber => {\n fiber.setFiberRefs(FiberRefsPatch.patch(fiber.id(), fiber.getFiberRefs())(rollbackRefs));\n fiber.currentRuntimeFlags = runtimeFlags.patch(rollbackFlags)(fiber.currentRuntimeFlags);\n return core.void;\n }));\n }));\n});\n/** @internal */\nexport const effect_provide = /*#__PURE__*/dual(2, (self, source) => {\n if (Array.isArray(source)) {\n // @ts-expect-error\n return provideSomeLayer(self, mergeAll(...source));\n } else if (isLayer(source)) {\n return provideSomeLayer(self, source);\n } else if (Context.isContext(source)) {\n return core.provideSomeContext(self, source);\n } else if (circularManagedRuntime.TypeId in source) {\n return core.flatMap(source.runtimeEffect, rt => provideSomeRuntime(self, rt));\n } else {\n return provideSomeRuntime(self, source);\n }\n});\n//# sourceMappingURL=layer.js.map","import * as core from \"./internal/core.js\";\nimport * as internal from \"./internal/data.js\";\nimport { StructuralPrototype } from \"./internal/effectable.js\";\nimport * as Predicate from \"./Predicate.js\";\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data, Equal } from \"effect\"\n *\n * const alice = Data.struct({ name: \"Alice\", age: 30 })\n *\n * const bob = Data.struct({ name: \"Bob\", age: 40 })\n *\n * assert.deepStrictEqual(Equal.equals(alice, alice), true)\n * assert.deepStrictEqual(Equal.equals(alice, Data.struct({ name: \"Alice\", age: 30 })), true)\n *\n * assert.deepStrictEqual(Equal.equals(alice, { name: \"Alice\", age: 30 }), false)\n * assert.deepStrictEqual(Equal.equals(alice, bob), false)\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const struct = internal.struct;\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const unsafeStruct = as => Object.setPrototypeOf(as, StructuralPrototype);\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data, Equal } from \"effect\"\n *\n * const alice = Data.tuple(\"Alice\", 30)\n *\n * const bob = Data.tuple(\"Bob\", 40)\n *\n * assert.deepStrictEqual(Equal.equals(alice, alice), true)\n * assert.deepStrictEqual(Equal.equals(alice, Data.tuple(\"Alice\", 30)), true)\n *\n * assert.deepStrictEqual(Equal.equals(alice, [\"Alice\", 30]), false)\n * assert.deepStrictEqual(Equal.equals(alice, bob), false)\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const tuple = (...as) => unsafeArray(as);\n/**\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data, Equal } from \"effect\"\n *\n * const alice = Data.struct({ name: \"Alice\", age: 30 })\n * const bob = Data.struct({ name: \"Bob\", age: 40 })\n *\n * const persons = Data.array([alice, bob])\n *\n * assert.deepStrictEqual(\n * Equal.equals(\n * persons,\n * Data.array([\n * Data.struct({ name: \"Alice\", age: 30 }),\n * Data.struct({ name: \"Bob\", age: 40 })\n * ])\n * ),\n * true\n * )\n * ```\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const array = as => unsafeArray(as.slice(0));\n/**\n * @category constructors\n * @since 2.0.0\n */\nexport const unsafeArray = as => Object.setPrototypeOf(as, internal.ArrayProto);\nconst _case = () => args => args === undefined ? Object.create(StructuralPrototype) : struct(args);\nexport {\n/**\n * Provides a constructor for the specified `Case`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data, Equal } from \"effect\"\n *\n * interface Person {\n * readonly name: string\n * }\n *\n * // Creating a constructor for the specified Case\n * const Person = Data.case<Person>()\n *\n * // Creating instances of Person\n * const mike1 = Person({ name: \"Mike\" })\n * const mike2 = Person({ name: \"Mike\" })\n * const john = Person({ name: \"John\" })\n *\n * // Checking equality\n * assert.deepStrictEqual(Equal.equals(mike1, mike2), true)\n * assert.deepStrictEqual(Equal.equals(mike1, john), false)\n *\n * ```\n * @since 2.0.0\n * @category constructors\n */\n_case as case };\n/**\n * Provides a tagged constructor for the specified `Case`.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data } from \"effect\"\n *\n * interface Person {\n * readonly _tag: \"Person\" // the tag\n * readonly name: string\n * }\n *\n * const Person = Data.tagged<Person>(\"Person\")\n *\n * const mike = Person({ name: \"Mike\" })\n *\n * assert.deepEqual(mike, { _tag: \"Person\", name: \"Mike\" })\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const tagged = tag => args => {\n const value = args === undefined ? Object.create(StructuralPrototype) : struct(args);\n value._tag = tag;\n return value;\n};\n/**\n * Provides a constructor for a Case Class.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data, Equal } from \"effect\"\n *\n * class Person extends Data.Class<{ readonly name: string }> {}\n *\n * // Creating instances of Person\n * const mike1 = new Person({ name: \"Mike\" })\n * const mike2 = new Person({ name: \"Mike\" })\n * const john = new Person({ name: \"John\" })\n *\n * // Checking equality\n * assert.deepStrictEqual(Equal.equals(mike1, mike2), true)\n * assert.deepStrictEqual(Equal.equals(mike1, john), false)\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const Class = internal.Structural;\n/**\n * Provides a Tagged constructor for a Case Class.\n *\n * @example\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Data, Equal } from \"effect\"\n *\n * class Person extends Data.TaggedClass(\"Person\")<{ readonly name: string }> {}\n *\n * // Creating instances of Person\n * const mike1 = new Person({ name: \"Mike\" })\n * const mike2 = new Person({ name: \"Mike\" })\n * const john = new Person({ name: \"John\" })\n *\n * // Checking equality\n * assert.deepStrictEqual(Equal.equals(mike1, mike2), true)\n * assert.deepStrictEqual(Equal.equals(mike1, john), false)\n *\n * assert.deepStrictEqual(mike1._tag, \"Person\")\n * ```\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const TaggedClass = tag => {\n class Base extends Class {\n _tag = tag;\n }\n return Base;\n};\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const Structural = internal.Structural;\n/**\n * Create a constructor for a tagged union of `Data` structs.\n *\n * You can also pass a `TaggedEnum.WithGenerics` if you want to add generics to\n * the constructor.\n *\n * @example\n * ```ts\n * import { Data } from \"effect\"\n *\n * const { BadRequest, NotFound } = Data.taggedEnum<\n * | { readonly _tag: \"BadRequest\"; readonly status: 400; readonly message: string }\n * | { readonly _tag: \"NotFound\"; readonly status: 404; readonly message: string }\n * >()\n *\n * const notFound = NotFound({ status: 404, message: \"Not Found\" })\n * ```\n *\n * @example\n * import { Data } from \"effect\"\n *\n * type MyResult<E, A> = Data.TaggedEnum<{\n * Failure: { readonly error: E }\n * Success: { readonly value: A }\n * }>\n * interface MyResultDefinition extends Data.TaggedEnum.WithGenerics<2> {\n * readonly taggedEnum: MyResult<this[\"A\"], this[\"B\"]>\n * }\n * const { Failure, Success } = Data.taggedEnum<MyResultDefinition>()\n *\n * const success = Success({ value: 1 })\n *\n * @category constructors\n * @since 2.0.0\n */\nexport const taggedEnum = () => new Proxy({}, {\n get(_target, tag, _receiver) {\n if (tag === \"$is\") {\n return Predicate.isTagged;\n } else if (tag === \"$match\") {\n return taggedMatch;\n }\n return tagged(tag);\n }\n});\nfunction taggedMatch() {\n if (arguments.length === 1) {\n const cases = arguments[0];\n return function (value) {\n return cases[value._tag](value);\n };\n }\n const value = arguments[0];\n const cases = arguments[1];\n return cases[value._tag](value);\n}\n/**\n * Provides a constructor for a Case Class.\n *\n * @since 2.0.0\n * @category constructors\n */\nexport const Error = /*#__PURE__*/function () {\n const plainArgsSymbol = /*#__PURE__*/Symbol.for(\"effect/Data/Error/plainArgs\");\n const O = {\n BaseEffectError: class extends core.YieldableError {\n constructor(args) {\n super(args?.message, args?.cause ? {\n cause: args.cause\n } : undefined);\n if (args) {\n Object.assign(this, args);\n // @effect-diagnostics-next-line floatingEffect:off\n Object.defineProperty(this, plainArgsSymbol, {\n value: args,\n enumerable: false\n });\n }\n }\n toJSON() {\n return {\n ...this[plainArgsSymbol],\n ...this\n };\n }\n }\n };\n return O.BaseEffectError;\n}();\n/**\n * @since 2.0.0\n * @category constructors\n */\nexport const TaggedError = tag => {\n const O = {\n BaseEffectError: class extends Error {\n _tag = tag;\n }\n };\n O.BaseEffectError.prototype.name = tag;\n return O.BaseEffectError;\n};\n//# sourceMappingURL=Data.js.map","import * as Chunk from \"../Chunk.js\";\nimport * as Clock from \"../Clock.js\";\nimport * as Context from \"../Context.js\";\nimport * as Cron from \"../Cron.js\";\nimport * as Duration from \"../Duration.js\";\nimport * as Either from \"../Either.js\";\nimport * as Equal from \"../Equal.js\";\nimport { constVoid, dual, pipe } from \"../Function.js\";\nimport * as Option from \"../Option.js\";\nimport { pipeArguments } from \"../Pipeable.js\";\nimport { hasProperty } from \"../Predicate.js\";\nimport * as Random from \"../Random.js\";\nimport * as ScheduleDecision from \"../ScheduleDecision.js\";\nimport * as Interval from \"../ScheduleInterval.js\";\nimport * as Intervals from \"../ScheduleIntervals.js\";\nimport * as internalCause from \"./cause.js\";\nimport * as effect from \"./core-effect.js\";\nimport * as core from \"./core.js\";\nimport { forkScoped } from \"./effect/circular.js\";\nimport * as ref from \"./ref.js\";\n/** @internal */\nconst ScheduleSymbolKey = \"effect/Schedule\";\n/** @internal */\nexport const ScheduleTypeId = /*#__PURE__*/Symbol.for(ScheduleSymbolKey);\n/** @internal */\nexport const isSchedule = u => hasProperty(u, ScheduleTypeId);\n/** @internal */\nconst ScheduleDriverSymbolKey = \"effect/ScheduleDriver\";\n/** @internal */\nexport const ScheduleDriverTypeId = /*#__PURE__*/Symbol.for(ScheduleDriverSymbolKey);\n/** @internal */\nconst defaultIterationMetadata = {\n start: 0,\n now: 0,\n input: undefined,\n output: undefined,\n elapsed: Duration.zero,\n elapsedSincePrevious: Duration.zero,\n recurrence: 0\n};\n/** @internal */\nexport const CurrentIterationMetadata = /*#__PURE__*/Context.Reference()(\"effect/Schedule/CurrentIterationMetadata\", {\n defaultValue: () => defaultIterationMetadata\n});\nconst scheduleVariance = {\n /* c8 ignore next */\n _Out: _ => _,\n /* c8 ignore next */\n _In: _ => _,\n /* c8 ignore next */\n _R: _ => _\n};\nconst scheduleDriverVariance = {\n /* c8 ignore next */\n _Out: _ => _,\n /* c8 ignore next */\n _In: _ => _,\n /* c8 ignore next */\n _R: _ => _\n};\n/** @internal */\nclass ScheduleImpl {\n initial;\n step;\n [ScheduleTypeId] = scheduleVariance;\n constructor(initial, step) {\n this.initial = initial;\n this.step = step;\n }\n pipe() {\n return pipeArguments(this, arguments);\n }\n}\n/** @internal */\nconst updateInfo = (iterationMetaRef, now, input, output) => ref.update(iterationMetaRef, prev => prev.recurrence === 0 ? {\n now,\n input,\n output,\n recurrence: prev.recurrence + 1,\n elapsed: Duration.zero,\n elapsedSincePrevious: Duration.zero,\n start: now\n} : {\n now,\n input,\n output,\n recurrence: prev.recurrence + 1,\n elapsed: Duration.millis(now - prev.start),\n elapsedSincePrevious: Duration.millis(now - prev.now),\n start: prev.start\n});\n/** @internal */\nclass ScheduleDriverImpl {\n schedule;\n ref;\n [ScheduleDriverTypeId] = scheduleDriverVariance;\n constructor(schedule, ref) {\n this.schedule = schedule;\n this.ref = ref;\n }\n get state() {\n return core.map(ref.get(this.ref), tuple => tuple[1]);\n }\n get last() {\n return core.flatMap(ref.get(this.ref), ([element, _]) => {\n switch (element._tag) {\n case \"None\":\n {\n return core.failSync(() => new core.NoSuchElementException());\n }\n case \"Some\":\n {\n return core.succeed(element.value);\n }\n }\n });\n }\n iterationMeta = /*#__PURE__*/ref.unsafeMake(defaultIterationMetadata);\n get reset() {\n return ref.set(this.ref, [Option.none(), this.schedule.initial]).pipe(core.zipLeft(ref.set(this.iterationMeta, defaultIterationMetadata)));\n }\n next(input) {\n return pipe(core.map(ref.get(this.ref), tuple => tuple[1]), core.flatMap(state => pipe(Clock.currentTimeMillis, core.flatMap(now => pipe(core.suspend(() => this.schedule.step(now, input, state)), core.flatMap(([state, out, decision]) => {\n const setState = ref.set(this.ref, [Option.some(out), state]);\n if (ScheduleDecision.isDone(decision)) {\n return setState.pipe(core.zipRight(core.fail(Option.none())));\n }\n const millis = Intervals.start(decision.intervals) - now;\n if (millis <= 0) {\n return setState.pipe(core.zipRight(updateInfo(this.iterationMeta, now, input, out)), core.as(out));\n }\n const duration = Duration.millis(millis);\n return pipe(setState, core.zipRight(updateInfo(this.iterationMeta, now, input, out)), core.zipRight(effect.sleep(duration)), core.as(out));\n }))))));\n }\n}\n/** @internal */\nexport const makeWithState = (initial, step) => new ScheduleImpl(initial, step);\n/** @internal */\nexport const addDelay = /*#__PURE__*/dual(2, (self, f) => addDelayEffect(self, out => core.sync(() => f(out))));\n/** @internal */\nexport const addDelayEffect = /*#__PURE__*/dual(2, (self, f) => modifyDelayEffect(self, (out, duration) => core.map(f(out), delay => Duration.sum(duration, Duration.decode(delay)))));\n/** @internal */\nexport const andThen = /*#__PURE__*/dual(2, (self, that) => map(andThenEither(self, that), Either.merge));\n/** @internal */\nexport const andThenEither = /*#__PURE__*/dual(2, (self, that) => makeWithState([self.initial, that.initial, true], (now, input, state) => state[2] ? core.flatMap(self.step(now, input, state[0]), ([lState, out, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.map(that.step(now, input, state[1]), ([rState, out, decision]) => [[lState, rState, false], Either.right(out), decision]);\n }\n return core.succeed([[lState, state[1], true], Either.left(out), decision]);\n}) : core.map(that.step(now, input, state[1]), ([rState, out, decision]) => [[state[0], rState, false], Either.right(out), decision])));\n/** @internal */\nexport const as = /*#__PURE__*/dual(2, (self, out) => map(self, () => out));\n/** @internal */\nexport const asVoid = self => map(self, constVoid);\n/** @internal */\nexport const bothInOut = /*#__PURE__*/dual(2, (self, that) => makeWithState([self.initial, that.initial], (now, [in1, in2], state) => core.zipWith(self.step(now, in1, state[0]), that.step(now, in2, state[1]), ([lState, out, lDecision], [rState, out2, rDecision]) => {\n if (ScheduleDecision.isContinue(lDecision) && ScheduleDecision.isContinue(rDecision)) {\n const interval = pipe(lDecision.intervals, Intervals.union(rDecision.intervals));\n return [[lState, rState], [out, out2], ScheduleDecision.continue(interval)];\n }\n return [[lState, rState], [out, out2], ScheduleDecision.done];\n})));\n/** @internal */\nexport const check = /*#__PURE__*/dual(2, (self, test) => checkEffect(self, (input, out) => core.sync(() => test(input, out))));\n/** @internal */\nexport const checkEffect = /*#__PURE__*/dual(2, (self, test) => makeWithState(self.initial, (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.succeed([state, out, ScheduleDecision.done]);\n }\n return core.map(test(input, out), cont => cont ? [state, out, decision] : [state, out, ScheduleDecision.done]);\n})));\n/** @internal */\nexport const collectAllInputs = () => collectAllOutputs(identity());\n/** @internal */\nexport const collectAllOutputs = self => reduce(self, Chunk.empty(), (outs, out) => pipe(outs, Chunk.append(out)));\n/** @internal */\nexport const collectUntil = f => collectAllOutputs(recurUntil(f));\n/** @internal */\nexport const collectUntilEffect = f => collectAllOutputs(recurUntilEffect(f));\n/** @internal */\nexport const collectWhile = f => collectAllOutputs(recurWhile(f));\n/** @internal */\nexport const collectWhileEffect = f => collectAllOutputs(recurWhileEffect(f));\n/** @internal */\nexport const compose = /*#__PURE__*/dual(2, (self, that) => makeWithState([self.initial, that.initial], (now, input, state) => core.flatMap(self.step(now, input, state[0]), ([lState, out, lDecision]) => core.map(that.step(now, out, state[1]), ([rState, out2, rDecision]) => ScheduleDecision.isDone(lDecision) ? [[lState, rState], out2, ScheduleDecision.done] : ScheduleDecision.isDone(rDecision) ? [[lState, rState], out2, ScheduleDecision.done] : [[lState, rState], out2, ScheduleDecision.continue(pipe(lDecision.intervals, Intervals.max(rDecision.intervals)))]))));\n/** @internal */\nexport const mapInput = /*#__PURE__*/dual(2, (self, f) => mapInputEffect(self, input2 => core.sync(() => f(input2))));\n/** @internal */\nexport const mapInputContext = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.mapInputContext(self.step(now, input, state), f)));\n/** @internal */\nexport const mapInputEffect = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input2, state) => core.flatMap(f(input2), input => self.step(now, input, state))));\n/** @internal */\nexport const cron = (expression, tz) => {\n const parsed = Cron.isCron(expression) ? Either.right(expression) : Cron.parse(expression, tz);\n return makeWithState([true, [Number.MIN_SAFE_INTEGER, 0, 0]], (now, _, [initial, previous]) => {\n if (now < previous[0]) {\n return core.succeed([[false, previous], [previous[1], previous[2]], ScheduleDecision.continueWith(Interval.make(previous[1], previous[2]))]);\n }\n if (Either.isLeft(parsed)) {\n return core.die(parsed.left);\n }\n const cron = parsed.right;\n const date = new Date(now);\n let next;\n if (initial && Cron.match(cron, date)) {\n next = now;\n }\n next = Cron.next(cron, date).getTime();\n const start = beginningOfSecond(next);\n const end = endOfSecond(next);\n return core.succeed([[false, [next, start, end]], [start, end], ScheduleDecision.continueWith(Interval.make(start, end))]);\n });\n};\n/** @internal */\nexport const dayOfMonth = day => {\n return makeWithState([Number.NEGATIVE_INFINITY, 0], (now, _, state) => {\n if (!Number.isInteger(day) || day < 1 || 31 < day) {\n return core.dieSync(() => new core.IllegalArgumentException(`Invalid argument in: dayOfMonth(${day}). Must be in range 1...31`));\n }\n const n = state[1];\n const initial = n === 0;\n const day0 = nextDayOfMonth(now, day, initial);\n const start = beginningOfDay(day0);\n const end = endOfDay(day0);\n const interval = Interval.make(start, end);\n return core.succeed([[end, n + 1], n, ScheduleDecision.continueWith(interval)]);\n });\n};\n/** @internal */\nexport const dayOfWeek = day => {\n return makeWithState([Number.MIN_SAFE_INTEGER, 0], (now, _, state) => {\n if (!Number.isInteger(day) || day < 1 || 7 < day) {\n return core.dieSync(() => new core.IllegalArgumentException(`Invalid argument in: dayOfWeek(${day}). Must be in range 1 (Monday)...7 (Sunday)`));\n }\n const n = state[1];\n const initial = n === 0;\n const day0 = nextDay(now, day, initial);\n const start = beginningOfDay(day0);\n const end = endOfDay(day0);\n const interval = Interval.make(start, end);\n return core.succeed([[end, n + 1], n, ScheduleDecision.continueWith(interval)]);\n });\n};\n/** @internal */\nexport const delayed = /*#__PURE__*/dual(2, (self, f) => delayedEffect(self, duration => core.sync(() => f(duration))));\n/** @internal */\nexport const delayedEffect = /*#__PURE__*/dual(2, (self, f) => modifyDelayEffect(self, (_, delay) => f(delay)));\n/** @internal */\nexport const delayedSchedule = schedule => addDelay(schedule, x => x);\n/** @internal */\nexport const delays = self => makeWithState(self.initial, (now, input, state) => pipe(self.step(now, input, state), core.flatMap(([state, _, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.succeed([state, Duration.zero, decision]);\n }\n return core.succeed([state, Duration.millis(Intervals.start(decision.intervals) - now), decision]);\n})));\n/** @internal */\nexport const mapBoth = /*#__PURE__*/dual(2, (self, {\n onInput,\n onOutput\n}) => map(mapInput(self, onInput), onOutput));\n/** @internal */\nexport const mapBothEffect = /*#__PURE__*/dual(2, (self, {\n onInput,\n onOutput\n}) => mapEffect(mapInputEffect(self, onInput), onOutput));\n/** @internal */\nexport const driver = self => pipe(ref.make([Option.none(), self.initial]), core.map(ref => new ScheduleDriverImpl(self, ref)));\n/** @internal */\nexport const duration = durationInput => {\n const duration = Duration.decode(durationInput);\n const durationMillis = Duration.toMillis(duration);\n return makeWithState(true, (now, _, state) => core.succeed(state ? [false, duration, ScheduleDecision.continueWith(Interval.after(now + durationMillis))] : [false, Duration.zero, ScheduleDecision.done]));\n};\n/** @internal */\nexport const either = /*#__PURE__*/dual(2, (self, that) => union(self, that));\n/** @internal */\nexport const eitherWith = /*#__PURE__*/dual(3, (self, that, f) => unionWith(self, that, f));\n/** @internal */\nexport const ensuring = /*#__PURE__*/dual(2, (self, finalizer) => makeWithState(self.initial, (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => ScheduleDecision.isDone(decision) ? core.as(finalizer, [state, out, decision]) : core.succeed([state, out, decision]))));\n/** @internal */\nexport const exponential = (baseInput, factor = 2.0) => {\n const base = Duration.decode(baseInput);\n return delayedSchedule(map(forever, i => Duration.times(base, Math.pow(factor, i))));\n};\n/** @internal */\nexport const fibonacci = oneInput => {\n const one = Duration.decode(oneInput);\n return delayedSchedule(pipe(unfold([one, one], ([a, b]) => [b, Duration.sum(a, b)]), map(out => out[0])));\n};\n/** @internal */\nexport const fixed = intervalInput => {\n const interval = Duration.decode(intervalInput);\n const intervalMillis = Duration.toMillis(interval);\n return makeWithState([Option.none(), 0], (now, _, [option, n]) => core.sync(() => {\n switch (option._tag) {\n case \"None\":\n {\n return [[Option.some([now, now + intervalMillis]), n + 1], n, ScheduleDecision.continueWith(Interval.after(now + intervalMillis))];\n }\n case \"Some\":\n {\n const [startMillis, lastRun] = option.value;\n const runningBehind = now > lastRun + intervalMillis;\n const boundary = Equal.equals(interval, Duration.zero) ? interval : Duration.millis(intervalMillis - (now - startMillis) % intervalMillis);\n const sleepTime = Equal.equals(boundary, Duration.zero) ? interval : boundary;\n const nextRun = runningBehind ? now : now + Duration.toMillis(sleepTime);\n return [[Option.some([startMillis, nextRun]), n + 1], n, ScheduleDecision.continueWith(Interval.after(nextRun))];\n }\n }\n }));\n};\n/** @internal */\nexport const fromDelay = delay => duration(delay);\n/** @internal */\nexport const fromDelays = (delay, ...delays) => makeWithState([[delay, ...delays].map(_ => Duration.decode(_)), true], (now, _, [durations, cont]) => core.sync(() => {\n if (cont) {\n const x = durations[0];\n const interval = Interval.after(now + Duration.toMillis(x));\n if (durations.length >= 2) {\n return [[durations.slice(1), true], x, ScheduleDecision.continueWith(interval)];\n }\n const y = durations.slice(1);\n return [[[x, ...y], false], x, ScheduleDecision.continueWith(interval)];\n }\n return [[durations, false], Duration.zero, ScheduleDecision.done];\n}));\n/** @internal */\nexport const fromFunction = f => map(identity(), f);\n/** @internal */\nexport const hourOfDay = hour => makeWithState([Number.NEGATIVE_INFINITY, 0], (now, _, state) => {\n if (!Number.isInteger(hour) || hour < 0 || 23 < hour) {\n return core.dieSync(() => new core.IllegalArgumentException(`Invalid argument in: hourOfDay(${hour}). Must be in range 0...23`));\n }\n const n = state[1];\n const initial = n === 0;\n const hour0 = nextHour(now, hour, initial);\n const start = beginningOfHour(hour0);\n const end = endOfHour(hour0);\n const interval = Interval.make(start, end);\n return core.succeed([[end, n + 1], n, ScheduleDecision.continueWith(interval)]);\n});\n/** @internal */\nexport const identity = () => makeWithState(void 0, (now, input, state) => core.succeed([state, input, ScheduleDecision.continueWith(Interval.after(now))]));\n/** @internal */\nexport const intersect = /*#__PURE__*/dual(2, (self, that) => intersectWith(self, that, Intervals.intersect));\n/** @internal */\nexport const intersectWith = /*#__PURE__*/dual(3, (self, that, f) => makeWithState([self.initial, that.initial], (now, input, state) => pipe(core.zipWith(self.step(now, input, state[0]), that.step(now, input, state[1]), (a, b) => [a, b]), core.flatMap(([[lState, out, lDecision], [rState, out2, rDecision]]) => {\n if (ScheduleDecision.isContinue(lDecision) && ScheduleDecision.isContinue(rDecision)) {\n return intersectWithLoop(self, that, input, lState, out, lDecision.intervals, rState, out2, rDecision.intervals, f);\n }\n return core.succeed([[lState, rState], [out, out2], ScheduleDecision.done]);\n}))));\n/** @internal */\nconst intersectWithLoop = (self, that, input, lState, out, lInterval, rState, out2, rInterval, f) => {\n const combined = f(lInterval, rInterval);\n if (Intervals.isNonEmpty(combined)) {\n return core.succeed([[lState, rState], [out, out2], ScheduleDecision.continue(combined)]);\n }\n if (pipe(lInterval, Intervals.lessThan(rInterval))) {\n return core.flatMap(self.step(Intervals.end(lInterval), input, lState), ([lState, out, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.succeed([[lState, rState], [out, out2], ScheduleDecision.done]);\n }\n return intersectWithLoop(self, that, input, lState, out, decision.intervals, rState, out2, rInterval, f);\n });\n }\n return core.flatMap(that.step(Intervals.end(rInterval), input, rState), ([rState, out2, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.succeed([[lState, rState], [out, out2], ScheduleDecision.done]);\n }\n return intersectWithLoop(self, that, input, lState, out, lInterval, rState, out2, decision.intervals, f);\n });\n};\n/** @internal */\nexport const jittered = self => jitteredWith(self, {\n min: 0.8,\n max: 1.2\n});\n/** @internal */\nexport const jitteredWith = /*#__PURE__*/dual(2, (self, options) => {\n const {\n max,\n min\n } = Object.assign({\n min: 0.8,\n max: 1.2\n }, options);\n return delayedEffect(self, duration => core.map(Random.next, random => {\n const d = Duration.toMillis(duration);\n const jittered = d * min * (1 - random) + d * max * random;\n return Duration.millis(jittered);\n }));\n});\n/** @internal */\nexport const linear = baseInput => {\n const base = Duration.decode(baseInput);\n return delayedSchedule(map(forever, i => Duration.times(base, i + 1)));\n};\n/** @internal */\nexport const map = /*#__PURE__*/dual(2, (self, f) => mapEffect(self, out => core.sync(() => f(out))));\n/** @internal */\nexport const mapEffect = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => core.map(f(out), out2 => [state, out2, decision]))));\n/** @internal */\nexport const minuteOfHour = minute => makeWithState([Number.MIN_SAFE_INTEGER, 0], (now, _, state) => {\n if (!Number.isInteger(minute) || minute < 0 || 59 < minute) {\n return core.dieSync(() => new core.IllegalArgumentException(`Invalid argument in: minuteOfHour(${minute}). Must be in range 0...59`));\n }\n const n = state[1];\n const initial = n === 0;\n const minute0 = nextMinute(now, minute, initial);\n const start = beginningOfMinute(minute0);\n const end = endOfMinute(minute0);\n const interval = Interval.make(start, end);\n return core.succeed([[end, n + 1], n, ScheduleDecision.continueWith(interval)]);\n});\n/** @internal */\nexport const modifyDelay = /*#__PURE__*/dual(2, (self, f) => modifyDelayEffect(self, (out, duration) => core.sync(() => f(out, duration))));\n/** @internal */\nexport const modifyDelayEffect = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.succeed([state, out, decision]);\n }\n const intervals = decision.intervals;\n const delay = Interval.size(Interval.make(now, Intervals.start(intervals)));\n return core.map(f(out, delay), durationInput => {\n const duration = Duration.decode(durationInput);\n const oldStart = Intervals.start(intervals);\n const newStart = now + Duration.toMillis(duration);\n const delta = newStart - oldStart;\n const newEnd = Math.max(0, Intervals.end(intervals) + delta);\n const newInterval = Interval.make(newStart, newEnd);\n return [state, out, ScheduleDecision.continueWith(newInterval)];\n });\n})));\n/** @internal */\nexport const onDecision = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => core.as(f(out, decision), [state, out, decision]))));\n/** @internal */\nexport const passthrough = self => makeWithState(self.initial, (now, input, state) => pipe(self.step(now, input, state), core.map(([state, _, decision]) => [state, input, decision])));\n/** @internal */\nexport const provideContext = /*#__PURE__*/dual(2, (self, context) => makeWithState(self.initial, (now, input, state) => core.provideContext(self.step(now, input, state), context)));\n/** @internal */\nexport const provideService = /*#__PURE__*/dual(3, (self, tag, service) => makeWithState(self.initial, (now, input, state) => core.contextWithEffect(env => core.provideContext(\n// @ts-expect-error\nself.step(now, input, state), Context.add(env, tag, service)))));\n/** @internal */\nexport const recurUntil = f => untilInput(identity(), f);\n/** @internal */\nexport const recurUntilEffect = f => untilInputEffect(identity(), f);\n/** @internal */\nexport const recurUntilOption = pf => untilOutput(map(identity(), pf), Option.isSome);\n/** @internal */\nexport const recurUpTo = durationInput => {\n const duration = Duration.decode(durationInput);\n return whileOutput(elapsed, elapsed => Duration.lessThan(elapsed, duration));\n};\n/** @internal */\nexport const recurWhile = f => whileInput(identity(), f);\n/** @internal */\nexport const recurWhileEffect = f => whileInputEffect(identity(), f);\n/** @internal */\nexport const recurs = n => whileOutput(forever, out => out < n);\n/** @internal */\nexport const reduce = /*#__PURE__*/dual(3, (self, zero, f) => reduceEffect(self, zero, (z, out) => core.sync(() => f(z, out))));\n/** @internal */\nexport const reduceEffect = /*#__PURE__*/dual(3, (self, zero, f) => makeWithState([self.initial, zero], (now, input, [s, z]) => core.flatMap(self.step(now, input, s), ([s, out, decision]) => ScheduleDecision.isDone(decision) ? core.succeed([[s, z], z, decision]) : core.map(f(z, out), z2 => [[s, z2], z, decision]))));\n/** @internal */\nexport const repeatForever = self => makeWithState(self.initial, (now, input, state) => {\n const step = (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => ScheduleDecision.isDone(decision) ? step(now, input, self.initial) : core.succeed([state, out, decision]));\n return step(now, input, state);\n});\n/** @internal */\nexport const repetitions = self => reduce(self, 0, (n, _) => n + 1);\n/** @internal */\nexport const resetAfter = /*#__PURE__*/dual(2, (self, durationInput) => {\n const duration = Duration.decode(durationInput);\n return pipe(self, intersect(elapsed), resetWhen(([, time]) => Duration.greaterThanOrEqualTo(time, duration)), map(out => out[0]));\n});\n/** @internal */\nexport const resetWhen = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.flatMap(self.step(now, input, state), ([state, out, decision]) => f(out) ? self.step(now, input, self.initial) : core.succeed([state, out, decision]))));\n/** @internal */\nexport const run = /*#__PURE__*/dual(3, (self, now, input) => pipe(runLoop(self, now, Chunk.fromIterable(input), self.initial, Chunk.empty()), core.map(list => Chunk.reverse(list))));\n/** @internal */\nconst runLoop = (self, now, inputs, state, acc) => {\n if (!Chunk.isNonEmpty(inputs)) {\n return core.succeed(acc);\n }\n const input = Chunk.headNonEmpty(inputs);\n const nextInputs = Chunk.tailNonEmpty(inputs);\n return core.flatMap(self.step(now, input, state), ([state, out, decision]) => {\n if (ScheduleDecision.isDone(decision)) {\n return core.sync(() => pipe(acc, Chunk.prepend(out)));\n }\n return runLoop(self, Intervals.start(decision.intervals), nextInputs, state, Chunk.prepend(acc, out));\n });\n};\n/** @internal */\nexport const secondOfMinute = second => makeWithState([Number.NEGATIVE_INFINITY, 0], (now, _, state) => {\n if (!Number.isInteger(second) || second < 0 || 59 < second) {\n return core.dieSync(() => new core.IllegalArgumentException(`Invalid argument in: secondOfMinute(${second}). Must be in range 0...59`));\n }\n const n = state[1];\n const initial = n === 0;\n const second0 = nextSecond(now, second, initial);\n const start = beginningOfSecond(second0);\n const end = endOfSecond(second0);\n const interval = Interval.make(start, end);\n return core.succeed([[end, n + 1], n, ScheduleDecision.continueWith(interval)]);\n});\n/** @internal */\nexport const spaced = duration => addDelay(forever, () => duration);\n/** @internal */\nexport const succeed = value => map(forever, () => value);\n/** @internal */\nexport const sync = evaluate => map(forever, evaluate);\n/** @internal */\nexport const tapInput = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.zipRight(f(input), self.step(now, input, state))));\n/** @internal */\nexport const tapOutput = /*#__PURE__*/dual(2, (self, f) => makeWithState(self.initial, (now, input, state) => core.tap(self.step(now, input, state), ([, out]) => f(out))));\n/** @internal */\nexport const unfold = (initial, f) => makeWithState(initial, (now, _, state) => core.sync(() => [f(state), state, ScheduleDecision.continueWith(Interval.after(now))]));\n/** @internal */\nexport const union = /*#__PURE__*/dual(2, (self, that) => unionWith(self, that, Intervals.union));\n/** @internal */\nexport const unionWith = /*#__PURE__*/dual(3, (self, that, f) => makeWithState([self.initial, that.initial], (now, input, state) => core.zipWith(self.step(now, input, state[0]), that.step(now, input, state[1]), ([lState, l, lDecision], [rState, r, rDecision]) => {\n if (ScheduleDecision.isDone(lDecision) && ScheduleDecision.isDone(rDecision)) {\n return [[lState, rState], [l, r], ScheduleDecision.done];\n }\n if (ScheduleDecision.isDone(lDecision) && ScheduleDecision.isContinue(rDecision)) {\n return [[lState, rState], [l, r], ScheduleDecision.continue(rDecision.intervals)];\n }\n if (ScheduleDecision.isContinue(lDecision) && ScheduleDecision.isDone(rDecision)) {\n return [[lState, rState], [l, r], ScheduleDecision.continue(lDecision.intervals)];\n }\n if (ScheduleDecision.isContinue(lDecision) && ScheduleDecision.isContinue(rDecision)) {\n const combined = f(lDecision.intervals, rDecision.intervals);\n return [[lState, rState], [l, r], ScheduleDecision.continue(combined)];\n }\n throw new Error(\"BUG: Schedule.unionWith - please report an issue at https://github.com/Effect-TS/effect/issues\");\n})));\n/** @internal */\nexport const untilInput = /*#__PURE__*/dual(2, (self, f) => check(self, (input, _) => !f(input)));\n/** @internal */\nexport const untilInputEffect = /*#__PURE__*/dual(2, (self, f) => checkEffect(self, (input, _) => effect.negate(f(input))));\n/** @internal */\nexport const untilOutput = /*#__PURE__*/dual(2, (self, f) => check(self, (_, out) => !f(out)));\n/** @internal */\nexport const untilOutputEffect = /*#__PURE__*/dual(2, (self, f) => checkEffect(self, (_, out) => effect.negate(f(out))));\n/** @internal */\nexport const upTo = /*#__PURE__*/dual(2, (self, duration) => zipLeft(self, recurUpTo(duration)));\n/** @internal */\nexport const whileInput = /*#__PURE__*/dual(2, (self, f) => check(self, (input, _) => f(input)));\n/** @internal */\nexport const whileInputEffect = /*#__PURE__*/dual(2, (self, f) => checkEffect(self, (input, _) => f(input)));\n/** @internal */\nexport const whileOutput = /*#__PURE__*/dual(2, (self, f) => check(self, (_, out) => f(out)));\n/** @internal */\nexport const whileOutputEffect = /*#__PURE__*/dual(2, (self, f) => checkEffect(self, (_, out) => f(out)));\n/** @internal */\nexport const windowed = intervalInput => {\n const interval = Duration.decode(intervalInput);\n const millis = Duration.toMillis(interval);\n return makeWithState([Option.none(), 0], (now, _, [option, n]) => {\n switch (option._tag) {\n case \"None\":\n {\n return core.succeed([[Option.some(now), n + 1], n, ScheduleDecision.continueWith(Interval.after(now + millis))]);\n }\n case \"Some\":\n {\n return core.succeed([[Option.some(option.value), n + 1], n, ScheduleDecision.continueWith(Interval.after(now + (millis - (now - option.value) % millis)))]);\n }\n }\n });\n};\n/** @internal */\nexport const zipLeft = /*#__PURE__*/dual(2, (self, that) => map(intersect(self, that), out => out[0]));\n/** @internal */\nexport const zipRight = /*#__PURE__*/dual(2, (self, that) => map(intersect(self, that), out => out[1]));\n/** @internal */\nexport const zipWith = /*#__PURE__*/dual(3, (self, that, f) => map(intersect(self, that), ([out, out2]) => f(out, out2)));\n// -----------------------------------------------------------------------------\n// Seconds\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const beginningOfSecond = now => {\n const date = new Date(now);\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), 0).getTime();\n};\n/** @internal */\nexport const endOfSecond = now => {\n const date = new Date(beginningOfSecond(now));\n return date.setSeconds(date.getSeconds() + 1);\n};\n/** @internal */\nexport const nextSecond = (now, second, initial) => {\n const date = new Date(now);\n if (date.getSeconds() === second && initial) {\n return now;\n }\n if (date.getSeconds() < second) {\n return date.setSeconds(second);\n }\n // Set seconds to the provided value and add one minute\n const newDate = new Date(date.setSeconds(second));\n return newDate.setTime(newDate.getTime() + 1000 * 60);\n};\n// -----------------------------------------------------------------------------\n// Minutes\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const beginningOfMinute = now => {\n const date = new Date(now);\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), 0, 0).getTime();\n};\n/** @internal */\nexport const endOfMinute = now => {\n const date = new Date(beginningOfMinute(now));\n return date.setMinutes(date.getMinutes() + 1);\n};\n/** @internal */\nexport const nextMinute = (now, minute, initial) => {\n const date = new Date(now);\n if (date.getMinutes() === minute && initial) {\n return now;\n }\n if (date.getMinutes() < minute) {\n return date.setMinutes(minute);\n }\n // Set minutes to the provided value and add one hour\n const newDate = new Date(date.setMinutes(minute));\n return newDate.setTime(newDate.getTime() + 1000 * 60 * 60);\n};\n// -----------------------------------------------------------------------------\n// Hours\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const beginningOfHour = now => {\n const date = new Date(now);\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), 0, 0, 0).getTime();\n};\n/** @internal */\nexport const endOfHour = now => {\n const date = new Date(beginningOfHour(now));\n return date.setHours(date.getHours() + 1);\n};\n/** @internal */\nexport const nextHour = (now, hour, initial) => {\n const date = new Date(now);\n if (date.getHours() === hour && initial) {\n return now;\n }\n if (date.getHours() < hour) {\n return date.setHours(hour);\n }\n // Set hours to the provided value and add one day\n const newDate = new Date(date.setHours(hour));\n return newDate.setTime(newDate.getTime() + 1000 * 60 * 60 * 24);\n};\n// -----------------------------------------------------------------------------\n// Days\n// -----------------------------------------------------------------------------\n/** @internal */\nexport const beginningOfDay = now => {\n const date = new Date(now);\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0, 0).getTime();\n};\n/** @internal */\nexport const endOfDay = now => {\n const date = new Date(beginningOfDay(now));\n return date.setDate(date.getDate() + 1);\n};\n/** @internal */\nexport const nextDay = (now, dayOfWeek, initial) => {\n const date = new Date(now);\n if (date.getDay() === dayOfWeek && initial) {\n return now;\n }\n const nextDayOfWeek = (7 + dayOfWeek - date.getDay()) % 7;\n return date.setDate(date.getDate() + (nextDayOfWeek === 0 ? 7 : nextDayOfWeek));\n};\n/** @internal */\nexport const nextDayOfMonth = (now, day, initial) => {\n const date = new Date(now);\n if (date.getDate() === day && initial) {\n return now;\n }\n if (date.getDate() < day) {\n return date.setDate(day);\n }\n return findNextMonth(now, day, 1);\n};\n/** @internal */\nexport const findNextMonth = (now, day, months) => {\n const d = new Date(now);\n const tmp1 = new Date(d.setDate(day));\n const tmp2 = new Date(tmp1.setMonth(tmp1.getMonth() + months));\n if (tmp2.getDate() === day) {\n const d2 = new Date(now);\n const tmp3 = new Date(d2.setDate(day));\n return tmp3.setMonth(tmp3.getMonth() + months);\n }\n return findNextMonth(now, day, months + 1);\n};\n// circular with Effect\nconst ScheduleDefectTypeId = /*#__PURE__*/Symbol.for(\"effect/Schedule/ScheduleDefect\");\nclass ScheduleDefect {\n error;\n [ScheduleDefectTypeId];\n constructor(error) {\n this.error = error;\n this[ScheduleDefectTypeId] = ScheduleDefectTypeId;\n }\n}\nconst isScheduleDefect = u => hasProperty(u, ScheduleDefectTypeId);\nconst scheduleDefectWrap = self => core.catchAll(self, e => core.die(new ScheduleDefect(e)));\n/** @internal */\nexport const scheduleDefectRefailCause = cause => Option.match(internalCause.find(cause, _ => internalCause.isDieType(_) && isScheduleDefect(_.defect) ? Option.some(_.defect) : Option.none()), {\n onNone: () => cause,\n onSome: error => internalCause.fail(error.error)\n});\n/** @internal */\nexport const scheduleDefectRefail = effect => core.catchAllCause(effect, cause => core.failCause(scheduleDefectRefailCause(cause)));\n/** @internal */\nexport const repeat_Effect = /*#__PURE__*/dual(2, (self, schedule) => repeatOrElse_Effect(self, schedule, (e, _) => core.fail(e)));\n/** @internal */\nexport const repeat_combined = /*#__PURE__*/dual(2, (self, options) => {\n if (isSchedule(options)) {\n return repeat_Effect(self, options);\n }\n const base = options.schedule ?? passthrough(forever);\n const withWhile = options.while ? whileInputEffect(base, a => {\n const applied = options.while(a);\n if (typeof applied === \"boolean\") {\n return core.succeed(applied);\n }\n return scheduleDefectWrap(applied);\n }) : base;\n const withUntil = options.until ? untilInputEffect(withWhile, a => {\n const applied = options.until(a);\n if (typeof applied === \"boolean\") {\n return core.succeed(applied);\n }\n return scheduleDefectWrap(applied);\n }) : withWhile;\n const withTimes = options.times ? intersect(withUntil, recurs(options.times)).pipe(map(intersectionPair => intersectionPair[0])) : withUntil;\n return scheduleDefectRefail(repeat_Effect(self, withTimes));\n});\n/** @internal */\nexport const repeatOrElse_Effect = /*#__PURE__*/dual(3, (self, schedule, orElse) => core.flatMap(driver(schedule), driver => core.matchEffect(self, {\n onFailure: error => orElse(error, Option.none()),\n onSuccess: value => repeatOrElseEffectLoop(effect.provideServiceEffect(self, CurrentIterationMetadata, ref.get(driver.iterationMeta)), driver, (error, option) => effect.provideServiceEffect(orElse(error, option), CurrentIterationMetadata, ref.get(driver.iterationMeta)), value)\n})));\n/** @internal */\nconst repeatOrElseEffectLoop = (self, driver, orElse, value) => core.matchEffect(driver.next(value), {\n onFailure: () => core.orDie(driver.last),\n onSuccess: b => core.matchEffect(self, {\n onFailure: error => orElse(error, Option.some(b)),\n onSuccess: value => repeatOrElseEffectLoop(self, driver, orElse, value)\n })\n});\n/** @internal */\nexport const retry_Effect = /*#__PURE__*/dual(2, (self, policy) => retryOrElse_Effect(self, policy, (e, _) => core.fail(e)));\n/** @internal */\nexport const retry_combined = /*#__PURE__*/dual(2, (self, options) => {\n if (isSchedule(options)) {\n return retry_Effect(self, options);\n }\n return scheduleDefectRefail(retry_Effect(self, fromRetryOptions(options)));\n});\n/** @internal */\nexport const fromRetryOptions = options => {\n const base = options.schedule ?? forever;\n const withWhile = options.while ? whileInputEffect(base, e => {\n const applied = options.while(e);\n if (typeof applied === \"boolean\") {\n return core.succeed(applied);\n }\n return scheduleDefectWrap(applied);\n }) : base;\n const withUntil = options.until ? untilInputEffect(withWhile, e => {\n const applied = options.until(e);\n if (typeof applied === \"boolean\") {\n return core.succeed(applied);\n }\n return scheduleDefectWrap(applied);\n }) : withWhile;\n return options.times !== undefined ? intersect(withUntil, recurs(options.times)) : withUntil;\n};\n/** @internal */\nexport const retryOrElse_Effect = /*#__PURE__*/dual(3, (self, policy, orElse) => core.flatMap(driver(policy), driver => retryOrElse_EffectLoop(effect.provideServiceEffect(self, CurrentIterationMetadata, ref.get(driver.iterationMeta)), driver, (e, out) => effect.provideServiceEffect(orElse(e, out), CurrentIterationMetadata, ref.get(driver.iterationMeta)))));\n/** @internal */\nconst retryOrElse_EffectLoop = (self, driver, orElse) => {\n return core.catchAll(self, e => core.matchEffect(driver.next(e), {\n onFailure: () => pipe(driver.last, core.orDie, core.flatMap(out => orElse(e, out))),\n onSuccess: () => retryOrElse_EffectLoop(self, driver, orElse)\n }));\n};\n/** @internal */\nexport const schedule_Effect = /*#__PURE__*/dual(2, (self, schedule) => scheduleFrom_Effect(self, void 0, schedule));\n/** @internal */\nexport const scheduleFrom_Effect = /*#__PURE__*/dual(3, (self, initial, schedule) => core.flatMap(driver(schedule), driver => scheduleFrom_EffectLoop(effect.provideServiceEffect(self, CurrentIterationMetadata, ref.get(driver.iterationMeta)), initial, driver)));\n/** @internal */\nconst scheduleFrom_EffectLoop = (self, initial, driver) => core.matchEffect(driver.next(initial), {\n onFailure: () => core.orDie(driver.last),\n onSuccess: () => core.flatMap(self, a => scheduleFrom_EffectLoop(self, a, driver))\n});\n/** @internal */\nexport const count = /*#__PURE__*/unfold(0, n => n + 1);\n/** @internal */\nexport const elapsed = /*#__PURE__*/makeWithState(/*#__PURE__*/Option.none(), (now, _, state) => {\n switch (state._tag) {\n case \"None\":\n {\n return core.succeed([Option.some(now), Duration.zero, ScheduleDecision.continueWith(Interval.after(now))]);\n }\n case \"Some\":\n {\n return core.succeed([Option.some(state.value), Duration.millis(now - state.value), ScheduleDecision.continueWith(Interval.after(now))]);\n }\n }\n});\n/** @internal */\nexport const forever = /*#__PURE__*/unfold(0, n => n + 1);\n/** @internal */\nexport const once = /*#__PURE__*/asVoid(/*#__PURE__*/recurs(1));\n/** @internal */\nexport const stop = /*#__PURE__*/asVoid(/*#__PURE__*/recurs(0));\n/** @internal */\nexport const scheduleForked = /*#__PURE__*/dual(2, (self, schedule) => forkScoped(schedule_Effect(self, schedule)));\n//# sourceMappingURL=schedule.js.map","import { dual } from \"./Function.js\";\nimport * as internalCause from \"./internal/cause.js\";\nimport * as console_ from \"./internal/console.js\";\nimport { TagProto } from \"./internal/context.js\";\nimport * as effect from \"./internal/core-effect.js\";\nimport * as core from \"./internal/core.js\";\nimport * as defaultServices from \"./internal/defaultServices.js\";\nimport * as circular from \"./internal/effect/circular.js\";\nimport * as internalExecutionPlan from \"./internal/executionPlan.js\";\nimport * as fiberRuntime from \"./internal/fiberRuntime.js\";\nimport * as layer from \"./internal/layer.js\";\nimport * as option_ from \"./internal/option.js\";\nimport * as query from \"./internal/query.js\";\nimport * as runtime_ from \"./internal/runtime.js\";\nimport * as schedule_ from \"./internal/schedule.js\";\nimport * as internalTracer from \"./internal/tracer.js\";\nimport * as Random from \"./Random.js\";\nimport * as Request from \"./Request.js\";\nimport * as Scheduler from \"./Scheduler.js\";\nimport { isGeneratorFunction } from \"./Utils.js\";\n/**\n * @since 2.0.0\n * @category Symbols\n */\nexport const EffectTypeId = core.EffectTypeId;\n/**\n * Checks if a given value is an `Effect` value.\n *\n * **When to Use**\n *\n * This function can be useful for checking the type of a value before\n * attempting to operate on it as an `Effect` value. For example, you could use\n * `Effect.isEffect` to check the type of a value before using it as an argument\n * to a function that expects an `Effect` value.\n *\n * @since 2.0.0\n * @category Guards\n */\nexport const isEffect = core.isEffect;\n/**\n * Returns an effect that caches its result for a specified `Duration`,\n * known as \"timeToLive\" (TTL).\n *\n * **Details**\n *\n * This function is used to cache the result of an effect for a specified amount\n * of time. This means that the first time the effect is evaluated, its result\n * is computed and stored.\n *\n * If the effect is evaluated again within the specified `timeToLive`, the\n * cached result will be used, avoiding recomputation.\n *\n * After the specified duration has passed, the cache expires, and the effect\n * will be recomputed upon the next evaluation.\n *\n * **When to Use**\n *\n * Use this function when you have an effect that involves costly operations or\n * computations, and you want to avoid repeating them within a short time frame.\n *\n * It's ideal for scenarios where the result of an effect doesn't change\n * frequently and can be reused for a specified duration.\n *\n * By caching the result, you can improve efficiency and reduce unnecessary\n * computations, especially in performance-critical applications.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * let i = 1\n * const expensiveTask = Effect.promise<string>(() => {\n * console.log(\"expensive task...\")\n * return new Promise((resolve) => {\n * setTimeout(() => {\n * resolve(`result ${i++}`)\n * }, 100)\n * })\n * })\n *\n * const program = Effect.gen(function* () {\n * const cached = yield* Effect.cachedWithTTL(expensiveTask, \"150 millis\")\n * yield* cached.pipe(Effect.andThen(Console.log))\n * yield* cached.pipe(Effect.andThen(Console.log))\n * yield* Effect.sleep(\"100 millis\")\n * yield* cached.pipe(Effect.andThen(Console.log))\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // expensive task...\n * // result 1\n * // result 1\n * // expensive task...\n * // result 2\n * ```\n *\n * @see {@link cached} for a similar function that caches the result\n * indefinitely.\n * @see {@link cachedInvalidateWithTTL} for a similar function that includes an\n * additional effect for manually invalidating the cached value.\n *\n * @since 2.0.0\n * @category Caching\n */\nexport const cachedWithTTL = circular.cached;\n/**\n * Caches an effect's result for a specified duration and allows manual\n * invalidation before expiration.\n *\n * **Details**\n *\n * This function behaves similarly to {@link cachedWithTTL} by caching the\n * result of an effect for a specified period of time. However, it introduces an\n * additional feature: it provides an effect that allows you to manually\n * invalidate the cached result before it naturally expires.\n *\n * This gives you more control over the cache, allowing you to refresh the\n * result when needed, even if the original cache has not yet expired.\n *\n * Once the cache is invalidated, the next time the effect is evaluated, the\n * result will be recomputed, and the cache will be refreshed.\n *\n * **When to Use**\n *\n * Use this function when you have an effect whose result needs to be cached for\n * a certain period, but you also want the option to refresh the cache manually\n * before the expiration time.\n *\n * This is useful when you need to ensure that the cached data remains valid for\n * a certain period but still want to invalidate it if the underlying data\n * changes or if you want to force a recomputation.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * let i = 1\n * const expensiveTask = Effect.promise<string>(() => {\n * console.log(\"expensive task...\")\n * return new Promise((resolve) => {\n * setTimeout(() => {\n * resolve(`result ${i++}`)\n * }, 100)\n * })\n * })\n *\n * const program = Effect.gen(function* () {\n * const [cached, invalidate] = yield* Effect.cachedInvalidateWithTTL(\n * expensiveTask,\n * \"1 hour\"\n * )\n * yield* cached.pipe(Effect.andThen(Console.log))\n * yield* cached.pipe(Effect.andThen(Console.log))\n * yield* invalidate\n * yield* cached.pipe(Effect.andThen(Console.log))\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // expensive task...\n * // result 1\n * // result 1\n * // expensive task...\n * // result 2\n * ```\n *\n * @see {@link cached} for a similar function that caches the result\n * indefinitely.\n * @see {@link cachedWithTTL} for a similar function that caches the result for\n * a specified duration but does not include an effect for manual invalidation.\n *\n * @since 2.0.0\n * @category Caching\n */\nexport const cachedInvalidateWithTTL = circular.cachedInvalidateWithTTL;\n/**\n * Returns an effect that lazily computes a result and caches it for subsequent\n * evaluations.\n *\n * **Details**\n *\n * This function wraps an effect and ensures that its result is computed only\n * once. Once the result is computed, it is cached, meaning that subsequent\n * evaluations of the same effect will return the cached result without\n * re-executing the logic.\n *\n * **When to Use**\n *\n * Use this function when you have an expensive or time-consuming operation that\n * you want to avoid repeating. The first evaluation will compute the result,\n * and all following evaluations will immediately return the cached value,\n * improving performance and reducing unnecessary work.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * let i = 1\n * const expensiveTask = Effect.promise<string>(() => {\n * console.log(\"expensive task...\")\n * return new Promise((resolve) => {\n * setTimeout(() => {\n * resolve(`result ${i++}`)\n * }, 100)\n * })\n * })\n *\n * const program = Effect.gen(function* () {\n * console.log(\"non-cached version:\")\n * yield* expensiveTask.pipe(Effect.andThen(Console.log))\n * yield* expensiveTask.pipe(Effect.andThen(Console.log))\n * console.log(\"cached version:\")\n * const cached = yield* Effect.cached(expensiveTask)\n * yield* cached.pipe(Effect.andThen(Console.log))\n * yield* cached.pipe(Effect.andThen(Console.log))\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // non-cached version:\n * // expensive task...\n * // result 1\n * // expensive task...\n * // result 2\n * // cached version:\n * // expensive task...\n * // result 3\n * // result 3\n * ```\n *\n * @see {@link cachedWithTTL} for a similar function that includes a\n * time-to-live duration for the cached value.\n * @see {@link cachedInvalidateWithTTL} for a similar function that includes an\n * additional effect for manually invalidating the cached value.\n *\n * @since 2.0.0\n * @category Caching\n */\nexport const cached = effect.memoize;\n/**\n * Returns a memoized version of a function with effects, reusing results for\n * the same inputs.\n *\n * **Details**\n *\n * This function creates a memoized version of a given function that performs an\n * effect. Memoization ensures that once a result is computed for a specific\n * input, it is stored and reused for subsequent calls with the same input,\n * reducing the need to recompute the result.\n *\n * The function can optionally take an `Equivalence` parameter to\n * determine how inputs are compared for caching purposes.\n *\n * **When to Use**\n *\n * Use this function when you have a function that performs an effect and you\n * want to avoid recomputing the result for the same input multiple times.\n *\n * It's ideal for functions that produce deterministic results based on their\n * inputs, and you want to improve performance by caching the output.\n *\n * This is particularly useful in scenarios where the function involves\n * expensive calculations or operations that should be avoided after the first\n * execution with the same parameters.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * const program = Effect.gen(function* () {\n * const randomNumber = (n: number) => Random.nextIntBetween(1, n)\n * console.log(\"non-memoized version:\")\n * console.log(yield* randomNumber(10))\n * console.log(yield* randomNumber(10))\n *\n * console.log(\"memoized version:\")\n * const memoized = yield* Effect.cachedFunction(randomNumber)\n * console.log(yield* memoized(10))\n * console.log(yield* memoized(10))\n * })\n *\n * Effect.runFork(program)\n * // Example Output:\n * // non-memoized version:\n * // 2\n * // 8\n * // memoized version:\n * // 5\n * // 5\n * ```\n *\n * @since 2.0.0\n * @category Caching\n */\nexport const cachedFunction = circular.cachedFunction;\n/**\n * Returns an effect that executes only once, regardless of how many times it's\n * called.\n *\n * **Details**\n *\n * This function ensures that a specific effect is executed only a single time,\n * no matter how many times it is invoked. The result of the effect will be\n * cached, and subsequent calls to the effect will immediately return the cached\n * result without re-executing the original logic.\n *\n * **When to Use**\n *\n * Use this function when you need to perform a task only once, regardless of\n * how many times the effect is triggered. It's particularly useful when you\n * have initialization tasks, logging, or other one-time actions that should not\n * be repeated. This can help optimize performance and avoid redundant actions.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const program = Effect.gen(function* () {\n * const task1 = Console.log(\"task1\")\n * yield* Effect.repeatN(task1, 2)\n * const task2 = yield* Effect.once(Console.log(\"task2\"))\n * yield* Effect.repeatN(task2, 2)\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // task1\n * // task1\n * // task1\n * // task2\n * ```\n *\n * @since 2.0.0\n * @category Caching\n */\nexport const once = effect.once;\n/**\n * Combines multiple effects into one, returning results based on the input\n * structure.\n *\n * **Details**\n *\n * Use this function when you need to run multiple effects and combine their\n * results into a single output. It supports tuples, iterables, structs, and\n * records, making it flexible for different input types.\n *\n * For instance, if the input is a tuple:\n *\n * ```ts skip-type-checking\n * // ┌─── a tuple of effects\n * // ▼\n * Effect.all([effect1, effect2, ...])\n * ```\n *\n * the effects are executed sequentially, and the result is a new effect\n * containing the results as a tuple. The results in the tuple match the order\n * of the effects passed to `Effect.all`.\n *\n * **Concurrency**\n *\n * You can control the execution order (e.g., sequential vs. concurrent) using\n * the `concurrency` option.\n *\n * **Short-Circuiting Behavior**\n *\n * This function stops execution on the first error it encounters, this is\n * called \"short-circuiting\". If any effect in the collection fails, the\n * remaining effects will not run, and the error will be propagated. To change\n * this behavior, you can use the `mode` option, which allows all effects to run\n * and collect results as `Either` or `Option`.\n *\n * **The `mode` option**\n *\n * The `{ mode: \"either\" }` option changes the behavior of `Effect.all` to\n * ensure all effects run, even if some fail. Instead of stopping on the first\n * failure, this mode collects both successes and failures, returning an array\n * of `Either` instances where each result is either a `Right` (success) or a\n * `Left` (failure).\n *\n * Similarly, the `{ mode: \"validate\" }` option uses `Option` to indicate\n * success or failure. Each effect returns `None` for success and `Some` with\n * the error for failure.\n *\n * **Example** (Combining Effects in Tuples)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const tupleOfEffects = [\n * Effect.succeed(42).pipe(Effect.tap(Console.log)),\n * Effect.succeed(\"Hello\").pipe(Effect.tap(Console.log))\n * ] as const\n *\n * // ┌─── Effect<[number, string], never, never>\n * // ▼\n * const resultsAsTuple = Effect.all(tupleOfEffects)\n *\n * Effect.runPromise(resultsAsTuple).then(console.log)\n * // Output:\n * // 42\n * // Hello\n * // [ 42, 'Hello' ]\n * ```\n *\n * **Example** (Combining Effects in Iterables)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const iterableOfEffects: Iterable<Effect.Effect<number>> = [1, 2, 3].map(\n * (n) => Effect.succeed(n).pipe(Effect.tap(Console.log))\n * )\n *\n * // ┌─── Effect<number[], never, never>\n * // ▼\n * const resultsAsArray = Effect.all(iterableOfEffects)\n *\n * Effect.runPromise(resultsAsArray).then(console.log)\n * // Output:\n * // 1\n * // 2\n * // 3\n * // [ 1, 2, 3 ]\n * ```\n *\n * **Example** (Combining Effects in Structs)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const structOfEffects = {\n * a: Effect.succeed(42).pipe(Effect.tap(Console.log)),\n * b: Effect.succeed(\"Hello\").pipe(Effect.tap(Console.log))\n * }\n *\n * // ┌─── Effect<{ a: number; b: string; }, never, never>\n * // ▼\n * const resultsAsStruct = Effect.all(structOfEffects)\n *\n * Effect.runPromise(resultsAsStruct).then(console.log)\n * // Output:\n * // 42\n * // Hello\n * // { a: 42, b: 'Hello' }\n * ```\n *\n * **Example** (Combining Effects in Records)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const recordOfEffects: Record<string, Effect.Effect<number>> = {\n * key1: Effect.succeed(1).pipe(Effect.tap(Console.log)),\n * key2: Effect.succeed(2).pipe(Effect.tap(Console.log))\n * }\n *\n * // ┌─── Effect<{ [x: string]: number; }, never, never>\n * // ▼\n * const resultsAsRecord = Effect.all(recordOfEffects)\n *\n * Effect.runPromise(resultsAsRecord).then(console.log)\n * // Output:\n * // 1\n * // 2\n * // { key1: 1, key2: 2 }\n * ```\n *\n * **Example** (Short-Circuiting Behavior)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const program = Effect.all([\n * Effect.succeed(\"Task1\").pipe(Effect.tap(Console.log)),\n * Effect.fail(\"Task2: Oh no!\").pipe(Effect.tap(Console.log)),\n * // Won't execute due to earlier failure\n * Effect.succeed(\"Task3\").pipe(Effect.tap(Console.log))\n * ])\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // Task1\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'Task2: Oh no!' }\n * // }\n * ```\n *\n * **Example** (Collecting Results with `mode: \"either\"`)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const effects = [\n * Effect.succeed(\"Task1\").pipe(Effect.tap(Console.log)),\n * Effect.fail(\"Task2: Oh no!\").pipe(Effect.tap(Console.log)),\n * Effect.succeed(\"Task3\").pipe(Effect.tap(Console.log))\n * ]\n *\n * const program = Effect.all(effects, { mode: \"either\" })\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // Task1\n * // Task3\n * // {\n * // _id: 'Exit',\n * // _tag: 'Success',\n * // value: [\n * // { _id: 'Either', _tag: 'Right', right: 'Task1' },\n * // { _id: 'Either', _tag: 'Left', left: 'Task2: Oh no!' },\n * // { _id: 'Either', _tag: 'Right', right: 'Task3' }\n * // ]\n * // }\n * ```\n *\n * **Example** (Collecting Results with `mode: \"validate\"`)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const effects = [\n * Effect.succeed(\"Task1\").pipe(Effect.tap(Console.log)),\n * Effect.fail(\"Task2: Oh no!\").pipe(Effect.tap(Console.log)),\n * Effect.succeed(\"Task3\").pipe(Effect.tap(Console.log))\n * ]\n *\n * const program = Effect.all(effects, { mode: \"validate\" })\n *\n * Effect.runPromiseExit(program).then((result) => console.log(\"%o\", result))\n * // Output:\n * // Task1\n * // Task3\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Fail',\n * // failure: [\n * // { _id: 'Option', _tag: 'None' },\n * // { _id: 'Option', _tag: 'Some', value: 'Task2: Oh no!' },\n * // { _id: 'Option', _tag: 'None' }\n * // ]\n * // }\n * // }\n * ```\n *\n * @see {@link forEach} for iterating over elements and applying an effect.\n * @see {@link allWith} for a data-last version of this function.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const all = fiberRuntime.all;\n/**\n * A data-last version of {@link all}, designed for use in pipelines.\n *\n * **When to Use**\n *\n * This function enables you to combine multiple effects and customize execution\n * options such as concurrency levels. This version is useful in functional\n * pipelines where you first define your data and then apply operations to it.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, pipe } from \"effect\"\n *\n * const task1 = Effect.succeed(1).pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Effect.log(\"task1 done\"))\n * )\n *\n * const task2 = Effect.succeed(\"hello\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Effect.log(\"task2 done\"))\n * )\n *\n * const program = pipe(\n * [task1, task2],\n * // Run both effects concurrently using the concurrent option\n * Effect.allWith({ concurrency: 2 })\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#3 message=\"task2 done\"\n * // timestamp=... level=INFO fiber=#2 message=\"task1 done\"\n * // [ 1, 'hello' ]\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const allWith = fiberRuntime.allWith;\n/**\n * Evaluates and runs each effect in the iterable, collecting only the\n * successful results while discarding failures.\n *\n * **Details**\n *\n * This function function processes an iterable of effects and runs each one. If\n * an effect is successful, its result is collected; if it fails, the result is\n * discarded. This ensures that only successful outcomes are kept.\n *\n * **Options**\n *\n * The function also allows you to customize how the effects are handled by\n * specifying options such as concurrency, batching, and how finalizers behave.\n * These options provide flexibility in running the effects concurrently or\n * adjusting other execution details.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const tasks = [\n * Effect.succeed(1),\n * Effect.fail(\"Error 1\"),\n * Effect.succeed(2),\n * Effect.fail(\"Error 2\")\n * ]\n *\n * const program = Effect.gen(function*() {\n * const successfulResults = yield* Effect.allSuccesses(tasks)\n * console.log(successfulResults)\n * })\n *\n * Effect.runFork(program)\n * // Output: [1, 2]\n *\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const allSuccesses = fiberRuntime.allSuccesses;\n/**\n * Drops elements until the effectful predicate returns `true`.\n *\n * **Details**\n *\n * This function processes a collection of elements and uses an effectful\n * predicate to determine when to stop dropping elements. It drops elements from\n * the beginning of the collection until the predicate returns `true`.\n *\n * The predicate is a function that takes an element and its index in the\n * collection and returns an effect that evaluates to a boolean.\n *\n * Once the predicate returns `true`, the remaining elements of the collection\n * are returned.\n *\n * **Note**: The first element for which the predicate returns `true` is also\n * dropped.\n *\n * **When to Use**\n *\n * This function allows you to conditionally skip over a part of the collection\n * based on some criteria defined in the predicate.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5, 6]\n * const predicate = (n: number, i: number) => Effect.succeed(n > 3)\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.dropUntil(numbers, predicate)\n * console.log(result)\n * })\n *\n * Effect.runFork(program)\n * // Output: [5, 6]\n * ```\n *\n * @see {@link dropWhile} for a similar function that drops elements while the\n * predicate returns `true`.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const dropUntil = effect.dropUntil;\n/**\n * Drops elements as long as the predicate returns `true`.\n *\n * **Details**\n *\n * This function processes a collection of elements and uses a predicate to\n * decide whether to drop an element.\n *\n * The predicate is a function that takes an element and its index, and it\n * returns an effect that evaluates to a boolean.\n *\n * As long as the predicate returns `true`, elements will continue to be dropped\n * from the collection.\n *\n * Once the predicate returns `false`, the remaining elements are kept.\n *\n * **When to Use**\n *\n * This function allows you to discard elements from the start of a collection\n * based on a condition, and only keep the rest when the condition no longer\n * holds.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5, 6]\n * const predicate = (n: number, i: number) => Effect.succeed(n <= 3)\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.dropWhile(numbers, predicate)\n * console.log(result)\n * })\n *\n * Effect.runFork(program)\n * // Output: [4, 5, 6]\n * ```\n *\n * @see {@link dropUntil} for a similar function that drops elements until the\n * predicate returns `true`.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const dropWhile = effect.dropWhile;\n/**\n * Takes elements from a collection until the effectful predicate returns\n * `true`.\n *\n * **Details**\n *\n * This function processes a collection of elements and uses an effectful\n * predicate to decide when to stop taking elements. The elements are taken from\n * the beginning of the collection until the predicate returns `true`.\n *\n * The predicate is a function that takes an element and its index in the\n * collection, and returns an effect that resolves to a boolean.\n *\n * Once the predicate returns `true`, the remaining elements of the collection\n * are discarded, and the function stops taking more elements.\n *\n * **Note**: The first element for which the predicate returns `true` is also\n * included in the result.\n *\n * **When to Use**\n *\n * Use this function when you want to conditionally take elements from a\n * collection based on a dynamic condition. For example, you may want to collect\n * numbers from a list until a certain threshold is reached, or gather items\n * until a specific condition is met.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5, 6]\n * const predicate = (n: number, i: number) => Effect.succeed(n > 3)\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.takeUntil(numbers, predicate)\n * console.log(result)\n * })\n *\n * Effect.runFork(program)\n * // Output: [ 1, 2, 3, 4 ]\n * ```\n *\n * @see {@link takeWhile} for a similar function that takes elements while the\n * predicate returns `true`.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const takeUntil = effect.takeUntil;\n/**\n * Takes elements as long as the predicate returns `true`.\n *\n * **Details**\n *\n * This function processes a collection of elements and uses a predicate to\n * decide whether to take an element.\n *\n * The predicate is a function that takes an element and its index, and it\n * returns an effect that evaluates to a boolean.\n *\n * As long as the predicate returns `true`, elements will continue to be taken\n * from the collection.\n *\n * Once the predicate returns `false`, the remaining elements are discarded.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5, 6]\n * const predicate = (n: number, i: number) => Effect.succeed(n <= 3)\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.takeWhile(numbers, predicate)\n * console.log(result)\n * })\n *\n * Effect.runFork(program)\n * // Output: [1, 2, 3]\n * ```\n *\n * @see {@link takeUntil} for a similar function that takes elements until the predicate returns `true`.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const takeWhile = effect.takeWhile;\n/**\n * Determines whether all elements of the iterable satisfy the effectful\n * predicate.\n *\n * **Details**\n *\n * This function checks whether every element in a given collection (an\n * iterable) satisfies a condition defined by an effectful predicate.\n *\n * The predicate is a function that takes an element and its index, and it\n * returns an effect that evaluates to a boolean.\n *\n * The function will process each element and return `true` if all elements\n * satisfy the predicate; otherwise, it returns `false`.\n *\n * **When to Use**\n *\n * This function is useful when you need to verify that all items in a\n * collection meet certain criteria, even when the evaluation of each item\n * involves effects, such as asynchronous checks or complex computations.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [2, 4, 6, 8]\n * const predicate = (n: number, i: number) => Effect.succeed(n % 2 === 0)\n *\n * const program = Effect.gen(function*() {\n * const allEven = yield* Effect.every(numbers, predicate)\n * console.log(allEven)\n * })\n *\n * Effect.runFork(program)\n * // Output: true\n * ```\n *\n * @see {@link exists} for a similar function that returns a boolean indicating\n * whether **any** element satisfies the predicate.\n *\n * @since 2.0.0\n * @category Condition Checking\n */\nexport const every = effect.every;\n/**\n * Determines whether any element of the iterable satisfies the effectual\n * predicate.\n *\n * **Details**\n *\n * This function checks whether any element in a given collection (an iterable)\n * satisfies a condition defined by an effectful predicate.\n *\n * The predicate is a function that takes an element and its index, and it\n * returns an effect that evaluates to a boolean.\n *\n * The function will process each element, and if any element satisfies the\n * predicate (returns `true`), the function will immediately return `true`.\n *\n * If none of the elements satisfy the condition, it will return `false`.\n *\n * **When to Use**\n *\n * This function allows you to quickly check for a condition in a collection\n * without having to manually iterate over it.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4]\n * const predicate = (n: number, i: number) => Effect.succeed(n > 2)\n *\n * const program = Effect.gen(function*() {\n * const hasLargeNumber = yield* Effect.exists(numbers, predicate)\n * console.log(hasLargeNumber)\n * })\n *\n * Effect.runFork(program)\n * // Output: true\n * ```\n *\n * @see {@link every} for a similar function that checks if **all** elements\n * satisfy the predicate.\n *\n * @since 2.0.0\n * @category Condition Checking\n */\nexport const exists = fiberRuntime.exists;\n/**\n * Filters an iterable using the specified effectful predicate.\n *\n * **Details**\n *\n * This function filters a collection (an iterable) by applying an effectful\n * predicate.\n *\n * The predicate is a function that takes an element and its index, and it\n * returns an effect that evaluates to a boolean.\n *\n * The function processes each element in the collection and keeps only those\n * that satisfy the condition defined by the predicate.\n *\n * **Options**\n *\n * You can also adjust the behavior with options such as concurrency, batching,\n * or whether to negate the condition.\n *\n * **When to Use**\n *\n * This function allows you to selectively keep or remove elements based on a\n * condition that may involve asynchronous or side-effect-causing operations.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5]\n * const predicate = (n: number, i: number) => Effect.succeed(n % 2 === 0)\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.filter(numbers, predicate)\n * console.log(result)\n * })\n *\n * Effect.runFork(program)\n * // Output: [2, 4]\n * ```\n *\n * @since 2.0.0\n * @category Filtering\n */\nexport const filter = fiberRuntime.filter;\n/**\n * Filters and maps elements sequentially in one operation.\n *\n * This function processes each element one by one. It applies a function that\n * returns an `Option` to each element. If the function returns `Some`, the\n * element is kept; if it returns `None`, the element is removed. The operation\n * is done sequentially for each element.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect, Option } from \"effect\"\n *\n * const task = (n: number) =>\n * Effect.succeed(n).pipe(\n * Effect.delay(1000 - (n * 100)),\n * Effect.tap(Console.log(`task${n} done`))\n * )\n *\n * const program = Effect.filterMap(\n * [task(1), task(2), task(3), task(4)],\n * (n) => n % 2 === 0 ? Option.some(n) : Option.none()\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // task1 done\n * // task2 done\n * // task3 done\n * // task4 done\n * // [ 2, 4 ]\n * ```\n *\n * @since 2.0.0\n * @category Filtering\n */\nexport const filterMap = effect.filterMap;\n/**\n * Returns the first element that satisfies the effectful predicate.\n *\n * **Details**\n *\n * This function processes a collection of elements and applies an effectful\n * predicate to each element.\n *\n * The predicate is a function that takes an element and its index in the\n * collection, and it returns an effect that evaluates to a boolean.\n *\n * The function stops as soon as it finds the first element for which the\n * predicate returns `true` and returns that element wrapped in an `Option`.\n *\n * If no element satisfies the predicate, the result will be `None`.\n *\n * **When to Use**\n *\n * This function allows you to efficiently find an element that meets a specific\n * condition, even when the evaluation involves effects like asynchronous\n * operations or side effects.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [1, 2, 3, 4, 5]\n * const predicate = (n: number, i: number) => Effect.succeed(n > 3)\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.findFirst(numbers, predicate)\n * console.log(result)\n * })\n *\n * Effect.runFork(program)\n * // Output: { _id: 'Option', _tag: 'Some', value: 4 }\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const findFirst = effect.findFirst;\n/**\n * Executes an effectful operation for each element in an `Iterable`.\n *\n * **Details**\n *\n * This function applies a provided operation to each element in the iterable,\n * producing a new effect that returns an array of results.\n *\n * If any effect fails, the iteration stops immediately (short-circuiting), and\n * the error is propagated.\n *\n * **Concurrency**\n *\n * The `concurrency` option controls how many operations are performed\n * concurrently. By default, the operations are performed sequentially.\n *\n * **Discarding Results**\n *\n * If the `discard` option is set to `true`, the intermediate results are not\n * collected, and the final result of the operation is `void`.\n *\n * **Example** (Applying Effects to Iterable Elements)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const result = Effect.forEach([1, 2, 3, 4, 5], (n, index) =>\n * Console.log(`Currently at index ${index}`).pipe(Effect.as(n * 2))\n * )\n *\n * Effect.runPromise(result).then(console.log)\n * // Output:\n * // Currently at index 0\n * // Currently at index 1\n * // Currently at index 2\n * // Currently at index 3\n * // Currently at index 4\n * // [ 2, 4, 6, 8, 10 ]\n * ```\n *\n * **Example** (Discarding Results)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // Apply effects but discard the results\n * const result = Effect.forEach(\n * [1, 2, 3, 4, 5],\n * (n, index) =>\n * Console.log(`Currently at index ${index}`).pipe(Effect.as(n * 2)),\n * { discard: true }\n * )\n *\n * Effect.runPromise(result).then(console.log)\n * // Output:\n * // Currently at index 0\n * // Currently at index 1\n * // Currently at index 2\n * // Currently at index 3\n * // Currently at index 4\n * // undefined\n * ```\n *\n * @see {@link all} for combining multiple effects into one.\n *\n * @since 2.0.0\n * @category Looping\n */\nexport const forEach = fiberRuntime.forEach;\n/**\n * Returns the first element of the iterable if the collection is non-empty, or\n * fails with the error `NoSuchElementException` if the collection is empty.\n *\n * **When to Use**\n *\n * This function is useful when you need to retrieve the first item from a\n * collection and want to handle the case where the collection might be empty\n * without causing an unhandled exception.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Simulate an async operation\n * const fetchNumbers = Effect.succeed([1, 2, 3]).pipe(Effect.delay(\"100 millis\"))\n *\n * const program = Effect.gen(function*() {\n * const firstElement = yield* Effect.head(fetchNumbers)\n * console.log(firstElement)\n * })\n *\n * Effect.runFork(program)\n * // Output: 1\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const head = effect.head;\n/**\n * Merges an `Iterable<Effect<A, E, R>>` to a single effect.\n *\n * **Details**\n *\n * This function takes an iterable of effects and combines them into a single\n * effect. It does this by iterating over each effect in the collection and\n * applying a function that accumulates results into a \"zero\" value, which\n * starts with an initial value and is updated with each effect's success.\n *\n * The provided function `f` is called for each element in the iterable,\n * allowing you to specify how to combine the results.\n *\n * **Options**\n *\n * The function also allows you to customize how the effects are handled by\n * specifying options such as concurrency, batching, and how finalizers behave.\n * These options provide flexibility in running the effects concurrently or\n * adjusting other execution details.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const numbers = [Effect.succeed(1), Effect.succeed(2), Effect.succeed(3)]\n * const add = (sum: number, value: number, i: number) => sum + value\n * const zero = 0\n *\n * const program = Effect.gen(function*() {\n * const total = yield* Effect.mergeAll(numbers, zero, add)\n * console.log(total)\n * })\n *\n * Effect.runFork(program)\n * // Output: 6\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const mergeAll = fiberRuntime.mergeAll;\n/**\n * Processes an iterable and applies an effectful function to each element,\n * categorizing the results into successes and failures.\n *\n * **Details**\n *\n * This function processes each element in the provided iterable by applying an\n * effectful function to it. The results are then categorized into two separate\n * lists: one for failures and another for successes. This separation allows you\n * to handle the two categories differently. Failures are collected in a list\n * without interrupting the processing of the remaining elements, so the\n * operation continues even if some elements fail. This is particularly useful\n * when you need to handle both successful and failed results separately,\n * without stopping the entire process on encountering a failure.\n *\n * **When to Use**\n *\n * Use this function when you want to process a collection of items and handle\n * errors or failures without interrupting the processing of other items. It's\n * useful when you need to distinguish between successful and failed results and\n * process them separately, for example, when logging errors while continuing to\n * work with valid data. The function ensures that failures are captured, while\n * successes are processed normally.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<[string[], number[]], never, never>\n * // ▼\n * const program = Effect.partition([0, 1, 2, 3, 4], (n) => {\n * if (n % 2 === 0) {\n * return Effect.succeed(n)\n * } else {\n * return Effect.fail(`${n} is not even`)\n * }\n * })\n *\n * Effect.runPromise(program).then(console.log, console.error)\n * // Output:\n * // [ [ '1 is not even', '3 is not even' ], [ 0, 2, 4 ] ]\n * ```\n *\n * @see {@link validateAll} for a function that either collects all failures or all successes.\n * @see {@link validateFirst} for a function that stops at the first success.\n *\n * @since 2.0.0\n * @category Error Accumulation\n */\nexport const partition = fiberRuntime.partition;\n/**\n * Reduces an `Iterable<A>` using an effectual function `f`, working\n * sequentially from left to right.\n *\n * **Details**\n *\n * This function takes an iterable and applies a function `f` to each element in\n * the iterable. The function works sequentially, starting with an initial value\n * `zero` and then combining it with each element in the collection. The\n * provided function `f` is called for each element in the iterable, allowing\n * you to accumulate a result based on the current value and the element being\n * processed.\n *\n * **When to Use**\n *\n * The function is often used for operations like summing a collection of\n * numbers or combining results from multiple tasks. It ensures that operations\n * are performed one after the other, maintaining the order of the elements.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const processOrder = (id: number) =>\n * Effect.succeed({ id, price: 100 * id })\n * .pipe(Effect.tap(() => Console.log(`Order ${id} processed`)), Effect.delay(500 - (id * 100)))\n *\n * const program = Effect.reduce(\n * [1, 2, 3, 4],\n * 0,\n * (acc, id, i) =>\n * processOrder(id)\n * .pipe(Effect.map((order) => acc + order.price))\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // Order 1 processed\n * // Order 2 processed\n * // Order 3 processed\n * // Order 4 processed\n * // 1000\n * ```\n *\n * @see {@link reduceWhile} for a similar function that stops the process based on a predicate.\n * @see {@link reduceRight} for a similar function that works from right to left.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const reduce = effect.reduce;\n/**\n * Reduces an `Iterable<A>` using an effectual function `body`, working\n * sequentially from left to right, stopping the process early when the\n * predicate `while` is not satisfied.\n *\n * **Details**\n *\n * This function processes a collection of elements, applying a function `body`\n * to reduce them to a single value, starting from the first element. It checks\n * the value of the accumulator against a predicate (`while`). If at any point\n * the predicate returns `false`, the reduction stops, and the accumulated\n * result is returned.\n *\n * **When to Use**\n *\n * Use this function when you need to reduce a collection of elements, but only\n * continue the process as long as a certain condition holds true. For example,\n * if you want to sum values in a list but stop as soon as the sum exceeds a\n * certain threshold, you can use this function.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const processOrder = (id: number) =>\n * Effect.succeed({ id, price: 100 * id })\n * .pipe(Effect.tap(() => Console.log(`Order ${id} processed`)), Effect.delay(500 - (id * 100)))\n *\n * const program = Effect.reduceWhile(\n * [1, 2, 3, 4],\n * 0,\n * {\n * body: (acc, id, i) =>\n * processOrder(id)\n * .pipe(Effect.map((order) => acc + order.price)),\n * while: (acc) => acc < 500\n * }\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // Order 1 processed\n * // Order 2 processed\n * // Order 3 processed\n * // 600\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const reduceWhile = effect.reduceWhile;\n/**\n * Reduces an `Iterable<A>` using an effectual function `f`, working\n * sequentially from right to left.\n *\n * **Details**\n *\n * This function takes an iterable and applies a function `f` to each element in\n * the iterable. The function works sequentially, starting with an initial value\n * `zero` and then combining it with each element in the collection. The\n * provided function `f` is called for each element in the iterable, allowing\n * you to accumulate a result based on the current value and the element being\n * processed.\n *\n * **When to Use**\n *\n * The function is often used for operations like summing a collection of\n * numbers or combining results from multiple tasks. It ensures that operations\n * are performed one after the other, maintaining the order of the elements.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const processOrder = (id: number) =>\n * Effect.succeed({ id, price: 100 * id })\n * .pipe(Effect.tap(() => Console.log(`Order ${id} processed`)), Effect.delay(500 - (id * 100)))\n *\n * const program = Effect.reduceRight(\n * [1, 2, 3, 4],\n * 0,\n * (id, acc, i) =>\n * processOrder(id)\n * .pipe(Effect.map((order) => acc + order.price))\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // Order 4 processed\n * // Order 3 processed\n * // Order 2 processed\n * // Order 1 processed\n * // 1000\n * ```\n *\n * @see {@link reduce} for a similar function that works from left to right.\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const reduceRight = effect.reduceRight;\n/**\n * Reduces an `Iterable<Effect<A, E, R>>` to a single effect.\n *\n * **Details**\n *\n * This function processes a collection of effects and combines them into one\n * single effect. It starts with an initial effect (`zero`) and applies a\n * function `f` to each element in the collection.\n *\n * **Options**\n *\n * The function also allows you to customize how the effects are handled by\n * specifying options such as concurrency, batching, and how finalizers behave.\n * These options provide flexibility in running the effects concurrently or\n * adjusting other execution details.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const processOrder = (id: number) =>\n * Effect.succeed({ id, price: 100 * id })\n * .pipe(Effect.tap(() => Console.log(`Order ${id} processed`)), Effect.delay(500 - (id * 100)))\n *\n * const program = Effect.reduceEffect(\n * [processOrder(1), processOrder(2), processOrder(3), processOrder(4)],\n * Effect.succeed(0),\n * (acc, order, i) => acc + order.price\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // Order 1 processed\n * // Order 2 processed\n * // Order 3 processed\n * // Order 4 processed\n * // 1000\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const reduceEffect = fiberRuntime.reduceEffect;\n/**\n * Replicates the given effect `n` times.\n *\n * **Details**\n *\n * This function takes an effect and replicates it a specified number of times\n * (`n`). The result is an array of `n` effects, each of which is identical to\n * the original effect.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const task = Effect.succeed(\"Hello, World!\").pipe(\n * Effect.tap(Console.log)\n * )\n *\n * const program = Effect.gen(function*() {\n * // Replicate the task 3 times\n * const tasks = Effect.replicate(task, 3)\n * for (const t of tasks) {\n * // Run each task\n * yield* t\n * }\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // Hello, World!\n * // Hello, World!\n * // Hello, World!\n * ```\n *\n * @since 2.0.0\n */\nexport const replicate = fiberRuntime.replicate;\n/**\n * Performs this effect the specified number of times and collects the results.\n *\n * **Details**\n *\n * This function repeats an effect multiple times and collects the results into\n * an array. You specify how many times to execute the effect, and it runs that\n * many times, either in sequence or concurrently depending on the provided\n * options.\n *\n * **Options**\n *\n * If the `discard` option is set to `true`, the intermediate results are not\n * collected, and the final result of the operation is `void`.\n *\n * The function also allows you to customize how the effects are handled by\n * specifying options such as concurrency, batching, and how finalizers behave.\n * These options provide flexibility in running the effects concurrently or\n * adjusting other execution details.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * let counter = 0\n *\n * const task = Effect.sync(() => ++counter).pipe(\n * Effect.tap(() => Console.log(`Task completed`))\n * )\n *\n * const program = Effect.gen(function*() {\n * // Replicate the task 3 times and collect the results\n * const results = yield* Effect.replicateEffect(task, 3)\n * yield* Console.log(`Results: ${results.join(\", \")}`)\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // Task completed\n * // Task completed\n * // Task completed\n * // Results: 1, 2, 3\n * ```\n *\n * @since 2.0.0\n * @category Collecting\n */\nexport const replicateEffect = fiberRuntime.replicateEffect;\n/**\n * Applies an effectful operation to each element in a collection while\n * collecting both successes and failures.\n *\n * **Details**\n *\n * This function allows you to apply an effectful operation to every item in a\n * collection.\n *\n * Unlike {@link forEach}, which would stop at the first error, this function\n * continues processing all elements, accumulating both successes and failures.\n *\n * **When to Use**\n *\n * Use this function when you want to process every item in a collection, even\n * if some items fail. This is particularly useful when you need to perform\n * operations on all elements without halting due to an error.\n *\n * Keep in mind that if there are any failures, **all successes will be lost**,\n * so this function is not suitable when you need to keep the successful results\n * in case of errors.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<number[], [string, ...string[]], never>\n * // ▼\n * const program = Effect.validateAll([1, 2, 3, 4, 5], (n) => {\n * if (n < 4) {\n * return Console.log(`item ${n}`).pipe(Effect.as(n))\n * } else {\n * return Effect.fail(`${n} is not less that 4`)\n * }\n * })\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // item 1\n * // item 2\n * // item 3\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Fail',\n * // failure: [ '4 is not less that 4', '5 is not less that 4' ]\n * // }\n * // }\n * ```\n *\n * @see {@link forEach} for a similar function that stops at the first error.\n * @see {@link partition} when you need to separate successes and failures\n * instead of losing successes with errors.\n *\n * @since 2.0.0\n * @category Error Accumulation\n */\nexport const validateAll = fiberRuntime.validateAll;\n/**\n * This function is similar to {@link validateAll} but with a key difference: it\n * returns the first successful result or all errors if none of the operations\n * succeed.\n *\n * **Details**\n *\n * This function processes a collection of elements and applies an effectful\n * operation to each. Unlike {@link validateAll}, which accumulates both\n * successes and failures, `Effect.validateFirst` stops and returns the first\n * success it encounters. If no success occurs, it returns all accumulated\n * errors. This can be useful when you are interested in the first successful\n * result and want to avoid processing further once a valid result is found.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<number, string[], never>\n * // ▼\n * const program = Effect.validateFirst([1, 2, 3, 4, 5], (n) => {\n * if (n < 4) {\n * return Effect.fail(`${n} is not less that 4`)\n * } else {\n * return Console.log(`item ${n}`).pipe(Effect.as(n))\n * }\n * })\n *\n * Effect.runPromise(program).then(console.log, console.error)\n * // Output:\n * // item 4\n * // 4\n * ```\n *\n * @see {@link validateAll} for a similar function that accumulates all results.\n * @see {@link firstSuccessOf} for a similar function that processes multiple\n * effects and returns the first successful one or the last error.\n *\n * @since 2.0.0\n * @category Error Accumulation\n */\nexport const validateFirst = fiberRuntime.validateFirst;\n/**\n * Creates an `Effect` from a callback-based asynchronous function.\n *\n * **Details**\n *\n * The `resume` function:\n * - Must be called exactly once. Any additional calls will be ignored.\n * - Can return an optional `Effect` that will be run if the `Fiber` executing\n * this `Effect` is interrupted. This can be useful in scenarios where you\n * need to handle resource cleanup if the operation is interrupted.\n * - Can receive an `AbortSignal` to handle interruption if needed.\n *\n * The `FiberId` of the fiber that may complete the async callback may also be\n * specified using the `blockingOn` argument. This is called the \"blocking\n * fiber\" because it suspends the fiber executing the `async` effect (i.e.\n * semantically blocks the fiber from making progress). Specifying this fiber id\n * in cases where it is known will improve diagnostics, but not affect the\n * behavior of the returned effect.\n *\n * **When to Use**\n *\n * Use `Effect.async` when dealing with APIs that use callback-style instead of\n * `async/await` or `Promise`.\n *\n * **Example** (Wrapping a Callback API)\n *\n * ```ts\n * import { Effect } from \"effect\"\n * import * as NodeFS from \"node:fs\"\n *\n * const readFile = (filename: string) =>\n * Effect.async<Buffer, Error>((resume) => {\n * NodeFS.readFile(filename, (error, data) => {\n * if (error) {\n * // Resume with a failed Effect if an error occurs\n * resume(Effect.fail(error))\n * } else {\n * // Resume with a succeeded Effect if successful\n * resume(Effect.succeed(data))\n * }\n * })\n * })\n *\n * // ┌─── Effect<Buffer, Error, never>\n * // ▼\n * const program = readFile(\"example.txt\")\n * ```\n *\n * **Example** (Handling Interruption with Cleanup)\n *\n * ```ts\n * import { Effect, Fiber } from \"effect\"\n * import * as NodeFS from \"node:fs\"\n *\n * // Simulates a long-running operation to write to a file\n * const writeFileWithCleanup = (filename: string, data: string) =>\n * Effect.async<void, Error>((resume) => {\n * const writeStream = NodeFS.createWriteStream(filename)\n *\n * // Start writing data to the file\n * writeStream.write(data)\n *\n * // When the stream is finished, resume with success\n * writeStream.on(\"finish\", () => resume(Effect.void))\n *\n * // In case of an error during writing, resume with failure\n * writeStream.on(\"error\", (err) => resume(Effect.fail(err)))\n *\n * // Handle interruption by returning a cleanup effect\n * return Effect.sync(() => {\n * console.log(`Cleaning up ${filename}`)\n * NodeFS.unlinkSync(filename)\n * })\n * })\n *\n * const program = Effect.gen(function* () {\n * const fiber = yield* Effect.fork(\n * writeFileWithCleanup(\"example.txt\", \"Some long data...\")\n * )\n * // Simulate interrupting the fiber after 1 second\n * yield* Effect.sleep(\"1 second\")\n * yield* Fiber.interrupt(fiber) // This will trigger the cleanup\n * })\n *\n * // Run the program\n * Effect.runPromise(program)\n * // Output:\n * // Cleaning up example.txt\n * ```\n *\n * **Example** (Handling Interruption with AbortSignal)\n *\n * ```ts\n * import { Effect, Fiber } from \"effect\"\n *\n * // A task that supports interruption using AbortSignal\n * const interruptibleTask = Effect.async<void, Error>((resume, signal) => {\n * // Handle interruption\n * signal.addEventListener(\"abort\", () => {\n * console.log(\"Abort signal received\")\n * clearTimeout(timeoutId)\n * })\n *\n * // Simulate a long-running task\n * const timeoutId = setTimeout(() => {\n * console.log(\"Operation completed\")\n * resume(Effect.void)\n * }, 2000)\n * })\n *\n * const program = Effect.gen(function* () {\n * const fiber = yield* Effect.fork(interruptibleTask)\n * // Simulate interrupting the fiber after 1 second\n * yield* Effect.sleep(\"1 second\")\n * yield* Fiber.interrupt(fiber)\n * })\n *\n * // Run the program\n * Effect.runPromise(program)\n * // Output:\n * // Abort signal received\n * ```\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const async = core.async;\n/**\n * A variant of {@link async} where the registration function may return an `Effect`.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const asyncEffect = runtime_.asyncEffect;\n/**\n * Low level constructor that enables for custom stack tracing cutpoints.\n *\n * It is meant to be called with a bag of instructions that become available in\n * the \"this\" of the effect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const throwingFunction = () => { throw new Error() }\n * const blowUp = Effect.custom(throwingFunction, function() {\n * return Effect.succeed(this.effect_instruction_i0())\n * })\n * ```\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const custom = core.custom;\n/**\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const withFiberRuntime = core.withFiberRuntime;\n/**\n * Creates an `Effect` that represents a recoverable error.\n *\n * **When to Use**\n *\n * Use this function to explicitly signal an error in an `Effect`. The error\n * will keep propagating unless it is handled. You can handle the error with\n * functions like {@link catchAll} or {@link catchTag}.\n *\n * **Example** (Creating a Failed Effect)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<never, Error, never>\n * // ▼\n * const failure = Effect.fail(\n * new Error(\"Operation failed due to network error\")\n * )\n * ```\n *\n * @see {@link succeed} to create an effect that represents a successful value.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const fail = core.fail;\n/**\n * Creates an `Effect` that fails with the specified error, evaluated lazily.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const failSync = core.failSync;\n/**\n * Creates an `Effect` that fails with the specified `Cause`.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const failCause = core.failCause;\n/**\n * Creates an `Effect` that fails with the specified `Cause`, evaluated lazily.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const failCauseSync = core.failCauseSync;\n/**\n * Creates an effect that terminates a fiber with a specified error.\n *\n * **Details**\n *\n * This function is used to signal a defect, which represents a critical and\n * unexpected error in the code. When invoked, it produces an effect that does\n * not handle the error and instead terminates the fiber.\n *\n * The error channel of the resulting effect is of type `never`, indicating that\n * it cannot recover from this failure.\n *\n * **When to Use**\n *\n * Use this function when encountering unexpected conditions in your code that\n * should not be handled as regular errors but instead represent unrecoverable\n * defects.\n *\n * **Example** (Terminating on Division by Zero with a Specified Error)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const divide = (a: number, b: number) =>\n * b === 0\n * ? Effect.die(new Error(\"Cannot divide by zero\"))\n * : Effect.succeed(a / b)\n *\n * // ┌─── Effect<number, never, never>\n * // ▼\n * const program = divide(1, 0)\n *\n * Effect.runPromise(program).catch(console.error)\n * // Output:\n * // (FiberFailure) Error: Cannot divide by zero\n * // ...stack trace...\n * ```\n *\n * @see {@link dieSync} for a variant that throws a specified error, evaluated\n * lazily.\n * @see {@link dieMessage} for a variant that throws a `RuntimeException` with a\n * message.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const die = core.die;\n/**\n * Creates an effect that terminates a fiber with a `RuntimeException`\n * containing the specified message.\n *\n * **Details**\n *\n * This function is used to signal a defect, representing a critical and\n * unexpected error in the code. When invoked, it produces an effect that\n * terminates the fiber with a `RuntimeException` carrying the given message.\n *\n * The resulting effect has an error channel of type `never`, indicating it does\n * not handle or recover from the error.\n *\n * **When to Use**\n *\n * Use this function when you want to terminate a fiber due to an unrecoverable\n * defect and include a clear explanation in the message.\n *\n * **Example** (Terminating on Division by Zero with a Specified Message)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const divide = (a: number, b: number) =>\n * b === 0\n * ? Effect.dieMessage(\"Cannot divide by zero\")\n * : Effect.succeed(a / b)\n *\n * // ┌─── Effect<number, never, never>\n * // ▼\n * const program = divide(1, 0)\n *\n * Effect.runPromise(program).catch(console.error)\n * // Output:\n * // (FiberFailure) RuntimeException: Cannot divide by zero\n * // ...stack trace...\n * ```\n *\n * @see {@link die} for a variant that throws a specified error.\n * @see {@link dieSync} for a variant that throws a specified error, evaluated\n * lazily.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const dieMessage = core.dieMessage;\n/**\n * Creates an effect that dies with the specified error, evaluated lazily.\n *\n * **Details**\n *\n * This function allows you to create an effect that will terminate with a fatal error.\n * The error is provided as a lazy argument, meaning it will only be evaluated when the effect runs.\n *\n * @see {@link die} if you don't need to evaluate the error lazily.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const dieSync = core.dieSync;\n/**\n * Provides a way to write effectful code using generator functions, simplifying\n * control flow and error handling.\n *\n * **When to Use**\n *\n * `Effect.gen` allows you to write code that looks and behaves like synchronous\n * code, but it can handle asynchronous tasks, errors, and complex control flow\n * (like loops and conditions). It helps make asynchronous code more readable\n * and easier to manage.\n *\n * The generator functions work similarly to `async/await` but with more\n * explicit control over the execution of effects. You can `yield*` values from\n * effects and return the final result at the end.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const addServiceCharge = (amount: number) => amount + 1\n *\n * const applyDiscount = (\n * total: number,\n * discountRate: number\n * ): Effect.Effect<number, Error> =>\n * discountRate === 0\n * ? Effect.fail(new Error(\"Discount rate cannot be zero\"))\n * : Effect.succeed(total - (total * discountRate) / 100)\n *\n * const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))\n *\n * const fetchDiscountRate = Effect.promise(() => Promise.resolve(5))\n *\n * export const program = Effect.gen(function* () {\n * const transactionAmount = yield* fetchTransactionAmount\n * const discountRate = yield* fetchDiscountRate\n * const discountedAmount = yield* applyDiscount(\n * transactionAmount,\n * discountRate\n * )\n * const finalAmount = addServiceCharge(discountedAmount)\n * return `Final amount to charge: ${finalAmount}`\n * })\n * ```\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const gen = core.gen;\n/**\n * An effect that that runs indefinitely and never produces any result. The\n * moral equivalent of `while(true) {}`, only without the wasted CPU cycles.\n *\n * **When to Use**\n *\n * It could be useful for long-running background tasks or to simulate waiting\n * behavior without actually consuming resources. This effect is ideal for cases\n * where you want to keep the program alive or in a certain state without\n * performing any active work.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const never = core.never;\n/**\n * Ensures the `Option` is `None`, returning `void`. Otherwise, raises a\n * `NoSuchElementException`.\n *\n * **Details**\n *\n * This function checks if the provided `Option` is `None`. If it is, it returns\n * an effect that produces no result (i.e., `void`). If the `Option` is not\n * `None` (i.e., it contains a value), the function will raise a\n * `NoSuchElementException` error.\n *\n * **When to Use**\n *\n * This is useful when you want to ensure that a certain value is absent (i.e.,\n * `None`) before continuing execution, and to handle cases where the value is\n * unexpectedly present.\n *\n * @since 2.0.0\n */\nexport const none = effect.none;\n/**\n * Creates an `Effect` that represents an asynchronous computation guaranteed to\n * succeed.\n *\n * **Details**\n *\n * The provided function (`thunk`) returns a `Promise` that should never reject; if it does, the error\n * will be treated as a \"defect\".\n *\n * This defect is not a standard error but indicates a flaw in the logic that\n * was expected to be error-free. You can think of it similar to an unexpected\n * crash in the program, which can be further managed or logged using tools like\n * {@link catchAllDefect}.\n *\n * **Interruptions**\n *\n * An optional `AbortSignal` can be provided to allow for interruption of the\n * wrapped `Promise` API.\n *\n * **When to Use**\n *\n * Use this function when you are sure the operation will not reject.\n *\n * **Example** (Delayed Message)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const delay = (message: string) =>\n * Effect.promise<string>(\n * () =>\n * new Promise((resolve) => {\n * setTimeout(() => {\n * resolve(message)\n * }, 2000)\n * })\n * )\n *\n * // ┌─── Effect<string, never, never>\n * // ▼\n * const program = delay(\"Async operation completed successfully!\")\n * ```\n *\n * @see {@link tryPromise} for a version that can handle failures.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const promise = effect.promise;\n/**\n * Creates an `Effect` that always succeeds with a given value.\n *\n * **When to Use**\n *\n * Use this function when you need an effect that completes successfully with a\n * specific value without any errors or external dependencies.\n *\n * **Example** (Creating a Successful Effect)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Creating an effect that represents a successful scenario\n * //\n * // ┌─── Effect<number, never, never>\n * // ▼\n * const success = Effect.succeed(42)\n * ```\n *\n * @see {@link fail} to create an effect that represents a failure.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const succeed = core.succeed;\n/**\n * Returns an effect which succeeds with `None`.\n *\n * **When to Use**\n *\n * Use this function when you need to represent the absence of a value in your\n * code, especially when working with optional data. This can be helpful when\n * you want to indicate that no result is available without throwing an error or\n * performing additional logic.\n *\n * @see {@link succeedSome} to create an effect that succeeds with a `Some` value.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const succeedNone = effect.succeedNone;\n/**\n * Returns an effect which succeeds with the value wrapped in a `Some`.\n *\n * @see {@link succeedNone} for a similar function that returns `None` when the value is absent.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const succeedSome = effect.succeedSome;\n/**\n * Delays the creation of an `Effect` until it is actually needed.\n *\n * **Details**\n *\n * The `Effect.suspend` function takes a thunk that represents the effect and\n * wraps it in a suspended effect. This means the effect will not be created\n * until it is explicitly needed, which is helpful in various scenarios:\n * - **Lazy Evaluation**: Helps optimize performance by deferring computations,\n * especially when the effect might not be needed, or when its computation is\n * expensive. This also ensures that any side effects or scoped captures are\n * re-executed on each invocation.\n * - **Handling Circular Dependencies**: Useful in managing circular\n * dependencies, such as recursive functions that need to avoid eager\n * evaluation to prevent stack overflow.\n * - **Unifying Return Types**: Can help TypeScript unify return types in\n * situations where multiple branches of logic return different effects,\n * simplifying type inference.\n *\n * **When to Use**\n *\n * Use this function when you need to defer the evaluation of an effect until it\n * is required. This is particularly useful for optimizing expensive\n * computations, managing circular dependencies, or resolving type inference\n * issues.\n *\n * **Example** (Lazy Evaluation with Side Effects)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * let i = 0\n *\n * const bad = Effect.succeed(i++)\n *\n * const good = Effect.suspend(() => Effect.succeed(i++))\n *\n * console.log(Effect.runSync(bad)) // Output: 0\n * console.log(Effect.runSync(bad)) // Output: 0\n *\n * console.log(Effect.runSync(good)) // Output: 1\n * console.log(Effect.runSync(good)) // Output: 2\n * ```\n *\n * **Example** (Recursive Fibonacci)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const blowsUp = (n: number): Effect.Effect<number> =>\n * n < 2\n * ? Effect.succeed(1)\n * : Effect.zipWith(blowsUp(n - 1), blowsUp(n - 2), (a, b) => a + b)\n *\n * console.log(Effect.runSync(blowsUp(32)))\n * // crash: JavaScript heap out of memory\n *\n * const allGood = (n: number): Effect.Effect<number> =>\n * n < 2\n * ? Effect.succeed(1)\n * : Effect.zipWith(\n * Effect.suspend(() => allGood(n - 1)),\n * Effect.suspend(() => allGood(n - 2)),\n * (a, b) => a + b\n * )\n *\n * console.log(Effect.runSync(allGood(32)))\n * // Output: 3524578\n * ```\n *\n * **Example** (Using Effect.suspend to Help TypeScript Infer Types)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Without suspend, TypeScript may struggle with type inference.\n * // Inferred type:\n * // (a: number, b: number) =>\n * // Effect<never, Error, never> | Effect<number, never, never>\n * const withoutSuspend = (a: number, b: number) =>\n * b === 0\n * ? Effect.fail(new Error(\"Cannot divide by zero\"))\n * : Effect.succeed(a / b)\n *\n * // Using suspend to unify return types.\n * // Inferred type:\n * // (a: number, b: number) => Effect<number, Error, never>\n * const withSuspend = (a: number, b: number) =>\n * Effect.suspend(() =>\n * b === 0\n * ? Effect.fail(new Error(\"Cannot divide by zero\"))\n * : Effect.succeed(a / b)\n * )\n * ```\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const suspend = core.suspend;\n/**\n * Creates an `Effect` that represents a synchronous side-effectful computation.\n *\n * **Details**\n *\n * The provided function (`thunk`) must not throw errors; if it does, the error\n * will be treated as a \"defect\".\n *\n * This defect is not a standard error but indicates a flaw in the logic that\n * was expected to be error-free. You can think of it similar to an unexpected\n * crash in the program, which can be further managed or logged using tools like\n * {@link catchAllDefect}.\n *\n * **When to Use**\n *\n * Use this function when you are sure the operation will not fail.\n *\n * **Example** (Logging a Message)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const log = (message: string) =>\n * Effect.sync(() => {\n * console.log(message) // side effect\n * })\n *\n * // ┌─── Effect<void, never, never>\n * // ▼\n * const program = log(\"Hello, World!\")\n * ```\n *\n * @see {@link try_ | try} for a version that can handle failures.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const sync = core.sync;\nconst _void = core.void;\nexport {\n/**\n * Represents an effect that does nothing and produces no value.\n *\n * **When to Use**\n *\n * Use this effect when you need to represent an effect that does nothing.\n * This is useful in scenarios where you need to satisfy an effect-based\n * interface or control program flow without performing any operations. For\n * example, it can be used in situations where you want to return an effect\n * from a function but do not need to compute or return any result.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\n_void as void };\n/**\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const yieldNow = core.yieldNow;\nconst _catch = effect._catch;\nexport {\n/**\n * Recovers from a specified error by catching it and handling it with a provided function.\n *\n * **Details**\n *\n * This function allows you to recover from specific errors that occur during\n * the execution of an effect. It works by catching a specific type of error\n * (identified by a discriminator) and then handling it using a provided\n * handler function. The handler can return a new effect that helps recover\n * from the error, allowing the program to continue. If the error doesn't\n * match the specified type, the function allows the original effect to\n * continue as it was.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * class NetworkError {\n * readonly _tag = \"NetworkError\"\n * }\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // Simulate an effect that may fail\n * const task: Effect.Effect<never, NetworkError | ValidationError, never> = Effect.fail(new NetworkError())\n *\n * const program = Effect.gen(function*() {\n * const result = yield* Effect.catch(task, \"_tag\", {\n * failure: \"NetworkError\",\n * onFailure: (error) => Effect.succeed(`recovered from error: ${error._tag}`)\n * })\n * console.log(`Result: ${result}`)\n * })\n *\n * Effect.runFork(program)\n * // Output: Result: recovered from error: NetworkError\n * ```\n *\n * @see {@link catchTag} for a version that can recover from errors based on a `_tag` discriminator.\n *\n * @since 2.0.0\n * @category Error handling\n */\n_catch as catch };\n/**\n * Handles all errors in an effect by providing a fallback effect.\n *\n * **Details**\n *\n * This function catches any errors that may occur during the execution of an\n * effect and allows you to handle them by specifying a fallback effect. This\n * ensures that the program continues without failing by recovering from errors\n * using the provided fallback logic.\n *\n * **Note**: This function only handles recoverable errors. It will not recover\n * from unrecoverable defects.\n *\n * **Example** (Providing Recovery Logic for Recoverable Errors)\n *\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * class HttpError {\n * readonly _tag = \"HttpError\"\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const n1 = yield* Random.next\n * const n2 = yield* Random.next\n * if (n1 < 0.5) {\n * yield* Effect.fail(new HttpError())\n * }\n * if (n2 < 0.5) {\n * yield* Effect.fail(new ValidationError())\n * }\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, never, never>\n * // ▼\n * const recovered = program.pipe(\n * Effect.catchAll((error) =>\n * Effect.succeed(`Recovering from ${error._tag}`)\n * )\n * )\n * ```\n *\n * @see {@link catchAllCause} for a version that can recover from both\n * recoverable and unrecoverable errors.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchAll = core.catchAll;\n/**\n * Handles both recoverable and unrecoverable errors by providing a recovery\n * effect.\n *\n * **When to Use**\n *\n * The `catchAllCause` function allows you to handle all errors, including\n * unrecoverable defects, by providing a recovery effect. The recovery logic is\n * based on the `Cause` of the error, which provides detailed information about\n * the failure.\n *\n * **When to Recover from Defects**\n *\n * Defects are unexpected errors that typically shouldn't be recovered from, as\n * they often indicate serious issues. However, in some cases, such as\n * dynamically loaded plugins, controlled recovery might be needed.\n *\n * **Example** (Recovering from All Errors)\n *\n * ```ts\n * import { Cause, Effect } from \"effect\"\n *\n * // Define an effect that may fail with a recoverable or unrecoverable error\n * const program = Effect.fail(\"Something went wrong!\")\n *\n * // Recover from all errors by examining the cause\n * const recovered = program.pipe(\n * Effect.catchAllCause((cause) =>\n * Cause.isFailure(cause)\n * ? Effect.succeed(\"Recovered from a regular error\")\n * : Effect.succeed(\"Recovered from a defect\")\n * )\n * )\n *\n * Effect.runPromise(recovered).then(console.log)\n * // Output: \"Recovered from a regular error\"\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchAllCause = core.catchAllCause;\n/**\n * Recovers from all defects using a provided recovery function.\n *\n * **When to Use**\n *\n * There is no sensible way to recover from defects. This method should be used\n * only at the boundary between Effect and an external system, to transmit\n * information on a defect for diagnostic or explanatory purposes.\n *\n * **Details**\n *\n * `catchAllDefect` allows you to handle defects, which are unexpected errors\n * that usually cause the program to terminate. This function lets you recover\n * from these defects by providing a function that handles the error. However,\n * it does not handle expected errors (like those from {@link fail}) or\n * execution interruptions (like those from {@link interrupt}).\n *\n * **When to Recover from Defects**\n *\n * Defects are unexpected errors that typically shouldn't be recovered from, as\n * they often indicate serious issues. However, in some cases, such as\n * dynamically loaded plugins, controlled recovery might be needed.\n *\n * **Example** (Handling All Defects)\n *\n * ```ts\n * import { Effect, Cause, Console } from \"effect\"\n *\n * // Simulating a runtime error\n * const task = Effect.dieMessage(\"Boom!\")\n *\n * const program = Effect.catchAllDefect(task, (defect) => {\n * if (Cause.isRuntimeException(defect)) {\n * return Console.log(\n * `RuntimeException defect caught: ${defect.message}`\n * )\n * }\n * return Console.log(\"Unknown defect caught.\")\n * })\n *\n * // We get an Exit.Success because we caught all defects\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // RuntimeException defect caught: Boom!\n * // {\n * // _id: \"Exit\",\n * // _tag: \"Success\",\n * // value: undefined\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchAllDefect = effect.catchAllDefect;\n/**\n * Recovers from specific errors based on a predicate.\n *\n * **When to Use**\n *\n * `catchIf` works similarly to {@link catchSome}, but it allows you to\n * recover from errors by providing a predicate function. If the predicate\n * matches the error, the recovery effect is applied. This function doesn't\n * alter the error type, so the resulting effect still carries the original\n * error type unless a user-defined type guard is used to narrow the type.\n *\n * **Example** (Catching Specific Errors with a Predicate)\n *\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * class HttpError {\n * readonly _tag = \"HttpError\"\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const n1 = yield* Random.next\n * const n2 = yield* Random.next\n * if (n1 < 0.5) {\n * yield* Effect.fail(new HttpError())\n * }\n * if (n2 < 0.5) {\n * yield* Effect.fail(new ValidationError())\n * }\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, ValidationError, never>\n * // ▼\n * const recovered = program.pipe(\n * Effect.catchIf(\n * // Only handle HttpError errors\n * (error) => error._tag === \"HttpError\",\n * () => Effect.succeed(\"Recovering from HttpError\")\n * )\n * )\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchIf = core.catchIf;\n/**\n * Catches and recovers from specific types of errors, allowing you to attempt\n * recovery only for certain errors.\n *\n * **Details**\n *\n * `catchSome` lets you selectively catch and handle errors of certain\n * types by providing a recovery effect for specific errors. If the error\n * matches a condition, recovery is attempted; if not, it doesn't affect the\n * program. This function doesn't alter the error type, meaning the error type\n * remains the same as in the original effect.\n *\n * **Example** (Handling Specific Errors with Effect.catchSome)\n *\n * ```ts\n * import { Effect, Random, Option } from \"effect\"\n *\n * class HttpError {\n * readonly _tag = \"HttpError\"\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const n1 = yield* Random.next\n * const n2 = yield* Random.next\n * if (n1 < 0.5) {\n * yield* Effect.fail(new HttpError())\n * }\n * if (n2 < 0.5) {\n * yield* Effect.fail(new ValidationError())\n * }\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const recovered = program.pipe(\n * Effect.catchSome((error) => {\n * // Only handle HttpError errors\n * if (error._tag === \"HttpError\") {\n * return Option.some(Effect.succeed(\"Recovering from HttpError\"))\n * } else {\n * return Option.none()\n * }\n * })\n * )\n * ```\n *\n * @see {@link catchIf} for a version that allows you to recover from errors based on a predicate.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchSome = core.catchSome;\n/**\n * Recovers from specific causes using a provided partial function.\n *\n * @see {@link catchSome} for a version that allows you to recover from errors.\n * @see {@link catchSomeDefect} for a version that allows you to recover from defects.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchSomeCause = effect.catchSomeCause;\n/**\n * Recovers from specific defects using a provided partial function.\n *\n * **Details**\n *\n * `catchSomeDefect` allows you to handle specific defects, which are\n * unexpected errors that can cause the program to stop. It uses a partial\n * function to catch only certain defects and ignores others. The function does\n * not handle expected errors (such as those caused by {@link fail}) or\n * interruptions in execution (like those caused by {@link interrupt}).\n *\n * This function provides a way to handle certain types of defects while\n * allowing others to propagate and cause failure in the program.\n *\n * **Note**: There is no sensible way to recover from defects. This method\n * should be used only at the boundary between Effect and an external system, to\n * transmit information on a defect for diagnostic or explanatory purposes.\n *\n * **How the Partial Function Works**\n *\n * The function provided to `catchSomeDefect` acts as a filter and a handler for defects:\n * - It receives the defect as an input.\n * - If the defect matches a specific condition (e.g., a certain error type), the function returns\n * an `Option.some` containing the recovery logic.\n * - If the defect does not match, the function returns `Option.none`, allowing the defect to propagate.\n *\n * **Example** (Handling Specific Defects)\n *\n * ```ts\n * import { Effect, Cause, Option, Console } from \"effect\"\n *\n * // Simulating a runtime error\n * const task = Effect.dieMessage(\"Boom!\")\n *\n * const program = Effect.catchSomeDefect(task, (defect) => {\n * if (Cause.isIllegalArgumentException(defect)) {\n * return Option.some(\n * Console.log(\n * `Caught an IllegalArgumentException defect: ${defect.message}`\n * )\n * )\n * }\n * return Option.none()\n * })\n *\n * // Since we are only catching IllegalArgumentException\n * // we will get an Exit.Failure because we simulated a runtime error.\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Die',\n * // defect: { _tag: 'RuntimeException' }\n * // }\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchSomeDefect = effect.catchSomeDefect;\n/**\n * Catches and handles specific errors by their `_tag` field, which is used as a\n * discriminator.\n *\n * **When to Use**\n *\n * `catchTag` is useful when your errors are tagged with a readonly `_tag` field\n * that identifies the error type. You can use this function to handle specific\n * error types by matching the `_tag` value. This allows for precise error\n * handling, ensuring that only specific errors are caught and handled.\n *\n * The error type must have a readonly `_tag` field to use `catchTag`. This\n * field is used to identify and match errors.\n *\n * **Example** (Handling Errors by Tag)\n *\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * class HttpError {\n * readonly _tag = \"HttpError\"\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const n1 = yield* Random.next\n * const n2 = yield* Random.next\n * if (n1 < 0.5) {\n * yield* Effect.fail(new HttpError())\n * }\n * if (n2 < 0.5) {\n * yield* Effect.fail(new ValidationError())\n * }\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, ValidationError, never>\n * // ▼\n * const recovered = program.pipe(\n * // Only handle HttpError errors\n * Effect.catchTag(\"HttpError\", (_HttpError) =>\n * Effect.succeed(\"Recovering from HttpError\")\n * )\n * )\n * ```\n *\n * @see {@link catchTags} for a version that allows you to handle multiple error\n * types at once.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchTag = effect.catchTag;\n/**\n * Handles multiple errors in a single block of code using their `_tag` field.\n *\n * **When to Use**\n *\n * `catchTags` is a convenient way to handle multiple error types at\n * once. Instead of using {@link catchTag} multiple times, you can pass an\n * object where each key is an error type's `_tag`, and the value is the handler\n * for that specific error. This allows you to catch and recover from multiple\n * error types in a single call.\n *\n * The error type must have a readonly `_tag` field to use `catchTag`. This\n * field is used to identify and match errors.\n *\n * **Example** (Handling Multiple Tagged Error Types at Once)\n *\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * class HttpError {\n * readonly _tag = \"HttpError\"\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const n1 = yield* Random.next\n * const n2 = yield* Random.next\n * if (n1 < 0.5) {\n * yield* Effect.fail(new HttpError())\n * }\n * if (n2 < 0.5) {\n * yield* Effect.fail(new ValidationError())\n * }\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, never, never>\n * // ▼\n * const recovered = program.pipe(\n * Effect.catchTags({\n * HttpError: (_HttpError) =>\n * Effect.succeed(`Recovering from HttpError`),\n * ValidationError: (_ValidationError) =>\n * Effect.succeed(`Recovering from ValidationError`)\n * })\n * )\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const catchTags = effect.catchTags;\n/**\n * Retrieves the cause of a failure in an effect.\n *\n * **Details**\n *\n * This function allows you to expose the detailed cause of an effect, which\n * includes a more precise representation of failures, such as error messages\n * and defects.\n *\n * **When to Use**\n *\n * This function is helpful when you need to inspect the cause of a failure in\n * an effect, giving you more information than just the error message. It can be\n * used to log, handle, or analyze failures in more detail, including\n * distinguishing between different types of defects (e.g., runtime exceptions,\n * interruptions, etc.).\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<number, string, never>\n * // ▼\n * const program = Effect.fail(\"Oh uh!\").pipe(Effect.as(2))\n *\n * // ┌─── Effect<void, never, never>\n * // ▼\n * const recovered = Effect.gen(function* () {\n * const cause = yield* Effect.cause(program)\n * yield* Console.log(cause)\n * })\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const cause = effect.cause;\n/**\n * Runs an effect repeatedly until it succeeds, ignoring errors.\n *\n * **Details**\n *\n * This function takes an effect and runs it repeatedly until the effect\n * successfully completes. If the effect fails, it will ignore the error and\n * retry the operation. This is useful when you need to perform a task that may\n * fail occasionally, but you want to keep trying until it eventually succeeds.\n * It works by repeatedly executing the effect until it no longer throws an\n * error.\n *\n * **When to Use**\n *\n * Use this function when you want to retry an operation multiple times until it\n * succeeds. It is helpful in cases where the operation may fail temporarily\n * (e.g., a network request), and you want to keep trying without handling or\n * worrying about the errors.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * let counter = 0\n *\n * const effect = Effect.try(() => {\n * counter++\n * if (counter < 3) {\n * console.log(\"running effect\")\n * throw new Error(\"error\")\n * } else {\n * console.log(\"effect done\")\n * return \"some result\"\n * }\n * })\n *\n * const program = Effect.eventually(effect)\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // running effect\n * // running effect\n * // effect done\n * // some result\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const eventually = effect.eventually;\n/**\n * Discards both the success and failure values of an effect.\n *\n * **When to Use**\n *\n * `ignore` allows you to run an effect without caring about its result, whether\n * it succeeds or fails. This is useful when you only care about the side\n * effects of the effect and do not need to handle or process its outcome.\n *\n * **Example** (Using Effect.ignore to Discard Values)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, string, never>\n * // ▼\n * const task = Effect.fail(\"Uh oh!\").pipe(Effect.as(5))\n *\n * // ┌─── Effect<void, never, never>\n * // ▼\n * const program = Effect.ignore(task)\n * ```\n *\n * @see {@link ignoreLogged} to log failures while ignoring them.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const ignore = effect.ignore;\n/**\n * Ignores the result of an effect but logs any failures.\n *\n * **Details**\n *\n * This function takes an effect and returns a new effect that ignores whether\n * the original effect succeeds or fails. However, if the effect fails, it will\n * log the failure at the Debug level, so you can keep track of any issues that\n * arise.\n *\n * **When to Use**\n *\n * This is useful in scenarios where you want to continue with your program\n * regardless of the result of the effect, but you still want to be aware of\n * potential failures that may need attention later.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const ignoreLogged = effect.ignoreLogged;\n/**\n * Combines all errors from concurrent operations into a single error.\n *\n * **Details**\n *\n * This function is used when you have multiple operations running at the same\n * time, and you want to capture all the errors that occur across those\n * operations. Instead of handling each error separately, it combines all the\n * errors into one unified error.\n *\n * **When to Use**\n *\n * When using this function, any errors that occur in the concurrently running\n * operations will be grouped together into a single error. This helps simplify\n * error handling in cases where you don't need to differentiate between each\n * failure, but simply want to know that multiple failures occurred.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const fail1 = Effect.fail(\"Oh uh!\")\n * const fail2 = Effect.fail(\"Oh no!\")\n * const die = Effect.dieMessage(\"Boom!\")\n *\n * // Run all effects concurrently and capture all errors\n * const program = Effect.all([fail1, fail2, die], {\n * concurrency: \"unbounded\"\n * }).pipe(Effect.asVoid, Effect.parallelErrors)\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: [ 'Oh uh!', 'Oh no!' ] }\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const parallelErrors = effect.parallelErrors;\n/**\n * Transforms an effect to expose detailed error causes.\n *\n * **Details**\n *\n * This function enhances an effect by providing detailed information about any\n * error, defect, or interruption that may occur during its execution. It\n * modifies the error channel of the effect so that it includes a full cause of\n * the failure, wrapped in a `Cause<E>` type.\n *\n * After applying this function, you can use operators like {@link catchAll} and\n * {@link catchTags} to handle specific types of errors.\n *\n * If you no longer need the detailed cause information, you can revert the\n * changes using {@link unsandbox} to return to the original error-handling\n * behavior.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<string, Error, never>\n * // ▼\n * const task = Effect.fail(new Error(\"Oh uh!\")).pipe(\n * Effect.as(\"primary result\")\n * )\n *\n * // ┌─── Effect<string, Cause<Error>, never>\n * // ▼\n * const sandboxed = Effect.sandbox(task)\n *\n * const program = Effect.catchTags(sandboxed, {\n * Die: (cause) =>\n * Console.log(`Caught a defect: ${cause.defect}`).pipe(\n * Effect.as(\"fallback result on defect\")\n * ),\n * Interrupt: (cause) =>\n * Console.log(`Caught a defect: ${cause.fiberId}`).pipe(\n * Effect.as(\"fallback result on fiber interruption\")\n * ),\n * Fail: (cause) =>\n * Console.log(`Caught a defect: ${cause.error}`).pipe(\n * Effect.as(\"fallback result on failure\")\n * )\n * })\n *\n * // Restore the original error handling with unsandbox\n * const main = Effect.unsandbox(program)\n *\n * Effect.runPromise(main).then(console.log)\n * // Output:\n * // Caught a defect: Oh uh!\n * // fallback result on failure\n * ```\n *\n * @see {@link unsandbox} to restore the original error handling.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const sandbox = effect.sandbox;\n/**\n * Retries a failing effect based on a defined retry policy.\n *\n * **Details**\n *\n * The `Effect.retry` function takes an effect and a {@link Schedule} policy,\n * and will automatically retry the effect if it fails, following the rules of\n * the policy.\n *\n * If the effect ultimately succeeds, the result will be returned.\n *\n * If the maximum retries are exhausted and the effect still fails, the failure\n * is propagated.\n *\n * **When to Use**\n *\n * This can be useful when dealing with intermittent failures, such as network\n * issues or temporary resource unavailability. By defining a retry policy, you\n * can control the number of retries, the delay between them, and when to stop\n * retrying.\n *\n * **Example** (Retrying with a Fixed Delay)\n *\n * ```ts\n * import { Effect, Schedule } from \"effect\"\n *\n * let count = 0\n *\n * // Simulates an effect with possible failures\n * const task = Effect.async<string, Error>((resume) => {\n * if (count <= 2) {\n * count++\n * console.log(\"failure\")\n * resume(Effect.fail(new Error()))\n * } else {\n * console.log(\"success\")\n * resume(Effect.succeed(\"yay!\"))\n * }\n * })\n *\n * // Define a repetition policy using a fixed delay between retries\n * const policy = Schedule.fixed(\"100 millis\")\n *\n * const repeated = Effect.retry(task, policy)\n *\n * Effect.runPromise(repeated).then(console.log)\n * // Output:\n * // failure\n * // failure\n * // failure\n * // success\n * // yay!\n * ```\n *\n * **Example** (Retrying a Task up to 5 times)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * let count = 0\n *\n * // Simulates an effect with possible failures\n * const task = Effect.async<string, Error>((resume) => {\n * if (count <= 2) {\n * count++\n * console.log(\"failure\")\n * resume(Effect.fail(new Error()))\n * } else {\n * console.log(\"success\")\n * resume(Effect.succeed(\"yay!\"))\n * }\n * })\n *\n * // Retry the task up to 5 times\n * Effect.runPromise(Effect.retry(task, { times: 5 })).then(console.log)\n * // Output:\n * // failure\n * // failure\n * // failure\n * // success\n * ```\n *\n * **Example** (Retrying Until a Specific Condition is Met)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * let count = 0\n *\n * // Define an effect that simulates varying error on each invocation\n * const action = Effect.failSync(() => {\n * console.log(`Action called ${++count} time(s)`)\n * return `Error ${count}`\n * })\n *\n * // Retry the action until a specific condition is met\n * const program = Effect.retry(action, {\n * until: (err) => err === \"Error 3\"\n * })\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // Action called 1 time(s)\n * // Action called 2 time(s)\n * // Action called 3 time(s)\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'Error 3' }\n * // }\n * ```\n *\n * @see {@link retryOrElse} for a version that allows you to run a fallback.\n * @see {@link repeat} if your retry condition is based on successful outcomes rather than errors.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const retry = schedule_.retry_combined;\n/**\n * Apply an `ExecutionPlan` to the effect, which allows you to fallback to\n * different resources in case of failure.\n *\n * @since 3.16.0\n * @category Error handling\n * @experimental\n */\nexport const withExecutionPlan = internalExecutionPlan.withExecutionPlan;\n/**\n * Retries a failing effect and runs a fallback effect if retries are exhausted.\n *\n * **Details**\n *\n * The `Effect.retryOrElse` function attempts to retry a failing effect multiple\n * times according to a defined {@link Schedule} policy.\n *\n * If the retries are exhausted and the effect still fails, it runs a fallback\n * effect instead.\n *\n * **When to Use**\n *\n * This function is useful when you want to handle failures gracefully by\n * specifying an alternative action after repeated failures.\n *\n * **Example** (Retrying with Fallback)\n *\n * ```ts\n * import { Effect, Schedule, Console } from \"effect\"\n *\n * let count = 0\n *\n * // Simulates an effect with possible failures\n * const task = Effect.async<string, Error>((resume) => {\n * if (count <= 2) {\n * count++\n * console.log(\"failure\")\n * resume(Effect.fail(new Error()))\n * } else {\n * console.log(\"success\")\n * resume(Effect.succeed(\"yay!\"))\n * }\n * })\n *\n * // Retry the task with a delay between retries and a maximum of 2 retries\n * const policy = Schedule.addDelay(Schedule.recurs(2), () => \"100 millis\")\n *\n * // If all retries fail, run the fallback effect\n * const repeated = Effect.retryOrElse(\n * task,\n * policy,\n * // fallback\n * () => Console.log(\"orElse\").pipe(Effect.as(\"default value\"))\n * )\n *\n * Effect.runPromise(repeated).then(console.log)\n * // Output:\n * // failure\n * // failure\n * // failure\n * // orElse\n * // default value\n * ```\n *\n * @see {@link retry} for a version that does not run a fallback effect.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const retryOrElse = schedule_.retryOrElse_Effect;\nconst try_ = effect.try_;\nexport {\n/**\n * Creates an `Effect` that represents a synchronous computation that might\n * fail.\n *\n * **When to Use**\n *\n * In situations where you need to perform synchronous operations that might\n * fail, such as parsing JSON, you can use the `try` constructor. This\n * constructor is designed to handle operations that could throw exceptions by\n * capturing those exceptions and transforming them into manageable errors.\n *\n * **Error Handling**\n *\n * There are two ways to handle errors with `try`:\n *\n * 1. If you don't provide a `catch` function, the error is caught and the\n * effect fails with an `UnknownException`.\n * 2. If you provide a `catch` function, the error is caught and the `catch`\n * function maps it to an error of type `E`.\n *\n * **Example** (Safe JSON Parsing)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const parse = (input: string) =>\n * // This might throw an error if input is not valid JSON\n * Effect.try(() => JSON.parse(input))\n *\n * // ┌─── Effect<any, UnknownException, never>\n * // ▼\n * const program = parse(\"\")\n *\n * ```\n *\n * **Example** (Custom Error Handling)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const parse = (input: string) =>\n * Effect.try({\n * // JSON.parse may throw for bad input\n * try: () => JSON.parse(input),\n * // remap the error\n * catch: (unknown) => new Error(`something went wrong ${unknown}`)\n * })\n *\n * // ┌─── Effect<any, Error, never>\n * // ▼\n * const program = parse(\"\")\n * ```\n *\n * @see {@link sync} if the effectful computation is synchronous and does not\n * throw errors.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\ntry_ as try };\n/**\n * Returns an effect that maps its success using the specified side-effecting\n * `try` function, converting any errors into typed failed effects using the\n * `catch` function.\n *\n * @see {@link tryPromise} for a version that works with asynchronous computations.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const tryMap = effect.tryMap;\n/**\n * Returns an effect that maps its success using the specified side-effecting\n * `try` function, converting any promise rejections into typed failed effects\n * using the `catch` function.\n *\n * An optional `AbortSignal` can be provided to allow for interruption of the\n * wrapped `Promise` API.\n *\n * @see {@link tryMap} for a version that works with synchronous computations.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const tryMapPromise = effect.tryMapPromise;\n/**\n * Creates an `Effect` that represents an asynchronous computation that might\n * fail.\n *\n * **When to Use**\n *\n * In situations where you need to perform asynchronous operations that might\n * fail, such as fetching data from an API, you can use the `tryPromise`\n * constructor. This constructor is designed to handle operations that could\n * throw exceptions by capturing those exceptions and transforming them into\n * manageable errors.\n *\n * **Error Handling**\n *\n * There are two ways to handle errors with `tryPromise`:\n *\n * 1. If you don't provide a `catch` function, the error is caught and the\n * effect fails with an `UnknownException`.\n * 2. If you provide a `catch` function, the error is caught and the `catch`\n * function maps it to an error of type `E`.\n *\n * **Interruptions**\n *\n * An optional `AbortSignal` can be provided to allow for interruption of the\n * wrapped `Promise` API.\n *\n * **Example** (Fetching a TODO Item)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const getTodo = (id: number) =>\n * // Will catch any errors and propagate them as UnknownException\n * Effect.tryPromise(() =>\n * fetch(`https://jsonplaceholder.typicode.com/todos/${id}`)\n * )\n *\n * // ┌─── Effect<Response, UnknownException, never>\n * // ▼\n * const program = getTodo(1)\n * ```\n *\n * **Example** (Custom Error Handling)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const getTodo = (id: number) =>\n * Effect.tryPromise({\n * try: () => fetch(`https://jsonplaceholder.typicode.com/todos/${id}`),\n * // remap the error\n * catch: (unknown) => new Error(`something went wrong ${unknown}`)\n * })\n *\n * // ┌─── Effect<Response, Error, never>\n * // ▼\n * const program = getTodo(1)\n * ```\n *\n * @see {@link promise} if the effectful computation is asynchronous and does not throw errors.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const tryPromise = effect.tryPromise;\n/**\n * The `unsandbox` function is used to revert an effect that has been\n * sandboxed by {@link sandbox}. When you apply `unsandbox`, the\n * effect's error channel is restored to its original state, without the\n * detailed `Cause<E>` information. This means that any underlying causes of\n * errors, defects, or fiber interruptions are no longer exposed in the error\n * channel.\n *\n * This function is useful when you want to remove the detailed error tracking\n * provided by `sandbox` and return to the standard error handling for\n * your effect. Once unsandboxed, the effect behaves as if `sandbox` was\n * never applied.\n *\n * @see {@link sandbox} to expose the full cause of failures, defects, or interruptions.\n *\n * @since 2.0.0\n * @category Error handling\n */\nexport const unsandbox = effect.unsandbox;\n/**\n * Allows interruption of the current fiber, even in uninterruptible regions.\n *\n * **Details**\n *\n * This effect checks whether any other fibers are attempting to interrupt the\n * current fiber. If so, it allows the current fiber to perform a\n * self-interruption.\n *\n * **When to Use**\n *\n * This is useful in situations where you want to allow interruption to happen\n * even in regions of the code that are normally uninterruptible.\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const allowInterrupt = effect.allowInterrupt;\n/**\n * Checks if interruption is allowed and executes a callback accordingly.\n *\n * **Details**\n *\n * This function checks the current interrupt status of the running fiber. It\n * then calls the provided callback, passing a boolean indicating whether\n * interruption is allowed.\n *\n * **When to Use**\n *\n * This is useful for handling specific logic based on whether the current\n * operation can be interrupted, such as when performing asynchronous operations\n * or handling cancellation.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * yield* Effect.checkInterruptible((isInterruptible) => {\n * if (isInterruptible) {\n * return Console.log(\"You can interrupt this operation.\")\n * } else {\n * return Console.log(\"This operation cannot be interrupted.\")\n * }\n * })\n * })\n *\n * Effect.runPromise(program)\n * // Output: You can interrupt this operation.\n *\n * Effect.runPromise(program.pipe(Effect.uninterruptible))\n * // Output: This operation cannot be interrupted.\n *\n * ```\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const checkInterruptible = core.checkInterruptible;\n/**\n * Provides a way to handle timeouts in uninterruptible effects, allowing them\n * to continue in the background while the main control flow proceeds with the\n * timeout error.\n *\n * **Details**\n *\n * The `disconnect` function allows an uninterruptible effect to continue\n * running in the background, while enabling the main control flow to\n * immediately recognize a timeout condition. This is useful when you want to\n * avoid blocking the program due to long-running tasks, especially when those\n * tasks do not need to affect the flow of the rest of the program.\n *\n * Without `disconnect`, an uninterruptible effect will ignore the\n * timeout and continue executing until it completes. The timeout error will\n * only be assessed after the effect finishes, which can cause delays in\n * recognizing a timeout.\n *\n * With `disconnect`, the uninterruptible effect proceeds in the\n * background while the main program flow can immediately handle the timeout\n * error or trigger alternative logic. This enables faster timeout handling\n * without waiting for the completion of the long-running task.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const longRunningTask = Effect.gen(function* () {\n * console.log(\"Start heavy processing...\")\n * yield* Effect.sleep(\"5 seconds\") // Simulate a long process\n * console.log(\"Heavy processing done.\")\n * return \"Data processed\"\n * })\n *\n * const timedEffect = longRunningTask.pipe(\n * Effect.uninterruptible,\n * // Allows the task to finish in the background if it times out\n * Effect.disconnect,\n * Effect.timeout(\"1 second\")\n * )\n *\n * Effect.runPromiseExit(timedEffect).then(console.log)\n * // Output:\n * // Start heavy processing...\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Fail',\n * // failure: { _tag: 'TimeoutException' }\n * // }\n * // }\n * // Heavy processing done.\n * ```\n *\n * @see {@link timeout} for a version that interrupts the effect.\n * @see {@link uninterruptible} for creating an uninterruptible effect.\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const disconnect = fiberRuntime.disconnect;\n/**\n * Represents an effect that interrupts the current fiber.\n *\n * **Details**\n *\n * This effect models the explicit interruption of the fiber in which it runs.\n * When executed, it causes the fiber to stop its operation immediately,\n * capturing the interruption details such as the fiber's ID and its start time.\n * The resulting interruption can be observed in the `Exit` type if the effect\n * is run with functions like {@link runPromiseExit}.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.gen(function* () {\n * console.log(\"start\")\n * yield* Effect.sleep(\"2 seconds\")\n * yield* Effect.interrupt\n * console.log(\"done\")\n * return \"some result\"\n * })\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // start\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Interrupt',\n * // fiberId: {\n * // _id: 'FiberId',\n * // _tag: 'Runtime',\n * // id: 0,\n * // startTimeMillis: ...\n * // }\n * // }\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const interrupt = core.interrupt;\n/**\n * @since 2.0.0\n * @category Interruption\n */\nexport const interruptWith = core.interruptWith;\n/**\n * Marks an effect as interruptible.\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const interruptible = core.interruptible;\n/**\n * This function behaves like {@link interruptible}, but it also provides a\n * `restore` function. This function can be used to restore the interruptibility\n * of any specific region of code.\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const interruptibleMask = core.interruptibleMask;\n/**\n * Registers a cleanup effect to run when an effect is interrupted.\n *\n * **Details**\n *\n * This function allows you to specify an effect to run when the fiber is\n * interrupted. This effect will be executed when the fiber is interrupted,\n * allowing you to perform cleanup or other actions.\n *\n * **Example** (Running a Cleanup Action on Interruption)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * // This handler is executed when the fiber is interrupted\n * const handler = Effect.onInterrupt((_fibers) => Console.log(\"Cleanup completed\"))\n *\n * const success = Console.log(\"Task completed\").pipe(Effect.as(\"some result\"), handler)\n *\n * Effect.runFork(success)\n * // Output:\n * // Task completed\n *\n * const failure = Console.log(\"Task failed\").pipe(Effect.andThen(Effect.fail(\"some error\")), handler)\n *\n * Effect.runFork(failure)\n * // Output:\n * // Task failed\n *\n * const interruption = Console.log(\"Task interrupted\").pipe(Effect.andThen(Effect.interrupt), handler)\n *\n * Effect.runFork(interruption)\n * // Output:\n * // Task interrupted\n * // Cleanup completed\n * ```\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const onInterrupt = core.onInterrupt;\n/**\n * Marks an effect as uninterruptible.\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const uninterruptible = core.uninterruptible;\n/**\n * This function behaves like {@link uninterruptible}, but it also provides a\n * `restore` function. This function can be used to restore the interruptibility\n * of any specific region of code.\n *\n * @since 2.0.0\n * @category Interruption\n */\nexport const uninterruptibleMask = core.uninterruptibleMask;\n/**\n * Transforms a `Predicate` function into an `Effect` returning the input value if the predicate returns `true`\n * or failing with specified error if the predicate fails\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const isPositive = (n: number): boolean => n > 0\n *\n * // succeeds with `1`\n * Effect.liftPredicate(1, isPositive, n => `${n} is not positive`)\n *\n * // fails with `\"0 is not positive\"`\n * Effect.liftPredicate(0, isPositive, n => `${n} is not positive`)\n * ```\n *\n * @category Condition Checking\n * @since 3.4.0\n */\nexport const liftPredicate = effect.liftPredicate;\n/**\n * Replaces the value inside an effect with a constant value.\n *\n * **Details**\n *\n * This function allows you to ignore the original value inside an effect and\n * replace it with a constant value.\n *\n * **When to Use**\n *\n * It is useful when you no longer need the value produced by an effect but want\n * to ensure that the effect completes successfully with a specific constant\n * result instead. For instance, you can replace the value produced by a\n * computation with a predefined value, ignoring what was calculated before.\n *\n * **Example** (Replacing a Value)\n *\n * ```ts\n * import { pipe, Effect } from \"effect\"\n *\n * // Replaces the value 5 with the constant \"new value\"\n * const program = pipe(Effect.succeed(5), Effect.as(\"new value\"))\n *\n * Effect.runPromise(program).then(console.log)\n * // Output: \"new value\"\n * ```\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const as = core.as;\n/**\n * This function maps the success value of an `Effect` value to a `Some` value\n * in an `Option` value. If the original `Effect` value fails, the returned\n * `Effect` value will also fail.\n *\n * @category Mapping\n * @since 2.0.0\n */\nexport const asSome = effect.asSome;\n/**\n * This function maps the error value of an `Effect` value to a `Some` value\n * in an `Option` value. If the original `Effect` value succeeds, the returned\n * `Effect` value will also succeed.\n *\n * @category Mapping\n * @since 2.0.0\n */\nexport const asSomeError = effect.asSomeError;\n/**\n * This function maps the success value of an `Effect` value to `void`. If the\n * original `Effect` value succeeds, the returned `Effect` value will also\n * succeed. If the original `Effect` value fails, the returned `Effect` value\n * will fail with the same error.\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const asVoid = core.asVoid;\n/**\n * Swaps the success and error channels of an effect.\n *\n * **Details**\n *\n * This function reverses the flow of an effect by swapping its success and\n * error channels. The success value becomes an error, and the error value\n * becomes a success.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, string, never>\n * // ▼\n * const program = Effect.fail(\"Oh uh!\").pipe(Effect.as(2))\n *\n * // ┌─── Effect<string, number, never>\n * // ▼\n * const flipped = Effect.flip(program)\n * ```\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const flip = core.flip;\n/**\n * Swaps the error/value parameters, applies the function `f` and flips the\n * parameters back\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const flipWith = effect.flipWith;\n/**\n * Transforms the value inside an effect by applying a function to it.\n *\n * **Syntax**\n *\n * ```ts skip-type-checking\n * const mappedEffect = pipe(myEffect, Effect.map(transformation))\n * // or\n * const mappedEffect = Effect.map(myEffect, transformation)\n * // or\n * const mappedEffect = myEffect.pipe(Effect.map(transformation))\n * ```\n *\n * **Details**\n *\n * `map` takes a function and applies it to the value contained within an\n * effect, creating a new effect with the transformed value.\n *\n * It's important to note that effects are immutable, meaning that the original\n * effect is not modified. Instead, a new effect is returned with the updated\n * value.\n *\n * **Example** (Adding a Service Charge)\n *\n * ```ts\n * import { pipe, Effect } from \"effect\"\n *\n * const addServiceCharge = (amount: number) => amount + 1\n *\n * const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))\n *\n * const finalAmount = pipe(\n * fetchTransactionAmount,\n * Effect.map(addServiceCharge)\n * )\n *\n * Effect.runPromise(finalAmount).then(console.log)\n * // Output: 101\n * ```\n *\n * @see {@link mapError} for a version that operates on the error channel.\n * @see {@link mapBoth} for a version that operates on both channels.\n * @see {@link flatMap} or {@link andThen} for a version that can return a new effect.\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const map = core.map;\n/**\n * Applies a stateful transformation to each element of a collection, producing\n * new elements along with an updated state.\n *\n * **When to Use**\n *\n * Use `mapAccum` when you need to process each element of a collection while\n * keeping track of some state across iterations.\n *\n * **Details**\n *\n * `mapAccum` takes an initial state (`initial`) and a function (`f`) that is\n * applied to each element. This function returns a new state and a transformed\n * element. The final effect produces both the accumulated state and the\n * transformed collection.\n *\n * If the input collection is a non-empty array, the return type will match the\n * input collection type.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Define an initial state and a transformation function\n * const initialState = 0\n *\n * const transformation = (state: number, element: string) =>\n * Effect.succeed<[number, string]>([state + element.length, element.toUpperCase()])\n *\n * // Apply mapAccum to transform an array of strings\n * const program = Effect.mapAccum([\"a\", \"bb\", \"ccc\"], initialState, transformation)\n *\n * Effect.runPromise(program).then(([finalState, transformedCollection]) => {\n * console.log(finalState)\n * console.log(transformedCollection)\n * })\n * // Output:\n * // 6\n * // [ 'A', 'BB', 'CCC' ]\n * ```\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const mapAccum = effect.mapAccum;\n/**\n * Applies transformations to both the success and error channels of an effect.\n *\n * **Details**\n *\n * This function takes two map functions as arguments: one for the error channel\n * and one for the success channel. You can use it when you want to modify both\n * the error and the success values without altering the overall success or\n * failure status of the effect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, string, never>\n * // ▼\n * const simulatedTask = Effect.fail(\"Oh no!\").pipe(Effect.as(1))\n *\n * // ┌─── Effect<boolean, Error, never>\n * // ▼\n * const modified = Effect.mapBoth(simulatedTask, {\n * onFailure: (message) => new Error(message),\n * onSuccess: (n) => n > 0\n * })\n * ```\n *\n * @see {@link map} for a version that operates on the success channel.\n * @see {@link mapError} for a version that operates on the error channel.\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const mapBoth = core.mapBoth;\n/**\n * Transforms or modifies the error produced by an effect without affecting its\n * success value.\n *\n * **When to Use**\n *\n * This function is helpful when you want to enhance the error with additional\n * information, change the error type, or apply custom error handling while\n * keeping the original behavior of the effect's success values intact. It only\n * operates on the error channel and leaves the success channel unchanged.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, string, never>\n * // ▼\n * const simulatedTask = Effect.fail(\"Oh no!\").pipe(Effect.as(1))\n *\n * // ┌─── Effect<number, Error, never>\n * // ▼\n * const mapped = Effect.mapError(\n * simulatedTask,\n * (message) => new Error(message)\n * )\n * ```\n *\n * @see {@link map} for a version that operates on the success channel.\n * @see {@link mapBoth} for a version that operates on both channels.\n * @see {@link orElseFail} if you want to replace the error with a new one.\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const mapError = core.mapError;\n/**\n * Maps the cause of failure of an effect using a specified function.\n *\n * @see {@link sandbox} for a version that exposes the full cause of failures, defects, or interruptions.\n * @see {@link catchAllCause} for a version that can recover from all types of defects.\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const mapErrorCause = effect.mapErrorCause;\n/**\n * Combines both success and error channels of an effect into a single outcome.\n *\n * **Details**\n *\n * This function transforms an effect that may fail into one that always returns\n * a value, where both success and failure outcomes are handled as values in the\n * success channel.\n *\n * **When to Use**\n *\n * This can be useful when you want to continue execution regardless of the\n * error type and still capture both successful results and errors as part of\n * the outcome.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, string, never>\n * // ▼\n * const program = Effect.fail(\"Oh uh!\").pipe(Effect.as(2))\n *\n * // ┌─── Effect<number | string, never, never>\n * // ▼\n * const recovered = Effect.merge(program)\n * ```\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const merge = effect.merge;\n/**\n * Returns a new effect with the boolean value of this effect negated.\n *\n * @since 2.0.0\n * @category Mapping\n */\nexport const negate = effect.negate;\n/**\n * Creates a scoped resource using an `acquire` and `release` effect.\n *\n * **Details**\n *\n * This function helps manage resources by combining two `Effect` values: one\n * for acquiring the resource and one for releasing it.\n *\n * `acquireRelease` does the following:\n *\n * 1. Ensures that the effect that acquires the resource will not be\n * interrupted. Note that acquisition may still fail due to internal\n * reasons (such as an uncaught exception).\n * 2. Ensures that the `release` effect will not be interrupted, and will be\n * executed as long as the acquisition effect successfully acquires the\n * resource.\n *\n * If the `acquire` function succeeds, the `release` function is added to the\n * list of finalizers for the scope. This ensures that the release will happen\n * automatically when the scope is closed.\n *\n * Both `acquire` and `release` run uninterruptibly, meaning they cannot be\n * interrupted while they are executing.\n *\n * Additionally, the `release` function can be influenced by the exit value when\n * the scope closes, allowing for custom handling of how the resource is\n * released based on the execution outcome.\n *\n * **When to Use**\n *\n * This function is used to ensure that an effect that represents the\n * acquisition of a resource (for example, opening a file, launching a thread,\n * etc.) will not be interrupted, and that the resource will always be released\n * when the `Effect` completes execution.\n *\n * **Example** (Defining a Simple Resource)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Define an interface for a resource\n * interface MyResource {\n * readonly contents: string\n * readonly close: () => Promise<void>\n * }\n *\n * // Simulate resource acquisition\n * const getMyResource = (): Promise<MyResource> =>\n * Promise.resolve({\n * contents: \"lorem ipsum\",\n * close: () =>\n * new Promise((resolve) => {\n * console.log(\"Resource released\")\n * resolve()\n * })\n * })\n *\n * // Define how the resource is acquired\n * const acquire = Effect.tryPromise({\n * try: () =>\n * getMyResource().then((res) => {\n * console.log(\"Resource acquired\")\n * return res\n * }),\n * catch: () => new Error(\"getMyResourceError\")\n * })\n *\n * // Define how the resource is released\n * const release = (res: MyResource) => Effect.promise(() => res.close())\n *\n * // Create the resource management workflow\n * //\n * // ┌─── Effect<MyResource, Error, Scope>\n * // ▼\n * const resource = Effect.acquireRelease(acquire, release)\n * ```\n *\n * @see {@link acquireUseRelease} for a version that automatically handles the scoping of resources.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const acquireRelease = fiberRuntime.acquireRelease;\n/**\n * Creates a scoped resource with an interruptible acquire action.\n *\n * **Details**\n *\n * This function is similar to {@link acquireRelease}, but it allows the\n * acquisition of the resource to be interrupted. The `acquire` effect, which\n * represents the process of obtaining the resource, can be interrupted if\n * necessary.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const acquireReleaseInterruptible = fiberRuntime.acquireReleaseInterruptible;\n/**\n * Many real-world operations involve working with resources that must be released when no longer needed, such as:\n *\n * - Database connections\n * - File handles\n * - Network requests\n *\n * This function ensures that a resource is:\n *\n * 1. **Acquired** properly.\n * 2. **Used** for its intended purpose.\n * 3. **Released** even if an error occurs.\n *\n * **Example** (Automatically Managing Resource Lifetime)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // Define an interface for a resource\n * interface MyResource {\n * readonly contents: string\n * readonly close: () => Promise<void>\n * }\n *\n * // Simulate resource acquisition\n * const getMyResource = (): Promise<MyResource> =>\n * Promise.resolve({\n * contents: \"lorem ipsum\",\n * close: () =>\n * new Promise((resolve) => {\n * console.log(\"Resource released\")\n * resolve()\n * })\n * })\n *\n * // Define how the resource is acquired\n * const acquire = Effect.tryPromise({\n * try: () =>\n * getMyResource().then((res) => {\n * console.log(\"Resource acquired\")\n * return res\n * }),\n * catch: () => new Error(\"getMyResourceError\")\n * })\n *\n * // Define how the resource is released\n * const release = (res: MyResource) => Effect.promise(() => res.close())\n *\n * const use = (res: MyResource) => Console.log(`content is ${res.contents}`)\n *\n * // ┌─── Effect<void, Error, never>\n * // ▼\n * const program = Effect.acquireUseRelease(acquire, use, release)\n *\n * Effect.runPromise(program)\n * // Output:\n * // Resource acquired\n * // content is lorem ipsum\n * // Resource released\n * ```\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const acquireUseRelease = core.acquireUseRelease;\n/**\n * Ensures a finalizer is added to the scope of the calling effect, guaranteeing\n * it runs when the scope is closed.\n *\n * **Details**\n *\n * This function adds a finalizer that will execute whenever the scope of the\n * effect is closed, regardless of whether the effect succeeds, fails, or is\n * interrupted. The finalizer receives the `Exit` value of the effect's scope,\n * allowing it to react differently depending on how the effect concludes.\n *\n * Finalizers are a reliable way to manage resource cleanup, ensuring that\n * resources such as file handles, network connections, or database transactions\n * are properly closed even in the event of an unexpected interruption or error.\n *\n * Finalizers operate in conjunction with Effect's scoped resources. If an\n * effect with a finalizer is wrapped in a scope, the finalizer will execute\n * automatically when the scope ends.\n *\n * **Example** (Adding a Finalizer on Success)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<string, never, Scope>\n * // ▼\n * const program = Effect.gen(function* () {\n * yield* Effect.addFinalizer((exit) =>\n * Console.log(`Finalizer executed. Exit status: ${exit._tag}`)\n * )\n * return \"some result\"\n * })\n *\n * // Wrapping the effect in a scope\n * //\n * // ┌─── Effect<string, never, never>\n * // ▼\n * const runnable = Effect.scoped(program)\n *\n * Effect.runPromiseExit(runnable).then(console.log)\n * // Output:\n * // Finalizer executed. Exit status: Success\n * // { _id: 'Exit', _tag: 'Success', value: 'some result' }\n * ```\n *\n * **Example** (Adding a Finalizer on Failure)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<never, string, Scope>\n * // ▼\n * const program = Effect.gen(function* () {\n * yield* Effect.addFinalizer((exit) =>\n * Console.log(`Finalizer executed. Exit status: ${exit._tag}`)\n * )\n * return yield* Effect.fail(\"Uh oh!\")\n * })\n *\n * // Wrapping the effect in a scope\n * //\n * // ┌─── Effect<never, string, never>\n * // ▼\n * const runnable = Effect.scoped(program)\n *\n * Effect.runPromiseExit(runnable).then(console.log)\n * // Output:\n * // Finalizer executed. Exit status: Failure\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'Uh oh!' }\n * // }\n * ```\n *\n * **Example** (Adding a Finalizer on Interruption)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // ┌─── Effect<never, never, Scope>\n * // ▼\n * const program = Effect.gen(function* () {\n * yield* Effect.addFinalizer((exit) =>\n * Console.log(`Finalizer executed. Exit status: ${exit._tag}`)\n * )\n * return yield* Effect.interrupt\n * })\n *\n * // Wrapping the effect in a scope\n * //\n * // ┌─── Effect<never, never, never>\n * // ▼\n * const runnable = Effect.scoped(program)\n *\n * Effect.runPromiseExit(runnable).then(console.log)\n * // Output:\n * // Finalizer executed. Exit status: Failure\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Interrupt',\n * // fiberId: {\n * // _id: 'FiberId',\n * // _tag: 'Runtime',\n * // id: 0,\n * // startTimeMillis: ...\n * // }\n * // }\n * // }\n * ```\n *\n * @see {@link onExit} for attaching a finalizer directly to an effect.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const addFinalizer = fiberRuntime.addFinalizer;\n/**\n * Guarantees the execution of a finalizer when an effect starts execution.\n *\n * **Details**\n *\n * This function allows you to specify a `finalizer` effect that will always be\n * run once the effect starts execution, regardless of whether the effect\n * succeeds, fails, or is interrupted.\n *\n * **When to Use**\n *\n * This is useful when you need to ensure that certain cleanup or final steps\n * are executed in all cases, such as releasing resources or performing\n * necessary logging.\n *\n * While this function provides strong guarantees about executing the finalizer,\n * it is considered a low-level tool, which may not be ideal for more complex\n * resource management. For higher-level resource management with automatic\n * acquisition and release, see the {@link acquireRelease} family of functions.\n * For use cases where you need access to the result of an effect, consider\n * using {@link onExit}.\n *\n * **Example** (Running a Finalizer in All Outcomes)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * // Define a cleanup effect\n * const handler = Effect.ensuring(Console.log(\"Cleanup completed\"))\n *\n * // Define a successful effect\n * const success = Console.log(\"Task completed\").pipe(\n * Effect.as(\"some result\"),\n * handler\n * )\n *\n * Effect.runFork(success)\n * // Output:\n * // Task completed\n * // Cleanup completed\n *\n * // Define a failing effect\n * const failure = Console.log(\"Task failed\").pipe(\n * Effect.andThen(Effect.fail(\"some error\")),\n * handler\n * )\n *\n * Effect.runFork(failure)\n * // Output:\n * // Task failed\n * // Cleanup completed\n *\n * // Define an interrupted effect\n * const interruption = Console.log(\"Task interrupted\").pipe(\n * Effect.andThen(Effect.interrupt),\n * handler\n * )\n *\n * Effect.runFork(interruption)\n * // Output:\n * // Task interrupted\n * // Cleanup completed\n * ```\n *\n * @see {@link onExit} for a version that provides access to the result of an\n * effect.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const ensuring = fiberRuntime.ensuring;\n/**\n * Ensures a cleanup effect runs whenever the calling effect fails, providing\n * the failure cause to the cleanup effect.\n *\n * **Details**\n *\n * This function allows you to attach a cleanup effect that runs whenever the\n * calling effect fails. The cleanup effect receives the cause of the failure,\n * allowing you to perform actions such as logging, releasing resources, or\n * executing additional recovery logic based on the error. The cleanup effect\n * will execute even if the failure is due to interruption.\n *\n * Importantly, the cleanup effect itself is uninterruptible, ensuring that it\n * completes regardless of external interruptions.\n *\n * **Example** (Running Cleanup Only on Failure)\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * // This handler logs the failure cause when the effect fails\n * const handler = Effect.onError((cause) =>\n * Console.log(`Cleanup completed: ${cause}`)\n * )\n *\n * // Define a successful effect\n * const success = Console.log(\"Task completed\").pipe(\n * Effect.as(\"some result\"),\n * handler\n * )\n *\n * Effect.runFork(success)\n * // Output:\n * // Task completed\n *\n * // Define a failing effect\n * const failure = Console.log(\"Task failed\").pipe(\n * Effect.andThen(Effect.fail(\"some error\")),\n * handler\n * )\n *\n * Effect.runFork(failure)\n * // Output:\n * // Task failed\n * // Cleanup completed: Error: some error\n *\n * // Define a failing effect\n * const defect = Console.log(\"Task failed with defect\").pipe(\n * Effect.andThen(Effect.die(\"Boom!\")),\n * handler\n * )\n *\n * Effect.runFork(defect)\n * // Output:\n * // Task failed with defect\n * // Cleanup completed: Error: Boom!\n *\n * // Define an interrupted effect\n * const interruption = Console.log(\"Task interrupted\").pipe(\n * Effect.andThen(Effect.interrupt),\n * handler\n * )\n *\n * Effect.runFork(interruption)\n * // Output:\n * // Task interrupted\n * // Cleanup completed: All fibers interrupted without errors.\n * ```\n *\n * @see {@link ensuring} for attaching a cleanup effect that runs on both success and failure.\n * @see {@link onExit} for attaching a cleanup effect that runs on all possible exits.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const onError = core.onError;\n/**\n * Guarantees that a cleanup function runs regardless of whether the effect\n * succeeds, fails, or is interrupted.\n *\n * **Details**\n *\n * This function ensures that a provided cleanup function is executed after the\n * effect completes, regardless of the outcome. The cleanup function is given\n * the `Exit` value of the effect, which provides detailed information about the\n * result:\n * - If the effect succeeds, the `Exit` contains the success value.\n * - If the effect fails, the `Exit` contains the error or failure cause.\n * - If the effect is interrupted, the `Exit` reflects the interruption.\n *\n * The cleanup function is guaranteed to run uninterruptibly, ensuring reliable\n * resource management even in complex or high-concurrency scenarios.\n *\n * **Example** (Running a Cleanup Function with the Effect’s Result)\n *\n * ```ts\n * import { Console, Effect, Exit } from \"effect\"\n *\n * // Define a cleanup effect that logs the result\n * const handler = Effect.onExit((exit) =>\n * Console.log(`Cleanup completed: ${Exit.getOrElse(exit, String)}`)\n * )\n *\n * // Define a successful effect\n * const success = Console.log(\"Task completed\").pipe(\n * Effect.as(\"some result\"),\n * handler\n * )\n *\n * Effect.runFork(success)\n * // Output:\n * // Task completed\n * // Cleanup completed: some result\n *\n * // Define a failing effect\n * const failure = Console.log(\"Task failed\").pipe(\n * Effect.andThen(Effect.fail(\"some error\")),\n * handler\n * )\n *\n * Effect.runFork(failure)\n * // Output:\n * // Task failed\n * // Cleanup completed: Error: some error\n *\n * // Define an interrupted effect\n * const interruption = Console.log(\"Task interrupted\").pipe(\n * Effect.andThen(Effect.interrupt),\n * handler\n * )\n *\n * Effect.runFork(interruption)\n * // Output:\n * // Task interrupted\n * // Cleanup completed: All fibers interrupted without errors.\n * ```\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const onExit = core.onExit;\n/**\n * Ensures that finalizers are run concurrently when the scope of an effect is\n * closed.\n *\n * **Details**\n *\n * This function modifies the behavior of finalizers within a scoped workflow to\n * allow them to run concurrently when the scope is closed.\n *\n * By default, finalizers are executed sequentially in reverse order of their\n * addition, but this function changes that behavior to execute all finalizers\n * concurrently.\n *\n * **When to Use**\n *\n * Running finalizers concurrently can improve performance when multiple\n * independent cleanup tasks need to be performed. However, it requires that\n * these tasks do not depend on the order of execution or introduce race\n * conditions.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * // Define a program that adds multiple finalizers\n * const program = Effect.gen(function*() {\n * yield* Effect.addFinalizer(() => Console.log(\"Finalizer 1 executed\").pipe(Effect.delay(\"300 millis\")))\n * yield* Effect.addFinalizer(() => Console.log(\"Finalizer 2 executed\").pipe(Effect.delay(\"100 millis\")))\n * yield* Effect.addFinalizer(() => Console.log(\"Finalizer 3 executed\").pipe(Effect.delay(\"200 millis\")))\n * return \"some result\"\n * })\n *\n * // Modify the program to ensure finalizers run in parallel\n * const modified = program.pipe(Effect.parallelFinalizers)\n *\n * const runnable = Effect.scoped(modified)\n *\n * Effect.runFork(runnable)\n * // Output:\n * // Finalizer 2 executed\n * // Finalizer 3 executed\n * // Finalizer 1 executed\n * ```\n *\n * @see {@link sequentialFinalizers} for a version that ensures finalizers are run sequentially.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const parallelFinalizers = fiberRuntime.parallelFinalizers;\n/**\n * Ensures that finalizers are run sequentially in reverse order of their\n * addition.\n *\n * **Details**\n *\n * This function modifies the behavior of finalizers within a scoped workflow to\n * ensure they are run sequentially in reverse order when the scope is closed.\n *\n * By default, finalizers are executed sequentially, so this only changes the\n * behavior if the scope is configured to run finalizers concurrently.\n *\n * @see {@link parallelFinalizers} for a version that ensures finalizers are run concurrently.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const sequentialFinalizers = fiberRuntime.sequentialFinalizers;\n/**\n * Applies a custom execution strategy to finalizers within a scoped workflow.\n *\n * **Details**\n *\n * This function allows you to control how finalizers are executed in a scope by\n * applying a specified `ExecutionStrategy`. The `strategy` can dictate whether\n * finalizers run (e.g., sequentially or in parallel).\n *\n * Additionally, the function provides a `restore` operation, which ensures that\n * the effect passed to it is executed under the default execution strategy.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const finalizersMask = fiberRuntime.finalizersMask;\n/**\n * Provides access to the current scope in a scoped workflow.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const scope = fiberRuntime.scope;\n/**\n * Accesses the current scope and uses it to perform the specified effect.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const scopeWith = fiberRuntime.scopeWith;\n/**\n * Creates a `Scope`, passes it to the specified effectful function, and closes\n * the scope when the effect completes (whether through success, failure, or\n * interruption).\n *\n * @since 3.11.0\n * @category Scoping, Resources & Finalization\n */\nexport const scopedWith = fiberRuntime.scopedWith;\n/**\n * Scopes all resources used in an effect to the lifetime of the effect.\n *\n * **Details**\n *\n * This function ensures that all resources used within an effect are tied to\n * its lifetime. Finalizers for these resources are executed automatically when\n * the effect completes, whether through success, failure, or interruption. This\n * guarantees proper resource cleanup without requiring explicit management.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const scoped = fiberRuntime.scopedEffect;\n/**\n * Scopes all resources acquired by one effect to the lifetime of another\n * effect.\n *\n * **Details**\n *\n * This function allows you to scope the resources acquired by one effect\n * (`self`) to the lifetime of another effect (`use`). This ensures that the\n * resources are cleaned up as soon as the `use` effect completes, regardless of\n * how the `use` effect ends (success, failure, or interruption).\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const acquire = Console.log(\"Acquiring resource\").pipe(\n * Effect.as(1),\n * Effect.tap(Effect.addFinalizer(() => Console.log(\"Releasing resource\")))\n * )\n * const use = (resource: number) => Console.log(`Using resource: ${resource}`)\n *\n * const program = acquire.pipe(Effect.using(use))\n *\n * Effect.runFork(program)\n * // Output:\n * // Acquiring resource\n * // Using resource: 1\n * // Releasing resource\n * ```\n *\n * @see {@link scopedWith} Manage scoped operations with a temporary scope.\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const using = fiberRuntime.using;\n/**\n * Returns the result of the effect and a finalizer to close its scope.\n *\n * **Details**\n *\n * This function allows you to retrieve both the result of an effect and a\n * finalizer that can be used to manually close its scope. This is useful for\n * workflows where you need early access to the result while retaining control\n * over the resource cleanup process.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const acquire = Console.log(\"Acquiring resource\").pipe(\n * Effect.as(1),\n * Effect.tap(Effect.addFinalizer(() => Console.log(\"Releasing resource\")))\n * )\n * const program = Effect.gen(function*() {\n * const [finalizer, resource] = yield* Effect.withEarlyRelease(acquire)\n * console.log(`Using resource: ${resource}`)\n * yield* Effect.sleep(\"1 second\")\n * yield* finalizer\n * })\n *\n * Effect.runFork(program.pipe(Effect.scoped))\n * // Output:\n * // Acquiring resource\n * // Using resource: 1\n * // Releasing resource\n * ```\n *\n * @since 2.0.0\n * @category Scoping, Resources & Finalization\n */\nexport const withEarlyRelease = fiberRuntime.withEarlyRelease;\n/**\n * Returns a new effect that will not succeed with its value before first\n * waiting for the end of all child fibers forked by the effect.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const awaitAllChildren = circular.awaitAllChildren;\n/**\n * Returns a new workflow that will not supervise any fibers forked by this\n * workflow.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const daemonChildren = fiberRuntime.daemonChildren;\n/**\n * Constructs an effect with information about the current `Fiber`.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const descriptor = effect.descriptor;\n/**\n * Constructs an effect based on information about the current `Fiber`.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const descriptorWith = effect.descriptorWith;\n/**\n * Returns a new workflow that executes this one and captures the changes in\n * `FiberRef` values.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const diffFiberRefs = effect.diffFiberRefs;\n/**\n * Acts on the children of this fiber (collected into a single fiber),\n * guaranteeing the specified callback will be invoked, whether or not this\n * effect succeeds.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const ensuringChild = circular.ensuringChild;\n/**\n * Acts on the children of this fiber, guaranteeing the specified callback\n * will be invoked, whether or not this effect succeeds.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const ensuringChildren = circular.ensuringChildren;\n/**\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const fiberId = core.fiberId;\n/**\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const fiberIdWith = core.fiberIdWith;\n/**\n * Creates a new fiber to run an effect concurrently.\n *\n * **Details**\n *\n * This function takes an effect and forks it into a separate fiber, allowing it\n * to run concurrently without blocking the original effect. The new fiber\n * starts execution immediately after being created, and the fiber object is\n * returned immediately without waiting for the effect to begin. This is useful\n * when you want to run tasks concurrently while continuing other tasks in the\n * parent fiber.\n *\n * The forked fiber is attached to the parent fiber's scope. This means that\n * when the parent fiber terminates, the child fiber will also be terminated\n * automatically. This feature, known as \"auto supervision,\" ensures that no\n * fibers are left running unintentionally. If you prefer not to have this auto\n * supervision behavior, you can use {@link forkDaemon} or {@link forkIn}.\n *\n * **When to Use**\n *\n * Use this function when you need to run an effect concurrently without\n * blocking the current execution flow. For example, you might use it to launch\n * background tasks or concurrent computations. However, working with fibers can\n * be complex, so before using this function directly, you might want to explore\n * higher-level functions like {@link raceWith}, {@link zip}, or others that can\n * manage concurrency for you.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const fib = (n: number): Effect.Effect<number> =>\n * n < 2\n * ? Effect.succeed(n)\n * : Effect.zipWith(fib(n - 1), fib(n - 2), (a, b) => a + b)\n *\n * // ┌─── Effect<RuntimeFiber<number, never>, never, never>\n * // ▼\n * const fib10Fiber = Effect.fork(fib(10))\n * ```\n *\n * @see {@link forkWithErrorHandler} for a version that allows you to handle errors.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const fork = fiberRuntime.fork;\n/**\n * Creates a long-running background fiber that is independent of its parent.\n *\n * **Details**\n *\n * This function creates a \"daemon\" fiber that runs in the background and is not\n * tied to the lifecycle of its parent fiber. Unlike normal fibers that stop\n * when the parent fiber terminates, a daemon fiber will continue running until\n * the global scope closes or the fiber completes naturally. This makes it\n * useful for tasks that need to run in the background independently, such as\n * periodic logging, monitoring, or background data processing.\n *\n * **Example** (Creating a Daemon Fiber)\n *\n * ```ts\n * import { Effect, Console, Schedule } from \"effect\"\n *\n * // Daemon fiber that logs a message repeatedly every second\n * const daemon = Effect.repeat(\n * Console.log(\"daemon: still running!\"),\n * Schedule.fixed(\"1 second\")\n * )\n *\n * const parent = Effect.gen(function* () {\n * console.log(\"parent: started!\")\n * // Daemon fiber running independently\n * yield* Effect.forkDaemon(daemon)\n * yield* Effect.sleep(\"3 seconds\")\n * console.log(\"parent: finished!\")\n * })\n *\n * Effect.runFork(parent)\n * // Output:\n * // parent: started!\n * // daemon: still running!\n * // daemon: still running!\n * // daemon: still running!\n * // parent: finished!\n * // daemon: still running!\n * // daemon: still running!\n * // daemon: still running!\n * // daemon: still running!\n * // daemon: still running!\n * // ...etc...\n * ```\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const forkDaemon = fiberRuntime.forkDaemon;\n/**\n * Returns an effect that forks all of the specified values, and returns a\n * composite fiber that produces a list of their results, in order.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const forkAll = circular.forkAll;\n/**\n * Forks an effect in a specific scope, allowing finer control over its\n * execution.\n *\n * **Details**\n *\n * There are some cases where we need more fine-grained control, so we want to\n * fork a fiber in a specific scope. We can use the `Effect.forkIn` operator\n * which takes the target scope as an argument.\n *\n * The fiber will be interrupted when the scope is closed.\n *\n * **Example** (Forking a Fiber in a Specific Scope)\n *\n * In this example, the child fiber is forked into the outerScope,\n * allowing it to outlive the inner scope but still be terminated\n * when the outerScope is closed.\n *\n * ```ts\n * import { Console, Effect, Schedule } from \"effect\"\n *\n * // Child fiber that logs a message repeatedly every second\n * const child = Effect.repeat(\n * Console.log(\"child: still running!\"),\n * Schedule.fixed(\"1 second\")\n * )\n *\n * const program = Effect.scoped(\n * Effect.gen(function* () {\n * yield* Effect.addFinalizer(() =>\n * Console.log(\"The outer scope is about to be closed!\")\n * )\n *\n * // Capture the outer scope\n * const outerScope = yield* Effect.scope\n *\n * // Create an inner scope\n * yield* Effect.scoped(\n * Effect.gen(function* () {\n * yield* Effect.addFinalizer(() =>\n * Console.log(\"The inner scope is about to be closed!\")\n * )\n * // Fork the child fiber in the outer scope\n * yield* Effect.forkIn(child, outerScope)\n * yield* Effect.sleep(\"3 seconds\")\n * })\n * )\n *\n * yield* Effect.sleep(\"5 seconds\")\n * })\n * )\n *\n * Effect.runFork(program)\n * // Output:\n * // child: still running!\n * // child: still running!\n * // child: still running!\n * // The inner scope is about to be closed!\n * // child: still running!\n * // child: still running!\n * // child: still running!\n * // child: still running!\n * // child: still running!\n * // child: still running!\n * // The outer scope is about to be closed!\n * ```\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const forkIn = circular.forkIn;\n/**\n * Forks a fiber in a local scope, ensuring it outlives its parent.\n *\n * **Details**\n *\n * This function is used to create fibers that are tied to a local scope,\n * meaning they are not dependent on their parent fiber's lifecycle. Instead,\n * they will continue running until the scope they were created in is closed.\n * This is particularly useful when you need a fiber to run independently of the\n * parent fiber, but still want it to be terminated when the scope ends.\n *\n * Fibers created with this function are isolated from the parent fiber’s\n * termination, so they can run for a longer period. This behavior is different\n * from fibers created with {@link fork}, which are terminated when the parent fiber\n * terminates. With `forkScoped`, the child fiber will keep running until the\n * local scope ends, regardless of the state of the parent fiber.\n *\n * **Example** (Forking a Fiber in a Local Scope)\n *\n * In this example, the child fiber continues to run beyond the lifetime of the parent fiber.\n * The child fiber is tied to the local scope and will be terminated only when the scope ends.\n *\n * ```ts\n * import { Effect, Console, Schedule } from \"effect\"\n *\n * // Child fiber that logs a message repeatedly every second\n * const child = Effect.repeat(\n * Console.log(\"child: still running!\"),\n * Schedule.fixed(\"1 second\")\n * )\n *\n * // ┌─── Effect<void, never, Scope>\n * // ▼\n * const parent = Effect.gen(function* () {\n * console.log(\"parent: started!\")\n * // Child fiber attached to local scope\n * yield* Effect.forkScoped(child)\n * yield* Effect.sleep(\"3 seconds\")\n * console.log(\"parent: finished!\")\n * })\n *\n * // Program runs within a local scope\n * const program = Effect.scoped(\n * Effect.gen(function* () {\n * console.log(\"Local scope started!\")\n * yield* Effect.fork(parent)\n * // Scope lasts for 5 seconds\n * yield* Effect.sleep(\"5 seconds\")\n * console.log(\"Leaving the local scope!\")\n * })\n * )\n *\n * Effect.runFork(program)\n * // Output:\n * // Local scope started!\n * // parent: started!\n * // child: still running!\n * // child: still running!\n * // child: still running!\n * // parent: finished!\n * // child: still running!\n * // child: still running!\n * // Leaving the local scope!\n * ```\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const forkScoped = circular.forkScoped;\n/**\n * Like {@link fork} but handles an error with the provided handler.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const forkWithErrorHandler = fiberRuntime.forkWithErrorHandler;\n/**\n * Creates an `Effect` value that represents the exit value of the specified\n * fiber.\n *\n * @see {@link fromFiberEffect} for creating an effect from a fiber obtained from an effect.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const fromFiber = circular.fromFiber;\n/**\n * Creates an `Effect` value that represents the exit value of a fiber obtained\n * from an effect.\n *\n * @see {@link fromFiber} for creating an effect from a fiber.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const fromFiberEffect = circular.fromFiberEffect;\n/**\n * Supervises child fibers by reporting them to a specified supervisor.\n *\n * **Details**\n *\n * This function takes a supervisor as an argument and returns an effect where\n * all child fibers forked within it are supervised by the provided supervisor.\n * This enables you to capture detailed information about these child fibers,\n * such as their status, through the supervisor.\n *\n * **Example** (Monitoring Fiber Count)\n *\n * ```ts\n * import { Effect, Supervisor, Schedule, Fiber, FiberStatus } from \"effect\"\n *\n * // Main program that monitors fibers while calculating a Fibonacci number\n * const program = Effect.gen(function* () {\n * // Create a supervisor to track child fibers\n * const supervisor = yield* Supervisor.track\n *\n * // Start a Fibonacci calculation, supervised by the supervisor\n * const fibFiber = yield* fib(20).pipe(\n * Effect.supervised(supervisor),\n * // Fork the Fibonacci effect into a fiber\n * Effect.fork\n * )\n *\n * // Define a schedule to periodically monitor the fiber count every 500ms\n * const policy = Schedule.spaced(\"500 millis\").pipe(\n * Schedule.whileInputEffect((_) =>\n * Fiber.status(fibFiber).pipe(\n * // Continue while the Fibonacci fiber is not done\n * Effect.andThen((status) => status !== FiberStatus.done)\n * )\n * )\n * )\n *\n * // Start monitoring the fibers, using the supervisor to track the count\n * const monitorFiber = yield* monitorFibers(supervisor).pipe(\n * // Repeat the monitoring according to the schedule\n * Effect.repeat(policy),\n * // Fork the monitoring into its own fiber\n * Effect.fork\n * )\n *\n * // Join the monitor and Fibonacci fibers to ensure they complete\n * yield* Fiber.join(monitorFiber)\n * const result = yield* Fiber.join(fibFiber)\n *\n * console.log(`fibonacci result: ${result}`)\n * })\n *\n * // Function to monitor and log the number of active fibers\n * const monitorFibers = (\n * supervisor: Supervisor.Supervisor<Array<Fiber.RuntimeFiber<any, any>>>\n * ): Effect.Effect<void> =>\n * Effect.gen(function* () {\n * const fibers = yield* supervisor.value // Get the current set of fibers\n * console.log(`number of fibers: ${fibers.length}`)\n * })\n *\n * // Recursive Fibonacci calculation, spawning fibers for each recursive step\n * const fib = (n: number): Effect.Effect<number> =>\n * Effect.gen(function* () {\n * if (n <= 1) {\n * return 1\n * }\n * yield* Effect.sleep(\"500 millis\") // Simulate work by delaying\n *\n * // Fork two fibers for the recursive Fibonacci calls\n * const fiber1 = yield* Effect.fork(fib(n - 2))\n * const fiber2 = yield* Effect.fork(fib(n - 1))\n *\n * // Join the fibers to retrieve their results\n * const v1 = yield* Fiber.join(fiber1)\n * const v2 = yield* Fiber.join(fiber2)\n *\n * return v1 + v2 // Combine the results\n * })\n *\n * Effect.runPromise(program)\n * // Output:\n * // number of fibers: 0\n * // number of fibers: 2\n * // number of fibers: 6\n * // number of fibers: 14\n * // number of fibers: 30\n * // number of fibers: 62\n * // number of fibers: 126\n * // number of fibers: 254\n * // number of fibers: 510\n * // number of fibers: 1022\n * // number of fibers: 2034\n * // number of fibers: 3795\n * // number of fibers: 5810\n * // number of fibers: 6474\n * // number of fibers: 4942\n * // number of fibers: 2515\n * // number of fibers: 832\n * // number of fibers: 170\n * // number of fibers: 18\n * // number of fibers: 0\n * // fibonacci result: 10946\n * ```\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const supervised = circular.supervised;\n/**\n * Transplants specified effects so that when those effects fork other\n * effects, the forked effects will be governed by the scope of the fiber that\n * executes this effect.\n *\n * This can be used to \"graft\" deep grandchildren onto a higher-level scope,\n * effectively extending their lifespans into the parent scope.\n *\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const transplant = core.transplant;\n/**\n * @since 2.0.0\n * @category Supervision & Fibers\n */\nexport const withConcurrency = core.withConcurrency;\n/**\n * Sets the provided scheduler for usage in the wrapped effect\n *\n * @since 2.0.0\n * @category Scheduler\n */\nexport const withScheduler = Scheduler.withScheduler;\n/**\n * Sets the scheduling priority used when yielding\n *\n * @since 2.0.0\n * @category Scheduler\n */\nexport const withSchedulingPriority = core.withSchedulingPriority;\n/**\n * Sets the maximum number of operations before yield by the default schedulers\n *\n * @since 2.0.0\n * @category Scheduler\n */\nexport const withMaxOpsBeforeYield = core.withMaxOpsBeforeYield;\n/**\n * Retrieves the `Clock` service from the context.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * const clock = yield* Effect.clock\n * const currentTime = yield* clock.currentTimeMillis\n * console.log(`Current time in milliseconds: ${currentTime}`)\n * })\n *\n * Effect.runFork(program)\n * // Example Output:\n * // Current time in milliseconds: 1735484796134\n * ```\n *\n * @since 2.0.0\n * @category Clock\n */\nexport const clock = effect.clock;\n/**\n * Retrieves the `Clock` service from the context and provides it to the\n * specified effectful function.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const program = Effect.clockWith((clock) =>\n * clock.currentTimeMillis.pipe(\n * Effect.map((currentTime) => `Current time is: ${currentTime}`),\n * Effect.tap(Console.log)\n * )\n * )\n *\n * Effect.runFork(program)\n * // Example Output:\n * // Current time is: 1735484929744\n * ```\n *\n * @since 2.0.0\n * @category Clock\n */\nexport const clockWith = effect.clockWith;\n/**\n * Sets the implementation of the `Clock` service to the specified value and\n * restores it to its original value when the scope is closed.\n *\n * @since 2.0.0\n * @category Clock\n */\nexport const withClockScoped = fiberRuntime.withClockScoped;\n/**\n * Executes the specified workflow with the specified implementation of the\n * `Clock` service.\n *\n * @since 2.0.0\n * @category Clock\n */\nexport const withClock = defaultServices.withClock;\n/**\n * Retreives the `Console` service from the context\n *\n * @since 2.0.0\n * @category Console\n */\nexport const console = console_.console;\n/**\n * Retreives the `Console` service from the context and provides it to the\n * specified effectful function.\n *\n * @since 2.0.0\n * @category Console\n */\nexport const consoleWith = console_.consoleWith;\n/**\n * Sets the implementation of the console service to the specified value and\n * restores it to its original value when the scope is closed.\n *\n * @since 2.0.0\n * @category Creating Effects\n */\nexport const withConsoleScoped = console_.withConsoleScoped;\n/**\n * Executes the specified workflow with the specified implementation of the\n * console service.\n *\n * @since 2.0.0\n * @category Console\n */\nexport const withConsole = console_.withConsole;\n/**\n * Delays the execution of an effect by a specified `Duration`.\n *\n * **Details\n *\n * This function postpones the execution of the provided effect by the specified\n * duration. The duration can be provided in various formats supported by the\n * `Duration` module.\n *\n * Internally, this function does not block the thread; instead, it uses an\n * efficient, non-blocking mechanism to introduce the delay.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const task = Console.log(\"Task executed\")\n *\n * const program = Console.log(\"start\").pipe(\n * Effect.andThen(\n * // Delays the log message by 2 seconds\n * task.pipe(Effect.delay(\"2 seconds\"))\n * )\n * )\n *\n * Effect.runFork(program)\n * // Output:\n * // start\n * // Task executed\n * ```\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const delay = effect.delay;\n/**\n * Suspends the execution of an effect for a specified `Duration`.\n *\n * **Details**\n *\n * This function pauses the execution of an effect for a given duration. It is\n * asynchronous, meaning that it does not block the fiber executing the effect.\n * Instead, the fiber is suspended during the delay period and can resume once\n * the specified time has passed.\n *\n * The duration can be specified using various formats supported by the\n * `Duration` module, such as a string (`\"2 seconds\"`) or numeric value\n * representing milliseconds.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * console.log(\"Starting task...\")\n * yield* Effect.sleep(\"3 seconds\") // Waits for 3 seconds\n * console.log(\"Task completed!\")\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // Starting task...\n * // Task completed!\n * ```\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const sleep = effect.sleep;\n/**\n * Executes an effect and measures the time it takes to complete.\n *\n * **Details**\n *\n * This function wraps the provided effect and returns a new effect that, when\n * executed, performs the original effect and calculates its execution duration.\n *\n * The result of the new effect includes both the execution time (as a\n * `Duration`) and the original effect's result. This is useful for monitoring\n * performance or gaining insights into the time taken by specific operations.\n *\n * The original effect's behavior (success, failure, or interruption) remains\n * unchanged, and the timing information is provided alongside the result in a\n * tuple.\n *\n * **Example**\n *\n * ```ts\n * import { Duration, Effect } from \"effect\"\n *\n * const task = Effect.gen(function*() {\n * yield* Effect.sleep(\"2 seconds\") // Simulates some work\n * return \"some result\"\n * })\n *\n * const timedTask = task.pipe(Effect.timed)\n *\n * const program = Effect.gen(function*() {\n * const [duration, result] = yield* timedTask\n * console.log(`Task completed in ${Duration.toMillis(duration)} ms with result: ${result}`)\n * })\n *\n * Effect.runFork(program)\n * // Output: Task completed in 2003.749125 ms with result: some result\n * ```\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const timed = effect.timed;\n/**\n * Executes an effect and measures its execution time using a custom clock.\n *\n * **Details**\n *\n * This function extends the functionality of {@link timed} by allowing you to\n * specify a custom clock for measuring the execution duration. The provided\n * effect (`nanoseconds`) represents the clock and should return the current\n * time in nanoseconds. The timing information is computed using this custom\n * clock instead of the default system clock.\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const timedWith = effect.timedWith;\n/**\n * Adds a time limit to an effect, triggering a timeout if the effect exceeds\n * the duration.\n *\n * **Details**\n *\n * This function allows you to enforce a time limit on the execution of an\n * effect. If the effect does not complete within the given duration, it fails\n * with a `TimeoutException`. This is useful for preventing tasks from hanging\n * indefinitely, especially in scenarios where responsiveness or resource limits\n * are critical.\n *\n * The returned effect will either:\n * - Succeed with the original effect's result if it completes within the\n * specified duration.\n * - Fail with a `TimeoutException` if the time limit is exceeded.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task = Effect.gen(function* () {\n * console.log(\"Start processing...\")\n * yield* Effect.sleep(\"2 seconds\") // Simulates a delay in processing\n * console.log(\"Processing complete.\")\n * return \"Result\"\n * })\n *\n * // Output will show a TimeoutException as the task takes longer\n * // than the specified timeout duration\n * const timedEffect = task.pipe(Effect.timeout(\"1 second\"))\n *\n * Effect.runPromiseExit(timedEffect).then(console.log)\n * // Output:\n * // Start processing...\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Fail',\n * // failure: { _tag: 'TimeoutException' }\n * // }\n * // }\n * ```\n *\n * @see {@link timeoutFail} for a version that raises a custom error.\n * @see {@link timeoutFailCause} for a version that raises a custom defect.\n * @see {@link timeoutTo} for a version that allows specifying both success and\n * timeout handlers.\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const timeout = circular.timeout;\n/**\n * Gracefully handles timeouts by returning an `Option` that represents either\n * the result or a timeout.\n *\n * **Details**\n *\n * This function wraps the outcome of an effect in an `Option` type. If the\n * effect completes within the specified duration, it returns a `Some`\n * containing the result. If the effect times out, it returns a `None`. Unlike\n * other timeout methods, this approach does not raise errors or exceptions;\n * instead, it allows you to treat timeouts as a regular outcome, simplifying\n * the logic for handling delays.\n *\n * **When to Use**\n *\n * This is useful when you want to handle timeouts without causing the program\n * to fail, making it easier to manage situations where you expect tasks might\n * take too long but want to continue executing other tasks.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task = Effect.gen(function* () {\n * console.log(\"Start processing...\")\n * yield* Effect.sleep(\"2 seconds\") // Simulates a delay in processing\n * console.log(\"Processing complete.\")\n * return \"Result\"\n * })\n *\n * const timedOutEffect = Effect.all([\n * task.pipe(Effect.timeoutOption(\"3 seconds\")),\n * task.pipe(Effect.timeoutOption(\"1 second\"))\n * ])\n *\n * Effect.runPromise(timedOutEffect).then(console.log)\n * // Output:\n * // Start processing...\n * // Processing complete.\n * // Start processing...\n * // [\n * // { _id: 'Option', _tag: 'Some', value: 'Result' },\n * // { _id: 'Option', _tag: 'None' }\n * // ]\n * ```\n *\n * @see {@link timeout} for a version that raises a `TimeoutException`.\n * @see {@link timeoutFail} for a version that raises a custom error.\n * @see {@link timeoutFailCause} for a version that raises a custom defect.\n * @see {@link timeoutTo} for a version that allows specifying both success and\n * timeout handlers.\n *\n * @since 3.1.0\n * @category Delays & Timeouts\n */\nexport const timeoutOption = circular.timeoutOption;\n/**\n * Specifies a custom error to be produced when a timeout occurs.\n *\n * **Details**\n *\n * This function allows you to handle timeouts in a customized way by defining a\n * specific error to be raised when an effect exceeds the given duration. Unlike\n * default timeout behaviors that use generic exceptions, this function gives\n * you the flexibility to specify a meaningful error type that aligns with your\n * application's needs.\n *\n * When you apply this function, you provide:\n * - A `duration`: The time limit for the effect.\n * - An `onTimeout` function: A lazy evaluation function that generates the\n * custom error if the timeout occurs.\n *\n * If the effect completes within the time limit, its result is returned\n * normally. Otherwise, the `onTimeout` function is triggered, and its output is\n * used as the error for the effect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task = Effect.gen(function* () {\n * console.log(\"Start processing...\")\n * yield* Effect.sleep(\"2 seconds\") // Simulates a delay in processing\n * console.log(\"Processing complete.\")\n * return \"Result\"\n * })\n *\n * class MyTimeoutError {\n * readonly _tag = \"MyTimeoutError\"\n * }\n *\n * const program = task.pipe(\n * Effect.timeoutFail({\n * duration: \"1 second\",\n * onTimeout: () => new MyTimeoutError() // Custom timeout error\n * })\n * )\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // Start processing...\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Fail',\n * // failure: MyTimeoutError { _tag: 'MyTimeoutError' }\n * // }\n * // }\n * ```\n *\n * @see {@link timeout} for a version that raises a `TimeoutException`.\n * @see {@link timeoutFailCause} for a version that raises a custom defect.\n * @see {@link timeoutTo} for a version that allows specifying both success and\n * timeout handlers.\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const timeoutFail = circular.timeoutFail;\n/**\n * Specifies a custom defect to be thrown when a timeout occurs.\n *\n * **Details**\n *\n * This function allows you to handle timeouts as exceptional cases by\n * generating a custom defect when an effect exceeds the specified duration. You\n * provide:\n * - A `duration`: The time limit for the effect.\n * - An `onTimeout` function: A lazy evaluation function that generates the\n * custom defect (typically created using `Cause.die`).\n *\n * If the effect completes within the time limit, its result is returned\n * normally. Otherwise, the custom defect is triggered, and the effect fails\n * with that defect.\n *\n * **When to Use**\n *\n * This is especially useful when you need to treat timeouts as critical\n * failures in your application and wish to include meaningful information in\n * the defect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Cause } from \"effect\"\n *\n * const task = Effect.gen(function* () {\n * console.log(\"Start processing...\")\n * yield* Effect.sleep(\"2 seconds\") // Simulates a delay in processing\n * console.log(\"Processing complete.\")\n * return \"Result\"\n * })\n *\n * const program = task.pipe(\n * Effect.timeoutFailCause({\n * duration: \"1 second\",\n * onTimeout: () => Cause.die(\"Timed out!\") // Custom defect for timeout\n * })\n * )\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // Start processing...\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Die', defect: 'Timed out!' }\n * // }\n * ```\n *\n * @see {@link timeout} for a version that raises a `TimeoutException`.\n * @see {@link timeoutFail} for a version that raises a custom error.\n * @see {@link timeoutTo} for a version that allows specifying both success and\n * timeout handlers.\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const timeoutFailCause = circular.timeoutFailCause;\n/**\n * Provides custom behavior for successful and timed-out operations.\n *\n * **Details**\n *\n * This function allows you to define distinct outcomes for an effect depending\n * on whether it completes within a specified time frame or exceeds the timeout\n * duration. You can provide:\n * - `onSuccess`: A handler for processing the result of the effect if it\n * completes successfully within the time limit.\n * - `onTimeout`: A handler for generating a result when the effect times out.\n * - `duration`: The maximum allowed time for the effect to complete.\n *\n * **When to Use**\n *\n * Unlike {@link timeout}, which raises an exception for timeouts, this function\n * gives you full control over the behavior for both success and timeout\n * scenarios. It is particularly useful when you want to encapsulate timeouts\n * and successes into a specific data structure, like an `Either` type, to\n * represent these outcomes in a meaningful way.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Either } from \"effect\"\n *\n * const task = Effect.gen(function* () {\n * console.log(\"Start processing...\")\n * yield* Effect.sleep(\"2 seconds\") // Simulates a delay in processing\n * console.log(\"Processing complete.\")\n * return \"Result\"\n * })\n *\n * const program = task.pipe(\n * Effect.timeoutTo({\n * duration: \"1 second\",\n * onSuccess: (result): Either.Either<string, string> =>\n * Either.right(result),\n * onTimeout: (): Either.Either<string, string> =>\n * Either.left(\"Timed out!\")\n * })\n * )\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // Start processing...\n * // {\n * // _id: \"Either\",\n * // _tag: \"Left\",\n * // left: \"Timed out!\"\n * // }\n * ```\n *\n * @see {@link timeout} for a version that raises a `TimeoutException`.\n * @see {@link timeoutFail} for a version that raises a custom error.\n * @see {@link timeoutFailCause} for a version that raises a custom defect.\n *\n * @since 2.0.0\n * @category Delays & Timeouts\n */\nexport const timeoutTo = circular.timeoutTo;\n/**\n * Allows working with the default configuration provider.\n *\n * **Details**\n *\n * This function retrieves the default configuration provider and passes it to\n * the provided function, which can use it to perform computations or retrieve\n * configuration values. The function can return an effect that leverages the\n * configuration provider for its operations.\n *\n * @since 2.0.0\n * @category Config\n */\nexport const configProviderWith = defaultServices.configProviderWith;\n/**\n * Executes an effect using a specific configuration provider.\n *\n * **Details**\n *\n * This function lets you run an effect with a specified configuration provider.\n * The custom provider will override the default configuration provider for the\n * duration of the effect's execution.\n *\n * **When to Use**\n *\n * This is particularly useful when you need to use a different set of\n * configuration values or sources for specific parts of your application.\n *\n * **Example**\n *\n * ```ts\n * import { Config, ConfigProvider, Effect } from \"effect\"\n *\n * const customProvider: ConfigProvider.ConfigProvider = ConfigProvider.fromMap(\n * new Map([[\"custom-key\", \"custom-value\"]])\n * )\n *\n * const program = Effect.withConfigProvider(customProvider)(\n * Effect.gen(function*() {\n * const value = yield* Config.string(\"custom-key\")\n * console.log(`Config value: ${value}`)\n * })\n * )\n *\n * Effect.runPromise(program)\n * // Output:\n * // Config value: custom-value\n * ```\n *\n * @since 2.0.0\n * @category Config\n */\nexport const withConfigProvider = defaultServices.withConfigProvider;\n/**\n * Sets a configuration provider within a scope.\n *\n * **Details**\n *\n * This function sets the configuration provider to a specified value and\n * ensures that it is restored to its original value when the scope is closed.\n *\n * @since 2.0.0\n * @category Config\n */\nexport const withConfigProviderScoped = fiberRuntime.withConfigProviderScoped;\n/**\n * Accesses the full context of the effect.\n *\n * **Details**\n *\n * This function provides the ability to access the entire context required by\n * an effect. The context is a container that holds dependencies or environment\n * values needed by an effect to run. By using this function, you can retrieve\n * and work with the context directly within an effect.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const context = core.context;\n/**\n * Accesses the context and applies a transformation function.\n *\n * **Details**\n *\n * This function retrieves the context of the effect and applies a pure\n * transformation function to it. The result of the transformation is then\n * returned within the effect.\n *\n * @see {@link contextWithEffect} for a version that allows effectful transformations.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const contextWith = effect.contextWith;\n/**\n * Accesses the context and performs an effectful transformation.\n *\n * **Details**\n *\n * This function retrieves the context and allows you to transform it\n * effectually using another effect. It is useful when the transformation\n * involves asynchronous or effectful operations.\n *\n * @see {@link contextWith} for a version that allows pure transformations.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const contextWithEffect = core.contextWithEffect;\n/**\n * Provides part of the required context while leaving the rest unchanged.\n *\n * **Details**\n *\n * This function allows you to transform the context required by an effect,\n * providing part of the context and leaving the rest to be fulfilled later.\n *\n * **Example**\n *\n * ```ts\n * import { Context, Effect } from \"effect\"\n *\n * class Service1 extends Context.Tag(\"Service1\")<Service1, { readonly port: number }>() {}\n * class Service2 extends Context.Tag(\"Service2\")<Service2, { readonly connection: string }>() {}\n *\n * const program = Effect.gen(function*() {\n * const service1 = yield* Service1\n * console.log(service1.port)\n * const service2 = yield* Service2\n * console.log(service2.connection)\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, never, Service2>\n * // ▼\n * const programWithService1 = Effect.mapInputContext(\n * program,\n * (ctx: Context.Context<Service2>) => Context.add(ctx, Service1, { port: 3000 })\n * )\n *\n * const runnable = programWithService1.pipe(\n * Effect.provideService(Service2, { connection: \"localhost\" }),\n * Effect.provideService(Service1, { port: 3001 })\n * )\n *\n * Effect.runPromise(runnable)\n * // Output:\n * // 3000\n * // localhost\n * ```\n *\n * @since 2.0.0\n * @category Context\n */\nexport const mapInputContext = core.mapInputContext;\n/**\n * Provides necessary dependencies to an effect, removing its environmental\n * requirements.\n *\n * **Details**\n *\n * This function allows you to supply the required environment for an effect.\n * The environment can be provided in the form of one or more `Layer`s, a\n * `Context`, a `Runtime`, or a `ManagedRuntime`. Once the environment is\n * provided, the effect can run without requiring external dependencies.\n *\n * You can compose layers to create a modular and reusable way of setting up the\n * environment for effects. For example, layers can be used to configure\n * databases, logging services, or any other required dependencies.\n *\n * **Example**\n *\n * ```ts\n * import { Context, Effect, Layer } from \"effect\"\n *\n * class Database extends Context.Tag(\"Database\")<\n * Database,\n * { readonly query: (sql: string) => Effect.Effect<Array<unknown>> }\n * >() {}\n *\n * const DatabaseLive = Layer.succeed(\n * Database,\n * {\n * // Simulate a database query\n * query: (sql: string) => Effect.log(`Executing query: ${sql}`).pipe(Effect.as([]))\n * }\n * )\n *\n * // ┌─── Effect<unknown[], never, Database>\n * // ▼\n * const program = Effect.gen(function*() {\n * const database = yield* Database\n * const result = yield* database.query(\"SELECT * FROM users\")\n * return result\n * })\n *\n * // ┌─── Effect<unknown[], never, never>\n * // ▼\n * const runnable = Effect.provide(program, DatabaseLive)\n *\n * Effect.runPromise(runnable).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=\"Executing query: SELECT * FROM users\"\n * // []\n * ```\n *\n * @see {@link provideService} for providing a service to an effect.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const provide = layer.effect_provide;\n/**\n * Provides an implementation for a service in the context of an effect.\n *\n * **Details**\n *\n * This function allows you to supply a specific implementation for a service\n * required by an effect. Services are typically defined using `Context.Tag`,\n * which acts as a unique identifier for the service. By using this function,\n * you link the service to its concrete implementation, enabling the effect to\n * execute successfully without additional requirements.\n *\n * For example, you can use this function to provide a random number generator,\n * a logger, or any other service your effect depends on. Once the service is\n * provided, all parts of the effect that rely on the service will automatically\n * use the implementation you supplied.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Context } from \"effect\"\n *\n * // Declaring a tag for a service that generates random numbers\n * class Random extends Context.Tag(\"MyRandomService\")<\n * Random,\n * { readonly next: Effect.Effect<number> }\n * >() {}\n *\n * // Using the service\n * const program = Effect.gen(function* () {\n * const random = yield* Random\n * const randomNumber = yield* random.next\n * console.log(`random number: ${randomNumber}`)\n * })\n *\n * // Providing the implementation\n * //\n * // ┌─── Effect<void, never, never>\n * // ▼\n * const runnable = Effect.provideService(program, Random, {\n * next: Effect.sync(() => Math.random())\n * })\n *\n * // Run successfully\n * Effect.runPromise(runnable)\n * // Example Output:\n * // random number: 0.8241872233134417\n * ```\n *\n * @see {@link provide} for providing multiple layers to an effect.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const provideService = effect.provideService;\n/**\n * Dynamically provides an implementation for a service using an effect.\n *\n * **Details**\n *\n * This function allows you to provide an implementation for a service\n * dynamically by using another effect. The provided effect is executed to\n * produce the service implementation, which is then made available to the\n * consuming effect. This is particularly useful when the service implementation\n * itself requires asynchronous or resource-intensive initialization.\n *\n * For example, you can use this function to lazily initialize a database\n * connection or fetch configuration values from an external source before\n * making the service available to your effect.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const provideServiceEffect = effect.provideServiceEffect;\n/**\n * Creates a function that uses a service from the context to produce a value.\n *\n * @see {@link serviceFunctionEffect} for a version that returns an effect.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const serviceFunction = effect.serviceFunction;\n/**\n * Creates a function that uses a service from the context to produce an effect.\n *\n * @see {@link serviceFunction} for a version that returns a value.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const serviceFunctionEffect = effect.serviceFunctionEffect;\n/**\n * @since 2.0.0\n * @category Context\n */\nexport const serviceFunctions = effect.serviceFunctions;\n/**\n * @since 2.0.0\n * @category Context\n */\nexport const serviceConstants = effect.serviceConstants;\n/**\n * @since 2.0.0\n * @category Context\n */\nexport const serviceMembers = effect.serviceMembers;\n/**\n * Retrieves an optional service from the context as an `Option`.\n *\n * **Details**\n *\n * This function retrieves a service from the context and wraps it in an\n * `Option`. If the service is available, it returns a `Some` containing the\n * service. If the service is not found, it returns a `None`. This approach is\n * useful when you want to handle the absence of a service gracefully without\n * causing an error.\n *\n * **When to Use**\n *\n * Use this function when:\n * - You need to access a service that may or may not be present in the context.\n * - You want to handle the absence of a service using the `Option` type instead\n * of throwing an error.\n *\n * @see {@link serviceOptional} for a version that throws an error if the service is missing.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const serviceOption = effect.serviceOption;\n/**\n * Retrieves a service from the context, throwing an error if it is missing.\n *\n * **Details**\n *\n * This function retrieves a required service from the context. If the service\n * is available, it returns the service. If the service is missing, it throws a\n * `NoSuchElementException`, which can be handled using Effect's error-handling\n * mechanisms. This is useful for services that are critical to the execution of\n * your effect.\n *\n * @see {@link serviceOption} for a version that returns an `Option` instead of throwing an error.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const serviceOptional = effect.serviceOptional;\n/**\n * Updates a service in the context with a new implementation.\n *\n * **Details**\n *\n * This function modifies the existing implementation of a service in the\n * context. It retrieves the current service, applies the provided\n * transformation function `f`, and replaces the old service with the\n * transformed one.\n *\n * **When to Use**\n *\n * This is useful for adapting or extending a service's behavior during the\n * execution of an effect.\n *\n * @since 2.0.0\n * @category Context\n */\nexport const updateService = effect.updateService;\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Effect` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * **Example**\n *\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Effect, pipe } from \"effect\"\n *\n * const result = pipe(\n * Effect.Do,\n * Effect.bind(\"x\", () => Effect.succeed(2)),\n * Effect.bind(\"y\", () => Effect.succeed(3)),\n * Effect.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })\n * ```\n *\n * @see {@link bind}\n * @see {@link bindTo}\n * @see {@link let_ let}\n *\n * @category Do notation\n * @since 2.0.0\n */\nexport const Do = effect.Do;\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Effect` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * **Example**\n *\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Effect, pipe } from \"effect\"\n *\n * const result = pipe(\n * Effect.Do,\n * Effect.bind(\"x\", () => Effect.succeed(2)),\n * Effect.bind(\"y\", () => Effect.succeed(3)),\n * Effect.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })\n * ```\n *\n * @see {@link Do}\n * @see {@link bindTo}\n * @see {@link let_ let}\n *\n * @category Do notation\n * @since 2.0.0\n */\nexport const bind = effect.bind;\n/**\n * `bindAll` combines `all` with `bind`. It is useful\n * when you want to concurrently run multiple effects and then combine their\n * results in a Do notation pipeline.\n *\n * **Example**\n *\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Effect, Either, pipe } from \"effect\"\n *\n * const result = pipe(\n * Effect.Do,\n * Effect.bind(\"x\", () => Effect.succeed(2)),\n * Effect.bindAll(({ x }) => ({\n * a: Effect.succeed(x),\n * b: Effect.fail(\"oops\"),\n * }), { concurrency: 2, mode: \"either\" })\n * )\n * assert.deepStrictEqual(Effect.runSync(result), { x: 2, a: Either.right(2), b: Either.left(\"oops\") })\n * ```\n *\n * @category Do notation\n * @since 3.7.0\n */\nexport const bindAll = circular.bindAll;\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Effect` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * **Example**\n *\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Effect, pipe } from \"effect\"\n *\n * const result = pipe(\n * Effect.Do,\n * Effect.bind(\"x\", () => Effect.succeed(2)),\n * Effect.bind(\"y\", () => Effect.succeed(3)),\n * Effect.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })\n * ```\n *\n * @see {@link Do}\n * @see {@link bind}\n * @see {@link let_ let}\n *\n * @category Do notation\n * @since 2.0.0\n */\nexport const bindTo = effect.bindTo;\nconst let_ = effect.let_;\nexport {\n/**\n * The \"do simulation\" in Effect allows you to write code in a more declarative style, similar to the \"do notation\" in other programming languages. It provides a way to define variables and perform operations on them using functions like `bind` and `let`.\n *\n * Here's how the do simulation works:\n *\n * 1. Start the do simulation using the `Do` value\n * 2. Within the do simulation scope, you can use the `bind` function to define variables and bind them to `Effect` values\n * 3. You can accumulate multiple `bind` statements to define multiple variables within the scope\n * 4. Inside the do simulation scope, you can also use the `let` function to define variables and bind them to simple values\n *\n * **Example**\n *\n * ```ts\n * import * as assert from \"node:assert\"\n * import { Effect, pipe } from \"effect\"\n *\n * const result = pipe(\n * Effect.Do,\n * Effect.bind(\"x\", () => Effect.succeed(2)),\n * Effect.bind(\"y\", () => Effect.succeed(3)),\n * Effect.let(\"sum\", ({ x, y }) => x + y)\n * )\n * assert.deepStrictEqual(Effect.runSync(result), { x: 2, y: 3, sum: 5 })\n *\n * ```\n *\n * @see {@link Do}\n * @see {@link bind}\n * @see {@link bindTo}\n *\n * @category Do notation\n * @since 2.0.0\n */\nlet_ as let };\n/**\n * Encapsulates the result of an effect in an `Option`.\n *\n * **Details**\n *\n * This function wraps the outcome of an effect in an `Option` type. If the\n * original effect succeeds, the success value is wrapped in `Option.some`. If\n * the effect fails, the failure is converted to `Option.none`.\n *\n * This is particularly useful for scenarios where you want to represent the\n * absence of a value explicitly, without causing the resulting effect to fail.\n * The resulting effect has an error type of `never`, meaning it cannot fail\n * directly. However, unrecoverable errors, also referred to as defects, are\n * not captured and will still result in failure.\n *\n * **Example** (Using Effect.option to Handle Errors)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const maybe1 = Effect.option(Effect.succeed(1))\n *\n * Effect.runPromiseExit(maybe1).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Success',\n * // value: { _id: 'Option', _tag: 'Some', value: 1 }\n * // }\n *\n * const maybe2 = Effect.option(Effect.fail(\"Uh oh!\"))\n *\n * Effect.runPromiseExit(maybe2).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Success',\n * // value: { _id: 'Option', _tag: 'None' }\n * // }\n *\n * const maybe3 = Effect.option(Effect.die(\"Boom!\"))\n *\n * Effect.runPromiseExit(maybe3).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Die', defect: 'Boom!' }\n * // }\n * ```\n *\n * @see {@link either} for a version that uses `Either` instead.\n * @see {@link exit} for a version that encapsulates both recoverable errors and defects in an `Exit`.\n *\n * @since 2.0.0\n * @category Outcome Encapsulation\n */\nexport const option = effect.option;\n/**\n * Encapsulates both success and failure of an `Effect` into an `Either` type.\n *\n * **Details**\n *\n * This function converts an effect that may fail into an effect that always\n * succeeds, wrapping the outcome in an `Either` type. The result will be\n * `Either.Left` if the effect fails, containing the recoverable error, or\n * `Either.Right` if it succeeds, containing the result.\n *\n * Using this function, you can handle recoverable errors explicitly without\n * causing the effect to fail. This is particularly useful in scenarios where\n * you want to chain effects and manage both success and failure in the same\n * logical flow.\n *\n * It's important to note that unrecoverable errors, often referred to as\n * \"defects,\" are still thrown and not captured within the `Either` type. Only\n * failures that are explicitly represented as recoverable errors in the effect\n * are encapsulated.\n *\n * The resulting effect cannot fail directly because all recoverable failures\n * are represented inside the `Either` type.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Either, Random } from \"effect\"\n *\n * class HttpError {\n * readonly _tag = \"HttpError\"\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * }\n *\n * // ┌─── Effect<string, HttpError | ValidationError, never>\n * // ▼\n * const program = Effect.gen(function* () {\n * const n1 = yield* Random.next\n * const n2 = yield* Random.next\n * if (n1 < 0.5) {\n * yield* Effect.fail(new HttpError())\n * }\n * if (n2 < 0.5) {\n * yield* Effect.fail(new ValidationError())\n * }\n * return \"some result\"\n * })\n *\n * // ┌─── Effect<string, never, never>\n * // ▼\n * const recovered = Effect.gen(function* () {\n * // ┌─── Either<string, HttpError | ValidationError>\n * // ▼\n * const failureOrSuccess = yield* Effect.either(program)\n * return Either.match(failureOrSuccess, {\n * onLeft: (error) => `Recovering from ${error._tag}`,\n * onRight: (value) => value // Do nothing in case of success\n * })\n * })\n * ```\n *\n * @see {@link option} for a version that uses `Option` instead.\n * @see {@link exit} for a version that encapsulates both recoverable errors and defects in an `Exit`.\n *\n * @since 2.0.0\n * @category Outcome Encapsulation\n */\nexport const either = core.either;\n/**\n * Encapsulates both success and failure of an `Effect` using the `Exit` type.\n *\n * **Details**\n *\n * This function converts an effect into one that always succeeds, wrapping its\n * outcome in the `Exit` type. The `Exit` type provides explicit handling of\n * both success (`Exit.Success`) and failure (`Exit.Failure`) cases, including\n * defects (unrecoverable errors).\n *\n * Unlike {@link either} or {@link option}, this function also encapsulates\n * defects, which are typically unrecoverable and would otherwise terminate the\n * effect. With the `Exit` type, defects are represented in `Exit.Failure`,\n * allowing for detailed introspection and structured error handling.\n *\n * This makes the resulting effect robust and incapable of direct failure (its\n * error type is `never`). It is particularly useful for workflows where all\n * outcomes, including unexpected defects, must be managed and analyzed.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Cause, Console, Exit } from \"effect\"\n *\n * // Simulating a runtime error\n * const task = Effect.dieMessage(\"Boom!\")\n *\n * const program = Effect.gen(function* () {\n * const exit = yield* Effect.exit(task)\n * if (Exit.isFailure(exit)) {\n * const cause = exit.cause\n * if (\n * Cause.isDieType(cause) &&\n * Cause.isRuntimeException(cause.defect)\n * ) {\n * yield* Console.log(\n * `RuntimeException defect caught: ${cause.defect.message}`\n * )\n * } else {\n * yield* Console.log(\"Unknown failure caught.\")\n * }\n * }\n * })\n *\n * // We get an Exit.Success because we caught all failures\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // RuntimeException defect caught: Boom!\n * // {\n * // _id: \"Exit\",\n * // _tag: \"Success\",\n * // value: undefined\n * // }\n * ```\n *\n * @see {@link option} for a version that uses `Option` instead.\n * @see {@link either} for a version that uses `Either` instead.\n *\n * @since 2.0.0\n * @category Outcome Encapsulation\n */\nexport const exit = core.exit;\n/**\n * Converts an `Effect` into an operation that completes a `Deferred` with its result.\n *\n * **Details**\n *\n * The `intoDeferred` function takes an effect and a `Deferred` and ensures that the `Deferred`\n * is completed based on the outcome of the effect. If the effect succeeds, the `Deferred` is\n * completed with the success value. If the effect fails, the `Deferred` is completed with the\n * failure. Additionally, if the effect is interrupted, the `Deferred` will also be interrupted.\n *\n * **Example**\n *\n * ```ts\n * import { Deferred, Effect } from \"effect\"\n *\n * // Define an effect that succeeds\n * const successEffect = Effect.succeed(42)\n *\n * const program = Effect.gen(function*() {\n * // Create a deferred\n * const deferred = yield* Deferred.make<number, string>()\n *\n * // Complete the deferred using the successEffect\n * const isCompleted = yield* Effect.intoDeferred(successEffect, deferred)\n *\n * // Access the value of the deferred\n * const value = yield* Deferred.await(deferred)\n * console.log(value)\n *\n * return isCompleted\n * })\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // 42\n * // true\n * ```\n *\n * @since 2.0.0\n * @category Synchronization Utilities\n */\nexport const intoDeferred = core.intoDeferred;\nconst if_ = core.if_;\nexport {\n/**\n * Executes one of two effects based on a condition evaluated by an effectful predicate.\n *\n * Use `if` to run one of two effects depending on whether the predicate effect\n * evaluates to `true` or `false`. If the predicate is `true`, the `onTrue` effect\n * is executed. If it is `false`, the `onFalse` effect is executed instead.\n *\n * **Example** (Simulating a Coin Flip)\n *\n * ```ts\n * import { Effect, Random, Console } from \"effect\"\n *\n * const flipTheCoin = Effect.if(Random.nextBoolean, {\n * onTrue: () => Console.log(\"Head\"), // Runs if the predicate is true\n * onFalse: () => Console.log(\"Tail\") // Runs if the predicate is false\n * })\n *\n * Effect.runFork(flipTheCoin)\n * ```\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nif_ as if };\n/**\n * Filters an effect, dying with a custom defect if the predicate fails.\n *\n * **Details**\n *\n * This function applies a predicate to the result of an effect. If the\n * predicate evaluates to `false`, the effect dies with a custom defect\n * generated by the `orDieWith` function.\n *\n * **When to Use**\n *\n * This is useful for enforcing constraints on values and treating violations as\n * fatal program errors.\n *\n * @since 2.0.0\n * @category Filtering\n */\nexport const filterOrDie = effect.filterOrDie;\n/**\n * Filters an effect, dying with a custom message if the predicate fails.\n *\n * **Details**\n *\n * This function works like {@link filterOrDie} but allows you to specify a\n * custom error message to describe the reason for the failure. The message is\n * included in the defect when the predicate evaluates to `false`.\n *\n * @since 2.0.0\n * @category Filtering\n */\nexport const filterOrDieMessage = effect.filterOrDieMessage;\n/**\n * Filters an effect, providing an alternative effect if the predicate fails.\n *\n * **Details**\n *\n * This function applies a predicate to the result of an effect. If the\n * predicate evaluates to `false`, it executes the `orElse` effect instead. The\n * `orElse` effect can produce an alternative value or perform additional\n * computations.\n *\n * @since 2.0.0\n * @category Filtering\n */\nexport const filterOrElse = effect.filterOrElse;\n/**\n * Filters an effect, failing with a custom error if the predicate fails.\n *\n * **Details**\n *\n * This function applies a predicate to the result of an effect. If the\n * predicate evaluates to `false`, the effect fails with a custom error\n * generated by the `orFailWith` function.\n *\n * **When to Use**\n *\n * This is useful for enforcing constraints and treating violations as\n * recoverable errors.\n *\n * **Providing a Guard**\n *\n * In addition to the filtering capabilities discussed earlier, you have the\n * option to further refine and narrow down the type of the success channel by\n * providing a [user-defined type\n * guard](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates).\n * Let's explore this concept through an example:\n *\n * **Example**\n *\n * ```ts\n * import { Effect, pipe } from \"effect\"\n *\n * // Define a user interface\n * interface User {\n * readonly name: string\n * }\n *\n * // Simulate an asynchronous authentication function\n * declare const auth: () => Promise<User | null>\n *\n * const program = pipe(\n * Effect.promise(() => auth()),\n * // Use filterOrFail with a custom type guard to ensure user is not null\n * Effect.filterOrFail(\n * (user): user is User => user !== null, // Type guard\n * () => new Error(\"Unauthorized\")\n * ),\n * // 'user' now has the type `User` (not `User | null`)\n * Effect.andThen((user) => user.name)\n * )\n * ```\n *\n * @since 2.0.0\n * @category Filtering\n */\nexport const filterOrFail = effect.filterOrFail;\n/**\n * Filters an effect with an effectful predicate, falling back to an alternative\n * effect if the predicate fails.\n *\n * **Details**\n *\n * This function applies a predicate to the result of an effect. If the\n * predicate evaluates to `false`, the effect falls back to the `orElse`\n * effect. The `orElse` effect can produce an alternative value or perform\n * additional computations.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, pipe } from \"effect\"\n *\n * // Define a user interface\n * interface User {\n * readonly name: string\n * }\n *\n * // Simulate an asynchronous authentication function\n * declare const auth: () => Promise<User | null>\n *\n * const program = pipe(\n * Effect.promise(() => auth()),\n * // Use filterEffectOrElse with an effectful predicate\n * Effect.filterEffectOrElse({\n * predicate: (user) => Effect.succeed(user !== null),\n * orElse: (user) => Effect.fail(new Error(`Unauthorized user: ${user}`))\n * }),\n * )\n * ```\n *\n * @since 3.13.0\n * @category Filtering\n */\nexport const filterEffectOrElse = core.filterEffectOrElse;\n/**\n * Filters an effect with an effectful predicate, failing with a custom error if the predicate fails.\n *\n * **Details**\n *\n * This function applies a predicate to the result of an effect. If the\n * predicate evaluates to `false`, the effect fails with a custom error\n * generated by the `orFailWith` function.\n *\n * **When to Use**\n *\n * This is useful for enforcing constraints and treating violations as\n * recoverable errors.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, pipe } from \"effect\"\n *\n * // Define a user interface\n * interface User {\n * readonly name: string\n * }\n *\n * // Simulate an asynchronous authentication function\n * declare const auth: () => Promise<User | null>\n *\n * const program = pipe(\n * Effect.promise(() => auth()),\n * // Use filterEffectOrFail with an effectful predicate\n * Effect.filterEffectOrFail({\n * predicate: (user) => Effect.succeed(user !== null),\n * orFailWith: () => new Error(\"Unauthorized\")\n * }),\n * )\n * ```\n *\n * @since 3.13.0\n * @category Filtering\n */\nexport const filterEffectOrFail = core.filterEffectOrFail;\n/**\n * Executes an effect only if the condition is `false`.\n *\n * @see {@link unlessEffect} for a version that allows the condition to be an effect.\n * @see {@link when} for a version that executes the effect when the condition is `true`.\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nexport const unless = effect.unless;\n/**\n * Conditionally execute an effect based on the result of another effect.\n *\n * @see {@link unless} for a version that allows the condition to be a boolean.\n * @see {@link whenEffect} for a version that executes the effect when the condition is `true`.\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nexport const unlessEffect = effect.unlessEffect;\n/**\n * Conditionally executes an effect based on a boolean condition.\n *\n * **Details**\n *\n * This function allows you to run an effect only if a given condition evaluates\n * to `true`. If the condition is `true`, the effect is executed, and its result\n * is wrapped in an `Option.some`. If the condition is `false`, the effect is\n * skipped, and the result is `Option.none`.\n *\n * **When to Use**\n *\n * This function is useful for scenarios where you need to dynamically decide\n * whether to execute an effect based on runtime logic, while also representing\n * the skipped case explicitly.\n *\n * **Example** (Conditional Effect Execution)\n *\n * ```ts\n * import { Effect, Option } from \"effect\"\n *\n * const validateWeightOption = (\n * weight: number\n * ): Effect.Effect<Option.Option<number>> =>\n * // Conditionally execute the effect if the weight is non-negative\n * Effect.succeed(weight).pipe(Effect.when(() => weight >= 0))\n *\n * // Run with a valid weight\n * Effect.runPromise(validateWeightOption(100)).then(console.log)\n * // Output:\n * // {\n * // _id: \"Option\",\n * // _tag: \"Some\",\n * // value: 100\n * // }\n *\n * // Run with an invalid weight\n * Effect.runPromise(validateWeightOption(-5)).then(console.log)\n * // Output:\n * // {\n * // _id: \"Option\",\n * // _tag: \"None\"\n * // }\n * ```\n *\n * @see {@link whenEffect} for a version that allows the condition to be an effect.\n * @see {@link unless} for a version that executes the effect when the condition is `false`.\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nexport const when = effect.when;\n/**\n * Conditionally executes an effect based on the result of another effect.\n *\n * **Details**\n *\n * This function allows you to run an effect only if a conditional effect\n * evaluating to a boolean resolves to `true`. If the conditional effect\n * evaluates to `true`, the specified effect is executed, and its result is\n * wrapped in `Option.some`. If the conditional effect evaluates to `false`, the\n * effect is skipped, and the result is `Option.none`.\n *\n * **When to Use**\n *\n * This function is particularly useful when the decision to execute an effect\n * depends on the result of another effect, such as a random value, a\n * user-provided input, or a network request result.\n *\n * **Example** (Using an Effect as a Condition)\n *\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * const randomIntOption = Random.nextInt.pipe(\n * Effect.whenEffect(Random.nextBoolean)\n * )\n *\n * console.log(Effect.runSync(randomIntOption))\n * // Example Output:\n * // { _id: 'Option', _tag: 'Some', value: 8609104974198840 }\n * ```\n *\n * @see {@link when} for a version that allows the condition to be a boolean.\n * @see {@link unlessEffect} for a version that executes the effect when the condition is `false`.\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nexport const whenEffect = core.whenEffect;\n/**\n * Executes an effect conditionally based on the value of a `FiberRef` that\n * satisfies a predicate.\n *\n * **Details**\n *\n * This function enables you to execute an effect only when the value of a\n * specified `FiberRef` meets a certain condition defined by a predicate. If the\n * value satisfies the predicate, the effect is executed, and the result is\n * wrapped in an `Option.some`. If the predicate is not satisfied, the effect is\n * skipped, and the result is `Option.none`. In both cases, the current value of\n * the `FiberRef` is included in the result.\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nexport const whenFiberRef = effect.whenFiberRef;\n/**\n * Executes an effect conditionally based on the value of a `Ref` that satisfies\n * a predicate.\n *\n * **Details**\n *\n * This function allows you to execute an effect only when the value of a\n * specified `Ref` meets a condition defined by a predicate. If the value\n * satisfies the predicate, the effect is executed, and the result is wrapped in\n * an `Option.some`. If the predicate is not satisfied, the effect is skipped,\n * and the result is `Option.none`. In both cases, the current value of the\n * `Ref` is included in the result.\n *\n * @since 2.0.0\n * @category Conditional Operators\n */\nexport const whenRef = effect.whenRef;\n/**\n * Chains effects to produce new `Effect` instances, useful for combining\n * operations that depend on previous results.\n *\n * **Syntax**\n *\n * ```ts skip-type-checking\n * const flatMappedEffect = pipe(myEffect, Effect.flatMap(transformation))\n * // or\n * const flatMappedEffect = Effect.flatMap(myEffect, transformation)\n * // or\n * const flatMappedEffect = myEffect.pipe(Effect.flatMap(transformation))\n * ```\n *\n * **Details**\n *\n * `flatMap` lets you sequence effects so that the result of one effect can be\n * used in the next step. It is similar to `flatMap` used with arrays but works\n * specifically with `Effect` instances, allowing you to avoid deeply nested\n * effect structures.\n *\n * Since effects are immutable, `flatMap` always returns a new effect instead of\n * changing the original one.\n *\n * **When to Use**\n *\n * Use `flatMap` when you need to chain multiple effects, ensuring that each\n * step produces a new `Effect` while flattening any nested effects that may\n * occur.\n *\n * **Example**\n *\n * ```ts\n * import { pipe, Effect } from \"effect\"\n *\n * // Function to apply a discount safely to a transaction amount\n * const applyDiscount = (\n * total: number,\n * discountRate: number\n * ): Effect.Effect<number, Error> =>\n * discountRate === 0\n * ? Effect.fail(new Error(\"Discount rate cannot be zero\"))\n * : Effect.succeed(total - (total * discountRate) / 100)\n *\n * // Simulated asynchronous task to fetch a transaction amount from database\n * const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))\n *\n * // Chaining the fetch and discount application using `flatMap`\n * const finalAmount = pipe(\n * fetchTransactionAmount,\n * Effect.flatMap((amount) => applyDiscount(amount, 5))\n * )\n *\n * Effect.runPromise(finalAmount).then(console.log)\n * // Output: 95\n * ```\n *\n * @see {@link tap} for a version that ignores the result of the effect.\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const flatMap = core.flatMap;\n/**\n * Chains two actions, where the second action can depend on the result of the\n * first.\n *\n * **Syntax**\n *\n * ```ts skip-type-checking\n * const transformedEffect = pipe(myEffect, Effect.andThen(anotherEffect))\n * // or\n * const transformedEffect = Effect.andThen(myEffect, anotherEffect)\n * // or\n * const transformedEffect = myEffect.pipe(Effect.andThen(anotherEffect))\n * ```\n *\n * **When to Use**\n *\n * Use `andThen` when you need to run multiple actions in sequence, with the\n * second action depending on the result of the first. This is useful for\n * combining effects or handling computations that must happen in order.\n *\n * **Details**\n *\n * The second action can be:\n *\n * - A constant value (similar to {@link as})\n * - A function returning a value (similar to {@link map})\n * - A `Promise`\n * - A function returning a `Promise`\n * - An `Effect`\n * - A function returning an `Effect` (similar to {@link flatMap})\n *\n * **Note:** `andThen` works well with both `Option` and `Either` types,\n * treating them as effects.\n *\n * **Example** (Applying a Discount Based on Fetched Amount)\n *\n * ```ts\n * import { pipe, Effect } from \"effect\"\n *\n * // Function to apply a discount safely to a transaction amount\n * const applyDiscount = (\n * total: number,\n * discountRate: number\n * ): Effect.Effect<number, Error> =>\n * discountRate === 0\n * ? Effect.fail(new Error(\"Discount rate cannot be zero\"))\n * : Effect.succeed(total - (total * discountRate) / 100)\n *\n * // Simulated asynchronous task to fetch a transaction amount from database\n * const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))\n *\n * // Using Effect.map and Effect.flatMap\n * const result1 = pipe(\n * fetchTransactionAmount,\n * Effect.map((amount) => amount * 2),\n * Effect.flatMap((amount) => applyDiscount(amount, 5))\n * )\n *\n * Effect.runPromise(result1).then(console.log)\n * // Output: 190\n *\n * // Using Effect.andThen\n * const result2 = pipe(\n * fetchTransactionAmount,\n * Effect.andThen((amount) => amount * 2),\n * Effect.andThen((amount) => applyDiscount(amount, 5))\n * )\n *\n * Effect.runPromise(result2).then(console.log)\n * // Output: 190\n * ```\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const andThen = core.andThen;\n/**\n * @since 2.0.0\n * @category Sequencing\n */\nexport const flatten = core.flatten;\n/**\n * Races two effects and returns the result of the first successful one.\n *\n * **Details**\n *\n * This function takes two effects and runs them concurrently. The first effect\n * that successfully completes will determine the result of the race, and the\n * other effect will be interrupted.\n *\n * If neither effect succeeds, the function will fail with a `Cause`\n * containing all the errors.\n *\n * **When to Use**\n *\n * This is useful when you want to run two effects concurrently, but only care\n * about the first one to succeed. It is commonly used in cases like timeouts,\n * retries, or when you want to optimize for the faster response without\n * worrying about the other effect.\n *\n * **Handling Success or Failure with Either**\n *\n * If you want to handle the result of whichever task completes first, whether\n * it succeeds or fails, you can use the `Effect.either` function. This function\n * wraps the result in an `Either` type, allowing you to see if the result\n * was a success (`Right`) or a failure (`Left`).\n *\n * **Example** (Both Tasks Succeed)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.succeed(\"task1\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * const program = Effect.race(task1, task2)\n *\n * Effect.runFork(program)\n * // Output:\n * // task1 done\n * // task2 interrupted\n * ```\n *\n * **Example** (One Task Fails, One Succeeds)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.fail(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * const program = Effect.race(task1, task2)\n *\n * Effect.runFork(program)\n * // Output:\n * // task2 done\n * ```\n *\n * **Example** (Both Tasks Fail)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.fail(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.fail(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * const program = Effect.race(task1, task2)\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Parallel',\n * // left: { _id: 'Cause', _tag: 'Fail', failure: 'task1' },\n * // right: { _id: 'Cause', _tag: 'Fail', failure: 'task2' }\n * // }\n * // }\n * ```\n *\n * **Example** (Handling Success or Failure with Either)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.fail(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * // Run both tasks concurrently, wrapping the result\n * // in Either to capture success or failure\n * const program = Effect.race(Effect.either(task1), Effect.either(task2))\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // task2 interrupted\n * // { _id: 'Either', _tag: 'Left', left: 'task1' }\n * ```\n *\n * @see {@link raceAll} for a version that handles multiple effects.\n * @see {@link raceFirst} for a version that returns the result of the first effect to complete.\n *\n * @since 2.0.0\n * @category Racing\n */\nexport const race = fiberRuntime.race;\n/**\n * Races multiple effects and returns the first successful result.\n *\n * **Details**\n *\n * This function runs multiple effects concurrently and returns the result of\n * the first one to succeed. If one effect succeeds, the others will be\n * interrupted.\n *\n * If none of the effects succeed, the function will fail with the last error\n * encountered.\n *\n * **When to Use**\n *\n * This is useful when you want to race multiple effects, but only care about\n * the first one to succeed. It is commonly used in cases like timeouts,\n * retries, or when you want to optimize for the faster response without\n * worrying about the other effects.\n *\n * **Example** (All Tasks Succeed)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.succeed(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * const task3 = Effect.succeed(\"task3\").pipe(\n * Effect.delay(\"150 millis\"),\n * Effect.tap(Console.log(\"task3 done\")),\n * Effect.onInterrupt(() => Console.log(\"task3 interrupted\"))\n * )\n *\n * const program = Effect.raceAll([task1, task2, task3])\n *\n * Effect.runFork(program)\n * // Output:\n * // task1 done\n * // task2 interrupted\n * // task3 interrupted\n * ```\n *\n * **Example** (One Task Fails, Two Tasks Succeed)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.fail(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * const task3 = Effect.succeed(\"task3\").pipe(\n * Effect.delay(\"150 millis\"),\n * Effect.tap(Console.log(\"task3 done\")),\n * Effect.onInterrupt(() => Console.log(\"task3 interrupted\"))\n * )\n *\n * const program = Effect.raceAll([task1, task2, task3])\n *\n * Effect.runFork(program)\n * // Output:\n * // task3 done\n * // task2 interrupted\n * ```\n *\n * **Example** (All Tasks Fail)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.fail(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() => Console.log(\"task1 interrupted\"))\n * )\n * const task2 = Effect.fail(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() => Console.log(\"task2 interrupted\"))\n * )\n *\n * const task3 = Effect.fail(\"task3\").pipe(\n * Effect.delay(\"150 millis\"),\n * Effect.tap(Console.log(\"task3 done\")),\n * Effect.onInterrupt(() => Console.log(\"task3 interrupted\"))\n * )\n *\n * const program = Effect.raceAll([task1, task2, task3])\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'task2' }\n * // }\n * ```\n *\n * @see {@link race} for a version that handles only two effects.\n *\n * @since 2.0.0\n * @category Racing\n */\nexport const raceAll = fiberRuntime.raceAll;\n/**\n * Races two effects and returns the result of the first one to complete.\n *\n * **Details**\n *\n * This function takes two effects and runs them concurrently, returning the\n * result of the first one that completes, regardless of whether it succeeds or\n * fails.\n *\n * **When to Use**\n *\n * This function is useful when you want to race two operations, and you want to\n * proceed with whichever one finishes first, regardless of whether it succeeds\n * or fails.\n *\n * **Disconnecting Effects**\n *\n * The `Effect.raceFirst` function safely interrupts the “loser” effect once the other completes, but it will not resume until the loser is cleanly terminated.\n *\n * If you want a quicker return, you can disconnect the interrupt signal for both effects. Instead of calling:\n *\n * ```ts skip-type-checking\n * Effect.raceFirst(task1, task2)\n * ```\n *\n * You can use:\n *\n * ```ts skip-type-checking\n * Effect.raceFirst(Effect.disconnect(task1), Effect.disconnect(task2))\n * ```\n *\n * This allows both effects to complete independently while still terminating the losing effect in the background.\n *\n * **Example** (Both Tasks Succeed)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.succeed(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task1 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task2 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n *\n * const program = Effect.raceFirst(task1, task2).pipe(\n * Effect.tap(Console.log(\"more work...\"))\n * )\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // task1 done\n * // task2 interrupted\n * // more work...\n * // { _id: 'Exit', _tag: 'Success', value: 'task1' }\n * ```\n *\n * **Example** (One Task Fails, One Succeeds)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.fail(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task1 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task2 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n *\n * const program = Effect.raceFirst(task1, task2).pipe(\n * Effect.tap(Console.log(\"more work...\"))\n * )\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // task2 interrupted\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'task1' }\n * // }\n * ```\n *\n * **Example** (Using Effect.disconnect for Quicker Return)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.succeed(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task1 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task2 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n *\n * // Race the two tasks with disconnect to allow quicker return\n * const program = Effect.raceFirst(\n * Effect.disconnect(task1),\n * Effect.disconnect(task2)\n * ).pipe(Effect.tap(Console.log(\"more work...\")))\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // task1 done\n * // more work...\n * // { _id: 'Exit', _tag: 'Success', value: 'task1' }\n * // task2 interrupted\n * ```\n *\n * @since 2.0.0\n * @category Racing\n */\nexport const raceFirst = circular.raceFirst;\n/**\n * Races two effects and calls a finisher when the first one completes.\n *\n * **Details**\n *\n * This function runs two effects concurrently and calls a specified “finisher”\n * function once one of the effects completes, regardless of whether it succeeds\n * or fails.\n *\n * The finisher functions for each effect allow you to handle the results of\n * each effect as soon as they complete.\n *\n * The function takes two finisher callbacks, one for each effect, and allows\n * you to specify how to handle the result of the race.\n *\n * **When to Use**\n *\n * This function is useful when you need to react to the completion of either\n * effect without waiting for both to finish. It can be used whenever you want\n * to take action based on the first available result.\n *\n * **Example** (Handling Results of Concurrent Tasks)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Effect.succeed(\"task1\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Console.log(\"task1 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task1 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n * const task2 = Effect.succeed(\"task2\").pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Console.log(\"task2 done\")),\n * Effect.onInterrupt(() =>\n * Console.log(\"task2 interrupted\").pipe(Effect.delay(\"100 millis\"))\n * )\n * )\n *\n * const program = Effect.raceWith(task1, task2, {\n * onSelfDone: (exit) => Console.log(`task1 exited with ${exit}`),\n * onOtherDone: (exit) => Console.log(`task2 exited with ${exit}`)\n * })\n *\n * Effect.runFork(program)\n * // Output:\n * // task1 done\n * // task1 exited with {\n * // \"_id\": \"Exit\",\n * // \"_tag\": \"Success\",\n * // \"value\": \"task1\"\n * // }\n * // task2 interrupted\n * ```\n *\n * @since 2.0.0\n * @category Racing\n */\nexport const raceWith = fiberRuntime.raceWith;\n/**\n * Summarizes a effect by computing some value before and after execution, and\n * then combining the values to produce a summary, together with the result of\n * execution.\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const summarized = effect.summarized;\n/**\n * Runs a side effect with the result of an effect without changing the original\n * value.\n *\n * **Details**\n *\n * This function works similarly to `flatMap`, but it ignores the result of the\n * function passed to it. The value from the previous effect remains available\n * for the next part of the chain. Note that if the side effect fails, the\n * entire chain will fail too.\n *\n * **When to Use**\n *\n * Use this function when you want to perform a side effect, like logging or\n * tracking, without modifying the main value. This is useful when you need to\n * observe or record an action but want the original value to be passed to the\n * next step.\n *\n * **Example** (Logging a step in a pipeline)\n *\n * ```ts\n * import { Console, Effect, pipe } from \"effect\"\n *\n * // Function to apply a discount safely to a transaction amount\n * const applyDiscount = (\n * total: number,\n * discountRate: number\n * ): Effect.Effect<number, Error> =>\n * discountRate === 0\n * ? Effect.fail(new Error(\"Discount rate cannot be zero\"))\n * : Effect.succeed(total - (total * discountRate) / 100)\n *\n * // Simulated asynchronous task to fetch a transaction amount from database\n * const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))\n *\n * const finalAmount = pipe(\n * fetchTransactionAmount,\n * // Log the fetched transaction amount\n * Effect.tap((amount) => Console.log(`Apply a discount to: ${amount}`)),\n * // `amount` is still available!\n * Effect.flatMap((amount) => applyDiscount(amount, 5))\n * )\n *\n * Effect.runPromise(finalAmount).then(console.log)\n * // Output:\n * // Apply a discount to: 100\n * // 95\n * ```\n *\n * @see {@link flatMap} for a version that allows you to change the value.\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const tap = core.tap;\n/**\n * Allows you to inspect both success and failure outcomes of an effect and\n * perform side effects for each.\n *\n * **Details**\n *\n * This function enables you to handle both success and failure cases\n * separately, without modifying the main effect's result. It is particularly\n * useful for scenarios where you need to log, monitor, or perform additional\n * actions depending on whether the effect succeeded or failed.\n *\n * When the effect succeeds, the `onSuccess` handler is executed with the\n * success value. When the effect fails, the `onFailure` handler is executed\n * with the failure value. Both handlers can include side effects such as\n * logging or analytics, and neither modifies the original effect's output.\n *\n * If either the success or failure handler fails, the overall effect will also\n * fail.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Random, Console } from \"effect\"\n *\n * // Simulate a task that might fail\n * const task = Effect.filterOrFail(\n * Random.nextRange(-1, 1),\n * (n) => n >= 0,\n * () => \"random number is negative\"\n * )\n *\n * // Use tapBoth to log both success and failure outcomes\n * const tapping = Effect.tapBoth(task, {\n * onFailure: (error) => Console.log(`failure: ${error}`),\n * onSuccess: (randomNumber) =>\n * Console.log(`random number: ${randomNumber}`)\n * })\n *\n * Effect.runFork(tapping)\n * // Example Output:\n * // failure: random number is negative\n * ```\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const tapBoth = effect.tapBoth;\n/**\n * Inspect severe errors or defects (non-recoverable failures) in an effect.\n *\n * **Details**\n *\n * This function is specifically designed to handle and inspect defects, which\n * are critical failures in your program, such as unexpected runtime exceptions\n * or system-level errors. Unlike normal recoverable errors, defects typically\n * indicate serious issues that cannot be addressed through standard error\n * handling.\n *\n * When a defect occurs in an effect, the function you provide to this function\n * will be executed, allowing you to log, monitor, or handle the defect in some\n * way. Importantly, this does not alter the main result of the effect. If no\n * defect occurs, the effect behaves as if this function was not used.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // Simulate a task that fails with a recoverable error\n * const task1: Effect.Effect<number, string> = Effect.fail(\"NetworkError\")\n *\n * // tapDefect won't log anything because NetworkError is not a defect\n * const tapping1 = Effect.tapDefect(task1, (cause) =>\n * Console.log(`defect: ${cause}`)\n * )\n *\n * Effect.runFork(tapping1)\n * // No Output\n *\n * // Simulate a severe failure in the system\n * const task2: Effect.Effect<number, string> = Effect.dieMessage(\n * \"Something went wrong\"\n * )\n *\n * // Log the defect using tapDefect\n * const tapping2 = Effect.tapDefect(task2, (cause) =>\n * Console.log(`defect: ${cause}`)\n * )\n *\n * Effect.runFork(tapping2)\n * // Output:\n * // defect: RuntimeException: Something went wrong\n * // ... stack trace ...\n * ```\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const tapDefect = effect.tapDefect;\n/**\n * Execute a side effect on failure without modifying the original effect.\n *\n * **Details**\n *\n * This function allows you to inspect and react to the failure of an effect by\n * executing an additional effect. The failure value is passed to the provided\n * function, enabling you to log it, track it, or perform any other operation.\n * Importantly, the original failure remains intact and is re-propagated, so the\n * effect's behavior is unchanged.\n *\n * The side effect you provide is only executed when the effect fails. If the\n * effect succeeds, the function is ignored, and the success value is propagated\n * as usual.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // Simulate a task that fails with an error\n * const task: Effect.Effect<number, string> = Effect.fail(\"NetworkError\")\n *\n * // Use tapError to log the error message when the task fails\n * const tapping = Effect.tapError(task, (error) =>\n * Console.log(`expected error: ${error}`)\n * )\n *\n * Effect.runFork(tapping)\n * // Output:\n * // expected error: NetworkError\n * ```\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const tapError = effect.tapError;\n/**\n * Inspect errors matching a specific tag without altering the original effect.\n *\n * **Details**\n *\n * This function allows you to inspect and handle specific error types based on\n * their `_tag` property. It is particularly useful in applications where errors\n * are modeled with tagged types (e.g., union types with discriminating tags).\n * By targeting errors with a specific `_tag`, you can log or perform actions on\n * them while leaving the error channel and overall effect unchanged.\n *\n * If the error doesn't match the specified tag, this function does nothing, and\n * the effect proceeds as usual.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * class NetworkError {\n * readonly _tag = \"NetworkError\"\n * constructor(readonly statusCode: number) {}\n * }\n *\n * class ValidationError {\n * readonly _tag = \"ValidationError\"\n * constructor(readonly field: string) {}\n * }\n *\n * // Create a task that fails with a NetworkError\n * const task: Effect.Effect<number, NetworkError | ValidationError> =\n * Effect.fail(new NetworkError(504))\n *\n * // Use tapErrorTag to inspect only NetworkError types and log the status code\n * const tapping = Effect.tapErrorTag(task, \"NetworkError\", (error) =>\n * Console.log(`expected error: ${error.statusCode}`)\n * )\n *\n * Effect.runFork(tapping)\n * // Output:\n * // expected error: 504\n * ```\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const tapErrorTag = effect.tapErrorTag;\n/**\n * Inspect the complete cause of an error, including failures and defects.\n *\n * **Details**\n *\n * This function provides access to the full cause of an error, including both\n * recoverable failures and irrecoverable defects. It allows you to handle, log,\n * or monitor specific error causes without modifying the result of the effect.\n * The full `Cause` object encapsulates the error and its contextual\n * information, making it useful for debugging and understanding failure\n * scenarios in complex workflows.\n *\n * The effect itself is not modified, and any errors or defects remain in the\n * error channel of the original effect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * // Create a task that fails with a NetworkError\n * const task1: Effect.Effect<number, string> = Effect.fail(\"NetworkError\")\n *\n * const tapping1 = Effect.tapErrorCause(task1, (cause) =>\n * Console.log(`error cause: ${cause}`)\n * )\n *\n * Effect.runFork(tapping1)\n * // Output:\n * // error cause: Error: NetworkError\n *\n * // Simulate a severe failure in the system\n * const task2: Effect.Effect<number, string> = Effect.dieMessage(\n * \"Something went wrong\"\n * )\n *\n * const tapping2 = Effect.tapErrorCause(task2, (cause) =>\n * Console.log(`error cause: ${cause}`)\n * )\n *\n * Effect.runFork(tapping2)\n * // Output:\n * // error cause: RuntimeException: Something went wrong\n * // ... stack trace ...\n * ```\n *\n * @since 2.0.0\n * @category Sequencing\n */\nexport const tapErrorCause = effect.tapErrorCause;\n/**\n * Repeats an effect indefinitely until an error occurs.\n *\n * **Details**\n *\n * This function executes an effect repeatedly in an infinite loop. Each\n * iteration is executed sequentially, and the loop continues until the first\n * error occurs. If the effect succeeds, it starts over from the beginning. If\n * the effect fails, the error is propagated, and the loop stops.\n *\n * Be cautious when using this function, as it will run indefinitely unless an\n * error interrupts it. This makes it suitable for long-running processes or\n * continuous polling tasks, but you should ensure proper error handling or\n * combine it with other operators like `timeout` or `schedule` to prevent\n * unintentional infinite loops.\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const forever = effect.forever;\n/**\n * Repeatedly updates a state through an effectful operation until a condition\n * is no longer met.\n *\n * **Details**\n *\n * This function provides a way to implement effectful loops, similar to a\n * `while` loop in JavaScript.\n *\n * ```ts skip-type-checking\n * let result = initial\n *\n * while (options.while(result)) {\n * result = options.body(result)\n * }\n *\n * return result\n * ```\n *\n * It starts with an initial state, checks a\n * condition (`while`), and executes a body operation to update the state if the\n * condition evaluates to `true`. The process repeats until the condition\n * returns `false`.\n *\n * The state is passed between iterations, allowing the body operation to modify\n * it dynamically. The final state after the loop ends is returned as the result\n * of the effect.\n *\n * **When to Use**\n *\n * This is particularly useful for scenarios where looping logic involves\n * asynchronous or side-effectful operations, such as polling or iterative\n * computations that depend on external factors.\n *\n * **Example** (Effectful Iteration)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const result = Effect.iterate(\n * // Initial result\n * 1,\n * {\n * // Condition to continue iterating\n * while: (result) => result <= 5,\n * // Operation to change the result\n * body: (result) => Effect.succeed(result + 1)\n * }\n * )\n *\n * Effect.runPromise(result).then(console.log)\n * // Output: 6\n * ```\n *\n * @since 2.0.0\n * @category Looping\n */\nexport const iterate = effect.iterate;\n/**\n * Repeatedly executes a loop with a state, collecting results or discarding\n * them based on configuration.\n *\n * **Details**\n *\n * This function performs an effectful loop, starting with an initial state and\n * iterating as long as the `while` condition evaluates to `true`, similar to a\n * `while` loop in JavaScript.\n *\n * ```ts skip-type-checking\n * let state = initial\n * const result = []\n *\n * while (options.while(state)) {\n * result.push(options.body(state)) // Perform the effectful operation\n * state = options.step(state) // Update the state\n * }\n *\n * return result\n * ```\n *\n * During each iteration, the `step` function updates the state, and the `body`\n * effect is executed.\n *\n * The results of the body effect can be collected in an array or discarded\n * based on the `discard` option.\n *\n * **Discarding Intermediate Results**\n *\n * - If `discard` is `false` or not provided, the intermediate results are\n * collected into an array and returned as the final result.\n * - If `discard` is `true`, the intermediate results are ignored, and the\n * effect returns `void`.\n *\n * **When to Use**\n *\n * This is useful for implementing loops where you need to perform effectful\n * computations repeatedly, such as processing items in a list, generating\n * values, or performing iterative updates.\n *\n * **Example** (Looping with Collected Results)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // A loop that runs 5 times, collecting each iteration's result\n * const result = Effect.loop(\n * // Initial state\n * 1,\n * {\n * // Condition to continue looping\n * while: (state) => state <= 5,\n * // State update function\n * step: (state) => state + 1,\n * // Effect to be performed on each iteration\n * body: (state) => Effect.succeed(state)\n * }\n * )\n *\n * Effect.runPromise(result).then(console.log)\n * // Output: [1, 2, 3, 4, 5]\n * ```\n *\n * **Example** (Loop with Discarded Results)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const result = Effect.loop(\n * // Initial state\n * 1,\n * {\n * // Condition to continue looping\n * while: (state) => state <= 5,\n * // State update function\n * step: (state) => state + 1,\n * // Effect to be performed on each iteration\n * body: (state) => Console.log(`Currently at state ${state}`),\n * // Discard intermediate results\n * discard: true\n * }\n * )\n *\n * Effect.runPromise(result).then(console.log)\n * // Output:\n * // Currently at state 1\n * // Currently at state 2\n * // Currently at state 3\n * // Currently at state 4\n * // Currently at state 5\n * // undefined\n * ```\n *\n * @since 2.0.0\n * @category Looping\n */\nexport const loop = effect.loop;\n/**\n * Repeats an effect based on a specified schedule or until the first failure.\n *\n * **Details**\n *\n * This function executes an effect repeatedly according to the given schedule.\n * Each repetition occurs after the initial execution of the effect, meaning\n * that the schedule determines the number of additional repetitions. For\n * example, using `Schedule.once` will result in the effect being executed twice\n * (once initially and once as part of the repetition).\n *\n * If the effect succeeds, it is repeated according to the schedule. If it\n * fails, the repetition stops immediately, and the failure is returned.\n *\n * The schedule can also specify delays between repetitions, making it useful\n * for tasks like retrying operations with backoff, periodic execution, or\n * performing a series of dependent actions.\n *\n * You can combine schedules for more advanced repetition logic, such as adding\n * delays, limiting recursions, or dynamically adjusting based on the outcome of\n * each execution.\n *\n * **Example** (Success Example)\n *\n * ```ts\n * import { Effect, Schedule, Console } from \"effect\"\n *\n * const action = Console.log(\"success\")\n * const policy = Schedule.addDelay(Schedule.recurs(2), () => \"100 millis\")\n * const program = Effect.repeat(action, policy)\n *\n * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))\n * ```\n *\n * **Example** (Failure Example)\n *\n * ```ts\n * import { Effect, Schedule } from \"effect\"\n *\n * let count = 0\n *\n * // Define an async effect that simulates an action with possible failures\n * const action = Effect.async<string, string>((resume) => {\n * if (count > 1) {\n * console.log(\"failure\")\n * resume(Effect.fail(\"Uh oh!\"))\n * } else {\n * count++\n * console.log(\"success\")\n * resume(Effect.succeed(\"yay!\"))\n * }\n * })\n *\n * const policy = Schedule.addDelay(Schedule.recurs(2), () => \"100 millis\")\n * const program = Effect.repeat(action, policy)\n *\n * Effect.runPromiseExit(program).then(console.log)\n * ```\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const repeat = schedule_.repeat_combined;\n/**\n * Repeats an effect a specified number of times or until the first failure.\n *\n * **Details**\n *\n * This function executes an effect initially and then repeats it the specified\n * number of times, as long as it succeeds. For example, calling\n * `repeatN(action, 2)` will execute `action` once initially and then repeat it\n * two additional times if there are no failures.\n *\n * If the effect fails during any repetition, the failure is returned, and no\n * further repetitions are attempted.\n *\n * **When to Use**\n *\n * This function is useful for tasks that need to be retried a fixed number of\n * times or for performing repeated actions without requiring a schedule.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const action = Console.log(\"success\")\n * const program = Effect.repeatN(action, 2)\n *\n * Effect.runPromise(program)\n * ```\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const repeatN = effect.repeatN;\n/**\n * Repeats an effect with a schedule, handling failures using a custom handler.\n *\n * **Details**\n *\n * This function allows you to execute an effect repeatedly based on a specified\n * schedule. If the effect fails at any point, a custom failure handler is\n * invoked. The handler is provided with both the failure value and the output\n * of the schedule at the time of failure. This enables advanced error recovery\n * or alternative fallback logic while maintaining flexibility in how\n * repetitions are handled.\n *\n * For example, using a schedule with `recurs(2)` will allow for two additional\n * repetitions after the initial execution, provided the effect succeeds. If a\n * failure occurs during any iteration, the failure handler is invoked to handle\n * the situation.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Schedule } from \"effect\"\n *\n * let count = 0\n *\n * // Define an async effect that simulates an action with possible failures\n * const action = Effect.async<string, string>((resume) => {\n * if (count > 1) {\n * console.log(\"failure\")\n * resume(Effect.fail(\"Uh oh!\"))\n * } else {\n * count++\n * console.log(\"success\")\n * resume(Effect.succeed(\"yay!\"))\n * }\n * })\n *\n * const policy = Schedule.addDelay(\n * Schedule.recurs(2), // Repeat for a maximum of 2 times\n * () => \"100 millis\" // Add a delay of 100 milliseconds between repetitions\n * )\n *\n * const program = Effect.repeatOrElse(action, policy, () =>\n * Effect.sync(() => {\n * console.log(\"orElse\")\n * return count - 1\n * })\n * )\n *\n * Effect.runPromise(program).then((n) => console.log(`repetitions: ${n}`))\n * ```\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const repeatOrElse = schedule_.repeatOrElse_Effect;\n/**\n * Repeats an effect based on a specified schedule.\n *\n * **Details**\n *\n * This function allows you to execute an effect repeatedly according to a given\n * schedule. The schedule determines the timing and number of repetitions. Each\n * repetition can also depend on the decision of the schedule, providing\n * flexibility for complex workflows. This function does not modify the effect's\n * success or failure; it only controls its repetition.\n *\n * For example, you can use a schedule that recurs a specific number of times,\n * adds delays between repetitions, or customizes repetition behavior based on\n * external inputs. The effect runs initially and is repeated according to the\n * schedule.\n *\n * @see {@link scheduleFrom} for a variant that allows the schedule's decision\n * to depend on the result of this effect.\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const schedule = schedule_.schedule_Effect;\n/**\n * Runs an effect repeatedly on a new fiber according to a given schedule.\n *\n * **Details**\n *\n * This function starts the provided effect on a new fiber and runs it\n * repeatedly based on the specified schedule. The repetitions are managed by\n * the schedule's rules, which define the timing and number of iterations. The\n * fiber is attached to the current scope, meaning it is automatically managed\n * and cleaned up when the scope is closed.\n *\n * The function returns a `RuntimeFiber` that allows you to monitor or interact\n * with the running fiber.\n *\n * **When to Use**\n *\n * This is particularly useful for concurrent execution of scheduled tasks or\n * when you want to continue processing without waiting for the repetitions to\n * complete.\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const scheduleForked = schedule_.scheduleForked;\n/**\n * Runs an effect repeatedly according to a schedule, starting from a specified\n * input value.\n *\n * **Details**\n *\n * This function allows you to repeatedly execute an effect based on a schedule.\n * The schedule starts with the given `initial` input value, which is passed to\n * the first execution. Subsequent executions of the effect are controlled by\n * the schedule's rules, using the output of the previous iteration as the input\n * for the next one.\n *\n * The returned effect will complete when the schedule ends or the effect fails,\n * propagating the error.\n *\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const scheduleFrom = schedule_.scheduleFrom_Effect;\n/**\n * @since 2.0.0\n * @category Repetition / Recursion\n */\nexport const whileLoop = core.whileLoop;\n/**\n * Returns a collection of all `FiberRef` values for the fiber running this\n * effect.\n *\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const getFiberRefs = effect.fiberRefs;\n/**\n * Inherits values from all `FiberRef` instances into current fiber.\n *\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const inheritFiberRefs = effect.inheritFiberRefs;\n/**\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const locally = core.fiberRefLocally;\n/**\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const locallyWith = core.fiberRefLocallyWith;\n/**\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const locallyScoped = fiberRuntime.fiberRefLocallyScoped;\n/**\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const locallyScopedWith = fiberRuntime.fiberRefLocallyScopedWith;\n/**\n * Applies the specified changes to the `FiberRef` values for the fiber\n * running this workflow.\n *\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const patchFiberRefs = effect.patchFiberRefs;\n/**\n * Sets the `FiberRef` values for the fiber running this effect to the values\n * in the specified collection of `FiberRef` values.\n *\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const setFiberRefs = effect.setFiberRefs;\n/**\n * Updates the `FiberRef` values for the fiber running this effect using the\n * specified function.\n *\n * @since 2.0.0\n * @category Fiber Refs\n */\nexport const updateFiberRefs = effect.updateFiberRefs;\n/**\n * Checks if an effect has failed.\n *\n * **Details**\n *\n * This function evaluates whether an effect has resulted in a failure. It\n * returns a boolean value wrapped in an effect, with `true` indicating the\n * effect failed and `false` otherwise.\n *\n * The resulting effect cannot fail (`never` in the error channel) but retains\n * the context of the original effect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const failure = Effect.fail(\"Uh oh!\")\n *\n * console.log(Effect.runSync(Effect.isFailure(failure)))\n * // Output: true\n *\n * const defect = Effect.dieMessage(\"BOOM!\")\n *\n * Effect.runSync(Effect.isFailure(defect))\n * // throws: BOOM!\n * ```\n *\n * @since 2.0.0\n * @category Condition Checking\n */\nexport const isFailure = effect.isFailure;\n/**\n * Checks if an effect has succeeded.\n *\n * **Details**\n *\n * This function evaluates whether an effect has resulted in a success. It\n * returns a boolean value wrapped in an effect, with `true` indicating the\n * effect succeeded and `false` otherwise.\n *\n * The resulting effect cannot fail (`never` in the error channel) but retains\n * the context of the original effect.\n *\n * @since 2.0.0\n * @category Condition Checking\n */\nexport const isSuccess = effect.isSuccess;\n/**\n * Handles both success and failure cases of an effect without performing side\n * effects.\n *\n * **Details**\n *\n * `match` lets you define custom handlers for both success and failure\n * scenarios. You provide separate functions to handle each case, allowing you\n * to process the result if the effect succeeds, or handle the error if the\n * effect fails.\n *\n * **When to Use**\n *\n * This is useful for structuring your code to respond differently to success or\n * failure without triggering side effects.\n *\n * **Example** (Handling Both Success and Failure Cases)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const success: Effect.Effect<number, Error> = Effect.succeed(42)\n *\n * const program1 = Effect.match(success, {\n * onFailure: (error) => `failure: ${error.message}`,\n * onSuccess: (value) => `success: ${value}`\n * })\n *\n * // Run and log the result of the successful effect\n * Effect.runPromise(program1).then(console.log)\n * // Output: \"success: 42\"\n *\n * const failure: Effect.Effect<number, Error> = Effect.fail(\n * new Error(\"Uh oh!\")\n * )\n *\n * const program2 = Effect.match(failure, {\n * onFailure: (error) => `failure: ${error.message}`,\n * onSuccess: (value) => `success: ${value}`\n * })\n *\n * // Run and log the result of the failed effect\n * Effect.runPromise(program2).then(console.log)\n * // Output: \"failure: Uh oh!\"\n * ```\n *\n * @see {@link matchEffect} if you need to perform side effects in the handlers.\n *\n * @since 2.0.0\n * @category Matching\n */\nexport const match = effect.match;\n/**\n * Handles failures by matching the cause of failure.\n *\n * **Details**\n *\n * The `matchCause` function allows you to handle failures with access to the\n * full cause of the failure within a fiber.\n *\n * **When to Use**\n *\n * This is useful for differentiating between different types of errors, such as\n * regular failures, defects, or interruptions. You can provide specific\n * handling logic for each failure type based on the cause.\n *\n * **Example** (Handling Different Failure Causes)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task: Effect.Effect<number, Error> = Effect.die(\"Uh oh!\")\n *\n * const program = Effect.matchCause(task, {\n * onFailure: (cause) => {\n * switch (cause._tag) {\n * case \"Fail\":\n * // Handle standard failure\n * return `Fail: ${cause.error.message}`\n * case \"Die\":\n * // Handle defects (unexpected errors)\n * return `Die: ${cause.defect}`\n * case \"Interrupt\":\n * // Handle interruption\n * return `${cause.fiberId} interrupted!`\n * }\n * // Fallback for other causes\n * return \"failed due to other causes\"\n * },\n * onSuccess: (value) =>\n * // task completes successfully\n * `succeeded with ${value} value`\n * })\n *\n * Effect.runPromise(program).then(console.log)\n * // Output: \"Die: Uh oh!\"\n * ```\n *\n * @see {@link matchCauseEffect} if you need to perform side effects in the\n * handlers.\n * @see {@link match} if you don't need to handle the cause of the failure.\n *\n * @since 2.0.0\n * @category Matching\n */\nexport const matchCause = core.matchCause;\n/**\n * Handles failures with access to the cause and allows performing side effects.\n *\n * **Details**\n *\n * The `matchCauseEffect` function works similarly to {@link matchCause}, but it\n * also allows you to perform additional side effects based on the failure\n * cause. This function provides access to the complete cause of the failure,\n * making it possible to differentiate between various failure types, and allows\n * you to respond accordingly while performing side effects (like logging or\n * other operations).\n *\n * **Example** (Handling Different Failure Causes with Side Effects)\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task: Effect.Effect<number, Error> = Effect.die(\"Uh oh!\")\n *\n * const program = Effect.matchCauseEffect(task, {\n * onFailure: (cause) => {\n * switch (cause._tag) {\n * case \"Fail\":\n * // Handle standard failure with a logged message\n * return Console.log(`Fail: ${cause.error.message}`)\n * case \"Die\":\n * // Handle defects (unexpected errors) by logging the defect\n * return Console.log(`Die: ${cause.defect}`)\n * case \"Interrupt\":\n * // Handle interruption and log the fiberId that was interrupted\n * return Console.log(`${cause.fiberId} interrupted!`)\n * }\n * // Fallback for other causes\n * return Console.log(\"failed due to other causes\")\n * },\n * onSuccess: (value) =>\n * // Log success if the task completes successfully\n * Console.log(`succeeded with ${value} value`)\n * })\n *\n * Effect.runPromise(program)\n * // Output: \"Die: Uh oh!\"\n * ```\n *\n * @see {@link matchCause} if you don't need side effects and only want to handle the result or failure.\n * @see {@link matchEffect} if you don't need to handle the cause of the failure.\n *\n * @since 2.0.0\n * @category Matching\n */\nexport const matchCauseEffect = core.matchCauseEffect;\n/**\n * Handles both success and failure cases of an effect, allowing for additional\n * side effects.\n *\n * **Details**\n *\n * The `matchEffect` function is similar to {@link match}, but it enables you to\n * perform side effects in the handlers for both success and failure outcomes.\n *\n * **When to Use**\n *\n * This is useful when you need to execute additional actions, like logging or\n * notifying users, based on whether an effect succeeds or fails.\n *\n * **Example** (Handling Both Success and Failure Cases with Side Effects)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const success: Effect.Effect<number, Error> = Effect.succeed(42)\n * const failure: Effect.Effect<number, Error> = Effect.fail(\n * new Error(\"Uh oh!\")\n * )\n *\n * const program1 = Effect.matchEffect(success, {\n * onFailure: (error) =>\n * Effect.succeed(`failure: ${error.message}`).pipe(\n * Effect.tap(Effect.log)\n * ),\n * onSuccess: (value) =>\n * Effect.succeed(`success: ${value}`).pipe(Effect.tap(Effect.log))\n * })\n *\n * console.log(Effect.runSync(program1))\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=\"success: 42\"\n * // success: 42\n *\n * const program2 = Effect.matchEffect(failure, {\n * onFailure: (error) =>\n * Effect.succeed(`failure: ${error.message}`).pipe(\n * Effect.tap(Effect.log)\n * ),\n * onSuccess: (value) =>\n * Effect.succeed(`success: ${value}`).pipe(Effect.tap(Effect.log))\n * })\n *\n * console.log(Effect.runSync(program2))\n * // Output:\n * // timestamp=... level=INFO fiber=#1 message=\"failure: Uh oh!\"\n * // failure: Uh oh!\n * ```\n *\n * @see {@link match} if you don't need side effects and only want to handle the\n * result or failure.\n *\n * @since 2.0.0\n * @category Matching\n */\nexport const matchEffect = core.matchEffect;\n/**\n * Logs one or more messages or error causes at the current log level.\n *\n * **Details**\n *\n * This function provides a simple way to log messages or error causes during\n * the execution of your effects. By default, logs are recorded at the `INFO`\n * level, but this can be adjusted using other logging utilities\n * (`Logger.withMinimumLogLevel`). Multiple items, including `Cause` instances,\n * can be logged in a single call. When logging `Cause` instances, detailed\n * error information is included in the log output.\n *\n * The log output includes useful metadata like the current timestamp, log\n * level, and fiber ID, making it suitable for debugging and tracking purposes.\n * This function does not interrupt or alter the effect's execution flow.\n *\n * **Example**\n *\n * ```ts\n * import { Cause, Effect } from \"effect\"\n *\n * const program = Effect.log(\n * \"message1\",\n * \"message2\",\n * Cause.die(\"Oh no!\"),\n * Cause.die(\"Oh uh!\")\n * )\n *\n * Effect.runFork(program)\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=message1 message=message2 cause=\"Error: Oh no!\n * // Error: Oh uh!\"\n * ```\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const log = effect.log;\n/**\n * Logs messages or error causes at a specified log level.\n *\n * **Details**\n *\n * This function allows you to log one or more messages or error causes while\n * specifying the desired log level (e.g., DEBUG, INFO, ERROR). It provides\n * flexibility in categorizing logs based on their importance or severity,\n * making it easier to filter logs during debugging or production monitoring.\n *\n * **Example**\n *\n * ```ts\n * import { Cause, Effect, LogLevel } from \"effect\"\n *\n * const program = Effect.logWithLevel(\n * LogLevel.Error,\n * \"Critical error encountered\",\n * Cause.die(\"System failure!\")\n * )\n *\n * Effect.runFork(program)\n * // Output:\n * // timestamp=... level=ERROR fiber=#0 message=Critical error encountered cause=\"Error: System failure!\"\n * ```\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logWithLevel = (level, ...message) => effect.logWithLevel(level)(...message);\n/**\n * Logs messages at the TRACE log level.\n *\n * **Details**\n *\n * This function logs the specified messages at the TRACE level. TRACE logs are\n * typically used for very detailed diagnostic information. These messages are\n * not displayed by default. To view them, you must adjust the logging\n * configuration by setting the minimum log level to `LogLevel.Trace` using\n * `Logger.withMinimumLogLevel`.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Logger, LogLevel } from \"effect\"\n *\n * const program = Effect.logTrace(\"message1\").pipe(Logger.withMinimumLogLevel(LogLevel.Trace))\n *\n * Effect.runFork(program)\n * // timestamp=... level=TRACE fiber=#0 message=message1\n * ```\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logTrace = effect.logTrace;\n/**\n * Logs messages at the DEBUG log level.\n *\n * **Details**\n *\n * This function logs messages at the DEBUG level, which is typically used for\n * diagnosing application behavior during development. DEBUG messages provide\n * less detailed information than TRACE logs but are still not shown by default.\n * To view these logs, adjust the log level using `Logger.withMinimumLogLevel`.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Logger, LogLevel } from \"effect\"\n *\n * const program = Effect.logDebug(\"message1\").pipe(Logger.withMinimumLogLevel(LogLevel.Debug))\n *\n * Effect.runFork(program)\n * // timestamp=... level=DEBUG fiber=#0 message=message1\n * ```\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logDebug = effect.logDebug;\n/**\n * Logs messages at the INFO log level.\n *\n * **Details**\n *\n * This function logs messages at the INFO level, suitable for general\n * application events or operational messages. INFO logs are shown by default\n * and are commonly used for highlighting normal, non-error operations.\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logInfo = effect.logInfo;\n/**\n * Logs messages at the WARNING log level.\n *\n * **Details**\n *\n * This function logs messages at the WARNING level, suitable for highlighting\n * potential issues that are not errors but may require attention. These\n * messages indicate that something unexpected occurred or might lead to errors\n * in the future.\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logWarning = effect.logWarning;\n/**\n * Logs messages at the ERROR log level.\n *\n * **Details**\n *\n * This function logs messages at the ERROR level, suitable for reporting\n * application errors or failures. These logs are typically used for unexpected\n * issues that need immediate attention.\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logError = effect.logError;\n/**\n * Logs messages at the FATAL log level.\n *\n * **Details**\n *\n * This function logs messages at the FATAL level, suitable for reporting\n * critical errors that cause the application to terminate or stop functioning.\n * These logs are typically used for unrecoverable errors that require immediate\n * attention.\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logFatal = effect.logFatal;\n/**\n * Adds a log span to an effect for tracking and logging its execution duration.\n *\n * **Details**\n *\n * This function wraps an effect with a log span, providing performance\n * monitoring and debugging capabilities. The log span tracks the duration of\n * the wrapped effect and logs it with the specified label. This is particularly\n * useful when analyzing time-sensitive operations or understanding the\n * execution time of specific tasks in your application.\n *\n * The logged output will include the label and the total time taken for the\n * operation. The span information is included in the log metadata, making it\n * easy to trace performance metrics in logs.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * yield* Effect.sleep(\"1 second\")\n * yield* Effect.log(\"The job is finished!\")\n * }).pipe(Effect.withLogSpan(\"myspan\"))\n *\n * Effect.runFork(program)\n * // timestamp=... level=INFO fiber=#0 message=\"The job is finished!\" myspan=1011ms\n * ```\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const withLogSpan = effect.withLogSpan;\n/**\n * Adds custom annotations to log entries generated within an effect.\n *\n * **Details**\n *\n * This function allows you to enhance log messages by appending additional\n * context in the form of key-value pairs. These annotations are included in\n * every log message created during the execution of the effect, making the logs\n * more informative and easier to trace.\n *\n * The annotations can be specified as a single key-value pair or as a record of\n * multiple key-value pairs. This is particularly useful for tracking\n * operations, debugging, or associating specific metadata with logs for better\n * observability.\n *\n * The annotated key-value pairs will appear alongside the log message in the\n * output.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * yield* Effect.log(\"message1\")\n * yield* Effect.log(\"message2\")\n * }).pipe(Effect.annotateLogs(\"taskId\", \"1234\")) // Annotation as key/value pair\n *\n * Effect.runFork(program)\n * // timestamp=... level=INFO fiber=#0 message=message1 taskId=1234\n * // timestamp=... level=INFO fiber=#0 message=message2 taskId=1234\n * ```\n *\n * @see {@link annotateLogsScoped} to add log annotations with a limited scope.\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const annotateLogs = effect.annotateLogs;\n/**\n * Adds log annotations with a limited scope to enhance contextual logging.\n *\n * **Details**\n *\n * This function allows you to apply key-value annotations to log entries\n * generated within a specific scope of your effect computations. The\n * annotations are restricted to the defined `Scope`, ensuring that they are\n * only applied to logs produced during that scope. Once the scope ends, the\n * annotations are automatically removed, making it easier to manage\n * context-specific logging without affecting other parts of your application.\n *\n * The annotations can be provided as a single key-value pair or as a record of\n * multiple key-value pairs. This flexibility enables fine-grained control over\n * the additional metadata included in logs for specific tasks or operations.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * yield* Effect.log(\"no annotations\")\n * yield* Effect.annotateLogsScoped({ key: \"value\" })\n * yield* Effect.log(\"message1\") // Annotation is applied to this log\n * yield* Effect.log(\"message2\") // Annotation is applied to this log\n * }).pipe(Effect.scoped, Effect.andThen(Effect.log(\"no annotations again\")))\n *\n * Effect.runFork(program)\n * // timestamp=... level=INFO fiber=#0 message=\"no annotations\"\n * // timestamp=... level=INFO fiber=#0 message=message1 key=value\n * // timestamp=... level=INFO fiber=#0 message=message2 key=value\n * // timestamp=... level=INFO fiber=#0 message=\"no annotations again\"\n * ```\n *\n * @see {@link annotateLogs} to add custom annotations to log entries generated within an effect.\n *\n * @since 3.1.0\n * @category Logging\n */\nexport const annotateLogsScoped = fiberRuntime.annotateLogsScoped;\n/**\n * Retrieves the current log annotations for the current scope.\n *\n * **Details**\n *\n * This function provides access to the log annotations associated with the\n * current scope. Log annotations are key-value pairs that provide additional\n * context to log entries. They are often used to add metadata such as tags,\n * identifiers, or extra debugging information to logs.\n *\n * By using this function, you can inspect or utilize the annotations applied to\n * the current scope, making it easier to trace and debug specific sections of\n * your application.\n *\n * @see {@link annotateLogs} to add custom annotations to log entries generated within an effect.\n * @see {@link annotateLogsScoped} to add log annotations with a limited scope.\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const logAnnotations = effect.logAnnotations;\n/**\n * Configures whether child fibers will log unhandled errors and at what log\n * level.\n *\n * **Details**\n *\n * This function allows you to control whether unhandled errors from child\n * fibers are logged and to specify the log level for these errors. By default,\n * unhandled errors are reported via the logger. However, using this function,\n * you can choose to suppress these logs by passing `Option.none` or adjust the\n * log level to a specific severity, such as `Error`, `Warning`, or `Info`.\n *\n * This configuration is scoped to the effect it is applied to, meaning the\n * changes only apply to the child fibers created within that effect's context.\n * It is especially useful when you want to reduce noise in logs or prioritize\n * certain types of errors.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Fiber, LogLevel, Option } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * const fiber = yield* Effect.fork(Effect.fail(\"Unhandled error!\"))\n * yield* Fiber.join(fiber)\n * })\n *\n * Effect.runFork(program.pipe(Effect.withUnhandledErrorLogLevel(Option.some(LogLevel.Error))))\n * // Output:\n * // timestamp=... level=ERROR fiber=#1 message=\"Fiber terminated with an unhandled error\" cause=\"Error: Unhandled error!\"\n * ```\n *\n * @since 2.0.0\n * @category Logging\n */\nexport const withUnhandledErrorLogLevel = core.withUnhandledErrorLogLevel;\n/**\n * Conditionally executes an effect based on the specified log level and currently enabled log level.\n *\n * **Details**\n *\n * This function runs the provided effect only if the specified log level is\n * enabled. If the log level is enabled, the effect is executed and its result\n * is wrapped in `Some`. If the log level is not enabled, the effect is not\n * executed and `None` is returned.\n *\n * This function is useful for conditionally executing logging-related effects\n * or other operations that depend on the current log level configuration.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Logger, LogLevel } from \"effect\"\n *\n * const program = Effect.gen(function* () {\n * yield* Effect.whenLogLevel(Effect.logTrace(\"message1\"), LogLevel.Trace); // returns `None`\n * yield* Effect.whenLogLevel(Effect.logDebug(\"message2\"), LogLevel.Debug); // returns `Some`\n * }).pipe(Logger.withMinimumLogLevel(LogLevel.Debug));\n *\n * Effect.runFork(program)\n * // timestamp=... level=DEBUG fiber=#0 message=message2\n * ```\n *\n * @see {@link FiberRef.currentMinimumLogLevel} to retrieve the current minimum log level.\n *\n * @since 3.13.0\n * @category Logging\n */\nexport const whenLogLevel = fiberRuntime.whenLogLevel;\n/**\n * Converts an effect's failure into a fiber termination, removing the error\n * from the effect's type.\n *\n * **Details**\n *\n * The `orDie` function is used when you encounter errors that you do not want\n * to handle or recover from. It removes the error type from the effect and\n * ensures that any failure will terminate the fiber. This is useful for\n * propagating failures as defects, signaling that they should not be handled\n * within the effect.\n *\n * **When to Use*\n *\n * Use `orDie` when failures should be treated as unrecoverable defects and no\n * error handling is required.\n *\n * **Example** (Propagating an Error as a Defect)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const divide = (a: number, b: number) =>\n * b === 0\n * ? Effect.fail(new Error(\"Cannot divide by zero\"))\n * : Effect.succeed(a / b)\n *\n * // ┌─── Effect<number, never, never>\n * // ▼\n * const program = Effect.orDie(divide(1, 0))\n *\n * Effect.runPromise(program).catch(console.error)\n * // Output:\n * // (FiberFailure) Error: Cannot divide by zero\n * // ...stack trace...\n * ```\n *\n * @see {@link orDieWith} if you need to customize the error.\n *\n * @since 2.0.0\n * @category Converting Failures to Defects\n */\nexport const orDie = core.orDie;\n/**\n * Converts an effect's failure into a fiber termination with a custom error.\n *\n * **Details**\n *\n * The `orDieWith` function behaves like {@link orDie}, but it allows you to provide a mapping\n * function to transform the error before terminating the fiber. This is useful for cases where\n * you want to include a more detailed or user-friendly error when the failure is propagated\n * as a defect.\n *\n * **When to Use**\n *\n * Use `orDieWith` when failures should terminate the fiber as defects, and you want to customize\n * the error for clarity or debugging purposes.\n *\n * **Example** (Customizing Defect)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const divide = (a: number, b: number) =>\n * b === 0\n * ? Effect.fail(new Error(\"Cannot divide by zero\"))\n * : Effect.succeed(a / b)\n *\n * // ┌─── Effect<number, never, never>\n * // ▼\n * const program = Effect.orDieWith(\n * divide(1, 0),\n * (error) => new Error(`defect: ${error.message}`)\n * )\n *\n * Effect.runPromise(program).catch(console.error)\n * // Output:\n * // (FiberFailure) Error: defect: Cannot divide by zero\n * // ...stack trace...\n * ```\n *\n * @see {@link orDie} if you don't need to customize the error.\n *\n * @since 2.0.0\n * @category Converting Failures to Defects\n */\nexport const orDieWith = core.orDieWith;\n/**\n * Attempts one effect, and if it fails, falls back to another effect.\n *\n * **Details**\n *\n * This function allows you to try executing an effect, and if it fails\n * (produces an error), a fallback effect is executed instead. The fallback\n * effect is defined as a lazy argument, meaning it will only be evaluated if\n * the first effect fails. This provides a way to recover from errors by\n * specifying an alternative path of execution.\n *\n * The error type of the resulting effect will be that of the fallback effect,\n * as the first effect's error is replaced when the fallback is executed.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const success = Effect.succeed(\"success\")\n * const failure = Effect.fail(\"failure\")\n * const fallback = Effect.succeed(\"fallback\")\n *\n * // Try the success effect first, fallback is not used\n * const program1 = Effect.orElse(success, () => fallback)\n * console.log(Effect.runSync(program1))\n * // Output: \"success\"\n *\n * // Try the failure effect first, fallback is used\n * const program2 = Effect.orElse(failure, () => fallback)\n * console.log(Effect.runSync(program2))\n * // Output: \"fallback\"\n * ```\n *\n * @see {@link catchAll} if you need to access the error in the fallback effect.\n *\n * @since 2.0.0\n * @category Fallback\n */\nexport const orElse = core.orElse;\n/**\n * Replaces the failure of an effect with a custom failure value.\n *\n * **Details**\n *\n * This function allows you to handle the failure of an effect by replacing it\n * with a predefined failure value. If the effect fails, the new failure value\n * provided by the `evaluate` function will be returned instead of the original\n * failure. If the effect succeeds, the original success value is returned\n * unchanged.\n *\n * **When to Use**\n *\n * This is particularly useful when you want to standardize error handling or\n * provide a consistent failure value for specific operations. It simplifies\n * error management by ensuring that all failures are replaced with a controlled\n * alternative.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const validate = (age: number): Effect.Effect<number, string> => {\n * if (age < 0) {\n * return Effect.fail(\"NegativeAgeError\")\n * } else if (age < 18) {\n * return Effect.fail(\"IllegalAgeError\")\n * } else {\n * return Effect.succeed(age)\n * }\n * }\n *\n * const program = Effect.orElseFail(validate(-1), () => \"invalid age\")\n *\n * console.log(Effect.runSyncExit(program))\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: { _id: 'Cause', _tag: 'Fail', failure: 'invalid age' }\n * // }\n * ```\n *\n * @see {@link mapError} if you need to access the error to transform it.\n *\n * @since 2.0.0\n * @category Fallback\n */\nexport const orElseFail = effect.orElseFail;\n/**\n * Ensures the effect always succeeds by replacing failures with a default\n * success value.\n *\n * **Details**\n *\n * This function transforms an effect that may fail into one that cannot fail by\n * replacing any failure with a provided success value. If the original effect\n * fails, the failure is \"swallowed,\" and the specified success value is\n * returned instead. If the original effect succeeds, its value remains\n * unchanged.\n *\n * **When to Use**\n *\n * This is especially useful for providing default values in case of failure,\n * ensuring that an effect always completes successfully. By using this\n * function, you can avoid the need for complex error handling and guarantee a\n * fallback result.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const validate = (age: number): Effect.Effect<number, string> => {\n * if (age < 0) {\n * return Effect.fail(\"NegativeAgeError\")\n * } else if (age < 18) {\n * return Effect.fail(\"IllegalAgeError\")\n * } else {\n * return Effect.succeed(age)\n * }\n * }\n *\n * const program = Effect.orElseSucceed(validate(-1), () => 18)\n *\n * console.log(Effect.runSyncExit(program))\n * // Output:\n * // { _id: 'Exit', _tag: 'Success', value: 18 }\n * ```\n *\n * @since 2.0.0\n * @category Fallback\n */\nexport const orElseSucceed = effect.orElseSucceed;\n/**\n * Runs a sequence of effects and returns the result of the first successful\n * one.\n *\n * **Details**\n *\n * This function allows you to execute a collection of effects in sequence,\n * stopping at the first success. If an effect succeeds, its result is\n * immediately returned, and no further effects in the sequence are executed.\n * However, if all the effects fail, the function will return the error of the\n * last effect.\n *\n * The execution is sequential, meaning that effects are evaluated one at a time\n * in the order they are provided. This ensures predictable behavior and avoids\n * unnecessary computations.\n *\n * If the collection of effects is empty, an `IllegalArgumentException` is\n * thrown, indicating that the operation is invalid without any effects to try.\n *\n * **When to Use**\n *\n * This is particularly useful when you have multiple fallback strategies or\n * alternative sources to obtain a result, such as attempting multiple APIs,\n * retrieving configurations, or accessing resources in a prioritized manner.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * interface Config {\n * host: string\n * port: number\n * apiKey: string\n * }\n *\n * // Create a configuration object with sample values\n * const makeConfig = (name: string): Config => ({\n * host: `${name}.example.com`,\n * port: 8080,\n * apiKey: \"12345-abcde\"\n * })\n *\n * // Simulate retrieving configuration from a remote node\n * const remoteConfig = (name: string): Effect.Effect<Config, Error> =>\n * Effect.gen(function* () {\n * // Simulate node3 being the only one with available config\n * if (name === \"node3\") {\n * yield* Console.log(`Config for ${name} found`)\n * return makeConfig(name)\n * } else {\n * yield* Console.log(`Unavailable config for ${name}`)\n * return yield* Effect.fail(new Error(`Config not found for ${name}`))\n * }\n * })\n *\n * // Define the master configuration and potential fallback nodes\n * const masterConfig = remoteConfig(\"master\")\n * const nodeConfigs = [\"node1\", \"node2\", \"node3\", \"node4\"].map(remoteConfig)\n *\n * // Attempt to find a working configuration,\n * // starting with the master and then falling back to other nodes\n * const config = Effect.firstSuccessOf([masterConfig, ...nodeConfigs])\n *\n * // Run the effect to retrieve the configuration\n * const result = Effect.runSync(config)\n *\n * console.log(result)\n * // Output:\n * // Unavailable config for master\n * // Unavailable config for node1\n * // Unavailable config for node2\n * // Config for node3 found\n * // { host: 'node3.example.com', port: 8080, apiKey: '12345-abcde' }\n * ```\n *\n * @since 2.0.0\n * @category Fallback\n */\nexport const firstSuccessOf = effect.firstSuccessOf;\n/**\n * Retrieves the `Random` service from the context.\n *\n * @since 2.0.0\n * @category Random\n */\nexport const random = effect.random;\n/**\n * Retrieves the `Random` service from the context and uses it to run the\n * specified effect.\n *\n * @since 2.0.0\n * @category Random\n */\nexport const randomWith = defaultServices.randomWith;\n/**\n * Executes the specified effect with the specified implementation of the\n * `Random` service.\n *\n * @since 2.0.0\n * @category Random\n */\nexport const withRandom = defaultServices.withRandom;\n/**\n * Executes the specified effect with a `Random` service that cycles through\n * a provided array of values.\n *\n * @example\n * ```ts\n * import { Effect, Random } from \"effect\"\n *\n * Effect.gen(function*() {\n * console.log(yield* Random.next) // 0.2\n * console.log(yield* Random.next) // 0.5\n * console.log(yield* Random.next) // 0.8\n * }).pipe(Effect.withRandomFixed([0.2, 0.5, 0.8]))\n * ```\n *\n * @since 3.11.0\n * @category Random\n */\nexport const withRandomFixed = /*#__PURE__*/dual(2, (effect, values) => withRandom(effect, Random.fixed(values)));\n/**\n * Sets the implementation of the `Random` service to the specified value and\n * restores it to its original value when the scope is closed.\n *\n * @since 2.0.0\n * @category Random\n */\nexport const withRandomScoped = fiberRuntime.withRandomScoped;\n/**\n * Returns an effect that accesses the runtime, which can be used to (unsafely)\n * execute tasks.\n *\n * **When to Use**\n *\n * This is useful for integration with legacy code that must call back into\n * Effect code.\n *\n * @since 2.0.0\n * @category Runtime\n */\nexport const runtime = runtime_.runtime;\n/**\n * Retrieves an effect that succeeds with the current runtime flags, which\n * govern behavior and features of the runtime system.\n *\n * @since 2.0.0\n * @category Runtime\n */\nexport const getRuntimeFlags = core.runtimeFlags;\n/**\n * @since 2.0.0\n * @category Runtime\n */\nexport const patchRuntimeFlags = core.updateRuntimeFlags;\n/**\n * @since 2.0.0\n * @category Runtime\n */\nexport const withRuntimeFlagsPatch = core.withRuntimeFlags;\n/**\n * @since 2.0.0\n * @category Runtime\n */\nexport const withRuntimeFlagsPatchScoped = fiberRuntime.withRuntimeFlagsScoped;\n/**\n * Tags each metric in an effect with specific key-value pairs.\n *\n * **Details**\n *\n * This function allows you to tag all metrics in an effect with a set of\n * key-value pairs or a single key-value pair. Tags help you add metadata to\n * metrics, making it easier to filter and categorize them in monitoring\n * systems. The provided tags will apply to all metrics generated within the\n * effect's scope.\n *\n * @since 2.0.0\n * @category Metrics\n */\nexport const tagMetrics = effect.tagMetrics;\n/**\n * Adds labels to metrics within an effect using `MetricLabel` objects.\n *\n * **Details**\n *\n * This function allows you to label metrics using `MetricLabel` objects. Labels\n * help add structured metadata to metrics for categorization and filtering in\n * monitoring systems. The provided labels will apply to all metrics within the\n * effect's execution.\n *\n * @since 2.0.0\n * @category Metrics\n */\nexport const labelMetrics = effect.labelMetrics;\n/**\n * Tags metrics within a scope with a specific key-value pair.\n *\n * **Details**\n *\n * This function tags all metrics within a scope with the provided key-value\n * pair. Once the scope is closed, the tag is automatically removed. This is\n * useful for applying temporary context-specific tags to metrics during scoped\n * operations.\n *\n * @since 2.0.0\n * @category Metrics\n */\nexport const tagMetricsScoped = fiberRuntime.tagMetricsScoped;\n/**\n * Adds labels to metrics within a scope using `MetricLabel` objects.\n *\n * **Details**\n *\n * This function allows you to apply labels to all metrics generated within a\n * specific scope using an array of `MetricLabel` objects. These labels provide\n * additional metadata to metrics, which can be used for categorization,\n * filtering, or monitoring purposes. The labels are scoped and will be removed\n * automatically once the scope is closed, ensuring they are only applied\n * temporarily within the defined context.\n *\n * @since 2.0.0\n * @category Metrics\n */\nexport const labelMetricsScoped = fiberRuntime.labelMetricsScoped;\n/**\n * Retrieves the metric labels associated with the current scope.\n *\n * @since 2.0.0\n * @category Metrics\n */\nexport const metricLabels = core.metricLabels;\n/**\n * Associates a metric with the current effect, updating it as the effect progresses.\n *\n * @since 2.0.0\n * @category Metrics\n */\nexport const withMetric = effect.withMetric;\n/**\n * Unsafely creates a new Semaphore.\n *\n * @since 2.0.0\n * @category Semaphore\n */\nexport const unsafeMakeSemaphore = circular.unsafeMakeSemaphore;\n/**\n * Creates a new semaphore with the specified number of permits.\n *\n * **Details**\n *\n * This function initializes a semaphore that controls concurrent access to a\n * shared resource. The number of permits determines how many tasks can access\n * the resource concurrently.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Create a semaphore with 3 permits\n * const mutex = Effect.makeSemaphore(3)\n * ```\n *\n * @since 2.0.0\n * @category Semaphore\n */\nexport const makeSemaphore = circular.makeSemaphore;\n/**\n * @category Latch\n * @since 3.8.0\n */\nexport const unsafeMakeLatch = circular.unsafeMakeLatch;\n/**\n * Creates a new `Latch`, starting in the specified state.\n *\n * **Details**\n *\n * This function initializes a `Latch` safely, ensuring proper runtime\n * guarantees. By default, the latch starts in the closed state.\n *\n * **Example**\n *\n * ```ts\n * import { Console, Effect } from \"effect\"\n *\n * const program = Effect.gen(function*() {\n * // Create a latch, starting in the closed state\n * const latch = yield* Effect.makeLatch(false)\n *\n * // Fork a fiber that logs \"open sesame\" when the latch is opened\n * const fiber = yield* Console.log(\"open sesame\").pipe(\n * latch.whenOpen,\n * Effect.fork\n * )\n *\n * yield* Effect.sleep(\"1 second\")\n *\n * // Open the latch\n * yield* latch.open\n * yield* fiber.await\n * })\n *\n * Effect.runFork(program)\n * // Output: open sesame (after 1 second)\n * ```\n *\n * @category Latch\n * @since 3.8.0\n */\nexport const makeLatch = circular.makeLatch;\n/**\n * Runs an effect in the background, returning a fiber that can be observed or\n * interrupted.\n *\n * Unless you specifically need a `Promise` or synchronous operation, `runFork`\n * is a good default choice.\n *\n * **Details**\n *\n * This function is the foundational way to execute an effect in the background.\n * It creates a \"fiber,\" a lightweight, cooperative thread of execution that can\n * be observed (to access its result), interrupted, or joined. Fibers are useful\n * for concurrent programming and allow effects to run independently of the main\n * program flow.\n *\n * Once the effect is running in a fiber, you can monitor its progress, cancel\n * it if necessary, or retrieve its result when it completes. If the effect\n * fails, the fiber will propagate the failure, which you can observe and\n * handle.\n *\n * **When to Use**\n *\n * Use this function when you need to run an effect in the background,\n * especially if the effect is long-running or performs periodic tasks. It's\n * suitable for tasks that need to run independently but might still need\n * observation or management, like logging, monitoring, or scheduled tasks.\n *\n * This function is ideal if you don't need the result immediately or if the\n * effect is part of a larger concurrent workflow.\n *\n * **Example** (Running an Effect in the Background)\n *\n * ```ts\n * import { Effect, Console, Schedule, Fiber } from \"effect\"\n *\n * // ┌─── Effect<number, never, never>\n * // ▼\n * const program = Effect.repeat(\n * Console.log(\"running...\"),\n * Schedule.spaced(\"200 millis\")\n * )\n *\n * // ┌─── RuntimeFiber<number, never>\n * // ▼\n * const fiber = Effect.runFork(program)\n *\n * setTimeout(() => {\n * Effect.runFork(Fiber.interrupt(fiber))\n * }, 500)\n * ```\n *\n * @since 2.0.0\n * @category Running Effects\n */\nexport const runFork = runtime_.unsafeForkEffect;\n/**\n * Executes an effect asynchronously and handles the result using a callback.\n *\n * **Details**\n *\n * This function runs an effect asynchronously and passes the result (`Exit`) to\n * a specified callback. The callback is invoked with the outcome of the effect:\n * - On success, the callback receives the successful result.\n * - On failure, the callback receives the failure information.\n *\n * **When to Use**\n *\n * This function is effectful and should only be invoked at the edges of your\n * program.\n *\n * @since 2.0.0\n * @category Running Effects\n */\nexport const runCallback = runtime_.unsafeRunEffect;\n/**\n * Executes an effect and returns the result as a `Promise`.\n *\n * **Details**\n *\n * This function runs an effect and converts its result into a `Promise`. If the\n * effect succeeds, the `Promise` will resolve with the successful result. If\n * the effect fails, the `Promise` will reject with an error, which includes the\n * failure details of the effect.\n *\n * The optional `options` parameter allows you to pass an `AbortSignal` for\n * cancellation, enabling more fine-grained control over asynchronous tasks.\n *\n * **When to Use**\n *\n * Use this function when you need to execute an effect and work with its result\n * in a promise-based system, such as when integrating with third-party\n * libraries that expect `Promise` results.\n *\n * **Example** (Running a Successful Effect as a Promise)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * Effect.runPromise(Effect.succeed(1)).then(console.log)\n * // Output: 1\n * ```\n *\n * **Example** (Handling a Failing Effect as a Rejected Promise)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * Effect.runPromise(Effect.fail(\"my error\")).catch(console.error)\n * // Output:\n * // (FiberFailure) Error: my error\n * ```\n *\n * @see {@link runPromiseExit} for a version that returns an `Exit` type instead\n * of rejecting.\n *\n * @since 2.0.0\n * @category Running Effects\n */\nexport const runPromise = runtime_.unsafeRunPromiseEffect;\n/**\n * Runs an effect and returns a `Promise` that resolves to an `Exit`,\n * representing the outcome.\n *\n * **Details**\n *\n * This function executes an effect and resolves to an `Exit` object. The `Exit`\n * type provides detailed information about the result of the effect:\n * - If the effect succeeds, the `Exit` will be of type `Success` and include\n * the value produced by the effect.\n * - If the effect fails, the `Exit` will be of type `Failure` and contain a\n * `Cause` object, detailing the failure.\n *\n * Using this function allows you to examine both successful results and failure\n * cases in a unified way, while still leveraging `Promise` for handling the\n * asynchronous behavior of the effect.\n *\n * **When to Use**\n *\n * Use this function when you need to understand the outcome of an effect,\n * whether it succeeded or failed, and want to work with this result using\n * `Promise` syntax. This is particularly useful when integrating with systems\n * that rely on promises but need more detailed error handling than a simple\n * rejection.\n *\n * **Example** (Handling Results as Exit)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // Execute a successful effect and get the Exit result as a Promise\n * Effect.runPromiseExit(Effect.succeed(1)).then(console.log)\n * // Output:\n * // {\n * // _id: \"Exit\",\n * // _tag: \"Success\",\n * // value: 1\n * // }\n *\n * // Execute a failing effect and get the Exit result as a Promise\n * Effect.runPromiseExit(Effect.fail(\"my error\")).then(console.log)\n * // Output:\n * // {\n * // _id: \"Exit\",\n * // _tag: \"Failure\",\n * // cause: {\n * // _id: \"Cause\",\n * // _tag: \"Fail\",\n * // failure: \"my error\"\n * // }\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Running Effects\n */\nexport const runPromiseExit = runtime_.unsafeRunPromiseExitEffect;\n/**\n * Executes an effect synchronously, running it immediately and returning the\n * result.\n *\n * **Details**\n *\n * This function evaluates the provided effect synchronously, returning its\n * result directly. It is ideal for effects that do not fail or include\n * asynchronous operations. If the effect does fail or involves async tasks, it\n * will throw an error. Execution stops at the point of failure or asynchronous\n * operation, making it unsuitable for effects that require asynchronous\n * handling.\n *\n * **Important**: Attempting to run effects that involve asynchronous operations\n * or failures will result in exceptions being thrown, so use this function with\n * care for purely synchronous and error-free effects.\n *\n * **When to Use**\n *\n * Use this function when:\n * - You are sure that the effect will not fail or involve asynchronous\n * operations.\n * - You need a direct, synchronous result from the effect.\n * - You are working within a context where asynchronous effects are not\n * allowed.\n *\n * Avoid using this function for effects that can fail or require asynchronous\n * handling. For such cases, consider using {@link runPromise} or\n * {@link runSyncExit}.\n *\n * **Example** (Synchronous Logging)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const program = Effect.sync(() => {\n * console.log(\"Hello, World!\")\n * return 1\n * })\n *\n * const result = Effect.runSync(program)\n * // Output: Hello, World!\n *\n * console.log(result)\n * // Output: 1\n * ```\n *\n * **Example** (Incorrect Usage with Failing or Async Effects)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * try {\n * // Attempt to run an effect that fails\n * Effect.runSync(Effect.fail(\"my error\"))\n * } catch (e) {\n * console.error(e)\n * }\n * // Output:\n * // (FiberFailure) Error: my error\n *\n * try {\n * // Attempt to run an effect that involves async work\n * Effect.runSync(Effect.promise(() => Promise.resolve(1)))\n * } catch (e) {\n * console.error(e)\n * }\n * // Output:\n * // (FiberFailure) AsyncFiberException: Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work\n * ```\n *\n * @see {@link runSyncExit} for a version that returns an `Exit` type instead of\n * throwing an error.\n *\n * @since 2.0.0\n * @category Running Effects\n */\nexport const runSync = runtime_.unsafeRunSyncEffect;\n/**\n * Runs an effect synchronously and returns the result as an `Exit` type.\n *\n * **Details**\n *\n * This function executes the provided effect synchronously and returns an `Exit`\n * type that encapsulates the outcome of the effect:\n * - If the effect succeeds, the result is wrapped in a `Success`.\n * - If the effect fails, it returns a `Failure` containing a `Cause` that explains\n * the failure.\n *\n * If the effect involves asynchronous operations, this function will return a `Failure`\n * with a `Die` cause, indicating that it cannot resolve the effect synchronously.\n * This makes the function suitable for use only with effects that are synchronous\n * in nature.\n *\n * **When to Use**\n *\n * Use this function when:\n * - You want to handle both success and failure outcomes in a structured way using the `Exit` type.\n * - You are working with effects that are purely synchronous and do not involve asynchronous operations.\n * - You need to debug or inspect failures, including their causes, in a detailed manner.\n *\n * Avoid using this function for effects that involve asynchronous operations, as it will fail with a `Die` cause.\n *\n * **Example** (Handling Results as Exit)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * console.log(Effect.runSyncExit(Effect.succeed(1)))\n * // Output:\n * // {\n * // _id: \"Exit\",\n * // _tag: \"Success\",\n * // value: 1\n * // }\n *\n * console.log(Effect.runSyncExit(Effect.fail(\"my error\")))\n * // Output:\n * // {\n * // _id: \"Exit\",\n * // _tag: \"Failure\",\n * // cause: {\n * // _id: \"Cause\",\n * // _tag: \"Fail\",\n * // failure: \"my error\"\n * // }\n * // }\n * ```\n *\n * **Example** (Asynchronous Operation Resulting in Die)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * console.log(Effect.runSyncExit(Effect.promise(() => Promise.resolve(1))))\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Die',\n * // defect: [Fiber #0 cannot be resolved synchronously. This is caused by using runSync on an effect that performs async work] {\n * // fiber: [FiberRuntime],\n * // _tag: 'AsyncFiberException',\n * // name: 'AsyncFiberException'\n * // }\n * // }\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Running Effects\n */\nexport const runSyncExit = runtime_.unsafeRunSyncExitEffect;\n/**\n * Combines multiple effects and accumulates both successes and failures.\n *\n * **Details**\n *\n * This function allows you to combine multiple effects, continuing through all\n * effects even if some of them fail. Unlike other functions that stop execution\n * upon encountering an error, this function collects all errors into a `Cause`.\n * The final result includes all successes and the accumulated failures.\n *\n * By default, effects are executed sequentially, but you can control\n * concurrency and batching behavior using the `options` parameter. This\n * provides flexibility in scenarios where you want to maximize performance or\n * ensure specific ordering.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Console } from \"effect\"\n *\n * const task1 = Console.log(\"task1\").pipe(Effect.as(1))\n * const task2 = Effect.fail(\"Oh uh!\").pipe(Effect.as(2))\n * const task3 = Console.log(\"task2\").pipe(Effect.as(3))\n * const task4 = Effect.fail(\"Oh no!\").pipe(Effect.as(4))\n *\n * const program = task1.pipe(\n * Effect.validate(task2),\n * Effect.validate(task3),\n * Effect.validate(task4)\n * )\n *\n * Effect.runPromiseExit(program).then(console.log)\n * // Output:\n * // task1\n * // task2\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Sequential',\n * // left: { _id: 'Cause', _tag: 'Fail', failure: 'Oh uh!' },\n * // right: { _id: 'Cause', _tag: 'Fail', failure: 'Oh no!' }\n * // }\n * // }\n * ```\n *\n * @see {@link zip} for a version that stops at the first error.\n *\n * @since 2.0.0\n * @category Error Accumulation\n */\nexport const validate = fiberRuntime.validate;\n/**\n * Sequentially combines two effects using a specified combiner function while\n * accumulating errors.\n *\n * **Details**\n *\n * This function combines two effects, `self` and `that`, into a single effect\n * by applying the provided combiner function to their results. If both effects\n * succeed, the combiner function is applied to their results to produce the\n * final value. If either effect fails, the failures are accumulated into a\n * combined `Cause`.\n *\n * By default, effects are executed sequentially. However, the execution mode\n * can be controlled using the `options` parameter to enable concurrency,\n * batching, or customized finalizer behavior.\n *\n * @since 2.0.0\n * @category Error Accumulation\n */\nexport const validateWith = fiberRuntime.validateWith;\n/**\n * Combines two effects into a single effect, producing a tuple of their\n * results.\n *\n * **Details**\n *\n * This function combines two effects, `self` and `that`, into one. It executes\n * the first effect (`self`) and then the second effect (`that`), collecting\n * their results into a tuple. Both effects must succeed for the resulting\n * effect to succeed. If either effect fails, the entire operation fails.\n *\n * By default, the effects are executed sequentially. If the `concurrent` option\n * is set to `true`, the effects will run concurrently, potentially improving\n * performance for independent operations.\n *\n * **Example** (Combining Two Effects Sequentially)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task1 = Effect.succeed(1).pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Effect.log(\"task1 done\"))\n * )\n * const task2 = Effect.succeed(\"hello\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Effect.log(\"task2 done\"))\n * )\n *\n * // Combine the two effects together\n * //\n * // ┌─── Effect<[number, string], never, never>\n * // ▼\n * const program = Effect.zip(task1, task2)\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=\"task1 done\"\n * // timestamp=... level=INFO fiber=#0 message=\"task2 done\"\n * // [ 1, 'hello' ]\n * ```\n *\n * **Example** (Combining Two Effects Concurrently)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task1 = Effect.succeed(1).pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Effect.log(\"task1 done\"))\n * )\n * const task2 = Effect.succeed(\"hello\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Effect.log(\"task2 done\"))\n * )\n *\n * // Run both effects concurrently using the concurrent option\n * const program = Effect.zip(task1, task2, { concurrent: true })\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=\"task2 done\"\n * // timestamp=... level=INFO fiber=#0 message=\"task1 done\"\n * // [ 1, 'hello' ]\n * ```\n *\n * @see {@link zipWith} for a version that combines the results with a custom\n * function.\n * @see {@link validate} for a version that accumulates errors.\n *\n * @since 2.0.0\n * @category Zipping\n */\nexport const zip = fiberRuntime.zipOptions;\n/**\n * Executes two effects sequentially, returning the result of the first effect\n * and ignoring the result of the second.\n *\n * **Details**\n *\n * This function allows you to run two effects in sequence, where the result of\n * the first effect is preserved, and the result of the second effect is\n * discarded. By default, the two effects are executed sequentially. If you need\n * them to run concurrently, you can pass the `{ concurrent: true }` option.\n *\n * The second effect will always be executed, even though its result is ignored.\n * This makes it useful for cases where you want to execute an effect for its\n * side effects while keeping the result of another effect.\n *\n * **When to Use**\n *\n * Use this function when you are only interested in the result of the first\n * effect but still need to run the second effect for its side effects, such as\n * logging or performing a cleanup action.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task1 = Effect.succeed(1).pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Effect.log(\"task1 done\"))\n * )\n * const task2 = Effect.succeed(\"hello\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Effect.log(\"task2 done\"))\n * )\n *\n * const program = Effect.zipLeft(task1, task2)\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=\"task1 done\"\n * // timestamp=... level=INFO fiber=#0 message=\"task2 done\"\n * // 1\n * ```\n *\n * @see {@link zipRight} for a version that returns the result of the second\n * effect.\n *\n * @since 2.0.0\n * @category Zipping\n */\nexport const zipLeft = fiberRuntime.zipLeftOptions;\n/**\n * Executes two effects sequentially, returning the result of the second effect\n * while ignoring the result of the first.\n *\n * **Details**\n *\n * This function allows you to run two effects in sequence, keeping the result\n * of the second effect and discarding the result of the first. By default, the\n * two effects are executed sequentially. If you need them to run concurrently,\n * you can pass the `{ concurrent: true }` option.\n *\n * The first effect will always be executed, even though its result is ignored.\n * This makes it useful for scenarios where the first effect is needed for its\n * side effects, but only the result of the second effect is important.\n *\n * **When to Use**\n *\n * Use this function when you are only interested in the result of the second\n * effect but still need to run the first effect for its side effects, such as\n * initialization or setup tasks.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task1 = Effect.succeed(1).pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Effect.log(\"task1 done\"))\n * )\n * const task2 = Effect.succeed(\"hello\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Effect.log(\"task2 done\"))\n * )\n *\n * const program = Effect.zipRight(task1, task2)\n *\n * Effect.runPromise(program).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#0 message=\"task1 done\"\n * // timestamp=... level=INFO fiber=#0 message=\"task2 done\"\n * // hello\n * ```\n *\n * @see {@link zipLeft} for a version that returns the result of the first\n * effect.\n *\n * @since 2.0.0\n * @category Zipping\n */\nexport const zipRight = fiberRuntime.zipRightOptions;\n/**\n * Combines two effects sequentially and applies a function to their results to\n * produce a single value.\n *\n * **Details**\n *\n * This function runs two effects in sequence (or concurrently, if the `{\n * concurrent: true }` option is provided) and combines their results using a\n * provided function. Unlike {@link zip}, which returns a tuple of the results,\n * this function processes the results with a custom function to produce a\n * single output.\n *\n * **Example** (Combining Effects with a Custom Function)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const task1 = Effect.succeed(1).pipe(\n * Effect.delay(\"200 millis\"),\n * Effect.tap(Effect.log(\"task1 done\"))\n * )\n * const task2 = Effect.succeed(\"hello\").pipe(\n * Effect.delay(\"100 millis\"),\n * Effect.tap(Effect.log(\"task2 done\"))\n * )\n *\n * const task3 = Effect.zipWith(\n * task1,\n * task2,\n * // Combines results into a single value\n * (number, string) => number + string.length\n * )\n *\n * Effect.runPromise(task3).then(console.log)\n * // Output:\n * // timestamp=... level=INFO fiber=#3 message=\"task1 done\"\n * // timestamp=... level=INFO fiber=#2 message=\"task2 done\"\n * // 6\n * ```\n *\n * @since 2.0.0\n * @category Zipping\n */\nexport const zipWith = fiberRuntime.zipWithOptions;\n/**\n * Applies the function produced by one effect to the value produced by another effect.\n *\n * **Details**\n *\n * This function combines two effects:\n * - The first effect produces a function of type `(a: A) => B`.\n * - The second effect produces a value of type `A`.\n *\n * Once both effects complete successfully, the function is applied to the value, resulting in an effect that produces a value of type `B`.\n *\n * @since 2.0.0\n */\nexport const ap = /*#__PURE__*/dual(2, (self, that) => zipWith(self, that, (f, a) => f(a)));\n/**\n * @category Requests & Batching\n * @since 2.0.0\n */\nexport const blocked = core.blocked;\n/**\n * @category Requests & Batching\n * @since 2.0.0\n */\nexport const runRequestBlock = core.runRequestBlock;\n/**\n * @category Requests & Batching\n * @since 2.0.0\n */\nexport const step = core.step;\n/**\n * @since 2.0.0\n * @category Requests & Batching\n */\nexport const request = /*#__PURE__*/dual(args => Request.isRequest(args[0]), query.fromRequest);\n/**\n * @since 2.0.0\n * @category Requests & Batching\n */\nexport const cacheRequestResult = query.cacheRequest;\n/**\n * @since 2.0.0\n * @category Requests & Batching\n */\nexport const withRequestBatching = core.withRequestBatching;\n/**\n * @since 2.0.0\n * @category Requests & Batching\n */\nexport const withRequestCaching = query.withRequestCaching;\n/**\n * @since 2.0.0\n * @category Requests & Batching\n */\nexport const withRequestCache = query.withRequestCache;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const tracer = effect.tracer;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const tracerWith = defaultServices.tracerWith;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const withTracer = defaultServices.withTracer;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const withTracerScoped = fiberRuntime.withTracerScoped;\n/**\n * Disable the tracer for the given Effect.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * Effect.succeed(42).pipe(\n * Effect.withSpan(\"my-span\"),\n * // the span will not be registered with the tracer\n * Effect.withTracerEnabled(false)\n * )\n * ```\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const withTracerEnabled = core.withTracerEnabled;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const withTracerTiming = core.withTracerTiming;\n/**\n * Adds annotations to each span in the effect for enhanced traceability.\n *\n * **Details**\n *\n * This function lets you attach key-value annotations to all spans generated\n * during the execution of an effect. Annotations provide additional context,\n * such as metadata or labels, which can help you understand and debug\n * asynchronous workflows more effectively.\n *\n * You can either pass a single key-value pair or a record of key-value pairs to\n * annotate the spans. These annotations can then be visualized in tracing tools\n * that support span annotations.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const annotateSpans = effect.annotateSpans;\n/**\n * Adds annotations to the currently active span for traceability.\n *\n * **Details**\n *\n * This function adds key-value annotations to the currently active span in the\n * effect's trace. These annotations help provide more context about the\n * operation being executed at a specific point in time. Unlike\n * {@link annotateSpans}, which applies to all spans in an effect, this function\n * focuses solely on the active span.\n *\n * You can either pass a single key-value pair or a record of key-value pairs to\n * annotate the span. These annotations are useful for adding metadata to\n * operations, especially in systems with detailed observability requirements.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const annotateCurrentSpan = effect.annotateCurrentSpan;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const currentSpan = effect.currentSpan;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const currentParentSpan = effect.currentParentSpan;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const spanAnnotations = effect.spanAnnotations;\n/**\n * @since 2.0.0\n * @category Tracing\n */\nexport const spanLinks = effect.spanLinks;\n/**\n * For all spans in this effect, add a link with the provided span.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const linkSpans = effect.linkSpans;\n/**\n * Add span links to the current span.\n *\n * @since 3.14.0\n * @category Tracing\n */\nexport const linkSpanCurrent = effect.linkSpanCurrent;\n/**\n * Create a new span for tracing.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const makeSpan = effect.makeSpan;\n/**\n * Create a new span for tracing, and automatically close it when the Scope\n * finalizes.\n *\n * The span is not added to the current span stack, so no child spans will be\n * created for it.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const makeSpanScoped = fiberRuntime.makeSpanScoped;\n/**\n * Create a new span for tracing, and automatically close it when the effect\n * completes.\n *\n * The span is not added to the current span stack, so no child spans will be\n * created for it.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const useSpan = effect.useSpan;\n/**\n * Wraps the effect with a new span for tracing.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const withSpan = effect.withSpan;\n/**\n * Wraps a function that returns an effect with a new span for tracing.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const getTodo = Effect.functionWithSpan({\n * body: (id: number) => Effect.succeed(`Got todo ${id}!`),\n * options: (id) => ({\n * name: `getTodo-${id}`,\n * attributes: { id }\n * })\n * })\n * ```\n *\n * @since 3.2.0\n * @category Tracing\n */\nexport const functionWithSpan = effect.functionWithSpan;\n/**\n * Wraps the effect with a new span for tracing.\n *\n * The span is ended when the Scope is finalized.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const withSpanScoped = fiberRuntime.withSpanScoped;\n/**\n * Adds the provided span to the current span stack.\n *\n * @since 2.0.0\n * @category Tracing\n */\nexport const withParentSpan = effect.withParentSpan;\n/**\n * Safely handles nullable values by creating an effect that fails for `null` or\n * `undefined`.\n *\n * **Details**\n *\n * This function ensures that an input value is non-null and non-undefined\n * before processing it. If the value is valid, the effect succeeds with the\n * value. If the value is `null` or `undefined`, the effect fails with a\n * `NoSuchElementException`. This is particularly useful for avoiding\n * null-related errors by clearly separating valid values from invalid ones in\n * effectful computations.\n *\n * The failure with `NoSuchElementException` allows you to explicitly handle\n * cases where a value is expected but not provided, leading to safer and more\n * predictable code.\n *\n * **When to Use**\n *\n * Use this function when working with values that may be `null` or `undefined`\n * and you want to ensure that only non-null values are processed. It helps\n * enforce null-safety and makes error handling more explicit.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, NoSuchElementException, never>\n * // ▼\n * const maybe1 = Effect.fromNullable(1)\n *\n * Effect.runPromiseExit(maybe1).then(console.log)\n * // Output:\n * // { _id: 'Exit', _tag: 'Success', value: 1 }\n *\n * // ┌─── Effect<number, NoSuchElementException, never>\n * // ▼\n * const maybe2 = Effect.fromNullable(null as number | null)\n *\n * Effect.runPromiseExit(maybe2).then(console.log)\n * // Output:\n * // {\n * // _id: 'Exit',\n * // _tag: 'Failure',\n * // cause: {\n * // _id: 'Cause',\n * // _tag: 'Fail',\n * // failure: { _tag: 'NoSuchElementException' }\n * // }\n * // }\n * ```\n *\n * @since 2.0.0\n * @category Optional Wrapping & Unwrapping\n */\nexport const fromNullable = effect.fromNullable;\n/**\n * Converts an effect that may fail with a `NoSuchElementException` into an\n * effect that succeeds with an `Option`.\n *\n * **Details**\n *\n * This function transforms an effect that might fail with\n * `Cause.NoSuchElementException` into an effect that succeeds with an `Option`\n * type. If the original effect succeeds, its value is wrapped in `Option.some`.\n * If it fails specifically due to a `NoSuchElementException`, the failure is\n * mapped to `Option.none`. Other types of failures remain unchanged and are\n * passed through as they are.\n *\n * This is useful when working with effects where you want to gracefully handle\n * the absence of a value while preserving other potential failures.\n *\n * **When to Use**\n *\n * Use this function when you need to handle missing values as `Option.none`\n * rather than throwing or propagating errors like `NoSuchElementException`.\n * It’s ideal for scenarios where you want to explicitly represent optionality\n * in a type-safe way while retaining other failure information.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * // ┌─── Effect<number, NoSuchElementException, never>\n * // ▼\n * const maybe1 = Effect.fromNullable(1)\n *\n * // ┌─── Effect<Option<number>, never, never>\n * // ▼\n * const option1 = Effect.optionFromOptional(maybe1)\n *\n * Effect.runPromise(option1).then(console.log)\n * // Output: { _id: 'Option', _tag: 'Some', value: 1 }\n *\n * // ┌─── Effect<number, NoSuchElementException, never>\n * // ▼\n * const maybe2 = Effect.fromNullable(null as number | null)\n *\n * // ┌─── Effect<Option<number>, never, never>\n * // ▼\n * const option2 = Effect.optionFromOptional(maybe2)\n *\n * Effect.runPromise(option2).then(console.log)\n * // Output: { _tag: 'None' }\n * ```\n *\n * @since 2.0.0\n * @category Optional Wrapping & Unwrapping\n */\nexport const optionFromOptional = effect.optionFromOptional;\n/**\n * Converts an `Option` of an `Effect` into an `Effect` of an `Option`.\n *\n * **Details**\n *\n * This function transforms an `Option<Effect<A, E, R>>` into an\n * `Effect<Option<A>, E, R>`. If the `Option` is `None`, the resulting `Effect`\n * will immediately succeed with a `None` value. If the `Option` is `Some`, the\n * inner `Effect` will be executed, and its result wrapped in a `Some`.\n *\n * **Example**\n *\n * ```ts\n * import { Effect, Option } from \"effect\"\n *\n * // ┌─── Option<Effect<number, never, never>>\n * // ▼\n * const maybe = Option.some(Effect.succeed(42))\n *\n * // ┌─── Effect<Option<number>, never, never>\n * // ▼\n * const result = Effect.transposeOption(maybe)\n *\n * console.log(Effect.runSync(result))\n * // Output: { _id: 'Option', _tag: 'Some', value: 42 }\n * ```\n *\n * @since 3.13.0\n * @category Optional Wrapping & Unwrapping\n */\nexport const transposeOption = self => {\n return option_.isNone(self) ? succeedNone : map(self.value, option_.some);\n};\n/**\n * Applies an `Effect` on an `Option` and transposes the result.\n *\n * **Details**\n *\n * If the `Option` is `None`, the resulting `Effect` will immediately succeed with a `None` value.\n * If the `Option` is `Some`, the effectful operation will be executed on the inner value, and its result wrapped in a `Some`.\n *\n * @example\n * ```ts\n * import { Effect, Option, pipe } from \"effect\"\n *\n * // ┌─── Effect<Option<number>, never, never>>\n * // ▼\n * const noneResult = pipe(\n * Option.none(),\n * Effect.transposeMapOption(() => Effect.succeed(42)) // will not be executed\n * )\n * console.log(Effect.runSync(noneResult))\n * // Output: { _id: 'Option', _tag: 'None' }\n *\n * // ┌─── Effect<Option<number>, never, never>>\n * // ▼\n * const someSuccessResult = pipe(\n * Option.some(42),\n * Effect.transposeMapOption((value) => Effect.succeed(value * 2))\n * )\n * console.log(Effect.runSync(someSuccessResult))\n * // Output: { _id: 'Option', _tag: 'Some', value: 84 }\n * ```\n *\n * @since 3.14.0\n * @category Optional Wrapping & Unwrapping\n */\nexport const transposeMapOption = /*#__PURE__*/dual(2, (self, f) => option_.isNone(self) ? succeedNone : map(f(self.value), option_.some));\nconst makeTagProxy = TagClass => {\n const cache = new Map();\n return new Proxy(TagClass, {\n get(target, prop, receiver) {\n if (prop in target) {\n return Reflect.get(target, prop, receiver);\n }\n if (cache.has(prop)) {\n return cache.get(prop);\n }\n const fn = (...args) => core.andThen(target, s => {\n if (typeof s[prop] === \"function\") {\n cache.set(prop, (...args) => core.andThen(target, s => s[prop](...args)));\n return s[prop](...args);\n }\n cache.set(prop, core.andThen(target, s => s[prop]));\n return s[prop];\n });\n const cn = core.andThen(target, s => s[prop]);\n // @effect-diagnostics-next-line floatingEffect:off\n Object.assign(fn, cn);\n const apply = fn.apply;\n const bind = fn.bind;\n const call = fn.call;\n const proto = Object.setPrototypeOf({}, Object.getPrototypeOf(cn));\n proto.apply = apply;\n proto.bind = bind;\n proto.call = call;\n Object.setPrototypeOf(fn, proto);\n cache.set(prop, fn);\n return fn;\n }\n });\n};\n/**\n * Creates a unique tag for a dependency, embedding the service's methods as\n * static properties.\n *\n * **Details**\n *\n * This function allows you to define a `Tag` for a service or dependency in\n * your application. The `Tag` not only acts as an identifier but also provides\n * direct access to the service's methods via static properties. This makes it\n * easier to access and use the service in your code without manually managing\n * contexts.\n *\n * In the example below, the fields of the service (in this case, the `notify`\n * method) are turned into static properties of the Notifications class, making\n * it easier to access them.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * class Notifications extends Effect.Tag(\"Notifications\")<\n * Notifications,\n * { readonly notify: (message: string) => Effect.Effect<void> }\n * >() {}\n *\n * // Create an effect that depends on the Notifications service\n * const action = Notifications.notify(\"Hello, world!\")\n * ```\n *\n * @since 2.0.0\n * @category Context\n */\nexport const Tag = id => () => {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const creationError = new Error();\n Error.stackTraceLimit = limit;\n function TagClass() {}\n Object.setPrototypeOf(TagClass, TagProto);\n TagClass.key = id;\n Object.defineProperty(TagClass, \"use\", {\n get() {\n return body => core.andThen(this, body);\n }\n });\n Object.defineProperty(TagClass, \"stack\", {\n get() {\n return creationError.stack;\n }\n });\n return makeTagProxy(TagClass);\n};\n/**\n * Simplifies the creation and management of services in Effect by defining both\n * a `Tag` and a `Layer`.\n *\n * **Details**\n *\n * This function allows you to streamline the creation of services by combining\n * the definition of a `Context.Tag` and a `Layer` in a single step. It supports\n * various ways of providing the service implementation:\n * - Using an `effect` to define the service dynamically.\n * - Using `sync` or `succeed` to define the service statically.\n * - Using `scoped` to create services with lifecycle management.\n *\n * It also allows you to specify dependencies for the service, which will be\n * provided automatically when the service is used. Accessors can be optionally\n * generated for the service, making it more convenient to use.\n *\n * **Example**\n *\n * ```ts\n * import { Effect } from 'effect';\n *\n * class Prefix extends Effect.Service<Prefix>()(\"Prefix\", {\n * sync: () => ({ prefix: \"PRE\" })\n * }) {}\n *\n * class Logger extends Effect.Service<Logger>()(\"Logger\", {\n * accessors: true,\n * effect: Effect.gen(function* () {\n * const { prefix } = yield* Prefix\n * return {\n * info: (message: string) =>\n * Effect.sync(() => {\n * console.log(`[${prefix}][${message}]`)\n * })\n * }\n * }),\n * dependencies: [Prefix.Default]\n * }) {}\n * ```\n *\n * @since 3.9.0\n * @category Context\n * @experimental might be up for breaking changes\n */\nexport const Service = function () {\n return function () {\n const [id, maker] = arguments;\n const proxy = \"accessors\" in maker ? maker[\"accessors\"] : false;\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const creationError = new Error();\n Error.stackTraceLimit = limit;\n let patchState = \"unchecked\";\n const TagClass = function (service) {\n if (patchState === \"unchecked\") {\n const proto = Object.getPrototypeOf(service);\n if (proto === Object.prototype || proto === null) {\n patchState = \"plain\";\n } else {\n const selfProto = Object.getPrototypeOf(this);\n Object.setPrototypeOf(selfProto, proto);\n patchState = \"patched\";\n }\n }\n if (patchState === \"plain\") {\n Object.assign(this, service);\n } else if (patchState === \"patched\") {\n Object.setPrototypeOf(service, Object.getPrototypeOf(this));\n return service;\n }\n };\n TagClass.prototype._tag = id;\n Object.defineProperty(TagClass, \"make\", {\n get() {\n return service => new this(service);\n }\n });\n Object.defineProperty(TagClass, \"use\", {\n get() {\n return body => core.andThen(this, body);\n }\n });\n TagClass.key = id;\n Object.assign(TagClass, TagProto);\n Object.defineProperty(TagClass, \"stack\", {\n get() {\n return creationError.stack;\n }\n });\n const hasDeps = \"dependencies\" in maker && maker.dependencies.length > 0;\n const layerName = hasDeps ? \"DefaultWithoutDependencies\" : \"Default\";\n let layerCache;\n let isFunction = false;\n if (\"effect\" in maker) {\n isFunction = typeof maker.effect === \"function\";\n Object.defineProperty(TagClass, layerName, {\n get() {\n if (isFunction) {\n return function () {\n return layer.fromEffect(TagClass, map(maker.effect.apply(null, arguments), _ => new this(_)));\n }.bind(this);\n }\n return layerCache ??= layer.fromEffect(TagClass, map(maker.effect, _ => new this(_)));\n }\n });\n } else if (\"scoped\" in maker) {\n isFunction = typeof maker.scoped === \"function\";\n Object.defineProperty(TagClass, layerName, {\n get() {\n if (isFunction) {\n return function () {\n return layer.scoped(TagClass, map(maker.scoped.apply(null, arguments), _ => new this(_)));\n }.bind(this);\n }\n return layerCache ??= layer.scoped(TagClass, map(maker.scoped, _ => new this(_)));\n }\n });\n } else if (\"sync\" in maker) {\n Object.defineProperty(TagClass, layerName, {\n get() {\n return layerCache ??= layer.sync(TagClass, () => new this(maker.sync()));\n }\n });\n } else {\n Object.defineProperty(TagClass, layerName, {\n get() {\n return layerCache ??= layer.succeed(TagClass, new this(maker.succeed));\n }\n });\n }\n if (hasDeps) {\n let layerWithDepsCache;\n Object.defineProperty(TagClass, \"Default\", {\n get() {\n if (isFunction) {\n return function () {\n return layer.provide(this.DefaultWithoutDependencies.apply(null, arguments), maker.dependencies);\n };\n }\n return layerWithDepsCache ??= layer.provide(this.DefaultWithoutDependencies, maker.dependencies);\n }\n });\n }\n return proxy === true ? makeTagProxy(TagClass) : TagClass;\n };\n};\n/**\n * The `Effect.fn` function allows you to create traced functions that return an\n * effect. It provides two key features:\n *\n * - **Stack traces with location details** if an error occurs.\n * - **Automatic span creation** for tracing when a span name is provided.\n *\n * If a span name is passed as the first argument, the function's execution is\n * tracked using that name. If no name is provided, stack tracing still works,\n * but spans are not created.\n *\n * A function can be defined using either:\n *\n * - A generator function, allowing the use of `yield*` for effect composition.\n * - A regular function that returns an `Effect`.\n *\n * **Example** (Creating a Traced Function with a Span Name)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const myfunc = Effect.fn(\"myspan\")(function* <N extends number>(n: N) {\n * yield* Effect.annotateCurrentSpan(\"n\", n) // Attach metadata to the span\n * console.log(`got: ${n}`)\n * yield* Effect.fail(new Error(\"Boom!\")) // Simulate failure\n * })\n *\n * Effect.runFork(myfunc(100).pipe(Effect.catchAllCause(Effect.logError)))\n * // Output:\n * // got: 100\n * // timestamp=... level=ERROR fiber=#0 cause=\"Error: Boom!\n * // at <anonymous> (/.../index.ts:6:22) <= Raise location\n * // at myspan (/.../index.ts:3:23) <= Definition location\n * // at myspan (/.../index.ts:9:16)\" <= Call location\n * ```\n *\n * `Effect.fn` automatically creates spans. The spans capture information about\n * the function execution, including metadata and error details.\n *\n * **Example** (Exporting Spans to the Console)\n *\n * ```ts skip-type-checking\n * import { Effect } from \"effect\"\n * import { NodeSdk } from \"@effect/opentelemetry\"\n * import {\n * ConsoleSpanExporter,\n * BatchSpanProcessor\n * } from \"@opentelemetry/sdk-trace-base\"\n *\n * const myfunc = Effect.fn(\"myspan\")(function* <N extends number>(n: N) {\n * yield* Effect.annotateCurrentSpan(\"n\", n)\n * console.log(`got: ${n}`)\n * yield* Effect.fail(new Error(\"Boom!\"))\n * })\n *\n * const program = myfunc(100)\n *\n * const NodeSdkLive = NodeSdk.layer(() => ({\n * resource: { serviceName: \"example\" },\n * // Export span data to the console\n * spanProcessor: new BatchSpanProcessor(new ConsoleSpanExporter())\n * }))\n *\n * Effect.runFork(program.pipe(Effect.provide(NodeSdkLive)))\n * // Output:\n * // got: 100\n * // {\n * // resource: {\n * // attributes: {\n * // 'service.name': 'example',\n * // 'telemetry.sdk.language': 'nodejs',\n * // 'telemetry.sdk.name': '@effect/opentelemetry',\n * // 'telemetry.sdk.version': '1.30.1'\n * // }\n * // },\n * // instrumentationScope: { name: 'example', version: undefined, schemaUrl: undefined },\n * // traceId: '22801570119e57a6e2aacda3dec9665b',\n * // parentId: undefined,\n * // traceState: undefined,\n * // name: 'myspan',\n * // id: '7af530c1e01bc0cb',\n * // kind: 0,\n * // timestamp: 1741182277518402.2,\n * // duration: 4300.416,\n * // attributes: {\n * // n: 100,\n * // 'code.stacktrace': 'at <anonymous> (/.../index.ts:8:23)\\n' +\n * // 'at <anonymous> (/.../index.ts:14:17)'\n * // },\n * // status: { code: 2, message: 'Boom!' },\n * // events: [\n * // {\n * // name: 'exception',\n * // attributes: {\n * // 'exception.type': 'Error',\n * // 'exception.message': 'Boom!',\n * // 'exception.stacktrace': 'Error: Boom!\\n' +\n * // ' at <anonymous> (/.../index.ts:11:22)\\n' +\n * // ' at myspan (/.../index.ts:8:23)\\n' +\n * // ' at myspan (/.../index.ts:14:17)'\n * // },\n * // time: [ 1741182277, 522702583 ],\n * // droppedAttributesCount: 0\n * // }\n * // ],\n * // links: []\n * // }\n * ```\n *\n * `Effect.fn` also acts as a pipe function, allowing you to create a pipeline\n * after the function definition using the effect returned by the generator\n * function as the starting value of the pipeline.\n *\n * **Example** (Creating a Traced Function with a Delay)\n *\n * ```ts\n * import { Effect } from \"effect\"\n *\n * const myfunc = Effect.fn(\n * function* (n: number) {\n * console.log(`got: ${n}`)\n * yield* Effect.fail(new Error(\"Boom!\"))\n * },\n * // You can access both the created effect and the original arguments\n * (effect, n) => Effect.delay(effect, `${n / 100} seconds`)\n * )\n *\n * Effect.runFork(myfunc(100).pipe(Effect.catchAllCause(Effect.logError)))\n * // Output:\n * // got: 100\n * // timestamp=... level=ERROR fiber=#0 cause=\"Error: Boom! (<= after 1 second)\n * ```\n *\n * @see {@link fnUntraced} for a version of this function that doesn't add a span.\n *\n * @since 3.11.0\n * @category Tracing\n */\nexport const fn = function (nameOrBody, ...pipeables) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const errorDef = new Error();\n Error.stackTraceLimit = limit;\n if (typeof nameOrBody !== \"string\") {\n return defineLength(nameOrBody.length, function (...args) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const errorCall = new Error();\n Error.stackTraceLimit = limit;\n return fnApply({\n self: this,\n body: nameOrBody,\n args,\n pipeables,\n spanName: \"<anonymous>\",\n spanOptions: {\n context: internalTracer.DisablePropagation.context(true)\n },\n errorDef,\n errorCall\n });\n });\n }\n const name = nameOrBody;\n const options = pipeables[0];\n return (body, ...pipeables) => defineLength(body.length, {\n [name](...args) {\n const limit = Error.stackTraceLimit;\n Error.stackTraceLimit = 2;\n const errorCall = new Error();\n Error.stackTraceLimit = limit;\n return fnApply({\n self: this,\n body,\n args,\n pipeables,\n spanName: name,\n spanOptions: options,\n errorDef,\n errorCall\n });\n }\n }[name]);\n};\nfunction defineLength(length, fn) {\n return Object.defineProperty(fn, \"length\", {\n value: length,\n configurable: true\n });\n}\nfunction fnApply(options) {\n let effect;\n let fnError = undefined;\n if (isGeneratorFunction(options.body)) {\n effect = core.fromIterator(() => options.body.apply(options.self, options.args));\n } else {\n try {\n effect = options.body.apply(options.self, options.args);\n } catch (error) {\n fnError = error;\n effect = die(error);\n }\n }\n if (options.pipeables.length > 0) {\n try {\n for (const x of options.pipeables) {\n effect = x(effect, ...options.args);\n }\n } catch (error) {\n effect = fnError ? failCause(internalCause.sequential(internalCause.die(fnError), internalCause.die(error))) : die(error);\n }\n }\n let cache = false;\n const captureStackTrace = () => {\n if (cache !== false) {\n return cache;\n }\n if (options.errorCall.stack) {\n const stackDef = options.errorDef.stack.trim().split(\"\\n\");\n const stackCall = options.errorCall.stack.trim().split(\"\\n\");\n let endStackDef = stackDef.slice(2).join(\"\\n\").trim();\n if (!endStackDef.includes(`(`)) {\n endStackDef = endStackDef.replace(/at (.*)/, \"at ($1)\");\n }\n let endStackCall = stackCall.slice(2).join(\"\\n\").trim();\n if (!endStackCall.includes(`(`)) {\n endStackCall = endStackCall.replace(/at (.*)/, \"at ($1)\");\n }\n cache = `${endStackDef}\\n${endStackCall}`;\n return cache;\n }\n };\n const opts = options.spanOptions && \"captureStackTrace\" in options.spanOptions ? options.spanOptions : {\n captureStackTrace,\n ...options.spanOptions\n };\n return withSpan(effect, options.spanName, opts);\n}\n/**\n * Same as {@link fn}, but allows you to create a function that is not traced, for when performance is critical.\n *\n * @see {@link fn} for a version that includes tracing.\n *\n * @since 3.12.0\n * @category Tracing\n */\nexport const fnUntraced = core.fnUntraced;\n// -----------------------------------------------------------------------------\n// Type constraints\n// -----------------------------------------------------------------------------\n/**\n * A no-op type constraint that enforces the success channel of an Effect conforms to\n * the specified success type `A`.\n *\n * @example\n * import { Effect } from \"effect\"\n *\n * // Ensure that the program does not expose any unhandled errors.\n * const program = Effect.succeed(42).pipe(Effect.ensureSuccessType<number>())\n *\n * @since 3.17.0\n * @category Type constraints\n */\nexport const ensureSuccessType = () => effect => effect;\n/**\n * A no-op type constraint that enforces the error channel of an Effect conforms to\n * the specified error type `E`.\n *\n * @example\n * import { Effect } from \"effect\"\n *\n * // Ensure that the program does not expose any unhandled errors.\n * const program = Effect.succeed(42).pipe(Effect.ensureErrorType<never>())\n *\n * @since 3.17.0\n * @category Type constraints\n */\nexport const ensureErrorType = () => effect => effect;\n/**\n * A no-op type constraint that enforces the requirements channel of an Effect conforms to\n * the specified requirements type `R`.\n *\n * @example\n * import { Effect } from \"effect\"\n *\n * // Ensure that the program does not have any requirements.\n * const program = Effect.succeed(42).pipe(Effect.ensureRequirementsType<never>())\n *\n * @since 3.17.0\n * @category Type constraints\n */\nexport const ensureRequirementsType = () => effect => effect;\n//# sourceMappingURL=Effect.js.map","export function getLocationBase() {\n return import.meta?.url ?? window?.location?.origin ?? '';\n}\n","import { getAssetPath } from '@stencil/core';\nimport { Data, Effect } from 'effect';\nimport { getLocationBase } from './environment';\n\nexport class URLCreationError extends Data.TaggedError('URLCreationError')<Error> {}\n\nconst relativeAssetsPath = '../../assets';\n\n/**\n * Attempts to create an asset URL using Stencil's `getAssetPath` utility, and falls back to a default URL if that fails (e.g. because the app using the library hasn't configured the asset path correctly).\n * This is a workaround for Stencil's behavior of throwing an error when `getAssetPath` is called without a valid asset path configuration, which can happen in certain environments like Storybook.\n *\n * @param file - The filename of the asset to create a URL for, relative to the configured asset path.\n * @param pathFromAssetRoot - The path from the asset root to the asset directory (e.g. 'icons' for assets located at <pkg-root>/assets/icons/).\n * @returns An Effect that yields a string URL for the asset, or a fallback URL if the creation fails.\n */\nexport const syncCreateAssetUrlSafely = (file: string, pathFromAssetRoot?: string | undefined) => {\n // * dist output target expects assets to be located at <pkg-root>/assets/...\n // * this base path is used in components' assetDirs declaration, but with the relative ../../assets/\n const relativeAssetPath = joinPath(relativeAssetsPath, pathFromAssetRoot, file);\n return Effect.try(() => getAssetPath(relativeAssetPath)).pipe(\n Effect.tapError(() =>\n Effect.logWarning(`Failed to create URL for asset \"${file}\" in path \"${pathFromAssetRoot}\".\n Please provide an absolute URL in your app's 'setAssetPath(...)' configuration! Falling back to a relative URL, which may work in some environments but is not guaranteed to be correct.`),\n ),\n Effect.orElseSucceed(() => new URL(relativeAssetPath, getLocationBase())),\n );\n};\n\nfunction joinPath(...parts: (string | undefined)[]) {\n return parts.filter(Boolean).join('/').replace('//', '/').replace('/./', '/');\n}\n"],"names":["isFunction","make","mapInput","array","isFunction_","symbol","number","combine","equals","Hash.hash","Predicate.hasProperty","Predicate.isFunction","format","EffectTypeId","version.getCurrentVersion","EffectPrototype","Equal.symbol","Hash.symbol","Hash.cached","Hash.random","SingleShotGen","Hash.structure","Equal.equals","OpCodes.OP_COMMIT","Base","TypeId","CommonProto","isSome","Hash.combine","isNone","none","some","isRight","isLeft","left","right","getRight","option.none","option.some","either.right","either.left","either.isLeft","either.isRight","match","merge","getOrThrowWith","isNonEmptyArray","greaterThan","option.isNone","option.isSome","either.getRight","map","flatMap","_equivalence","Equal.equivalence","fromIterable","prepend","append","appendAll","internalArray.isNonEmptyArray","get","Option.none","Option.some","unsafeGet","head","headNonEmpty","tailNonEmpty","splitAt","drop","reverse","zip","zipWith","Tuple.make","copy","union","empty","of","flatten","filterMap","Option.isSome","filter","reduce","unfold","getEquivalence","Equivalence.array","join","Order","order.number","Reference","isContext","Hash.number","_empty","add","getOption","mergeAll","internal.makeGenericTag","internal.isContext","internal.empty","internal.make","internal.add","internal.get","internal.unsafeGet","internal.getOption","internal.merge","internal.mergeAll","internal.Reference","Equivalence.make","Hash.array","RA.fromIterable","RA.reverse","O.none","O.some","RA.filterMap","RA.filter","isEmpty","isNonEmpty","RA.map","RA.reduce","bigint0","O.isNone","Stack.make","hash","Option.isNone","makeImpl","Node.isEmptyNode","Node.EmptyNode","beginMutation","set","endMutation","Dual.dual","has","modifyAt","keys","size","remove","forEach","HM.keys","HM.size","HM.empty","HM.has","HM.beginMutation","HM.set","HM.remove","difference","HM.forEach","HM.reduce","HS.empty","HS.fromIterable","HS.make","HS.has","HS.size","HS.add","HS.remove","HS.difference","HS.union","HS.reduce","Hash.string","None","combineAll","HashSet.reduce","HashSet.empty","HashSet.make","HashSet.union","MutableRef.make","threadName","unsafeMake","MutableRef.get","MutableRef.set","internal.none","internal.combine","internal.combineAll","internal.threadName","internal.unsafeMake","HM.fromIterable","HM.isEmpty","HM.get","HM.modifyAt","HM.map","Arr.fromIterable","Equivalence.mapInput","Arr.getEquivalence","variance","PatchProto","EmptyProto","AndThenProto","makeAndThen","diff","patch","Chunk.of","Chunk.isNonEmpty","Chunk.headNonEmpty","Chunk.tailNonEmpty","Chunk.prepend","HashSet.has","HashSet.remove","HashSet.add","Data.Structural","Arr.drop","Arr.of","Arr.isNonEmptyArray","Arr.headNonEmpty","Arr.tailNonEmpty","ContextPatch.empty","ContextPatch.combine","ContextPatch.diff","ContextPatch.patch","HashSetPatch.empty","HashSetPatch.combine","HashSetPatch.diff","HashSetPatch.patch","ReadonlyArrayPatch.empty","ReadonlyArrayPatch.combine","ReadonlyArrayPatch.diff","ReadonlyArrayPatch.patch","update","enable","disable","exclude","interruptible","runtimeFlagsPatch.make","runtimeFlagsPatch.invert","runtimeFlagsPatch.active","runtimeFlagsPatch.enabled","differ","internalDiffer.make","runtimeFlagsPatch.empty","runtimeFlagsPatch.andThen","internal.enable","internal.disable","internal.exclude","List.of","List.empty","List.reduce","step","List.appendAll","List.isNil","List.reverse","List.cons","HashMap.empty","HashMap.modifyAt","Option.orElseSome","Option.map","Chunk.append","HashMap.reduce","HashMap.set","Option.match","HashMap.get","Chunk.appendAll","HashMap.isEmpty","HashMap.keys","HashMap.map","Chunk.empty","OP_EMPTY","OP_FAIL","OP_PARALLEL","OP_SEQUENTIAL","proto","OpCodes.OP_EMPTY","fail","OpCodes.OP_FAIL","die","OpCodes.OP_DIE","interrupt","OpCodes.OP_INTERRUPT","parallel","OpCodes.OP_PARALLEL","sequential","OpCodes.OP_SEQUENTIAL","Chunk.reverse","Either.right","Either.left","Option.mergeWith","Arr.reduce","HashSet.size","Chunk.isEmpty","Chunk.make","Option.getOrUndefined","OpCodes.OP_STATE_PENDING","done","OpCodes.OP_STATE_DONE","OpCodes.OP_REVERT_FLAGS","isEffect","withFiberRuntime","OpCodes.OP_WITH_RUNTIME","acquireUseRelease","uninterruptibleMask","exit","suspend","matchCauseEffect","OpCodes.OP_FAILURE","failCause","internalCause.sequential","OpCodes.OP_SUCCESS","as","succeed","asVoid","FiberId.none","OpCodes.OP_ASYNC","void_","catchAllCause","OpCodes.OP_ON_FAILURE","catchAll","internalCause.spanSymbol","internalCause.die","dieMessage","matchCause","exitFailCause","exitSucceed","internalCause.fail","sync","fiberIdWith","OpCodes.OP_ON_SUCCESS","OpCodes.OP_ON_SUCCESS_AND_FAILURE","defects","internalCause.defects","internalCause.electFailures","failures","internalCause.failures","Chunk.unsafeHead","Arr.allocate","internalCause.interrupt","OpCodes.OP_UPDATE_RUNTIME_FLAGS","RuntimeFlagsPatch.enable","runtimeFlags_.Interruption","intoDeferred","mapError","internalCause.failureOrCause","onExit","zipRight","internalCause.isInterruptedOnly","internalCause.interruptors","OpCodes.OP_SYNC","tap","Option.getOrElse","Option.getOrThrow","internalCause.keepDefectsAndElectFailures","uninterruptible","RuntimeFlagsPatch.disable","runtimeFlags_.interruption","OpCodes.OP_WHILE","OpCodes.OP_ITERATOR","gen","yieldNow","OpCodes.OP_YIELD","zipLeft","internalDiffer.update","internalDiffer.hashSet","internalDiffer.readonlyArray","internalDiffer.environment","runtimeFlags_.differ","Context.empty","Arr.empty","internalCause.empty","internalCause.pretty","internalCause.parallel","exitDie","exitInterrupt","exitVoid","Chunk.fromIterable","Chunk.toReadonlyArray","deferred.DeferredTypeId","deferred.deferredVariance","deferred.pending","DeferredOpCodes.OP_STATE_DONE","DeferredOpCodes.OP_STATE_PENDING","deferred.done","provideContext","Context.merge","Equal.isEqual","Context.GenericTag","Duration.toMillis","core.sync","core.succeed","core.async","core.void","core.asVoid","OpCodes.OP_AND","OpCodes.OP_OR","OpCodes.OP_INVALID_DATA","RA.join","OpCodes.OP_MISSING_DATA","OpCodes.OP_SOURCE_UNAVAILABLE","OpCodes.OP_UNSUPPORTED","List.isCons","RA.prepend","RA.head","Option.contains","RA.tailNonEmpty","configError.MissingData","core.flatMap","Arr.head","core.fail","Arr.join","core.mapError","Arr.unsafeGet","HashSet.fromIterable","pathPatch.empty","extend","Arr.unfold","OpCodes.OP_CONSTANT","OpCodes.OP_DESCRIBED","core.suspend","OpCodes.OP_FALLBACK","core.catchAll","configError.Or","OpCodes.OP_LAZY","OpCodes.OP_MAP_OR_FAIL","core.forEachSequential","configError.prefixed","OpCodes.OP_NESTED","OpCodes.OP_PRIMITIVE","pathPatch.patch","Arr.last","OpCodes.OP_SEQUENCE","core.map","Arr.append","Arr.flatten","OpCodes.OP_HASHMAP","Arr.map","HashMap.fromIterable","Arr.zip","OpCodes.OP_ZIP_WITH","core.either","Either.isLeft","configError.And","Either.isRight","core.zip","regexp.escape","core.mapBoth","Arr.sort","number.Order","Either.merge","Option.flatMap","PCGRandom.PCGRandom","core.forEachSequentialDiscard","core.as","Context.add","clock.clockTag","clock.make","console_.consoleTag","console_.defaultConsole","random.randomTag","random.make","configProvider.configProviderTag","configProvider.fromEnv","tracer.tracerTag","tracer.nativeTracer","core.fiberRefUnsafeMakeContext","sleep","Duration.decode","clockWith","core.withFiberRuntime","currentTimeMillis","defaultServices.sleep","defaultServices.currentTimeMillis","defaultServices.clockWith","Arr.isNonEmptyReadonlyArray","getOrDefault","updateManyAs","internal.getOrDefault","internal.updateManyAs","core.logLevelAll","core.logLevelFatal","Error","core.logLevelError","core.logLevelWarning","core.logLevelInfo","core.logLevelDebug","core.logLevelTrace","core.logLevelNone","order.mapInput","order.greaterThan","internal.EffectPrototype","internal.Base","Effectable.Class","Readable.TypeId","OP_AND_THEN","fiberRefs_.updateAs","fiberRefs_.delete_","fiberRefs_.getOrDefault","Arr.prepend","try_","core.UnknownException","catchSomeCause","core.matchCauseEffect","core.failCause","Clock.clockWith","fiberRefsPatch.diff","core.matchEffect","forever","core.yieldNow","ignore","Option.fromNullable","internalCause.isCause","logWarning","LogLevel.Warning","logError","LogLevel.Error","core.failCauseSync","orElseSucceed","core.orElse","fiberRefsPatch.patch","promise","core.die","core.contextWithEffect","core.provideContext","Clock.sleep","tapError","core.zipRight","tapErrorCause","tryPromise","core.failSync","when","parallelN","internal.sequential","internal.parallel","internal.parallelN","internal.diff","internal.patch","OP_DONE","running","suspended","isDone","internal.done","internal.running","internal.suspended","internal.isDone","fiberVariance","InternalContext.unsafeGetReference","Effectable.EffectPrototype","Context.Reference","runFork","core.currentMaxOpsBeforeYield","core.currentSchedulingPriority","core.fiberRefUnsafeMake","core.fiberRefGetWith","core.currentConcurrency","FiberMessage.stateful","core.zipLeft","core.flatten","logSpan_.formatLabel","fiberId_.threadName","Arr.ensure","Inspectable.toStringUnknown","Cause.isEmptyType","Cause.pretty","logSpan_.render","Arr.appendAll","Arr.dedupe","Arr.makeBy","Chunk.unsafeFromArray","counter","histogram","metricKeyType.counter","metricKeyType.histogram","taggedWithLabels","Arr.union","frequency","gauge","summary","metricState.counter","metricState.frequency","metricState.gauge","metricState.histogram","Duration.millis","Duration.greaterThanOrEqualTo","Duration.zero","Duration.lessThanOrEqualTo","metricState.summary","Arr.lastNonEmpty","Arr.span","MutableHashMap.empty","metricPair.unsafeMake","MutableHashMap.get","metricKeyType.isCounterKey","metricKeyType.isGaugeKey","metricKeyType.isFrequencyKey","metricKeyType.isHistogramKey","metricKeyType.isSummaryKey","metricHook.counter","MutableHashMap.has","MutableHashMap.set","metricHook.frequency","metricHook.gauge","metricHook.histogram","metricHook.summary","metricRegistry.make","core.tap","metricKey.counter","metricKey.taggedWithLabels","metricKey.histogram","metricLabel.make","core.currentMetricLabels","completedRequestMap.currentRequestMap","core.deferredUnsafeDone","supervisor.none","supervisor.isZip","HashSet.difference","Differ.make","metric.counter","metric.tagged","metric.histogram","metricBoundaries.exponential","core.exitSucceed","runtimeFlags_.interruptible","core.exitFailCause","core.exitIsExit","FiberMessage.OP_INTERRUPT_SIGNAL","FiberMessage.OP_RESUME","FiberMessage.OP_STATEFUL","FiberStatus.running","FiberMessage.OP_YIELD_NOW","RequestBlock_.flatten","RequestBlock_.sequentialCollectionToChunk","core.fiberRefLocally","internalFiber.FiberTypeId","internalFiber.fiberVariance","internalFiber.RuntimeFiberTypeId","runtimeFlags_.runtimeMetrics","internalFiber.join","FiberMessage.resume","FiberStatus.isDone","fiberScope.unsafeMake","core.currentInterruptedCause","core.deferredUnsafeMake","core.deferredAwait","fiberRefs.joinAs","runtimeFlags_.diff","RuntimeFlagsPatch.exclude","runtimeFlags_.WindDown","core.updateRuntimeFlags","FiberMessage.interruptSignal","fiberRefs.delete_","fiberRefs.updateAs","defaultServices.currentServices","core.currentContext","tracer.spanTag","internalFiber.currentFiberURI","internalCause.isEmpty","core.whileLoop","core.currentUnhandledErrorLogLevel","core.currentLogLevel","LogLevel.greaterThan","core.currentLogSpan","core.currentLogAnnotations","Context.get","Inspectable.withRedactableContext","FiberStatus.done","FiberStatus.suspended","runtimeFlags_.cooperativeYielding","FiberMessage.yieldNow","core.exitVoid","runtimeFlags_.enable","runtimeFlags_.patch","OpCodes.OP_TAG","Context.unsafeGet","core.NoSuchElementException","core.unsafeAsync","Micro.runFork","Micro.provideContext","internalCause.stripFailures","FiberRefsPatch.diff","core.blocked","FiberRefsPatch.patch","core.uninterruptibleMask","forkDaemon","core.runRequestBlock","core.RevertFlags","core.EffectTypeId","core.currentVersionMismatchErrorLogLevel","core.dieMessage","core.isInterruptedException","LogLevel.fromLiteral","internalLogger.makeLogger","FiberRefs.getOrDefault","internalLogger.stringLogger","Context.getOption","fiberRefs.getOrDefault","FiberId.threadName","core.fiberRefUnsafeMakeHashSet","Predicate.isIterable","all","core.currentRequestBatching","concurrency.match","ExecutionStrategy.sequential","ExecutionStrategy.parallel","ExecutionStrategy.parallelN","core.transplant","core.uninterruptible","fiberScope.globalScope","core.step","core.exit","core.exitCollectAll","RequestBlock_.par","core.onExit","core.exitMatch","unsafeFork","FiberId.unsafeMake","fiberRefs.forkAs","core.currentForkScopeOverride","core.scopeFork","scopedWith","core.isEffect","scope","core.ScopeTypeId","core.CloseableScopeTypeId","executionStrategy.isSequential","core.exitAsVoid","executionStrategy.isParallel","executionStrategy.sequential","core.mapInputContext","Context.make","core.fiberRefUnsafeMakePatch","SupervisorPatch.differ","SupervisorPatch.empty","core.fiberRefUnsafeMakeRuntimeFlags","runtimeFlags_.none","raceWith","race","core.fiberIdWith","core.exitMatchEffect","internalEffect.mapErrorCause","core.interruptAsFiber","MRef.make","FiberId.combine","MRef.compareAndSet","ensuring","core.interruptible","internalCause.isInterrupted","core.interruptFiber","core.exitInterrupt","lessThan","intersect","after","internal.lessThan","internal.isEmpty","internal.intersect","internal.after","Interval.intersect","Interval.isEmpty","Interval.lessThan","start","Chunk.head","Interval.empty","end","internal.start","internal.end","internal.isNonEmpty","_continue","continueWith","Intervals.make","isContinue","internal._continue","internal.continueWith","internal.isContinue","core.scopeAddFinalizer","core.scopeAddFinalizerExit","core.scopeClose","fiberRuntime.scopeExtend","fiberRuntime.scopeMake","core.asyncInterrupt","fiberRuntime.ensuring","effect.succeedNone","effect.asSome","makeSemaphore","forkIn","fiberRuntime.unsafeFork","raceFirst","fiberRuntime.race","internalRef.RefTypeId","internalRef.refVariance","internalRef.get","internalRef.set","internalRef.unsafeMake","scheduler_.currentScheduler","FiberRefs.updateManyAs","FiberRuntime.FiberRuntime","scope_.fork","scope_.close","supervisor_.none","InternalCause.prettyErrors","InternalCause.pretty","Inspectable.NodeInspectSymbol","core.exitFail","scheduler_.SyncScheduler","core.exitDie","core.capture","core.currentSpanFromFiber","runtime","runtimeFlags.make","runtimeFlags.Interruption","runtimeFlags.CooperativeYielding","runtimeFlags.RuntimeMetrics","FiberRefs.empty","OpCodes.OP_FRESH","synchronized.modifyEffect","effect.patchFiberRefs","ref.make","core.deferredMake","effect.diffFiberRefs","EffectOpCodes.OP_FAILURE","core.deferredFailCause","EffectOpCodes.OP_SUCCESS","ref.set","core.whenEffect","ref.modify","ref.update","ref.get","core.deferredSucceed","circular.makeSynchronized","circular.unsafeMakeSynchronized","effect.provideService","fiberRuntime.scopeWith","core.zipWith","core.gen","fiberRuntime.zipWithOptions","fiberRuntime.forEachConcurrentDiscard","core.fnUntraced","Context.mergeAll","OpCodes.OP_MERGE_ALL","fiberRuntime.scopedWith","core.provideSomeContext","runtime.defaultRuntime","runtimeFlags.diff","runtimeFlags.patch","Context.isContext","circularManagedRuntime.TypeId","core.YieldableError","ref.unsafeMake","Clock.currentTimeMillis","ScheduleDecision.isDone","millis","Intervals.start","effect.sleep","ScheduleDecision.done","Intervals.intersect","ScheduleDecision.isContinue","Intervals.isNonEmpty","ScheduleDecision.continue","Intervals.lessThan","Intervals.end","ScheduleDecision.continueWith","Interval.after","effect.negate","internalCause.find","internalCause.isDieType","core.catchAllCause","effect.provideServiceEffect","core.orDie","fiberRuntime.all","fiberRuntime.forEach","effect.promise","effect.catchSomeCause","effect.ignore","effect.try_","effect.tryPromise","core.interrupt","core.acquireUseRelease","fiberRuntime.scope","fiberRuntime.forkDaemon","circular.forkIn","layer.effect_provide","core.intoDeferred","effect.when","circular.raceFirst","fiberRuntime.raceWith","effect.tapError","effect.tapErrorCause","effect.forever","schedule_.repeat_combined","effect.match","core.matchCause","effect.logWarning","effect.logError","effect.orElseSucceed","runtime_.runtime","circular.makeSemaphore","runtime_.unsafeForkEffect","runtime_.unsafeRunPromiseEffect","runtime_.unsafeRunSyncEffect","fiberRuntime.zipOptions","fiberRuntime.zipLeftOptions","fiberRuntime.zipRightOptions","Data.TaggedError","Effect.try","Effect.tapError","Effect.logWarning","Effect.orElseSucceed"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,YAAU,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,UAAU;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG,UAAU,KAAK,EAAE,IAAI,EAAE;AAC3C,EAAE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;AACnC,IAAI,OAAO,YAAY;AACvB,MAAM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AK,QAAQ;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;AAoB1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;AAwB1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,GAAGG,YAAW;AA2GrC;AACA;AACA;AACA;AACO,MAAM,eAAe,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,GAAG,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,IAAI,IAAI;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,I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GAAG,CAAC,CAAC;AAoD7E;AACA;AACA;AACA;AACO,MAAM,QAAQ,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAKA,MAAI,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AA4G/F;AACA;AACA;AACA;AACA;AACO,MAAM8C,aAAW,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;;AC7L5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAACjB,MAAI,GAAG,MAAMO;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAGC;AA6BpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,GAAGU,QAAa;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAGC;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAACN,OAAK,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE;AACjD,EAAE,MAAM;AACR,EAAE;AACF,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAgFlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAGO;AAkCxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK;AAsCpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;AAgEtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG,aAAa,IAAI,aAAa,IAAI,IAAI,GAAGpB,MAAI,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;AA+DjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,gBAAgB,SAAS,CAAC,cAAc;AAoCnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,cAAc,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;AACrE,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE;AACpB,IAAI,OAAO,IAAI,CAAC,KAAK;AACrB;AACA,EAAE,MAAM,MAAM,EAAE;AAChB,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,gBAAgB,cAAc,CAAC,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMqB,KAAG,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,GAAGrB,MAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAyDjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;AC54ErF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAggBA;AACA;AACA;AACA;AACA;AACO,MAAM+B,OAAK,GAAGC,MAAY;;ACpmBjC;AACA;AACA;AACA;AACA;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,MAAM,CAAC;;AC1B9E;AACO,MAAM,SAAS,gBAAgB,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;AACtE;AACO,MAAM,eAAe,gBAAgB,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;AAClF;AACA,MAAM,YAAY,GAAG,YAAY;AACjC;AACO,MAAM,SAAS,gBAAgB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AAC9D;AACO,MAAM,QAAQ,GAAG;AACxB,EAAE,GAAGxE,iBAAe;AACpB,EAAE,GAAG,EAAE,KAAK;AACZ,EAAE,CAAC,SAAS,GAAG,cAAc;AAC7B,EAAE,CAAC,SAAS,GAAG;AACf,IAAI,QAAQ,EAAE,CAAC,IAAI,CAAC;AACpB,IAAI,WAAW,EAAE,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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,GAAGC,cAAuB;AAOjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS,GAAGC,WAAkB;AAwB3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMrB,OAAK,GAAGsB,OAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMhG,MAAI,GAAGiG,MAAa;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMN,KAAG,GAAGO,KAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMvC,KAAG,GAAGwC,KAAY;AAS/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMrC,WAAS,GAAGsC,WAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS,GAAGC,WAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM1D,OAAK,GAAG2D,OAAc;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO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AE,EAAE,GAAG,IAAI;AACjF,EAAE4D,SAAO,CAAC,IAAI,EAAE,KAAK,IAAI3C,KAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACzC,EAAE,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;AAC5B,IAAIA,KAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AACnB;AACA,CAAC,CAAC,CAAC;AAsBH;AACO,MAAM2C,SAAO,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAKS,SAAU,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClG;AACO,MAAM/D,QAAM,gBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,KAAKgE,QAAS,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;;ACvJlH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMtE,OAAK,GAAGuE,OAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM3F,cAAY,GAAG4F,cAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMlJ,MAAI,GAAGmJ,MAAO;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMlB,KAAG,GAAGmB,KAAM;AAsLzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAChB,MAAI,GAAGiB;AAyIpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,GAAG,GAAGC,KAAM;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMjB,QAAM,GAAGkB,QAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,GAAGC,YAAa;AAgCvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,KAAK,GAAGC,OAAQ;AAmH7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMzE,QAAM,GAAG0E,QAAS;;AC7mC/B;AACA;AACA;AAKA,MAAMlI,QAAM,gBAAgB,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC;AAC3D,MAAM,eAAe,GAAG;AACxB,EAAE,CAACA,QAAM,GAAGA,QAAM;AAClB,EAAE,QAAQ,GAAG;AACb,IAAI,OAAOb,QAAM,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;AAChC,GAAG;AACH,EAAE,MAAM,GAAG;AACX,IAAI,OAAO;AACX,MAAM,GAAG,EAAE,YAAY;AACvB,MAAM,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO;AAClC,KAAK;AACL,GAAG;AACH,EAAE,CAAC,iBAAiB,CAAC,GAAG;AACxB,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE;AACxB,GAAG;AACH,EAAE,IAAI,GAAG;AACT,IAAI,OAAO,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC;AACzC;AACA,CAAC;AACD;AACA;AACA;AACA;AACY,MAACX,MAAI,GAAG,KAAK,IAAI;AAC7B,EAAE,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC;AAC5C,EAAE,GAAG,CAAC,OAAO,GAAG,KAAK;AACrB,E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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,GAAG,GAAGmJ;AAmenB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AAkgBvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,KAAK,GAAG7d;AA6BrB;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAG8E;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG5D;AAQpB;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG8F;AAuDzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAGyL;AAe1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,GAAG,GAAGgJ;AAoCnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGqC;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG/d;AA0BvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG6B;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG9B;AACf,MAAC,KAAK,GAAGG;AAsEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG6B;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG2b;AAwK7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAGM;AA6Q9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAGC;AA4TjB,MAAC,IAAI,GAAGC;AAuFb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAGC;AAgJ1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAGC;AAMzB;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAGjI;AAmD7B;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,eAAe,GAAGvC;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,mBAAmB,GAAGxB;AAuBnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,EAAE,GAAGrO;AAmBlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG5D;AAoCtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,GAAG,GAAGuC;AAiFnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAGrB;AAoJxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,iBAAiB,GAAGgd;AAyHjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAGhG;AAmOxB;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,KAAK,GAAGiG;AAQrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAGtC;AAqJ1B;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAGrG;AAiD3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAG4I;AAS1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAGC;AAy5BtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AAwcvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAG1K;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,YAAY,GAAG2K;AA8N5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAGC;AAyEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG1d;AA6EvB;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGsJ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,IAAI,GAAGqO;AAwHpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAGgG;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAGC;AAUxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,GAAG,GAAGtR;AAoGnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAGuR;AAgDxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAGC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AA6JvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAGC;AA2QtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,KAAK,GAAGC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAGC;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,gBAAgB,GAAGnY;AAiMhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAGoY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAGC;AA2YxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,GAAGC,eAAoB;AAmIjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AAwGvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAGC;AA4C7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AAoBvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAGC;AA0D1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AAuJvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,GAAG,GAAGC;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAGC;AACvB;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CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AAC/E;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118]}
|