svelte-effect-runtime 3.4.11 → 4.0.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-BrZka6DW.js +530 -0
- package/.dist/chunks/client-BrZka6DW.js.map +1 -0
- package/.dist/chunks/compiler-COVzgLYo.js +412 -0
- package/.dist/chunks/compiler-COVzgLYo.js.map +1 -0
- package/.dist/chunks/descriptors-B4otDlm1.js +216 -0
- package/.dist/chunks/descriptors-B4otDlm1.js.map +1 -0
- package/.dist/chunks/diagnostics-BDrky-Di.js +359 -0
- package/.dist/chunks/diagnostics-BDrky-Di.js.map +1 -0
- package/.dist/chunks/dispatcher-BA0PLQhA.js +16 -0
- package/.dist/chunks/dispatcher-BA0PLQhA.js.map +1 -0
- package/.dist/chunks/{dispatcher-pHH4JcFR.js → dispatcher-_x0MQZBS.js} +84 -258
- package/.dist/chunks/dispatcher-_x0MQZBS.js.map +1 -0
- package/.dist/chunks/{errors-Dcf0MVbq.js → errors-CLsbGjIa.js} +57 -106
- package/.dist/chunks/errors-CLsbGjIa.js.map +1 -0
- package/.dist/chunks/live-BundLSoY.js +146 -0
- package/.dist/chunks/live-BundLSoY.js.map +1 -0
- package/.dist/chunks/live-CHK0RrZu.js +10 -0
- package/.dist/chunks/live-CHK0RrZu.js.map +1 -0
- package/.dist/chunks/{remote-client-Bj1pZXgq.js → remote-client-mkQAfP1G.js} +30 -24
- package/.dist/chunks/remote-client-mkQAfP1G.js.map +1 -0
- package/.dist/chunks/{runtime-ekkMQ-wL.js → runtime-HDTlEnzp.js} +3 -27
- package/.dist/chunks/runtime-HDTlEnzp.js.map +1 -0
- package/.dist/chunks/server-BNrA1I-u.js +144 -0
- package/.dist/chunks/server-BNrA1I-u.js.map +1 -0
- package/.dist/chunks/source-scan-9pZxnfct.js +1059 -0
- package/.dist/chunks/source-scan-9pZxnfct.js.map +1 -0
- package/.dist/chunks/{transform-CtQDGS9c.js → transform-BXyYUAez.js} +308 -484
- package/.dist/chunks/transform-BXyYUAez.js.map +1 -0
- package/.dist/compiler/markup-identifiers.d.ts +2 -0
- package/.dist/compiler/remote-client.d.ts +6 -0
- package/.dist/compiler/source-scan.d.ts +101 -0
- package/.dist/compiler/sveltekit-remote-bridge.d.ts +3 -0
- package/.dist/{vite.d.ts → compiler.d.ts} +7 -1
- package/.dist/{vite.js → compiler.js} +1 -1
- package/.dist/detect.d.ts +0 -31
- package/.dist/detect.js +0 -39
- package/.dist/detect.js.map +1 -1
- package/.dist/diagnostics.d.ts +0 -16
- package/.dist/dispatcher/deps.d.ts +3 -14
- package/.dist/dispatcher/fibers.d.ts +5 -46
- package/.dist/dispatcher/index.d.ts +1 -143
- package/.dist/dispatcher/types.d.ts +0 -151
- package/.dist/dispatcher.js +1 -1
- package/.dist/errors.d.ts +44 -86
- package/.dist/generated/dispatcher.d.ts +0 -50
- package/.dist/generators.d.ts +3 -12
- package/.dist/internal/descriptors.d.ts +0 -16
- package/.dist/internal/generators.js +25 -3
- package/.dist/internal/generators.js.map +1 -0
- package/.dist/internal/live.d.ts +9 -0
- package/.dist/internal/remote-client.js +2 -2
- package/.dist/internal/remote-server.js +2 -2
- package/.dist/internal/schema.d.ts +13 -0
- package/.dist/live.d.ts +106 -0
- package/.dist/markup/event-attributes.d.ts +5 -28
- package/.dist/markup/promise.d.ts +1 -23
- package/.dist/markup/promise.js +2 -18
- package/.dist/markup/promise.js.map +1 -1
- package/.dist/markup/run.d.ts +1 -10
- package/.dist/markup/run.js +2 -11
- package/.dist/markup/run.js.map +1 -1
- package/.dist/markup/transform/apply.d.ts +4 -4
- package/.dist/markup/transform/classify.d.ts +2 -11
- package/.dist/markup/transform/constants.d.ts +2 -1
- package/.dist/markup/transform/effect-bindings.d.ts +2 -26
- package/.dist/markup/transform/effect-callbacks.d.ts +0 -20
- package/.dist/markup/transform/emit.d.ts +2 -11
- package/.dist/markup/transform/expressions.d.ts +0 -35
- package/.dist/markup/transform/scan.d.ts +3 -22
- package/.dist/markup/transform/types.d.ts +2 -129
- package/.dist/markup/transform.js +1 -1
- package/.dist/markup/value.d.ts +1 -18
- package/.dist/markup/value.js +2 -19
- package/.dist/markup/value.js.map +1 -1
- package/.dist/mod.d.ts +6 -8
- package/.dist/mod.js +5 -4
- package/.dist/mod.js.map +1 -1
- package/.dist/remote/cause-codec.d.ts +19 -0
- package/.dist/remote/client/command.d.ts +3 -17
- package/.dist/remote/client/form-data.d.ts +0 -7
- package/.dist/remote/client/form-enhance.d.ts +0 -7
- package/.dist/remote/client/form-transport.d.ts +15 -18
- package/.dist/remote/client/form.d.ts +9 -20
- package/.dist/remote/client/index.d.ts +2 -1
- package/.dist/remote/client/prerender.d.ts +6 -0
- package/.dist/remote/client/query-result.d.ts +2 -14
- package/.dist/remote/client/query.d.ts +9 -59
- package/.dist/remote/client/responses.d.ts +3 -27
- package/.dist/remote/client/types.d.ts +26 -101
- package/.dist/remote/client/utils.d.ts +0 -8
- package/.dist/remote/client.d.ts +2 -2
- package/.dist/remote/client.js +2 -2
- package/.dist/remote/effect.d.ts +6 -0
- package/.dist/remote/failures.d.ts +4 -0
- package/.dist/remote/query-update.d.ts +2 -0
- package/.dist/remote/resource.d.ts +25 -0
- package/.dist/remote/server.d.ts +5 -60
- package/.dist/remote/server.js +2 -179
- package/.dist/remote/shared.d.ts +6 -145
- package/.dist/remote/shared.js +6 -127
- package/.dist/remote/shared.js.map +1 -1
- package/.dist/runtime/transform.js +83 -87
- package/.dist/runtime/transform.js.map +1 -1
- package/.dist/script-transform/ast.d.ts +0 -46
- package/.dist/script-transform/imports.d.ts +2 -38
- package/.dist/script-transform/lower.d.ts +0 -9
- package/.dist/script-transform/runes.d.ts +0 -10
- package/.dist/script-transform/runtime-block.d.ts +0 -17
- package/.dist/script-transform/source.d.ts +0 -24
- package/.dist/script-transform/types.d.ts +9 -126
- package/.dist/server/effects.d.ts +8 -57
- package/.dist/server/factories.d.ts +7 -7
- package/.dist/server/handler.d.ts +37 -0
- package/.dist/server/index.d.ts +4 -1
- package/.dist/server/invalid.d.ts +0 -7
- package/.dist/server/live-snapshot.d.ts +5 -0
- package/.dist/server/remote-handler-context.d.ts +5 -0
- package/.dist/server/runtime.d.ts +6 -24
- package/.dist/server/schema.d.ts +2 -40
- package/.dist/server/transport.d.ts +2 -0
- package/.dist/server/types.d.ts +88 -71
- package/.dist/server/wrappers.d.ts +4 -41
- package/.dist/server.d.ts +2 -2
- package/.dist/server.js +255 -279
- package/.dist/server.js.map +1 -1
- package/.dist/yieldable.d.ts +7 -0
- package/README.md +1 -1
- package/package.json +5 -5
- package/.dist/chunks/client-CsVu54pU.js +0 -627
- package/.dist/chunks/client-CsVu54pU.js.map +0 -1
- package/.dist/chunks/descriptors-cOe9uRJz.js +0 -36
- package/.dist/chunks/descriptors-cOe9uRJz.js.map +0 -1
- package/.dist/chunks/dispatcher-LtvFKYUp.js +0 -47
- package/.dist/chunks/dispatcher-LtvFKYUp.js.map +0 -1
- package/.dist/chunks/dispatcher-pHH4JcFR.js.map +0 -1
- package/.dist/chunks/errors-Dcf0MVbq.js.map +0 -1
- package/.dist/chunks/event-attributes-gHzP2ycp.js +0 -39
- package/.dist/chunks/event-attributes-gHzP2ycp.js.map +0 -1
- package/.dist/chunks/remote-client-Bj1pZXgq.js.map +0 -1
- package/.dist/chunks/runtime-ekkMQ-wL.js.map +0 -1
- package/.dist/chunks/transform-CtQDGS9c.js.map +0 -1
- package/.dist/chunks/vite-WGlbSnso.js +0 -486
- package/.dist/chunks/vite-WGlbSnso.js.map +0 -1
- package/.dist/remote/client/effect.d.ts +0 -29
- package/.dist/remote/client/failures.d.ts +0 -42
- package/.dist/remote/server.js.map +0 -1
- package/.dist/vite/remote-client.d.ts +0 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-COVzgLYo.js","names":["candidate"],"sources":["../../../modules/svelte-effect-runtime/src/compiler/sveltekit-remote-bridge.ts","../../../modules/svelte-effect-runtime/src/compiler.ts"],"sourcesContent":["const sveltekit_remote_runtime_suffix =\n\t\"/node_modules/@sveltejs/kit/src/runtime/client/remote-functions/index.js\";\n\nconst expected_sveltekit_remote_exports = [\n\t[\"command\", \"./command.svelte.js\"],\n\t[\"form\", \"./form.svelte.js\"],\n\t[\"prerender\", \"./prerender.svelte.js\"],\n\t[\"query\", \"./query/index.js\"],\n\t[\"query_batch\", \"./query-batch.svelte.js\"],\n\t[\"query_live\", \"./query-live/index.js\"],\n] as const;\n\nconst sveltekit_remote_bridge_exports = [\n\t`export { remote_request as __SER___remote_request } from './shared.svelte.js';`,\n\t`export { serialize_binary_form as __SER___serialize_binary_form, BINARY_FORM_CONTENT_TYPE as __SER___binary_form_content_type } from '../../form-utils.js';`,\n] as const;\n\nconst sveltekit_remote_bridge_names = [\n\t\"__SER___remote_request\",\n\t\"__SER___serialize_binary_form\",\n\t\"__SER___binary_form_content_type\",\n] as const;\n\nexport function is_sveltekit_remote_runtime_index(id: string): boolean {\n\tconst [filename] = id.split(\"?\", 2);\n\tconst normalized_filename = filename.replaceAll(\"\\\\\", \"/\");\n\n\treturn normalized_filename.endsWith(sveltekit_remote_runtime_suffix);\n}\n\nexport function append_sveltekit_remote_transport_bridge(code: string): string {\n\tconst has_complete_bridge = sveltekit_remote_bridge_exports.every((statement) =>\n\t\tcode.includes(statement),\n\t);\n\tconst present_bridge_names = sveltekit_remote_bridge_names.filter((name) =>\n\t\tcode.includes(name),\n\t);\n\n\tif (has_complete_bridge) {\n\t\treturn code;\n\t}\n\n\tif (present_bridge_names.length > 0) {\n\t\tthrow new Error(\n\t\t\tmake_unsupported_sveltekit_remote_runtime_message(\n\t\t\t\t`found an incomplete SER transport bridge (${present_bridge_names.join(\", \")})`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst missing_exports = expected_sveltekit_remote_exports\n\t\t.filter(([name, source]) => !has_named_reexport(code, name, source))\n\t\t.map(([name, source]) => `${name} from ${source}`);\n\n\tif (missing_exports.length > 0) {\n\t\tthrow new Error(\n\t\t\tmake_unsupported_sveltekit_remote_runtime_message(\n\t\t\t\t`missing ${missing_exports.join(\", \")}`,\n\t\t\t),\n\t\t);\n\t}\n\n\treturn `${code.trimEnd()}\\n${sveltekit_remote_bridge_exports.join(\"\\n\")}\\n`;\n}\n\nexport function make_missing_sveltekit_remote_runtime_message(): string {\n\treturn make_unsupported_sveltekit_remote_runtime_message(\n\t\t\"the generated client used a remote form, but the Kit client runtime index was not found\",\n\t);\n}\n\nfunction has_named_reexport(code: string, name: string, source: string): boolean {\n\tconst escaped_name = escape_regular_expression(name);\n\tconst escaped_source = escape_regular_expression(source);\n\tconst pattern = new RegExp(\n\t\t`export\\\\s*\\\\{\\\\s*${escaped_name}\\\\s*\\\\}\\\\s*from\\\\s*[\"']${escaped_source}[\"']\\\\s*;?`,\n\t);\n\n\treturn pattern.test(code);\n}\n\nfunction escape_regular_expression(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction make_unsupported_sveltekit_remote_runtime_message(reason: string): string {\n\treturn [\n\t\t\"Unsupported @sveltejs/kit remote client runtime.\",\n\t\treason,\n\t\t\"SER expects the remote runtime layout used by SvelteKit 2.69.x and 3.0.0-next.x.\",\n\t].join(\" \");\n}\n","import {\n\tappend_sveltekit_remote_transport_bridge,\n\tis_sveltekit_remote_runtime_index,\n\tmake_missing_sveltekit_remote_runtime_message,\n} from \"./compiler/sveltekit-remote-bridge.ts\";\nimport type { Plugin } from \"vite\";\n\n/**\n * Options for the {@link effect} Vite plugin.\n *\n * @example\n * ```ts\n * const options: EffectOptions = { debug: true };\n * const plugins = effect(options);\n * ```\n *\n * @since 2.0.0\n */\nexport interface EffectOptions {\n\t/** Whether to emit debug logging in the generated remote client module. */\n\tdebug?: boolean;\n}\n\ninterface SvelteComponentModuleFilter {\n\tset_extensions(extensions: readonly string[]): void;\n\tis_module(id: string): boolean;\n}\n\ninterface VitePluginSvelteApi {\n\toptions?: {\n\t\textensions?: readonly unknown[];\n\t};\n}\n\ntype VitePluginSvelte = Plugin & {\n\tapi?: VitePluginSvelteApi;\n};\n\ntype VitePluginSvelteWithExtensions = Plugin & {\n\tapi: {\n\t\toptions: {\n\t\t\textensions: readonly string[];\n\t\t};\n\t};\n};\n\nconst default_svelte_component_extensions = [\".svelte\"] as const;\n\n/**\n * Vite plugin for SvelteKit. The server import plugin rewrites server-side\n * imports to the server entrypoint; the remote client plugin wraps SvelteKit's\n * generated client remote exports in Effect-returning adapters.\n *\n * @example\n * ```ts\n * import { effect } from \"svelte-effect-runtime/compiler\";\n * import { sveltekit } from \"@sveltejs/kit/vite\";\n *\n * export default defineConfig({ plugins: [effect(), sveltekit()] });\n * ```\n *\n * @since 2.0.0\n * @param options - Optional configuration.\n * @returns Vite plugins that integrate the runtime with SvelteKit.\n */\nexport function effect(options?: EffectOptions): Plugin[] {\n\tconst component_filter = make_svelte_component_module_filter();\n\n\treturn [\n\t\tmake_diagnostics_plugin(component_filter),\n\t\tmake_svelte_transform_plugin(component_filter),\n\t\tmake_server_rewrite_plugin(),\n\t\tmake_remote_client_wrapper_plugin(options),\n\t];\n}\n\nfunction make_diagnostics_plugin(component_filter: SvelteComponentModuleFilter): Plugin {\n\tconst warned_diagnostics = new Set<string>();\n\n\treturn {\n\t\tname: \"svelte-effect-runtime:diagnostics\",\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (!component_filter.is_module(id) || !may_have_effect_diagnostics(code)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst clean_id = id.split(\"?\")[0] ?? id;\n\t\t\tconst { find_svelte_effect_diagnostics } = await import(\"./diagnostics.ts\");\n\t\t\tconst diagnostics = find_svelte_effect_diagnostics(code, clean_id);\n\n\t\t\tfor (const diagnostic of diagnostics) {\n\t\t\t\tconst diagnostic_key = [\n\t\t\t\t\tclean_id,\n\t\t\t\t\tdiagnostic.line,\n\t\t\t\t\tdiagnostic.column,\n\t\t\t\t\tdiagnostic.message,\n\t\t\t\t].join(\":\");\n\n\t\t\t\tif (warned_diagnostics.has(diagnostic_key)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\twarned_diagnostics.add(diagnostic_key);\n\n\t\t\t\tthis.warn({\n\t\t\t\t\tid: clean_id,\n\t\t\t\t\tmessage: diagnostic.message,\n\t\t\t\t\tloc: {\n\t\t\t\t\t\tline: diagnostic.line,\n\t\t\t\t\t\tcolumn: diagnostic.column,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t},\n\t};\n}\n\nfunction make_svelte_transform_plugin(component_filter: SvelteComponentModuleFilter): Plugin {\n\treturn {\n\t\tname: \"svelte-effect-runtime:svelte-transform\",\n\n\t\tconfigResolved(config) {\n\t\t\tconst extensions = find_svelte_component_extensions(config.plugins);\n\t\t\tconst conflicting_plugin_names = find_pre_transform_plugin_names(config.plugins);\n\n\t\t\tif (extensions) {\n\t\t\t\tcomponent_filter.set_extensions(extensions);\n\t\t\t}\n\n\t\t\tif (conflicting_plugin_names.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.logger.info(make_pre_transform_plugin_notice(conflicting_plugin_names));\n\t\t},\n\n\t\tasync transform(code: string, id: string, options?: { ssr?: boolean | undefined }) {\n\t\t\tif (!component_filter.is_module(id) || !may_have_ser_syntax(code)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { transform_svelte_effect } = await import(\"./runtime/transform.ts\");\n\t\t\tconst result = transform_svelte_effect(code, id, {\n\t\t\t\ttarget: options?.ssr ? \"server\" : \"client\",\n\t\t\t});\n\n\t\t\tif (result.code === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: result.code, map: null };\n\t\t},\n\t};\n}\n\nfunction make_svelte_component_module_filter(): SvelteComponentModuleFilter {\n\tlet extensions: readonly string[] = default_svelte_component_extensions;\n\n\treturn {\n\t\tset_extensions(next_extensions) {\n\t\t\tconst normalized_extensions = normalize_svelte_component_extensions(next_extensions);\n\n\t\t\tif (normalized_extensions.length === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\textensions = normalized_extensions;\n\t\t},\n\n\t\tis_module(id) {\n\t\t\treturn is_svelte_component_module(id, extensions);\n\t\t},\n\t};\n}\n\nfunction normalize_svelte_component_extensions(extensions: readonly string[]): string[] {\n\tconst normalized_extensions = extensions\n\t\t.filter((extension) => extension.length > 0)\n\t\t.map((extension) => (extension.startsWith(\".\") ? extension : `.${extension}`));\n\n\treturn [...new Set(normalized_extensions)];\n}\n\nfunction find_svelte_component_extensions(\n\tplugins: readonly Plugin[],\n): readonly string[] | undefined {\n\tconst svelte_plugin = plugins.find(has_svelte_component_extensions);\n\n\treturn svelte_plugin?.api?.options?.extensions;\n}\n\nfunction has_svelte_component_extensions(plugin: Plugin): plugin is VitePluginSvelteWithExtensions {\n\tconst candidate = plugin as VitePluginSvelte;\n\tconst extensions = candidate.api?.options?.extensions;\n\n\tif (!plugin.name.startsWith(\"vite-plugin-svelte\")) {\n\t\treturn false;\n\t}\n\n\treturn (\n\t\tArray.isArray(extensions) && extensions.every((extension) => typeof extension === \"string\")\n\t);\n}\n\nfunction find_pre_transform_plugin_names(plugins: readonly Plugin[]): string[] {\n\treturn plugins\n\t\t.filter(\n\t\t\t(plugin) =>\n\t\t\t\t!plugin.name.startsWith(\"svelte-effect-runtime:\") &&\n\t\t\t\t!is_known_framework_pre_transform_plugin(plugin.name) &&\n\t\t\t\thas_pre_transform_priority(plugin),\n\t\t)\n\t\t.map((plugin) => plugin.name);\n}\n\nconst ansi_reset = \"\\x1b[0m\";\nconst ansi_light_green = \"\\x1b[92m\";\n\nfunction make_pre_transform_plugin_notice(plugin_names: readonly string[]): string {\n\tconst formatted_plugins = plugin_names.map((plugin_name) => ` - ${plugin_name}`).join(\"\\n\");\n\n\treturn [\n\t\t`${ansi_light_green}[svelte-effect-runtime]${ansi_reset} Svelte Effect Runtime noticed possible Vite plugin ordering conflicts.`,\n\t\t\"\",\n\t\t\"These plugins run before normal Svelte component transforms:\",\n\t\tformatted_plugins,\n\t\t\"\",\n\t\t\"This is usually fine, but if you see Svelte parser errors around <script effect>\",\n\t\t\"or yield* in components, one of those plugins may be reading component files before\",\n\t\t\"SER has lowered its syntax.\",\n\t].join(\"\\n\");\n}\n\nfunction is_known_framework_pre_transform_plugin(name: string): boolean {\n\treturn name.startsWith(\"vite:\") || name === \"vite-plugin-svelte:preprocess\";\n}\n\nfunction has_pre_transform_priority(plugin: Plugin): boolean {\n\tif (plugin.enforce === \"pre\" && plugin.transform) {\n\t\treturn true;\n\t}\n\n\tif (\n\t\ttypeof plugin.transform === \"object\" &&\n\t\tplugin.transform !== null &&\n\t\t\"order\" in plugin.transform &&\n\t\tplugin.transform.order === \"pre\"\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction make_server_rewrite_plugin(): Plugin {\n\treturn {\n\t\tname: \"svelte-effect-runtime:server-imports\",\n\n\t\tconfig() {\n\t\t\treturn { optimizeDeps: { exclude: [\"svelte-effect-runtime\"] } };\n\t\t},\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (!is_server_runtime_module(id)) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tif (!code.includes(\"svelte-effect-runtime\")) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst rewritten = await rewrite_server_imports(code, id);\n\n\t\t\tif (rewritten === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: rewritten, map: null };\n\t\t},\n\t};\n}\n\nasync function rewrite_server_imports(code: string, id: string): Promise<string> {\n\tconst [{ default: MagicString }, ts] = await Promise.all([\n\t\timport(\"magic-string\"),\n\t\timport(\"typescript\"),\n\t]);\n\tconst filename = id.split(\"?\", 2)[0] ?? id;\n\tconst source_file = ts.createSourceFile(\n\t\tfilename,\n\t\tcode,\n\t\tts.ScriptTarget.Latest,\n\t\ttrue,\n\t\tget_script_kind(filename, ts),\n\t);\n\tconst magic = new MagicString(code);\n\tconst ser_prerender_imports = is_remote_module(id)\n\t\t? source_file.statements.flatMap((statement) => {\n\t\t\t\tif (\n\t\t\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t\t\t!ts.isStringLiteralLike(statement.moduleSpecifier) ||\n\t\t\t\t\t!is_ser_server_import(statement.moduleSpecifier.text)\n\t\t\t\t) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst bindings = statement.importClause?.namedBindings;\n\n\t\t\t\tif (\n\t\t\t\t\tstatement.importClause?.isTypeOnly === true ||\n\t\t\t\t\t!bindings ||\n\t\t\t\t\t!ts.isNamedImports(bindings)\n\t\t\t\t) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\treturn bindings.elements.filter(\n\t\t\t\t\t(element) =>\n\t\t\t\t\t\t!element.isTypeOnly &&\n\t\t\t\t\t\t(element.propertyName?.text ?? element.name.text) === \"Prerender\",\n\t\t\t\t);\n\t\t\t})\n\t\t: [];\n\tconst prerender_binding_names = new Set(\n\t\tser_prerender_imports.map((element) => element.name.text),\n\t);\n\tconst prerender_namespace_names = new Set(\n\t\tis_remote_module(id)\n\t\t\t? source_file.statements.flatMap((statement) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!ts.isImportDeclaration(statement) ||\n\t\t\t\t\t\t!ts.isStringLiteralLike(statement.moduleSpecifier) ||\n\t\t\t\t\t\t!is_ser_server_import(statement.moduleSpecifier.text) ||\n\t\t\t\t\t\tstatement.importClause?.isTypeOnly === true ||\n\t\t\t\t\t\tstatement.importClause?.namedBindings === undefined ||\n\t\t\t\t\t\t!ts.isNamespaceImport(statement.importClause.namedBindings)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [statement.importClause.namedBindings.name.text];\n\t\t\t\t})\n\t\t\t: [],\n\t);\n\tconst ser_prerender_calls = collect_exported_ser_prerender_calls(\n\t\tsource_file,\n\t\tprerender_binding_names,\n\t\tprerender_namespace_names,\n\t\tts,\n\t);\n\tconst has_sveltekit_prerender_import = source_file.statements.some(\n\t\t(statement) =>\n\t\t\tts.isImportDeclaration(statement) &&\n\t\t\tts.isStringLiteralLike(statement.moduleSpecifier) &&\n\t\t\tstatement.moduleSpecifier.text === \"$app/server\" &&\n\t\t\tstatement.importClause?.isTypeOnly !== true &&\n\t\t\tstatement.importClause?.namedBindings !== undefined &&\n\t\t\tts.isNamedImports(statement.importClause.namedBindings) &&\n\t\t\tstatement.importClause.namedBindings.elements.some(\n\t\t\t\t(element) =>\n\t\t\t\t\t!element.isTypeOnly &&\n\t\t\t\t\t(element.propertyName?.text ?? element.name.text) === \"prerender\" &&\n\t\t\t\t\telement.name.text === \"prerender\",\n\t\t\t),\n\t);\n\tconst has_top_level_prerender_binding = source_file.statements.some((statement) =>\n\t\tdeclares_top_level_value_binding(statement, \"prerender\", ts),\n\t);\n\tlet changed = false;\n\n\tif (ser_prerender_calls.size > 0 && !has_sveltekit_prerender_import) {\n\t\tif (has_top_level_prerender_binding) {\n\t\t\tthrow new Error(\n\t\t\t\t`[svelte-effect-runtime] ${filename}: Prerender remote modules reserve the top-level \"prerender\" binding for SvelteKit. Rename the existing binding.`,\n\t\t\t);\n\t\t}\n\n\t\tconst last_import = [...source_file.statements].reverse().find(ts.isImportDeclaration);\n\t\tconst native_import = `import { prerender } from \"$app/server\";`;\n\n\t\tif (last_import) {\n\t\t\tmagic.appendRight(last_import.end, `\\n${native_import}`);\n\t\t} else {\n\t\t\tmagic.prepend(`${native_import}\\n`);\n\t\t}\n\n\t\tchanged = true;\n\t}\n\n\tconst rewrite_specifier = (specifier: import(\"typescript\").StringLiteralLike) => {\n\t\tconst replacement = get_server_import_replacement(specifier.text);\n\n\t\tif (!replacement) {\n\t\t\treturn;\n\t\t}\n\n\t\tmagic.overwrite(\n\t\t\tspecifier.getStart(source_file),\n\t\t\tspecifier.end,\n\t\t\tJSON.stringify(replacement),\n\t\t);\n\t\tchanged = true;\n\t};\n\n\tconst visit = (node: import(\"typescript\").Node) => {\n\t\tif (ts.isImportDeclaration(node) && ts.isStringLiteralLike(node.moduleSpecifier)) {\n\t\t\trewrite_specifier(node.moduleSpecifier);\n\t\t}\n\n\t\tif (\n\t\t\tts.isExportDeclaration(node) &&\n\t\t\tnode.moduleSpecifier &&\n\t\t\tts.isStringLiteralLike(node.moduleSpecifier)\n\t\t) {\n\t\t\trewrite_specifier(node.moduleSpecifier);\n\t\t}\n\n\t\tif (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword) {\n\t\t\tconst [specifier] = node.arguments;\n\n\t\t\tif (specifier && ts.isStringLiteralLike(specifier)) {\n\t\t\t\trewrite_specifier(specifier);\n\t\t\t}\n\t\t}\n\n\t\tif (ts.isCallExpression(node) && ser_prerender_calls.has(node)) {\n\t\t\tconst missing_arguments = Math.max(0, 3 - node.arguments.length);\n\t\t\tconst injected_arguments = [\n\t\t\t\t...Array.from({ length: missing_arguments }, () => \"undefined\"),\n\t\t\t\t\"prerender\",\n\t\t\t];\n\t\t\tconst separator =\n\t\t\t\tnode.arguments.length === 0 || node.arguments.hasTrailingComma ? \"\" : \",\";\n\n\t\t\tmagic.appendLeft(node.end - 1, `${separator} ${injected_arguments.join(\", \")}`);\n\t\t\tchanged = true;\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n\n\treturn changed ? magic.toString() : code;\n}\n\nfunction is_ser_server_import(specifier: string): boolean {\n\treturn specifier === \"svelte-effect-runtime\" || specifier === \"svelte-effect-runtime/server\";\n}\n\nfunction is_ser_prerender_callee(\n\texpression: import(\"typescript\").Expression,\n\tbinding_names: ReadonlySet<string>,\n\tnamespace_names: ReadonlySet<string>,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isIdentifier(expression)) {\n\t\treturn binding_names.has(expression.text);\n\t}\n\n\treturn (\n\t\tts.isPropertyAccessExpression(expression) &&\n\t\tts.isIdentifier(expression.expression) &&\n\t\tnamespace_names.has(expression.expression.text) &&\n\t\texpression.name.text === \"Prerender\"\n\t);\n}\n\nfunction collect_exported_ser_prerender_calls(\n\tsource_file: import(\"typescript\").SourceFile,\n\tbinding_names: ReadonlySet<string>,\n\tnamespace_names: ReadonlySet<string>,\n\tts: typeof import(\"typescript\"),\n): ReadonlySet<import(\"typescript\").CallExpression> {\n\tconst calls = new Set<import(\"typescript\").CallExpression>();\n\n\tconst visit = (node: import(\"typescript\").Node) => {\n\t\tif (\n\t\t\tts.isCallExpression(node) &&\n\t\t\tis_ser_prerender_callee(node.expression, binding_names, namespace_names, ts) &&\n\t\t\tis_exported_variable_initializer(node, ts)\n\t\t) {\n\t\t\tcalls.add(node);\n\t\t}\n\n\t\tts.forEachChild(node, visit);\n\t};\n\n\tvisit(source_file);\n\n\treturn calls;\n}\n\nfunction is_exported_variable_initializer(\n\tnode: import(\"typescript\").CallExpression,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tlet initializer: import(\"typescript\").Expression = node;\n\tlet parent = initializer.parent;\n\n\twhile (is_transparent_expression_wrapper(parent, initializer, ts)) {\n\t\tinitializer = parent;\n\t\tparent = initializer.parent;\n\t}\n\n\tif (!ts.isVariableDeclaration(parent) || parent.initializer !== initializer) {\n\t\treturn false;\n\t}\n\n\tconst statement = parent.parent.parent;\n\n\treturn (\n\t\tts.isVariableStatement(statement) &&\n\t\tstatement.modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword) ===\n\t\t\ttrue\n\t);\n}\n\nfunction is_transparent_expression_wrapper(\n\tparent: import(\"typescript\").Node,\n\texpression: import(\"typescript\").Expression,\n\tts: typeof import(\"typescript\"),\n): parent is import(\"typescript\").Expression {\n\treturn (\n\t\t(ts.isParenthesizedExpression(parent) ||\n\t\t\tts.isAsExpression(parent) ||\n\t\t\tts.isSatisfiesExpression(parent) ||\n\t\t\tts.isTypeAssertionExpression(parent) ||\n\t\t\tts.isNonNullExpression(parent)) &&\n\t\tparent.expression === expression\n\t);\n}\n\nfunction declares_top_level_value_binding(\n\tstatement: import(\"typescript\").Statement,\n\tname: string,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isImportDeclaration(statement)) {\n\t\tconst import_clause = statement.importClause;\n\n\t\tif (!import_clause || import_clause.isTypeOnly) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (import_clause.name?.text === name) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst bindings = import_clause.namedBindings;\n\n\t\tif (bindings && ts.isNamespaceImport(bindings)) {\n\t\t\treturn bindings.name.text === name;\n\t\t}\n\n\t\treturn (\n\t\t\tbindings?.elements.some(\n\t\t\t\t(element) => !element.isTypeOnly && element.name.text === name,\n\t\t\t) === true\n\t\t);\n\t}\n\n\tif (ts.isVariableStatement(statement)) {\n\t\treturn statement.declarationList.declarations.some((declaration) =>\n\t\t\tbinding_name_contains(declaration.name, name, ts),\n\t\t);\n\t}\n\n\tif (\n\t\tts.isFunctionDeclaration(statement) ||\n\t\tts.isClassDeclaration(statement) ||\n\t\tts.isEnumDeclaration(statement) ||\n\t\tts.isModuleDeclaration(statement)\n\t) {\n\t\treturn statement.name?.getText() === name;\n\t}\n\n\treturn ts.isImportEqualsDeclaration(statement) && statement.name.text === name;\n}\n\nfunction binding_name_contains(\n\tbinding: import(\"typescript\").BindingName,\n\tname: string,\n\tts: typeof import(\"typescript\"),\n): boolean {\n\tif (ts.isIdentifier(binding)) {\n\t\treturn binding.text === name;\n\t}\n\n\treturn binding.elements.some(\n\t\t(element) =>\n\t\t\t!ts.isOmittedExpression(element) && binding_name_contains(element.name, name, ts),\n\t);\n}\n\nfunction get_server_import_replacement(specifier: string): string | undefined {\n\tif (specifier === \"svelte-effect-runtime\") {\n\t\treturn \"svelte-effect-runtime/server\";\n\t}\n\n\tif (specifier === \"svelte-effect-runtime/internal/generators\") {\n\t\treturn \"svelte-effect-runtime/server\";\n\t}\n\n\treturn undefined;\n}\n\nfunction get_script_kind(filename: string, ts: typeof import(\"typescript\")) {\n\tconst normalized_filename = filename.toLowerCase();\n\n\tif (has_file_extension(normalized_filename, [\".tsx\"])) {\n\t\treturn ts.ScriptKind.TSX;\n\t}\n\n\tif (has_file_extension(normalized_filename, [\".jsx\"])) {\n\t\treturn ts.ScriptKind.JSX;\n\t}\n\n\tif (has_file_extension(normalized_filename, [\".js\", \".mjs\", \".cjs\"])) {\n\t\treturn ts.ScriptKind.JS;\n\t}\n\n\treturn ts.ScriptKind.TS;\n}\n\nfunction has_file_extension(filename: string, extensions: readonly string[]): boolean {\n\treturn extensions.some((extension) => filename.endsWith(extension));\n}\n\nfunction make_remote_client_wrapper_plugin(options?: EffectOptions): Plugin {\n\tlet has_remote_form_module = false;\n\tlet has_sveltekit_remote_bridge = false;\n\n\treturn {\n\t\tname: \"svelte-effect-runtime:remote-client\",\n\t\tenforce: \"post\",\n\n\t\tbuildStart() {\n\t\t\thas_remote_form_module = false;\n\t\t\thas_sveltekit_remote_bridge = false;\n\t\t},\n\n\t\tbuildEnd(error) {\n\t\t\tif (error || !has_remote_form_module || has_sveltekit_remote_bridge) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.error(make_missing_sveltekit_remote_runtime_message());\n\t\t},\n\n\t\tconfig() {\n\t\t\treturn { ssr: { noExternal: [\"svelte-effect-runtime\"] } };\n\t\t},\n\n\t\tconfigResolved(config) {\n\t\t\tconst no_external = config.ssr.noExternal;\n\t\t\tconst runtime_package = \"svelte-effect-runtime\";\n\n\t\t\tif (no_external === true) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (Array.isArray(no_external)) {\n\t\t\t\tconst has_runtime_package = no_external.some((entry) => entry === runtime_package);\n\n\t\t\t\tif (!has_runtime_package) {\n\t\t\t\t\tno_external.push(runtime_package);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.ssr.noExternal = [no_external, runtime_package].filter(\n\t\t\t\t(value): value is string | RegExp => value !== undefined,\n\t\t\t);\n\t\t},\n\n\t\tasync transform(code: string, id: string) {\n\t\t\tif (is_sveltekit_remote_runtime_index(id)) {\n\t\t\t\tconst rewritten = append_sveltekit_remote_transport_bridge(code);\n\n\t\t\t\thas_sveltekit_remote_bridge = true;\n\n\t\t\t\tif (rewritten === code) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\n\t\t\t\treturn { code: rewritten, map: null };\n\t\t\t}\n\n\t\t\tif (!is_remote_module(id) || !code.includes(\"__sveltekit/remote\")) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst has_remote_form = /\\.[\\s\\n]*form[\\s\\n]*\\(/.test(code);\n\n\t\t\thas_remote_form_module ||= has_remote_form;\n\n\t\t\tif (has_remote_form) {\n\t\t\t\tconst resolved_runtime = await this.resolve(\"__sveltekit/remote\", id);\n\n\t\t\t\tif (!resolved_runtime || !is_sveltekit_remote_runtime_index(resolved_runtime.id)) {\n\t\t\t\t\tthis.error(make_missing_sveltekit_remote_runtime_message());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst rewritten = await rewrite_remote_client_exports(code, options);\n\n\t\t\tif (rewritten === code) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\treturn { code: rewritten, map: null };\n\t\t},\n\t};\n}\n\nfunction is_server_runtime_module(id: string): boolean {\n\tconst [filename] = id.split(\"?\", 2);\n\n\treturn (\n\t\t/\\.(server|remote)(?:\\.[cm])?\\.[jt]s$/.test(filename) ||\n\t\t/(?:^|[\\\\/])hooks\\.server(?:\\.[cm])?\\.[jt]s$/.test(filename)\n\t);\n}\n\nfunction is_remote_module(id: string): boolean {\n\treturn /\\.(remote|remote\\.[cm]?)\\.[jt]s(?:\\?.*)?$/.test(id) || id.includes(\".remote.\");\n}\n\nfunction is_svelte_component_module(id: string, extensions: readonly string[]): boolean {\n\tconst [filename, query = \"\"] = id.split(\"?\", 2);\n\n\tif (!extensions.some((extension) => filename.endsWith(extension))) {\n\t\treturn false;\n\t}\n\n\tif (query.length === 0) {\n\t\treturn true;\n\t}\n\n\tconst params = new URLSearchParams(query);\n\tconst allowed_params = [\"t\", \"v\"];\n\n\treturn [...params.keys()].every((key) => allowed_params.includes(key));\n}\n\nfunction may_have_effect_diagnostics(code: string): boolean {\n\treturn (\n\t\t/\\byield\\s*\\*/.test(code) ||\n\t\tcode.includes(\"Effect\") ||\n\t\t/[\"']effect(?:\\/Effect)?[\"']/.test(code)\n\t);\n}\n\nfunction may_have_ser_syntax(code: string): boolean {\n\treturn /\\byield\\s*\\*/.test(code) || /<script\\b[^>]*\\beffect(?:[\\s=>]|$)/i.test(code);\n}\n\n/**\n * Rewrites SvelteKit's generated client remote module from:\n *\n * `export const get_post = __remote.query(\"hash/get_post\")`\n *\n * into an Effect-aware wrapper around the same native function.\n *\n * @example\n * ```ts\n * const rewritten = await rewrite_remote_client_exports(remote_module_code);\n * ```\n *\n * @since 2.0.0\n * @param code - The generated client remote module code.\n * @param options - Optional plugin options.\n * @returns A promise that resolves to the rewritten module code.\n * @internal\n */\nexport async function rewrite_remote_client_exports(\n\tcode: string,\n\toptions?: EffectOptions,\n): Promise<string> {\n\tconst remote_client = await import(\"./compiler/remote-client.ts\");\n\n\treturn remote_client.rewrite_remote_client_exports(code, options);\n}\n"],"mappings":";AAAA,MAAM,kCACL;AAED,MAAM,oCAAoC;CACzC,CAAC,WAAW,qBAAqB;CACjC,CAAC,QAAQ,kBAAkB;CAC3B,CAAC,aAAa,uBAAuB;CACrC,CAAC,SAAS,kBAAkB;CAC5B,CAAC,eAAe,yBAAyB;CACzC,CAAC,cAAc,uBAAuB;AACvC;AAEA,MAAM,kCAAkC,CACvC,kFACA,6JACD;AAEA,MAAM,gCAAgC;CACrC;CACA;CACA;AACD;AAEA,SAAgB,kCAAkC,IAAqB;CACtE,MAAM,CAAC,YAAY,GAAG,MAAM,KAAK,CAAC;CAGlC,OAF4B,SAAS,WAAW,MAAM,GAE7B,CAAC,CAAC,SAAS,+BAA+B;AACpE;AAEA,SAA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AAM,8CAA8C,CAAC;GAE5D;GAEA,MAAM,YAAY,MAAM,8BAA8B,MAAM,OAAO;GAEnE,IAAI,cAAc,MACjB;GAGD,OAAO;IAAE,MAAM;IAAW,KAAK;GAAK;EACrC;CACD;AACD;AAEA,SAAS,yBAAyB,IAAqB;CACtD,MAAM,CAAC,YAAY,GAAG,MAAM,KAAK,CAAC;CAElC,OACC,uCAAuC,KAAK,QAAQ,KACpD,8CAA8C,KAAK,QAAQ;AAE7D;AAEA,SAAS,iBAAiB,IAAqB;CAC9C,OAAO,4CAA4C,KAAK,EAAE,KAAK,GAAG,SAAS,UAAU;AACtF;AAEA,SAAS,2BAA2B,IAAY,YAAwC;CACvF,MAAM,CAAC,UAAU,QAAQ,MAAM,GAAG,MAAM,KAAK,CAAC;CAE9C,IAAI,CAAC,WAAW,MAAM,cAAc,SAAS,SAAS,SAAS,CAAC,GAC/D,OAAO;CAGR,IAAI,MAAM,WAAW,GACpB,OAAO;CAGR,MAAM,SAAS,IAAI,gBAAgB,KAAK;CACxC,MAAM,iBAAiB,CAAC,KAAK,GAAG;CAEhC,OAAO,CAAC,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC,OAAO,QAAQ,eAAe,SAAS,GAAG,CAAC;AACtE;AAEA,SAAS,4BAA4B,MAAuB;CAC3D,OACC,eAAe,KAAK,IAAI,KACxB,KAAK,SAAS,QAAQ,KACtB,8BAA8B,KAAK,IAAI;AAEzC;AAEA,SAAS,oBAAoB,MAAuB;CACnD,OAAO,eAAe,KAAK,IAAI,KAAK,sCAAsC,KAAK,IAAI;AACpF;;;;;;;;;;;;;;;;;;;AAoBA,eAAsB,8BACrB,MACA,SACkB;CAGlB,QAAO,MAFqB,OAAO,+BAAA,CAEd,8BAA8B,MAAM,OAAO;AACjE"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { h as RemoteErrorDecodeError } from "./errors-CLsbGjIa.js";
|
|
2
|
+
import { create_remote_http_error, create_remote_transport_error, is_serialized_remote_failure_envelope } from "../remote/shared.js";
|
|
3
|
+
import { n as get_native_remote_live_resource } from "./live-BundLSoY.js";
|
|
4
|
+
import { Effect, Option, Result, Schema } from "effect";
|
|
5
|
+
import { isRedirect } from "@sveltejs/kit";
|
|
6
|
+
import { parse } from "devalue";
|
|
7
|
+
//#region src/remote/failures.ts
|
|
8
|
+
const RemoteErrorMessageEnvelopeSchema = Schema.Struct({ message: Schema.String });
|
|
9
|
+
const DecodedRemoteFailureSchema = Schema.Struct({ _tag: Schema.String });
|
|
10
|
+
const DecodeJsonString = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);
|
|
11
|
+
const is_decoded_remote_failure_value = Schema.is(DecodedRemoteFailureSchema);
|
|
12
|
+
const is_remote_error_message_envelope = Schema.is(RemoteErrorMessageEnvelopeSchema);
|
|
13
|
+
function decode_remote_error(raw, decode) {
|
|
14
|
+
const embedded = decode_embedded_remote_failure(raw);
|
|
15
|
+
if (embedded._tag === "EmbeddedRemoteFailureDecoded") return decode_remote_error(embedded.value, decode);
|
|
16
|
+
if (is_serialized_remote_failure_envelope(raw)) {
|
|
17
|
+
const decoded = decode_serialized_remote_failure(raw.encoded, decode);
|
|
18
|
+
if (decoded._tag === "SerializedRemoteFailureInvalid") return create_remote_transport_error(new RemoteErrorDecodeError(raw), raw);
|
|
19
|
+
return decoded.value;
|
|
20
|
+
}
|
|
21
|
+
return raw;
|
|
22
|
+
}
|
|
23
|
+
function decode_embedded_remote_failure(raw) {
|
|
24
|
+
if (typeof raw === "string") return decode_embedded_json_remote_failure(raw);
|
|
25
|
+
if (!is_remote_error_message_envelope(raw)) return { _tag: "EmbeddedRemoteFailureIgnored" };
|
|
26
|
+
return decode_embedded_json_remote_failure(raw.message);
|
|
27
|
+
}
|
|
28
|
+
function decode_embedded_json_remote_failure(value) {
|
|
29
|
+
const decoded = decode_json_string(value);
|
|
30
|
+
if (decoded._tag === "JsonStringIgnored") return { _tag: "EmbeddedRemoteFailureIgnored" };
|
|
31
|
+
return {
|
|
32
|
+
_tag: "EmbeddedRemoteFailureDecoded",
|
|
33
|
+
value: decoded.value
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function decode_json_string(value) {
|
|
37
|
+
const decoded = DecodeJsonString(value);
|
|
38
|
+
if (!Option.isSome(decoded)) return { _tag: "JsonStringIgnored" };
|
|
39
|
+
return {
|
|
40
|
+
_tag: "JsonStringDecoded",
|
|
41
|
+
value: decoded.value
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function decode_serialized_remote_failure(encoded, decode) {
|
|
45
|
+
const decoded = Result.try(() => decode ? decode(encoded) : parse(encoded));
|
|
46
|
+
if (Result.isFailure(decoded)) return { _tag: "SerializedRemoteFailureInvalid" };
|
|
47
|
+
return {
|
|
48
|
+
_tag: "SerializedRemoteFailureDecoded",
|
|
49
|
+
value: decoded.success
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function is_decoded_remote_failure(value) {
|
|
53
|
+
return is_decoded_remote_failure_value(value);
|
|
54
|
+
}
|
|
55
|
+
function normalize_native_error(error) {
|
|
56
|
+
const body = get_error_body(error);
|
|
57
|
+
const decoded = decode_remote_error(body);
|
|
58
|
+
const status = get_error_status(error);
|
|
59
|
+
if (is_decoded_remote_failure(decoded)) return decoded;
|
|
60
|
+
if (status !== void 0) return create_remote_http_error(status, body, error);
|
|
61
|
+
return create_remote_transport_error(error);
|
|
62
|
+
}
|
|
63
|
+
function get_error_status(error) {
|
|
64
|
+
if (typeof error !== "object" || error === null) return;
|
|
65
|
+
const status = error.status;
|
|
66
|
+
return typeof status === "number" ? status : void 0;
|
|
67
|
+
}
|
|
68
|
+
function get_error_body(error) {
|
|
69
|
+
if (typeof error !== "object" || error === null) return;
|
|
70
|
+
if ("body" in error) return error.body;
|
|
71
|
+
if ("data" in error) return error.data;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/remote/effect.ts
|
|
75
|
+
const MakeEffectFromPromise = (run) => Effect.tryPromise({
|
|
76
|
+
try: run,
|
|
77
|
+
catch: normalize_remote_effect_error
|
|
78
|
+
});
|
|
79
|
+
const MakeEffectFromSync = (run) => Effect.try({
|
|
80
|
+
try: run,
|
|
81
|
+
catch: normalize_remote_effect_error
|
|
82
|
+
});
|
|
83
|
+
const FailWithRemoteError = (error) => Effect.gen(function* () {
|
|
84
|
+
if (isRedirect(error)) return yield* Effect.die(error);
|
|
85
|
+
return yield* Effect.fail(normalize_remote_effect_error(error));
|
|
86
|
+
});
|
|
87
|
+
function normalize_remote_effect_error(error) {
|
|
88
|
+
if (isRedirect(error)) throw error;
|
|
89
|
+
if (is_decoded_remote_failure(error)) return error;
|
|
90
|
+
return normalize_native_error(error);
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/remote/resource.ts
|
|
94
|
+
function is_remote_resource(resource) {
|
|
95
|
+
const resource_type = typeof resource;
|
|
96
|
+
return resource_type === "object" && resource !== null || resource_type === "function";
|
|
97
|
+
}
|
|
98
|
+
function attach_remote_resource_getters(resource, effect) {
|
|
99
|
+
const methods = is_remote_resource(resource) ? resource : void 0;
|
|
100
|
+
const keys = [
|
|
101
|
+
"current",
|
|
102
|
+
"error",
|
|
103
|
+
"loading",
|
|
104
|
+
"ready"
|
|
105
|
+
];
|
|
106
|
+
if (!methods) return;
|
|
107
|
+
for (const key of keys) {
|
|
108
|
+
if (!(key in methods)) continue;
|
|
109
|
+
Object.defineProperty(effect, key, {
|
|
110
|
+
configurable: true,
|
|
111
|
+
get: () => methods[key]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function attach_failed_remote_resource_getters(error, effect) {
|
|
116
|
+
const normalized_error = normalize_remote_resource_error(error);
|
|
117
|
+
Object.defineProperties(effect, {
|
|
118
|
+
current: {
|
|
119
|
+
configurable: true,
|
|
120
|
+
get: () => void 0
|
|
121
|
+
},
|
|
122
|
+
error: {
|
|
123
|
+
configurable: true,
|
|
124
|
+
get: () => normalized_error
|
|
125
|
+
},
|
|
126
|
+
loading: {
|
|
127
|
+
configurable: true,
|
|
128
|
+
get: () => false
|
|
129
|
+
},
|
|
130
|
+
ready: {
|
|
131
|
+
configurable: true,
|
|
132
|
+
get: () => false
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function attach_failed_remote_query_resource(error, effect) {
|
|
137
|
+
const normalized_error = normalize_remote_resource_error(error);
|
|
138
|
+
const RefreshFailedResource = () => FailWithRemoteError(error);
|
|
139
|
+
const throw_resource_error = () => {
|
|
140
|
+
throw normalized_error;
|
|
141
|
+
};
|
|
142
|
+
attach_failed_remote_resource_getters(normalized_error, effect);
|
|
143
|
+
Object.defineProperties(effect, {
|
|
144
|
+
refresh: {
|
|
145
|
+
configurable: true,
|
|
146
|
+
value: RefreshFailedResource
|
|
147
|
+
},
|
|
148
|
+
set: {
|
|
149
|
+
configurable: true,
|
|
150
|
+
value: throw_resource_error
|
|
151
|
+
},
|
|
152
|
+
withOverride: {
|
|
153
|
+
configurable: true,
|
|
154
|
+
value: throw_resource_error
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
function normalize_remote_resource_error(error) {
|
|
159
|
+
const normalized = Result.try(() => normalize_remote_effect_error(error));
|
|
160
|
+
return Result.isSuccess(normalized) ? normalized.success : error;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/internal/schema.ts
|
|
164
|
+
function is_standard_schema(value) {
|
|
165
|
+
return typeof value === "object" && value !== null && "~standard" in value;
|
|
166
|
+
}
|
|
167
|
+
function is_effect_schema(value) {
|
|
168
|
+
return Schema.isSchema(value);
|
|
169
|
+
}
|
|
170
|
+
function normalize_validator(value) {
|
|
171
|
+
if (is_standard_schema(value) || !is_effect_schema(value)) return value;
|
|
172
|
+
return Schema.toStandardSchemaV1(value);
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/remote/query-update.ts
|
|
176
|
+
const native_remote_query_update = Symbol.for("svelte-effect-runtime/native-remote-query-update");
|
|
177
|
+
function attach_native_remote_query_update(target, native_update) {
|
|
178
|
+
if (!is_reference(target)) return;
|
|
179
|
+
Object.defineProperty(target, native_remote_query_update, {
|
|
180
|
+
configurable: true,
|
|
181
|
+
value: native_update
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function resolve_native_remote_query_updates(updates) {
|
|
185
|
+
return updates.map(resolve_native_remote_query_update);
|
|
186
|
+
}
|
|
187
|
+
function resolve_native_remote_query_update(update) {
|
|
188
|
+
if (!is_reference(update)) return update;
|
|
189
|
+
const attached_update = update[native_remote_query_update];
|
|
190
|
+
const live_resource = get_native_remote_live_resource(update);
|
|
191
|
+
return attached_update ?? live_resource ?? update;
|
|
192
|
+
}
|
|
193
|
+
function is_reference(value) {
|
|
194
|
+
return typeof value === "object" && value !== null || typeof value === "function";
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/internal/descriptors.ts
|
|
198
|
+
const default_excluded_descriptor_keys = /* @__PURE__ */ new Set([
|
|
199
|
+
"length",
|
|
200
|
+
"name",
|
|
201
|
+
"prototype"
|
|
202
|
+
]);
|
|
203
|
+
function copy_property_descriptors(source, target, exclude = default_excluded_descriptor_keys) {
|
|
204
|
+
if (typeof source !== "object" && typeof source !== "function") return;
|
|
205
|
+
if (source === null) return;
|
|
206
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
207
|
+
if (default_excluded_descriptor_keys.has(key) || exclude.has(key)) continue;
|
|
208
|
+
const descriptor = Object.getOwnPropertyDescriptor(source, key);
|
|
209
|
+
if (!descriptor) continue;
|
|
210
|
+
Object.defineProperty(target, key, descriptor);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
//#endregion
|
|
214
|
+
export { normalize_validator as a, attach_remote_resource_getters as c, MakeEffectFromPromise as d, MakeEffectFromSync as f, normalize_native_error as h, is_standard_schema as i, is_remote_resource as l, is_decoded_remote_failure as m, attach_native_remote_query_update as n, attach_failed_remote_query_resource as o, decode_remote_error as p, resolve_native_remote_query_updates as r, attach_failed_remote_resource_getters as s, copy_property_descriptors as t, FailWithRemoteError as u };
|
|
215
|
+
|
|
216
|
+
//# sourceMappingURL=descriptors-B4otDlm1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptors-B4otDlm1.js","names":["carrier"],"sources":["../../../modules/svelte-effect-runtime/src/remote/failures.ts","../../../modules/svelte-effect-runtime/src/remote/effect.ts","../../../modules/svelte-effect-runtime/src/remote/resource.ts","../../../modules/svelte-effect-runtime/src/internal/schema.ts","../../../modules/svelte-effect-runtime/src/remote/query-update.ts","../../../modules/svelte-effect-runtime/src/internal/descriptors.ts"],"sourcesContent":["import {\n\tcreate_remote_http_error,\n\tcreate_remote_transport_error,\n\tis_serialized_remote_failure_envelope,\n} from \"$/remote/shared.ts\";\nimport type { RemoteFailure } from \"$/remote/shared.ts\";\nimport { RemoteErrorDecodeError } from \"$/errors.ts\";\nimport { Option, Result, Schema } from \"effect\";\nimport { parse } from \"devalue\";\n\ntype JsonStringDecode =\n\t| {\n\t\t\treadonly _tag: \"JsonStringDecoded\";\n\t\t\treadonly value: unknown;\n\t }\n\t| {\n\t\t\treadonly _tag: \"JsonStringIgnored\";\n\t };\n\ntype EmbeddedRemoteFailureDecode =\n\t| {\n\t\t\treadonly _tag: \"EmbeddedRemoteFailureDecoded\";\n\t\t\treadonly value: unknown;\n\t }\n\t| {\n\t\t\treadonly _tag: \"EmbeddedRemoteFailureIgnored\";\n\t };\n\ntype SerializedRemoteFailureDecode<ErrorType> =\n\t| {\n\t\t\treadonly _tag: \"SerializedRemoteFailureDecoded\";\n\t\t\treadonly value: RemoteFailure<ErrorType>;\n\t }\n\t| {\n\t\t\treadonly _tag: \"SerializedRemoteFailureInvalid\";\n\t };\n\nconst RemoteErrorMessageEnvelopeSchema = Schema.Struct({\n\tmessage: Schema.String,\n});\n\nconst DecodedRemoteFailureSchema = Schema.Struct({\n\t_tag: Schema.String,\n});\n\nconst DecodeJsonString = Schema.decodeUnknownOption(Schema.UnknownFromJsonString);\nconst is_decoded_remote_failure_value = Schema.is(DecodedRemoteFailureSchema);\nconst is_remote_error_message_envelope = Schema.is(RemoteErrorMessageEnvelopeSchema);\n\nexport function decode_remote_error<ErrorType = never>(\n\traw: unknown,\n\tdecode?: (encoded: string) => unknown,\n): RemoteFailure<ErrorType> | unknown {\n\tconst embedded = decode_embedded_remote_failure(raw);\n\n\tif (embedded._tag === \"EmbeddedRemoteFailureDecoded\") {\n\t\treturn decode_remote_error<ErrorType>(embedded.value, decode);\n\t}\n\n\tif (is_serialized_remote_failure_envelope(raw)) {\n\t\tconst decoded = decode_serialized_remote_failure<ErrorType>(raw.encoded, decode);\n\n\t\tif (decoded._tag === \"SerializedRemoteFailureInvalid\") {\n\t\t\treturn create_remote_transport_error(new RemoteErrorDecodeError(raw), raw);\n\t\t}\n\n\t\treturn decoded.value;\n\t}\n\n\treturn raw;\n}\n\nfunction decode_embedded_remote_failure(raw: unknown): EmbeddedRemoteFailureDecode {\n\tif (typeof raw === \"string\") {\n\t\treturn decode_embedded_json_remote_failure(raw);\n\t}\n\n\tif (!is_remote_error_message_envelope(raw)) {\n\t\treturn { _tag: \"EmbeddedRemoteFailureIgnored\" };\n\t}\n\n\treturn decode_embedded_json_remote_failure(raw.message);\n}\n\nfunction decode_embedded_json_remote_failure(value: string): EmbeddedRemoteFailureDecode {\n\tconst decoded = decode_json_string(value);\n\n\tif (decoded._tag === \"JsonStringIgnored\") {\n\t\treturn { _tag: \"EmbeddedRemoteFailureIgnored\" };\n\t}\n\n\treturn {\n\t\t_tag: \"EmbeddedRemoteFailureDecoded\",\n\t\tvalue: decoded.value,\n\t};\n}\n\nfunction decode_json_string(value: string): JsonStringDecode {\n\tconst decoded = DecodeJsonString(value);\n\n\tif (!Option.isSome(decoded)) {\n\t\treturn { _tag: \"JsonStringIgnored\" };\n\t}\n\n\treturn {\n\t\t_tag: \"JsonStringDecoded\",\n\t\tvalue: decoded.value,\n\t};\n}\n\nfunction decode_serialized_remote_failure<ErrorType>(\n\tencoded: string,\n\tdecode: ((encoded: string) => unknown) | undefined,\n): SerializedRemoteFailureDecode<ErrorType> {\n\tconst decoded = Result.try(() => (decode ? decode(encoded) : parse(encoded)));\n\n\tif (Result.isFailure(decoded)) {\n\t\treturn { _tag: \"SerializedRemoteFailureInvalid\" };\n\t}\n\n\treturn {\n\t\t_tag: \"SerializedRemoteFailureDecoded\",\n\t\tvalue: decoded.success as RemoteFailure<ErrorType>,\n\t};\n}\n\nexport function is_decoded_remote_failure(value: unknown): value is RemoteFailure<never> {\n\treturn is_decoded_remote_failure_value(value);\n}\n\nexport function normalize_native_error<ErrorType = never>(\n\terror: unknown,\n): RemoteFailure<ErrorType> {\n\tconst body = get_error_body(error);\n\tconst decoded = decode_remote_error<ErrorType>(body);\n\tconst status = get_error_status(error);\n\n\tif (is_decoded_remote_failure(decoded)) {\n\t\treturn decoded;\n\t}\n\n\tif (status !== undefined) {\n\t\treturn create_remote_http_error(status, body, error);\n\t}\n\n\treturn create_remote_transport_error(error);\n}\n\nfunction get_error_status(error: unknown): number | undefined {\n\tif (typeof error !== \"object\" || error === null) {\n\t\treturn undefined;\n\t}\n\n\tconst status = (error as { status?: unknown }).status;\n\n\treturn typeof status === \"number\" ? status : undefined;\n}\n\nfunction get_error_body(error: unknown): unknown {\n\tif (typeof error !== \"object\" || error === null) {\n\t\treturn undefined;\n\t}\n\n\tif (\"body\" in error) {\n\t\treturn (error as { body?: unknown }).body;\n\t}\n\n\tif (\"data\" in error) {\n\t\treturn (error as { data?: unknown }).data;\n\t}\n\n\treturn undefined;\n}\n","import { is_decoded_remote_failure, normalize_native_error } from \"./failures.ts\";\nimport type { RemoteFailure } from \"$/remote/shared.ts\";\nimport { isRedirect } from \"@sveltejs/kit\";\nimport { Effect } from \"effect\";\n\nexport const MakeEffectFromPromise = <Output, ErrorType = never>(\n\trun: (signal: AbortSignal) => PromiseLike<Output>,\n) =>\n\tEffect.tryPromise({\n\t\ttry: run,\n\t\tcatch: normalize_remote_effect_error<ErrorType>,\n\t});\n\nexport const MakeEffectFromSync = <Output, ErrorType = never>(run: () => Output) =>\n\tEffect.try({\n\t\ttry: run,\n\t\tcatch: normalize_remote_effect_error<ErrorType>,\n\t});\n\nexport const FailWithRemoteError = <ErrorType = never>(error: unknown) =>\n\tEffect.gen(function* () {\n\t\tif (isRedirect(error)) {\n\t\t\treturn yield* Effect.die(error);\n\t\t}\n\n\t\treturn yield* Effect.fail(normalize_remote_effect_error<ErrorType>(error));\n\t});\n\nexport function normalize_remote_effect_error<ErrorType>(error: unknown): RemoteFailure<ErrorType> {\n\tif (isRedirect(error)) {\n\t\tthrow error;\n\t}\n\n\tif (is_decoded_remote_failure(error)) {\n\t\treturn error;\n\t}\n\n\treturn normalize_native_error<ErrorType>(error);\n}\n","import { FailWithRemoteError, normalize_remote_effect_error } from \"./effect.ts\";\nimport type { RemoteFailure } from \"$/remote/shared.ts\";\nimport { Result, type Effect } from \"effect\";\n\nexport type RemoteResourceEffect<Output, ErrorType = never> = Effect.Effect<\n\tOutput,\n\tRemoteFailure<ErrorType>\n> & {\n\treadonly current: Output | undefined;\n\treadonly error: unknown;\n\treadonly loading: boolean;\n\treadonly ready: boolean;\n};\n\ntype RemoteQueryResourceEffect<Output, ErrorType = never> = RemoteResourceEffect<\n\tOutput,\n\tErrorType\n> & {\n\treadonly refresh: () => Effect.Effect<void, unknown, never>;\n\treadonly set: (value: Output) => void;\n\treadonly withOverride: (update: (current: Output) => Output) => unknown;\n};\n\nexport type NativeRemoteResource<Output> = {\n\treadonly current?: Output;\n\treadonly error?: unknown;\n\treadonly loading?: boolean;\n\treadonly ready?: boolean;\n};\n\nexport function is_remote_resource<Output>(\n\tresource: unknown,\n): resource is NativeRemoteResource<Output> {\n\tconst resource_type = typeof resource;\n\n\treturn (resource_type === \"object\" && resource !== null) || resource_type === \"function\";\n}\n\nexport function attach_remote_resource_getters<Output, ErrorType = never>(\n\tresource: unknown,\n\teffect: RemoteResourceEffect<Output, ErrorType>,\n): void {\n\tconst methods = is_remote_resource<Output>(resource) ? resource : undefined;\n\tconst keys = [\"current\", \"error\", \"loading\", \"ready\"] as const;\n\n\tif (!methods) {\n\t\treturn;\n\t}\n\n\tfor (const key of keys) {\n\t\tif (!(key in methods)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tObject.defineProperty(effect, key, {\n\t\t\tconfigurable: true,\n\t\t\tget: () => methods[key],\n\t\t});\n\t}\n}\n\nexport function attach_failed_remote_resource_getters<Output, ErrorType = never>(\n\terror: unknown,\n\teffect: RemoteResourceEffect<Output, ErrorType>,\n): void {\n\tconst normalized_error = normalize_remote_resource_error<ErrorType>(error);\n\n\tObject.defineProperties(effect, {\n\t\tcurrent: {\n\t\t\tconfigurable: true,\n\t\t\tget: () => undefined,\n\t\t},\n\t\terror: {\n\t\t\tconfigurable: true,\n\t\t\tget: () => normalized_error,\n\t\t},\n\t\tloading: {\n\t\t\tconfigurable: true,\n\t\t\tget: () => false,\n\t\t},\n\t\tready: {\n\t\t\tconfigurable: true,\n\t\t\tget: () => false,\n\t\t},\n\t});\n}\n\nexport function attach_failed_remote_query_resource<Output, ErrorType = never>(\n\terror: unknown,\n\teffect: RemoteQueryResourceEffect<Output, ErrorType>,\n): void {\n\tconst normalized_error = normalize_remote_resource_error<ErrorType>(error);\n\tconst RefreshFailedResource = () => FailWithRemoteError<ErrorType>(error);\n\tconst throw_resource_error = (): never => {\n\t\tthrow normalized_error;\n\t};\n\n\tattach_failed_remote_resource_getters(normalized_error, effect);\n\n\tObject.defineProperties(effect, {\n\t\trefresh: {\n\t\t\tconfigurable: true,\n\t\t\tvalue: RefreshFailedResource,\n\t\t},\n\t\tset: {\n\t\t\tconfigurable: true,\n\t\t\tvalue: throw_resource_error,\n\t\t},\n\t\twithOverride: {\n\t\t\tconfigurable: true,\n\t\t\tvalue: throw_resource_error,\n\t\t},\n\t});\n}\n\nexport function normalize_remote_resource_error<ErrorType>(error: unknown): unknown {\n\tconst normalized = Result.try(() => normalize_remote_effect_error<ErrorType>(error));\n\n\treturn Result.isSuccess(normalized) ? normalized.success : error;\n}\n","import { Schema } from \"effect\";\n\nexport type StandardSchema = {\n\treadonly \"~standard\": {\n\t\treadonly types?: {\n\t\t\treadonly input: unknown;\n\t\t\treadonly output: unknown;\n\t\t};\n\t\treadonly validate: (input: unknown) => unknown;\n\t};\n};\n\nexport function is_standard_schema(value: unknown): value is StandardSchema {\n\treturn typeof value === \"object\" && value !== null && \"~standard\" in value;\n}\n\nexport function is_effect_schema(value: unknown): value is Schema.Schema<unknown> {\n\treturn Schema.isSchema(value);\n}\n\nexport function normalize_validator(value: unknown): unknown {\n\tif (is_standard_schema(value) || !is_effect_schema(value)) {\n\t\treturn value;\n\t}\n\n\treturn Schema.toStandardSchemaV1(value as never);\n}\n","import { get_native_remote_live_resource } from \"$/live.ts\";\n\nconst native_remote_query_update: unique symbol = Symbol.for(\n\t\"svelte-effect-runtime/native-remote-query-update\",\n) as never;\n\ntype NativeRemoteQueryUpdateCarrier = {\n\treadonly [native_remote_query_update]?: unknown;\n};\n\nexport function attach_native_remote_query_update(target: unknown, native_update: unknown): void {\n\tif (!is_reference(target)) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(target, native_remote_query_update, {\n\t\tconfigurable: true,\n\t\tvalue: native_update,\n\t});\n}\n\nexport function resolve_native_remote_query_updates(updates: readonly unknown[]): unknown[] {\n\treturn updates.map(resolve_native_remote_query_update);\n}\n\nfunction resolve_native_remote_query_update(update: unknown): unknown {\n\tif (!is_reference(update)) {\n\t\treturn update;\n\t}\n\n\tconst carrier = update as NativeRemoteQueryUpdateCarrier;\n\tconst attached_update = carrier[native_remote_query_update];\n\tconst live_resource = get_native_remote_live_resource(update);\n\n\treturn attached_update ?? live_resource ?? update;\n}\n\nfunction is_reference(value: unknown): value is object | ((...args: never[]) => unknown) {\n\treturn (typeof value === \"object\" && value !== null) || typeof value === \"function\";\n}\n","const default_excluded_descriptor_keys = new Set<PropertyKey>([\"length\", \"name\", \"prototype\"]);\n\nexport function copy_property_descriptors(\n\tsource: unknown,\n\ttarget: object,\n\texclude: ReadonlySet<PropertyKey> = default_excluded_descriptor_keys,\n): void {\n\tif (typeof source !== \"object\" && typeof source !== \"function\") {\n\t\treturn;\n\t}\n\n\tif (source === null) {\n\t\treturn;\n\t}\n\n\tfor (const key of Reflect.ownKeys(source)) {\n\t\tif (default_excluded_descriptor_keys.has(key) || exclude.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst descriptor = Object.getOwnPropertyDescriptor(source, key);\n\n\t\tif (!descriptor) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tObject.defineProperty(target, key, descriptor);\n\t}\n}\n"],"mappings":";;;;;;;AAqCA,MAAM,mCAAmC,OAAO,OAAO,EACtD,SAAS,OAAO,OACjB,CAAC;AAED,MAAM,6BAA6B,OAAO,OAAO,EAChD,MAAM,OAAO,OACd,CAAC;AAED,MAAM,mBAAmB,OAAO,oBAAoB,OAAO,qBAAqB;AAChF,MAAM,kCAAkC,OAAO,GAAG,0BAA0B;AAC5E,MAAM,mCAAmC,OAAO,GAAG,gCAAgC;AAEnF,SAAgB,oBACf,KACA,QACqC;CACrC,MAAM,WAAW,+BAA+B,GAAG;CAEnD,IAAI,SAAS,SAAS,gCACrB,OAAO,oBAA+B,SAAS,OAAO,MAAM;CAG7D,IAAI,sCAAsC,GAAG,GAAG;EAC/C,MAAM,UAAU,iCAA4C,IAAI,SAAS,MAAM;EAE/E,IAAI,QAAQ,SAAS,kCACpB,OAAO,8BAA8B,IAAI,uBAAuB,GAAG,GAAG,GAAG;EAG1E,OAAO,QAAQ;CAChB;CAEA,OAAO;AACR;AAEA,SAAS,+BAA+B,KAA2C;CAClF,IAAI,OAAO,QAAQ,UAClB,OAAO,oCAAoC,GAAG;CAG/C,IAAI,CAAC,iCAAiC,GAAG,GACxC,OAAO,EAAE,MAAM,+BAA+B;CAG/C,OAAO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