@reckona/mreact-router 0.0.174 → 0.0.176

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.
Files changed (64) hide show
  1. package/dist/adapters/cloudflare.d.ts.map +1 -1
  2. package/dist/adapters/cloudflare.js +5 -49
  3. package/dist/adapters/cloudflare.js.map +1 -1
  4. package/dist/build.d.ts +1 -0
  5. package/dist/build.d.ts.map +1 -1
  6. package/dist/build.js +90 -0
  7. package/dist/build.js.map +1 -1
  8. package/dist/built-assets.d.ts +11 -0
  9. package/dist/built-assets.d.ts.map +1 -0
  10. package/dist/built-assets.js +130 -0
  11. package/dist/built-assets.js.map +1 -0
  12. package/dist/built-runtime.d.ts +53 -0
  13. package/dist/built-runtime.d.ts.map +1 -0
  14. package/dist/built-runtime.js +178 -0
  15. package/dist/built-runtime.js.map +1 -0
  16. package/dist/built-server-module-artifacts.d.ts +19 -0
  17. package/dist/built-server-module-artifacts.d.ts.map +1 -0
  18. package/dist/built-server-module-artifacts.js +217 -0
  19. package/dist/built-server-module-artifacts.js.map +1 -0
  20. package/dist/client-manifest-assets.d.ts +16 -0
  21. package/dist/client-manifest-assets.d.ts.map +1 -0
  22. package/dist/client-manifest-assets.js +60 -0
  23. package/dist/client-manifest-assets.js.map +1 -0
  24. package/dist/client.d.ts.map +1 -1
  25. package/dist/client.js +31 -3
  26. package/dist/client.js.map +1 -1
  27. package/dist/node-server.d.ts +29 -0
  28. package/dist/node-server.d.ts.map +1 -0
  29. package/dist/node-server.js +81 -0
  30. package/dist/node-server.js.map +1 -0
  31. package/dist/render.d.ts +9 -0
  32. package/dist/render.d.ts.map +1 -1
  33. package/dist/render.js +20 -41
  34. package/dist/render.js.map +1 -1
  35. package/dist/route-dispatch.d.ts +2 -0
  36. package/dist/route-dispatch.d.ts.map +1 -0
  37. package/dist/route-dispatch.js +16 -0
  38. package/dist/route-dispatch.js.map +1 -0
  39. package/dist/route-loader-runtime.d.ts +22 -0
  40. package/dist/route-loader-runtime.d.ts.map +1 -0
  41. package/dist/route-loader-runtime.js +30 -0
  42. package/dist/route-loader-runtime.js.map +1 -0
  43. package/dist/routes.d.ts +2 -0
  44. package/dist/routes.d.ts.map +1 -1
  45. package/dist/routes.js +48 -1
  46. package/dist/routes.js.map +1 -1
  47. package/dist/serve.d.ts +4 -3
  48. package/dist/serve.d.ts.map +1 -1
  49. package/dist/serve.js +84 -582
  50. package/dist/serve.js.map +1 -1
  51. package/package.json +11 -11
  52. package/src/adapters/cloudflare.ts +5 -60
  53. package/src/build.ts +143 -0
  54. package/src/built-assets.ts +164 -0
  55. package/src/built-runtime.ts +312 -0
  56. package/src/built-server-module-artifacts.ts +340 -0
  57. package/src/client-manifest-assets.ts +92 -0
  58. package/src/client.ts +31 -3
  59. package/src/node-server.ts +129 -0
  60. package/src/render.ts +38 -60
  61. package/src/route-dispatch.ts +17 -0
  62. package/src/route-loader-runtime.ts +54 -0
  63. package/src/routes.ts +70 -1
  64. package/src/serve.ts +105 -863
