resuxjs 0.4.0-beta.8 → 0.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["viteBuild","parseSfc","parseTemplate"],"sources":["../../src/compiler/index.ts"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, readdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { existsSync, statSync, writeFileSync, mkdirSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { NodeTypes, parse as parseTemplate, type AttributeNode, type DirectiveNode, type ElementNode, type Node as VueCompilerNode, type SimpleExpressionNode, type TemplateChildNode } from \"@vue/compiler-dom\";\nimport { compileStyle, parse as parseSfc, type SFCStyleBlock } from \"@vue/compiler-sfc\";\nimport vuePlugin from \"@vitejs/plugin-vue\";\nimport ts from \"typescript\";\nimport { build as viteBuild } from \"vite\";\nimport { createResux } from \"../core/resux.js\";\nimport { cspDirectiveSources } from \"../head/utils.js\";\nimport type { ResuxHooks } from \"../core/hooks.js\";\nimport { ResuxModuleContainer, type ResuxModuleContext as CoreResuxModuleContext, type ResuxModuleContributions } from \"../core/module-container.js\";\nimport { buildLocalePath, normalizeI18nRuntimeConfig, type ResuxI18nRuntimeConfig } from \"../i18n/shared.js\";\nimport { withResuxKitContext } from \"../kit/index.js\";\nimport { isPathWithinBoundary } from \"../security/path-boundary.js\";\nimport {\n getClientRuntimeSource,\n type ComponentStyle,\n type ElementTemplateNode,\n type PageMeta,\n type ResuxPackageMode,\n type ResuxPackagesConfig,\n type TemplateAttribute,\n type TemplateEvent,\n type TemplateNode,\n} from \"../runtime/index.js\";\n\nexport interface CompileErrorLocation {\n file: string;\n line: number;\n column: number;\n}\n\nexport class ResuxCompileError extends Error {\n readonly location?: CompileErrorLocation;\n\n constructor(message: string, location?: CompileErrorLocation) {\n super(location ? `${message} (${location.file}:${location.line}:${location.column})` : message);\n this.name = \"ResuxCompileError\";\n this.location = location;\n }\n}\n\nexport interface CompiledComponent {\n id: string;\n name: string;\n file: string;\n serverSource: string;\n clientSource: string;\n template: TemplateNode[];\n templateRefs?: string[];\n templateForRefs?: string[];\n handlers: string[];\n styles: ComponentStyle[];\n styleScopeId?: string;\n meta?: PageMeta;\n expressions?: { id: string; original: string; transformed: string; locals: string[] }[];\n}\n\nexport interface RouteManifestRecord {\n id: string;\n path: string;\n file: string;\n params: string[];\n componentId: string;\n meta?: PageMeta;\n}\n\nexport interface CompiledPlugin {\n id: string;\n file: string;\n mode: \"all\" | \"server\" | \"client\";\n serverSource: string;\n clientSource: string;\n}\n\nexport interface ClientEnhancementManifestEntry {\n name: string;\n id: string;\n file: string;\n src: string;\n}\n\nexport interface CompiledMiddleware {\n id: string;\n name: string;\n file: string;\n mode: \"all\" | \"server\" | \"client\";\n global: boolean;\n serverSource: string;\n clientSource: string;\n}\n\nexport interface CompiledServerMiddleware {\n id: string;\n file: string;\n source: string;\n}\n\nexport interface ServerHandlerRecord {\n id: string;\n path: string;\n file: string;\n params: string[];\n source: string;\n}\n\nexport interface VueIslandRecord {\n name: string;\n file: string;\n}\n\nexport interface RouteRuleConfig {\n headers?: Record<string, string>;\n redirect?: string | { to: string; statusCode?: number };\n statusCode?: number;\n cache?: false | string | { maxAge?: number; swr?: number };\n cors?: boolean | {\n origin?: string;\n methods?: string[];\n headers?: string[];\n credentials?: boolean;\n };\n}\n\nexport interface BuildResult {\n appRoot: string;\n outDir: string;\n routes: RouteManifestRecord[];\n components: CompiledComponent[];\n layouts: CompiledComponent[];\n plugins: CompiledPlugin[];\n clientEnhancements: ClientEnhancementManifestEntry[];\n middleware: CompiledMiddleware[];\n serverMiddleware: CompiledServerMiddleware[];\n serverHandlers: ServerHandlerRecord[];\n vueIslands: VueIslandRecord[];\n routeRules: Record<string, RouteRuleConfig>;\n contributions?: ResuxModuleContributions;\n app?: CompiledComponent;\n error?: CompiledComponent;\n}\n\nexport interface BuildOptions {\n vite?: \"build\" | \"dev\";\n server?: \"bundle\" | \"modules\";\n hooks?: ResuxHooks;\n changedPath?: string;\n traceBuild?: boolean;\n}\n\ninterface ScriptAnalysis {\n setupBody: string;\n imports: string;\n importDeclarations: (ts.ImportDeclaration | ts.ImportEqualsDeclaration)[];\n bindings: string[];\n handlerNames: Set<string>;\n resumableBindings: Set<string>;\n importedBindings: Set<string>;\n inlineHandlerLocals: Map<string, string[]>;\n templateRefBindings: Set<string>;\n handlers: Map<string, ts.Node>;\n sourceFile: ts.SourceFile;\n pageMeta?: PageMeta;\n}\n\ntype PackageUsageMode = \"all\" | \"client\" | \"server\";\n\ninterface PackageSourceFileInput {\n file: string;\n mode: PackageUsageMode;\n}\n\ninterface PackageManifestEntry {\n name: string;\n specifiers: string[];\n files: string[];\n modes: PackageUsageMode[];\n dynamic: boolean;\n cssImports: string[];\n missing: boolean;\n declaredMode: ResuxPackageMode;\n warnings: string[];\n}\n\ninterface ClientRuntimePackageRegistry {\n importers: string[];\n cssByPackage: Record<string, string[]>;\n declared: string[];\n}\n\ninterface CompileTemplateState {\n file: string;\n templateRefBindings: Set<string>;\n templateRefs: Set<string>;\n bindingIndex: number;\n inlineHandlerIndex: number;\n handlers: TemplateEvent[];\n inlineHandlers: GeneratedHandler[];\n expressions: { id: string; original: string; transformed: string; locals: string[] }[];\n activeLocals: string[];\n allLocals: Set<string>;\n}\n\ninterface GeneratedHandler {\n name: string;\n source: string;\n locals?: string[];\n}\n\ninterface CompileTemplateNodeOptions {\n ifExpressionOverride?: string;\n}\n\ninterface ConditionalDirectiveInfo {\n kind: \"if\" | \"else-if\" | \"else\";\n directive: DirectiveNode;\n expression?: string;\n}\n\ntype ResuxConfig = Record<string, unknown> & {\n app?: { head?: unknown };\n css?: unknown;\n i18n?: unknown;\n packages?: unknown;\n video?: unknown;\n modules?: unknown;\n deploy?: {\n target?: \"auto\" | \"node\" | \"vercel\" | \"netlify\" | \"cloudflare\" | \"static\";\n nitroPreset?: string;\n };\n routeRules?: Record<string, RouteRuleConfig>;\n runtimeConfig?: Record<string, unknown>;\n};\n\ntype ResuxModuleContext = CoreResuxModuleContext;\n\ntype ResuxModuleSetup = (options: unknown, context: ResuxModuleContext) => unknown | Promise<unknown>;\n\ninterface BuiltinResuxModule {\n defaults?: Record<string, unknown>;\n setup: ResuxModuleSetup;\n}\n\nexport const RESUMABLE_HANDLER_ALLOWED_GLOBALS = new Set([\n \"Math\",\n \"Number\",\n \"String\",\n \"Boolean\",\n \"Array\",\n \"Object\",\n \"Date\",\n \"JSON\",\n \"Intl\",\n \"Promise\",\n \"console\",\n \"undefined\",\n \"globalThis\",\n \"window\",\n \"document\",\n \"navigator\",\n \"localStorage\",\n \"sessionStorage\",\n \"location\",\n \"history\",\n \"alert\",\n \"performance\",\n \"fetch\",\n \"Headers\",\n \"Request\",\n \"Response\",\n \"URL\",\n \"URLSearchParams\",\n \"AbortController\",\n \"setTimeout\",\n \"clearTimeout\",\n \"setInterval\",\n \"clearInterval\",\n \"queueMicrotask\",\n \"ref\",\n \"reactive\",\n \"computed\",\n \"watch\",\n \"watchEffect\",\n \"readonly\",\n \"toRef\",\n \"toRefs\",\n \"unref\",\n \"isRef\",\n \"isReactive\",\n \"isReadonly\",\n \"nextTick\",\n \"useState\",\n \"useGlobalState\",\n \"useAsyncData\",\n \"useRoute\",\n \"useRouter\",\n \"useHead\",\n \"useSeoMeta\",\n \"useRuntimeConfig\",\n \"useResuxApp\",\n \"useResuxImage\",\n \"useI18n\",\n \"useLocalePath\",\n \"useSwitchLocalePath\",\n \"useDevice\",\n \"$device\",\n \"apiURL\",\n \"useFetch\",\n \"$fetch\",\n \"useError\",\n \"clearError\",\n \"showError\",\n \"createError\",\n \"useLazyPackage\",\n \"useClientPackage\",\n \"usePackageReady\",\n \"defineLazyPackage\",\n \"defineClientOnlyPackage\",\n \"definePackageAdapter\",\n \"defineClientEnhancement\",\n \"useClientEnhancement\",\n \"onMounted\",\n \"definePageMeta\",\n \"defineProps\"\n]);\n\nconst BUILTIN_AUTO_IMPORTS: Array<{ from: string; name: string; as?: string }> = [\n { from: \"resuxjs\", name: \"useRoute\" },\n { from: \"resuxjs\", name: \"useRouter\" },\n { from: \"resuxjs\", name: \"useLocalePath\" },\n { from: \"resuxjs\", name: \"useSwitchLocalePath\" },\n { from: \"resuxjs\", name: \"useI18n\" },\n { from: \"resuxjs\", name: \"useResuxApp\" },\n { from: \"resuxjs\", name: \"useDevice\" },\n { from: \"resuxjs\", name: \"navigateTo\" },\n { from: \"resuxjs\", name: \"abortNavigation\" },\n { from: \"resuxjs\", name: \"useHead\" },\n { from: \"resuxjs\", name: \"useSeoMeta\" },\n { from: \"resuxjs\", name: \"useRuntimeConfig\" },\n { from: \"resuxjs\", name: \"useState\" },\n { from: \"resuxjs\", name: \"useGlobalState\" },\n { from: \"resuxjs\", name: \"useFetch\" },\n { from: \"resuxjs\", name: \"useAsyncData\" },\n { from: \"resuxjs\", name: \"$fetch\" },\n { from: \"resuxjs\", name: \"useError\" },\n { from: \"resuxjs\", name: \"clearError\" },\n { from: \"resuxjs\", name: \"showError\" },\n { from: \"resuxjs\", name: \"createError\" },\n { from: \"resuxjs\", name: \"useLazyPackage\" },\n { from: \"resuxjs\", name: \"useClientPackage\" },\n { from: \"resuxjs\", name: \"usePackageReady\" },\n { from: \"resuxjs\", name: \"defineLazyPackage\" },\n { from: \"resuxjs\", name: \"defineClientOnlyPackage\" },\n { from: \"resuxjs\", name: \"definePackageAdapter\" },\n { from: \"resuxjs\", name: \"defineClientEnhancement\" },\n { from: \"resuxjs\", name: \"useClientEnhancement\" }\n];\n\nconst SUPPORT_CLIENT_RUNTIME_HELPERS = [\n \"useLazyPackage\",\n \"useClientPackage\",\n \"usePackageReady\",\n \"defineLazyPackage\",\n \"defineClientOnlyPackage\",\n \"definePackageAdapter\",\n \"defineClientEnhancement\",\n \"useClientEnhancement\",\n] as const;\n\nconst CLIENT_ENHANCEMENT_DIR_CANDIDATES = [\n \"client-enhancements\",\n \"enhancements\",\n path.join(\"app\", \"client-enhancements\"),\n path.join(\"app\", \"enhancements\"),\n] as const;\n\ninterface SupportModuleTranspileOptions {\n prefix?: string;\n autoImports?: Array<{ from: string; names: readonly string[] }>;\n rewriteImports?: Record<string, string>;\n}\n\nexport async function buildProject(appRoot: string, outDir = path.join(appRoot, \".resux\"), options: BuildOptions = {}): Promise<BuildResult> {\n const absoluteRoot = path.resolve(appRoot);\n const absoluteOut = path.resolve(outDir);\n const buildOptions = {\n vite: options.vite ?? \"build\",\n server: options.server ?? (options.vite === \"dev\" ? \"modules\" : \"bundle\"),\n hooks: options.hooks,\n traceBuild: options.traceBuild === true\n };\n const mode = buildOptions.vite === \"dev\" ? \"dev\" : \"build\";\n const incrementalDevBuild = mode === \"dev\" && typeof options.changedPath === \"string\" && options.changedPath.length > 0;\n const hooks = buildOptions.hooks ?? createResux({ rootDir: absoluteRoot, buildDir: absoluteOut, config: {} }).hooks;\n\n try {\n await hooks.callHook(\"build:before\", { appRoot: absoluteRoot, outDir: absoluteOut, mode });\n if (!incrementalDevBuild) {\n await cleanGeneratedOutput(absoluteOut);\n }\n await ensureGeneratedDirs(absoluteOut, buildOptions.vite === \"dev\");\n\n const { config: runtimeConfig, moduleContainer } = await readRuntimeConfig(absoluteRoot, absoluteOut, hooks);\n const contributions = moduleContainer.contributions;\n await hooks.callHook(\"config:resolved\", { rootDir: absoluteRoot, buildDir: absoluteOut, config: runtimeConfig });\n await hooks.callHook(\"app:resolve\", { appRoot: absoluteRoot, outDir: absoluteOut });\n\n const routeRules = createRouteRules(runtimeConfig);\n const componentDirs = unique([\n path.join(absoluteRoot, \"components\"),\n path.join(absoluteRoot, \"app\", \"components\"),\n ...contributions.componentDirs.map((entry) => path.resolve(absoluteRoot, entry.path))\n ]);\n await hooks.callHook(\"components:dirs\", { dirs: componentDirs });\n const componentFiles = await discoverVueFilesFromDirs(componentDirs);\n componentFiles.push(...contributions.components.map((entry) => path.resolve(absoluteRoot, entry.file)));\n const uniqueComponentFiles = unique(componentFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n\n const pageFiles = await discoverAppVueFiles(absoluteRoot, \"pages\");\n const layoutFiles = await discoverAppVueFiles(absoluteRoot, \"layouts\");\n const appFile = await optionalFile(path.join(absoluteRoot, \"app.vue\"))\n ?? await optionalFile(path.join(absoluteRoot, \"app\", \"app.vue\"));\n const errorFile = await optionalFile(path.join(absoluteRoot, \"error.vue\"))\n ?? await optionalFile(path.join(absoluteRoot, \"app\", \"error.vue\"));\n\n const pluginDirs = [\n path.join(absoluteRoot, \"plugins\"),\n path.join(absoluteRoot, \"app\", \"plugins\"),\n path.join(absoluteRoot, \"enhancements\"),\n path.join(absoluteRoot, \"client-enhancements\"),\n path.join(absoluteRoot, \"app\", \"enhancements\"),\n path.join(absoluteRoot, \"app\", \"client-enhancements\"),\n ];\n await hooks.callHook(\"plugins:dirs\", { dirs: pluginDirs });\n const pluginFiles = await discoverSupportTsFiles(absoluteRoot, \"plugins\");\n const modulePluginEntries = contributions.plugins.map((entry) => ({\n file: path.resolve(absoluteRoot, entry.src),\n mode: entry.mode ?? \"all\"\n }));\n const pluginModeByFile = new Map<string, \"all\" | \"server\" | \"client\">();\n for (const entry of modulePluginEntries) {\n pluginModeByFile.set(entry.file, entry.mode);\n pluginFiles.push(entry.file);\n }\n const clientEnhancementFiles = await discoverClientEnhancementFiles(absoluteRoot);\n for (const file of clientEnhancementFiles) {\n if (!pluginModeByFile.has(file)) {\n pluginModeByFile.set(file, \"client\");\n }\n pluginFiles.push(file);\n }\n const clientEnhancementFileSet = new Set(\n clientEnhancementFiles.map((file) => normalizePath(path.resolve(file))),\n );\n\n const middlewareDirs = [path.join(absoluteRoot, \"middleware\"), path.join(absoluteRoot, \"app\", \"middleware\")];\n await hooks.callHook(\"middleware:dirs\", { dirs: middlewareDirs });\n const middlewareFiles = await discoverSupportTsFiles(absoluteRoot, \"middleware\");\n const moduleMiddlewareEntries = contributions.middleware.map((entry) => ({\n file: path.resolve(absoluteRoot, entry.src),\n mode: entry.mode ?? \"all\",\n global: entry.global === true,\n name: entry.name\n }));\n const middlewareMetaByFile = new Map<string, { mode: \"all\" | \"server\" | \"client\"; global: boolean; name: string }>();\n for (const entry of moduleMiddlewareEntries) {\n middlewareMetaByFile.set(entry.file, entry);\n middlewareFiles.push(entry.file);\n }\n\n const serverMiddlewareFiles = await discoverSupportTsFiles(absoluteRoot, path.join(\"server\", \"middleware\"));\n const serverHandlerFiles = [\n ...await discoverServerFiles(path.join(absoluteRoot, \"server\", \"api\"), \"/api\"),\n ...await discoverServerFiles(path.join(absoluteRoot, \"server\", \"routes\"), \"\")\n ];\n for (const handler of contributions.serverHandlers) {\n serverHandlerFiles.push({\n file: path.resolve(absoluteRoot, handler.handler),\n path: normalizeRoutePath(handler.route)\n });\n }\n\n const vueIslands = await discoverVueIslands(absoluteRoot);\n const allFiles = [...uniqueComponentFiles, ...layoutFiles, ...pageFiles, ...(appFile ? [appFile] : []), ...(errorFile ? [errorFile] : [])];\n const idByFile = new Map<string, string>();\n const compiledByFile = new Map<string, CompiledComponent>();\n let index = 0;\n\n for (const file of allFiles) {\n idByFile.set(file, `m${index++}`);\n }\n\n for (const file of allFiles) {\n const component = await compileVueFile(file, {\n id: idByFile.get(file)!,\n name: inferComponentName(absoluteRoot, file, componentDirs),\n outDir: absoluteOut\n });\n compiledByFile.set(file, component);\n await writeFile(path.join(absoluteOut, \"server\", `${component.id}.mjs`), component.serverSource, \"utf8\");\n await writeFile(path.join(absoluteOut, \"vite-client\", \"handlers\", `${component.id}.mjs`), component.clientSource, \"utf8\");\n }\n\n const baseRoutes = createRouteManifest(absoluteRoot, pageFiles, idByFile, compiledByFile);\n for (const extender of contributions.pagesExtenders) {\n await extender(baseRoutes as unknown as Array<Record<string, unknown>>);\n }\n await hooks.callHook(\"pages:extend\", { pages: baseRoutes as unknown as Array<Record<string, unknown>> });\n const routes = localizeRouteManifest(baseRoutes, runtimeConfig);\n await hooks.callHook(\"pages:resolved\", { pages: routes as unknown as Array<Record<string, unknown>> });\n\n const components = allFiles.map((file) => compiledByFile.get(file)!);\n const layouts = layoutFiles.map((file) => compiledByFile.get(file)!);\n const plugins = unique(pluginFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right))).map((file, pluginIndex) => {\n const compiled = compilePluginFile(file, pluginIndex);\n const mode = pluginModeByFile.get(file);\n if (mode) {\n compiled.mode = mode;\n }\n return compiled;\n });\n const clientEnhancements = plugins\n .filter((plugin) => (\n plugin.mode !== \"server\"\n && clientEnhancementFileSet.has(normalizePath(path.resolve(plugin.file)))\n ))\n .map((plugin) => ({\n name: supportFileBaseName(plugin.file),\n id: plugin.id,\n file: plugin.file,\n src: `/__resux/plugins/${plugin.id}.mjs`,\n }))\n .sort((left, right) => left.name.localeCompare(right.name) || normalizePath(left.file).localeCompare(normalizePath(right.file)));\n const middleware = unique(middlewareFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right))).map((file, middlewareIndex) => {\n const compiled = compileMiddlewareFile(file, middlewareIndex);\n const meta = middlewareMetaByFile.get(file);\n if (meta) {\n compiled.mode = meta.mode;\n compiled.global = meta.global;\n compiled.name = kebabCase(meta.name);\n }\n return compiled;\n });\n const serverMiddleware = serverMiddlewareFiles.map((file, middlewareIndex) => compileServerMiddlewareFile(file, middlewareIndex));\n const serverHandlers = uniqueServerHandlers(serverHandlerFiles).map((record, handlerIndex) => compileServerHandlerFile(record.file, handlerIndex, record.path));\n const app = appFile ? compiledByFile.get(appFile) : undefined;\n const error = errorFile ? compiledByFile.get(errorFile) : undefined;\n await hooks.callHook(\"components:extend\", { components: components as unknown as Array<Record<string, unknown>> });\n await hooks.callHook(\"plugins:extend\", { plugins: plugins as unknown as Array<Record<string, unknown>> });\n await hooks.callHook(\"middleware:extend\", { middleware: middleware as unknown as Array<Record<string, unknown>> });\n\n for (const plugin of plugins) {\n if (plugin.mode !== \"client\") {\n await writeFile(path.join(absoluteOut, \"server\", \"resux-plugins\", `${plugin.id}.mjs`), plugin.serverSource, \"utf8\");\n }\n if (plugin.mode !== \"server\") {\n await writeFile(path.join(absoluteOut, \"vite-client\", \"plugins\", `${plugin.id}.mjs`), plugin.clientSource, \"utf8\");\n }\n }\n await writeClientEnhancementManifests(absoluteOut, clientEnhancements);\n\n for (const entry of middleware) {\n if (entry.mode !== \"client\") {\n await writeFile(path.join(absoluteOut, \"server\", \"resux-middleware\", `${entry.id}.mjs`), entry.serverSource, \"utf8\");\n }\n if (entry.mode !== \"server\") {\n await writeFile(path.join(absoluteOut, \"vite-client\", \"middleware\", `${entry.id}.mjs`), entry.clientSource, \"utf8\");\n }\n }\n\n for (const entry of serverMiddleware) {\n await writeFile(path.join(absoluteOut, \"server\", \"request-middleware\", `${entry.id}.mjs`), entry.source, \"utf8\");\n }\n\n for (const handler of serverHandlers) {\n await writeFile(path.join(absoluteOut, \"server\", \"handlers\", `${handler.id}.mjs`), handler.source, \"utf8\");\n }\n\n for (const island of vueIslands) {\n const islandEntryDir = path.join(absoluteOut, \"vite-client\", \"vue-islands\");\n await writeFile(path.join(islandEntryDir, `${island.name}.mjs`), createVueIslandClientSource(island, islandEntryDir), \"utf8\");\n }\n\n const importDirs = unique([\n path.join(absoluteRoot, \"composables\"),\n path.join(absoluteRoot, \"utils\"),\n path.join(absoluteRoot, \"shared\"),\n path.join(absoluteRoot, \"server\", \"utils\"),\n ...contributions.importDirs.map((dir) => path.resolve(absoluteRoot, dir))\n ]);\n await hooks.callHook(\"imports:dirs\", { dirs: importDirs });\n const discoveredAutoImports = await discoverAutoImportsFromDirs(absoluteRoot, importDirs);\n const mergedImports = dedupeImports([...contributions.imports, ...discoveredAutoImports]);\n await hooks.callHook(\"imports:extend\", { imports: mergedImports as unknown as Array<Record<string, unknown>> });\n await hooks.callHook(\"app:templates\", { outDir: absoluteOut, templatesDir: path.join(absoluteOut, \"templates\") });\n const generatedTemplateFiles = await writeModuleTemplates(absoluteOut, contributions);\n await hooks.callHook(\"app:templatesGenerated\", { outDir: absoluteOut, files: generatedTemplateFiles });\n\n const additionalSharedPackageFiles = unique([\n ...await discoverSupportTsFiles(absoluteRoot, \"composables\"),\n ...await discoverSupportTsFiles(absoluteRoot, \"utils\"),\n ...await discoverSupportTsFiles(absoluteRoot, \"shared\"),\n ]);\n const additionalServerPackageFiles = unique([\n ...await discoverSupportTsFiles(absoluteRoot, path.join(\"server\", \"utils\")),\n ...await discoverSupportTsFiles(absoluteRoot, path.join(\"server\", \"plugins\")),\n ]);\n const packageSources: PackageSourceFileInput[] = uniquePackageSourceFiles([\n ...components.map((component) => ({ file: component.file, mode: \"all\" as const })),\n ...plugins.map((plugin) => ({ file: plugin.file, mode: plugin.mode as PackageUsageMode })),\n ...middleware.map((entry) => ({ file: entry.file, mode: entry.mode as PackageUsageMode })),\n ...serverMiddleware.map((entry) => ({ file: entry.file, mode: \"server\" as const })),\n ...serverHandlers.map((entry) => ({ file: entry.file, mode: \"server\" as const })),\n ...additionalSharedPackageFiles.map((file) => ({ file, mode: \"all\" as const })),\n ...additionalServerPackageFiles.map((file) => ({ file, mode: \"server\" as const })),\n ]);\n const packageDiagnostics = await analyzePackageUsage(\n absoluteRoot,\n packageSources,\n runtimeConfig,\n );\n const packageRegistry = createClientRuntimePackageRegistry(\n absoluteRoot,\n readConfiguredPackages(runtimeConfig),\n packageDiagnostics,\n );\n const buildCompatibilityId = createBuildCompatibilityId({\n runtimeConfig,\n routes,\n components,\n plugins,\n middleware,\n serverMiddleware,\n serverHandlers,\n packages: packageDiagnostics,\n });\n injectRuntimeBuildCompatibilityId(runtimeConfig, buildCompatibilityId);\n\n if (buildOptions.vite === \"dev\") {\n await writeViteClientRuntime(absoluteOut, packageRegistry);\n await hooks.callHook(\"vite:compiled\", { outDir: absoluteOut, dev: true });\n } else {\n await buildClientAssets(\n absoluteRoot,\n absoluteOut,\n components,\n plugins,\n middleware,\n vueIslands,\n packageRegistry,\n hooks,\n contributions,\n );\n await hooks.callHook(\"vite:compiled\", { outDir: absoluteOut, dev: false });\n }\n await ensureServerComponentModules(absoluteOut, components);\n\n const runtimeArtifacts = buildRuntimeArtifacts({\n routes,\n components,\n layouts,\n plugins,\n clientEnhancements,\n middleware,\n serverMiddleware,\n serverHandlers,\n vueIslands,\n app,\n error,\n runtimeConfig,\n routeRules,\n packages: packageDiagnostics,\n buildOptions: { vite: buildOptions.vite, server: buildOptions.server },\n contributions: {\n ...contributions,\n imports: mergedImports\n }\n });\n\n await hooks.callHook(\"build:manifest\", { manifest: runtimeArtifacts.manifest as Record<string, unknown>, outDir: absoluteOut });\n await writeFile(\n path.join(absoluteOut, \"server\", \"manifest.mjs\"),\n createServerManifestSource(routes, components, layouts, plugins, middleware, serverMiddleware, serverHandlers, vueIslands, app, error, runtimeConfig, buildOptions, absoluteRoot),\n \"utf8\"\n );\n await writeGeneratedArtifacts(absoluteOut, runtimeArtifacts, buildOptions.vite === \"dev\");\n await hooks.callHook(\"prepare:types\", {\n outDir: absoluteOut,\n files: [\n path.join(absoluteOut, \"resux.d.ts\"),\n path.join(absoluteOut, \"imports.d.ts\"),\n path.join(absoluteOut, \"components.d.ts\"),\n path.join(absoluteOut, \"server-routes.d.ts\")\n ]\n });\n\n if (buildOptions.server === \"bundle\") {\n await buildServerBundle(absoluteRoot, absoluteOut);\n }\n\n await hooks.callHook(\"build:done\", { appRoot: absoluteRoot, outDir: absoluteOut, mode });\n return {\n appRoot: absoluteRoot,\n outDir: absoluteOut,\n routes,\n components,\n layouts,\n plugins,\n clientEnhancements,\n middleware,\n serverMiddleware,\n serverHandlers,\n vueIslands,\n routeRules,\n contributions,\n app,\n error\n };\n } catch (error) {\n await hooks.callHook(\"build:error\", { appRoot: absoluteRoot, outDir: absoluteOut, mode, error });\n throw error;\n }\n}\n\nfunction createBuildCompatibilityId(input: {\n runtimeConfig: Record<string, unknown>;\n routes: RouteManifestRecord[];\n components: CompiledComponent[];\n plugins: CompiledPlugin[];\n middleware: CompiledMiddleware[];\n serverMiddleware: CompiledServerMiddleware[];\n serverHandlers: ServerHandlerRecord[];\n packages: PackageManifestEntry[];\n}): string {\n const hash = createHash(\"sha256\");\n hash.update(\"resux-build-compatibility-v1\\0\");\n hash.update(getClientRuntimeSource());\n hash.update(JSON.stringify(input.runtimeConfig));\n hash.update(JSON.stringify(input.routes.map(({ id, path: routePath, params, componentId, meta }) => ({ id, path: routePath, params, componentId, meta }))));\n for (const component of input.components) {\n hash.update(component.id);\n hash.update(component.serverSource);\n hash.update(component.clientSource);\n }\n for (const plugin of input.plugins) {\n hash.update(plugin.id);\n hash.update(plugin.serverSource);\n hash.update(plugin.clientSource);\n }\n for (const entry of input.middleware) {\n hash.update(entry.id);\n hash.update(entry.serverSource);\n hash.update(entry.clientSource);\n }\n for (const entry of input.serverMiddleware) {\n hash.update(entry.id);\n hash.update(entry.source);\n }\n for (const entry of input.serverHandlers) {\n hash.update(entry.id);\n hash.update(entry.source);\n }\n hash.update(JSON.stringify(input.packages));\n return hash.digest(\"hex\").slice(0, 24);\n}\n\nfunction injectRuntimeBuildCompatibilityId(runtimeConfig: Record<string, unknown>, buildId: string): void {\n const configuredRuntime = isPlainObject(runtimeConfig.runtimeConfig)\n ? runtimeConfig.runtimeConfig\n : {};\n const publicConfig = isPlainObject(configuredRuntime.public)\n ? configuredRuntime.public\n : {};\n configuredRuntime.public = {\n ...publicConfig,\n __resuxBuildId: buildId,\n };\n runtimeConfig.runtimeConfig = configuredRuntime;\n}\n\nasync function cleanGeneratedOutput(outDir: string): Promise<void> {\n const directoryRmOptions = {\n recursive: true,\n force: true,\n maxRetries: 6,\n retryDelay: 40,\n } as const;\n await mkdir(outDir, { recursive: true });\n await rm(path.join(outDir, \"server\"), directoryRmOptions);\n await rm(path.join(outDir, \"server-bundle\"), directoryRmOptions);\n await rm(path.join(outDir, \"client\"), directoryRmOptions);\n await rm(path.join(outDir, \"vite-client\"), directoryRmOptions);\n await rm(path.join(outDir, \"manifest\"), directoryRmOptions);\n await rm(path.join(outDir, \"types\"), directoryRmOptions);\n await rm(path.join(outDir, \"cache\"), directoryRmOptions);\n await rm(path.join(outDir, \"dev\"), directoryRmOptions);\n await rm(path.join(outDir, \"templates\"), directoryRmOptions);\n await rm(path.join(outDir, \"app.mjs\"), { force: true });\n await rm(path.join(outDir, \"routes.mjs\"), { force: true });\n await rm(path.join(outDir, \"plugins.mjs\"), { force: true });\n await rm(path.join(outDir, \"middleware.mjs\"), { force: true });\n await rm(path.join(outDir, \"components.mjs\"), { force: true });\n await rm(path.join(outDir, \"imports.mjs\"), { force: true });\n await rm(path.join(outDir, \"resux.d.ts\"), { force: true });\n await rm(path.join(outDir, \"imports.d.ts\"), { force: true });\n await rm(path.join(outDir, \"components.d.ts\"), { force: true });\n await rm(path.join(outDir, \"server-routes.d.ts\"), { force: true });\n await rm(path.join(outDir, \"manifest.json\"), { force: true });\n await rm(path.join(outDir, \"client-enhancements.mjs\"), { force: true });\n}\n\nasync function ensureGeneratedDirs(outDir: string, _dev: boolean): Promise<void> {\n await mkdir(path.join(outDir, \"server\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"resux-plugins\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"resux-middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"request-middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"handlers\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"config-modules\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"handlers\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"vue-islands\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"plugins\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"handlers\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"vue-islands\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"plugins\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"manifest\"), { recursive: true });\n await mkdir(path.join(outDir, \"types\"), { recursive: true });\n await mkdir(path.join(outDir, \"cache\"), { recursive: true });\n await mkdir(path.join(outDir, \"templates\"), { recursive: true });\n await mkdir(path.join(outDir, \"dev\"), { recursive: true });\n}\n\nasync function buildServerBundle(root: string, outDir: string): Promise<void> {\n try {\n await viteBuild({\n root,\n configFile: false,\n publicDir: false,\n appType: \"custom\",\n clearScreen: false,\n logLevel: \"warn\",\n build: {\n ssr: path.join(outDir, \"server\", \"manifest.mjs\"),\n outDir: path.join(outDir, \"server-bundle\"),\n emptyOutDir: true,\n minify: \"oxc\",\n sourcemap: false,\n manifest: false,\n rollupOptions: {\n external: (id: string) => {\n if (id === \"resuxjs\" || id.startsWith(\"resuxjs/\")) return true;\n if (id.includes(\"node_modules\") || (!id.startsWith(\".\") && !path.isAbsolute(id))) return true;\n return false;\n },\n output: {\n format: \"es\",\n entryFileNames: \"index.mjs\",\n chunkFileNames: \"chunks/[name]-[hash].mjs\"\n }\n }\n }\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Vite server build failed. Ensure vite is installed. ${message}`);\n }\n}\n\nasync function buildClientAssets(\n root: string,\n outDir: string,\n components: CompiledComponent[],\n plugins: CompiledPlugin[],\n middleware: CompiledMiddleware[],\n vueIslands: VueIslandRecord[],\n packageRegistry: ClientRuntimePackageRegistry,\n hooks?: ResuxHooks,\n contributions?: ResuxModuleContributions\n): Promise<void> {\n const inputRoot = path.join(outDir, \"vite-client\");\n const runtimeInput = await writeViteClientRuntime(outDir, packageRegistry);\n\n const input: Record<string, string> = {\n \"runtime-client\": runtimeInput\n };\n\n for (const component of components) {\n input[`handlers/${component.id}`] = path.join(inputRoot, \"handlers\", `${component.id}.mjs`);\n }\n\n for (const plugin of plugins.filter((entry) => entry.mode !== \"server\")) {\n input[`plugins/${plugin.id}`] = path.join(inputRoot, \"plugins\", `${plugin.id}.mjs`);\n }\n\n for (const entry of middleware.filter((candidate) => candidate.mode !== \"server\")) {\n input[`middleware/${entry.id}`] = path.join(inputRoot, \"middleware\", `${entry.id}.mjs`);\n }\n\n for (const island of vueIslands) {\n input[`vue-islands/${island.name}`] = path.join(inputRoot, \"vue-islands\", `${island.name}.mjs`);\n }\n\n try {\n const viteConfig: Record<string, unknown> = {\n root,\n configFile: false,\n publicDir: false,\n base: \"/__resux/\",\n appType: \"custom\",\n clearScreen: false,\n logLevel: \"warn\",\n plugins: [vuePlugin(), ...(contributions?.vitePlugins ?? [])],\n resolve: {\n alias: {\n vue: require.resolve(\"vue\"),\n \"@\": normalizePath(root),\n \"~\": normalizePath(root)\n }\n },\n build: {\n outDir: path.join(outDir, \"client\"),\n emptyOutDir: false,\n minify: \"oxc\",\n sourcemap: false,\n manifest: false,\n rollupOptions: {\n input,\n preserveEntrySignatures: \"strict\",\n external: (id: string) => id === \"/__resux/runtime-client.mjs\",\n output: {\n format: \"es\",\n entryFileNames: \"[name].mjs\",\n chunkFileNames: \"chunks/[name]-[hash].mjs\",\n assetFileNames: \"assets/[name]-[hash][extname]\"\n }\n }\n }\n };\n console.log(\"resux build client viteConfig:\", JSON.stringify(viteConfig, null, 2));\n for (const extender of contributions?.viteConfigExtenders ?? []) {\n await extender(viteConfig);\n }\n if (hooks) {\n await hooks.callHook(\"vite:extendConfig\", { config: viteConfig, dev: false });\n }\n await viteBuild(viteConfig as Parameters<typeof viteBuild>[0]);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Vite client build failed. Ensure vite is installed. ${message}`);\n } finally {\n await rm(inputRoot, { recursive: true, force: true });\n }\n}\n\nasync function writeViteClientRuntime(\n outDir: string,\n packageRegistry: ClientRuntimePackageRegistry,\n): Promise<string> {\n const runtimeInput = path.join(outDir, \"vite-client\", \"runtime-client.mjs\");\n await writeFile(\n runtimeInput,\n getClientRuntimeSource({\n packageRegistry: {\n importers: packageRegistry.importers,\n css: packageRegistry.cssByPackage,\n declared: packageRegistry.declared,\n },\n }),\n \"utf8\",\n );\n return runtimeInput;\n}\n\nfunction createClientEnhancementManifestSource(entries: ClientEnhancementManifestEntry[]): string {\n const imports = entries\n .map((entry) => `import ${JSON.stringify(entry.src)};`)\n .join(\"\\n\");\n const names = [...new Set(entries.map((entry) => entry.name))];\n if (imports) {\n return `${imports}\\n\\nexport const clientEnhancements = ${JSON.stringify(names, null, 2)};\\n`;\n }\n return `export const clientEnhancements = ${JSON.stringify(names, null, 2)};\\n`;\n}\n\nasync function writeClientEnhancementManifests(\n outDir: string,\n entries: ClientEnhancementManifestEntry[],\n): Promise<void> {\n const source = createClientEnhancementManifestSource(entries);\n await writeFile(path.join(outDir, \"client-enhancements.mjs\"), source, \"utf8\");\n await writeFile(path.join(outDir, \"vite-client\", \"client-enhancements.mjs\"), source, \"utf8\");\n await writeFile(path.join(outDir, \"client\", \"client-enhancements.mjs\"), source, \"utf8\");\n}\n\nexport async function compileVueFile(file: string, options: { id: string; name?: string; outDir?: string }): Promise<CompiledComponent> {\n const source = await readFile(file, \"utf8\");\n return compileVueSource(source, {\n file,\n id: options.id,\n name: options.name ?? pascalCase(path.basename(file, \".vue\")),\n outDir: options.outDir\n });\n}\n\nexport function compileVueSource(source: string, options: { file: string; id: string; name: string; outDir?: string }): CompiledComponent {\n const parsed = parseSfc(source, { filename: options.file });\n const descriptor = parsed.descriptor;\n\n if (!descriptor.template) {\n throw new ResuxCompileError(\"Resux components need a <template> block.\", locationFromOffset(options.file, source, 0));\n }\n\n const script = descriptor.scriptSetup?.content ?? \"\";\n const templateRefBindings = inferTemplateRefBindings(script, options.file);\n const template = compileTemplate(descriptor.template.content, options.file, templateRefBindings);\n const analysis = analyzeScript(script, options.file, template.inlineHandlers);\n const compiledStyles = compileSfcStyles(descriptor.styles, {\n id: options.id,\n file: options.file\n });\n validateTemplateHandlers(template.handlers, analysis, options.file, source, template.allLocals);\n const serverSource = createComponentModuleSource({\n id: options.id,\n name: options.name,\n file: options.file,\n template: template.nodes,\n templateRefs: template.templateRefs,\n templateForRefs: template.templateForRefs,\n analysis,\n styles: compiledStyles.styles,\n styleScopeId: compiledStyles.styleScopeId,\n client: false,\n expressions: template.expressions,\n outDir: options.outDir\n });\n const clientSource = createComponentModuleSource({\n id: options.id,\n name: options.name,\n file: options.file,\n template: template.nodes,\n templateRefs: template.templateRefs,\n templateForRefs: template.templateForRefs,\n analysis,\n styles: compiledStyles.styles,\n styleScopeId: compiledStyles.styleScopeId,\n client: true,\n expressions: template.expressions,\n outDir: options.outDir\n });\n\n return {\n id: options.id,\n name: options.name,\n file: options.file,\n serverSource,\n clientSource,\n template: template.nodes,\n templateRefs: template.templateRefs,\n templateForRefs: template.templateForRefs,\n handlers: [...new Set(template.handlers.map((event) => event.handler))],\n styles: compiledStyles.styles,\n styleScopeId: compiledStyles.styleScopeId,\n meta: analysis.pageMeta,\n expressions: template.expressions\n };\n}\n\nfunction compileSfcStyles(\n styleBlocks: SFCStyleBlock[],\n options: { id: string; file: string }\n): { styles: ComponentStyle[]; styleScopeId?: string } {\n const scopeId = `rx-s-${options.id}`;\n const styles: ComponentStyle[] = [];\n let hasScopedStyles = false;\n\n for (let index = 0; index < styleBlocks.length; index++) {\n const style = styleBlocks[index];\n const lang = style.lang ?? (typeof style.attrs.lang === \"string\" ? style.attrs.lang : undefined);\n\n if (lang && lang !== \"css\") {\n throw new ResuxCompileError(\n `Resux <style> only supports plain CSS in resumable components. Unsupported lang \"${lang}\".`,\n styleBlockLocation(options.file, style)\n );\n }\n if (style.module) {\n throw new ResuxCompileError(\n \"Resux <style module> is not supported in resumable components yet.\",\n styleBlockLocation(options.file, style)\n );\n }\n if (style.src) {\n throw new ResuxCompileError(\n \"Resux <style src> is not supported in resumable components yet.\",\n styleBlockLocation(options.file, style)\n );\n }\n\n const result = compileStyle({\n id: scopeId,\n filename: options.file,\n source: style.content,\n scoped: Boolean(style.scoped),\n isProd: true\n });\n\n if (result.errors.length > 0) {\n const error = result.errors[0];\n const message = error instanceof Error ? error.message : String(error);\n throw new ResuxCompileError(message, styleBlockLocation(options.file, style));\n }\n\n const css = result.code.trim();\n if (!css) {\n continue;\n }\n\n hasScopedStyles ||= Boolean(style.scoped);\n styles.push({\n id: `${options.id}-${index}`,\n css,\n scoped: Boolean(style.scoped)\n });\n }\n\n return {\n styles,\n styleScopeId: hasScopedStyles ? `data-v-${scopeId}` : undefined\n };\n}\n\nfunction styleBlockLocation(file: string, style: SFCStyleBlock): CompileErrorLocation {\n return {\n file,\n line: style.loc.start.line,\n column: style.loc.start.column\n };\n}\n\nexport function createRouteManifest(\n root: string,\n files: string[],\n idByFile?: Map<string, string>,\n compiledByFile?: Map<string, CompiledComponent>\n): RouteManifestRecord[] {\n return files\n .map((file, index) => {\n const normalizedRoot = normalizePath(path.resolve(root));\n const normalizedFile = normalizePath(path.resolve(file));\n const appPagesRoot = `${normalizedRoot}/app/pages/`;\n const pagesRoot = `${normalizedRoot}/pages/`;\n const relative = normalizedFile.startsWith(appPagesRoot)\n ? normalizedFile.slice(appPagesRoot.length)\n : normalizedFile.startsWith(pagesRoot)\n ? normalizedFile.slice(pagesRoot.length)\n : normalizePath(path.relative(path.join(root, \"pages\"), file));\n const withoutExtension = relative.replace(/\\.vue$/, \"\");\n const parts = withoutExtension.split(\"/\");\n const params: string[] = [];\n const routeParts = parts\n .filter((part, partIndex) => !(part === \"index\" && partIndex === parts.length - 1))\n .map((part) => {\n const catchAllMatch = /^\\[\\.\\.\\.([A-Za-z0-9_]+)\\]$/.exec(part);\n if (catchAllMatch) {\n params.push(catchAllMatch[1]);\n return `:${catchAllMatch[1]}*`;\n }\n const match = /^\\[([A-Za-z0-9_]+)\\]$/.exec(part);\n if (match) {\n params.push(match[1]);\n return `:${match[1]}`;\n }\n return part;\n });\n const routePath = `/${routeParts.join(\"/\")}`.replace(/\\/$/, \"\") || \"/\";\n\n return {\n id: `r${index}`,\n path: routePath,\n file,\n params,\n componentId: idByFile?.get(file) ?? `m${index}`,\n meta: compiledByFile?.get(file)?.meta\n };\n })\n .sort((a, b) => routeScore(b.path) - routeScore(a.path) || a.path.localeCompare(b.path));\n}\n\nasync function ensureServerComponentModules(outDir: string, components: CompiledComponent[]): Promise<void> {\n for (const component of components) {\n const file = path.join(outDir, \"server\", `${component.id}.mjs`);\n if (await existsFile(file)) {\n continue;\n }\n await writeFile(file, component.serverSource, \"utf8\");\n }\n}\n\nfunction localizeRouteManifest(routes: RouteManifestRecord[], runtimeConfig: Record<string, unknown>): RouteManifestRecord[] {\n const i18n = readRuntimeI18nConfig(runtimeConfig);\n if (!i18n) {\n return routes;\n }\n\n const localeCodes = i18n.strategy === \"no_prefix\"\n ? [i18n.defaultLocale]\n : i18n.locales.map((locale) => locale.code);\n const localized: RouteManifestRecord[] = [];\n const seenPaths = new Set<string>();\n\n for (const route of routes) {\n for (const localeCode of localeCodes) {\n const localizedPath = buildLocalePath(route.path, localeCode, i18n);\n if (seenPaths.has(localizedPath)) {\n continue;\n }\n seenPaths.add(localizedPath);\n localized.push({\n ...route,\n path: localizedPath,\n id: route.id\n });\n }\n }\n\n return localized\n .sort((a, b) => routeScore(b.path) - routeScore(a.path) || a.path.localeCompare(b.path))\n .map((route, index) => ({\n ...route,\n id: `r${index}`\n }));\n}\n\nfunction readRuntimeI18nConfig(runtimeConfig: Record<string, unknown>): ResuxI18nRuntimeConfig | null {\n const directPublicConfig = isPlainObject(runtimeConfig.public)\n ? runtimeConfig.public\n : null;\n const nestedRuntimeConfig = isPlainObject(runtimeConfig.runtimeConfig)\n ? runtimeConfig.runtimeConfig\n : null;\n const nestedPublicConfig = nestedRuntimeConfig && isPlainObject(nestedRuntimeConfig.public)\n ? nestedRuntimeConfig.public\n : null;\n const publicConfig = directPublicConfig ?? nestedPublicConfig;\n if (!publicConfig) {\n return null;\n }\n const i18n = publicConfig.i18n;\n return normalizeI18nRuntimeConfig(i18n);\n}\n\n// Refs inside v-for subtrees resolve to one element per iteration, so they\n// must always read back as an array, even for a single rendered item.\nfunction collectTemplateForRefs(nodes: TemplateNode[], insideFor = false, out: Set<string> = new Set<string>()): Set<string> {\n for (const node of nodes) {\n if (!node || node.type !== \"element\") {\n continue;\n }\n const nowInsideFor = insideFor || Boolean(node.for);\n if (nowInsideFor && node.ref) {\n out.add(node.ref);\n }\n if (Array.isArray(node.children)) {\n collectTemplateForRefs(node.children, nowInsideFor, out);\n }\n }\n return out;\n}\n\nfunction compileTemplate(\n template: string,\n file: string,\n templateRefBindings: Set<string> = new Set()\n): {\n nodes: TemplateNode[];\n handlers: TemplateEvent[];\n inlineHandlers: GeneratedHandler[];\n expressions: { id: string; original: string; transformed: string; locals: string[] }[];\n allLocals: string[];\n templateRefs: string[];\n templateForRefs: string[];\n} {\n const ast = parseTemplate(template, { comments: false });\n const state: CompileTemplateState = {\n file,\n templateRefBindings,\n templateRefs: new Set<string>(),\n bindingIndex: 0,\n inlineHandlerIndex: 0,\n handlers: [],\n inlineHandlers: [],\n expressions: [],\n activeLocals: [],\n allLocals: new Set<string>()\n };\n\n const nodes = compileTemplateChildren(ast.children, state);\n return {\n nodes,\n handlers: state.handlers,\n inlineHandlers: state.inlineHandlers,\n expressions: state.expressions,\n allLocals: Array.from(state.allLocals),\n templateRefs: Array.from(state.templateRefs),\n templateForRefs: Array.from(collectTemplateForRefs(nodes))\n };\n}\n\nfunction compileTemplateChildren(children: TemplateChildNode[], state: CompileTemplateState): TemplateNode[] {\n const nodes: TemplateNode[] = [];\n let conditionalChainExpressions: string[] | null = null;\n\n for (const child of children) {\n if (child.type === NodeTypes.ELEMENT) {\n const conditionalDirective = resolveConditionalDirective(child, state);\n if (!conditionalDirective) {\n conditionalChainExpressions = null;\n const compiledNode = compileTemplateNode(child, state);\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n if (conditionalDirective.kind === \"if\") {\n const expressionResult = transformTemplateExpressionCode(\n conditionalDirective.expression!,\n state.templateRefBindings,\n state.file,\n conditionalDirective.directive\n );\n conditionalChainExpressions = [expressionResult.transformed];\n const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expressionResult.transformed });\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n if (!conditionalChainExpressions || conditionalChainExpressions.length === 0) {\n throw new ResuxCompileError(\n `v-${conditionalDirective.kind} must follow a sibling with v-if or v-else-if.`,\n locationFromVueNode(state.file, conditionalDirective.directive),\n );\n }\n\n if (conditionalDirective.kind === \"else-if\") {\n const branchExpressionResult = transformTemplateExpressionCode(\n conditionalDirective.expression!,\n state.templateRefBindings,\n state.file,\n conditionalDirective.directive\n );\n const expression = `${buildConditionalChainGuard(conditionalChainExpressions)} && (${branchExpressionResult.transformed})`;\n conditionalChainExpressions.push(branchExpressionResult.transformed);\n const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n const expression = buildConditionalChainGuard(conditionalChainExpressions);\n conditionalChainExpressions = null;\n const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n if (child.type !== NodeTypes.TEXT || child.content.trim().length > 0) {\n conditionalChainExpressions = null;\n }\n\n const compiledNode = compileTemplateNode(child, state);\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n }\n\n return nodes;\n}\n\nfunction buildConditionalChainGuard(expressions: string[]): string {\n return expressions.map((expression) => `!(${expression})`).join(\" && \");\n}\n\nfunction resolveConditionalDirective(node: ElementNode, state: CompileTemplateState): ConditionalDirectiveInfo | null {\n let conditional: ConditionalDirectiveInfo | null = null;\n for (const prop of node.props) {\n if (prop.type !== NodeTypes.DIRECTIVE) {\n continue;\n }\n if (prop.name !== \"if\" && prop.name !== \"else-if\" && prop.name !== \"else\") {\n continue;\n }\n if (conditional) {\n throw new ResuxCompileError(\n \"Only one conditional directive is allowed per element.\",\n locationFromVueNode(state.file, prop),\n );\n }\n\n const expression = expressionContent(prop.exp).trim();\n if ((prop.name === \"if\" || prop.name === \"else-if\") && expression.length === 0) {\n throw new ResuxCompileError(\n `v-${prop.name} needs an expression.`,\n locationFromVueNode(state.file, prop),\n );\n }\n if (prop.name === \"else\" && expression.length > 0) {\n throw new ResuxCompileError(\n \"v-else does not accept an expression.\",\n locationFromVueNode(state.file, prop),\n );\n }\n\n conditional = {\n kind: prop.name,\n directive: prop,\n expression: expression.length > 0 ? expression : undefined,\n };\n }\n\n return conditional;\n}\n\nfunction expressionContent(node: unknown): string {\n if (node && typeof node === \"object\" && \"content\" in node && typeof node.content === \"string\") {\n return node.content;\n }\n return \"\";\n}\n\nfunction compileTemplateNode(\n node: TemplateChildNode,\n state: CompileTemplateState,\n options: CompileTemplateNodeOptions = {},\n): TemplateNode | null {\n if (node.type === NodeTypes.TEXT) {\n return {\n type: \"text\",\n value: node.content\n };\n }\n\n if (node.type === NodeTypes.INTERPOLATION) {\n return {\n type: \"interpolation\",\n expression: registerTemplateExpression(expressionContent(node.content), state.templateRefBindings, state.file, node, state),\n bindingId: nextBindingId(state)\n };\n }\n\n if (node.type !== NodeTypes.ELEMENT) {\n return null;\n }\n\n // Find v-for to track locals for children\n const forProp = node.props.find((prop) => prop.type === NodeTypes.DIRECTIVE && prop.name === \"for\") as DirectiveNode | undefined;\n let addedLocals = 0;\n if (forProp) {\n const expression = expressionContent(forProp.exp);\n if (expression) {\n const parsedFor = parseForExpression(expression, state.file, forProp, state);\n state.activeLocals.push(parsedFor.value);\n state.allLocals.add(parsedFor.value);\n addedLocals++;\n if (parsedFor.index) {\n state.activeLocals.push(parsedFor.index);\n state.allLocals.add(parsedFor.index);\n addedLocals++;\n }\n }\n }\n\n // Find slot props to track locals for children\n const slotProp = node.props.find((prop) => prop.type === NodeTypes.DIRECTIVE && prop.name === \"slot\") as DirectiveNode | undefined;\n if (slotProp) {\n const expression = expressionContent(slotProp.exp);\n if (expression) {\n const slotLocals = parseBindingNames(expression);\n for (const local of slotLocals) {\n state.activeLocals.push(local);\n state.allLocals.add(local);\n addedLocals++;\n }\n }\n }\n\n const attrs: TemplateAttribute[] = [];\n const events: TemplateEvent[] = [];\n const element: ElementTemplateNode = {\n type: \"element\",\n tag: node.tag,\n attrs,\n events,\n children: compileTemplateChildren(node.children, state)\n };\n\n for (const prop of node.props) {\n if (prop.type === NodeTypes.ATTRIBUTE) {\n if (prop.name === \"ref\" && prop.value?.content) {\n const refName = prop.value.content.trim();\n if (refName) {\n state.templateRefs.add(refName);\n element.ref = refName;\n }\n }\n attrs.push({\n kind: \"static\",\n name: prop.name,\n value: prop.value?.content ?? \"\"\n });\n continue;\n }\n\n if (prop.type !== NodeTypes.DIRECTIVE) {\n continue;\n }\n\n if (prop.name === \"bind\") {\n const arg = expressionContent(prop.arg);\n const expression = expressionContent(prop.exp);\n if (!arg || !expression) {\n throw new ResuxCompileError(\"Dynamic bindings need an argument and expression.\", locationFromVueNode(state.file, prop));\n }\n if (arg === \"ref\") {\n const trimmed = expression.trim();\n const quotedMatch = /^(['\"`])([\\s\\S]*)\\1$/.exec(trimmed);\n const staticRefName = quotedMatch\n ? quotedMatch[2].trim()\n : (/^[A-Za-z_$][\\w$]*$/.test(trimmed) ? trimmed : \"\");\n if (staticRefName) {\n state.templateRefs.add(staticRefName);\n element.ref = staticRefName;\n }\n }\n attrs.push({\n kind: \"dynamic\",\n name: arg,\n value: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n });\n continue;\n }\n\n if (prop.name === \"on\") {\n const arg = expressionContent(prop.arg);\n const expression = expressionContent(prop.exp);\n const modifiers = normalizeEventModifiers(prop.modifiers ?? [], state.file, prop);\n if (!arg || !expression) {\n throw new ResuxCompileError(\"Events need an argument and expression.\", locationFromVueNode(state.file, prop));\n }\n const isSimpleIdentifier = /^[A-Za-z_$][\\w$]*$/.test(expression);\n if (isSimpleIdentifier && state.activeLocals.includes(expression)) {\n throw new ResuxCompileError(\n `Direct template-local event handler \"${expression}\" cannot be resumed because template locals are serialized by value. Call a top-level handler with serializable local data instead.`,\n locationFromVueNode(state.file, prop),\n );\n }\n const usesInlineHandler = !isSimpleIdentifier;\n const inlineHandler = usesInlineHandler\n ? createInlineEventHandler(expression, state, prop)\n : null;\n const handler = inlineHandler?.name ?? expression;\n const event: TemplateEvent = {\n name: arg,\n handler,\n modifiers,\n ...(inlineHandler?.locals.length ? { locals: inlineHandler.locals } : {})\n };\n events.push(event);\n state.handlers.push(event);\n continue;\n }\n\n if (prop.name === \"if\") {\n if (options.ifExpressionOverride) {\n continue;\n }\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-if needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.if = {\n expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n blockId: nextBindingId(state)\n };\n continue;\n }\n\n if (prop.name === \"else-if\" || prop.name === \"else\") {\n if (options.ifExpressionOverride) {\n continue;\n }\n throw new ResuxCompileError(\n `v-${prop.name} must follow a sibling with v-if or v-else-if.`,\n locationFromVueNode(state.file, prop),\n );\n }\n\n if (prop.name === \"for\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-for needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.for = parseForExpression(expression, state.file, prop, state);\n element.for.source = registerTemplateExpression(element.for.source, state.templateRefBindings, state.file, prop, state);\n continue;\n }\n\n if (prop.name === \"show\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-show needs an expression.\", locationFromVueNode(state.file, prop));\n }\n attrs.push({\n kind: \"dynamic\",\n name: \"hidden\",\n value: registerRawTemplateExpression(`!(${transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).transformed})`, expression, transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).identifiers, state),\n bindingId: nextBindingId(state)\n });\n continue;\n }\n\n if (prop.name === \"text\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-text needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.children = [{\n type: \"interpolation\",\n expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n }];\n continue;\n }\n\n if (prop.name === \"html\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-html needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.html = {\n expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n };\n element.children = [];\n continue;\n }\n\n if (prop.name === \"model\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-model needs an expression.\", locationFromVueNode(state.file, prop));\n }\n if (!isAssignableExpression(expression)) {\n throw new ResuxCompileError(\"v-model needs an assignable expression like \\\"message.value\\\".\", locationFromVueNode(state.file, prop));\n }\n const assignmentRoot = assignableExpressionRoot(expression);\n if (assignmentRoot && state.activeLocals.includes(assignmentRoot)) {\n throw new ResuxCompileError(\n `v-model cannot assign through template-local binding \"${assignmentRoot}\" because resumed event locals are serialized by value. Bind v-model to resumable component state instead.`,\n locationFromVueNode(state.file, prop),\n );\n }\n const model = createModelBinding(node.tag, node.props, expression, state, prop);\n attrs.push({\n kind: \"dynamic\",\n name: model.attribute,\n value: registerTemplateExpression(model.value, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n });\n const event: TemplateEvent = {\n name: model.event,\n handler: model.handler,\n modifiers: [],\n ...(model.locals.length > 0 ? { locals: model.locals } : {})\n };\n events.push(event);\n state.handlers.push(event);\n continue;\n }\n\n const argSuffix = prop.arg ? `:${expressionContent(prop.arg)}` : \"\";\n const name = `v-${prop.name}${argSuffix}`;\n const expression = expressionContent(prop.exp);\n if (expression) {\n attrs.push({\n kind: \"dynamic\",\n name,\n value: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n });\n } else {\n attrs.push({\n kind: \"static\",\n name,\n value: \"\"\n });\n }\n continue;\n }\n\n if (options.ifExpressionOverride) {\n const conditionalExpression = transformTemplateExpressionCode(\n options.ifExpressionOverride,\n state.templateRefBindings,\n state.file,\n node,\n );\n element.if = {\n expression: registerRawTemplateExpression(\n conditionalExpression.transformed,\n options.ifExpressionOverride,\n conditionalExpression.identifiers,\n state,\n ),\n blockId: nextBindingId(state),\n };\n }\n\n if (addedLocals > 0) {\n state.activeLocals.splice(state.activeLocals.length - addedLocals, addedLocals);\n }\n\n return element;\n}\n\nfunction selectReferencedActiveLocals(activeLocals: string[], identifiers: string[]): string[] {\n const referenced = new Set(identifiers);\n const seen = new Set<string>();\n const selected: string[] = [];\n for (let index = activeLocals.length - 1; index >= 0; index -= 1) {\n const local = activeLocals[index];\n if (!referenced.has(local) || seen.has(local)) continue;\n seen.add(local);\n selected.unshift(local);\n }\n return selected;\n}\n\nfunction createInlineEventHandler(\n expression: string,\n state: CompileTemplateState,\n node?: VueCompilerNode\n): { name: string; locals: string[] } {\n const name = nextInlineHandlerName(state);\n const transformed = transformTemplateExpressionCode(\n expression,\n state.templateRefBindings,\n state.file,\n node ?? ({} as any)\n );\n const capturedLocals = selectReferencedActiveLocals(state.activeLocals, transformed.identifiers);\n const localBindings = capturedLocals\n .map((local) => `const ${local} = __rx_event_locals[${JSON.stringify(local)}];`)\n .join(\"\\n\");\n state.inlineHandlers.push({\n name,\n source: `function ${name}($event, __rx_event_locals = {}) {\\n${localBindings}${localBindings ? \"\\n\" : \"\"}${transformed.transformed}\\n}`,\n locals: capturedLocals\n });\n return { name, locals: capturedLocals };\n}\n\nfunction createModelBinding(\n tag: string,\n props: Array<AttributeNode | DirectiveNode>,\n expression: string,\n state: CompileTemplateState,\n node?: VueCompilerNode\n): { attribute: string; value: string; event: string; handler: string; locals: string[] } {\n const normalizedTag = tag.toLowerCase();\n const inputType = normalizedTag === \"input\" ? staticAttributeValue(props, \"type\")?.toLowerCase() : undefined;\n const isCheckbox = inputType === \"checkbox\";\n const handler = nextInlineHandlerName(state);\n const target = \"$event.target\";\n const assignmentExpression = state.templateRefBindings.has(expression.trim()) ? `${expression.trim()}.value` : expression;\n const assignment = isCheckbox\n ? `${assignmentExpression} = Boolean(${target} && ${target}.checked)`\n : `${assignmentExpression} = ${target} ? ${target}.value : \"\"`;\n const identifiers = transformTemplateExpressionCode(\n expression,\n state.templateRefBindings,\n state.file,\n node ?? ({} as any)\n ).identifiers;\n const capturedLocals = selectReferencedActiveLocals(state.activeLocals, identifiers);\n const localBindings = capturedLocals\n .map((local) => `const ${local} = __rx_event_locals[${JSON.stringify(local)}];`)\n .join(\"\\n\");\n\n state.inlineHandlers.push({\n name: handler,\n source: `function ${handler}($event, __rx_event_locals = {}) {\\n${localBindings}${localBindings ? \"\\n\" : \"\"}${assignment}\\n}`,\n locals: capturedLocals\n });\n\n return {\n attribute: isCheckbox ? \"checked\" : \"value\",\n value: expression,\n event: isCheckbox || normalizedTag === \"select\" ? \"change\" : \"input\",\n handler,\n locals: capturedLocals\n };\n}\n\nfunction staticAttributeValue(props: Array<AttributeNode | DirectiveNode>, name: string): string | undefined {\n const attr = props.find((prop): prop is AttributeNode => prop.type === NodeTypes.ATTRIBUTE && prop.name === name);\n return attr?.value?.content;\n}\n\nfunction registerTemplateExpression(\n expression: string,\n templateRefBindings: Set<string>,\n file: string,\n node: VueCompilerNode,\n state: CompileTemplateState\n): string {\n const result = transformTemplateExpressionCode(expression, templateRefBindings, file, node);\n return registerRawTemplateExpression(result.transformed, expression, result.identifiers, state);\n}\n\nfunction registerRawTemplateExpression(\n transformed: string,\n original: string,\n identifiers: string[],\n state: CompileTemplateState\n): string {\n const id = `__rx_expr_${state.expressions.length}`;\n state.expressions.push({\n id,\n original,\n transformed,\n locals: identifiers // repurposing locals to store the free identifiers needed for the closure\n });\n return id;\n}\n\nfunction transformTemplateExpressionCode(\n expression: string,\n templateRefBindings: Set<string>,\n file: string,\n node: VueCompilerNode\n): { transformed: string; identifiers: string[] } {\n if (expression.trim() === \"\") {\n return { transformed: expression, identifiers: [] };\n }\n\n const wrapped = `(${expression})`;\n const sourceFile = ts.createSourceFile(`${file}?template-expression`, wrapped, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n if (((sourceFile as unknown as { parseDiagnostics?: unknown[] }).parseDiagnostics ?? []).length > 0) {\n throw new ResuxCompileError(\"Template expression is not valid JavaScript.\", locationFromVueNode(file, node));\n }\n\n const insertions: number[] = [];\n const identifiers = new Set<string>();\n\n const visit = (current: ts.Node): void => {\n if (ts.isIdentifier(current)) {\n if (shouldAutoUnwrapTemplateIdentifier(current)) {\n if (templateRefBindings.has(current.text)) {\n const position = current.end - 1;\n if (position >= 0 && position <= expression.length) {\n insertions.push(position);\n }\n }\n }\n\n let isPropertyName = false;\n const parent = current.parent;\n if (parent) {\n if (ts.isPropertyAccessExpression(parent) && parent.name === current) {\n isPropertyName = true;\n }\n if (ts.isPropertyAssignment(parent) && parent.name === current) {\n isPropertyName = true;\n }\n }\n\n if (!isPropertyName && ![\"undefined\", \"NaN\", \"Infinity\", \"arguments\", \"this\"].includes(current.text)) {\n identifiers.add(current.text);\n }\n }\n\n ts.forEachChild(current, visit);\n };\n\n visit(sourceFile);\n \n let transformed = expression;\n if (insertions.length > 0) {\n const uniqueInsertions = [...new Set(insertions)].sort((a, b) => b - a);\n for (const position of uniqueInsertions) {\n transformed = `${transformed.slice(0, position)}.value${transformed.slice(position)}`;\n }\n }\n \n return { transformed, identifiers: [...identifiers] };\n}\n\nfunction shouldAutoUnwrapTemplateIdentifier(node: ts.Identifier): boolean {\n const parent = node.parent;\n if (!parent) {\n return true;\n }\n\n if (ts.isPropertyAccessExpression(parent)) {\n if (parent.expression === node && parent.name.text === \"value\") {\n return false;\n }\n return parent.name !== node;\n }\n\n if (ts.isPropertyAssignment(parent) && parent.name === node) {\n return false;\n }\n\n if (ts.isShorthandPropertyAssignment(parent) || ts.isBindingElement(parent)) {\n return false;\n }\n\n return true;\n}\n\nfunction isAssignableExpression(expression: string): boolean {\n return /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\[[^\\]]+\\])*$/.test(expression.trim());\n}\n\nfunction assignableExpressionRoot(expression: string): string | undefined {\n return /^([A-Za-z_$][\\w$]*)/.exec(expression.trim())?.[1];\n}\n\nfunction normalizeEventModifiers(modifiers: SimpleExpressionNode[], file: string, node: VueCompilerNode): string[] {\n const modifierNames = modifiers.map((modifier) => String(modifier.content));\n const supported = new Set([\n \"prevent\",\n \"stop\",\n \"self\",\n \"once\",\n \"capture\",\n \"passive\",\n \"ctrl\",\n \"shift\",\n \"alt\",\n \"meta\",\n \"exact\",\n \"left\",\n \"middle\",\n \"right\",\n \"enter\",\n \"tab\",\n \"delete\",\n \"esc\",\n \"escape\",\n \"space\",\n \"up\",\n \"down\",\n \"left\",\n \"right\"\n ]);\n const unsupported = modifierNames.find((modifier) => !supported.has(modifier));\n\n if (unsupported) {\n throw new ResuxCompileError(\n `Event modifier \".${unsupported}\" is not supported in the resumability runtime yet.`,\n locationFromVueNode(file, node)\n );\n }\n\n return modifierNames;\n}\n\nfunction parseForExpression(expression: string, file: string, node: VueCompilerNode, state: CompileTemplateState) {\n const match = /^\\s*(?:\\(([^)]+)\\)|([A-Za-z_$][\\w$]*))\\s+(?:in|of)\\s+(.+)\\s*$/.exec(expression);\n if (!match) {\n throw new ResuxCompileError(\"v-for must look like \\\"item in items\\\" or \\\"(item, index) in items\\\".\", locationFromVueNode(file, node));\n }\n const aliases = (match[1] ?? match[2]).split(\",\").map((part) => part.trim()).filter(Boolean);\n if (!aliases[0] || aliases.length > 2) {\n throw new ResuxCompileError(\"v-for supports only value and optional index aliases.\", locationFromVueNode(file, node));\n }\n return {\n value: aliases[0],\n index: aliases[1],\n source: match[3],\n blockId: nextBindingId(state)\n };\n}\n\nfunction parseBindingNames(expression: string): string[] {\n const source = `const ${expression} = null;`;\n const sf = ts.createSourceFile(\"temp.ts\", source, ts.ScriptTarget.Latest, true);\n const names: string[] = [];\n if (sf.statements.length > 0) {\n const stmt = sf.statements[0];\n if (ts.isVariableStatement(stmt)) {\n const decl = stmt.declarationList.declarations[0];\n if (decl) {\n names.push(...collectBindingNames(decl.name));\n }\n }\n }\n return names;\n}\n\nfunction rewriteImportStatementText(\n statement: ts.ImportDeclaration | ts.ImportEqualsDeclaration,\n sourceFile: ts.SourceFile,\n file: string\n): string {\n if (ts.isImportDeclaration(statement)) {\n const specifier = statement.moduleSpecifier;\n if (ts.isStringLiteral(specifier)) {\n const importPath = specifier.text;\n if (importPath.startsWith(\".\")) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const normalized = fileUrl(resolvedPath);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n }\n } else if (ts.isImportEqualsDeclaration(statement)) {\n const moduleRef = statement.moduleReference;\n if (ts.isExternalModuleReference(moduleRef) && ts.isStringLiteral(moduleRef.expression)) {\n const specifier = moduleRef.expression;\n const importPath = specifier.text;\n if (importPath.startsWith(\".\")) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const normalized = fileUrl(resolvedPath);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n }\n }\n return statement.getFullText(sourceFile);\n}\n\nfunction findProjectRoot(startFile: string): string {\n let dir = path.dirname(startFile);\n while (true) {\n if (existsSync(path.join(dir, \"resux.config.ts\")) || \n existsSync(path.join(dir, \"package.json\")) ||\n existsSync(path.join(dir, \"nuxt.config.ts\"))) {\n return dir;\n }\n const parent = path.dirname(dir);\n if (parent === dir) {\n break;\n }\n dir = parent;\n }\n return path.dirname(startFile);\n}\n\nconst IMAGE_VIDEO_FONT_EXTENSIONS = new Set([\n \".webp\", \".png\", \".jpg\", \".jpeg\", \".svg\", \".gif\", \".ico\", \".webm\", \".mp4\",\n \".wav\", \".mp3\", \".ogg\", \".woff\", \".woff2\", \".ttf\", \".eot\"\n]);\n\nconst STYLESHEET_EXTENSIONS = new Set([\n \".css\", \".scss\", \".sass\", \".less\", \".styl\", \".stylus\"\n]);\n\nfunction ensureCompiledUserModule(\n resolvedFile: string,\n projectRoot: string,\n outDir: string,\n compiledSet = new Set<string>()\n): string {\n const relativePath = normalizePath(path.relative(projectRoot, resolvedFile));\n const safeRelativePath = relativePath\n .split(\"/\")\n .map((segment) =>\n segment\n .replace(/_/g, \"__\")\n .replace(/[%#?]/g, (character) => `_${character.codePointAt(0)!.toString(16).toUpperCase()}_`)\n )\n .join(\"/\")\n .replace(/\\.[jt]sx?$/, \".mjs\");\n const targetJsFile = path.join(outDir, \"server\", \"imported\", safeRelativePath);\n\n if (compiledSet.has(resolvedFile)) {\n return targetJsFile;\n }\n compiledSet.add(resolvedFile);\n\n let sourceText = \"\";\n try {\n sourceText = ts.sys.readFile(resolvedFile) ?? \"\";\n } catch {\n return resolvedFile;\n }\n\n const sourceFile = ts.createSourceFile(resolvedFile, sourceText, ts.ScriptTarget.ES2022, true);\n const replacements: Array<{ start: number; end: number; replacement: string }> = [];\n\n for (const statement of sourceFile.statements) {\n if (ts.isImportDeclaration(statement) && statement.moduleSpecifier && ts.isStringLiteral(statement.moduleSpecifier)) {\n const specifier = statement.moduleSpecifier;\n const importPath = specifier.text;\n if (importPath.startsWith(\".\") || importPath.startsWith(\"@/\") || importPath.startsWith(\"~/\")) {\n let resolvedImported = \"\";\n if (importPath.startsWith(\".\")) {\n resolvedImported = path.resolve(path.dirname(resolvedFile), importPath);\n } else {\n resolvedImported = path.resolve(projectRoot, importPath.slice(2));\n }\n resolvedImported = resolveFileExtension(resolvedImported);\n const ext = path.extname(resolvedImported).toLowerCase();\n if (ext === \".ts\" || ext === \".tsx\" || ext === \".js\" || ext === \".jsx\") {\n const compiledTarget = ensureCompiledUserModule(resolvedImported, projectRoot, outDir, compiledSet);\n const relativeToCompiled = path.relative(path.dirname(targetJsFile), compiledTarget);\n const relativeImportPath = relativeToCompiled.startsWith(\".\")\n ? relativeToCompiled.replace(/\\\\/g, \"/\")\n : \"./\" + relativeToCompiled.replace(/\\\\/g, \"/\");\n replacements.push({\n start: specifier.getStart(sourceFile),\n end: specifier.getEnd(),\n replacement: JSON.stringify(relativeImportPath)\n });\n }\n }\n }\n }\n\n replacements.sort((a, b) => b.start - a.start);\n let rewrittenSource = sourceText;\n for (const r of replacements) {\n rewrittenSource = rewrittenSource.slice(0, r.start) + r.replacement + rewrittenSource.slice(r.end);\n }\n\n const transpiled = ts.transpileModule(rewrittenSource, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n\n const targetDir = path.dirname(targetJsFile);\n if (!existsSync(targetDir)) {\n mkdirSync(targetDir, { recursive: true });\n }\n writeFileSync(targetJsFile, transpiled, \"utf8\");\n\n return targetJsFile;\n}\n\nfunction resolveServerUserModuleImport(\n resolvedPath: string,\n file: string,\n outDir?: string,\n): string {\n const projectRoot = findProjectRoot(file);\n const buildOutDir = outDir ? path.resolve(outDir) : path.join(projectRoot, \".resux\");\n const compiledTarget = ensureCompiledUserModule(resolvedPath, projectRoot, buildOutDir);\n return relativeImportPath(path.join(buildOutDir, \"server\"), compiledTarget);\n}\n\nfunction processImportDeclaration(\n statement: ts.ImportDeclaration | ts.ImportEqualsDeclaration,\n sourceFile: ts.SourceFile,\n file: string,\n client: boolean,\n outDir?: string\n): string {\n if (ts.isImportDeclaration(statement)) {\n const specifier = statement.moduleSpecifier;\n if (!ts.isStringLiteral(specifier)) {\n return statement.getFullText(sourceFile);\n }\n const importPath = specifier.text;\n const isRelative = importPath.startsWith(\".\");\n const isAlias = importPath.startsWith(\"@/\") || importPath.startsWith(\"~/\");\n const ext = path.extname(importPath).toLowerCase();\n\n if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {\n if (client) {\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n if (isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n return statement.getFullText(sourceFile);\n } else {\n if (STYLESHEET_EXTENSIONS.has(ext)) {\n return \"\";\n }\n const projectRoot = findProjectRoot(file);\n let absolutePath = \"\";\n if (isAlias) {\n absolutePath = path.resolve(projectRoot, importPath.slice(2));\n } else if (isRelative) {\n absolutePath = path.resolve(path.dirname(file), importPath);\n } else {\n absolutePath = importPath;\n }\n\n let webPath = importPath;\n const relativeToRoot = path.relative(projectRoot, absolutePath);\n const isInsideProject = relativeToRoot === \"\"\n || (relativeToRoot !== \"..\"\n && !relativeToRoot.startsWith(`..${path.sep}`)\n && !path.isAbsolute(relativeToRoot));\n if (isInsideProject) {\n webPath = \"/\" + relativeToRoot.replace(/\\\\/g, \"/\");\n }\n\n const clause = statement.importClause;\n if (!clause) {\n return \"\";\n }\n\n const bindings: string[] = [];\n if (clause.name) {\n bindings.push(clause.name.text);\n }\n if (clause.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) {\n bindings.push(clause.namedBindings.name.text);\n } else {\n for (const element of clause.namedBindings.elements) {\n bindings.push(element.name.text);\n }\n }\n }\n\n if (bindings.length === 0) {\n return \"\";\n }\n\n return bindings.map(name => `const ${name} = ${JSON.stringify(webPath)};`).join(\"\\n\");\n }\n }\n\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (!client && (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\")) {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n\n if (!client && isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\") {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n } else if (ts.isImportEqualsDeclaration(statement)) {\n const moduleRef = statement.moduleReference;\n if (ts.isExternalModuleReference(moduleRef) && ts.isStringLiteral(moduleRef.expression)) {\n const specifier = moduleRef.expression;\n const importPath = specifier.text;\n const isRelative = importPath.startsWith(\".\");\n const isAlias = importPath.startsWith(\"@/\") || importPath.startsWith(\"~/\");\n const ext = path.extname(importPath).toLowerCase();\n\n if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {\n if (client) {\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n if (isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n return statement.getFullText(sourceFile);\n } else {\n if (STYLESHEET_EXTENSIONS.has(ext)) {\n return \"\";\n }\n const projectRoot = findProjectRoot(file);\n let absolutePath = \"\";\n if (isAlias) {\n absolutePath = path.resolve(projectRoot, importPath.slice(2));\n } else if (isRelative) {\n absolutePath = path.resolve(path.dirname(file), importPath);\n } else {\n absolutePath = importPath;\n }\n\n let webPath = importPath;\n const relativeToRoot = path.relative(projectRoot, absolutePath);\n const isInsideProject = relativeToRoot === \"\"\n || (relativeToRoot !== \"..\"\n && !relativeToRoot.startsWith(`..${path.sep}`)\n && !path.isAbsolute(relativeToRoot));\n if (isInsideProject) {\n webPath = \"/\" + relativeToRoot.replace(/\\\\/g, \"/\");\n }\n\n if (!statement.name) {\n return \"\";\n }\n return `const ${statement.name.text} = ${JSON.stringify(webPath)};`;\n }\n }\n\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (!client && (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\")) {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n\n if (!client && isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\") {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n }\n }\n return statement.getFullText(sourceFile);\n}\n\nfunction analyzeScript(script: string, file: string, inlineHandlers: GeneratedHandler[] = []): ScriptAnalysis {\n const sourceFile = ts.createSourceFile(file, script, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n const imports: string[] = [];\n const importDeclarations: (ts.ImportDeclaration | ts.ImportEqualsDeclaration)[] = [];\n const body: string[] = [];\n const bindings = new Set<string>();\n const handlerNames = new Set<string>();\n const resumableBindings = new Set<string>();\n const importedBindings = new Set<string>();\n const inlineHandlerLocals = new Map<string, string[]>();\n const templateRefBindings = inferTemplateRefBindings(script, file);\n const handlers = new Map<string, ts.Node>();\n let pageMeta: PageMeta | undefined;\n\n for (const h of inlineHandlers) {\n if (h.locals) {\n inlineHandlerLocals.set(h.name, h.locals);\n }\n }\n\n for (const statement of sourceFile.statements) {\n const text = statement.getFullText(sourceFile);\n if (ts.isImportDeclaration(statement) || ts.isImportEqualsDeclaration(statement)) {\n imports.push(rewriteImportStatementText(statement, sourceFile, file));\n importDeclarations.push(statement);\n if (ts.isImportDeclaration(statement)) {\n const clause = statement.importClause;\n if (clause) {\n if (clause.name) {\n bindings.add(clause.name.text);\n importedBindings.add(clause.name.text);\n }\n if (clause.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) {\n bindings.add(clause.namedBindings.name.text);\n importedBindings.add(clause.namedBindings.name.text);\n } else {\n for (const element of clause.namedBindings.elements) {\n bindings.add(element.name.text);\n importedBindings.add(element.name.text);\n }\n }\n }\n }\n } else if (ts.isImportEqualsDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n importedBindings.add(statement.name.text);\n }\n continue;\n }\n\n if (isDefinePageMetaStatement(statement)) {\n pageMeta = readPageMeta(statement, sourceFile, file);\n continue;\n }\n\n body.push(text);\n\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n handlerNames.add(statement.name.text);\n handlers.set(statement.name.text, statement);\n continue;\n }\n\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n for (const name of collectBindingNames(declaration.name)) {\n bindings.add(name);\n }\n\n if (ts.isIdentifier(declaration.name)) {\n if (isHandlerLikeInitializer(declaration.initializer)) {\n handlerNames.add(declaration.name.text);\n handlers.set(declaration.name.text, declaration);\n }\n }\n if (isResumableInitializer(declaration.initializer)) {\n for (const name of collectBindingNames(declaration.name)) {\n resumableBindings.add(name);\n }\n }\n }\n }\n }\n\n if (inlineHandlers.length > 0) {\n const inlineSource = inlineHandlers.map((handler) => handler.source).join(\"\\n\");\n const inlineSourceFile = ts.createSourceFile(`${file}?inline-handlers`, inlineSource, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n body.push(inlineSource);\n\n for (const statement of inlineSourceFile.statements) {\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n handlerNames.add(statement.name.text);\n handlers.set(statement.name.text, statement);\n }\n }\n }\n\n return {\n imports: imports.join(\"\\n\"),\n importDeclarations,\n setupBody: body.join(\"\\n\"),\n bindings: [...bindings],\n handlerNames,\n resumableBindings,\n importedBindings,\n inlineHandlerLocals,\n templateRefBindings,\n handlers,\n sourceFile,\n pageMeta\n };\n}\n\nfunction inferTemplateRefBindings(script: string, file: string): Set<string> {\n const sourceFile = ts.createSourceFile(file, script, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n const bindings = new Set<string>();\n\n for (const statement of sourceFile.statements) {\n if (!ts.isVariableStatement(statement)) {\n continue;\n }\n\n for (const declaration of statement.declarationList.declarations) {\n const initializer = unwrapAwaitExpression(declaration.initializer);\n if (!initializer || !ts.isCallExpression(initializer)) {\n continue;\n }\n\n const callee = initializer.expression;\n const calleeName = ts.isIdentifier(callee)\n ? callee.text\n : ts.isPropertyAccessExpression(callee) && ts.isIdentifier(callee.name)\n ? callee.name.text\n : \"\";\n\n if (ts.isIdentifier(declaration.name) && isTemplateRefFactory(calleeName)) {\n bindings.add(declaration.name.text);\n continue;\n }\n\n if (ts.isObjectBindingPattern(declaration.name) && isObjectTemplateRefFactory(calleeName)) {\n for (const element of declaration.name.elements) {\n if (!ts.isBindingElement(element) || !ts.isIdentifier(element.name)) {\n continue;\n }\n const propertyName = element.propertyName && ts.isIdentifier(element.propertyName)\n ? element.propertyName.text\n : element.name.text;\n if (isObjectTemplateRefBinding(calleeName, propertyName)) {\n bindings.add(element.name.text);\n }\n }\n }\n }\n }\n\n return bindings;\n}\n\nfunction unwrapAwaitExpression(node: ts.Expression | undefined): ts.Expression | undefined {\n return node && ts.isAwaitExpression(node) ? node.expression : node;\n}\n\nfunction isTemplateRefFactory(name: string): boolean {\n return [\"ref\", \"computed\", \"toRef\", \"useState\", \"useAsyncData\", \"useFetch\", \"useResuxImage\", \"useError\"].includes(name);\n}\n\nfunction isAsyncDataFactory(name: string): boolean {\n return [\"useAsyncData\", \"useFetch\"].includes(name);\n}\n\nfunction isObjectTemplateRefFactory(name: string): boolean {\n return isAsyncDataFactory(name) || name === \"toRefs\" || name === \"useI18n\";\n}\n\nfunction isObjectTemplateRefBinding(factory: string, property: string): boolean {\n if (factory === \"toRefs\") {\n return true;\n }\n if (factory === \"useI18n\") {\n return property === \"locale\" || property === \"dir\";\n }\n return [\"data\", \"pending\", \"error\", \"value\"].includes(property);\n}\n\nfunction isDefinePageMetaStatement(statement: ts.Statement): boolean {\n return ts.isExpressionStatement(statement)\n && ts.isCallExpression(statement.expression)\n && ts.isIdentifier(statement.expression.expression)\n && statement.expression.expression.text === \"definePageMeta\";\n}\n\nfunction readPageMeta(statement: ts.Statement, sourceFile: ts.SourceFile, file: string): PageMeta {\n if (!isDefinePageMetaStatement(statement)) {\n return {};\n }\n\n const call = (statement as ts.ExpressionStatement).expression as ts.CallExpression;\n const firstArg = call.arguments[0];\n if (!firstArg || !ts.isObjectLiteralExpression(firstArg)) {\n throw new ResuxCompileError(\"definePageMeta only supports an object literal in Resux.\", locationFromTsNode(file, sourceFile, statement));\n }\n\n return readObjectLiteral(firstArg, sourceFile, file) as PageMeta;\n}\n\nfunction readObjectLiteral(node: ts.ObjectLiteralExpression, sourceFile: ts.SourceFile, file: string): Record<string, unknown> {\n const output: Record<string, unknown> = {};\n\n for (const property of node.properties) {\n if (!ts.isPropertyAssignment(property)) {\n throw new ResuxCompileError(\"Only plain object properties are supported here.\", locationFromTsNode(file, sourceFile, property));\n }\n\n const name = readPropertyName(property.name, sourceFile, file);\n output[name] = readLiteralValue(property.initializer, sourceFile, file);\n }\n\n return output;\n}\n\nfunction readLiteralValue(node: ts.Expression, sourceFile: ts.SourceFile, file: string): unknown {\n if (ts.isStringLiteralLike(node)) {\n return node.text;\n }\n if (node.kind === ts.SyntaxKind.TrueKeyword) {\n return true;\n }\n if (node.kind === ts.SyntaxKind.FalseKeyword) {\n return false;\n }\n if (ts.isNumericLiteral(node)) {\n return Number(node.text);\n }\n if (ts.isArrayLiteralExpression(node)) {\n return node.elements.map((element) => readLiteralValue(element as ts.Expression, sourceFile, file));\n }\n if (ts.isObjectLiteralExpression(node)) {\n return readObjectLiteral(node, sourceFile, file);\n }\n\n throw new ResuxCompileError(\"Only JSON-like literals are supported here.\", locationFromTsNode(file, sourceFile, node));\n}\n\nfunction readPropertyName(name: ts.PropertyName, sourceFile: ts.SourceFile, file: string): string {\n if (ts.isIdentifier(name) || ts.isStringLiteralLike(name) || ts.isNumericLiteral(name)) {\n return name.text;\n }\n\n throw new ResuxCompileError(\"Only simple property names are supported here.\", locationFromTsNode(file, sourceFile, name));\n}\n\nfunction validateTemplateHandlers(events: TemplateEvent[], analysis: ScriptAnalysis, file: string, fullSource: string, templateLocals: string[] = []): void {\n const allowedHandlers = new Set([...analysis.handlerNames, ...templateLocals]);\n for (const event of events) {\n if (!allowedHandlers.has(event.handler)) {\n throw new ResuxCompileError(`Handler \"${event.handler}\" must be a top-level function or arrow function.`, locationFromOffset(file, fullSource, 0));\n }\n\n const handlerNode = analysis.handlers.get(event.handler);\n if (!handlerNode) {\n continue;\n }\n\n const locals = analysis.inlineHandlerLocals.get(event.handler) ?? [];\n const unsupportedCapture = findUnsupportedCapture(handlerNode, event.handler, analysis, locals);\n if (unsupportedCapture) {\n throw new ResuxCompileError(\n `Handler \"${event.handler}\" captures \"${unsupportedCapture}\", which is not resumable in Resux. If this is a client or browser API, access it via \"globalThis.${unsupportedCapture}\" or move client-only logic into onMounted() or useClientEnhancement(). See https://resux.dev/guide/resumability-handlers for allowed globals and resumability rules.`,\n locationFromTsNode(file, analysis.sourceFile, handlerNode)\n );\n }\n }\n}\n\nfunction findUnsupportedCapture(\n node: ts.Node,\n handlerName: string,\n analysis: ScriptAnalysis,\n templateLocals: string[] = []\n): string | null {\n const locals = new Set<string>([handlerName, \"event\", ...templateLocals]);\n const allowedTopLevel = new Set([\n ...analysis.resumableBindings,\n ...analysis.handlerNames,\n ...analysis.importedBindings\n ]);\n\n function registerPattern(name: ts.BindingName): void {\n for (const binding of collectBindingNames(name)) {\n locals.add(binding);\n }\n }\n\n if (ts.isFunctionDeclaration(node)) {\n for (const parameter of node.parameters) {\n registerPattern(parameter.name);\n }\n }\n\n if (ts.isVariableDeclaration(node) && node.initializer && (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer))) {\n for (const parameter of node.initializer.parameters) {\n registerPattern(parameter.name);\n }\n }\n\n let unsupported: string | null = null;\n\n function visit(current: ts.Node): void {\n if (unsupported) {\n return;\n }\n\n if (ts.isVariableDeclaration(current)) {\n registerPattern(current.name);\n }\n\n if (ts.isIdentifier(current) && isValueIdentifier(current)) {\n const name = current.text;\n if (!locals.has(name) && !RESUMABLE_HANDLER_ALLOWED_GLOBALS.has(name) && !allowedTopLevel.has(name)) {\n unsupported = name;\n return;\n }\n }\n\n ts.forEachChild(current, visit);\n }\n\n ts.forEachChild(node, visit);\n return unsupported;\n}\n\nfunction isValueIdentifier(node: ts.Identifier): boolean {\n const parent = node.parent;\n if (!parent) {\n return true;\n }\n if (ts.isPropertyAccessExpression(parent) && parent.name === node) {\n return false;\n }\n if (ts.isPropertyAssignment(parent) && parent.name === node) {\n return false;\n }\n if ((ts.isVariableDeclaration(parent) || ts.isFunctionDeclaration(parent) || ts.isParameter(parent)) && parent.name === node) {\n return false;\n }\n if (ts.isBindingElement(parent) && parent.name === node) {\n return false;\n }\n return true;\n}\n\nfunction isHandlerLikeInitializer(node: ts.Expression | undefined): boolean {\n return Boolean(node && (ts.isArrowFunction(node) || ts.isFunctionExpression(node)));\n}\n\nfunction isResumableInitializer(node: ts.Expression | undefined): boolean {\n if (!node) {\n return false;\n }\n if (ts.isNumericLiteral(node) || ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {\n return true;\n }\n if (node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword || node.kind === ts.SyntaxKind.NullKeyword) {\n return true;\n }\n if (ts.isPrefixUnaryExpression(node) && ts.isNumericLiteral(node.operand)) {\n return true;\n }\n if (ts.isCallExpression(node) && ts.isIdentifier(node.expression)) {\n if (node.expression.text.startsWith(\"use\")) {\n return true;\n }\n return [\n \"ref\",\n \"reactive\",\n \"computed\",\n \"readonly\",\n \"toRef\",\n \"toRefs\",\n \"watch\",\n \"watchEffect\",\n \"useState\",\n \"useAsyncData\",\n \"useRoute\",\n \"useRouter\",\n \"useRuntimeConfig\",\n \"useResuxApp\",\n \"useResuxImage\",\n \"usePackageReady\",\n \"defineProps\",\n \"defineEmits\"\n ].includes(node.expression.text);\n }\n if (ts.isAwaitExpression(node) && ts.isCallExpression(node.expression) && ts.isIdentifier(node.expression.expression)) {\n if (node.expression.expression.text.startsWith(\"use\")) {\n return true;\n }\n return [\"useAsyncData\", \"useFetch\"].includes(node.expression.expression.text);\n }\n return false;\n}\n\nfunction collectBindingNames(name: ts.BindingName): string[] {\n if (ts.isIdentifier(name)) {\n return [name.text];\n }\n\n const names: string[] = [];\n for (const element of name.elements) {\n if (ts.isBindingElement(element)) {\n names.push(...collectBindingNames(element.name));\n }\n }\n return names;\n}\n\nfunction createComponentModuleSource(options: {\n id: string;\n name: string;\n file: string;\n template: TemplateNode[];\n templateRefs?: string[];\n templateForRefs?: string[];\n analysis: ScriptAnalysis;\n styles: ComponentStyle[];\n styleScopeId?: string;\n client: boolean;\n expressions?: { id: string; original: string; transformed: string; locals: string[] }[];\n outDir?: string;\n}): string {\n const importPath = options.client ? \"/__resux/runtime-client.mjs\" : \"resuxjs/runtime\";\n const factory = options.client ? \"createClientComponent\" : \"defineComponent\";\n \n const expressionClosures = (options.expressions ?? []).map((expr) => {\n const destructure = expr.locals.length > 0\n ? expr.locals.map(id => `let ${id} = (locals && \"${id}\" in locals) ? locals.${id} : (scope && \"${id}\" in scope) ? scope.${id} : (typeof globalThis !== \"undefined\" && \"${id}\" in globalThis) ? globalThis.${id} : undefined;\n if (typeof ${id} === \"string\" && ${id}.startsWith(\"__rx_callback:\")) {\n const parts = ${id}.split(\":\");\n const cbScopeId = parts[2];\n const cbHandler = parts[3];\n ${id} = async (...args) => {\n const payload = globalThis.__RESUX__;\n if (payload && payload.scopes[cbScopeId]) {\n const comp = await importComponent(payload.scopes[cbScopeId].moduleId, payload.modules, devImportRevision);\n let sRec = scopeCache.get(cbScopeId);\n if (!sRec) {\n sRec = await comp.createScope(payload.scopes[cbScopeId], payload.route);\n scopeCache.set(cbScopeId, sRec);\n }\n const patches = await comp.run(sRec, cbHandler, args[0]);\n const serialized = comp.serialize(sRec);\n payload.scopes[cbScopeId].props = serialized.props;\n payload.scopes[cbScopeId].state = serialized.state;\n payload.scopes[cbScopeId].asyncData = serialized.asyncData;\n applyPatches(cbScopeId, patches);\n }\n };\n }`).join(\"\\n \")\n : \"\";\n return ` ${JSON.stringify(expr.id)}: function(scope, locals) {\n ${destructure}\n return (${expr.transformed});\n },`;\n }).join(\"\\n\");\n\n const importsText = (options.analysis.importDeclarations ?? []).map((decl) => {\n return processImportDeclaration(\n decl,\n options.analysis.sourceFile,\n options.file,\n options.client,\n options.outDir,\n );\n }).filter(Boolean).join(\"\\n\");\n\n const source = [\n `import { ${factory} } from ${JSON.stringify(importPath)};`,\n importsText,\n `const __template = ${JSON.stringify(options.template, null, 2)};`,\n `async function __rx_setup(__ctx) {`,\n `const { ref, reactive, computed, watch, watchEffect, readonly, toRef, toRefs, unref, isRef, isReactive, isReadonly, nextTick, useState, useAsyncData, useRoute, useRouter, useHead, useSeoMeta, useRuntimeConfig, useResuxApp, useResuxImage, apiURL, useFetch, $fetch, useError, clearError, showError, createError, useLazyPackage, useClientPackage, usePackageReady, defineLazyPackage, defineClientOnlyPackage, definePackageAdapter, defineClientEnhancement, useClientEnhancement, onMounted, definePageMeta, defineProps, defineEmits, useLocalePath, useSwitchLocalePath, useI18n, useDevice, $device, importComponent, scopeCache, devImportRevision, applyPatches } = __ctx;`,\n options.analysis.setupBody,\n `const __rx_expressions = {`,\n expressionClosures,\n `};`,\n `return { ${options.analysis.bindings.join(\", \")}, __rx_expressions };`,\n `}`,\n `export default ${factory}({`,\n `id: ${JSON.stringify(options.id)},`,\n `name: ${JSON.stringify(options.name)},`,\n `file: ${JSON.stringify(normalizePath(options.file))},`,\n `script: __rx_setup,`,\n `template: __template,`,\n `templateRefs: ${JSON.stringify(options.templateRefs ?? [])},`,\n `templateForRefs: ${JSON.stringify(options.templateForRefs ?? [])}`,\n `handlers: ${JSON.stringify([...options.analysis.handlerNames])},`,\n `styles: ${JSON.stringify(options.styles)},`,\n `styleScopeId: ${JSON.stringify(options.styleScopeId)},`,\n `meta: ${JSON.stringify(options.analysis.pageMeta ?? {})}`,\n `});`\n ].join(\"\\n\");\n\n return ts.transpileModule(source, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n}\n\nfunction createVueIslandClientSource(island: VueIslandRecord, entryDir: string): string {\n const componentImport = relativeImportPath(entryDir, island.file);\n return [\n `import { createApp } from \"vue\";`,\n `import Component from ${JSON.stringify(componentImport)};`,\n `export function mount(el, props = {}) {`,\n ` const app = createApp(Component, props);`,\n ` app.mount(el);`,\n ` return app;`,\n `}`,\n `export default { mount };`\n ].join(\"\\n\");\n}\n\nfunction relativeImportPath(fromDir: string, file: string): string {\n const relative = normalizePath(path.relative(fromDir, file));\n return relative.startsWith(\".\") ? relative : `./${relative}`;\n}\n\nfunction createServerManifestSource(\n routes: RouteManifestRecord[],\n components: CompiledComponent[],\n layouts: CompiledComponent[],\n plugins: CompiledPlugin[],\n middleware: CompiledMiddleware[],\n serverMiddleware: CompiledServerMiddleware[],\n serverHandlers: ServerHandlerRecord[],\n vueIslands: VueIslandRecord[],\n app?: CompiledComponent,\n error?: CompiledComponent,\n runtimeConfig: Record<string, unknown> = {},\n buildOptions: BuildOptions = {},\n appRoot = process.cwd()\n): string {\n const importSuffix = buildOptions.vite === \"dev\" ? `?t=${Date.now()}` : \"\";\n const serverPlugins = plugins.filter((entry) => entry.mode !== \"client\");\n const clientPlugins = plugins.filter((entry) => entry.mode !== \"server\");\n const serverRouteMiddleware = middleware.filter((entry) => entry.mode !== \"client\");\n const clientRouteMiddleware = middleware.filter((entry) => entry.mode !== \"server\");\n const imports = components.map((component) => `import ${component.id} from \"./${component.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const pluginImports = serverPlugins.map((plugin) => `import ${plugin.id} from \"./resux-plugins/${plugin.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const middlewareImports = serverRouteMiddleware.map((entry) => `import ${entry.id} from \"./resux-middleware/${entry.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const serverMiddlewareImports = serverMiddleware.map((entry) => `import ${entry.id} from \"./request-middleware/${entry.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const handlerImports = serverHandlers.map((handler) => `import ${handler.id} from \"./handlers/${handler.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const componentEntries = components.map((component) => `${JSON.stringify(component.name)}: ${component.id}`).join(\",\\n\");\n const layoutEntries = layouts.map((layout) => `${JSON.stringify(layoutNameFromFile(layout.file))}: ${layout.id}`).join(\",\\n\");\n const moduleEntries = components\n .map((component) => `${JSON.stringify(component.id)}: ${JSON.stringify(`/__resux/handlers/${component.id}.mjs`)}`)\n .join(\",\\n\");\n const vueIslandEntries = vueIslands\n .map((island) => `${JSON.stringify(island.name)}: ${JSON.stringify(`/__resux/vue-islands/${island.name}.mjs`)}`)\n .join(\",\\n\");\n const pluginEntries = serverPlugins\n .map((plugin) => plugin.id)\n .join(\",\\n\");\n const clientPluginEntries = clientPlugins\n .map((plugin) => `{\n id: ${JSON.stringify(plugin.id)},\n file: ${JSON.stringify(normalizePath(plugin.file))},\n mode: ${JSON.stringify(plugin.mode)},\n src: ${JSON.stringify(`/__resux/plugins/${plugin.id}.mjs`)}\n }`)\n .join(\",\\n\");\n const middlewareEntries = serverRouteMiddleware\n .map((entry) => `{\n id: ${JSON.stringify(entry.id)},\n name: ${JSON.stringify(entry.name)},\n file: ${JSON.stringify(normalizePath(entry.file))},\n global: ${JSON.stringify(entry.global)},\n mode: ${JSON.stringify(entry.mode)},\n handler: ${entry.id}\n }`)\n .join(\",\\n\");\n const clientMiddlewareEntries = clientRouteMiddleware\n .map((entry) => `{\n id: ${JSON.stringify(entry.id)},\n name: ${JSON.stringify(entry.name)},\n file: ${JSON.stringify(normalizePath(entry.file))},\n global: ${JSON.stringify(entry.global)},\n mode: ${JSON.stringify(entry.mode)},\n src: ${JSON.stringify(`/__resux/middleware/${entry.id}.mjs`)}\n }`)\n .join(\",\\n\");\n const serverMiddlewareEntries = serverMiddleware\n .map((entry) => `{\n id: ${JSON.stringify(entry.id)},\n file: ${JSON.stringify(normalizePath(entry.file))},\n handler: ${entry.id}\n }`)\n .join(\",\\n\");\n const serverHandlerEntries = serverHandlers\n .map((handler) => `{\n id: ${JSON.stringify(handler.id)},\n path: ${JSON.stringify(handler.path)},\n file: ${JSON.stringify(normalizePath(handler.file))},\n params: ${JSON.stringify(handler.params)},\n handler: ${handler.id},\n match: createMatcher(${JSON.stringify(handler.path)})\n }`)\n .join(\",\\n\");\n const routeEntries = routes\n .map((route) => {\n const component = components.find((candidate) => candidate.id === route.componentId);\n if (!component) {\n throw new Error(`Missing compiled component for ${route.file}.`);\n }\n return `{\n id: ${JSON.stringify(route.id)},\n path: ${JSON.stringify(route.path)},\n file: ${JSON.stringify(normalizePath(route.file))},\n params: ${JSON.stringify(route.params)},\n meta: ${JSON.stringify(route.meta ?? {})},\n component: ${route.componentId},\n match: createMatcher(${JSON.stringify(route.path)})\n }`;\n })\n .join(\",\\n\");\n const appHead = createAppHead(runtimeConfig, appRoot, buildOptions.vite !== \"dev\");\n const appRuntimeConfig = createRuntimeConfig(runtimeConfig);\n const routeRules = createRouteRules(runtimeConfig);\n\n return `${imports}\n${pluginImports}\n${middlewareImports}\n${serverMiddlewareImports}\n${handlerImports}\nexport const app = ${app ? app.id : \"undefined\"};\nexport const errorComponent = ${error ? error.id : \"undefined\"};\nexport const components = {\n${componentEntries}\n};\nexport const layouts = {\n${layoutEntries}\n};\nexport const modules = {\n${moduleEntries}\n};\nexport const vueIslands = {\n${vueIslandEntries}\n};\nexport const resuxPlugins = [\n${pluginEntries}\n];\nexport const clientPlugins = [\n${clientPluginEntries}\n];\nexport const middleware = [\n${middlewareEntries}\n];\nexport const clientMiddleware = [\n${clientMiddlewareEntries}\n];\nexport const serverMiddleware = [\n${serverMiddlewareEntries}\n];\nexport const serverHandlers = [\n${serverHandlerEntries}\n];\nexport const runtimeConfig = ${JSON.stringify(appRuntimeConfig, null, 2)};\nexport const appHead = ${JSON.stringify(appHead, null, 2)};\nexport const routeRules = ${JSON.stringify(routeRules, null, 2)};\nexport const routes = [\n${routeEntries}\n];\nexport function matchRoute(pathname) {\n for (const route of routes) {\n const params = route.match(pathname);\n if (params) return { route, params };\n }\n return null;\n}\nexport function matchServerHandler(pathname) {\n for (const route of serverHandlers) {\n const params = route.match(pathname);\n if (params) return { route, params };\n }\n return null;\n}\nfunction createMatcher(pattern) {\n const names = [];\n const source = pattern === \"/\" ? \"^/$\" : \"^\" + pattern.split(\"/\").map((part) => {\n if (!part) return \"\";\n if (part.startsWith(\":\") && part.endsWith(\"*\")) {\n names.push(part.slice(1, -1));\n return \"(?:/(.*))?\";\n }\n if (part.startsWith(\":\")) {\n names.push(part.slice(1));\n return \"/([^/]+)\";\n }\n return \"/\" + part.replace(/[.*+?^${\"${\"}}()|[\\\\]\\\\\\\\]/g, \"\\\\\\\\$&\");\n }).join(\"\") + \"$\";\n const regex = new RegExp(source);\n return (pathname) => {\n const match = regex.exec(pathname);\n if (!match) return null;\n const params = {};\n names.forEach((name, index) => {\n params[name] = decodeURIComponent(match[index + 1] ?? \"\");\n });\n return params;\n };\n}\n`;\n}\n\nfunction createAppHead(\n runtimeConfig: Record<string, unknown>,\n appRoot: string,\n optimizeCss: boolean,\n) {\n const config = runtimeConfig as ResuxConfig;\n const head = typeof config.app === \"object\" && config.app && \"head\" in config.app\n ? config.app.head\n : {};\n const headObject = typeof head === \"object\" && head ? head as Record<string, unknown> : {};\n const performanceConfig = readPerformanceRuntimeConfig(config);\n const csp = readSecurityContentSecurityPolicy(config, headObject);\n const inlineCss = optimizeCss\n && performanceConfig !== null\n && performanceConfig.inlineCss !== false\n && allowsInlineStyleForCsp(csp);\n const inlineCssMaxBytes = performanceConfig && Number.isFinite(performanceConfig.inlineCssMaxBytes)\n ? Math.max(0, Math.floor(performanceConfig.inlineCssMaxBytes as number))\n : 65_536;\n\n const cssEntries = collectConfiguredCssEntries(\n config.css,\n appRoot,\n inlineCss ? inlineCssMaxBytes : 0,\n );\n const { links: cssLinks, styles: criticalStyles } = splitCssEntriesPreservingOrder(cssEntries);\n const configuredLinks = Array.isArray(headObject.link)\n ? headObject.link as Array<Record<string, unknown>>\n : [];\n const configuredScripts = Array.isArray(headObject.script)\n ? headObject.script as Array<Record<string, unknown>>\n : [];\n const inlineScriptAttributeAllowed = allowsInlineScriptAttributeForCsp(csp);\n const inlineScriptElementAllowed = allowsInlineScriptElementForCsp(csp);\n\n return {\n ...headObject,\n link: [\n ...normalizeFontLinksForCsp(\n configuredLinks,\n inlineScriptAttributeAllowed,\n inlineScriptElementAllowed,\n ),\n ...cssLinks,\n ],\n style: [\n ...criticalStyles,\n ...((Array.isArray(headObject.style)\n ? headObject.style\n : []) as Array<Record<string, unknown> | string>),\n ],\n script: inlineScriptElementAllowed\n ? configuredScripts\n : configuredScripts.filter((entry) => !isResuxFontLoaderScript(entry)),\n };\n}\n\ninterface ConfiguredCssEntry {\n href: string;\n css: string | null;\n}\n\nfunction collectConfiguredCssEntries(\n cssConfig: unknown,\n appRoot: string,\n inlineCssMaxBytes: number,\n): ConfiguredCssEntry[] {\n if (!Array.isArray(cssConfig)) {\n return [];\n }\n\n return cssConfig\n .map((cssEntry) => String(cssEntry ?? \"\").trim())\n .filter(Boolean)\n .map((href) => ({\n href,\n css: inlineCssMaxBytes > 0\n ? readInlinePublicCss(appRoot, href, inlineCssMaxBytes)\n : null,\n }));\n}\n\nfunction splitCssEntriesPreservingOrder(entries: ConfiguredCssEntry[]): {\n links: Array<Record<string, string>>;\n styles: Array<{ id: string; css: string }>;\n} {\n const lastLinkedCssIndex = entries.reduce(\n (lastIndex, entry, index) => entry.css === null ? index : lastIndex,\n -1,\n );\n const links: Array<Record<string, string>> = [];\n const styles: Array<{ id: string; css: string }> = [];\n\n entries.forEach((entry, index) => {\n if (entry.css !== null && index > lastLinkedCssIndex) {\n styles.push({\n id: `resux-critical-${createHash(\"sha256\").update(entry.href).digest(\"hex\").slice(0, 12)}`,\n css: entry.css,\n });\n return;\n }\n links.push({ rel: \"stylesheet\", href: entry.href });\n });\n\n return { links, styles };\n}\n\nfunction readPerformanceRuntimeConfig(config: ResuxConfig): Record<string, unknown> | null {\n const runtime = isPlainObject(config.runtimeConfig) ? config.runtimeConfig as Record<string, unknown> : {};\n const publicConfig = isPlainObject(runtime.public) ? runtime.public as Record<string, unknown> : {};\n return isPlainObject(publicConfig.performanceModule)\n ? publicConfig.performanceModule as Record<string, unknown>\n : null;\n}\n\nfunction readSecurityContentSecurityPolicy(\n config: ResuxConfig,\n head: Record<string, unknown>,\n): string {\n const runtime = isPlainObject(config.runtimeConfig)\n ? config.runtimeConfig as Record<string, unknown>\n : {};\n const security = isPlainObject(runtime.resuxSecurity)\n ? runtime.resuxSecurity as Record<string, unknown>\n : {};\n const configured = firstString(security.contentSecurityPolicy);\n if (configured) {\n return configured;\n }\n\n const meta = Array.isArray(head.meta) ? head.meta : [];\n for (const entry of meta) {\n if (!isPlainObject(entry)) continue;\n const httpEquiv = String(entry[\"http-equiv\"] ?? entry.httpEquiv ?? \"\").trim().toLowerCase();\n if (httpEquiv !== \"content-security-policy\") continue;\n const content = firstString(entry.content);\n if (content) return content;\n }\n return \"\";\n}\n\nfunction allowsInlineStyleForCsp(csp: string): boolean {\n const sources = cspDirectiveSources(csp, [\"style-src-elem\", \"style-src\", \"default-src\"]);\n return sources === null || sources.includes(\"'unsafe-inline'\");\n}\n\nfunction allowsInlineScriptAttributeForCsp(csp: string): boolean {\n const sources = cspDirectiveSources(csp, [\"script-src-attr\", \"script-src\", \"default-src\"]);\n return sources === null || sources.includes(\"'unsafe-inline'\");\n}\n\nfunction allowsInlineScriptElementForCsp(csp: string): boolean {\n const sources = cspDirectiveSources(csp, [\"script-src-elem\", \"script-src\", \"default-src\"]);\n return sources === null || sources.includes(\"'unsafe-inline'\");\n}\n\nfunction normalizeFontLinksForCsp(\n links: Array<Record<string, unknown>>,\n inlineScriptAttributeAllowed: boolean,\n inlineScriptElementAllowed: boolean,\n): Array<Record<string, unknown>> {\n return links.map((link) => {\n const next = { ...link };\n const needsInlineAttribute = next[\"data-resux-font-async\"] === \"true\";\n const needsInlineScript = next[\"data-resux-font-lazy\"] === \"true\";\n if (\n (needsInlineAttribute && !inlineScriptAttributeAllowed)\n || (needsInlineScript && !inlineScriptElementAllowed)\n ) {\n delete next.media;\n delete next.onload;\n delete next[\"data-resux-font-async\"];\n delete next[\"data-resux-font-lazy\"];\n }\n return next;\n });\n}\n\nfunction isResuxFontLoaderScript(entry: Record<string, unknown>): boolean {\n return entry[\"data-resux-font-loader\"] === \"true\";\n}\n\nfunction readInlinePublicCss(appRoot: string, href: string, maxBytes: number): string | null {\n if (\n maxBytes <= 0\n || !href.startsWith(\"/\")\n || href.startsWith(\"//\")\n || href.includes(\"..\")\n || /^[a-z][a-z0-9+.-]*:/i.test(href)\n ) {\n return null;\n }\n\n const pathname = href.split(/[?#]/, 1)[0];\n if (!pathname.toLowerCase().endsWith(\".css\")) {\n return null;\n }\n\n const publicRoot = path.resolve(appRoot, \"public\");\n const staticRoot = path.resolve(appRoot, \"static\");\n const relativePath = pathname.replace(/^[/\\\\]+/, \"\");\n const candidates = [\n { root: publicRoot, candidate: path.resolve(publicRoot, relativePath) },\n { root: staticRoot, candidate: path.resolve(staticRoot, relativePath) },\n ];\n\n for (const { root, candidate } of candidates) {\n if (!isPathWithinBoundary(root, candidate) || !existsSync(candidate)) {\n continue;\n }\n const css = ts.sys.readFile(candidate);\n if (\n typeof css !== \"string\"\n || Buffer.byteLength(css, \"utf8\") > maxBytes\n || hasRelativeCssReferences(css)\n ) {\n continue;\n }\n return css;\n }\n\n return null;\n}\n\nfunction hasRelativeCssReferences(css: string): boolean {\n const urlPattern = /url\\(\\s*(?:\"([^\"]*)\"|'([^']*)'|([^)\"']+))\\s*\\)/gi;\n for (const match of css.matchAll(urlPattern)) {\n const value = String(match[1] ?? match[2] ?? match[3] ?? \"\").trim();\n if (isRelativeCssReference(value)) {\n return true;\n }\n }\n\n const importPattern = /@import\\s+(?:url\\(\\s*)?(?:\"([^\"]*)\"|'([^']*)'|([^\\s;)]+))/gi;\n for (const match of css.matchAll(importPattern)) {\n const value = String(match[1] ?? match[2] ?? match[3] ?? \"\").trim();\n if (isRelativeCssReference(value)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isRelativeCssReference(value: string): boolean {\n if (!value || value.startsWith(\"/\") || value.startsWith(\"#\") || value.startsWith(\"//\")) {\n return false;\n }\n return !/^(?:data|blob|https?):/i.test(value);\n}\n\nfunction scanRuntimeConfigForSecrets(config: Record<string, unknown>, halalConfig: any): void {\n const publicConfig = config.public as Record<string, unknown> | undefined;\n if (!publicConfig || typeof publicConfig !== \"object\") {\n return;\n }\n\n const isStrict = halalConfig?.strict === true;\n const unsafeKeys = [\"SECRET\", \"TOKEN\", \"PASSWORD\", \"PRIVATE\", \"DATABASE\", \"KEY\"];\n const secretValuePatterns = [\n /^[a-f0-9]{32,128}$/i,\n /ey[a-zA-Z0-9_-]{15,}\\.ey[a-zA-Z0-9_-]{15,}\\.[a-zA-Z0-9_-]{15,}/,\n /sk_live_[0-9a-zA-Z]{24}/,\n /AIzaSy[0-9a-zA-Z_-]{33}/,\n /amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}/i,\n /https?:\\/\\/[^/]+:[^/]+@/\n ];\n\n for (const [key, value] of Object.entries(publicConfig)) {\n const upperKey = key.toUpperCase();\n const matchesUnsafeKey = unsafeKeys.some(unsafe => upperKey.includes(unsafe));\n if (matchesUnsafeKey) {\n const msg = `[resux-safety] Unsafe key name \"${key}\" found in public runtimeConfig. Do not expose secrets to the client.`;\n if (isStrict) {\n throw new Error(msg);\n } else {\n console.warn(`\\x1b[33m${msg}\\x1b[0m`);\n }\n }\n\n if (typeof value === \"string\") {\n const looksLikeSecret = secretValuePatterns.some(pattern => pattern.test(value));\n if (looksLikeSecret) {\n const msg = `[resux-safety] Value of public runtimeConfig key \"${key}\" looks like a private credential or API secret. Do not expose secrets to the client.`;\n if (isStrict) {\n throw new Error(msg);\n } else {\n console.warn(`\\x1b[33m${msg}\\x1b[0m`);\n }\n }\n }\n }\n}\n\nfunction createRuntimeConfig(config: Record<string, unknown>): Record<string, unknown> {\n const runtimeConfig = (config as ResuxConfig).runtimeConfig;\n const packagesConfig = isPlainObject((config as ResuxConfig).packages)\n ? (config as ResuxConfig).packages as Record<string, unknown>\n : null;\n const videoConfig = isPlainObject((config as ResuxConfig).video)\n ? (config as ResuxConfig).video as Record<string, unknown>\n : null;\n const routerConfig = isPlainObject(config.router)\n ? config.router\n : null;\n const publicConfig = (runtimeConfig?.public && typeof runtimeConfig.public === \"object\" && !Array.isArray(runtimeConfig.public))\n ? runtimeConfig.public as Record<string, unknown>\n : {};\n const appRuntimeConfig = {\n ...(runtimeConfig ?? {}),\n public: {\n ...publicConfig,\n ...(packagesConfig ? { packages: packagesConfig } : {}),\n ...(videoConfig ? { video: videoConfig } : {}),\n ...(routerConfig ? { router: routerConfig } : {}),\n }\n };\n\n const halalConfig = (config as any).halalAI;\n scanRuntimeConfigForSecrets(appRuntimeConfig, halalConfig);\n\n return appRuntimeConfig;\n}\n\nfunction createRouteRules(config: Record<string, unknown>): Record<string, RouteRuleConfig> {\n const routeRules = (config as ResuxConfig).routeRules;\n\n if (!routeRules || typeof routeRules !== \"object\" || Array.isArray(routeRules)) {\n return {};\n }\n\n const normalized: Record<string, RouteRuleConfig> = {};\n\n for (const [routePath, rule] of Object.entries(routeRules)) {\n if (!routePath.startsWith(\"/\") || !rule || typeof rule !== \"object\" || Array.isArray(rule)) {\n continue;\n }\n\n const routeRule = rule as RouteRuleConfig;\n normalized[routePath] = {\n ...(routeRule.headers && typeof routeRule.headers === \"object\" ? { headers: normalizeStringRecord(routeRule.headers) } : {}),\n ...(typeof routeRule.redirect === \"string\" || isRedirectObject(routeRule.redirect)\n ? { redirect: routeRule.redirect }\n : {}),\n ...(isStatusCode(routeRule.statusCode) ? { statusCode: routeRule.statusCode } : {}),\n ...(normalizeCacheRule(routeRule.cache) !== undefined ? { cache: normalizeCacheRule(routeRule.cache) } : {}),\n ...(normalizeCorsRule(routeRule.cors) !== undefined ? { cors: normalizeCorsRule(routeRule.cors) } : {})\n };\n }\n\n return normalized;\n}\n\nfunction isStatusCode(value: unknown): value is number {\n return Number.isInteger(value) && (value as number) >= 100 && (value as number) <= 599;\n}\n\nfunction normalizeCacheRule(value: RouteRuleConfig[\"cache\"]): RouteRuleConfig[\"cache\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (value === false || typeof value === \"string\") {\n return value;\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n\n const cache: { maxAge?: number; swr?: number } = {};\n if (Number.isFinite(value.maxAge) && value.maxAge! >= 0) {\n cache.maxAge = Math.floor(value.maxAge!);\n }\n if (Number.isFinite(value.swr) && value.swr! >= 0) {\n cache.swr = Math.floor(value.swr!);\n }\n return Object.keys(cache).length > 0 ? cache : undefined;\n}\n\nfunction normalizeCorsRule(value: RouteRuleConfig[\"cors\"]): RouteRuleConfig[\"cors\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n\n return {\n ...(typeof value.origin === \"string\" ? { origin: value.origin } : {}),\n ...(Array.isArray(value.methods) ? { methods: value.methods.map(String) } : {}),\n ...(Array.isArray(value.headers) ? { headers: value.headers.map(String) } : {}),\n ...(typeof value.credentials === \"boolean\" ? { credentials: value.credentials } : {})\n };\n}\n\nfunction normalizeStringRecord(record: Record<string, unknown>): Record<string, string> {\n const output: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(record)) {\n if (value !== undefined && value !== null) {\n output[key] = String(value);\n }\n }\n\n return output;\n}\n\nfunction isRedirectObject(value: unknown): value is { to: string; statusCode?: number } {\n return Boolean(\n value\n && typeof value === \"object\"\n && !Array.isArray(value)\n && typeof (value as { to?: unknown }).to === \"string\"\n );\n}\n\nfunction layoutNameFromFile(file: string): string {\n return kebabCase(path.basename(file, \".vue\"));\n}\n\nfunction supportFileMode(file: string): \"all\" | \"server\" | \"client\" {\n if (file.includes(\".client.\")) {\n return \"client\";\n }\n if (file.includes(\".server.\")) {\n return \"server\";\n }\n return \"all\";\n}\n\nfunction supportFileBaseName(file: string): string {\n const extensionStripped = path.basename(file).replace(/\\.[cm]?[tj]s$/, \"\");\n return extensionStripped.replace(/(?:\\.global|\\.client|\\.server)+$/, \"\");\n}\n\nfunction compilePluginFile(file: string, index: number): CompiledPlugin {\n const mode = supportFileMode(file);\n return {\n id: `p${index}`,\n file,\n mode,\n serverSource: transpileSupportModule(file, {\n prefix: `import { defineResuxPlugin } from \"resuxjs/runtime\";\\nconst defineNuxtPlugin = defineResuxPlugin;\\n`,\n autoImports: [{\n from: \"resuxjs/runtime\",\n names: SUPPORT_CLIENT_RUNTIME_HELPERS,\n }],\n }),\n clientSource: transpileSupportModule(file, {\n prefix: `import { defineResuxPlugin } from \"/__resux/runtime-client.mjs\";\\nconst defineNuxtPlugin = defineResuxPlugin;\\n`,\n autoImports: [{\n from: \"/__resux/runtime-client.mjs\",\n names: SUPPORT_CLIENT_RUNTIME_HELPERS,\n }],\n rewriteImports: {\n \"resuxjs\": \"/__resux/runtime-client.mjs\",\n \"resuxjs/runtime\": \"/__resux/runtime-client.mjs\",\n },\n })\n };\n}\n\nfunction compileMiddlewareFile(file: string, index: number): CompiledMiddleware {\n const baseName = supportFileBaseName(file);\n const mode = supportFileMode(file);\n const global = /\\.global(?:\\.(?:client|server))?\\.[cm]?[tj]s$/.test(file);\n\n return {\n id: `w${index}`,\n name: kebabCase(baseName),\n file,\n mode,\n global,\n serverSource: transpileSupportModule(\n file,\n `import { defineResuxRouteMiddleware, navigateTo, abortNavigation } from \"resuxjs/runtime\";\\n`\n ),\n clientSource: transpileSupportModule(\n file,\n `import { defineResuxRouteMiddleware, defineClientRouteRedirect as navigateTo, defineClientRouteAbort as abortNavigation } from \"/__resux/runtime-client.mjs\";\\n`\n )\n };\n}\n\nfunction compileServerMiddlewareFile(file: string, index: number): CompiledServerMiddleware {\n return {\n id: `s${index}`,\n file,\n source: transpileSupportModule(file, `import { defineServerMiddleware, defineEventHandler, eventHandler, readBody, getQuery, setHeader } from \"resuxjs/runtime\";\\n`)\n };\n}\n\nfunction compileServerHandlerFile(file: string, index: number, routePath: string): ServerHandlerRecord {\n const params = collectRouteParams(routePath);\n\n return {\n id: `h${index}`,\n path: routePath,\n file,\n params,\n source: transpileSupportModule(file, `import { defineEventHandler, eventHandler, readBody, getQuery, setHeader } from \"resuxjs/runtime\";\\n`)\n };\n}\n\nfunction transpileSupportModule(file: string, input: string | SupportModuleTranspileOptions = \"\"): string {\n const source = ts.sys.readFile(file) ?? \"\";\n const options: SupportModuleTranspileOptions = typeof input === \"string\"\n ? { prefix: input }\n : input;\n const rewrittenSource = rewriteSupportModuleImports(source, options.rewriteImports);\n const autoImportPrefix = createSupportModuleAutoImportPrefix(file, rewrittenSource, options.autoImports ?? []);\n return ts.transpileModule(`${options.prefix ?? \"\"}${autoImportPrefix}${rewrittenSource}`, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n}\n\nfunction rewriteSupportModuleImports(source: string, rewrites?: Record<string, string>): string {\n if (!rewrites || Object.keys(rewrites).length === 0) {\n return source;\n }\n let output = source;\n for (const [from, to] of Object.entries(rewrites)) {\n if (!from || !to || from === to) {\n continue;\n }\n const escapedFrom = escapeRegExp(from);\n output = output.replace(\n new RegExp(`(\\\\bfrom\\\\s+[\"'])${escapedFrom}([\"'])`, \"g\"),\n `$1${to}$2`,\n );\n output = output.replace(\n new RegExp(`(\\\\bimport\\\\s*\\\\(\\\\s*[\"'])${escapedFrom}([\"']\\\\s*\\\\))`, \"g\"),\n `$1${to}$2`,\n );\n }\n return output;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction createSupportModuleAutoImportPrefix(\n file: string,\n source: string,\n autoImports: Array<{ from: string; names: readonly string[] }>,\n): string {\n if (!autoImports.length) {\n return \"\";\n }\n\n const declared = collectSupportModuleTopLevelBindings(file, source);\n const lines: string[] = [];\n\n for (const entry of autoImports) {\n const seen = new Set<string>();\n const names: string[] = [];\n\n for (const name of entry.names) {\n if (seen.has(name) || declared.has(name)) {\n continue;\n }\n seen.add(name);\n const pattern = new RegExp(`\\\\b${name}\\\\b`);\n if (!pattern.test(source)) {\n continue;\n }\n names.push(name);\n }\n\n if (names.length > 0) {\n lines.push(`import { ${names.join(\", \")} } from ${JSON.stringify(entry.from)};`);\n }\n }\n\n if (!lines.length) {\n return \"\";\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nfunction collectSupportModuleTopLevelBindings(file: string, source: string): Set<string> {\n const bindings = new Set<string>();\n const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.ES2022, true, ts.ScriptKind.TS);\n\n for (const statement of sourceFile.statements) {\n if (ts.isImportDeclaration(statement)) {\n const clause = statement.importClause;\n if (!clause) {\n continue;\n }\n if (clause.name) {\n bindings.add(clause.name.text);\n }\n if (clause.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) {\n bindings.add(clause.namedBindings.name.text);\n } else {\n for (const element of clause.namedBindings.elements) {\n bindings.add(element.name.text);\n }\n }\n }\n continue;\n }\n\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n for (const name of collectBindingNames(declaration.name)) {\n bindings.add(name);\n }\n }\n continue;\n }\n\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isClassDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isEnumDeclaration(statement)) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isTypeAliasDeclaration(statement)) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isInterfaceDeclaration(statement)) {\n bindings.add(statement.name.text);\n continue;\n }\n }\n\n return bindings;\n}\n\ninterface RuntimeConfigReadResult {\n config: Record<string, unknown>;\n moduleContainer: ResuxModuleContainer;\n}\n\nasync function readRuntimeConfig(root: string, outDir: string, hooks: ResuxHooks): Promise<RuntimeConfigReadResult> {\n const moduleContainer = new ResuxModuleContainer();\n const candidates = [\n \"resux.config.ts\",\n \"resux.config.mjs\",\n \"resux.config.js\"\n ];\n\n for (const candidate of candidates) {\n const file = await optionalFile(path.join(root, candidate));\n if (!file) {\n continue;\n }\n\n const source = normalizeConfigHelpers(await readFile(file, \"utf8\"));\n const outputFile = path.join(outDir, \"server\", \"config.mjs\");\n const compiled = ts.transpileModule(source, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022\n }\n }).outputText;\n await writeFile(outputFile, compiled, \"utf8\");\n const imported = await import(`${pathToFileURL(outputFile).href}?t=${Date.now()}`);\n const config = (imported.default ?? {}) as ResuxConfig;\n Object.assign(config, createResux({ rootDir: root, buildDir: outDir, config }).options);\n const context = moduleContainer.createContext(config, root, outDir, hooks);\n await applyConfiguredModules(config, root, outDir, context);\n delete config.modules;\n await writeFile(outputFile, `export default ${JSON.stringify(config, null, 2)};`, \"utf8\");\n return { config, moduleContainer };\n }\n\n return { config: createResux({ rootDir: root, buildDir: outDir, config: {} }).options, moduleContainer };\n}\n\nfunction normalizeConfigHelpers(source: string): string {\n return source\n .replace(/\\bdefineResuxConfig\\s*\\(/g, \"(\")\n .replace(/\\bdefineResuxModule\\s*\\(/g, \"(\");\n}\n\nasync function applyConfiguredModules(\n config: ResuxConfig,\n root: string,\n outDir: string,\n context: ResuxModuleContext\n): Promise<void> {\n const modules = Array.isArray(config.modules) ? config.modules : [];\n\n for (const moduleEntry of modules) {\n const { module, options } = await resolveModuleEntry(moduleEntry, root, outDir);\n const setup = getModuleSetup(module);\n await Promise.resolve(withResuxKitContext(context, () => setup(createModuleOptions(module, options), context)));\n }\n}\n\nfunction deepMerge<T extends Record<string, unknown>>(base: T, next: Record<string, unknown>): T {\n const output = { ...base } as Record<string, unknown>;\n\n for (const [key, value] of Object.entries(next)) {\n const current = output[key];\n output[key] = isPlainObject(current) && isPlainObject(value)\n ? deepMerge(current, value)\n : value;\n }\n\n return output as T;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === \"object\" && !Array.isArray(value));\n}\n\nasync function resolveModuleEntry(\n entry: unknown,\n root: string,\n outDir: string\n): Promise<{ module: unknown; options: unknown }> {\n if (Array.isArray(entry)) {\n return {\n module: await loadModule(entry[0], root, outDir),\n options: entry[1] ?? {}\n };\n }\n\n return {\n module: await loadModule(entry, root, outDir),\n options: {}\n };\n}\n\nasync function loadModule(module: unknown, root: string, outDir: string): Promise<unknown> {\n if (typeof module === \"function\" || isPlainObject(module)) {\n return module;\n }\n\n if (typeof module !== \"string\") {\n throw new Error(\"Resux modules must be functions, module objects, module specifiers, or [module, options] tuples.\");\n }\n\n const builtin = resolveBuiltinModule(module);\n if (builtin) {\n return builtin;\n }\n\n const resolved = resolveModuleSpecifier(module, root);\n const imported = await import(`${await moduleImportUrl(resolved, outDir)}?t=${Date.now()}`);\n return imported.default ?? imported;\n}\n\nfunction getModuleSetup(module: unknown): ResuxModuleSetup {\n if (typeof module === \"function\") {\n return module as ResuxModuleSetup;\n }\n\n if (isPlainObject(module) && typeof module.setup === \"function\") {\n return module.setup as ResuxModuleSetup;\n }\n\n throw new Error(\"Resux modules must export a setup function or defineResuxModule({ setup }).\");\n}\n\nfunction createModuleOptions(module: unknown, options: unknown): unknown {\n if (isPlainObject(module) && isPlainObject(module.defaults)) {\n return {\n ...module.defaults,\n ...(isPlainObject(options) ? options : {})\n };\n }\n\n return options;\n}\n\nfunction resolveBuiltinModule(specifier: string): BuiltinResuxModule | null {\n const normalized = specifier.startsWith(\"resux:\") ? specifier.slice(\"resux:\".length) : specifier;\n return builtinModules[normalized] ?? null;\n}\n\nconst i18nBuiltinModule: BuiltinResuxModule = {\n async setup(options, resux) {\n const imported = await import(\"../i18n/index.js\");\n const module = imported.default ?? imported;\n const setup = getModuleSetup(module);\n await setup(options, resux);\n }\n};\n\nconst builtinModules: Record<string, BuiltinResuxModule> = {\n i18n: i18nBuiltinModule,\n \"resuxjs/i18n\": i18nBuiltinModule,\n \"@resuxjs/i18n\": i18nBuiltinModule,\n security: {\n defaults: {\n route: \"/**\",\n contentSecurityPolicy: false\n },\n setup(options, resux) {\n const input = isPlainObject(options) ? options : {};\n const routePath = firstString(input.route) ?? \"/**\";\n const headers: Record<string, string> = {\n \"x-content-type-options\": \"nosniff\",\n \"referrer-policy\": \"strict-origin-when-cross-origin\",\n \"x-frame-options\": \"SAMEORIGIN\",\n \"cross-origin-opener-policy\": \"same-origin\",\n \"permissions-policy\": \"camera=(), microphone=(), geolocation=()\",\n ...(isPlainObject(input.headers) ? normalizeStringRecord(input.headers) : {})\n };\n const csp = firstString(input.contentSecurityPolicy);\n\n if (csp) {\n headers[\"content-security-policy\"] = csp;\n }\n\n resux.addRouteRule(routePath, { headers });\n resux.extendRuntimeConfig({\n public: { securityHeaders: true },\n resuxSecurity: {\n contentSecurityPolicy: csp ?? \"\",\n route: routePath,\n },\n });\n }\n },\n performance: {\n defaults: {\n assetMaxAge: 31536000,\n routePayloadNoStore: true,\n inlineCss: true,\n inlineCssMaxBytes: 65_536\n },\n setup(options, resux) {\n const input = isPlainObject(options) ? options : {};\n const maxAge = Number.isFinite(input.assetMaxAge) ? Math.max(0, Math.floor(input.assetMaxAge as number)) : 31536000;\n const inlineCss = input.inlineCss !== false;\n const inlineCssMaxBytes = Number.isFinite(input.inlineCssMaxBytes)\n ? Math.max(0, Math.floor(input.inlineCssMaxBytes as number))\n : 65_536;\n const assetCache = { maxAge };\n resux.addRouteRule(\"/__resux/runtime-client.mjs\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/handlers/**\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/vue-islands/**\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/image\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/video\", { cache: assetCache });\n\n if (input.routePayloadNoStore !== false) {\n resux.addRouteRule(\"/__resux/route\", { cache: false });\n }\n\n resux.extendRuntimeConfig({\n public: {\n performanceModule: {\n assetMaxAge: maxAge,\n inlineCss,\n inlineCssMaxBytes,\n },\n },\n });\n }\n }\n};\n\nfunction firstString(value: unknown): string | null {\n return typeof value === \"string\" && value.length > 0 ? value : null;\n}\n\nfunction resolveModuleSpecifier(specifier: string, root: string): string {\n if (specifier.startsWith(\".\") || specifier.startsWith(\"/\") || specifier.startsWith(\"file:\")) {\n const resolved = specifier.startsWith(\"file:\")\n ? new URL(specifier)\n : path.resolve(root, specifier);\n const file = resolved instanceof URL ? fileURLToPath(resolved) : resolved;\n return resolveLocalModuleFile(file);\n }\n\n return require.resolve(specifier, { paths: [root] });\n}\n\nfunction resolveLocalModuleFile(file: string): string {\n const candidates = [\n file,\n `${file}.ts`,\n `${file}.mts`,\n `${file}.js`,\n `${file}.mjs`,\n path.join(file, \"index.ts\"),\n path.join(file, \"index.mts\"),\n path.join(file, \"index.js\"),\n path.join(file, \"index.mjs\")\n ];\n const found = candidates.find((candidate) => ts.sys.fileExists(candidate));\n\n if (!found) {\n throw new Error(`Cannot resolve Resux module \"${file}\".`);\n }\n\n return found;\n}\n\nasync function moduleImportUrl(file: string, outDir: string): Promise<string> {\n if (/\\.[cm]?ts$/.test(file)) {\n const outputFile = path.join(outDir, \"server\", \"config-modules\", `${safeModuleFileName(file)}.mjs`);\n await writeFile(outputFile, transpileConfigSupportModule(file), \"utf8\");\n return pathToFileURL(outputFile).href;\n }\n\n return pathToFileURL(file).href;\n}\n\nfunction transpileConfigSupportModule(file: string): string {\n const source = normalizeConfigHelpers(ts.sys.readFile(file) ?? \"\");\n return ts.transpileModule(source, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n}\n\nfunction safeModuleFileName(file: string): string {\n return normalizePath(path.resolve(file)).replace(/[^A-Za-z0-9_-]+/g, \"_\");\n}\n\nfunction nextBindingId(state: CompileTemplateState): string {\n return `b${state.bindingIndex++}`;\n}\n\nfunction nextInlineHandlerName(state: CompileTemplateState): string {\n return `__rx_inline_${state.inlineHandlerIndex++}`;\n}\n\nfunction routeScore(routePath: string): number {\n return routePath\n .split(\"/\")\n .filter(Boolean)\n .reduce((score, part) => score + (part.startsWith(\":\") ? 1 : 3), 0);\n}\n\nasync function discoverVueFiles(dir: string): Promise<string[]> {\n try {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: string[] = [];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...await discoverVueFiles(fullPath));\n } else if (entry.isFile() && entry.name.endsWith(\".vue\")) {\n files.push(fullPath);\n }\n }\n\n return files.sort();\n } catch {\n return [];\n }\n}\n\nasync function discoverAppVueFiles(root: string, dirName: string): Promise<string[]> {\n return unique([\n ...await discoverVueFiles(path.join(root, dirName)),\n ...await discoverVueFiles(path.join(root, \"app\", dirName))\n ]);\n}\n\nasync function discoverVueFilesFromDirs(dirs: string[]): Promise<string[]> {\n const files: string[] = [];\n for (const dir of dirs) {\n files.push(...await discoverVueFiles(dir));\n }\n return unique(files);\n}\n\nasync function discoverSupportTsFiles(root: string, dirName: string): Promise<string[]> {\n const dirs = [path.join(root, dirName), path.join(root, \"app\", dirName)];\n const files: string[] = [];\n\n for (const dir of dirs) {\n files.push(...await discoverSupportTsFilesInDir(dir));\n }\n\n return unique(files).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n}\n\nfunction isClientEnhancementSupportFile(file: string): boolean {\n return /\\.client\\.[cm]?[tj]s$/.test(file) && !/\\.d\\.[cm]?[tj]s$/.test(file);\n}\n\nasync function discoverClientEnhancementFiles(root: string): Promise<string[]> {\n const files: string[] = [];\n for (const relativeDir of CLIENT_ENHANCEMENT_DIR_CANDIDATES) {\n const absoluteDir = path.join(root, relativeDir);\n files.push(...await discoverSupportTsFilesInDir(absoluteDir));\n }\n return unique(files)\n .map((file) => path.resolve(file))\n .filter((file) => isClientEnhancementSupportFile(file))\n .sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n}\n\nasync function discoverAutoImportsFromDirs(\n root: string,\n dirs: string[]\n): Promise<Array<{ from: string; name: string; as?: string }>> {\n const entries: Array<{ from: string; name: string; as?: string }> = [];\n for (const dir of dirs) {\n const files = await discoverSupportTsFilesInDir(dir);\n for (const file of files) {\n const source = await readFile(file, \"utf8\");\n const names = collectNamedExportsFromSource(file, source);\n const relative = normalizePath(path.relative(root, file).replace(/\\.[cm]?[tj]s$/, \"\"));\n const from = relative.startsWith(\".\") ? relative : `./${relative}`;\n for (const name of names) {\n entries.push({ from, name });\n }\n }\n }\n return dedupeImports(entries);\n}\n\nfunction collectNamedExportsFromSource(file: string, source: string): string[] {\n const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.ES2022, true, ts.ScriptKind.TS);\n const names = new Set<string>();\n for (const statement of sourceFile.statements) {\n if (!isStatementExported(statement)) {\n continue;\n }\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n names.add(statement.name.text);\n continue;\n }\n if (ts.isClassDeclaration(statement) && statement.name) {\n names.add(statement.name.text);\n continue;\n }\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name)) {\n names.add(declaration.name.text);\n }\n }\n continue;\n }\n if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)) {\n for (const specifier of statement.exportClause.elements) {\n names.add(specifier.name.text);\n }\n }\n }\n return [...names].sort();\n}\n\nfunction isStatementExported(statement: ts.Statement): boolean {\n const modifiers = ts.canHaveModifiers(statement) ? ts.getModifiers(statement) : undefined;\n return Boolean(modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword));\n}\n\nfunction uniqueServerHandlers(records: Array<{ file: string; path: string }>): Array<{ file: string; path: string }> {\n const map = new Map<string, { file: string; path: string }>();\n for (const record of records) {\n const key = `${normalizeRoutePath(record.path)}::${normalizePath(path.resolve(record.file))}`;\n map.set(key, { file: path.resolve(record.file), path: normalizeRoutePath(record.path) });\n }\n return [...map.values()].sort((left, right) => left.path.localeCompare(right.path) || normalizePath(left.file).localeCompare(normalizePath(right.file)));\n}\n\nasync function writeModuleTemplates(outDir: string, contributions: ResuxModuleContributions): Promise<string[]> {\n const written: string[] = [];\n for (const template of [...contributions.templates, ...contributions.typeTemplates]) {\n if (template.write === false) {\n continue;\n }\n const target = path.join(outDir, \"templates\", template.filename);\n await mkdir(path.dirname(target), { recursive: true });\n await writeFile(target, await template.getContents(), \"utf8\");\n written.push(target);\n }\n return written.sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n}\n\ninterface RuntimeArtifactsInput {\n routes: RouteManifestRecord[];\n components: CompiledComponent[];\n layouts: CompiledComponent[];\n plugins: CompiledPlugin[];\n clientEnhancements: ClientEnhancementManifestEntry[];\n middleware: CompiledMiddleware[];\n serverMiddleware: CompiledServerMiddleware[];\n serverHandlers: ServerHandlerRecord[];\n vueIslands: VueIslandRecord[];\n app?: CompiledComponent;\n error?: CompiledComponent;\n runtimeConfig: Record<string, unknown>;\n routeRules: Record<string, RouteRuleConfig>;\n packages: PackageManifestEntry[];\n buildOptions: { vite: \"build\" | \"dev\"; server: \"bundle\" | \"modules\" };\n contributions: ResuxModuleContributions;\n}\n\ninterface RuntimeArtifacts {\n manifest: Record<string, unknown>;\n buildManifest: Record<string, unknown>;\n routesSource: string;\n pluginsSource: string;\n middlewareSource: string;\n componentsSource: string;\n importsSource: string;\n appSource: string;\n resuxDts: string;\n importsDts: string;\n componentsDts: string;\n serverRoutesDts: string;\n diagnostics: {\n routeManifest: Record<string, unknown>[];\n pluginManifest: Record<string, unknown>[];\n clientEnhancementManifest: Record<string, unknown>[];\n middlewareManifest: Record<string, unknown>[];\n componentManifest: Record<string, unknown>[];\n };\n}\n\nfunction buildRuntimeArtifacts(input: RuntimeArtifactsInput): RuntimeArtifacts {\n const manifest = {\n routes: input.routes,\n components: input.components.map(({ id, name, file, handlers, styles, styleScopeId, meta }) => ({ id, name, file, handlers, styles, styleScopeId, meta })),\n layouts: input.layouts.map(({ id, name, file, styles, styleScopeId }) => ({ id, name, file, styles, styleScopeId })),\n plugins: input.plugins.map(({ id, file, mode }) => ({ id, file, mode })),\n clientEnhancements: input.clientEnhancements.map(({ name, id, file, src }) => ({ name, id, file, src })),\n middleware: input.middleware.map(({ id, name, file, global, mode }) => ({ id, name, file, global, mode })),\n serverMiddleware: input.serverMiddleware.map(({ id, file }) => ({ id, file })),\n serverHandlers: input.serverHandlers.map(({ id, path: routePath, file, params }) => ({ id, path: routePath, file, params })),\n vueIslands: input.vueIslands,\n app: input.app?.id,\n error: input.error?.id,\n runtimeConfig: input.runtimeConfig,\n routeRules: input.routeRules,\n packages: input.packages,\n features: input.buildOptions\n };\n\n const buildManifest = {\n routes: input.routes.map((route) => route.path),\n serverHandlers: input.serverHandlers.map((handler) => ({ path: handler.path, file: handler.file })),\n plugins: input.plugins.map((plugin) => ({ file: plugin.file, mode: plugin.mode })),\n clientEnhancements: input.clientEnhancements.map((entry) => ({ name: entry.name, id: entry.id, file: entry.file, src: entry.src })),\n middleware: input.middleware.map((entry) => ({ name: entry.name, file: entry.file, mode: entry.mode, global: entry.global })),\n components: input.components.map((component) => ({ name: component.name, file: component.file })),\n assets: [],\n imageTransforms: [],\n routeRules: Object.entries(input.routeRules).map(([routePath, rule]) => ({ path: routePath, rule })),\n runtimeConfig: input.runtimeConfig,\n packages: input.packages\n };\n\n const componentMap = new Map<string, typeof input.components[0]>();\n for (const component of input.components) {\n componentMap.set(component.name, component);\n const basename = pascalCase(path.basename(component.file, \".vue\"));\n if (!componentMap.has(basename)) {\n componentMap.set(basename, component);\n }\n }\n const componentNames = unique([...componentMap.keys()].filter(Boolean)).sort();\n const imports = dedupeImports([...BUILTIN_AUTO_IMPORTS, ...input.contributions.imports]);\n const importsSignatures = imports\n .map((entry) => `${entry.name}${entry.as ? ` as ${entry.as}` : \"\"} from ${entry.from}`)\n .join(\"\\n\");\n\n const routesSource = `export default ${JSON.stringify(input.routes.map((route) => ({ id: route.id, path: route.path, file: route.file, params: route.params, componentId: route.componentId, meta: route.meta })), null, 2)};\\n`;\n const pluginsSource = `export default ${JSON.stringify(input.plugins.map((plugin) => ({ id: plugin.id, file: plugin.file, mode: plugin.mode })), null, 2)};\\n`;\n const middlewareSource = `export default ${JSON.stringify(input.middleware.map((entry) => ({ id: entry.id, name: entry.name, file: entry.file, global: entry.global, mode: entry.mode })), null, 2)};\\n`;\n const componentsSource = `export default ${JSON.stringify([...componentMap.entries()].map(([name, comp]) => ({ id: comp.id, name, file: comp.file })), null, 2)};\\n`;\n const importsSource = `export default ${JSON.stringify(imports, null, 2)};\\n`;\n const appSource = [\n `import routes from \"./routes.mjs\";`,\n `import plugins from \"./plugins.mjs\";`,\n `import middleware from \"./middleware.mjs\";`,\n `import components from \"./components.mjs\";`,\n `import imports from \"./imports.mjs\";`,\n `export default {`,\n ` app: ${JSON.stringify(input.app?.id ?? null)},`,\n ` error: ${JSON.stringify(input.error?.id ?? null)},`,\n ` routes,`,\n ` plugins,`,\n ` middleware,`,\n ` components,`,\n ` imports`,\n `};`,\n ``\n ].join(\"\\n\");\n const resuxDts = [\n `export interface ResuxGeneratedAppManifest {`,\n ` app: string | null;`,\n ` error: string | null;`,\n ` routes: Array<{ id: string; path: string; file: string; params: string[]; componentId: string }>;`,\n ` plugins: Array<{ id: string; file: string; mode: \"all\" | \"server\" | \"client\" }>;`,\n ` clientEnhancements: Array<{ name: string; id: string; file: string; src: string }>;`,\n ` middleware: Array<{ id: string; name: string; file: string; mode: \"all\" | \"server\" | \"client\"; global: boolean }>;`,\n ` components: Array<{ id: string; name: string; file: string }>;`,\n ` imports: Array<{ from: string; name: string; as?: string }>;`,\n `}`,\n `declare const manifest: ResuxGeneratedAppManifest;`,\n `export default manifest;`,\n ``\n ].join(\"\\n\");\n const importsDts = [\n `// Generated by Resux`,\n `declare module \"resuxjs\" {`,\n ` export interface ResuxAutoImportsRegistry {`,\n ...(importsSignatures ? imports.map((entry) => ` \"${entry.as ?? entry.name}\": typeof import(\"${entry.from}\")[\"${entry.name}\"];`) : [\" // no user imports detected\"]),\n ` }`,\n `}`,\n `export {};`,\n ``\n ].join(\"\\n\");\n const componentsDts = [\n `declare module \"resuxjs/components\" {`,\n ` export interface ResuxComponentsRegistry {`,\n ...(componentNames.length ? componentNames.map((name) => ` \"${name}\": unknown;`) : [\" // no components detected\"]),\n ` }`,\n `}`,\n `export {};`,\n ``\n ].join(\"\\n\");\n const serverRoutesDts = [\n `declare module \"resuxjs/server-routes\" {`,\n ` export interface ResuxServerRouteMap {`,\n ...(input.serverHandlers.length\n ? input.serverHandlers.map((handler) => ` \"${handler.path}\": unknown;`)\n : [\" // no server routes detected\"]),\n ` }`,\n `}`,\n `export {};`,\n ``\n ].join(\"\\n\");\n\n return {\n manifest: manifest as Record<string, unknown>,\n buildManifest: buildManifest as Record<string, unknown>,\n routesSource,\n pluginsSource,\n middlewareSource,\n componentsSource,\n importsSource,\n appSource,\n resuxDts,\n importsDts,\n componentsDts,\n serverRoutesDts,\n diagnostics: {\n routeManifest: input.routes.map((route) => ({ id: route.id, path: route.path, file: route.file, params: route.params })),\n pluginManifest: input.plugins.map((plugin) => ({ id: plugin.id, file: plugin.file, mode: plugin.mode })),\n clientEnhancementManifest: input.clientEnhancements.map((entry) => ({ name: entry.name, id: entry.id, file: entry.file, src: entry.src })),\n middlewareManifest: input.middleware.map((entry) => ({ id: entry.id, name: entry.name, file: entry.file, global: entry.global, mode: entry.mode })),\n componentManifest: input.components.map((component) => ({ id: component.id, name: component.name, file: component.file }))\n }\n };\n}\n\nasync function writeGeneratedArtifacts(outDir: string, artifacts: RuntimeArtifacts, dev: boolean): Promise<void> {\n await writeFile(path.join(outDir, \"manifest.json\"), JSON.stringify(artifacts.manifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"manifest\", \"build-manifest.json\"), JSON.stringify(artifacts.buildManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"routes.mjs\"), artifacts.routesSource, \"utf8\");\n await writeFile(path.join(outDir, \"plugins.mjs\"), artifacts.pluginsSource, \"utf8\");\n await writeFile(path.join(outDir, \"middleware.mjs\"), artifacts.middlewareSource, \"utf8\");\n await writeFile(path.join(outDir, \"components.mjs\"), artifacts.componentsSource, \"utf8\");\n await writeFile(path.join(outDir, \"imports.mjs\"), artifacts.importsSource, \"utf8\");\n await writeFile(path.join(outDir, \"app.mjs\"), artifacts.appSource, \"utf8\");\n await writeFile(path.join(outDir, \"resux.d.ts\"), artifacts.resuxDts, \"utf8\");\n await writeFile(path.join(outDir, \"imports.d.ts\"), artifacts.importsDts, \"utf8\");\n await writeFile(path.join(outDir, \"components.d.ts\"), artifacts.componentsDts, \"utf8\");\n await writeFile(path.join(outDir, \"server-routes.d.ts\"), artifacts.serverRoutesDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"resux.d.ts\"), artifacts.resuxDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"imports.d.ts\"), artifacts.importsDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"components.d.ts\"), artifacts.componentsDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"server-routes.d.ts\"), artifacts.serverRoutesDts, \"utf8\");\n if (!dev) {\n return;\n }\n await mkdir(path.join(outDir, \"dev\"), { recursive: true });\n await writeFile(path.join(outDir, \"dev\", \"route-manifest.json\"), JSON.stringify(artifacts.diagnostics.routeManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"plugin-manifest.json\"), JSON.stringify(artifacts.diagnostics.pluginManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"client-enhancement-manifest.json\"), JSON.stringify(artifacts.diagnostics.clientEnhancementManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"middleware-manifest.json\"), JSON.stringify(artifacts.diagnostics.middlewareManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"component-manifest.json\"), JSON.stringify(artifacts.diagnostics.componentManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"imports.d.ts\"), artifacts.importsDts, \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"resux.d.ts\"), artifacts.resuxDts, \"utf8\");\n}\n\nfunction uniquePackageSourceFiles(entries: PackageSourceFileInput[]): PackageSourceFileInput[] {\n const map = new Map<string, PackageSourceFileInput>();\n for (const entry of entries) {\n const resolved = path.resolve(entry.file);\n const key = normalizePath(resolved);\n const existing = map.get(key);\n if (!existing) {\n map.set(key, { file: resolved, mode: entry.mode });\n continue;\n }\n if (existing.mode === entry.mode) {\n continue;\n }\n map.set(key, { file: resolved, mode: \"all\" });\n }\n return [...map.values()].sort((left, right) => normalizePath(left.file).localeCompare(normalizePath(right.file)));\n}\n\nfunction isPackageSpecifier(specifier: string): boolean {\n if (!specifier) {\n return false;\n }\n if (\n specifier.startsWith(\".\")\n || specifier.startsWith(\"/\")\n || specifier.startsWith(\"http://\")\n || specifier.startsWith(\"https://\")\n || specifier.startsWith(\"data:\")\n || specifier.startsWith(\"file:\")\n || specifier.startsWith(\"virtual:\")\n || specifier.startsWith(\"node:\")\n ) {\n return false;\n }\n return true;\n}\n\nfunction normalizePackageName(specifier: string): string {\n const clean = specifier.split(\"?\")[0]?.split(\"#\")[0] ?? specifier;\n const segments = clean.split(\"/\");\n if (clean.startsWith(\"@\")) {\n return segments.length >= 2 ? `${segments[0]}/${segments[1]}` : clean;\n }\n return segments[0] ?? clean;\n}\n\nfunction collectPackageImportsFromSource(source: string): Array<{ specifier: string; dynamic: boolean; css: boolean }> {\n const imports: Array<{ specifier: string; dynamic: boolean; css: boolean }> = [];\n const staticRegex = /import\\s+(?:type\\s+)?(?:[^\"'()]*?\\s+from\\s+)?[\"']([^\"']+)[\"']/g;\n const dynamicRegex = /import\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n const requireRegex = /require\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n const packageApiRegex = /(?:useClientPackage|useLazyPackage|defineClientOnlyPackage|defineLazyPackage)(?:\\s*<[\\s\\S]*?>)?\\(\\s*([A-Za-z_$][A-Za-z0-9_$]*|[\"'][^\"']+[\"'])\\s*(?:,\\s*\\{([\\s\\S]*?)\\})?\\s*\\)/g;\n const packageConstRegex = /(?:^|[;\\r\\n])\\s*const\\s+([A-Za-z_$][A-Za-z0-9_$]*)\\s*=\\s*[\"']([^\"']+)[\"']/g;\n const cssArrayRegex = /css\\s*:\\s*\\[([\\s\\S]*?)\\]/g;\n const cssStringRegex = /css\\s*:\\s*[\"']([^\"']+)[\"']/g;\n const stringLiteralRegex = /[\"']([^\"']+)[\"']/g;\n const packageConstMap = new Map<string, string>();\n\n for (const match of source.matchAll(packageConstRegex)) {\n const name = (match[1] ?? \"\").trim();\n const value = (match[2] ?? \"\").trim();\n if (!name || !value) {\n continue;\n }\n packageConstMap.set(name, value);\n }\n\n for (const match of source.matchAll(staticRegex)) {\n const specifier = match[1] ?? \"\";\n imports.push({\n specifier,\n dynamic: false,\n css: /\\.css(?:[?#]|$)/i.test(specifier),\n });\n }\n for (const match of source.matchAll(dynamicRegex)) {\n const specifier = match[1] ?? \"\";\n imports.push({\n specifier,\n dynamic: true,\n css: /\\.css(?:[?#]|$)/i.test(specifier),\n });\n }\n for (const match of source.matchAll(requireRegex)) {\n const specifier = match[1] ?? \"\";\n imports.push({\n specifier,\n dynamic: false,\n css: /\\.css(?:[?#]|$)/i.test(specifier),\n });\n }\n for (const match of source.matchAll(packageApiRegex)) {\n const token = (match[1] ?? \"\").trim();\n const specifier = token.startsWith(\"\\\"\") || token.startsWith(\"'\")\n ? token.slice(1, -1).trim()\n : (packageConstMap.get(token) ?? \"\");\n const optionsSource = match[2] ?? \"\";\n if (specifier.length > 0) {\n imports.push({\n specifier,\n dynamic: true,\n css: false,\n });\n }\n for (const cssArray of optionsSource.matchAll(cssArrayRegex)) {\n const content = cssArray[1] ?? \"\";\n for (const cssEntry of content.matchAll(stringLiteralRegex)) {\n const cssSpecifier = (cssEntry[1] ?? \"\").trim();\n if (!cssSpecifier) {\n continue;\n }\n imports.push({\n specifier: cssSpecifier,\n dynamic: true,\n css: true,\n });\n }\n }\n for (const cssValue of optionsSource.matchAll(cssStringRegex)) {\n const cssSpecifier = (cssValue[1] ?? \"\").trim();\n if (!cssSpecifier) {\n continue;\n }\n imports.push({\n specifier: cssSpecifier,\n dynamic: true,\n css: true,\n });\n }\n }\n\n return imports;\n}\n\nfunction readConfiguredPackages(runtimeConfig: Record<string, unknown>): ResuxPackagesConfig {\n const directPackages = (runtimeConfig as ResuxConfig).packages;\n if (isPlainObject(directPackages)) {\n return directPackages as ResuxPackagesConfig;\n }\n const nestedRuntimeConfig = isPlainObject((runtimeConfig as ResuxConfig).runtimeConfig)\n ? (runtimeConfig as ResuxConfig).runtimeConfig as Record<string, unknown>\n : null;\n const nestedPublic = nestedRuntimeConfig && isPlainObject(nestedRuntimeConfig.public)\n ? nestedRuntimeConfig.public as Record<string, unknown>\n : null;\n const nestedPackages = nestedPublic?.packages;\n if (isPlainObject(nestedPackages)) {\n return nestedPackages as ResuxPackagesConfig;\n }\n return {};\n}\n\nfunction normalizeConfiguredPackageList(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return [...new Set(value\n .map((entry) => String(entry ?? \"\").trim())\n .filter((entry) => entry.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeConfiguredPackageCssMap(config: ResuxPackagesConfig): Record<string, string[]> {\n const output: Record<string, string[]> = {};\n if (!config.css || typeof config.css !== \"object\" || Array.isArray(config.css)) {\n return output;\n }\n for (const [packageName, entries] of Object.entries(config.css)) {\n const normalizedPackageName = String(packageName || \"\").trim();\n if (!normalizedPackageName || !Array.isArray(entries)) {\n continue;\n }\n const normalizedEntries = [...new Set(entries\n .map((entry) => String(entry || \"\").trim())\n .filter((entry) => entry.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n if (normalizedEntries.length > 0) {\n output[normalizedPackageName] = normalizedEntries;\n }\n }\n return output;\n}\n\nfunction canResolvePackageSpecifier(appRoot: string, specifier: string): boolean {\n try {\n require.resolve(specifier, { paths: [appRoot] });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction createClientRuntimePackageRegistry(\n appRoot: string,\n configuredPackages: ResuxPackagesConfig,\n packageDiagnostics: PackageManifestEntry[],\n): ClientRuntimePackageRegistry {\n const importers = new Set<string>();\n const declaredPackages = new Set<string>();\n const cssByPackage = normalizeConfiguredPackageCssMap(configuredPackages);\n const configuredModeMap = configuredPackages.mode && typeof configuredPackages.mode === \"object\" && !Array.isArray(configuredPackages.mode)\n ? configuredPackages.mode\n : {};\n const configuredLazy = normalizeConfiguredPackageList(configuredPackages.lazy);\n const configuredClientOnly = normalizeConfiguredPackageList(configuredPackages.clientOnly);\n\n for (const packageName of configuredLazy) {\n declaredPackages.add(packageName);\n importers.add(packageName);\n }\n for (const packageName of configuredClientOnly) {\n declaredPackages.add(packageName);\n importers.add(packageName);\n }\n for (const packageName of Object.keys(configuredModeMap)) {\n const normalizedPackageName = String(packageName || \"\").trim();\n if (!normalizedPackageName) {\n continue;\n }\n declaredPackages.add(normalizedPackageName);\n const mode = normalizeConfiguredPackageMode(configuredModeMap[normalizedPackageName], \"ssr\");\n if (mode !== \"serverOnly\") {\n importers.add(normalizedPackageName);\n }\n }\n for (const [packageName, cssEntries] of Object.entries(cssByPackage)) {\n declaredPackages.add(packageName);\n importers.add(packageName);\n for (const entry of cssEntries) {\n importers.add(entry);\n }\n }\n if (Array.isArray(configuredPackages.css)) {\n for (const entry of configuredPackages.css) {\n const normalized = String(entry || \"\").trim();\n if (!normalized) {\n continue;\n }\n importers.add(normalized);\n }\n }\n\n for (const packageEntry of packageDiagnostics) {\n declaredPackages.add(packageEntry.name);\n const includeImporter = packageEntry.declaredMode !== \"serverOnly\"\n && packageEntry.modes.some((mode) => mode !== \"server\");\n if (includeImporter) {\n importers.add(packageEntry.name);\n for (const specifier of packageEntry.specifiers) {\n const normalizedSpecifier = String(specifier || \"\").trim();\n if (!normalizedSpecifier || !isPackageSpecifier(normalizedSpecifier)) {\n continue;\n }\n importers.add(normalizedSpecifier);\n declaredPackages.add(normalizedSpecifier);\n }\n }\n for (const cssSpecifier of packageEntry.cssImports) {\n const normalizedCssSpecifier = String(cssSpecifier || \"\").trim();\n if (!normalizedCssSpecifier) {\n continue;\n }\n const cssOwner = normalizePackageName(normalizedCssSpecifier);\n if (!cssByPackage[cssOwner]) {\n cssByPackage[cssOwner] = [];\n }\n if (!cssByPackage[cssOwner].includes(normalizedCssSpecifier)) {\n cssByPackage[cssOwner].push(normalizedCssSpecifier);\n }\n importers.add(normalizedCssSpecifier);\n }\n }\n\n const resolvedImporters = [...importers]\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0)\n .filter((entry) => isPackageSpecifier(entry))\n .filter((entry) => canResolvePackageSpecifier(appRoot, entry))\n .sort((left, right) => left.localeCompare(right));\n\n const normalizedCssByPackage: Record<string, string[]> = {};\n for (const [packageName, entries] of Object.entries(cssByPackage)) {\n const normalizedEntries = [...new Set(entries\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n if (normalizedEntries.length > 0) {\n normalizedCssByPackage[packageName] = normalizedEntries;\n }\n }\n\n return {\n importers: resolvedImporters,\n cssByPackage: normalizedCssByPackage,\n declared: [...declaredPackages].sort((left, right) => left.localeCompare(right)),\n };\n}\n\nfunction normalizeConfiguredPackageMode(value: unknown, fallback: ResuxPackageMode = \"ssr\"): ResuxPackageMode {\n if (typeof value !== \"string\") {\n return fallback;\n }\n const normalized = value.trim();\n if (\n normalized === \"ssr\"\n || normalized === \"clientOnly\"\n || normalized === \"serverOnly\"\n || normalized === \"progressive\"\n ) {\n return normalized;\n }\n return fallback;\n}\n\nfunction resolveConfiguredPackageMode(\n packageName: string,\n config: ResuxPackagesConfig,\n): ResuxPackageMode {\n if (config.mode && typeof config.mode === \"object\" && !Array.isArray(config.mode)) {\n const direct = (config.mode as Record<string, unknown>)[packageName];\n if (direct) {\n return normalizeConfiguredPackageMode(direct, \"ssr\");\n }\n }\n const serverOnly = Array.isArray(config.serverOnly) ? config.serverOnly.map(String) : [];\n if (serverOnly.includes(packageName)) {\n return \"serverOnly\";\n }\n const clientOnly = Array.isArray(config.clientOnly) ? config.clientOnly.map(String) : [];\n if (clientOnly.includes(packageName)) {\n return \"clientOnly\";\n }\n return \"ssr\";\n}\n\nasync function analyzePackageUsage(\n appRoot: string,\n sources: PackageSourceFileInput[],\n runtimeConfig: Record<string, unknown>,\n): Promise<PackageManifestEntry[]> {\n const configuredPackages = readConfiguredPackages(runtimeConfig);\n const map = new Map<string, {\n files: Set<string>;\n modes: Set<PackageUsageMode>;\n dynamic: boolean;\n specifiers: Set<string>;\n cssImports: Set<string>;\n declaredMode: ResuxPackageMode;\n warnings: Set<string>;\n }>();\n const ignoredPackages = new Set([\"resuxjs\", \"vue\", \"h3\", \"nitropack\", \"typescript\"]);\n\n for (const entry of sources) {\n let sourceText = \"\";\n try {\n sourceText = await readFile(entry.file, \"utf8\");\n } catch {\n continue;\n }\n const imports = collectPackageImportsFromSource(sourceText);\n for (const imported of imports) {\n if (!isPackageSpecifier(imported.specifier)) {\n continue;\n }\n const packageName = normalizePackageName(imported.specifier);\n if (!packageName || ignoredPackages.has(packageName)) {\n continue;\n }\n const usage = map.get(packageName) ?? {\n files: new Set<string>(),\n modes: new Set<PackageUsageMode>(),\n dynamic: false,\n specifiers: new Set<string>(),\n cssImports: new Set<string>(),\n declaredMode: resolveConfiguredPackageMode(packageName, configuredPackages),\n warnings: new Set<string>(),\n };\n usage.files.add(normalizePath(path.relative(appRoot, entry.file)));\n usage.modes.add(entry.mode);\n usage.dynamic = usage.dynamic || imported.dynamic;\n usage.specifiers.add(imported.specifier);\n if (imported.css) {\n usage.cssImports.add(imported.specifier);\n }\n if (entry.mode === \"server\" && (usage.declaredMode === \"clientOnly\" || usage.declaredMode === \"progressive\")) {\n usage.warnings.add(`Package \"${packageName}\" is marked ${usage.declaredMode} but appears in server files.`);\n }\n if (entry.mode !== \"server\" && usage.declaredMode === \"serverOnly\") {\n usage.warnings.add(`Package \"${packageName}\" is marked serverOnly but appears in client files.`);\n }\n if (usage.declaredMode === \"progressive\" && entry.mode === \"all\") {\n usage.warnings.add(`Package \"${packageName}\" is marked progressive. Prefer loading it inside a client enhancement instead of setup-time imports.`);\n }\n if (\n entry.mode === \"server\"\n && usage.declaredMode === \"ssr\"\n && /(swiper|gsap|chart\\.js|echarts|plyr|animejs|video\\.js)/i.test(packageName)\n ) {\n usage.warnings.add(\n `Package \"${packageName}\" may be browser-only but is imported in server files. Consider packages.mode[\"${packageName}\"] = \"clientOnly\" or \"progressive\".`,\n );\n }\n map.set(packageName, usage);\n }\n }\n\n const output: PackageManifestEntry[] = [];\n for (const [name, usage] of map.entries()) {\n let missing = false;\n try {\n require.resolve(name, { paths: [appRoot] });\n } catch {\n missing = true;\n usage.warnings.add(`Package \"${name}\" is imported but not installed.`);\n }\n output.push({\n name,\n specifiers: [...usage.specifiers].sort(),\n files: [...usage.files].sort(),\n modes: [...usage.modes].sort(),\n dynamic: usage.dynamic,\n cssImports: [...usage.cssImports].sort(),\n missing,\n declaredMode: usage.declaredMode,\n warnings: [...usage.warnings].sort(),\n });\n }\n\n return output.sort((left, right) => left.name.localeCompare(right.name));\n}\n\nfunction dedupeImports(entries: Array<{ from: string; name: string; as?: string }>): Array<{ from: string; name: string; as?: string }> {\n const map = new Map<string, { from: string; name: string; as?: string }>();\n for (const entry of entries) {\n const key = `${entry.from}::${entry.name}::${entry.as ?? \"\"}`;\n map.set(key, entry);\n }\n return [...map.values()].sort((left, right) => {\n const leftKey = `${left.from}:${left.name}:${left.as ?? \"\"}`;\n const rightKey = `${right.from}:${right.name}:${right.as ?? \"\"}`;\n return leftKey.localeCompare(rightKey);\n });\n}\n\nasync function discoverSupportTsFilesInDir(dir: string): Promise<string[]> {\n try {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: string[] = [];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...await discoverSupportTsFilesInDir(fullPath));\n continue;\n }\n if (!entry.isFile()) {\n continue;\n }\n if (!/\\.[cm]?[tj]s$/.test(entry.name)) {\n continue;\n }\n if (/\\.d\\.[cm]?[tj]s$/.test(entry.name)) {\n continue;\n }\n files.push(fullPath);\n }\n\n return files;\n } catch {\n return [];\n }\n}\n\nasync function discoverServerFiles(dir: string, routePrefix: string): Promise<Array<{ file: string; path: string }>> {\n try {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: Array<{ file: string; path: string }> = [];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...await discoverServerFiles(fullPath, `${routePrefix}/${entry.name}`));\n } else if (entry.isFile() && /\\.[cm]?[tj]s$/.test(entry.name)) {\n const name = entry.name.replace(/\\.[cm]?[tj]s$/, \"\");\n const segment = name === \"index\" ? \"\" : `/${name}`;\n files.push({\n file: fullPath,\n path: normalizeRoutePath(`${routePrefix}${segment}`)\n });\n }\n }\n\n return files.sort((a, b) => a.path.localeCompare(b.path));\n } catch {\n return [];\n }\n}\n\nasync function discoverVueIslands(root: string): Promise<VueIslandRecord[]> {\n const islandRoot = path.join(root, \"islands\", \"vue\");\n const files = await discoverVueFiles(islandRoot);\n return files.map((file) => {\n const relative = path.relative(islandRoot, file).replace(/\\.vue$/, \"\");\n return {\n name: pascalCase(relative),\n file\n };\n });\n}\n\nasync function findFirstExisting(files: string[]): Promise<string | null> {\n for (const file of files) {\n const found = await optionalFile(file);\n if (found) {\n return found;\n }\n }\n return null;\n}\n\nfunction unique<T>(items: T[]): T[] {\n return [...new Set(items)];\n}\n\nasync function optionalFile(file: string): Promise<string | null> {\n try {\n await readFile(file, \"utf8\");\n return file;\n } catch {\n return null;\n }\n}\n\nasync function existsFile(file: string): Promise<boolean> {\n try {\n await stat(file);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction inferComponentName(root: string, file: string, componentDirs: string[] = []): string {\n const relative = normalizePath(path.relative(root, file));\n if (relative === \"app.vue\") {\n return \"App\";\n }\n const normalizedFile = normalizePath(path.resolve(file));\n for (const dir of componentDirs) {\n const normalizedDir = normalizePath(path.resolve(dir)) + \"/\";\n if (normalizedFile.startsWith(normalizedDir)) {\n const relToDir = normalizedFile.slice(normalizedDir.length).replace(/\\.vue$/, \"\");\n const segments = relToDir.split(\"/\").filter(Boolean);\n const parts: string[] = [];\n for (let i = 0; i < segments.length; i++) {\n const current = pascalCase(segments[i]);\n if (i < segments.length - 1) {\n const next = pascalCase(segments[i + 1]);\n if (next.toLowerCase().startsWith(current.toLowerCase())) {\n continue;\n }\n }\n parts.push(current);\n }\n return parts.join(\"\");\n }\n }\n return pascalCase(path.basename(file, \".vue\"));\n}\n\n\nfunction pascalCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}\n\nfunction kebabCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/\\.global$/, \"\")\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .join(\"-\")\n .toLowerCase();\n}\n\nfunction normalizePath(value: string): string {\n return value.replaceAll(\"\\\\\", \"/\");\n}\n\nfunction normalizeRoutePath(value: string): string {\n const normalized = value\n .replaceAll(\"\\\\\", \"/\")\n .replace(/\\.[cm]?[tj]s$/, \"\")\n .replace(/\\[\\.\\.\\.([A-Za-z0-9_]+)\\]/g, \":$1*\")\n .replace(/\\[([A-Za-z0-9_]+)\\]/g, \":$1\")\n .replace(/\\/index$/, \"\");\n\n return (`/${normalized}`.replace(/\\/+/g, \"/\").replace(/\\/$/, \"\")) || \"/\";\n}\n\nfunction collectRouteParams(routePath: string): string[] {\n return routePath\n .split(\"/\")\n .filter((part) => part.startsWith(\":\"))\n .map((part) => part.slice(1).replace(/\\*$/, \"\"));\n}\n\nfunction locationFromVueNode(file: string, node: VueCompilerNode): CompileErrorLocation {\n return {\n file,\n line: node.loc?.start?.line ?? 1,\n column: node.loc?.start?.column ?? 1\n };\n}\n\nfunction locationFromTsNode(file: string, sourceFile: ts.SourceFile, node: ts.Node): CompileErrorLocation {\n const nodeSourceFile = node.getSourceFile() ?? sourceFile;\n const position = nodeSourceFile.getLineAndCharacterOfPosition(node.getStart(nodeSourceFile));\n return {\n file,\n line: position.line + 1,\n column: position.character + 1\n };\n}\n\nfunction locationFromOffset(file: string, source: string, offset: number): CompileErrorLocation {\n const lines = source.slice(0, offset).split(/\\r?\\n/);\n return {\n file,\n line: lines.length,\n column: lines[lines.length - 1].length + 1\n };\n}\n\nexport function resolveFileExtension(filePath: string): string {\n const ext = path.extname(filePath);\n if (ext) {\n return filePath;\n }\n const extensions = [\".ts\", \".js\", \".vue\", \".tsx\", \".jsx\", \".mjs\", \".cjs\"];\n for (const ext of extensions) {\n const candidate = filePath + ext;\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n if (existsSync(filePath) && statSync(filePath).isDirectory()) {\n for (const ext of extensions) {\n const candidate = path.join(filePath, \"index\" + ext);\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n }\n return filePath;\n}\n\nexport function fileUrl(file: string): string {\n return pathToFileURL(file).href;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,IAAa,oBAAb,cAAuC,MAAM;CAClC;CAET,YAAY,SAAiB,UAAiC;EAC5D,MAAM,WAAW,GAAG,QAAQ,IAAI,SAAS,KAAK,GAAG,SAAS,KAAK,GAAG,SAAS,OAAO,KAAK,OAAO;EAC9F,KAAK,OAAO;EACZ,KAAK,WAAW;CAClB;AACF;AA2MA,MAAa,oDAAoC,IAAI,IAAI;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,uBAA2E;CAC/E;EAAE,MAAM;EAAW,MAAM;CAAW;CACpC;EAAE,MAAM;EAAW,MAAM;CAAY;CACrC;EAAE,MAAM;EAAW,MAAM;CAAgB;CACzC;EAAE,MAAM;EAAW,MAAM;CAAsB;CAC/C;EAAE,MAAM;EAAW,MAAM;CAAU;CACnC;EAAE,MAAM;EAAW,MAAM;CAAc;CACvC;EAAE,MAAM;EAAW,MAAM;CAAY;CACrC;EAAE,MAAM;EAAW,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import { createHash } from \"node:crypto\";\nimport { mkdir, readFile, readdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { existsSync, statSync, writeFileSync, mkdirSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport { NodeTypes, parse as parseTemplate, type AttributeNode, type DirectiveNode, type ElementNode, type Node as VueCompilerNode, type SimpleExpressionNode, type TemplateChildNode } from \"@vue/compiler-dom\";\nimport { compileStyle, parse as parseSfc, type SFCStyleBlock } from \"@vue/compiler-sfc\";\nimport vuePlugin from \"@vitejs/plugin-vue\";\nimport ts from \"typescript\";\nimport { build as viteBuild } from \"vite\";\nimport { createResux } from \"../core/resux.js\";\nimport { cspDirectiveSources } from \"../head/utils.js\";\nimport type { ResuxHooks } from \"../core/hooks.js\";\nimport { ResuxModuleContainer, type ResuxModuleContext as CoreResuxModuleContext, type ResuxModuleContributions } from \"../core/module-container.js\";\nimport { buildLocalePath, normalizeI18nRuntimeConfig, type ResuxI18nRuntimeConfig } from \"../i18n/shared.js\";\nimport { withResuxKitContext } from \"../kit/index.js\";\nimport { isPathWithinBoundary } from \"../security/path-boundary.js\";\nimport {\n getClientRuntimeSource,\n type ComponentStyle,\n type ElementTemplateNode,\n type PageMeta,\n type ResuxPackageMode,\n type ResuxPackagesConfig,\n type TemplateAttribute,\n type TemplateEvent,\n type TemplateNode,\n} from \"../runtime/index.js\";\n\nexport interface CompileErrorLocation {\n file: string;\n line: number;\n column: number;\n}\n\nexport class ResuxCompileError extends Error {\n readonly location?: CompileErrorLocation;\n\n constructor(message: string, location?: CompileErrorLocation) {\n super(location ? `${message} (${location.file}:${location.line}:${location.column})` : message);\n this.name = \"ResuxCompileError\";\n this.location = location;\n }\n}\n\nexport interface CompiledComponent {\n id: string;\n name: string;\n file: string;\n serverSource: string;\n clientSource: string;\n template: TemplateNode[];\n templateRefs?: string[];\n templateForRefs?: string[];\n handlers: string[];\n styles: ComponentStyle[];\n styleScopeId?: string;\n meta?: PageMeta;\n expressions?: { id: string; original: string; transformed: string; locals: string[] }[];\n}\n\nexport interface RouteManifestRecord {\n id: string;\n path: string;\n file: string;\n params: string[];\n componentId: string;\n meta?: PageMeta;\n}\n\nexport interface CompiledPlugin {\n id: string;\n file: string;\n mode: \"all\" | \"server\" | \"client\";\n serverSource: string;\n clientSource: string;\n}\n\nexport interface ClientEnhancementManifestEntry {\n name: string;\n id: string;\n file: string;\n src: string;\n}\n\nexport interface CompiledMiddleware {\n id: string;\n name: string;\n file: string;\n mode: \"all\" | \"server\" | \"client\";\n global: boolean;\n serverSource: string;\n clientSource: string;\n}\n\nexport interface CompiledServerMiddleware {\n id: string;\n file: string;\n source: string;\n}\n\nexport interface ServerHandlerRecord {\n id: string;\n path: string;\n file: string;\n params: string[];\n source: string;\n}\n\nexport interface VueIslandRecord {\n name: string;\n file: string;\n}\n\nexport interface RouteRuleConfig {\n headers?: Record<string, string>;\n redirect?: string | { to: string; statusCode?: number };\n statusCode?: number;\n cache?: false | string | { maxAge?: number; swr?: number };\n cors?: boolean | {\n origin?: string;\n methods?: string[];\n headers?: string[];\n credentials?: boolean;\n };\n}\n\nexport interface BuildResult {\n appRoot: string;\n outDir: string;\n routes: RouteManifestRecord[];\n components: CompiledComponent[];\n layouts: CompiledComponent[];\n plugins: CompiledPlugin[];\n clientEnhancements: ClientEnhancementManifestEntry[];\n middleware: CompiledMiddleware[];\n serverMiddleware: CompiledServerMiddleware[];\n serverHandlers: ServerHandlerRecord[];\n vueIslands: VueIslandRecord[];\n routeRules: Record<string, RouteRuleConfig>;\n contributions?: ResuxModuleContributions;\n app?: CompiledComponent;\n error?: CompiledComponent;\n}\n\nexport interface BuildOptions {\n vite?: \"build\" | \"dev\";\n server?: \"bundle\" | \"modules\";\n hooks?: ResuxHooks;\n changedPath?: string;\n traceBuild?: boolean;\n}\n\ninterface ScriptAnalysis {\n setupBody: string;\n imports: string;\n importDeclarations: (ts.ImportDeclaration | ts.ImportEqualsDeclaration)[];\n bindings: string[];\n handlerNames: Set<string>;\n resumableBindings: Set<string>;\n importedBindings: Set<string>;\n inlineHandlerLocals: Map<string, string[]>;\n templateRefBindings: Set<string>;\n handlers: Map<string, ts.Node>;\n sourceFile: ts.SourceFile;\n pageMeta?: PageMeta;\n}\n\ntype PackageUsageMode = \"all\" | \"client\" | \"server\";\n\ninterface PackageSourceFileInput {\n file: string;\n mode: PackageUsageMode;\n}\n\ninterface PackageManifestEntry {\n name: string;\n specifiers: string[];\n files: string[];\n modes: PackageUsageMode[];\n dynamic: boolean;\n cssImports: string[];\n missing: boolean;\n declaredMode: ResuxPackageMode;\n warnings: string[];\n}\n\ninterface ClientRuntimePackageRegistry {\n importers: string[];\n cssByPackage: Record<string, string[]>;\n declared: string[];\n}\n\ninterface CompileTemplateState {\n file: string;\n templateRefBindings: Set<string>;\n templateRefs: Set<string>;\n bindingIndex: number;\n inlineHandlerIndex: number;\n handlers: TemplateEvent[];\n inlineHandlers: GeneratedHandler[];\n expressions: { id: string; original: string; transformed: string; locals: string[] }[];\n activeLocals: string[];\n allLocals: Set<string>;\n}\n\ninterface GeneratedHandler {\n name: string;\n source: string;\n locals?: string[];\n}\n\ninterface CompileTemplateNodeOptions {\n ifExpressionOverride?: string;\n}\n\ninterface ConditionalDirectiveInfo {\n kind: \"if\" | \"else-if\" | \"else\";\n directive: DirectiveNode;\n expression?: string;\n}\n\ntype ResuxConfig = Record<string, unknown> & {\n app?: { head?: unknown };\n css?: unknown;\n i18n?: unknown;\n packages?: unknown;\n video?: unknown;\n modules?: unknown;\n deploy?: {\n target?: \"auto\" | \"node\" | \"vercel\" | \"netlify\" | \"cloudflare\" | \"static\";\n nitroPreset?: string;\n };\n routeRules?: Record<string, RouteRuleConfig>;\n runtimeConfig?: Record<string, unknown>;\n};\n\ntype ResuxModuleContext = CoreResuxModuleContext;\n\ntype ResuxModuleSetup = (options: unknown, context: ResuxModuleContext) => unknown | Promise<unknown>;\n\ninterface BuiltinResuxModule {\n defaults?: Record<string, unknown>;\n setup: ResuxModuleSetup;\n}\n\nexport const RESUMABLE_HANDLER_ALLOWED_GLOBALS = new Set([\n \"Math\",\n \"Number\",\n \"String\",\n \"Boolean\",\n \"Array\",\n \"Object\",\n \"Date\",\n \"JSON\",\n \"Intl\",\n \"Promise\",\n \"console\",\n \"undefined\",\n \"globalThis\",\n \"window\",\n \"document\",\n \"navigator\",\n \"localStorage\",\n \"sessionStorage\",\n \"location\",\n \"history\",\n \"alert\",\n \"performance\",\n \"fetch\",\n \"Headers\",\n \"Request\",\n \"Response\",\n \"URL\",\n \"URLSearchParams\",\n \"AbortController\",\n \"setTimeout\",\n \"clearTimeout\",\n \"setInterval\",\n \"clearInterval\",\n \"queueMicrotask\",\n \"ref\",\n \"reactive\",\n \"computed\",\n \"watch\",\n \"watchEffect\",\n \"readonly\",\n \"toRef\",\n \"toRefs\",\n \"unref\",\n \"isRef\",\n \"isReactive\",\n \"isReadonly\",\n \"nextTick\",\n \"useState\",\n \"useGlobalState\",\n \"useAsyncData\",\n \"useRoute\",\n \"useRouter\",\n \"useHead\",\n \"useSeoMeta\",\n \"useRuntimeConfig\",\n \"useResuxApp\",\n \"useResuxImage\",\n \"useI18n\",\n \"useLocalePath\",\n \"useSwitchLocalePath\",\n \"useDevice\",\n \"$device\",\n \"apiURL\",\n \"useFetch\",\n \"$fetch\",\n \"useError\",\n \"clearError\",\n \"showError\",\n \"createError\",\n \"useLazyPackage\",\n \"useClientPackage\",\n \"usePackageReady\",\n \"defineLazyPackage\",\n \"defineClientOnlyPackage\",\n \"definePackageAdapter\",\n \"defineClientEnhancement\",\n \"useClientEnhancement\",\n \"onMounted\",\n \"definePageMeta\",\n \"defineProps\"\n]);\n\nconst BUILTIN_AUTO_IMPORTS: Array<{ from: string; name: string; as?: string }> = [\n { from: \"resuxjs\", name: \"useRoute\" },\n { from: \"resuxjs\", name: \"useRouter\" },\n { from: \"resuxjs\", name: \"useLocalePath\" },\n { from: \"resuxjs\", name: \"useSwitchLocalePath\" },\n { from: \"resuxjs\", name: \"useI18n\" },\n { from: \"resuxjs\", name: \"useResuxApp\" },\n { from: \"resuxjs\", name: \"useDevice\" },\n { from: \"resuxjs\", name: \"navigateTo\" },\n { from: \"resuxjs\", name: \"abortNavigation\" },\n { from: \"resuxjs\", name: \"useHead\" },\n { from: \"resuxjs\", name: \"useSeoMeta\" },\n { from: \"resuxjs\", name: \"useRuntimeConfig\" },\n { from: \"resuxjs\", name: \"useState\" },\n { from: \"resuxjs\", name: \"useGlobalState\" },\n { from: \"resuxjs\", name: \"useFetch\" },\n { from: \"resuxjs\", name: \"useAsyncData\" },\n { from: \"resuxjs\", name: \"$fetch\" },\n { from: \"resuxjs\", name: \"useError\" },\n { from: \"resuxjs\", name: \"clearError\" },\n { from: \"resuxjs\", name: \"showError\" },\n { from: \"resuxjs\", name: \"createError\" },\n { from: \"resuxjs\", name: \"useLazyPackage\" },\n { from: \"resuxjs\", name: \"useClientPackage\" },\n { from: \"resuxjs\", name: \"usePackageReady\" },\n { from: \"resuxjs\", name: \"defineLazyPackage\" },\n { from: \"resuxjs\", name: \"defineClientOnlyPackage\" },\n { from: \"resuxjs\", name: \"definePackageAdapter\" },\n { from: \"resuxjs\", name: \"defineClientEnhancement\" },\n { from: \"resuxjs\", name: \"useClientEnhancement\" }\n];\n\nconst SUPPORT_CLIENT_RUNTIME_HELPERS = [\n \"useLazyPackage\",\n \"useClientPackage\",\n \"usePackageReady\",\n \"defineLazyPackage\",\n \"defineClientOnlyPackage\",\n \"definePackageAdapter\",\n \"defineClientEnhancement\",\n \"useClientEnhancement\",\n] as const;\n\nconst CLIENT_ENHANCEMENT_DIR_CANDIDATES = [\n \"client-enhancements\",\n \"enhancements\",\n path.join(\"app\", \"client-enhancements\"),\n path.join(\"app\", \"enhancements\"),\n] as const;\n\ninterface SupportModuleTranspileOptions {\n prefix?: string;\n autoImports?: Array<{ from: string; names: readonly string[] }>;\n rewriteImports?: Record<string, string>;\n}\n\nexport async function buildProject(appRoot: string, outDir = path.join(appRoot, \".resux\"), options: BuildOptions = {}): Promise<BuildResult> {\n const absoluteRoot = path.resolve(appRoot);\n const absoluteOut = path.resolve(outDir);\n const buildOptions = {\n vite: options.vite ?? \"build\",\n server: options.server ?? (options.vite === \"dev\" ? \"modules\" : \"bundle\"),\n hooks: options.hooks,\n traceBuild: options.traceBuild === true\n };\n const mode = buildOptions.vite === \"dev\" ? \"dev\" : \"build\";\n const incrementalDevBuild = mode === \"dev\" && typeof options.changedPath === \"string\" && options.changedPath.length > 0;\n const hooks = buildOptions.hooks ?? createResux({ rootDir: absoluteRoot, buildDir: absoluteOut, config: {} }).hooks;\n\n try {\n await hooks.callHook(\"build:before\", { appRoot: absoluteRoot, outDir: absoluteOut, mode });\n if (!incrementalDevBuild) {\n await cleanGeneratedOutput(absoluteOut);\n }\n await ensureGeneratedDirs(absoluteOut, buildOptions.vite === \"dev\");\n\n const { config: runtimeConfig, moduleContainer } = await readRuntimeConfig(absoluteRoot, absoluteOut, hooks);\n const contributions = moduleContainer.contributions;\n await hooks.callHook(\"config:resolved\", { rootDir: absoluteRoot, buildDir: absoluteOut, config: runtimeConfig });\n await hooks.callHook(\"app:resolve\", { appRoot: absoluteRoot, outDir: absoluteOut });\n\n const routeRules = createRouteRules(runtimeConfig);\n const componentDirs = unique([\n path.join(absoluteRoot, \"components\"),\n path.join(absoluteRoot, \"app\", \"components\"),\n ...contributions.componentDirs.map((entry) => path.resolve(absoluteRoot, entry.path))\n ]);\n await hooks.callHook(\"components:dirs\", { dirs: componentDirs });\n const componentFiles = await discoverVueFilesFromDirs(componentDirs);\n componentFiles.push(...contributions.components.map((entry) => path.resolve(absoluteRoot, entry.file)));\n const uniqueComponentFiles = unique(componentFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n\n const pageFiles = await discoverAppVueFiles(absoluteRoot, \"pages\");\n const layoutFiles = await discoverAppVueFiles(absoluteRoot, \"layouts\");\n const appFile = await optionalFile(path.join(absoluteRoot, \"app.vue\"))\n ?? await optionalFile(path.join(absoluteRoot, \"app\", \"app.vue\"));\n const errorFile = await optionalFile(path.join(absoluteRoot, \"error.vue\"))\n ?? await optionalFile(path.join(absoluteRoot, \"app\", \"error.vue\"));\n\n const pluginDirs = [\n path.join(absoluteRoot, \"plugins\"),\n path.join(absoluteRoot, \"app\", \"plugins\"),\n path.join(absoluteRoot, \"enhancements\"),\n path.join(absoluteRoot, \"client-enhancements\"),\n path.join(absoluteRoot, \"app\", \"enhancements\"),\n path.join(absoluteRoot, \"app\", \"client-enhancements\"),\n ];\n await hooks.callHook(\"plugins:dirs\", { dirs: pluginDirs });\n const pluginFiles = await discoverSupportTsFiles(absoluteRoot, \"plugins\");\n const modulePluginEntries = contributions.plugins.map((entry) => ({\n file: path.resolve(absoluteRoot, entry.src),\n mode: entry.mode ?? \"all\"\n }));\n const pluginModeByFile = new Map<string, \"all\" | \"server\" | \"client\">();\n for (const entry of modulePluginEntries) {\n pluginModeByFile.set(entry.file, entry.mode);\n pluginFiles.push(entry.file);\n }\n const clientEnhancementFiles = await discoverClientEnhancementFiles(absoluteRoot);\n for (const file of clientEnhancementFiles) {\n if (!pluginModeByFile.has(file)) {\n pluginModeByFile.set(file, \"client\");\n }\n pluginFiles.push(file);\n }\n const clientEnhancementFileSet = new Set(\n clientEnhancementFiles.map((file) => normalizePath(path.resolve(file))),\n );\n\n const middlewareDirs = [path.join(absoluteRoot, \"middleware\"), path.join(absoluteRoot, \"app\", \"middleware\")];\n await hooks.callHook(\"middleware:dirs\", { dirs: middlewareDirs });\n const middlewareFiles = await discoverSupportTsFiles(absoluteRoot, \"middleware\");\n const moduleMiddlewareEntries = contributions.middleware.map((entry) => ({\n file: path.resolve(absoluteRoot, entry.src),\n mode: entry.mode ?? \"all\",\n global: entry.global === true,\n name: entry.name\n }));\n const middlewareMetaByFile = new Map<string, { mode: \"all\" | \"server\" | \"client\"; global: boolean; name: string }>();\n for (const entry of moduleMiddlewareEntries) {\n middlewareMetaByFile.set(entry.file, entry);\n middlewareFiles.push(entry.file);\n }\n\n const serverMiddlewareFiles = await discoverSupportTsFiles(absoluteRoot, path.join(\"server\", \"middleware\"));\n const serverHandlerFiles = [\n ...await discoverServerFiles(path.join(absoluteRoot, \"server\", \"api\"), \"/api\"),\n ...await discoverServerFiles(path.join(absoluteRoot, \"server\", \"routes\"), \"\")\n ];\n for (const handler of contributions.serverHandlers) {\n serverHandlerFiles.push({\n file: path.resolve(absoluteRoot, handler.handler),\n path: normalizeRoutePath(handler.route)\n });\n }\n\n const vueIslands = await discoverVueIslands(absoluteRoot);\n const allFiles = [...uniqueComponentFiles, ...layoutFiles, ...pageFiles, ...(appFile ? [appFile] : []), ...(errorFile ? [errorFile] : [])];\n const idByFile = new Map<string, string>();\n const compiledByFile = new Map<string, CompiledComponent>();\n let index = 0;\n\n for (const file of allFiles) {\n idByFile.set(file, `m${index++}`);\n }\n\n for (const file of allFiles) {\n const component = await compileVueFile(file, {\n id: idByFile.get(file)!,\n name: inferComponentName(absoluteRoot, file, componentDirs),\n outDir: absoluteOut\n });\n compiledByFile.set(file, component);\n await writeFile(path.join(absoluteOut, \"server\", `${component.id}.mjs`), component.serverSource, \"utf8\");\n await writeFile(path.join(absoluteOut, \"vite-client\", \"handlers\", `${component.id}.mjs`), component.clientSource, \"utf8\");\n }\n\n const baseRoutes = createRouteManifest(absoluteRoot, pageFiles, idByFile, compiledByFile);\n for (const extender of contributions.pagesExtenders) {\n await extender(baseRoutes as unknown as Array<Record<string, unknown>>);\n }\n await hooks.callHook(\"pages:extend\", { pages: baseRoutes as unknown as Array<Record<string, unknown>> });\n const routes = localizeRouteManifest(baseRoutes, runtimeConfig);\n await hooks.callHook(\"pages:resolved\", { pages: routes as unknown as Array<Record<string, unknown>> });\n\n const components = allFiles.map((file) => compiledByFile.get(file)!);\n const layouts = layoutFiles.map((file) => compiledByFile.get(file)!);\n const plugins = unique(pluginFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right))).map((file, pluginIndex) => {\n const compiled = compilePluginFile(file, pluginIndex);\n const mode = pluginModeByFile.get(file);\n if (mode) {\n compiled.mode = mode;\n }\n return compiled;\n });\n const clientEnhancements = plugins\n .filter((plugin) => (\n plugin.mode !== \"server\"\n && clientEnhancementFileSet.has(normalizePath(path.resolve(plugin.file)))\n ))\n .map((plugin) => ({\n name: supportFileBaseName(plugin.file),\n id: plugin.id,\n file: plugin.file,\n src: `/__resux/plugins/${plugin.id}.mjs`,\n }))\n .sort((left, right) => left.name.localeCompare(right.name) || normalizePath(left.file).localeCompare(normalizePath(right.file)));\n const middleware = unique(middlewareFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right))).map((file, middlewareIndex) => {\n const compiled = compileMiddlewareFile(file, middlewareIndex);\n const meta = middlewareMetaByFile.get(file);\n if (meta) {\n compiled.mode = meta.mode;\n compiled.global = meta.global;\n compiled.name = kebabCase(meta.name);\n }\n return compiled;\n });\n const serverMiddleware = serverMiddlewareFiles.map((file, middlewareIndex) => compileServerMiddlewareFile(file, middlewareIndex));\n const serverHandlers = uniqueServerHandlers(serverHandlerFiles).map((record, handlerIndex) => compileServerHandlerFile(record.file, handlerIndex, record.path));\n const app = appFile ? compiledByFile.get(appFile) : undefined;\n const error = errorFile ? compiledByFile.get(errorFile) : undefined;\n await hooks.callHook(\"components:extend\", { components: components as unknown as Array<Record<string, unknown>> });\n await hooks.callHook(\"plugins:extend\", { plugins: plugins as unknown as Array<Record<string, unknown>> });\n await hooks.callHook(\"middleware:extend\", { middleware: middleware as unknown as Array<Record<string, unknown>> });\n\n for (const plugin of plugins) {\n if (plugin.mode !== \"client\") {\n await writeFile(path.join(absoluteOut, \"server\", \"resux-plugins\", `${plugin.id}.mjs`), plugin.serverSource, \"utf8\");\n }\n if (plugin.mode !== \"server\") {\n await writeFile(path.join(absoluteOut, \"vite-client\", \"plugins\", `${plugin.id}.mjs`), plugin.clientSource, \"utf8\");\n }\n }\n await writeClientEnhancementManifests(absoluteOut, clientEnhancements);\n\n for (const entry of middleware) {\n if (entry.mode !== \"client\") {\n await writeFile(path.join(absoluteOut, \"server\", \"resux-middleware\", `${entry.id}.mjs`), entry.serverSource, \"utf8\");\n }\n if (entry.mode !== \"server\") {\n await writeFile(path.join(absoluteOut, \"vite-client\", \"middleware\", `${entry.id}.mjs`), entry.clientSource, \"utf8\");\n }\n }\n\n for (const entry of serverMiddleware) {\n await writeFile(path.join(absoluteOut, \"server\", \"request-middleware\", `${entry.id}.mjs`), entry.source, \"utf8\");\n }\n\n for (const handler of serverHandlers) {\n await writeFile(path.join(absoluteOut, \"server\", \"handlers\", `${handler.id}.mjs`), handler.source, \"utf8\");\n }\n\n for (const island of vueIslands) {\n const islandEntryDir = path.join(absoluteOut, \"vite-client\", \"vue-islands\");\n await writeFile(path.join(islandEntryDir, `${island.name}.mjs`), createVueIslandClientSource(island, islandEntryDir), \"utf8\");\n }\n\n const importDirs = unique([\n path.join(absoluteRoot, \"composables\"),\n path.join(absoluteRoot, \"utils\"),\n path.join(absoluteRoot, \"shared\"),\n path.join(absoluteRoot, \"server\", \"utils\"),\n ...contributions.importDirs.map((dir) => path.resolve(absoluteRoot, dir))\n ]);\n await hooks.callHook(\"imports:dirs\", { dirs: importDirs });\n const discoveredAutoImports = await discoverAutoImportsFromDirs(absoluteRoot, importDirs);\n const mergedImports = dedupeImports([...contributions.imports, ...discoveredAutoImports]);\n await hooks.callHook(\"imports:extend\", { imports: mergedImports as unknown as Array<Record<string, unknown>> });\n await hooks.callHook(\"app:templates\", { outDir: absoluteOut, templatesDir: path.join(absoluteOut, \"templates\") });\n const generatedTemplateFiles = await writeModuleTemplates(absoluteOut, contributions);\n await hooks.callHook(\"app:templatesGenerated\", { outDir: absoluteOut, files: generatedTemplateFiles });\n\n const additionalSharedPackageFiles = unique([\n ...await discoverSupportTsFiles(absoluteRoot, \"composables\"),\n ...await discoverSupportTsFiles(absoluteRoot, \"utils\"),\n ...await discoverSupportTsFiles(absoluteRoot, \"shared\"),\n ]);\n const additionalServerPackageFiles = unique([\n ...await discoverSupportTsFiles(absoluteRoot, path.join(\"server\", \"utils\")),\n ...await discoverSupportTsFiles(absoluteRoot, path.join(\"server\", \"plugins\")),\n ]);\n const packageSources: PackageSourceFileInput[] = uniquePackageSourceFiles([\n ...components.map((component) => ({ file: component.file, mode: \"all\" as const })),\n ...plugins.map((plugin) => ({ file: plugin.file, mode: plugin.mode as PackageUsageMode })),\n ...middleware.map((entry) => ({ file: entry.file, mode: entry.mode as PackageUsageMode })),\n ...serverMiddleware.map((entry) => ({ file: entry.file, mode: \"server\" as const })),\n ...serverHandlers.map((entry) => ({ file: entry.file, mode: \"server\" as const })),\n ...additionalSharedPackageFiles.map((file) => ({ file, mode: \"all\" as const })),\n ...additionalServerPackageFiles.map((file) => ({ file, mode: \"server\" as const })),\n ]);\n const packageDiagnostics = await analyzePackageUsage(\n absoluteRoot,\n packageSources,\n runtimeConfig,\n );\n const packageRegistry = createClientRuntimePackageRegistry(\n absoluteRoot,\n readConfiguredPackages(runtimeConfig),\n packageDiagnostics,\n );\n const buildCompatibilityId = createBuildCompatibilityId({\n runtimeConfig,\n routes,\n components,\n plugins,\n middleware,\n serverMiddleware,\n serverHandlers,\n packages: packageDiagnostics,\n });\n injectRuntimeBuildCompatibilityId(runtimeConfig, buildCompatibilityId);\n\n if (buildOptions.vite === \"dev\") {\n await writeViteClientRuntime(absoluteOut, packageRegistry);\n await hooks.callHook(\"vite:compiled\", { outDir: absoluteOut, dev: true });\n } else {\n await buildClientAssets(\n absoluteRoot,\n absoluteOut,\n components,\n plugins,\n middleware,\n vueIslands,\n packageRegistry,\n hooks,\n contributions,\n );\n await hooks.callHook(\"vite:compiled\", { outDir: absoluteOut, dev: false });\n }\n await ensureServerComponentModules(absoluteOut, components);\n\n const runtimeArtifacts = buildRuntimeArtifacts({\n routes,\n components,\n layouts,\n plugins,\n clientEnhancements,\n middleware,\n serverMiddleware,\n serverHandlers,\n vueIslands,\n app,\n error,\n runtimeConfig,\n routeRules,\n packages: packageDiagnostics,\n buildOptions: { vite: buildOptions.vite, server: buildOptions.server },\n contributions: {\n ...contributions,\n imports: mergedImports\n }\n });\n\n await hooks.callHook(\"build:manifest\", { manifest: runtimeArtifacts.manifest as Record<string, unknown>, outDir: absoluteOut });\n await writeFile(\n path.join(absoluteOut, \"server\", \"manifest.mjs\"),\n createServerManifestSource(routes, components, layouts, plugins, middleware, serverMiddleware, serverHandlers, vueIslands, app, error, runtimeConfig, buildOptions, absoluteRoot),\n \"utf8\"\n );\n await writeGeneratedArtifacts(absoluteOut, runtimeArtifacts, buildOptions.vite === \"dev\");\n await hooks.callHook(\"prepare:types\", {\n outDir: absoluteOut,\n files: [\n path.join(absoluteOut, \"resux.d.ts\"),\n path.join(absoluteOut, \"imports.d.ts\"),\n path.join(absoluteOut, \"components.d.ts\"),\n path.join(absoluteOut, \"server-routes.d.ts\")\n ]\n });\n\n if (buildOptions.server === \"bundle\") {\n await buildServerBundle(absoluteRoot, absoluteOut);\n }\n\n await hooks.callHook(\"build:done\", { appRoot: absoluteRoot, outDir: absoluteOut, mode });\n return {\n appRoot: absoluteRoot,\n outDir: absoluteOut,\n routes,\n components,\n layouts,\n plugins,\n clientEnhancements,\n middleware,\n serverMiddleware,\n serverHandlers,\n vueIslands,\n routeRules,\n contributions,\n app,\n error\n };\n } catch (error) {\n await hooks.callHook(\"build:error\", { appRoot: absoluteRoot, outDir: absoluteOut, mode, error });\n throw error;\n }\n}\n\nfunction createBuildCompatibilityId(input: {\n runtimeConfig: Record<string, unknown>;\n routes: RouteManifestRecord[];\n components: CompiledComponent[];\n plugins: CompiledPlugin[];\n middleware: CompiledMiddleware[];\n serverMiddleware: CompiledServerMiddleware[];\n serverHandlers: ServerHandlerRecord[];\n packages: PackageManifestEntry[];\n}): string {\n const hash = createHash(\"sha256\");\n hash.update(\"resux-build-compatibility-v1\\0\");\n hash.update(getClientRuntimeSource());\n hash.update(JSON.stringify(input.runtimeConfig));\n hash.update(JSON.stringify(input.routes.map(({ id, path: routePath, params, componentId, meta }) => ({ id, path: routePath, params, componentId, meta }))));\n for (const component of input.components) {\n hash.update(component.id);\n hash.update(component.serverSource);\n hash.update(component.clientSource);\n }\n for (const plugin of input.plugins) {\n hash.update(plugin.id);\n hash.update(plugin.serverSource);\n hash.update(plugin.clientSource);\n }\n for (const entry of input.middleware) {\n hash.update(entry.id);\n hash.update(entry.serverSource);\n hash.update(entry.clientSource);\n }\n for (const entry of input.serverMiddleware) {\n hash.update(entry.id);\n hash.update(entry.source);\n }\n for (const entry of input.serverHandlers) {\n hash.update(entry.id);\n hash.update(entry.source);\n }\n hash.update(JSON.stringify(input.packages));\n return hash.digest(\"hex\").slice(0, 24);\n}\n\nfunction injectRuntimeBuildCompatibilityId(runtimeConfig: Record<string, unknown>, buildId: string): void {\n const configuredRuntime = isPlainObject(runtimeConfig.runtimeConfig)\n ? runtimeConfig.runtimeConfig\n : {};\n const publicConfig = isPlainObject(configuredRuntime.public)\n ? configuredRuntime.public\n : {};\n configuredRuntime.public = {\n ...publicConfig,\n __resuxBuildId: buildId,\n };\n runtimeConfig.runtimeConfig = configuredRuntime;\n}\n\nasync function cleanGeneratedOutput(outDir: string): Promise<void> {\n const directoryRmOptions = {\n recursive: true,\n force: true,\n maxRetries: 6,\n retryDelay: 40,\n } as const;\n await mkdir(outDir, { recursive: true });\n await rm(path.join(outDir, \"server\"), directoryRmOptions);\n await rm(path.join(outDir, \"server-bundle\"), directoryRmOptions);\n await rm(path.join(outDir, \"client\"), directoryRmOptions);\n await rm(path.join(outDir, \"vite-client\"), directoryRmOptions);\n await rm(path.join(outDir, \"manifest\"), directoryRmOptions);\n await rm(path.join(outDir, \"types\"), directoryRmOptions);\n await rm(path.join(outDir, \"cache\"), directoryRmOptions);\n await rm(path.join(outDir, \"dev\"), directoryRmOptions);\n await rm(path.join(outDir, \"templates\"), directoryRmOptions);\n await rm(path.join(outDir, \"app.mjs\"), { force: true });\n await rm(path.join(outDir, \"routes.mjs\"), { force: true });\n await rm(path.join(outDir, \"plugins.mjs\"), { force: true });\n await rm(path.join(outDir, \"middleware.mjs\"), { force: true });\n await rm(path.join(outDir, \"components.mjs\"), { force: true });\n await rm(path.join(outDir, \"imports.mjs\"), { force: true });\n await rm(path.join(outDir, \"resux.d.ts\"), { force: true });\n await rm(path.join(outDir, \"imports.d.ts\"), { force: true });\n await rm(path.join(outDir, \"components.d.ts\"), { force: true });\n await rm(path.join(outDir, \"server-routes.d.ts\"), { force: true });\n await rm(path.join(outDir, \"manifest.json\"), { force: true });\n await rm(path.join(outDir, \"client-enhancements.mjs\"), { force: true });\n}\n\nasync function ensureGeneratedDirs(outDir: string, _dev: boolean): Promise<void> {\n await mkdir(path.join(outDir, \"server\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"resux-plugins\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"resux-middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"request-middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"handlers\"), { recursive: true });\n await mkdir(path.join(outDir, \"server\", \"config-modules\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"handlers\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"vue-islands\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"plugins\"), { recursive: true });\n await mkdir(path.join(outDir, \"client\", \"middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"handlers\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"vue-islands\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"plugins\"), { recursive: true });\n await mkdir(path.join(outDir, \"vite-client\", \"middleware\"), { recursive: true });\n await mkdir(path.join(outDir, \"manifest\"), { recursive: true });\n await mkdir(path.join(outDir, \"types\"), { recursive: true });\n await mkdir(path.join(outDir, \"cache\"), { recursive: true });\n await mkdir(path.join(outDir, \"templates\"), { recursive: true });\n await mkdir(path.join(outDir, \"dev\"), { recursive: true });\n}\n\nasync function buildServerBundle(root: string, outDir: string): Promise<void> {\n try {\n await viteBuild({\n root,\n configFile: false,\n publicDir: false,\n appType: \"custom\",\n clearScreen: false,\n logLevel: \"warn\",\n build: {\n ssr: path.join(outDir, \"server\", \"manifest.mjs\"),\n outDir: path.join(outDir, \"server-bundle\"),\n emptyOutDir: true,\n minify: \"oxc\",\n sourcemap: false,\n manifest: false,\n rollupOptions: {\n external: (id: string) => {\n if (id === \"resuxjs\" || id.startsWith(\"resuxjs/\")) return true;\n if (id.includes(\"node_modules\") || (!id.startsWith(\".\") && !path.isAbsolute(id))) return true;\n return false;\n },\n output: {\n format: \"es\",\n entryFileNames: \"index.mjs\",\n chunkFileNames: \"chunks/[name]-[hash].mjs\"\n }\n }\n }\n });\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Vite server build failed. Ensure vite is installed. ${message}`);\n }\n}\n\nasync function buildClientAssets(\n root: string,\n outDir: string,\n components: CompiledComponent[],\n plugins: CompiledPlugin[],\n middleware: CompiledMiddleware[],\n vueIslands: VueIslandRecord[],\n packageRegistry: ClientRuntimePackageRegistry,\n hooks?: ResuxHooks,\n contributions?: ResuxModuleContributions\n): Promise<void> {\n const inputRoot = path.join(outDir, \"vite-client\");\n const runtimeInput = await writeViteClientRuntime(outDir, packageRegistry);\n\n const input: Record<string, string> = {\n \"runtime-client\": runtimeInput\n };\n\n for (const component of components) {\n input[`handlers/${component.id}`] = path.join(inputRoot, \"handlers\", `${component.id}.mjs`);\n }\n\n for (const plugin of plugins.filter((entry) => entry.mode !== \"server\")) {\n input[`plugins/${plugin.id}`] = path.join(inputRoot, \"plugins\", `${plugin.id}.mjs`);\n }\n\n for (const entry of middleware.filter((candidate) => candidate.mode !== \"server\")) {\n input[`middleware/${entry.id}`] = path.join(inputRoot, \"middleware\", `${entry.id}.mjs`);\n }\n\n for (const island of vueIslands) {\n input[`vue-islands/${island.name}`] = path.join(inputRoot, \"vue-islands\", `${island.name}.mjs`);\n }\n\n try {\n const viteConfig: Record<string, unknown> = {\n root,\n configFile: false,\n publicDir: false,\n base: \"/__resux/\",\n appType: \"custom\",\n clearScreen: false,\n logLevel: \"warn\",\n plugins: [vuePlugin(), ...(contributions?.vitePlugins ?? [])],\n resolve: {\n alias: {\n vue: require.resolve(\"vue\"),\n \"@\": normalizePath(root),\n \"~\": normalizePath(root)\n }\n },\n build: {\n outDir: path.join(outDir, \"client\"),\n emptyOutDir: false,\n minify: \"oxc\",\n sourcemap: false,\n manifest: false,\n rollupOptions: {\n input,\n preserveEntrySignatures: \"strict\",\n external: (id: string) => id === \"/__resux/runtime-client.mjs\",\n output: {\n format: \"es\",\n entryFileNames: \"[name].mjs\",\n chunkFileNames: \"chunks/[name]-[hash].mjs\",\n assetFileNames: \"assets/[name]-[hash][extname]\"\n }\n }\n }\n };\n console.log(\"resux build client viteConfig:\", JSON.stringify(viteConfig, null, 2));\n for (const extender of contributions?.viteConfigExtenders ?? []) {\n await extender(viteConfig);\n }\n if (hooks) {\n await hooks.callHook(\"vite:extendConfig\", { config: viteConfig, dev: false });\n }\n await viteBuild(viteConfig as Parameters<typeof viteBuild>[0]);\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Vite client build failed. Ensure vite is installed. ${message}`);\n } finally {\n await rm(inputRoot, { recursive: true, force: true });\n }\n}\n\nasync function writeViteClientRuntime(\n outDir: string,\n packageRegistry: ClientRuntimePackageRegistry,\n): Promise<string> {\n const runtimeInput = path.join(outDir, \"vite-client\", \"runtime-client.mjs\");\n await writeFile(\n runtimeInput,\n getClientRuntimeSource({\n packageRegistry: {\n importers: packageRegistry.importers,\n css: packageRegistry.cssByPackage,\n declared: packageRegistry.declared,\n },\n }),\n \"utf8\",\n );\n return runtimeInput;\n}\n\nfunction createClientEnhancementManifestSource(entries: ClientEnhancementManifestEntry[]): string {\n const imports = entries\n .map((entry) => `import ${JSON.stringify(entry.src)};`)\n .join(\"\\n\");\n const names = [...new Set(entries.map((entry) => entry.name))];\n if (imports) {\n return `${imports}\\n\\nexport const clientEnhancements = ${JSON.stringify(names, null, 2)};\\n`;\n }\n return `export const clientEnhancements = ${JSON.stringify(names, null, 2)};\\n`;\n}\n\nasync function writeClientEnhancementManifests(\n outDir: string,\n entries: ClientEnhancementManifestEntry[],\n): Promise<void> {\n const source = createClientEnhancementManifestSource(entries);\n await writeFile(path.join(outDir, \"client-enhancements.mjs\"), source, \"utf8\");\n await writeFile(path.join(outDir, \"vite-client\", \"client-enhancements.mjs\"), source, \"utf8\");\n await writeFile(path.join(outDir, \"client\", \"client-enhancements.mjs\"), source, \"utf8\");\n}\n\nexport async function compileVueFile(file: string, options: { id: string; name?: string; outDir?: string }): Promise<CompiledComponent> {\n const source = await readFile(file, \"utf8\");\n return compileVueSource(source, {\n file,\n id: options.id,\n name: options.name ?? pascalCase(path.basename(file, \".vue\")),\n outDir: options.outDir\n });\n}\n\nexport function compileVueSource(source: string, options: { file: string; id: string; name: string; outDir?: string }): CompiledComponent {\n const parsed = parseSfc(source, { filename: options.file });\n const descriptor = parsed.descriptor;\n\n if (!descriptor.template) {\n throw new ResuxCompileError(\"Resux components need a <template> block.\", locationFromOffset(options.file, source, 0));\n }\n\n const script = descriptor.scriptSetup?.content ?? \"\";\n const templateRefBindings = inferTemplateRefBindings(script, options.file);\n const template = compileTemplate(descriptor.template.content, options.file, templateRefBindings);\n const analysis = analyzeScript(script, options.file, template.inlineHandlers);\n const compiledStyles = compileSfcStyles(descriptor.styles, {\n id: options.id,\n file: options.file\n });\n validateTemplateHandlers(template.handlers, analysis, options.file, source, template.allLocals);\n const serverSource = createComponentModuleSource({\n id: options.id,\n name: options.name,\n file: options.file,\n template: template.nodes,\n templateRefs: template.templateRefs,\n templateForRefs: template.templateForRefs,\n analysis,\n styles: compiledStyles.styles,\n styleScopeId: compiledStyles.styleScopeId,\n client: false,\n expressions: template.expressions,\n outDir: options.outDir\n });\n const clientSource = createComponentModuleSource({\n id: options.id,\n name: options.name,\n file: options.file,\n template: template.nodes,\n templateRefs: template.templateRefs,\n templateForRefs: template.templateForRefs,\n analysis,\n styles: compiledStyles.styles,\n styleScopeId: compiledStyles.styleScopeId,\n client: true,\n expressions: template.expressions,\n outDir: options.outDir\n });\n\n return {\n id: options.id,\n name: options.name,\n file: options.file,\n serverSource,\n clientSource,\n template: template.nodes,\n templateRefs: template.templateRefs,\n templateForRefs: template.templateForRefs,\n handlers: [...new Set(template.handlers.map((event) => event.handler))],\n styles: compiledStyles.styles,\n styleScopeId: compiledStyles.styleScopeId,\n meta: analysis.pageMeta,\n expressions: template.expressions\n };\n}\n\nfunction compileSfcStyles(\n styleBlocks: SFCStyleBlock[],\n options: { id: string; file: string }\n): { styles: ComponentStyle[]; styleScopeId?: string } {\n const scopeId = `rx-s-${options.id}`;\n const styles: ComponentStyle[] = [];\n let hasScopedStyles = false;\n\n for (let index = 0; index < styleBlocks.length; index++) {\n const style = styleBlocks[index];\n const lang = style.lang ?? (typeof style.attrs.lang === \"string\" ? style.attrs.lang : undefined);\n\n if (lang && lang !== \"css\") {\n throw new ResuxCompileError(\n `Resux <style> only supports plain CSS in resumable components. Unsupported lang \"${lang}\".`,\n styleBlockLocation(options.file, style)\n );\n }\n if (style.module) {\n throw new ResuxCompileError(\n \"Resux <style module> is not supported in resumable components yet.\",\n styleBlockLocation(options.file, style)\n );\n }\n if (style.src) {\n throw new ResuxCompileError(\n \"Resux <style src> is not supported in resumable components yet.\",\n styleBlockLocation(options.file, style)\n );\n }\n\n const result = compileStyle({\n id: scopeId,\n filename: options.file,\n source: style.content,\n scoped: Boolean(style.scoped),\n isProd: true\n });\n\n if (result.errors.length > 0) {\n const error = result.errors[0];\n const message = error instanceof Error ? error.message : String(error);\n throw new ResuxCompileError(message, styleBlockLocation(options.file, style));\n }\n\n const css = result.code.trim();\n if (!css) {\n continue;\n }\n\n hasScopedStyles ||= Boolean(style.scoped);\n styles.push({\n id: `${options.id}-${index}`,\n css,\n scoped: Boolean(style.scoped)\n });\n }\n\n return {\n styles,\n styleScopeId: hasScopedStyles ? `data-v-${scopeId}` : undefined\n };\n}\n\nfunction styleBlockLocation(file: string, style: SFCStyleBlock): CompileErrorLocation {\n return {\n file,\n line: style.loc.start.line,\n column: style.loc.start.column\n };\n}\n\nexport function createRouteManifest(\n root: string,\n files: string[],\n idByFile?: Map<string, string>,\n compiledByFile?: Map<string, CompiledComponent>\n): RouteManifestRecord[] {\n return files\n .map((file, index) => {\n const normalizedRoot = normalizePath(path.resolve(root));\n const normalizedFile = normalizePath(path.resolve(file));\n const appPagesRoot = `${normalizedRoot}/app/pages/`;\n const pagesRoot = `${normalizedRoot}/pages/`;\n const relative = normalizedFile.startsWith(appPagesRoot)\n ? normalizedFile.slice(appPagesRoot.length)\n : normalizedFile.startsWith(pagesRoot)\n ? normalizedFile.slice(pagesRoot.length)\n : normalizePath(path.relative(path.join(root, \"pages\"), file));\n const withoutExtension = relative.replace(/\\.vue$/, \"\");\n const parts = withoutExtension.split(\"/\");\n const params: string[] = [];\n const routeParts = parts\n .filter((part, partIndex) => !(part === \"index\" && partIndex === parts.length - 1))\n .map((part) => {\n const catchAllMatch = /^\\[\\.\\.\\.([A-Za-z0-9_]+)\\]$/.exec(part);\n if (catchAllMatch) {\n params.push(catchAllMatch[1]);\n return `:${catchAllMatch[1]}*`;\n }\n const match = /^\\[([A-Za-z0-9_]+)\\]$/.exec(part);\n if (match) {\n params.push(match[1]);\n return `:${match[1]}`;\n }\n return part;\n });\n const routePath = `/${routeParts.join(\"/\")}`.replace(/\\/$/, \"\") || \"/\";\n\n return {\n id: `r${index}`,\n path: routePath,\n file,\n params,\n componentId: idByFile?.get(file) ?? `m${index}`,\n meta: compiledByFile?.get(file)?.meta\n };\n })\n .sort((a, b) => routeScore(b.path) - routeScore(a.path) || a.path.localeCompare(b.path));\n}\n\nasync function ensureServerComponentModules(outDir: string, components: CompiledComponent[]): Promise<void> {\n for (const component of components) {\n const file = path.join(outDir, \"server\", `${component.id}.mjs`);\n if (await existsFile(file)) {\n continue;\n }\n await writeFile(file, component.serverSource, \"utf8\");\n }\n}\n\nfunction localizeRouteManifest(routes: RouteManifestRecord[], runtimeConfig: Record<string, unknown>): RouteManifestRecord[] {\n const i18n = readRuntimeI18nConfig(runtimeConfig);\n if (!i18n) {\n return routes;\n }\n\n const localeCodes = i18n.strategy === \"no_prefix\"\n ? [i18n.defaultLocale]\n : i18n.locales.map((locale) => locale.code);\n const localized: RouteManifestRecord[] = [];\n const seenPaths = new Set<string>();\n\n for (const route of routes) {\n for (const localeCode of localeCodes) {\n const localizedPath = buildLocalePath(route.path, localeCode, i18n);\n if (seenPaths.has(localizedPath)) {\n continue;\n }\n seenPaths.add(localizedPath);\n localized.push({\n ...route,\n path: localizedPath,\n id: route.id\n });\n }\n }\n\n return localized\n .sort((a, b) => routeScore(b.path) - routeScore(a.path) || a.path.localeCompare(b.path))\n .map((route, index) => ({\n ...route,\n id: `r${index}`\n }));\n}\n\nfunction readRuntimeI18nConfig(runtimeConfig: Record<string, unknown>): ResuxI18nRuntimeConfig | null {\n const directPublicConfig = isPlainObject(runtimeConfig.public)\n ? runtimeConfig.public\n : null;\n const nestedRuntimeConfig = isPlainObject(runtimeConfig.runtimeConfig)\n ? runtimeConfig.runtimeConfig\n : null;\n const nestedPublicConfig = nestedRuntimeConfig && isPlainObject(nestedRuntimeConfig.public)\n ? nestedRuntimeConfig.public\n : null;\n const publicConfig = directPublicConfig ?? nestedPublicConfig;\n if (!publicConfig) {\n return null;\n }\n const i18n = publicConfig.i18n;\n return normalizeI18nRuntimeConfig(i18n);\n}\n\n// Refs inside v-for subtrees resolve to one element per iteration, so they\n// must always read back as an array, even for a single rendered item.\nfunction collectTemplateForRefs(nodes: TemplateNode[], insideFor = false, out: Set<string> = new Set<string>()): Set<string> {\n for (const node of nodes) {\n if (!node || node.type !== \"element\") {\n continue;\n }\n const nowInsideFor = insideFor || Boolean(node.for);\n if (nowInsideFor && node.ref) {\n out.add(node.ref);\n }\n if (Array.isArray(node.children)) {\n collectTemplateForRefs(node.children, nowInsideFor, out);\n }\n }\n return out;\n}\n\nfunction compileTemplate(\n template: string,\n file: string,\n templateRefBindings: Set<string> = new Set()\n): {\n nodes: TemplateNode[];\n handlers: TemplateEvent[];\n inlineHandlers: GeneratedHandler[];\n expressions: { id: string; original: string; transformed: string; locals: string[] }[];\n allLocals: string[];\n templateRefs: string[];\n templateForRefs: string[];\n} {\n const ast = parseTemplate(template, { comments: false });\n const state: CompileTemplateState = {\n file,\n templateRefBindings,\n templateRefs: new Set<string>(),\n bindingIndex: 0,\n inlineHandlerIndex: 0,\n handlers: [],\n inlineHandlers: [],\n expressions: [],\n activeLocals: [],\n allLocals: new Set<string>()\n };\n\n const nodes = compileTemplateChildren(ast.children, state);\n return {\n nodes,\n handlers: state.handlers,\n inlineHandlers: state.inlineHandlers,\n expressions: state.expressions,\n allLocals: Array.from(state.allLocals),\n templateRefs: Array.from(state.templateRefs),\n templateForRefs: Array.from(collectTemplateForRefs(nodes))\n };\n}\n\nfunction compileTemplateChildren(children: TemplateChildNode[], state: CompileTemplateState): TemplateNode[] {\n const nodes: TemplateNode[] = [];\n let conditionalChainExpressions: string[] | null = null;\n\n for (const child of children) {\n if (child.type === NodeTypes.ELEMENT) {\n const conditionalDirective = resolveConditionalDirective(child, state);\n if (!conditionalDirective) {\n conditionalChainExpressions = null;\n const compiledNode = compileTemplateNode(child, state);\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n if (conditionalDirective.kind === \"if\") {\n const expressionResult = transformTemplateExpressionCode(\n conditionalDirective.expression!,\n state.templateRefBindings,\n state.file,\n conditionalDirective.directive\n );\n conditionalChainExpressions = [expressionResult.transformed];\n const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expressionResult.transformed });\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n if (!conditionalChainExpressions || conditionalChainExpressions.length === 0) {\n throw new ResuxCompileError(\n `v-${conditionalDirective.kind} must follow a sibling with v-if or v-else-if.`,\n locationFromVueNode(state.file, conditionalDirective.directive),\n );\n }\n\n if (conditionalDirective.kind === \"else-if\") {\n const branchExpressionResult = transformTemplateExpressionCode(\n conditionalDirective.expression!,\n state.templateRefBindings,\n state.file,\n conditionalDirective.directive\n );\n const expression = `${buildConditionalChainGuard(conditionalChainExpressions)} && (${branchExpressionResult.transformed})`;\n conditionalChainExpressions.push(branchExpressionResult.transformed);\n const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n const expression = buildConditionalChainGuard(conditionalChainExpressions);\n conditionalChainExpressions = null;\n const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n continue;\n }\n\n if (child.type !== NodeTypes.TEXT || child.content.trim().length > 0) {\n conditionalChainExpressions = null;\n }\n\n const compiledNode = compileTemplateNode(child, state);\n if (compiledNode) {\n nodes.push(compiledNode);\n }\n }\n\n return nodes;\n}\n\nfunction buildConditionalChainGuard(expressions: string[]): string {\n return expressions.map((expression) => `!(${expression})`).join(\" && \");\n}\n\nfunction resolveConditionalDirective(node: ElementNode, state: CompileTemplateState): ConditionalDirectiveInfo | null {\n let conditional: ConditionalDirectiveInfo | null = null;\n for (const prop of node.props) {\n if (prop.type !== NodeTypes.DIRECTIVE) {\n continue;\n }\n if (prop.name !== \"if\" && prop.name !== \"else-if\" && prop.name !== \"else\") {\n continue;\n }\n if (conditional) {\n throw new ResuxCompileError(\n \"Only one conditional directive is allowed per element.\",\n locationFromVueNode(state.file, prop),\n );\n }\n\n const expression = expressionContent(prop.exp).trim();\n if ((prop.name === \"if\" || prop.name === \"else-if\") && expression.length === 0) {\n throw new ResuxCompileError(\n `v-${prop.name} needs an expression.`,\n locationFromVueNode(state.file, prop),\n );\n }\n if (prop.name === \"else\" && expression.length > 0) {\n throw new ResuxCompileError(\n \"v-else does not accept an expression.\",\n locationFromVueNode(state.file, prop),\n );\n }\n\n conditional = {\n kind: prop.name,\n directive: prop,\n expression: expression.length > 0 ? expression : undefined,\n };\n }\n\n return conditional;\n}\n\nfunction expressionContent(node: unknown): string {\n if (node && typeof node === \"object\" && \"content\" in node && typeof node.content === \"string\") {\n return node.content;\n }\n return \"\";\n}\n\nfunction compileTemplateNode(\n node: TemplateChildNode,\n state: CompileTemplateState,\n options: CompileTemplateNodeOptions = {},\n): TemplateNode | null {\n if (node.type === NodeTypes.TEXT) {\n return {\n type: \"text\",\n value: node.content\n };\n }\n\n if (node.type === NodeTypes.INTERPOLATION) {\n return {\n type: \"interpolation\",\n expression: registerTemplateExpression(expressionContent(node.content), state.templateRefBindings, state.file, node, state),\n bindingId: nextBindingId(state)\n };\n }\n\n if (node.type !== NodeTypes.ELEMENT) {\n return null;\n }\n\n // Find v-for to track locals for children\n const forProp = node.props.find((prop) => prop.type === NodeTypes.DIRECTIVE && prop.name === \"for\") as DirectiveNode | undefined;\n let addedLocals = 0;\n if (forProp) {\n const expression = expressionContent(forProp.exp);\n if (expression) {\n const parsedFor = parseForExpression(expression, state.file, forProp, state);\n state.activeLocals.push(parsedFor.value);\n state.allLocals.add(parsedFor.value);\n addedLocals++;\n if (parsedFor.index) {\n state.activeLocals.push(parsedFor.index);\n state.allLocals.add(parsedFor.index);\n addedLocals++;\n }\n }\n }\n\n // Find slot props to track locals for children\n const slotProp = node.props.find((prop) => prop.type === NodeTypes.DIRECTIVE && prop.name === \"slot\") as DirectiveNode | undefined;\n if (slotProp) {\n const expression = expressionContent(slotProp.exp);\n if (expression) {\n const slotLocals = parseBindingNames(expression);\n for (const local of slotLocals) {\n state.activeLocals.push(local);\n state.allLocals.add(local);\n addedLocals++;\n }\n }\n }\n\n const attrs: TemplateAttribute[] = [];\n const events: TemplateEvent[] = [];\n const element: ElementTemplateNode = {\n type: \"element\",\n tag: node.tag,\n attrs,\n events,\n children: compileTemplateChildren(node.children, state)\n };\n\n for (const prop of node.props) {\n if (prop.type === NodeTypes.ATTRIBUTE) {\n if (prop.name === \"ref\" && prop.value?.content) {\n const refName = prop.value.content.trim();\n if (refName) {\n state.templateRefs.add(refName);\n element.ref = refName;\n }\n }\n attrs.push({\n kind: \"static\",\n name: prop.name,\n value: prop.value?.content ?? \"\"\n });\n continue;\n }\n\n if (prop.type !== NodeTypes.DIRECTIVE) {\n continue;\n }\n\n if (prop.name === \"bind\") {\n const arg = expressionContent(prop.arg);\n const expression = expressionContent(prop.exp);\n if (!arg || !expression) {\n throw new ResuxCompileError(\"Dynamic bindings need an argument and expression.\", locationFromVueNode(state.file, prop));\n }\n if (arg === \"ref\") {\n const trimmed = expression.trim();\n const quotedMatch = /^(['\"`])([\\s\\S]*)\\1$/.exec(trimmed);\n const staticRefName = quotedMatch\n ? quotedMatch[2].trim()\n : (/^[A-Za-z_$][\\w$]*$/.test(trimmed) ? trimmed : \"\");\n if (staticRefName) {\n state.templateRefs.add(staticRefName);\n element.ref = staticRefName;\n }\n }\n attrs.push({\n kind: \"dynamic\",\n name: arg,\n value: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n });\n continue;\n }\n\n if (prop.name === \"on\") {\n const arg = expressionContent(prop.arg);\n const expression = expressionContent(prop.exp);\n const modifiers = normalizeEventModifiers(prop.modifiers ?? [], state.file, prop);\n if (!arg || !expression) {\n throw new ResuxCompileError(\"Events need an argument and expression.\", locationFromVueNode(state.file, prop));\n }\n const isSimpleIdentifier = /^[A-Za-z_$][\\w$]*$/.test(expression);\n if (isSimpleIdentifier && state.activeLocals.includes(expression)) {\n throw new ResuxCompileError(\n `Direct template-local event handler \"${expression}\" cannot be resumed because template locals are serialized by value. Call a top-level handler with serializable local data instead.`,\n locationFromVueNode(state.file, prop),\n );\n }\n const usesInlineHandler = !isSimpleIdentifier;\n const inlineHandler = usesInlineHandler\n ? createInlineEventHandler(expression, state, prop)\n : null;\n const handler = inlineHandler?.name ?? expression;\n const event: TemplateEvent = {\n name: arg,\n handler,\n modifiers,\n ...(inlineHandler?.locals.length ? { locals: inlineHandler.locals } : {})\n };\n events.push(event);\n state.handlers.push(event);\n continue;\n }\n\n if (prop.name === \"if\") {\n if (options.ifExpressionOverride) {\n continue;\n }\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-if needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.if = {\n expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n blockId: nextBindingId(state)\n };\n continue;\n }\n\n if (prop.name === \"else-if\" || prop.name === \"else\") {\n if (options.ifExpressionOverride) {\n continue;\n }\n throw new ResuxCompileError(\n `v-${prop.name} must follow a sibling with v-if or v-else-if.`,\n locationFromVueNode(state.file, prop),\n );\n }\n\n if (prop.name === \"for\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-for needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.for = parseForExpression(expression, state.file, prop, state);\n element.for.source = registerTemplateExpression(element.for.source, state.templateRefBindings, state.file, prop, state);\n continue;\n }\n\n if (prop.name === \"show\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-show needs an expression.\", locationFromVueNode(state.file, prop));\n }\n attrs.push({\n kind: \"dynamic\",\n name: \"hidden\",\n value: registerRawTemplateExpression(`!(${transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).transformed})`, expression, transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).identifiers, state),\n bindingId: nextBindingId(state)\n });\n continue;\n }\n\n if (prop.name === \"text\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-text needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.children = [{\n type: \"interpolation\",\n expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n }];\n continue;\n }\n\n if (prop.name === \"html\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-html needs an expression.\", locationFromVueNode(state.file, prop));\n }\n element.html = {\n expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n };\n element.children = [];\n continue;\n }\n\n if (prop.name === \"model\") {\n const expression = expressionContent(prop.exp);\n if (!expression) {\n throw new ResuxCompileError(\"v-model needs an expression.\", locationFromVueNode(state.file, prop));\n }\n if (!isAssignableExpression(expression)) {\n throw new ResuxCompileError(\"v-model needs an assignable expression like \\\"message.value\\\".\", locationFromVueNode(state.file, prop));\n }\n const assignmentRoot = assignableExpressionRoot(expression);\n if (assignmentRoot && state.activeLocals.includes(assignmentRoot)) {\n throw new ResuxCompileError(\n `v-model cannot assign through template-local binding \"${assignmentRoot}\" because resumed event locals are serialized by value. Bind v-model to resumable component state instead.`,\n locationFromVueNode(state.file, prop),\n );\n }\n const model = createModelBinding(node.tag, node.props, expression, state, prop);\n attrs.push({\n kind: \"dynamic\",\n name: model.attribute,\n value: registerTemplateExpression(model.value, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n });\n const event: TemplateEvent = {\n name: model.event,\n handler: model.handler,\n modifiers: [],\n ...(model.locals.length > 0 ? { locals: model.locals } : {})\n };\n events.push(event);\n state.handlers.push(event);\n continue;\n }\n\n const argSuffix = prop.arg ? `:${expressionContent(prop.arg)}` : \"\";\n const name = `v-${prop.name}${argSuffix}`;\n const expression = expressionContent(prop.exp);\n if (expression) {\n attrs.push({\n kind: \"dynamic\",\n name,\n value: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),\n bindingId: nextBindingId(state)\n });\n } else {\n attrs.push({\n kind: \"static\",\n name,\n value: \"\"\n });\n }\n continue;\n }\n\n if (options.ifExpressionOverride) {\n const conditionalExpression = transformTemplateExpressionCode(\n options.ifExpressionOverride,\n state.templateRefBindings,\n state.file,\n node,\n );\n element.if = {\n expression: registerRawTemplateExpression(\n conditionalExpression.transformed,\n options.ifExpressionOverride,\n conditionalExpression.identifiers,\n state,\n ),\n blockId: nextBindingId(state),\n };\n }\n\n if (addedLocals > 0) {\n state.activeLocals.splice(state.activeLocals.length - addedLocals, addedLocals);\n }\n\n return element;\n}\n\nfunction selectReferencedActiveLocals(activeLocals: string[], identifiers: string[]): string[] {\n const referenced = new Set(identifiers);\n const seen = new Set<string>();\n const selected: string[] = [];\n for (let index = activeLocals.length - 1; index >= 0; index -= 1) {\n const local = activeLocals[index];\n if (!referenced.has(local) || seen.has(local)) continue;\n seen.add(local);\n selected.unshift(local);\n }\n return selected;\n}\n\nfunction createInlineEventHandler(\n expression: string,\n state: CompileTemplateState,\n node?: VueCompilerNode\n): { name: string; locals: string[] } {\n const name = nextInlineHandlerName(state);\n const transformed = transformTemplateExpressionCode(\n expression,\n state.templateRefBindings,\n state.file,\n node ?? ({} as any)\n );\n const capturedLocals = selectReferencedActiveLocals(state.activeLocals, transformed.identifiers);\n const localBindings = capturedLocals\n .map((local) => `const ${local} = __rx_event_locals[${JSON.stringify(local)}];`)\n .join(\"\\n\");\n state.inlineHandlers.push({\n name,\n source: `function ${name}($event, __rx_event_locals = {}) {\\n${localBindings}${localBindings ? \"\\n\" : \"\"}${transformed.transformed}\\n}`,\n locals: capturedLocals\n });\n return { name, locals: capturedLocals };\n}\n\nfunction createModelBinding(\n tag: string,\n props: Array<AttributeNode | DirectiveNode>,\n expression: string,\n state: CompileTemplateState,\n node?: VueCompilerNode\n): { attribute: string; value: string; event: string; handler: string; locals: string[] } {\n const normalizedTag = tag.toLowerCase();\n const inputType = normalizedTag === \"input\" ? staticAttributeValue(props, \"type\")?.toLowerCase() : undefined;\n const isCheckbox = inputType === \"checkbox\";\n const handler = nextInlineHandlerName(state);\n const target = \"$event.target\";\n const assignmentExpression = state.templateRefBindings.has(expression.trim()) ? `${expression.trim()}.value` : expression;\n const assignment = isCheckbox\n ? `${assignmentExpression} = Boolean(${target} && ${target}.checked)`\n : `${assignmentExpression} = ${target} ? ${target}.value : \"\"`;\n const identifiers = transformTemplateExpressionCode(\n expression,\n state.templateRefBindings,\n state.file,\n node ?? ({} as any)\n ).identifiers;\n const capturedLocals = selectReferencedActiveLocals(state.activeLocals, identifiers);\n const localBindings = capturedLocals\n .map((local) => `const ${local} = __rx_event_locals[${JSON.stringify(local)}];`)\n .join(\"\\n\");\n\n state.inlineHandlers.push({\n name: handler,\n source: `function ${handler}($event, __rx_event_locals = {}) {\\n${localBindings}${localBindings ? \"\\n\" : \"\"}${assignment}\\n}`,\n locals: capturedLocals\n });\n\n return {\n attribute: isCheckbox ? \"checked\" : \"value\",\n value: expression,\n event: isCheckbox || normalizedTag === \"select\" ? \"change\" : \"input\",\n handler,\n locals: capturedLocals\n };\n}\n\nfunction staticAttributeValue(props: Array<AttributeNode | DirectiveNode>, name: string): string | undefined {\n const attr = props.find((prop): prop is AttributeNode => prop.type === NodeTypes.ATTRIBUTE && prop.name === name);\n return attr?.value?.content;\n}\n\nfunction registerTemplateExpression(\n expression: string,\n templateRefBindings: Set<string>,\n file: string,\n node: VueCompilerNode,\n state: CompileTemplateState\n): string {\n const result = transformTemplateExpressionCode(expression, templateRefBindings, file, node);\n return registerRawTemplateExpression(result.transformed, expression, result.identifiers, state);\n}\n\nfunction registerRawTemplateExpression(\n transformed: string,\n original: string,\n identifiers: string[],\n state: CompileTemplateState\n): string {\n const id = `__rx_expr_${state.expressions.length}`;\n state.expressions.push({\n id,\n original,\n transformed,\n locals: identifiers // repurposing locals to store the free identifiers needed for the closure\n });\n return id;\n}\n\nfunction transformTemplateExpressionCode(\n expression: string,\n templateRefBindings: Set<string>,\n file: string,\n node: VueCompilerNode\n): { transformed: string; identifiers: string[] } {\n if (expression.trim() === \"\") {\n return { transformed: expression, identifiers: [] };\n }\n\n const wrapped = `(${expression})`;\n const sourceFile = ts.createSourceFile(`${file}?template-expression`, wrapped, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n if (((sourceFile as unknown as { parseDiagnostics?: unknown[] }).parseDiagnostics ?? []).length > 0) {\n throw new ResuxCompileError(\"Template expression is not valid JavaScript.\", locationFromVueNode(file, node));\n }\n\n const insertions: number[] = [];\n const identifiers = new Set<string>();\n\n const visit = (current: ts.Node): void => {\n if (ts.isIdentifier(current)) {\n if (shouldAutoUnwrapTemplateIdentifier(current) && !isShadowedByFunctionParameter(current)) {\n if (templateRefBindings.has(current.text)) {\n const position = current.end - 1;\n if (position >= 0 && position <= expression.length) {\n insertions.push(position);\n }\n }\n }\n\n let isPropertyName = false;\n const parent = current.parent;\n if (parent) {\n if (ts.isPropertyAccessExpression(parent) && parent.name === current) {\n isPropertyName = true;\n }\n if (ts.isPropertyAssignment(parent) && parent.name === current) {\n isPropertyName = true;\n }\n }\n\n if (!isPropertyName && ![\"undefined\", \"NaN\", \"Infinity\", \"arguments\", \"this\"].includes(current.text)) {\n identifiers.add(current.text);\n }\n }\n\n ts.forEachChild(current, visit);\n };\n\n visit(sourceFile);\n \n let transformed = expression;\n if (insertions.length > 0) {\n const uniqueInsertions = [...new Set(insertions)].sort((a, b) => b - a);\n for (const position of uniqueInsertions) {\n transformed = `${transformed.slice(0, position)}.value${transformed.slice(position)}`;\n }\n }\n \n return { transformed, identifiers: [...identifiers] };\n}\n\n// An identifier that is a parameter of an enclosing function (or the parameter\n// declaration itself) belongs to that function, so it must not be rewritten to\n// `.value` even when a template ref of the same name exists.\nfunction isShadowedByFunctionParameter(node: ts.Identifier): boolean {\n for (let current: ts.Node | undefined = node; current; current = current.parent) {\n if (!ts.isArrowFunction(current) && !ts.isFunctionExpression(current)) {\n continue;\n }\n\n for (const parameter of current.parameters) {\n if (collectBindingNames(parameter.name).includes(node.text)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction shouldAutoUnwrapTemplateIdentifier(node: ts.Identifier): boolean {\n const parent = node.parent;\n if (!parent) {\n return true;\n }\n\n if (ts.isPropertyAccessExpression(parent)) {\n if (parent.expression === node && parent.name.text === \"value\") {\n return false;\n }\n return parent.name !== node;\n }\n\n if (ts.isPropertyAssignment(parent) && parent.name === node) {\n return false;\n }\n\n if (ts.isShorthandPropertyAssignment(parent) || ts.isBindingElement(parent)) {\n return false;\n }\n\n return true;\n}\n\nfunction isAssignableExpression(expression: string): boolean {\n return /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\[[^\\]]+\\])*$/.test(expression.trim());\n}\n\nfunction assignableExpressionRoot(expression: string): string | undefined {\n return /^([A-Za-z_$][\\w$]*)/.exec(expression.trim())?.[1];\n}\n\nfunction normalizeEventModifiers(modifiers: SimpleExpressionNode[], file: string, node: VueCompilerNode): string[] {\n const modifierNames = modifiers.map((modifier) => String(modifier.content));\n const supported = new Set([\n \"prevent\",\n \"stop\",\n \"self\",\n \"once\",\n \"capture\",\n \"passive\",\n \"ctrl\",\n \"shift\",\n \"alt\",\n \"meta\",\n \"exact\",\n \"left\",\n \"middle\",\n \"right\",\n \"enter\",\n \"tab\",\n \"delete\",\n \"esc\",\n \"escape\",\n \"space\",\n \"up\",\n \"down\",\n \"left\",\n \"right\"\n ]);\n const unsupported = modifierNames.find((modifier) => !supported.has(modifier));\n\n if (unsupported) {\n throw new ResuxCompileError(\n `Event modifier \".${unsupported}\" is not supported in the resumability runtime yet.`,\n locationFromVueNode(file, node)\n );\n }\n\n return modifierNames;\n}\n\nfunction parseForExpression(expression: string, file: string, node: VueCompilerNode, state: CompileTemplateState) {\n const match = /^\\s*(?:\\(([^)]+)\\)|([A-Za-z_$][\\w$]*))\\s+(?:in|of)\\s+(.+)\\s*$/.exec(expression);\n if (!match) {\n throw new ResuxCompileError(\"v-for must look like \\\"item in items\\\" or \\\"(item, index) in items\\\".\", locationFromVueNode(file, node));\n }\n const aliases = (match[1] ?? match[2]).split(\",\").map((part) => part.trim()).filter(Boolean);\n if (!aliases[0] || aliases.length > 2) {\n throw new ResuxCompileError(\"v-for supports only value and optional index aliases.\", locationFromVueNode(file, node));\n }\n return {\n value: aliases[0],\n index: aliases[1],\n source: match[3],\n blockId: nextBindingId(state)\n };\n}\n\nfunction parseBindingNames(expression: string): string[] {\n const source = `const ${expression} = null;`;\n const sf = ts.createSourceFile(\"temp.ts\", source, ts.ScriptTarget.Latest, true);\n const names: string[] = [];\n if (sf.statements.length > 0) {\n const stmt = sf.statements[0];\n if (ts.isVariableStatement(stmt)) {\n const decl = stmt.declarationList.declarations[0];\n if (decl) {\n names.push(...collectBindingNames(decl.name));\n }\n }\n }\n return names;\n}\n\nfunction rewriteImportStatementText(\n statement: ts.ImportDeclaration | ts.ImportEqualsDeclaration,\n sourceFile: ts.SourceFile,\n file: string\n): string {\n if (ts.isImportDeclaration(statement)) {\n const specifier = statement.moduleSpecifier;\n if (ts.isStringLiteral(specifier)) {\n const importPath = specifier.text;\n if (importPath.startsWith(\".\")) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const normalized = fileUrl(resolvedPath);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n }\n } else if (ts.isImportEqualsDeclaration(statement)) {\n const moduleRef = statement.moduleReference;\n if (ts.isExternalModuleReference(moduleRef) && ts.isStringLiteral(moduleRef.expression)) {\n const specifier = moduleRef.expression;\n const importPath = specifier.text;\n if (importPath.startsWith(\".\")) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const normalized = fileUrl(resolvedPath);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n }\n }\n return statement.getFullText(sourceFile);\n}\n\nfunction findProjectRoot(startFile: string): string {\n let dir = path.dirname(startFile);\n while (true) {\n if (existsSync(path.join(dir, \"resux.config.ts\")) || \n existsSync(path.join(dir, \"package.json\")) ||\n existsSync(path.join(dir, \"nuxt.config.ts\"))) {\n return dir;\n }\n const parent = path.dirname(dir);\n if (parent === dir) {\n break;\n }\n dir = parent;\n }\n return path.dirname(startFile);\n}\n\nconst IMAGE_VIDEO_FONT_EXTENSIONS = new Set([\n \".webp\", \".png\", \".jpg\", \".jpeg\", \".svg\", \".gif\", \".ico\", \".webm\", \".mp4\",\n \".wav\", \".mp3\", \".ogg\", \".woff\", \".woff2\", \".ttf\", \".eot\"\n]);\n\nconst STYLESHEET_EXTENSIONS = new Set([\n \".css\", \".scss\", \".sass\", \".less\", \".styl\", \".stylus\"\n]);\n\nfunction ensureCompiledUserModule(\n resolvedFile: string,\n projectRoot: string,\n outDir: string,\n compiledSet = new Set<string>()\n): string {\n const relativePath = normalizePath(path.relative(projectRoot, resolvedFile));\n const safeRelativePath = relativePath\n .split(\"/\")\n .map((segment) =>\n segment\n .replace(/_/g, \"__\")\n .replace(/[%#?]/g, (character) => `_${character.codePointAt(0)!.toString(16).toUpperCase()}_`)\n )\n .join(\"/\")\n .replace(/\\.[jt]sx?$/, \".mjs\");\n const targetJsFile = path.join(outDir, \"server\", \"imported\", safeRelativePath);\n\n if (compiledSet.has(resolvedFile)) {\n return targetJsFile;\n }\n compiledSet.add(resolvedFile);\n\n let sourceText = \"\";\n try {\n sourceText = ts.sys.readFile(resolvedFile) ?? \"\";\n } catch {\n return resolvedFile;\n }\n\n const sourceFile = ts.createSourceFile(resolvedFile, sourceText, ts.ScriptTarget.ES2022, true);\n const replacements: Array<{ start: number; end: number; replacement: string }> = [];\n\n for (const statement of sourceFile.statements) {\n if (ts.isImportDeclaration(statement) && statement.moduleSpecifier && ts.isStringLiteral(statement.moduleSpecifier)) {\n const specifier = statement.moduleSpecifier;\n const importPath = specifier.text;\n if (importPath.startsWith(\".\") || importPath.startsWith(\"@/\") || importPath.startsWith(\"~/\")) {\n let resolvedImported = \"\";\n if (importPath.startsWith(\".\")) {\n resolvedImported = path.resolve(path.dirname(resolvedFile), importPath);\n } else {\n resolvedImported = path.resolve(projectRoot, importPath.slice(2));\n }\n resolvedImported = resolveFileExtension(resolvedImported);\n const ext = path.extname(resolvedImported).toLowerCase();\n if (ext === \".ts\" || ext === \".tsx\" || ext === \".js\" || ext === \".jsx\") {\n const compiledTarget = ensureCompiledUserModule(resolvedImported, projectRoot, outDir, compiledSet);\n const relativeToCompiled = path.relative(path.dirname(targetJsFile), compiledTarget);\n const relativeImportPath = relativeToCompiled.startsWith(\".\")\n ? relativeToCompiled.replace(/\\\\/g, \"/\")\n : \"./\" + relativeToCompiled.replace(/\\\\/g, \"/\");\n replacements.push({\n start: specifier.getStart(sourceFile),\n end: specifier.getEnd(),\n replacement: JSON.stringify(relativeImportPath)\n });\n }\n }\n }\n }\n\n replacements.sort((a, b) => b.start - a.start);\n let rewrittenSource = sourceText;\n for (const r of replacements) {\n rewrittenSource = rewrittenSource.slice(0, r.start) + r.replacement + rewrittenSource.slice(r.end);\n }\n\n const transpiled = ts.transpileModule(rewrittenSource, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n\n const targetDir = path.dirname(targetJsFile);\n if (!existsSync(targetDir)) {\n mkdirSync(targetDir, { recursive: true });\n }\n writeFileSync(targetJsFile, transpiled, \"utf8\");\n\n return targetJsFile;\n}\n\nfunction resolveServerUserModuleImport(\n resolvedPath: string,\n file: string,\n outDir?: string,\n): string {\n const projectRoot = findProjectRoot(file);\n const buildOutDir = outDir ? path.resolve(outDir) : path.join(projectRoot, \".resux\");\n const compiledTarget = ensureCompiledUserModule(resolvedPath, projectRoot, buildOutDir);\n return relativeImportPath(path.join(buildOutDir, \"server\"), compiledTarget);\n}\n\nfunction processImportDeclaration(\n statement: ts.ImportDeclaration | ts.ImportEqualsDeclaration,\n sourceFile: ts.SourceFile,\n file: string,\n client: boolean,\n outDir?: string\n): string {\n if (ts.isImportDeclaration(statement)) {\n const specifier = statement.moduleSpecifier;\n if (!ts.isStringLiteral(specifier)) {\n return statement.getFullText(sourceFile);\n }\n const importPath = specifier.text;\n const isRelative = importPath.startsWith(\".\");\n const isAlias = importPath.startsWith(\"@/\") || importPath.startsWith(\"~/\");\n const ext = path.extname(importPath).toLowerCase();\n\n if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {\n if (client) {\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n if (isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n return statement.getFullText(sourceFile);\n } else {\n if (STYLESHEET_EXTENSIONS.has(ext)) {\n return \"\";\n }\n const projectRoot = findProjectRoot(file);\n let absolutePath = \"\";\n if (isAlias) {\n absolutePath = path.resolve(projectRoot, importPath.slice(2));\n } else if (isRelative) {\n absolutePath = path.resolve(path.dirname(file), importPath);\n } else {\n absolutePath = importPath;\n }\n\n let webPath = importPath;\n const relativeToRoot = path.relative(projectRoot, absolutePath);\n const isInsideProject = relativeToRoot === \"\"\n || (relativeToRoot !== \"..\"\n && !relativeToRoot.startsWith(`..${path.sep}`)\n && !path.isAbsolute(relativeToRoot));\n if (isInsideProject) {\n webPath = \"/\" + relativeToRoot.replace(/\\\\/g, \"/\");\n }\n\n const clause = statement.importClause;\n if (!clause) {\n return \"\";\n }\n\n const bindings: string[] = [];\n if (clause.name) {\n bindings.push(clause.name.text);\n }\n if (clause.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) {\n bindings.push(clause.namedBindings.name.text);\n } else {\n for (const element of clause.namedBindings.elements) {\n bindings.push(element.name.text);\n }\n }\n }\n\n if (bindings.length === 0) {\n return \"\";\n }\n\n return bindings.map(name => `const ${name} = ${JSON.stringify(webPath)};`).join(\"\\n\");\n }\n }\n\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (!client && (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\")) {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n\n if (!client && isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\") {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n } else if (ts.isImportEqualsDeclaration(statement)) {\n const moduleRef = statement.moduleReference;\n if (ts.isExternalModuleReference(moduleRef) && ts.isStringLiteral(moduleRef.expression)) {\n const specifier = moduleRef.expression;\n const importPath = specifier.text;\n const isRelative = importPath.startsWith(\".\");\n const isAlias = importPath.startsWith(\"@/\") || importPath.startsWith(\"~/\");\n const ext = path.extname(importPath).toLowerCase();\n\n if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {\n if (client) {\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n if (isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const normalized = fileUrl(absoluteImported);\n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n return statement.getFullText(sourceFile);\n } else {\n if (STYLESHEET_EXTENSIONS.has(ext)) {\n return \"\";\n }\n const projectRoot = findProjectRoot(file);\n let absolutePath = \"\";\n if (isAlias) {\n absolutePath = path.resolve(projectRoot, importPath.slice(2));\n } else if (isRelative) {\n absolutePath = path.resolve(path.dirname(file), importPath);\n } else {\n absolutePath = importPath;\n }\n\n let webPath = importPath;\n const relativeToRoot = path.relative(projectRoot, absolutePath);\n const isInsideProject = relativeToRoot === \"\"\n || (relativeToRoot !== \"..\"\n && !relativeToRoot.startsWith(`..${path.sep}`)\n && !path.isAbsolute(relativeToRoot));\n if (isInsideProject) {\n webPath = \"/\" + relativeToRoot.replace(/\\\\/g, \"/\");\n }\n\n if (!statement.name) {\n return \"\";\n }\n return `const ${statement.name.text} = ${JSON.stringify(webPath)};`;\n }\n }\n\n if (isRelative) {\n const absoluteImported = path.resolve(path.dirname(file), importPath);\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (!client && (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\")) {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n\n if (!client && isAlias) {\n const projectRoot = findProjectRoot(file);\n const absoluteImported = path.resolve(projectRoot, importPath.slice(2));\n const resolvedPath = resolveFileExtension(absoluteImported);\n const resolvedExt = path.extname(resolvedPath).toLowerCase();\n \n let normalized = \"\";\n if (resolvedExt === \".ts\" || resolvedExt === \".tsx\" || resolvedExt === \".js\" || resolvedExt === \".jsx\") {\n normalized = resolveServerUserModuleImport(resolvedPath, file, outDir);\n } else {\n normalized = fileUrl(resolvedPath);\n }\n \n const fullText = statement.getFullText(sourceFile);\n const start = specifier.getStart(sourceFile) - statement.getFullStart();\n const end = specifier.getEnd() - statement.getFullStart();\n return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);\n }\n }\n }\n return statement.getFullText(sourceFile);\n}\n\nfunction analyzeScript(script: string, file: string, inlineHandlers: GeneratedHandler[] = []): ScriptAnalysis {\n const sourceFile = ts.createSourceFile(file, script, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n const imports: string[] = [];\n const importDeclarations: (ts.ImportDeclaration | ts.ImportEqualsDeclaration)[] = [];\n const body: string[] = [];\n const bindings = new Set<string>();\n const handlerNames = new Set<string>();\n const resumableBindings = new Set<string>();\n const importedBindings = new Set<string>();\n const inlineHandlerLocals = new Map<string, string[]>();\n const templateRefBindings = inferTemplateRefBindings(script, file);\n const handlers = new Map<string, ts.Node>();\n let pageMeta: PageMeta | undefined;\n\n for (const h of inlineHandlers) {\n if (h.locals) {\n inlineHandlerLocals.set(h.name, h.locals);\n }\n }\n\n for (const statement of sourceFile.statements) {\n const text = statement.getFullText(sourceFile);\n if (ts.isImportDeclaration(statement) || ts.isImportEqualsDeclaration(statement)) {\n imports.push(rewriteImportStatementText(statement, sourceFile, file));\n importDeclarations.push(statement);\n if (ts.isImportDeclaration(statement)) {\n const clause = statement.importClause;\n if (clause) {\n if (clause.name) {\n bindings.add(clause.name.text);\n importedBindings.add(clause.name.text);\n }\n if (clause.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) {\n bindings.add(clause.namedBindings.name.text);\n importedBindings.add(clause.namedBindings.name.text);\n } else {\n for (const element of clause.namedBindings.elements) {\n bindings.add(element.name.text);\n importedBindings.add(element.name.text);\n }\n }\n }\n }\n } else if (ts.isImportEqualsDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n importedBindings.add(statement.name.text);\n }\n continue;\n }\n\n if (isDefinePageMetaStatement(statement)) {\n pageMeta = readPageMeta(statement, sourceFile, file);\n continue;\n }\n\n body.push(text);\n\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n handlerNames.add(statement.name.text);\n handlers.set(statement.name.text, statement);\n continue;\n }\n\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n for (const name of collectBindingNames(declaration.name)) {\n bindings.add(name);\n }\n\n if (ts.isIdentifier(declaration.name)) {\n if (isHandlerLikeInitializer(declaration.initializer)) {\n handlerNames.add(declaration.name.text);\n handlers.set(declaration.name.text, declaration);\n }\n }\n if (isResumableInitializer(declaration.initializer)) {\n for (const name of collectBindingNames(declaration.name)) {\n resumableBindings.add(name);\n }\n }\n }\n }\n }\n\n if (inlineHandlers.length > 0) {\n const inlineSource = inlineHandlers.map((handler) => handler.source).join(\"\\n\");\n const inlineSourceFile = ts.createSourceFile(`${file}?inline-handlers`, inlineSource, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n body.push(inlineSource);\n\n for (const statement of inlineSourceFile.statements) {\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n handlerNames.add(statement.name.text);\n handlers.set(statement.name.text, statement);\n }\n }\n }\n\n return {\n imports: imports.join(\"\\n\"),\n importDeclarations,\n setupBody: body.join(\"\\n\"),\n bindings: [...bindings],\n handlerNames,\n resumableBindings,\n importedBindings,\n inlineHandlerLocals,\n templateRefBindings,\n handlers,\n sourceFile,\n pageMeta\n };\n}\n\nfunction inferTemplateRefBindings(script: string, file: string): Set<string> {\n const sourceFile = ts.createSourceFile(file, script, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);\n const bindings = new Set<string>();\n\n for (const statement of sourceFile.statements) {\n if (!ts.isVariableStatement(statement)) {\n continue;\n }\n\n for (const declaration of statement.declarationList.declarations) {\n const initializer = unwrapAwaitExpression(declaration.initializer);\n if (!initializer || !ts.isCallExpression(initializer)) {\n continue;\n }\n\n const callee = initializer.expression;\n const calleeName = ts.isIdentifier(callee)\n ? callee.text\n : ts.isPropertyAccessExpression(callee) && ts.isIdentifier(callee.name)\n ? callee.name.text\n : \"\";\n\n if (ts.isIdentifier(declaration.name) && isTemplateRefFactory(calleeName)) {\n bindings.add(declaration.name.text);\n continue;\n }\n\n if (ts.isObjectBindingPattern(declaration.name) && isObjectTemplateRefFactory(calleeName)) {\n for (const element of declaration.name.elements) {\n if (!ts.isBindingElement(element) || !ts.isIdentifier(element.name)) {\n continue;\n }\n const propertyName = element.propertyName && ts.isIdentifier(element.propertyName)\n ? element.propertyName.text\n : element.name.text;\n if (isObjectTemplateRefBinding(calleeName, propertyName)) {\n bindings.add(element.name.text);\n }\n }\n }\n }\n }\n\n return bindings;\n}\n\nfunction unwrapAwaitExpression(node: ts.Expression | undefined): ts.Expression | undefined {\n return node && ts.isAwaitExpression(node) ? node.expression : node;\n}\n\nfunction isTemplateRefFactory(name: string): boolean {\n return [\"ref\", \"computed\", \"toRef\", \"useState\", \"useAsyncData\", \"useFetch\", \"useResuxImage\", \"useError\"].includes(name);\n}\n\nfunction isAsyncDataFactory(name: string): boolean {\n return [\"useAsyncData\", \"useFetch\"].includes(name);\n}\n\nfunction isObjectTemplateRefFactory(name: string): boolean {\n return isAsyncDataFactory(name) || name === \"toRefs\" || name === \"useI18n\";\n}\n\nfunction isObjectTemplateRefBinding(factory: string, property: string): boolean {\n if (factory === \"toRefs\") {\n return true;\n }\n if (factory === \"useI18n\") {\n return property === \"locale\" || property === \"dir\";\n }\n return [\"data\", \"pending\", \"error\", \"value\"].includes(property);\n}\n\nfunction isDefinePageMetaStatement(statement: ts.Statement): boolean {\n return ts.isExpressionStatement(statement)\n && ts.isCallExpression(statement.expression)\n && ts.isIdentifier(statement.expression.expression)\n && statement.expression.expression.text === \"definePageMeta\";\n}\n\nfunction readPageMeta(statement: ts.Statement, sourceFile: ts.SourceFile, file: string): PageMeta {\n if (!isDefinePageMetaStatement(statement)) {\n return {};\n }\n\n const call = (statement as ts.ExpressionStatement).expression as ts.CallExpression;\n const firstArg = call.arguments[0];\n if (!firstArg || !ts.isObjectLiteralExpression(firstArg)) {\n throw new ResuxCompileError(\"definePageMeta only supports an object literal in Resux.\", locationFromTsNode(file, sourceFile, statement));\n }\n\n return readObjectLiteral(firstArg, sourceFile, file) as PageMeta;\n}\n\nfunction readObjectLiteral(node: ts.ObjectLiteralExpression, sourceFile: ts.SourceFile, file: string): Record<string, unknown> {\n const output: Record<string, unknown> = {};\n\n for (const property of node.properties) {\n if (!ts.isPropertyAssignment(property)) {\n throw new ResuxCompileError(\"Only plain object properties are supported here.\", locationFromTsNode(file, sourceFile, property));\n }\n\n const name = readPropertyName(property.name, sourceFile, file);\n output[name] = readLiteralValue(property.initializer, sourceFile, file);\n }\n\n return output;\n}\n\nfunction readLiteralValue(node: ts.Expression, sourceFile: ts.SourceFile, file: string): unknown {\n if (ts.isStringLiteralLike(node)) {\n return node.text;\n }\n if (node.kind === ts.SyntaxKind.TrueKeyword) {\n return true;\n }\n if (node.kind === ts.SyntaxKind.FalseKeyword) {\n return false;\n }\n if (ts.isNumericLiteral(node)) {\n return Number(node.text);\n }\n if (ts.isArrayLiteralExpression(node)) {\n return node.elements.map((element) => readLiteralValue(element as ts.Expression, sourceFile, file));\n }\n if (ts.isObjectLiteralExpression(node)) {\n return readObjectLiteral(node, sourceFile, file);\n }\n\n throw new ResuxCompileError(\"Only JSON-like literals are supported here.\", locationFromTsNode(file, sourceFile, node));\n}\n\nfunction readPropertyName(name: ts.PropertyName, sourceFile: ts.SourceFile, file: string): string {\n if (ts.isIdentifier(name) || ts.isStringLiteralLike(name) || ts.isNumericLiteral(name)) {\n return name.text;\n }\n\n throw new ResuxCompileError(\"Only simple property names are supported here.\", locationFromTsNode(file, sourceFile, name));\n}\n\nfunction validateTemplateHandlers(events: TemplateEvent[], analysis: ScriptAnalysis, file: string, fullSource: string, templateLocals: string[] = []): void {\n const allowedHandlers = new Set([...analysis.handlerNames, ...templateLocals]);\n for (const event of events) {\n if (!allowedHandlers.has(event.handler)) {\n throw new ResuxCompileError(`Handler \"${event.handler}\" must be a top-level function or arrow function.`, locationFromOffset(file, fullSource, 0));\n }\n\n const handlerNode = analysis.handlers.get(event.handler);\n if (!handlerNode) {\n continue;\n }\n\n const locals = analysis.inlineHandlerLocals.get(event.handler) ?? [];\n const unsupportedCapture = findUnsupportedCapture(handlerNode, event.handler, analysis, locals);\n if (unsupportedCapture) {\n throw new ResuxCompileError(\n `Handler \"${event.handler}\" captures \"${unsupportedCapture}\", which is not resumable in Resux. If this is a client or browser API, access it via \"globalThis.${unsupportedCapture}\" or move client-only logic into onMounted() or useClientEnhancement(). See https://resux.dev/guide/resumability-handlers for allowed globals and resumability rules.`,\n locationFromTsNode(file, analysis.sourceFile, handlerNode)\n );\n }\n }\n}\n\nfunction findUnsupportedCapture(\n node: ts.Node,\n handlerName: string,\n analysis: ScriptAnalysis,\n templateLocals: string[] = []\n): string | null {\n const locals = new Set<string>([handlerName, \"event\", ...templateLocals]);\n const allowedTopLevel = new Set([\n ...analysis.resumableBindings,\n ...analysis.handlerNames,\n ...analysis.importedBindings\n ]);\n\n function registerPattern(name: ts.BindingName): void {\n for (const binding of collectBindingNames(name)) {\n locals.add(binding);\n }\n }\n\n if (ts.isFunctionDeclaration(node)) {\n for (const parameter of node.parameters) {\n registerPattern(parameter.name);\n }\n }\n\n if (ts.isVariableDeclaration(node) && node.initializer && (ts.isArrowFunction(node.initializer) || ts.isFunctionExpression(node.initializer))) {\n for (const parameter of node.initializer.parameters) {\n registerPattern(parameter.name);\n }\n }\n\n let unsupported: string | null = null;\n\n function visit(current: ts.Node): void {\n if (unsupported) {\n return;\n }\n\n if (ts.isVariableDeclaration(current)) {\n registerPattern(current.name);\n }\n\n if (ts.isIdentifier(current) && isValueIdentifier(current)) {\n const name = current.text;\n if (!locals.has(name) && !RESUMABLE_HANDLER_ALLOWED_GLOBALS.has(name) && !allowedTopLevel.has(name)) {\n unsupported = name;\n return;\n }\n }\n\n ts.forEachChild(current, visit);\n }\n\n ts.forEachChild(node, visit);\n return unsupported;\n}\n\nfunction isValueIdentifier(node: ts.Identifier): boolean {\n const parent = node.parent;\n if (!parent) {\n return true;\n }\n if (ts.isPropertyAccessExpression(parent) && parent.name === node) {\n return false;\n }\n if (ts.isPropertyAssignment(parent) && parent.name === node) {\n return false;\n }\n if ((ts.isVariableDeclaration(parent) || ts.isFunctionDeclaration(parent) || ts.isParameter(parent)) && parent.name === node) {\n return false;\n }\n if (ts.isBindingElement(parent) && parent.name === node) {\n return false;\n }\n return true;\n}\n\nfunction isHandlerLikeInitializer(node: ts.Expression | undefined): boolean {\n return Boolean(node && (ts.isArrowFunction(node) || ts.isFunctionExpression(node)));\n}\n\nfunction isResumableInitializer(node: ts.Expression | undefined): boolean {\n if (!node) {\n return false;\n }\n if (ts.isNumericLiteral(node) || ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) {\n return true;\n }\n if (node.kind === ts.SyntaxKind.TrueKeyword || node.kind === ts.SyntaxKind.FalseKeyword || node.kind === ts.SyntaxKind.NullKeyword) {\n return true;\n }\n if (ts.isPrefixUnaryExpression(node) && ts.isNumericLiteral(node.operand)) {\n return true;\n }\n if (ts.isCallExpression(node) && ts.isIdentifier(node.expression)) {\n if (node.expression.text.startsWith(\"use\")) {\n return true;\n }\n return [\n \"ref\",\n \"reactive\",\n \"computed\",\n \"readonly\",\n \"toRef\",\n \"toRefs\",\n \"watch\",\n \"watchEffect\",\n \"useState\",\n \"useAsyncData\",\n \"useRoute\",\n \"useRouter\",\n \"useRuntimeConfig\",\n \"useResuxApp\",\n \"useResuxImage\",\n \"usePackageReady\",\n \"defineProps\",\n \"defineEmits\"\n ].includes(node.expression.text);\n }\n if (ts.isAwaitExpression(node) && ts.isCallExpression(node.expression) && ts.isIdentifier(node.expression.expression)) {\n if (node.expression.expression.text.startsWith(\"use\")) {\n return true;\n }\n return [\"useAsyncData\", \"useFetch\"].includes(node.expression.expression.text);\n }\n return false;\n}\n\nfunction collectBindingNames(name: ts.BindingName): string[] {\n if (ts.isIdentifier(name)) {\n return [name.text];\n }\n\n const names: string[] = [];\n for (const element of name.elements) {\n if (ts.isBindingElement(element)) {\n names.push(...collectBindingNames(element.name));\n }\n }\n return names;\n}\n\nfunction createComponentModuleSource(options: {\n id: string;\n name: string;\n file: string;\n template: TemplateNode[];\n templateRefs?: string[];\n templateForRefs?: string[];\n analysis: ScriptAnalysis;\n styles: ComponentStyle[];\n styleScopeId?: string;\n client: boolean;\n expressions?: { id: string; original: string; transformed: string; locals: string[] }[];\n outDir?: string;\n}): string {\n const importPath = options.client ? \"/__resux/runtime-client.mjs\" : \"resuxjs/runtime\";\n const factory = options.client ? \"createClientComponent\" : \"defineComponent\";\n \n const expressionClosures = (options.expressions ?? []).map((expr) => {\n const destructure = expr.locals.length > 0\n ? expr.locals.map(id => `let ${id} = (locals && \"${id}\" in locals) ? locals.${id} : (scope && \"${id}\" in scope) ? scope.${id} : (typeof globalThis !== \"undefined\" && \"${id}\" in globalThis) ? globalThis.${id} : undefined;\n if (typeof ${id} === \"string\" && ${id}.startsWith(\"__rx_callback:\")) {\n const parts = ${id}.split(\":\");\n const cbScopeId = parts[2];\n const cbHandler = parts[3];\n ${id} = async (...args) => {\n const payload = globalThis.__RESUX__;\n if (payload && payload.scopes[cbScopeId]) {\n const comp = await importComponent(payload.scopes[cbScopeId].moduleId, payload.modules, devImportRevision);\n let sRec = scopeCache.get(cbScopeId);\n if (!sRec) {\n sRec = await comp.createScope(payload.scopes[cbScopeId], payload.route);\n scopeCache.set(cbScopeId, sRec);\n }\n const patches = await comp.run(sRec, cbHandler, args[0]);\n const serialized = comp.serialize(sRec);\n payload.scopes[cbScopeId].props = serialized.props;\n payload.scopes[cbScopeId].state = serialized.state;\n payload.scopes[cbScopeId].asyncData = serialized.asyncData;\n applyPatches(cbScopeId, patches);\n }\n };\n }`).join(\"\\n \")\n : \"\";\n return ` ${JSON.stringify(expr.id)}: function(scope, locals) {\n ${destructure}\n return (${expr.transformed});\n },`;\n }).join(\"\\n\");\n\n const importsText = (options.analysis.importDeclarations ?? []).map((decl) => {\n return processImportDeclaration(\n decl,\n options.analysis.sourceFile,\n options.file,\n options.client,\n options.outDir,\n );\n }).filter(Boolean).join(\"\\n\");\n\n const source = [\n `import { ${factory} } from ${JSON.stringify(importPath)};`,\n importsText,\n `const __template = ${JSON.stringify(options.template, null, 2)};`,\n `async function __rx_setup(__ctx) {`,\n `const { ref, reactive, computed, watch, watchEffect, readonly, toRef, toRefs, unref, isRef, isReactive, isReadonly, nextTick, useState, useAsyncData, useRoute, useRouter, useHead, useSeoMeta, useRuntimeConfig, useResuxApp, useResuxImage, apiURL, useFetch, $fetch, useError, clearError, showError, createError, useLazyPackage, useClientPackage, usePackageReady, defineLazyPackage, defineClientOnlyPackage, definePackageAdapter, defineClientEnhancement, useClientEnhancement, onMounted, definePageMeta, defineProps, defineEmits, useLocalePath, useSwitchLocalePath, useI18n, useDevice, $device, importComponent, scopeCache, devImportRevision, applyPatches } = __ctx;`,\n options.analysis.setupBody,\n `const __rx_expressions = {`,\n expressionClosures,\n `};`,\n `return { ${options.analysis.bindings.join(\", \")}, __rx_expressions };`,\n `}`,\n `export default ${factory}({`,\n `id: ${JSON.stringify(options.id)},`,\n `name: ${JSON.stringify(options.name)},`,\n `file: ${JSON.stringify(normalizePath(options.file))},`,\n `script: __rx_setup,`,\n `template: __template,`,\n `templateRefs: ${JSON.stringify(options.templateRefs ?? [])},`,\n `templateForRefs: ${JSON.stringify(options.templateForRefs ?? [])}`,\n `handlers: ${JSON.stringify([...options.analysis.handlerNames])},`,\n `styles: ${JSON.stringify(options.styles)},`,\n `styleScopeId: ${JSON.stringify(options.styleScopeId)},`,\n `meta: ${JSON.stringify(options.analysis.pageMeta ?? {})}`,\n `});`\n ].join(\"\\n\");\n\n return ts.transpileModule(source, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n}\n\nfunction createVueIslandClientSource(island: VueIslandRecord, entryDir: string): string {\n const componentImport = relativeImportPath(entryDir, island.file);\n return [\n `import { createApp } from \"vue\";`,\n `import Component from ${JSON.stringify(componentImport)};`,\n `export function mount(el, props = {}) {`,\n ` const app = createApp(Component, props);`,\n ` app.mount(el);`,\n ` return app;`,\n `}`,\n `export default { mount };`\n ].join(\"\\n\");\n}\n\nfunction relativeImportPath(fromDir: string, file: string): string {\n const relative = normalizePath(path.relative(fromDir, file));\n return relative.startsWith(\".\") ? relative : `./${relative}`;\n}\n\nfunction createServerManifestSource(\n routes: RouteManifestRecord[],\n components: CompiledComponent[],\n layouts: CompiledComponent[],\n plugins: CompiledPlugin[],\n middleware: CompiledMiddleware[],\n serverMiddleware: CompiledServerMiddleware[],\n serverHandlers: ServerHandlerRecord[],\n vueIslands: VueIslandRecord[],\n app?: CompiledComponent,\n error?: CompiledComponent,\n runtimeConfig: Record<string, unknown> = {},\n buildOptions: BuildOptions = {},\n appRoot = process.cwd()\n): string {\n const importSuffix = buildOptions.vite === \"dev\" ? `?t=${Date.now()}` : \"\";\n const serverPlugins = plugins.filter((entry) => entry.mode !== \"client\");\n const clientPlugins = plugins.filter((entry) => entry.mode !== \"server\");\n const serverRouteMiddleware = middleware.filter((entry) => entry.mode !== \"client\");\n const clientRouteMiddleware = middleware.filter((entry) => entry.mode !== \"server\");\n const imports = components.map((component) => `import ${component.id} from \"./${component.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const pluginImports = serverPlugins.map((plugin) => `import ${plugin.id} from \"./resux-plugins/${plugin.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const middlewareImports = serverRouteMiddleware.map((entry) => `import ${entry.id} from \"./resux-middleware/${entry.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const serverMiddlewareImports = serverMiddleware.map((entry) => `import ${entry.id} from \"./request-middleware/${entry.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const handlerImports = serverHandlers.map((handler) => `import ${handler.id} from \"./handlers/${handler.id}.mjs${importSuffix}\";`).join(\"\\n\");\n const componentEntries = components.map((component) => `${JSON.stringify(component.name)}: ${component.id}`).join(\",\\n\");\n const layoutEntries = layouts.map((layout) => `${JSON.stringify(layoutNameFromFile(layout.file))}: ${layout.id}`).join(\",\\n\");\n const moduleEntries = components\n .map((component) => `${JSON.stringify(component.id)}: ${JSON.stringify(`/__resux/handlers/${component.id}.mjs`)}`)\n .join(\",\\n\");\n const vueIslandEntries = vueIslands\n .map((island) => `${JSON.stringify(island.name)}: ${JSON.stringify(`/__resux/vue-islands/${island.name}.mjs`)}`)\n .join(\",\\n\");\n const pluginEntries = serverPlugins\n .map((plugin) => plugin.id)\n .join(\",\\n\");\n const clientPluginEntries = clientPlugins\n .map((plugin) => `{\n id: ${JSON.stringify(plugin.id)},\n file: ${JSON.stringify(normalizePath(plugin.file))},\n mode: ${JSON.stringify(plugin.mode)},\n src: ${JSON.stringify(`/__resux/plugins/${plugin.id}.mjs`)}\n }`)\n .join(\",\\n\");\n const middlewareEntries = serverRouteMiddleware\n .map((entry) => `{\n id: ${JSON.stringify(entry.id)},\n name: ${JSON.stringify(entry.name)},\n file: ${JSON.stringify(normalizePath(entry.file))},\n global: ${JSON.stringify(entry.global)},\n mode: ${JSON.stringify(entry.mode)},\n handler: ${entry.id}\n }`)\n .join(\",\\n\");\n const clientMiddlewareEntries = clientRouteMiddleware\n .map((entry) => `{\n id: ${JSON.stringify(entry.id)},\n name: ${JSON.stringify(entry.name)},\n file: ${JSON.stringify(normalizePath(entry.file))},\n global: ${JSON.stringify(entry.global)},\n mode: ${JSON.stringify(entry.mode)},\n src: ${JSON.stringify(`/__resux/middleware/${entry.id}.mjs`)}\n }`)\n .join(\",\\n\");\n const serverMiddlewareEntries = serverMiddleware\n .map((entry) => `{\n id: ${JSON.stringify(entry.id)},\n file: ${JSON.stringify(normalizePath(entry.file))},\n handler: ${entry.id}\n }`)\n .join(\",\\n\");\n const serverHandlerEntries = serverHandlers\n .map((handler) => `{\n id: ${JSON.stringify(handler.id)},\n path: ${JSON.stringify(handler.path)},\n file: ${JSON.stringify(normalizePath(handler.file))},\n params: ${JSON.stringify(handler.params)},\n handler: ${handler.id},\n match: createMatcher(${JSON.stringify(handler.path)})\n }`)\n .join(\",\\n\");\n const routeEntries = routes\n .map((route) => {\n const component = components.find((candidate) => candidate.id === route.componentId);\n if (!component) {\n throw new Error(`Missing compiled component for ${route.file}.`);\n }\n return `{\n id: ${JSON.stringify(route.id)},\n path: ${JSON.stringify(route.path)},\n file: ${JSON.stringify(normalizePath(route.file))},\n params: ${JSON.stringify(route.params)},\n meta: ${JSON.stringify(route.meta ?? {})},\n component: ${route.componentId},\n match: createMatcher(${JSON.stringify(route.path)})\n }`;\n })\n .join(\",\\n\");\n const appHead = createAppHead(runtimeConfig, appRoot, buildOptions.vite !== \"dev\");\n const appRuntimeConfig = createRuntimeConfig(runtimeConfig);\n const routeRules = createRouteRules(runtimeConfig);\n\n return `${imports}\n${pluginImports}\n${middlewareImports}\n${serverMiddlewareImports}\n${handlerImports}\nexport const app = ${app ? app.id : \"undefined\"};\nexport const errorComponent = ${error ? error.id : \"undefined\"};\nexport const components = {\n${componentEntries}\n};\nexport const layouts = {\n${layoutEntries}\n};\nexport const modules = {\n${moduleEntries}\n};\nexport const vueIslands = {\n${vueIslandEntries}\n};\nexport const resuxPlugins = [\n${pluginEntries}\n];\nexport const clientPlugins = [\n${clientPluginEntries}\n];\nexport const middleware = [\n${middlewareEntries}\n];\nexport const clientMiddleware = [\n${clientMiddlewareEntries}\n];\nexport const serverMiddleware = [\n${serverMiddlewareEntries}\n];\nexport const serverHandlers = [\n${serverHandlerEntries}\n];\nexport const runtimeConfig = ${JSON.stringify(appRuntimeConfig, null, 2)};\nexport const appHead = ${JSON.stringify(appHead, null, 2)};\nexport const routeRules = ${JSON.stringify(routeRules, null, 2)};\nexport const routes = [\n${routeEntries}\n];\nexport function matchRoute(pathname) {\n for (const route of routes) {\n const params = route.match(pathname);\n if (params) return { route, params };\n }\n return null;\n}\nexport function matchServerHandler(pathname) {\n for (const route of serverHandlers) {\n const params = route.match(pathname);\n if (params) return { route, params };\n }\n return null;\n}\nfunction createMatcher(pattern) {\n const names = [];\n const source = pattern === \"/\" ? \"^/$\" : \"^\" + pattern.split(\"/\").map((part) => {\n if (!part) return \"\";\n if (part.startsWith(\":\") && part.endsWith(\"*\")) {\n names.push(part.slice(1, -1));\n return \"(?:/(.*))?\";\n }\n if (part.startsWith(\":\")) {\n names.push(part.slice(1));\n return \"/([^/]+)\";\n }\n return \"/\" + part.replace(/[.*+?^${\"${\"}}()|[\\\\]\\\\\\\\]/g, \"\\\\\\\\$&\");\n }).join(\"\") + \"$\";\n const regex = new RegExp(source);\n return (pathname) => {\n const match = regex.exec(pathname);\n if (!match) return null;\n const params = {};\n names.forEach((name, index) => {\n params[name] = decodeURIComponent(match[index + 1] ?? \"\");\n });\n return params;\n };\n}\n`;\n}\n\nfunction createAppHead(\n runtimeConfig: Record<string, unknown>,\n appRoot: string,\n optimizeCss: boolean,\n) {\n const config = runtimeConfig as ResuxConfig;\n const head = typeof config.app === \"object\" && config.app && \"head\" in config.app\n ? config.app.head\n : {};\n const headObject = typeof head === \"object\" && head ? head as Record<string, unknown> : {};\n const performanceConfig = readPerformanceRuntimeConfig(config);\n const csp = readSecurityContentSecurityPolicy(config, headObject);\n const inlineCss = optimizeCss\n && performanceConfig !== null\n && performanceConfig.inlineCss !== false\n && allowsInlineStyleForCsp(csp);\n const inlineCssMaxBytes = performanceConfig && Number.isFinite(performanceConfig.inlineCssMaxBytes)\n ? Math.max(0, Math.floor(performanceConfig.inlineCssMaxBytes as number))\n : 65_536;\n\n const cssEntries = collectConfiguredCssEntries(\n config.css,\n appRoot,\n inlineCss ? inlineCssMaxBytes : 0,\n );\n const { links: cssLinks, styles: criticalStyles } = splitCssEntriesPreservingOrder(cssEntries);\n const configuredLinks = Array.isArray(headObject.link)\n ? headObject.link as Array<Record<string, unknown>>\n : [];\n const configuredScripts = Array.isArray(headObject.script)\n ? headObject.script as Array<Record<string, unknown>>\n : [];\n const inlineScriptAttributeAllowed = allowsInlineScriptAttributeForCsp(csp);\n const inlineScriptElementAllowed = allowsInlineScriptElementForCsp(csp);\n\n return {\n ...headObject,\n link: [\n ...normalizeFontLinksForCsp(\n configuredLinks,\n inlineScriptAttributeAllowed,\n inlineScriptElementAllowed,\n ),\n ...cssLinks,\n ],\n style: [\n ...criticalStyles,\n ...((Array.isArray(headObject.style)\n ? headObject.style\n : []) as Array<Record<string, unknown> | string>),\n ],\n script: inlineScriptElementAllowed\n ? configuredScripts\n : configuredScripts.filter((entry) => !isResuxFontLoaderScript(entry)),\n };\n}\n\ninterface ConfiguredCssEntry {\n href: string;\n css: string | null;\n}\n\nfunction collectConfiguredCssEntries(\n cssConfig: unknown,\n appRoot: string,\n inlineCssMaxBytes: number,\n): ConfiguredCssEntry[] {\n if (!Array.isArray(cssConfig)) {\n return [];\n }\n\n return cssConfig\n .map((cssEntry) => String(cssEntry ?? \"\").trim())\n .filter(Boolean)\n .map((href) => ({\n href,\n css: inlineCssMaxBytes > 0\n ? readInlinePublicCss(appRoot, href, inlineCssMaxBytes)\n : null,\n }));\n}\n\nfunction splitCssEntriesPreservingOrder(entries: ConfiguredCssEntry[]): {\n links: Array<Record<string, string>>;\n styles: Array<{ id: string; css: string }>;\n} {\n const lastLinkedCssIndex = entries.reduce(\n (lastIndex, entry, index) => entry.css === null ? index : lastIndex,\n -1,\n );\n const links: Array<Record<string, string>> = [];\n const styles: Array<{ id: string; css: string }> = [];\n\n entries.forEach((entry, index) => {\n if (entry.css !== null && index > lastLinkedCssIndex) {\n styles.push({\n id: `resux-critical-${createHash(\"sha256\").update(entry.href).digest(\"hex\").slice(0, 12)}`,\n css: entry.css,\n });\n return;\n }\n links.push({ rel: \"stylesheet\", href: entry.href });\n });\n\n return { links, styles };\n}\n\nfunction readPerformanceRuntimeConfig(config: ResuxConfig): Record<string, unknown> | null {\n const runtime = isPlainObject(config.runtimeConfig) ? config.runtimeConfig as Record<string, unknown> : {};\n const publicConfig = isPlainObject(runtime.public) ? runtime.public as Record<string, unknown> : {};\n return isPlainObject(publicConfig.performanceModule)\n ? publicConfig.performanceModule as Record<string, unknown>\n : null;\n}\n\nfunction readSecurityContentSecurityPolicy(\n config: ResuxConfig,\n head: Record<string, unknown>,\n): string {\n const runtime = isPlainObject(config.runtimeConfig)\n ? config.runtimeConfig as Record<string, unknown>\n : {};\n const security = isPlainObject(runtime.resuxSecurity)\n ? runtime.resuxSecurity as Record<string, unknown>\n : {};\n const configured = firstString(security.contentSecurityPolicy);\n if (configured) {\n return configured;\n }\n\n const meta = Array.isArray(head.meta) ? head.meta : [];\n for (const entry of meta) {\n if (!isPlainObject(entry)) continue;\n const httpEquiv = String(entry[\"http-equiv\"] ?? entry.httpEquiv ?? \"\").trim().toLowerCase();\n if (httpEquiv !== \"content-security-policy\") continue;\n const content = firstString(entry.content);\n if (content) return content;\n }\n return \"\";\n}\n\nfunction allowsInlineStyleForCsp(csp: string): boolean {\n const sources = cspDirectiveSources(csp, [\"style-src-elem\", \"style-src\", \"default-src\"]);\n return sources === null || sources.includes(\"'unsafe-inline'\");\n}\n\nfunction allowsInlineScriptAttributeForCsp(csp: string): boolean {\n const sources = cspDirectiveSources(csp, [\"script-src-attr\", \"script-src\", \"default-src\"]);\n return sources === null || sources.includes(\"'unsafe-inline'\");\n}\n\nfunction allowsInlineScriptElementForCsp(csp: string): boolean {\n const sources = cspDirectiveSources(csp, [\"script-src-elem\", \"script-src\", \"default-src\"]);\n return sources === null || sources.includes(\"'unsafe-inline'\");\n}\n\nfunction normalizeFontLinksForCsp(\n links: Array<Record<string, unknown>>,\n inlineScriptAttributeAllowed: boolean,\n inlineScriptElementAllowed: boolean,\n): Array<Record<string, unknown>> {\n return links.map((link) => {\n const next = { ...link };\n const needsInlineAttribute = next[\"data-resux-font-async\"] === \"true\";\n const needsInlineScript = next[\"data-resux-font-lazy\"] === \"true\";\n if (\n (needsInlineAttribute && !inlineScriptAttributeAllowed)\n || (needsInlineScript && !inlineScriptElementAllowed)\n ) {\n delete next.media;\n delete next.onload;\n delete next[\"data-resux-font-async\"];\n delete next[\"data-resux-font-lazy\"];\n }\n return next;\n });\n}\n\nfunction isResuxFontLoaderScript(entry: Record<string, unknown>): boolean {\n return entry[\"data-resux-font-loader\"] === \"true\";\n}\n\nfunction readInlinePublicCss(appRoot: string, href: string, maxBytes: number): string | null {\n if (\n maxBytes <= 0\n || !href.startsWith(\"/\")\n || href.startsWith(\"//\")\n || href.includes(\"..\")\n || /^[a-z][a-z0-9+.-]*:/i.test(href)\n ) {\n return null;\n }\n\n const pathname = href.split(/[?#]/, 1)[0];\n if (!pathname.toLowerCase().endsWith(\".css\")) {\n return null;\n }\n\n const publicRoot = path.resolve(appRoot, \"public\");\n const staticRoot = path.resolve(appRoot, \"static\");\n const relativePath = pathname.replace(/^[/\\\\]+/, \"\");\n const candidates = [\n { root: publicRoot, candidate: path.resolve(publicRoot, relativePath) },\n { root: staticRoot, candidate: path.resolve(staticRoot, relativePath) },\n ];\n\n for (const { root, candidate } of candidates) {\n if (!isPathWithinBoundary(root, candidate) || !existsSync(candidate)) {\n continue;\n }\n const css = ts.sys.readFile(candidate);\n if (\n typeof css !== \"string\"\n || Buffer.byteLength(css, \"utf8\") > maxBytes\n || hasRelativeCssReferences(css)\n ) {\n continue;\n }\n return css;\n }\n\n return null;\n}\n\nfunction hasRelativeCssReferences(css: string): boolean {\n const urlPattern = /url\\(\\s*(?:\"([^\"]*)\"|'([^']*)'|([^)\"']+))\\s*\\)/gi;\n for (const match of css.matchAll(urlPattern)) {\n const value = String(match[1] ?? match[2] ?? match[3] ?? \"\").trim();\n if (isRelativeCssReference(value)) {\n return true;\n }\n }\n\n const importPattern = /@import\\s+(?:url\\(\\s*)?(?:\"([^\"]*)\"|'([^']*)'|([^\\s;)]+))/gi;\n for (const match of css.matchAll(importPattern)) {\n const value = String(match[1] ?? match[2] ?? match[3] ?? \"\").trim();\n if (isRelativeCssReference(value)) {\n return true;\n }\n }\n return false;\n}\n\nfunction isRelativeCssReference(value: string): boolean {\n if (!value || value.startsWith(\"/\") || value.startsWith(\"#\") || value.startsWith(\"//\")) {\n return false;\n }\n return !/^(?:data|blob|https?):/i.test(value);\n}\n\nfunction scanRuntimeConfigForSecrets(config: Record<string, unknown>, halalConfig: any): void {\n const publicConfig = config.public as Record<string, unknown> | undefined;\n if (!publicConfig || typeof publicConfig !== \"object\") {\n return;\n }\n\n const isStrict = halalConfig?.strict === true;\n const unsafeKeys = [\"SECRET\", \"TOKEN\", \"PASSWORD\", \"PRIVATE\", \"DATABASE\", \"KEY\"];\n const secretValuePatterns = [\n /^[a-f0-9]{32,128}$/i,\n /ey[a-zA-Z0-9_-]{15,}\\.ey[a-zA-Z0-9_-]{15,}\\.[a-zA-Z0-9_-]{15,}/,\n /sk_live_[0-9a-zA-Z]{24}/,\n /AIzaSy[0-9a-zA-Z_-]{33}/,\n /amzn\\.mws\\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}/i,\n /https?:\\/\\/[^/]+:[^/]+@/\n ];\n\n const report = (msg: string): void => {\n if (isStrict) {\n throw new Error(msg);\n }\n console.warn(`\\x1b[33m${msg}\\x1b[0m`);\n };\n const seen = new WeakSet<object>();\n\n // Scan nested objects and arrays at any depth: a secret under\n // `public.api.credentials` reaches the client exactly like a top-level one.\n const scan = (value: unknown, pathLabel: string, keyName: string | null): void => {\n if (keyName !== null) {\n const upperKey = keyName.toUpperCase();\n if (unsafeKeys.some(unsafe => upperKey.includes(unsafe))) {\n report(`[resux-safety] Unsafe key name \"${pathLabel}\" found in public runtimeConfig. Do not expose secrets to the client.`);\n }\n }\n\n if (typeof value === \"string\") {\n if (secretValuePatterns.some(pattern => pattern.test(value))) {\n report(`[resux-safety] Value of public runtimeConfig key \"${pathLabel}\" looks like a private credential or API secret. Do not expose secrets to the client.`);\n }\n return;\n }\n\n if (value && typeof value === \"object\") {\n if (seen.has(value)) {\n return;\n }\n seen.add(value);\n if (Array.isArray(value)) {\n value.forEach((item, index) => scan(item, `${pathLabel}[${index}]`, null));\n return;\n }\n for (const [childKey, childValue] of Object.entries(value)) {\n scan(childValue, `${pathLabel}.${childKey}`, childKey);\n }\n }\n };\n\n for (const [key, value] of Object.entries(publicConfig)) {\n scan(value, key, key);\n }\n}\n\nfunction createRuntimeConfig(config: Record<string, unknown>): Record<string, unknown> {\n const runtimeConfig = (config as ResuxConfig).runtimeConfig;\n const packagesConfig = isPlainObject((config as ResuxConfig).packages)\n ? (config as ResuxConfig).packages as Record<string, unknown>\n : null;\n const videoConfig = isPlainObject((config as ResuxConfig).video)\n ? (config as ResuxConfig).video as Record<string, unknown>\n : null;\n const routerConfig = isPlainObject(config.router)\n ? config.router\n : null;\n const publicConfig = (runtimeConfig?.public && typeof runtimeConfig.public === \"object\" && !Array.isArray(runtimeConfig.public))\n ? runtimeConfig.public as Record<string, unknown>\n : {};\n const appRuntimeConfig = {\n ...(runtimeConfig ?? {}),\n public: {\n ...publicConfig,\n ...(packagesConfig ? { packages: packagesConfig } : {}),\n ...(videoConfig ? { video: videoConfig } : {}),\n ...(routerConfig ? { router: routerConfig } : {}),\n }\n };\n\n const halalConfig = (config as any).halalAI;\n // Scan only the user's own public config; framework-injected sections\n // (packages, video, router) are not user-provided secrets.\n scanRuntimeConfigForSecrets({ ...appRuntimeConfig, public: publicConfig }, halalConfig);\n\n return appRuntimeConfig;\n}\n\nfunction createRouteRules(config: Record<string, unknown>): Record<string, RouteRuleConfig> {\n const routeRules = (config as ResuxConfig).routeRules;\n\n if (!routeRules || typeof routeRules !== \"object\" || Array.isArray(routeRules)) {\n return {};\n }\n\n const normalized: Record<string, RouteRuleConfig> = {};\n\n for (const [routePath, rule] of Object.entries(routeRules)) {\n if (!routePath.startsWith(\"/\") || !rule || typeof rule !== \"object\" || Array.isArray(rule)) {\n continue;\n }\n\n const routeRule = rule as RouteRuleConfig;\n normalized[routePath] = {\n ...(routeRule.headers && typeof routeRule.headers === \"object\" ? { headers: normalizeStringRecord(routeRule.headers) } : {}),\n ...(typeof routeRule.redirect === \"string\" || isRedirectObject(routeRule.redirect)\n ? { redirect: routeRule.redirect }\n : {}),\n ...(isStatusCode(routeRule.statusCode) ? { statusCode: routeRule.statusCode } : {}),\n ...(normalizeCacheRule(routeRule.cache) !== undefined ? { cache: normalizeCacheRule(routeRule.cache) } : {}),\n ...(normalizeCorsRule(routeRule.cors) !== undefined ? { cors: normalizeCorsRule(routeRule.cors) } : {})\n };\n }\n\n return normalized;\n}\n\nfunction isStatusCode(value: unknown): value is number {\n return Number.isInteger(value) && (value as number) >= 100 && (value as number) <= 599;\n}\n\nfunction normalizeCacheRule(value: RouteRuleConfig[\"cache\"]): RouteRuleConfig[\"cache\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (value === false || typeof value === \"string\") {\n return value;\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n\n const cache: { maxAge?: number; swr?: number } = {};\n if (Number.isFinite(value.maxAge) && value.maxAge! >= 0) {\n cache.maxAge = Math.floor(value.maxAge!);\n }\n if (Number.isFinite(value.swr) && value.swr! >= 0) {\n cache.swr = Math.floor(value.swr!);\n }\n return Object.keys(cache).length > 0 ? cache : undefined;\n}\n\nfunction normalizeCorsRule(value: RouteRuleConfig[\"cors\"]): RouteRuleConfig[\"cors\"] | undefined {\n if (value === undefined) {\n return undefined;\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n\n return {\n ...(typeof value.origin === \"string\" ? { origin: value.origin } : {}),\n ...(Array.isArray(value.methods) ? { methods: value.methods.map(String) } : {}),\n ...(Array.isArray(value.headers) ? { headers: value.headers.map(String) } : {}),\n ...(typeof value.credentials === \"boolean\" ? { credentials: value.credentials } : {})\n };\n}\n\nfunction normalizeStringRecord(record: Record<string, unknown>): Record<string, string> {\n const output: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(record)) {\n if (value !== undefined && value !== null) {\n output[key] = String(value);\n }\n }\n\n return output;\n}\n\nfunction isRedirectObject(value: unknown): value is { to: string; statusCode?: number } {\n return Boolean(\n value\n && typeof value === \"object\"\n && !Array.isArray(value)\n && typeof (value as { to?: unknown }).to === \"string\"\n );\n}\n\nfunction layoutNameFromFile(file: string): string {\n return kebabCase(path.basename(file, \".vue\"));\n}\n\nfunction supportFileMode(file: string): \"all\" | \"server\" | \"client\" {\n if (file.includes(\".client.\")) {\n return \"client\";\n }\n if (file.includes(\".server.\")) {\n return \"server\";\n }\n return \"all\";\n}\n\nfunction supportFileBaseName(file: string): string {\n const extensionStripped = path.basename(file).replace(/\\.[cm]?[tj]s$/, \"\");\n return extensionStripped.replace(/(?:\\.global|\\.client|\\.server)+$/, \"\");\n}\n\nfunction compilePluginFile(file: string, index: number): CompiledPlugin {\n const mode = supportFileMode(file);\n return {\n id: `p${index}`,\n file,\n mode,\n serverSource: transpileSupportModule(file, {\n prefix: `import { defineResuxPlugin } from \"resuxjs/runtime\";\\nconst defineNuxtPlugin = defineResuxPlugin;\\n`,\n autoImports: [{\n from: \"resuxjs/runtime\",\n names: SUPPORT_CLIENT_RUNTIME_HELPERS,\n }],\n }),\n clientSource: transpileSupportModule(file, {\n prefix: `import { defineResuxPlugin } from \"/__resux/runtime-client.mjs\";\\nconst defineNuxtPlugin = defineResuxPlugin;\\n`,\n autoImports: [{\n from: \"/__resux/runtime-client.mjs\",\n names: SUPPORT_CLIENT_RUNTIME_HELPERS,\n }],\n rewriteImports: {\n \"resuxjs\": \"/__resux/runtime-client.mjs\",\n \"resuxjs/runtime\": \"/__resux/runtime-client.mjs\",\n },\n })\n };\n}\n\nfunction compileMiddlewareFile(file: string, index: number): CompiledMiddleware {\n const baseName = supportFileBaseName(file);\n const mode = supportFileMode(file);\n const global = /\\.global(?:\\.(?:client|server))?\\.[cm]?[tj]s$/.test(file);\n\n return {\n id: `w${index}`,\n name: kebabCase(baseName),\n file,\n mode,\n global,\n serverSource: transpileSupportModule(\n file,\n `import { defineResuxRouteMiddleware, navigateTo, abortNavigation } from \"resuxjs/runtime\";\\n`\n ),\n clientSource: transpileSupportModule(\n file,\n `import { defineResuxRouteMiddleware, defineClientRouteRedirect as navigateTo, defineClientRouteAbort as abortNavigation } from \"/__resux/runtime-client.mjs\";\\n`\n )\n };\n}\n\nfunction compileServerMiddlewareFile(file: string, index: number): CompiledServerMiddleware {\n return {\n id: `s${index}`,\n file,\n source: transpileSupportModule(file, `import { defineServerMiddleware, defineEventHandler, eventHandler, readBody, getQuery, setHeader } from \"resuxjs/runtime\";\\n`)\n };\n}\n\nfunction compileServerHandlerFile(file: string, index: number, routePath: string): ServerHandlerRecord {\n const params = collectRouteParams(routePath);\n\n return {\n id: `h${index}`,\n path: routePath,\n file,\n params,\n source: transpileSupportModule(file, `import { defineEventHandler, eventHandler, readBody, getQuery, setHeader } from \"resuxjs/runtime\";\\n`)\n };\n}\n\nfunction transpileSupportModule(file: string, input: string | SupportModuleTranspileOptions = \"\"): string {\n const source = ts.sys.readFile(file) ?? \"\";\n const options: SupportModuleTranspileOptions = typeof input === \"string\"\n ? { prefix: input }\n : input;\n const rewrittenSource = rewriteSupportModuleImports(source, options.rewriteImports);\n const autoImportPrefix = createSupportModuleAutoImportPrefix(file, rewrittenSource, options.autoImports ?? []);\n return ts.transpileModule(`${options.prefix ?? \"\"}${autoImportPrefix}${rewrittenSource}`, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n}\n\nfunction rewriteSupportModuleImports(source: string, rewrites?: Record<string, string>): string {\n if (!rewrites || Object.keys(rewrites).length === 0) {\n return source;\n }\n let output = source;\n for (const [from, to] of Object.entries(rewrites)) {\n if (!from || !to || from === to) {\n continue;\n }\n const escapedFrom = escapeRegExp(from);\n output = output.replace(\n new RegExp(`(\\\\bfrom\\\\s+[\"'])${escapedFrom}([\"'])`, \"g\"),\n `$1${to}$2`,\n );\n output = output.replace(\n new RegExp(`(\\\\bimport\\\\s*\\\\(\\\\s*[\"'])${escapedFrom}([\"']\\\\s*\\\\))`, \"g\"),\n `$1${to}$2`,\n );\n }\n return output;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction createSupportModuleAutoImportPrefix(\n file: string,\n source: string,\n autoImports: Array<{ from: string; names: readonly string[] }>,\n): string {\n if (!autoImports.length) {\n return \"\";\n }\n\n const declared = collectSupportModuleTopLevelBindings(file, source);\n const lines: string[] = [];\n\n for (const entry of autoImports) {\n const seen = new Set<string>();\n const names: string[] = [];\n\n for (const name of entry.names) {\n if (seen.has(name) || declared.has(name)) {\n continue;\n }\n seen.add(name);\n const pattern = new RegExp(`\\\\b${name}\\\\b`);\n if (!pattern.test(source)) {\n continue;\n }\n names.push(name);\n }\n\n if (names.length > 0) {\n lines.push(`import { ${names.join(\", \")} } from ${JSON.stringify(entry.from)};`);\n }\n }\n\n if (!lines.length) {\n return \"\";\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nfunction collectSupportModuleTopLevelBindings(file: string, source: string): Set<string> {\n const bindings = new Set<string>();\n const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.ES2022, true, ts.ScriptKind.TS);\n\n for (const statement of sourceFile.statements) {\n if (ts.isImportDeclaration(statement)) {\n const clause = statement.importClause;\n if (!clause) {\n continue;\n }\n if (clause.name) {\n bindings.add(clause.name.text);\n }\n if (clause.namedBindings) {\n if (ts.isNamespaceImport(clause.namedBindings)) {\n bindings.add(clause.namedBindings.name.text);\n } else {\n for (const element of clause.namedBindings.elements) {\n bindings.add(element.name.text);\n }\n }\n }\n continue;\n }\n\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n for (const name of collectBindingNames(declaration.name)) {\n bindings.add(name);\n }\n }\n continue;\n }\n\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isClassDeclaration(statement) && statement.name) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isEnumDeclaration(statement)) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isTypeAliasDeclaration(statement)) {\n bindings.add(statement.name.text);\n continue;\n }\n\n if (ts.isInterfaceDeclaration(statement)) {\n bindings.add(statement.name.text);\n continue;\n }\n }\n\n return bindings;\n}\n\ninterface RuntimeConfigReadResult {\n config: Record<string, unknown>;\n moduleContainer: ResuxModuleContainer;\n}\n\nasync function readRuntimeConfig(root: string, outDir: string, hooks: ResuxHooks): Promise<RuntimeConfigReadResult> {\n const moduleContainer = new ResuxModuleContainer();\n const candidates = [\n \"resux.config.ts\",\n \"resux.config.mjs\",\n \"resux.config.js\"\n ];\n\n for (const candidate of candidates) {\n const file = await optionalFile(path.join(root, candidate));\n if (!file) {\n continue;\n }\n\n const source = normalizeConfigHelpers(await readFile(file, \"utf8\"));\n const outputFile = path.join(outDir, \"server\", \"config.mjs\");\n const compiled = ts.transpileModule(source, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022\n }\n }).outputText;\n await writeFile(outputFile, compiled, \"utf8\");\n const imported = await import(`${pathToFileURL(outputFile).href}?t=${Date.now()}`);\n const config = (imported.default ?? {}) as ResuxConfig;\n Object.assign(config, createResux({ rootDir: root, buildDir: outDir, config }).options);\n const context = moduleContainer.createContext(config, root, outDir, hooks);\n await applyConfiguredModules(config, root, outDir, context);\n delete config.modules;\n await writeFile(outputFile, `export default ${JSON.stringify(config, null, 2)};`, \"utf8\");\n return { config, moduleContainer };\n }\n\n return { config: createResux({ rootDir: root, buildDir: outDir, config: {} }).options, moduleContainer };\n}\n\nfunction normalizeConfigHelpers(source: string): string {\n return source\n .replace(/\\bdefineResuxConfig\\s*\\(/g, \"(\")\n .replace(/\\bdefineResuxModule\\s*\\(/g, \"(\");\n}\n\nasync function applyConfiguredModules(\n config: ResuxConfig,\n root: string,\n outDir: string,\n context: ResuxModuleContext\n): Promise<void> {\n const modules = Array.isArray(config.modules) ? config.modules : [];\n\n for (const moduleEntry of modules) {\n const { module, options } = await resolveModuleEntry(moduleEntry, root, outDir);\n const setup = getModuleSetup(module);\n await Promise.resolve(withResuxKitContext(context, () => setup(createModuleOptions(module, options), context)));\n }\n}\n\nfunction deepMerge<T extends Record<string, unknown>>(base: T, next: Record<string, unknown>): T {\n const output = { ...base } as Record<string, unknown>;\n\n for (const [key, value] of Object.entries(next)) {\n const current = output[key];\n output[key] = isPlainObject(current) && isPlainObject(value)\n ? deepMerge(current, value)\n : value;\n }\n\n return output as T;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === \"object\" && !Array.isArray(value));\n}\n\nasync function resolveModuleEntry(\n entry: unknown,\n root: string,\n outDir: string\n): Promise<{ module: unknown; options: unknown }> {\n if (Array.isArray(entry)) {\n return {\n module: await loadModule(entry[0], root, outDir),\n options: entry[1] ?? {}\n };\n }\n\n return {\n module: await loadModule(entry, root, outDir),\n options: {}\n };\n}\n\nasync function loadModule(module: unknown, root: string, outDir: string): Promise<unknown> {\n if (typeof module === \"function\" || isPlainObject(module)) {\n return module;\n }\n\n if (typeof module !== \"string\") {\n throw new Error(\"Resux modules must be functions, module objects, module specifiers, or [module, options] tuples.\");\n }\n\n const builtin = resolveBuiltinModule(module);\n if (builtin) {\n return builtin;\n }\n\n const resolved = resolveModuleSpecifier(module, root);\n const imported = await import(`${await moduleImportUrl(resolved, outDir)}?t=${Date.now()}`);\n return imported.default ?? imported;\n}\n\nfunction getModuleSetup(module: unknown): ResuxModuleSetup {\n if (typeof module === \"function\") {\n return module as ResuxModuleSetup;\n }\n\n if (isPlainObject(module) && typeof module.setup === \"function\") {\n return module.setup as ResuxModuleSetup;\n }\n\n throw new Error(\"Resux modules must export a setup function or defineResuxModule({ setup }).\");\n}\n\nfunction createModuleOptions(module: unknown, options: unknown): unknown {\n if (isPlainObject(module) && isPlainObject(module.defaults)) {\n return {\n ...module.defaults,\n ...(isPlainObject(options) ? options : {})\n };\n }\n\n return options;\n}\n\nfunction resolveBuiltinModule(specifier: string): BuiltinResuxModule | null {\n const normalized = specifier.startsWith(\"resux:\") ? specifier.slice(\"resux:\".length) : specifier;\n return builtinModules[normalized] ?? null;\n}\n\nconst i18nBuiltinModule: BuiltinResuxModule = {\n async setup(options, resux) {\n const imported = await import(\"../i18n/index.js\");\n const module = imported.default ?? imported;\n const setup = getModuleSetup(module);\n await setup(options, resux);\n }\n};\n\nconst builtinModules: Record<string, BuiltinResuxModule> = {\n i18n: i18nBuiltinModule,\n \"resuxjs/i18n\": i18nBuiltinModule,\n \"@resuxjs/i18n\": i18nBuiltinModule,\n security: {\n defaults: {\n route: \"/**\",\n contentSecurityPolicy: false\n },\n setup(options, resux) {\n const input = isPlainObject(options) ? options : {};\n const routePath = firstString(input.route) ?? \"/**\";\n const headers: Record<string, string> = {\n \"x-content-type-options\": \"nosniff\",\n \"referrer-policy\": \"strict-origin-when-cross-origin\",\n \"x-frame-options\": \"SAMEORIGIN\",\n \"cross-origin-opener-policy\": \"same-origin\",\n \"permissions-policy\": \"camera=(), microphone=(), geolocation=()\",\n ...(isPlainObject(input.headers) ? normalizeStringRecord(input.headers) : {})\n };\n const csp = firstString(input.contentSecurityPolicy);\n\n if (csp) {\n headers[\"content-security-policy\"] = csp;\n }\n\n resux.addRouteRule(routePath, { headers });\n resux.extendRuntimeConfig({\n public: { securityHeaders: true },\n resuxSecurity: {\n contentSecurityPolicy: csp ?? \"\",\n route: routePath,\n },\n });\n }\n },\n performance: {\n defaults: {\n assetMaxAge: 31536000,\n routePayloadNoStore: true,\n inlineCss: true,\n inlineCssMaxBytes: 65_536\n },\n setup(options, resux) {\n const input = isPlainObject(options) ? options : {};\n const maxAge = Number.isFinite(input.assetMaxAge) ? Math.max(0, Math.floor(input.assetMaxAge as number)) : 31536000;\n const inlineCss = input.inlineCss !== false;\n const inlineCssMaxBytes = Number.isFinite(input.inlineCssMaxBytes)\n ? Math.max(0, Math.floor(input.inlineCssMaxBytes as number))\n : 65_536;\n const assetCache = { maxAge };\n resux.addRouteRule(\"/__resux/runtime-client.mjs\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/handlers/**\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/vue-islands/**\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/image\", { cache: assetCache });\n resux.addRouteRule(\"/__resux/video\", { cache: assetCache });\n\n if (input.routePayloadNoStore !== false) {\n resux.addRouteRule(\"/__resux/route\", { cache: false });\n }\n\n resux.extendRuntimeConfig({\n public: {\n performanceModule: {\n assetMaxAge: maxAge,\n inlineCss,\n inlineCssMaxBytes,\n },\n },\n });\n }\n }\n};\n\nfunction firstString(value: unknown): string | null {\n return typeof value === \"string\" && value.length > 0 ? value : null;\n}\n\nfunction resolveModuleSpecifier(specifier: string, root: string): string {\n if (specifier.startsWith(\".\") || specifier.startsWith(\"/\") || specifier.startsWith(\"file:\")) {\n const resolved = specifier.startsWith(\"file:\")\n ? new URL(specifier)\n : path.resolve(root, specifier);\n const file = resolved instanceof URL ? fileURLToPath(resolved) : resolved;\n return resolveLocalModuleFile(file);\n }\n\n return require.resolve(specifier, { paths: [root] });\n}\n\nfunction resolveLocalModuleFile(file: string): string {\n const candidates = [\n file,\n `${file}.ts`,\n `${file}.mts`,\n `${file}.js`,\n `${file}.mjs`,\n path.join(file, \"index.ts\"),\n path.join(file, \"index.mts\"),\n path.join(file, \"index.js\"),\n path.join(file, \"index.mjs\")\n ];\n const found = candidates.find((candidate) => ts.sys.fileExists(candidate));\n\n if (!found) {\n throw new Error(`Cannot resolve Resux module \"${file}\".`);\n }\n\n return found;\n}\n\nasync function moduleImportUrl(file: string, outDir: string): Promise<string> {\n if (/\\.[cm]?ts$/.test(file)) {\n const outputFile = path.join(outDir, \"server\", \"config-modules\", `${safeModuleFileName(file)}.mjs`);\n await writeFile(outputFile, transpileConfigSupportModule(file), \"utf8\");\n return pathToFileURL(outputFile).href;\n }\n\n return pathToFileURL(file).href;\n}\n\nfunction transpileConfigSupportModule(file: string): string {\n const source = normalizeConfigHelpers(ts.sys.readFile(file) ?? \"\");\n return ts.transpileModule(source, {\n compilerOptions: {\n target: ts.ScriptTarget.ES2022,\n module: ts.ModuleKind.ES2022,\n importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove\n }\n }).outputText;\n}\n\nfunction safeModuleFileName(file: string): string {\n return normalizePath(path.resolve(file)).replace(/[^A-Za-z0-9_-]+/g, \"_\");\n}\n\nfunction nextBindingId(state: CompileTemplateState): string {\n return `b${state.bindingIndex++}`;\n}\n\nfunction nextInlineHandlerName(state: CompileTemplateState): string {\n return `__rx_inline_${state.inlineHandlerIndex++}`;\n}\n\nfunction routeScore(routePath: string): number {\n return routePath\n .split(\"/\")\n .filter(Boolean)\n .reduce((score, part) => score + (part.startsWith(\":\") ? 1 : 3), 0);\n}\n\nasync function discoverVueFiles(dir: string): Promise<string[]> {\n try {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: string[] = [];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...await discoverVueFiles(fullPath));\n } else if (entry.isFile() && entry.name.endsWith(\".vue\")) {\n files.push(fullPath);\n }\n }\n\n return files.sort();\n } catch {\n return [];\n }\n}\n\nasync function discoverAppVueFiles(root: string, dirName: string): Promise<string[]> {\n return unique([\n ...await discoverVueFiles(path.join(root, dirName)),\n ...await discoverVueFiles(path.join(root, \"app\", dirName))\n ]);\n}\n\nasync function discoverVueFilesFromDirs(dirs: string[]): Promise<string[]> {\n const files: string[] = [];\n for (const dir of dirs) {\n files.push(...await discoverVueFiles(dir));\n }\n return unique(files);\n}\n\nasync function discoverSupportTsFiles(root: string, dirName: string): Promise<string[]> {\n const dirs = [path.join(root, dirName), path.join(root, \"app\", dirName)];\n const files: string[] = [];\n\n for (const dir of dirs) {\n files.push(...await discoverSupportTsFilesInDir(dir));\n }\n\n return unique(files).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n}\n\nfunction isClientEnhancementSupportFile(file: string): boolean {\n return /\\.client\\.[cm]?[tj]s$/.test(file) && !/\\.d\\.[cm]?[tj]s$/.test(file);\n}\n\nasync function discoverClientEnhancementFiles(root: string): Promise<string[]> {\n const files: string[] = [];\n for (const relativeDir of CLIENT_ENHANCEMENT_DIR_CANDIDATES) {\n const absoluteDir = path.join(root, relativeDir);\n files.push(...await discoverSupportTsFilesInDir(absoluteDir));\n }\n return unique(files)\n .map((file) => path.resolve(file))\n .filter((file) => isClientEnhancementSupportFile(file))\n .sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n}\n\nasync function discoverAutoImportsFromDirs(\n root: string,\n dirs: string[]\n): Promise<Array<{ from: string; name: string; as?: string }>> {\n const entries: Array<{ from: string; name: string; as?: string }> = [];\n for (const dir of dirs) {\n const files = await discoverSupportTsFilesInDir(dir);\n for (const file of files) {\n const source = await readFile(file, \"utf8\");\n const names = collectNamedExportsFromSource(file, source);\n const relative = normalizePath(path.relative(root, file).replace(/\\.[cm]?[tj]s$/, \"\"));\n const from = relative.startsWith(\".\") ? relative : `./${relative}`;\n for (const name of names) {\n entries.push({ from, name });\n }\n }\n }\n return dedupeImports(entries);\n}\n\nfunction collectNamedExportsFromSource(file: string, source: string): string[] {\n const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.ES2022, true, ts.ScriptKind.TS);\n const names = new Set<string>();\n for (const statement of sourceFile.statements) {\n if (!isStatementExported(statement)) {\n continue;\n }\n if (ts.isFunctionDeclaration(statement) && statement.name) {\n names.add(statement.name.text);\n continue;\n }\n if (ts.isClassDeclaration(statement) && statement.name) {\n names.add(statement.name.text);\n continue;\n }\n if (ts.isVariableStatement(statement)) {\n for (const declaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(declaration.name)) {\n names.add(declaration.name.text);\n }\n }\n continue;\n }\n if (ts.isExportDeclaration(statement) && statement.exportClause && ts.isNamedExports(statement.exportClause)) {\n for (const specifier of statement.exportClause.elements) {\n names.add(specifier.name.text);\n }\n }\n }\n return [...names].sort();\n}\n\nfunction isStatementExported(statement: ts.Statement): boolean {\n const modifiers = ts.canHaveModifiers(statement) ? ts.getModifiers(statement) : undefined;\n return Boolean(modifiers?.some((modifier) => modifier.kind === ts.SyntaxKind.ExportKeyword));\n}\n\nfunction uniqueServerHandlers(records: Array<{ file: string; path: string }>): Array<{ file: string; path: string }> {\n const map = new Map<string, { file: string; path: string }>();\n for (const record of records) {\n const key = `${normalizeRoutePath(record.path)}::${normalizePath(path.resolve(record.file))}`;\n map.set(key, { file: path.resolve(record.file), path: normalizeRoutePath(record.path) });\n }\n return [...map.values()].sort((left, right) => left.path.localeCompare(right.path) || normalizePath(left.file).localeCompare(normalizePath(right.file)));\n}\n\nasync function writeModuleTemplates(outDir: string, contributions: ResuxModuleContributions): Promise<string[]> {\n const written: string[] = [];\n for (const template of [...contributions.templates, ...contributions.typeTemplates]) {\n if (template.write === false) {\n continue;\n }\n const target = path.join(outDir, \"templates\", template.filename);\n await mkdir(path.dirname(target), { recursive: true });\n await writeFile(target, await template.getContents(), \"utf8\");\n written.push(target);\n }\n return written.sort((left, right) => normalizePath(left).localeCompare(normalizePath(right)));\n}\n\ninterface RuntimeArtifactsInput {\n routes: RouteManifestRecord[];\n components: CompiledComponent[];\n layouts: CompiledComponent[];\n plugins: CompiledPlugin[];\n clientEnhancements: ClientEnhancementManifestEntry[];\n middleware: CompiledMiddleware[];\n serverMiddleware: CompiledServerMiddleware[];\n serverHandlers: ServerHandlerRecord[];\n vueIslands: VueIslandRecord[];\n app?: CompiledComponent;\n error?: CompiledComponent;\n runtimeConfig: Record<string, unknown>;\n routeRules: Record<string, RouteRuleConfig>;\n packages: PackageManifestEntry[];\n buildOptions: { vite: \"build\" | \"dev\"; server: \"bundle\" | \"modules\" };\n contributions: ResuxModuleContributions;\n}\n\ninterface RuntimeArtifacts {\n manifest: Record<string, unknown>;\n buildManifest: Record<string, unknown>;\n routesSource: string;\n pluginsSource: string;\n middlewareSource: string;\n componentsSource: string;\n importsSource: string;\n appSource: string;\n resuxDts: string;\n importsDts: string;\n componentsDts: string;\n serverRoutesDts: string;\n diagnostics: {\n routeManifest: Record<string, unknown>[];\n pluginManifest: Record<string, unknown>[];\n clientEnhancementManifest: Record<string, unknown>[];\n middlewareManifest: Record<string, unknown>[];\n componentManifest: Record<string, unknown>[];\n };\n}\n\nfunction buildRuntimeArtifacts(input: RuntimeArtifactsInput): RuntimeArtifacts {\n const manifest = {\n routes: input.routes,\n components: input.components.map(({ id, name, file, handlers, styles, styleScopeId, meta }) => ({ id, name, file, handlers, styles, styleScopeId, meta })),\n layouts: input.layouts.map(({ id, name, file, styles, styleScopeId }) => ({ id, name, file, styles, styleScopeId })),\n plugins: input.plugins.map(({ id, file, mode }) => ({ id, file, mode })),\n clientEnhancements: input.clientEnhancements.map(({ name, id, file, src }) => ({ name, id, file, src })),\n middleware: input.middleware.map(({ id, name, file, global, mode }) => ({ id, name, file, global, mode })),\n serverMiddleware: input.serverMiddleware.map(({ id, file }) => ({ id, file })),\n serverHandlers: input.serverHandlers.map(({ id, path: routePath, file, params }) => ({ id, path: routePath, file, params })),\n vueIslands: input.vueIslands,\n app: input.app?.id,\n error: input.error?.id,\n runtimeConfig: input.runtimeConfig,\n routeRules: input.routeRules,\n packages: input.packages,\n features: input.buildOptions\n };\n\n const buildManifest = {\n routes: input.routes.map((route) => route.path),\n serverHandlers: input.serverHandlers.map((handler) => ({ path: handler.path, file: handler.file })),\n plugins: input.plugins.map((plugin) => ({ file: plugin.file, mode: plugin.mode })),\n clientEnhancements: input.clientEnhancements.map((entry) => ({ name: entry.name, id: entry.id, file: entry.file, src: entry.src })),\n middleware: input.middleware.map((entry) => ({ name: entry.name, file: entry.file, mode: entry.mode, global: entry.global })),\n components: input.components.map((component) => ({ name: component.name, file: component.file })),\n assets: [],\n imageTransforms: [],\n routeRules: Object.entries(input.routeRules).map(([routePath, rule]) => ({ path: routePath, rule })),\n runtimeConfig: input.runtimeConfig,\n packages: input.packages\n };\n\n const componentMap = new Map<string, typeof input.components[0]>();\n for (const component of input.components) {\n componentMap.set(component.name, component);\n const basename = pascalCase(path.basename(component.file, \".vue\"));\n if (!componentMap.has(basename)) {\n componentMap.set(basename, component);\n }\n }\n const componentNames = unique([...componentMap.keys()].filter(Boolean)).sort();\n const imports = dedupeImports([...BUILTIN_AUTO_IMPORTS, ...input.contributions.imports]);\n const importsSignatures = imports\n .map((entry) => `${entry.name}${entry.as ? ` as ${entry.as}` : \"\"} from ${entry.from}`)\n .join(\"\\n\");\n\n const routesSource = `export default ${JSON.stringify(input.routes.map((route) => ({ id: route.id, path: route.path, file: route.file, params: route.params, componentId: route.componentId, meta: route.meta })), null, 2)};\\n`;\n const pluginsSource = `export default ${JSON.stringify(input.plugins.map((plugin) => ({ id: plugin.id, file: plugin.file, mode: plugin.mode })), null, 2)};\\n`;\n const middlewareSource = `export default ${JSON.stringify(input.middleware.map((entry) => ({ id: entry.id, name: entry.name, file: entry.file, global: entry.global, mode: entry.mode })), null, 2)};\\n`;\n const componentsSource = `export default ${JSON.stringify([...componentMap.entries()].map(([name, comp]) => ({ id: comp.id, name, file: comp.file })), null, 2)};\\n`;\n const importsSource = `export default ${JSON.stringify(imports, null, 2)};\\n`;\n const appSource = [\n `import routes from \"./routes.mjs\";`,\n `import plugins from \"./plugins.mjs\";`,\n `import middleware from \"./middleware.mjs\";`,\n `import components from \"./components.mjs\";`,\n `import imports from \"./imports.mjs\";`,\n `export default {`,\n ` app: ${JSON.stringify(input.app?.id ?? null)},`,\n ` error: ${JSON.stringify(input.error?.id ?? null)},`,\n ` routes,`,\n ` plugins,`,\n ` middleware,`,\n ` components,`,\n ` imports`,\n `};`,\n ``\n ].join(\"\\n\");\n const resuxDts = [\n `export interface ResuxGeneratedAppManifest {`,\n ` app: string | null;`,\n ` error: string | null;`,\n ` routes: Array<{ id: string; path: string; file: string; params: string[]; componentId: string }>;`,\n ` plugins: Array<{ id: string; file: string; mode: \"all\" | \"server\" | \"client\" }>;`,\n ` clientEnhancements: Array<{ name: string; id: string; file: string; src: string }>;`,\n ` middleware: Array<{ id: string; name: string; file: string; mode: \"all\" | \"server\" | \"client\"; global: boolean }>;`,\n ` components: Array<{ id: string; name: string; file: string }>;`,\n ` imports: Array<{ from: string; name: string; as?: string }>;`,\n `}`,\n `declare const manifest: ResuxGeneratedAppManifest;`,\n `export default manifest;`,\n ``\n ].join(\"\\n\");\n const importsDts = [\n `// Generated by Resux`,\n `declare module \"resuxjs\" {`,\n ` export interface ResuxAutoImportsRegistry {`,\n ...(importsSignatures ? imports.map((entry) => ` \"${entry.as ?? entry.name}\": typeof import(\"${entry.from}\")[\"${entry.name}\"];`) : [\" // no user imports detected\"]),\n ` }`,\n `}`,\n `export {};`,\n ``\n ].join(\"\\n\");\n const componentsDts = [\n `declare module \"resuxjs/components\" {`,\n ` export interface ResuxComponentsRegistry {`,\n ...(componentNames.length ? componentNames.map((name) => ` \"${name}\": unknown;`) : [\" // no components detected\"]),\n ` }`,\n `}`,\n `export {};`,\n ``\n ].join(\"\\n\");\n const serverRoutesDts = [\n `declare module \"resuxjs/server-routes\" {`,\n ` export interface ResuxServerRouteMap {`,\n ...(input.serverHandlers.length\n ? input.serverHandlers.map((handler) => ` \"${handler.path}\": unknown;`)\n : [\" // no server routes detected\"]),\n ` }`,\n `}`,\n `export {};`,\n ``\n ].join(\"\\n\");\n\n return {\n manifest: manifest as Record<string, unknown>,\n buildManifest: buildManifest as Record<string, unknown>,\n routesSource,\n pluginsSource,\n middlewareSource,\n componentsSource,\n importsSource,\n appSource,\n resuxDts,\n importsDts,\n componentsDts,\n serverRoutesDts,\n diagnostics: {\n routeManifest: input.routes.map((route) => ({ id: route.id, path: route.path, file: route.file, params: route.params })),\n pluginManifest: input.plugins.map((plugin) => ({ id: plugin.id, file: plugin.file, mode: plugin.mode })),\n clientEnhancementManifest: input.clientEnhancements.map((entry) => ({ name: entry.name, id: entry.id, file: entry.file, src: entry.src })),\n middlewareManifest: input.middleware.map((entry) => ({ id: entry.id, name: entry.name, file: entry.file, global: entry.global, mode: entry.mode })),\n componentManifest: input.components.map((component) => ({ id: component.id, name: component.name, file: component.file }))\n }\n };\n}\n\nasync function writeGeneratedArtifacts(outDir: string, artifacts: RuntimeArtifacts, dev: boolean): Promise<void> {\n await writeFile(path.join(outDir, \"manifest.json\"), JSON.stringify(artifacts.manifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"manifest\", \"build-manifest.json\"), JSON.stringify(artifacts.buildManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"routes.mjs\"), artifacts.routesSource, \"utf8\");\n await writeFile(path.join(outDir, \"plugins.mjs\"), artifacts.pluginsSource, \"utf8\");\n await writeFile(path.join(outDir, \"middleware.mjs\"), artifacts.middlewareSource, \"utf8\");\n await writeFile(path.join(outDir, \"components.mjs\"), artifacts.componentsSource, \"utf8\");\n await writeFile(path.join(outDir, \"imports.mjs\"), artifacts.importsSource, \"utf8\");\n await writeFile(path.join(outDir, \"app.mjs\"), artifacts.appSource, \"utf8\");\n await writeFile(path.join(outDir, \"resux.d.ts\"), artifacts.resuxDts, \"utf8\");\n await writeFile(path.join(outDir, \"imports.d.ts\"), artifacts.importsDts, \"utf8\");\n await writeFile(path.join(outDir, \"components.d.ts\"), artifacts.componentsDts, \"utf8\");\n await writeFile(path.join(outDir, \"server-routes.d.ts\"), artifacts.serverRoutesDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"resux.d.ts\"), artifacts.resuxDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"imports.d.ts\"), artifacts.importsDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"components.d.ts\"), artifacts.componentsDts, \"utf8\");\n await writeFile(path.join(outDir, \"types\", \"server-routes.d.ts\"), artifacts.serverRoutesDts, \"utf8\");\n if (!dev) {\n return;\n }\n await mkdir(path.join(outDir, \"dev\"), { recursive: true });\n await writeFile(path.join(outDir, \"dev\", \"route-manifest.json\"), JSON.stringify(artifacts.diagnostics.routeManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"plugin-manifest.json\"), JSON.stringify(artifacts.diagnostics.pluginManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"client-enhancement-manifest.json\"), JSON.stringify(artifacts.diagnostics.clientEnhancementManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"middleware-manifest.json\"), JSON.stringify(artifacts.diagnostics.middlewareManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"component-manifest.json\"), JSON.stringify(artifacts.diagnostics.componentManifest, null, 2), \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"imports.d.ts\"), artifacts.importsDts, \"utf8\");\n await writeFile(path.join(outDir, \"dev\", \"resux.d.ts\"), artifacts.resuxDts, \"utf8\");\n}\n\nfunction uniquePackageSourceFiles(entries: PackageSourceFileInput[]): PackageSourceFileInput[] {\n const map = new Map<string, PackageSourceFileInput>();\n for (const entry of entries) {\n const resolved = path.resolve(entry.file);\n const key = normalizePath(resolved);\n const existing = map.get(key);\n if (!existing) {\n map.set(key, { file: resolved, mode: entry.mode });\n continue;\n }\n if (existing.mode === entry.mode) {\n continue;\n }\n map.set(key, { file: resolved, mode: \"all\" });\n }\n return [...map.values()].sort((left, right) => normalizePath(left.file).localeCompare(normalizePath(right.file)));\n}\n\nfunction isPackageSpecifier(specifier: string): boolean {\n if (!specifier) {\n return false;\n }\n if (\n specifier.startsWith(\".\")\n || specifier.startsWith(\"/\")\n || specifier.startsWith(\"http://\")\n || specifier.startsWith(\"https://\")\n || specifier.startsWith(\"data:\")\n || specifier.startsWith(\"file:\")\n || specifier.startsWith(\"virtual:\")\n || specifier.startsWith(\"node:\")\n ) {\n return false;\n }\n return true;\n}\n\nfunction normalizePackageName(specifier: string): string {\n const clean = specifier.split(\"?\")[0]?.split(\"#\")[0] ?? specifier;\n const segments = clean.split(\"/\");\n if (clean.startsWith(\"@\")) {\n return segments.length >= 2 ? `${segments[0]}/${segments[1]}` : clean;\n }\n return segments[0] ?? clean;\n}\n\nfunction collectPackageImportsFromSource(source: string): Array<{ specifier: string; dynamic: boolean; css: boolean }> {\n const imports: Array<{ specifier: string; dynamic: boolean; css: boolean }> = [];\n const staticRegex = /import\\s+(?:type\\s+)?(?:[^\"'()]*?\\s+from\\s+)?[\"']([^\"']+)[\"']/g;\n const dynamicRegex = /import\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n const requireRegex = /require\\(\\s*[\"']([^\"']+)[\"']\\s*\\)/g;\n const packageApiRegex = /(?:useClientPackage|useLazyPackage|defineClientOnlyPackage|defineLazyPackage)(?:\\s*<[\\s\\S]*?>)?\\(\\s*([A-Za-z_$][A-Za-z0-9_$]*|[\"'][^\"']+[\"'])\\s*(?:,\\s*\\{([\\s\\S]*?)\\})?\\s*\\)/g;\n const packageConstRegex = /(?:^|[;\\r\\n])\\s*const\\s+([A-Za-z_$][A-Za-z0-9_$]*)\\s*=\\s*[\"']([^\"']+)[\"']/g;\n const cssArrayRegex = /css\\s*:\\s*\\[([\\s\\S]*?)\\]/g;\n const cssStringRegex = /css\\s*:\\s*[\"']([^\"']+)[\"']/g;\n const stringLiteralRegex = /[\"']([^\"']+)[\"']/g;\n const packageConstMap = new Map<string, string>();\n\n for (const match of source.matchAll(packageConstRegex)) {\n const name = (match[1] ?? \"\").trim();\n const value = (match[2] ?? \"\").trim();\n if (!name || !value) {\n continue;\n }\n packageConstMap.set(name, value);\n }\n\n for (const match of source.matchAll(staticRegex)) {\n const specifier = match[1] ?? \"\";\n imports.push({\n specifier,\n dynamic: false,\n css: /\\.css(?:[?#]|$)/i.test(specifier),\n });\n }\n for (const match of source.matchAll(dynamicRegex)) {\n const specifier = match[1] ?? \"\";\n imports.push({\n specifier,\n dynamic: true,\n css: /\\.css(?:[?#]|$)/i.test(specifier),\n });\n }\n for (const match of source.matchAll(requireRegex)) {\n const specifier = match[1] ?? \"\";\n imports.push({\n specifier,\n dynamic: false,\n css: /\\.css(?:[?#]|$)/i.test(specifier),\n });\n }\n for (const match of source.matchAll(packageApiRegex)) {\n const token = (match[1] ?? \"\").trim();\n const specifier = token.startsWith(\"\\\"\") || token.startsWith(\"'\")\n ? token.slice(1, -1).trim()\n : (packageConstMap.get(token) ?? \"\");\n const optionsSource = match[2] ?? \"\";\n if (specifier.length > 0) {\n imports.push({\n specifier,\n dynamic: true,\n css: false,\n });\n }\n for (const cssArray of optionsSource.matchAll(cssArrayRegex)) {\n const content = cssArray[1] ?? \"\";\n for (const cssEntry of content.matchAll(stringLiteralRegex)) {\n const cssSpecifier = (cssEntry[1] ?? \"\").trim();\n if (!cssSpecifier) {\n continue;\n }\n imports.push({\n specifier: cssSpecifier,\n dynamic: true,\n css: true,\n });\n }\n }\n for (const cssValue of optionsSource.matchAll(cssStringRegex)) {\n const cssSpecifier = (cssValue[1] ?? \"\").trim();\n if (!cssSpecifier) {\n continue;\n }\n imports.push({\n specifier: cssSpecifier,\n dynamic: true,\n css: true,\n });\n }\n }\n\n return imports;\n}\n\nfunction readConfiguredPackages(runtimeConfig: Record<string, unknown>): ResuxPackagesConfig {\n const directPackages = (runtimeConfig as ResuxConfig).packages;\n if (isPlainObject(directPackages)) {\n return directPackages as ResuxPackagesConfig;\n }\n const nestedRuntimeConfig = isPlainObject((runtimeConfig as ResuxConfig).runtimeConfig)\n ? (runtimeConfig as ResuxConfig).runtimeConfig as Record<string, unknown>\n : null;\n const nestedPublic = nestedRuntimeConfig && isPlainObject(nestedRuntimeConfig.public)\n ? nestedRuntimeConfig.public as Record<string, unknown>\n : null;\n const nestedPackages = nestedPublic?.packages;\n if (isPlainObject(nestedPackages)) {\n return nestedPackages as ResuxPackagesConfig;\n }\n return {};\n}\n\nfunction normalizeConfiguredPackageList(value: unknown): string[] {\n if (!Array.isArray(value)) {\n return [];\n }\n return [...new Set(value\n .map((entry) => String(entry ?? \"\").trim())\n .filter((entry) => entry.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeConfiguredPackageCssMap(config: ResuxPackagesConfig): Record<string, string[]> {\n const output: Record<string, string[]> = {};\n if (!config.css || typeof config.css !== \"object\" || Array.isArray(config.css)) {\n return output;\n }\n for (const [packageName, entries] of Object.entries(config.css)) {\n const normalizedPackageName = String(packageName || \"\").trim();\n if (!normalizedPackageName || !Array.isArray(entries)) {\n continue;\n }\n const normalizedEntries = [...new Set(entries\n .map((entry) => String(entry || \"\").trim())\n .filter((entry) => entry.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n if (normalizedEntries.length > 0) {\n output[normalizedPackageName] = normalizedEntries;\n }\n }\n return output;\n}\n\nfunction canResolvePackageSpecifier(appRoot: string, specifier: string): boolean {\n try {\n require.resolve(specifier, { paths: [appRoot] });\n return true;\n } catch {\n return false;\n }\n}\n\nfunction createClientRuntimePackageRegistry(\n appRoot: string,\n configuredPackages: ResuxPackagesConfig,\n packageDiagnostics: PackageManifestEntry[],\n): ClientRuntimePackageRegistry {\n const importers = new Set<string>();\n const declaredPackages = new Set<string>();\n const cssByPackage = normalizeConfiguredPackageCssMap(configuredPackages);\n const configuredModeMap = configuredPackages.mode && typeof configuredPackages.mode === \"object\" && !Array.isArray(configuredPackages.mode)\n ? configuredPackages.mode\n : {};\n const configuredLazy = normalizeConfiguredPackageList(configuredPackages.lazy);\n const configuredClientOnly = normalizeConfiguredPackageList(configuredPackages.clientOnly);\n\n for (const packageName of configuredLazy) {\n declaredPackages.add(packageName);\n importers.add(packageName);\n }\n for (const packageName of configuredClientOnly) {\n declaredPackages.add(packageName);\n importers.add(packageName);\n }\n for (const packageName of Object.keys(configuredModeMap)) {\n const normalizedPackageName = String(packageName || \"\").trim();\n if (!normalizedPackageName) {\n continue;\n }\n declaredPackages.add(normalizedPackageName);\n const mode = normalizeConfiguredPackageMode(configuredModeMap[normalizedPackageName], \"ssr\");\n if (mode !== \"serverOnly\") {\n importers.add(normalizedPackageName);\n }\n }\n for (const [packageName, cssEntries] of Object.entries(cssByPackage)) {\n declaredPackages.add(packageName);\n importers.add(packageName);\n for (const entry of cssEntries) {\n importers.add(entry);\n }\n }\n if (Array.isArray(configuredPackages.css)) {\n for (const entry of configuredPackages.css) {\n const normalized = String(entry || \"\").trim();\n if (!normalized) {\n continue;\n }\n importers.add(normalized);\n }\n }\n\n for (const packageEntry of packageDiagnostics) {\n declaredPackages.add(packageEntry.name);\n const includeImporter = packageEntry.declaredMode !== \"serverOnly\"\n && packageEntry.modes.some((mode) => mode !== \"server\");\n if (includeImporter) {\n importers.add(packageEntry.name);\n for (const specifier of packageEntry.specifiers) {\n const normalizedSpecifier = String(specifier || \"\").trim();\n if (!normalizedSpecifier || !isPackageSpecifier(normalizedSpecifier)) {\n continue;\n }\n importers.add(normalizedSpecifier);\n declaredPackages.add(normalizedSpecifier);\n }\n }\n for (const cssSpecifier of packageEntry.cssImports) {\n const normalizedCssSpecifier = String(cssSpecifier || \"\").trim();\n if (!normalizedCssSpecifier) {\n continue;\n }\n const cssOwner = normalizePackageName(normalizedCssSpecifier);\n if (!cssByPackage[cssOwner]) {\n cssByPackage[cssOwner] = [];\n }\n if (!cssByPackage[cssOwner].includes(normalizedCssSpecifier)) {\n cssByPackage[cssOwner].push(normalizedCssSpecifier);\n }\n importers.add(normalizedCssSpecifier);\n }\n }\n\n const resolvedImporters = [...importers]\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0)\n .filter((entry) => isPackageSpecifier(entry))\n .filter((entry) => canResolvePackageSpecifier(appRoot, entry))\n .sort((left, right) => left.localeCompare(right));\n\n const normalizedCssByPackage: Record<string, string[]> = {};\n for (const [packageName, entries] of Object.entries(cssByPackage)) {\n const normalizedEntries = [...new Set(entries\n .map((entry) => entry.trim())\n .filter((entry) => entry.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n if (normalizedEntries.length > 0) {\n normalizedCssByPackage[packageName] = normalizedEntries;\n }\n }\n\n return {\n importers: resolvedImporters,\n cssByPackage: normalizedCssByPackage,\n declared: [...declaredPackages].sort((left, right) => left.localeCompare(right)),\n };\n}\n\nfunction normalizeConfiguredPackageMode(value: unknown, fallback: ResuxPackageMode = \"ssr\"): ResuxPackageMode {\n if (typeof value !== \"string\") {\n return fallback;\n }\n const normalized = value.trim();\n if (\n normalized === \"ssr\"\n || normalized === \"clientOnly\"\n || normalized === \"serverOnly\"\n || normalized === \"progressive\"\n ) {\n return normalized;\n }\n return fallback;\n}\n\nfunction resolveConfiguredPackageMode(\n packageName: string,\n config: ResuxPackagesConfig,\n): ResuxPackageMode {\n if (config.mode && typeof config.mode === \"object\" && !Array.isArray(config.mode)) {\n const direct = (config.mode as Record<string, unknown>)[packageName];\n if (direct) {\n return normalizeConfiguredPackageMode(direct, \"ssr\");\n }\n }\n const serverOnly = Array.isArray(config.serverOnly) ? config.serverOnly.map(String) : [];\n if (serverOnly.includes(packageName)) {\n return \"serverOnly\";\n }\n const clientOnly = Array.isArray(config.clientOnly) ? config.clientOnly.map(String) : [];\n if (clientOnly.includes(packageName)) {\n return \"clientOnly\";\n }\n return \"ssr\";\n}\n\nasync function analyzePackageUsage(\n appRoot: string,\n sources: PackageSourceFileInput[],\n runtimeConfig: Record<string, unknown>,\n): Promise<PackageManifestEntry[]> {\n const configuredPackages = readConfiguredPackages(runtimeConfig);\n const map = new Map<string, {\n files: Set<string>;\n modes: Set<PackageUsageMode>;\n dynamic: boolean;\n specifiers: Set<string>;\n cssImports: Set<string>;\n declaredMode: ResuxPackageMode;\n warnings: Set<string>;\n }>();\n const ignoredPackages = new Set([\"resuxjs\", \"vue\", \"h3\", \"nitropack\", \"typescript\"]);\n\n for (const entry of sources) {\n let sourceText = \"\";\n try {\n sourceText = await readFile(entry.file, \"utf8\");\n } catch {\n continue;\n }\n const imports = collectPackageImportsFromSource(sourceText);\n for (const imported of imports) {\n if (!isPackageSpecifier(imported.specifier)) {\n continue;\n }\n const packageName = normalizePackageName(imported.specifier);\n if (!packageName || ignoredPackages.has(packageName)) {\n continue;\n }\n const usage = map.get(packageName) ?? {\n files: new Set<string>(),\n modes: new Set<PackageUsageMode>(),\n dynamic: false,\n specifiers: new Set<string>(),\n cssImports: new Set<string>(),\n declaredMode: resolveConfiguredPackageMode(packageName, configuredPackages),\n warnings: new Set<string>(),\n };\n usage.files.add(normalizePath(path.relative(appRoot, entry.file)));\n usage.modes.add(entry.mode);\n usage.dynamic = usage.dynamic || imported.dynamic;\n usage.specifiers.add(imported.specifier);\n if (imported.css) {\n usage.cssImports.add(imported.specifier);\n }\n if (entry.mode === \"server\" && (usage.declaredMode === \"clientOnly\" || usage.declaredMode === \"progressive\")) {\n usage.warnings.add(`Package \"${packageName}\" is marked ${usage.declaredMode} but appears in server files.`);\n }\n if (entry.mode !== \"server\" && usage.declaredMode === \"serverOnly\") {\n usage.warnings.add(`Package \"${packageName}\" is marked serverOnly but appears in client files.`);\n }\n if (usage.declaredMode === \"progressive\" && entry.mode === \"all\") {\n usage.warnings.add(`Package \"${packageName}\" is marked progressive. Prefer loading it inside a client enhancement instead of setup-time imports.`);\n }\n if (\n entry.mode === \"server\"\n && usage.declaredMode === \"ssr\"\n && /(swiper|gsap|chart\\.js|echarts|plyr|animejs|video\\.js)/i.test(packageName)\n ) {\n usage.warnings.add(\n `Package \"${packageName}\" may be browser-only but is imported in server files. Consider packages.mode[\"${packageName}\"] = \"clientOnly\" or \"progressive\".`,\n );\n }\n map.set(packageName, usage);\n }\n }\n\n const output: PackageManifestEntry[] = [];\n for (const [name, usage] of map.entries()) {\n let missing = false;\n try {\n require.resolve(name, { paths: [appRoot] });\n } catch {\n missing = true;\n usage.warnings.add(`Package \"${name}\" is imported but not installed.`);\n }\n output.push({\n name,\n specifiers: [...usage.specifiers].sort(),\n files: [...usage.files].sort(),\n modes: [...usage.modes].sort(),\n dynamic: usage.dynamic,\n cssImports: [...usage.cssImports].sort(),\n missing,\n declaredMode: usage.declaredMode,\n warnings: [...usage.warnings].sort(),\n });\n }\n\n return output.sort((left, right) => left.name.localeCompare(right.name));\n}\n\nfunction dedupeImports(entries: Array<{ from: string; name: string; as?: string }>): Array<{ from: string; name: string; as?: string }> {\n const map = new Map<string, { from: string; name: string; as?: string }>();\n for (const entry of entries) {\n const key = `${entry.from}::${entry.name}::${entry.as ?? \"\"}`;\n map.set(key, entry);\n }\n return [...map.values()].sort((left, right) => {\n const leftKey = `${left.from}:${left.name}:${left.as ?? \"\"}`;\n const rightKey = `${right.from}:${right.name}:${right.as ?? \"\"}`;\n return leftKey.localeCompare(rightKey);\n });\n}\n\nasync function discoverSupportTsFilesInDir(dir: string): Promise<string[]> {\n try {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: string[] = [];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...await discoverSupportTsFilesInDir(fullPath));\n continue;\n }\n if (!entry.isFile()) {\n continue;\n }\n if (!/\\.[cm]?[tj]s$/.test(entry.name)) {\n continue;\n }\n if (/\\.d\\.[cm]?[tj]s$/.test(entry.name)) {\n continue;\n }\n files.push(fullPath);\n }\n\n return files;\n } catch {\n return [];\n }\n}\n\nasync function discoverServerFiles(dir: string, routePrefix: string): Promise<Array<{ file: string; path: string }>> {\n try {\n const entries = await readdir(dir, { withFileTypes: true });\n const files: Array<{ file: string; path: string }> = [];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n files.push(...await discoverServerFiles(fullPath, `${routePrefix}/${entry.name}`));\n } else if (entry.isFile() && /\\.[cm]?[tj]s$/.test(entry.name)) {\n const name = entry.name.replace(/\\.[cm]?[tj]s$/, \"\");\n const segment = name === \"index\" ? \"\" : `/${name}`;\n files.push({\n file: fullPath,\n path: normalizeRoutePath(`${routePrefix}${segment}`)\n });\n }\n }\n\n return files.sort((a, b) => a.path.localeCompare(b.path));\n } catch {\n return [];\n }\n}\n\nasync function discoverVueIslands(root: string): Promise<VueIslandRecord[]> {\n const islandRoot = path.join(root, \"islands\", \"vue\");\n const files = await discoverVueFiles(islandRoot);\n return files.map((file) => {\n const relative = path.relative(islandRoot, file).replace(/\\.vue$/, \"\");\n return {\n name: pascalCase(relative),\n file\n };\n });\n}\n\nasync function findFirstExisting(files: string[]): Promise<string | null> {\n for (const file of files) {\n const found = await optionalFile(file);\n if (found) {\n return found;\n }\n }\n return null;\n}\n\nfunction unique<T>(items: T[]): T[] {\n return [...new Set(items)];\n}\n\nasync function optionalFile(file: string): Promise<string | null> {\n try {\n await readFile(file, \"utf8\");\n return file;\n } catch {\n return null;\n }\n}\n\nasync function existsFile(file: string): Promise<boolean> {\n try {\n await stat(file);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction inferComponentName(root: string, file: string, componentDirs: string[] = []): string {\n const relative = normalizePath(path.relative(root, file));\n if (relative === \"app.vue\") {\n return \"App\";\n }\n const normalizedFile = normalizePath(path.resolve(file));\n for (const dir of componentDirs) {\n const normalizedDir = normalizePath(path.resolve(dir)) + \"/\";\n if (normalizedFile.startsWith(normalizedDir)) {\n const relToDir = normalizedFile.slice(normalizedDir.length).replace(/\\.vue$/, \"\");\n const segments = relToDir.split(\"/\").filter(Boolean);\n const parts: string[] = [];\n for (let i = 0; i < segments.length; i++) {\n const current = pascalCase(segments[i]);\n if (i < segments.length - 1) {\n const next = pascalCase(segments[i + 1]);\n if (next.toLowerCase().startsWith(current.toLowerCase())) {\n continue;\n }\n }\n parts.push(current);\n }\n return parts.join(\"\");\n }\n }\n return pascalCase(path.basename(file, \".vue\"));\n}\n\n\nfunction pascalCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}\n\nfunction kebabCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/\\.global$/, \"\")\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .join(\"-\")\n .toLowerCase();\n}\n\nfunction normalizePath(value: string): string {\n return value.replaceAll(\"\\\\\", \"/\");\n}\n\nfunction normalizeRoutePath(value: string): string {\n const normalized = value\n .replaceAll(\"\\\\\", \"/\")\n .replace(/\\.[cm]?[tj]s$/, \"\")\n .replace(/\\[\\.\\.\\.([A-Za-z0-9_]+)\\]/g, \":$1*\")\n .replace(/\\[([A-Za-z0-9_]+)\\]/g, \":$1\")\n .replace(/\\/index$/, \"\");\n\n return (`/${normalized}`.replace(/\\/+/g, \"/\").replace(/\\/$/, \"\")) || \"/\";\n}\n\nfunction collectRouteParams(routePath: string): string[] {\n return routePath\n .split(\"/\")\n .filter((part) => part.startsWith(\":\"))\n .map((part) => part.slice(1).replace(/\\*$/, \"\"));\n}\n\nfunction locationFromVueNode(file: string, node: VueCompilerNode): CompileErrorLocation {\n return {\n file,\n line: node.loc?.start?.line ?? 1,\n column: node.loc?.start?.column ?? 1\n };\n}\n\nfunction locationFromTsNode(file: string, sourceFile: ts.SourceFile, node: ts.Node): CompileErrorLocation {\n const nodeSourceFile = node.getSourceFile() ?? sourceFile;\n const position = nodeSourceFile.getLineAndCharacterOfPosition(node.getStart(nodeSourceFile));\n return {\n file,\n line: position.line + 1,\n column: position.character + 1\n };\n}\n\nfunction locationFromOffset(file: string, source: string, offset: number): CompileErrorLocation {\n const lines = source.slice(0, offset).split(/\\r?\\n/);\n return {\n file,\n line: lines.length,\n column: lines[lines.length - 1].length + 1\n };\n}\n\nexport function resolveFileExtension(filePath: string): string {\n const ext = path.extname(filePath);\n if (ext) {\n return filePath;\n }\n const extensions = [\".ts\", \".js\", \".vue\", \".tsx\", \".jsx\", \".mjs\", \".cjs\"];\n for (const ext of extensions) {\n const candidate = filePath + ext;\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n if (existsSync(filePath) && statSync(filePath).isDirectory()) {\n for (const ext of extensions) {\n const candidate = path.join(filePath, \"index\" + ext);\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n }\n return filePath;\n}\n\nexport function fileUrl(file: string): string {\n return pathToFileURL(file).href;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,IAAa,oBAAb,cAAuC,MAAM;CAClC;CAET,YAAY,SAAiB,UAAiC;EAC5D,MAAM,WAAW,GAAG,QAAQ,IAAI,SAAS,KAAK,GAAG,SAAS,KAAK,GAAG,SAAS,OAAO,KAAK,OAAO;EAC9F,KAAK,OAAO;EACZ,KAAK,WAAW;CAClB;AACF;AA2MA,MAAa,oDAAoC,IAAI,IAAI;CACvD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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