@reckona/mreact-router 0.0.68 → 0.0.70
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/client.d.ts.map +1 -1
- package/dist/client.js +17 -6
- package/dist/client.js.map +1 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +10 -2
- package/dist/vite.js.map +1 -1
- package/package.json +11 -11
- package/src/client.ts +18 -6
- package/src/vite.ts +11 -2
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,yBAAyB,EAE9B,KAAK,uBAAuB,EAG7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAO5C,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,MAAM,CAAC;AAIjD,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAA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S,6BAA6B,EAAE,CAAC;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;CACnD,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAoDvC;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA2iD3B;AAsJD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKlE;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKnE"}
|
package/dist/client.js
CHANGED
|
@@ -2494,12 +2494,17 @@ function workspaceRuntimePlugin(options) {
|
|
|
2494
2494
|
});
|
|
2495
2495
|
const reactiveCorePath = packageFile("reactive-core", "@reckona/mreact-reactive-core", "index");
|
|
2496
2496
|
const reactiveCoreDir = dirname(reactiveCorePath);
|
|
2497
|
+
const reactiveDomPath = packageFile("reactive-dom", "@reckona/mreact-reactive-dom", "index");
|
|
2498
|
+
const reactiveDomDir = dirname(reactiveDomPath);
|
|
2499
|
+
const reactCompatPath = packageFile("react-compat", "@reckona/mreact-compat", "index");
|
|
2500
|
+
const reactCompatDir = dirname(reactCompatPath);
|
|
2501
|
+
const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactCompatDir];
|
|
2497
2502
|
const runtimePaths = new Map([
|
|
2498
2503
|
[
|
|
2499
2504
|
"@reckona/mreact-reactive-core/internal",
|
|
2500
2505
|
packageFile("reactive-core", "@reckona/mreact-reactive-core", "internal"),
|
|
2501
2506
|
],
|
|
2502
|
-
["@reckona/mreact-compat",
|
|
2507
|
+
["@reckona/mreact-compat", reactCompatPath],
|
|
2503
2508
|
[
|
|
2504
2509
|
"@reckona/mreact-compat/event-priority",
|
|
2505
2510
|
packageFile("react-compat", "@reckona/mreact-compat", "event-priority"),
|
|
@@ -2526,7 +2531,7 @@ function workspaceRuntimePlugin(options) {
|
|
|
2526
2531
|
],
|
|
2527
2532
|
[
|
|
2528
2533
|
"@reckona/mreact-reactive-dom",
|
|
2529
|
-
|
|
2534
|
+
reactiveDomPath,
|
|
2530
2535
|
],
|
|
2531
2536
|
]);
|
|
2532
2537
|
return {
|
|
@@ -2535,10 +2540,16 @@ function workspaceRuntimePlugin(options) {
|
|
|
2535
2540
|
buildApi.onResolve({ filter: /^\.\/devtools\.js$/ }, (args) => args.importer?.startsWith(reactiveCoreDir) === true
|
|
2536
2541
|
? { namespace: "mreact-devtools-stub", path: "devtools" }
|
|
2537
2542
|
: undefined);
|
|
2538
|
-
buildApi.onResolve({ filter: /^@reckona\/mreact-reactive-core$/ }, () =>
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2543
|
+
buildApi.onResolve({ filter: /^@reckona\/mreact-reactive-core$/ }, (args) => {
|
|
2544
|
+
const importer = args.importer;
|
|
2545
|
+
return importer !== undefined &&
|
|
2546
|
+
runtimePackageDirs.some((directory) => importer.startsWith(`${directory}${sep}`))
|
|
2547
|
+
? { path: reactiveCorePath }
|
|
2548
|
+
: {
|
|
2549
|
+
namespace: "mreact-hot-runtime",
|
|
2550
|
+
path: "reactive-core",
|
|
2551
|
+
};
|
|
2552
|
+
});
|
|
2542
2553
|
buildApi.onResolve({
|
|
2543
2554
|
filter: /^@reckona\/mreact-(?:compat|reactive-core|reactive-dom)(?:\/(?:event-priority|flight|internal|jsx-dev-runtime|jsx-runtime|scheduler))?$/,
|
|
2544
2555
|
}, (args) => {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,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AK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport { builtinModules } from \"node:module\";\nimport { dirname, extname, join, relative, sep } from \"node:path\";\nimport {\n collectClientRouteModuleAnalysis,\n formatDiagnostic,\n type ComponentMetadata,\n type ClientRouteModuleAnalysis,\n type ClientRouteStaticImportReference,\n type ClientReferenceMetadata,\n type StaticImportReference,\n type TopLevelExportRenderInfo,\n} from \"@reckona/mreact-compiler\";\nimport {\n collectClientRouteModuleAnalysisFromContext,\n createCompilerModuleContext,\n stripTypeScriptWithOxc,\n transformCompilerModuleContext,\n type CompilerModuleContext,\n} from \"@reckona/mreact-compiler/internal\";\nimport { assetPath } from \"./assets.js\";\nimport {\n bundleRouterModule,\n bundleRouterModules,\n type RouterCompatBuildApi,\n type RouterBundleAssetOutput,\n type RouterBundleChunkOutput,\n} from \"./bundle-pipeline.js\";\nimport type { AppRoute } from \"./routes.js\";\nimport { existingRouteShellCandidates } from \"./route-shells.js\";\nimport { stripRouteClientOnlyExports } from \"./route-source.js\";\nimport { hasJsxSyntax } from \"./source-jsx.js\";\nimport { sourceModuleCandidates } from \"./source-modules.js\";\nimport { escapeHtmlQuotedAttribute as escapeHtmlAttribute } from \"@reckona/mreact-shared/html-escape\";\nimport { workspacePackageFile } from \"./workspace-packages.js\";\nimport type { Plugin, PluginOption } from \"vite\";\n\nconst nodeBuiltinPackages = new Set(builtinModules.flatMap((name) => [name, `node:${name}`]));\n\nexport interface ClientRouteManifestEntry {\n bytes?: number;\n css?: readonly string[];\n path: string;\n kind: AppRoute[\"kind\"];\n client: boolean;\n devScript?: string;\n imports?: readonly string[];\n navigation?: boolean;\n navigationScript?: string;\n routeId?: string;\n script?: string;\n sourceMap?: string;\n}\n\nexport interface BuildClientRouteOutputOptions {\n code: string;\n clientBoundaryImports?: readonly string[] | undefined;\n clientReferenceImports?: readonly ClientReferenceImport[] | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n filename: string;\n minify?: boolean | undefined;\n routePath: string;\n sourceMap?: boolean | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n clientNavigation?: boolean | undefined;\n}\n\nexport interface BuildClientRouteBatchOutput {\n assets?: RouterBundleAssetOutput[] | undefined;\n chunks: readonly RouterBundleChunkOutput[];\n routes: readonly BuildClientRouteBatchRouteOutput[];\n}\n\nexport interface BuildClientRouteBatchRouteOutput {\n chunk: RouterBundleChunkOutput;\n routeId: string;\n routePath: string;\n}\n\nexport interface ClientRouteInferenceCache {\n moduleAnalysisByFile: Map<string, Promise<ClientRouteModuleAnalysis>>;\n moduleContextByFile: Map<string, Promise<CompilerModuleContext>>;\n resolvedByImport: Map<string, Promise<string | undefined>>;\n sourceByFile: Map<string, Promise<CachedClientRouteSource>>;\n transformedSourceByFile: Map<string, Promise<CachedClientRouteSource>>;\n}\n\ninterface CachedClientRouteSource {\n signature: string;\n source: string;\n}\n\ninterface ClientRouteSourceTransform {\n cacheKey: string;\n transform(filename: string, code: string): Promise<string>;\n}\n\nexport interface ClientRouteInferenceResult {\n client: boolean;\n clientBoundaryImports: string[];\n diagnostics: ClientRouteInferenceDiagnostic[];\n}\n\ninterface ClientRouteModuleInferenceResult extends ClientRouteInferenceResult {\n clientBoundaryExportNames: string[];\n clientBoundaryModule: boolean;\n nestedClientExportNames: string[];\n clientReferenceSourceFiles: string[];\n serverOnly: boolean;\n serverOnlyClientRuntime: boolean;\n}\n\nexport interface ClientReferenceImport {\n exportName: string;\n importSource: string;\n name: string;\n}\n\nexport interface ClientRouteReferenceResult extends ClientRouteInferenceResult {\n clientReferenceImports: ClientReferenceImport[];\n clientReferenceManifest: ClientReferenceMetadata[];\n}\n\nexport interface ClientRouteInferenceDiagnostic {\n code:\n | typeof clientBoundaryInferenceServerOnlyReferenceCode\n | typeof clientBoundaryInferenceUnsupportedReferenceCode;\n filename: string;\n level: \"warn\";\n localNames: string[];\n message: string;\n source: string;\n}\n\nconst clientBoundaryInferenceServerOnlyReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_SERVER_ONLY_REFERENCE\";\nconst clientBoundaryInferenceUnsupportedReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_UNSUPPORTED_REFERENCE\";\n\nexport async function routeToClientManifestEntry(\n route: AppRoute,\n): Promise<ClientRouteManifestEntry> {\n if (route.kind !== \"page\") {\n return { path: route.path, kind: route.kind, client: false };\n }\n\n const code = await readFile(route.file, \"utf8\");\n const inference = await inferClientRouteModule({\n code: stripRouteClientOnlyExports(code),\n filename: route.file,\n routePath: route.path,\n });\n\n return inference.client\n ? {\n path: route.path,\n kind: route.kind,\n client: true,\n routeId: routeIdForPath(route.path),\n script: clientScriptForPath(route.path),\n }\n : { path: route.path, kind: route.kind, client: false };\n}\n\nexport function createClientRouteInferenceCache(): ClientRouteInferenceCache {\n return {\n moduleAnalysisByFile: new Map(),\n moduleContextByFile: new Map(),\n resolvedByImport: new Map(),\n sourceByFile: new Map(),\n transformedSourceByFile: new Map(),\n };\n}\n\nexport async function isClientRouteModule(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n routePath?: string | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<boolean> {\n return (await inferClientRouteModule(options)).client;\n}\n\nexport async function inferClientRouteModule(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n moduleContext?: CompilerModuleContext | undefined;\n routePath?: string | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<ClientRouteInferenceResult> {\n const cache = options.cache ?? createClientRouteInferenceCache();\n const sourceTransform = clientRouteSourceTransformForVitePlugins(options.vitePlugins);\n const code = await transformClientRouteSource({\n code: options.code,\n filename: options.filename,\n sourceTransform,\n });\n\n try {\n const routeInference = await inferClientRouteModuleSource({\n cache,\n code,\n filename: options.filename,\n ...(sourceTransform === undefined ? { moduleContext: options.moduleContext } : {}),\n root: true,\n seen: new Set(),\n sourceTransform,\n });\n\n if (options.appDir === undefined) {\n return routeInference;\n }\n\n const shellInferences = await inferClientRouteShellModules({\n appDir: options.appDir,\n cache,\n filename: options.filename,\n sourceTransform,\n });\n\n return {\n client: routeInference.client || shellInferences.some((inference) => inference.client),\n clientBoundaryImports: routeInference.clientBoundaryImports,\n diagnostics: [\n ...routeInference.diagnostics,\n ...shellInferences.flatMap((inference) => inference.diagnostics),\n ],\n };\n } catch (error) {\n throw new Error(\n `Failed to infer client route for ${options.routePath ?? \"<unknown>\"} (${options.filename}).\\n${errorMessage(error)}`,\n { cause: error },\n );\n }\n}\n\nexport async function collectClientRouteReferences(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<ClientRouteReferenceResult> {\n const cache = options.cache ?? createClientRouteInferenceCache();\n const sourceTransform = clientRouteSourceTransformForVitePlugins(options.vitePlugins);\n const code = await transformClientRouteSource({\n code: options.code,\n filename: options.filename,\n sourceTransform,\n });\n const routeModuleContext = await compilerModuleContextForSource({\n cache,\n code,\n filename: options.filename,\n });\n const routeInference = await inferClientRouteModuleSource({\n cache,\n code,\n filename: options.filename,\n moduleContext: routeModuleContext,\n root: true,\n seen: new Set(),\n sourceTransform,\n });\n const sources: Array<{\n code: string;\n filename: string;\n inference: ClientRouteModuleInferenceResult;\n moduleContext: CompilerModuleContext;\n }> = [];\n const seenSourceFiles = new Set<string>();\n const addSource = async (sourceOptions: {\n code: string;\n filename: string;\n inference?: ClientRouteModuleInferenceResult | undefined;\n moduleContext?: CompilerModuleContext | undefined;\n }) => {\n if (seenSourceFiles.has(sourceOptions.filename)) {\n return;\n }\n\n seenSourceFiles.add(sourceOptions.filename);\n const moduleContext =\n sourceOptions.moduleContext ??\n (await compilerModuleContextForSource({\n cache,\n code: sourceOptions.code,\n filename: sourceOptions.filename,\n }));\n const inference =\n sourceOptions.inference ??\n (await inferClientRouteModuleSource({\n cache,\n code: sourceOptions.code,\n filename: sourceOptions.filename,\n moduleContext,\n root: true,\n seen: new Set(),\n sourceTransform,\n }));\n sources.push({\n code: sourceOptions.code,\n filename: sourceOptions.filename,\n inference,\n moduleContext,\n });\n\n for (const referenceFile of inference.clientReferenceSourceFiles) {\n const code = stripRouteClientOnlyExports(\n await readClientRouteSource({ cache, filename: referenceFile, sourceTransform }),\n );\n await addSource({ code, filename: referenceFile });\n }\n };\n\n await addSource({\n code,\n filename: options.filename,\n inference: routeInference,\n moduleContext: routeModuleContext,\n });\n\n if (options.appDir !== undefined) {\n for (const shell of await clientShellFilesForPage(options.appDir, options.filename)) {\n const code = stripRouteClientOnlyExports(\n await readClientRouteSource({ cache, filename: shell, sourceTransform }),\n );\n const moduleContext = await compilerModuleContextForSource({\n cache,\n code,\n filename: shell,\n });\n await addSource({\n code,\n filename: shell,\n inference: await inferClientRouteModuleSource({\n cache,\n code,\n filename: shell,\n moduleContext,\n root: true,\n seen: new Set(),\n sourceTransform,\n }),\n moduleContext,\n });\n }\n }\n\n const clientReferenceManifest: ClientReferenceMetadata[] = [];\n const clientReferenceImports: ClientReferenceImport[] = [];\n const seenReferences = new Set<string>();\n\n for (const source of sources) {\n const output = transformCompilerModuleContext({\n code: source.code,\n clientBoundaryImports: source.inference.clientBoundaryImports,\n dev: false,\n filename: source.filename,\n moduleContext: source.moduleContext,\n target: \"server\",\n });\n const fatalDiagnostics = output.diagnostics.filter(\n (diagnostic) =>\n diagnostic.code !== \"MR_UNSUPPORTED_SERVER_EVENT_HANDLER\" &&\n diagnostic.code !== \"MR_UNSUPPORTED_AWAIT_INNER_COMPONENT\",\n );\n\n if (fatalDiagnostics.length > 0) {\n throw new Error(\n fatalDiagnostics\n .map((diagnostic) => formatDiagnostic(source.filename, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n for (const reference of output.metadata.clientReferenceManifest ?? []) {\n const key = `${reference.name}\\0${reference.moduleId}\\0${reference.exportName}`;\n\n if (seenReferences.has(key)) {\n continue;\n }\n\n seenReferences.add(key);\n clientReferenceManifest.push(reference);\n clientReferenceImports.push({\n exportName: reference.exportName,\n importSource: clientReferenceImportSource({\n moduleId: reference.moduleId,\n routeFile: options.filename,\n sourceFile: source.filename,\n }),\n name: reference.name,\n });\n }\n }\n\n return {\n client:\n routeInference.client ||\n sources.some((source) => source.filename !== options.filename && source.inference.client),\n clientBoundaryImports: routeInference.clientBoundaryImports,\n clientReferenceImports,\n clientReferenceManifest,\n diagnostics: sources.flatMap((source) => source.inference.diagnostics),\n };\n}\n\nasync function inferClientRouteShellModules(options: {\n appDir: string;\n cache: ClientRouteInferenceCache;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<ClientRouteInferenceResult[]> {\n return Promise.all(\n (await clientShellFilesForPage(options.appDir, options.filename)).map(async (shell) => {\n const code = stripRouteClientOnlyExports(\n await readClientRouteSource({\n cache: options.cache,\n filename: shell,\n sourceTransform: options.sourceTransform,\n }),\n );\n return await inferClientRouteModuleSource({\n cache: options.cache,\n code,\n filename: shell,\n root: true,\n seen: new Set(),\n sourceTransform: options.sourceTransform,\n });\n }),\n );\n}\n\nasync function clientShellFilesForPage(appDir: string, pageFile: string): Promise<string[]> {\n const existing = await existingRouteShellCandidates(\n appDir,\n pageFile,\n async (file) => file !== pageFile && (await isFile(file)),\n );\n\n return existing.map((candidate) => candidate.file);\n}\n\nfunction clientReferenceImportSource(options: {\n moduleId: string;\n routeFile: string;\n sourceFile: string;\n}): string {\n if (!options.moduleId.startsWith(\".\")) {\n return options.moduleId;\n }\n\n const absolute = join(dirname(options.sourceFile), options.moduleId);\n const relativeImport = relative(dirname(options.routeFile), absolute).replaceAll(sep, \"/\");\n\n return relativeImport.startsWith(\".\") ? relativeImport : `./${relativeImport}`;\n}\n\nexport function isClientRouteSource(code: string): boolean {\n const analysis = collectClientRouteModuleAnalysis({ code });\n\n return (\n analysis.hasUseClientDirective || (!analysis.hasUseServerDirective && analysis.clientRuntime)\n );\n}\n\nfunction isExplicitClientRouteSource(\n analysis: ClientRouteModuleAnalysis,\n filename: string,\n): boolean {\n return analysis.hasUseClientDirective || isClientBoundaryFilename(filename);\n}\n\nfunction isClientBoundaryFilename(filename: string): boolean {\n return /\\.(?:client|compat)(?:\\.mreact)?\\.[cm]?[jt]sx?$/.test(filename);\n}\n\nfunction isServerOnlyClientRouteSource(analysis: ClientRouteModuleAnalysis): boolean {\n return analysis.hasUseServerDirective;\n}\n\nfunction isServerOnlyImportSource(source: string): boolean {\n return nodeBuiltinPackages.has(source);\n}\n\nfunction hasServerOnlyImports(analysis: ClientRouteModuleAnalysis): boolean {\n return analysis.staticImports.some((reference) => isServerOnlyImportSource(reference.source));\n}\n\nasync function inferClientRouteModuleSource(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n moduleContext?: CompilerModuleContext | undefined;\n root: boolean;\n seen: Set<string>;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<ClientRouteModuleInferenceResult> {\n const analysis = await clientRouteModuleAnalysisForSource(options);\n\n if (isServerOnlyClientRouteSource(analysis)) {\n return emptyClientRouteModuleInferenceResult({\n serverOnly: true,\n serverOnlyClientRuntime: analysis.clientRuntime,\n });\n }\n\n if (isExplicitClientRouteSource(analysis, options.filename)) {\n return emptyClientRouteModuleInferenceResult({\n client: true,\n clientBoundaryModule: true,\n });\n }\n\n if (options.seen.has(options.filename)) {\n return emptyClientRouteModuleInferenceResult();\n }\n\n options.seen.add(options.filename);\n\n try {\n const clientBoundaryImports: string[] = [];\n const clientBoundaryExportNames = new Set<string>();\n const nestedClientExportNames = new Set<string>();\n const clientReferenceSourceFiles: string[] = [];\n const diagnostics: ClientRouteInferenceDiagnostic[] = [];\n let clientProxy = false;\n let nestedClient = false;\n const exportInfo = analysis.topLevelExportRenderInfo;\n const implicitModuleClient = exportInfo.length === 0 && analysis.clientRuntime;\n for (const info of exportInfo) {\n if (info.clientRuntime) {\n clientBoundaryExportNames.add(info.name);\n }\n }\n if (\n hasServerOnlyImports(analysis) &&\n (implicitModuleClient || clientBoundaryExportNames.size > 0)\n ) {\n return emptyClientRouteModuleInferenceResult({\n serverOnly: true,\n serverOnlyClientRuntime: true,\n });\n }\n const jsxComponentRoots = new Set(analysis.jsxComponentRoots);\n const componentCallRoots = new Set(analysis.componentCallRoots);\n const renderedComponentRoots = unionSets(jsxComponentRoots, componentCallRoots);\n const identifierReferences = new Set(analysis.identifierReferences);\n\n for (const reference of analysis.staticImports) {\n const renderedByJsx = isRenderedImportReference(reference, jsxComponentRoots);\n const renderedByCall = isRenderedImportReference(reference, componentCallRoots);\n const rendered = isRenderedImportReference(reference, renderedComponentRoots);\n const referenced = isReferencedImportReference(reference, identifierReferences);\n\n if (\n !rendered &&\n (!referenced || !hasPotentialClientBoundaryReference(reference, identifierReferences))\n ) {\n continue;\n }\n if (reference.sideEffect && isStyleModuleSpecifier(reference.source)) {\n continue;\n }\n\n const resolved = await resolveAppLocalModule({\n allowExplicitNonSource: options.sourceTransform !== undefined,\n cache: options.cache,\n importer: options.filename,\n specifier: reference.source,\n });\n\n if (resolved === undefined) {\n continue;\n }\n\n const source = await readClientRouteSource({\n cache: options.cache,\n filename: resolved,\n sourceTransform: options.sourceTransform,\n });\n const imported = await inferClientRouteModuleSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n moduleContext: await compilerModuleContextForSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n }),\n root: false,\n seen: options.seen,\n sourceTransform: options.sourceTransform,\n });\n diagnostics.push(...imported.diagnostics);\n\n if (!imported.client) {\n if (imported.serverOnlyClientRuntime && rendered) {\n diagnostics.push(\n serverOnlyClientImportReferenceDiagnostic({\n filename: options.filename,\n reference,\n }),\n );\n }\n continue;\n }\n\n if (rendered) {\n const importedExportNames = renderedImportedExportNames(reference, renderedComponentRoots);\n const renderedExportNames = renderedLocalExportNames(reference, exportInfo);\n const importedBoundary =\n imported.clientBoundaryModule ||\n matchesInferredExportNames(importedExportNames, imported.clientBoundaryExportNames);\n const importedNested = matchesInferredExportNames(\n importedExportNames,\n imported.nestedClientExportNames,\n );\n if (!importedBoundary && !importedNested) {\n continue;\n }\n\n nestedClient = true;\n\n for (const exportName of renderedExportNames) {\n if (importedBoundary || importedNested || renderedByCall) {\n nestedClientExportNames.add(exportName);\n }\n }\n\n if (renderedByCall && !renderedByJsx) {\n continue;\n }\n\n if (!importedBoundary) {\n clientReferenceSourceFiles.push(resolved);\n continue;\n }\n\n clientBoundaryImports.push(reference.source);\n continue;\n }\n\n const diagnostic = unsupportedClientImportReferenceDiagnostic({\n filename: options.filename,\n identifierReferences,\n reference,\n });\n\n if (diagnostic !== undefined) {\n diagnostics.push(diagnostic);\n }\n }\n\n if (!options.root) {\n for (const reference of analysis.staticExports) {\n const resolved = await resolveAppLocalModule({\n allowExplicitNonSource: options.sourceTransform !== undefined,\n cache: options.cache,\n importer: options.filename,\n specifier: reference.source,\n });\n\n if (resolved === undefined) {\n continue;\n }\n\n const source = await readClientRouteSource({\n cache: options.cache,\n filename: resolved,\n sourceTransform: options.sourceTransform,\n });\n const exported = await inferClientRouteModuleSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n moduleContext: await compilerModuleContextForSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n }),\n root: false,\n seen: options.seen,\n sourceTransform: options.sourceTransform,\n });\n diagnostics.push(...exported.diagnostics);\n\n if (exported.clientBoundaryModule) {\n clientProxy = true;\n } else if (exported.clientBoundaryExportNames.length > 0) {\n for (const exportName of reference.exportedNames) {\n if (exported.clientBoundaryExportNames.includes(exportName)) {\n clientBoundaryExportNames.add(exportName);\n }\n }\n } else if (exported.client) {\n nestedClient = true;\n clientReferenceSourceFiles.push(resolved);\n }\n }\n }\n\n return {\n client:\n clientBoundaryImports.length > 0 ||\n clientBoundaryExportNames.size > 0 ||\n implicitModuleClient ||\n clientProxy ||\n nestedClient,\n clientBoundaryImports,\n clientBoundaryExportNames: Array.from(clientBoundaryExportNames),\n clientBoundaryModule: clientProxy || implicitModuleClient,\n nestedClientExportNames: Array.from(nestedClientExportNames),\n clientReferenceSourceFiles: Array.from(new Set(clientReferenceSourceFiles)),\n diagnostics,\n serverOnly: false,\n serverOnlyClientRuntime: false,\n };\n } finally {\n options.seen.delete(options.filename);\n }\n}\n\nfunction emptyClientRouteModuleInferenceResult(\n overrides: Partial<ClientRouteModuleInferenceResult> = {},\n): ClientRouteModuleInferenceResult {\n return {\n client: false,\n clientBoundaryImports: [],\n clientBoundaryExportNames: [],\n clientBoundaryModule: false,\n nestedClientExportNames: [],\n clientReferenceSourceFiles: [],\n diagnostics: [],\n serverOnly: false,\n serverOnlyClientRuntime: false,\n ...overrides,\n };\n}\n\nasync function clientRouteModuleAnalysisForSource(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n moduleContext?: CompilerModuleContext | undefined;\n}): Promise<ClientRouteModuleAnalysis> {\n const cacheKey = sourceAnalysisCacheKey(options.filename, options.code);\n const cached = options.cache.moduleAnalysisByFile.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const analysis = Promise.resolve().then(async () =>\n collectClientRouteModuleAnalysisFromContext(\n options.moduleContext ??\n (await compilerModuleContextForSource({\n cache: options.cache,\n code: options.code,\n filename: options.filename,\n })),\n ),\n );\n options.cache.moduleAnalysisByFile.set(cacheKey, analysis);\n return analysis;\n}\n\nexport async function compilerModuleContextForSource(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n}): Promise<CompilerModuleContext> {\n const cacheKey = sourceAnalysisCacheKey(options.filename, options.code);\n const cached = options.cache.moduleContextByFile.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const context = Promise.resolve().then(() =>\n createCompilerModuleContext({\n code: options.code,\n filename: options.filename,\n }),\n );\n options.cache.moduleContextByFile.set(cacheKey, context);\n return context;\n}\n\nfunction sourceAnalysisCacheKey(filename: string, code: string): string {\n return `${filename}\\0${hashSourceText(code)}`;\n}\n\nfunction hashSourceText(text: string): string {\n return createHash(\"sha256\").update(text).digest(\"hex\");\n}\n\nfunction isRenderedImportReference(\n reference: StaticImportReference,\n componentRoots: ReadonlySet<string>,\n): boolean {\n return (\n reference.sideEffect || reference.localNames.some((localName) => componentRoots.has(localName))\n );\n}\n\nfunction isReferencedImportReference(\n reference: StaticImportReference,\n identifierReferences: ReadonlySet<string>,\n): boolean {\n return (\n reference.sideEffect ||\n reference.localNames.some((localName) => identifierReferences.has(localName))\n );\n}\n\nfunction hasPotentialClientBoundaryReference(\n reference: ClientRouteStaticImportReference,\n identifierReferences: ReadonlySet<string>,\n): boolean {\n return (\n reference.sideEffect ||\n reference.specifiers.some(\n (specifier) =>\n specifier.kind === \"namespace\" && identifierReferences.has(specifier.localName),\n ) ||\n reference.localNames.some(\n (localName) => identifierReferences.has(localName) && startsUppercase(localName),\n )\n );\n}\n\nfunction isStyleModuleSpecifier(source: string): boolean {\n const pathname = source.split(/[?#]/u, 1)[0] ?? source;\n return styleModuleExtensions.has(extname(pathname));\n}\n\nconst styleModuleExtensions = new Set([\n \".css\",\n \".less\",\n \".sass\",\n \".scss\",\n \".styl\",\n \".stylus\",\n]);\n\nfunction renderedImportedExportNames(\n reference: ClientRouteStaticImportReference,\n componentRoots: ReadonlySet<string>,\n): string[] | undefined {\n if (reference.sideEffect) {\n return undefined;\n }\n\n const names = new Set<string>();\n\n for (const specifier of reference.specifiers) {\n if (!componentRoots.has(specifier.localName)) {\n continue;\n }\n\n if (specifier.kind === \"namespace\") {\n return undefined;\n }\n\n names.add(specifier.importedName);\n }\n\n return Array.from(names);\n}\n\nfunction renderedLocalExportNames(\n reference: StaticImportReference,\n exportInfo: readonly TopLevelExportRenderInfo[],\n): string[] {\n const localNames = new Set(reference.localNames);\n const rendered = exportInfo\n .filter((info) => renderedComponentRootNames(info).some((root) => localNames.has(root)))\n .map((info) => info.name);\n\n return rendered.length === 0 ? [\"default\"] : rendered;\n}\n\nfunction renderedComponentRootNames(info: TopLevelExportRenderInfo): string[] {\n return [...info.renderedComponentRoots, ...info.calledComponentRoots];\n}\n\nfunction unionSets<T>(left: ReadonlySet<T>, right: ReadonlySet<T>): ReadonlySet<T> {\n return new Set([...left, ...right]);\n}\n\nfunction matchesInferredExportNames(\n importedExportNames: readonly string[] | undefined,\n inferredExportNames: readonly string[],\n): boolean {\n if (importedExportNames === undefined) {\n return inferredExportNames.length > 0;\n }\n\n return importedExportNames.some((name) => inferredExportNames.includes(name));\n}\n\nfunction serverOnlyClientImportReferenceDiagnostic(options: {\n filename: string;\n reference: StaticImportReference;\n}): ClientRouteInferenceDiagnostic {\n return {\n code: clientBoundaryInferenceServerOnlyReferenceCode,\n filename: options.filename,\n level: \"warn\",\n localNames: options.reference.localNames,\n message:\n `${options.filename}: server-only component import ${JSON.stringify(options.reference.source)} ` +\n \"uses client runtime syntax but is marked with server-only semantics. Automatic client \" +\n \"boundary detection skipped it. Move the interactive UI behind a .client module or add an \" +\n \"explicit clientBoundaryImports entry.\",\n source: options.reference.source,\n };\n}\n\nfunction unsupportedClientImportReferenceDiagnostic(options: {\n filename: string;\n identifierReferences: ReadonlySet<string>;\n reference: StaticImportReference;\n}): ClientRouteInferenceDiagnostic | undefined {\n if (options.reference.sideEffect) {\n return undefined;\n }\n\n const localNames = options.reference.localNames.filter((name) =>\n options.identifierReferences.has(name),\n );\n\n if (localNames.length === 0) {\n return undefined;\n }\n\n return {\n code: clientBoundaryInferenceUnsupportedReferenceCode,\n filename: options.filename,\n level: \"warn\",\n localNames,\n message:\n `${options.filename}: client component import ${JSON.stringify(options.reference.source)} ` +\n `is referenced as ${localNames.map((name) => JSON.stringify(name)).join(\", \")} but ` +\n \"was not rendered through a supported static JSX pattern. Automatic client boundary \" +\n \"detection supports direct JSX such as <Counter />, JSX member roots such as \" +\n \"<components.Counter />, and simple aliases such as const Alias = Counter. For dynamic \" +\n `registries or computed component selection, add ${JSON.stringify(options.reference.source)} ` +\n \"to clientBoundaryImports.\",\n source: options.reference.source,\n };\n}\n\nfunction startsUppercase(value: string): boolean {\n return /^[A-Z]/.test(value);\n}\n\nexport function formatClientRouteInferenceDiagnostic(\n diagnostic: ClientRouteInferenceDiagnostic,\n): string {\n return `${diagnostic.code}: ${diagnostic.message}`;\n}\n\nasync function resolveAppLocalModule(options: {\n allowExplicitNonSource?: boolean | undefined;\n cache: ClientRouteInferenceCache;\n importer: string;\n specifier: string;\n}): Promise<string | undefined> {\n if (!options.specifier.startsWith(\".\")) {\n return undefined;\n }\n\n const cacheKey = `${options.importer}\\0${options.specifier}\\0${\n options.allowExplicitNonSource === true ? \"explicit\" : \"source\"\n }`;\n const cached = options.cache.resolvedByImport.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const resolved = resolveAppLocalModuleUncached({\n allowExplicitNonSource: options.allowExplicitNonSource === true,\n importer: options.importer,\n specifier: options.specifier,\n });\n options.cache.resolvedByImport.set(cacheKey, resolved);\n return resolved;\n}\n\nasync function resolveAppLocalModuleUncached(options: {\n allowExplicitNonSource: boolean;\n importer: string;\n specifier: string;\n}): Promise<string | undefined> {\n const { importer, specifier } = options;\n const base = join(dirname(importer), specifier);\n const candidates = sourceModuleCandidates(base);\n\n if (candidates.length === 0) {\n if (options.allowExplicitNonSource && extname(base) !== \"\" && (await isFile(base))) {\n return base;\n }\n\n return undefined;\n }\n\n for (const candidate of candidates) {\n if (await isFile(candidate)) {\n return candidate;\n }\n }\n\n throw new Error(`${importer}: could not resolve app-local import ${JSON.stringify(specifier)}.`);\n}\n\nasync function isFile(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile();\n } catch {\n return false;\n }\n}\n\nasync function readCachedFile(cache: ClientRouteInferenceCache, filename: string): Promise<string> {\n const signature = await sourceFileSignature(filename);\n const cached = cache.sourceByFile.get(filename);\n\n if (cached !== undefined) {\n const source = await cached;\n\n if (source.signature === signature) {\n return source.source;\n }\n }\n\n const source = readFile(filename, \"utf8\").then((value) => ({\n signature,\n source: value,\n }));\n cache.sourceByFile.set(filename, source);\n return (await source).source;\n}\n\nasync function readClientRouteSource(options: {\n cache: ClientRouteInferenceCache;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<string> {\n if (options.sourceTransform === undefined) {\n return readCachedFile(options.cache, options.filename);\n }\n\n const signature = await sourceFileSignature(options.filename);\n const cacheKey = `${options.filename}\\0${options.sourceTransform.cacheKey}`;\n const cached = options.cache.transformedSourceByFile.get(cacheKey);\n\n if (cached !== undefined) {\n const source = await cached;\n\n if (source.signature === signature) {\n return source.source;\n }\n }\n\n const source = readCachedFile(options.cache, options.filename).then(async (code) => ({\n signature,\n source: await options.sourceTransform!.transform(options.filename, code),\n }));\n options.cache.transformedSourceByFile.set(cacheKey, source);\n return (await source).source;\n}\n\nasync function transformClientRouteSource(options: {\n code: string;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<string> {\n return options.sourceTransform === undefined\n ? options.code\n : await options.sourceTransform.transform(options.filename, options.code);\n}\n\nfunction clientRouteSourceTransformForVitePlugins(\n pluginOptions: readonly PluginOption[] | undefined,\n): ClientRouteSourceTransform | undefined {\n const plugins = orderVitePlugins(flattenVitePlugins(pluginOptions)).filter((plugin) =>\n hasViteTransformHook(plugin),\n );\n\n if (plugins.length === 0) {\n return undefined;\n }\n\n return {\n cacheKey: plugins.map((plugin, index) => `${index}:${plugin.name}`).join(\"\\0\"),\n async transform(filename, code) {\n let nextCode = code;\n\n for (const plugin of plugins) {\n const handler = viteTransformHookHandler(plugin);\n\n if (handler === undefined) {\n continue;\n }\n\n const result = await handler.call(\n createClientRouteViteTransformContext(plugin.name),\n nextCode,\n filename,\n { ssr: false },\n );\n\n if (typeof result === \"string\") {\n nextCode = result;\n } else if (result !== null && result !== undefined && typeof result === \"object\") {\n const codeResult = (result as { code?: unknown }).code;\n\n if (typeof codeResult === \"string\") {\n nextCode = codeResult;\n }\n }\n }\n\n return nextCode;\n },\n };\n}\n\nfunction flattenVitePlugins(pluginOptions: readonly PluginOption[] | undefined): Plugin[] {\n const plugins: Plugin[] = [];\n const visit = (option: PluginOption | null | false | undefined): void => {\n if (option === false || option === null || option === undefined) {\n return;\n }\n\n if (Array.isArray(option)) {\n for (const child of option) {\n visit(child);\n }\n return;\n }\n\n if (typeof option === \"object\" && \"then\" in option) {\n return;\n }\n\n plugins.push(option as Plugin);\n };\n\n for (const option of pluginOptions ?? []) {\n visit(option);\n }\n\n return plugins;\n}\n\nfunction orderVitePlugins(plugins: readonly Plugin[]): Plugin[] {\n return [\n ...plugins.filter((plugin) => plugin.enforce === \"pre\"),\n ...plugins.filter((plugin) => plugin.enforce !== \"pre\" && plugin.enforce !== \"post\"),\n ...plugins.filter((plugin) => plugin.enforce === \"post\"),\n ];\n}\n\nfunction hasViteTransformHook(plugin: Plugin): boolean {\n return viteTransformHookHandler(plugin) !== undefined;\n}\n\nfunction viteTransformHookHandler(plugin: Plugin):\n | ((\n this: unknown,\n code: string,\n id: string,\n options?: { ssr?: boolean | undefined },\n ) => unknown)\n | undefined {\n const transform = plugin.transform as unknown;\n\n if (typeof transform === \"function\") {\n return transform as (\n this: unknown,\n code: string,\n id: string,\n options?: { ssr?: boolean | undefined },\n ) => unknown;\n }\n\n if (transform !== null && typeof transform === \"object\") {\n const handler = (transform as { handler?: unknown }).handler;\n\n if (typeof handler === \"function\") {\n return handler as (\n this: unknown,\n code: string,\n id: string,\n options?: { ssr?: boolean | undefined },\n ) => unknown;\n }\n }\n\n return undefined;\n}\n\nfunction createClientRouteViteTransformContext(pluginName: string): unknown {\n return {\n addWatchFile() {},\n async resolve() {\n return null;\n },\n error(error: unknown): never {\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(String(error));\n },\n warn() {},\n getCombinedSourcemap() {\n return null;\n },\n parse() {\n throw new Error(\n `${pluginName}: client route import analysis cannot provide Rollup parser context.`,\n );\n },\n };\n}\n\nasync function sourceFileSignature(filename: string): Promise<string> {\n const stats = await stat(filename);\n\n return `${stats.mtimeMs}\\0${stats.size}`;\n}\n\nexport function routeIdForPath(path: string): string {\n if (path === \"/\") {\n return \"index\";\n }\n\n return path\n .slice(1)\n .replaceAll(\"/\", \"_\")\n .replaceAll(\":\", \"_\")\n .replace(/[^A-Za-z0-9_$-]/g, \"_\");\n}\n\nexport function clientScriptForPath(path: string): string {\n return `routes/${routeIdForPath(path)}.js`;\n}\n\nexport function navigationRuntimeScriptForDev(): string {\n return \"navigation.js\";\n}\n\nexport function withHydrationMarkers(options: {\n assetBaseUrl?: string | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n html: string;\n props: unknown;\n routePath: string;\n script?: string | undefined;\n}): string {\n const marker = hydrationMarkerParts({\n assetBaseUrl: options.assetBaseUrl,\n clientReferenceManifest: options.clientReferenceManifest,\n props: options.props,\n routePath: options.routePath,\n script: options.script,\n });\n\n return `${marker.prefix}${options.html}${marker.suffix}`;\n}\n\nexport function withRouteMarkers(options: { html: string; routePath: string }): string {\n const routeId = routeIdForPath(options.routePath);\n\n return `<div data-mreact-route-id=\"${escapeHtmlAttribute(routeId)}\">${options.html}</div>`;\n}\n\nexport function hydrationMarkerParts(options: {\n assetBaseUrl?: string | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n props: unknown;\n routePath: string;\n script?: string | undefined;\n}): { prefix: string; suffix: string } {\n const routeId = routeIdForPath(options.routePath);\n const escapedRouteId = escapeHtmlAttribute(routeId);\n const propsJson = escapeScriptJson(JSON.stringify(options.props));\n const script = options.script ?? clientScriptForPath(options.routePath);\n const scriptSrc = assetPath(script, options.assetBaseUrl ?? \"/_mreact/client/\");\n const clientReferencesJson =\n options.clientReferenceManifest === undefined || options.clientReferenceManifest.length === 0\n ? undefined\n : escapeScriptJson(JSON.stringify(options.clientReferenceManifest));\n\n return {\n prefix: `<div data-mreact-route-id=\"${escapedRouteId}\">`,\n suffix: [\n \"</div>\",\n `<script type=\"application/json\" id=\"mreact-props-${escapedRouteId}\">${propsJson}</script>`,\n clientReferencesJson === undefined\n ? undefined\n : `<script type=\"application/json\" id=\"mreact-client-references-${escapedRouteId}\">${clientReferencesJson}</script>`,\n `<script type=\"module\" src=\"${escapeHtmlAttribute(scriptSrc)}\"></script>`,\n ]\n .filter((part): part is string => part !== undefined)\n .join(\"\"),\n };\n}\n\nexport async function buildClientRouteBundle(options: {\n code: string;\n clientBoundaryImports?: readonly string[] | undefined;\n clientReferenceImports?: readonly ClientReferenceImport[] | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n filename: string;\n routePath: string;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<string> {\n return (await buildClientRouteOutput(options)).code;\n}\n\nexport async function buildNavigationRuntimeBundle(\n options: {\n minify?: boolean;\n sourceMap?: boolean;\n } = {},\n): Promise<{ code: string; map?: string }> {\n return buildClientRouteOutput({\n code: \"export default undefined;\",\n filename: \"__mreact_navigation_runtime.tsx\",\n routePath: \"/__mreact_navigation_runtime\",\n clientNavigation: true,\n ...(options.minify === undefined ? {} : { minify: options.minify }),\n ...(options.sourceMap === undefined ? {} : { sourceMap: options.sourceMap }),\n });\n}\n\nexport async function buildClientRouteOutput(\n options: BuildClientRouteOutputOptions,\n): Promise<{ code: string; map?: string }> {\n const entry = await buildClientRouteEntrySource(options);\n const bundled = await bundleRouterModule({\n code: entry.code,\n define: {\n __MREACT_CLIENT_DEVTOOLS__: \"false\",\n },\n filename: options.filename,\n minify: options.minify === true,\n platform: \"browser\",\n preserveExports: true,\n plugins: [workspaceRuntimePlugin({ routeFiles: [options.filename] })],\n sourceMap: options.sourceMap,\n vitePlugins: options.vitePlugins,\n });\n\n return {\n code: bundled.code,\n ...(bundled.map === undefined ? {} : { map: bundled.map }),\n };\n}\n\nexport async function buildClientRouteBatchOutput(options: {\n assetBaseUrl?: string | undefined;\n minify?: boolean;\n projectRoot?: string | undefined;\n routes: readonly BuildClientRouteOutputOptions[];\n sourceMap?: boolean;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<BuildClientRouteBatchOutput> {\n const entries = await Promise.all(\n options.routes.map(async (route) => ({\n filename: route.filename,\n name: routeIdForPath(route.routePath),\n routePath: route.routePath,\n source: await buildClientRouteEntrySource({\n ...route,\n minify: options.minify ?? route.minify,\n sourceMap: options.sourceMap ?? route.sourceMap,\n vitePlugins: options.vitePlugins ?? route.vitePlugins,\n }),\n })),\n );\n const bundled = await bundleRouterModules({\n base: options.assetBaseUrl ?? \"/_mreact/client/\",\n define: {\n __MREACT_CLIENT_DEVTOOLS__: \"false\",\n },\n entries: entries.map((entry) => ({\n code: entry.source.code,\n filename: entry.filename,\n name: entry.name,\n })),\n minify: options.minify === true,\n platform: \"browser\",\n plugins: [workspaceRuntimePlugin({ routeFiles: entries.map((entry) => entry.filename) })],\n root: options.projectRoot,\n sourceMap: options.sourceMap,\n vitePlugins: options.vitePlugins,\n });\n const entryChunks = new Map(\n bundled.chunks.filter((chunk) => chunk.isEntry).map((chunk) => [chunk.name, chunk]),\n );\n\n return {\n ...(bundled.assets === undefined ? {} : { assets: bundled.assets }),\n chunks: bundled.chunks,\n routes: entries.map((entry) => {\n const chunk = entryChunks.get(entry.name);\n\n if (chunk === undefined) {\n throw new Error(`Failed to bundle client route ${entry.routePath}: missing entry chunk.`);\n }\n\n return {\n chunk,\n routeId: entry.name,\n routePath: entry.routePath,\n };\n }),\n };\n}\n\nexport async function buildClientRouteEntrySource(\n options: BuildClientRouteOutputOptions,\n): Promise<{ code: string }> {\n const moduleContext = createCompilerModuleContext({\n code: options.code,\n filename: options.filename,\n });\n const compiled = transformCompilerModuleContext({\n code: options.code,\n clientBoundaryImports: options.clientBoundaryImports ?? [],\n filename: options.filename,\n moduleContext,\n target: \"client\",\n dev: options.minify !== true,\n });\n\n if (compiled.diagnostics.length > 0) {\n throw new Error(\n compiled.diagnostics\n .map((diagnostic) => formatDiagnostic(options.filename, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n const clientNavigation = options.clientNavigation ?? detectClientNavigationHint(options.code);\n const clientReferenceManifest =\n options.clientReferenceManifest ?? (await inferClientReferenceManifestForBundle(options));\n const compatClientReferenceNames = compatClientReferenceComponentNames(clientReferenceManifest);\n const clientReferenceImportBlock = emitClientReferenceImportBlock(\n options.clientReferenceImports ?? [],\n );\n const clientReferenceRegistry = emitClientReferenceRegistry(\n clientReferenceManifest,\n options.clientReferenceImports ?? [],\n compatClientReferenceNames,\n );\n const routeComponentExpression = routeComponentExpressionForComponents(\n compiled.metadata.components,\n );\n\n const routeId = routeIdForPath(options.routePath);\n const routeUsesCells = detectRouteCellStateHint(compiled.code);\n const routeUsesReactiveEffect = detectRouteReactiveEffectHint(compiled.code);\n const routeUsesCleanupScope = routeUsesCells || routeUsesReactiveEffect;\n const routeHasEventBindings =\n (compiled.metadata.eventHydrationManifest?.events.length ?? 0) > 0;\n const routeRequiresFullHydration =\n routeUsesCells || routeUsesReactiveEffect || routeHasEventBindings;\n const routeUsesOnlyClientReferenceBoundaries =\n !routeRequiresFullHydration &&\n clientReferenceManifest.length > 0 &&\n (options.clientReferenceImports?.length ?? 0) > 0;\n const routeHydrationCode = routeUsesOnlyClientReferenceBoundaries ? \"\" : compiled.code;\n const hydratedRouteComponentExpression = routeUsesOnlyClientReferenceBoundaries\n ? \"undefined\"\n : routeComponentExpression;\n const routeStateSignature = routeUsesCells ? routeStateSignatureForSource(compiled.code) : \"\";\n const routeCellEffectImport = routeUsesCells\n ? `import { effect as __mreactRouteEffect } from \"@reckona/mreact-reactive-core\";\\n`\n : \"\";\n const routeCleanupScopeImport = routeUsesCleanupScope\n ? `import { withCleanupScope as __mreactWithCleanupScope } from \"@reckona/mreact-reactive-core/internal\";\\n`\n : \"\";\n const navigationStateDeclaration = clientNavigation\n ? `const __mreactNavigationState = __mreactGlobal.__mreactNavigationState ??= {\n cache: new Map(),\n current: {\n from: null,\n pending: false,\n to: null,\n type: null,\n },\n installed: false,\n prefetchedScripts: new Set(),\n routePrefetchManifest: undefined,\n routePrefetchManifestText: undefined,\n viewportAnchors: new WeakSet(),\n viewportObserver: undefined,\n};`\n : \"\";\n const routeCellStateDeclaration = routeUsesCells\n ? `const __mreactRouteStates = __mreactGlobal.__mreactRouteStates ??= new Map();\nlet __mreactActiveCellRecords = undefined;\nlet __mreactActiveCellIndex = 0;`\n : \"\";\n const routeCleanupStateDeclaration = routeUsesCleanupScope\n ? `const __mreactRouteDisposers = __mreactGlobal.__mreactRouteDisposers ??= new Map();`\n : \"\";\n const routeCellHook = routeUsesCells\n ? `\n__mreactGlobal.__mreactRouteCell = (nativeCell, initial) => {\n if (__mreactActiveCellRecords === undefined) {\n return nativeCell(initial);\n }\n\n const cellKey = String(__mreactActiveCellIndex);\n __mreactActiveCellIndex += 1;\n const existingRecord = __mreactActiveCellRecords.get(cellKey);\n const record = existingRecord ?? { value: initial };\n const stateCell = nativeCell(record.value);\n const setStateCell = stateCell.set;\n\n stateCell.set = (next) => {\n setStateCell((previous) => {\n const resolved = typeof next === \"function\" ? next(previous) : next;\n record.value = resolved;\n return resolved;\n });\n };\n\n __mreactActiveCellRecords.set(cellKey, record);\n return stateCell;\n};`\n : \"\";\n const routeCellHydrationStart = routeUsesCells\n ? ` const __mreactPreviousState = __mreactRouteStates.get(__mreactRouteId);\n const __mreactState = __mreactPreviousState?.marker === __mreactMarker &&\n __mreactPreviousState?.signature === __mreactRouteStateSignature\n ? __mreactPreviousState\n : {\n cells: new Map(),\n marker: __mreactMarker,\n signature: __mreactRouteStateSignature,\n };\n __mreactDropMismatchedRouteState(__mreactPreviousState, __mreactState);\n __mreactRouteStates.set(__mreactRouteId, __mreactState);\n __mreactState.dispose?.();\n\n __mreactState.dispose = __mreactRouteEffect(() => {\n const __mreactRouteEffectDisposers = new Set();\n __mreactActiveCellRecords = __mreactState.cells;\n __mreactActiveCellIndex = 0;\n __mreactRouteDisposers.set(__mreactRouteId, () => __mreactState.dispose?.());\n\n try {\n`\n : \"\";\n const routeCellHydrationEnd = routeUsesCells\n ? ` } finally {\n __mreactActiveCellRecords = undefined;\n __mreactActiveCellIndex = 0;\n }\n return () => {\n for (const __mreactDispose of Array.from(__mreactRouteEffectDisposers)) {\n __mreactDispose();\n }\n __mreactRouteEffectDisposers.clear();\n };\n });\n`\n : \"\";\n const routeCellHydrationIndent = routeUsesCells ? \" \" : \" \";\n const routeCleanupHydrationStart = routeUsesCleanupScope && !routeUsesCells\n ? ` __mreactDisposeRoute(__mreactRouteId);\n const __mreactRouteEffectDisposers = new Set();\n __mreactRouteDisposers.set(__mreactRouteId, () => {\n for (const __mreactDispose of Array.from(__mreactRouteEffectDisposers)) {\n __mreactDispose();\n }\n __mreactRouteEffectDisposers.clear();\n });\n`\n : \"\";\n const routeCellDropFunction = routeUsesCells\n ? `\nfunction __mreactDropMismatchedRouteState(previousState, nextState) {\n if (previousState === undefined || previousState === nextState) {\n return;\n }\n\n if (previousState.signature !== nextState.signature && typeof console !== \"undefined\") {\n console.warn(\"mreact: dropping stale route state after route cell signature changed\");\n }\n}\n`\n : \"\";\n const routeCleanupFunction = routeUsesCleanupScope\n ? `\nfunction __mreactDisposeRoute(routeId) {\n const __mreactDispose = __mreactRouteDisposers.get(routeId);\n if (__mreactDispose === undefined) {\n return;\n }\n __mreactRouteDisposers.delete(routeId);\n __mreactDispose();\n}\n`\n : \"\";\n const routeCleanupNavigationDispose = routeUsesCleanupScope\n ? ` if (currentRouteId !== nextRouteId) {\n __mreactDisposeRoute(currentRouteId);\n }\n`\n : \"\";\n const routeNodeResolver = routeUsesCells\n ? `\nfunction __mreactResolveRouteNode(value) {\n if (\n value !== null &&\n typeof value === \"object\" &&\n value.$$typeof === Symbol.for(\"modular.react.element\") &&\n typeof value.type === \"function\"\n ) {\n return __mreactResolveRouteNode(value.type(value.props ?? {}));\n }\n\n if (value !== null && typeof value === \"object\" && value.nodeType !== undefined) {\n return value;\n }\n\n const fragment = document.createDocumentFragment();\n if (value !== null && value !== undefined && value !== false && value !== true) {\n fragment.append(document.createTextNode(String(value)));\n }\n return fragment;\n}\n`\n : \"\";\n const routeComponentCallExpression = routeUsesCleanupScope\n ? \"__mreactWithCleanupScope((__mreactDispose) => __mreactRouteEffectDisposers.add(__mreactDispose), () => __mreactComponent(__mreactProps))\"\n : \"__mreactComponent(__mreactProps)\";\n const routeNodeExpression = routeUsesCells\n ? `__mreactResolveRouteNode(${routeComponentCallExpression})`\n : routeComponentCallExpression;\n const boundaryOnlyHydrationBlock = routeRequiresFullHydration\n ? \"\"\n : `${routeCellHydrationIndent}if (!__mreactHasNonSerializableClientBoundaries(__mreactMarker) && __mreactHydrateClientBoundaries(document, __mreactClientReferences, __mreactClientReferenceComponents)) {\n${routeCellHydrationIndent} __mreactMarker.setAttribute(\"data-mreact-hydrated\", \"true\");\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const routeComponentGuard = `${routeCellHydrationIndent}if (__mreactComponent === undefined) {\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const entry = `${routeCellEffectImport}${routeCleanupScopeImport}${emitCompatClientReferenceImportBlock(compatClientReferenceNames)}${clientReferenceImportBlock}${routeHydrationCode}\n\nconst __mreactRouteId = ${JSON.stringify(routeId)};\nconst __mreactRouteStateSignature = ${JSON.stringify(routeStateSignature)};\nconst __mreactGlobal = globalThis;\n${navigationStateDeclaration}\n${routeCellStateDeclaration}\n${routeCleanupStateDeclaration}\n${routeCellHook}\n${clientReferenceRegistry}\n${routeNodeResolver}\n\nexport function __mreactHydrateRoute() {\n __mreactApplyOutOfOrderFragments(document);\n const __mreactMarker = document.querySelector(\\`[data-mreact-route-id=\"\\${__mreactRouteId}\"]\\`);\n const __mreactPropsElement = document.getElementById(\\`mreact-props-\\${__mreactRouteId}\\`);\n const __mreactClientReferencesElement = document.getElementById(\\`mreact-client-references-\\${__mreactRouteId}\\`);\n const __mreactProps = __mreactPropsElement?.textContent === undefined\n ? {}\n : JSON.parse(__mreactPropsElement.textContent);\n const __mreactClientReferences = __mreactClientReferencesElement?.textContent === undefined\n ? []\n : JSON.parse(__mreactClientReferencesElement.textContent);\n const __mreactClientReferenceManifests = __mreactGlobal.__mreactClientReferenceManifests ??= new Map();\n __mreactClientReferenceManifests.set(__mreactRouteId, __mreactClientReferences);\n const __mreactComponent = ${hydratedRouteComponentExpression};\n\n if (__mreactMarker === null) {\n return;\n }\n${routeCellHydrationStart}${routeCleanupHydrationStart}${boundaryOnlyHydrationBlock}${routeComponentGuard}${routeCellHydrationIndent}const __mreactNode = ${routeNodeExpression};\n${routeCellHydrationIndent}__mreactResumeRoute(__mreactMarker, __mreactNode);\n${routeCellHydrationIndent}__mreactHydrateClientBoundaries(__mreactMarker, __mreactClientReferences, __mreactClientReferenceComponents);\n${routeCellHydrationIndent}__mreactMarker.setAttribute(\"data-mreact-hydrated\", \"true\");\n${routeCellHydrationEnd}}\n${routeCellDropFunction}\n${routeCleanupFunction}\n\n__mreactHydrateRoute();\n${clientNavigation ? \"__mreactInstallNavigation();\" : \"\"}\n\n${\n clientNavigation\n ? `export function __mreactNavigateToHtml(html, url, options = {}) {\n __mreactSaveCurrentHistoryState();\n const applied = __mreactApplyNavigationHtml(html, url);\n\n if (!applied) {\n return false;\n }\n\n __mreactPushHistoryState(url);\n if (options.scroll !== \"preserve\") {\n __mreactScrollTo(0, 0);\n }\n __mreactResetNavigationFocus();\n __mreactAnnounceNavigation();\n return true;\n}\n\nfunction __mreactResetNavigationFocus() {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const focusTarget =\n document.querySelector(\"[data-mreact-focus-target]\") ??\n document.querySelector(\"main\") ??\n document.querySelector(\"h1\") ??\n document.body;\n\n if (!(focusTarget instanceof HTMLElement)) {\n return;\n }\n\n const hadTabIndex = focusTarget.hasAttribute(\"tabindex\");\n\n if (!hadTabIndex) {\n focusTarget.setAttribute(\"tabindex\", \"-1\");\n }\n\n try {\n focusTarget.focus({ preventScroll: true });\n } catch {\n focusTarget.focus();\n }\n\n if (!hadTabIndex) {\n focusTarget.addEventListener(\n \"blur\",\n () => focusTarget.removeAttribute(\"tabindex\"),\n { once: true },\n );\n }\n}\n\nfunction __mreactAnnounceNavigation() {\n if (typeof document === \"undefined\" || document.body === null) {\n return;\n }\n\n const announcement = __mreactRouteAnnouncementElement();\n announcement.textContent = \\`Loaded \\${document.title || \"page\"}\\`;\n}\n\nfunction __mreactRouteAnnouncementElement() {\n const existing = document.getElementById(\"mreact-route-announcement\");\n\n if (existing instanceof HTMLElement) {\n return existing;\n }\n\n const announcement = document.createElement(\"div\");\n announcement.id = \"mreact-route-announcement\";\n announcement.setAttribute(\"role\", \"status\");\n announcement.setAttribute(\"aria-live\", \"polite\");\n announcement.setAttribute(\"aria-atomic\", \"true\");\n announcement.setAttribute(\n \"style\",\n \"position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden\",\n );\n document.body.appendChild(announcement);\n return announcement;\n}\n\nexport async function __mreactPrefetch(url) {\n if (!__mreactCanPrefetch()) {\n return false;\n }\n\n const href = __mreactNormalizeNavigationUrl(url);\n\n if (href === undefined) {\n return false;\n }\n\n const script = __mreactRouteScriptForNavigationUrl(href);\n\n if (script === undefined) {\n return __mreactPrefetchNavigationHtml(href);\n }\n\n return __mreactPrefetchRouteScript(script);\n}\n\nfunction __mreactPrefetchNavigationHtml(href) {\n if (__mreactNavigationState.cache.has(href)) {\n return true;\n }\n\n return __mreactFetchNavigationHtml(href).then((html) => {\n if (typeof html !== \"string\") {\n return false;\n }\n\n __mreactNavigationState.cache.set(href, html);\n return true;\n }).catch(() => false);\n}\n\nfunction __mreactPrefetchRouteScript(script) {\n if (typeof document === \"undefined\") {\n return false;\n }\n\n const href = __mreactNormalizeAssetUrl(script);\n\n if (href === undefined) {\n return false;\n }\n\n if (__mreactNavigationState.prefetchedScripts.has(href)) {\n return true;\n }\n\n for (const link of Array.from(document.querySelectorAll('link[rel=\"modulepreload\"][href]'))) {\n if (link.href === href) {\n __mreactNavigationState.prefetchedScripts.add(href);\n return true;\n }\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"modulepreload\";\n link.href = href;\n document.head.appendChild(link);\n __mreactNavigationState.prefetchedScripts.add(href);\n return true;\n}\n\nexport async function __mreactNavigate(url, options = {}) {\n const href = __mreactNormalizeNavigationUrl(url);\n\n if (href === undefined) {\n return false;\n }\n\n __mreactSetNavigationState(__mreactPendingNavigationState(href, options.type ?? \"push\"));\n\n try {\n const cachedHtml = __mreactNavigationState.cache.get(href);\n const html = cachedHtml ?? await __mreactFetchNavigationHtml(href);\n\n if (typeof html !== \"string\") {\n return false;\n }\n\n __mreactNavigationState.cache.set(href, html);\n return await __mreactApplyNavigationHtmlWithOptionalTransition(html, href, options);\n } finally {\n __mreactSetNavigationState(__mreactIdleNavigationState());\n }\n}\n\nexport function __mreactGetNavigationState() {\n return __mreactNavigationStateSnapshot(__mreactNavigationState.current);\n}\n\nfunction __mreactPendingNavigationState(to, type) {\n return {\n from: typeof location === \"undefined\" ? null : location.href,\n pending: true,\n to,\n type: __mreactNavigationType(type),\n };\n}\n\nfunction __mreactIdleNavigationState() {\n return {\n from: null,\n pending: false,\n to: null,\n type: null,\n };\n}\n\nfunction __mreactSetNavigationState(state) {\n const snapshot = __mreactNavigationStateSnapshot(state);\n __mreactNavigationState.current = snapshot;\n __mreactApplyNavigationStateAttributes(snapshot);\n __mreactDispatchNavigationStateChange(snapshot);\n}\n\nfunction __mreactNavigationStateSnapshot(state) {\n return {\n from: typeof state?.from === \"string\" ? state.from : null,\n pending: state?.pending === true,\n to: typeof state?.to === \"string\" ? state.to : null,\n type: __mreactNavigationType(state?.type),\n };\n}\n\nfunction __mreactNavigationType(type) {\n return type === \"push\" || type === \"replace\" || type === \"pop\" || type === \"refresh\"\n ? type\n : null;\n}\n\nfunction __mreactApplyNavigationStateAttributes(state) {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const root = document.documentElement;\n\n if (state.pending !== true) {\n root.removeAttribute(\"data-mreact-navigation-pending\");\n root.removeAttribute(\"data-mreact-navigation-from\");\n root.removeAttribute(\"data-mreact-navigation-to\");\n root.removeAttribute(\"data-mreact-navigation-type\");\n return;\n }\n\n root.setAttribute(\"data-mreact-navigation-pending\", \"true\");\n\n if (state.from === null) {\n root.removeAttribute(\"data-mreact-navigation-from\");\n } else {\n root.setAttribute(\"data-mreact-navigation-from\", state.from);\n }\n\n if (state.to === null) {\n root.removeAttribute(\"data-mreact-navigation-to\");\n } else {\n root.setAttribute(\"data-mreact-navigation-to\", state.to);\n }\n\n if (state.type === null) {\n root.removeAttribute(\"data-mreact-navigation-type\");\n } else {\n root.setAttribute(\"data-mreact-navigation-type\", state.type);\n }\n}\n\nfunction __mreactDispatchNavigationStateChange(state) {\n if (typeof window === \"undefined\" || typeof CustomEvent !== \"function\") {\n return;\n }\n\n window.dispatchEvent(new CustomEvent(\"mreact:navigation-state-change\", {\n detail: state,\n }));\n}\n\nasync function __mreactApplyNavigationHtmlWithOptionalTransition(html, href, options) {\n if (!__mreactViewTransitionsAllowed(options.transition)) {\n return __mreactNavigateToHtml(html, href, options);\n }\n\n let navigated = false;\n const transition = document.startViewTransition(() => {\n navigated = __mreactNavigateToHtml(html, href, options);\n });\n\n try {\n await transition.updateCallbackDone;\n } catch {\n return navigated;\n }\n\n return navigated;\n}\n\nfunction __mreactViewTransitionsAllowed(transition) {\n if (\n transition !== \"auto\" ||\n typeof document === \"undefined\" ||\n typeof document.startViewTransition !== \"function\"\n ) {\n return false;\n }\n\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return true;\n }\n\n try {\n return !window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n } catch {\n return true;\n }\n}\n\nexport function __mreactInvalidateNavigationCache(path) {\n const normalizedPath = __mreactNormalizeNavigationPath(path);\n\n if (normalizedPath === undefined) {\n return;\n }\n\n for (const href of Array.from(__mreactNavigationState.cache.keys())) {\n if (__mreactNormalizeNavigationPath(href) === normalizedPath) {\n __mreactNavigationState.cache.delete(href);\n }\n }\n}\n\nfunction __mreactFetchNavigationHtml(href) {\n return fetch(href, {\n headers: { \"x-mreact-navigation\": \"1\" },\n }).then((response) => {\n __mreactApplyRevalidationHeader(response);\n if (__mreactNavigationResponseRequiresDocumentReload(response)) {\n return undefined;\n }\n\n return response.text();\n });\n}\n\nfunction __mreactNavigationResponseRequiresDocumentReload(response) {\n return response.status === 204 || response.headers.get(\"x-mreact-navigation\") === \"reload\";\n}\n\nfunction __mreactApplyRevalidationHeader(response) {\n const header = response.headers.get(\"x-mreact-revalidate\");\n\n if (header === null || header.trim() === \"\") {\n return;\n }\n\n for (const path of header.split(\",\")) {\n __mreactInvalidateNavigationCache(path.trim());\n }\n}\n\nfunction __mreactNormalizeNavigationPath(path) {\n if (typeof location === \"undefined\") {\n return typeof path === \"string\" && path.length > 0 ? path : undefined;\n }\n\n try {\n const url = new URL(path, location.href);\n const pathname = url.pathname.replace(/\\\\/+$/, \"\");\n\n return pathname === \"\" ? \"/\" : pathname;\n } catch {\n return undefined;\n }\n}\n\nexport function __mreactRestoreHistoryState(state) {\n if (state === null || state === undefined || state.__mreact !== true || typeof state.html !== \"string\") {\n return false;\n }\n\n const applied = __mreactApplyNavigationHtml(state.html, state.url);\n\n if (!applied) {\n return false;\n }\n\n __mreactScrollTo(Number(state.scrollX ?? 0), Number(state.scrollY ?? 0));\n return true;\n}\n\nfunction __mreactApplyNavigationHtml(html, url) {\n const template = document.createElement(\"template\");\n template.innerHTML = html.replace(/^\\\\s*<!doctype html>/i, \"\");\n __mreactApplyOutOfOrderFragments(template.content);\n const nextMarker = template.content.querySelector(\"[data-mreact-route-id]\");\n const currentMarker = document.querySelector(\"[data-mreact-route-id]\");\n\n if (nextMarker === null || currentMarker === null) {\n return false;\n }\n\n const currentRouteId = currentMarker.getAttribute(\"data-mreact-route-id\");\n const nextRouteId = nextMarker.getAttribute(\"data-mreact-route-id\");\n\n __mreactSyncHeadMetadata(template.content, html);\n __mreactResumeNode(currentMarker, nextMarker);\n${routeCleanupNavigationDispose} __mreactSyncRouteDataScripts(template.content, currentRouteId, nextRouteId);\n\n const script = template.content.querySelector('script[type=\"module\"][src]')?.getAttribute(\"src\");\n if (script !== null && script !== undefined) {\n void import(/* @vite-ignore */ script).then((module) => module.__mreactHydrateRoute?.());\n }\n\n __mreactApplyOutOfOrderFragments(document);\n __mreactObserveViewportPrefetchAnchors(document);\n\n return true;\n}\n\nfunction __mreactSyncHeadMetadata(root, html) {\n __mreactSyncHtmlLang(root, html);\n\n const nextHead = root.querySelector(\"head\");\n\n if ((nextHead === null && !/<head(?:\\\\s[^>]*)?>/i.test(html)) || document.head === null) {\n return;\n }\n\n const metadataRoot = nextHead ?? root;\n const selector = __mreactManagedHeadMetadataSelector();\n\n for (const element of Array.from(document.head.querySelectorAll(selector))) {\n element.remove();\n }\n\n for (const element of Array.from(metadataRoot.querySelectorAll(selector))) {\n document.head.appendChild(element);\n }\n}\n\nfunction __mreactSyncHtmlLang(root, html) {\n const nextHtml = root.querySelector(\"html\");\n const nextLang = nextHtml?.getAttribute(\"lang\") ?? __mreactHtmlLangFromSource(html);\n\n if (nextLang === null) {\n return;\n }\n\n if (document.documentElement.lang !== nextLang) {\n document.documentElement.lang = nextLang;\n }\n}\n\nfunction __mreactHtmlLangFromSource(html) {\n const match = /<html\\\\b[^>]*\\\\slang=(?:\"([^\"]*)\"|'([^']*)'|([^\\\\s>]+))/i.exec(html);\n\n return match === null ? null : match[1] ?? match[2] ?? match[3] ?? null;\n}\n\nfunction __mreactManagedHeadMetadataSelector() {\n return [\n \"title\",\n 'meta[name=\"description\"]',\n 'link[rel=\"canonical\"]',\n 'meta[property=\"og:title\"]',\n 'meta[property=\"og:description\"]',\n 'meta[property=\"og:image\"]',\n 'link[rel=\"icon\"]',\n 'link[rel=\"apple-touch-icon\"]',\n 'meta[name=\"robots\"]',\n 'meta[name=\"theme-color\"]',\n 'meta[name=\"viewport\"]',\n ].join(\",\");\n}\n\nfunction __mreactSyncRouteDataScripts(root, currentRouteId, nextRouteId) {\n const managedIds = __mreactRouteDataScriptIds(currentRouteId, nextRouteId);\n\n if (managedIds.size === 0) {\n return;\n }\n\n for (const element of Array.from(document.querySelectorAll(__mreactRouteDataScriptSelector()))) {\n if (managedIds.has(element.id)) {\n element.remove();\n }\n }\n\n for (const element of Array.from(root.querySelectorAll(__mreactRouteDataScriptSelector()))) {\n if (managedIds.has(element.id)) {\n document.body.appendChild(element);\n }\n }\n}\n\nfunction __mreactRouteDataScriptIds(...routeIds) {\n const ids = new Set();\n\n for (const routeId of routeIds) {\n if (typeof routeId !== \"string\" || routeId === \"\") {\n continue;\n }\n\n ids.add(\\`mreact-props-\\${routeId}\\`);\n ids.add(\\`mreact-client-references-\\${routeId}\\`);\n }\n\n return ids;\n}\n\nfunction __mreactRouteDataScriptSelector() {\n return 'script[type=\"application/json\"][id^=\"mreact-props-\"], script[type=\"application/json\"][id^=\"mreact-client-references-\"]';\n}\n\nfunction __mreactCurrentHistoryState(url) {\n return {\n __mreact: true,\n html: document.body.innerHTML,\n scrollX: Number(globalThis.scrollX ?? 0),\n scrollY: Number(globalThis.scrollY ?? 0),\n url,\n };\n}\n\nfunction __mreactPushHistoryState(url) {\n if (typeof history === \"undefined\" || url === undefined) {\n return;\n }\n\n try {\n history.pushState(__mreactCurrentHistoryState(url), \"\", url);\n } catch {\n // Ignore invalid URLs in non-browser test environments.\n }\n}\n\nfunction __mreactSaveCurrentHistoryState() {\n if (typeof history === \"undefined\" || typeof location === \"undefined\") {\n return;\n }\n\n try {\n history.replaceState(__mreactCurrentHistoryState(location.href), \"\", location.href);\n } catch {\n // Ignore invalid URLs in non-browser test environments.\n }\n}\n\nfunction __mreactEnableManualScrollRestoration() {\n if (typeof history === \"undefined\" || !(\"scrollRestoration\" in history)) {\n return;\n }\n\n try {\n history.scrollRestoration = \"manual\";\n } catch {\n // Ignore read-only history implementations in non-browser runtimes.\n }\n}\n\nfunction __mreactNormalizeNavigationUrl(url) {\n if (typeof location === \"undefined\") {\n return typeof url === \"string\" ? url : undefined;\n }\n\n try {\n return new URL(url, location.href).href;\n } catch {\n return undefined;\n }\n}\n\nfunction __mreactNormalizeAssetUrl(url) {\n if (typeof location === \"undefined\") {\n return typeof url === \"string\" ? url : undefined;\n }\n\n try {\n return new URL(url, location.href).href;\n } catch {\n return undefined;\n }\n}\n\nfunction __mreactRouteScriptForNavigationUrl(url) {\n const href = __mreactNormalizeNavigationUrl(url);\n\n if (href === undefined || typeof location === \"undefined\") {\n return undefined;\n }\n\n let nextUrl;\n\n try {\n nextUrl = new URL(href, location.href);\n } catch {\n return undefined;\n }\n\n if (nextUrl.origin !== location.origin) {\n return undefined;\n }\n\n for (const route of __mreactClientRoutePrefetchManifest()) {\n if (__mreactRoutePathMatches(route.path, nextUrl.pathname)) {\n return route.script;\n }\n }\n\n return undefined;\n}\n\nfunction __mreactClientRoutePrefetchManifest() {\n const element = typeof document === \"undefined\"\n ? null\n : document.getElementById(\"mreact-route-prefetch-manifest\");\n const text = element?.textContent ?? \"\";\n\n if (\n __mreactNavigationState.routePrefetchManifest !== undefined &&\n __mreactNavigationState.routePrefetchManifestText === text\n ) {\n return __mreactNavigationState.routePrefetchManifest;\n }\n\n __mreactNavigationState.routePrefetchManifestText = text;\n\n if (element === null) {\n __mreactNavigationState.routePrefetchManifest = [];\n return __mreactNavigationState.routePrefetchManifest;\n }\n\n try {\n const parsed = JSON.parse(text);\n __mreactNavigationState.routePrefetchManifest = Array.isArray(parsed)\n ? parsed.filter((route) =>\n route !== null &&\n typeof route === \"object\" &&\n typeof route.path === \"string\" &&\n typeof route.script === \"string\"\n )\n : [];\n } catch {\n __mreactNavigationState.routePrefetchManifest = [];\n }\n\n return __mreactNavigationState.routePrefetchManifest;\n}\n\nfunction __mreactRoutePathMatches(routePath, pathname) {\n const routeSegments = __mreactNormalizeRoutePath(routePath);\n const pathSegments = __mreactNormalizeRoutePath(pathname);\n\n if (routeSegments.length === 0) {\n return pathSegments.length === 0;\n }\n\n for (const [index, segment] of routeSegments.entries()) {\n const value = pathSegments[index];\n\n if (segment.startsWith(\":...\")) {\n return pathSegments.length >= index + 1;\n }\n\n if (value === undefined) {\n return false;\n }\n\n if (!segment.startsWith(\":\") && segment !== value) {\n return false;\n }\n }\n\n return routeSegments.length === pathSegments.length;\n}\n\nfunction __mreactNormalizeRoutePath(path) {\n const normalized = path.length > 1 ? path.replace(/\\\\/+$/, \"\") : path;\n return normalized === \"/\" || normalized === \"\" ? [] : normalized.replace(/^\\\\/+/, \"\").split(\"/\");\n}\n\nfunction __mreactCanPrefetch() {\n if (typeof navigator === \"undefined\") {\n return true;\n }\n\n const connection = navigator.connection ?? navigator.mozConnection ?? navigator.webkitConnection;\n const effectiveType = typeof connection?.effectiveType === \"string\"\n ? connection.effectiveType.toLowerCase()\n : \"\";\n\n return connection?.saveData !== true && effectiveType !== \"slow-2g\" && effectiveType !== \"2g\";\n}\n\nfunction __mreactScrollTo(x, y) {\n if (typeof scrollTo === \"function\") {\n scrollTo(x, y);\n }\n}\n\nfunction __mreactIsHashOnlyNavigation(nextUrl) {\n if (typeof location === \"undefined\") {\n return false;\n }\n\n return nextUrl.origin === location.origin &&\n nextUrl.pathname === location.pathname &&\n nextUrl.search === location.search &&\n nextUrl.hash !== \"\" &&\n nextUrl.hash !== location.hash;\n}\n\nfunction __mreactInstallNavigation() {\n if (__mreactNavigationState.installed || typeof document === \"undefined\") {\n return;\n }\n\n __mreactNavigationState.installed = true;\n __mreactEnableManualScrollRestoration();\n __mreactSaveCurrentHistoryState();\n addEventListener(\"popstate\", (event) => {\n __mreactSaveCurrentHistoryState();\n if (!__mreactRestoreHistoryState(event.state)) {\n location.reload();\n }\n });\n document.addEventListener(\"pointerenter\", (event) => {\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor !== null && __mreactAnchorPrefetchMode(anchor) === \"intent\") {\n void __mreactPrefetch(anchor.href);\n }\n }, true);\n document.addEventListener(\"pointerdown\", (event) => {\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor !== null && __mreactAnchorPrefetchMode(anchor) === \"intent\") {\n void __mreactPrefetch(anchor.href);\n }\n }, true);\n document.addEventListener(\"focusin\", (event) => {\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor !== null && __mreactAnchorPrefetchMode(anchor) === \"intent\") {\n void __mreactPrefetch(anchor.href);\n }\n });\n __mreactObserveViewportPrefetchAnchors(document);\n document.addEventListener(\"click\", (event) => {\n if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return;\n }\n\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor === null) {\n return;\n }\n\n if (anchor.dataset.mreactReload === \"true\") {\n return;\n }\n\n const nextUrl = new URL(anchor.href, location.href);\n\n if (nextUrl.origin !== location.origin) {\n return;\n }\n\n if (__mreactIsHashOnlyNavigation(nextUrl)) {\n return;\n }\n\n event.preventDefault();\n void __mreactNavigate(nextUrl.href, {\n scroll: __mreactAnchorScrollMode(anchor),\n transition: __mreactAnchorTransitionMode(anchor),\n })\n .then((navigated) => {\n if (!navigated) {\n location.href = nextUrl.href;\n }\n }).catch(() => {\n location.href = nextUrl.href;\n });\n });\n}\n\nfunction __mreactAnchorFromEvent(event) {\n const target = event.target;\n const anchor = target instanceof Element ? target.closest(\"a[href]\") : null;\n\n if (!(anchor instanceof HTMLAnchorElement) || anchor.target !== \"\" || anchor.hasAttribute(\"download\")) {\n return null;\n }\n\n return anchor;\n}\n\nfunction __mreactAnchorPrefetchMode(anchor) {\n const value = anchor.dataset.mreactPrefetch;\n\n if (value === \"false\" || value === \"none\") {\n return \"none\";\n }\n\n return value === \"viewport\" ? \"viewport\" : \"intent\";\n}\n\nfunction __mreactAnchorScrollMode(anchor) {\n return anchor.dataset.mreactScroll === \"preserve\" ? \"preserve\" : \"top\";\n}\n\nfunction __mreactAnchorTransitionMode(anchor) {\n return anchor.dataset.mreactTransition === \"auto\" ? \"auto\" : \"none\";\n}\n\nfunction __mreactObserveViewportPrefetchAnchors(root) {\n if (typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n if (__mreactNavigationState.viewportObserver === undefined) {\n __mreactNavigationState.viewportObserver = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (!entry.isIntersecting || !(entry.target instanceof HTMLAnchorElement)) {\n continue;\n }\n\n __mreactNavigationState.viewportObserver?.unobserve(entry.target);\n void __mreactPrefetch(entry.target.href);\n }\n });\n }\n\n for (const anchor of Array.from(root.querySelectorAll('a[href][data-mreact-prefetch=\"viewport\"]'))) {\n if (!(anchor instanceof HTMLAnchorElement) || __mreactNavigationState.viewportAnchors.has(anchor)) {\n continue;\n }\n\n __mreactNavigationState.viewportAnchors.add(anchor);\n __mreactNavigationState.viewportObserver.observe(anchor);\n }\n}\n`\n : \"\"\n}\n\nfunction __mreactApplyOutOfOrderFragments(root) {\n const fragments = Array.from(root.querySelectorAll(\"template[data-mreact-oob-fragment]\"));\n\n for (const fragment of fragments) {\n const id = fragment.getAttribute(\"data-mreact-oob-fragment\");\n\n if (id === null) {\n continue;\n }\n\n const placeholder = Array.from(root.querySelectorAll(\"[data-mreact-oob-placeholder]\"))\n .find((candidate) => candidate.getAttribute(\"data-mreact-oob-placeholder\") === id);\n\n if (placeholder === undefined) {\n continue;\n }\n\n placeholder.replaceWith(fragment.content.cloneNode(true));\n fragment.remove();\n }\n}\n\nfunction __mreactHydrateClientBoundaries(marker, references, components) {\n if (components.size === 0 && (!Array.isArray(references) || references.length === 0)) {\n return false;\n }\n\n const placeholders = Array.from(marker.querySelectorAll(\"template[data-mreact-client-boundary]\"));\n\n if (placeholders.length === 0) {\n return false;\n }\n\n for (const placeholder of placeholders) {\n const name = placeholder.getAttribute(\"data-mreact-client-boundary\");\n const entry = name === null ? undefined : components.get(name);\n const component = typeof entry === \"function\" ? entry : entry?.component;\n const compat = entry?.compat === true;\n\n if (typeof component !== \"function\") {\n return false;\n }\n\n const propsElement = __mreactClientBoundaryPropsElement(placeholder, name);\n const props = propsElement?.textContent === undefined || propsElement.textContent === \"\"\n ? {}\n : JSON.parse(propsElement.textContent);\n\n if (compat) {\n const container = document.createElement(\"span\");\n container.setAttribute(\"data-mreact-compat-boundary\", name ?? \"\");\n container.style.display = \"contents\";\n placeholder.replaceWith(container);\n __mreactCompatCreateRoot(container).render(__mreactCompatCreateElement(component, props));\n propsElement?.remove();\n continue;\n }\n\n const node = component(props);\n\n placeholder.replaceWith(node);\n propsElement?.remove();\n }\n\n return true;\n}\n\nfunction __mreactHasNonSerializableClientBoundaries(marker) {\n return marker.querySelector(\n 'template[data-mreact-client-boundary][data-mreact-client-boundary-nonserializable=\"true\"]',\n ) !== null;\n}\n\nfunction __mreactClientBoundaryPropsElement(placeholder, name) {\n let next = placeholder.nextSibling;\n\n while (next !== null) {\n if (\n next.nodeType === Node.ELEMENT_NODE &&\n next.tagName === \"SCRIPT\" &&\n next.getAttribute(\"type\") === \"application/json\" &&\n next.getAttribute(\"data-mreact-client-boundary-props\") === name\n ) {\n return next;\n }\n\n if (next.nodeType === Node.ELEMENT_NODE) {\n return undefined;\n }\n\n next = next.nextSibling;\n }\n\n return undefined;\n}\n\nfunction __mreactResumeRoute(marker, nextNode) {\n if (nextNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n marker.replaceChildren(nextNode);\n return;\n }\n\n const current = __mreactRouteResumeTarget(marker, nextNode);\n\n if (current === null) {\n marker.appendChild(nextNode);\n return;\n }\n\n __mreactResumeNode(current, nextNode);\n\n if (current.parentNode !== marker) {\n return;\n }\n\n while (marker.childNodes.length > 1) {\n marker.lastChild?.remove();\n }\n}\n\nfunction __mreactRouteResumeTarget(marker, nextNode) {\n const current = marker.firstChild;\n\n if (\n current === null ||\n current.nodeType !== Node.ELEMENT_NODE ||\n nextNode.nodeType !== Node.ELEMENT_NODE ||\n current.tagName === nextNode.tagName ||\n !current.hasAttribute(\"data-mreact-layout-boundary\")\n ) {\n return current;\n }\n\n return __mreactFindLayoutPageTarget(current, nextNode) ?? current;\n}\n\nfunction __mreactFindLayoutPageTarget(current, nextNode) {\n for (const child of Array.from(current.childNodes)) {\n if (child.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n\n if (\n child.tagName === nextNode.tagName &&\n !child.hasAttribute(\"data-mreact-layout-boundary\") &&\n !child.hasAttribute(\"data-mreact-template-boundary\")\n ) {\n return child;\n }\n\n if (child.hasAttribute(\"data-mreact-layout-boundary\")) {\n const nested = __mreactFindLayoutPageTarget(child, nextNode);\n\n if (nested !== null) {\n return nested;\n }\n }\n }\n\n return null;\n}\n\nfunction __mreactResumeNode(current, next) {\n if (\n next.nodeType === Node.COMMENT_NODE &&\n next.nodeValue === \"mreact-async-boundary\"\n ) {\n // Server stream emits the resolved <Await> content; preserve the existing\n // DOM instead of replacing it with the client placeholder comment.\n return;\n }\n\n if (__mreactShouldReplaceNode(current, next)) {\n current.replaceWith(next);\n return;\n }\n\n if (current.nodeType === Node.TEXT_NODE && next.nodeType === Node.TEXT_NODE) {\n if (current.nodeValue !== next.nodeValue) {\n current.nodeValue = next.nodeValue;\n }\n return;\n }\n\n if (current.nodeType !== Node.ELEMENT_NODE || next.nodeType !== Node.ELEMENT_NODE) {\n current.replaceWith(next);\n return;\n }\n\n __mreactSyncEventBindings(current, next);\n __mreactSyncAttributes(current, next);\n __mreactSyncPropBindings(current, next);\n __mreactResumeChildren(current, next);\n}\n\nfunction __mreactShouldReplaceNode(current, next) {\n if (\n next.nodeType === Node.ELEMENT_NODE &&\n next.hasAttribute(\"data-mreact-template-boundary\")\n ) {\n return true;\n }\n\n if (current.nodeType !== next.nodeType) {\n return true;\n }\n\n return current.nodeType === Node.ELEMENT_NODE &&\n current.tagName !== next.tagName;\n}\n\nfunction __mreactSyncEventBindings(current, next) {\n const previousDisposers = current.__mreactEventDisposers;\n\n if (Array.isArray(previousDisposers)) {\n for (const dispose of previousDisposers) {\n dispose();\n }\n }\n\n const bindings = next.__mreactEventBindings;\n\n if (!Array.isArray(bindings) || bindings.length === 0) {\n current.__mreactEventDisposers = [];\n current.__mreactHasEvents = false;\n return;\n }\n\n const disposers = [];\n\n for (const binding of bindings) {\n if (binding.delegated === true && __mreactIsDelegatedEventType(binding.type)) {\n disposers.push(__mreactAddDelegatedEventListener(current, binding.type, binding.listener));\n } else {\n current.addEventListener(binding.type, binding.listener);\n disposers.push(() => current.removeEventListener(binding.type, binding.listener));\n }\n }\n\n current.__mreactEventDisposers = disposers;\n current.__mreactHasEvents = true;\n}\n\nfunction __mreactIsDelegatedEventType(type) {\n return type === \"change\" ||\n type === \"click\" ||\n type === \"input\" ||\n type === \"keydown\" ||\n type === \"keyup\" ||\n type === \"pointerdown\" ||\n type === \"pointermove\" ||\n type === \"pointerup\" ||\n type === \"submit\";\n}\n\nfunction __mreactDelegatedEventState() {\n globalThis.__mreactDelegatedEventState ??= {\n elements: new WeakMap(),\n roots: new WeakMap(),\n };\n return globalThis.__mreactDelegatedEventState;\n}\n\nfunction __mreactAddDelegatedEventListener(element, type, listener) {\n const root = element.ownerDocument;\n const state = __mreactDelegatedEventState();\n let listenersByType = state.elements.get(element);\n\n if (listenersByType === undefined) {\n listenersByType = new Map();\n state.elements.set(element, listenersByType);\n }\n\n let listeners = listenersByType.get(type);\n\n if (listeners === undefined) {\n listeners = [];\n listenersByType.set(type, listeners);\n }\n\n listeners.push(listener);\n __mreactRetainDelegatedEventRoot(root, type);\n\n return () => {\n const state = __mreactDelegatedEventState();\n const currentListeners = state.elements.get(element)?.get(type);\n const index = currentListeners?.indexOf(listener) ?? -1;\n\n if (index !== -1) {\n currentListeners?.splice(index, 1);\n }\n\n if (currentListeners?.length === 0) {\n state.elements.get(element)?.delete(type);\n }\n\n __mreactReleaseDelegatedEventRoot(root, type);\n };\n}\n\nfunction __mreactRetainDelegatedEventRoot(root, type) {\n const state = __mreactDelegatedEventState();\n let rootsByType = state.roots.get(root);\n\n if (rootsByType === undefined) {\n rootsByType = new Map();\n state.roots.set(root, rootsByType);\n }\n\n const current = rootsByType.get(type);\n\n if (current !== undefined) {\n current.count += 1;\n return;\n }\n\n const listener = (event) => __mreactDispatchDelegatedEvent(root, type, event);\n rootsByType.set(type, { count: 1, listener });\n root.addEventListener(type, listener);\n}\n\nfunction __mreactReleaseDelegatedEventRoot(root, type) {\n const rootsByType = __mreactDelegatedEventState().roots.get(root);\n const current = rootsByType?.get(type);\n\n if (rootsByType === undefined || current === undefined) {\n return;\n }\n\n current.count -= 1;\n\n if (current.count > 0) {\n return;\n }\n\n root.removeEventListener(type, current.listener);\n rootsByType.delete(type);\n}\n\nfunction __mreactDispatchDelegatedEvent(root, type, event) {\n const state = __mreactDelegatedEventState();\n\n for (const target of event.composedPath()) {\n if (target === root) {\n break;\n }\n\n if (!(target instanceof HTMLElement)) {\n continue;\n }\n\n const listeners = state.elements.get(target)?.get(type);\n\n if (listeners === undefined || listeners.length === 0) {\n continue;\n }\n\n const activeListeners = listeners.slice();\n\n for (const listener of activeListeners) {\n __mreactCallWithCurrentTarget(listener, event, target);\n }\n\n if (event.cancelBubble) {\n break;\n }\n }\n}\n\nfunction __mreactCallWithCurrentTarget(listener, event, currentTarget) {\n const descriptor = Object.getOwnPropertyDescriptor(event, \"currentTarget\");\n\n Object.defineProperty(event, \"currentTarget\", {\n configurable: true,\n value: currentTarget,\n });\n\n try {\n listener.call(currentTarget, event);\n } finally {\n if (descriptor === undefined) {\n delete event.currentTarget;\n } else {\n Object.defineProperty(event, \"currentTarget\", descriptor);\n }\n }\n}\n\nfunction __mreactSyncAttributes(current, next) {\n for (const attribute of Array.from(current.attributes)) {\n if (!next.hasAttribute(attribute.name)) {\n current.removeAttribute(attribute.name);\n }\n }\n\n for (const attribute of Array.from(next.attributes)) {\n if (current.getAttribute(attribute.name) !== attribute.value) {\n current.setAttribute(attribute.name, attribute.value);\n }\n }\n}\n\nfunction __mreactSyncPropBindings(current, next) {\n const previousBindings = current.__mreactPropBindings;\n\n if (Array.isArray(previousBindings)) {\n for (const binding of previousBindings) {\n binding.dispose?.();\n }\n }\n\n const bindings = next.__mreactPropBindings;\n\n if (!Array.isArray(bindings) || bindings.length === 0) {\n current.__mreactPropBindings = [];\n current.__mreactHasReactiveProps = false;\n return;\n }\n\n current.__mreactPropBindings = bindings;\n current.__mreactHasReactiveProps = true;\n next.__mreactPropBindings = [];\n next.__mreactHasReactiveProps = false;\n\n for (const binding of bindings) {\n binding.retarget?.(current);\n }\n}\n\nfunction __mreactResumeChildren(current, next) {\n const nextChildren = Array.from(next.childNodes);\n const refreshTextBindings = next.__mreactHasEvents === true;\n let index = 0;\n\n while (index < nextChildren.length) {\n const currentChild = current.childNodes[index];\n const nextChild = nextChildren[index];\n\n if (currentChild === undefined) {\n current.appendChild(nextChild);\n index += 1;\n continue;\n }\n\n // Nodes owned by insertDynamic/bindText must replace the matching server\n // DOM so subsequent reactive updates mutate the live node/range instead of\n // appending beside stale SSR fallback content.\n const isDynamicNode = nextChild.__mreactDynamicNode === true;\n const isReactiveText = nextChild.__mreactReactiveText === true;\n\n if (isDynamicNode) {\n currentChild.replaceWith(nextChild);\n } else if (\n (refreshTextBindings || isReactiveText) &&\n currentChild.nodeType === Node.TEXT_NODE &&\n nextChild.nodeType === Node.TEXT_NODE\n ) {\n currentChild.replaceWith(nextChild);\n } else {\n __mreactResumeNode(currentChild, nextChild);\n }\n index += 1;\n }\n\n while (current.childNodes.length > nextChildren.length) {\n current.lastChild?.remove();\n }\n}\n`;\n return {\n code: stripTypeScriptWithOxc(entry),\n };\n}\n\nfunction workspaceRuntimePlugin(options: { routeFiles: readonly string[] }) {\n const routeFiles = new Set(options.routeFiles);\n const packageFile = (monorepoDir: string, packageName: string, entry: string): string =>\n workspacePackageFile({\n currentFileUrl: import.meta.url,\n entry,\n monorepoDir,\n packageName,\n });\n const reactiveCorePath = packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"index\");\n const reactiveCoreDir = dirname(reactiveCorePath);\n const runtimePaths = new Map([\n [\n \"@reckona/mreact-reactive-core/internal\",\n packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"internal\"),\n ],\n [\"@reckona/mreact-compat\", packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"index\")],\n [\n \"@reckona/mreact-compat/event-priority\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"event-priority\"),\n ],\n [\n \"@reckona/mreact-compat/flight\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"flight\"),\n ],\n [\n \"@reckona/mreact-compat/internal\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"internal\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/scheduler\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"scheduler\"),\n ],\n [\n \"@reckona/mreact-reactive-dom\",\n packageFile(\"reactive-dom\", \"@reckona/mreact-reactive-dom\", \"index\"),\n ],\n ]);\n\n return {\n name: \"mreact-workspace-runtime\",\n setup(buildApi: RouterCompatBuildApi) {\n buildApi.onResolve({ filter: /^\\.\\/devtools\\.js$/ }, (args) =>\n args.importer?.startsWith(reactiveCoreDir) === true\n ? { namespace: \"mreact-devtools-stub\", path: \"devtools\" }\n : undefined,\n );\n buildApi.onResolve({ filter: /^@reckona\\/mreact-reactive-core$/ }, () => ({\n namespace: \"mreact-hot-runtime\",\n path: \"reactive-core\",\n }));\n buildApi.onResolve(\n {\n filter:\n /^@reckona\\/mreact-(?:compat|reactive-core|reactive-dom)(?:\\/(?:event-priority|flight|internal|jsx-dev-runtime|jsx-runtime|scheduler))?$/,\n },\n (args) => {\n const path = runtimePaths.get(args.path);\n\n return path === undefined ? undefined : { path };\n },\n );\n buildApi.onLoad({ filter: /^reactive-core$/, namespace: \"mreact-hot-runtime\" }, () => ({\n contents: `import { cell as nativeCell } from ${JSON.stringify(reactiveCorePath)};\nexport * from ${JSON.stringify(reactiveCorePath)};\nexport function cell(initial) {\n const routeCell = globalThis.__mreactRouteCell;\n return typeof routeCell === \"function\" ? routeCell(nativeCell, initial) : nativeCell(initial);\n}`,\n loader: \"ts\",\n resolveDir: reactiveCoreDir,\n }));\n buildApi.onLoad({ filter: /^devtools$/, namespace: \"mreact-devtools-stub\" }, () => ({\n contents: `export function emitReactiveDevtoolsEvent() {}\nexport function hasReactiveDevtoolsEmitter() { return false; }\nexport function currentDevtoolsEmitter() { return undefined; }`,\n loader: \"ts\",\n }));\n buildApi.onLoad({ filter: /\\.(?:mreact\\.)?[cm]?[jt]sx$/ }, async (args) => {\n if (!isRouteClientDependencySourcePath(args.path, routeFiles)) {\n return undefined;\n }\n\n const source = await readFile(args.path, \"utf8\");\n const moduleContext = createCompilerModuleContext({\n code: source,\n filename: args.path,\n });\n\n if (!hasJsxSyntax(moduleContext.program)) {\n return undefined;\n }\n\n const output = transformCompilerModuleContext({\n code: source,\n dev: true,\n filename: args.path,\n mode: isCompatSourcePath(args.path) ? \"compat\" : \"reactive\",\n moduleContext,\n target: \"client\",\n });\n\n if (output.diagnostics.length > 0) {\n throw new Error(\n output.diagnostics\n .map((diagnostic) => formatDiagnostic(args.path, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n return {\n contents: output.code,\n loader: \"tsx\",\n resolveDir: dirname(args.path),\n };\n });\n },\n };\n}\n\nfunction isRouteClientDependencySourcePath(path: string, routeFiles: ReadonlySet<string>): boolean {\n return !routeFiles.has(path) && !path.includes(`${sep}node_modules${sep}`);\n}\n\nfunction isCompatSourcePath(path: string): boolean {\n return /\\.compat(?:\\.mreact)?(?:\\.[cm]?[jt]sx?)?$/.test(path);\n}\n\n/**\n * Detects the `export const clientNavigation = false` hint in a page module\n * source. Returns the hinted value, or `true` when no hint is present (i.e.,\n * preserve the historical \"navigation runtime is always present\" behavior).\n *\n * Regex-based to avoid pulling the JS parser into the build path. The pattern\n * accepts the common formatting variants:\n * export const clientNavigation = false\n * export const clientNavigation = false ;\n * export const clientNavigation: boolean = false\n */\nexport function detectClientNavigationHint(source: string): boolean {\n const match = source.match(\n /export\\s+const\\s+clientNavigation\\s*(?::\\s*[^=]+)?=\\s*(true|false)\\s*;?/,\n );\n return match === null ? true : match[1] === \"true\";\n}\n\nexport function detectNavigationRuntimeHint(source: string): boolean {\n const match = source.match(\n /export\\s+const\\s+navigationRuntime\\s*(?::\\s*[^=]+)?=\\s*(true|false)\\s*;?/,\n );\n return match !== null && match[1] === \"true\";\n}\n\nfunction detectRouteCellStateHint(code: string): boolean {\n const callExpression = routeCellCallExpressionSource(code);\n\n return callExpression === undefined\n ? /\\bcell\\d*\\s*\\(/.test(code)\n : new RegExp(`(?:${callExpression})\\\\s*\\\\(`).test(code);\n}\n\nfunction detectRouteReactiveEffectHint(code: string): boolean {\n return (\n /from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/.test(code) &&\n /\\beffect\\s*\\(/.test(code)\n );\n}\n\nasync function inferClientReferenceManifestForBundle(options: {\n code: string;\n filename: string;\n routePath: string;\n}): Promise<readonly ClientReferenceMetadata[]> {\n const cache = createClientRouteInferenceCache();\n const moduleContext = await compilerModuleContextForSource({\n cache,\n code: options.code,\n filename: options.filename,\n });\n const inference = await inferClientRouteModule({\n cache,\n code: options.code,\n filename: options.filename,\n moduleContext,\n routePath: options.routePath,\n });\n\n if (inference.clientBoundaryImports.length === 0) {\n return [];\n }\n\n const output = transformCompilerModuleContext({\n code: options.code,\n clientBoundaryImports: inference.clientBoundaryImports,\n dev: true,\n filename: options.filename,\n moduleContext,\n target: \"server\",\n });\n\n return output.metadata.clientReferenceManifest ?? [];\n}\n\nfunction emitClientReferenceImportBlock(imports: readonly ClientReferenceImport[]): string {\n if (imports.length === 0) {\n return \"\";\n }\n\n return `${imports\n .map((reference, index) => {\n const localName = clientReferenceLocalName(index);\n\n return isIdentifierName(reference.exportName)\n ? `import { ${reference.exportName} as ${localName} } from ${JSON.stringify(reference.importSource)};`\n : `import * as ${localName} from ${JSON.stringify(reference.importSource)};`;\n })\n .join(\"\\n\")}\\n`;\n}\n\nfunction emitClientReferenceRegistry(\n manifest: readonly ClientReferenceMetadata[],\n imports: readonly ClientReferenceImport[],\n compatNames: ReadonlySet<string>,\n): string {\n const importedExpressions = new Map(\n imports.map((reference, index) => [\n reference.name,\n isIdentifierName(reference.exportName)\n ? clientReferenceLocalName(index)\n : `${clientReferenceLocalName(index)}[${JSON.stringify(reference.exportName)}]`,\n ]),\n );\n const entries = manifest.flatMap((reference) => {\n const expression =\n importedExpressions.get(reference.name) ?? clientReferenceExpression(reference.name);\n\n return expression === undefined\n ? []\n : [\n compatNames.has(reference.name)\n ? ` [${JSON.stringify(reference.name)}, { component: ${expression}, compat: true }],`\n : ` [${JSON.stringify(reference.name)}, ${expression}],`,\n ];\n });\n\n return [\"const __mreactClientReferenceComponents = new Map([\", ...entries, \"]);\"].join(\"\\n\");\n}\n\nfunction compatClientReferenceComponentNames(\n manifest: readonly ClientReferenceMetadata[],\n): ReadonlySet<string> {\n return new Set(\n manifest\n .filter((reference) => isCompatSourcePath(reference.moduleId))\n .map((reference) => reference.name),\n );\n}\n\nfunction emitCompatClientReferenceImportBlock(compatNames: ReadonlySet<string>): string {\n return compatNames.size === 0\n ? \"\"\n : 'import { createElement as __mreactCompatCreateElement, createRoot as __mreactCompatCreateRoot } from \"@reckona/mreact-compat\";\\n';\n}\n\nfunction clientReferenceLocalName(index: number): string {\n return `__mreactClientReference${index}`;\n}\n\nfunction clientReferenceExpression(name: string): string | undefined {\n return /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$/.test(name) ? name : undefined;\n}\n\nfunction routeComponentExpressionForComponents(components: readonly ComponentMetadata[]): string {\n const candidates = uniqueStrings([\n ...components\n .filter((component) => component.exportName === \"default\")\n .map((component) => component.name),\n \"Page\",\n \"DefaultExport\",\n ]).filter(isIdentifierName);\n\n return candidates.reduceRight(\n (next, name) => `typeof ${name} === \"function\" ? ${name} : ${next}`,\n \"undefined\",\n );\n}\n\nfunction uniqueStrings(values: readonly string[]): string[] {\n return Array.from(new Set(values));\n}\n\nfunction isIdentifierName(value: string): boolean {\n return /^[A-Za-z_$][\\w$]*$/.test(value);\n}\n\nfunction routeStateSignatureForSource(code: string): string {\n const callExpression = routeCellCallExpressionSource(code);\n const callsitePattern =\n callExpression === undefined\n ? /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*(cell\\d*|cell)\\s*\\(/g\n : new RegExp(\n `\\\\b(?:const|let|var)\\\\s+([A-Za-z_$][\\\\w$]*)\\\\s*=\\\\s*(${callExpression})\\\\s*\\\\(`,\n \"g\",\n );\n const cellCallsites = Array.from(\n code.matchAll(callsitePattern),\n (match) => `${match[1]}:${match[2]}`,\n );\n const countPattern =\n callExpression === undefined\n ? /\\bcell\\d*\\s*\\(/g\n : new RegExp(`(?:${callExpression})\\\\s*\\\\(`, \"g\");\n const signature =\n cellCallsites.length > 0\n ? cellCallsites.join(\"\\n\")\n : `cell-count:${(code.match(countPattern) ?? []).length}`;\n\n return createHash(\"sha256\").update(signature).digest(\"hex\").slice(0, 16);\n}\n\nfunction routeCellCallExpressionSource(code: string): string | undefined {\n const namedImports = new Set<string>();\n const namespaceImports = new Set<string>();\n const namedImportPattern =\n /import\\s+\\{(?<imports>[^}]*)\\}\\s+from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/g;\n\n for (const match of code.matchAll(namedImportPattern)) {\n const imports = match.groups?.imports;\n\n if (imports === undefined) {\n continue;\n }\n\n for (const part of imports.split(\",\")) {\n const specifier = part.trim();\n const alias = /^cell\\s+as\\s+([A-Za-z_$][\\w$]*)$/.exec(specifier);\n\n if (specifier === \"cell\") {\n namedImports.add(\"cell\");\n } else if (alias?.[1] !== undefined) {\n namedImports.add(alias[1]);\n }\n }\n }\n\n const namespaceImportPattern =\n /import\\s+\\*\\s+as\\s+([A-Za-z_$][\\w$]*)\\s+from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/g;\n\n for (const match of code.matchAll(namespaceImportPattern)) {\n if (match[1] !== undefined) {\n namespaceImports.add(match[1]);\n }\n }\n\n const alternatives = [\n ...Array.from(namedImports, (name) => `\\\\b${escapeRegExp(name)}`),\n ...Array.from(namespaceImports, (name) => `\\\\b${escapeRegExp(name)}\\\\.cell`),\n ];\n\n return alternatives.length === 0 ? undefined : `(?:${alternatives.join(\"|\")})`;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction escapeScriptJson(value: string): string {\n return value.replaceAll(\"<\", \"\\\\u003c\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EACL,gCAAgC,EAChC,gBAAgB,GAOjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,2CAA2C,EAC3C,2BAA2B,EAC3B,sBAAsB,EACtB,8BAA8B,GAE/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,GAIpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,2BAA2B,E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tD,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\nimport { readFile, stat } from \"node:fs/promises\";\nimport { builtinModules } from \"node:module\";\nimport { dirname, extname, join, relative, sep } from \"node:path\";\nimport {\n collectClientRouteModuleAnalysis,\n formatDiagnostic,\n type ComponentMetadata,\n type ClientRouteModuleAnalysis,\n type ClientRouteStaticImportReference,\n type ClientReferenceMetadata,\n type StaticImportReference,\n type TopLevelExportRenderInfo,\n} from \"@reckona/mreact-compiler\";\nimport {\n collectClientRouteModuleAnalysisFromContext,\n createCompilerModuleContext,\n stripTypeScriptWithOxc,\n transformCompilerModuleContext,\n type CompilerModuleContext,\n} from \"@reckona/mreact-compiler/internal\";\nimport { assetPath } from \"./assets.js\";\nimport {\n bundleRouterModule,\n bundleRouterModules,\n type RouterCompatBuildApi,\n type RouterBundleAssetOutput,\n type RouterBundleChunkOutput,\n} from \"./bundle-pipeline.js\";\nimport type { AppRoute } from \"./routes.js\";\nimport { existingRouteShellCandidates } from \"./route-shells.js\";\nimport { stripRouteClientOnlyExports } from \"./route-source.js\";\nimport { hasJsxSyntax } from \"./source-jsx.js\";\nimport { sourceModuleCandidates } from \"./source-modules.js\";\nimport { escapeHtmlQuotedAttribute as escapeHtmlAttribute } from \"@reckona/mreact-shared/html-escape\";\nimport { workspacePackageFile } from \"./workspace-packages.js\";\nimport type { Plugin, PluginOption } from \"vite\";\n\nconst nodeBuiltinPackages = new Set(builtinModules.flatMap((name) => [name, `node:${name}`]));\n\nexport interface ClientRouteManifestEntry {\n bytes?: number;\n css?: readonly string[];\n path: string;\n kind: AppRoute[\"kind\"];\n client: boolean;\n devScript?: string;\n imports?: readonly string[];\n navigation?: boolean;\n navigationScript?: string;\n routeId?: string;\n script?: string;\n sourceMap?: string;\n}\n\nexport interface BuildClientRouteOutputOptions {\n code: string;\n clientBoundaryImports?: readonly string[] | undefined;\n clientReferenceImports?: readonly ClientReferenceImport[] | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n filename: string;\n minify?: boolean | undefined;\n routePath: string;\n sourceMap?: boolean | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n clientNavigation?: boolean | undefined;\n}\n\nexport interface BuildClientRouteBatchOutput {\n assets?: RouterBundleAssetOutput[] | undefined;\n chunks: readonly RouterBundleChunkOutput[];\n routes: readonly BuildClientRouteBatchRouteOutput[];\n}\n\nexport interface BuildClientRouteBatchRouteOutput {\n chunk: RouterBundleChunkOutput;\n routeId: string;\n routePath: string;\n}\n\nexport interface ClientRouteInferenceCache {\n moduleAnalysisByFile: Map<string, Promise<ClientRouteModuleAnalysis>>;\n moduleContextByFile: Map<string, Promise<CompilerModuleContext>>;\n resolvedByImport: Map<string, Promise<string | undefined>>;\n sourceByFile: Map<string, Promise<CachedClientRouteSource>>;\n transformedSourceByFile: Map<string, Promise<CachedClientRouteSource>>;\n}\n\ninterface CachedClientRouteSource {\n signature: string;\n source: string;\n}\n\ninterface ClientRouteSourceTransform {\n cacheKey: string;\n transform(filename: string, code: string): Promise<string>;\n}\n\nexport interface ClientRouteInferenceResult {\n client: boolean;\n clientBoundaryImports: string[];\n diagnostics: ClientRouteInferenceDiagnostic[];\n}\n\ninterface ClientRouteModuleInferenceResult extends ClientRouteInferenceResult {\n clientBoundaryExportNames: string[];\n clientBoundaryModule: boolean;\n nestedClientExportNames: string[];\n clientReferenceSourceFiles: string[];\n serverOnly: boolean;\n serverOnlyClientRuntime: boolean;\n}\n\nexport interface ClientReferenceImport {\n exportName: string;\n importSource: string;\n name: string;\n}\n\nexport interface ClientRouteReferenceResult extends ClientRouteInferenceResult {\n clientReferenceImports: ClientReferenceImport[];\n clientReferenceManifest: ClientReferenceMetadata[];\n}\n\nexport interface ClientRouteInferenceDiagnostic {\n code:\n | typeof clientBoundaryInferenceServerOnlyReferenceCode\n | typeof clientBoundaryInferenceUnsupportedReferenceCode;\n filename: string;\n level: \"warn\";\n localNames: string[];\n message: string;\n source: string;\n}\n\nconst clientBoundaryInferenceServerOnlyReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_SERVER_ONLY_REFERENCE\";\nconst clientBoundaryInferenceUnsupportedReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_UNSUPPORTED_REFERENCE\";\n\nexport async function routeToClientManifestEntry(\n route: AppRoute,\n): Promise<ClientRouteManifestEntry> {\n if (route.kind !== \"page\") {\n return { path: route.path, kind: route.kind, client: false };\n }\n\n const code = await readFile(route.file, \"utf8\");\n const inference = await inferClientRouteModule({\n code: stripRouteClientOnlyExports(code),\n filename: route.file,\n routePath: route.path,\n });\n\n return inference.client\n ? {\n path: route.path,\n kind: route.kind,\n client: true,\n routeId: routeIdForPath(route.path),\n script: clientScriptForPath(route.path),\n }\n : { path: route.path, kind: route.kind, client: false };\n}\n\nexport function createClientRouteInferenceCache(): ClientRouteInferenceCache {\n return {\n moduleAnalysisByFile: new Map(),\n moduleContextByFile: new Map(),\n resolvedByImport: new Map(),\n sourceByFile: new Map(),\n transformedSourceByFile: new Map(),\n };\n}\n\nexport async function isClientRouteModule(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n routePath?: string | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<boolean> {\n return (await inferClientRouteModule(options)).client;\n}\n\nexport async function inferClientRouteModule(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n moduleContext?: CompilerModuleContext | undefined;\n routePath?: string | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<ClientRouteInferenceResult> {\n const cache = options.cache ?? createClientRouteInferenceCache();\n const sourceTransform = clientRouteSourceTransformForVitePlugins(options.vitePlugins);\n const code = await transformClientRouteSource({\n code: options.code,\n filename: options.filename,\n sourceTransform,\n });\n\n try {\n const routeInference = await inferClientRouteModuleSource({\n cache,\n code,\n filename: options.filename,\n ...(sourceTransform === undefined ? { moduleContext: options.moduleContext } : {}),\n root: true,\n seen: new Set(),\n sourceTransform,\n });\n\n if (options.appDir === undefined) {\n return routeInference;\n }\n\n const shellInferences = await inferClientRouteShellModules({\n appDir: options.appDir,\n cache,\n filename: options.filename,\n sourceTransform,\n });\n\n return {\n client: routeInference.client || shellInferences.some((inference) => inference.client),\n clientBoundaryImports: routeInference.clientBoundaryImports,\n diagnostics: [\n ...routeInference.diagnostics,\n ...shellInferences.flatMap((inference) => inference.diagnostics),\n ],\n };\n } catch (error) {\n throw new Error(\n `Failed to infer client route for ${options.routePath ?? \"<unknown>\"} (${options.filename}).\\n${errorMessage(error)}`,\n { cause: error },\n );\n }\n}\n\nexport async function collectClientRouteReferences(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<ClientRouteReferenceResult> {\n const cache = options.cache ?? createClientRouteInferenceCache();\n const sourceTransform = clientRouteSourceTransformForVitePlugins(options.vitePlugins);\n const code = await transformClientRouteSource({\n code: options.code,\n filename: options.filename,\n sourceTransform,\n });\n const routeModuleContext = await compilerModuleContextForSource({\n cache,\n code,\n filename: options.filename,\n });\n const routeInference = await inferClientRouteModuleSource({\n cache,\n code,\n filename: options.filename,\n moduleContext: routeModuleContext,\n root: true,\n seen: new Set(),\n sourceTransform,\n });\n const sources: Array<{\n code: string;\n filename: string;\n inference: ClientRouteModuleInferenceResult;\n moduleContext: CompilerModuleContext;\n }> = [];\n const seenSourceFiles = new Set<string>();\n const addSource = async (sourceOptions: {\n code: string;\n filename: string;\n inference?: ClientRouteModuleInferenceResult | undefined;\n moduleContext?: CompilerModuleContext | undefined;\n }) => {\n if (seenSourceFiles.has(sourceOptions.filename)) {\n return;\n }\n\n seenSourceFiles.add(sourceOptions.filename);\n const moduleContext =\n sourceOptions.moduleContext ??\n (await compilerModuleContextForSource({\n cache,\n code: sourceOptions.code,\n filename: sourceOptions.filename,\n }));\n const inference =\n sourceOptions.inference ??\n (await inferClientRouteModuleSource({\n cache,\n code: sourceOptions.code,\n filename: sourceOptions.filename,\n moduleContext,\n root: true,\n seen: new Set(),\n sourceTransform,\n }));\n sources.push({\n code: sourceOptions.code,\n filename: sourceOptions.filename,\n inference,\n moduleContext,\n });\n\n for (const referenceFile of inference.clientReferenceSourceFiles) {\n const code = stripRouteClientOnlyExports(\n await readClientRouteSource({ cache, filename: referenceFile, sourceTransform }),\n );\n await addSource({ code, filename: referenceFile });\n }\n };\n\n await addSource({\n code,\n filename: options.filename,\n inference: routeInference,\n moduleContext: routeModuleContext,\n });\n\n if (options.appDir !== undefined) {\n for (const shell of await clientShellFilesForPage(options.appDir, options.filename)) {\n const code = stripRouteClientOnlyExports(\n await readClientRouteSource({ cache, filename: shell, sourceTransform }),\n );\n const moduleContext = await compilerModuleContextForSource({\n cache,\n code,\n filename: shell,\n });\n await addSource({\n code,\n filename: shell,\n inference: await inferClientRouteModuleSource({\n cache,\n code,\n filename: shell,\n moduleContext,\n root: true,\n seen: new Set(),\n sourceTransform,\n }),\n moduleContext,\n });\n }\n }\n\n const clientReferenceManifest: ClientReferenceMetadata[] = [];\n const clientReferenceImports: ClientReferenceImport[] = [];\n const seenReferences = new Set<string>();\n\n for (const source of sources) {\n const output = transformCompilerModuleContext({\n code: source.code,\n clientBoundaryImports: source.inference.clientBoundaryImports,\n dev: false,\n filename: source.filename,\n moduleContext: source.moduleContext,\n target: \"server\",\n });\n const fatalDiagnostics = output.diagnostics.filter(\n (diagnostic) =>\n diagnostic.code !== \"MR_UNSUPPORTED_SERVER_EVENT_HANDLER\" &&\n diagnostic.code !== \"MR_UNSUPPORTED_AWAIT_INNER_COMPONENT\",\n );\n\n if (fatalDiagnostics.length > 0) {\n throw new Error(\n fatalDiagnostics\n .map((diagnostic) => formatDiagnostic(source.filename, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n for (const reference of output.metadata.clientReferenceManifest ?? []) {\n const key = `${reference.name}\\0${reference.moduleId}\\0${reference.exportName}`;\n\n if (seenReferences.has(key)) {\n continue;\n }\n\n seenReferences.add(key);\n clientReferenceManifest.push(reference);\n clientReferenceImports.push({\n exportName: reference.exportName,\n importSource: clientReferenceImportSource({\n moduleId: reference.moduleId,\n routeFile: options.filename,\n sourceFile: source.filename,\n }),\n name: reference.name,\n });\n }\n }\n\n return {\n client:\n routeInference.client ||\n sources.some((source) => source.filename !== options.filename && source.inference.client),\n clientBoundaryImports: routeInference.clientBoundaryImports,\n clientReferenceImports,\n clientReferenceManifest,\n diagnostics: sources.flatMap((source) => source.inference.diagnostics),\n };\n}\n\nasync function inferClientRouteShellModules(options: {\n appDir: string;\n cache: ClientRouteInferenceCache;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<ClientRouteInferenceResult[]> {\n return Promise.all(\n (await clientShellFilesForPage(options.appDir, options.filename)).map(async (shell) => {\n const code = stripRouteClientOnlyExports(\n await readClientRouteSource({\n cache: options.cache,\n filename: shell,\n sourceTransform: options.sourceTransform,\n }),\n );\n return await inferClientRouteModuleSource({\n cache: options.cache,\n code,\n filename: shell,\n root: true,\n seen: new Set(),\n sourceTransform: options.sourceTransform,\n });\n }),\n );\n}\n\nasync function clientShellFilesForPage(appDir: string, pageFile: string): Promise<string[]> {\n const existing = await existingRouteShellCandidates(\n appDir,\n pageFile,\n async (file) => file !== pageFile && (await isFile(file)),\n );\n\n return existing.map((candidate) => candidate.file);\n}\n\nfunction clientReferenceImportSource(options: {\n moduleId: string;\n routeFile: string;\n sourceFile: string;\n}): string {\n if (!options.moduleId.startsWith(\".\")) {\n return options.moduleId;\n }\n\n const absolute = join(dirname(options.sourceFile), options.moduleId);\n const relativeImport = relative(dirname(options.routeFile), absolute).replaceAll(sep, \"/\");\n\n return relativeImport.startsWith(\".\") ? relativeImport : `./${relativeImport}`;\n}\n\nexport function isClientRouteSource(code: string): boolean {\n const analysis = collectClientRouteModuleAnalysis({ code });\n\n return (\n analysis.hasUseClientDirective || (!analysis.hasUseServerDirective && analysis.clientRuntime)\n );\n}\n\nfunction isExplicitClientRouteSource(\n analysis: ClientRouteModuleAnalysis,\n filename: string,\n): boolean {\n return analysis.hasUseClientDirective || isClientBoundaryFilename(filename);\n}\n\nfunction isClientBoundaryFilename(filename: string): boolean {\n return /\\.(?:client|compat)(?:\\.mreact)?\\.[cm]?[jt]sx?$/.test(filename);\n}\n\nfunction isServerOnlyClientRouteSource(analysis: ClientRouteModuleAnalysis): boolean {\n return analysis.hasUseServerDirective;\n}\n\nfunction isServerOnlyImportSource(source: string): boolean {\n return nodeBuiltinPackages.has(source);\n}\n\nfunction hasServerOnlyImports(analysis: ClientRouteModuleAnalysis): boolean {\n return analysis.staticImports.some((reference) => isServerOnlyImportSource(reference.source));\n}\n\nasync function inferClientRouteModuleSource(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n moduleContext?: CompilerModuleContext | undefined;\n root: boolean;\n seen: Set<string>;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<ClientRouteModuleInferenceResult> {\n const analysis = await clientRouteModuleAnalysisForSource(options);\n\n if (isServerOnlyClientRouteSource(analysis)) {\n return emptyClientRouteModuleInferenceResult({\n serverOnly: true,\n serverOnlyClientRuntime: analysis.clientRuntime,\n });\n }\n\n if (isExplicitClientRouteSource(analysis, options.filename)) {\n return emptyClientRouteModuleInferenceResult({\n client: true,\n clientBoundaryModule: true,\n });\n }\n\n if (options.seen.has(options.filename)) {\n return emptyClientRouteModuleInferenceResult();\n }\n\n options.seen.add(options.filename);\n\n try {\n const clientBoundaryImports: string[] = [];\n const clientBoundaryExportNames = new Set<string>();\n const nestedClientExportNames = new Set<string>();\n const clientReferenceSourceFiles: string[] = [];\n const diagnostics: ClientRouteInferenceDiagnostic[] = [];\n let clientProxy = false;\n let nestedClient = false;\n const exportInfo = analysis.topLevelExportRenderInfo;\n const implicitModuleClient = exportInfo.length === 0 && analysis.clientRuntime;\n for (const info of exportInfo) {\n if (info.clientRuntime) {\n clientBoundaryExportNames.add(info.name);\n }\n }\n if (\n hasServerOnlyImports(analysis) &&\n (implicitModuleClient || clientBoundaryExportNames.size > 0)\n ) {\n return emptyClientRouteModuleInferenceResult({\n serverOnly: true,\n serverOnlyClientRuntime: true,\n });\n }\n const jsxComponentRoots = new Set(analysis.jsxComponentRoots);\n const componentCallRoots = new Set(analysis.componentCallRoots);\n const renderedComponentRoots = unionSets(jsxComponentRoots, componentCallRoots);\n const identifierReferences = new Set(analysis.identifierReferences);\n\n for (const reference of analysis.staticImports) {\n const renderedByJsx = isRenderedImportReference(reference, jsxComponentRoots);\n const renderedByCall = isRenderedImportReference(reference, componentCallRoots);\n const rendered = isRenderedImportReference(reference, renderedComponentRoots);\n const referenced = isReferencedImportReference(reference, identifierReferences);\n\n if (\n !rendered &&\n (!referenced || !hasPotentialClientBoundaryReference(reference, identifierReferences))\n ) {\n continue;\n }\n if (reference.sideEffect && isStyleModuleSpecifier(reference.source)) {\n continue;\n }\n\n const resolved = await resolveAppLocalModule({\n allowExplicitNonSource: options.sourceTransform !== undefined,\n cache: options.cache,\n importer: options.filename,\n specifier: reference.source,\n });\n\n if (resolved === undefined) {\n continue;\n }\n\n const source = await readClientRouteSource({\n cache: options.cache,\n filename: resolved,\n sourceTransform: options.sourceTransform,\n });\n const imported = await inferClientRouteModuleSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n moduleContext: await compilerModuleContextForSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n }),\n root: false,\n seen: options.seen,\n sourceTransform: options.sourceTransform,\n });\n diagnostics.push(...imported.diagnostics);\n\n if (!imported.client) {\n if (imported.serverOnlyClientRuntime && rendered) {\n diagnostics.push(\n serverOnlyClientImportReferenceDiagnostic({\n filename: options.filename,\n reference,\n }),\n );\n }\n continue;\n }\n\n if (rendered) {\n const importedExportNames = renderedImportedExportNames(reference, renderedComponentRoots);\n const renderedExportNames = renderedLocalExportNames(reference, exportInfo);\n const importedBoundary =\n imported.clientBoundaryModule ||\n matchesInferredExportNames(importedExportNames, imported.clientBoundaryExportNames);\n const importedNested = matchesInferredExportNames(\n importedExportNames,\n imported.nestedClientExportNames,\n );\n if (!importedBoundary && !importedNested) {\n continue;\n }\n\n nestedClient = true;\n\n for (const exportName of renderedExportNames) {\n if (importedBoundary || importedNested || renderedByCall) {\n nestedClientExportNames.add(exportName);\n }\n }\n\n if (renderedByCall && !renderedByJsx) {\n continue;\n }\n\n if (!importedBoundary) {\n clientReferenceSourceFiles.push(resolved);\n continue;\n }\n\n clientBoundaryImports.push(reference.source);\n continue;\n }\n\n const diagnostic = unsupportedClientImportReferenceDiagnostic({\n filename: options.filename,\n identifierReferences,\n reference,\n });\n\n if (diagnostic !== undefined) {\n diagnostics.push(diagnostic);\n }\n }\n\n if (!options.root) {\n for (const reference of analysis.staticExports) {\n const resolved = await resolveAppLocalModule({\n allowExplicitNonSource: options.sourceTransform !== undefined,\n cache: options.cache,\n importer: options.filename,\n specifier: reference.source,\n });\n\n if (resolved === undefined) {\n continue;\n }\n\n const source = await readClientRouteSource({\n cache: options.cache,\n filename: resolved,\n sourceTransform: options.sourceTransform,\n });\n const exported = await inferClientRouteModuleSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n moduleContext: await compilerModuleContextForSource({\n cache: options.cache,\n code: source,\n filename: resolved,\n }),\n root: false,\n seen: options.seen,\n sourceTransform: options.sourceTransform,\n });\n diagnostics.push(...exported.diagnostics);\n\n if (exported.clientBoundaryModule) {\n clientProxy = true;\n } else if (exported.clientBoundaryExportNames.length > 0) {\n for (const exportName of reference.exportedNames) {\n if (exported.clientBoundaryExportNames.includes(exportName)) {\n clientBoundaryExportNames.add(exportName);\n }\n }\n } else if (exported.client) {\n nestedClient = true;\n clientReferenceSourceFiles.push(resolved);\n }\n }\n }\n\n return {\n client:\n clientBoundaryImports.length > 0 ||\n clientBoundaryExportNames.size > 0 ||\n implicitModuleClient ||\n clientProxy ||\n nestedClient,\n clientBoundaryImports,\n clientBoundaryExportNames: Array.from(clientBoundaryExportNames),\n clientBoundaryModule: clientProxy || implicitModuleClient,\n nestedClientExportNames: Array.from(nestedClientExportNames),\n clientReferenceSourceFiles: Array.from(new Set(clientReferenceSourceFiles)),\n diagnostics,\n serverOnly: false,\n serverOnlyClientRuntime: false,\n };\n } finally {\n options.seen.delete(options.filename);\n }\n}\n\nfunction emptyClientRouteModuleInferenceResult(\n overrides: Partial<ClientRouteModuleInferenceResult> = {},\n): ClientRouteModuleInferenceResult {\n return {\n client: false,\n clientBoundaryImports: [],\n clientBoundaryExportNames: [],\n clientBoundaryModule: false,\n nestedClientExportNames: [],\n clientReferenceSourceFiles: [],\n diagnostics: [],\n serverOnly: false,\n serverOnlyClientRuntime: false,\n ...overrides,\n };\n}\n\nasync function clientRouteModuleAnalysisForSource(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n moduleContext?: CompilerModuleContext | undefined;\n}): Promise<ClientRouteModuleAnalysis> {\n const cacheKey = sourceAnalysisCacheKey(options.filename, options.code);\n const cached = options.cache.moduleAnalysisByFile.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const analysis = Promise.resolve().then(async () =>\n collectClientRouteModuleAnalysisFromContext(\n options.moduleContext ??\n (await compilerModuleContextForSource({\n cache: options.cache,\n code: options.code,\n filename: options.filename,\n })),\n ),\n );\n options.cache.moduleAnalysisByFile.set(cacheKey, analysis);\n return analysis;\n}\n\nexport async function compilerModuleContextForSource(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n}): Promise<CompilerModuleContext> {\n const cacheKey = sourceAnalysisCacheKey(options.filename, options.code);\n const cached = options.cache.moduleContextByFile.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const context = Promise.resolve().then(() =>\n createCompilerModuleContext({\n code: options.code,\n filename: options.filename,\n }),\n );\n options.cache.moduleContextByFile.set(cacheKey, context);\n return context;\n}\n\nfunction sourceAnalysisCacheKey(filename: string, code: string): string {\n return `${filename}\\0${hashSourceText(code)}`;\n}\n\nfunction hashSourceText(text: string): string {\n return createHash(\"sha256\").update(text).digest(\"hex\");\n}\n\nfunction isRenderedImportReference(\n reference: StaticImportReference,\n componentRoots: ReadonlySet<string>,\n): boolean {\n return (\n reference.sideEffect || reference.localNames.some((localName) => componentRoots.has(localName))\n );\n}\n\nfunction isReferencedImportReference(\n reference: StaticImportReference,\n identifierReferences: ReadonlySet<string>,\n): boolean {\n return (\n reference.sideEffect ||\n reference.localNames.some((localName) => identifierReferences.has(localName))\n );\n}\n\nfunction hasPotentialClientBoundaryReference(\n reference: ClientRouteStaticImportReference,\n identifierReferences: ReadonlySet<string>,\n): boolean {\n return (\n reference.sideEffect ||\n reference.specifiers.some(\n (specifier) =>\n specifier.kind === \"namespace\" && identifierReferences.has(specifier.localName),\n ) ||\n reference.localNames.some(\n (localName) => identifierReferences.has(localName) && startsUppercase(localName),\n )\n );\n}\n\nfunction isStyleModuleSpecifier(source: string): boolean {\n const pathname = source.split(/[?#]/u, 1)[0] ?? source;\n return styleModuleExtensions.has(extname(pathname));\n}\n\nconst styleModuleExtensions = new Set([\n \".css\",\n \".less\",\n \".sass\",\n \".scss\",\n \".styl\",\n \".stylus\",\n]);\n\nfunction renderedImportedExportNames(\n reference: ClientRouteStaticImportReference,\n componentRoots: ReadonlySet<string>,\n): string[] | undefined {\n if (reference.sideEffect) {\n return undefined;\n }\n\n const names = new Set<string>();\n\n for (const specifier of reference.specifiers) {\n if (!componentRoots.has(specifier.localName)) {\n continue;\n }\n\n if (specifier.kind === \"namespace\") {\n return undefined;\n }\n\n names.add(specifier.importedName);\n }\n\n return Array.from(names);\n}\n\nfunction renderedLocalExportNames(\n reference: StaticImportReference,\n exportInfo: readonly TopLevelExportRenderInfo[],\n): string[] {\n const localNames = new Set(reference.localNames);\n const rendered = exportInfo\n .filter((info) => renderedComponentRootNames(info).some((root) => localNames.has(root)))\n .map((info) => info.name);\n\n return rendered.length === 0 ? [\"default\"] : rendered;\n}\n\nfunction renderedComponentRootNames(info: TopLevelExportRenderInfo): string[] {\n return [...info.renderedComponentRoots, ...info.calledComponentRoots];\n}\n\nfunction unionSets<T>(left: ReadonlySet<T>, right: ReadonlySet<T>): ReadonlySet<T> {\n return new Set([...left, ...right]);\n}\n\nfunction matchesInferredExportNames(\n importedExportNames: readonly string[] | undefined,\n inferredExportNames: readonly string[],\n): boolean {\n if (importedExportNames === undefined) {\n return inferredExportNames.length > 0;\n }\n\n return importedExportNames.some((name) => inferredExportNames.includes(name));\n}\n\nfunction serverOnlyClientImportReferenceDiagnostic(options: {\n filename: string;\n reference: StaticImportReference;\n}): ClientRouteInferenceDiagnostic {\n return {\n code: clientBoundaryInferenceServerOnlyReferenceCode,\n filename: options.filename,\n level: \"warn\",\n localNames: options.reference.localNames,\n message:\n `${options.filename}: server-only component import ${JSON.stringify(options.reference.source)} ` +\n \"uses client runtime syntax but is marked with server-only semantics. Automatic client \" +\n \"boundary detection skipped it. Move the interactive UI behind a .client module or add an \" +\n \"explicit clientBoundaryImports entry.\",\n source: options.reference.source,\n };\n}\n\nfunction unsupportedClientImportReferenceDiagnostic(options: {\n filename: string;\n identifierReferences: ReadonlySet<string>;\n reference: StaticImportReference;\n}): ClientRouteInferenceDiagnostic | undefined {\n if (options.reference.sideEffect) {\n return undefined;\n }\n\n const localNames = options.reference.localNames.filter((name) =>\n options.identifierReferences.has(name),\n );\n\n if (localNames.length === 0) {\n return undefined;\n }\n\n return {\n code: clientBoundaryInferenceUnsupportedReferenceCode,\n filename: options.filename,\n level: \"warn\",\n localNames,\n message:\n `${options.filename}: client component import ${JSON.stringify(options.reference.source)} ` +\n `is referenced as ${localNames.map((name) => JSON.stringify(name)).join(\", \")} but ` +\n \"was not rendered through a supported static JSX pattern. Automatic client boundary \" +\n \"detection supports direct JSX such as <Counter />, JSX member roots such as \" +\n \"<components.Counter />, and simple aliases such as const Alias = Counter. For dynamic \" +\n `registries or computed component selection, add ${JSON.stringify(options.reference.source)} ` +\n \"to clientBoundaryImports.\",\n source: options.reference.source,\n };\n}\n\nfunction startsUppercase(value: string): boolean {\n return /^[A-Z]/.test(value);\n}\n\nexport function formatClientRouteInferenceDiagnostic(\n diagnostic: ClientRouteInferenceDiagnostic,\n): string {\n return `${diagnostic.code}: ${diagnostic.message}`;\n}\n\nasync function resolveAppLocalModule(options: {\n allowExplicitNonSource?: boolean | undefined;\n cache: ClientRouteInferenceCache;\n importer: string;\n specifier: string;\n}): Promise<string | undefined> {\n if (!options.specifier.startsWith(\".\")) {\n return undefined;\n }\n\n const cacheKey = `${options.importer}\\0${options.specifier}\\0${\n options.allowExplicitNonSource === true ? \"explicit\" : \"source\"\n }`;\n const cached = options.cache.resolvedByImport.get(cacheKey);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const resolved = resolveAppLocalModuleUncached({\n allowExplicitNonSource: options.allowExplicitNonSource === true,\n importer: options.importer,\n specifier: options.specifier,\n });\n options.cache.resolvedByImport.set(cacheKey, resolved);\n return resolved;\n}\n\nasync function resolveAppLocalModuleUncached(options: {\n allowExplicitNonSource: boolean;\n importer: string;\n specifier: string;\n}): Promise<string | undefined> {\n const { importer, specifier } = options;\n const base = join(dirname(importer), specifier);\n const candidates = sourceModuleCandidates(base);\n\n if (candidates.length === 0) {\n if (options.allowExplicitNonSource && extname(base) !== \"\" && (await isFile(base))) {\n return base;\n }\n\n return undefined;\n }\n\n for (const candidate of candidates) {\n if (await isFile(candidate)) {\n return candidate;\n }\n }\n\n throw new Error(`${importer}: could not resolve app-local import ${JSON.stringify(specifier)}.`);\n}\n\nasync function isFile(path: string): Promise<boolean> {\n try {\n return (await stat(path)).isFile();\n } catch {\n return false;\n }\n}\n\nasync function readCachedFile(cache: ClientRouteInferenceCache, filename: string): Promise<string> {\n const signature = await sourceFileSignature(filename);\n const cached = cache.sourceByFile.get(filename);\n\n if (cached !== undefined) {\n const source = await cached;\n\n if (source.signature === signature) {\n return source.source;\n }\n }\n\n const source = readFile(filename, \"utf8\").then((value) => ({\n signature,\n source: value,\n }));\n cache.sourceByFile.set(filename, source);\n return (await source).source;\n}\n\nasync function readClientRouteSource(options: {\n cache: ClientRouteInferenceCache;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<string> {\n if (options.sourceTransform === undefined) {\n return readCachedFile(options.cache, options.filename);\n }\n\n const signature = await sourceFileSignature(options.filename);\n const cacheKey = `${options.filename}\\0${options.sourceTransform.cacheKey}`;\n const cached = options.cache.transformedSourceByFile.get(cacheKey);\n\n if (cached !== undefined) {\n const source = await cached;\n\n if (source.signature === signature) {\n return source.source;\n }\n }\n\n const source = readCachedFile(options.cache, options.filename).then(async (code) => ({\n signature,\n source: await options.sourceTransform!.transform(options.filename, code),\n }));\n options.cache.transformedSourceByFile.set(cacheKey, source);\n return (await source).source;\n}\n\nasync function transformClientRouteSource(options: {\n code: string;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<string> {\n return options.sourceTransform === undefined\n ? options.code\n : await options.sourceTransform.transform(options.filename, options.code);\n}\n\nfunction clientRouteSourceTransformForVitePlugins(\n pluginOptions: readonly PluginOption[] | undefined,\n): ClientRouteSourceTransform | undefined {\n const plugins = orderVitePlugins(flattenVitePlugins(pluginOptions)).filter((plugin) =>\n hasViteTransformHook(plugin),\n );\n\n if (plugins.length === 0) {\n return undefined;\n }\n\n return {\n cacheKey: plugins.map((plugin, index) => `${index}:${plugin.name}`).join(\"\\0\"),\n async transform(filename, code) {\n let nextCode = code;\n\n for (const plugin of plugins) {\n const handler = viteTransformHookHandler(plugin);\n\n if (handler === undefined) {\n continue;\n }\n\n const result = await handler.call(\n createClientRouteViteTransformContext(plugin.name),\n nextCode,\n filename,\n { ssr: false },\n );\n\n if (typeof result === \"string\") {\n nextCode = result;\n } else if (result !== null && result !== undefined && typeof result === \"object\") {\n const codeResult = (result as { code?: unknown }).code;\n\n if (typeof codeResult === \"string\") {\n nextCode = codeResult;\n }\n }\n }\n\n return nextCode;\n },\n };\n}\n\nfunction flattenVitePlugins(pluginOptions: readonly PluginOption[] | undefined): Plugin[] {\n const plugins: Plugin[] = [];\n const visit = (option: PluginOption | null | false | undefined): void => {\n if (option === false || option === null || option === undefined) {\n return;\n }\n\n if (Array.isArray(option)) {\n for (const child of option) {\n visit(child);\n }\n return;\n }\n\n if (typeof option === \"object\" && \"then\" in option) {\n return;\n }\n\n plugins.push(option as Plugin);\n };\n\n for (const option of pluginOptions ?? []) {\n visit(option);\n }\n\n return plugins;\n}\n\nfunction orderVitePlugins(plugins: readonly Plugin[]): Plugin[] {\n return [\n ...plugins.filter((plugin) => plugin.enforce === \"pre\"),\n ...plugins.filter((plugin) => plugin.enforce !== \"pre\" && plugin.enforce !== \"post\"),\n ...plugins.filter((plugin) => plugin.enforce === \"post\"),\n ];\n}\n\nfunction hasViteTransformHook(plugin: Plugin): boolean {\n return viteTransformHookHandler(plugin) !== undefined;\n}\n\nfunction viteTransformHookHandler(plugin: Plugin):\n | ((\n this: unknown,\n code: string,\n id: string,\n options?: { ssr?: boolean | undefined },\n ) => unknown)\n | undefined {\n const transform = plugin.transform as unknown;\n\n if (typeof transform === \"function\") {\n return transform as (\n this: unknown,\n code: string,\n id: string,\n options?: { ssr?: boolean | undefined },\n ) => unknown;\n }\n\n if (transform !== null && typeof transform === \"object\") {\n const handler = (transform as { handler?: unknown }).handler;\n\n if (typeof handler === \"function\") {\n return handler as (\n this: unknown,\n code: string,\n id: string,\n options?: { ssr?: boolean | undefined },\n ) => unknown;\n }\n }\n\n return undefined;\n}\n\nfunction createClientRouteViteTransformContext(pluginName: string): unknown {\n return {\n addWatchFile() {},\n async resolve() {\n return null;\n },\n error(error: unknown): never {\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(String(error));\n },\n warn() {},\n getCombinedSourcemap() {\n return null;\n },\n parse() {\n throw new Error(\n `${pluginName}: client route import analysis cannot provide Rollup parser context.`,\n );\n },\n };\n}\n\nasync function sourceFileSignature(filename: string): Promise<string> {\n const stats = await stat(filename);\n\n return `${stats.mtimeMs}\\0${stats.size}`;\n}\n\nexport function routeIdForPath(path: string): string {\n if (path === \"/\") {\n return \"index\";\n }\n\n return path\n .slice(1)\n .replaceAll(\"/\", \"_\")\n .replaceAll(\":\", \"_\")\n .replace(/[^A-Za-z0-9_$-]/g, \"_\");\n}\n\nexport function clientScriptForPath(path: string): string {\n return `routes/${routeIdForPath(path)}.js`;\n}\n\nexport function navigationRuntimeScriptForDev(): string {\n return \"navigation.js\";\n}\n\nexport function withHydrationMarkers(options: {\n assetBaseUrl?: string | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n html: string;\n props: unknown;\n routePath: string;\n script?: string | undefined;\n}): string {\n const marker = hydrationMarkerParts({\n assetBaseUrl: options.assetBaseUrl,\n clientReferenceManifest: options.clientReferenceManifest,\n props: options.props,\n routePath: options.routePath,\n script: options.script,\n });\n\n return `${marker.prefix}${options.html}${marker.suffix}`;\n}\n\nexport function withRouteMarkers(options: { html: string; routePath: string }): string {\n const routeId = routeIdForPath(options.routePath);\n\n return `<div data-mreact-route-id=\"${escapeHtmlAttribute(routeId)}\">${options.html}</div>`;\n}\n\nexport function hydrationMarkerParts(options: {\n assetBaseUrl?: string | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n props: unknown;\n routePath: string;\n script?: string | undefined;\n}): { prefix: string; suffix: string } {\n const routeId = routeIdForPath(options.routePath);\n const escapedRouteId = escapeHtmlAttribute(routeId);\n const propsJson = escapeScriptJson(JSON.stringify(options.props));\n const script = options.script ?? clientScriptForPath(options.routePath);\n const scriptSrc = assetPath(script, options.assetBaseUrl ?? \"/_mreact/client/\");\n const clientReferencesJson =\n options.clientReferenceManifest === undefined || options.clientReferenceManifest.length === 0\n ? undefined\n : escapeScriptJson(JSON.stringify(options.clientReferenceManifest));\n\n return {\n prefix: `<div data-mreact-route-id=\"${escapedRouteId}\">`,\n suffix: [\n \"</div>\",\n `<script type=\"application/json\" id=\"mreact-props-${escapedRouteId}\">${propsJson}</script>`,\n clientReferencesJson === undefined\n ? undefined\n : `<script type=\"application/json\" id=\"mreact-client-references-${escapedRouteId}\">${clientReferencesJson}</script>`,\n `<script type=\"module\" src=\"${escapeHtmlAttribute(scriptSrc)}\"></script>`,\n ]\n .filter((part): part is string => part !== undefined)\n .join(\"\"),\n };\n}\n\nexport async function buildClientRouteBundle(options: {\n code: string;\n clientBoundaryImports?: readonly string[] | undefined;\n clientReferenceImports?: readonly ClientReferenceImport[] | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n filename: string;\n routePath: string;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<string> {\n return (await buildClientRouteOutput(options)).code;\n}\n\nexport async function buildNavigationRuntimeBundle(\n options: {\n minify?: boolean;\n sourceMap?: boolean;\n } = {},\n): Promise<{ code: string; map?: string }> {\n return buildClientRouteOutput({\n code: \"export default undefined;\",\n filename: \"__mreact_navigation_runtime.tsx\",\n routePath: \"/__mreact_navigation_runtime\",\n clientNavigation: true,\n ...(options.minify === undefined ? {} : { minify: options.minify }),\n ...(options.sourceMap === undefined ? {} : { sourceMap: options.sourceMap }),\n });\n}\n\nexport async function buildClientRouteOutput(\n options: BuildClientRouteOutputOptions,\n): Promise<{ code: string; map?: string }> {\n const entry = await buildClientRouteEntrySource(options);\n const bundled = await bundleRouterModule({\n code: entry.code,\n define: {\n __MREACT_CLIENT_DEVTOOLS__: \"false\",\n },\n filename: options.filename,\n minify: options.minify === true,\n platform: \"browser\",\n preserveExports: true,\n plugins: [workspaceRuntimePlugin({ routeFiles: [options.filename] })],\n sourceMap: options.sourceMap,\n vitePlugins: options.vitePlugins,\n });\n\n return {\n code: bundled.code,\n ...(bundled.map === undefined ? {} : { map: bundled.map }),\n };\n}\n\nexport async function buildClientRouteBatchOutput(options: {\n assetBaseUrl?: string | undefined;\n minify?: boolean;\n projectRoot?: string | undefined;\n routes: readonly BuildClientRouteOutputOptions[];\n sourceMap?: boolean;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<BuildClientRouteBatchOutput> {\n const entries = await Promise.all(\n options.routes.map(async (route) => ({\n filename: route.filename,\n name: routeIdForPath(route.routePath),\n routePath: route.routePath,\n source: await buildClientRouteEntrySource({\n ...route,\n minify: options.minify ?? route.minify,\n sourceMap: options.sourceMap ?? route.sourceMap,\n vitePlugins: options.vitePlugins ?? route.vitePlugins,\n }),\n })),\n );\n const bundled = await bundleRouterModules({\n base: options.assetBaseUrl ?? \"/_mreact/client/\",\n define: {\n __MREACT_CLIENT_DEVTOOLS__: \"false\",\n },\n entries: entries.map((entry) => ({\n code: entry.source.code,\n filename: entry.filename,\n name: entry.name,\n })),\n minify: options.minify === true,\n platform: \"browser\",\n plugins: [workspaceRuntimePlugin({ routeFiles: entries.map((entry) => entry.filename) })],\n root: options.projectRoot,\n sourceMap: options.sourceMap,\n vitePlugins: options.vitePlugins,\n });\n const entryChunks = new Map(\n bundled.chunks.filter((chunk) => chunk.isEntry).map((chunk) => [chunk.name, chunk]),\n );\n\n return {\n ...(bundled.assets === undefined ? {} : { assets: bundled.assets }),\n chunks: bundled.chunks,\n routes: entries.map((entry) => {\n const chunk = entryChunks.get(entry.name);\n\n if (chunk === undefined) {\n throw new Error(`Failed to bundle client route ${entry.routePath}: missing entry chunk.`);\n }\n\n return {\n chunk,\n routeId: entry.name,\n routePath: entry.routePath,\n };\n }),\n };\n}\n\nexport async function buildClientRouteEntrySource(\n options: BuildClientRouteOutputOptions,\n): Promise<{ code: string }> {\n const moduleContext = createCompilerModuleContext({\n code: options.code,\n filename: options.filename,\n });\n const compiled = transformCompilerModuleContext({\n code: options.code,\n clientBoundaryImports: options.clientBoundaryImports ?? [],\n filename: options.filename,\n moduleContext,\n target: \"client\",\n dev: options.minify !== true,\n });\n\n if (compiled.diagnostics.length > 0) {\n throw new Error(\n compiled.diagnostics\n .map((diagnostic) => formatDiagnostic(options.filename, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n const clientNavigation = options.clientNavigation ?? detectClientNavigationHint(options.code);\n const clientReferenceManifest =\n options.clientReferenceManifest ?? (await inferClientReferenceManifestForBundle(options));\n const compatClientReferenceNames = compatClientReferenceComponentNames(clientReferenceManifest);\n const clientReferenceImportBlock = emitClientReferenceImportBlock(\n options.clientReferenceImports ?? [],\n );\n const clientReferenceRegistry = emitClientReferenceRegistry(\n clientReferenceManifest,\n options.clientReferenceImports ?? [],\n compatClientReferenceNames,\n );\n const routeComponentExpression = routeComponentExpressionForComponents(\n compiled.metadata.components,\n );\n\n const routeId = routeIdForPath(options.routePath);\n const routeUsesCells = detectRouteCellStateHint(compiled.code);\n const routeUsesReactiveEffect = detectRouteReactiveEffectHint(compiled.code);\n const routeUsesCleanupScope = routeUsesCells || routeUsesReactiveEffect;\n const routeHasEventBindings =\n (compiled.metadata.eventHydrationManifest?.events.length ?? 0) > 0;\n const routeRequiresFullHydration =\n routeUsesCells || routeUsesReactiveEffect || routeHasEventBindings;\n const routeUsesOnlyClientReferenceBoundaries =\n !routeRequiresFullHydration &&\n clientReferenceManifest.length > 0 &&\n (options.clientReferenceImports?.length ?? 0) > 0;\n const routeHydrationCode = routeUsesOnlyClientReferenceBoundaries ? \"\" : compiled.code;\n const hydratedRouteComponentExpression = routeUsesOnlyClientReferenceBoundaries\n ? \"undefined\"\n : routeComponentExpression;\n const routeStateSignature = routeUsesCells ? routeStateSignatureForSource(compiled.code) : \"\";\n const routeCellEffectImport = routeUsesCells\n ? `import { effect as __mreactRouteEffect } from \"@reckona/mreact-reactive-core\";\\n`\n : \"\";\n const routeCleanupScopeImport = routeUsesCleanupScope\n ? `import { withCleanupScope as __mreactWithCleanupScope } from \"@reckona/mreact-reactive-core/internal\";\\n`\n : \"\";\n const navigationStateDeclaration = clientNavigation\n ? `const __mreactNavigationState = __mreactGlobal.__mreactNavigationState ??= {\n cache: new Map(),\n current: {\n from: null,\n pending: false,\n to: null,\n type: null,\n },\n installed: false,\n prefetchedScripts: new Set(),\n routePrefetchManifest: undefined,\n routePrefetchManifestText: undefined,\n viewportAnchors: new WeakSet(),\n viewportObserver: undefined,\n};`\n : \"\";\n const routeCellStateDeclaration = routeUsesCells\n ? `const __mreactRouteStates = __mreactGlobal.__mreactRouteStates ??= new Map();\nlet __mreactActiveCellRecords = undefined;\nlet __mreactActiveCellIndex = 0;`\n : \"\";\n const routeCleanupStateDeclaration = routeUsesCleanupScope\n ? `const __mreactRouteDisposers = __mreactGlobal.__mreactRouteDisposers ??= new Map();`\n : \"\";\n const routeCellHook = routeUsesCells\n ? `\n__mreactGlobal.__mreactRouteCell = (nativeCell, initial) => {\n if (__mreactActiveCellRecords === undefined) {\n return nativeCell(initial);\n }\n\n const cellKey = String(__mreactActiveCellIndex);\n __mreactActiveCellIndex += 1;\n const existingRecord = __mreactActiveCellRecords.get(cellKey);\n const record = existingRecord ?? { value: initial };\n const stateCell = nativeCell(record.value);\n const setStateCell = stateCell.set;\n\n stateCell.set = (next) => {\n setStateCell((previous) => {\n const resolved = typeof next === \"function\" ? next(previous) : next;\n record.value = resolved;\n return resolved;\n });\n };\n\n __mreactActiveCellRecords.set(cellKey, record);\n return stateCell;\n};`\n : \"\";\n const routeCellHydrationStart = routeUsesCells\n ? ` const __mreactPreviousState = __mreactRouteStates.get(__mreactRouteId);\n const __mreactState = __mreactPreviousState?.marker === __mreactMarker &&\n __mreactPreviousState?.signature === __mreactRouteStateSignature\n ? __mreactPreviousState\n : {\n cells: new Map(),\n marker: __mreactMarker,\n signature: __mreactRouteStateSignature,\n };\n __mreactDropMismatchedRouteState(__mreactPreviousState, __mreactState);\n __mreactRouteStates.set(__mreactRouteId, __mreactState);\n __mreactState.dispose?.();\n\n __mreactState.dispose = __mreactRouteEffect(() => {\n const __mreactRouteEffectDisposers = new Set();\n __mreactActiveCellRecords = __mreactState.cells;\n __mreactActiveCellIndex = 0;\n __mreactRouteDisposers.set(__mreactRouteId, () => __mreactState.dispose?.());\n\n try {\n`\n : \"\";\n const routeCellHydrationEnd = routeUsesCells\n ? ` } finally {\n __mreactActiveCellRecords = undefined;\n __mreactActiveCellIndex = 0;\n }\n return () => {\n for (const __mreactDispose of Array.from(__mreactRouteEffectDisposers)) {\n __mreactDispose();\n }\n __mreactRouteEffectDisposers.clear();\n };\n });\n`\n : \"\";\n const routeCellHydrationIndent = routeUsesCells ? \" \" : \" \";\n const routeCleanupHydrationStart = routeUsesCleanupScope && !routeUsesCells\n ? ` __mreactDisposeRoute(__mreactRouteId);\n const __mreactRouteEffectDisposers = new Set();\n __mreactRouteDisposers.set(__mreactRouteId, () => {\n for (const __mreactDispose of Array.from(__mreactRouteEffectDisposers)) {\n __mreactDispose();\n }\n __mreactRouteEffectDisposers.clear();\n });\n`\n : \"\";\n const routeCellDropFunction = routeUsesCells\n ? `\nfunction __mreactDropMismatchedRouteState(previousState, nextState) {\n if (previousState === undefined || previousState === nextState) {\n return;\n }\n\n if (previousState.signature !== nextState.signature && typeof console !== \"undefined\") {\n console.warn(\"mreact: dropping stale route state after route cell signature changed\");\n }\n}\n`\n : \"\";\n const routeCleanupFunction = routeUsesCleanupScope\n ? `\nfunction __mreactDisposeRoute(routeId) {\n const __mreactDispose = __mreactRouteDisposers.get(routeId);\n if (__mreactDispose === undefined) {\n return;\n }\n __mreactRouteDisposers.delete(routeId);\n __mreactDispose();\n}\n`\n : \"\";\n const routeCleanupNavigationDispose = routeUsesCleanupScope\n ? ` if (currentRouteId !== nextRouteId) {\n __mreactDisposeRoute(currentRouteId);\n }\n`\n : \"\";\n const routeNodeResolver = routeUsesCells\n ? `\nfunction __mreactResolveRouteNode(value) {\n if (\n value !== null &&\n typeof value === \"object\" &&\n value.$$typeof === Symbol.for(\"modular.react.element\") &&\n typeof value.type === \"function\"\n ) {\n return __mreactResolveRouteNode(value.type(value.props ?? {}));\n }\n\n if (value !== null && typeof value === \"object\" && value.nodeType !== undefined) {\n return value;\n }\n\n const fragment = document.createDocumentFragment();\n if (value !== null && value !== undefined && value !== false && value !== true) {\n fragment.append(document.createTextNode(String(value)));\n }\n return fragment;\n}\n`\n : \"\";\n const routeComponentCallExpression = routeUsesCleanupScope\n ? \"__mreactWithCleanupScope((__mreactDispose) => __mreactRouteEffectDisposers.add(__mreactDispose), () => __mreactComponent(__mreactProps))\"\n : \"__mreactComponent(__mreactProps)\";\n const routeNodeExpression = routeUsesCells\n ? `__mreactResolveRouteNode(${routeComponentCallExpression})`\n : routeComponentCallExpression;\n const boundaryOnlyHydrationBlock = routeRequiresFullHydration\n ? \"\"\n : `${routeCellHydrationIndent}if (!__mreactHasNonSerializableClientBoundaries(__mreactMarker) && __mreactHydrateClientBoundaries(document, __mreactClientReferences, __mreactClientReferenceComponents)) {\n${routeCellHydrationIndent} __mreactMarker.setAttribute(\"data-mreact-hydrated\", \"true\");\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const routeComponentGuard = `${routeCellHydrationIndent}if (__mreactComponent === undefined) {\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const entry = `${routeCellEffectImport}${routeCleanupScopeImport}${emitCompatClientReferenceImportBlock(compatClientReferenceNames)}${clientReferenceImportBlock}${routeHydrationCode}\n\nconst __mreactRouteId = ${JSON.stringify(routeId)};\nconst __mreactRouteStateSignature = ${JSON.stringify(routeStateSignature)};\nconst __mreactGlobal = globalThis;\n${navigationStateDeclaration}\n${routeCellStateDeclaration}\n${routeCleanupStateDeclaration}\n${routeCellHook}\n${clientReferenceRegistry}\n${routeNodeResolver}\n\nexport function __mreactHydrateRoute() {\n __mreactApplyOutOfOrderFragments(document);\n const __mreactMarker = document.querySelector(\\`[data-mreact-route-id=\"\\${__mreactRouteId}\"]\\`);\n const __mreactPropsElement = document.getElementById(\\`mreact-props-\\${__mreactRouteId}\\`);\n const __mreactClientReferencesElement = document.getElementById(\\`mreact-client-references-\\${__mreactRouteId}\\`);\n const __mreactProps = __mreactPropsElement?.textContent === undefined\n ? {}\n : JSON.parse(__mreactPropsElement.textContent);\n const __mreactClientReferences = __mreactClientReferencesElement?.textContent === undefined\n ? []\n : JSON.parse(__mreactClientReferencesElement.textContent);\n const __mreactClientReferenceManifests = __mreactGlobal.__mreactClientReferenceManifests ??= new Map();\n __mreactClientReferenceManifests.set(__mreactRouteId, __mreactClientReferences);\n const __mreactComponent = ${hydratedRouteComponentExpression};\n\n if (__mreactMarker === null) {\n return;\n }\n${routeCellHydrationStart}${routeCleanupHydrationStart}${boundaryOnlyHydrationBlock}${routeComponentGuard}${routeCellHydrationIndent}const __mreactNode = ${routeNodeExpression};\n${routeCellHydrationIndent}__mreactResumeRoute(__mreactMarker, __mreactNode);\n${routeCellHydrationIndent}__mreactHydrateClientBoundaries(__mreactMarker, __mreactClientReferences, __mreactClientReferenceComponents);\n${routeCellHydrationIndent}__mreactMarker.setAttribute(\"data-mreact-hydrated\", \"true\");\n${routeCellHydrationEnd}}\n${routeCellDropFunction}\n${routeCleanupFunction}\n\n__mreactHydrateRoute();\n${clientNavigation ? \"__mreactInstallNavigation();\" : \"\"}\n\n${\n clientNavigation\n ? `export function __mreactNavigateToHtml(html, url, options = {}) {\n __mreactSaveCurrentHistoryState();\n const applied = __mreactApplyNavigationHtml(html, url);\n\n if (!applied) {\n return false;\n }\n\n __mreactPushHistoryState(url);\n if (options.scroll !== \"preserve\") {\n __mreactScrollTo(0, 0);\n }\n __mreactResetNavigationFocus();\n __mreactAnnounceNavigation();\n return true;\n}\n\nfunction __mreactResetNavigationFocus() {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const focusTarget =\n document.querySelector(\"[data-mreact-focus-target]\") ??\n document.querySelector(\"main\") ??\n document.querySelector(\"h1\") ??\n document.body;\n\n if (!(focusTarget instanceof HTMLElement)) {\n return;\n }\n\n const hadTabIndex = focusTarget.hasAttribute(\"tabindex\");\n\n if (!hadTabIndex) {\n focusTarget.setAttribute(\"tabindex\", \"-1\");\n }\n\n try {\n focusTarget.focus({ preventScroll: true });\n } catch {\n focusTarget.focus();\n }\n\n if (!hadTabIndex) {\n focusTarget.addEventListener(\n \"blur\",\n () => focusTarget.removeAttribute(\"tabindex\"),\n { once: true },\n );\n }\n}\n\nfunction __mreactAnnounceNavigation() {\n if (typeof document === \"undefined\" || document.body === null) {\n return;\n }\n\n const announcement = __mreactRouteAnnouncementElement();\n announcement.textContent = \\`Loaded \\${document.title || \"page\"}\\`;\n}\n\nfunction __mreactRouteAnnouncementElement() {\n const existing = document.getElementById(\"mreact-route-announcement\");\n\n if (existing instanceof HTMLElement) {\n return existing;\n }\n\n const announcement = document.createElement(\"div\");\n announcement.id = \"mreact-route-announcement\";\n announcement.setAttribute(\"role\", \"status\");\n announcement.setAttribute(\"aria-live\", \"polite\");\n announcement.setAttribute(\"aria-atomic\", \"true\");\n announcement.setAttribute(\n \"style\",\n \"position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden\",\n );\n document.body.appendChild(announcement);\n return announcement;\n}\n\nexport async function __mreactPrefetch(url) {\n if (!__mreactCanPrefetch()) {\n return false;\n }\n\n const href = __mreactNormalizeNavigationUrl(url);\n\n if (href === undefined) {\n return false;\n }\n\n const script = __mreactRouteScriptForNavigationUrl(href);\n\n if (script === undefined) {\n return __mreactPrefetchNavigationHtml(href);\n }\n\n return __mreactPrefetchRouteScript(script);\n}\n\nfunction __mreactPrefetchNavigationHtml(href) {\n if (__mreactNavigationState.cache.has(href)) {\n return true;\n }\n\n return __mreactFetchNavigationHtml(href).then((html) => {\n if (typeof html !== \"string\") {\n return false;\n }\n\n __mreactNavigationState.cache.set(href, html);\n return true;\n }).catch(() => false);\n}\n\nfunction __mreactPrefetchRouteScript(script) {\n if (typeof document === \"undefined\") {\n return false;\n }\n\n const href = __mreactNormalizeAssetUrl(script);\n\n if (href === undefined) {\n return false;\n }\n\n if (__mreactNavigationState.prefetchedScripts.has(href)) {\n return true;\n }\n\n for (const link of Array.from(document.querySelectorAll('link[rel=\"modulepreload\"][href]'))) {\n if (link.href === href) {\n __mreactNavigationState.prefetchedScripts.add(href);\n return true;\n }\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"modulepreload\";\n link.href = href;\n document.head.appendChild(link);\n __mreactNavigationState.prefetchedScripts.add(href);\n return true;\n}\n\nexport async function __mreactNavigate(url, options = {}) {\n const href = __mreactNormalizeNavigationUrl(url);\n\n if (href === undefined) {\n return false;\n }\n\n __mreactSetNavigationState(__mreactPendingNavigationState(href, options.type ?? \"push\"));\n\n try {\n const cachedHtml = __mreactNavigationState.cache.get(href);\n const html = cachedHtml ?? await __mreactFetchNavigationHtml(href);\n\n if (typeof html !== \"string\") {\n return false;\n }\n\n __mreactNavigationState.cache.set(href, html);\n return await __mreactApplyNavigationHtmlWithOptionalTransition(html, href, options);\n } finally {\n __mreactSetNavigationState(__mreactIdleNavigationState());\n }\n}\n\nexport function __mreactGetNavigationState() {\n return __mreactNavigationStateSnapshot(__mreactNavigationState.current);\n}\n\nfunction __mreactPendingNavigationState(to, type) {\n return {\n from: typeof location === \"undefined\" ? null : location.href,\n pending: true,\n to,\n type: __mreactNavigationType(type),\n };\n}\n\nfunction __mreactIdleNavigationState() {\n return {\n from: null,\n pending: false,\n to: null,\n type: null,\n };\n}\n\nfunction __mreactSetNavigationState(state) {\n const snapshot = __mreactNavigationStateSnapshot(state);\n __mreactNavigationState.current = snapshot;\n __mreactApplyNavigationStateAttributes(snapshot);\n __mreactDispatchNavigationStateChange(snapshot);\n}\n\nfunction __mreactNavigationStateSnapshot(state) {\n return {\n from: typeof state?.from === \"string\" ? state.from : null,\n pending: state?.pending === true,\n to: typeof state?.to === \"string\" ? state.to : null,\n type: __mreactNavigationType(state?.type),\n };\n}\n\nfunction __mreactNavigationType(type) {\n return type === \"push\" || type === \"replace\" || type === \"pop\" || type === \"refresh\"\n ? type\n : null;\n}\n\nfunction __mreactApplyNavigationStateAttributes(state) {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const root = document.documentElement;\n\n if (state.pending !== true) {\n root.removeAttribute(\"data-mreact-navigation-pending\");\n root.removeAttribute(\"data-mreact-navigation-from\");\n root.removeAttribute(\"data-mreact-navigation-to\");\n root.removeAttribute(\"data-mreact-navigation-type\");\n return;\n }\n\n root.setAttribute(\"data-mreact-navigation-pending\", \"true\");\n\n if (state.from === null) {\n root.removeAttribute(\"data-mreact-navigation-from\");\n } else {\n root.setAttribute(\"data-mreact-navigation-from\", state.from);\n }\n\n if (state.to === null) {\n root.removeAttribute(\"data-mreact-navigation-to\");\n } else {\n root.setAttribute(\"data-mreact-navigation-to\", state.to);\n }\n\n if (state.type === null) {\n root.removeAttribute(\"data-mreact-navigation-type\");\n } else {\n root.setAttribute(\"data-mreact-navigation-type\", state.type);\n }\n}\n\nfunction __mreactDispatchNavigationStateChange(state) {\n if (typeof window === \"undefined\" || typeof CustomEvent !== \"function\") {\n return;\n }\n\n window.dispatchEvent(new CustomEvent(\"mreact:navigation-state-change\", {\n detail: state,\n }));\n}\n\nasync function __mreactApplyNavigationHtmlWithOptionalTransition(html, href, options) {\n if (!__mreactViewTransitionsAllowed(options.transition)) {\n return __mreactNavigateToHtml(html, href, options);\n }\n\n let navigated = false;\n const transition = document.startViewTransition(() => {\n navigated = __mreactNavigateToHtml(html, href, options);\n });\n\n try {\n await transition.updateCallbackDone;\n } catch {\n return navigated;\n }\n\n return navigated;\n}\n\nfunction __mreactViewTransitionsAllowed(transition) {\n if (\n transition !== \"auto\" ||\n typeof document === \"undefined\" ||\n typeof document.startViewTransition !== \"function\"\n ) {\n return false;\n }\n\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return true;\n }\n\n try {\n return !window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n } catch {\n return true;\n }\n}\n\nexport function __mreactInvalidateNavigationCache(path) {\n const normalizedPath = __mreactNormalizeNavigationPath(path);\n\n if (normalizedPath === undefined) {\n return;\n }\n\n for (const href of Array.from(__mreactNavigationState.cache.keys())) {\n if (__mreactNormalizeNavigationPath(href) === normalizedPath) {\n __mreactNavigationState.cache.delete(href);\n }\n }\n}\n\nfunction __mreactFetchNavigationHtml(href) {\n return fetch(href, {\n headers: { \"x-mreact-navigation\": \"1\" },\n }).then((response) => {\n __mreactApplyRevalidationHeader(response);\n if (__mreactNavigationResponseRequiresDocumentReload(response)) {\n return undefined;\n }\n\n return response.text();\n });\n}\n\nfunction __mreactNavigationResponseRequiresDocumentReload(response) {\n return response.status === 204 || response.headers.get(\"x-mreact-navigation\") === \"reload\";\n}\n\nfunction __mreactApplyRevalidationHeader(response) {\n const header = response.headers.get(\"x-mreact-revalidate\");\n\n if (header === null || header.trim() === \"\") {\n return;\n }\n\n for (const path of header.split(\",\")) {\n __mreactInvalidateNavigationCache(path.trim());\n }\n}\n\nfunction __mreactNormalizeNavigationPath(path) {\n if (typeof location === \"undefined\") {\n return typeof path === \"string\" && path.length > 0 ? path : undefined;\n }\n\n try {\n const url = new URL(path, location.href);\n const pathname = url.pathname.replace(/\\\\/+$/, \"\");\n\n return pathname === \"\" ? \"/\" : pathname;\n } catch {\n return undefined;\n }\n}\n\nexport function __mreactRestoreHistoryState(state) {\n if (state === null || state === undefined || state.__mreact !== true || typeof state.html !== \"string\") {\n return false;\n }\n\n const applied = __mreactApplyNavigationHtml(state.html, state.url);\n\n if (!applied) {\n return false;\n }\n\n __mreactScrollTo(Number(state.scrollX ?? 0), Number(state.scrollY ?? 0));\n return true;\n}\n\nfunction __mreactApplyNavigationHtml(html, url) {\n const template = document.createElement(\"template\");\n template.innerHTML = html.replace(/^\\\\s*<!doctype html>/i, \"\");\n __mreactApplyOutOfOrderFragments(template.content);\n const nextMarker = template.content.querySelector(\"[data-mreact-route-id]\");\n const currentMarker = document.querySelector(\"[data-mreact-route-id]\");\n\n if (nextMarker === null || currentMarker === null) {\n return false;\n }\n\n const currentRouteId = currentMarker.getAttribute(\"data-mreact-route-id\");\n const nextRouteId = nextMarker.getAttribute(\"data-mreact-route-id\");\n\n __mreactSyncHeadMetadata(template.content, html);\n __mreactResumeNode(currentMarker, nextMarker);\n${routeCleanupNavigationDispose} __mreactSyncRouteDataScripts(template.content, currentRouteId, nextRouteId);\n\n const script = template.content.querySelector('script[type=\"module\"][src]')?.getAttribute(\"src\");\n if (script !== null && script !== undefined) {\n void import(/* @vite-ignore */ script).then((module) => module.__mreactHydrateRoute?.());\n }\n\n __mreactApplyOutOfOrderFragments(document);\n __mreactObserveViewportPrefetchAnchors(document);\n\n return true;\n}\n\nfunction __mreactSyncHeadMetadata(root, html) {\n __mreactSyncHtmlLang(root, html);\n\n const nextHead = root.querySelector(\"head\");\n\n if ((nextHead === null && !/<head(?:\\\\s[^>]*)?>/i.test(html)) || document.head === null) {\n return;\n }\n\n const metadataRoot = nextHead ?? root;\n const selector = __mreactManagedHeadMetadataSelector();\n\n for (const element of Array.from(document.head.querySelectorAll(selector))) {\n element.remove();\n }\n\n for (const element of Array.from(metadataRoot.querySelectorAll(selector))) {\n document.head.appendChild(element);\n }\n}\n\nfunction __mreactSyncHtmlLang(root, html) {\n const nextHtml = root.querySelector(\"html\");\n const nextLang = nextHtml?.getAttribute(\"lang\") ?? __mreactHtmlLangFromSource(html);\n\n if (nextLang === null) {\n return;\n }\n\n if (document.documentElement.lang !== nextLang) {\n document.documentElement.lang = nextLang;\n }\n}\n\nfunction __mreactHtmlLangFromSource(html) {\n const match = /<html\\\\b[^>]*\\\\slang=(?:\"([^\"]*)\"|'([^']*)'|([^\\\\s>]+))/i.exec(html);\n\n return match === null ? null : match[1] ?? match[2] ?? match[3] ?? null;\n}\n\nfunction __mreactManagedHeadMetadataSelector() {\n return [\n \"title\",\n 'meta[name=\"description\"]',\n 'link[rel=\"canonical\"]',\n 'meta[property=\"og:title\"]',\n 'meta[property=\"og:description\"]',\n 'meta[property=\"og:image\"]',\n 'link[rel=\"icon\"]',\n 'link[rel=\"apple-touch-icon\"]',\n 'meta[name=\"robots\"]',\n 'meta[name=\"theme-color\"]',\n 'meta[name=\"viewport\"]',\n ].join(\",\");\n}\n\nfunction __mreactSyncRouteDataScripts(root, currentRouteId, nextRouteId) {\n const managedIds = __mreactRouteDataScriptIds(currentRouteId, nextRouteId);\n\n if (managedIds.size === 0) {\n return;\n }\n\n for (const element of Array.from(document.querySelectorAll(__mreactRouteDataScriptSelector()))) {\n if (managedIds.has(element.id)) {\n element.remove();\n }\n }\n\n for (const element of Array.from(root.querySelectorAll(__mreactRouteDataScriptSelector()))) {\n if (managedIds.has(element.id)) {\n document.body.appendChild(element);\n }\n }\n}\n\nfunction __mreactRouteDataScriptIds(...routeIds) {\n const ids = new Set();\n\n for (const routeId of routeIds) {\n if (typeof routeId !== \"string\" || routeId === \"\") {\n continue;\n }\n\n ids.add(\\`mreact-props-\\${routeId}\\`);\n ids.add(\\`mreact-client-references-\\${routeId}\\`);\n }\n\n return ids;\n}\n\nfunction __mreactRouteDataScriptSelector() {\n return 'script[type=\"application/json\"][id^=\"mreact-props-\"], script[type=\"application/json\"][id^=\"mreact-client-references-\"]';\n}\n\nfunction __mreactCurrentHistoryState(url) {\n return {\n __mreact: true,\n html: document.body.innerHTML,\n scrollX: Number(globalThis.scrollX ?? 0),\n scrollY: Number(globalThis.scrollY ?? 0),\n url,\n };\n}\n\nfunction __mreactPushHistoryState(url) {\n if (typeof history === \"undefined\" || url === undefined) {\n return;\n }\n\n try {\n history.pushState(__mreactCurrentHistoryState(url), \"\", url);\n } catch {\n // Ignore invalid URLs in non-browser test environments.\n }\n}\n\nfunction __mreactSaveCurrentHistoryState() {\n if (typeof history === \"undefined\" || typeof location === \"undefined\") {\n return;\n }\n\n try {\n history.replaceState(__mreactCurrentHistoryState(location.href), \"\", location.href);\n } catch {\n // Ignore invalid URLs in non-browser test environments.\n }\n}\n\nfunction __mreactEnableManualScrollRestoration() {\n if (typeof history === \"undefined\" || !(\"scrollRestoration\" in history)) {\n return;\n }\n\n try {\n history.scrollRestoration = \"manual\";\n } catch {\n // Ignore read-only history implementations in non-browser runtimes.\n }\n}\n\nfunction __mreactNormalizeNavigationUrl(url) {\n if (typeof location === \"undefined\") {\n return typeof url === \"string\" ? url : undefined;\n }\n\n try {\n return new URL(url, location.href).href;\n } catch {\n return undefined;\n }\n}\n\nfunction __mreactNormalizeAssetUrl(url) {\n if (typeof location === \"undefined\") {\n return typeof url === \"string\" ? url : undefined;\n }\n\n try {\n return new URL(url, location.href).href;\n } catch {\n return undefined;\n }\n}\n\nfunction __mreactRouteScriptForNavigationUrl(url) {\n const href = __mreactNormalizeNavigationUrl(url);\n\n if (href === undefined || typeof location === \"undefined\") {\n return undefined;\n }\n\n let nextUrl;\n\n try {\n nextUrl = new URL(href, location.href);\n } catch {\n return undefined;\n }\n\n if (nextUrl.origin !== location.origin) {\n return undefined;\n }\n\n for (const route of __mreactClientRoutePrefetchManifest()) {\n if (__mreactRoutePathMatches(route.path, nextUrl.pathname)) {\n return route.script;\n }\n }\n\n return undefined;\n}\n\nfunction __mreactClientRoutePrefetchManifest() {\n const element = typeof document === \"undefined\"\n ? null\n : document.getElementById(\"mreact-route-prefetch-manifest\");\n const text = element?.textContent ?? \"\";\n\n if (\n __mreactNavigationState.routePrefetchManifest !== undefined &&\n __mreactNavigationState.routePrefetchManifestText === text\n ) {\n return __mreactNavigationState.routePrefetchManifest;\n }\n\n __mreactNavigationState.routePrefetchManifestText = text;\n\n if (element === null) {\n __mreactNavigationState.routePrefetchManifest = [];\n return __mreactNavigationState.routePrefetchManifest;\n }\n\n try {\n const parsed = JSON.parse(text);\n __mreactNavigationState.routePrefetchManifest = Array.isArray(parsed)\n ? parsed.filter((route) =>\n route !== null &&\n typeof route === \"object\" &&\n typeof route.path === \"string\" &&\n typeof route.script === \"string\"\n )\n : [];\n } catch {\n __mreactNavigationState.routePrefetchManifest = [];\n }\n\n return __mreactNavigationState.routePrefetchManifest;\n}\n\nfunction __mreactRoutePathMatches(routePath, pathname) {\n const routeSegments = __mreactNormalizeRoutePath(routePath);\n const pathSegments = __mreactNormalizeRoutePath(pathname);\n\n if (routeSegments.length === 0) {\n return pathSegments.length === 0;\n }\n\n for (const [index, segment] of routeSegments.entries()) {\n const value = pathSegments[index];\n\n if (segment.startsWith(\":...\")) {\n return pathSegments.length >= index + 1;\n }\n\n if (value === undefined) {\n return false;\n }\n\n if (!segment.startsWith(\":\") && segment !== value) {\n return false;\n }\n }\n\n return routeSegments.length === pathSegments.length;\n}\n\nfunction __mreactNormalizeRoutePath(path) {\n const normalized = path.length > 1 ? path.replace(/\\\\/+$/, \"\") : path;\n return normalized === \"/\" || normalized === \"\" ? [] : normalized.replace(/^\\\\/+/, \"\").split(\"/\");\n}\n\nfunction __mreactCanPrefetch() {\n if (typeof navigator === \"undefined\") {\n return true;\n }\n\n const connection = navigator.connection ?? navigator.mozConnection ?? navigator.webkitConnection;\n const effectiveType = typeof connection?.effectiveType === \"string\"\n ? connection.effectiveType.toLowerCase()\n : \"\";\n\n return connection?.saveData !== true && effectiveType !== \"slow-2g\" && effectiveType !== \"2g\";\n}\n\nfunction __mreactScrollTo(x, y) {\n if (typeof scrollTo === \"function\") {\n scrollTo(x, y);\n }\n}\n\nfunction __mreactIsHashOnlyNavigation(nextUrl) {\n if (typeof location === \"undefined\") {\n return false;\n }\n\n return nextUrl.origin === location.origin &&\n nextUrl.pathname === location.pathname &&\n nextUrl.search === location.search &&\n nextUrl.hash !== \"\" &&\n nextUrl.hash !== location.hash;\n}\n\nfunction __mreactInstallNavigation() {\n if (__mreactNavigationState.installed || typeof document === \"undefined\") {\n return;\n }\n\n __mreactNavigationState.installed = true;\n __mreactEnableManualScrollRestoration();\n __mreactSaveCurrentHistoryState();\n addEventListener(\"popstate\", (event) => {\n __mreactSaveCurrentHistoryState();\n if (!__mreactRestoreHistoryState(event.state)) {\n location.reload();\n }\n });\n document.addEventListener(\"pointerenter\", (event) => {\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor !== null && __mreactAnchorPrefetchMode(anchor) === \"intent\") {\n void __mreactPrefetch(anchor.href);\n }\n }, true);\n document.addEventListener(\"pointerdown\", (event) => {\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor !== null && __mreactAnchorPrefetchMode(anchor) === \"intent\") {\n void __mreactPrefetch(anchor.href);\n }\n }, true);\n document.addEventListener(\"focusin\", (event) => {\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor !== null && __mreactAnchorPrefetchMode(anchor) === \"intent\") {\n void __mreactPrefetch(anchor.href);\n }\n });\n __mreactObserveViewportPrefetchAnchors(document);\n document.addEventListener(\"click\", (event) => {\n if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return;\n }\n\n const anchor = __mreactAnchorFromEvent(event);\n\n if (anchor === null) {\n return;\n }\n\n if (anchor.dataset.mreactReload === \"true\") {\n return;\n }\n\n const nextUrl = new URL(anchor.href, location.href);\n\n if (nextUrl.origin !== location.origin) {\n return;\n }\n\n if (__mreactIsHashOnlyNavigation(nextUrl)) {\n return;\n }\n\n event.preventDefault();\n void __mreactNavigate(nextUrl.href, {\n scroll: __mreactAnchorScrollMode(anchor),\n transition: __mreactAnchorTransitionMode(anchor),\n })\n .then((navigated) => {\n if (!navigated) {\n location.href = nextUrl.href;\n }\n }).catch(() => {\n location.href = nextUrl.href;\n });\n });\n}\n\nfunction __mreactAnchorFromEvent(event) {\n const target = event.target;\n const anchor = target instanceof Element ? target.closest(\"a[href]\") : null;\n\n if (!(anchor instanceof HTMLAnchorElement) || anchor.target !== \"\" || anchor.hasAttribute(\"download\")) {\n return null;\n }\n\n return anchor;\n}\n\nfunction __mreactAnchorPrefetchMode(anchor) {\n const value = anchor.dataset.mreactPrefetch;\n\n if (value === \"false\" || value === \"none\") {\n return \"none\";\n }\n\n return value === \"viewport\" ? \"viewport\" : \"intent\";\n}\n\nfunction __mreactAnchorScrollMode(anchor) {\n return anchor.dataset.mreactScroll === \"preserve\" ? \"preserve\" : \"top\";\n}\n\nfunction __mreactAnchorTransitionMode(anchor) {\n return anchor.dataset.mreactTransition === \"auto\" ? \"auto\" : \"none\";\n}\n\nfunction __mreactObserveViewportPrefetchAnchors(root) {\n if (typeof IntersectionObserver === \"undefined\") {\n return;\n }\n\n if (__mreactNavigationState.viewportObserver === undefined) {\n __mreactNavigationState.viewportObserver = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (!entry.isIntersecting || !(entry.target instanceof HTMLAnchorElement)) {\n continue;\n }\n\n __mreactNavigationState.viewportObserver?.unobserve(entry.target);\n void __mreactPrefetch(entry.target.href);\n }\n });\n }\n\n for (const anchor of Array.from(root.querySelectorAll('a[href][data-mreact-prefetch=\"viewport\"]'))) {\n if (!(anchor instanceof HTMLAnchorElement) || __mreactNavigationState.viewportAnchors.has(anchor)) {\n continue;\n }\n\n __mreactNavigationState.viewportAnchors.add(anchor);\n __mreactNavigationState.viewportObserver.observe(anchor);\n }\n}\n`\n : \"\"\n}\n\nfunction __mreactApplyOutOfOrderFragments(root) {\n const fragments = Array.from(root.querySelectorAll(\"template[data-mreact-oob-fragment]\"));\n\n for (const fragment of fragments) {\n const id = fragment.getAttribute(\"data-mreact-oob-fragment\");\n\n if (id === null) {\n continue;\n }\n\n const placeholder = Array.from(root.querySelectorAll(\"[data-mreact-oob-placeholder]\"))\n .find((candidate) => candidate.getAttribute(\"data-mreact-oob-placeholder\") === id);\n\n if (placeholder === undefined) {\n continue;\n }\n\n placeholder.replaceWith(fragment.content.cloneNode(true));\n fragment.remove();\n }\n}\n\nfunction __mreactHydrateClientBoundaries(marker, references, components) {\n if (components.size === 0 && (!Array.isArray(references) || references.length === 0)) {\n return false;\n }\n\n const placeholders = Array.from(marker.querySelectorAll(\"template[data-mreact-client-boundary]\"));\n\n if (placeholders.length === 0) {\n return false;\n }\n\n for (const placeholder of placeholders) {\n const name = placeholder.getAttribute(\"data-mreact-client-boundary\");\n const entry = name === null ? undefined : components.get(name);\n const component = typeof entry === \"function\" ? entry : entry?.component;\n const compat = entry?.compat === true;\n\n if (typeof component !== \"function\") {\n return false;\n }\n\n const propsElement = __mreactClientBoundaryPropsElement(placeholder, name);\n const props = propsElement?.textContent === undefined || propsElement.textContent === \"\"\n ? {}\n : JSON.parse(propsElement.textContent);\n\n if (compat) {\n const container = document.createElement(\"span\");\n container.setAttribute(\"data-mreact-compat-boundary\", name ?? \"\");\n container.style.display = \"contents\";\n placeholder.replaceWith(container);\n __mreactCompatCreateRoot(container).render(__mreactCompatCreateElement(component, props));\n propsElement?.remove();\n continue;\n }\n\n const node = component(props);\n\n placeholder.replaceWith(node);\n propsElement?.remove();\n }\n\n return true;\n}\n\nfunction __mreactHasNonSerializableClientBoundaries(marker) {\n return marker.querySelector(\n 'template[data-mreact-client-boundary][data-mreact-client-boundary-nonserializable=\"true\"]',\n ) !== null;\n}\n\nfunction __mreactClientBoundaryPropsElement(placeholder, name) {\n let next = placeholder.nextSibling;\n\n while (next !== null) {\n if (\n next.nodeType === Node.ELEMENT_NODE &&\n next.tagName === \"SCRIPT\" &&\n next.getAttribute(\"type\") === \"application/json\" &&\n next.getAttribute(\"data-mreact-client-boundary-props\") === name\n ) {\n return next;\n }\n\n if (next.nodeType === Node.ELEMENT_NODE) {\n return undefined;\n }\n\n next = next.nextSibling;\n }\n\n return undefined;\n}\n\nfunction __mreactResumeRoute(marker, nextNode) {\n if (nextNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n marker.replaceChildren(nextNode);\n return;\n }\n\n const current = __mreactRouteResumeTarget(marker, nextNode);\n\n if (current === null) {\n marker.appendChild(nextNode);\n return;\n }\n\n __mreactResumeNode(current, nextNode);\n\n if (current.parentNode !== marker) {\n return;\n }\n\n while (marker.childNodes.length > 1) {\n marker.lastChild?.remove();\n }\n}\n\nfunction __mreactRouteResumeTarget(marker, nextNode) {\n const current = marker.firstChild;\n\n if (\n current === null ||\n current.nodeType !== Node.ELEMENT_NODE ||\n nextNode.nodeType !== Node.ELEMENT_NODE ||\n current.tagName === nextNode.tagName ||\n !current.hasAttribute(\"data-mreact-layout-boundary\")\n ) {\n return current;\n }\n\n return __mreactFindLayoutPageTarget(current, nextNode) ?? current;\n}\n\nfunction __mreactFindLayoutPageTarget(current, nextNode) {\n for (const child of Array.from(current.childNodes)) {\n if (child.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n\n if (\n child.tagName === nextNode.tagName &&\n !child.hasAttribute(\"data-mreact-layout-boundary\") &&\n !child.hasAttribute(\"data-mreact-template-boundary\")\n ) {\n return child;\n }\n\n if (child.hasAttribute(\"data-mreact-layout-boundary\")) {\n const nested = __mreactFindLayoutPageTarget(child, nextNode);\n\n if (nested !== null) {\n return nested;\n }\n }\n }\n\n return null;\n}\n\nfunction __mreactResumeNode(current, next) {\n if (\n next.nodeType === Node.COMMENT_NODE &&\n next.nodeValue === \"mreact-async-boundary\"\n ) {\n // Server stream emits the resolved <Await> content; preserve the existing\n // DOM instead of replacing it with the client placeholder comment.\n return;\n }\n\n if (__mreactShouldReplaceNode(current, next)) {\n current.replaceWith(next);\n return;\n }\n\n if (current.nodeType === Node.TEXT_NODE && next.nodeType === Node.TEXT_NODE) {\n if (current.nodeValue !== next.nodeValue) {\n current.nodeValue = next.nodeValue;\n }\n return;\n }\n\n if (current.nodeType !== Node.ELEMENT_NODE || next.nodeType !== Node.ELEMENT_NODE) {\n current.replaceWith(next);\n return;\n }\n\n __mreactSyncEventBindings(current, next);\n __mreactSyncAttributes(current, next);\n __mreactSyncPropBindings(current, next);\n __mreactResumeChildren(current, next);\n}\n\nfunction __mreactShouldReplaceNode(current, next) {\n if (\n next.nodeType === Node.ELEMENT_NODE &&\n next.hasAttribute(\"data-mreact-template-boundary\")\n ) {\n return true;\n }\n\n if (current.nodeType !== next.nodeType) {\n return true;\n }\n\n return current.nodeType === Node.ELEMENT_NODE &&\n current.tagName !== next.tagName;\n}\n\nfunction __mreactSyncEventBindings(current, next) {\n const previousDisposers = current.__mreactEventDisposers;\n\n if (Array.isArray(previousDisposers)) {\n for (const dispose of previousDisposers) {\n dispose();\n }\n }\n\n const bindings = next.__mreactEventBindings;\n\n if (!Array.isArray(bindings) || bindings.length === 0) {\n current.__mreactEventDisposers = [];\n current.__mreactHasEvents = false;\n return;\n }\n\n const disposers = [];\n\n for (const binding of bindings) {\n if (binding.delegated === true && __mreactIsDelegatedEventType(binding.type)) {\n disposers.push(__mreactAddDelegatedEventListener(current, binding.type, binding.listener));\n } else {\n current.addEventListener(binding.type, binding.listener);\n disposers.push(() => current.removeEventListener(binding.type, binding.listener));\n }\n }\n\n current.__mreactEventDisposers = disposers;\n current.__mreactHasEvents = true;\n}\n\nfunction __mreactIsDelegatedEventType(type) {\n return type === \"change\" ||\n type === \"click\" ||\n type === \"input\" ||\n type === \"keydown\" ||\n type === \"keyup\" ||\n type === \"pointerdown\" ||\n type === \"pointermove\" ||\n type === \"pointerup\" ||\n type === \"submit\";\n}\n\nfunction __mreactDelegatedEventState() {\n globalThis.__mreactDelegatedEventState ??= {\n elements: new WeakMap(),\n roots: new WeakMap(),\n };\n return globalThis.__mreactDelegatedEventState;\n}\n\nfunction __mreactAddDelegatedEventListener(element, type, listener) {\n const root = element.ownerDocument;\n const state = __mreactDelegatedEventState();\n let listenersByType = state.elements.get(element);\n\n if (listenersByType === undefined) {\n listenersByType = new Map();\n state.elements.set(element, listenersByType);\n }\n\n let listeners = listenersByType.get(type);\n\n if (listeners === undefined) {\n listeners = [];\n listenersByType.set(type, listeners);\n }\n\n listeners.push(listener);\n __mreactRetainDelegatedEventRoot(root, type);\n\n return () => {\n const state = __mreactDelegatedEventState();\n const currentListeners = state.elements.get(element)?.get(type);\n const index = currentListeners?.indexOf(listener) ?? -1;\n\n if (index !== -1) {\n currentListeners?.splice(index, 1);\n }\n\n if (currentListeners?.length === 0) {\n state.elements.get(element)?.delete(type);\n }\n\n __mreactReleaseDelegatedEventRoot(root, type);\n };\n}\n\nfunction __mreactRetainDelegatedEventRoot(root, type) {\n const state = __mreactDelegatedEventState();\n let rootsByType = state.roots.get(root);\n\n if (rootsByType === undefined) {\n rootsByType = new Map();\n state.roots.set(root, rootsByType);\n }\n\n const current = rootsByType.get(type);\n\n if (current !== undefined) {\n current.count += 1;\n return;\n }\n\n const listener = (event) => __mreactDispatchDelegatedEvent(root, type, event);\n rootsByType.set(type, { count: 1, listener });\n root.addEventListener(type, listener);\n}\n\nfunction __mreactReleaseDelegatedEventRoot(root, type) {\n const rootsByType = __mreactDelegatedEventState().roots.get(root);\n const current = rootsByType?.get(type);\n\n if (rootsByType === undefined || current === undefined) {\n return;\n }\n\n current.count -= 1;\n\n if (current.count > 0) {\n return;\n }\n\n root.removeEventListener(type, current.listener);\n rootsByType.delete(type);\n}\n\nfunction __mreactDispatchDelegatedEvent(root, type, event) {\n const state = __mreactDelegatedEventState();\n\n for (const target of event.composedPath()) {\n if (target === root) {\n break;\n }\n\n if (!(target instanceof HTMLElement)) {\n continue;\n }\n\n const listeners = state.elements.get(target)?.get(type);\n\n if (listeners === undefined || listeners.length === 0) {\n continue;\n }\n\n const activeListeners = listeners.slice();\n\n for (const listener of activeListeners) {\n __mreactCallWithCurrentTarget(listener, event, target);\n }\n\n if (event.cancelBubble) {\n break;\n }\n }\n}\n\nfunction __mreactCallWithCurrentTarget(listener, event, currentTarget) {\n const descriptor = Object.getOwnPropertyDescriptor(event, \"currentTarget\");\n\n Object.defineProperty(event, \"currentTarget\", {\n configurable: true,\n value: currentTarget,\n });\n\n try {\n listener.call(currentTarget, event);\n } finally {\n if (descriptor === undefined) {\n delete event.currentTarget;\n } else {\n Object.defineProperty(event, \"currentTarget\", descriptor);\n }\n }\n}\n\nfunction __mreactSyncAttributes(current, next) {\n for (const attribute of Array.from(current.attributes)) {\n if (!next.hasAttribute(attribute.name)) {\n current.removeAttribute(attribute.name);\n }\n }\n\n for (const attribute of Array.from(next.attributes)) {\n if (current.getAttribute(attribute.name) !== attribute.value) {\n current.setAttribute(attribute.name, attribute.value);\n }\n }\n}\n\nfunction __mreactSyncPropBindings(current, next) {\n const previousBindings = current.__mreactPropBindings;\n\n if (Array.isArray(previousBindings)) {\n for (const binding of previousBindings) {\n binding.dispose?.();\n }\n }\n\n const bindings = next.__mreactPropBindings;\n\n if (!Array.isArray(bindings) || bindings.length === 0) {\n current.__mreactPropBindings = [];\n current.__mreactHasReactiveProps = false;\n return;\n }\n\n current.__mreactPropBindings = bindings;\n current.__mreactHasReactiveProps = true;\n next.__mreactPropBindings = [];\n next.__mreactHasReactiveProps = false;\n\n for (const binding of bindings) {\n binding.retarget?.(current);\n }\n}\n\nfunction __mreactResumeChildren(current, next) {\n const nextChildren = Array.from(next.childNodes);\n const refreshTextBindings = next.__mreactHasEvents === true;\n let index = 0;\n\n while (index < nextChildren.length) {\n const currentChild = current.childNodes[index];\n const nextChild = nextChildren[index];\n\n if (currentChild === undefined) {\n current.appendChild(nextChild);\n index += 1;\n continue;\n }\n\n // Nodes owned by insertDynamic/bindText must replace the matching server\n // DOM so subsequent reactive updates mutate the live node/range instead of\n // appending beside stale SSR fallback content.\n const isDynamicNode = nextChild.__mreactDynamicNode === true;\n const isReactiveText = nextChild.__mreactReactiveText === true;\n\n if (isDynamicNode) {\n currentChild.replaceWith(nextChild);\n } else if (\n (refreshTextBindings || isReactiveText) &&\n currentChild.nodeType === Node.TEXT_NODE &&\n nextChild.nodeType === Node.TEXT_NODE\n ) {\n currentChild.replaceWith(nextChild);\n } else {\n __mreactResumeNode(currentChild, nextChild);\n }\n index += 1;\n }\n\n while (current.childNodes.length > nextChildren.length) {\n current.lastChild?.remove();\n }\n}\n`;\n return {\n code: stripTypeScriptWithOxc(entry),\n };\n}\n\nfunction workspaceRuntimePlugin(options: { routeFiles: readonly string[] }) {\n const routeFiles = new Set(options.routeFiles);\n const packageFile = (monorepoDir: string, packageName: string, entry: string): string =>\n workspacePackageFile({\n currentFileUrl: import.meta.url,\n entry,\n monorepoDir,\n packageName,\n });\n const reactiveCorePath = packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"index\");\n const reactiveCoreDir = dirname(reactiveCorePath);\n const reactiveDomPath = packageFile(\"reactive-dom\", \"@reckona/mreact-reactive-dom\", \"index\");\n const reactiveDomDir = dirname(reactiveDomPath);\n const reactCompatPath = packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"index\");\n const reactCompatDir = dirname(reactCompatPath);\n const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactCompatDir];\n const runtimePaths = new Map([\n [\n \"@reckona/mreact-reactive-core/internal\",\n packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"internal\"),\n ],\n [\"@reckona/mreact-compat\", reactCompatPath],\n [\n \"@reckona/mreact-compat/event-priority\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"event-priority\"),\n ],\n [\n \"@reckona/mreact-compat/flight\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"flight\"),\n ],\n [\n \"@reckona/mreact-compat/internal\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"internal\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/scheduler\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"scheduler\"),\n ],\n [\n \"@reckona/mreact-reactive-dom\",\n reactiveDomPath,\n ],\n ]);\n\n return {\n name: \"mreact-workspace-runtime\",\n setup(buildApi: RouterCompatBuildApi) {\n buildApi.onResolve({ filter: /^\\.\\/devtools\\.js$/ }, (args) =>\n args.importer?.startsWith(reactiveCoreDir) === true\n ? { namespace: \"mreact-devtools-stub\", path: \"devtools\" }\n : undefined,\n );\n buildApi.onResolve({ filter: /^@reckona\\/mreact-reactive-core$/ }, (args) => {\n const importer = args.importer;\n\n return importer !== undefined &&\n runtimePackageDirs.some((directory) => importer.startsWith(`${directory}${sep}`))\n ? { path: reactiveCorePath }\n : {\n namespace: \"mreact-hot-runtime\",\n path: \"reactive-core\",\n };\n });\n buildApi.onResolve(\n {\n filter:\n /^@reckona\\/mreact-(?:compat|reactive-core|reactive-dom)(?:\\/(?:event-priority|flight|internal|jsx-dev-runtime|jsx-runtime|scheduler))?$/,\n },\n (args) => {\n const path = runtimePaths.get(args.path);\n\n return path === undefined ? undefined : { path };\n },\n );\n buildApi.onLoad({ filter: /^reactive-core$/, namespace: \"mreact-hot-runtime\" }, () => ({\n contents: `import { cell as nativeCell } from ${JSON.stringify(reactiveCorePath)};\nexport * from ${JSON.stringify(reactiveCorePath)};\nexport function cell(initial) {\n const routeCell = globalThis.__mreactRouteCell;\n return typeof routeCell === \"function\" ? routeCell(nativeCell, initial) : nativeCell(initial);\n}`,\n loader: \"ts\",\n resolveDir: reactiveCoreDir,\n }));\n buildApi.onLoad({ filter: /^devtools$/, namespace: \"mreact-devtools-stub\" }, () => ({\n contents: `export function emitReactiveDevtoolsEvent() {}\nexport function hasReactiveDevtoolsEmitter() { return false; }\nexport function currentDevtoolsEmitter() { return undefined; }`,\n loader: \"ts\",\n }));\n buildApi.onLoad({ filter: /\\.(?:mreact\\.)?[cm]?[jt]sx$/ }, async (args) => {\n if (!isRouteClientDependencySourcePath(args.path, routeFiles)) {\n return undefined;\n }\n\n const source = await readFile(args.path, \"utf8\");\n const moduleContext = createCompilerModuleContext({\n code: source,\n filename: args.path,\n });\n\n if (!hasJsxSyntax(moduleContext.program)) {\n return undefined;\n }\n\n const output = transformCompilerModuleContext({\n code: source,\n dev: true,\n filename: args.path,\n mode: isCompatSourcePath(args.path) ? \"compat\" : \"reactive\",\n moduleContext,\n target: \"client\",\n });\n\n if (output.diagnostics.length > 0) {\n throw new Error(\n output.diagnostics\n .map((diagnostic) => formatDiagnostic(args.path, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n return {\n contents: output.code,\n loader: \"tsx\",\n resolveDir: dirname(args.path),\n };\n });\n },\n };\n}\n\nfunction isRouteClientDependencySourcePath(path: string, routeFiles: ReadonlySet<string>): boolean {\n return !routeFiles.has(path) && !path.includes(`${sep}node_modules${sep}`);\n}\n\nfunction isCompatSourcePath(path: string): boolean {\n return /\\.compat(?:\\.mreact)?(?:\\.[cm]?[jt]sx?)?$/.test(path);\n}\n\n/**\n * Detects the `export const clientNavigation = false` hint in a page module\n * source. Returns the hinted value, or `true` when no hint is present (i.e.,\n * preserve the historical \"navigation runtime is always present\" behavior).\n *\n * Regex-based to avoid pulling the JS parser into the build path. The pattern\n * accepts the common formatting variants:\n * export const clientNavigation = false\n * export const clientNavigation = false ;\n * export const clientNavigation: boolean = false\n */\nexport function detectClientNavigationHint(source: string): boolean {\n const match = source.match(\n /export\\s+const\\s+clientNavigation\\s*(?::\\s*[^=]+)?=\\s*(true|false)\\s*;?/,\n );\n return match === null ? true : match[1] === \"true\";\n}\n\nexport function detectNavigationRuntimeHint(source: string): boolean {\n const match = source.match(\n /export\\s+const\\s+navigationRuntime\\s*(?::\\s*[^=]+)?=\\s*(true|false)\\s*;?/,\n );\n return match !== null && match[1] === \"true\";\n}\n\nfunction detectRouteCellStateHint(code: string): boolean {\n const callExpression = routeCellCallExpressionSource(code);\n\n return callExpression === undefined\n ? /\\bcell\\d*\\s*\\(/.test(code)\n : new RegExp(`(?:${callExpression})\\\\s*\\\\(`).test(code);\n}\n\nfunction detectRouteReactiveEffectHint(code: string): boolean {\n return (\n /from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/.test(code) &&\n /\\beffect\\s*\\(/.test(code)\n );\n}\n\nasync function inferClientReferenceManifestForBundle(options: {\n code: string;\n filename: string;\n routePath: string;\n}): Promise<readonly ClientReferenceMetadata[]> {\n const cache = createClientRouteInferenceCache();\n const moduleContext = await compilerModuleContextForSource({\n cache,\n code: options.code,\n filename: options.filename,\n });\n const inference = await inferClientRouteModule({\n cache,\n code: options.code,\n filename: options.filename,\n moduleContext,\n routePath: options.routePath,\n });\n\n if (inference.clientBoundaryImports.length === 0) {\n return [];\n }\n\n const output = transformCompilerModuleContext({\n code: options.code,\n clientBoundaryImports: inference.clientBoundaryImports,\n dev: true,\n filename: options.filename,\n moduleContext,\n target: \"server\",\n });\n\n return output.metadata.clientReferenceManifest ?? [];\n}\n\nfunction emitClientReferenceImportBlock(imports: readonly ClientReferenceImport[]): string {\n if (imports.length === 0) {\n return \"\";\n }\n\n return `${imports\n .map((reference, index) => {\n const localName = clientReferenceLocalName(index);\n\n return isIdentifierName(reference.exportName)\n ? `import { ${reference.exportName} as ${localName} } from ${JSON.stringify(reference.importSource)};`\n : `import * as ${localName} from ${JSON.stringify(reference.importSource)};`;\n })\n .join(\"\\n\")}\\n`;\n}\n\nfunction emitClientReferenceRegistry(\n manifest: readonly ClientReferenceMetadata[],\n imports: readonly ClientReferenceImport[],\n compatNames: ReadonlySet<string>,\n): string {\n const importedExpressions = new Map(\n imports.map((reference, index) => [\n reference.name,\n isIdentifierName(reference.exportName)\n ? clientReferenceLocalName(index)\n : `${clientReferenceLocalName(index)}[${JSON.stringify(reference.exportName)}]`,\n ]),\n );\n const entries = manifest.flatMap((reference) => {\n const expression =\n importedExpressions.get(reference.name) ?? clientReferenceExpression(reference.name);\n\n return expression === undefined\n ? []\n : [\n compatNames.has(reference.name)\n ? ` [${JSON.stringify(reference.name)}, { component: ${expression}, compat: true }],`\n : ` [${JSON.stringify(reference.name)}, ${expression}],`,\n ];\n });\n\n return [\"const __mreactClientReferenceComponents = new Map([\", ...entries, \"]);\"].join(\"\\n\");\n}\n\nfunction compatClientReferenceComponentNames(\n manifest: readonly ClientReferenceMetadata[],\n): ReadonlySet<string> {\n return new Set(\n manifest\n .filter((reference) => isCompatSourcePath(reference.moduleId))\n .map((reference) => reference.name),\n );\n}\n\nfunction emitCompatClientReferenceImportBlock(compatNames: ReadonlySet<string>): string {\n return compatNames.size === 0\n ? \"\"\n : 'import { createElement as __mreactCompatCreateElement, createRoot as __mreactCompatCreateRoot } from \"@reckona/mreact-compat\";\\n';\n}\n\nfunction clientReferenceLocalName(index: number): string {\n return `__mreactClientReference${index}`;\n}\n\nfunction clientReferenceExpression(name: string): string | undefined {\n return /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$/.test(name) ? name : undefined;\n}\n\nfunction routeComponentExpressionForComponents(components: readonly ComponentMetadata[]): string {\n const candidates = uniqueStrings([\n ...components\n .filter((component) => component.exportName === \"default\")\n .map((component) => component.name),\n \"Page\",\n \"DefaultExport\",\n ]).filter(isIdentifierName);\n\n return candidates.reduceRight(\n (next, name) => `typeof ${name} === \"function\" ? ${name} : ${next}`,\n \"undefined\",\n );\n}\n\nfunction uniqueStrings(values: readonly string[]): string[] {\n return Array.from(new Set(values));\n}\n\nfunction isIdentifierName(value: string): boolean {\n return /^[A-Za-z_$][\\w$]*$/.test(value);\n}\n\nfunction routeStateSignatureForSource(code: string): string {\n const callExpression = routeCellCallExpressionSource(code);\n const callsitePattern =\n callExpression === undefined\n ? /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*(cell\\d*|cell)\\s*\\(/g\n : new RegExp(\n `\\\\b(?:const|let|var)\\\\s+([A-Za-z_$][\\\\w$]*)\\\\s*=\\\\s*(${callExpression})\\\\s*\\\\(`,\n \"g\",\n );\n const cellCallsites = Array.from(\n code.matchAll(callsitePattern),\n (match) => `${match[1]}:${match[2]}`,\n );\n const countPattern =\n callExpression === undefined\n ? /\\bcell\\d*\\s*\\(/g\n : new RegExp(`(?:${callExpression})\\\\s*\\\\(`, \"g\");\n const signature =\n cellCallsites.length > 0\n ? cellCallsites.join(\"\\n\")\n : `cell-count:${(code.match(countPattern) ?? []).length}`;\n\n return createHash(\"sha256\").update(signature).digest(\"hex\").slice(0, 16);\n}\n\nfunction routeCellCallExpressionSource(code: string): string | undefined {\n const namedImports = new Set<string>();\n const namespaceImports = new Set<string>();\n const namedImportPattern =\n /import\\s+\\{(?<imports>[^}]*)\\}\\s+from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/g;\n\n for (const match of code.matchAll(namedImportPattern)) {\n const imports = match.groups?.imports;\n\n if (imports === undefined) {\n continue;\n }\n\n for (const part of imports.split(\",\")) {\n const specifier = part.trim();\n const alias = /^cell\\s+as\\s+([A-Za-z_$][\\w$]*)$/.exec(specifier);\n\n if (specifier === \"cell\") {\n namedImports.add(\"cell\");\n } else if (alias?.[1] !== undefined) {\n namedImports.add(alias[1]);\n }\n }\n }\n\n const namespaceImportPattern =\n /import\\s+\\*\\s+as\\s+([A-Za-z_$][\\w$]*)\\s+from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/g;\n\n for (const match of code.matchAll(namespaceImportPattern)) {\n if (match[1] !== undefined) {\n namespaceImports.add(match[1]);\n }\n }\n\n const alternatives = [\n ...Array.from(namedImports, (name) => `\\\\b${escapeRegExp(name)}`),\n ...Array.from(namespaceImports, (name) => `\\\\b${escapeRegExp(name)}\\\\.cell`),\n ];\n\n return alternatives.length === 0 ? undefined : `(?:${alternatives.join(\"|\")})`;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction escapeScriptJson(value: string): string {\n return value.replaceAll(\"<\", \"\\\\u003c\");\n}\n"]}
|
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAQA,OAAO,EAAiB,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAsB,MAAM,MAAM,CAAC;AACvG,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,w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AO,CAAC;IAAC,WAAW,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAA;CAAO,GACjF,OAAO,CAAC,QAAQ,CAAC,CAuEnB"}
|
package/dist/vite.js
CHANGED
|
@@ -31,6 +31,11 @@ export function createAppRouterVitePlugin(options) {
|
|
|
31
31
|
});
|
|
32
32
|
const reactiveCorePath = packageFile("reactive-core", "@reckona/mreact-reactive-core", "index");
|
|
33
33
|
const reactiveCoreDir = normalizePath(dirname(reactiveCorePath));
|
|
34
|
+
const reactiveDomPath = packageFile("reactive-dom", "@reckona/mreact-reactive-dom", "index");
|
|
35
|
+
const reactiveDomDir = normalizePath(dirname(reactiveDomPath));
|
|
36
|
+
const reactCompatPath = packageFile("react-compat", "@reckona/mreact-compat", "index");
|
|
37
|
+
const reactCompatDir = normalizePath(dirname(reactCompatPath));
|
|
38
|
+
const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactCompatDir];
|
|
34
39
|
const runtimePaths = new Map([
|
|
35
40
|
[
|
|
36
41
|
"@reckona/mreact-reactive-core/internal",
|
|
@@ -38,11 +43,11 @@ export function createAppRouterVitePlugin(options) {
|
|
|
38
43
|
],
|
|
39
44
|
[
|
|
40
45
|
"@reckona/mreact-reactive-dom",
|
|
41
|
-
|
|
46
|
+
reactiveDomPath,
|
|
42
47
|
],
|
|
43
48
|
[
|
|
44
49
|
"@reckona/mreact-compat",
|
|
45
|
-
|
|
50
|
+
reactCompatPath,
|
|
46
51
|
],
|
|
47
52
|
[
|
|
48
53
|
"@reckona/mreact-compat/event-priority",
|
|
@@ -182,6 +187,9 @@ export function currentDevtoolsEmitter() { return undefined; }`;
|
|
|
182
187
|
async resolveId(id, importer) {
|
|
183
188
|
const runtimePath = runtimePaths.get(id);
|
|
184
189
|
if (id === "@reckona/mreact-reactive-core") {
|
|
190
|
+
if (runtimePackageDirs.some((directory) => importerInDirectory(importer, directory))) {
|
|
191
|
+
return reactiveCorePath;
|
|
192
|
+
}
|
|
185
193
|
return virtualReactiveCoreId;
|
|
186
194
|
}
|
|
187
195
|
if (id === "./devtools.js" && importerInDirectory(importer, reactiveCoreDir)) {
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAoE,MAAM,MAAM,CAAC;AAGvG,OAAO,EACL,8BAA8B,GAG/B,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,mBAAmB,EACnB,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAA0B,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAuB/D,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AA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AG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;QAC/C,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO;YACT,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC;YAChB,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC;YAC3B,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;gBACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC;YAC3C,CAAC;QACH,CAAC,CAAC;QAEF,QAAQ,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QAC5C,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,oBAAoB,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO;;;;EAIP,IAAI;;;;;;;;;;CAUL,CAAC;AACF,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { ServerResponse } from \"node:http\";\nimport { dirname } from \"node:path\";\nimport { formatDiagnostic } from \"@reckona/mreact-compiler\";\nimport {\n createCompilerModuleContext,\n transformCompilerModuleContext,\n} from \"@reckona/mreact-compiler/internal\";\nimport { normalizePath, type Connect, type Plugin, type PluginOption, type ViteDevServer } from \"vite\";\nimport type { AppRouterServerActionOptions } from \"./actions.js\";\nimport type { AppRouterCache } from \"./cache.js\";\nimport {\n resolveAppRouterProjectOptions,\n type AppRouterProjectOptions,\n type ResolvedAppRouterProject,\n} from \"./config.js\";\nimport type { AppRouterImportPolicy } from \"./import-policy.js\";\nimport {\n buildNavigationRuntimeBundle,\n buildClientRouteBundle,\n buildClientRouteEntrySource,\n clientScriptForPath,\n collectClientRouteReferences,\n detectNavigationRuntimeHint,\n isClientRouteSource,\n navigationRuntimeScriptForDev,\n} from \"./client.js\";\nimport { nodeRequestToWebRequest, sendResponse } from \"./http.js\";\nimport { renderAppRequest } from \"./render.js\";\nimport { stripRouteClientOnlyExports } from \"./route-source.js\";\nimport { collectRouteCssHrefs } from \"./route-styles.js\";\nimport { scanAppRoutes } from \"./routes.js\";\nimport { resolveRequestHost, type RequestHostPolicy } from \"./serve.js\";\nimport { hasJsxSyntax } from \"./source-jsx.js\";\nimport { workspacePackageFile } from \"./workspace-packages.js\";\n\nexport interface AppRouterViteMiddlewareOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}\n\ntype AppRouterViteRuntimeMiddlewareOptions = AppRouterViteMiddlewareOptions & {\n viteDevServer?: ViteDevServer | undefined;\n};\n\nexport interface AppRouterVitePluginOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}\n\nconst clientPrefix = \"/_mreact/client/\";\nconst devCssPrefix = \"/_mreact/dev-css/\";\nconst clientRouteModuleQuery = \"mreact-router-client-route\";\nconst virtualClientPrefix = \"\\0mreact-router-client:\";\nconst virtualReactiveCoreId = \"\\0mreact-router-reactive-core\";\nconst virtualReactiveDevtoolsId = \"\\0mreact-router-reactive-devtools\";\nconst mreactRouterConfigKey = \"__mreactRouterConfig\";\n\ntype MreactRouterPlugin = Plugin & {\n [mreactRouterConfigKey]: ResolvedAppRouterProject;\n};\n\nexport function createAppRouterVitePlugin(\n options: AppRouterVitePluginOptions,\n): Plugin {\n const project = resolveAppRouterProjectOptions(options);\n const normalizedSourceDirs = project.allowedSourceDirs.map((directory) => normalizePath(directory));\n const packageFile = (monorepoDir: string, packageName: string, entry: string): string =>\n workspacePackageFile({\n currentFileUrl: import.meta.url,\n entry,\n monorepoDir,\n packageName,\n });\n const reactiveCorePath = packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"index\");\n const reactiveCoreDir = normalizePath(dirname(reactiveCorePath));\n const runtimePaths = new Map([\n [\n \"@reckona/mreact-reactive-core/internal\",\n packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"internal\"),\n ],\n [\n \"@reckona/mreact-reactive-dom\",\n packageFile(\"reactive-dom\", \"@reckona/mreact-reactive-dom\", \"index\"),\n ],\n [\n \"@reckona/mreact-compat\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"index\"),\n ],\n [\n \"@reckona/mreact-compat/event-priority\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"event-priority\"),\n ],\n [\n \"@reckona/mreact-compat/flight\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"flight\"),\n ],\n [\n \"@reckona/mreact-compat/internal\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"internal\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/scheduler\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"scheduler\"),\n ],\n [\n \"@reckona/mreact-router/link\",\n packageFile(\"router\", \"@reckona/mreact-router\", \"link\"),\n ],\n [\n \"@reckona/mreact-router/navigation-state\",\n packageFile(\"router\", \"@reckona/mreact-router\", \"navigation-state\"),\n ],\n [\n \"@reckona/mreact-shared/url-safety\",\n packageFile(\"shared\", \"@reckona/mreact-shared\", \"url-safety\"),\n ],\n ]);\n\n const plugin: MreactRouterPlugin = {\n [mreactRouterConfigKey]: project,\n enforce: \"pre\",\n name: \"mreact-router\",\n configureServer(server) {\n server.middlewares.use(createDevCssProxyMiddleware());\n\n return () => {\n const middlewareOptions: AppRouterViteRuntimeMiddlewareOptions = {\n ...options,\n viteDevServer: server,\n vitePlugins: server.config.plugins,\n };\n\n server.middlewares.use(\n createAppRouterViteMiddleware(middlewareOptions),\n );\n };\n },\n handleHotUpdate(context) {\n const normalizedFile = normalizePath(context.file);\n\n if (!normalizedSourceDirs.some((directory) => normalizedFile.startsWith(directory))) {\n return;\n }\n\n const timestamp = Date.now();\n const updates = Array.from(context.server.moduleGraph.idToModuleMap.values())\n .filter((moduleNode) => isMreactClientDevModuleId(moduleNode.id))\n .map((moduleNode) => {\n context.server.moduleGraph.invalidateModule(moduleNode);\n\n return {\n acceptedPath: moduleNode.url,\n path: moduleNode.url,\n timestamp,\n type: \"js-update\" as const,\n };\n });\n\n if (updates.length > 0) {\n context.server.ws.send({ type: \"update\", updates });\n }\n\n return [];\n },\n load(id) {\n if (id === virtualReactiveCoreId) {\n return `import { cell as nativeCell } from ${JSON.stringify(reactiveCorePath)};\nexport * from ${JSON.stringify(reactiveCorePath)};\nexport function cell(initial) {\n const routeCell = globalThis.__mreactRouteCell;\n return typeof routeCell === \"function\" ? routeCell(nativeCell, initial) : nativeCell(initial);\n}`;\n }\n\n if (id === virtualReactiveDevtoolsId) {\n return `export function emitReactiveDevtoolsEvent() {}\nexport function hasReactiveDevtoolsEmitter() { return false; }\nexport function currentDevtoolsEmitter() { return undefined; }`;\n }\n\n if (id.startsWith(virtualClientPrefix)) {\n return renderAppRouterClientAsset(\n project.routesDir,\n id.slice(virtualClientPrefix.length),\n { dev: true },\n ).then(async (response) => {\n if (!response.ok) {\n const message = await response.text();\n throw new Error(message || `MReact client route asset was not found: ${id}`);\n }\n\n return response.text();\n });\n }\n\n const requestPath = clientRouteModuleRequestPath(id);\n\n return requestPath === undefined\n ? undefined\n : renderAppRouterClientRouteDevModule(project.routesDir, requestPath);\n },\n transform(code, id, options) {\n if (options?.ssr === true) {\n return undefined;\n }\n\n if (isMreactClientDevModuleId(id)) {\n return undefined;\n }\n\n const filename = clientRequestPath(id);\n\n if (!isMreactClientSourceDependency(filename, normalizedSourceDirs)) {\n return undefined;\n }\n\n const moduleContext = createCompilerModuleContext({ code, filename });\n\n if (!hasJsxSyntax(moduleContext.program)) {\n return undefined;\n }\n\n const output = transformCompilerModuleContext({\n code,\n dev: true,\n filename,\n mode: isCompatSourcePath(filename) ? \"compat\" : \"reactive\",\n moduleContext,\n target: \"client\",\n });\n\n if (output.diagnostics.length > 0) {\n throw new Error(\n output.diagnostics\n .map((diagnostic) => formatDiagnostic(filename, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n return {\n code: output.code,\n map: null,\n };\n },\n async resolveId(id, importer) {\n const runtimePath = runtimePaths.get(id);\n\n if (id === \"@reckona/mreact-reactive-core\") {\n return virtualReactiveCoreId;\n }\n\n if (id === \"./devtools.js\" && importerInDirectory(importer, reactiveCoreDir)) {\n return virtualReactiveDevtoolsId;\n }\n\n if (runtimePath !== undefined) {\n return runtimePath;\n }\n\n const requestPath = clientRequestPath(id);\n\n if (requestPath === `${clientPrefix}${navigationRuntimeScriptForDev()}`) {\n return `${virtualClientPrefix}${requestPath}`;\n }\n\n if (!requestPath.startsWith(clientPrefix)) {\n return undefined;\n }\n\n const route = await clientRouteForRequestPath(project.routesDir, requestPath);\n\n return route === undefined ? undefined : clientRouteModuleId(route.file, requestPath);\n },\n };\n\n return plugin;\n}\n\nfunction isMreactClientSourceDependency(\n filename: string,\n normalizedSourceDirs: readonly string[],\n): boolean {\n const normalized = normalizePath(filename);\n\n return (\n /\\.(?:mreact\\.)?[cm]?[jt]sx?$/.test(normalized) &&\n !normalized.includes(\"/node_modules/\") &&\n normalizedSourceDirs.some(\n (directory) => normalized === directory || normalized.startsWith(`${directory}/`),\n )\n );\n}\n\nfunction isCompatSourcePath(filename: string): boolean {\n return /\\.compat(?:\\.mreact)?(?:\\.[cm]?[jt]sx?)?$/.test(filename);\n}\n\nexport const mreactRouter = createAppRouterVitePlugin;\n\nexport function mreactRouterConfigFromPlugins(\n plugins: readonly unknown[],\n): ResolvedAppRouterProject | undefined {\n for (const plugin of plugins.flat(Infinity)) {\n if (\n plugin !== null &&\n typeof plugin === \"object\" &&\n mreactRouterConfigKey in plugin\n ) {\n return (plugin as MreactRouterPlugin)[mreactRouterConfigKey];\n }\n }\n\n return undefined;\n}\n\nexport function createAppRouterViteMiddleware(\n options: AppRouterViteMiddlewareOptions,\n): Connect.NextHandleFunction {\n return (request, response, next) => {\n void handleAppRouterViteRequest(\n options as AppRouterViteRuntimeMiddlewareOptions,\n request,\n response,\n next,\n );\n };\n}\n\nasync function handleAppRouterViteRequest(\n options: AppRouterViteRuntimeMiddlewareOptions,\n incoming: Connect.IncomingMessage,\n outgoing: ServerResponse,\n next: Connect.NextFunction,\n): Promise<void> {\n try {\n const project = resolveAppRouterProjectOptions(options);\n const host = resolveRequestHost({\n allowedHosts: options.allowedHosts,\n fallbackHost: \"localhost\",\n hostPolicy: options.hostPolicy,\n rawHost: incoming.headers.host,\n });\n const origin = `http://${host}`;\n const url = new URL(incoming.url ?? \"/\", origin);\n\n if (url.pathname.startsWith(clientPrefix)) {\n if (options.viteDevServer !== undefined) {\n const transformed = await options.viteDevServer.transformRequest(\n `${url.pathname}${url.search}`,\n );\n\n if (transformed !== null) {\n await sendResponse(\n outgoing,\n new Response(transformed.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n }),\n );\n return;\n }\n }\n\n await sendResponse(\n outgoing,\n await renderAppRouterClientAsset(project.routesDir, url.pathname, {\n vitePlugins: options.vitePlugins,\n }),\n );\n return;\n }\n\n const request = nodeRequestToWebRequest(incoming, origin);\n\n await sendResponse(\n outgoing,\n await renderAppRequest({\n appDir: project.routesDir,\n importPolicy: {\n ...options.importPolicy,\n allowedSourceDirs: project.allowedSourceDirs,\n projectRoot: project.projectRoot,\n },\n clientStyles: await devRouteStyles(project),\n navigationScripts: await devNavigationScripts(project.routesDir),\n request,\n routeCache: options.routeCache,\n serverActions: options.serverActions,\n }),\n );\n } catch (error) {\n next(error);\n }\n}\n\nexport async function renderAppRouterClientAsset(\n appDir: string,\n pathname: string,\n options: { dev?: boolean; vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<Response> {\n if (pathname === `/_mreact/client/${navigationRuntimeScriptForDev()}`) {\n const output = await buildNavigationRuntimeBundle();\n\n return new Response(options.dev === true ? withViteHmrRuntime(output.code) : output.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n }\n\n const routes = await scanAppRoutes({ appDir });\n const route = routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n\n if (route === undefined || route.kind !== \"page\") {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code);\n let references: Awaited<ReturnType<typeof collectClientRouteReferences>>;\n\n try {\n references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n if (!references.client) {\n if (isClientRouteSource(clientSource)) {\n return clientAssetBuildErrorResponse(\n route.file,\n new Error(\n [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\"),\n ),\n );\n }\n\n return new Response(\"Not Found\", { status: 404 });\n }\n\n let bundle: string;\n\n try {\n bundle = await buildClientRouteBundle({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n return new Response(options.dev === true ? withViteHmrRuntime(bundle) : bundle, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function renderAppRouterClientRouteDevModule(\n appDir: string,\n pathname: string,\n options: { vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<string> {\n const route = await clientRouteForRequestPath(appDir, pathname);\n\n if (route === undefined) {\n throw new Error(`MReact client route asset was not found: ${pathname}`);\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code);\n const references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n\n if (!references.client) {\n throw new Error(\n isClientRouteSource(clientSource)\n ? [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\")\n : `MReact client route asset was not found: ${pathname}`,\n );\n }\n\n const entry = await buildClientRouteEntrySource({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n\n return withViteHmrRuntime(entry.code);\n}\n\nasync function clientRouteForRequestPath(appDir: string, pathname: string) {\n const routes = await scanAppRoutes({ appDir });\n\n return routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n}\n\nfunction clientRequestPath(id: string): string {\n const [path] = id.split(/[?#]/, 1);\n\n return path ?? id;\n}\n\nfunction clientRouteModuleId(filename: string, requestPath: string): string {\n return `${normalizePath(filename)}?${clientRouteModuleQuery}=${encodeURIComponent(requestPath)}`;\n}\n\nfunction clientRouteModuleRequestPath(id: string): string | undefined {\n const queryStart = id.indexOf(\"?\");\n\n if (queryStart === -1) {\n return undefined;\n }\n\n const params = new URLSearchParams(id.slice(queryStart + 1));\n const value = params.get(clientRouteModuleQuery);\n\n return value === null ? undefined : value;\n}\n\nfunction isMreactClientDevModuleId(id: string | null | undefined): boolean {\n return (\n id?.startsWith(virtualClientPrefix) === true ||\n id?.includes(`?${clientRouteModuleQuery}=`) === true ||\n id?.includes(`&${clientRouteModuleQuery}=`) === true\n );\n}\n\nfunction importerInDirectory(importer: string | undefined, directory: string): boolean {\n return importer !== undefined && normalizePath(importer).startsWith(`${directory}/`);\n}\n\nfunction clientAssetBuildErrorResponse(filename: string, error: unknown): Response {\n const message = [\n `Failed to build mreact client route asset for ${filename}.`,\n error instanceof Error ? error.message : String(error),\n ].join(\"\\n\");\n\n return new Response(`throw new Error(${JSON.stringify(message)});\\n`, {\n status: 500,\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function devRouteStyles(\n project: ResolvedAppRouterProject,\n): Promise<ReadonlyMap<string, readonly string[]>> {\n const entries = await Promise.all(\n (await scanAppRoutes({ appDir: project.routesDir })).map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const hrefs = await collectRouteCssHrefs({\n appDir: project.routesDir,\n hrefPrefix: devCssPrefix,\n pageFile: route.file,\n projectRoot: project.projectRoot,\n });\n\n return hrefs.length === 0 ? undefined : ([route.path, hrefs as readonly string[]] as const);\n }),\n );\n const routeStyles = entries.filter(\n (entry): entry is readonly [string, readonly string[]] => entry !== undefined,\n );\n\n return new Map<string, readonly string[]>(routeStyles);\n}\n\nasync function devNavigationScripts(appDir: string): Promise<ReadonlyMap<string, string>> {\n const entries = await Promise.all(\n (await scanAppRoutes({ appDir })).map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const source = await readFile(route.file, \"utf8\");\n\n return detectNavigationRuntimeHint(source)\n ? ([route.path, navigationRuntimeScriptForDev()] as const)\n : undefined;\n }),\n );\n\n return new Map(entries.filter((entry): entry is readonly [string, string] => entry !== undefined));\n}\n\nfunction createDevCssProxyMiddleware(): Connect.NextHandleFunction {\n return (incoming, outgoing, next) => {\n const originalUrl = incoming.url ?? \"/\";\n const url = new URL(originalUrl, \"http://mreact.local\");\n\n if (!url.pathname.startsWith(devCssPrefix)) {\n next();\n return;\n }\n\n const sourcePath = `/${url.pathname.slice(devCssPrefix.length)}`;\n\n if (sourcePath === \"/\" || sourcePath.includes(\"\\0\")) {\n next();\n return;\n }\n\n const originalAccept = incoming.headers.accept;\n let restored = false;\n const restore = () => {\n if (restored) {\n return;\n }\n restored = true;\n incoming.url = originalUrl;\n if (originalAccept === undefined) {\n delete incoming.headers.accept;\n } else {\n incoming.headers.accept = originalAccept;\n }\n };\n\n incoming.url = `${sourcePath}${url.search}`;\n incoming.headers.accept = \"text/css,*/*;q=0.1\";\n outgoing.once(\"finish\", restore);\n outgoing.once(\"close\", restore);\n next();\n };\n}\n\nfunction withViteHmrRuntime(code: string): string {\n return `import \"/@vite/client\";\nif (import.meta.hot?.data.__mreactRouteStates) {\n globalThis.__mreactRouteStates = import.meta.hot.data.__mreactRouteStates;\n}\n${code}\nif (import.meta.hot) {\n const __mreactPreserveRouteState = () => {\n import.meta.hot.data.__mreactRouteStates = globalThis.__mreactRouteStates;\n };\n import.meta.hot.dispose(__mreactPreserveRouteState);\n import.meta.hot.accept((module) => {\n module?.__mreactHydrateRoute?.();\n });\n}\n`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,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CAAC,IAAI,CAAC,EAAE,CAAC;YACpD,IAAI,EAAE,CAAC;YACP,OAAO;QACT,CAAC;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;QAC/C,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,IAAI,QAAQ,EAAE,CAAC;gBACb,OAAO;YACT,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC;YAChB,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC;YAC3B,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;gBACjC,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,cAAc,CAAC;YAC3C,CAAC;QACH,CAAC,CAAC;QAEF,QAAQ,CAAC,GAAG,GAAG,GAAG,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QAC5C,QAAQ,CAAC,OAAO,CAAC,MAAM,GAAG,oBAAoB,CAAC;QAC/C,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO;;;;EAIP,IAAI;;;;;;;;;;CAUL,CAAC;AACF,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport type { ServerResponse } from \"node:http\";\nimport { dirname } from \"node:path\";\nimport { formatDiagnostic } from \"@reckona/mreact-compiler\";\nimport {\n createCompilerModuleContext,\n transformCompilerModuleContext,\n} from \"@reckona/mreact-compiler/internal\";\nimport { normalizePath, type Connect, type Plugin, type PluginOption, type ViteDevServer } from \"vite\";\nimport type { AppRouterServerActionOptions } from \"./actions.js\";\nimport type { AppRouterCache } from \"./cache.js\";\nimport {\n resolveAppRouterProjectOptions,\n type AppRouterProjectOptions,\n type ResolvedAppRouterProject,\n} from \"./config.js\";\nimport type { AppRouterImportPolicy } from \"./import-policy.js\";\nimport {\n buildNavigationRuntimeBundle,\n buildClientRouteBundle,\n buildClientRouteEntrySource,\n clientScriptForPath,\n collectClientRouteReferences,\n detectNavigationRuntimeHint,\n isClientRouteSource,\n navigationRuntimeScriptForDev,\n} from \"./client.js\";\nimport { nodeRequestToWebRequest, sendResponse } from \"./http.js\";\nimport { renderAppRequest } from \"./render.js\";\nimport { stripRouteClientOnlyExports } from \"./route-source.js\";\nimport { collectRouteCssHrefs } from \"./route-styles.js\";\nimport { scanAppRoutes } from \"./routes.js\";\nimport { resolveRequestHost, type RequestHostPolicy } from \"./serve.js\";\nimport { hasJsxSyntax } from \"./source-jsx.js\";\nimport { workspacePackageFile } from \"./workspace-packages.js\";\n\nexport interface AppRouterViteMiddlewareOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}\n\ntype AppRouterViteRuntimeMiddlewareOptions = AppRouterViteMiddlewareOptions & {\n viteDevServer?: ViteDevServer | undefined;\n};\n\nexport interface AppRouterVitePluginOptions extends AppRouterProjectOptions {\n allowedHosts?: readonly string[] | undefined;\n hostPolicy?: RequestHostPolicy | undefined;\n importPolicy?: AppRouterImportPolicy | undefined;\n routeCache?: AppRouterCache | undefined;\n serverActions?: AppRouterServerActionOptions | undefined;\n}\n\nconst clientPrefix = \"/_mreact/client/\";\nconst devCssPrefix = \"/_mreact/dev-css/\";\nconst clientRouteModuleQuery = \"mreact-router-client-route\";\nconst virtualClientPrefix = \"\\0mreact-router-client:\";\nconst virtualReactiveCoreId = \"\\0mreact-router-reactive-core\";\nconst virtualReactiveDevtoolsId = \"\\0mreact-router-reactive-devtools\";\nconst mreactRouterConfigKey = \"__mreactRouterConfig\";\n\ntype MreactRouterPlugin = Plugin & {\n [mreactRouterConfigKey]: ResolvedAppRouterProject;\n};\n\nexport function createAppRouterVitePlugin(\n options: AppRouterVitePluginOptions,\n): Plugin {\n const project = resolveAppRouterProjectOptions(options);\n const normalizedSourceDirs = project.allowedSourceDirs.map((directory) => normalizePath(directory));\n const packageFile = (monorepoDir: string, packageName: string, entry: string): string =>\n workspacePackageFile({\n currentFileUrl: import.meta.url,\n entry,\n monorepoDir,\n packageName,\n });\n const reactiveCorePath = packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"index\");\n const reactiveCoreDir = normalizePath(dirname(reactiveCorePath));\n const reactiveDomPath = packageFile(\"reactive-dom\", \"@reckona/mreact-reactive-dom\", \"index\");\n const reactiveDomDir = normalizePath(dirname(reactiveDomPath));\n const reactCompatPath = packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"index\");\n const reactCompatDir = normalizePath(dirname(reactCompatPath));\n const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactCompatDir];\n const runtimePaths = new Map([\n [\n \"@reckona/mreact-reactive-core/internal\",\n packageFile(\"reactive-core\", \"@reckona/mreact-reactive-core\", \"internal\"),\n ],\n [\n \"@reckona/mreact-reactive-dom\",\n reactiveDomPath,\n ],\n [\n \"@reckona/mreact-compat\",\n reactCompatPath,\n ],\n [\n \"@reckona/mreact-compat/event-priority\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"event-priority\"),\n ],\n [\n \"@reckona/mreact-compat/flight\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"flight\"),\n ],\n [\n \"@reckona/mreact-compat/internal\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"internal\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/jsx-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\"),\n ],\n [\n \"@reckona/mreact-compat/scheduler\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"scheduler\"),\n ],\n [\n \"@reckona/mreact-router/link\",\n packageFile(\"router\", \"@reckona/mreact-router\", \"link\"),\n ],\n [\n \"@reckona/mreact-router/navigation-state\",\n packageFile(\"router\", \"@reckona/mreact-router\", \"navigation-state\"),\n ],\n [\n \"@reckona/mreact-shared/url-safety\",\n packageFile(\"shared\", \"@reckona/mreact-shared\", \"url-safety\"),\n ],\n ]);\n\n const plugin: MreactRouterPlugin = {\n [mreactRouterConfigKey]: project,\n enforce: \"pre\",\n name: \"mreact-router\",\n configureServer(server) {\n server.middlewares.use(createDevCssProxyMiddleware());\n\n return () => {\n const middlewareOptions: AppRouterViteRuntimeMiddlewareOptions = {\n ...options,\n viteDevServer: server,\n vitePlugins: server.config.plugins,\n };\n\n server.middlewares.use(\n createAppRouterViteMiddleware(middlewareOptions),\n );\n };\n },\n handleHotUpdate(context) {\n const normalizedFile = normalizePath(context.file);\n\n if (!normalizedSourceDirs.some((directory) => normalizedFile.startsWith(directory))) {\n return;\n }\n\n const timestamp = Date.now();\n const updates = Array.from(context.server.moduleGraph.idToModuleMap.values())\n .filter((moduleNode) => isMreactClientDevModuleId(moduleNode.id))\n .map((moduleNode) => {\n context.server.moduleGraph.invalidateModule(moduleNode);\n\n return {\n acceptedPath: moduleNode.url,\n path: moduleNode.url,\n timestamp,\n type: \"js-update\" as const,\n };\n });\n\n if (updates.length > 0) {\n context.server.ws.send({ type: \"update\", updates });\n }\n\n return [];\n },\n load(id) {\n if (id === virtualReactiveCoreId) {\n return `import { cell as nativeCell } from ${JSON.stringify(reactiveCorePath)};\nexport * from ${JSON.stringify(reactiveCorePath)};\nexport function cell(initial) {\n const routeCell = globalThis.__mreactRouteCell;\n return typeof routeCell === \"function\" ? routeCell(nativeCell, initial) : nativeCell(initial);\n}`;\n }\n\n if (id === virtualReactiveDevtoolsId) {\n return `export function emitReactiveDevtoolsEvent() {}\nexport function hasReactiveDevtoolsEmitter() { return false; }\nexport function currentDevtoolsEmitter() { return undefined; }`;\n }\n\n if (id.startsWith(virtualClientPrefix)) {\n return renderAppRouterClientAsset(\n project.routesDir,\n id.slice(virtualClientPrefix.length),\n { dev: true },\n ).then(async (response) => {\n if (!response.ok) {\n const message = await response.text();\n throw new Error(message || `MReact client route asset was not found: ${id}`);\n }\n\n return response.text();\n });\n }\n\n const requestPath = clientRouteModuleRequestPath(id);\n\n return requestPath === undefined\n ? undefined\n : renderAppRouterClientRouteDevModule(project.routesDir, requestPath);\n },\n transform(code, id, options) {\n if (options?.ssr === true) {\n return undefined;\n }\n\n if (isMreactClientDevModuleId(id)) {\n return undefined;\n }\n\n const filename = clientRequestPath(id);\n\n if (!isMreactClientSourceDependency(filename, normalizedSourceDirs)) {\n return undefined;\n }\n\n const moduleContext = createCompilerModuleContext({ code, filename });\n\n if (!hasJsxSyntax(moduleContext.program)) {\n return undefined;\n }\n\n const output = transformCompilerModuleContext({\n code,\n dev: true,\n filename,\n mode: isCompatSourcePath(filename) ? \"compat\" : \"reactive\",\n moduleContext,\n target: \"client\",\n });\n\n if (output.diagnostics.length > 0) {\n throw new Error(\n output.diagnostics\n .map((diagnostic) => formatDiagnostic(filename, diagnostic))\n .join(\"\\n\"),\n );\n }\n\n return {\n code: output.code,\n map: null,\n };\n },\n async resolveId(id, importer) {\n const runtimePath = runtimePaths.get(id);\n\n if (id === \"@reckona/mreact-reactive-core\") {\n if (runtimePackageDirs.some((directory) => importerInDirectory(importer, directory))) {\n return reactiveCorePath;\n }\n\n return virtualReactiveCoreId;\n }\n\n if (id === \"./devtools.js\" && importerInDirectory(importer, reactiveCoreDir)) {\n return virtualReactiveDevtoolsId;\n }\n\n if (runtimePath !== undefined) {\n return runtimePath;\n }\n\n const requestPath = clientRequestPath(id);\n\n if (requestPath === `${clientPrefix}${navigationRuntimeScriptForDev()}`) {\n return `${virtualClientPrefix}${requestPath}`;\n }\n\n if (!requestPath.startsWith(clientPrefix)) {\n return undefined;\n }\n\n const route = await clientRouteForRequestPath(project.routesDir, requestPath);\n\n return route === undefined ? undefined : clientRouteModuleId(route.file, requestPath);\n },\n };\n\n return plugin;\n}\n\nfunction isMreactClientSourceDependency(\n filename: string,\n normalizedSourceDirs: readonly string[],\n): boolean {\n const normalized = normalizePath(filename);\n\n return (\n /\\.(?:mreact\\.)?[cm]?[jt]sx?$/.test(normalized) &&\n !normalized.includes(\"/node_modules/\") &&\n normalizedSourceDirs.some(\n (directory) => normalized === directory || normalized.startsWith(`${directory}/`),\n )\n );\n}\n\nfunction isCompatSourcePath(filename: string): boolean {\n return /\\.compat(?:\\.mreact)?(?:\\.[cm]?[jt]sx?)?$/.test(filename);\n}\n\nexport const mreactRouter = createAppRouterVitePlugin;\n\nexport function mreactRouterConfigFromPlugins(\n plugins: readonly unknown[],\n): ResolvedAppRouterProject | undefined {\n for (const plugin of plugins.flat(Infinity)) {\n if (\n plugin !== null &&\n typeof plugin === \"object\" &&\n mreactRouterConfigKey in plugin\n ) {\n return (plugin as MreactRouterPlugin)[mreactRouterConfigKey];\n }\n }\n\n return undefined;\n}\n\nexport function createAppRouterViteMiddleware(\n options: AppRouterViteMiddlewareOptions,\n): Connect.NextHandleFunction {\n return (request, response, next) => {\n void handleAppRouterViteRequest(\n options as AppRouterViteRuntimeMiddlewareOptions,\n request,\n response,\n next,\n );\n };\n}\n\nasync function handleAppRouterViteRequest(\n options: AppRouterViteRuntimeMiddlewareOptions,\n incoming: Connect.IncomingMessage,\n outgoing: ServerResponse,\n next: Connect.NextFunction,\n): Promise<void> {\n try {\n const project = resolveAppRouterProjectOptions(options);\n const host = resolveRequestHost({\n allowedHosts: options.allowedHosts,\n fallbackHost: \"localhost\",\n hostPolicy: options.hostPolicy,\n rawHost: incoming.headers.host,\n });\n const origin = `http://${host}`;\n const url = new URL(incoming.url ?? \"/\", origin);\n\n if (url.pathname.startsWith(clientPrefix)) {\n if (options.viteDevServer !== undefined) {\n const transformed = await options.viteDevServer.transformRequest(\n `${url.pathname}${url.search}`,\n );\n\n if (transformed !== null) {\n await sendResponse(\n outgoing,\n new Response(transformed.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n }),\n );\n return;\n }\n }\n\n await sendResponse(\n outgoing,\n await renderAppRouterClientAsset(project.routesDir, url.pathname, {\n vitePlugins: options.vitePlugins,\n }),\n );\n return;\n }\n\n const request = nodeRequestToWebRequest(incoming, origin);\n\n await sendResponse(\n outgoing,\n await renderAppRequest({\n appDir: project.routesDir,\n importPolicy: {\n ...options.importPolicy,\n allowedSourceDirs: project.allowedSourceDirs,\n projectRoot: project.projectRoot,\n },\n clientStyles: await devRouteStyles(project),\n navigationScripts: await devNavigationScripts(project.routesDir),\n request,\n routeCache: options.routeCache,\n serverActions: options.serverActions,\n }),\n );\n } catch (error) {\n next(error);\n }\n}\n\nexport async function renderAppRouterClientAsset(\n appDir: string,\n pathname: string,\n options: { dev?: boolean; vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<Response> {\n if (pathname === `/_mreact/client/${navigationRuntimeScriptForDev()}`) {\n const output = await buildNavigationRuntimeBundle();\n\n return new Response(options.dev === true ? withViteHmrRuntime(output.code) : output.code, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n }\n\n const routes = await scanAppRoutes({ appDir });\n const route = routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n\n if (route === undefined || route.kind !== \"page\") {\n return new Response(\"Not Found\", { status: 404 });\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code);\n let references: Awaited<ReturnType<typeof collectClientRouteReferences>>;\n\n try {\n references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n if (!references.client) {\n if (isClientRouteSource(clientSource)) {\n return clientAssetBuildErrorResponse(\n route.file,\n new Error(\n [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\"),\n ),\n );\n }\n\n return new Response(\"Not Found\", { status: 404 });\n }\n\n let bundle: string;\n\n try {\n bundle = await buildClientRouteBundle({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n } catch (error) {\n return clientAssetBuildErrorResponse(route.file, error);\n }\n\n return new Response(options.dev === true ? withViteHmrRuntime(bundle) : bundle, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function renderAppRouterClientRouteDevModule(\n appDir: string,\n pathname: string,\n options: { vitePlugins?: readonly PluginOption[] | undefined } = {},\n): Promise<string> {\n const route = await clientRouteForRequestPath(appDir, pathname);\n\n if (route === undefined) {\n throw new Error(`MReact client route asset was not found: ${pathname}`);\n }\n\n const code = await readFile(route.file, \"utf8\");\n const clientSource = stripRouteClientOnlyExports(code);\n const references = await collectClientRouteReferences({\n appDir,\n code: clientSource,\n filename: route.file,\n vitePlugins: options.vitePlugins,\n });\n\n if (!references.client) {\n throw new Error(\n isClientRouteSource(clientSource)\n ? [\n \"Client route analysis did not produce a client asset.\",\n \"Browser build cannot import Node builtins or other server-only modules.\",\n ...references.diagnostics.map((diagnostic) => diagnostic.message),\n ].join(\"\\n\")\n : `MReact client route asset was not found: ${pathname}`,\n );\n }\n\n const entry = await buildClientRouteEntrySource({\n code: clientSource,\n clientBoundaryImports: references.clientBoundaryImports,\n clientReferenceImports: references.clientReferenceImports,\n clientReferenceManifest: references.clientReferenceManifest,\n filename: route.file,\n routePath: route.path,\n vitePlugins: options.vitePlugins,\n });\n\n return withViteHmrRuntime(entry.code);\n}\n\nasync function clientRouteForRequestPath(appDir: string, pathname: string) {\n const routes = await scanAppRoutes({ appDir });\n\n return routes.find(\n (candidate) =>\n candidate.kind === \"page\" &&\n `/_mreact/client/${clientScriptForPath(candidate.path)}` === pathname,\n );\n}\n\nfunction clientRequestPath(id: string): string {\n const [path] = id.split(/[?#]/, 1);\n\n return path ?? id;\n}\n\nfunction clientRouteModuleId(filename: string, requestPath: string): string {\n return `${normalizePath(filename)}?${clientRouteModuleQuery}=${encodeURIComponent(requestPath)}`;\n}\n\nfunction clientRouteModuleRequestPath(id: string): string | undefined {\n const queryStart = id.indexOf(\"?\");\n\n if (queryStart === -1) {\n return undefined;\n }\n\n const params = new URLSearchParams(id.slice(queryStart + 1));\n const value = params.get(clientRouteModuleQuery);\n\n return value === null ? undefined : value;\n}\n\nfunction isMreactClientDevModuleId(id: string | null | undefined): boolean {\n return (\n id?.startsWith(virtualClientPrefix) === true ||\n id?.includes(`?${clientRouteModuleQuery}=`) === true ||\n id?.includes(`&${clientRouteModuleQuery}=`) === true\n );\n}\n\nfunction importerInDirectory(importer: string | undefined, directory: string): boolean {\n return importer !== undefined && normalizePath(importer).startsWith(`${directory}/`);\n}\n\nfunction clientAssetBuildErrorResponse(filename: string, error: unknown): Response {\n const message = [\n `Failed to build mreact client route asset for ${filename}.`,\n error instanceof Error ? error.message : String(error),\n ].join(\"\\n\");\n\n return new Response(`throw new Error(${JSON.stringify(message)});\\n`, {\n status: 500,\n headers: { \"content-type\": \"text/javascript; charset=utf-8\" },\n });\n}\n\nasync function devRouteStyles(\n project: ResolvedAppRouterProject,\n): Promise<ReadonlyMap<string, readonly string[]>> {\n const entries = await Promise.all(\n (await scanAppRoutes({ appDir: project.routesDir })).map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const hrefs = await collectRouteCssHrefs({\n appDir: project.routesDir,\n hrefPrefix: devCssPrefix,\n pageFile: route.file,\n projectRoot: project.projectRoot,\n });\n\n return hrefs.length === 0 ? undefined : ([route.path, hrefs as readonly string[]] as const);\n }),\n );\n const routeStyles = entries.filter(\n (entry): entry is readonly [string, readonly string[]] => entry !== undefined,\n );\n\n return new Map<string, readonly string[]>(routeStyles);\n}\n\nasync function devNavigationScripts(appDir: string): Promise<ReadonlyMap<string, string>> {\n const entries = await Promise.all(\n (await scanAppRoutes({ appDir })).map(async (route) => {\n if (route.kind !== \"page\") {\n return undefined;\n }\n\n const source = await readFile(route.file, \"utf8\");\n\n return detectNavigationRuntimeHint(source)\n ? ([route.path, navigationRuntimeScriptForDev()] as const)\n : undefined;\n }),\n );\n\n return new Map(entries.filter((entry): entry is readonly [string, string] => entry !== undefined));\n}\n\nfunction createDevCssProxyMiddleware(): Connect.NextHandleFunction {\n return (incoming, outgoing, next) => {\n const originalUrl = incoming.url ?? \"/\";\n const url = new URL(originalUrl, \"http://mreact.local\");\n\n if (!url.pathname.startsWith(devCssPrefix)) {\n next();\n return;\n }\n\n const sourcePath = `/${url.pathname.slice(devCssPrefix.length)}`;\n\n if (sourcePath === \"/\" || sourcePath.includes(\"\\0\")) {\n next();\n return;\n }\n\n const originalAccept = incoming.headers.accept;\n let restored = false;\n const restore = () => {\n if (restored) {\n return;\n }\n restored = true;\n incoming.url = originalUrl;\n if (originalAccept === undefined) {\n delete incoming.headers.accept;\n } else {\n incoming.headers.accept = originalAccept;\n }\n };\n\n incoming.url = `${sourcePath}${url.search}`;\n incoming.headers.accept = \"text/css,*/*;q=0.1\";\n outgoing.once(\"finish\", restore);\n outgoing.once(\"close\", restore);\n next();\n };\n}\n\nfunction withViteHmrRuntime(code: string): string {\n return `import \"/@vite/client\";\nif (import.meta.hot?.data.__mreactRouteStates) {\n globalThis.__mreactRouteStates = import.meta.hot.data.__mreactRouteStates;\n}\n${code}\nif (import.meta.hot) {\n const __mreactPreserveRouteState = () => {\n import.meta.hot.data.__mreactRouteStates = globalThis.__mreactRouteStates;\n };\n import.meta.hot.dispose(__mreactPreserveRouteState);\n import.meta.hot.accept((module) => {\n module?.__mreactHydrateRoute?.();\n });\n}\n`;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reckona/mreact-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"description": "File-system app router, SSR, actions, and deployment adapters for mreact.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -104,20 +104,20 @@
|
|
|
104
104
|
"access": "public"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@reckona/mreact": "0.0.
|
|
108
|
-
"@reckona/mreact-
|
|
109
|
-
"@reckona/mreact-
|
|
110
|
-
"@reckona/mreact-query": "0.0.
|
|
111
|
-
"@reckona/mreact-reactive-core": "0.0.
|
|
112
|
-
"@reckona/mreact-compiler": "0.0.
|
|
113
|
-
"@reckona/mreact-reactive-dom": "0.0.
|
|
114
|
-
"@reckona/mreact-server": "0.0.
|
|
115
|
-
"@reckona/mreact-shared": "0.0.
|
|
107
|
+
"@reckona/mreact": "0.0.70",
|
|
108
|
+
"@reckona/mreact-compat": "0.0.70",
|
|
109
|
+
"@reckona/mreact-devtools": "0.0.70",
|
|
110
|
+
"@reckona/mreact-query": "0.0.70",
|
|
111
|
+
"@reckona/mreact-reactive-core": "0.0.70",
|
|
112
|
+
"@reckona/mreact-compiler": "0.0.70",
|
|
113
|
+
"@reckona/mreact-reactive-dom": "0.0.70",
|
|
114
|
+
"@reckona/mreact-server": "0.0.70",
|
|
115
|
+
"@reckona/mreact-shared": "0.0.70"
|
|
116
116
|
},
|
|
117
117
|
"peerDependencies": {
|
|
118
118
|
"vite": ">=8 <9"
|
|
119
119
|
},
|
|
120
120
|
"optionalDependencies": {
|
|
121
|
-
"@reckona/mreact-router-native": "0.0.
|
|
121
|
+
"@reckona/mreact-router-native": "0.0.70"
|
|
122
122
|
}
|
|
123
123
|
}
|
package/src/client.ts
CHANGED
|
@@ -3026,12 +3026,17 @@ function workspaceRuntimePlugin(options: { routeFiles: readonly string[] }) {
|
|
|
3026
3026
|
});
|
|
3027
3027
|
const reactiveCorePath = packageFile("reactive-core", "@reckona/mreact-reactive-core", "index");
|
|
3028
3028
|
const reactiveCoreDir = dirname(reactiveCorePath);
|
|
3029
|
+
const reactiveDomPath = packageFile("reactive-dom", "@reckona/mreact-reactive-dom", "index");
|
|
3030
|
+
const reactiveDomDir = dirname(reactiveDomPath);
|
|
3031
|
+
const reactCompatPath = packageFile("react-compat", "@reckona/mreact-compat", "index");
|
|
3032
|
+
const reactCompatDir = dirname(reactCompatPath);
|
|
3033
|
+
const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactCompatDir];
|
|
3029
3034
|
const runtimePaths = new Map([
|
|
3030
3035
|
[
|
|
3031
3036
|
"@reckona/mreact-reactive-core/internal",
|
|
3032
3037
|
packageFile("reactive-core", "@reckona/mreact-reactive-core", "internal"),
|
|
3033
3038
|
],
|
|
3034
|
-
["@reckona/mreact-compat",
|
|
3039
|
+
["@reckona/mreact-compat", reactCompatPath],
|
|
3035
3040
|
[
|
|
3036
3041
|
"@reckona/mreact-compat/event-priority",
|
|
3037
3042
|
packageFile("react-compat", "@reckona/mreact-compat", "event-priority"),
|
|
@@ -3058,7 +3063,7 @@ function workspaceRuntimePlugin(options: { routeFiles: readonly string[] }) {
|
|
|
3058
3063
|
],
|
|
3059
3064
|
[
|
|
3060
3065
|
"@reckona/mreact-reactive-dom",
|
|
3061
|
-
|
|
3066
|
+
reactiveDomPath,
|
|
3062
3067
|
],
|
|
3063
3068
|
]);
|
|
3064
3069
|
|
|
@@ -3070,10 +3075,17 @@ function workspaceRuntimePlugin(options: { routeFiles: readonly string[] }) {
|
|
|
3070
3075
|
? { namespace: "mreact-devtools-stub", path: "devtools" }
|
|
3071
3076
|
: undefined,
|
|
3072
3077
|
);
|
|
3073
|
-
buildApi.onResolve({ filter: /^@reckona\/mreact-reactive-core$/ }, () =>
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3078
|
+
buildApi.onResolve({ filter: /^@reckona\/mreact-reactive-core$/ }, (args) => {
|
|
3079
|
+
const importer = args.importer;
|
|
3080
|
+
|
|
3081
|
+
return importer !== undefined &&
|
|
3082
|
+
runtimePackageDirs.some((directory) => importer.startsWith(`${directory}${sep}`))
|
|
3083
|
+
? { path: reactiveCorePath }
|
|
3084
|
+
: {
|
|
3085
|
+
namespace: "mreact-hot-runtime",
|
|
3086
|
+
path: "reactive-core",
|
|
3087
|
+
};
|
|
3088
|
+
});
|
|
3077
3089
|
buildApi.onResolve(
|
|
3078
3090
|
{
|
|
3079
3091
|
filter:
|
package/src/vite.ts
CHANGED
|
@@ -81,6 +81,11 @@ export function createAppRouterVitePlugin(
|
|
|
81
81
|
});
|
|
82
82
|
const reactiveCorePath = packageFile("reactive-core", "@reckona/mreact-reactive-core", "index");
|
|
83
83
|
const reactiveCoreDir = normalizePath(dirname(reactiveCorePath));
|
|
84
|
+
const reactiveDomPath = packageFile("reactive-dom", "@reckona/mreact-reactive-dom", "index");
|
|
85
|
+
const reactiveDomDir = normalizePath(dirname(reactiveDomPath));
|
|
86
|
+
const reactCompatPath = packageFile("react-compat", "@reckona/mreact-compat", "index");
|
|
87
|
+
const reactCompatDir = normalizePath(dirname(reactCompatPath));
|
|
88
|
+
const runtimePackageDirs = [reactiveCoreDir, reactiveDomDir, reactCompatDir];
|
|
84
89
|
const runtimePaths = new Map([
|
|
85
90
|
[
|
|
86
91
|
"@reckona/mreact-reactive-core/internal",
|
|
@@ -88,11 +93,11 @@ export function createAppRouterVitePlugin(
|
|
|
88
93
|
],
|
|
89
94
|
[
|
|
90
95
|
"@reckona/mreact-reactive-dom",
|
|
91
|
-
|
|
96
|
+
reactiveDomPath,
|
|
92
97
|
],
|
|
93
98
|
[
|
|
94
99
|
"@reckona/mreact-compat",
|
|
95
|
-
|
|
100
|
+
reactCompatPath,
|
|
96
101
|
],
|
|
97
102
|
[
|
|
98
103
|
"@reckona/mreact-compat/event-priority",
|
|
@@ -262,6 +267,10 @@ export function currentDevtoolsEmitter() { return undefined; }`;
|
|
|
262
267
|
const runtimePath = runtimePaths.get(id);
|
|
263
268
|
|
|
264
269
|
if (id === "@reckona/mreact-reactive-core") {
|
|
270
|
+
if (runtimePackageDirs.some((directory) => importerInDirectory(importer, directory))) {
|
|
271
|
+
return reactiveCorePath;
|
|
272
|
+
}
|
|
273
|
+
|
|
265
274
|
return virtualReactiveCoreId;
|
|
266
275
|
}
|
|
267
276
|
|