@@ -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,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAChC,gBAAgB,GAOjB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,2CAA2C,EAC3C,2BAA2B,EAC3B,kCAAkC,EAClC,yBAAyB,EACzB,oCAAoC,EACpC,sBAAsB,EACtB,8BAA8B,GAE/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACx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AAC,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACjF,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACtD,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;SACT,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACrC,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 analyzeBoundaryGraph,\n collectClientRouteModuleAnalysis,\n formatDiagnostic,\n type ComponentMetadata,\n type BoundaryGraphResult,\n type ClientRouteModuleAnalysis,\n type ClientRouteStaticImportReference,\n type StaticImportReference,\n type TopLevelExportRenderInfo,\n} from \"@reckona/mreact-compiler\";\nimport type { ClientReferenceMetadata } from \"@reckona/mreact-shared/compiler-contract\";\nimport {\n collectClientRouteModuleAnalysisFromContext,\n createCompilerModuleContext,\n hasUnguardedBrowserGlobalReference,\n readTopLevelBooleanExport,\n readTopLevelBooleanExportFromContext,\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 { resolveClientConsolePureFunctions, type AppRouterProductionOptions } from \"./config.js\";\nimport type { AppRoute } from \"./routes.js\";\nimport { existingRouteShellCandidates } from \"./route-shells.js\";\nimport {\n routeDataScriptIds,\n routeDataScriptSelector,\n routeHydrationContract,\n} from \"./route-hydration-contract.js\";\nimport { stripRouteClientSource } 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 clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\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 cacheDir?: string | undefined;\n code: string;\n clientBoundaryImports?: readonly string[] | undefined;\n clientReferenceImports?: readonly ClientReferenceImport[] | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n dropClientConsole?: AppRouterProductionOptions[\"dropClientConsole\"] | undefined;\n dropConsoleFunctions?: readonly string[] | 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 clientBoundaryFallbackImports: string[];\n diagnostics: ClientRouteInferenceDiagnostic[];\n}\n\ninterface ClientRouteModuleInferenceResult extends ClientRouteInferenceResult {\n boundaryGraphFallbackCandidate: boolean;\n boundaryGraphFallbackRequired: boolean;\n clientBoundaryExportNames: string[];\n clientBoundaryModule: boolean;\n nestedClientExportNames: string[];\n clientReferenceSourceFiles: string[];\n navigationLinkExportNames: string[];\n serverOnly: boolean;\n serverOnlyClientRuntime: boolean;\n usesNavigationLink: 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 usesNavigationLink: boolean;\n}\n\nexport interface ClientRouteInferenceDiagnostic {\n code:\n | typeof clientBoundaryInferenceServerOnlyReferenceCode\n | typeof clientBoundaryInferenceFunctionCallInteractiveCode\n | typeof clientBoundaryInferenceUnsupportedReferenceCode\n | typeof navigationRuntimeLinkDisabledCode;\n filename: string;\n level: \"warn\";\n localNames: string[];\n message: string;\n routePath?: string | undefined;\n source: string;\n}\n\nconst clientBoundaryInferenceServerOnlyReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_SERVER_ONLY_REFERENCE\";\nconst clientBoundaryInferenceFunctionCallInteractiveCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_FUNCTION_CALL_INTERACTIVE\";\nconst clientBoundaryInferenceUnsupportedReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_UNSUPPORTED_REFERENCE\";\nconst navigationRuntimeLinkDisabledCode = \"MR_NAVIGATION_RUNTIME_LINK_DISABLED\";\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: stripRouteClientSource({ code, filename: route.file }),\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 const mergedRouteInference = routeInference.boundaryGraphFallbackRequired\n ? mergeClientRouteInference(\n routeInference,\n await inferClientRouteModuleBoundaryGraph({\n cache,\n code,\n filename: options.filename,\n sourceTransform,\n }),\n )\n : routeInference;\n\n if (options.appDir === undefined) {\n return withClientRouteDiagnosticPath(mergedRouteInference, options.routePath);\n }\n\n const shellInferences = await inferClientRouteShellModules({\n appDir: options.appDir,\n cache,\n filename: options.filename,\n sourceTransform,\n });\n\n return withClientRouteDiagnosticPath(\n {\n client:\n mergedRouteInference.client || shellInferences.some((inference) => inference.client),\n clientBoundaryImports: mergedRouteInference.clientBoundaryImports,\n clientBoundaryFallbackImports: mergedRouteInference.clientBoundaryFallbackImports,\n diagnostics: [\n ...mergedRouteInference.diagnostics,\n ...shellInferences.flatMap((inference) => inference.diagnostics),\n ],\n },\n options.routePath,\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\nasync function inferClientRouteModuleBoundaryGraph(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<ClientRouteInferenceResult> {\n const graph = await analyzeBoundaryGraph({\n entries: [{ file: options.filename, kind: \"route-page\" }],\n readModule: async (file) => {\n if (file === options.filename) {\n return options.code;\n }\n\n return await readClientRouteSource({\n cache: options.cache,\n filename: file,\n sourceTransform: options.sourceTransform,\n });\n },\n resolveModule: async ({ importer, source }) =>\n await resolveAppLocalModule({\n allowExplicitNonSource: options.sourceTransform !== undefined,\n cache: options.cache,\n importer,\n specifier: source,\n }),\n });\n\n return clientRouteInferenceFromBoundaryGraph(graph, options.filename);\n}\n\nfunction clientRouteInferenceFromBoundaryGraph(\n graph: BoundaryGraphResult,\n filename: string,\n): ClientRouteInferenceResult {\n const clientBoundaryImports = graph.clientBoundaries\n .filter((boundary) => boundary.importerFile === filename)\n .map((boundary) => boundary.source);\n const clientRoute = graph.modules.some(\n (module) => module.file === filename && module.classification === \"client-route\",\n );\n\n return {\n client: clientRoute || clientBoundaryImports.length > 0,\n clientBoundaryImports,\n clientBoundaryFallbackImports: [],\n diagnostics: [],\n };\n}\n\nfunction mergeClientRouteInference(\n left: ClientRouteInferenceResult,\n right: ClientRouteInferenceResult,\n): ClientRouteInferenceResult {\n return {\n client: left.client || right.client,\n clientBoundaryImports: Array.from(\n new Set([...left.clientBoundaryImports, ...right.clientBoundaryImports]),\n ),\n clientBoundaryFallbackImports: Array.from(\n new Set([...left.clientBoundaryFallbackImports, ...right.clientBoundaryFallbackImports]),\n ),\n diagnostics: [...left.diagnostics, ...right.diagnostics],\n };\n}\n\nexport async function collectClientRouteReferences(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<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 = stripRouteClientSource({\n code: await readClientRouteSource({ cache, filename: referenceFile, sourceTransform }),\n filename: referenceFile,\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 = stripRouteClientSource({\n code: await readClientRouteSource({ cache, filename: shell, sourceTransform }),\n filename: shell,\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 clientBoundaryFallbackImports: source.inference.clientBoundaryFallbackImports,\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 clientBoundaryFallbackImports: routeInference.clientBoundaryFallbackImports,\n clientReferenceImports,\n clientReferenceManifest,\n diagnostics: sources\n .flatMap((source) => source.inference.diagnostics)\n .map((diagnostic) => withClientRouteDiagnosticPath(diagnostic, options.routePath)),\n usesNavigationLink:\n routeInference.usesNavigationLink ||\n sources.some(\n (source) => source.filename !== options.filename && source.inference.usesNavigationLink,\n ),\n };\n}\n\nexport async function resolveNavigationRuntime(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n references?: ClientRouteReferenceResult | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<boolean> {\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 // Read the override from the cached module context so the dev server does not\n // re-parse every page route on each request.\n const moduleContext = await compilerModuleContextForSource({\n cache,\n code,\n filename: options.filename,\n });\n const override = readTopLevelBooleanExportFromContext(moduleContext, \"navigationRuntime\");\n\n if (override !== undefined) {\n return override;\n }\n\n const references =\n options.references ??\n (await collectClientRouteReferences({\n appDir: options.appDir,\n cache,\n code: options.code,\n filename: options.filename,\n vitePlugins: options.vitePlugins,\n }));\n\n return references.usesNavigationLink;\n}\n\nexport function navigationRuntimeLinkDisabledDiagnostic(options: {\n filename: string;\n references: Pick<ClientRouteReferenceResult, \"usesNavigationLink\">;\n routePath?: string | undefined;\n source: string;\n}): ClientRouteInferenceDiagnostic | undefined {\n if (\n !options.references.usesNavigationLink ||\n detectNavigationRuntimeOverride(options.source) !== false\n ) {\n return undefined;\n }\n\n return {\n code: navigationRuntimeLinkDisabledCode,\n filename: options.filename,\n level: \"warn\",\n localNames: [],\n message:\n \"A rendered Link was detected, but this route exports navigationRuntime = false. Client-side navigation will be disabled for this route; remove the override or replace Link with a plain anchor if that is intentional.\",\n routePath: options.routePath,\n source: options.source,\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 = stripRouteClientSource({\n code: await readClientRouteSource({\n cache: options.cache,\n filename: shell,\n sourceTransform: options.sourceTransform,\n }),\n filename: shell,\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 const usesNavigationLinkLocal = detectLinkComponentUsage(analysis);\n\n if (isServerOnlyClientRouteSource(analysis)) {\n return emptyClientRouteModuleInferenceResult({\n navigationLinkExportNames: detectLinkComponentExportNames(analysis),\n serverOnly: true,\n serverOnlyClientRuntime: analysis.clientRuntime,\n usesNavigationLink: usesNavigationLinkLocal,\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 clientBoundaryFallbackImports: string[] = [];\n const clientBoundaryExportNames = new Set<string>();\n const nestedClientExportNames = new Set<string>();\n const clientReferenceSourceFiles: string[] = [];\n const diagnostics: ClientRouteInferenceDiagnostic[] = [];\n let boundaryGraphFallbackRequired = false;\n let clientProxy = false;\n let nestedClient = false;\n let usesNavigationLink = usesNavigationLinkLocal;\n const navigationLinkExportNames = new Set<string>(detectLinkComponentExportNames(analysis));\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 // A bare-identifier default export (`export default Page`) is the route's\n // rendered component even though the module body has no JSX for it; treat it\n // as a rendered root so a re-exported imported component (and any Link it\n // renders) is followed.\n const renderedComponentRoots =\n analysis.defaultExportIdentifier === undefined\n ? unionSets(jsxComponentRoots, componentCallRoots)\n : new Set([...jsxComponentRoots, ...componentCallRoots, analysis.defaultExportIdentifier]);\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 // Propagate the navigation runtime only for imports that are actually\n // rendered here, and only for the specific exports whose subtree renders a\n // `Link`. A merely-referenced import (e.g. `const C = Nav`) recurses for\n // client-boundary detection but must not pull in a transitive `Link`, and\n // a barrel re-exporting Link-free siblings must not over-trigger.\n if (rendered) {\n const importedNavigationExportNames = renderedImportedExportNames(\n reference,\n renderedComponentRoots,\n );\n if (\n matchesInferredExportNames(\n importedNavigationExportNames,\n imported.navigationLinkExportNames,\n )\n ) {\n usesNavigationLink = true;\n for (const exportName of renderedLocalExportNames(reference, exportInfo)) {\n navigationLinkExportNames.add(exportName);\n }\n }\n }\n\n if (!imported.client) {\n if (rendered && imported.boundaryGraphFallbackCandidate) {\n boundaryGraphFallbackRequired = true;\n }\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 diagnostics.push(\n functionCallInteractiveImportDiagnostic({\n filename: options.filename,\n reference,\n }),\n );\n continue;\n }\n\n if (!importedBoundary) {\n clientReferenceSourceFiles.push(resolved);\n continue;\n }\n\n clientBoundaryImports.push(reference.source);\n if (\n !imported.clientBoundaryModule &&\n isClientBoundaryFallbackEligibleSource(source, resolved)\n ) {\n clientBoundaryFallbackImports.push(reference.source);\n }\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 // A re-export renders nothing itself, so it does not set the module's\n // own `usesNavigationLink`; it only forwards per-export `Link` usage so\n // an importer that renders this name can decide precisely. Map the\n // source module's export names onto the names this barrel re-exposes:\n // `export * from` keeps the original names, `export { A as Nav } from`\n // renames them.\n if (reference.exportAll) {\n for (const exportName of exported.navigationLinkExportNames) {\n navigationLinkExportNames.add(exportName);\n }\n } else {\n for (const specifier of reference.specifiers) {\n if (exported.navigationLinkExportNames.includes(specifier.localName)) {\n navigationLinkExportNames.add(specifier.exportedName);\n }\n }\n }\n\n if (exported.clientBoundaryModule) {\n clientProxy = true;\n } else if (exported.clientBoundaryExportNames.length > 0) {\n if (reference.exportAll) {\n for (const exportName of exported.clientBoundaryExportNames) {\n clientBoundaryExportNames.add(exportName);\n }\n } else {\n for (const specifier of reference.specifiers) {\n if (exported.clientBoundaryExportNames.includes(specifier.localName)) {\n clientBoundaryExportNames.add(specifier.exportedName);\n }\n }\n }\n } else if (exported.client) {\n nestedClient = true;\n clientReferenceSourceFiles.push(resolved);\n } else if (exported.boundaryGraphFallbackCandidate) {\n boundaryGraphFallbackRequired = true;\n }\n }\n }\n\n return {\n boundaryGraphFallbackCandidate:\n analysis.staticExports.length > 0 || boundaryGraphFallbackRequired,\n boundaryGraphFallbackRequired,\n client:\n clientBoundaryImports.length > 0 ||\n clientBoundaryExportNames.size > 0 ||\n implicitModuleClient ||\n clientProxy ||\n nestedClient,\n clientBoundaryImports,\n clientBoundaryFallbackImports,\n clientBoundaryExportNames: Array.from(clientBoundaryExportNames),\n clientBoundaryModule: clientProxy || implicitModuleClient,\n nestedClientExportNames: Array.from(nestedClientExportNames),\n clientReferenceSourceFiles: Array.from(new Set(clientReferenceSourceFiles)),\n diagnostics,\n navigationLinkExportNames: Array.from(navigationLinkExportNames),\n serverOnly: false,\n serverOnlyClientRuntime: false,\n usesNavigationLink,\n };\n } finally {\n options.seen.delete(options.filename);\n }\n}\n\nfunction emptyClientRouteModuleInferenceResult(\n overrides: Partial<ClientRouteModuleInferenceResult> = {},\n): ClientRouteModuleInferenceResult {\n return {\n boundaryGraphFallbackCandidate: false,\n boundaryGraphFallbackRequired: false,\n client: false,\n clientBoundaryImports: [],\n clientBoundaryFallbackImports: [],\n clientBoundaryExportNames: [],\n clientBoundaryModule: false,\n nestedClientExportNames: [],\n clientReferenceSourceFiles: [],\n diagnostics: [],\n navigationLinkExportNames: [],\n serverOnly: false,\n serverOnlyClientRuntime: false,\n usesNavigationLink: 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 setLatestModuleCacheEntry(\n options.cache.moduleAnalysisByFile,\n options.filename,\n cacheKey,\n analysis,\n );\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 setLatestModuleCacheEntry(options.cache.moduleContextByFile, options.filename, cacheKey, context);\n return context;\n}\n\nfunction sourceAnalysisCacheKey(filename: string, code: string): string {\n return `${filename}\\0${hashSourceText(code)}`;\n}\n\n// Keeps only the latest content version per file in the source-keyed caches.\n// The cache persists across dev requests, and keys embed a content hash, so\n// without this an edited file would accumulate an entry per saved version.\n// Filenames cannot contain the NUL separator, so the `${filename}\\0` prefix\n// matches exactly that file's prior entries.\nfunction setLatestModuleCacheEntry<T>(\n map: Map<string, T>,\n filename: string,\n cacheKey: string,\n value: T,\n): void {\n const prefix = `${filename}\\0`;\n\n for (const existing of map.keys()) {\n if (existing !== cacheKey && existing.startsWith(prefix)) {\n map.delete(existing);\n }\n }\n\n map.set(cacheKey, value);\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([\".css\", \".less\", \".sass\", \".scss\", \".styl\", \".stylus\"]);\n\nfunction isClientBoundaryFallbackEligibleSource(source: string, filename?: string): boolean {\n if (hasClientBoundaryFallbackUnsafeBrowserGlobal(source, filename)) {\n return false;\n }\n\n const destructuredCallbackPropNames = destructuredPropsCallbackNames(source);\n const callbackPropNames = new Set([\n ...destructuredCallbackPropNames,\n ...propsCallbackAliasNames(source),\n ...memberCallbackNames(source),\n ]);\n const sourceWithoutComponentCallbackProps = source.replaceAll(\n /<[A-Z][A-Za-z0-9_$.]*(?:\\s[\\s\\S]*?)?>/gu,\n (tag) => tag.replaceAll(/\\s+on[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{[^{}]*\\}/gu, \"\"),\n );\n let sourceWithoutGuardedUndefinedCallbacks = sourceWithoutComponentCallbackProps\n .replaceAll(\n /\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*props\\.[A-Za-z_$][\\w$]*\\s*===\\s*undefined\\s*\\?\\s*undefined\\s*:/gu,\n \"\",\n )\n .replaceAll(\n /\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*props\\.[A-Za-z_$][\\w$]*\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}/gu,\n \"\",\n );\n\n for (const callbackName of callbackPropNames) {\n const escapedCallbackName = escapeRegExp(callbackName);\n const callbackHandlerAttributePattern = new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*[^{}]*\\b${escapedCallbackName}\\b[^{}]*\\}`,\n \"gu\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\b(?:const|let|var)\\s+${escapedCallbackName}\\s*=\\s*props\\.[A-Za-z_$][\\w$]*\\s*;?`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\b(?:const|let|var)\\s+${escapedCallbackName}\\s*=\\s*[^;\\n]+\\.${escapedCallbackName}\\s*;?`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*(?:===|==)\\s*(?:undefined|null)\\s*\\?\\s*undefined\\s*:\\s*[^{}]*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*(?:undefined|null)\\s*(?:===|==)\\s*${escapedCallbackName}\\s*\\?\\s*undefined\\s*:\\s*[^{}]*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*(?:!==|!=)\\s*(?:undefined|null)\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*typeof\\s+${escapedCallbackName}\\s*===\\s*[\"']function[\"']\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*\\?\\?\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n\n if (\n hasCallbackAbsenceGuard(\n sourceWithoutComponentCallbackProps.replaceAll(callbackHandlerAttributePattern, \"\"),\n callbackName,\n )\n ) {\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n callbackHandlerAttributePattern,\n \"\",\n );\n }\n sourceWithoutGuardedUndefinedCallbacks = removeSafeCallbackHandlerAttributes(\n sourceWithoutGuardedUndefinedCallbacks,\n callbackName,\n {\n externalAbsenceGuard: hasCallbackAbsenceGuard(\n sourceWithoutComponentCallbackProps.replaceAll(callbackHandlerAttributePattern, \"\"),\n callbackName,\n ),\n },\n );\n\n if (\n new RegExp(String.raw`\\b${escapedCallbackName}\\s*\\(`, \"u\").test(\n sourceWithoutGuardedUndefinedCallbacks,\n )\n ) {\n return false;\n }\n }\n\n return (\n !/\\bon[A-Z][A-Za-z0-9_$]*\\s*=/u.test(sourceWithoutGuardedUndefinedCallbacks) &&\n !/\\bglobalThis\\b/u.test(source)\n );\n}\n\nfunction hasClientBoundaryFallbackUnsafeBrowserGlobal(source: string, filename?: string): boolean {\n const sourceWithoutTypeofGuards = source.replaceAll(\n /\\btypeof\\s+(?:window|document|localStorage)\\s*(?:(?:={2,3}|!={1,2})\\s*[\"']undefined[\"'])?/gu,\n \"\",\n );\n if (!/\\b(?:window|document|localStorage)\\b/u.test(sourceWithoutTypeofGuards)) {\n return false;\n }\n\n // Remaining browser-global tokens may still be typeof-guarded uses such as\n // `if (typeof window !== \"undefined\") return window.location.pathname;`.\n // Those never execute on the server, so the AST guard analysis decides;\n // an unparsable module stays conservatively ineligible.\n try {\n return hasUnguardedBrowserGlobalReference({ code: source, filename });\n } catch {\n return true;\n }\n}\n\nfunction propsCallbackAliasNames(source: string): Set<string> {\n const names = new Set<string>();\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*props\\.([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*\\(\\s*props\\s+as\\s+[^)]+\\)\\.([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*\\(\\s*props\\s*\\)\\.([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*[^;\\n]+\\.([A-Za-z_$][\\w$]*)\\s*;?/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n let added = true;\n while (added) {\n added = false;\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const sourceName = match[2];\n\n if (localName !== undefined && sourceName !== undefined && names.has(sourceName)) {\n const previousSize = names.size;\n names.add(localName);\n added ||= names.size !== previousSize;\n }\n }\n }\n\n return names;\n}\n\nfunction hasCallbackAbsenceGuard(source: string, name: string): boolean {\n const escapedName = escapeRegExp(name);\n\n return new RegExp(\n String.raw`(?:!\\s*${escapedName}\\b|${escapedName}\\s*(?:===|==)\\s*(?:undefined|null)|(?:undefined|null)\\s*(?:===|==)\\s*${escapedName}\\b)`,\n \"u\",\n ).test(source);\n}\n\nfunction memberCallbackNames(source: string): Set<string> {\n const names = new Set<string>();\n\n for (const match of source.matchAll(/\\.([A-Za-z_$][\\w$]*)\\b/gu)) {\n const memberName = match[1];\n\n if (memberName !== undefined && isCallbackPropName(memberName)) {\n names.add(memberName);\n }\n }\n\n return names;\n}\n\nfunction removeSafeCallbackHandlerAttributes(\n source: string,\n callbackName: string,\n options: { externalAbsenceGuard: boolean },\n): string {\n const attributePattern = /\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{/gu;\n let result = \"\";\n let cursor = 0;\n\n for (const match of source.matchAll(attributePattern)) {\n const start = match.index;\n const expressionStart = start + match[0].length;\n const end = matchingBraceEnd(source, expressionStart - 1);\n\n if (end === undefined) {\n continue;\n }\n\n const expression = source.slice(expressionStart, end);\n if (isSafeCallbackHandlerExpression(expression, callbackName, options)) {\n result += source.slice(cursor, start);\n cursor = end + 1;\n }\n }\n\n return cursor === 0 ? source : result + source.slice(cursor);\n}\n\nfunction matchingBraceEnd(source: string, openBraceIndex: number): number | undefined {\n let depth = 0;\n let quote: \"\\\"\" | \"'\" | \"`\" | undefined;\n let escaped = false;\n\n for (let index = openBraceIndex; index < source.length; index += 1) {\n const char = source[index];\n\n if (quote !== undefined) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (char === quote) {\n quote = undefined;\n }\n continue;\n }\n\n if (char === \"\\\"\" || char === \"'\" || char === \"`\") {\n quote = char;\n continue;\n }\n\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) {\n return index;\n }\n }\n }\n\n return undefined;\n}\n\nfunction isSafeCallbackHandlerExpression(\n expression: string,\n callbackName: string,\n options: { externalAbsenceGuard: boolean },\n): boolean {\n const escapedName = escapeRegExp(callbackName);\n if (!new RegExp(String.raw`\\b${escapedName}\\b`, \"u\").test(expression)) {\n return false;\n }\n\n if (new RegExp(String.raw`\\b${escapedName}\\s*\\(`, \"u\").test(expression)) {\n return false;\n }\n\n return (\n new RegExp(String.raw`\\b${escapedName}\\s*\\?\\.\\s*\\(`, \"u\").test(expression) ||\n new RegExp(String.raw`^\\s*${escapedName}\\s*\\?\\?\\s*undefined\\s*$`, \"u\").test(expression) ||\n options.externalAbsenceGuard\n );\n}\n\nfunction destructuredPropsCallbackNames(source: string): Set<string> {\n const names = new Set<string>();\n\n for (const match of source.matchAll(/\\b(?:const|let|var)\\s*\\{([^}]+)\\}\\s*=\\s*props\\b/gu)) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\{[^{}]*:\\s*\\{([^{}]+)\\}\\s*(?:=\\s*\\{\\})?[^{}]*\\}/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\bfunction(?:\\s+[A-Za-z_$][\\w$]*(?:<[^>()]+>)?)?\\s*\\(\\s*\\{([^}]+)\\}/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+[A-Za-z_$][\\w$]*\\s*=\\s*(?:async\\s*)?\\(?\\s*\\{([^}]+)\\}\\s*(?::\\s*[^)=]+)?\\)?\\s*=>/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\bexport\\s+default\\s+(?:async\\s*)?\\(?\\s*\\{([^}]+)\\}\\s*(?::\\s*[^)=]+)?\\)?\\s*=>/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+[A-Za-z_$][\\w$]*\\s*=\\s*function(?:\\s+[A-Za-z_$][\\w$]*)?\\s*\\(\\s*\\{([^}]+)\\}/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n return names;\n}\n\nfunction addDestructuredCallbackNames(names: Set<string>, destructured: string): void {\n for (const part of destructured.split(\",\")) {\n const [rawProperty, rawAlias] = part.trim().split(/\\s*:\\s*/u);\n const property = destructuredBindingName(rawProperty);\n const alias = destructuredBindingName(rawAlias);\n const name = alias ?? property;\n\n if (\n name !== undefined &&\n (isCallbackPropName(property) || isCallbackPropName(name))\n ) {\n names.add(name);\n }\n }\n}\n\nfunction destructuredBindingName(value: string | undefined): string | undefined {\n const name = value?.trim().split(/\\s*=/u, 1)[0]?.trim();\n return name === \"\" ? undefined : name;\n}\n\nfunction isCallbackPropName(name: string | undefined): boolean {\n return name !== undefined && /^on[A-Z][A-Za-z0-9_$]*$/u.test(name);\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 functionCallInteractiveImportDiagnostic(options: {\n filename: string;\n reference: StaticImportReference;\n}): ClientRouteInferenceDiagnostic {\n const localNames = options.reference.localNames.filter(startsUppercase);\n const component = localNames[0] ?? options.reference.localNames[0] ?? options.reference.source;\n const componentUsage = startsUppercase(component) ? `<${component} />` : \"JSX\";\n\n return {\n code: clientBoundaryInferenceFunctionCallInteractiveCode,\n filename: options.filename,\n level: \"warn\",\n localNames: localNames.length === 0 ? options.reference.localNames : localNames,\n message:\n `${options.filename}: interactive component import ${JSON.stringify(options.reference.source)} ` +\n `is rendered through a function call as ${component}(), so its event handlers or cell() state ` +\n \"will not hydrate as a client boundary. Render it through JSX such as \" +\n `${componentUsage}, or move the call behind an explicit client boundary.`,\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 const route =\n diagnostic.routePath === undefined ? \"\" : ` on route ${JSON.stringify(diagnostic.routePath)}`;\n return `${diagnostic.code}: ${diagnostic.message}${route}`;\n}\n\nfunction withClientRouteDiagnosticPath<\n T extends ClientRouteInferenceDiagnostic | ClientRouteInferenceResult,\n>(value: T, routePath: string | undefined): T {\n if (routePath === undefined) {\n return value;\n }\n\n if (\"diagnostics\" in value) {\n return {\n ...value,\n diagnostics: value.diagnostics.map((diagnostic) =>\n withClientRouteDiagnosticPath(diagnostic, routePath),\n ),\n };\n }\n\n return {\n ...value,\n routePath: value.routePath ?? routePath,\n };\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(\n plugin: Plugin,\n):\n | ((this: unknown, code: string, id: string, options?: { ssr?: boolean | undefined }) => 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 ${routeHydrationContract.routeMarkerAttribute}=\"${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 [propsScriptId, clientReferencesScriptId] = routeDataScriptIds(routeId).map((id) =>\n escapeHtmlAttribute(id),\n );\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 ${routeHydrationContract.routeMarkerAttribute}=\"${escapedRouteId}\">`,\n suffix: [\n \"</div>\",\n `<script type=\"application/json\" id=\"${propsScriptId}\">${propsJson}</script>`,\n clientReferencesJson === undefined\n ? undefined\n : `<script type=\"application/json\" id=\"${clientReferencesScriptId}\">${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 dropConsoleFunctions?: readonly string[] | undefined;\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.dropConsoleFunctions === undefined\n ? {}\n : { dropConsoleFunctions: options.dropConsoleFunctions }),\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 dropConsoleFunctions =\n options.dropConsoleFunctions ?? resolveClientConsolePureFunctions(options.dropClientConsole);\n const bundled = await bundleRouterModule({\n code: entry.code,\n cacheDir: options.cacheDir,\n define: {\n __MREACT_CLIENT_DEVTOOLS__: \"false\",\n },\n filename: options.filename,\n dropConsoleFunctions,\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 cacheDir?: string | undefined;\n dropConsoleFunctions?: readonly 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 cacheDir: options.cacheDir,\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 dropConsoleFunctions: options.dropConsoleFunctions,\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 routeSourceAnalysis = collectClientRouteModuleAnalysisFromContext(moduleContext);\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 routeExplicitlyRequiresHydration = isExplicitClientRouteSource(\n routeSourceAnalysis,\n options.filename,\n );\n const routeHasEventBindings = (compiled.metadata.eventHydrationManifest?.events.length ?? 0) > 0;\n const routeRequiresFullHydration =\n routeExplicitlyRequiresHydration ||\n routeUsesCells ||\n routeUsesReactiveEffect ||\n 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 routeReactiveDomMetadataImport = !routeUsesOnlyClientReferenceBoundaries\n ? `import { withEventBindingMetadata as __mreactWithEventBindingMetadata, withPropBindingMetadata as __mreactWithPropBindingMetadata } from \"@reckona/mreact-reactive-dom\";\\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 fetchRevalidationInstalled: false,\n installed: false,\n prefetchedUrls: new Set(),\n prefetchedScripts: new Set(),\n reloadNextNavigationFetch: false,\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?.propsText === (__mreactPropsText ?? \"\")\n ? __mreactPreviousState\n : {\n cells: new Map(),\n marker: __mreactMarker,\n propsText: __mreactPropsText ?? \"\",\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 =\n 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(\"react.transitional.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 routeHydrationNodeExpression = !routeUsesOnlyClientReferenceBoundaries\n ? `__mreactWithPropBindingMetadata(() => __mreactWithEventBindingMetadata(() => __mreactEvaluateHydrationNode(() => ${routeNodeExpression})))`\n : `__mreactEvaluateHydrationNode(() => ${routeNodeExpression})`;\n const boundaryOnlyHydrationBlock = routeRequiresFullHydration\n ? \"\"\n : `${routeCellHydrationIndent}if (!__mreactHasNonSerializableClientBoundaries(__mreactMarker) && __mreactHydrateClientBoundaries(document, __mreactClientReferences, __mreactClientReferenceComponents)) {\n${routeCellHydrationIndent} __mreactMarker.setAttribute(${JSON.stringify(routeHydrationContract.hydratedAttribute)}, \"true\");\n${routeCellHydrationIndent} __mreactMarkRouteHydrated();\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const routeComponentGuard = `${routeCellHydrationIndent}if (__mreactComponent === undefined) {\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const entry = `${routeCellEffectImport}${routeCleanupScopeImport}${routeReactiveDomMetadataImport}${emitCompatClientReferenceImportBlock(compatClientReferenceNames)}${clientReferenceImportBlock}${routeHydrationCode}\n\nconst __mreactRouteId = ${JSON.stringify(routeId)};\n const __mreactRouteStateSignature = ${JSON.stringify(routeStateSignature)};\n const __mreactRouteMarkerAttribute = ${JSON.stringify(routeHydrationContract.routeMarkerAttribute)};\n const __mreactRouteHydratedAttribute = ${JSON.stringify(routeHydrationContract.hydratedAttribute)};\n const __mreactPropsScriptPrefix = ${JSON.stringify(routeHydrationContract.propsScriptPrefix)};\n const __mreactClientReferencesScriptPrefix = ${JSON.stringify(routeHydrationContract.clientReferencesScriptPrefix)};\n const __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(\\`[\\${__mreactRouteMarkerAttribute}=\"\\${__mreactRouteId}\"]\\`);\n const __mreactPropsElement = document.getElementById(\\`\\${__mreactPropsScriptPrefix}\\${__mreactRouteId}\\`);\n const __mreactClientReferencesElement = document.getElementById(\\`\\${__mreactClientReferencesScriptPrefix}\\${__mreactRouteId}\\`);\n const __mreactPropsText = __mreactPropsElement?.textContent;\n const __mreactProps = __mreactPropsText === undefined\n ? {}\n : JSON.parse(__mreactPropsText);\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 = ${routeHydrationNodeExpression};\n${routeCellHydrationIndent}__mreactResumeRoute(__mreactMarker, __mreactNode);\n${routeCellHydrationIndent}__mreactHydrateClientBoundaries(document, __mreactClientReferences, __mreactClientReferenceComponents);\n${routeCellHydrationIndent}__mreactMarker.setAttribute(__mreactRouteHydratedAttribute, \"true\");\n${routeCellHydrationIndent}__mreactMarkRouteHydrated();\n${routeCellHydrationEnd}}\n${routeCellDropFunction}\n${routeCleanupFunction}\n\nfunction __mreactMarkRouteHydrated() {\n if (typeof document !== \"undefined\") {\n document.documentElement.setAttribute(__mreactRouteHydratedAttribute, \"true\");\n }\n\n if (typeof window !== \"undefined\" && typeof CustomEvent === \"function\") {\n window.dispatchEvent(new CustomEvent(\"mreact:hydrated\", {\n detail: { routeId: __mreactRouteId },\n }));\n }\n}\n\nfunction __mreactMarkRouteHydrating() {\n if (typeof document === \"undefined\") {\n return;\n }\n\n document.documentElement.removeAttribute(__mreactRouteHydratedAttribute);\n}\n\nfunction __mreactEvaluateHydrationNode(factory) {\n const previous = __mreactGlobal.__mreactHydratingDynamicRanges;\n __mreactGlobal.__mreactHydratingDynamicRanges = true;\n\n try {\n return factory();\n } finally {\n if (previous === undefined) {\n delete __mreactGlobal.__mreactHydratingDynamicRanges;\n } else {\n __mreactGlobal.__mreactHydratingDynamicRanges = previous;\n }\n }\n}\n\nconst __mreactRouteHydrationReported = Symbol.for(\"mreact.routeHydrationReported\");\n\nfunction __mreactReportRouteHydrationError(error) {\n if (error !== null && typeof error === \"object\") {\n if (error[__mreactRouteHydrationReported] === true) {\n return;\n }\n error[__mreactRouteHydrationReported] = true;\n }\n\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(\n \\`mreact: route hydration failed for route \"\\${__mreactRouteId}\". Server HTML remains visible, but client interactivity for this route was not attached.\\`,\n error,\n );\n }\n}\n\nfunction __mreactRunRouteHydration(factory) {\n try {\n return factory();\n } catch (error) {\n __mreactReportRouteHydrationError(error);\n throw error;\n }\n}\n\n__mreactRunRouteHydration(() => __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 if (!__mreactIsSameOriginNavigationUrl(href)) {\n return false;\n }\n\n if (__mreactIsCurrentLocationNavigationHref(href)) {\n return false;\n }\n\n if (__mreactNavigationState.prefetchedUrls.has(href)) {\n return true;\n }\n\n __mreactNavigationState.prefetchedUrls.add(href);\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 __mreactRememberNavigationHtml(href, html);\n return true;\n }).catch(() => false);\n}\n\nconst __mreactNavigationHtmlCacheMaxEntries = 64;\n\nfunction __mreactCachedNavigationHtml(href) {\n const html = __mreactNavigationState.cache.get(href);\n\n if (html === undefined) {\n return undefined;\n }\n\n __mreactNavigationState.cache.delete(href);\n __mreactNavigationState.cache.set(href, html);\n return html;\n}\n\nfunction __mreactRememberNavigationHtml(href, html) {\n if (__mreactNavigationState.cache.has(href)) {\n __mreactNavigationState.cache.delete(href);\n }\n\n __mreactNavigationState.cache.set(href, html);\n\n while (__mreactNavigationState.cache.size > __mreactNavigationHtmlCacheMaxEntries) {\n const oldestHref = __mreactNavigationState.cache.keys().next().value;\n\n if (oldestHref === undefined) {\n return;\n }\n\n __mreactNavigationState.cache.delete(oldestHref);\n }\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 = __mreactCachedNavigationHtml(href);\n const script = __mreactRouteScriptForNavigationUrl(href);\n if (script !== undefined) {\n void __mreactPrefetchRouteScript(script);\n }\n const html = cachedHtml ?? await __mreactFetchNavigationHtml(href);\n\n if (typeof html !== \"string\") {\n return false;\n }\n\n __mreactRememberNavigationHtml(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 __mreactNavigationState.prefetchedUrls.delete(href);\n }\n }\n}\n\nfunction __mreactInvalidateAllNavigationCache() {\n __mreactNavigationState.cache.clear();\n __mreactNavigationState.prefetchedUrls.clear();\n}\n\nfunction __mreactFetchNavigationHtml(href) {\n const reloadRouteCache = __mreactNavigationState.reloadNextNavigationFetch === true;\n __mreactNavigationState.reloadNextNavigationFetch = false;\n const headers = reloadRouteCache\n ? { \"x-mreact-navigation\": \"1\", \"x-mreact-navigation-cache\": \"reload\" }\n : { \"x-mreact-navigation\": \"1\" };\n\n return fetch(href, {\n headers,\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 = typeof response?.headers?.get === \"function\"\n ? response.headers.get(\"x-mreact-revalidate\")\n : null;\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) {\n return false;\n }\n\n const html = typeof state.html === \"string\"\n ? state.html\n : typeof state.url === \"string\" ? __mreactNavigationState.cache.get(state.url) : undefined;\n\n if (typeof html !== \"string\") {\n return false;\n }\n\n const applied = __mreactApplyNavigationHtml(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(\"[${routeHydrationContract.routeMarkerAttribute}]\");\n const currentMarker = document.querySelector(\"[${routeHydrationContract.routeMarkerAttribute}]\");\n\n if (nextMarker === null || currentMarker === null) {\n return false;\n }\n\n const currentRouteId = currentMarker.getAttribute(\"${routeHydrationContract.routeMarkerAttribute}\");\n const nextRouteId = nextMarker.getAttribute(\"${routeHydrationContract.routeMarkerAttribute}\");\n\n __mreactMarkRouteHydrating();\n __mreactSyncHeadMetadata(template.content, html);\n if (!__mreactApplyNavigationShellHtml(currentMarker, nextMarker)) {\n __mreactUnmountCompatBoundaries(currentMarker);\n __mreactResumeNode(currentMarker, nextMarker);\n }\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)\n .then((module) => __mreactRunRouteHydration(() => module.${routeHydrationContract.routeHydrateExport}?.()))\n .catch((error) => {\n __mreactReportRouteHydrationError(error);\n throw error;\n });\n } else {\n __mreactMarkRouteHydrated();\n }\n\n __mreactApplyOutOfOrderFragments(document);\n __mreactObserveViewportPrefetchAnchors(document);\n\n return true;\n}\n\nfunction __mreactApplyNavigationShellHtml(currentMarker, nextMarker) {\n const target = __mreactNavigationShellSyncTarget(currentMarker, nextMarker);\n\n if (target === null) {\n return false;\n }\n\n __mreactUnmountCompatBoundaries(target.current);\n __mreactResumeNode(target.current, target.next);\n return true;\n}\n\nfunction __mreactNavigationShellSyncTarget(currentMarker, nextMarker) {\n const currentShells = __mreactMarkerShellAncestors(currentMarker);\n const nextShells = __mreactMarkerShellAncestors(nextMarker);\n const commonLength = Math.min(currentShells.length, nextShells.length);\n let commonIndex = -1;\n\n for (let index = 0; index < commonLength; index += 1) {\n if (!__mreactSameNavigationShellBoundary(currentShells[index], nextShells[index])) {\n break;\n }\n\n commonIndex = index;\n }\n\n if (commonIndex >= 0) {\n return __mreactNavigationShellDomTarget(currentShells[commonIndex], nextShells[commonIndex]);\n }\n\n if (currentShells.length === 0 || nextShells.length === 0) {\n return null;\n }\n\n const currentRoot = currentShells[0];\n const nextRoot = nextShells[0];\n\n if (currentRoot.tagName !== nextRoot.tagName) {\n return null;\n }\n\n return __mreactNavigationShellDomTarget(currentRoot, nextRoot);\n}\n\nfunction __mreactMarkerShellAncestors(marker) {\n const shells = [];\n let current = marker.parentElement;\n\n while (current !== null) {\n if (__mreactIsNavigationShellBoundary(current)) {\n shells.push(current);\n }\n\n current = current.parentElement;\n }\n\n shells.reverse();\n return shells;\n}\n\nfunction __mreactIsNavigationShellBoundary(element) {\n return element.hasAttribute(\"data-mreact-layout-boundary\") ||\n element.hasAttribute(\"data-mreact-template-boundary\");\n}\n\nfunction __mreactSameNavigationShellBoundary(current, next) {\n const currentKind = __mreactNavigationShellBoundaryKind(current);\n const nextKind = __mreactNavigationShellBoundaryKind(next);\n\n if (currentKind === null || currentKind !== nextKind || current.tagName !== next.tagName) {\n return false;\n }\n\n const attribute = currentKind === \"layout\"\n ? \"data-mreact-layout-boundary\"\n : \"data-mreact-template-boundary\";\n\n return current.getAttribute(attribute) === next.getAttribute(attribute);\n}\n\nfunction __mreactNavigationShellBoundaryKind(element) {\n if (element.hasAttribute(\"data-mreact-layout-boundary\")) {\n return \"layout\";\n }\n\n if (element.hasAttribute(\"data-mreact-template-boundary\")) {\n return \"template\";\n }\n\n return null;\n}\n\nfunction __mreactNavigationShellDomTarget(currentShell, nextShell) {\n if (currentShell.tagName === \"HTML\" && nextShell.tagName === \"HTML\") {\n const currentBody = currentShell.querySelector(\"body\");\n const nextBody = nextShell.querySelector(\"body\");\n\n if (currentBody !== null && nextBody !== null) {\n return { current: currentBody, next: nextBody };\n }\n }\n\n return { current: currentShell, next: nextShell };\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 id of managedIds) {\n document.getElementById(id)?.remove();\n const next = typeof root.getElementById === \"function\"\n ? root.getElementById(id)\n : root.querySelector(\\`#\\${id}\\`);\n\n if (next !== null && next !== undefined) {\n document.body.appendChild(next);\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(\\`${routeHydrationContract.propsScriptPrefix}\\${routeId}\\`);\n ids.add(\\`${routeHydrationContract.clientReferencesScriptPrefix}\\${routeId}\\`);\n }\n\n return ids;\n}\n\nfunction __mreactRouteDataScriptSelector() {\n return ${JSON.stringify(routeDataScriptSelector())};\n}\n\nfunction __mreactCurrentHistoryState(url) {\n return {\n __mreact: true,\n html: __mreactCurrentDocumentRouteHtml(),\n scrollX: Number(globalThis.scrollX ?? 0),\n scrollY: Number(globalThis.scrollY ?? 0),\n url,\n };\n}\n\nfunction __mreactCurrentDocumentRouteHtml() {\n if (typeof document === \"undefined\") {\n return undefined;\n }\n\n const marker = document.querySelector(\"[\" + __mreactRouteMarkerAttribute + \"]\");\n if (marker === null) {\n return undefined;\n }\n\n const routeDataScripts = Array.from(document.querySelectorAll(__mreactRouteDataScriptSelector()))\n .map((script) => script.outerHTML)\n .join(\"\");\n return marker.outerHTML + routeDataScripts;\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 __mreactIsSameOriginNavigationUrl(url) {\n if (typeof location === \"undefined\") {\n return true;\n }\n\n try {\n return new URL(url, location.href).origin === location.origin;\n } catch {\n return false;\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 __mreactIsCurrentLocationNavigationHref(href) {\n if (typeof location === \"undefined\") {\n return false;\n }\n\n return __mreactIsCurrentLocationNavigation(new URL(href, location.href));\n}\n\nfunction __mreactIsCurrentLocationNavigation(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}\n\nfunction __mreactInstallNavigation() {\n if (__mreactNavigationState.installed || typeof document === \"undefined\") {\n return;\n }\n\n __mreactNavigationState.installed = true;\n __mreactInstallNavigationFetchRevalidation();\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(\"submit\", (event) => {\n if (event.defaultPrevented || typeof fetch !== \"function\") {\n return;\n }\n\n const submission = __mreactServerActionSubmissionFromEvent(event);\n\n if (submission === null) {\n return;\n }\n\n event.preventDefault();\n void __mreactSubmitServerActionForm(submission).catch(() => {\n location.href = submission.action;\n });\n });\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 if (__mreactIsCurrentLocationNavigation(nextUrl)) {\n event.preventDefault();\n\n if (__mreactAnchorScrollMode(anchor) !== false && nextUrl.hash === \"\") {\n __mreactScrollTo(0, 0);\n }\n\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 __mreactServerActionSubmissionFromEvent(event) {\n const target = event.target;\n const form = target instanceof Element ? target.closest(\"form\") : null;\n const submitter = __mreactFormSubmitterFromEvent(event);\n\n if (!(form instanceof HTMLFormElement)) {\n return null;\n }\n\n const action = submitter?.getAttribute(\"formaction\") ?? form.action;\n const method = submitter?.getAttribute(\"formmethod\") ?? form.method;\n const targetName = submitter?.getAttribute(\"formtarget\") ?? form.target;\n const actionUrl = new URL(action, location.href);\n\n if (\n targetName !== \"\" ||\n actionUrl.origin !== location.origin ||\n actionUrl.pathname !== \"/_mreact/actions\" ||\n method.toUpperCase() !== \"POST\"\n ) {\n return null;\n }\n\n return { action: actionUrl.href, form, submitter };\n}\n\nfunction __mreactFormSubmitterFromEvent(event) {\n const submitter = event.submitter;\n\n return submitter instanceof HTMLElement ? submitter : null;\n}\n\nasync function __mreactSubmitServerActionForm(submission) {\n const response = await fetch(submission.action, {\n body: __mreactServerActionFormData(submission.form, submission.submitter),\n headers: { \"x-mreact-action-single-flight\": \"1\" },\n method: \"POST\",\n });\n __mreactApplyRevalidationHeader(response);\n\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n const singleFlight = response.headers.get(\"x-mreact-action-single-flight\") === \"1\";\n if (\n !singleFlight &&\n !contentType.includes(\"text/html\")\n ) {\n location.href = response.url || submission.action;\n return;\n }\n\n const html = await response.text();\n const applied = __mreactApplyServerActionHtml(html, singleFlight);\n\n if (!applied) {\n location.href = response.url || submission.action;\n }\n}\n\nfunction __mreactServerActionFormData(form, submitter) {\n if (submitter !== null) {\n try {\n return new FormData(form, submitter);\n } catch {\n // Older DOM implementations only accept the form argument.\n }\n }\n\n return new FormData(form);\n}\n\nfunction __mreactApplyServerActionHtml(html, singleFlight) {\n __mreactSaveCurrentHistoryState();\n const applied = __mreactApplyNavigationHtml(html, location.href);\n\n if (!applied) {\n if (\n !singleFlight ||\n typeof document === \"undefined\" ||\n typeof document.open !== \"function\"\n ) {\n return false;\n }\n\n document.open();\n document.write(html);\n document.close();\n return true;\n }\n\n __mreactResetNavigationFocus();\n __mreactAnnounceNavigation();\n return true;\n}\n\nfunction __mreactInstallNavigationFetchRevalidation() {\n if (\n __mreactNavigationState.fetchRevalidationInstalled ||\n typeof globalThis.fetch !== \"function\"\n ) {\n return;\n }\n\n __mreactNavigationState.fetchRevalidationInstalled = true;\n const fetchImpl = globalThis.fetch;\n globalThis.fetch = function(input, init) {\n const mutating = __mreactIsMutatingFetchRequest(input, init);\n\n return Promise.resolve(fetchImpl.call(this, input, init)).then((response) => {\n __mreactApplyRevalidationHeader(response);\n\n if (mutating) {\n __mreactInvalidateAllNavigationCache();\n __mreactNavigationState.reloadNextNavigationFetch = true;\n }\n\n return response;\n });\n };\n}\n\nfunction __mreactIsMutatingFetchRequest(input, init) {\n const method = __mreactFetchRequestMethod(input, init);\n\n return method !== \"GET\" && method !== \"HEAD\";\n}\n\nfunction __mreactFetchRequestMethod(input, init) {\n if (typeof init?.method === \"string\" && init.method !== \"\") {\n return init.method.toUpperCase();\n }\n\n if (typeof Request !== \"undefined\" && input instanceof Request) {\n return input.method.toUpperCase();\n }\n\n return \"GET\";\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 completionMarker = Array.from(root.querySelectorAll(\"[data-mreact-oob-complete]\"))\n .find((candidate) => candidate.getAttribute(\"data-mreact-oob-complete\") === id);\n\n if (completionMarker === undefined) {\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 completionMarker.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 const fallbackChildren = __mreactClientBoundaryFallbackChildren(placeholder, propsElement);\n\n if (fallbackChildren !== undefined) {\n props.children = fallbackChildren;\n }\n\n if (compat) {\n const parentContainer = __mreactClientBoundaryParentContainer(placeholder, propsElement);\n const container = parentContainer ?? document.createElement(\"span\");\n container.setAttribute(\"data-mreact-compat-boundary\", name ?? \"\");\n if (parentContainer === null) {\n container.style.display = \"contents\";\n placeholder.replaceWith(container);\n } else {\n placeholder.remove();\n }\n propsElement?.remove();\n const root = __mreactCompatCreateRoot(container);\n container.__mreactCompatRoot = root;\n root.render(__mreactCompatCreateElement(component, props));\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 __mreactClientBoundaryParentContainer(placeholder, propsElement) {\n const parent = placeholder.parentElement;\n\n if (parent === null) {\n return null;\n }\n\n for (const node of Array.from(parent.childNodes)) {\n if (node === placeholder || node === propsElement) {\n continue;\n }\n\n if (node.nodeType === Node.TEXT_NODE && (node.textContent ?? \"\").trim() === \"\") {\n continue;\n }\n\n return null;\n }\n\n return parent;\n}\n\nfunction __mreactUnmountCompatBoundaries(root) {\n const containers = [];\n\n if (\n root.nodeType === Node.ELEMENT_NODE &&\n root.hasAttribute(\"data-mreact-compat-boundary\")\n ) {\n containers.push(root);\n }\n\n if (typeof root.querySelectorAll === \"function\") {\n containers.push(...root.querySelectorAll(\"[data-mreact-compat-boundary]\"));\n }\n\n for (const container of containers) {\n const compatRoot = container.__mreactCompatRoot;\n\n if (compatRoot === undefined || typeof compatRoot.unmount !== \"function\") {\n continue;\n }\n\n compatRoot.unmount();\n container.__mreactCompatRoot = undefined;\n }\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 next = next.nextSibling;\n }\n\n return undefined;\n}\n\nfunction __mreactClientBoundaryFallbackChildren(placeholder, propsElement) {\n const nodes = [];\n let next = placeholder.nextSibling;\n\n while (next !== null && next !== propsElement) {\n const current = next;\n next = next.nextSibling;\n\n if (current.nodeType === Node.TEXT_NODE && (current.textContent ?? \"\").trim() === \"\") {\n current.remove();\n continue;\n }\n\n current.remove();\n nodes.push(current);\n }\n\n if (nodes.length === 0) {\n return undefined;\n }\n\n return nodes.length === 1 ? nodes[0] : nodes;\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 __mreactUnmountCompatBoundaries(current);\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 __mreactUnmountCompatBoundaries(current);\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 rawBindings = next.__mreactEventBindings;\n const bindings =\n rawBindings === undefined ? [] : Array.isArray(rawBindings) ? rawBindings : [rawBindings];\n\n if (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 const lastChild = current.lastChild;\n if (lastChild === null) {\n break;\n }\n __mreactUnmountCompatBoundaries(lastChild);\n 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 runtimePackageNames = [\n \"@reckona/mreact-reactive-core\",\n \"@reckona/mreact-reactive-dom\",\n \"@reckona/mreact-compat\",\n ];\n const runtimePaths = new Map([\n [\"react\", reactCompatPath],\n [\"react-dom\", reactCompatPath],\n [\"react-dom/client\", reactCompatPath],\n [\"react-dom/server\", reactCompatPath],\n [\n \"react/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\"react/jsx-runtime\", packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\")],\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/hooks\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"hooks-entry\"),\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 [\"@reckona/mreact-reactive-dom\", reactiveDomPath],\n ]);\n\n return {\n name: \"mreact-workspace-runtime\",\n setup(buildApi: RouterCompatBuildApi) {\n buildApi.onResolve({ filter: /^\\.\\/devtools\\.js$/ }, (args) =>\n importerInRuntimePackage(\n args.importer,\n [reactiveCoreDir],\n [\"@reckona/mreact-reactive-core\"],\n )\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 importerInRuntimePackage(importer, runtimePackageDirs, runtimePackageNames)\n ? { path: reactiveCorePath }\n : {\n namespace: \"mreact-hot-runtime\",\n path: \"reactive-core\",\n };\n });\n buildApi.onResolve(\n {\n filter:\n /^(?:react(?:\\/jsx-(?:dev-)?runtime)?|react-dom(?:\\/(?:client|server))?|@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; }\nexport function currentReactiveDevtools() { 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\nfunction importerInRuntimePackage(\n importer: string | undefined,\n directories: readonly string[],\n packageNames: readonly string[],\n): boolean {\n if (importer === undefined) {\n return false;\n }\n\n const normalizedImporter = importer.split(/[\\\\/]+/).join(\"/\");\n return (\n directories.some((directory) => importer.startsWith(`${directory}${sep}`)) ||\n packageNames.some((packageName) => normalizedImporter.includes(`/node_modules/${packageName}/`))\n );\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 * AST-based so commented-out or string-literal occurrences of the pattern are\n * not mistaken for a real export.\n */\nexport function detectClientNavigationHint(source: string): boolean {\n return readTopLevelBooleanExport({ code: source, name: \"clientNavigation\" }) ?? true;\n}\n\n// `Link` ships from the dedicated `/link` subpath and is also re-exported from\n// the package root for backward compatibility, so both specifiers must count.\n// The root entry exports many bindings, so a root import only triggers the\n// navigation runtime when the rendered specifier is `Link` specifically.\nconst navigationLinkPackageSpecifiers = new Set([\n \"@reckona/mreact-router\",\n \"@reckona/mreact-router/link\",\n]);\n\nfunction staticImportsRenderLink(\n staticImports: readonly ClientRouteStaticImportReference[],\n renderedRoots: ReadonlySet<string>,\n renderedNames: ReadonlySet<string>,\n): boolean {\n return staticImports.some(\n (reference) =>\n navigationLinkPackageSpecifiers.has(reference.source) &&\n reference.specifiers.some(\n (specifier) =>\n (specifier.importedName === \"Link\" && renderedRoots.has(specifier.localName)) ||\n (specifier.kind === \"namespace\" && renderedNames.has(`${specifier.localName}.Link`)),\n ),\n );\n}\n\nfunction detectLinkComponentUsage(analysis: ClientRouteModuleAnalysis): boolean {\n // Use the export-reachable rendered roots, not the file-wide JSX roots, so a\n // `Link` rendered only in dead/unreachable code does not trigger the runtime.\n return staticImportsRenderLink(\n analysis.staticImports,\n new Set(analysis.reachableRenderedComponentRoots),\n new Set(analysis.reachableRenderedComponentNames),\n );\n}\n\n// Export names whose own render subtree (transitively, within this module)\n// renders a navigation `Link`. Lets callers attribute `Link` usage to the\n// specific export they render, so a barrel that re-exports both Link-using and\n// Link-free components only triggers the runtime for the ones actually rendered.\nfunction detectLinkComponentExportNames(analysis: ClientRouteModuleAnalysis): string[] {\n return Object.keys(analysis.reachableExportRenderedComponentRoots).filter((exportName) =>\n staticImportsRenderLink(\n analysis.staticImports,\n new Set(analysis.reachableExportRenderedComponentRoots[exportName] ?? []),\n new Set(analysis.reachableExportRenderedComponentNames[exportName] ?? []),\n ),\n );\n}\n\n// Reads the explicit `export const navigationRuntime = true | false` override.\n// Returns `undefined` when absent. AST-based so commented-out or string-literal\n// occurrences of the pattern are not mistaken for a real export.\nexport function detectNavigationRuntimeOverride(source: string): boolean | undefined {\n return readTopLevelBooleanExport({ code: source, name: \"navigationRuntime\" });\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 /from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/.test(code) && /\\beffect\\s*\\(/.test(code);\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\n .replaceAll(\"&\", \"\\\\u0026\")\n .replaceAll(\"<\", \"\\\\u003c\")\n .replaceAll(\">\", \"\\\\u003e\")\n .replaceAll(\"\\u2028\", \"\\\\u2028\")\n .replaceAll(\"\\u2029\", \"\\\\u2029\");\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,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,GAAG;QACnB,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QACjE,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;KAC7E,CAAC;IAEF,OAAO,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AACjF,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACtD,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;SACT,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC;SAC1B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC/B,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AACrC,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 analyzeBoundaryGraph,\n collectClientRouteModuleAnalysis,\n formatDiagnostic,\n type ComponentMetadata,\n type BoundaryGraphResult,\n type ClientRouteModuleAnalysis,\n type ClientRouteStaticImportReference,\n type StaticImportReference,\n type TopLevelExportRenderInfo,\n} from \"@reckona/mreact-compiler\";\nimport type { ClientReferenceMetadata } from \"@reckona/mreact-shared/compiler-contract\";\nimport {\n collectClientRouteModuleAnalysisFromContext,\n createCompilerModuleContext,\n hasUnguardedBrowserGlobalReference,\n readTopLevelBooleanExport,\n readTopLevelBooleanExportFromContext,\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 { resolveClientConsolePureFunctions, type AppRouterProductionOptions } from \"./config.js\";\nimport type { AppRoute } from \"./routes.js\";\nimport { existingRouteShellCandidates } from \"./route-shells.js\";\nimport {\n routeDataScriptIds,\n routeDataScriptSelector,\n routeHydrationContract,\n} from \"./route-hydration-contract.js\";\nimport { stripRouteClientSource } 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 clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\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 cacheDir?: string | undefined;\n code: string;\n clientBoundaryImports?: readonly string[] | undefined;\n clientReferenceImports?: readonly ClientReferenceImport[] | undefined;\n clientReferenceManifest?: readonly ClientReferenceMetadata[] | undefined;\n dropClientConsole?: AppRouterProductionOptions[\"dropClientConsole\"] | undefined;\n dropConsoleFunctions?: readonly string[] | 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 clientBoundaryFallbackImports: string[];\n diagnostics: ClientRouteInferenceDiagnostic[];\n}\n\ninterface ClientRouteModuleInferenceResult extends ClientRouteInferenceResult {\n boundaryGraphFallbackCandidate: boolean;\n boundaryGraphFallbackRequired: boolean;\n clientBoundaryExportNames: string[];\n clientBoundaryModule: boolean;\n nestedClientExportNames: string[];\n clientReferenceSourceFiles: string[];\n navigationLinkExportNames: string[];\n serverOnly: boolean;\n serverOnlyClientRuntime: boolean;\n usesNavigationLink: 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 usesNavigationLink: boolean;\n}\n\nexport interface ClientRouteInferenceDiagnostic {\n code:\n | typeof clientBoundaryInferenceServerOnlyReferenceCode\n | typeof clientBoundaryInferenceFunctionCallInteractiveCode\n | typeof clientBoundaryInferenceUnsupportedReferenceCode\n | typeof navigationRuntimeLinkDisabledCode;\n filename: string;\n level: \"warn\";\n localNames: string[];\n message: string;\n routePath?: string | undefined;\n source: string;\n}\n\nconst clientBoundaryInferenceServerOnlyReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_SERVER_ONLY_REFERENCE\";\nconst clientBoundaryInferenceFunctionCallInteractiveCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_FUNCTION_CALL_INTERACTIVE\";\nconst clientBoundaryInferenceUnsupportedReferenceCode =\n \"MR_CLIENT_BOUNDARY_INFERENCE_UNSUPPORTED_REFERENCE\";\nconst navigationRuntimeLinkDisabledCode = \"MR_NAVIGATION_RUNTIME_LINK_DISABLED\";\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: stripRouteClientSource({ code, filename: route.file }),\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 const mergedRouteInference = routeInference.boundaryGraphFallbackRequired\n ? mergeClientRouteInference(\n routeInference,\n await inferClientRouteModuleBoundaryGraph({\n cache,\n code,\n filename: options.filename,\n sourceTransform,\n }),\n )\n : routeInference;\n\n if (options.appDir === undefined) {\n return withClientRouteDiagnosticPath(mergedRouteInference, options.routePath);\n }\n\n const shellInferences = await inferClientRouteShellModules({\n appDir: options.appDir,\n cache,\n filename: options.filename,\n sourceTransform,\n });\n\n return withClientRouteDiagnosticPath(\n {\n client:\n mergedRouteInference.client || shellInferences.some((inference) => inference.client),\n clientBoundaryImports: mergedRouteInference.clientBoundaryImports,\n clientBoundaryFallbackImports: mergedRouteInference.clientBoundaryFallbackImports,\n diagnostics: [\n ...mergedRouteInference.diagnostics,\n ...shellInferences.flatMap((inference) => inference.diagnostics),\n ],\n },\n options.routePath,\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\nasync function inferClientRouteModuleBoundaryGraph(options: {\n cache: ClientRouteInferenceCache;\n code: string;\n filename: string;\n sourceTransform?: ClientRouteSourceTransform | undefined;\n}): Promise<ClientRouteInferenceResult> {\n const graph = await analyzeBoundaryGraph({\n entries: [{ file: options.filename, kind: \"route-page\" }],\n readModule: async (file) => {\n if (file === options.filename) {\n return options.code;\n }\n\n return await readClientRouteSource({\n cache: options.cache,\n filename: file,\n sourceTransform: options.sourceTransform,\n });\n },\n resolveModule: async ({ importer, source }) =>\n await resolveAppLocalModule({\n allowExplicitNonSource: options.sourceTransform !== undefined,\n cache: options.cache,\n importer,\n specifier: source,\n }),\n });\n\n return clientRouteInferenceFromBoundaryGraph(graph, options.filename);\n}\n\nfunction clientRouteInferenceFromBoundaryGraph(\n graph: BoundaryGraphResult,\n filename: string,\n): ClientRouteInferenceResult {\n const clientBoundaryImports = graph.clientBoundaries\n .filter((boundary) => boundary.importerFile === filename)\n .map((boundary) => boundary.source);\n const clientRoute = graph.modules.some(\n (module) => module.file === filename && module.classification === \"client-route\",\n );\n\n return {\n client: clientRoute || clientBoundaryImports.length > 0,\n clientBoundaryImports,\n clientBoundaryFallbackImports: [],\n diagnostics: [],\n };\n}\n\nfunction mergeClientRouteInference(\n left: ClientRouteInferenceResult,\n right: ClientRouteInferenceResult,\n): ClientRouteInferenceResult {\n return {\n client: left.client || right.client,\n clientBoundaryImports: Array.from(\n new Set([...left.clientBoundaryImports, ...right.clientBoundaryImports]),\n ),\n clientBoundaryFallbackImports: Array.from(\n new Set([...left.clientBoundaryFallbackImports, ...right.clientBoundaryFallbackImports]),\n ),\n diagnostics: [...left.diagnostics, ...right.diagnostics],\n };\n}\n\nexport async function collectClientRouteReferences(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<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 = stripRouteClientSource({\n code: await readClientRouteSource({ cache, filename: referenceFile, sourceTransform }),\n filename: referenceFile,\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 = stripRouteClientSource({\n code: await readClientRouteSource({ cache, filename: shell, sourceTransform }),\n filename: shell,\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 clientBoundaryFallbackImports: source.inference.clientBoundaryFallbackImports,\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 clientBoundaryFallbackImports: routeInference.clientBoundaryFallbackImports,\n clientReferenceImports,\n clientReferenceManifest,\n diagnostics: sources\n .flatMap((source) => source.inference.diagnostics)\n .map((diagnostic) => withClientRouteDiagnosticPath(diagnostic, options.routePath)),\n usesNavigationLink:\n routeInference.usesNavigationLink ||\n sources.some(\n (source) => source.filename !== options.filename && source.inference.usesNavigationLink,\n ),\n };\n}\n\nexport async function resolveNavigationRuntime(options: {\n appDir?: string | undefined;\n cache?: ClientRouteInferenceCache | undefined;\n code: string;\n filename: string;\n references?: ClientRouteReferenceResult | undefined;\n vitePlugins?: readonly PluginOption[] | undefined;\n}): Promise<boolean> {\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 // Read the override from the cached module context so the dev server does not\n // re-parse every page route on each request.\n const moduleContext = await compilerModuleContextForSource({\n cache,\n code,\n filename: options.filename,\n });\n const override = readTopLevelBooleanExportFromContext(moduleContext, \"navigationRuntime\");\n\n if (override !== undefined) {\n return override;\n }\n\n const references =\n options.references ??\n (await collectClientRouteReferences({\n appDir: options.appDir,\n cache,\n code: options.code,\n filename: options.filename,\n vitePlugins: options.vitePlugins,\n }));\n\n return references.usesNavigationLink;\n}\n\nexport function navigationRuntimeLinkDisabledDiagnostic(options: {\n filename: string;\n references: Pick<ClientRouteReferenceResult, \"usesNavigationLink\">;\n routePath?: string | undefined;\n source: string;\n}): ClientRouteInferenceDiagnostic | undefined {\n if (\n !options.references.usesNavigationLink ||\n detectNavigationRuntimeOverride(options.source) !== false\n ) {\n return undefined;\n }\n\n return {\n code: navigationRuntimeLinkDisabledCode,\n filename: options.filename,\n level: \"warn\",\n localNames: [],\n message:\n \"A rendered Link was detected, but this route exports navigationRuntime = false. Client-side navigation will be disabled for this route; remove the override or replace Link with a plain anchor if that is intentional.\",\n routePath: options.routePath,\n source: options.source,\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 = stripRouteClientSource({\n code: await readClientRouteSource({\n cache: options.cache,\n filename: shell,\n sourceTransform: options.sourceTransform,\n }),\n filename: shell,\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 const usesNavigationLinkLocal = detectLinkComponentUsage(analysis);\n\n if (isServerOnlyClientRouteSource(analysis)) {\n return emptyClientRouteModuleInferenceResult({\n navigationLinkExportNames: detectLinkComponentExportNames(analysis),\n serverOnly: true,\n serverOnlyClientRuntime: analysis.clientRuntime,\n usesNavigationLink: usesNavigationLinkLocal,\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 clientBoundaryFallbackImports: string[] = [];\n const clientBoundaryExportNames = new Set<string>();\n const nestedClientExportNames = new Set<string>();\n const clientReferenceSourceFiles: string[] = [];\n const diagnostics: ClientRouteInferenceDiagnostic[] = [];\n let boundaryGraphFallbackRequired = false;\n let clientProxy = false;\n let nestedClient = false;\n let usesNavigationLink = usesNavigationLinkLocal;\n const navigationLinkExportNames = new Set<string>(detectLinkComponentExportNames(analysis));\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 // A bare-identifier default export (`export default Page`) is the route's\n // rendered component even though the module body has no JSX for it; treat it\n // as a rendered root so a re-exported imported component (and any Link it\n // renders) is followed.\n const renderedComponentRoots =\n analysis.defaultExportIdentifier === undefined\n ? unionSets(jsxComponentRoots, componentCallRoots)\n : new Set([...jsxComponentRoots, ...componentCallRoots, analysis.defaultExportIdentifier]);\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 // Propagate the navigation runtime only for imports that are actually\n // rendered here, and only for the specific exports whose subtree renders a\n // `Link`. A merely-referenced import (e.g. `const C = Nav`) recurses for\n // client-boundary detection but must not pull in a transitive `Link`, and\n // a barrel re-exporting Link-free siblings must not over-trigger.\n if (rendered) {\n const importedNavigationExportNames = renderedImportedExportNames(\n reference,\n renderedComponentRoots,\n );\n if (\n matchesInferredExportNames(\n importedNavigationExportNames,\n imported.navigationLinkExportNames,\n )\n ) {\n usesNavigationLink = true;\n for (const exportName of renderedLocalExportNames(reference, exportInfo)) {\n navigationLinkExportNames.add(exportName);\n }\n }\n }\n\n if (!imported.client) {\n if (rendered && imported.boundaryGraphFallbackCandidate) {\n boundaryGraphFallbackRequired = true;\n }\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 diagnostics.push(\n functionCallInteractiveImportDiagnostic({\n filename: options.filename,\n reference,\n }),\n );\n continue;\n }\n\n if (!importedBoundary) {\n clientReferenceSourceFiles.push(resolved);\n continue;\n }\n\n clientBoundaryImports.push(reference.source);\n if (\n !imported.clientBoundaryModule &&\n isClientBoundaryFallbackEligibleSource(source, resolved)\n ) {\n clientBoundaryFallbackImports.push(reference.source);\n }\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 // A re-export renders nothing itself, so it does not set the module's\n // own `usesNavigationLink`; it only forwards per-export `Link` usage so\n // an importer that renders this name can decide precisely. Map the\n // source module's export names onto the names this barrel re-exposes:\n // `export * from` keeps the original names, `export { A as Nav } from`\n // renames them.\n if (reference.exportAll) {\n for (const exportName of exported.navigationLinkExportNames) {\n navigationLinkExportNames.add(exportName);\n }\n } else {\n for (const specifier of reference.specifiers) {\n if (exported.navigationLinkExportNames.includes(specifier.localName)) {\n navigationLinkExportNames.add(specifier.exportedName);\n }\n }\n }\n\n if (exported.clientBoundaryModule) {\n clientProxy = true;\n } else if (exported.clientBoundaryExportNames.length > 0) {\n if (reference.exportAll) {\n for (const exportName of exported.clientBoundaryExportNames) {\n clientBoundaryExportNames.add(exportName);\n }\n } else {\n for (const specifier of reference.specifiers) {\n if (exported.clientBoundaryExportNames.includes(specifier.localName)) {\n clientBoundaryExportNames.add(specifier.exportedName);\n }\n }\n }\n } else if (exported.client) {\n nestedClient = true;\n clientReferenceSourceFiles.push(resolved);\n } else if (exported.boundaryGraphFallbackCandidate) {\n boundaryGraphFallbackRequired = true;\n }\n }\n }\n\n return {\n boundaryGraphFallbackCandidate:\n analysis.staticExports.length > 0 || boundaryGraphFallbackRequired,\n boundaryGraphFallbackRequired,\n client:\n clientBoundaryImports.length > 0 ||\n clientBoundaryExportNames.size > 0 ||\n implicitModuleClient ||\n clientProxy ||\n nestedClient,\n clientBoundaryImports,\n clientBoundaryFallbackImports,\n clientBoundaryExportNames: Array.from(clientBoundaryExportNames),\n clientBoundaryModule: clientProxy || implicitModuleClient,\n nestedClientExportNames: Array.from(nestedClientExportNames),\n clientReferenceSourceFiles: Array.from(new Set(clientReferenceSourceFiles)),\n diagnostics,\n navigationLinkExportNames: Array.from(navigationLinkExportNames),\n serverOnly: false,\n serverOnlyClientRuntime: false,\n usesNavigationLink,\n };\n } finally {\n options.seen.delete(options.filename);\n }\n}\n\nfunction emptyClientRouteModuleInferenceResult(\n overrides: Partial<ClientRouteModuleInferenceResult> = {},\n): ClientRouteModuleInferenceResult {\n return {\n boundaryGraphFallbackCandidate: false,\n boundaryGraphFallbackRequired: false,\n client: false,\n clientBoundaryImports: [],\n clientBoundaryFallbackImports: [],\n clientBoundaryExportNames: [],\n clientBoundaryModule: false,\n nestedClientExportNames: [],\n clientReferenceSourceFiles: [],\n diagnostics: [],\n navigationLinkExportNames: [],\n serverOnly: false,\n serverOnlyClientRuntime: false,\n usesNavigationLink: 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 setLatestModuleCacheEntry(\n options.cache.moduleAnalysisByFile,\n options.filename,\n cacheKey,\n analysis,\n );\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 setLatestModuleCacheEntry(options.cache.moduleContextByFile, options.filename, cacheKey, context);\n return context;\n}\n\nfunction sourceAnalysisCacheKey(filename: string, code: string): string {\n return `${filename}\\0${hashSourceText(code)}`;\n}\n\n// Keeps only the latest content version per file in the source-keyed caches.\n// The cache persists across dev requests, and keys embed a content hash, so\n// without this an edited file would accumulate an entry per saved version.\n// Filenames cannot contain the NUL separator, so the `${filename}\\0` prefix\n// matches exactly that file's prior entries.\nfunction setLatestModuleCacheEntry<T>(\n map: Map<string, T>,\n filename: string,\n cacheKey: string,\n value: T,\n): void {\n const prefix = `${filename}\\0`;\n\n for (const existing of map.keys()) {\n if (existing !== cacheKey && existing.startsWith(prefix)) {\n map.delete(existing);\n }\n }\n\n map.set(cacheKey, value);\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([\".css\", \".less\", \".sass\", \".scss\", \".styl\", \".stylus\"]);\n\nfunction isClientBoundaryFallbackEligibleSource(source: string, filename?: string): boolean {\n if (hasClientBoundaryFallbackUnsafeBrowserGlobal(source, filename)) {\n return false;\n }\n\n const destructuredCallbackPropNames = destructuredPropsCallbackNames(source);\n const callbackPropNames = new Set([\n ...destructuredCallbackPropNames,\n ...propsCallbackAliasNames(source),\n ...memberCallbackNames(source),\n ]);\n const sourceWithoutComponentCallbackProps = source.replaceAll(\n /<[A-Z][A-Za-z0-9_$.]*(?:\\s[\\s\\S]*?)?>/gu,\n (tag) => tag.replaceAll(/\\s+on[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{[^{}]*\\}/gu, \"\"),\n );\n let sourceWithoutGuardedUndefinedCallbacks = sourceWithoutComponentCallbackProps\n .replaceAll(\n /\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*props\\.[A-Za-z_$][\\w$]*\\s*===\\s*undefined\\s*\\?\\s*undefined\\s*:/gu,\n \"\",\n )\n .replaceAll(\n /\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*props\\.[A-Za-z_$][\\w$]*\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}/gu,\n \"\",\n );\n\n for (const callbackName of callbackPropNames) {\n const escapedCallbackName = escapeRegExp(callbackName);\n const callbackHandlerAttributePattern = new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*[^{}]*\\b${escapedCallbackName}\\b[^{}]*\\}`,\n \"gu\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\b(?:const|let|var)\\s+${escapedCallbackName}\\s*=\\s*props\\.[A-Za-z_$][\\w$]*\\s*;?`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\b(?:const|let|var)\\s+${escapedCallbackName}\\s*=\\s*[^;\\n]+\\.${escapedCallbackName}\\s*;?`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*(?:===|==)\\s*(?:undefined|null)\\s*\\?\\s*undefined\\s*:\\s*[^{}]*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*(?:undefined|null)\\s*(?:===|==)\\s*${escapedCallbackName}\\s*\\?\\s*undefined\\s*:\\s*[^{}]*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*(?:!==|!=)\\s*(?:undefined|null)\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*typeof\\s+${escapedCallbackName}\\s*===\\s*[\"']function[\"']\\s*\\?\\s*[^{}]*:\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n new RegExp(\n String.raw`\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{\\s*${escapedCallbackName}\\s*\\?\\?\\s*undefined\\s*\\}`,\n \"gu\",\n ),\n \"\",\n );\n\n if (\n hasCallbackAbsenceGuard(\n sourceWithoutComponentCallbackProps.replaceAll(callbackHandlerAttributePattern, \"\"),\n callbackName,\n )\n ) {\n sourceWithoutGuardedUndefinedCallbacks = sourceWithoutGuardedUndefinedCallbacks.replaceAll(\n callbackHandlerAttributePattern,\n \"\",\n );\n }\n sourceWithoutGuardedUndefinedCallbacks = removeSafeCallbackHandlerAttributes(\n sourceWithoutGuardedUndefinedCallbacks,\n callbackName,\n {\n externalAbsenceGuard: hasCallbackAbsenceGuard(\n sourceWithoutComponentCallbackProps.replaceAll(callbackHandlerAttributePattern, \"\"),\n callbackName,\n ),\n },\n );\n\n if (\n new RegExp(String.raw`\\b${escapedCallbackName}\\s*\\(`, \"u\").test(\n sourceWithoutGuardedUndefinedCallbacks,\n )\n ) {\n return false;\n }\n }\n\n return (\n !/\\bon[A-Z][A-Za-z0-9_$]*\\s*=/u.test(sourceWithoutGuardedUndefinedCallbacks) &&\n !/\\bglobalThis\\b/u.test(source)\n );\n}\n\nfunction hasClientBoundaryFallbackUnsafeBrowserGlobal(source: string, filename?: string): boolean {\n const sourceWithoutTypeofGuards = source.replaceAll(\n /\\btypeof\\s+(?:window|document|localStorage)\\s*(?:(?:={2,3}|!={1,2})\\s*[\"']undefined[\"'])?/gu,\n \"\",\n );\n if (!/\\b(?:window|document|localStorage)\\b/u.test(sourceWithoutTypeofGuards)) {\n return false;\n }\n\n // Remaining browser-global tokens may still be typeof-guarded uses such as\n // `if (typeof window !== \"undefined\") return window.location.pathname;`.\n // Those never execute on the server, so the AST guard analysis decides;\n // an unparsable module stays conservatively ineligible.\n try {\n return hasUnguardedBrowserGlobalReference({ code: source, filename });\n } catch {\n return true;\n }\n}\n\nfunction propsCallbackAliasNames(source: string): Set<string> {\n const names = new Set<string>();\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*props\\.([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*\\(\\s*props\\s+as\\s+[^)]+\\)\\.([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*\\(\\s*props\\s*\\)\\.([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*[^;\\n]+\\.([A-Za-z_$][\\w$]*)\\s*;?/gu,\n )) {\n const localName = match[1];\n const propName = match[2];\n\n if (\n localName !== undefined &&\n (isCallbackPropName(propName) || isCallbackPropName(localName))\n ) {\n names.add(localName);\n }\n }\n\n let added = true;\n while (added) {\n added = false;\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*([A-Za-z_$][\\w$]*)\\b/gu,\n )) {\n const localName = match[1];\n const sourceName = match[2];\n\n if (localName !== undefined && sourceName !== undefined && names.has(sourceName)) {\n const previousSize = names.size;\n names.add(localName);\n added ||= names.size !== previousSize;\n }\n }\n }\n\n return names;\n}\n\nfunction hasCallbackAbsenceGuard(source: string, name: string): boolean {\n const escapedName = escapeRegExp(name);\n\n return new RegExp(\n String.raw`(?:!\\s*${escapedName}\\b|${escapedName}\\s*(?:===|==)\\s*(?:undefined|null)|(?:undefined|null)\\s*(?:===|==)\\s*${escapedName}\\b)`,\n \"u\",\n ).test(source);\n}\n\nfunction memberCallbackNames(source: string): Set<string> {\n const names = new Set<string>();\n\n for (const match of source.matchAll(/\\.([A-Za-z_$][\\w$]*)\\b/gu)) {\n const memberName = match[1];\n\n if (memberName !== undefined && isCallbackPropName(memberName)) {\n names.add(memberName);\n }\n }\n\n return names;\n}\n\nfunction removeSafeCallbackHandlerAttributes(\n source: string,\n callbackName: string,\n options: { externalAbsenceGuard: boolean },\n): string {\n const attributePattern = /\\bon[A-Z][A-Za-z0-9_$]*\\s*=\\s*\\{/gu;\n let result = \"\";\n let cursor = 0;\n\n for (const match of source.matchAll(attributePattern)) {\n const start = match.index;\n const expressionStart = start + match[0].length;\n const end = matchingBraceEnd(source, expressionStart - 1);\n\n if (end === undefined) {\n continue;\n }\n\n const expression = source.slice(expressionStart, end);\n if (isSafeCallbackHandlerExpression(expression, callbackName, options)) {\n result += source.slice(cursor, start);\n cursor = end + 1;\n }\n }\n\n return cursor === 0 ? source : result + source.slice(cursor);\n}\n\nfunction matchingBraceEnd(source: string, openBraceIndex: number): number | undefined {\n let depth = 0;\n let quote: \"\\\"\" | \"'\" | \"`\" | undefined;\n let escaped = false;\n\n for (let index = openBraceIndex; index < source.length; index += 1) {\n const char = source[index];\n\n if (quote !== undefined) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (char === quote) {\n quote = undefined;\n }\n continue;\n }\n\n if (char === \"\\\"\" || char === \"'\" || char === \"`\") {\n quote = char;\n continue;\n }\n\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) {\n return index;\n }\n }\n }\n\n return undefined;\n}\n\nfunction isSafeCallbackHandlerExpression(\n expression: string,\n callbackName: string,\n options: { externalAbsenceGuard: boolean },\n): boolean {\n const escapedName = escapeRegExp(callbackName);\n if (!new RegExp(String.raw`\\b${escapedName}\\b`, \"u\").test(expression)) {\n return false;\n }\n\n if (new RegExp(String.raw`\\b${escapedName}\\s*\\(`, \"u\").test(expression)) {\n return false;\n }\n\n return (\n new RegExp(String.raw`\\b${escapedName}\\s*\\?\\.\\s*\\(`, \"u\").test(expression) ||\n new RegExp(String.raw`^\\s*${escapedName}\\s*\\?\\?\\s*undefined\\s*$`, \"u\").test(expression) ||\n options.externalAbsenceGuard\n );\n}\n\nfunction destructuredPropsCallbackNames(source: string): Set<string> {\n const names = new Set<string>();\n\n for (const match of source.matchAll(/\\b(?:const|let|var)\\s*\\{([^}]+)\\}\\s*=\\s*props\\b/gu)) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\{[^{}]*:\\s*\\{([^{}]+)\\}\\s*(?:=\\s*\\{\\})?[^{}]*\\}/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\bfunction(?:\\s+[A-Za-z_$][\\w$]*(?:<[^>()]+>)?)?\\s*\\(\\s*\\{([^}]+)\\}/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+[A-Za-z_$][\\w$]*\\s*=\\s*(?:async\\s*)?\\(?\\s*\\{([^}]+)\\}\\s*(?::\\s*[^)=]+)?\\)?\\s*=>/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\bexport\\s+default\\s+(?:async\\s*)?\\(?\\s*\\{([^}]+)\\}\\s*(?::\\s*[^)=]+)?\\)?\\s*=>/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n for (const match of source.matchAll(\n /\\b(?:const|let|var)\\s+[A-Za-z_$][\\w$]*\\s*=\\s*function(?:\\s+[A-Za-z_$][\\w$]*)?\\s*\\(\\s*\\{([^}]+)\\}/gu,\n )) {\n addDestructuredCallbackNames(names, match[1] ?? \"\");\n }\n\n return names;\n}\n\nfunction addDestructuredCallbackNames(names: Set<string>, destructured: string): void {\n for (const part of destructured.split(\",\")) {\n const [rawProperty, rawAlias] = part.trim().split(/\\s*:\\s*/u);\n const property = destructuredBindingName(rawProperty);\n const alias = destructuredBindingName(rawAlias);\n const name = alias ?? property;\n\n if (\n name !== undefined &&\n (isCallbackPropName(property) || isCallbackPropName(name))\n ) {\n names.add(name);\n }\n }\n}\n\nfunction destructuredBindingName(value: string | undefined): string | undefined {\n const name = value?.trim().split(/\\s*=/u, 1)[0]?.trim();\n return name === \"\" ? undefined : name;\n}\n\nfunction isCallbackPropName(name: string | undefined): boolean {\n return name !== undefined && /^on[A-Z][A-Za-z0-9_$]*$/u.test(name);\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 functionCallInteractiveImportDiagnostic(options: {\n filename: string;\n reference: StaticImportReference;\n}): ClientRouteInferenceDiagnostic {\n const localNames = options.reference.localNames.filter(startsUppercase);\n const component = localNames[0] ?? options.reference.localNames[0] ?? options.reference.source;\n const componentUsage = startsUppercase(component) ? `<${component} />` : \"JSX\";\n\n return {\n code: clientBoundaryInferenceFunctionCallInteractiveCode,\n filename: options.filename,\n level: \"warn\",\n localNames: localNames.length === 0 ? options.reference.localNames : localNames,\n message:\n `${options.filename}: interactive component import ${JSON.stringify(options.reference.source)} ` +\n `is rendered through a function call as ${component}(), so its event handlers or cell() state ` +\n \"will not hydrate as a client boundary. Render it through JSX such as \" +\n `${componentUsage}, or move the call behind an explicit client boundary.`,\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 const route =\n diagnostic.routePath === undefined ? \"\" : ` on route ${JSON.stringify(diagnostic.routePath)}`;\n return `${diagnostic.code}: ${diagnostic.message}${route}`;\n}\n\nfunction withClientRouteDiagnosticPath<\n T extends ClientRouteInferenceDiagnostic | ClientRouteInferenceResult,\n>(value: T, routePath: string | undefined): T {\n if (routePath === undefined) {\n return value;\n }\n\n if (\"diagnostics\" in value) {\n return {\n ...value,\n diagnostics: value.diagnostics.map((diagnostic) =>\n withClientRouteDiagnosticPath(diagnostic, routePath),\n ),\n };\n }\n\n return {\n ...value,\n routePath: value.routePath ?? routePath,\n };\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(\n plugin: Plugin,\n):\n | ((this: unknown, code: string, id: string, options?: { ssr?: boolean | undefined }) => 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 ${routeHydrationContract.routeMarkerAttribute}=\"${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 [propsScriptId, clientReferencesScriptId] = routeDataScriptIds(routeId).map((id) =>\n escapeHtmlAttribute(id),\n );\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 ${routeHydrationContract.routeMarkerAttribute}=\"${escapedRouteId}\">`,\n suffix: [\n \"</div>\",\n `<script type=\"application/json\" id=\"${propsScriptId}\">${propsJson}</script>`,\n clientReferencesJson === undefined\n ? undefined\n : `<script type=\"application/json\" id=\"${clientReferencesScriptId}\">${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 dropConsoleFunctions?: readonly string[] | undefined;\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.dropConsoleFunctions === undefined\n ? {}\n : { dropConsoleFunctions: options.dropConsoleFunctions }),\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 dropConsoleFunctions =\n options.dropConsoleFunctions ?? resolveClientConsolePureFunctions(options.dropClientConsole);\n const bundled = await bundleRouterModule({\n code: entry.code,\n cacheDir: options.cacheDir,\n define: {\n __MREACT_CLIENT_DEVTOOLS__: \"false\",\n },\n filename: options.filename,\n dropConsoleFunctions,\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 cacheDir?: string | undefined;\n dropConsoleFunctions?: readonly 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 cacheDir: options.cacheDir,\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 dropConsoleFunctions: options.dropConsoleFunctions,\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 routeSourceAnalysis = collectClientRouteModuleAnalysisFromContext(moduleContext);\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 routeExplicitlyRequiresHydration = isExplicitClientRouteSource(\n routeSourceAnalysis,\n options.filename,\n );\n const routeHasEventBindings = (compiled.metadata.eventHydrationManifest?.events.length ?? 0) > 0;\n const routeRequiresFullHydration =\n routeExplicitlyRequiresHydration ||\n routeUsesCells ||\n routeUsesReactiveEffect ||\n 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 routeReactiveDomMetadataImport = !routeUsesOnlyClientReferenceBoundaries\n ? `import { withEventBindingMetadata as __mreactWithEventBindingMetadata, withPropBindingMetadata as __mreactWithPropBindingMetadata } from \"@reckona/mreact-reactive-dom\";\\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 fetchRevalidationInstalled: false,\n installed: false,\n prefetchedUrls: new Set(),\n prefetchedScripts: new Set(),\n reloadNextNavigationFetch: false,\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?.propsText === (__mreactPropsText ?? \"\")\n ? __mreactPreviousState\n : {\n cells: new Map(),\n marker: __mreactMarker,\n propsText: __mreactPropsText ?? \"\",\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 =\n 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(\"react.transitional.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 routeHydrationNodeExpression = !routeUsesOnlyClientReferenceBoundaries\n ? `__mreactWithPropBindingMetadata(() => __mreactWithEventBindingMetadata(() => __mreactEvaluateHydrationNode(() => ${routeNodeExpression})))`\n : `__mreactEvaluateHydrationNode(() => ${routeNodeExpression})`;\n const boundaryOnlyHydrationBlock = routeRequiresFullHydration\n ? \"\"\n : `${routeCellHydrationIndent}if (!__mreactHasNonSerializableClientBoundaries(__mreactMarker) && __mreactHydrateClientBoundaries(document, __mreactClientReferences, __mreactClientReferenceComponents)) {\n${routeCellHydrationIndent} __mreactMarker.setAttribute(${JSON.stringify(routeHydrationContract.hydratedAttribute)}, \"true\");\n${routeCellHydrationIndent} __mreactMarkRouteHydrated();\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const routeComponentGuard = `${routeCellHydrationIndent}if (__mreactComponent === undefined) {\n${routeCellHydrationIndent} return;\n${routeCellHydrationIndent}}\n`;\n const entry = `${routeCellEffectImport}${routeCleanupScopeImport}${routeReactiveDomMetadataImport}${emitCompatClientReferenceImportBlock(compatClientReferenceNames)}${clientReferenceImportBlock}${routeHydrationCode}\n\nconst __mreactRouteId = ${JSON.stringify(routeId)};\n const __mreactRouteStateSignature = ${JSON.stringify(routeStateSignature)};\n const __mreactRouteMarkerAttribute = ${JSON.stringify(routeHydrationContract.routeMarkerAttribute)};\n const __mreactRouteHydratedAttribute = ${JSON.stringify(routeHydrationContract.hydratedAttribute)};\n const __mreactPropsScriptPrefix = ${JSON.stringify(routeHydrationContract.propsScriptPrefix)};\n const __mreactClientReferencesScriptPrefix = ${JSON.stringify(routeHydrationContract.clientReferencesScriptPrefix)};\n const __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(\\`[\\${__mreactRouteMarkerAttribute}=\"\\${__mreactRouteId}\"]\\`);\n const __mreactPropsElement = document.getElementById(\\`\\${__mreactPropsScriptPrefix}\\${__mreactRouteId}\\`);\n const __mreactClientReferencesElement = document.getElementById(\\`\\${__mreactClientReferencesScriptPrefix}\\${__mreactRouteId}\\`);\n const __mreactPropsText = __mreactPropsElement?.textContent;\n const __mreactProps = __mreactPropsText === undefined\n ? {}\n : JSON.parse(__mreactPropsText);\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 = ${routeHydrationNodeExpression};\n${routeCellHydrationIndent}__mreactResumeRoute(__mreactMarker, __mreactNode);\n${routeCellHydrationIndent}__mreactHydrateClientBoundaries(document, __mreactClientReferences, __mreactClientReferenceComponents);\n${routeCellHydrationIndent}__mreactMarker.setAttribute(__mreactRouteHydratedAttribute, \"true\");\n${routeCellHydrationIndent}__mreactMarkRouteHydrated();\n${routeCellHydrationEnd}}\n${routeCellDropFunction}\n${routeCleanupFunction}\n\nfunction __mreactMarkRouteHydrated() {\n if (typeof document !== \"undefined\") {\n document.documentElement.setAttribute(__mreactRouteHydratedAttribute, \"true\");\n }\n\n if (typeof window !== \"undefined\" && typeof CustomEvent === \"function\") {\n window.dispatchEvent(new CustomEvent(\"mreact:hydrated\", {\n detail: { routeId: __mreactRouteId },\n }));\n }\n}\n\nfunction __mreactMarkRouteHydrating() {\n if (typeof document === \"undefined\") {\n return;\n }\n\n document.documentElement.removeAttribute(__mreactRouteHydratedAttribute);\n}\n\nfunction __mreactEvaluateHydrationNode(factory) {\n const previous = __mreactGlobal.__mreactHydratingDynamicRanges;\n __mreactGlobal.__mreactHydratingDynamicRanges = true;\n\n try {\n return factory();\n } finally {\n if (previous === undefined) {\n delete __mreactGlobal.__mreactHydratingDynamicRanges;\n } else {\n __mreactGlobal.__mreactHydratingDynamicRanges = previous;\n }\n }\n}\n\nconst __mreactRouteHydrationReported = Symbol.for(\"mreact.routeHydrationReported\");\n\nfunction __mreactReportRouteHydrationError(error) {\n if (error !== null && typeof error === \"object\") {\n if (error[__mreactRouteHydrationReported] === true) {\n return;\n }\n error[__mreactRouteHydrationReported] = true;\n }\n\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(\n \\`mreact: route hydration failed for route \"\\${__mreactRouteId}\". Server HTML remains visible, but client interactivity for this route was not attached.\\`,\n error,\n );\n }\n}\n\nfunction __mreactRunRouteHydration(factory) {\n try {\n return factory();\n } catch (error) {\n __mreactReportRouteHydrationError(error);\n throw error;\n }\n}\n\n__mreactRunRouteHydration(() => __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 if (!__mreactIsSameOriginNavigationUrl(href)) {\n return false;\n }\n\n if (__mreactIsCurrentLocationNavigationHref(href)) {\n return false;\n }\n\n if (__mreactNavigationState.prefetchedUrls.has(href)) {\n return true;\n }\n\n __mreactRememberPrefetchedUrl(href);\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 __mreactRememberNavigationHtml(href, html);\n return true;\n }).catch(() => false);\n}\n\nconst __mreactNavigationHtmlCacheMaxEntries = 64;\nconst __mreactNavigationPrefetchHistoryMaxEntries = 64;\n\nfunction __mreactRememberPrefetchedUrl(href) {\n __mreactRememberPrefetchHistory(__mreactNavigationState.prefetchedUrls, href);\n}\n\nfunction __mreactRememberPrefetchedScript(href) {\n __mreactRememberPrefetchHistory(__mreactNavigationState.prefetchedScripts, href);\n}\n\nfunction __mreactRememberPrefetchHistory(history, href) {\n if (history.has(href)) {\n history.delete(href);\n }\n\n history.add(href);\n\n while (history.size > __mreactNavigationPrefetchHistoryMaxEntries) {\n const oldestHref = history.keys().next().value;\n\n if (oldestHref === undefined) {\n return;\n }\n\n history.delete(oldestHref);\n }\n}\n\nfunction __mreactCachedNavigationHtml(href) {\n const html = __mreactNavigationState.cache.get(href);\n\n if (html === undefined) {\n return undefined;\n }\n\n __mreactNavigationState.cache.delete(href);\n __mreactNavigationState.cache.set(href, html);\n return html;\n}\n\nfunction __mreactRememberNavigationHtml(href, html) {\n if (__mreactNavigationState.cache.has(href)) {\n __mreactNavigationState.cache.delete(href);\n }\n\n __mreactNavigationState.cache.set(href, html);\n\n while (__mreactNavigationState.cache.size > __mreactNavigationHtmlCacheMaxEntries) {\n const oldestHref = __mreactNavigationState.cache.keys().next().value;\n\n if (oldestHref === undefined) {\n return;\n }\n\n __mreactNavigationState.cache.delete(oldestHref);\n __mreactNavigationState.prefetchedUrls.delete(oldestHref);\n }\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 __mreactRememberPrefetchedScript(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 __mreactRememberPrefetchedScript(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 = __mreactCachedNavigationHtml(href);\n const script = __mreactRouteScriptForNavigationUrl(href);\n if (script !== undefined) {\n void __mreactPrefetchRouteScript(script);\n }\n const html = cachedHtml ?? await __mreactFetchNavigationHtml(href);\n\n if (typeof html !== \"string\") {\n return false;\n }\n\n __mreactRememberNavigationHtml(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 __mreactNavigationState.prefetchedUrls.delete(href);\n }\n }\n}\n\nfunction __mreactInvalidateAllNavigationCache() {\n __mreactNavigationState.cache.clear();\n __mreactNavigationState.prefetchedUrls.clear();\n}\n\nfunction __mreactFetchNavigationHtml(href) {\n const reloadRouteCache = __mreactNavigationState.reloadNextNavigationFetch === true;\n __mreactNavigationState.reloadNextNavigationFetch = false;\n const headers = reloadRouteCache\n ? { \"x-mreact-navigation\": \"1\", \"x-mreact-navigation-cache\": \"reload\" }\n : { \"x-mreact-navigation\": \"1\" };\n\n return fetch(href, {\n headers,\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 = typeof response?.headers?.get === \"function\"\n ? response.headers.get(\"x-mreact-revalidate\")\n : null;\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) {\n return false;\n }\n\n const html = typeof state.html === \"string\"\n ? state.html\n : typeof state.url === \"string\" ? __mreactNavigationState.cache.get(state.url) : undefined;\n\n if (typeof html !== \"string\") {\n return false;\n }\n\n const applied = __mreactApplyNavigationHtml(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(\"[${routeHydrationContract.routeMarkerAttribute}]\");\n const currentMarker = document.querySelector(\"[${routeHydrationContract.routeMarkerAttribute}]\");\n\n if (nextMarker === null || currentMarker === null) {\n return false;\n }\n\n const currentRouteId = currentMarker.getAttribute(\"${routeHydrationContract.routeMarkerAttribute}\");\n const nextRouteId = nextMarker.getAttribute(\"${routeHydrationContract.routeMarkerAttribute}\");\n\n __mreactMarkRouteHydrating();\n __mreactSyncHeadMetadata(template.content, html);\n if (!__mreactApplyNavigationShellHtml(currentMarker, nextMarker)) {\n __mreactUnmountCompatBoundaries(currentMarker);\n __mreactResumeNode(currentMarker, nextMarker);\n }\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)\n .then((module) => __mreactRunRouteHydration(() => module.${routeHydrationContract.routeHydrateExport}?.()))\n .catch((error) => {\n __mreactReportRouteHydrationError(error);\n throw error;\n });\n } else {\n __mreactMarkRouteHydrated();\n }\n\n __mreactApplyOutOfOrderFragments(document);\n __mreactObserveViewportPrefetchAnchors(document);\n\n return true;\n}\n\nfunction __mreactApplyNavigationShellHtml(currentMarker, nextMarker) {\n const target = __mreactNavigationShellSyncTarget(currentMarker, nextMarker);\n\n if (target === null) {\n return false;\n }\n\n __mreactUnmountCompatBoundaries(target.current);\n __mreactResumeNode(target.current, target.next);\n return true;\n}\n\nfunction __mreactNavigationShellSyncTarget(currentMarker, nextMarker) {\n const currentShells = __mreactMarkerShellAncestors(currentMarker);\n const nextShells = __mreactMarkerShellAncestors(nextMarker);\n const commonLength = Math.min(currentShells.length, nextShells.length);\n let commonIndex = -1;\n\n for (let index = 0; index < commonLength; index += 1) {\n if (!__mreactSameNavigationShellBoundary(currentShells[index], nextShells[index])) {\n break;\n }\n\n commonIndex = index;\n }\n\n if (commonIndex >= 0) {\n return __mreactNavigationShellDomTarget(currentShells[commonIndex], nextShells[commonIndex]);\n }\n\n if (currentShells.length === 0 || nextShells.length === 0) {\n return null;\n }\n\n const currentRoot = currentShells[0];\n const nextRoot = nextShells[0];\n\n if (currentRoot.tagName !== nextRoot.tagName) {\n return null;\n }\n\n return __mreactNavigationShellDomTarget(currentRoot, nextRoot);\n}\n\nfunction __mreactMarkerShellAncestors(marker) {\n const shells = [];\n let current = marker.parentElement;\n\n while (current !== null) {\n if (__mreactIsNavigationShellBoundary(current)) {\n shells.push(current);\n }\n\n current = current.parentElement;\n }\n\n shells.reverse();\n return shells;\n}\n\nfunction __mreactIsNavigationShellBoundary(element) {\n return element.hasAttribute(\"data-mreact-layout-boundary\") ||\n element.hasAttribute(\"data-mreact-template-boundary\");\n}\n\nfunction __mreactSameNavigationShellBoundary(current, next) {\n const currentKind = __mreactNavigationShellBoundaryKind(current);\n const nextKind = __mreactNavigationShellBoundaryKind(next);\n\n if (currentKind === null || currentKind !== nextKind || current.tagName !== next.tagName) {\n return false;\n }\n\n const attribute = currentKind === \"layout\"\n ? \"data-mreact-layout-boundary\"\n : \"data-mreact-template-boundary\";\n\n return current.getAttribute(attribute) === next.getAttribute(attribute);\n}\n\nfunction __mreactNavigationShellBoundaryKind(element) {\n if (element.hasAttribute(\"data-mreact-layout-boundary\")) {\n return \"layout\";\n }\n\n if (element.hasAttribute(\"data-mreact-template-boundary\")) {\n return \"template\";\n }\n\n return null;\n}\n\nfunction __mreactNavigationShellDomTarget(currentShell, nextShell) {\n if (currentShell.tagName === \"HTML\" && nextShell.tagName === \"HTML\") {\n const currentBody = currentShell.querySelector(\"body\");\n const nextBody = nextShell.querySelector(\"body\");\n\n if (currentBody !== null && nextBody !== null) {\n return { current: currentBody, next: nextBody };\n }\n }\n\n return { current: currentShell, next: nextShell };\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 id of managedIds) {\n document.getElementById(id)?.remove();\n const next = typeof root.getElementById === \"function\"\n ? root.getElementById(id)\n : root.querySelector(\\`#\\${id}\\`);\n\n if (next !== null && next !== undefined) {\n document.body.appendChild(next);\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(\\`${routeHydrationContract.propsScriptPrefix}\\${routeId}\\`);\n ids.add(\\`${routeHydrationContract.clientReferencesScriptPrefix}\\${routeId}\\`);\n }\n\n return ids;\n}\n\nfunction __mreactRouteDataScriptSelector() {\n return ${JSON.stringify(routeDataScriptSelector())};\n}\n\nfunction __mreactCurrentHistoryState(url) {\n return {\n __mreact: true,\n html: __mreactCurrentDocumentRouteHtml(),\n scrollX: Number(globalThis.scrollX ?? 0),\n scrollY: Number(globalThis.scrollY ?? 0),\n url,\n };\n}\n\nfunction __mreactCurrentDocumentRouteHtml() {\n if (typeof document === \"undefined\") {\n return undefined;\n }\n\n const marker = document.querySelector(\"[\" + __mreactRouteMarkerAttribute + \"]\");\n if (marker === null) {\n return undefined;\n }\n\n const routeDataScripts = Array.from(document.querySelectorAll(__mreactRouteDataScriptSelector()))\n .map((script) => script.outerHTML)\n .join(\"\");\n return marker.outerHTML + routeDataScripts;\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 __mreactIsSameOriginNavigationUrl(url) {\n if (typeof location === \"undefined\") {\n return true;\n }\n\n try {\n return new URL(url, location.href).origin === location.origin;\n } catch {\n return false;\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 __mreactIsCurrentLocationNavigationHref(href) {\n if (typeof location === \"undefined\") {\n return false;\n }\n\n return __mreactIsCurrentLocationNavigation(new URL(href, location.href));\n}\n\nfunction __mreactIsCurrentLocationNavigation(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}\n\nfunction __mreactInstallNavigation() {\n if (__mreactNavigationState.installed || typeof document === \"undefined\") {\n return;\n }\n\n __mreactNavigationState.installed = true;\n __mreactInstallNavigationFetchRevalidation();\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(\"submit\", (event) => {\n if (event.defaultPrevented || typeof fetch !== \"function\") {\n return;\n }\n\n const submission = __mreactServerActionSubmissionFromEvent(event);\n\n if (submission === null) {\n return;\n }\n\n event.preventDefault();\n void __mreactSubmitServerActionForm(submission).catch(() => {\n location.href = submission.action;\n });\n });\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 if (__mreactIsCurrentLocationNavigation(nextUrl)) {\n event.preventDefault();\n\n if (__mreactAnchorScrollMode(anchor) !== false && nextUrl.hash === \"\") {\n __mreactScrollTo(0, 0);\n }\n\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 __mreactServerActionSubmissionFromEvent(event) {\n const target = event.target;\n const form = target instanceof Element ? target.closest(\"form\") : null;\n const submitter = __mreactFormSubmitterFromEvent(event);\n\n if (!(form instanceof HTMLFormElement)) {\n return null;\n }\n\n const action = submitter?.getAttribute(\"formaction\") ?? form.action;\n const method = submitter?.getAttribute(\"formmethod\") ?? form.method;\n const targetName = submitter?.getAttribute(\"formtarget\") ?? form.target;\n const actionUrl = new URL(action, location.href);\n\n if (\n targetName !== \"\" ||\n actionUrl.origin !== location.origin ||\n actionUrl.pathname !== \"/_mreact/actions\" ||\n method.toUpperCase() !== \"POST\"\n ) {\n return null;\n }\n\n return { action: actionUrl.href, form, submitter };\n}\n\nfunction __mreactFormSubmitterFromEvent(event) {\n const submitter = event.submitter;\n\n return submitter instanceof HTMLElement ? submitter : null;\n}\n\nasync function __mreactSubmitServerActionForm(submission) {\n const response = await fetch(submission.action, {\n body: __mreactServerActionFormData(submission.form, submission.submitter),\n headers: { \"x-mreact-action-single-flight\": \"1\" },\n method: \"POST\",\n });\n __mreactApplyRevalidationHeader(response);\n\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n const singleFlight = response.headers.get(\"x-mreact-action-single-flight\") === \"1\";\n if (\n !singleFlight &&\n !contentType.includes(\"text/html\")\n ) {\n location.href = response.url || submission.action;\n return;\n }\n\n const html = await response.text();\n const applied = __mreactApplyServerActionHtml(html, singleFlight);\n\n if (!applied) {\n location.href = response.url || submission.action;\n }\n}\n\nfunction __mreactServerActionFormData(form, submitter) {\n if (submitter !== null) {\n try {\n return new FormData(form, submitter);\n } catch {\n // Older DOM implementations only accept the form argument.\n }\n }\n\n return new FormData(form);\n}\n\nfunction __mreactApplyServerActionHtml(html, singleFlight) {\n __mreactSaveCurrentHistoryState();\n const applied = __mreactApplyNavigationHtml(html, location.href);\n\n if (!applied) {\n if (\n !singleFlight ||\n typeof document === \"undefined\" ||\n typeof document.open !== \"function\"\n ) {\n return false;\n }\n\n document.open();\n document.write(html);\n document.close();\n return true;\n }\n\n __mreactResetNavigationFocus();\n __mreactAnnounceNavigation();\n return true;\n}\n\nfunction __mreactInstallNavigationFetchRevalidation() {\n if (\n __mreactNavigationState.fetchRevalidationInstalled ||\n typeof globalThis.fetch !== \"function\"\n ) {\n return;\n }\n\n __mreactNavigationState.fetchRevalidationInstalled = true;\n const fetchImpl = globalThis.fetch;\n globalThis.fetch = function(input, init) {\n const mutating = __mreactIsMutatingFetchRequest(input, init);\n\n return Promise.resolve(fetchImpl.call(this, input, init)).then((response) => {\n __mreactApplyRevalidationHeader(response);\n\n if (mutating) {\n __mreactInvalidateAllNavigationCache();\n __mreactNavigationState.reloadNextNavigationFetch = true;\n }\n\n return response;\n });\n };\n}\n\nfunction __mreactIsMutatingFetchRequest(input, init) {\n const method = __mreactFetchRequestMethod(input, init);\n\n return method !== \"GET\" && method !== \"HEAD\";\n}\n\nfunction __mreactFetchRequestMethod(input, init) {\n if (typeof init?.method === \"string\" && init.method !== \"\") {\n return init.method.toUpperCase();\n }\n\n if (typeof Request !== \"undefined\" && input instanceof Request) {\n return input.method.toUpperCase();\n }\n\n return \"GET\";\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 completionMarker = Array.from(root.querySelectorAll(\"[data-mreact-oob-complete]\"))\n .find((candidate) => candidate.getAttribute(\"data-mreact-oob-complete\") === id);\n\n if (completionMarker === undefined) {\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 completionMarker.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 const fallbackChildren = __mreactClientBoundaryFallbackChildren(placeholder, propsElement);\n\n if (fallbackChildren !== undefined) {\n props.children = fallbackChildren;\n }\n\n if (compat) {\n const parentContainer = __mreactClientBoundaryParentContainer(placeholder, propsElement);\n const container = parentContainer ?? document.createElement(\"span\");\n container.setAttribute(\"data-mreact-compat-boundary\", name ?? \"\");\n if (parentContainer === null) {\n container.style.display = \"contents\";\n placeholder.replaceWith(container);\n } else {\n placeholder.remove();\n }\n propsElement?.remove();\n const root = __mreactCompatCreateRoot(container);\n container.__mreactCompatRoot = root;\n root.render(__mreactCompatCreateElement(component, props));\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 __mreactClientBoundaryParentContainer(placeholder, propsElement) {\n const parent = placeholder.parentElement;\n\n if (parent === null) {\n return null;\n }\n\n for (const node of Array.from(parent.childNodes)) {\n if (node === placeholder || node === propsElement) {\n continue;\n }\n\n if (node.nodeType === Node.TEXT_NODE && (node.textContent ?? \"\").trim() === \"\") {\n continue;\n }\n\n return null;\n }\n\n return parent;\n}\n\nfunction __mreactUnmountCompatBoundaries(root) {\n const containers = [];\n\n if (\n root.nodeType === Node.ELEMENT_NODE &&\n root.hasAttribute(\"data-mreact-compat-boundary\")\n ) {\n containers.push(root);\n }\n\n if (typeof root.querySelectorAll === \"function\") {\n containers.push(...root.querySelectorAll(\"[data-mreact-compat-boundary]\"));\n }\n\n for (const container of containers) {\n const compatRoot = container.__mreactCompatRoot;\n\n if (compatRoot === undefined || typeof compatRoot.unmount !== \"function\") {\n continue;\n }\n\n compatRoot.unmount();\n container.__mreactCompatRoot = undefined;\n }\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 next = next.nextSibling;\n }\n\n return undefined;\n}\n\nfunction __mreactClientBoundaryFallbackChildren(placeholder, propsElement) {\n const nodes = [];\n let next = placeholder.nextSibling;\n\n while (next !== null && next !== propsElement) {\n const current = next;\n next = next.nextSibling;\n\n if (current.nodeType === Node.TEXT_NODE && (current.textContent ?? \"\").trim() === \"\") {\n current.remove();\n continue;\n }\n\n current.remove();\n nodes.push(current);\n }\n\n if (nodes.length === 0) {\n return undefined;\n }\n\n return nodes.length === 1 ? nodes[0] : nodes;\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 __mreactUnmountCompatBoundaries(current);\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 __mreactUnmountCompatBoundaries(current);\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 rawBindings = next.__mreactEventBindings;\n const bindings =\n rawBindings === undefined ? [] : Array.isArray(rawBindings) ? rawBindings : [rawBindings];\n\n if (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 const lastChild = current.lastChild;\n if (lastChild === null) {\n break;\n }\n __mreactUnmountCompatBoundaries(lastChild);\n 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 runtimePackageNames = [\n \"@reckona/mreact-reactive-core\",\n \"@reckona/mreact-reactive-dom\",\n \"@reckona/mreact-compat\",\n ];\n const runtimePaths = new Map([\n [\"react\", reactCompatPath],\n [\"react-dom\", reactCompatPath],\n [\"react-dom/client\", reactCompatPath],\n [\"react-dom/server\", reactCompatPath],\n [\n \"react/jsx-dev-runtime\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-dev-runtime\"),\n ],\n [\"react/jsx-runtime\", packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"jsx-runtime\")],\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/hooks\",\n packageFile(\"react-compat\", \"@reckona/mreact-compat\", \"hooks-entry\"),\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 [\"@reckona/mreact-reactive-dom\", reactiveDomPath],\n ]);\n\n return {\n name: \"mreact-workspace-runtime\",\n setup(buildApi: RouterCompatBuildApi) {\n buildApi.onResolve({ filter: /^\\.\\/devtools\\.js$/ }, (args) =>\n importerInRuntimePackage(\n args.importer,\n [reactiveCoreDir],\n [\"@reckona/mreact-reactive-core\"],\n )\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 importerInRuntimePackage(importer, runtimePackageDirs, runtimePackageNames)\n ? { path: reactiveCorePath }\n : {\n namespace: \"mreact-hot-runtime\",\n path: \"reactive-core\",\n };\n });\n buildApi.onResolve(\n {\n filter:\n /^(?:react(?:\\/jsx-(?:dev-)?runtime)?|react-dom(?:\\/(?:client|server))?|@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; }\nexport function currentReactiveDevtools() { 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\nfunction importerInRuntimePackage(\n importer: string | undefined,\n directories: readonly string[],\n packageNames: readonly string[],\n): boolean {\n if (importer === undefined) {\n return false;\n }\n\n const normalizedImporter = importer.split(/[\\\\/]+/).join(\"/\");\n return (\n directories.some((directory) => importer.startsWith(`${directory}${sep}`)) ||\n packageNames.some((packageName) => normalizedImporter.includes(`/node_modules/${packageName}/`))\n );\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 * AST-based so commented-out or string-literal occurrences of the pattern are\n * not mistaken for a real export.\n */\nexport function detectClientNavigationHint(source: string): boolean {\n return readTopLevelBooleanExport({ code: source, name: \"clientNavigation\" }) ?? true;\n}\n\n// `Link` ships from the dedicated `/link` subpath and is also re-exported from\n// the package root for backward compatibility, so both specifiers must count.\n// The root entry exports many bindings, so a root import only triggers the\n// navigation runtime when the rendered specifier is `Link` specifically.\nconst navigationLinkPackageSpecifiers = new Set([\n \"@reckona/mreact-router\",\n \"@reckona/mreact-router/link\",\n]);\n\nfunction staticImportsRenderLink(\n staticImports: readonly ClientRouteStaticImportReference[],\n renderedRoots: ReadonlySet<string>,\n renderedNames: ReadonlySet<string>,\n): boolean {\n return staticImports.some(\n (reference) =>\n navigationLinkPackageSpecifiers.has(reference.source) &&\n reference.specifiers.some(\n (specifier) =>\n (specifier.importedName === \"Link\" && renderedRoots.has(specifier.localName)) ||\n (specifier.kind === \"namespace\" && renderedNames.has(`${specifier.localName}.Link`)),\n ),\n );\n}\n\nfunction detectLinkComponentUsage(analysis: ClientRouteModuleAnalysis): boolean {\n // Use the export-reachable rendered roots, not the file-wide JSX roots, so a\n // `Link` rendered only in dead/unreachable code does not trigger the runtime.\n return staticImportsRenderLink(\n analysis.staticImports,\n new Set(analysis.reachableRenderedComponentRoots),\n new Set(analysis.reachableRenderedComponentNames),\n );\n}\n\n// Export names whose own render subtree (transitively, within this module)\n// renders a navigation `Link`. Lets callers attribute `Link` usage to the\n// specific export they render, so a barrel that re-exports both Link-using and\n// Link-free components only triggers the runtime for the ones actually rendered.\nfunction detectLinkComponentExportNames(analysis: ClientRouteModuleAnalysis): string[] {\n return Object.keys(analysis.reachableExportRenderedComponentRoots).filter((exportName) =>\n staticImportsRenderLink(\n analysis.staticImports,\n new Set(analysis.reachableExportRenderedComponentRoots[exportName] ?? []),\n new Set(analysis.reachableExportRenderedComponentNames[exportName] ?? []),\n ),\n );\n}\n\n// Reads the explicit `export const navigationRuntime = true | false` override.\n// Returns `undefined` when absent. AST-based so commented-out or string-literal\n// occurrences of the pattern are not mistaken for a real export.\nexport function detectNavigationRuntimeOverride(source: string): boolean | undefined {\n return readTopLevelBooleanExport({ code: source, name: \"navigationRuntime\" });\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 /from\\s+[\"']@reckona\\/mreact-reactive-core[\"']/.test(code) && /\\beffect\\s*\\(/.test(code);\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\n .replaceAll(\"&\", \"\\\\u0026\")\n .replaceAll(\"<\", \"\\\\u003c\")\n .replaceAll(\">\", \"\\\\u003e\")\n .replaceAll(\"\\u2028\", \"\\\\u2028\")\n .replaceAll(\"\\u2029\", \"\\\\u2029\");\n}\n"]}