svelte-effect-runtime 4.1.1 → 4.2.1
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/chunks/{client-DbwVAMWm.js → client-CkxjaRTA.js} +2 -2
- package/.dist/chunks/{client-DbwVAMWm.js.map → client-CkxjaRTA.js.map} +1 -1
- package/.dist/chunks/{dispatcher-CTWINW5I.js → dispatcher-B6ZRUsjN.js} +139 -44
- package/.dist/chunks/dispatcher-B6ZRUsjN.js.map +1 -0
- package/.dist/chunks/{dispatcher-pZPzarul.js → dispatcher-D8j5wTx6.js} +3 -3
- package/.dist/chunks/{dispatcher-pZPzarul.js.map → dispatcher-D8j5wTx6.js.map} +1 -1
- package/.dist/chunks/{runtime-CPosEhGl.js → runtime-B8RHHy3v.js} +2 -2
- package/.dist/chunks/{runtime-CPosEhGl.js.map → runtime-B8RHHy3v.js.map} +1 -1
- package/.dist/chunks/server-BNxq-pUH.js +354 -0
- package/.dist/chunks/server-BNxq-pUH.js.map +1 -0
- package/.dist/chunks/{transform-D7TTlPpK.js → transform-C0jW8Qta.js} +38 -5
- package/.dist/chunks/transform-C0jW8Qta.js.map +1 -0
- package/.dist/dispatcher.js +1 -1
- package/.dist/environment.d.ts +87 -0
- package/.dist/environment.js +44 -0
- package/.dist/environment.js.map +1 -0
- package/.dist/internal/generators.js +2 -2
- package/.dist/internal/remote-client.js +1 -1
- package/.dist/internal/remote-server.js +2 -2
- package/.dist/markup/promise.js +1 -1
- package/.dist/markup/run.js +1 -1
- package/.dist/markup/transform.js +1 -1
- package/.dist/markup/value.js +1 -1
- package/.dist/mod.d.ts +2 -0
- package/.dist/mod.js +3 -2
- package/.dist/mod.js.map +1 -1
- package/.dist/remote/cause-codec.d.ts +35 -0
- package/.dist/remote/client.js +1 -1
- package/.dist/remote/diagnostics.d.ts +83 -0
- package/.dist/remote/server.d.ts +26 -2
- package/.dist/remote/server.js +2 -2
- package/.dist/runtime/transform.js +14 -6
- package/.dist/runtime/transform.js.map +1 -1
- package/.dist/script-transform/imports.d.ts +1 -1
- package/.dist/server.js +6 -6
- package/.dist/server.js.map +1 -1
- package/package.json +5 -1
- package/.dist/chunks/dispatcher-CTWINW5I.js.map +0 -1
- package/.dist/chunks/server-yQrNoiCR.js +0 -144
- package/.dist/chunks/server-yQrNoiCR.js.map +0 -1
- package/.dist/chunks/transform-D7TTlPpK.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as InvalidLiveQueryFactoryError, d as InvalidQueryFactoryError, f as InvalidRemoteFormResponseError, g as RemoteFormEndpointMissingError, j as UnsupportedRemoteFormResponseError, s as InvalidCommandFactoryError, u as InvalidPrerenderFactoryError } from "./errors-qhcbUH6o.js";
|
|
2
|
-
import { r as get_dispatcher } from "./dispatcher-
|
|
2
|
+
import { r as get_dispatcher } from "./dispatcher-B6ZRUsjN.js";
|
|
3
3
|
import { create_remote_http_error, create_remote_transport_error, create_remote_validation_error } from "../remote/shared.js";
|
|
4
4
|
import { i as make_remote_live_stream, r as make_failed_remote_live_stream } from "./live-BW7xZKjb.js";
|
|
5
5
|
import { a as normalize_validator, c as attach_remote_resource_getters, d as MakeEffectFromPromise, f as MakeEffectFromSync, h as normalize_native_error, i as is_standard_schema, l as is_remote_resource, m as is_decoded_remote_failure, n as attach_native_remote_query_update, o as attach_failed_remote_query_resource, p as decode_remote_error, r as resolve_native_remote_query_updates, s as attach_failed_remote_resource_getters, t as copy_property_descriptors, u as FailWithRemoteError } from "./descriptors-q909VWyR.js";
|
|
@@ -527,4 +527,4 @@ const RefreshRemoteResource = (resource, refresh) => Effect.gen(function* () {
|
|
|
527
527
|
//#endregion
|
|
528
528
|
export { create_remote_command_adapter as a, create_remote_form_adapter as i, create_remote_query_adapter as n, create_remote_prerender_adapter as r, create_remote_live_query_adapter as t };
|
|
529
529
|
|
|
530
|
-
//# sourceMappingURL=client-
|
|
530
|
+
//# sourceMappingURL=client-CkxjaRTA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-DbwVAMWm.js","names":[],"sources":["../../../modules/svelte-effect-runtime/src/remote/client/utils.ts","../../../modules/svelte-effect-runtime/src/remote/client/responses.ts","../../../modules/svelte-effect-runtime/src/remote/client/command.ts","../../../modules/svelte-effect-runtime/src/remote/client/form-data.ts","../../../modules/svelte-effect-runtime/src/remote/client/form-transport.ts","../../../modules/svelte-effect-runtime/src/remote/client/form-enhance.ts","../../../modules/svelte-effect-runtime/src/remote/client/form.ts","../../../modules/svelte-effect-runtime/src/remote/client/query-result.ts","../../../modules/svelte-effect-runtime/src/remote/client/prerender.ts","../../../modules/svelte-effect-runtime/src/remote/client/query.ts"],"sourcesContent":["export { copy_property_descriptors } from \"$/internal/descriptors.ts\";\nimport type { NativeMethod } from \"./types.ts\";\n\nexport function has_method<K extends PropertyKey>(\n\tvalue: unknown,\n\tkey: K,\n): value is Record<K, NativeMethod> {\n\tconst value_type = typeof value;\n\n\treturn (\n\t\t((value_type === \"object\" && value !== null) || value_type === \"function\") &&\n\t\ttypeof (value as Record<PropertyKey, unknown>)[key] === \"function\"\n\t);\n}\n","import { decode_remote_error, is_decoded_remote_failure } from \"$/remote/failures.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { create_remote_http_error } from \"$/remote/shared.ts\";\nimport type { RemoteFailure } from \"$/remote/shared.ts\";\nimport { Effect } from \"effect\";\n\nexport const DecodeResponseFailure = <ErrorType = never>(response: Response) =>\n\tEffect.gen(function* () {\n\t\tconst body = yield* MakeEffectFromPromise<unknown, ErrorType>(() => response.json()).pipe(\n\t\t\tEffect.orElseSucceed(() => undefined),\n\t\t);\n\t\tconst decoded = decode_remote_error<ErrorType>(body);\n\n\t\tif (is_decoded_remote_failure(decoded)) {\n\t\t\treturn decoded as RemoteFailure<ErrorType>;\n\t\t}\n\n\t\treturn create_remote_http_error(response.status, body);\n\t});\n\nexport const DecodeResponseOrValue = <Output, ErrorType = never>(\n\tvalue: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n) =>\n\tEffect.gen(function* () {\n\t\tif (value instanceof Response) {\n\t\t\tif (!value.ok) {\n\t\t\t\tconst failure = yield* DecodeResponseFailure<ErrorType>(value);\n\n\t\t\t\treturn yield* Effect.fail(failure);\n\t\t\t}\n\n\t\t\tconst data = yield* DecodeSuccessResponseBody<ErrorType>(value);\n\n\t\t\treturn yield* MakeEffectFromSync<Output, ErrorType>(\n\t\t\t\t() => decode_payload(data) as Output,\n\t\t\t);\n\t\t}\n\n\t\treturn yield* MakeEffectFromSync<Output, ErrorType>(() => decode_payload(value) as Output);\n\t});\n\nconst DecodeSuccessResponseBody = <ErrorType>(response: Response) =>\n\tEffect.gen(function* () {\n\t\tif (response.status === 204 || response.status === 205) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst text = yield* MakeEffectFromPromise<string, ErrorType>(() => response.text());\n\n\t\tif (text.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn yield* MakeEffectFromSync<unknown, ErrorType>(() => JSON.parse(text));\n\t});\n","import { copy_property_descriptors, has_method } from \"./utils.ts\";\nimport { resolve_native_remote_query_updates } from \"$/remote/query-update.ts\";\nimport { InvalidCommandFactoryError } from \"$/errors.ts\";\nimport type { EffectRemoteCommandCall, NativeMethod, Pending } from \"./types.ts\";\nimport { DecodeResponseOrValue } from \"./responses.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { Effect } from \"effect\";\n\ntype EffectRemoteCommandAdapter<Input, Output, ErrorType = never> = ((\n\tinput: undefined extends Input ? Input | void : Input,\n) => EffectRemoteCommandCall<Output, ErrorType>) & {\n\treadonly pending: number;\n};\n\n/** Adapts a generated SvelteKit command to SER's Effect-based client ABI. */\nexport function create_remote_command_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\t_base = \"\",\n\tpending?: Pending,\n): EffectRemoteCommandAdapter<Input, Output, ErrorType> {\n\tconst invoke = has_method(native_factory, \"invoke\") ? native_factory.invoke : undefined;\n\n\tif (typeof native_factory !== \"function\" && !invoke) {\n\t\tthrow new InvalidCommandFactoryError();\n\t}\n\n\tconst count = pending ?? { value: 0 };\n\n\tconst adapter = (input: undefined extends Input ? Input | void : Input) =>\n\t\tMakeCommandEffect<Input, Output, ErrorType>(\n\t\t\tnative_factory,\n\t\t\tinvoke,\n\t\t\tinput,\n\t\t\tdecode_payload,\n\t\t\tcount,\n\t\t);\n\n\tcopy_property_descriptors(native_factory, adapter);\n\n\tif (!Object.prototype.hasOwnProperty.call(adapter, \"pending\")) {\n\t\tObject.defineProperty(adapter, \"pending\", {\n\t\t\tget: () => count.value,\n\t\t});\n\t}\n\n\treturn adapter as EffectRemoteCommandAdapter<Input, Output, ErrorType>;\n}\n\nconst MakeCommandEffect = <Input, Output, ErrorType>(\n\tnative_factory: unknown,\n\tinvoke: NativeMethod | undefined,\n\tinput: undefined extends Input ? Input | void : Input,\n\tdecode_payload: (value: unknown) => unknown,\n\tpending: Pending,\n) => {\n\tlet updates_args: unknown[] | undefined;\n\n\tconst CommandEffect = Effect.acquireUseRelease(\n\t\tAcquirePending(pending),\n\t\t() =>\n\t\t\tInvokeCommand<Input, Output, ErrorType>(\n\t\t\t\tnative_factory,\n\t\t\t\tinvoke,\n\t\t\t\tinput,\n\t\t\t\tdecode_payload,\n\t\t\t\t() => updates_args,\n\t\t\t),\n\t\t() => ReleasePending(pending),\n\t) as EffectRemoteCommandCall<Output, ErrorType>;\n\n\tObject.defineProperty(CommandEffect, \"updates\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: (...args: unknown[]) => {\n\t\t\tupdates_args ??= args;\n\n\t\t\treturn CommandEffect;\n\t\t},\n\t});\n\n\treturn CommandEffect;\n};\n\nconst AcquirePending = (pending: Pending) =>\n\tEffect.sync(() => {\n\t\tpending.value += 1;\n\t});\n\nconst ReleasePending = (pending: Pending) =>\n\tEffect.sync(() => {\n\t\tpending.value -= 1;\n\t});\n\nconst InvokeCommand = <Input, Output, ErrorType>(\n\tnative_factory: unknown,\n\tinvoke: NativeMethod | undefined,\n\tinput: undefined extends Input ? Input | void : Input,\n\tdecode_payload: (value: unknown) => unknown,\n\tread_updates_args: () => unknown[] | undefined,\n) =>\n\tEffect.gen(function* () {\n\t\tconst invocation = yield* MakeEffectFromSync<unknown, ErrorType>(() => {\n\t\t\tconst result = invoke\n\t\t\t\t? invoke.call(native_factory, input)\n\t\t\t\t: (native_factory as NativeMethod)(input);\n\t\t\tconst updates_args = read_updates_args();\n\n\t\t\tif (updates_args && has_method(result, \"updates\")) {\n\t\t\t\treturn result.updates(...resolve_native_remote_query_updates(updates_args));\n\t\t\t}\n\n\t\t\treturn result;\n\t\t});\n\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\tPromise.resolve(invocation),\n\t\t);\n\n\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t});\n","export function to_form_data(input: unknown): FormData {\n\tconst form_data = new FormData();\n\n\tappend_form_value(form_data, \"\", input);\n\n\treturn form_data;\n}\n\nfunction append_form_value(form_data: FormData, path: string, value: unknown): void {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, item] of value.entries()) {\n\t\t\tappend_form_value(form_data, `${path}[${index}]`, item);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (value instanceof Blob) {\n\t\tform_data.append(path, value);\n\n\t\treturn;\n\t}\n\n\tif (typeof value === \"object\" && value !== null) {\n\t\tfor (const [key, child] of Object.entries(value)) {\n\t\t\tconst child_path = path.length === 0 ? key : `${path}.${key}`;\n\n\t\t\tappend_form_value(form_data, child_path, child);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (typeof value === \"number\") {\n\t\tform_data.append(`n:${path}`, String(value));\n\n\t\treturn;\n\t}\n\n\tif (typeof value === \"boolean\") {\n\t\tform_data.append(`b:${path}`, value ? \"on\" : \"off\");\n\n\t\treturn;\n\t}\n\n\tform_data.append(path, value === null ? \"\" : String(value));\n}\n","import {\n\tInvalidRemoteFormResponseError,\n\tRemoteFormEndpointMissingError,\n\tUnsupportedRemoteFormResponseError,\n} from \"$/errors.ts\";\nimport {\n\tcreate_remote_http_error,\n\tcreate_remote_transport_error,\n\tcreate_remote_validation_error,\n} from \"$/remote/shared.ts\";\nimport { decode_remote_error, is_decoded_remote_failure } from \"$/remote/failures.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport type { FormIssue } from \"$/remote/shared.ts\";\nimport type { StandardSchema } from \"$/internal/schema.ts\";\nimport { DecodeResponseFailure } from \"./responses.ts\";\nimport type { NativeFormRecord } from \"./types.ts\";\nimport { Effect, Option, Schema } from \"effect\";\nimport { to_form_data } from \"./form-data.ts\";\nimport { parse } from \"devalue\";\n\ntype RemoteFormResponseEnvelope =\n\t| {\n\t\t\treadonly _tag: \"RemoteFormErrorEnvelope\";\n\t\t\treadonly error?: unknown;\n\t\t\treadonly status?: number | undefined;\n\t }\n\t| {\n\t\t\treadonly _tag: \"RemoteFormResultEnvelope\";\n\t\t\treadonly data: string;\n\t }\n\t| {\n\t\t\treadonly _tag: \"RemoteFormRedirectEnvelope\";\n\t\t\treadonly location: string;\n\t };\n\nexport interface RemoteFormTransport {\n\treadonly binary_form_content_type?: string;\n\treadonly decoders?: Record<string, (value: unknown) => unknown>;\n\treadonly navigate?: (location: string, invalidate_all: boolean) => PromiseLike<void> | void;\n\treadonly remote_request?: (url: string, init?: RequestInit) => PromiseLike<unknown>;\n\treadonly refresh?: () => PromiseLike<void> | void;\n\treadonly serialize_binary_form?: (\n\t\tdata: unknown,\n\t\tmeta: { readonly remote_refreshes: readonly string[] },\n\t) => { readonly blob: Blob };\n}\n\ninterface KitRemoteFormTransport extends RemoteFormTransport {\n\treadonly binary_form_content_type: string;\n\treadonly remote_request: (url: string, init?: RequestInit) => PromiseLike<unknown>;\n\treadonly serialize_binary_form: (\n\t\tdata: unknown,\n\t\tmeta: { readonly remote_refreshes: readonly string[] },\n\t) => { readonly blob: Blob };\n}\n\ntype RemoteFormDecodedPayload<Output> = {\n\treadonly issues?: readonly FormIssue[];\n\treadonly result?: Output;\n};\n\nconst FormIssuePathSegmentSchema = Schema.Union([Schema.String, Schema.Number]);\n\nconst FormIssueSchema = Schema.Struct({\n\tmessage: Schema.String,\n\tpath: Schema.Array(FormIssuePathSegmentSchema),\n});\n\nconst RemoteFormErrorEnvelopeSchema = Schema.Struct({\n\ttype: Schema.Literal(\"error\"),\n\terror: Schema.optional(Schema.Unknown),\n\tstatus: Schema.optional(Schema.Number),\n});\n\nconst RemoteFormResultEnvelopeSchema = Schema.Struct({\n\ttype: Schema.Literal(\"result\"),\n\tdata: Schema.String,\n});\n\nconst RemoteFormRedirectEnvelopeSchema = Schema.Struct({\n\ttype: Schema.Literal(\"redirect\"),\n\tlocation: Schema.String,\n});\n\nconst RemoteFormResponseEnvelopeSchema = Schema.Union([\n\tRemoteFormErrorEnvelopeSchema,\n\tRemoteFormResultEnvelopeSchema,\n\tRemoteFormRedirectEnvelopeSchema,\n]);\n\nconst RemoteFormDecodedPayloadSchema = Schema.Struct({\n\tissues: Schema.optional(Schema.Array(FormIssueSchema)),\n\tresult: Schema.optional(Schema.Unknown),\n});\n\nconst RemoteFormRedirectDataSchema = Schema.Struct({\n\tredirect: Schema.String,\n});\n\nconst RemoteFormResultDataSchema = Schema.Struct({\n\t_: Schema.Unknown,\n});\n\nconst KitRemoteFormDataSchema = Schema.Struct({\n\t_: Schema.optional(Schema.Unknown),\n\tredirect: Schema.optional(Schema.String),\n\tr: Schema.optional(Schema.Literal(true)),\n});\n\nconst DecodeRemoteFormResponseEnvelope = Schema.decodeUnknownOption(\n\tRemoteFormResponseEnvelopeSchema,\n);\nconst DecodeRemoteFormPayload = Schema.decodeUnknownOption(RemoteFormDecodedPayloadSchema);\nconst DecodeRemoteFormRedirectData = Schema.decodeUnknownOption(RemoteFormRedirectDataSchema);\nconst DecodeRemoteFormResultData = Schema.decodeUnknownOption(RemoteFormResultDataSchema);\nconst DecodeKitRemoteFormData = Schema.decodeUnknownOption(KitRemoteFormDataSchema);\n\nexport const SubmitRemoteForm = <Output, ErrorType = never>(\n\tform_obj: NativeFormRecord,\n\tinput: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_base: string,\n\tremote_transport: RemoteFormTransport,\n\tpreflight_schema?: StandardSchema,\n) =>\n\tEffect.gen(function* () {\n\t\tconst action_id = yield* MakeEffectFromSync<string | undefined, ErrorType>(() =>\n\t\t\tget_remote_action_id(form_obj),\n\t\t);\n\n\t\tif (!action_id || remote_base.length === 0) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new RemoteFormEndpointMissingError()),\n\t\t\t);\n\t\t}\n\n\t\tyield* ValidatePreflightInput<ErrorType>(preflight_schema, input);\n\n\t\tif (is_kit_remote_form_transport(remote_transport)) {\n\t\t\treturn yield* SubmitRemoteFormWithKit<Output, ErrorType>(\n\t\t\t\taction_id,\n\t\t\t\tinput,\n\t\t\t\tdecode_payload,\n\t\t\t\tremote_base,\n\t\t\t\tremote_transport,\n\t\t\t);\n\t\t}\n\n\t\tconst response = yield* MakeEffectFromPromise<Response, ErrorType>((signal) =>\n\t\t\tfetch(to_remote_form_url(remote_base, action_id), {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: get_remote_request_headers(),\n\t\t\t\tbody: to_form_data(to_remote_form_input(input, action_id)),\n\t\t\t\tsignal,\n\t\t\t}),\n\t\t);\n\n\t\tif (!response.ok) {\n\t\t\tconst failure = yield* DecodeResponseFailure<ErrorType>(response);\n\n\t\t\treturn yield* Effect.fail(failure);\n\t\t}\n\n\t\tconst envelope = yield* MakeEffectFromPromise<unknown, ErrorType>(() => response.json());\n\n\t\treturn yield* DecodeFormResponse<Output, ErrorType>(\n\t\t\tenvelope,\n\t\t\tdecode_payload,\n\t\t\tremote_transport,\n\t\t);\n\t});\n\nconst SubmitRemoteFormWithKit = <Output, ErrorType>(\n\taction_id: string,\n\tinput: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_base: string,\n\tremote_transport: KitRemoteFormTransport,\n) =>\n\tEffect.gen(function* () {\n\t\tconst url = to_remote_form_url(remote_base, action_id);\n\t\tconst body = yield* MakeEffectFromSync<Blob, ErrorType>(\n\t\t\t() =>\n\t\t\t\tremote_transport.serialize_binary_form(to_remote_form_input(input, action_id), {\n\t\t\t\t\tremote_refreshes: [],\n\t\t\t\t}).blob,\n\t\t);\n\t\tconst data = yield* MakeEffectFromPromise<unknown, ErrorType>((signal) =>\n\t\t\tremote_transport.remote_request(url, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\t...get_remote_request_headers(),\n\t\t\t\t\t\"Content-Type\": remote_transport.binary_form_content_type,\n\t\t\t\t},\n\t\t\t\tbody,\n\t\t\t\tsignal,\n\t\t\t}),\n\t\t);\n\n\t\treturn yield* DecodeKitFormData<Output, ErrorType>(data, decode_payload, remote_transport);\n\t});\n\nexport function get_remote_action_id(form_obj: NativeFormRecord): string | undefined {\n\tconst action = form_obj.action;\n\n\tif (typeof action !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\tconst fallback = \"http://localhost/\";\n\tconst href = typeof location === \"undefined\" ? fallback : location.href;\n\tconst url = new URL(action, href);\n\n\treturn url.searchParams.get(\"/remote\") ?? url.searchParams.get(\"remote\") ?? undefined;\n}\n\nfunction to_remote_form_url(remote_base: string, action_id: string): string {\n\tconst parts = action_id.split(\"/\");\n\tconst head = parts.slice(0, 2).join(\"/\");\n\tconst normalized_base = remote_base.replace(/\\/$/, \"\");\n\n\treturn `${normalized_base}/${head}`;\n}\n\nfunction to_remote_form_input(input: unknown, action_id: string): Record<string, unknown> {\n\tconst data = is_record(input) ? input : {};\n\tconst serialized_key = action_id.split(\"/\").slice(2).join(\"/\");\n\tconst key: unknown = serialized_key.length === 0 ? undefined : JSON.parse(serialized_key);\n\n\tif (key === undefined || data.id !== undefined) {\n\t\treturn data;\n\t}\n\n\treturn {\n\t\t...data,\n\t\tid: key,\n\t};\n}\n\nfunction get_remote_request_headers(): Record<string, string> {\n\tif (typeof location === \"undefined\") {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\t\"x-sveltekit-pathname\": location.pathname,\n\t\t\"x-sveltekit-search\": location.search,\n\t};\n}\n\nconst ValidatePreflightInput = <ErrorType>(schema: StandardSchema | undefined, input: unknown) =>\n\tEffect.gen(function* () {\n\t\tif (!schema) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst validated = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\tPromise.resolve(schema[\"~standard\"].validate(input)),\n\t\t);\n\n\t\tif (!is_record(validated) || !Array.isArray(validated.issues)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst issues = validated.issues.map(normalize_standard_issue);\n\n\t\treturn yield* Effect.fail(create_remote_validation_error(issues, { issues }, 400));\n\t});\n\nfunction normalize_standard_issue(issue: unknown): FormIssue {\n\tif (!is_record(issue)) {\n\t\treturn { message: String(issue), path: [] };\n\t}\n\n\tconst message = typeof issue.message === \"string\" ? issue.message : \"Invalid input\";\n\tconst path = Array.isArray(issue.path) ? issue.path.flatMap(normalize_path_segment) : [];\n\n\treturn { message, path };\n}\n\nfunction normalize_path_segment(segment: unknown): Array<string | number> {\n\tif (typeof segment === \"string\" || typeof segment === \"number\") {\n\t\treturn [segment];\n\t}\n\n\tif (!is_record(segment)) {\n\t\treturn [];\n\t}\n\n\tconst key = segment.key;\n\n\tif (typeof key === \"string\" || typeof key === \"number\") {\n\t\treturn [key];\n\t}\n\n\treturn [];\n}\n\nfunction is_record(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nconst DecodeFormResponse = <Output, ErrorType>(\n\tenvelope: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_transport: RemoteFormTransport,\n) =>\n\tEffect.gen(function* () {\n\t\tconst response = decode_remote_form_response_envelope(envelope);\n\n\t\tif (!response) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew InvalidRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif (response._tag === \"RemoteFormErrorEnvelope\") {\n\t\t\tconst decoded = decode_remote_error<ErrorType>(response.error);\n\n\t\t\tif (is_decoded_remote_failure(decoded)) {\n\t\t\t\treturn yield* Effect.fail(decoded);\n\t\t\t}\n\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_http_error(get_remote_form_error_status(response), response.error),\n\t\t\t);\n\t\t}\n\n\t\tif (response._tag === \"RemoteFormRedirectEnvelope\") {\n\t\t\treturn yield* NavigateRemoteForm<ErrorType>(\n\t\t\t\tresponse.location,\n\t\t\t\ttrue,\n\t\t\t\tremote_transport,\n\t\t\t\tenvelope,\n\t\t\t);\n\t\t}\n\n\t\tconst parsed = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\tparse(response.data, remote_transport.decoders),\n\t\t);\n\t\tconst redirect_data = DecodeRemoteFormRedirectData(parsed);\n\n\t\tif (Option.isSome(redirect_data)) {\n\t\t\treturn yield* NavigateRemoteForm<ErrorType>(\n\t\t\t\tredirect_data.value.redirect,\n\t\t\t\ttrue,\n\t\t\t\tremote_transport,\n\t\t\t\tenvelope,\n\t\t\t);\n\t\t}\n\n\t\tconst result_data = DecodeRemoteFormResultData(parsed);\n\n\t\tif (!Option.isSome(result_data)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew UnsupportedRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tconst payload = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\tdecode_payload(result_data.value._),\n\t\t);\n\t\tconst decoded = decode_remote_form_payload<Output>(payload);\n\n\t\tif (!decoded) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew UnsupportedRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif (decoded.issues && decoded.issues.length > 0) {\n\t\t\treturn yield* Effect.fail(create_remote_validation_error(decoded.issues, decoded, 400));\n\t\t}\n\n\t\tyield* RefreshRemoteFormState<ErrorType>(remote_transport);\n\n\t\treturn decoded.result as Output;\n\t});\n\nconst DecodeKitFormData = <Output, ErrorType>(\n\tdata: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_transport: RemoteFormTransport,\n) =>\n\tEffect.gen(function* () {\n\t\tconst decoded_data = DecodeKitRemoteFormData(data);\n\n\t\tif (!Option.isSome(decoded_data)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new UnsupportedRemoteFormResponseError(data), data),\n\t\t\t);\n\t\t}\n\n\t\tconst should_invalidate = decoded_data.value.r !== true;\n\n\t\tif (decoded_data.value.redirect) {\n\t\t\treturn yield* NavigateRemoteForm<ErrorType>(\n\t\t\t\tdecoded_data.value.redirect,\n\t\t\t\tshould_invalidate,\n\t\t\t\tremote_transport,\n\t\t\t\tdata,\n\t\t\t);\n\t\t}\n\n\t\tif (!(\"_\" in decoded_data.value)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new UnsupportedRemoteFormResponseError(data), data),\n\t\t\t);\n\t\t}\n\n\t\tconst payload = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\tdecode_payload(decoded_data.value._),\n\t\t);\n\t\tconst decoded = decode_remote_form_payload<Output>(payload);\n\n\t\tif (!decoded) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new UnsupportedRemoteFormResponseError(data), data),\n\t\t\t);\n\t\t}\n\n\t\tif (decoded.issues && decoded.issues.length > 0) {\n\t\t\treturn yield* Effect.fail(create_remote_validation_error(decoded.issues, decoded, 400));\n\t\t}\n\n\t\tif (should_invalidate) {\n\t\t\tyield* RefreshRemoteFormState<ErrorType>(remote_transport);\n\t\t}\n\n\t\treturn decoded.result as Output;\n\t});\n\nconst NavigateRemoteForm = <ErrorType>(\n\tlocation: string,\n\tinvalidate_all: boolean,\n\tremote_transport: RemoteFormTransport,\n\tenvelope: unknown,\n) =>\n\tEffect.gen(function* () {\n\t\tconst navigate = remote_transport.navigate;\n\n\t\tif (!navigate) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew UnsupportedRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tyield* MakeEffectFromPromise<void, ErrorType>(() =>\n\t\t\tPromise.resolve(navigate(location, invalidate_all)),\n\t\t);\n\n\t\treturn yield* Effect.interrupt;\n\t});\n\nconst RefreshRemoteFormState = <ErrorType>(remote_transport: RemoteFormTransport) =>\n\tEffect.gen(function* () {\n\t\tconst refresh = remote_transport.refresh;\n\n\t\tif (!refresh) {\n\t\t\treturn;\n\t\t}\n\n\t\tyield* MakeEffectFromPromise<void, ErrorType>(() => Promise.resolve(refresh()));\n\t});\n\nfunction decode_remote_form_response_envelope(\n\tenvelope: unknown,\n): RemoteFormResponseEnvelope | undefined {\n\tconst decoded = DecodeRemoteFormResponseEnvelope(envelope);\n\n\tif (!Option.isSome(decoded)) {\n\t\treturn undefined;\n\t}\n\n\tif (decoded.value.type === \"error\") {\n\t\treturn {\n\t\t\t_tag: \"RemoteFormErrorEnvelope\",\n\t\t\terror: decoded.value.error,\n\t\t\tstatus: decoded.value.status,\n\t\t};\n\t}\n\n\tif (decoded.value.type === \"redirect\") {\n\t\treturn {\n\t\t\t_tag: \"RemoteFormRedirectEnvelope\",\n\t\t\tlocation: decoded.value.location,\n\t\t};\n\t}\n\n\treturn {\n\t\t_tag: \"RemoteFormResultEnvelope\",\n\t\tdata: decoded.value.data,\n\t};\n}\n\nfunction get_remote_form_error_status(\n\tresponse: Extract<RemoteFormResponseEnvelope, { _tag: \"RemoteFormErrorEnvelope\" }>,\n): number {\n\tconst nested_status = is_record(response.error) ? response.error.status : undefined;\n\n\tif (response.status !== undefined) {\n\t\treturn response.status;\n\t}\n\n\treturn typeof nested_status === \"number\" ? nested_status : 500;\n}\n\nfunction is_kit_remote_form_transport(\n\tremote_transport: RemoteFormTransport,\n): remote_transport is KitRemoteFormTransport {\n\treturn (\n\t\ttypeof remote_transport.binary_form_content_type === \"string\" &&\n\t\ttypeof remote_transport.remote_request === \"function\" &&\n\t\ttypeof remote_transport.serialize_binary_form === \"function\"\n\t);\n}\n\nfunction decode_remote_form_payload<Output>(\n\tpayload: unknown,\n): RemoteFormDecodedPayload<Output> | undefined {\n\tconst decoded = DecodeRemoteFormPayload(payload);\n\n\tif (!Option.isSome(decoded)) {\n\t\treturn undefined;\n\t}\n\n\treturn decoded.value as RemoteFormDecodedPayload<Output>;\n}\n","import { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { resolve_native_remote_query_updates } from \"$/remote/query-update.ts\";\nimport type { EffectRemoteFormSubmit, NativeMethod } from \"./types.ts\";\nimport { get_dispatcher } from \"$/dispatcher.ts\";\nimport { has_method } from \"./utils.ts\";\nimport { Effect } from \"effect\";\n\nexport function wrap_enhance_callback<Output, ErrorType = never>(\n\tcallback: NativeMethod | undefined,\n): NativeMethod | undefined {\n\tif (!callback) {\n\t\treturn undefined;\n\t}\n\n\treturn (event: unknown) => {\n\t\tconst wrapped_event = wrap_submit_callback<Output, ErrorType>(event);\n\t\tconst result = callback(wrapped_event);\n\n\t\tif (Effect.isEffect(result)) {\n\t\t\treturn get_dispatcher().run(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction wrap_submit_callback<Output, ErrorType>(event: unknown): unknown {\n\tif (typeof event !== \"object\" || event === null || !has_method(event, \"submit\")) {\n\t\treturn event;\n\t}\n\n\tconst original_submit = event.submit;\n\tconst { submit: _submit, ...descriptors } = Object.getOwnPropertyDescriptors(event);\n\n\tvoid _submit;\n\n\treturn Object.defineProperties(\n\t\t{},\n\t\t{\n\t\t\t...descriptors,\n\t\t\tsubmit: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: () => MakeSubmitEffect<Output, ErrorType>(original_submit, event),\n\t\t\t},\n\t\t},\n\t);\n}\n\nfunction MakeSubmitEffect<Output, ErrorType>(\n\toriginal_submit: NativeMethod,\n\tevent: unknown,\n): EffectRemoteFormSubmit<Output, ErrorType> {\n\tlet updates_args: unknown[] | undefined;\n\n\tconst SubmitEffect = Effect.gen(function* () {\n\t\tconst result = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\toriginal_submit.call(event),\n\t\t);\n\t\tconst value = yield* ResolveSubmitResult<ErrorType>(result, updates_args);\n\n\t\tif (typeof value === \"boolean\") {\n\t\t\treturn read_submit_result<Output>(event);\n\t\t}\n\n\t\treturn value as Output;\n\t}) as EffectRemoteFormSubmit<Output, ErrorType>;\n\n\tObject.defineProperty(SubmitEffect, \"updates\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: (...args: unknown[]) => {\n\t\t\tupdates_args ??= args;\n\n\t\t\treturn SubmitEffect;\n\t\t},\n\t});\n\n\treturn SubmitEffect;\n}\n\nconst ResolveSubmitResult = <ErrorType>(result: unknown, updates_args: unknown[] | undefined) =>\n\tEffect.gen(function* () {\n\t\tif (updates_args && has_method(result, \"updates\")) {\n\t\t\treturn yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\tPromise.resolve(\n\t\t\t\t\tresult.updates(...resolve_native_remote_query_updates(updates_args)),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn yield* MakeEffectFromPromise<unknown, ErrorType>(() => Promise.resolve(result));\n\t});\n\nfunction read_submit_result<Output>(event: unknown): Output | undefined {\n\tif (typeof event !== \"object\" || event === null || !(\"result\" in event)) {\n\t\treturn undefined;\n\t}\n\n\treturn Reflect.get(event, \"result\") as Output | undefined;\n}\n","import { is_standard_schema, normalize_validator, type StandardSchema } from \"$/internal/schema.ts\";\nimport type { EffectRemoteForm, NativeFormRecord, NativeMethod } from \"./types.ts\";\nimport {\n\tget_remote_action_id,\n\tSubmitRemoteForm,\n\ttype RemoteFormTransport,\n} from \"./form-transport.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { copy_property_descriptors, has_method } from \"./utils.ts\";\nimport { wrap_enhance_callback } from \"./form-enhance.ts\";\nimport { DecodeResponseOrValue } from \"./responses.ts\";\nimport type { RemoteFormInput } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\n\ntype RemoteInput<Input> = undefined extends Input ? Input | void : Input;\n\ninterface RemoteFormAdapterState {\n\tshared_preflight_schema?: StandardSchema;\n}\n\n/** Adapts a generated SvelteKit form to SER's Effect-based client ABI. */\nexport function create_remote_form_adapter<\n\tInput extends RemoteFormInput | void,\n\tOutput,\n\tErrorType = never,\n>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_base = \"\",\n\tremote_transport: RemoteFormTransport = {},\n\tadapter_state: RemoteFormAdapterState = {},\n\tkeyed = false,\n): EffectRemoteForm<Input, Output, ErrorType> {\n\tconst form_obj = native_factory as NativeFormRecord;\n\tlet local_preflight_schema: StandardSchema | undefined;\n\n\tconst SubmitForm = (input?: RemoteInput<Input>) =>\n\t\tEffect.gen(function* () {\n\t\t\tconst action_id = yield* MakeEffectFromSync<string | undefined, ErrorType>(() =>\n\t\t\t\tget_remote_action_id(form_obj),\n\t\t\t);\n\t\t\tconst can_use_remote_endpoint = remote_base.length > 0 && action_id !== undefined;\n\n\t\t\tif (has_method(form_obj, \"submit\") && !can_use_remote_endpoint) {\n\t\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\t\tPromise.resolve(form_obj.submit(input)),\n\t\t\t\t);\n\n\t\t\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t\t\t}\n\n\t\t\treturn yield* SubmitRemoteForm<Output, ErrorType>(\n\t\t\t\tform_obj,\n\t\t\t\tinput,\n\t\t\t\tdecode_payload,\n\t\t\t\tremote_base,\n\t\t\t\tremote_transport,\n\t\t\t\tlocal_preflight_schema ?? adapter_state.shared_preflight_schema,\n\t\t\t);\n\t\t});\n\n\tconst callable = ((input?: RemoteInput<Input>) => SubmitForm(input)) as EffectRemoteForm<\n\t\tInput,\n\t\tOutput,\n\t\tErrorType\n\t>;\n\n\tcopy_property_descriptors(\n\t\tform_obj,\n\t\tcallable,\n\t\tnew Set([\"submit\", \"validate\", \"enhance\", \"for\", \"preflight\"]),\n\t);\n\n\tObject.defineProperty(callable, \"submit\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: SubmitForm,\n\t});\n\n\tif (has_method(form_obj, \"validate\")) {\n\t\tconst validate = form_obj.validate;\n\n\t\tObject.defineProperty(callable, \"validate\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (options?: Record<string, unknown>) =>\n\t\t\t\tValidateRemoteForm<ErrorType>(form_obj, validate, options),\n\t\t});\n\t}\n\n\tif (has_method(form_obj, \"enhance\")) {\n\t\tObject.defineProperty(callable, \"enhance\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (callback?: NativeMethod) =>\n\t\t\t\tform_obj.enhance(wrap_enhance_callback<Output, ErrorType>(callback)),\n\t\t});\n\t}\n\n\tif (has_method(form_obj, \"for\")) {\n\t\tObject.defineProperty(callable, \"for\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (key: string | number | boolean) =>\n\t\t\t\tcreate_remote_form_adapter<Input, Output, ErrorType>(\n\t\t\t\t\tform_obj.for(key),\n\t\t\t\t\tdecode_payload,\n\t\t\t\t\tremote_base,\n\t\t\t\t\tremote_transport,\n\t\t\t\t\tadapter_state,\n\t\t\t\t\ttrue,\n\t\t\t\t),\n\t\t});\n\t}\n\n\tif (has_method(form_obj, \"preflight\")) {\n\t\tObject.defineProperty(callable, \"preflight\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (schema: unknown) => {\n\t\t\t\tconst normalized_schema = normalize_validator(schema);\n\n\t\t\t\tif (is_standard_schema(normalized_schema)) {\n\t\t\t\t\tlocal_preflight_schema = normalized_schema;\n\n\t\t\t\t\tif (!keyed) {\n\t\t\t\t\t\tadapter_state.shared_preflight_schema = normalized_schema;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tform_obj.preflight(normalized_schema);\n\n\t\t\t\treturn callable;\n\t\t\t},\n\t\t});\n\t}\n\n\treturn callable;\n}\n\nconst ValidateRemoteForm = <ErrorType>(\n\tform_obj: NativeFormRecord,\n\tvalidate: NativeMethod,\n\toptions: Record<string, unknown> | undefined,\n) =>\n\tEffect.gen(function* () {\n\t\tyield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\tPromise.resolve(validate.call(form_obj, normalize_validate_options(validate, options))),\n\t\t);\n\t});\n\nfunction normalize_validate_options(\n\tvalidate: NativeMethod,\n\toptions: Record<string, unknown> | undefined,\n): Record<string, unknown> | undefined {\n\tif (!options || !(\"all\" in options) || \"includeUntouched\" in options) {\n\t\treturn options;\n\t}\n\n\tconst source = Function.prototype.toString.call(validate);\n\tconst uses_stable_option = source.includes(\"includeUntouched\") && !/\\ball\\s*=/.test(source);\n\n\tif (!uses_stable_option) {\n\t\treturn options;\n\t}\n\n\treturn {\n\t\t...options,\n\t\tincludeUntouched: options.all,\n\t};\n}\n","import { DecodeResponseOrValue } from \"./responses.ts\";\nimport { MakeEffectFromPromise } from \"$/remote/effect.ts\";\nimport { has_method } from \"./utils.ts\";\nimport { Effect } from \"effect\";\n\nexport const ResolveQueryResult = <Output, ErrorType = never>(\n\tvalue: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n) =>\n\tEffect.gen(function* () {\n\t\tif (has_method(value, \"then\")) {\n\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\tPromise.resolve(value),\n\t\t\t);\n\n\t\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t\t}\n\n\t\tif (has_method(value, \"run\")) {\n\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\tPromise.resolve(value.run()),\n\t\t\t);\n\n\t\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t\t}\n\n\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(value, decode_payload);\n\t});\n","import {\n\tattach_failed_remote_resource_getters,\n\tattach_remote_resource_getters,\n\ttype RemoteResourceEffect,\n} from \"$/remote/resource.ts\";\nimport { InvalidPrerenderFactoryError } from \"$/errors.ts\";\nimport { FailWithRemoteError } from \"$/remote/effect.ts\";\nimport { copy_property_descriptors } from \"./utils.ts\";\nimport { ResolveQueryResult } from \"./query-result.ts\";\nimport type { NativeMethod } from \"./types.ts\";\nimport { Result } from \"effect\";\n\ntype RemoteInput<Input> = undefined extends Input ? Input | void : Input;\n\ntype EffectRemotePrerenderAdapter<Input, Output, ErrorType = never> = (\n\tinput: RemoteInput<Input>,\n) => RemoteResourceEffect<Output, ErrorType>;\n\nexport function create_remote_prerender_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => Output,\n): EffectRemotePrerenderAdapter<Input, Output, ErrorType>;\nexport function create_remote_prerender_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n): EffectRemotePrerenderAdapter<Input, Output, ErrorType>;\nexport function create_remote_prerender_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n): EffectRemotePrerenderAdapter<Input, Output, ErrorType> {\n\tif (typeof native_factory !== \"function\") {\n\t\tthrow new InvalidPrerenderFactoryError();\n\t}\n\n\tconst prerender = native_factory as NativeMethod;\n\tconst wrapped = ((input: RemoteInput<Input>) => {\n\t\tconst resource_attempt = Result.try(() => prerender(input));\n\n\t\tif (Result.isFailure(resource_attempt)) {\n\t\t\tconst PrerenderEffect = FailWithRemoteError<ErrorType>(\n\t\t\t\tresource_attempt.failure,\n\t\t\t) as unknown as RemoteResourceEffect<Output, ErrorType>;\n\n\t\t\tattach_failed_remote_resource_getters(resource_attempt.failure, PrerenderEffect);\n\n\t\t\treturn PrerenderEffect;\n\t\t}\n\n\t\tconst resource = resource_attempt.success;\n\t\tconst PrerenderEffect = ResolveQueryResult<Output, ErrorType>(\n\t\t\tresource,\n\t\t\tdecode_payload,\n\t\t) as RemoteResourceEffect<Output, ErrorType>;\n\n\t\tattach_remote_resource_getters(resource, PrerenderEffect);\n\n\t\treturn PrerenderEffect;\n\t}) as EffectRemotePrerenderAdapter<Input, Output, ErrorType>;\n\n\tcopy_property_descriptors(native_factory, wrapped);\n\n\treturn wrapped;\n}\n","import {\n\tattach_failed_remote_query_resource,\n\tattach_remote_resource_getters,\n\tis_remote_resource,\n\ttype NativeRemoteResource,\n\ttype RemoteResourceEffect,\n} from \"$/remote/resource.ts\";\nimport {\n\tmake_failed_remote_live_stream,\n\tmake_remote_live_stream,\n\ttype RemoteLiveStream,\n} from \"$/live.ts\";\nimport { InvalidLiveQueryFactoryError, InvalidQueryFactoryError } from \"$/errors.ts\";\nimport { FailWithRemoteError, MakeEffectFromPromise } from \"$/remote/effect.ts\";\nimport { attach_native_remote_query_update } from \"$/remote/query-update.ts\";\nimport type { EffectRemoteQueryUpdateBrand, NativeMethod } from \"./types.ts\";\nimport { copy_property_descriptors, has_method } from \"./utils.ts\";\nimport { normalize_native_error } from \"$/remote/failures.ts\";\nimport { ResolveQueryResult } from \"./query-result.ts\";\nimport { Effect, Result } from \"effect\";\n\ntype RemoteInput<Input> = undefined extends Input ? Input | void : Input;\n\ntype DecodePayload<Output> = (value: unknown) => Output;\n\ntype QueryAdapterMode = \"standard\" | \"batch\";\n\ntype NativeQueryFactory<Input> =\n\t| ((input: RemoteInput<Input>) => unknown)\n\t| {\n\t\t\treadonly load: (input: RemoteInput<Input>) => unknown;\n\t };\n\ntype RemoteQueryEffect<Output, ErrorType = never> = EffectRemoteQueryUpdateBrand &\n\tRemoteResourceEffect<Output, ErrorType> & {\n\t\treadonly refresh: () => Effect.Effect<void, unknown, never>;\n\t\treadonly set: (value: Output) => void;\n\t\treadonly withOverride: (update: (current: Output) => Output) => unknown;\n\t};\n\ntype NativeQueryResource<Output> = NativeRemoteResource<Output> & {\n\treadonly refresh?: () => Promise<void>;\n\treadonly set?: (value: Output) => void;\n\treadonly withOverride?: (update: (current: Output) => Output) => unknown;\n};\n\n/** Adapts a generated SvelteKit query to SER's Effect-based client ABI. */\nexport function create_remote_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: NativeQueryFactory<Input>,\n\tdecode_payload: DecodePayload<Output>,\n\t_base?: string,\n\tmode?: QueryAdapterMode,\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);\nexport function create_remote_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: NativeQueryFactory<Input>,\n\tdecode_payload: (value: unknown) => unknown,\n\t_base?: string,\n\tmode?: QueryAdapterMode,\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);\nexport function create_remote_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: DecodePayload<Output>,\n\t_base = \"\",\n\tmode: QueryAdapterMode = \"standard\",\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>) {\n\tconst load = has_method(native_factory, \"load\") ? native_factory.load : undefined;\n\tconst query =\n\t\ttypeof native_factory === \"function\" ? (native_factory as NativeMethod) : undefined;\n\n\tif (!query && !load) {\n\t\tthrow new InvalidQueryFactoryError();\n\t}\n\n\tconst wrapped = ((input: RemoteInput<Input>) => {\n\t\tif (!query) {\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\t\tPromise.resolve(load?.call(native_factory, input)),\n\t\t\t\t);\n\n\t\t\t\treturn yield* ResolveQueryResult<Output, ErrorType>(result, decode_payload);\n\t\t\t}) as RemoteQueryEffect<Output, ErrorType>;\n\t\t}\n\n\t\tconst resource_attempt = Result.try(() => query(input));\n\n\t\tif (Result.isFailure(resource_attempt)) {\n\t\t\tconst QueryEffect = FailWithRemoteError<ErrorType>(\n\t\t\t\tresource_attempt.failure,\n\t\t\t) as unknown as RemoteQueryEffect<Output, ErrorType>;\n\n\t\t\tattach_failed_remote_query_resource(resource_attempt.failure, QueryEffect);\n\n\t\t\treturn QueryEffect;\n\t\t}\n\n\t\tconst resource = resource_attempt.success;\n\t\tconst query_result = mode === \"batch\" ? begin_batch_query_result(resource) : resource;\n\t\tconst QueryEffect = ResolveQueryResult<Output, ErrorType>(\n\t\t\tquery_result,\n\t\t\tdecode_payload,\n\t\t) as RemoteQueryEffect<Output, ErrorType>;\n\n\t\tattach_native_remote_query_update(QueryEffect, resource);\n\t\tattach_query_resource(resource, QueryEffect);\n\n\t\treturn QueryEffect;\n\t}) as EffectRemoteQueryUpdateBrand &\n\t\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);\n\n\tcopy_property_descriptors(native_factory, wrapped);\n\tattach_native_remote_query_update(wrapped, native_factory);\n\n\treturn wrapped;\n}\n\nfunction begin_batch_query_result(resource: unknown): unknown {\n\tif (!has_method(resource, \"then\")) {\n\t\treturn resource;\n\t}\n\n\tconst result = Promise.resolve(resource);\n\n\tvoid result.catch(() => {});\n\n\treturn result;\n}\n\n/** Adapts a generated SvelteKit live query to SER's Effect-based client ABI. */\nexport function create_remote_live_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\t_decode_payload: (value: unknown) => unknown,\n\t_base = \"\",\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteLiveStream<Output, ErrorType>) {\n\tconst query =\n\t\ttypeof native_factory === \"function\" ? (native_factory as NativeMethod) : undefined;\n\n\tif (!query) {\n\t\tthrow new InvalidLiveQueryFactoryError();\n\t}\n\n\tconst wrapped = ((input: Input) => {\n\t\tconst resource_attempt = Result.try(() => query(input));\n\n\t\tif (Result.isFailure(resource_attempt)) {\n\t\t\treturn make_failed_remote_live_stream<Output, ErrorType>(\n\t\t\t\tresource_attempt.failure,\n\t\t\t\tnormalize_native_error,\n\t\t\t);\n\t\t}\n\n\t\tconst resource = resource_attempt.success;\n\n\t\tconst stream = make_remote_live_stream<Output, ErrorType>(resource, normalize_native_error);\n\n\t\tattach_native_remote_query_update(stream, resource);\n\n\t\treturn stream;\n\t}) as EffectRemoteQueryUpdateBrand &\n\t\t((input: RemoteInput<Input>) => RemoteLiveStream<Output, ErrorType>);\n\n\tcopy_property_descriptors(native_factory, wrapped);\n\tattach_native_remote_query_update(wrapped, native_factory);\n\n\treturn wrapped;\n}\n\nfunction attach_query_resource<Output, ErrorType = never>(\n\tresource: unknown,\n\teffect: RemoteQueryEffect<Output, ErrorType>,\n): void {\n\tconst methods = is_remote_resource<Output>(resource)\n\t\t? (resource as NativeQueryResource<Output>)\n\t\t: undefined;\n\tconst refresh = methods?.refresh;\n\tconst set = methods?.set;\n\tconst with_override = methods?.withOverride;\n\n\tattach_remote_resource_getters(resource, effect);\n\n\tif (!methods) {\n\t\treturn;\n\t}\n\n\tif (typeof refresh === \"function\") {\n\t\tObject.defineProperty(effect, \"refresh\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: () => RefreshRemoteResource(resource, refresh),\n\t\t});\n\t}\n\n\tif (typeof set === \"function\") {\n\t\tObject.defineProperty(effect, \"set\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: (value: Output) => set.call(resource, value),\n\t\t});\n\t}\n\n\tif (typeof with_override === \"function\") {\n\t\tObject.defineProperty(effect, \"withOverride\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: (update: (current: Output) => Output) => with_override.call(resource, update),\n\t\t});\n\t}\n}\n\nconst RefreshRemoteResource = (resource: unknown, refresh: () => Promise<void>) =>\n\tEffect.gen(function* () {\n\t\tyield* MakeEffectFromPromise(() => Promise.resolve(refresh.call(resource)));\n\t});\n"],"mappings":";;;;;;;;AAGA,SAAgB,WACf,OACA,KACmC;CACnC,MAAM,aAAa,OAAO;CAE1B,QACG,eAAe,YAAY,UAAU,QAAS,eAAe,eAC/D,OAAQ,MAAuC,SAAS;AAE1D;;;ACPA,MAAa,yBAA4C,aACxD,OAAO,IAAI,aAAa;CACvB,MAAM,OAAO,OAAO,4BAAgD,SAAS,KAAK,CAAC,CAAC,CAAC,KACpF,OAAO,oBAAoB,KAAA,CAAS,CACrC;CACA,MAAM,UAAU,oBAA+B,IAAI;CAEnD,IAAI,0BAA0B,OAAO,GACpC,OAAO;CAGR,OAAO,yBAAyB,SAAS,QAAQ,IAAI;AACtD,CAAC;AAEF,MAAa,yBACZ,OACA,mBAEA,OAAO,IAAI,aAAa;CACvB,IAAI,iBAAiB,UAAU;EAC9B,IAAI,CAAC,MAAM,IAAI;GACd,MAAM,UAAU,OAAO,sBAAiC,KAAK;GAE7D,OAAO,OAAO,OAAO,KAAK,OAAO;EAClC;EAEA,MAAM,OAAO,OAAO,0BAAqC,KAAK;EAE9D,OAAO,OAAO,yBACP,eAAe,IAAI,CAC1B;CACD;CAEA,OAAO,OAAO,yBAA4C,eAAe,KAAK,CAAW;AAC1F,CAAC;AAEF,MAAM,6BAAwC,aAC7C,OAAO,IAAI,aAAa;CACvB,IAAI,SAAS,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jD,OAAO,IAAI,aAAa;CACvB,OAAO,4BAA4B,QAAQ,QAAQ,QAAQ,KAAK,QAAQ,CAAC,CAAC;AAC3E,CAAC"}
|
|
1
|
+
{"version":3,"file":"client-CkxjaRTA.js","names":[],"sources":["../../../modules/svelte-effect-runtime/src/remote/client/utils.ts","../../../modules/svelte-effect-runtime/src/remote/client/responses.ts","../../../modules/svelte-effect-runtime/src/remote/client/command.ts","../../../modules/svelte-effect-runtime/src/remote/client/form-data.ts","../../../modules/svelte-effect-runtime/src/remote/client/form-transport.ts","../../../modules/svelte-effect-runtime/src/remote/client/form-enhance.ts","../../../modules/svelte-effect-runtime/src/remote/client/form.ts","../../../modules/svelte-effect-runtime/src/remote/client/query-result.ts","../../../modules/svelte-effect-runtime/src/remote/client/prerender.ts","../../../modules/svelte-effect-runtime/src/remote/client/query.ts"],"sourcesContent":["export { copy_property_descriptors } from \"$/internal/descriptors.ts\";\nimport type { NativeMethod } from \"./types.ts\";\n\nexport function has_method<K extends PropertyKey>(\n\tvalue: unknown,\n\tkey: K,\n): value is Record<K, NativeMethod> {\n\tconst value_type = typeof value;\n\n\treturn (\n\t\t((value_type === \"object\" && value !== null) || value_type === \"function\") &&\n\t\ttypeof (value as Record<PropertyKey, unknown>)[key] === \"function\"\n\t);\n}\n","import { decode_remote_error, is_decoded_remote_failure } from \"$/remote/failures.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { create_remote_http_error } from \"$/remote/shared.ts\";\nimport type { RemoteFailure } from \"$/remote/shared.ts\";\nimport { Effect } from \"effect\";\n\nexport const DecodeResponseFailure = <ErrorType = never>(response: Response) =>\n\tEffect.gen(function* () {\n\t\tconst body = yield* MakeEffectFromPromise<unknown, ErrorType>(() => response.json()).pipe(\n\t\t\tEffect.orElseSucceed(() => undefined),\n\t\t);\n\t\tconst decoded = decode_remote_error<ErrorType>(body);\n\n\t\tif (is_decoded_remote_failure(decoded)) {\n\t\t\treturn decoded as RemoteFailure<ErrorType>;\n\t\t}\n\n\t\treturn create_remote_http_error(response.status, body);\n\t});\n\nexport const DecodeResponseOrValue = <Output, ErrorType = never>(\n\tvalue: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n) =>\n\tEffect.gen(function* () {\n\t\tif (value instanceof Response) {\n\t\t\tif (!value.ok) {\n\t\t\t\tconst failure = yield* DecodeResponseFailure<ErrorType>(value);\n\n\t\t\t\treturn yield* Effect.fail(failure);\n\t\t\t}\n\n\t\t\tconst data = yield* DecodeSuccessResponseBody<ErrorType>(value);\n\n\t\t\treturn yield* MakeEffectFromSync<Output, ErrorType>(\n\t\t\t\t() => decode_payload(data) as Output,\n\t\t\t);\n\t\t}\n\n\t\treturn yield* MakeEffectFromSync<Output, ErrorType>(() => decode_payload(value) as Output);\n\t});\n\nconst DecodeSuccessResponseBody = <ErrorType>(response: Response) =>\n\tEffect.gen(function* () {\n\t\tif (response.status === 204 || response.status === 205) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst text = yield* MakeEffectFromPromise<string, ErrorType>(() => response.text());\n\n\t\tif (text.length === 0) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn yield* MakeEffectFromSync<unknown, ErrorType>(() => JSON.parse(text));\n\t});\n","import { copy_property_descriptors, has_method } from \"./utils.ts\";\nimport { resolve_native_remote_query_updates } from \"$/remote/query-update.ts\";\nimport { InvalidCommandFactoryError } from \"$/errors.ts\";\nimport type { EffectRemoteCommandCall, NativeMethod, Pending } from \"./types.ts\";\nimport { DecodeResponseOrValue } from \"./responses.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { Effect } from \"effect\";\n\ntype EffectRemoteCommandAdapter<Input, Output, ErrorType = never> = ((\n\tinput: undefined extends Input ? Input | void : Input,\n) => EffectRemoteCommandCall<Output, ErrorType>) & {\n\treadonly pending: number;\n};\n\n/** Adapts a generated SvelteKit command to SER's Effect-based client ABI. */\nexport function create_remote_command_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\t_base = \"\",\n\tpending?: Pending,\n): EffectRemoteCommandAdapter<Input, Output, ErrorType> {\n\tconst invoke = has_method(native_factory, \"invoke\") ? native_factory.invoke : undefined;\n\n\tif (typeof native_factory !== \"function\" && !invoke) {\n\t\tthrow new InvalidCommandFactoryError();\n\t}\n\n\tconst count = pending ?? { value: 0 };\n\n\tconst adapter = (input: undefined extends Input ? Input | void : Input) =>\n\t\tMakeCommandEffect<Input, Output, ErrorType>(\n\t\t\tnative_factory,\n\t\t\tinvoke,\n\t\t\tinput,\n\t\t\tdecode_payload,\n\t\t\tcount,\n\t\t);\n\n\tcopy_property_descriptors(native_factory, adapter);\n\n\tif (!Object.prototype.hasOwnProperty.call(adapter, \"pending\")) {\n\t\tObject.defineProperty(adapter, \"pending\", {\n\t\t\tget: () => count.value,\n\t\t});\n\t}\n\n\treturn adapter as EffectRemoteCommandAdapter<Input, Output, ErrorType>;\n}\n\nconst MakeCommandEffect = <Input, Output, ErrorType>(\n\tnative_factory: unknown,\n\tinvoke: NativeMethod | undefined,\n\tinput: undefined extends Input ? Input | void : Input,\n\tdecode_payload: (value: unknown) => unknown,\n\tpending: Pending,\n) => {\n\tlet updates_args: unknown[] | undefined;\n\n\tconst CommandEffect = Effect.acquireUseRelease(\n\t\tAcquirePending(pending),\n\t\t() =>\n\t\t\tInvokeCommand<Input, Output, ErrorType>(\n\t\t\t\tnative_factory,\n\t\t\t\tinvoke,\n\t\t\t\tinput,\n\t\t\t\tdecode_payload,\n\t\t\t\t() => updates_args,\n\t\t\t),\n\t\t() => ReleasePending(pending),\n\t) as EffectRemoteCommandCall<Output, ErrorType>;\n\n\tObject.defineProperty(CommandEffect, \"updates\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: (...args: unknown[]) => {\n\t\t\tupdates_args ??= args;\n\n\t\t\treturn CommandEffect;\n\t\t},\n\t});\n\n\treturn CommandEffect;\n};\n\nconst AcquirePending = (pending: Pending) =>\n\tEffect.sync(() => {\n\t\tpending.value += 1;\n\t});\n\nconst ReleasePending = (pending: Pending) =>\n\tEffect.sync(() => {\n\t\tpending.value -= 1;\n\t});\n\nconst InvokeCommand = <Input, Output, ErrorType>(\n\tnative_factory: unknown,\n\tinvoke: NativeMethod | undefined,\n\tinput: undefined extends Input ? Input | void : Input,\n\tdecode_payload: (value: unknown) => unknown,\n\tread_updates_args: () => unknown[] | undefined,\n) =>\n\tEffect.gen(function* () {\n\t\tconst invocation = yield* MakeEffectFromSync<unknown, ErrorType>(() => {\n\t\t\tconst result = invoke\n\t\t\t\t? invoke.call(native_factory, input)\n\t\t\t\t: (native_factory as NativeMethod)(input);\n\t\t\tconst updates_args = read_updates_args();\n\n\t\t\tif (updates_args && has_method(result, \"updates\")) {\n\t\t\t\treturn result.updates(...resolve_native_remote_query_updates(updates_args));\n\t\t\t}\n\n\t\t\treturn result;\n\t\t});\n\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\tPromise.resolve(invocation),\n\t\t);\n\n\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t});\n","export function to_form_data(input: unknown): FormData {\n\tconst form_data = new FormData();\n\n\tappend_form_value(form_data, \"\", input);\n\n\treturn form_data;\n}\n\nfunction append_form_value(form_data: FormData, path: string, value: unknown): void {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, item] of value.entries()) {\n\t\t\tappend_form_value(form_data, `${path}[${index}]`, item);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (value instanceof Blob) {\n\t\tform_data.append(path, value);\n\n\t\treturn;\n\t}\n\n\tif (typeof value === \"object\" && value !== null) {\n\t\tfor (const [key, child] of Object.entries(value)) {\n\t\t\tconst child_path = path.length === 0 ? key : `${path}.${key}`;\n\n\t\t\tappend_form_value(form_data, child_path, child);\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (typeof value === \"number\") {\n\t\tform_data.append(`n:${path}`, String(value));\n\n\t\treturn;\n\t}\n\n\tif (typeof value === \"boolean\") {\n\t\tform_data.append(`b:${path}`, value ? \"on\" : \"off\");\n\n\t\treturn;\n\t}\n\n\tform_data.append(path, value === null ? \"\" : String(value));\n}\n","import {\n\tInvalidRemoteFormResponseError,\n\tRemoteFormEndpointMissingError,\n\tUnsupportedRemoteFormResponseError,\n} from \"$/errors.ts\";\nimport {\n\tcreate_remote_http_error,\n\tcreate_remote_transport_error,\n\tcreate_remote_validation_error,\n} from \"$/remote/shared.ts\";\nimport { decode_remote_error, is_decoded_remote_failure } from \"$/remote/failures.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport type { FormIssue } from \"$/remote/shared.ts\";\nimport type { StandardSchema } from \"$/internal/schema.ts\";\nimport { DecodeResponseFailure } from \"./responses.ts\";\nimport type { NativeFormRecord } from \"./types.ts\";\nimport { Effect, Option, Schema } from \"effect\";\nimport { to_form_data } from \"./form-data.ts\";\nimport { parse } from \"devalue\";\n\ntype RemoteFormResponseEnvelope =\n\t| {\n\t\t\treadonly _tag: \"RemoteFormErrorEnvelope\";\n\t\t\treadonly error?: unknown;\n\t\t\treadonly status?: number | undefined;\n\t }\n\t| {\n\t\t\treadonly _tag: \"RemoteFormResultEnvelope\";\n\t\t\treadonly data: string;\n\t }\n\t| {\n\t\t\treadonly _tag: \"RemoteFormRedirectEnvelope\";\n\t\t\treadonly location: string;\n\t };\n\nexport interface RemoteFormTransport {\n\treadonly binary_form_content_type?: string;\n\treadonly decoders?: Record<string, (value: unknown) => unknown>;\n\treadonly navigate?: (location: string, invalidate_all: boolean) => PromiseLike<void> | void;\n\treadonly remote_request?: (url: string, init?: RequestInit) => PromiseLike<unknown>;\n\treadonly refresh?: () => PromiseLike<void> | void;\n\treadonly serialize_binary_form?: (\n\t\tdata: unknown,\n\t\tmeta: { readonly remote_refreshes: readonly string[] },\n\t) => { readonly blob: Blob };\n}\n\ninterface KitRemoteFormTransport extends RemoteFormTransport {\n\treadonly binary_form_content_type: string;\n\treadonly remote_request: (url: string, init?: RequestInit) => PromiseLike<unknown>;\n\treadonly serialize_binary_form: (\n\t\tdata: unknown,\n\t\tmeta: { readonly remote_refreshes: readonly string[] },\n\t) => { readonly blob: Blob };\n}\n\ntype RemoteFormDecodedPayload<Output> = {\n\treadonly issues?: readonly FormIssue[];\n\treadonly result?: Output;\n};\n\nconst FormIssuePathSegmentSchema = Schema.Union([Schema.String, Schema.Number]);\n\nconst FormIssueSchema = Schema.Struct({\n\tmessage: Schema.String,\n\tpath: Schema.Array(FormIssuePathSegmentSchema),\n});\n\nconst RemoteFormErrorEnvelopeSchema = Schema.Struct({\n\ttype: Schema.Literal(\"error\"),\n\terror: Schema.optional(Schema.Unknown),\n\tstatus: Schema.optional(Schema.Number),\n});\n\nconst RemoteFormResultEnvelopeSchema = Schema.Struct({\n\ttype: Schema.Literal(\"result\"),\n\tdata: Schema.String,\n});\n\nconst RemoteFormRedirectEnvelopeSchema = Schema.Struct({\n\ttype: Schema.Literal(\"redirect\"),\n\tlocation: Schema.String,\n});\n\nconst RemoteFormResponseEnvelopeSchema = Schema.Union([\n\tRemoteFormErrorEnvelopeSchema,\n\tRemoteFormResultEnvelopeSchema,\n\tRemoteFormRedirectEnvelopeSchema,\n]);\n\nconst RemoteFormDecodedPayloadSchema = Schema.Struct({\n\tissues: Schema.optional(Schema.Array(FormIssueSchema)),\n\tresult: Schema.optional(Schema.Unknown),\n});\n\nconst RemoteFormRedirectDataSchema = Schema.Struct({\n\tredirect: Schema.String,\n});\n\nconst RemoteFormResultDataSchema = Schema.Struct({\n\t_: Schema.Unknown,\n});\n\nconst KitRemoteFormDataSchema = Schema.Struct({\n\t_: Schema.optional(Schema.Unknown),\n\tredirect: Schema.optional(Schema.String),\n\tr: Schema.optional(Schema.Literal(true)),\n});\n\nconst DecodeRemoteFormResponseEnvelope = Schema.decodeUnknownOption(\n\tRemoteFormResponseEnvelopeSchema,\n);\nconst DecodeRemoteFormPayload = Schema.decodeUnknownOption(RemoteFormDecodedPayloadSchema);\nconst DecodeRemoteFormRedirectData = Schema.decodeUnknownOption(RemoteFormRedirectDataSchema);\nconst DecodeRemoteFormResultData = Schema.decodeUnknownOption(RemoteFormResultDataSchema);\nconst DecodeKitRemoteFormData = Schema.decodeUnknownOption(KitRemoteFormDataSchema);\n\nexport const SubmitRemoteForm = <Output, ErrorType = never>(\n\tform_obj: NativeFormRecord,\n\tinput: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_base: string,\n\tremote_transport: RemoteFormTransport,\n\tpreflight_schema?: StandardSchema,\n) =>\n\tEffect.gen(function* () {\n\t\tconst action_id = yield* MakeEffectFromSync<string | undefined, ErrorType>(() =>\n\t\t\tget_remote_action_id(form_obj),\n\t\t);\n\n\t\tif (!action_id || remote_base.length === 0) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new RemoteFormEndpointMissingError()),\n\t\t\t);\n\t\t}\n\n\t\tyield* ValidatePreflightInput<ErrorType>(preflight_schema, input);\n\n\t\tif (is_kit_remote_form_transport(remote_transport)) {\n\t\t\treturn yield* SubmitRemoteFormWithKit<Output, ErrorType>(\n\t\t\t\taction_id,\n\t\t\t\tinput,\n\t\t\t\tdecode_payload,\n\t\t\t\tremote_base,\n\t\t\t\tremote_transport,\n\t\t\t);\n\t\t}\n\n\t\tconst response = yield* MakeEffectFromPromise<Response, ErrorType>((signal) =>\n\t\t\tfetch(to_remote_form_url(remote_base, action_id), {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: get_remote_request_headers(),\n\t\t\t\tbody: to_form_data(to_remote_form_input(input, action_id)),\n\t\t\t\tsignal,\n\t\t\t}),\n\t\t);\n\n\t\tif (!response.ok) {\n\t\t\tconst failure = yield* DecodeResponseFailure<ErrorType>(response);\n\n\t\t\treturn yield* Effect.fail(failure);\n\t\t}\n\n\t\tconst envelope = yield* MakeEffectFromPromise<unknown, ErrorType>(() => response.json());\n\n\t\treturn yield* DecodeFormResponse<Output, ErrorType>(\n\t\t\tenvelope,\n\t\t\tdecode_payload,\n\t\t\tremote_transport,\n\t\t);\n\t});\n\nconst SubmitRemoteFormWithKit = <Output, ErrorType>(\n\taction_id: string,\n\tinput: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_base: string,\n\tremote_transport: KitRemoteFormTransport,\n) =>\n\tEffect.gen(function* () {\n\t\tconst url = to_remote_form_url(remote_base, action_id);\n\t\tconst body = yield* MakeEffectFromSync<Blob, ErrorType>(\n\t\t\t() =>\n\t\t\t\tremote_transport.serialize_binary_form(to_remote_form_input(input, action_id), {\n\t\t\t\t\tremote_refreshes: [],\n\t\t\t\t}).blob,\n\t\t);\n\t\tconst data = yield* MakeEffectFromPromise<unknown, ErrorType>((signal) =>\n\t\t\tremote_transport.remote_request(url, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: {\n\t\t\t\t\t...get_remote_request_headers(),\n\t\t\t\t\t\"Content-Type\": remote_transport.binary_form_content_type,\n\t\t\t\t},\n\t\t\t\tbody,\n\t\t\t\tsignal,\n\t\t\t}),\n\t\t);\n\n\t\treturn yield* DecodeKitFormData<Output, ErrorType>(data, decode_payload, remote_transport);\n\t});\n\nexport function get_remote_action_id(form_obj: NativeFormRecord): string | undefined {\n\tconst action = form_obj.action;\n\n\tif (typeof action !== \"string\") {\n\t\treturn undefined;\n\t}\n\n\tconst fallback = \"http://localhost/\";\n\tconst href = typeof location === \"undefined\" ? fallback : location.href;\n\tconst url = new URL(action, href);\n\n\treturn url.searchParams.get(\"/remote\") ?? url.searchParams.get(\"remote\") ?? undefined;\n}\n\nfunction to_remote_form_url(remote_base: string, action_id: string): string {\n\tconst parts = action_id.split(\"/\");\n\tconst head = parts.slice(0, 2).join(\"/\");\n\tconst normalized_base = remote_base.replace(/\\/$/, \"\");\n\n\treturn `${normalized_base}/${head}`;\n}\n\nfunction to_remote_form_input(input: unknown, action_id: string): Record<string, unknown> {\n\tconst data = is_record(input) ? input : {};\n\tconst serialized_key = action_id.split(\"/\").slice(2).join(\"/\");\n\tconst key: unknown = serialized_key.length === 0 ? undefined : JSON.parse(serialized_key);\n\n\tif (key === undefined || data.id !== undefined) {\n\t\treturn data;\n\t}\n\n\treturn {\n\t\t...data,\n\t\tid: key,\n\t};\n}\n\nfunction get_remote_request_headers(): Record<string, string> {\n\tif (typeof location === \"undefined\") {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\t\"x-sveltekit-pathname\": location.pathname,\n\t\t\"x-sveltekit-search\": location.search,\n\t};\n}\n\nconst ValidatePreflightInput = <ErrorType>(schema: StandardSchema | undefined, input: unknown) =>\n\tEffect.gen(function* () {\n\t\tif (!schema) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst validated = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\tPromise.resolve(schema[\"~standard\"].validate(input)),\n\t\t);\n\n\t\tif (!is_record(validated) || !Array.isArray(validated.issues)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst issues = validated.issues.map(normalize_standard_issue);\n\n\t\treturn yield* Effect.fail(create_remote_validation_error(issues, { issues }, 400));\n\t});\n\nfunction normalize_standard_issue(issue: unknown): FormIssue {\n\tif (!is_record(issue)) {\n\t\treturn { message: String(issue), path: [] };\n\t}\n\n\tconst message = typeof issue.message === \"string\" ? issue.message : \"Invalid input\";\n\tconst path = Array.isArray(issue.path) ? issue.path.flatMap(normalize_path_segment) : [];\n\n\treturn { message, path };\n}\n\nfunction normalize_path_segment(segment: unknown): Array<string | number> {\n\tif (typeof segment === \"string\" || typeof segment === \"number\") {\n\t\treturn [segment];\n\t}\n\n\tif (!is_record(segment)) {\n\t\treturn [];\n\t}\n\n\tconst key = segment.key;\n\n\tif (typeof key === \"string\" || typeof key === \"number\") {\n\t\treturn [key];\n\t}\n\n\treturn [];\n}\n\nfunction is_record(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null;\n}\n\nconst DecodeFormResponse = <Output, ErrorType>(\n\tenvelope: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_transport: RemoteFormTransport,\n) =>\n\tEffect.gen(function* () {\n\t\tconst response = decode_remote_form_response_envelope(envelope);\n\n\t\tif (!response) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew InvalidRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif (response._tag === \"RemoteFormErrorEnvelope\") {\n\t\t\tconst decoded = decode_remote_error<ErrorType>(response.error);\n\n\t\t\tif (is_decoded_remote_failure(decoded)) {\n\t\t\t\treturn yield* Effect.fail(decoded);\n\t\t\t}\n\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_http_error(get_remote_form_error_status(response), response.error),\n\t\t\t);\n\t\t}\n\n\t\tif (response._tag === \"RemoteFormRedirectEnvelope\") {\n\t\t\treturn yield* NavigateRemoteForm<ErrorType>(\n\t\t\t\tresponse.location,\n\t\t\t\ttrue,\n\t\t\t\tremote_transport,\n\t\t\t\tenvelope,\n\t\t\t);\n\t\t}\n\n\t\tconst parsed = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\tparse(response.data, remote_transport.decoders),\n\t\t);\n\t\tconst redirect_data = DecodeRemoteFormRedirectData(parsed);\n\n\t\tif (Option.isSome(redirect_data)) {\n\t\t\treturn yield* NavigateRemoteForm<ErrorType>(\n\t\t\t\tredirect_data.value.redirect,\n\t\t\t\ttrue,\n\t\t\t\tremote_transport,\n\t\t\t\tenvelope,\n\t\t\t);\n\t\t}\n\n\t\tconst result_data = DecodeRemoteFormResultData(parsed);\n\n\t\tif (!Option.isSome(result_data)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew UnsupportedRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tconst payload = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\tdecode_payload(result_data.value._),\n\t\t);\n\t\tconst decoded = decode_remote_form_payload<Output>(payload);\n\n\t\tif (!decoded) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew UnsupportedRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif (decoded.issues && decoded.issues.length > 0) {\n\t\t\treturn yield* Effect.fail(create_remote_validation_error(decoded.issues, decoded, 400));\n\t\t}\n\n\t\tyield* RefreshRemoteFormState<ErrorType>(remote_transport);\n\n\t\treturn decoded.result as Output;\n\t});\n\nconst DecodeKitFormData = <Output, ErrorType>(\n\tdata: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_transport: RemoteFormTransport,\n) =>\n\tEffect.gen(function* () {\n\t\tconst decoded_data = DecodeKitRemoteFormData(data);\n\n\t\tif (!Option.isSome(decoded_data)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new UnsupportedRemoteFormResponseError(data), data),\n\t\t\t);\n\t\t}\n\n\t\tconst should_invalidate = decoded_data.value.r !== true;\n\n\t\tif (decoded_data.value.redirect) {\n\t\t\treturn yield* NavigateRemoteForm<ErrorType>(\n\t\t\t\tdecoded_data.value.redirect,\n\t\t\t\tshould_invalidate,\n\t\t\t\tremote_transport,\n\t\t\t\tdata,\n\t\t\t);\n\t\t}\n\n\t\tif (!(\"_\" in decoded_data.value)) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new UnsupportedRemoteFormResponseError(data), data),\n\t\t\t);\n\t\t}\n\n\t\tconst payload = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\tdecode_payload(decoded_data.value._),\n\t\t);\n\t\tconst decoded = decode_remote_form_payload<Output>(payload);\n\n\t\tif (!decoded) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(new UnsupportedRemoteFormResponseError(data), data),\n\t\t\t);\n\t\t}\n\n\t\tif (decoded.issues && decoded.issues.length > 0) {\n\t\t\treturn yield* Effect.fail(create_remote_validation_error(decoded.issues, decoded, 400));\n\t\t}\n\n\t\tif (should_invalidate) {\n\t\t\tyield* RefreshRemoteFormState<ErrorType>(remote_transport);\n\t\t}\n\n\t\treturn decoded.result as Output;\n\t});\n\nconst NavigateRemoteForm = <ErrorType>(\n\tlocation: string,\n\tinvalidate_all: boolean,\n\tremote_transport: RemoteFormTransport,\n\tenvelope: unknown,\n) =>\n\tEffect.gen(function* () {\n\t\tconst navigate = remote_transport.navigate;\n\n\t\tif (!navigate) {\n\t\t\treturn yield* Effect.fail(\n\t\t\t\tcreate_remote_transport_error(\n\t\t\t\t\tnew UnsupportedRemoteFormResponseError(envelope),\n\t\t\t\t\tenvelope,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tyield* MakeEffectFromPromise<void, ErrorType>(() =>\n\t\t\tPromise.resolve(navigate(location, invalidate_all)),\n\t\t);\n\n\t\treturn yield* Effect.interrupt;\n\t});\n\nconst RefreshRemoteFormState = <ErrorType>(remote_transport: RemoteFormTransport) =>\n\tEffect.gen(function* () {\n\t\tconst refresh = remote_transport.refresh;\n\n\t\tif (!refresh) {\n\t\t\treturn;\n\t\t}\n\n\t\tyield* MakeEffectFromPromise<void, ErrorType>(() => Promise.resolve(refresh()));\n\t});\n\nfunction decode_remote_form_response_envelope(\n\tenvelope: unknown,\n): RemoteFormResponseEnvelope | undefined {\n\tconst decoded = DecodeRemoteFormResponseEnvelope(envelope);\n\n\tif (!Option.isSome(decoded)) {\n\t\treturn undefined;\n\t}\n\n\tif (decoded.value.type === \"error\") {\n\t\treturn {\n\t\t\t_tag: \"RemoteFormErrorEnvelope\",\n\t\t\terror: decoded.value.error,\n\t\t\tstatus: decoded.value.status,\n\t\t};\n\t}\n\n\tif (decoded.value.type === \"redirect\") {\n\t\treturn {\n\t\t\t_tag: \"RemoteFormRedirectEnvelope\",\n\t\t\tlocation: decoded.value.location,\n\t\t};\n\t}\n\n\treturn {\n\t\t_tag: \"RemoteFormResultEnvelope\",\n\t\tdata: decoded.value.data,\n\t};\n}\n\nfunction get_remote_form_error_status(\n\tresponse: Extract<RemoteFormResponseEnvelope, { _tag: \"RemoteFormErrorEnvelope\" }>,\n): number {\n\tconst nested_status = is_record(response.error) ? response.error.status : undefined;\n\n\tif (response.status !== undefined) {\n\t\treturn response.status;\n\t}\n\n\treturn typeof nested_status === \"number\" ? nested_status : 500;\n}\n\nfunction is_kit_remote_form_transport(\n\tremote_transport: RemoteFormTransport,\n): remote_transport is KitRemoteFormTransport {\n\treturn (\n\t\ttypeof remote_transport.binary_form_content_type === \"string\" &&\n\t\ttypeof remote_transport.remote_request === \"function\" &&\n\t\ttypeof remote_transport.serialize_binary_form === \"function\"\n\t);\n}\n\nfunction decode_remote_form_payload<Output>(\n\tpayload: unknown,\n): RemoteFormDecodedPayload<Output> | undefined {\n\tconst decoded = DecodeRemoteFormPayload(payload);\n\n\tif (!Option.isSome(decoded)) {\n\t\treturn undefined;\n\t}\n\n\treturn decoded.value as RemoteFormDecodedPayload<Output>;\n}\n","import { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { resolve_native_remote_query_updates } from \"$/remote/query-update.ts\";\nimport type { EffectRemoteFormSubmit, NativeMethod } from \"./types.ts\";\nimport { get_dispatcher } from \"$/dispatcher.ts\";\nimport { has_method } from \"./utils.ts\";\nimport { Effect } from \"effect\";\n\nexport function wrap_enhance_callback<Output, ErrorType = never>(\n\tcallback: NativeMethod | undefined,\n): NativeMethod | undefined {\n\tif (!callback) {\n\t\treturn undefined;\n\t}\n\n\treturn (event: unknown) => {\n\t\tconst wrapped_event = wrap_submit_callback<Output, ErrorType>(event);\n\t\tconst result = callback(wrapped_event);\n\n\t\tif (Effect.isEffect(result)) {\n\t\t\treturn get_dispatcher().run(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction wrap_submit_callback<Output, ErrorType>(event: unknown): unknown {\n\tif (typeof event !== \"object\" || event === null || !has_method(event, \"submit\")) {\n\t\treturn event;\n\t}\n\n\tconst original_submit = event.submit;\n\tconst { submit: _submit, ...descriptors } = Object.getOwnPropertyDescriptors(event);\n\n\tvoid _submit;\n\n\treturn Object.defineProperties(\n\t\t{},\n\t\t{\n\t\t\t...descriptors,\n\t\t\tsubmit: {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: () => MakeSubmitEffect<Output, ErrorType>(original_submit, event),\n\t\t\t},\n\t\t},\n\t);\n}\n\nfunction MakeSubmitEffect<Output, ErrorType>(\n\toriginal_submit: NativeMethod,\n\tevent: unknown,\n): EffectRemoteFormSubmit<Output, ErrorType> {\n\tlet updates_args: unknown[] | undefined;\n\n\tconst SubmitEffect = Effect.gen(function* () {\n\t\tconst result = yield* MakeEffectFromSync<unknown, ErrorType>(() =>\n\t\t\toriginal_submit.call(event),\n\t\t);\n\t\tconst value = yield* ResolveSubmitResult<ErrorType>(result, updates_args);\n\n\t\tif (typeof value === \"boolean\") {\n\t\t\treturn read_submit_result<Output>(event);\n\t\t}\n\n\t\treturn value as Output;\n\t}) as EffectRemoteFormSubmit<Output, ErrorType>;\n\n\tObject.defineProperty(SubmitEffect, \"updates\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: (...args: unknown[]) => {\n\t\t\tupdates_args ??= args;\n\n\t\t\treturn SubmitEffect;\n\t\t},\n\t});\n\n\treturn SubmitEffect;\n}\n\nconst ResolveSubmitResult = <ErrorType>(result: unknown, updates_args: unknown[] | undefined) =>\n\tEffect.gen(function* () {\n\t\tif (updates_args && has_method(result, \"updates\")) {\n\t\t\treturn yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\tPromise.resolve(\n\t\t\t\t\tresult.updates(...resolve_native_remote_query_updates(updates_args)),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\treturn yield* MakeEffectFromPromise<unknown, ErrorType>(() => Promise.resolve(result));\n\t});\n\nfunction read_submit_result<Output>(event: unknown): Output | undefined {\n\tif (typeof event !== \"object\" || event === null || !(\"result\" in event)) {\n\t\treturn undefined;\n\t}\n\n\treturn Reflect.get(event, \"result\") as Output | undefined;\n}\n","import { is_standard_schema, normalize_validator, type StandardSchema } from \"$/internal/schema.ts\";\nimport type { EffectRemoteForm, NativeFormRecord, NativeMethod } from \"./types.ts\";\nimport {\n\tget_remote_action_id,\n\tSubmitRemoteForm,\n\ttype RemoteFormTransport,\n} from \"./form-transport.ts\";\nimport { MakeEffectFromPromise, MakeEffectFromSync } from \"$/remote/effect.ts\";\nimport { copy_property_descriptors, has_method } from \"./utils.ts\";\nimport { wrap_enhance_callback } from \"./form-enhance.ts\";\nimport { DecodeResponseOrValue } from \"./responses.ts\";\nimport type { RemoteFormInput } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\n\ntype RemoteInput<Input> = undefined extends Input ? Input | void : Input;\n\ninterface RemoteFormAdapterState {\n\tshared_preflight_schema?: StandardSchema;\n}\n\n/** Adapts a generated SvelteKit form to SER's Effect-based client ABI. */\nexport function create_remote_form_adapter<\n\tInput extends RemoteFormInput | void,\n\tOutput,\n\tErrorType = never,\n>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n\tremote_base = \"\",\n\tremote_transport: RemoteFormTransport = {},\n\tadapter_state: RemoteFormAdapterState = {},\n\tkeyed = false,\n): EffectRemoteForm<Input, Output, ErrorType> {\n\tconst form_obj = native_factory as NativeFormRecord;\n\tlet local_preflight_schema: StandardSchema | undefined;\n\n\tconst SubmitForm = (input?: RemoteInput<Input>) =>\n\t\tEffect.gen(function* () {\n\t\t\tconst action_id = yield* MakeEffectFromSync<string | undefined, ErrorType>(() =>\n\t\t\t\tget_remote_action_id(form_obj),\n\t\t\t);\n\t\t\tconst can_use_remote_endpoint = remote_base.length > 0 && action_id !== undefined;\n\n\t\t\tif (has_method(form_obj, \"submit\") && !can_use_remote_endpoint) {\n\t\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\t\tPromise.resolve(form_obj.submit(input)),\n\t\t\t\t);\n\n\t\t\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t\t\t}\n\n\t\t\treturn yield* SubmitRemoteForm<Output, ErrorType>(\n\t\t\t\tform_obj,\n\t\t\t\tinput,\n\t\t\t\tdecode_payload,\n\t\t\t\tremote_base,\n\t\t\t\tremote_transport,\n\t\t\t\tlocal_preflight_schema ?? adapter_state.shared_preflight_schema,\n\t\t\t);\n\t\t});\n\n\tconst callable = ((input?: RemoteInput<Input>) => SubmitForm(input)) as EffectRemoteForm<\n\t\tInput,\n\t\tOutput,\n\t\tErrorType\n\t>;\n\n\tcopy_property_descriptors(\n\t\tform_obj,\n\t\tcallable,\n\t\tnew Set([\"submit\", \"validate\", \"enhance\", \"for\", \"preflight\"]),\n\t);\n\n\tObject.defineProperty(callable, \"submit\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: SubmitForm,\n\t});\n\n\tif (has_method(form_obj, \"validate\")) {\n\t\tconst validate = form_obj.validate;\n\n\t\tObject.defineProperty(callable, \"validate\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (options?: Record<string, unknown>) =>\n\t\t\t\tValidateRemoteForm<ErrorType>(form_obj, validate, options),\n\t\t});\n\t}\n\n\tif (has_method(form_obj, \"enhance\")) {\n\t\tObject.defineProperty(callable, \"enhance\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (callback?: NativeMethod) =>\n\t\t\t\tform_obj.enhance(wrap_enhance_callback<Output, ErrorType>(callback)),\n\t\t});\n\t}\n\n\tif (has_method(form_obj, \"for\")) {\n\t\tObject.defineProperty(callable, \"for\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (key: string | number | boolean) =>\n\t\t\t\tcreate_remote_form_adapter<Input, Output, ErrorType>(\n\t\t\t\t\tform_obj.for(key),\n\t\t\t\t\tdecode_payload,\n\t\t\t\t\tremote_base,\n\t\t\t\t\tremote_transport,\n\t\t\t\t\tadapter_state,\n\t\t\t\t\ttrue,\n\t\t\t\t),\n\t\t});\n\t}\n\n\tif (has_method(form_obj, \"preflight\")) {\n\t\tObject.defineProperty(callable, \"preflight\", {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: (schema: unknown) => {\n\t\t\t\tconst normalized_schema = normalize_validator(schema);\n\n\t\t\t\tif (is_standard_schema(normalized_schema)) {\n\t\t\t\t\tlocal_preflight_schema = normalized_schema;\n\n\t\t\t\t\tif (!keyed) {\n\t\t\t\t\t\tadapter_state.shared_preflight_schema = normalized_schema;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tform_obj.preflight(normalized_schema);\n\n\t\t\t\treturn callable;\n\t\t\t},\n\t\t});\n\t}\n\n\treturn callable;\n}\n\nconst ValidateRemoteForm = <ErrorType>(\n\tform_obj: NativeFormRecord,\n\tvalidate: NativeMethod,\n\toptions: Record<string, unknown> | undefined,\n) =>\n\tEffect.gen(function* () {\n\t\tyield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\tPromise.resolve(validate.call(form_obj, normalize_validate_options(validate, options))),\n\t\t);\n\t});\n\nfunction normalize_validate_options(\n\tvalidate: NativeMethod,\n\toptions: Record<string, unknown> | undefined,\n): Record<string, unknown> | undefined {\n\tif (!options || !(\"all\" in options) || \"includeUntouched\" in options) {\n\t\treturn options;\n\t}\n\n\tconst source = Function.prototype.toString.call(validate);\n\tconst uses_stable_option = source.includes(\"includeUntouched\") && !/\\ball\\s*=/.test(source);\n\n\tif (!uses_stable_option) {\n\t\treturn options;\n\t}\n\n\treturn {\n\t\t...options,\n\t\tincludeUntouched: options.all,\n\t};\n}\n","import { DecodeResponseOrValue } from \"./responses.ts\";\nimport { MakeEffectFromPromise } from \"$/remote/effect.ts\";\nimport { has_method } from \"./utils.ts\";\nimport { Effect } from \"effect\";\n\nexport const ResolveQueryResult = <Output, ErrorType = never>(\n\tvalue: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n) =>\n\tEffect.gen(function* () {\n\t\tif (has_method(value, \"then\")) {\n\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\tPromise.resolve(value),\n\t\t\t);\n\n\t\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t\t}\n\n\t\tif (has_method(value, \"run\")) {\n\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\tPromise.resolve(value.run()),\n\t\t\t);\n\n\t\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(result, decode_payload);\n\t\t}\n\n\t\treturn yield* DecodeResponseOrValue<Output, ErrorType>(value, decode_payload);\n\t});\n","import {\n\tattach_failed_remote_resource_getters,\n\tattach_remote_resource_getters,\n\ttype RemoteResourceEffect,\n} from \"$/remote/resource.ts\";\nimport { InvalidPrerenderFactoryError } from \"$/errors.ts\";\nimport { FailWithRemoteError } from \"$/remote/effect.ts\";\nimport { copy_property_descriptors } from \"./utils.ts\";\nimport { ResolveQueryResult } from \"./query-result.ts\";\nimport type { NativeMethod } from \"./types.ts\";\nimport { Result } from \"effect\";\n\ntype RemoteInput<Input> = undefined extends Input ? Input | void : Input;\n\ntype EffectRemotePrerenderAdapter<Input, Output, ErrorType = never> = (\n\tinput: RemoteInput<Input>,\n) => RemoteResourceEffect<Output, ErrorType>;\n\nexport function create_remote_prerender_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => Output,\n): EffectRemotePrerenderAdapter<Input, Output, ErrorType>;\nexport function create_remote_prerender_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n): EffectRemotePrerenderAdapter<Input, Output, ErrorType>;\nexport function create_remote_prerender_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: (value: unknown) => unknown,\n): EffectRemotePrerenderAdapter<Input, Output, ErrorType> {\n\tif (typeof native_factory !== \"function\") {\n\t\tthrow new InvalidPrerenderFactoryError();\n\t}\n\n\tconst prerender = native_factory as NativeMethod;\n\tconst wrapped = ((input: RemoteInput<Input>) => {\n\t\tconst resource_attempt = Result.try(() => prerender(input));\n\n\t\tif (Result.isFailure(resource_attempt)) {\n\t\t\tconst PrerenderEffect = FailWithRemoteError<ErrorType>(\n\t\t\t\tresource_attempt.failure,\n\t\t\t) as unknown as RemoteResourceEffect<Output, ErrorType>;\n\n\t\t\tattach_failed_remote_resource_getters(resource_attempt.failure, PrerenderEffect);\n\n\t\t\treturn PrerenderEffect;\n\t\t}\n\n\t\tconst resource = resource_attempt.success;\n\t\tconst PrerenderEffect = ResolveQueryResult<Output, ErrorType>(\n\t\t\tresource,\n\t\t\tdecode_payload,\n\t\t) as RemoteResourceEffect<Output, ErrorType>;\n\n\t\tattach_remote_resource_getters(resource, PrerenderEffect);\n\n\t\treturn PrerenderEffect;\n\t}) as EffectRemotePrerenderAdapter<Input, Output, ErrorType>;\n\n\tcopy_property_descriptors(native_factory, wrapped);\n\n\treturn wrapped;\n}\n","import {\n\tattach_failed_remote_query_resource,\n\tattach_remote_resource_getters,\n\tis_remote_resource,\n\ttype NativeRemoteResource,\n\ttype RemoteResourceEffect,\n} from \"$/remote/resource.ts\";\nimport {\n\tmake_failed_remote_live_stream,\n\tmake_remote_live_stream,\n\ttype RemoteLiveStream,\n} from \"$/live.ts\";\nimport { InvalidLiveQueryFactoryError, InvalidQueryFactoryError } from \"$/errors.ts\";\nimport { FailWithRemoteError, MakeEffectFromPromise } from \"$/remote/effect.ts\";\nimport { attach_native_remote_query_update } from \"$/remote/query-update.ts\";\nimport type { EffectRemoteQueryUpdateBrand, NativeMethod } from \"./types.ts\";\nimport { copy_property_descriptors, has_method } from \"./utils.ts\";\nimport { normalize_native_error } from \"$/remote/failures.ts\";\nimport { ResolveQueryResult } from \"./query-result.ts\";\nimport { Effect, Result } from \"effect\";\n\ntype RemoteInput<Input> = undefined extends Input ? Input | void : Input;\n\ntype DecodePayload<Output> = (value: unknown) => Output;\n\ntype QueryAdapterMode = \"standard\" | \"batch\";\n\ntype NativeQueryFactory<Input> =\n\t| ((input: RemoteInput<Input>) => unknown)\n\t| {\n\t\t\treadonly load: (input: RemoteInput<Input>) => unknown;\n\t };\n\ntype RemoteQueryEffect<Output, ErrorType = never> = EffectRemoteQueryUpdateBrand &\n\tRemoteResourceEffect<Output, ErrorType> & {\n\t\treadonly refresh: () => Effect.Effect<void, unknown, never>;\n\t\treadonly set: (value: Output) => void;\n\t\treadonly withOverride: (update: (current: Output) => Output) => unknown;\n\t};\n\ntype NativeQueryResource<Output> = NativeRemoteResource<Output> & {\n\treadonly refresh?: () => Promise<void>;\n\treadonly set?: (value: Output) => void;\n\treadonly withOverride?: (update: (current: Output) => Output) => unknown;\n};\n\n/** Adapts a generated SvelteKit query to SER's Effect-based client ABI. */\nexport function create_remote_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: NativeQueryFactory<Input>,\n\tdecode_payload: DecodePayload<Output>,\n\t_base?: string,\n\tmode?: QueryAdapterMode,\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);\nexport function create_remote_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: NativeQueryFactory<Input>,\n\tdecode_payload: (value: unknown) => unknown,\n\t_base?: string,\n\tmode?: QueryAdapterMode,\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);\nexport function create_remote_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\tdecode_payload: DecodePayload<Output>,\n\t_base = \"\",\n\tmode: QueryAdapterMode = \"standard\",\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>) {\n\tconst load = has_method(native_factory, \"load\") ? native_factory.load : undefined;\n\tconst query =\n\t\ttypeof native_factory === \"function\" ? (native_factory as NativeMethod) : undefined;\n\n\tif (!query && !load) {\n\t\tthrow new InvalidQueryFactoryError();\n\t}\n\n\tconst wrapped = ((input: RemoteInput<Input>) => {\n\t\tif (!query) {\n\t\t\treturn Effect.gen(function* () {\n\t\t\t\tconst result = yield* MakeEffectFromPromise<unknown, ErrorType>(() =>\n\t\t\t\t\tPromise.resolve(load?.call(native_factory, input)),\n\t\t\t\t);\n\n\t\t\t\treturn yield* ResolveQueryResult<Output, ErrorType>(result, decode_payload);\n\t\t\t}) as RemoteQueryEffect<Output, ErrorType>;\n\t\t}\n\n\t\tconst resource_attempt = Result.try(() => query(input));\n\n\t\tif (Result.isFailure(resource_attempt)) {\n\t\t\tconst QueryEffect = FailWithRemoteError<ErrorType>(\n\t\t\t\tresource_attempt.failure,\n\t\t\t) as unknown as RemoteQueryEffect<Output, ErrorType>;\n\n\t\t\tattach_failed_remote_query_resource(resource_attempt.failure, QueryEffect);\n\n\t\t\treturn QueryEffect;\n\t\t}\n\n\t\tconst resource = resource_attempt.success;\n\t\tconst query_result = mode === \"batch\" ? begin_batch_query_result(resource) : resource;\n\t\tconst QueryEffect = ResolveQueryResult<Output, ErrorType>(\n\t\t\tquery_result,\n\t\t\tdecode_payload,\n\t\t) as RemoteQueryEffect<Output, ErrorType>;\n\n\t\tattach_native_remote_query_update(QueryEffect, resource);\n\t\tattach_query_resource(resource, QueryEffect);\n\n\t\treturn QueryEffect;\n\t}) as EffectRemoteQueryUpdateBrand &\n\t\t((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);\n\n\tcopy_property_descriptors(native_factory, wrapped);\n\tattach_native_remote_query_update(wrapped, native_factory);\n\n\treturn wrapped;\n}\n\nfunction begin_batch_query_result(resource: unknown): unknown {\n\tif (!has_method(resource, \"then\")) {\n\t\treturn resource;\n\t}\n\n\tconst result = Promise.resolve(resource);\n\n\tvoid result.catch(() => {});\n\n\treturn result;\n}\n\n/** Adapts a generated SvelteKit live query to SER's Effect-based client ABI. */\nexport function create_remote_live_query_adapter<Input, Output, ErrorType = never>(\n\tnative_factory: unknown,\n\t_decode_payload: (value: unknown) => unknown,\n\t_base = \"\",\n): EffectRemoteQueryUpdateBrand &\n\t((input: RemoteInput<Input>) => RemoteLiveStream<Output, ErrorType>) {\n\tconst query =\n\t\ttypeof native_factory === \"function\" ? (native_factory as NativeMethod) : undefined;\n\n\tif (!query) {\n\t\tthrow new InvalidLiveQueryFactoryError();\n\t}\n\n\tconst wrapped = ((input: Input) => {\n\t\tconst resource_attempt = Result.try(() => query(input));\n\n\t\tif (Result.isFailure(resource_attempt)) {\n\t\t\treturn make_failed_remote_live_stream<Output, ErrorType>(\n\t\t\t\tresource_attempt.failure,\n\t\t\t\tnormalize_native_error,\n\t\t\t);\n\t\t}\n\n\t\tconst resource = resource_attempt.success;\n\n\t\tconst stream = make_remote_live_stream<Output, ErrorType>(resource, normalize_native_error);\n\n\t\tattach_native_remote_query_update(stream, resource);\n\n\t\treturn stream;\n\t}) as EffectRemoteQueryUpdateBrand &\n\t\t((input: RemoteInput<Input>) => RemoteLiveStream<Output, ErrorType>);\n\n\tcopy_property_descriptors(native_factory, wrapped);\n\tattach_native_remote_query_update(wrapped, native_factory);\n\n\treturn wrapped;\n}\n\nfunction attach_query_resource<Output, ErrorType = never>(\n\tresource: unknown,\n\teffect: RemoteQueryEffect<Output, ErrorType>,\n): void {\n\tconst methods = is_remote_resource<Output>(resource)\n\t\t? (resource as NativeQueryResource<Output>)\n\t\t: undefined;\n\tconst refresh = methods?.refresh;\n\tconst set = methods?.set;\n\tconst with_override = methods?.withOverride;\n\n\tattach_remote_resource_getters(resource, effect);\n\n\tif (!methods) {\n\t\treturn;\n\t}\n\n\tif (typeof refresh === \"function\") {\n\t\tObject.defineProperty(effect, \"refresh\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: () => RefreshRemoteResource(resource, refresh),\n\t\t});\n\t}\n\n\tif (typeof set === \"function\") {\n\t\tObject.defineProperty(effect, \"set\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: (value: Output) => set.call(resource, value),\n\t\t});\n\t}\n\n\tif (typeof with_override === \"function\") {\n\t\tObject.defineProperty(effect, \"withOverride\", {\n\t\t\tconfigurable: true,\n\t\t\tvalue: (update: (current: Output) => Output) => with_override.call(resource, update),\n\t\t});\n\t}\n}\n\nconst RefreshRemoteResource = (resource: unknown, refresh: () => Promise<void>) =>\n\tEffect.gen(function* () {\n\t\tyield* MakeEffectFromPromise(() => Promise.resolve(refresh.call(resource)));\n\t});\n"],"mappings":";;;;;;;;AAGA,SAAgB,WACf,OACA,KACmC;CACnC,MAAM,aAAa,OAAO;CAE1B,QACG,eAAe,YAAY,UAAU,QAAS,eAAe,eAC/D,OAAQ,MAAuC,SAAS;AAE1D;;;ACPA,MAAa,yBAA4C,aACxD,OAAO,IAAI,aAAa;CACvB,MAAM,OAAO,OAAO,4BAAgD,SAAS,KAAK,CAAC,CAAC,CAAC,KACpF,OAAO,oBAAoB,KAAA,CAAS,CACrC;CACA,MAAM,UAAU,oBAA+B,IAAI;CAEnD,IAAI,0BAA0B,OAAO,GACpC,OAAO;CAGR,OAAO,yBAAyB,SAAS,QAAQ,IAAI;AACtD,CAAC;AAEF,MAAa,yBACZ,OACA,mBAEA,OAAO,IAAI,aAAa;CACvB,IAAI,iBAAiB,UAAU;EAC9B,IAAI,CAAC,MAAM,IAAI;GACd,MAAM,UAAU,OAAO,sBAAiC,KAAK;GAE7D,OAAO,OAAO,OAAO,KAAK,OAAO;EAClC;EAEA,MAAM,OAAO,OAAO,0BAAqC,KAAK;EAE9D,OAAO,OAAO,yBACP,eAAe,IAAI,CAC1B;CACD;CAEA,OAAO,OAAO,yBAA4C,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Ac;EACd,QAAQ,WAAwC,cAAc,KAAK,UAAU,MAAM;CACpF,CAAC;AAEH;AAEA,MAAM,yBAAyB,UAAmB,YACjD,OAAO,IAAI,aAAa;CACvB,OAAO,4BAA4B,QAAQ,QAAQ,QAAQ,KAAK,QAAQ,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -241,6 +241,11 @@ var Dispatcher = class Dispatcher {
|
|
|
241
241
|
if (scope.disposed) return;
|
|
242
242
|
throw new ScopeDisposedError();
|
|
243
243
|
}
|
|
244
|
+
const scope_id = this.#scope_ids.get(scope);
|
|
245
|
+
if (scope_id !== void 0) {
|
|
246
|
+
this.#scope_ids.delete(scope);
|
|
247
|
+
this.#clear_scope_cache(scope_id);
|
|
248
|
+
}
|
|
244
249
|
scope.dispose();
|
|
245
250
|
this.#runtime.runFork(scope.close_effect);
|
|
246
251
|
}
|
|
@@ -305,12 +310,27 @@ var Dispatcher = class Dispatcher {
|
|
|
305
310
|
}
|
|
306
311
|
run(effect) {
|
|
307
312
|
if (this.#disposed) return Promise.reject(new DispatcherDisposedError());
|
|
308
|
-
const
|
|
313
|
+
const scoped_effect = Effect.gen(function* () {
|
|
309
314
|
const result = yield* Effect.exit(effect);
|
|
310
315
|
if (Exit.isSuccess(result)) return result.value;
|
|
311
316
|
if (Cause.hasInterruptsOnly(result.cause)) return;
|
|
312
317
|
const error = Cause.squash(result.cause);
|
|
313
318
|
if (isRedirect(error)) return;
|
|
319
|
+
/**
|
|
320
|
+
* Surface the failure without reporting it. Both the scoped and the
|
|
321
|
+
* unscoped path funnel through `interpreted_program`, which reports
|
|
322
|
+
* once, so reporting here would raise every failure twice.
|
|
323
|
+
*/
|
|
324
|
+
return yield* Effect.fail(error);
|
|
325
|
+
});
|
|
326
|
+
const scope = this.#current_scope;
|
|
327
|
+
const materialized_program = scope ? Effect.flatMap(scope.fork_in(scoped_effect), (fiber) => Fiber.await(fiber)) : Effect.exit(scoped_effect);
|
|
328
|
+
const interpreted_program = Effect.gen(function* () {
|
|
329
|
+
const result = yield* materialized_program;
|
|
330
|
+
if (Exit.isSuccess(result)) return result.value;
|
|
331
|
+
if (Cause.hasInterruptsOnly(result.cause)) return;
|
|
332
|
+
const error = Cause.squash(result.cause);
|
|
333
|
+
if (isRedirect(error)) return;
|
|
314
334
|
yield* Effect.sync(() => {
|
|
315
335
|
queueMicrotask(() => {
|
|
316
336
|
throw error;
|
|
@@ -318,8 +338,7 @@ var Dispatcher = class Dispatcher {
|
|
|
318
338
|
});
|
|
319
339
|
return yield* Effect.fail(error);
|
|
320
340
|
});
|
|
321
|
-
|
|
322
|
-
return this.#runtime.runPromise(scope ? Effect.provideService(Program, Scope.Scope, scope.underlying) : Program);
|
|
341
|
+
return this.#runtime.runPromise(interpreted_program);
|
|
323
342
|
}
|
|
324
343
|
#emit_markup_value(event) {
|
|
325
344
|
if (this.#is_server_render()) return event.fallback;
|
|
@@ -380,6 +399,39 @@ var Dispatcher = class Dispatcher {
|
|
|
380
399
|
this.#scope_ids.set(scope, next);
|
|
381
400
|
return next;
|
|
382
401
|
}
|
|
402
|
+
#clear_scope_cache(scope_id) {
|
|
403
|
+
const value_prefix = `${scope_id}|`;
|
|
404
|
+
const promise_prefix = `${scope_id}|`;
|
|
405
|
+
for (const [cache_id, cache_key] of this.#value_ids) {
|
|
406
|
+
if (!cache_id.startsWith(value_prefix)) continue;
|
|
407
|
+
this.#value_ids.delete(cache_id);
|
|
408
|
+
this.#interrupt_cached_fiber(cache_key);
|
|
409
|
+
this.#delete_value_cell(cache_key);
|
|
410
|
+
}
|
|
411
|
+
for (const [cache_id, cache_key] of this.#promise_ids) {
|
|
412
|
+
if (!cache_id.startsWith(promise_prefix)) continue;
|
|
413
|
+
this.#promise_ids.delete(cache_id);
|
|
414
|
+
this.#promise_values.delete(cache_key);
|
|
415
|
+
this.#interrupt_cached_fiber(cache_key);
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* The id maps only name the newest key per entry, so a scope whose
|
|
419
|
+
* dependencies changed leaves the settled cells of every superseded key
|
|
420
|
+
* behind. Sweep the caches themselves so unmounting releases them all.
|
|
421
|
+
*/
|
|
422
|
+
const value_key_prefix = `value:${scope_id}|`;
|
|
423
|
+
const promise_key_prefix = `promise:${scope_id}|`;
|
|
424
|
+
for (const cache_key of [...this.#value_cells.keys()]) {
|
|
425
|
+
if (!cache_key.startsWith(value_key_prefix)) continue;
|
|
426
|
+
this.#interrupt_cached_fiber(cache_key);
|
|
427
|
+
this.#delete_value_cell(cache_key);
|
|
428
|
+
}
|
|
429
|
+
for (const cache_key of [...this.#promise_values.keys()]) {
|
|
430
|
+
if (!cache_key.startsWith(promise_key_prefix)) continue;
|
|
431
|
+
this.#interrupt_cached_fiber(cache_key);
|
|
432
|
+
this.#promise_values.delete(cache_key);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
383
435
|
#make_scoped_id(scope_id, id) {
|
|
384
436
|
return `${scope_id}|${id}`;
|
|
385
437
|
}
|
|
@@ -397,57 +449,97 @@ var Dispatcher = class Dispatcher {
|
|
|
397
449
|
const Program = Effect.gen(function* () {
|
|
398
450
|
return yield* Effect.gen(options.factory);
|
|
399
451
|
});
|
|
400
|
-
/**
|
|
401
|
-
* Provide the active component scope so scoped acquisition works and
|
|
402
|
-
* finalizers run when the scope closes on unmount. Interruption of an
|
|
403
|
-
* individual run does not close the component scope; its finalizers
|
|
404
|
-
* run at scope disposal, matching the component lifetime.
|
|
405
|
-
*/
|
|
406
452
|
const scope = this.#current_scope;
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
453
|
+
if (!scope) {
|
|
454
|
+
const fiber = this.#runtime.runFork(Program);
|
|
455
|
+
this.#fibers.set(cache_key, fiber);
|
|
456
|
+
queueMicrotask(() => {
|
|
457
|
+
if (!this.#is_current_fiber(cache_key, fiber)) return;
|
|
458
|
+
if (this.#value_cells.has(cache_key)) return;
|
|
459
|
+
this.#set_value_cell(cache_key, {
|
|
460
|
+
status: "pending",
|
|
461
|
+
fiber
|
|
462
|
+
});
|
|
416
463
|
});
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
464
|
+
this.#runtime.runFork(WatchFiberExit({
|
|
465
|
+
fiber,
|
|
466
|
+
surface_failure: false,
|
|
467
|
+
on_complete: () => this.#complete_fiber(cache_key, fiber),
|
|
468
|
+
on_success: (value) => this.#publish_value_success(cache_key, fiber, value),
|
|
469
|
+
on_failure: (error) => this.#publish_value_failure(cache_key, fiber, error)
|
|
470
|
+
}));
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const launch_fiber = this.#runtime.runFork(Effect.flatMap(scope.fork_in(Program), (scoped_fiber) => {
|
|
474
|
+
if (this.#is_current_fiber(cache_key, launch_fiber)) this.#fibers.set(cache_key, scoped_fiber);
|
|
475
|
+
queueMicrotask(() => {
|
|
476
|
+
if (!this.#is_current_fiber(cache_key, scoped_fiber)) return;
|
|
477
|
+
this.#runtime.runFork(WatchFiberExit({
|
|
478
|
+
fiber: scoped_fiber,
|
|
479
|
+
surface_failure: false,
|
|
480
|
+
on_complete: () => this.#complete_fiber(cache_key, scoped_fiber),
|
|
481
|
+
on_success: (value) => this.#publish_value_success(cache_key, scoped_fiber, value),
|
|
482
|
+
on_failure: (error) => this.#publish_value_failure(cache_key, scoped_fiber, error)
|
|
483
|
+
}));
|
|
484
|
+
if (this.#value_cells.has(cache_key)) return;
|
|
485
|
+
this.#set_value_cell(cache_key, {
|
|
486
|
+
status: "pending",
|
|
487
|
+
fiber: scoped_fiber
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
return Effect.asVoid(Fiber.await(scoped_fiber));
|
|
424
491
|
}));
|
|
492
|
+
this.#fibers.set(cache_key, launch_fiber);
|
|
425
493
|
}
|
|
426
494
|
#start_promise_fiber(cache_key, options, cache_id) {
|
|
427
495
|
const Program = Effect.gen(function* () {
|
|
428
496
|
return yield* Effect.gen(options.factory);
|
|
429
497
|
});
|
|
430
|
-
/**
|
|
431
|
-
* See #start_value_fiber: the component scope is provided ambiently so
|
|
432
|
-
* scoped acquisition works and finalizers run on unmount.
|
|
433
|
-
*/
|
|
434
498
|
const scope = this.#current_scope;
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
499
|
+
/** Generator bodies passed to `Effect.gen` carry their own `this`. */
|
|
500
|
+
const dispatcher = this;
|
|
501
|
+
if (!scope) {
|
|
502
|
+
const fiber = this.#runtime.runFork(Program);
|
|
503
|
+
const ReleaseFiber = Effect.sync(() => {
|
|
504
|
+
if (!this.#is_current_fiber(cache_key, fiber)) return;
|
|
505
|
+
this.#fibers.delete(cache_key);
|
|
506
|
+
this.#promise_values.delete(cache_key);
|
|
507
|
+
if (this.#promise_ids.get(cache_id) === cache_key) this.#promise_ids.delete(cache_id);
|
|
508
|
+
});
|
|
509
|
+
const AwaitFiber = Effect.gen(function* () {
|
|
510
|
+
const exit = yield* Fiber.await(fiber);
|
|
511
|
+
yield* ReleaseFiber;
|
|
512
|
+
if (Exit.isSuccess(exit)) return exit.value;
|
|
513
|
+
return yield* Effect.fail(Cause.squash(exit.cause));
|
|
514
|
+
});
|
|
515
|
+
this.#fibers.set(cache_key, fiber);
|
|
516
|
+
this.#promise_values.set(cache_key, this.#runtime.runPromise(AwaitFiber));
|
|
517
|
+
return this.#promise_values.get(cache_key);
|
|
518
|
+
}
|
|
519
|
+
const promise = this.#runtime.runPromise(Effect.gen(function* () {
|
|
520
|
+
const scoped_fiber = yield* scope.fork_in(Program);
|
|
521
|
+
dispatcher.#fibers.set(cache_key, scoped_fiber);
|
|
522
|
+
dispatcher.#runtime.runFork(WatchFiberExit({
|
|
523
|
+
fiber: scoped_fiber,
|
|
524
|
+
/**
|
|
525
|
+
* The promise this call returns already rejects with the
|
|
526
|
+
* failure, so surfacing it again would hand a handled
|
|
527
|
+
* rejection back as an uncaught error.
|
|
528
|
+
*/
|
|
529
|
+
surface_failure: false,
|
|
530
|
+
on_complete: () => {
|
|
531
|
+
if (!dispatcher.#is_current_fiber(cache_key, scoped_fiber)) return;
|
|
532
|
+
dispatcher.#fibers.delete(cache_key);
|
|
533
|
+
dispatcher.#promise_values.delete(cache_key);
|
|
534
|
+
if (dispatcher.#promise_ids.get(cache_id) === cache_key) dispatcher.#promise_ids.delete(cache_id);
|
|
535
|
+
}
|
|
536
|
+
}));
|
|
537
|
+
const exit = yield* Fiber.await(scoped_fiber);
|
|
446
538
|
if (Exit.isSuccess(exit)) return exit.value;
|
|
447
539
|
return yield* Effect.fail(Cause.squash(exit.cause));
|
|
448
|
-
});
|
|
449
|
-
this.#
|
|
450
|
-
return
|
|
540
|
+
}));
|
|
541
|
+
this.#promise_values.set(cache_key, promise);
|
|
542
|
+
return promise;
|
|
451
543
|
}
|
|
452
544
|
#clear_pending_value_cell(cache_key, fiber) {
|
|
453
545
|
const cell = this.#value_cells.get(cache_key);
|
|
@@ -513,16 +605,19 @@ function reset_dispatcher() {
|
|
|
513
605
|
var ComponentScopeRef = class {
|
|
514
606
|
#get_dispatcher;
|
|
515
607
|
#scope;
|
|
608
|
+
#disposed = false;
|
|
516
609
|
constructor(get_dispatcher_fn) {
|
|
517
610
|
this.#get_dispatcher = get_dispatcher_fn;
|
|
518
611
|
}
|
|
519
612
|
/** The component scope, creating it on first access. */
|
|
520
613
|
get scope() {
|
|
614
|
+
if (this.#disposed) throw new ScopeDisposedError();
|
|
521
615
|
this.#scope ??= this.#get_dispatcher().begin_scope();
|
|
522
616
|
return this.#scope;
|
|
523
617
|
}
|
|
524
618
|
/** Disposes the scope if it was created. Idempotent. */
|
|
525
619
|
dispose() {
|
|
620
|
+
this.#disposed = true;
|
|
526
621
|
const scope = this.#scope;
|
|
527
622
|
this.#scope = void 0;
|
|
528
623
|
if (scope && !scope.disposed) this.#get_dispatcher().dispose_scope(scope);
|
|
@@ -531,4 +626,4 @@ var ComponentScopeRef = class {
|
|
|
531
626
|
//#endregion
|
|
532
627
|
export { Code as a, reset_dispatcher as i, Dispatcher as n, ComponentScope as o, get_dispatcher as r, ComponentScopeRef as t };
|
|
533
628
|
|
|
534
|
-
//# sourceMappingURL=dispatcher-
|
|
629
|
+
//# sourceMappingURL=dispatcher-B6ZRUsjN.js.map
|