@tsrx/content-mapper 0.1.0 → 0.1.2

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":"server.js","names":["resolveExports","bare_package_specifier_pattern","path","createRequire","logError","logWarning","exports","exports","require","createRequire","path","fileURLToPath","fs","require"],"sources":["../../typescript-plugin/src/config-host.js","../../../node_modules/.pnpm/resolve-pkg-maps@1.0.0/node_modules/resolve-pkg-maps/dist/index.mjs","../../typescript-plugin/src/package-resolution.js","../../typescript-plugin/src/jsonc.js","../../typescript-plugin/src/tsconfig-resolution.js","../../typescript-plugin/src/utils.js","../../typescript-plugin/src/consumer-compiler.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/binarySearch.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/translateOffset.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/lib/sourceMap.js","../../../node_modules/.pnpm/@volar+source-map@2.4.28/node_modules/@volar/source-map/index.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/editor.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/linkedCodeMap.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/types.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/lib/utils.js","../../../node_modules/.pnpm/@volar+language-core@2.4.28/node_modules/@volar/language-core/index.js","../../typescript-plugin/src/transform.js","../../typescript-plugin/src/language.js","../src/export-stub.js","../src/protocol.js","../src/span-mappings.js","../src/mapper.js","../src/rpc.js","../src/server.js"],"sourcesContent":["/**\n * The file-system host the TSRX tooling reads `tsconfig.json` files and\n * package manifests through when no TypeScript `sys` is supplied. It covers\n * the subset of `ts.sys` that `tsconfig-resolution.js` and\n * `consumer-compiler.js` use, on `node:fs`, so the native TypeScript 7 path\n * (whose `typescript` package has no JavaScript API) needs no TypeScript at\n * all. `ts.sys` still satisfies the same interface for the classic path.\n */\n\nimport fs from 'node:fs';\nimport { fileURLToPath } from 'node:url';\n\n/**\n * @typedef {object} ConfigHost\n * @property {(file_name: string) => boolean} fileExists\n * @property {(file_name: string) => string | undefined} readFile\n * @property {(directory_name: string) => boolean} [directoryExists]\n * @property {boolean | (() => boolean)} useCaseSensitiveFileNames\n * @property {(file_name: string) => Date | undefined} [getModifiedTime]\n * @property {(path_name: string) => string} [realpath]\n */\n\n/**\n * Whether the file system distinguishes letter case, probed the way\n * TypeScript's `sys` does: this module's own path with its case swapped exists\n * only on a case-insensitive file system.\n * @returns {boolean}\n */\nfunction detect_case_sensitive_file_names() {\n\tconst own_path = fileURLToPath(import.meta.url);\n\tconst swapped = own_path.replace(/[a-zA-Z]/g, (letter) =>\n\t\tletter === letter.toLowerCase() ? letter.toUpperCase() : letter.toLowerCase(),\n\t);\n\tif (swapped === own_path) {\n\t\treturn true;\n\t}\n\treturn !fs.existsSync(swapped);\n}\n\n/** @type {boolean | undefined} */\nlet case_sensitive_file_names;\n\n/** @returns {boolean} */\nexport function use_case_sensitive_file_names() {\n\tcase_sensitive_file_names ??= detect_case_sensitive_file_names();\n\treturn case_sensitive_file_names;\n}\n\n/**\n * @param {string} file_name\n * @returns {fs.Stats | undefined}\n */\nfunction stat(file_name) {\n\ttry {\n\t\treturn fs.statSync(file_name, { throwIfNoEntry: false });\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/** @returns {ConfigHost} */\nexport function create_config_host() {\n\treturn {\n\t\tfileExists: (file_name) => stat(file_name)?.isFile() === true,\n\t\tdirectoryExists: (directory_name) => stat(directory_name)?.isDirectory() === true,\n\t\treadFile: (file_name) => {\n\t\t\ttry {\n\t\t\t\treturn fs.readFileSync(file_name, 'utf8');\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t},\n\t\tuseCaseSensitiveFileNames: use_case_sensitive_file_names,\n\t\tgetModifiedTime: (file_name) => stat(file_name)?.mtime,\n\t\trealpath: (path_name) => {\n\t\t\ttry {\n\t\t\t\treturn fs.realpathSync(path_name);\n\t\t\t} catch {\n\t\t\t\treturn path_name;\n\t\t\t}\n\t\t},\n\t};\n}\n\n/** The shared default host; one instance so per-host caches are reused. */\nexport const NODE_CONFIG_HOST = create_config_host();\n","const A=r=>r!==null&&typeof r==\"object\",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_=\"ERR_INVALID_PACKAGE_CONFIG\",E=\"ERR_INVALID_PACKAGE_TARGET\",I=\"ERR_PACKAGE_PATH_NOT_EXPORTED\",P=\"ERR_PACKAGE_IMPORT_NOT_DEFINED\",R=/^\\d+$/,O=/^(\\.{1,2}|node_modules)$/i,w=/\\/|\\\\/;var h=(r=>(r.Export=\"exports\",r.Import=\"imports\",r))(h||{});const f=(r,t,e,o,c)=>{if(t==null)return[];if(typeof t==\"string\"){const[n,...i]=t.split(w);if(n===\"..\"||i.some(l=>O.test(l)))throw a(E,`Invalid \"${r}\" target \"${t}\" defined in the package config`);return[c?t.replace(/\\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R.test(n))throw a(_,\"Cannot contain numeric property keys\");if(n===\"default\"||o.includes(n))return f(r,t[n],e,o,c)}return[]}throw a(E,`Invalid \"${r}\" target \"${t}\"`)},s=\"*\",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return[t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g)}}return[e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===\"\"||e[0]!==\".\";if(t===void 0||t===o)return o;throw a(_,'\"exports\" cannot contain some keys starting with \".\" and some not')},void 0),u=/^\\w+:/,v=(r,t,e)=>{if(!r)throw new Error('\"exports\" is required');t=t===\"\"?\".\":`./${t}`,(typeof r==\"string\"||Array.isArray(r)||A(r)&&p(r))&&(r={\".\":r});const[o,c]=d(r,t),n=f(h.Export,r[o],t,e,c);if(n.length===0)throw a(I,t===\".\"?'No \"exports\" main defined':`Package subpath '${t}' is not defined by \"exports\"`);for(const i of n)if(!i.startsWith(\"./\")&&!u.test(i))throw a(E,`Invalid \"exports\" target \"${i}\" defined in the package config`);return n},T=(r,t,e)=>{if(!r)throw new Error('\"imports\" is required');const[o,c]=d(r,t),n=f(h.Import,r[o],t,e,c);if(n.length===0)throw a(P,`Package import specifier \"${t}\" is not defined in package`);return n};export{v as resolveExports,T as resolveImports};\n","/**\n * Package lookups without TypeScript's module resolver: the runtime entry of a\n * TSRX compiler package, and the file a `tsconfig.json` `extends` entry names.\n * Both walk `node_modules` directories upwards from a starting directory and\n * read every `package.json` fresh, so they also serve as the retry path when\n * Node's own `require.resolve` keeps a negative lookup after a package is\n * installed.\n */\n\nimport path from 'node:path';\nimport { resolveExports } from 'resolve-pkg-maps';\nimport { NODE_CONFIG_HOST } from './config-host.js';\n\n/** @typedef {import('./config-host.js').ConfigHost} ConfigHost */\n\n/**\n * @typedef {object} ParsedSpecifier\n * @property {string} name `pkg` or `@scope/pkg`.\n * @property {string} subpath The part after the package name, without a leading slash; empty for the package root.\n */\n\n/**\n * @param {string} specifier\n * @returns {ParsedSpecifier | undefined} `undefined` for relative, absolute or empty specifiers.\n */\nexport function parse_bare_specifier(specifier) {\n\tif (specifier === '' || specifier.startsWith('.') || path.isAbsolute(specifier)) {\n\t\treturn undefined;\n\t}\n\tconst segments = specifier.split('/');\n\tconst name_segments = specifier.startsWith('@') ? 2 : 1;\n\tif (segments.length < name_segments || segments.slice(0, name_segments).some((s) => s === '')) {\n\t\treturn undefined;\n\t}\n\treturn {\n\t\tname: segments.slice(0, name_segments).join('/'),\n\t\tsubpath: segments.slice(name_segments).join('/'),\n\t};\n}\n\n/**\n * A directory exists when the host says so, or (for hosts without\n * `directoryExists`) when it holds a `package.json`.\n * @param {ConfigHost} host\n * @param {string} directory_name\n * @returns {boolean}\n */\nfunction is_directory(host, directory_name) {\n\treturn host.directoryExists\n\t\t? host.directoryExists(directory_name)\n\t\t: host.fileExists(path.join(directory_name, 'package.json'));\n}\n\n/**\n * Read a package manifest through the host, never through Node's cached reader.\n * @param {ConfigHost} host\n * @param {string} package_dir\n * @returns {Record<string, unknown> | undefined}\n */\nexport function read_package_manifest(host, package_dir) {\n\tconst text = host.readFile(path.join(package_dir, 'package.json'));\n\tif (text === undefined) {\n\t\treturn undefined;\n\t}\n\ttry {\n\t\tconst parsed = JSON.parse(text);\n\t\treturn parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)\n\t\t\t? parsed\n\t\t\t: undefined;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/**\n * Every `node_modules/<name>` directory that exists on the way up from `from_dir`.\n * @param {ConfigHost} host\n * @param {string} from_dir\n * @param {string} name\n * @returns {string[]}\n */\nexport function package_directories(host, from_dir, name) {\n\t/** @type {string[]} */\n\tconst directories = [];\n\tlet current = path.resolve(from_dir);\n\twhile (true) {\n\t\tif (path.basename(current) !== 'node_modules') {\n\t\t\tconst candidate = path.join(current, 'node_modules', name);\n\t\t\tif (is_directory(host, candidate)) {\n\t\t\t\tdirectories.push(candidate);\n\t\t\t}\n\t\t}\n\t\tconst parent = path.dirname(current);\n\t\tif (parent === current) {\n\t\t\treturn directories;\n\t\t}\n\t\tcurrent = parent;\n\t}\n}\n\n/**\n * Targets of `exports` for a subpath under the given conditions, in order;\n * empty when the package has no `exports` or does not export the subpath.\n * @param {Record<string, unknown> | undefined} manifest\n * @param {string} subpath\n * @param {readonly string[]} conditions\n * @returns {string[]}\n */\nfunction exports_targets(manifest, subpath, conditions) {\n\tconst exports = manifest?.exports;\n\tif (exports === undefined || exports === null) {\n\t\treturn [];\n\t}\n\ttry {\n\t\treturn resolveExports(\n\t\t\t/** @type {import('resolve-pkg-maps').PathConditions} */ (exports),\n\t\t\tsubpath,\n\t\t\tconditions,\n\t\t);\n\t} catch {\n\t\treturn [];\n\t}\n}\n\n/**\n * The file a bare specifier loads at runtime: the package's `exports` (under\n * `conditions`), else its `main`, else `index.js`, with the extension probing\n * Node's CommonJS loader applies; a subpath is resolved the same way.\n * @param {string} specifier\n * @param {string} from_dir\n * @param {{ conditions?: readonly string[], host?: ConfigHost }} [options]\n * @returns {string | undefined}\n */\nexport function resolve_package_entry(specifier, from_dir, options = {}) {\n\tconst parsed = parse_bare_specifier(specifier);\n\tif (!parsed) {\n\t\treturn undefined;\n\t}\n\tconst host = options.host ?? NODE_CONFIG_HOST;\n\tconst conditions = options.conditions ?? ['node', 'require', 'default'];\n\tfor (const package_dir of package_directories(host, from_dir, parsed.name)) {\n\t\tconst manifest = read_package_manifest(host, package_dir);\n\t\tfor (const target of exports_targets(manifest, parsed.subpath, conditions)) {\n\t\t\tconst resolved = path.resolve(package_dir, target);\n\t\t\tif (host.fileExists(resolved)) {\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t}\n\t\tif (manifest?.exports !== undefined && manifest.exports !== null) {\n\t\t\t// `exports` is authoritative: nothing else in the package is reachable.\n\t\t\tcontinue;\n\t\t}\n\t\tconst main = typeof manifest?.main === 'string' ? manifest.main : undefined;\n\t\tconst targets =\n\t\t\tparsed.subpath !== '' ? [parsed.subpath] : main !== undefined ? [main, 'index'] : ['index'];\n\t\tfor (const target of targets) {\n\t\t\tconst base = path.resolve(package_dir, target);\n\t\t\tfor (const candidate of [\n\t\t\t\tbase,\n\t\t\t\t`${base}.js`,\n\t\t\t\t`${base}.cjs`,\n\t\t\t\t`${base}.mjs`,\n\t\t\t\t`${base}.json`,\n\t\t\t\tpath.join(base, 'index.js'),\n\t\t\t]) {\n\t\t\t\tif (host.fileExists(candidate)) {\n\t\t\t\t\treturn candidate;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * The config a package directory stands for: its `package.json` `tsconfig`\n * field (with `.json` appended when the file is missing without it, as\n * TypeScript's file loader does) or its `tsconfig.json`.\n * @param {ConfigHost} host\n * @param {string} directory\n * @param {Record<string, unknown> | undefined} manifest\n * @returns {string | undefined}\n */\nfunction tsconfig_field_target(host, directory, manifest) {\n\tconst field = typeof manifest?.tsconfig === 'string' ? manifest.tsconfig : 'tsconfig.json';\n\tlet resolved = path.resolve(directory, field);\n\tif (!host.fileExists(resolved) && !resolved.endsWith('.json')) {\n\t\tresolved = `${resolved}.json`;\n\t}\n\treturn host.fileExists(resolved) ? resolved : undefined;\n}\n\n/**\n * The JSON file a `tsconfig.json` `extends` entry names. The rules and their\n * order are those of get-tsconfig's `resolveExtendsPath` (MIT, privatenumber),\n * which are tested against `tsc`:\n *\n * 1. `..` means `../tsconfig.json`; an entry starting with `.` is relative to\n * the config's directory; an absolute path is used as is. A missing path\n * without a `.json` extension gets one appended.\n * 2. Otherwise the entry names a package (`name` or `@scope/name`, plus an\n * optional subpath) found by walking `node_modules` upwards. A package with\n * `exports` is resolved only through them (conditions `require`, `types`);\n * an unexported subpath is a hard stop. Without `exports`, the package\n * root's `tsconfig` field or its `tsconfig.json` is used; a subpath is tried\n * with `.json` appended, as a `.json` file, then as a directory whose\n * `package.json` `tsconfig` field or `tsconfig.json` is the target.\n *\n * @param {string} extends_value\n * @param {string} config_dir\n * @param {ConfigHost} [host]\n * @returns {{ path: string, candidate?: string } | { path?: undefined, candidate?: string }}\n * `path` when found; `candidate` is the location TypeScript would have read\n * for a path entry, whether or not it exists (so a watcher can wait for it).\n */\nexport function resolve_extends_target(extends_value, config_dir, host = NODE_CONFIG_HOST) {\n\tlet file_path = extends_value === '..' ? path.join('..', 'tsconfig.json') : extends_value;\n\tif (file_path.startsWith('.')) {\n\t\tfile_path = path.resolve(config_dir, file_path);\n\t}\n\tif (path.isAbsolute(file_path)) {\n\t\tif (host.fileExists(file_path)) {\n\t\t\treturn { path: file_path, candidate: file_path };\n\t\t}\n\t\t// Like TypeScript, append `.json` whenever the path is not a file, even\n\t\t// when a directory of that name exists next to the JSON file.\n\t\tconst candidate = file_path.endsWith('.json') ? file_path : `${file_path}.json`;\n\t\treturn host.fileExists(candidate) ? { path: candidate, candidate } : { candidate };\n\t}\n\tconst parsed = parse_bare_specifier(extends_value);\n\tif (!parsed) {\n\t\treturn {};\n\t}\n\tfor (const found_dir of package_directories(host, config_dir, parsed.name)) {\n\t\tconst package_dir = host.realpath ? host.realpath(found_dir) : found_dir;\n\t\tconst manifest = read_package_manifest(host, package_dir);\n\t\tif (manifest?.exports !== undefined && manifest.exports !== null) {\n\t\t\tconst [target] = exports_targets(manifest, parsed.subpath, ['require', 'types']);\n\t\t\tif (target === undefined) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst resolved = path.resolve(package_dir, target);\n\t\t\treturn host.fileExists(resolved) ? { path: resolved } : {};\n\t\t}\n\t\tif (parsed.subpath === '') {\n\t\t\tconst resolved = tsconfig_field_target(host, package_dir, manifest);\n\t\t\tif (resolved !== undefined) {\n\t\t\t\treturn { path: resolved };\n\t\t\t}\n\t\t}\n\t\tconst full_path = path.join(package_dir, parsed.subpath);\n\t\tif (!full_path.endsWith('.json') && host.fileExists(`${full_path}.json`)) {\n\t\t\treturn { path: `${full_path}.json` };\n\t\t}\n\t\tif (is_directory(host, full_path)) {\n\t\t\tconst resolved = tsconfig_field_target(\n\t\t\t\thost,\n\t\t\t\tfull_path,\n\t\t\t\tread_package_manifest(host, full_path),\n\t\t\t);\n\t\t\tif (resolved !== undefined) {\n\t\t\t\treturn { path: resolved };\n\t\t\t}\n\t\t} else if (full_path.endsWith('.json') && host.fileExists(full_path)) {\n\t\t\treturn { path: full_path };\n\t\t}\n\t}\n\treturn {};\n}\n","/**\n * A JSON-with-comments reader for `tsconfig.json` and package manifests:\n * comments and trailing commas are allowed, as TypeScript allows them. The\n * parsing is Microsoft's `jsonc-parser` (the same scanner VS Code and\n * get-tsconfig use), so what parses here parses there.\n */\n\n// The ESM build: the package's UMD `main` requires its `./impl/*` files at run\n// time, which the bundles of the mapper, the language server and the VS Code\n// extension cannot follow (the package has no `exports` map, so the path is\n// public).\n// A runtime dependency of every package that bundles this module (the mapper,\n// the language server, the VS Code extension): its UMD entry requires its\n// `./impl/*` files at run time, which a bundle cannot follow.\nimport { parse, printParseErrorCode } from 'jsonc-parser';\n\n/**\n * @typedef {object} JsoncParseResult\n * @property {unknown} value `undefined` when the text does not parse.\n * @property {{ message: string, offset: number }} [error] The first parse error.\n */\n\n/**\n * @param {string} text\n * @returns {JsoncParseResult}\n */\nexport function parse_jsonc(text) {\n\tconst source = text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;\n\tif (source.trim() === '') {\n\t\t// An empty config file is an empty object, as for TypeScript.\n\t\treturn { value: {} };\n\t}\n\t/** @type {import('jsonc-parser').ParseError[]} */\n\tconst errors = [];\n\tconst value = parse(source, errors, { allowTrailingComma: true, disallowComments: false });\n\tif (errors.length > 0) {\n\t\tconst [first] = errors;\n\t\treturn {\n\t\t\tvalue: undefined,\n\t\t\terror: {\n\t\t\t\tmessage: `${printParseErrorCode(first.error)} at offset ${first.offset}`,\n\t\t\t\toffset: first.offset,\n\t\t\t},\n\t\t};\n\t}\n\treturn { value };\n}\n","import path from 'node:path';\nimport { parse_jsonc } from './jsonc.js';\nimport { resolve_extends_target } from './package-resolution.js';\n\n/**\n * What the tooling needs from a file system to read tsconfig files: the\n * subset of TypeScript's `sys` that `config-host.js` also provides on\n * `node:fs`, so no TypeScript is needed to resolve a config chain.\n * @typedef {object} TsconfigHost\n * @property {(file_name: string) => boolean} fileExists\n * @property {(file_name: string) => string | undefined} readFile\n * @property {boolean | (() => boolean)} useCaseSensitiveFileNames\n * @property {(file_name: string) => Date | undefined} [getModifiedTime]\n */\n\n/**\n * A problem reading or resolving a config file. `code` follows TypeScript's\n * numbering for the cases it has one for (5024 invalid `extends` entry,\n * 6053 file not found, 18000 circular `extends`), so callers that filter on\n * codes keep working on both paths.\n * @typedef {object} TsconfigDiagnostic\n * @property {number} code\n * @property {string} message\n * @property {string} [file] The config file the problem is in.\n */\n\n/**\n * @typedef {object} TsconfigLayer\n * @property {string} path\n * @property {string} dir\n * @property {Record<string, unknown>} config\n * @property {string | undefined} raw_source\n * @property {TsconfigDiagnostic[]} parse_diagnostics\n */\n\n/** @typedef {TsconfigLayer & { extends_values: unknown[] }} ParsedTsconfigLayer */\n\n/**\n * @typedef {object} TsconfigExtendsFailure\n * @property {string} config_path\n * @property {unknown} extends_value\n * @property {string | undefined} resolved_path\n * @property {TsconfigDiagnostic[]} diagnostics\n */\n\n/**\n * @typedef {object} ResolvedTsconfigLayers\n * @property {TsconfigLayer[]} layers\n * @property {string[]} dependencies\n * @property {TsconfigDiagnostic[]} diagnostics\n * @property {TsconfigExtendsFailure[]} extends_failures\n */\n\n/**\n * @template TValue\n * @typedef {{state: 'absent'} | {state: 'found', value: TValue}} ConfigValueResult\n */\n\n/** @typedef {{config_path: string, config_dir: string}} TsconfigValueOrigin */\n\nexport const INVALID_EXTENDS_DIAGNOSTIC_CODE = 5024;\nexport const FILE_NOT_FOUND_DIAGNOSTIC_CODE = 6053;\nexport const CIRCULARITY_DIAGNOSTIC_CODE = 18000;\nconst PARSE_ERROR_DIAGNOSTIC_CODE = 1005;\n\n/**\n * Load a tsconfig and its explicit inheritance graph from lowest to highest\n * precedence. Parsed files are cached, but traversal intentionally does not\n * deduplicate layers because a shared base must be reapplied in every branch.\n * `extends` entries follow TypeScript's rules (see `resolve_extends_target`).\n *\n * @param {TsconfigHost} host\n * @param {string} config_file_name\n * @returns {ResolvedTsconfigLayers}\n */\nexport function load_tsconfig_layers(host, config_file_name) {\n\t/** @type {Map<string, ParsedTsconfigLayer>} */\n\tconst parsed_file_cache = new Map();\n\t/** @type {TsconfigLayer[]} */\n\tconst layers = [];\n\t/** @type {string[]} */\n\tconst dependencies = [];\n\tconst dependency_keys = new Set();\n\t/** @type {TsconfigDiagnostic[]} */\n\tconst diagnostics = [];\n\t/** @type {TsconfigExtendsFailure[]} */\n\tconst extends_failures = [];\n\tconst diagnostic_keys = new Set();\n\t/** The chain of configs being visited, root first, for cycle reporting. */\n\t/** @type {string[]} */\n\tconst active_stack = [];\n\tconst active_keys = new Set();\n\tconst use_case_sensitive_file_names =\n\t\ttypeof host.useCaseSensitiveFileNames === 'function'\n\t\t\t? host.useCaseSensitiveFileNames()\n\t\t\t: host.useCaseSensitiveFileNames;\n\n\t/** @param {string} file_name */\n\tfunction normalize_path(file_name) {\n\t\treturn path.normalize(path.resolve(file_name));\n\t}\n\n\t/** @param {string} file_name */\n\tfunction get_path_key(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\treturn use_case_sensitive_file_names ? normalized_path : normalized_path.toLowerCase();\n\t}\n\n\t/** @param {TsconfigDiagnostic[]} next_diagnostics */\n\tfunction add_diagnostics(next_diagnostics) {\n\t\tfor (const diagnostic of next_diagnostics) {\n\t\t\tconst key = `${diagnostic.code}\\0${diagnostic.file ?? ''}\\0${diagnostic.message}`;\n\t\t\tif (!diagnostic_keys.has(key)) {\n\t\t\t\tdiagnostic_keys.add(key);\n\t\t\t\tdiagnostics.push(diagnostic);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** @param {string} file_name */\n\tfunction add_dependency(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\tconst key = get_path_key(normalized_path);\n\t\tif (!dependency_keys.has(key)) {\n\t\t\tdependency_keys.add(key);\n\t\t\tdependencies.push(normalized_path);\n\t\t}\n\t}\n\n\t/** @param {string} file_name */\n\tfunction parse_file(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\tconst key = get_path_key(normalized_path);\n\t\tconst cached = parsed_file_cache.get(key);\n\t\tif (cached) {\n\t\t\treturn cached;\n\t\t}\n\n\t\tconst raw_source = host.readFile(normalized_path);\n\t\t/** @type {TsconfigDiagnostic[]} */\n\t\tconst parse_diagnostics = [];\n\t\t/** @type {Record<string, unknown>} */\n\t\tlet config = {};\n\t\tif (raw_source !== undefined) {\n\t\t\tconst parsed = parse_jsonc(raw_source);\n\t\t\tif (parsed.error) {\n\t\t\t\tparse_diagnostics.push({\n\t\t\t\t\tcode: PARSE_ERROR_DIAGNOSTIC_CODE,\n\t\t\t\t\tmessage: `Failed to parse ${normalized_path}: ${parsed.error.message}`,\n\t\t\t\t\tfile: normalized_path,\n\t\t\t\t});\n\t\t\t} else if (\n\t\t\t\tparsed.value !== null &&\n\t\t\t\ttypeof parsed.value === 'object' &&\n\t\t\t\t!Array.isArray(parsed.value)\n\t\t\t) {\n\t\t\t\tconfig = /** @type {Record<string, unknown>} */ (parsed.value);\n\t\t\t} else {\n\t\t\t\tparse_diagnostics.push({\n\t\t\t\t\tcode: PARSE_ERROR_DIAGNOSTIC_CODE,\n\t\t\t\t\tmessage: `The root value of ${normalized_path} must be an object.`,\n\t\t\t\t\tfile: normalized_path,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst extends_value = config.extends;\n\t\tconst extends_values = Array.isArray(extends_value)\n\t\t\t? extends_value\n\t\t\t: extends_value !== undefined\n\t\t\t\t? [extends_value]\n\t\t\t\t: [];\n\t\tconst parsed = {\n\t\t\tpath: normalized_path,\n\t\t\tdir: path.dirname(normalized_path),\n\t\t\tconfig,\n\t\t\traw_source,\n\t\t\tparse_diagnostics,\n\t\t\textends_values,\n\t\t};\n\t\tparsed_file_cache.set(key, parsed);\n\t\tadd_diagnostics(parse_diagnostics);\n\t\treturn parsed;\n\t}\n\n\t/**\n\t * Resolve one immediate extends entry. The conventional JSON candidate of an\n\t * unresolved relative entry is still recorded as a dependency so creating it\n\t * later invalidates caches and language-server projects.\n\t * @param {ParsedTsconfigLayer} parsed\n\t * @param {unknown} extends_value\n\t */\n\tfunction resolve_extends_path(parsed, extends_value) {\n\t\tif (typeof extends_value !== 'string') {\n\t\t\tconst diagnostic = {\n\t\t\t\tcode: INVALID_EXTENDS_DIAGNOSTIC_CODE,\n\t\t\t\tmessage: `Compiler option 'extends' requires a value of type string.`,\n\t\t\t\tfile: parsed.path,\n\t\t\t};\n\t\t\tadd_diagnostics([diagnostic]);\n\t\t\textends_failures.push({\n\t\t\t\tconfig_path: parsed.path,\n\t\t\t\textends_value,\n\t\t\t\tresolved_path: undefined,\n\t\t\t\tdiagnostics: [diagnostic],\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\t\tconst target = resolve_extends_target(extends_value, parsed.dir, host);\n\t\tconst dependency_path = target.path ?? target.candidate;\n\t\tif (dependency_path !== undefined) {\n\t\t\tadd_dependency(dependency_path);\n\t\t}\n\t\tif (target.path === undefined) {\n\t\t\tconst diagnostic = {\n\t\t\t\tcode: FILE_NOT_FOUND_DIAGNOSTIC_CODE,\n\t\t\t\tmessage: `File '${target.candidate ?? extends_value}' not found.`,\n\t\t\t\tfile: parsed.path,\n\t\t\t};\n\t\t\tadd_diagnostics([diagnostic]);\n\t\t\textends_failures.push({\n\t\t\t\tconfig_path: parsed.path,\n\t\t\t\textends_value,\n\t\t\t\tresolved_path: dependency_path,\n\t\t\t\tdiagnostics: [diagnostic],\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\t\tif (active_keys.has(get_path_key(target.path))) {\n\t\t\tconst chain = [...active_stack, normalize_path(target.path)];\n\t\t\tconst diagnostic = {\n\t\t\t\tcode: CIRCULARITY_DIAGNOSTIC_CODE,\n\t\t\t\tmessage: `Circularity detected while resolving configuration: ${chain.join(' -> ')}`,\n\t\t\t\tfile: parsed.path,\n\t\t\t};\n\t\t\tadd_diagnostics([diagnostic]);\n\t\t\textends_failures.push({\n\t\t\t\tconfig_path: parsed.path,\n\t\t\t\textends_value,\n\t\t\t\tresolved_path: dependency_path,\n\t\t\t\tdiagnostics: [diagnostic],\n\t\t\t});\n\t\t\treturn undefined;\n\t\t}\n\t\treturn target.path;\n\t}\n\n\t/** @param {string} file_name */\n\tfunction visit(file_name) {\n\t\tconst normalized_path = normalize_path(file_name);\n\t\tconst key = get_path_key(normalized_path);\n\t\tactive_keys.add(key);\n\t\tactive_stack.push(normalized_path);\n\t\tadd_dependency(normalized_path);\n\t\tconst parsed = parse_file(normalized_path);\n\t\tfor (const extends_value of parsed.extends_values) {\n\t\t\tconst extended_path = resolve_extends_path(parsed, extends_value);\n\t\t\tif (extended_path !== undefined) {\n\t\t\t\tvisit(extended_path);\n\t\t\t}\n\t\t}\n\t\tlayers.push({\n\t\t\tpath: parsed.path,\n\t\t\tdir: parsed.dir,\n\t\t\tconfig: parsed.config,\n\t\t\traw_source: parsed.raw_source,\n\t\t\tparse_diagnostics: parsed.parse_diagnostics,\n\t\t});\n\t\tactive_stack.pop();\n\t\tactive_keys.delete(key);\n\t}\n\n\tvisit(config_file_name);\n\treturn { layers, dependencies, diagnostics, extends_failures };\n}\n\n/**\n * Read a nested config value only when every segment is an own property.\n *\n * @param {unknown} config\n * @param {readonly PropertyKey[]} path_parts\n * @returns {ConfigValueResult<unknown>}\n */\nexport function get_own_config_value(config, path_parts) {\n\tlet current = config;\n\tfor (const path_part of path_parts) {\n\t\tif (\n\t\t\tcurrent === null ||\n\t\t\t(typeof current !== 'object' && typeof current !== 'function') ||\n\t\t\t!Object.prototype.hasOwnProperty.call(current, path_part)\n\t\t) {\n\t\t\treturn { state: 'absent' };\n\t\t}\n\t\tcurrent = /** @type {Record<PropertyKey, unknown>} */ (current)[path_part];\n\t}\n\treturn { state: 'found', value: current };\n}\n\n/**\n * Resolve a caller-defined value across layers. The last result whose state is\n * not absent wins and is annotated with the config that declared it.\n *\n * @template {{state: string}} TResult\n * @param {readonly TsconfigLayer[]} layers\n * @param {(layer: TsconfigLayer) => TResult} read_layer\n * @returns {{state: 'absent'} | (TResult & TsconfigValueOrigin)}\n */\nexport function resolve_inherited_config_value(layers, read_layer) {\n\t/** @type {{state: 'absent'} | (TResult & TsconfigValueOrigin)} */\n\tlet resolved = { state: 'absent' };\n\tfor (const layer of layers) {\n\t\tconst value = read_layer(layer);\n\t\tif (value.state !== 'absent') {\n\t\t\tresolved = {\n\t\t\t\t...value,\n\t\t\t\tconfig_path: layer.path,\n\t\t\t\tconfig_dir: layer.dir,\n\t\t\t};\n\t\t}\n\t}\n\treturn resolved;\n}\n","export const DEBUG = process.env.TSRX_DEBUG === 'true';\n// Matches valid JS/CSS identifier characters: word chars, dashes (CSS), $, and # (TSRX shorthands)\nexport const charAllowedWordRegex = /[\\w\\-$#]/;\n\n/**\n * Create a logging utility with a specific label\n * @param {string} label\n * @returns {{\n * \tlog: (...args: unknown[]) => void,\n * \tlogError: (...args: unknown[]) => void,\n * \tlogWarning: (...args: unknown[]) => void,\n * }}\n */\nexport function createLogging(label) {\n\treturn {\n\t\tlog(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogError(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.error(label, ...args);\n\t\t\t}\n\t\t},\n\t\tlogWarning(...args) {\n\t\t\tif (DEBUG) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t}\n\t\t},\n\t};\n}\n\n/**\n * Get the word at a specific position in the text\n * @param {string} text\n * @param {number} start\n * @returns {{word: string, start: number, end: number}}\n */\nexport function getWordFromPosition(text, start) {\n\tlet wordStart = start;\n\tlet wordEnd = start;\n\twhile (wordStart > 0 && charAllowedWordRegex.test(text[wordStart - 1])) {\n\t\twordStart--;\n\t}\n\twhile (wordEnd < text.length && charAllowedWordRegex.test(text[wordEnd])) {\n\t\twordEnd++;\n\t}\n\n\tconst word = text.substring(wordStart, wordEnd);\n\n\treturn {\n\t\tword,\n\t\tstart: wordStart,\n\t\tend: wordEnd,\n\t};\n}\n","/** @typedef {{actual_type: string, actual_value: string}} InvalidConfigValueDetails */\n/** @typedef {'web' | 'ios' | 'android'} Platform */\n/**\n * @typedef {\n * \t| {state: 'absent'}\n * \t| {state: 'declared', value: string}\n * \t| ({state: 'invalid', target: 'tsrx' | 'compiler'} & InvalidConfigValueDetails)\n * } CompilerDeclaration\n */\n\n/**\n * @typedef {\n * \t| {state: 'absent'}\n * \t| {state: 'declared', value: Platform}\n * \t| ({state: 'invalid', target: 'tsrx' | 'platform'} & InvalidConfigValueDetails)\n * } PlatformDeclaration\n */\n\n/**\n * @typedef {object} CompilerResolutionOptions\n * @property {typeof import('typescript')} [ts] Accepted for the classic callers; config resolution no longer uses it.\n * @property {string} [configFileName]\n * @property {import('./tsconfig-resolution.js').TsconfigHost} [configHost]\n * @property {Set<string>} [dependencies]\n * @property {boolean} [requirePlatformResolution]\n */\n\n/**\n * @typedef {object} ConfigHostResolutionCache\n * @property {Map<string, string | null>} nearest_config_paths\n * @property {Map<string, CachedTsconfigLayers>} resolved_config_layers\n */\n\n/**\n * @typedef {object} CachedTsconfigLayers\n * @property {import('./tsconfig-resolution.js').ResolvedTsconfigLayers} value\n * @property {Map<string, number | undefined> | undefined} dependency_modified_times\n */\n\nimport { createRequire } from 'module';\nimport path from 'path';\nimport { NODE_CONFIG_HOST } from './config-host.js';\nimport { resolve_package_entry } from './package-resolution.js';\nimport {\n\tget_own_config_value,\n\tload_tsconfig_layers,\n\tresolve_inherited_config_value,\n} from './tsconfig-resolution.js';\nimport { createLogging } from './utils.js';\n\nconst { log, logError, logWarning } = createLogging('[TSRX Language]');\n// npm scope/package names stay lowercase-strict; case-sensitive export subpaths may use capitals.\nconst bare_package_specifier_pattern =\n\t/^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._~-]*)*$/;\nconst tsrx_key_pattern = /[\"']tsrx[\"']\\s*:/;\n/** @type {WeakMap<object, ConfigHostResolutionCache>} */\nlet config_host_to_resolution_cache = new WeakMap();\n/** @type {Map<string, string | null>} */\nconst declared_compiler_path_map = new Map();\n\n/**\n * @param {unknown} value\n * @returns {{ actual_type: string, actual_value: string }}\n */\nfunction describe_config_value(value) {\n\tconst actual_type = value === null ? 'null' : Array.isArray(value) ? 'array' : typeof value;\n\treturn {\n\t\tactual_type,\n\t\tactual_value: JSON.stringify(value) ?? String(value),\n\t};\n}\n\n/**\n * Keep filesystem-derived config caches isolated per TypeScript/Volar host.\n * Different hosts can expose different snapshots for the same absolute path.\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n */\nfunction get_config_host_cache(host) {\n\tlet cache = config_host_to_resolution_cache.get(host);\n\tif (!cache) {\n\t\tcache = {\n\t\t\tnearest_config_paths: new Map(),\n\t\t\tresolved_config_layers: new Map(),\n\t\t};\n\t\tconfig_host_to_resolution_cache.set(host, cache);\n\t}\n\treturn cache;\n}\n\n/**\n * @param {string} file_name\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n */\nfunction get_config_cache_key(file_name, host) {\n\tconst normalized_path = path.normalize(path.resolve(file_name));\n\tconst use_case_sensitive_file_names =\n\t\ttypeof host.useCaseSensitiveFileNames === 'function'\n\t\t\t? host.useCaseSensitiveFileNames()\n\t\t\t: host.useCaseSensitiveFileNames;\n\treturn use_case_sensitive_file_names ? normalized_path : normalized_path.toLowerCase();\n}\n\n/**\n * @param {unknown} config\n * @returns {CompilerDeclaration}\n */\nfunction get_compiler_declaration(config) {\n\tconst tsrx_result = get_own_config_value(config, ['tsrx']);\n\tif (tsrx_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst tsrx_value = tsrx_result.value;\n\tif (tsrx_value === null || typeof tsrx_value !== 'object' || Array.isArray(tsrx_value)) {\n\t\treturn { state: 'invalid', target: 'tsrx', ...describe_config_value(tsrx_value) };\n\t}\n\tconst compiler_result = get_own_config_value(tsrx_value, ['compiler']);\n\tif (compiler_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst compiler = compiler_result.value;\n\tif (typeof compiler === 'string' && compiler.trim() !== '') {\n\t\treturn { state: 'declared', value: compiler.trim() };\n\t}\n\treturn { state: 'invalid', target: 'compiler', ...describe_config_value(compiler) };\n}\n\n/**\n * @param {unknown} config\n * @returns {PlatformDeclaration}\n */\nfunction get_platform_declaration(config) {\n\tconst tsrx_result = get_own_config_value(config, ['tsrx']);\n\tif (tsrx_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst tsrx_value = tsrx_result.value;\n\tif (tsrx_value === null || typeof tsrx_value !== 'object' || Array.isArray(tsrx_value)) {\n\t\treturn { state: 'invalid', target: 'tsrx', ...describe_config_value(tsrx_value) };\n\t}\n\tconst platform_result = get_own_config_value(tsrx_value, ['platform']);\n\tif (platform_result.state === 'absent') {\n\t\treturn { state: 'absent' };\n\t}\n\n\tconst platform = platform_result.value;\n\tif (platform === 'web' || platform === 'ios' || platform === 'android') {\n\t\treturn { state: 'declared', value: platform };\n\t}\n\treturn { state: 'invalid', target: 'platform', ...describe_config_value(platform) };\n}\n\n/**\n * Find the nearest tsconfig.json to use as the root of inheritance resolution.\n * @param {string} start_dir\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {ConfigHostResolutionCache} cache\n * @returns {string | null}\n */\nfunction get_nearest_root_tsconfig(start_dir, host, cache) {\n\tlet current_dir = start_dir;\n\t/** @type {string[]} */\n\tconst visited_dir_keys = [];\n\n\twhile (current_dir) {\n\t\tconst current_dir_key = get_config_cache_key(current_dir, host);\n\t\tif (cache.nearest_config_paths.has(current_dir_key)) {\n\t\t\tconst cached_tsconfig = cache.nearest_config_paths.get(current_dir_key) ?? null;\n\t\t\tfor (const visited_dir_key of visited_dir_keys) {\n\t\t\t\tcache.nearest_config_paths.set(visited_dir_key, cached_tsconfig);\n\t\t\t}\n\t\t\treturn cached_tsconfig;\n\t\t}\n\n\t\tvisited_dir_keys.push(current_dir_key);\n\t\tconst tsconfig_path = path.join(current_dir, 'tsconfig.json');\n\t\tif (host.fileExists(tsconfig_path)) {\n\t\t\tfor (const visited_dir_key of visited_dir_keys) {\n\t\t\t\tcache.nearest_config_paths.set(visited_dir_key, tsconfig_path);\n\t\t\t}\n\t\t\treturn tsconfig_path;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\tfor (const visited_dir_key of visited_dir_keys) {\n\t\tcache.nearest_config_paths.set(visited_dir_key, null);\n\t}\n\treturn null;\n}\n\n/**\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {string} root_config_path\n * @param {ConfigHostResolutionCache} cache\n */\nfunction get_tsconfig_layers(host, root_config_path, cache) {\n\tconst cache_key = get_config_cache_key(root_config_path, host);\n\tconst cached = cache.resolved_config_layers.get(cache_key);\n\tif (\n\t\tcached &&\n\t\t(cached.dependency_modified_times === undefined ||\n\t\t\t[...cached.dependency_modified_times].every(\n\t\t\t\t([dependency, modified_time]) =>\n\t\t\t\t\thost.getModifiedTime?.(dependency)?.valueOf() === modified_time,\n\t\t\t))\n\t) {\n\t\treturn cached.value;\n\t}\n\tconst value = load_tsconfig_layers(host, root_config_path);\n\tconst dependency_modified_times = host.getModifiedTime\n\t\t? new Map(\n\t\t\t\tvalue.dependencies.map((dependency) => [\n\t\t\t\t\tdependency,\n\t\t\t\t\thost.getModifiedTime?.(dependency)?.valueOf(),\n\t\t\t\t]),\n\t\t\t)\n\t\t: undefined;\n\tcache.resolved_config_layers.set(cache_key, { value, dependency_modified_times });\n\treturn value;\n}\n\n/**\n * A declaration in the config that owns a failed extends entry, or in a child\n * config above it, has higher precedence than anything the missing base could\n * have declared and therefore makes that failure irrelevant to this value.\n * @param {readonly import('./tsconfig-resolution.js').TsconfigLayer[]} layers\n * @param {import('./tsconfig-resolution.js').TsconfigExtendsFailure} failure\n * @param {string} declaration_config_path\n */\nfunction is_extends_failure_overridden(layers, failure, declaration_config_path) {\n\tconst failure_owner_index = layers.findLastIndex((layer) => layer.path === failure.config_path);\n\tconst declaration_index = layers.findLastIndex((layer) => layer.path === declaration_config_path);\n\treturn failure_owner_index >= 0 && declaration_index >= failure_owner_index;\n}\n\n/**\n * Resolve without a module-resolution cache. This is the recovery path when\n * Node retains a negative package lookup after a dependency is installed: the\n * package walk reads every manifest fresh and resolves the runtime entry.\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {string} config_path\n * @param {string} specifier\n */\nfunction resolve_uncached_declared_compiler(host, config_path, specifier) {\n\treturn resolve_package_entry(specifier, path.dirname(config_path), { host });\n}\n\n/**\n * Resolve the compiler explicitly selected by a consumer tsconfig. Invalid\n * specifiers are stable and cached, while missing packages are retried so\n * tsserver can recover after the dependency is installed.\n * @param {import('./tsconfig-resolution.js').TsconfigHost} host\n * @param {string} config_path\n * @param {string} specifier\n * @returns {string | null}\n */\nfunction resolve_declared_compiler(host, config_path, specifier) {\n\tconst cache_key = `${config_path}\\0${specifier}`;\n\tif (declared_compiler_path_map.has(cache_key)) {\n\t\treturn declared_compiler_path_map.get(cache_key) ?? null;\n\t}\n\n\tif (!bare_package_specifier_pattern.test(specifier)) {\n\t\tdeclared_compiler_path_map.set(cache_key, null);\n\t\tlogError(\n\t\t\t'Declared TSRX compiler must be a bare package specifier:',\n\t\t\tspecifier,\n\t\t\t`in ${config_path}`,\n\t\t);\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst tsconfig_require = createRequire(config_path);\n\t\tconst compiler_path = tsconfig_require.resolve(specifier);\n\t\tdeclared_compiler_path_map.set(cache_key, compiler_path);\n\t\tlog('Found declared tsrx compiler at:', compiler_path, 'from tsconfig:', config_path);\n\t\treturn compiler_path;\n\t} catch {\n\t\tconst compiler_path = resolve_uncached_declared_compiler(host, config_path, specifier);\n\t\tif (compiler_path !== undefined) {\n\t\t\tdeclared_compiler_path_map.set(cache_key, compiler_path);\n\t\t\tlog(\n\t\t\t\t'Found declared tsrx compiler after uncached retry at:',\n\t\t\t\tcompiler_path,\n\t\t\t\t'from tsconfig:',\n\t\t\t\tconfig_path,\n\t\t\t);\n\t\t\treturn compiler_path;\n\t\t}\n\t\tlogError(`Unable to resolve declared TSRX compiler \"${specifier}\" from tsconfig`, config_path);\n\t\treturn null;\n\t}\n}\n\n/**\n * Return undefined when there is no consumer declaration, null for a declared\n * hard stop, or the resolved compiler path for a valid declaration.\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | null | undefined}\n */\nexport function resolve_consumer_compiler_for_file(normalized_file_name, options = {}) {\n\tconst config_host = options.configHost ?? NODE_CONFIG_HOST;\n\tconst host_cache = get_config_host_cache(config_host);\n\tconst root_config_path =\n\t\toptions.configFileName ??\n\t\tget_nearest_root_tsconfig(path.dirname(normalized_file_name), config_host, host_cache);\n\tif (root_config_path === null) {\n\t\treturn undefined;\n\t}\n\tconst resolved_layers = get_tsconfig_layers(config_host, root_config_path, host_cache);\n\tfor (const dependency of resolved_layers.dependencies) {\n\t\toptions.dependencies?.add(dependency);\n\t}\n\tconst unreadable_layers = resolved_layers.layers.filter(\n\t\t(layer) => layer.raw_source === undefined,\n\t);\n\tif (unreadable_layers.length > 0) {\n\t\tfor (const layer of unreadable_layers) {\n\t\t\tlogError('Unable to read tsconfig layer:', layer.path);\n\t\t}\n\t\treturn null;\n\t}\n\tconst malformed_layers = resolved_layers.layers.filter(\n\t\t(layer) => layer.parse_diagnostics.length > 0,\n\t);\n\tif (malformed_layers.length > 0) {\n\t\tconst has_tsrx_intent = resolved_layers.layers.some((layer) => {\n\t\t\tif (get_own_config_value(layer.config, ['tsrx']).state === 'found') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (layer.parse_diagnostics.length === 0 || layer.raw_source === undefined) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// A comment can cause a false positive and hard stop; that fails safe when\n\t\t\t// an unparseable layer may have declared a compiler.\n\t\t\treturn tsrx_key_pattern.test(layer.raw_source);\n\t\t});\n\t\tconst log_parse_error = has_tsrx_intent ? logError : logWarning;\n\t\tfor (const layer of malformed_layers) {\n\t\t\tfor (const diagnostic of layer.parse_diagnostics) {\n\t\t\t\tlog_parse_error('Unable to parse tsconfig layer:', layer.path, diagnostic.message);\n\t\t\t}\n\t\t}\n\t\treturn has_tsrx_intent ? null : undefined;\n\t}\n\tconst declaration = resolve_inherited_config_value(resolved_layers.layers, (layer) =>\n\t\tget_compiler_declaration(layer.config),\n\t);\n\tif (declaration.state === 'invalid') {\n\t\tlogError(\n\t\t\t`Invalid TSRX ${declaration.target} declaration:`,\n\t\t\tdeclaration.actual_type,\n\t\t\tdeclaration.actual_value,\n\t\t\t`in ${declaration.config_path}`,\n\t\t);\n\t\treturn null;\n\t}\n\tconst effective_extends_failures = resolved_layers.extends_failures.filter(\n\t\t(failure) =>\n\t\t\tdeclaration.state !== 'declared' ||\n\t\t\t!is_extends_failure_overridden(resolved_layers.layers, failure, declaration.config_path),\n\t);\n\tif (effective_extends_failures.length > 0) {\n\t\tfor (const failure of effective_extends_failures) {\n\t\t\tif (failure.diagnostics.length === 0) {\n\t\t\t\tlogError(\n\t\t\t\t\t'Unable to resolve tsconfig extends entry:',\n\t\t\t\t\tJSON.stringify(failure.extends_value),\n\t\t\t\t\t`in ${failure.config_path}`,\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor (const diagnostic of failure.diagnostics) {\n\t\t\t\tlogError(\n\t\t\t\t\t'Unable to resolve tsconfig extends entry:',\n\t\t\t\t\tJSON.stringify(failure.extends_value),\n\t\t\t\t\t`in ${failure.config_path}`,\n\t\t\t\t\tdiagnostic.message,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\tif (declaration.state === 'declared') {\n\t\treturn resolve_declared_compiler(config_host, declaration.config_path, declaration.value);\n\t}\n\treturn undefined;\n}\n\n/**\n * Resolve the compile-time platform selected by the active TypeScript project.\n * The same inheritance graph and dependency tracking as compiler selection are\n * used so nested projects and config edits cannot silently drift.\n *\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {Platform | undefined}\n */\nexport function resolve_consumer_platform_for_file(normalized_file_name, options = {}) {\n\tconst config_host = options.configHost ?? NODE_CONFIG_HOST;\n\tconst host_cache = get_config_host_cache(config_host);\n\tconst root_config_path =\n\t\toptions.configFileName ??\n\t\tget_nearest_root_tsconfig(path.dirname(normalized_file_name), config_host, host_cache);\n\tif (root_config_path === null) {\n\t\treturn undefined;\n\t}\n\n\tconst resolved_layers = get_tsconfig_layers(config_host, root_config_path, host_cache);\n\tfor (const dependency of resolved_layers.dependencies) {\n\t\toptions.dependencies?.add(dependency);\n\t}\n\n\tconst unreadable_layer = resolved_layers.layers.find((layer) => layer.raw_source === undefined);\n\tif (unreadable_layer) {\n\t\tconst message = `Unable to read tsconfig layer while resolving TSRX platform: ${unreadable_layer.path}`;\n\t\tlogError(message);\n\t\tthrow new Error(message);\n\t}\n\n\tconst malformed_layers = resolved_layers.layers.filter(\n\t\t(layer) => layer.parse_diagnostics.length > 0,\n\t);\n\tif (malformed_layers.length > 0) {\n\t\tconst has_tsrx_intent = resolved_layers.layers.some((layer) => {\n\t\t\tif (get_own_config_value(layer.config, ['tsrx']).state === 'found') return true;\n\t\t\treturn (\n\t\t\t\tlayer.parse_diagnostics.length > 0 &&\n\t\t\t\tlayer.raw_source !== undefined &&\n\t\t\t\ttsrx_key_pattern.test(layer.raw_source)\n\t\t\t);\n\t\t});\n\t\tif (!has_tsrx_intent) return undefined;\n\n\t\tconst layer = malformed_layers[0];\n\t\tconst detail = layer.parse_diagnostics[0].message;\n\t\tconst message = `Unable to parse tsconfig layer while resolving TSRX platform: ${layer.path}: ${detail}`;\n\t\tlogError(message);\n\t\tthrow new Error(message);\n\t}\n\n\tconst declaration = resolve_inherited_config_value(resolved_layers.layers, (layer) =>\n\t\tget_platform_declaration(layer.config),\n\t);\n\tif (declaration.state === 'invalid') {\n\t\tconst expected =\n\t\t\tdeclaration.target === 'platform' ? ' Expected \"web\", \"ios\", or \"android\".' : '';\n\t\tconst message = `Invalid TSRX ${declaration.target} declaration: ${declaration.actual_type} ${declaration.actual_value} in ${declaration.config_path}.${expected}`;\n\t\tlogError(message);\n\t\tthrow new TypeError(message);\n\t}\n\n\tconst effective_extends_failures = resolved_layers.extends_failures.filter(\n\t\t(failure) =>\n\t\t\tdeclaration.state !== 'declared' ||\n\t\t\t!is_extends_failure_overridden(resolved_layers.layers, failure, declaration.config_path),\n\t);\n\tif (effective_extends_failures.length > 0) {\n\t\t// An unresolved lower-precedence config must not break a file that does not\n\t\t// use platform flags. Known declarations are still validated above. When a\n\t\t// flag is present, the caller requests a complete graph so an unknown base\n\t\t// cannot silently choose the wrong branch.\n\t\tif (!options.requirePlatformResolution) {\n\t\t\treturn declaration.state === 'declared' ? declaration.value : undefined;\n\t\t}\n\t\tconst failure = effective_extends_failures[0];\n\t\tconst detail = failure.diagnostics.length > 0 ? `: ${failure.diagnostics[0].message}` : '';\n\t\tconst message = `Unable to resolve tsconfig extends entry ${JSON.stringify(failure.extends_value)} in ${failure.config_path} while resolving TSRX platform${detail}`;\n\t\tlogError(message);\n\t\tthrow new Error(message);\n\t}\n\n\treturn declaration.state === 'declared' ? declaration.value : undefined;\n}\n\n/** Drop all filesystem-derived consumer compiler resolution state. */\nexport function reset_consumer_compiler_resolution_caches() {\n\tconfig_host_to_resolution_cache = new WeakMap();\n\tdeclared_compiler_path_map.clear();\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.binarySearch = binarySearch;\nfunction binarySearch(values, searchValue) {\n let low = 0;\n let high = values.length - 1;\n let match;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const midValue = values[mid];\n if (midValue < searchValue) {\n low = mid + 1;\n }\n else if (midValue > searchValue) {\n high = mid - 1;\n }\n else {\n low = mid;\n high = mid;\n match = mid;\n break;\n }\n }\n const finalLow = Math.max(Math.min(low, high, values.length - 1), 0);\n const finalHigh = Math.min(Math.max(low, high, 0), values.length - 1);\n return { low: finalLow, high: finalHigh, match };\n}\n//# sourceMappingURL=binarySearch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.translateOffset = translateOffset;\nlet warned = false;\nfunction translateOffset(start, fromOffsets, toOffsets, fromLengths, toLengths = fromLengths, preferEnd = false) {\n const isSorted = fromOffsets.every((value, index) => index === 0 || fromOffsets[index - 1] <= value);\n if (!isSorted) {\n for (let i = 0; i < fromOffsets.length; i++) {\n const fromOffset = fromOffsets[i];\n const fromLength = fromLengths[i];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[i];\n const toOffset = toOffsets[i];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n }\n if (!warned) {\n warned = true;\n console.warn('fromOffsets should be sorted in ascending order');\n }\n }\n let low = 0;\n let high = fromOffsets.length - 1;\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n const fromOffset = fromOffsets[mid];\n const fromLength = fromLengths[mid];\n if (start >= fromOffset && start <= fromOffset + fromLength) {\n const toLength = toLengths[mid];\n const toOffset = toOffsets[mid];\n let rangeOffset;\n const relativePos = start - fromOffset;\n if (preferEnd && toLength > fromLength && relativePos === fromLength) {\n rangeOffset = toLength;\n }\n else {\n rangeOffset = Math.min(relativePos, toLength);\n }\n return toOffset + rangeOffset;\n }\n else if (start < fromOffset) {\n high = mid - 1;\n }\n else {\n low = mid + 1;\n }\n }\n}\n//# sourceMappingURL=translateOffset.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SourceMap = void 0;\nconst binarySearch_1 = require(\"./binarySearch\");\nconst translateOffset_1 = require(\"./translateOffset\");\nclass SourceMap {\n constructor(mappings) {\n this.mappings = mappings;\n }\n toSourceRange(generatedStart, generatedEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(generatedStart, generatedEnd, fallbackToAnyMatch, 'generatedOffsets', filter);\n }\n toGeneratedRange(sourceStart, sourceEnd, fallbackToAnyMatch, filter) {\n return this.findMatchingStartEnd(sourceStart, sourceEnd, fallbackToAnyMatch, 'sourceOffsets', filter);\n }\n toSourceLocation(generatedOffset, filter) {\n return this.findMatchingOffsets(generatedOffset, 'generatedOffsets', filter);\n }\n toGeneratedLocation(sourceOffset, filter) {\n return this.findMatchingOffsets(sourceOffset, 'sourceOffsets', filter);\n }\n *findMatchingOffsets(offset, fromRange, filter, preferEnd = false) {\n const memo = this.getMemoBasedOnRange(fromRange);\n if (memo.offsets.length === 0) {\n return;\n }\n const { low: start, high: end } = (0, binarySearch_1.binarySearch)(memo.offsets, offset);\n const skip = new Set();\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n for (let i = start; i <= end; i++) {\n for (const mapping of memo.mappings[i]) {\n if (skip.has(mapping)) {\n continue;\n }\n skip.add(mapping);\n if (filter && !filter(mapping.data)) {\n continue;\n }\n const mapped = (0, translateOffset_1.translateOffset)(offset, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mapped !== undefined) {\n yield [mapped, mapping];\n }\n }\n }\n }\n *findMatchingStartEnd(start, end, fallbackToAnyMatch, fromRange, filter) {\n const toRange = fromRange === 'sourceOffsets' ? 'generatedOffsets' : 'sourceOffsets';\n const preferEnd = toRange === 'sourceOffsets';\n const mappedStarts = [];\n let hadMatch = false;\n for (const [mappedStart, mapping] of this.findMatchingOffsets(start, fromRange)) {\n if (filter && !filter(mapping.data)) {\n continue;\n }\n mappedStarts.push([mappedStart, mapping]);\n const mappedEnd = (0, translateOffset_1.translateOffset)(end, mapping[fromRange], mapping[toRange], getLengths(mapping, fromRange), getLengths(mapping, toRange), preferEnd);\n if (mappedEnd !== undefined) {\n hadMatch = true;\n yield [mappedStart, mappedEnd, mapping, mapping];\n }\n }\n if (!hadMatch && fallbackToAnyMatch) {\n for (const [mappedStart, mappingStart] of mappedStarts) {\n for (const [mappedEnd, mappingEnd] of this.findMatchingOffsets(end, fromRange, undefined, preferEnd)) {\n if (filter && !filter(mappingEnd.data) || mappedEnd < mappedStart) {\n continue;\n }\n yield [mappedStart, mappedEnd, mappingStart, mappingEnd];\n break;\n }\n }\n }\n }\n getMemoBasedOnRange(fromRange) {\n return fromRange === 'sourceOffsets'\n ? this.sourceCodeOffsetsMemo ??= this.createMemo('sourceOffsets')\n : this.generatedCodeOffsetsMemo ??= this.createMemo('generatedOffsets');\n }\n createMemo(key) {\n const offsetsSet = new Set();\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n offsetsSet.add(mapping[key][i]);\n offsetsSet.add(mapping[key][i] + getLengths(mapping, key)[i]);\n }\n }\n const offsets = [...offsetsSet].sort((a, b) => a - b);\n const mappings = offsets.map(() => new Set());\n for (const mapping of this.mappings) {\n for (let i = 0; i < mapping[key].length; i++) {\n const startIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i]).match;\n const endIndex = (0, binarySearch_1.binarySearch)(offsets, mapping[key][i] + getLengths(mapping, key)[i]).match;\n for (let i = startIndex; i <= endIndex; i++) {\n mappings[i].add(mapping);\n }\n }\n }\n return { offsets, mappings };\n }\n}\nexports.SourceMap = SourceMap;\nfunction getLengths(mapping, key) {\n return key === 'sourceOffsets' ? mapping.lengths : mapping.generatedLengths ?? mapping.lengths;\n}\n//# sourceMappingURL=sourceMap.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./lib/sourceMap\"), exports);\n__exportStar(require(\"./lib/translateOffset\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isHoverEnabled = isHoverEnabled;\nexports.isInlayHintsEnabled = isInlayHintsEnabled;\nexports.isCodeLensEnabled = isCodeLensEnabled;\nexports.isMonikerEnabled = isMonikerEnabled;\nexports.isInlineValueEnabled = isInlineValueEnabled;\nexports.isSemanticTokensEnabled = isSemanticTokensEnabled;\nexports.isCallHierarchyEnabled = isCallHierarchyEnabled;\nexports.isTypeHierarchyEnabled = isTypeHierarchyEnabled;\nexports.isRenameEnabled = isRenameEnabled;\nexports.isDefinitionEnabled = isDefinitionEnabled;\nexports.isTypeDefinitionEnabled = isTypeDefinitionEnabled;\nexports.isReferencesEnabled = isReferencesEnabled;\nexports.isImplementationEnabled = isImplementationEnabled;\nexports.isHighlightEnabled = isHighlightEnabled;\nexports.isSymbolsEnabled = isSymbolsEnabled;\nexports.isFoldingRangesEnabled = isFoldingRangesEnabled;\nexports.isSelectionRangesEnabled = isSelectionRangesEnabled;\nexports.isLinkedEditingEnabled = isLinkedEditingEnabled;\nexports.isColorEnabled = isColorEnabled;\nexports.isDocumentLinkEnabled = isDocumentLinkEnabled;\nexports.isDiagnosticsEnabled = isDiagnosticsEnabled;\nexports.isCodeActionsEnabled = isCodeActionsEnabled;\nexports.isFormattingEnabled = isFormattingEnabled;\nexports.isCompletionEnabled = isCompletionEnabled;\nexports.isAutoInsertEnabled = isAutoInsertEnabled;\nexports.isSignatureHelpEnabled = isSignatureHelpEnabled;\nexports.shouldReportDiagnostics = shouldReportDiagnostics;\nexports.resolveRenameNewName = resolveRenameNewName;\nexports.resolveRenameEditText = resolveRenameEditText;\nexports.findOverlapCodeRange = findOverlapCodeRange;\nfunction isHoverEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlayHintsEnabled(info) {\n return !!info.semantic;\n}\nfunction isCodeLensEnabled(info) {\n return !!info.semantic;\n}\nfunction isMonikerEnabled(info) {\n return !!info.semantic;\n}\nfunction isInlineValueEnabled(info) {\n return !!info.semantic;\n}\nfunction isSemanticTokensEnabled(info) {\n return typeof info.semantic === 'object'\n ? info.semantic.shouldHighlight?.() ?? true\n : !!info.semantic;\n}\nfunction isCallHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeHierarchyEnabled(info) {\n return !!info.navigation;\n}\nfunction isRenameEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldRename?.() ?? true\n : !!info.navigation;\n}\nfunction isDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isTypeDefinitionEnabled(info) {\n return !!info.navigation;\n}\nfunction isReferencesEnabled(info) {\n return !!info.navigation;\n}\nfunction isImplementationEnabled(info) {\n return !!info.navigation;\n}\nfunction isHighlightEnabled(info) {\n return typeof info.navigation === 'object'\n ? info.navigation.shouldHighlight?.() ?? true\n : !!info.navigation;\n}\nfunction isSymbolsEnabled(info) {\n return !!info.structure;\n}\nfunction isFoldingRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isSelectionRangesEnabled(info) {\n return !!info.structure;\n}\nfunction isLinkedEditingEnabled(info) {\n return !!info.structure;\n}\nfunction isColorEnabled(info) {\n return !!info.structure;\n}\nfunction isDocumentLinkEnabled(info) {\n return !!info.structure;\n}\nfunction isDiagnosticsEnabled(info) {\n return !!info.verification;\n}\nfunction isCodeActionsEnabled(info) {\n return !!info.verification;\n}\nfunction isFormattingEnabled(info) {\n return !!info.format;\n}\nfunction isCompletionEnabled(info) {\n return !!info.completion;\n}\nfunction isAutoInsertEnabled(info) {\n return !!info.completion;\n}\nfunction isSignatureHelpEnabled(info) {\n return !!info.completion;\n}\n// should...\nfunction shouldReportDiagnostics(info, source, code) {\n return typeof info.verification === 'object'\n ? info.verification.shouldReport?.(source, code) ?? true\n : !!info.verification;\n}\n// resolve...\nfunction resolveRenameNewName(newName, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameNewName?.(newName) ?? newName\n : newName;\n}\nfunction resolveRenameEditText(text, info) {\n return typeof info.navigation === 'object'\n ? info.navigation.resolveRenameEditText?.(text) ?? text\n : text;\n}\nfunction findOverlapCodeRange(start, end, map, filter) {\n let mappedStart;\n let mappedEnd;\n for (const [mapped, mapping] of map.toGeneratedLocation(start)) {\n if (filter(mapping.data)) {\n mappedStart = mapped;\n break;\n }\n }\n for (const [mapped, mapping] of map.toGeneratedLocation(end)) {\n if (filter(mapping.data)) {\n mappedEnd = mapped;\n break;\n }\n }\n if (mappedStart === undefined || mappedEnd === undefined) {\n for (const mapping of map.mappings) {\n if (filter(mapping.data)) {\n const mappingStart = mapping.sourceOffsets[0];\n const mappingEnd = mapping.sourceOffsets[mapping.sourceOffsets.length - 1]\n + mapping.lengths[mapping.lengths.length - 1];\n const overlap = getOverlapRange(start, end, mappingStart, mappingEnd);\n if (overlap) {\n const curMappedStart = (overlap.start - mappingStart) + mapping.generatedOffsets[0];\n const lastGeneratedLength = (mapping.generatedLengths ?? mapping.lengths)[mapping.generatedOffsets.length - 1];\n const curMappedEndOffset = Math.min(overlap.end - mapping.sourceOffsets[mapping.sourceOffsets.length - 1], lastGeneratedLength);\n const curMappedEnd = mapping.generatedOffsets[mapping.generatedOffsets.length - 1] + curMappedEndOffset;\n mappedStart = mappedStart === undefined ? curMappedStart : Math.min(mappedStart, curMappedStart);\n mappedEnd = mappedEnd === undefined ? curMappedEnd : Math.max(mappedEnd, curMappedEnd);\n }\n }\n }\n }\n if (mappedStart !== undefined && mappedEnd !== undefined) {\n return {\n start: mappedStart,\n end: mappedEnd,\n };\n }\n}\nfunction getOverlapRange(range1Start, range1End, range2Start, range2End) {\n const start = Math.max(range1Start, range2Start);\n const end = Math.min(range1End, range2End);\n if (start > end) {\n return undefined;\n }\n return {\n start,\n end,\n };\n}\n//# sourceMappingURL=editor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LinkedCodeMap = void 0;\nconst source_map_1 = require(\"@volar/source-map\");\nclass LinkedCodeMap extends source_map_1.SourceMap {\n *getLinkedOffsets(start) {\n for (const mapped of this.toGeneratedLocation(start)) {\n yield mapped[0];\n }\n for (const mapped of this.toSourceLocation(start)) {\n yield mapped[0];\n }\n }\n}\nexports.LinkedCodeMap = LinkedCodeMap;\n//# sourceMappingURL=linkedCodeMap.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileMap = void 0;\nclass FileMap extends Map {\n constructor(caseSensitive) {\n super();\n this.caseSensitive = caseSensitive;\n this.originalFileNames = new Map();\n }\n keys() {\n return this.originalFileNames.values();\n }\n get(key) {\n return super.get(this.normalizeId(key));\n }\n has(key) {\n return super.has(this.normalizeId(key));\n }\n set(key, value) {\n this.originalFileNames.set(this.normalizeId(key), key);\n return super.set(this.normalizeId(key), value);\n }\n delete(key) {\n this.originalFileNames.delete(this.normalizeId(key));\n return super.delete(this.normalizeId(key));\n }\n clear() {\n this.originalFileNames.clear();\n return super.clear();\n }\n normalizeId(id) {\n return this.caseSensitive ? id : id.toLowerCase();\n }\n}\nexports.FileMap = FileMap;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultMapperFactory = exports.SourceMap = void 0;\nexports.createLanguage = createLanguage;\nexports.forEachEmbeddedCode = forEachEmbeddedCode;\nvar source_map_1 = require(\"@volar/source-map\");\nObject.defineProperty(exports, \"SourceMap\", { enumerable: true, get: function () { return source_map_1.SourceMap; } });\n__exportStar(require(\"./lib/editor\"), exports);\n__exportStar(require(\"./lib/linkedCodeMap\"), exports);\n__exportStar(require(\"./lib/types\"), exports);\n__exportStar(require(\"./lib/utils\"), exports);\nconst source_map_2 = require(\"@volar/source-map\");\nconst linkedCodeMap_1 = require(\"./lib/linkedCodeMap\");\nconst defaultMapperFactory = mappings => new source_map_2.SourceMap(mappings);\nexports.defaultMapperFactory = defaultMapperFactory;\nfunction createLanguage(plugins, scriptRegistry, sync, onAssociationDirty) {\n const virtualCodeToSourceScriptMap = new WeakMap();\n const virtualCodeToSourceMap = new WeakMap();\n const virtualCodeToLinkedCodeMap = new WeakMap();\n const language = {\n mapperFactory: exports.defaultMapperFactory,\n plugins,\n scripts: {\n fromVirtualCode(virtualCode) {\n return virtualCodeToSourceScriptMap.get(virtualCode);\n },\n get(id, includeFsFiles = true, shouldRegister = false) {\n sync(id, includeFsFiles, shouldRegister);\n const result = scriptRegistry.get(id);\n // The sync function provider may not always call the set function due to caching, so it is necessary to explicitly check isAssociationDirty.\n if (result?.isAssociationDirty) {\n this.set(id, result.snapshot, result.languageId);\n }\n return scriptRegistry.get(id);\n },\n set(id, snapshot, languageId, _plugins = plugins) {\n if (!languageId) {\n for (const plugin of plugins) {\n languageId = plugin.getLanguageId?.(id);\n if (languageId) {\n break;\n }\n }\n }\n if (!languageId) {\n console.warn(`languageId not found for ${String(id)}`);\n return;\n }\n let associatedOnly = false;\n for (const plugin of plugins) {\n if (plugin.isAssociatedFileOnly?.(id, languageId)) {\n associatedOnly = true;\n break;\n }\n }\n if (scriptRegistry.has(id)) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript.languageId !== languageId || sourceScript.associatedOnly !== associatedOnly) {\n this.delete(id);\n triggerTargetsDirty(sourceScript);\n return this.set(id, snapshot, languageId);\n }\n else if (associatedOnly) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n }\n else if (sourceScript.isAssociationDirty || sourceScript.snapshot !== snapshot) {\n if (sourceScript.snapshot !== snapshot) {\n sourceScript.snapshot = snapshot;\n triggerTargetsDirty(sourceScript);\n }\n const codegenCtx = prepareCreateVirtualCode(sourceScript);\n if (sourceScript.generated) {\n const { updateVirtualCode, createVirtualCode } = sourceScript.generated.languagePlugin;\n const newVirtualCode = updateVirtualCode\n ? updateVirtualCode(id, sourceScript.generated.root, snapshot, codegenCtx)\n : createVirtualCode?.(id, languageId, snapshot, codegenCtx);\n if (newVirtualCode) {\n sourceScript.generated.root = newVirtualCode;\n sourceScript.generated.embeddedCodes.clear();\n for (const code of forEachEmbeddedCode(sourceScript.generated.root)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n return sourceScript;\n }\n else {\n this.delete(id);\n return;\n }\n }\n }\n else {\n // not changed\n return sourceScript;\n }\n }\n else {\n // created\n const sourceScript = {\n id: id,\n languageId,\n snapshot,\n associatedIds: new Set(),\n targetIds: new Set(),\n associatedOnly,\n };\n scriptRegistry.set(id, sourceScript);\n if (associatedOnly) {\n return sourceScript;\n }\n for (const languagePlugin of _plugins) {\n const virtualCode = languagePlugin.createVirtualCode?.(id, languageId, snapshot, prepareCreateVirtualCode(sourceScript));\n if (virtualCode) {\n sourceScript.generated = {\n root: virtualCode,\n languagePlugin,\n embeddedCodes: new Map(),\n };\n for (const code of forEachEmbeddedCode(virtualCode)) {\n virtualCodeToSourceScriptMap.set(code, sourceScript);\n sourceScript.generated.embeddedCodes.set(code.id, code);\n }\n break;\n }\n }\n return sourceScript;\n }\n },\n delete(id) {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.generated?.languagePlugin.disposeVirtualCode?.(id, sourceScript.generated.root);\n scriptRegistry.delete(id);\n triggerTargetsDirty(sourceScript);\n }\n },\n },\n maps: {\n get(virtualCode, sourceScript) {\n let mapCache = virtualCodeToSourceMap.get(virtualCode.snapshot);\n if (!mapCache) {\n virtualCodeToSourceMap.set(virtualCode.snapshot, mapCache = new WeakMap());\n }\n if (!mapCache.has(sourceScript.snapshot)) {\n const mappings = virtualCode.associatedScriptMappings?.get(sourceScript.id) ?? virtualCode.mappings;\n mapCache.set(sourceScript.snapshot, language.mapperFactory(mappings));\n }\n return mapCache.get(sourceScript.snapshot);\n },\n *forEach(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n yield [\n sourceScript,\n this.get(virtualCode, sourceScript),\n ];\n if (virtualCode.associatedScriptMappings) {\n for (const [relatedScriptId] of virtualCode.associatedScriptMappings) {\n const relatedSourceScript = scriptRegistry.get(relatedScriptId);\n if (relatedSourceScript) {\n yield [\n relatedSourceScript,\n this.get(virtualCode, relatedSourceScript),\n ];\n }\n }\n }\n },\n },\n linkedCodeMaps: {\n get(virtualCode) {\n const sourceScript = virtualCodeToSourceScriptMap.get(virtualCode);\n let mapCache = virtualCodeToLinkedCodeMap.get(virtualCode.snapshot);\n if (mapCache?.[0] !== sourceScript.snapshot) {\n virtualCodeToLinkedCodeMap.set(virtualCode.snapshot, mapCache = [\n sourceScript.snapshot,\n virtualCode.linkedCodeMappings\n ? new linkedCodeMap_1.LinkedCodeMap(virtualCode.linkedCodeMappings)\n : undefined,\n ]);\n }\n return mapCache[1];\n },\n },\n };\n return language;\n function triggerTargetsDirty(sourceScript) {\n sourceScript.targetIds.forEach(id => {\n const sourceScript = scriptRegistry.get(id);\n if (sourceScript) {\n sourceScript.isAssociationDirty = true;\n onAssociationDirty?.(sourceScript.id);\n }\n });\n }\n function prepareCreateVirtualCode(sourceScript) {\n for (const id of sourceScript.associatedIds) {\n scriptRegistry.get(id)?.targetIds.delete(sourceScript.id);\n }\n sourceScript.associatedIds.clear();\n sourceScript.isAssociationDirty = false;\n return {\n getAssociatedScript(id) {\n sync(id, true, true);\n const relatedSourceScript = scriptRegistry.get(id);\n if (relatedSourceScript) {\n relatedSourceScript.targetIds.add(sourceScript.id);\n sourceScript.associatedIds.add(relatedSourceScript.id);\n }\n return relatedSourceScript;\n },\n };\n }\n}\nfunction* forEachEmbeddedCode(virtualCode) {\n yield virtualCode;\n if (virtualCode.embeddedCodes) {\n for (const embeddedCode of virtualCode.embeddedCodes) {\n yield* forEachEmbeddedCode(embeddedCode);\n }\n }\n}\n//# sourceMappingURL=index.js.map","/** @import * as AST from 'estree'; */\n/** @import {CompileError, VolarMappingsResult, CodeMapping} from '@tsrx/core/types' */\n\n/**\n * The compiler contract every TSRX target exposes for editor tooling. Octane\n * and consumer-declared modules may spell the entry `compileToVolarMappings`;\n * see `normalize_tsrx_compiler_module` in `language.js`.\n * @typedef {{\n * \tcompile?: (source: string, filename: string, options?: TsrxTransformOptions) => { code?: string, errors?: CompileError[] },\n * \tcompile_to_volar_mappings(source: string, filename: string, options?: { loose?: boolean } & TsrxTransformOptions): VolarMappingsResult,\n * }} TSRXCompilerModule\n */\n\n/**\n * @typedef {object} TsrxTransformOptions\n * @property {'web' | 'ios' | 'android'} [platform] Platform selected for `import.meta.env.platform` flags.\n */\n\n/**\n * A `<style>` or `<script>` body inside a `.tsrx` file, located by source\n * offset. Both region kinds map 1:1 onto their source text.\n * @typedef {object} EmbeddedRegion\n * @property {string} id Stable id, e.g. `style_0` / `script_0`.\n * @property {number} start Source offset of the first character of the body.\n * @property {number} length Body length in UTF-16 code units.\n * @property {string} content The body text.\n */\n\n/**\n * The type-only transform of one `.tsrx` file, free of any Volar or\n * TypeScript-host types so that both the classic Volar language plugin and the\n * TypeScript 7 content mapper can consume it.\n *\n * `fatalError` is set when the compiler threw: `text` is then `''`,\n * `mappings` is empty and `sourceAst` is `null`. Otherwise `text` is the\n * generated TSX, `mappings` maps it back to the source, `errors` holds the\n * non-fatal (usage) diagnostics and the regions describe the embedded\n * `<style>` / `<script>` bodies.\n * @typedef {object} TsrxTransformResult\n * @property {string} text\n * @property {CodeMapping[]} mappings\n * @property {EmbeddedRegion[]} cssRegions\n * @property {EmbeddedRegion[]} scriptRegions\n * @property {CompileError[]} errors\n * @property {CompileError | null} fatalError\n * @property {AST.Program | null} sourceAst\n */\n\n/**\n * Run a TSRX compiler's type-only transform in loose mode.\n *\n * Pure with respect to its inputs: the compiler module is the only\n * collaborator, no caches are consulted and nothing is logged.\n * @param {TSRXCompilerModule} compiler\n * @param {string} file_name\n * @param {string} content\n * @param {TsrxTransformOptions} [options]\n * @returns {TsrxTransformResult}\n */\nexport function transform_tsrx(compiler, file_name, content, options = {}) {\n\t/** @type {VolarMappingsResult} */\n\tlet transpiled;\n\ttry {\n\t\ttranspiled = compiler.compile_to_volar_mappings(content, file_name, {\n\t\t\tloose: true,\n\t\t\tplatform: options.platform,\n\t\t});\n\t} catch (e) {\n\t\tconst error = /** @type {CompileError} */ (e);\n\t\terror.type = 'fatal';\n\t\treturn {\n\t\t\ttext: '',\n\t\t\tmappings: [],\n\t\t\tcssRegions: [],\n\t\t\tscriptRegions: [],\n\t\t\terrors: [],\n\t\t\tfatalError: error,\n\t\t\tsourceAst: null,\n\t\t};\n\t}\n\n\tconst scriptRegions = regions_from_mappings(transpiled.scriptMappings ?? []);\n\tconst embedded = embed_script_bodies(\n\t\tblank_script_bodies(transpiled.code ?? '', scriptRegions),\n\t\ttranspiled.mappings ?? [],\n\t\tscriptRegions,\n\t);\n\treturn {\n\t\ttext: embedded.text,\n\t\tmappings: embedded.mappings,\n\t\tcssRegions: regions_from_mappings(transpiled.cssMappings ?? []),\n\t\tscriptRegions,\n\t\terrors: transpiled.errors ?? [],\n\t\tfatalError: null,\n\t\tsourceAst: transpiled.sourceAst ?? null,\n\t};\n}\n\n/**\n * The mapping data of a `<script>` body embedded in the generated TSX: every\n * language feature except formatting, exactly like the compiler's own spans.\n */\nconst SCRIPT_BODY_MAPPING_DATA = {\n\tverification: true,\n\tcompletion: true,\n\tsemantic: true,\n\tnavigation: true,\n\tstructure: true,\n\tformat: false,\n\tcustomData: {},\n};\n\n/**\n * `import` declarations at the top level of a `<script>` body, by offset. A\n * conservative statement scanner (a line starting with `import`, up to the\n * module specifier and optional attributes) rather than a parser: the body is\n * plain TypeScript and the transform has no TypeScript parser of its own.\n */\nconst IMPORT_DECLARATION =\n\t/^[ \\t]*import\\s+(?:type\\s+)?(?:(?:[\\w$]+\\s*,\\s*)?(?:\\{[^}]*\\}|\\*\\s+as\\s+[\\w$]+|[\\w$]+)\\s+from\\s+)?(['\"])[^'\"\\n]*\\1(?:\\s+with\\s*\\{[^}]*\\})?[ \\t]*;?/gm;\n\n/**\n * Whole export statements that carry no declaration: re-exports\n * (`export ... from '...'`), local export lists (`export { a as b };`),\n * `export type { T };` and `export = x;`. Module-level syntax with nothing to\n * export from an inline script, blanked entirely.\n */\nconst EXPORT_STATEMENT =\n\t/^[ \\t]*export\\s+(?:type\\s+)?(?:(?:\\{[^}]*\\}|\\*(?:\\s+as\\s+[\\w$]+)?)(?:\\s+from\\s+(['\"])[^'\"\\n]*\\1(?:\\s+with\\s*\\{[^}]*\\})?)?|=\\s*[^;\\n]*)[ \\t]*;?/gm;\n\n/**\n * `export default` in front of a named function or class declaration: only the\n * keywords are blanked, so the declaration keeps its name in the block's scope.\n */\nconst EXPORT_DEFAULT_NAMED =\n\t/^([ \\t]*)(export[ \\t]+default[ \\t]+)(?=(?:async[ \\t]+)?function[ \\t]*\\*?[ \\t]*[A-Za-z_$]|(?:abstract[ \\t]+)?class[ \\t]+(?!(?:extends|implements)\\b)[A-Za-z_$])/gm;\n\n/**\n * `export default` in front of an expression, an anonymous function or an\n * anonymous class: replaced by a same-length `const <name>=` so the rest stays\n * a valid, checked initializer (an anonymous `function () {}` or `class {}` is\n * only valid as an expression).\n */\nconst EXPORT_DEFAULT = /^([ \\t]*)(export[ \\t]+default[ \\t]+)(?=\\S)/gm;\n\n/** The `export` keyword in front of a declaration. */\nconst EXPORT_KEYWORD =\n\t/^([ \\t]*)(export[ \\t]+)(?=(?:async[ \\t]+)?(?:const|let|var|function|class|type|interface|enum|abstract|declare|namespace|module)\\b)/gm;\n\n/**\n * A `<script type=\"module\">` body may `export`, but nothing can import an inline\n * script, so its exports are dead and a block cannot hold them: statements that\n * only export are blanked, `export default` becomes a same-length `const`\n * binding, and the keyword in front of a declaration is blanked, keeping every\n * length so the body's mapping stays one to one.\n * @param {string} body\n * @returns {string}\n */\nexport function blank_export_syntax(body) {\n\treturn body\n\t\t.replace(EXPORT_STATEMENT, (statement) => statement.replace(/[^\\r\\n]/g, ' '))\n\t\t.replace(\n\t\t\tEXPORT_DEFAULT_NAMED,\n\t\t\t(_match, indent, keywords) => indent + ' '.repeat(keywords.length),\n\t\t)\n\t\t.replace(EXPORT_DEFAULT, (_match, indent, keywords) => {\n\t\t\t// `const ` + name + `=` must be exactly as long as the keywords (15+ chars).\n\t\t\tconst name = '_default'.padEnd(keywords.length - 'const '.length - '='.length, '_');\n\t\t\treturn `${indent}const ${name}=`;\n\t\t})\n\t\t.replace(EXPORT_KEYWORD, (_match, indent, keyword) => indent + ' '.repeat(keyword.length));\n}\n\n/**\n * @param {string} body\n * @returns {Array<{ start: number, end: number }>}\n */\nexport function find_import_declarations(body) {\n\t/** @type {Array<{ start: number, end: number }>} */\n\tconst imports = [];\n\tfor (const match of body.matchAll(IMPORT_DECLARATION)) {\n\t\tconst start = match.index + match[0].length - match[0].trimStart().length;\n\t\timports.push({ start, end: match.index + match[0].length });\n\t}\n\treturn imports;\n}\n\n/**\n * Append every `<script>` body to the generated TSX as a block statement, so\n * TypeScript checks it in the same file as the component, on every path that\n * consumes the transform (the language server, tsserver through the plugin, and\n * the content mapper), with ordinary mappings back to the source. A block keeps\n * one body's declarations from colliding with another's or with the\n * component's, and contributes nothing to declaration output.\n *\n * `import` declarations cannot live in a block, so each body's imports are\n * hoisted verbatim in front of its block, at module level, where TypeScript\n * resolves them like any other import (a browser-only URL in a\n * `<script type=\"module\">` yields a mapped \"cannot find module\"); their place\n * in the block is blanked. `export` syntax is blanked in place\n * ({@link blank_export_syntax}). Top-level `await` is legal inside a block of a\n * module and stays as written. Each body maps in one multi-segment mapping.\n * @param {string} text\n * @param {CodeMapping[]} mappings\n * @param {EmbeddedRegion[]} script_regions\n * @returns {{ text: string, mappings: CodeMapping[] }}\n */\nexport function embed_script_bodies(text, mappings, script_regions) {\n\tconst result_mappings = [...mappings];\n\tfor (const region of script_regions) {\n\t\tif (region.length === 0 || region.content.length !== region.length) continue;\n\t\tconst imports = find_import_declarations(region.content);\n\t\t/** @type {number[]} */\n\t\tconst sourceOffsets = [];\n\t\t/** @type {number[]} */\n\t\tconst generatedOffsets = [];\n\t\t/** @type {number[]} */\n\t\tconst lengths = [];\n\n\t\tlet hoisted = '';\n\t\tlet body = blank_export_syntax(region.content);\n\t\tfor (const { start, end } of imports) {\n\t\t\tsourceOffsets.push(region.start + start);\n\t\t\tgeneratedOffsets.push(text.length + 1 + hoisted.length);\n\t\t\tlengths.push(end - start);\n\t\t\thoisted += region.content.slice(start, end) + '\\n';\n\t\t\tbody = body.slice(0, start) + ' '.repeat(end - start) + body.slice(end);\n\t\t}\n\t\tconst block_prefix = `\\n${hoisted};{\\n`;\n\t\tconst body_offset = text.length + block_prefix.length;\n\t\tlet cursor = 0;\n\t\tfor (const { start, end } of [...imports, { start: region.length, end: region.length }]) {\n\t\t\tif (start > cursor) {\n\t\t\t\tsourceOffsets.push(region.start + cursor);\n\t\t\t\tgeneratedOffsets.push(body_offset + cursor);\n\t\t\t\tlengths.push(start - cursor);\n\t\t\t}\n\t\t\tcursor = end;\n\t\t}\n\t\ttext += `${block_prefix}${body}\\n}\\n`;\n\t\tif (sourceOffsets.length > 0) {\n\t\t\tresult_mappings.push({\n\t\t\t\tsourceOffsets,\n\t\t\t\tgeneratedOffsets,\n\t\t\t\tlengths,\n\t\t\t\tgeneratedLengths: [...lengths],\n\t\t\t\tdata: { ...SCRIPT_BODY_MAPPING_DATA, customData: { embeddedId: region.id } },\n\t\t\t});\n\t\t}\n\t}\n\treturn { text, mappings: result_mappings };\n}\n\n/**\n * Blank every `<script>` body in the generated TSX, keeping its length and\n * line breaks. The compilers copy the body verbatim into the JSX text of the\n * `<script>` element, where a `<` (as in `1 < 2`) parses as a tag and yields a\n * syntax error that only the Volar path used to hide (it drops diagnostics\n * with no source mapping; the content-mapper protocol reports them). The body\n * is type-checked as a block appended by {@link embed_script_bodies}, and no\n * mapping of the generated TSX points into the copy in the JSX text\n * (`regions_from_mappings`), so blanking it loses nothing. A body is located by its text followed by the closing tag; a body\n * that is not found unchanged in the output is left alone.\n * @param {string} text\n * @param {EmbeddedRegion[]} script_regions\n * @returns {string}\n */\nexport function blank_script_bodies(text, script_regions) {\n\tlet cursor = 0;\n\tfor (const region of script_regions) {\n\t\tif (region.length === 0) continue;\n\t\tconst needle = `${region.content}</script>`;\n\t\tconst index = text.indexOf(needle, cursor);\n\t\tif (index < 0) continue;\n\t\tconst blank = region.content.replace(/[^\\r\\n]/g, ' ');\n\t\ttext = text.slice(0, index) + blank + text.slice(index + region.content.length);\n\t\tcursor = index + needle.length;\n\t}\n\treturn text;\n}\n\n/**\n * @param {CodeMapping[]} mappings\n * @returns {EmbeddedRegion[]}\n */\nfunction regions_from_mappings(mappings) {\n\treturn mappings.map((mapping) => ({\n\t\tid: String(mapping.data?.customData?.embeddedId ?? ''),\n\t\tstart: mapping.sourceOffsets[0],\n\t\tlength: mapping.lengths[0],\n\t\tcontent: String(mapping.data?.customData?.content ?? ''),\n\t}));\n}\n\n/**\n * Extract raw `<style>...</style>` bodies from source text, used as a fallback\n * for CSS intellisense while the file has a fatal compile error (no AST\n * available; the normal path derives regions from the compiler's\n * `cssMappings` instead).\n *\n * The opening-tag pattern is attribute-aware: a `>` inside a quoted value or an\n * `{...}` expression container (one level of nesting) does not end the tag, so\n * `apply={cond ? a : b}` and `apply={(x) => y}` are handled. It refuses to\n * match self-closing `<style apply={theme} />` blocks (the `/` before `>` must\n * not close the tag): they carry no CSS body, so, like the compiler's\n * `cssMappings`, they yield no region and cannot swallow a later bodied block.\n * One region is produced per bodied block, in source order, whether the blocks\n * share a scope or sit in nested `@{ ... }` / control-flow bodies.\n * @param {string} code\n * @returns {EmbeddedRegion[]}\n */\nexport function extract_css_regions(code) {\n\tconst style_regex =\n\t\t/<style\\b((?:[^>\"'{}/]|\"[^\"]*\"|'[^']*'|\\{(?:[^{}]|\\{[^{}]*\\})*\\}|\\/(?!>))*)>([\\s\\S]*?)<\\/style>/gi;\n\treturn extract_regions(code, style_regex, '<style'.length, 'style');\n}\n\n/**\n * @param {string} code\n * @param {RegExp} regex Global regex whose group 1 is the attribute text and group 2 the body.\n * @param {number} tag_name_length Length of `<tag`.\n * @param {string} id_prefix\n * @returns {EmbeddedRegion[]}\n */\nfunction extract_regions(code, regex, tag_name_length, id_prefix) {\n\t/** @type {EmbeddedRegion[]} */\n\tconst regions = [];\n\tlet match;\n\twhile ((match = regex.exec(code)) !== null) {\n\t\tconst attrs = match[1];\n\t\tconst content = match[2];\n\t\t// `<tag` + attrs + `>`; attrs may contain a quoted or braced `>`, so derive\n\t\t// the opening tag's end from the match structure rather than searching for `>`.\n\t\tconst start = match.index + tag_name_length + attrs.length + 1;\n\t\tregions.push({\n\t\t\tid: `${id_prefix}_${regions.length}`,\n\t\t\tstart,\n\t\t\tlength: content.length,\n\t\t\tcontent,\n\t\t});\n\t}\n\treturn regions;\n}\n","/** @import * as AST from 'estree'; */\n/** @import {CompileError, CodeMapping} from '@tsrx/core/types' */\n\n/** @typedef {import('./transform.js').TSRXCompilerModule} TSRXCompilerModule */\n/** @typedef {import('./transform.js').TsrxTransformResult} TsrxTransformResult */\n/** @typedef {import('./transform.js').EmbeddedRegion} EmbeddedRegion */\n\n/** @typedef {Map<string, CodeMapping>} CachedMappings */\n/** @typedef {import('typescript').CompilerOptions} CompilerOptions */\n/** @typedef {import('@volar/language-core').IScriptSnapshot} IScriptSnapshot */\n/** @typedef {import('@volar/language-core').VirtualCode} VirtualCode */\n/** @typedef {string | { fsPath: string }} ScriptId */\n// Side-effect import: augments @volar/language-core's LanguagePlugin with the `typescript` field.\n/** @typedef {typeof import('@volar/typescript')} _VolarTypeScriptAugmentation */\n/** @typedef {import('./consumer-compiler.js').CompilerResolutionOptions} CompilerResolutionOptions */\n/** @typedef {import('@volar/language-core').LanguagePlugin<ScriptId, VirtualCode>} TsrxLanguagePlugin */\n\n/** @typedef {InstanceType<typeof import('./language.js')[\"TSRXVirtualCode\"]>} TSRXVirtualCodeInstance */\n\nimport { forEachEmbeddedCode } from '@volar/language-core';\nimport fs from 'fs';\nimport path from 'path';\nimport { createRequire } from 'module';\nimport { fileURLToPath } from 'url';\nimport {\n\treset_consumer_compiler_resolution_caches,\n\tresolve_consumer_compiler_for_file,\n\tresolve_consumer_platform_for_file,\n} from './consumer-compiler.js';\nimport { NODE_CONFIG_HOST } from './config-host.js';\nimport { extract_css_regions, transform_tsrx } from './transform.js';\nimport { createLogging, DEBUG } from './utils.js';\n\nconst require = createRequire(import.meta.url);\nconst root_dirname = path.dirname(fileURLToPath(import.meta.url));\n\nconst { log, logWarning, logError } = createLogging('[TSRX Language]');\n/** @type {Set<string>} */\nconst loggedCompilationFailures = new Set();\nexport const TSRX_EXTENSIONS = ['.tsrx'];\n/**\n * `[package name, package directory parts, supported extensions, package hints, entry candidates?]`.\n * Entry candidates are relative to the package directory and are probed in order,\n * so a package that ships both a build output and its sources lists the published\n * layout first.\n * @typedef {[string, string[], string[], string[], string[][]?]} CompilerCandidate\n */\n/** @type {CompilerCandidate[]} */\nexport const COMPILER_CANDIDATES = [\n\t[\n\t\t'@tsrx/ripple',\n\t\t['node_modules', '@tsrx', 'ripple'],\n\t\t['.tsrx'],\n\t\t['@tsrx/ripple', 'ripple', '@ripple-ts/vite-plugin'],\n\t],\n\t[\n\t\t'@tsrx/react',\n\t\t['node_modules', '@tsrx', 'react'],\n\t\t['.tsrx'],\n\t\t['@tsrx/react', '@tsrx/vite-plugin-react'],\n\t],\n\t[\n\t\t'@tsrx/solid',\n\t\t['node_modules', '@tsrx', 'solid'],\n\t\t['.tsrx'],\n\t\t['@tsrx/solid', '@tsrx/vite-plugin-solid'],\n\t],\n\t[\n\t\t'@tsrx/preact',\n\t\t['node_modules', '@tsrx', 'preact'],\n\t\t['.tsrx'],\n\t\t['@tsrx/preact', '@tsrx/vite-plugin-preact'],\n\t],\n\t[\n\t\t'@tsrx/vue',\n\t\t['node_modules', '@tsrx', 'vue'],\n\t\t['.tsrx'],\n\t\t['@tsrx/vue', '@tsrx/vite-plugin-vue'],\n\t],\n\t[\n\t\t'@tsrx/hono',\n\t\t['node_modules', '@tsrx', 'hono'],\n\t\t['.tsrx'],\n\t\t['@tsrx/hono', '@tsrx/vite-plugin-hono'],\n\t],\n\t[\n\t\t'octane',\n\t\t['node_modules', 'octane'],\n\t\t['.tsrx'],\n\t\t['octane', '@octanejs/vite-plugin'],\n\t\t// Published `octane` releases only ship `dist/` and expose the compiler as\n\t\t// `octane/compiler/volar`; the `src/` layout is kept for source checkouts.\n\t\t[\n\t\t\t['dist', 'compiler', 'volar.js'],\n\t\t\t['src', 'compiler', 'volar.js'],\n\t\t],\n\t],\n];\n\n/** @type {string[][]} */\nconst DEFAULT_COMPILER_ENTRY_CANDIDATES = [['src', 'index.js']];\n\n/**\n * @param {string} file_name\n * @returns {boolean}\n */\nexport function is_tsrx_file(file_name) {\n\treturn TSRX_EXTENSIONS.some((extension) => file_name.endsWith(extension));\n}\n\n/**\n * Tokenize enough of a source text to find member chains: comments and\n * string literals are skipped, template literals contribute only their\n * `${...}` expressions, and every identifier, `.` and `?.` is a token.\n * It tokenizes independently of any grammar, so partially authored TSRX and\n * template syntax (`@{`, `@if`) are fine.\n * @param {string} source\n * @returns {Array<{ kind: 'word' | 'dot' | 'question-dot' | 'other', text: string }>}\n */\nfunction tokenize_member_chains(source) {\n\t/** @type {Array<{ kind: 'word' | 'dot' | 'question-dot' | 'other', text: string }>} */\n\tconst tokens = [];\n\tconst length = source.length;\n\tlet index = 0;\n\t/** Brace depth at which each open template substitution started, innermost last. */\n\t/** @type {number[]} */\n\tconst template_braces = [];\n\tlet brace_depth = 0;\n\n\t/** Skip template text from `index` to the closing backtick or the next substitution. */\n\tfunction skip_template_text() {\n\t\twhile (index < length && source[index] !== '`') {\n\t\t\tif (source[index] === '\\\\') {\n\t\t\t\tindex += 2;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (source[index] === '$' && source[index + 1] === '{') {\n\t\t\t\ttemplate_braces.push(brace_depth);\n\t\t\t\tindex += 2;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tindex += 1;\n\t\t}\n\t\tif (index < length) index += 1;\n\t}\n\n\twhile (index < length) {\n\t\tconst char = source[index];\n\t\tconst next = source[index + 1];\n\t\tif (/\\s/.test(char)) {\n\t\t\tindex += 1;\n\t\t} else if (char === '/' && next === '/') {\n\t\t\twhile (index < length && source[index] !== '\\n') index += 1;\n\t\t} else if (char === '/' && next === '*') {\n\t\t\tconst end = source.indexOf('*/', index + 2);\n\t\t\tindex = end < 0 ? length : end + 2;\n\t\t} else if (char === '\"' || char === \"'\") {\n\t\t\tindex += 1;\n\t\t\twhile (index < length && source[index] !== char && source[index] !== '\\n') {\n\t\t\t\tif (source[index] === '\\\\') index += 1;\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t\tindex += 1;\n\t\t} else if (char === '`') {\n\t\t\tindex += 1;\n\t\t\tskip_template_text();\n\t\t} else if (\n\t\t\tchar === '}' &&\n\t\t\ttemplate_braces.length > 0 &&\n\t\t\ttemplate_braces[template_braces.length - 1] === brace_depth\n\t\t) {\n\t\t\t// The substitution closed: back into the template literal's text.\n\t\t\ttemplate_braces.pop();\n\t\t\tindex += 1;\n\t\t\tskip_template_text();\n\t\t} else if (/[A-Za-z_$]/.test(char)) {\n\t\t\tlet end = index + 1;\n\t\t\twhile (end < length && /[\\w$]/.test(source[end])) end += 1;\n\t\t\ttokens.push({ kind: 'word', text: source.slice(index, end) });\n\t\t\tindex = end;\n\t\t} else if (char === '?' && next === '.') {\n\t\t\ttokens.push({ kind: 'question-dot', text: '?.' });\n\t\t\tindex += 2;\n\t\t} else if (char === '.') {\n\t\t\ttokens.push({ kind: 'dot', text: '.' });\n\t\t\tindex += 1;\n\t\t} else {\n\t\t\tif (char === '{') brace_depth += 1;\n\t\t\telse if (char === '}') brace_depth -= 1;\n\t\t\ttokens.push({ kind: 'other', text: char });\n\t\t\tindex += 1;\n\t\t}\n\t}\n\treturn tokens;\n}\n\n/**\n * Detect exact platform property paths (`import.meta.env.platform.web` and\n * the `ios` and `android` twins) without matching comments or string\n * literals, and without TypeScript's scanner so the native path needs no\n * TypeScript.\n *\n * @param {string} source\n * @param {unknown} [_typescript] Accepted for older callers; unused.\n * @returns {boolean}\n */\nexport function source_uses_platform_flag(source, _typescript) {\n\tconst tokens = tokenize_member_chains(source);\n\tconst prefix = ['import', '.', 'meta', '.', 'env', '.', 'platform', '.'];\n\tfor (let index = 0; index + prefix.length < tokens.length; index += 1) {\n\t\tif (\n\t\t\tindex > 0 &&\n\t\t\t(tokens[index - 1].kind === 'dot' || tokens[index - 1].kind === 'question-dot')\n\t\t) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (!prefix.every((text, offset) => tokens[index + offset].text === text)) continue;\n\t\tconst name = tokens[index + prefix.length].text;\n\t\tif (name === 'web' || name === 'ios' || name === 'android') return true;\n\t}\n\treturn false;\n}\n\n/**\n * @param {CompilerResolutionOptions} [options]\n * @returns {TsrxLanguagePlugin}\n */\nexport function getTsrxLanguagePlugin(options = {}) {\n\tlog('Creating TSRX language plugin...');\n\t// `ts` is only needed by the TypeScript-facing parts of the plugin (the\n\t// classic path); the native backend creates the plugin without one.\n\tconst typescript = options.ts;\n\t/** @type {CompilerResolutionOptions} */\n\tconst compiler_resolution_options = {\n\t\t...options,\n\t\tconfigHost: options.configHost ?? NODE_CONFIG_HOST,\n\t};\n\n\treturn {\n\t\tgetLanguageId(fileNameOrUri) {\n\t\t\tconst file_name =\n\t\t\t\ttypeof fileNameOrUri === 'string'\n\t\t\t\t\t? fileNameOrUri\n\t\t\t\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n\t\t\tif (is_tsrx_file(file_name)) {\n\t\t\t\tlog('Identified TSRX file:', file_name);\n\t\t\t\treturn 'tsrx';\n\t\t\t}\n\t\t},\n\t\tcreateVirtualCode(fileNameOrUri, languageId, snapshot) {\n\t\t\tif (languageId === 'tsrx') {\n\t\t\t\tconst file_name = normalizeFileNameOrUri(fileNameOrUri);\n\t\t\t\tconst compiler = get_tsrx_compiler(file_name, compiler_resolution_options);\n\t\t\t\tif (!compiler) {\n\t\t\t\t\tlogError(`TSRX compiler not found for file: ${file_name}`);\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\tlog('Creating virtual code for:', file_name);\n\t\t\t\ttry {\n\t\t\t\t\treturn new TSRXVirtualCode(file_name, snapshot, compiler, (required) =>\n\t\t\t\t\t\tresolve_consumer_platform_for_file(file_name, {\n\t\t\t\t\t\t\t...compiler_resolution_options,\n\t\t\t\t\t\t\trequirePlatformResolution: required,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tlogError('Failed to create virtual code for:', file_name, ':', err);\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\t\tupdateVirtualCode(fileNameOrUri, virtualCode, snapshot) {\n\t\t\tif (virtualCode instanceof TSRXVirtualCode) {\n\t\t\t\tlog('Updating existing virtual code for:', virtualCode.fileName);\n\t\t\t\tvirtualCode.update(snapshot);\n\t\t\t\treturn virtualCode;\n\t\t\t}\n\t\t\treturn undefined;\n\t\t},\n\n\t\ttypescript: {\n\t\t\textraFileExtensions: TSRX_EXTENSIONS.map((extension) => ({\n\t\t\t\textension: extension.slice(1),\n\t\t\t\tisMixedContent: false,\n\t\t\t\tscriptKind: 7,\n\t\t\t})),\n\t\t\t/**\n\t\t\t * @param {VirtualCode} tsrx_code\n\t\t\t */\n\t\t\tgetServiceScript(tsrx_code) {\n\t\t\t\tfor (const code of forEachEmbeddedCode(tsrx_code)) {\n\t\t\t\t\tif (code.languageId === 'tsrx') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcode,\n\t\t\t\t\t\t\textension: '.tsx',\n\t\t\t\t\t\t\tscriptKind: 4,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t},\n\t};\n}\n\n/**\n * @implements {VirtualCode}\n */\n/**\n * File names (as TypeScript spells them) whose last TSRX compilation failed.\n * While a file is in this state its generated code is the raw source, so every\n * TypeScript diagnostic on it would be noise; the tsserver plugin (`index.js`)\n * drops them, as the classic language server's diagnostic filter does, and the\n * TSRX compile error is reported by the language server instead.\n * @type {Set<string>}\n */\nexport const files_with_fatal_compile_error = new Set();\n\n/**\n * @param {string} file_name\n * @returns {boolean}\n */\nexport function has_fatal_compile_error(file_name) {\n\treturn files_with_fatal_compile_error.has(normalize_file_name_key(file_name));\n}\n\n/**\n * @param {string} file_name\n * @returns {string}\n */\nfunction normalize_file_name_key(file_name) {\n\treturn file_name.replace(/\\\\/g, '/').toLowerCase();\n}\n\nexport class TSRXVirtualCode {\n\t/** @type {string} */\n\tid = 'root';\n\t/** @type {string} */\n\tlanguageId = 'tsrx';\n\t/** @type {unknown[]} */\n\tcodegenStacks = [];\n\t/** @type {TSRXCompilerModule} */\n\ttsrx;\n\t/** @type {((required: boolean) => 'web' | 'ios' | 'android' | undefined) | undefined} */\n\tplatformProvider;\n\t/** @type {string} */\n\tgeneratedCode = '';\n\t/** @type {VirtualCode['embeddedCodes']} */\n\tembeddedCodes = [];\n\t/** @type {CodeMapping[]} */\n\tmappings = [];\n\t/** @type {CompileError[]} */\n\tfatalErrors = [];\n\t/** @type {CompileError[]} */\n\tusageErrors = [];\n\t/** @type {IScriptSnapshot} */\n\tsnapshot;\n\t/** @type {IScriptSnapshot} */\n\tsourceSnapshot;\n\t/** @type {string} */\n\toriginalCode = '';\n\t/** @type {AST.Program | null} */\n\tsourceAst = null;\n\t/** @type {boolean} */\n\tisDotCompletionMode = false;\n\t/** @type {unknown[]} */\n\tdiagnostics = [];\n\t/** @type {CachedMappings | null} */\n\t#mappingGenToSource = null;\n\t/** @type {CachedMappings | null} */\n\t#mappingSourceToGen = null;\n\n\t/**\n\t * @param {string} file_name\n\t * @param {IScriptSnapshot} snapshot\n\t * @param {TSRXCompilerModule} tsrx\n\t * @param {(required: boolean) => 'web' | 'ios' | 'android' | undefined} [platform_provider]\n\t */\n\tconstructor(file_name, snapshot, tsrx, platform_provider) {\n\t\tlog('Initializing TSRXVirtualCode for:', file_name);\n\n\t\tthis.fileName = file_name;\n\t\tthis.tsrx = tsrx;\n\t\tthis.platformProvider = platform_provider;\n\t\tthis.snapshot = snapshot;\n\t\tthis.sourceSnapshot = snapshot;\n\t\tthis.originalCode = snapshot.getText(0, snapshot.getLength());\n\n\t\t// Validate the selected TSRX compiler.\n\t\tif (!tsrx || typeof tsrx.compile_to_volar_mappings !== 'function') {\n\t\t\tlogError('Invalid TSRX compiler - missing compile_to_volar_mappings method');\n\t\t\tthrow new Error('Invalid TSRX compiler');\n\t\t}\n\n\t\tthis.update(snapshot);\n\t}\n\n\t/**\n\t * @param {IScriptSnapshot} snapshot\n\t * @returns {void}\n\t */\n\tupdate(snapshot) {\n\t\tlog('Updating virtual code for:', this.fileName);\n\n\t\tconst newCode = snapshot.getText(0, snapshot.getLength());\n\t\tconst changeRange = snapshot.getChangeRange(this.sourceSnapshot);\n\t\tthis.sourceSnapshot = snapshot;\n\n\t\t// Only clear mapping index - don't update snapshot/originalCode yet\n\t\tthis.#mappingGenToSource = null;\n\t\tthis.#mappingSourceToGen = null;\n\n\t\tthis.fatalErrors = [];\n\t\tthis.usageErrors = [];\n\t\tthis.sourceAst = null;\n\t\tthis.isDotCompletionMode = false;\n\n\t\t// Check if a single \".\" was typed using changeRange\n\t\tlet isDotTyped = false;\n\t\tlet dotPosition = -1;\n\n\t\tlog('changeRange:', JSON.stringify(changeRange));\n\n\t\tif (changeRange) {\n\t\t\tconst changeStart = changeRange.span.start;\n\t\t\tconst changeEnd = changeStart + changeRange.span.length;\n\t\t\tconst newEnd = changeStart + changeRange.newLength;\n\n\t\t\t// Get the old text (what was replaced) from originalCode\n\t\t\tconst oldText = this.originalCode.substring(changeStart, changeEnd);\n\t\t\t// Get the new text (what replaced it) from newCode\n\t\t\tconst newText = newCode.substring(changeStart, newEnd);\n\n\t\t\tlog('Change details:');\n\t\t\tlog(' Position:', changeStart, '-', changeEnd, '(length:', changeRange.span.length, ')');\n\t\t\tlog(' Old text:', JSON.stringify(oldText));\n\t\t\tlog(' New text:', JSON.stringify(newText), '(length:', changeRange.newLength, ')');\n\n\t\t\t// Check if a dot was added at the end of the new text\n\t\t\tif (newText.endsWith('.')) {\n\t\t\t\t// The dot is at position newEnd - 1\n\t\t\t\t// We need to check the character BEFORE the dot (inside the new text)\n\t\t\t\tconst charBeforeDot = newEnd > 1 ? newCode[newEnd - 2] : '';\n\t\t\t\tlog(' Char before dot:', JSON.stringify(charBeforeDot));\n\n\t\t\t\tif (/[$#_\\u200C\\u200D\\p{ID_Continue}\\)\\]\\}]/u.test(charBeforeDot)) {\n\t\t\t\t\tisDotTyped = true;\n\t\t\t\t\tdotPosition = newEnd - 1; // Position of the dot\n\t\t\t\t\tlog('ChangeRange detected dot typed at position', dotPosition);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** @type {TsrxTransformResult} */\n\t\tlet result;\n\t\ttry {\n\t\t\tconst platform = this.platformProvider?.(source_uses_platform_flag(newCode));\n\t\t\t// If user typed a \".\", compile without it and then stitch it back into\n\t\t\t// the generated output so completions can still resolve.\n\t\t\tif (isDotTyped && dotPosition >= 0) {\n\t\t\t\tthis.isDotCompletionMode = true;\n\t\t\t\tconst codeWithoutDot =\n\t\t\t\t\tnewCode.substring(0, dotPosition) + newCode.substring(dotPosition + 1);\n\n\t\t\t\tlog('Compiling without typed dot at position', dotPosition);\n\t\t\t\tresult = transform_tsrx(this.tsrx, this.fileName, codeWithoutDot, { platform });\n\n\t\t\t\tif (!result.fatalError && result.text && result.mappings.length > 0) {\n\t\t\t\t\tlog('Compilation without dot successful');\n\t\t\t\t\tconst insertedDotPosition = restore_typed_dot_in_transpiled_code(result, dotPosition);\n\n\t\t\t\t\tif (insertedDotPosition === null) {\n\t\t\t\t\t\tlogWarning('Failed to restore typed dot into transpiled output');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog('Inserted typed dot at generated position', insertedDotPosition);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlog('Compiling TSRX code...');\n\t\t\t\tresult = transform_tsrx(this.tsrx, this.fileName, newCode, { platform });\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// Platform resolution failed (invalid tsconfig): treat it like a compile failure.\n\t\t\tconst error = /** @type {CompileError} */ (e);\n\t\t\terror.type = 'fatal';\n\t\t\tresult = {\n\t\t\t\ttext: '',\n\t\t\t\tmappings: [],\n\t\t\t\tcssRegions: [],\n\t\t\t\tscriptRegions: [],\n\t\t\t\terrors: [],\n\t\t\t\tfatalError: error,\n\t\t\t\tsourceAst: null,\n\t\t\t};\n\t\t}\n\n\t\tif (result.fatalError) {\n\t\t\tlogError('TSRX compilation failed for', this.fileName, ':', result.fatalError);\n\t\t\tif (process.env.TSRX_TSC === 'true') {\n\t\t\t\tlogTSRXErrors(this.fileName, [result.fatalError]);\n\t\t\t}\n\t\t\tthis.fatalErrors.push(result.fatalError);\n\t\t\tfiles_with_fatal_compile_error.add(normalize_file_name_key(this.fileName));\n\t\t} else {\n\t\t\tlog('Compilation successful, generated code length:', result.text.length);\n\t\t\tfiles_with_fatal_compile_error.delete(normalize_file_name_key(this.fileName));\n\t\t}\n\n\t\tthis.originalCode = newCode;\n\n\t\tif (!result.fatalError && result.text) {\n\t\t\t// Successful compilation - update everything\n\t\t\tthis.generatedCode = result.text;\n\t\t\tthis.mappings = result.mappings;\n\t\t\tthis.usageErrors = result.errors;\n\t\t\tthis.sourceAst = result.sourceAst;\n\n\t\t\tif (process.env.TSRX_TSC === 'true' && result.errors.length > 0) {\n\t\t\t\tlogTSRXErrors(this.fileName, result.errors);\n\t\t\t}\n\n\t\t\tif (result.cssRegions.length > 0) {\n\t\t\t\tlog('Creating', result.cssRegions.length, 'CSS embedded codes');\n\t\t\t}\n\t\t\t// `<script>` bodies are not embedded codes: the transform appends each one\n\t\t\t// to the generated TSX as a block (`embed_script_bodies`), so TypeScript\n\t\t\t// checks them in the same file on every path. Only CSS is embedded.\n\t\t\tthis.embeddedCodes = result.cssRegions.map((region) =>\n\t\t\t\tcreate_embedded_code_from_region(region, 'css'),\n\t\t\t);\n\n\t\t\tif (DEBUG) {\n\t\t\t\tlog('CSS embedded codes:', (this.embeddedCodes || []).length);\n\t\t\t\tlog('Using transpiled code, mapping count:', this.mappings.length);\n\t\t\t\tlog('Original code length:', newCode.length);\n\t\t\t\tlog('Generated code length:', this.generatedCode.length);\n\t\t\t\tlog('Last 100 chars of original:', JSON.stringify(newCode.slice(-100)));\n\t\t\t\tlog('Last 200 chars of generated:', JSON.stringify(this.generatedCode.slice(-200)));\n\t\t\t\tlog('Last few mappings:');\n\t\t\t\tconst startIdx = Math.max(0, this.mappings.length - 5);\n\t\t\t\tfor (let i = startIdx; i < this.mappings.length; i++) {\n\t\t\t\t\tconst m = this.mappings[i];\n\t\t\t\t\tlog(\n\t\t\t\t\t\t` Mapping ${i}: source[${m.sourceOffsets[0]}:${m.sourceOffsets[0] + m.lengths[0]}] -> gen[${m.generatedOffsets[0]}:${m.generatedOffsets[0] + m.lengths[0]}], len=${m.lengths[0]}, completion=${m.data?.completion}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// When compilation fails, show where it failed and disable all\n\t\t\t// TypeScript diagnostics until the compilation error is fixed\n\t\t\tlog('Compilation failed, only display where the compilation error occurred.');\n\n\t\t\t// Feed the raw source back as the generated code, with verification\n\t\t\t// enabled. This lets TS parse it and surface errors at the broken\n\t\t\t// construct itself — important when a TSRX compile error has no `pos`\n\t\t\t// (or an unreliable one), since the dedicated diagnostic plugin would\n\t\t\t// otherwise pin the error to offset 0 (top of file, off-screen) and the\n\t\t\t// user would have no signal pointing at the actual problem.\n\t\t\tthis.generatedCode = newCode;\n\n\t\t\t// Create 1:1 mappings for the entire content.\n\t\t\t//\n\t\t\t// Enable `completion` on this fallback mapping. Volar only invokes\n\t\t\t// completion providers at a cursor position when some mapping covering\n\t\t\t// it has the completion capability (isCompletionEnabled === !!data.completion).\n\t\t\t// Without it, a transient compile error (e.g. a half-typed `@if`) would\n\t\t\t// disable ALL completions in the file, so the user gets no suggestions to\n\t\t\t// help them finish the very construct that is broken. Keeping completion on\n\t\t\t// lets template-directive and TypeScript completions surface while editing.\n\t\t\tthis.mappings = [\n\t\t\t\t{\n\t\t\t\t\tsourceOffsets: [0],\n\t\t\t\t\tgeneratedOffsets: [0],\n\t\t\t\t\tlengths: [newCode.length],\n\t\t\t\t\tgeneratedLengths: [newCode.length],\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tcompletion: true,\n\t\t\t\t\t\tverification: true,\n\t\t\t\t\t\tcustomData: {},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\n\t\t\t// Extract CSS from <style> tags for embedded codes, so CSS intellisense\n\t\t\t// keeps working while the file has a transient compile error elsewhere.\n\t\t\tthis.embeddedCodes = extract_css_regions(newCode).map((region) =>\n\t\t\t\tcreate_embedded_code_from_region(region, 'css'),\n\t\t\t);\n\t\t}\n\n\t\tthis.snapshot = /** @type {IScriptSnapshot} */ ({\n\t\t\tgetText: (start, end) => this.generatedCode.substring(start, end),\n\t\t\tgetLength: () => this.generatedCode.length,\n\t\t\tgetChangeRange: () => undefined,\n\t\t});\n\t}\n\n\t#buildMappingCache() {\n\t\tif (this.#mappingGenToSource || this.#mappingSourceToGen) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#mappingGenToSource = new Map();\n\t\tthis.#mappingSourceToGen = new Map();\n\n\t\tvar mapping, genStart, genLength, genEnd, genKey;\n\t\tvar sourceStart, sourceLength, sourceEnd, sourceKey;\n\t\tfor (var i = 0; i < this.mappings.length; i++) {\n\t\t\tmapping = this.mappings[i];\n\n\t\t\tgenStart = mapping.generatedOffsets[0];\n\t\t\tgenLength = mapping.generatedLengths[0];\n\t\t\tgenEnd = genStart + genLength;\n\t\t\tgenKey = `${genStart}-${genEnd}`;\n\t\t\tthis.#mappingGenToSource.set(genKey, mapping);\n\n\t\t\tsourceStart = mapping.sourceOffsets[0];\n\t\t\tsourceLength = mapping.lengths[0];\n\t\t\tsourceEnd = sourceStart + sourceLength;\n\t\t\tsourceKey = `${sourceStart}-${sourceEnd}`;\n\t\t\tthis.#mappingSourceToGen.set(sourceKey, mapping);\n\t\t}\n\t}\n\n\t/**\n\t * Find mapping by generated range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingByGeneratedRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingGenToSource).get(`${start}-${end}`) ?? null;\n\t}\n\n\t/**\n\t * Find mapping by source range\n\t * @param {number} start - The start offset of the range\n\t * @param {number} end - The end offset of the range\n\t * @returns {CodeMapping | null} The mapping for this range, or null if not found\n\t */\n\tfindMappingBySourceRange(start, end) {\n\t\tthis.#buildMappingCache();\n\t\treturn /** @type {CachedMappings} */ (this.#mappingSourceToGen).get(`${start}-${end}`) ?? null;\n\t}\n\n\t/**\n\t * Resolve a source range to a generated `[start, end]` offset pair by spanning\n\t * the token mappings that overlap it.\n\t *\n\t * Statement and element source ranges are only ever covered by several\n\t * granular token mappings (e.g. `const test = 5;` maps as `const `, `test`,\n\t * ` = `, `5`, `;`), and keywords/punctuation are frequently dropped entirely,\n\t * so an exact `findMappingBySourceRange` lookup never matches a multi-token\n\t * range and the endpoints often fall on unmapped tokens. Callers that have a\n\t * range with no exact mapping (such as compile-error diagnostics) use this to\n\t * land on the range: the generated start comes from the first overlapping\n\t * token and the generated end from the last, so an error pointing at a `const`\n\t * keyword still resolves via the `test`/`5` tokens that follow it.\n\t *\n\t * @param {number} start - Start of the source range\n\t * @param {number} end - Exclusive end of the source range\n\t * @returns {[number, number] | null} Generated `[start, end]`, or null if no\n\t * token overlaps the range\n\t */\n\tfindGeneratedRangeBySourceRange(start, end) {\n\t\t/** @type {CodeMapping | null} */\n\t\tlet first = null;\n\t\t/** @type {CodeMapping | null} */\n\t\tlet last = null;\n\t\tfor (let i = 0; i < this.mappings.length; i++) {\n\t\t\tconst mapping = this.mappings[i];\n\t\t\tconst sourceStart = mapping.sourceOffsets[0];\n\t\t\tconst sourceEnd = sourceStart + mapping.lengths[0];\n\t\t\t// Skip tokens that do not overlap the half-open range [start, end).\n\t\t\tif (sourceEnd <= start || sourceStart >= end) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!first || sourceStart < first.sourceOffsets[0]) {\n\t\t\t\tfirst = mapping;\n\t\t\t}\n\t\t\tif (!last || sourceEnd > last.sourceOffsets[0] + last.lengths[0]) {\n\t\t\t\tlast = mapping;\n\t\t\t}\n\t\t}\n\t\tif (!first || !last) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Offset into the first/last token, clamped so an endpoint that lands\n\t\t// before/after the token (an unmapped keyword or punctuation) snaps to the\n\t\t// token edge rather than escaping its generated span.\n\t\tconst generated_start =\n\t\t\tfirst.generatedOffsets[0] +\n\t\t\tclamp_offset(start - first.sourceOffsets[0], first.generatedLengths[0]);\n\t\tconst generated_end =\n\t\t\tlast.generatedOffsets[0] +\n\t\t\tclamp_offset(end - last.sourceOffsets[0], last.generatedLengths[0]);\n\t\treturn [generated_start, Math.max(generated_end, generated_start + 1)];\n\t}\n}\n\n/**\n * Clamp an intra-token offset into `[0, length]`.\n * @param {number} offset\n * @param {number} length\n * @returns {number}\n */\nfunction clamp_offset(offset, length) {\n\treturn Math.min(Math.max(offset, 0), length);\n}\n\n/**\n * @param {string} file_name\n * @param {ReadonlyArray<unknown>} errors\n */\nfunction logTSRXErrors(file_name, errors) {\n\tfor (const error of errors) {\n\t\tconst message =\n\t\t\terror && typeof error === 'object' && 'message' in error\n\t\t\t\t? String(/** @type {{ message: unknown }} */ (error).message)\n\t\t\t\t: String(error);\n\t\tconst key = `${file_name}\\0${message}`;\n\t\tif (loggedCompilationFailures.has(key)) {\n\t\t\tcontinue;\n\t\t}\n\t\tloggedCompilationFailures.add(key);\n\t\tconsole.error(`[tsrx-tsc] ${file_name}: ${message}`);\n\t}\n}\n\n/**\n * Build an embedded virtual code from a `<style>` / `<script>` region produced\n * by the transform. The embedded document text is the region's content;\n * `languageId` selects which Volar service handles it (`css` or `typescript`).\n * @param {EmbeddedRegion} region\n * @param {string} languageId\n * @returns {VirtualCode}\n */\nfunction create_embedded_code_from_region(region, languageId) {\n\tconst content = region.content;\n\t/** @type {CodeMapping} */\n\tconst mapping = {\n\t\tsourceOffsets: [region.start],\n\t\tgeneratedOffsets: [0],\n\t\tlengths: [region.length],\n\t\tgeneratedLengths: [region.length],\n\t\tdata: {\n\t\t\tverification: true,\n\t\t\tcompletion: true,\n\t\t\tsemantic: true,\n\t\t\tnavigation: true,\n\t\t\tstructure: true,\n\t\t\tformat: false,\n\t\t\tcustomData: {\n\t\t\t\tcontent,\n\t\t\t\tembeddedId: region.id,\n\t\t\t},\n\t\t},\n\t};\n\treturn {\n\t\tid: region.id,\n\t\tlanguageId,\n\t\tsnapshot: {\n\t\t\tgetText: (/** @type {number} */ start, /** @type {number} */ end) =>\n\t\t\t\tcontent.substring(start, end),\n\t\t\tgetLength: () => region.length,\n\t\t\tgetChangeRange: () => undefined,\n\t\t},\n\t\tmappings: [mapping],\n\t\tembeddedCodes: [],\n\t};\n}\n\n/**\n * Insert a typed dot back into the transpiled code and update mappings so the\n * source and generated offsets stay aligned for completion requests.\n * @param {TsrxTransformResult} transpiled\n * @param {number} dotPosition\n * @returns {number | null}\n */\nfunction restore_typed_dot_in_transpiled_code(transpiled, dotPosition) {\n\tlet dot_mapping = null;\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tconst source_end = mapping.sourceOffsets[0] + mapping.lengths[0];\n\t\tif (source_end === dotPosition) {\n\t\t\tdot_mapping = mapping;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!dot_mapping) {\n\t\treturn null;\n\t}\n\n\tconst generated_length = dot_mapping.generatedLengths[0];\n\tconst insertedDotPosition = dot_mapping.generatedOffsets[0] + generated_length;\n\n\ttranspiled.text =\n\t\ttranspiled.text.substring(0, insertedDotPosition) +\n\t\t'.' +\n\t\ttranspiled.text.substring(insertedDotPosition);\n\n\t// Create a separate 1:1 mapping for the dot character instead of extending\n\t// the existing mapping. When source and generated lengths differ (e.g.\n\t// #state → _$__u0023_state), Volar's translateOffset uses\n\t// Math.min(relativePos, toLength) which would map the cursor after the dot\n\t// to the middle of the generated identifier instead of after it.\n\n\t/** @type {CodeMapping} */\n\tconst new_dot_mapping = {\n\t\tsourceOffsets: [dotPosition],\n\t\tgeneratedOffsets: [insertedDotPosition],\n\t\tlengths: [1],\n\t\tgeneratedLengths: [1],\n\t\tdata: { ...dot_mapping.data },\n\t};\n\n\t// Find the index to insert after dot_mapping\n\tconst dot_mapping_index = transpiled.mappings.indexOf(dot_mapping);\n\ttranspiled.mappings.splice(dot_mapping_index + 1, 0, new_dot_mapping);\n\n\tfor (const mapping of transpiled.mappings) {\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.generatedOffsets[0] >= insertedDotPosition\n\t\t) {\n\t\t\tmapping.generatedOffsets[0] += 1;\n\t\t}\n\t\tif (\n\t\t\tmapping !== dot_mapping &&\n\t\t\tmapping !== new_dot_mapping &&\n\t\t\tmapping.sourceOffsets[0] >= dotPosition\n\t\t) {\n\t\t\tmapping.sourceOffsets[0] += 1;\n\t\t}\n\t}\n\n\treturn insertedDotPosition;\n}\n\n/**\n * @template T\n * @param {{ options?: CompilerOptions } & T} config\n * @returns {{ options: CompilerOptions } & T}\n */\nexport const resolveConfig = (config) => {\n\tconst baseOptions = config.options ?? /** @type {CompilerOptions} */ ({});\n\t/** @type {CompilerOptions} */\n\tconst options = { ...baseOptions };\n\n\t// Only the classic path (a TypeScript language service host) asks for\n\t// resolved compiler options, so TypeScript is loaded here and not at import.\n\tconst ts = /** @type {typeof import('typescript')} */ (require('typescript'));\n\n\t// Default target: align with modern bundlers while staying configurable.\n\tif (options.target === undefined) {\n\t\toptions.target = ts.ScriptTarget.ESNext;\n\t}\n\n\t// Leave `lib` unchanged. When omitted, TypeScript selects the target's\n\t// default library through the active language-service host. `lib: []`\n\t// and `noLib` must retain their distinct TypeScript semantics.\n\n\t// Default typeRoots: automatically discover @types like tsserver.\n\tif (!options.types) {\n\t\tconst host = ts.createCompilerHost(options);\n\t\tconst typeRoots = ts.getEffectiveTypeRoots(options, host);\n\t\tif (typeRoots && typeRoots.length > 0) {\n\t\t\toptions.typeRoots = typeRoots;\n\t\t}\n\t}\n\n\treturn {\n\t\t...config,\n\t\toptions,\n\t};\n};\n\n/** @type {Map<string, string | null>} */\nexport const path2TsrxCompilerPathMap = new Map();\n/** @type {Map<string, { mtimeMs: number, size: number, content: string }>} */\nconst pathToTypesCache = new Map();\n/** @type {Map<string, { text: string, matches: Map<string, RegExpMatchArray> }>} */\nconst typeNameMatchCache = new Map();\n/** @type {Map<string, { name: string | null, dependencies: Set<string> } | null>} */\nconst pathToPackageManifestCache = new Map();\n\n/**\n * @param {ScriptId} fileNameOrUri\n * @returns {string}\n */\nexport function normalizeFileNameOrUri(fileNameOrUri) {\n\treturn typeof fileNameOrUri === 'string'\n\t\t? fileNameOrUri\n\t\t: fileNameOrUri.fsPath.replace(/\\\\/g, '/');\n}\n\n/**\n * @param {string} start_dir\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @returns {{ name: string | null, dependencies: Set<string> } | null}\n */\nfunction get_nearest_package_manifest(start_dir, exists_sync = fs.existsSync) {\n\tlet current_dir = start_dir;\n\t/** @type {string[]} */\n\tconst visited_dirs = [];\n\n\twhile (current_dir) {\n\t\tif (pathToPackageManifestCache.has(current_dir)) {\n\t\t\tconst cached_manifest = pathToPackageManifestCache.get(current_dir) ?? null;\n\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\tpathToPackageManifestCache.set(visited_dir, cached_manifest);\n\t\t\t}\n\t\t\treturn cached_manifest;\n\t\t}\n\n\t\tvisited_dirs.push(current_dir);\n\n\t\tconst package_json_path = path.join(current_dir, 'package.json');\n\t\tif (exists_sync(package_json_path)) {\n\t\t\ttry {\n\t\t\t\tconst package_json = JSON.parse(fs.readFileSync(package_json_path, 'utf8'));\n\t\t\t\tconst dependencies = new Set([\n\t\t\t\t\t...Object.keys(package_json.dependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.devDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.peerDependencies ?? {}),\n\t\t\t\t\t...Object.keys(package_json.optionalDependencies ?? {}),\n\t\t\t\t]);\n\t\t\t\tconst package_manifest = {\n\t\t\t\t\tname: typeof package_json.name === 'string' ? package_json.name : null,\n\t\t\t\t\tdependencies,\n\t\t\t\t};\n\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, package_manifest);\n\t\t\t\t}\n\n\t\t\t\treturn package_manifest;\n\t\t\t} catch {\n\t\t\t\tfor (const visited_dir of visited_dirs) {\n\t\t\t\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\tfor (const visited_dir of visited_dirs) {\n\t\tpathToPackageManifestCache.set(visited_dir, null);\n\t}\n\n\treturn null;\n}\n\n/**\n * @param {{ name: string | null, dependencies: Set<string> } | null} package_manifest\n * @param {string} compiler_name\n * @param {string[]} package_hints\n * @returns {boolean}\n */\nfunction package_manifest_matches_compiler(package_manifest, compiler_name, package_hints) {\n\tif (!package_manifest) {\n\t\treturn false;\n\t}\n\n\tif (\n\t\tpackage_manifest.name === compiler_name ||\n\t\tpackage_hints.includes(package_manifest.name ?? '')\n\t) {\n\t\treturn true;\n\t}\n\n\tif (package_manifest.dependencies.has(compiler_name)) {\n\t\treturn true;\n\t}\n\n\tfor (const package_hint of package_hints) {\n\t\tif (package_manifest.dependencies.has(package_hint)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Resolve and load the TSRX compiler that owns a `.tsrx` file.\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {TSRXCompilerModule | undefined}\n */\nexport function get_tsrx_compiler(normalized_file_name, options) {\n\tconst compiler_path = get_compiler_entry_for_file(normalized_file_name, options);\n\tif (compiler_path) {\n\t\treturn require_tsrx_compiler(compiler_path);\n\t}\n}\n\n/**\n * Load a resolved compiler entry and normalize its contract.\n * @param {string} compiler_path\n * @returns {TSRXCompilerModule}\n */\nexport function require_tsrx_compiler(compiler_path) {\n\treturn normalize_tsrx_compiler_module(require(compiler_path));\n}\n\n/**\n * Normalize the compiler contract used by Octane and consumer-declared modules.\n * @param {TSRXCompilerModule & { compileToVolarMappings?: TSRXCompilerModule['compile_to_volar_mappings'] }} compiler_module\n * @returns {TSRXCompilerModule}\n */\nfunction normalize_tsrx_compiler_module(compiler_module) {\n\tif (\n\t\ttypeof compiler_module?.compile_to_volar_mappings !== 'function' &&\n\t\ttypeof compiler_module?.compileToVolarMappings === 'function'\n\t) {\n\t\treturn {\n\t\t\t...compiler_module,\n\t\t\tcompile_to_volar_mappings: compiler_module.compileToVolarMappings,\n\t\t};\n\t}\n\treturn compiler_module;\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {(file_path: import('fs').PathLike) => boolean} [exists_sync]\n * @param {Map<string, string | null>} [compiler_path_map]\n * @returns {string | undefined}\n */\nexport function find_workspace_compiler_entry_for_file(\n\tnormalized_file_name,\n\texists_sync = fs.existsSync,\n\tcompiler_path_map = path2TsrxCompilerPathMap,\n) {\n\tconst parts = normalized_file_name.split('/');\n\tconst ext = path.extname(normalized_file_name);\n\n\tfor (let i = parts.length - 2; i >= 0; i--) {\n\t\tconst dir = parts.slice(0, i + 1).join('/');\n\t\tconst cache_key = dir + '\\0' + ext;\n\n\t\tif (!compiler_path_map.has(cache_key)) {\n\t\t\t/** @type {Array<[string, string, string[]]>} */\n\t\t\tconst available_candidates = [];\n\t\t\tfor (const [\n\t\t\t\tcompiler_name,\n\t\t\t\tcompiler_dir_parts,\n\t\t\t\tsupported_extensions,\n\t\t\t\tpackage_hints,\n\t\t\t\tentry_candidates = DEFAULT_COMPILER_ENTRY_CANDIDATES,\n\t\t\t] of COMPILER_CANDIDATES) {\n\t\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfor (const entry_parts of entry_candidates) {\n\t\t\t\t\tconst full_path = [dir, ...compiler_dir_parts, ...entry_parts].join('/');\n\t\t\t\t\tif (exists_sync(full_path)) {\n\t\t\t\t\t\tavailable_candidates.push([compiler_name, full_path, package_hints]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet found_path = null;\n\t\t\tif (available_candidates.length > 0) {\n\t\t\t\tconst package_manifest = get_nearest_package_manifest(dir, exists_sync);\n\t\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t\t);\n\t\t\t\tfound_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\t\tlog('Found tsrx compiler at:', found_path, 'for extension:', ext);\n\t\t\t}\n\n\t\t\tcompiler_path_map.set(cache_key, found_path);\n\t\t}\n\n\t\tconst compiler_path = compiler_path_map.get(cache_key);\n\t\tif (compiler_path) {\n\t\t\treturn compiler_path;\n\t\t}\n\t}\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | undefined}\n */\nexport function get_compiler_entry_for_file(normalized_file_name, options) {\n\tconst ext = path.extname(normalized_file_name);\n\tconst consumer_compiler_path = resolve_consumer_compiler_for_file(normalized_file_name, options);\n\tif (consumer_compiler_path !== undefined) {\n\t\treturn consumer_compiler_path ?? undefined;\n\t}\n\tconst package_manifest = get_nearest_package_manifest(path.dirname(normalized_file_name));\n\n\tconst workspace_compiler_path = find_workspace_compiler_entry_for_file(normalized_file_name);\n\tif (workspace_compiler_path) {\n\t\treturn workspace_compiler_path;\n\t}\n\n\tconst warn_message = `No supported tsrx compiler found in workspace for ${normalized_file_name}.`;\n\n\t// Fallback: look for a packaged compiler.\n\tlet current_dir = root_dirname;\n\n\twhile (current_dir) {\n\t\t/** @type {Array<[string, string, string[]]>} */\n\t\tconst available_candidates = [];\n\t\tfor (const [\n\t\t\tcompiler_name,\n\t\t\tcompiler_dir_parts,\n\t\t\tsupported_extensions,\n\t\t\tpackage_hints,\n\t\t\tentry_candidates = DEFAULT_COMPILER_ENTRY_CANDIDATES,\n\t\t] of COMPILER_CANDIDATES) {\n\t\t\tif (!supported_extensions.includes(ext)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst full_path = path.join(current_dir, ...compiler_dir_parts);\n\t\t\tfor (const entry_parts of entry_candidates) {\n\t\t\t\tconst entry_path = path.join(full_path, ...entry_parts);\n\t\t\t\tif (fs.existsSync(entry_path)) {\n\t\t\t\t\tavailable_candidates.push([compiler_name, entry_path, package_hints]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (available_candidates.length > 0) {\n\t\t\tconst preferred_candidate = available_candidates.find(([compiler_name, , package_hints]) =>\n\t\t\t\tpackage_manifest_matches_compiler(package_manifest, compiler_name, package_hints),\n\t\t\t);\n\t\t\tconst entry_path = preferred_candidate?.[1] ?? available_candidates[0][1];\n\t\t\tlogWarning(`${warn_message} Using packaged version at ${entry_path}`);\n\t\t\treturn entry_path;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Resolve the tsrx compiler package that owns a `.tsrx` file (e.g. `'@tsrx/ripple'`,\n * `'@tsrx/react'`) from the exact compiler entry selected for compilation. All\n * targets share the `.tsrx` extension, so this is how the editor layer tells them\n * apart. Returns `undefined` for an unresolved or unknown third-party compiler.\n * @param {string} file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | undefined}\n */\nexport function get_tsrx_compiler_name_for_file(file_name, options) {\n\tconst entry = get_compiler_entry_for_file(file_name.replace(/\\\\/g, '/'), options);\n\tif (!entry) {\n\t\treturn undefined;\n\t}\n\n\tconst package_name = get_nearest_package_manifest(path.dirname(entry))?.name;\n\tif (COMPILER_CANDIDATES.some(([compiler_name]) => compiler_name === package_name)) {\n\t\treturn package_name ?? undefined;\n\t}\n\n\t// Compatibility fallback for unpackaged compiler fixtures and historical\n\t// source layouts that do not include a readable package manifest.\n\tconst normalized_entry = entry.replace(/\\\\/g, '/');\n\tfor (const [\n\t\tcompiler_name,\n\t\tcompiler_dir_parts,\n\t\t,\n\t\t,\n\t\tentry_candidates = DEFAULT_COMPILER_ENTRY_CANDIDATES,\n\t] of COMPILER_CANDIDATES) {\n\t\tfor (const entry_parts of entry_candidates) {\n\t\t\tconst suffix = '/' + [...compiler_dir_parts, ...entry_parts].join('/');\n\t\t\tif (normalized_entry.endsWith(suffix)) {\n\t\t\t\treturn compiler_name;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Whether a `.tsrx` file is compiled by the Ripple target (as opposed to\n * React/Solid/Preact/Vue). Used to gate Ripple-runtime-only editor suggestions.\n * @param {string} file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {boolean}\n */\nexport function is_ripple_target_file(file_name, options) {\n\treturn get_tsrx_compiler_name_for_file(file_name, options) === '@tsrx/ripple';\n}\n\n/**\n * Create a stable key for filesystem caches. Windows paths are case-insensitive\n * to TypeScript, while file URIs conventionally lowercase their drive letter.\n * @param {string} file_name\n */\nfunction getPathCacheKey(file_name) {\n\tconst is_windows_path =\n\t\tprocess.platform === 'win32' || /^[a-z]:[\\\\/]/i.test(file_name) || file_name.startsWith('\\\\\\\\');\n\tconst path_api = is_windows_path ? path.win32 : path;\n\tconst normalized = path_api.normalize(file_name);\n\treturn is_windows_path ? normalized.toLowerCase() : normalized;\n}\n\n/**\n * @param {string} typesFilePath\n * @returns {string | undefined}\n */\nexport function getCachedTypeDefinitionFile(typesFilePath) {\n\tconst cache_key = getPathCacheKey(typesFilePath);\n\n\tlet stat;\n\ttry {\n\t\tstat = fs.statSync(typesFilePath);\n\t} catch {\n\t\tlogWarning(`Types file does not exist at path: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tconst cached = pathToTypesCache.get(cache_key);\n\tif (cached && cached.mtimeMs === stat.mtimeMs && cached.size === stat.size) {\n\t\treturn cached.content;\n\t}\n\n\tlog(`Found TSRX types at: ${typesFilePath}`);\n\n\t// Read the file to find the class definition offset\n\tconst fileContent = fs.readFileSync(typesFilePath, 'utf8');\n\n\tif (!fileContent) {\n\t\tlogWarning(`Failed to read content of types file at: ${typesFilePath}`);\n\t\treturn;\n\t}\n\n\tpathToTypesCache.set(cache_key, {\n\t\tmtimeMs: stat.mtimeMs,\n\t\tsize: stat.size,\n\t\tcontent: fileContent,\n\t});\n\treturn fileContent;\n}\n\n/**\n * @param {string} typeName\n * @param {string} text\n * @param {string} [sourceKey]\n * @returns {RegExpMatchArray | undefined}\n */\nexport function getCachedTypeMatches(typeName, text, sourceKey = text) {\n\tconst cache_key = sourceKey === text ? text : getPathCacheKey(sourceKey);\n\tlet source_cache = typeNameMatchCache.get(cache_key);\n\tif (!source_cache || source_cache.text !== text) {\n\t\tsource_cache = {\n\t\t\ttext,\n\t\t\tmatches: new Map(),\n\t\t};\n\t\ttypeNameMatchCache.set(cache_key, source_cache);\n\t}\n\n\tconst cached = source_cache.matches.get(typeName);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst searchPattern = new RegExp(\n\t\t`(?:export\\\\s+(?:declare\\\\s+)?|declare\\\\s+)(class|function)\\\\s+${typeName}`,\n\t);\n\n\tconst match = text.match(searchPattern);\n\n\tif (match && match.index !== undefined) {\n\t\tsource_cache.matches.set(typeName, match);\n\t\treturn match;\n\t}\n\n\treturn;\n}\n\n/**\n * @param {string} normalized_file_name\n * @param {CompilerResolutionOptions} [options]\n * @returns {string | undefined}\n */\nexport function get_compiler_dir_for_file(normalized_file_name, options) {\n\tconst entry = get_compiler_entry_for_file(normalized_file_name, options);\n\tif (!entry) {\n\t\treturn undefined;\n\t}\n\n\tlet current_dir = path.dirname(entry);\n\twhile (current_dir) {\n\t\tif (fs.existsSync(path.join(current_dir, 'package.json'))) {\n\t\t\treturn current_dir;\n\t\t}\n\t\tif (path.basename(current_dir) === 'node_modules') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst parent_dir = path.dirname(current_dir);\n\t\tif (parent_dir === current_dir) {\n\t\t\treturn undefined;\n\t\t}\n\t\tcurrent_dir = parent_dir;\n\t}\n}\n\nexport { get_compiler_dir_for_file as getTsrxCompilerDirForFile };\n\n/**\n * Drop compiler-selection state. Loaded ESM compiler graphs cannot be evicted\n * safely in-process; language-server package watchers restart the process.\n */\nexport function invalidateCompilerResolutionCaches() {\n\tpath2TsrxCompilerPathMap.clear();\n\tpathToPackageManifestCache.clear();\n\treset_consumer_compiler_resolution_caches();\n\tloggedCompilationFailures.clear();\n}\n\n/**\n * Drop cached definition-file content and matches. A path invalidates only one\n * file; omitting it clears all definition state.\n * @param {string} [typesFilePath]\n */\nexport function invalidateTypeDefinitionCaches(typesFilePath) {\n\tif (typesFilePath) {\n\t\tconst cache_key = getPathCacheKey(typesFilePath);\n\t\tpathToTypesCache.delete(cache_key);\n\t\ttypeNameMatchCache.delete(cache_key);\n\t\treturn;\n\t}\n\n\tpathToTypesCache.clear();\n\ttypeNameMatchCache.clear();\n}\n\n/** Reset all module-level state used in tests. */\nexport function _reset_for_test() {\n\tinvalidateCompilerResolutionCaches();\n\tinvalidateTypeDefinitionCaches();\n}\n","/** @import * as AST from 'estree' */\n\n/**\n * Build a TypeScript stub that preserves a module's export surface while the\n * file cannot be compiled.\n *\n * The native content-mapper protocol offers no way to suppress TypeScript's\n * own diagnostics, so feeding raw TSRX (or the last good TSX, which may carry\n * type errors of its own) to the checker would produce noise. Instead every\n * export from the last successful transform's source AST is re-declared as\n * `any` (both as a value and as a type, so `new X()`, `X.y` and `let v: X` all\n * keep resolving), re-exports from other modules are kept as written (including\n * their `type` modifiers, so `isolatedModules` and `verbatimModuleSyntax` do\n * not reject the stub), and the compile error is reported through the mapper's\n * own diagnostics. Importers keep resolving; the author sees one error at the\n * right place.\n * @param {AST.Program | null | undefined} program The last successfully parsed source AST, if any.\n * @returns {string}\n */\nexport function build_export_stub(program) {\n\t/** @type {string[]} */\n\tconst lines = [];\n\t/** @type {Set<string>} */\n\tconst names = new Set();\n\tlet has_default = false;\n\n\tfor (const statement of program?.body ?? []) {\n\t\tswitch (statement.type) {\n\t\t\tcase 'ExportAllDeclaration': {\n\t\t\t\tconst exported = statement.exported ? ` as ${export_name(statement.exported)}` : '';\n\t\t\t\tlines.push(\n\t\t\t\t\t`export ${type_modifier(statement)}*${exported} from ${JSON.stringify(String(statement.source.value))};`,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'ExportDefaultDeclaration':\n\t\t\t\thas_default = true;\n\t\t\t\tbreak;\n\t\t\tcase 'ExportNamedDeclaration': {\n\t\t\t\tif (statement.source) {\n\t\t\t\t\tconst statement_is_type = type_modifier(statement) !== '';\n\t\t\t\t\tconst specifiers = statement.specifiers.map((specifier) => {\n\t\t\t\t\t\tconst local = export_name(specifier.local);\n\t\t\t\t\t\tconst exported = export_name(specifier.exported);\n\t\t\t\t\t\t// `export type { A }` marks the statement; `export { type A }`\n\t\t\t\t\t\t// marks the specifier. Never write both.\n\t\t\t\t\t\tconst modifier = statement_is_type ? '' : type_modifier(specifier);\n\t\t\t\t\t\treturn `${modifier}${local === exported ? local : `${local} as ${exported}`}`;\n\t\t\t\t\t});\n\t\t\t\t\tlines.push(\n\t\t\t\t\t\t`export ${type_modifier(statement)}{ ${specifiers.join(', ')} } from ${JSON.stringify(String(statement.source.value))};`,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (const specifier of statement.specifiers) {\n\t\t\t\t\tconst exported = export_name(specifier.exported);\n\t\t\t\t\tif (exported === 'default') has_default = true;\n\t\t\t\t\telse names.add(exported);\n\t\t\t\t}\n\t\t\t\tif (statement.declaration) {\n\t\t\t\t\tfor (const name of declaration_names(statement.declaration)) {\n\t\t\t\t\t\tnames.add(name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tfor (const name of names) {\n\t\tif (!/^[\\p{ID_Start}_$][\\p{ID_Continue}$]*$/u.test(name)) continue;\n\t\tlines.push(`export declare const ${name}: any;`);\n\t\tlines.push(`export type ${name} = any;`);\n\t}\n\tif (has_default) {\n\t\tlines.push('declare const _default: any;');\n\t\tlines.push('export default _default;');\n\t}\n\tif (lines.length === 0) {\n\t\tlines.push('export {};');\n\t}\n\treturn lines.join('\\n') + '\\n';\n}\n\n/**\n * `type ` for a type-only export statement or specifier (the ESTree-TS\n * `exportKind` field), else the empty string.\n * @param {AST.Node} node\n * @returns {'type ' | ''}\n */\nfunction type_modifier(node) {\n\treturn /** @type {{ exportKind?: string }} */ (node).exportKind === 'type' ? 'type ' : '';\n}\n\n/**\n * @param {AST.Identifier | AST.Literal | AST.Expression} node\n * @returns {string}\n */\nfunction export_name(node) {\n\tif (node.type === 'Identifier') return node.name;\n\tif (node.type === 'Literal') return String(node.value);\n\treturn '';\n}\n\n/**\n * @param {AST.Declaration | AST.Node} declaration\n * @returns {string[]}\n */\nfunction declaration_names(declaration) {\n\tswitch (declaration.type) {\n\t\tcase 'VariableDeclaration':\n\t\t\treturn declaration.declarations.flatMap((declarator) => pattern_names(declarator.id));\n\t\tcase 'FunctionDeclaration':\n\t\tcase 'ClassDeclaration':\n\t\t\treturn declaration.id ? [declaration.id.name] : [];\n\t\tdefault: {\n\t\t\t// TypeScript declarations (interface, type alias, enum, module) all\n\t\t\t// carry an `id` identifier in the ESTree-TS shape.\n\t\t\tconst id = /** @type {{ id?: AST.Node }} */ (declaration).id;\n\t\t\treturn id && id.type === 'Identifier' ? [/** @type {AST.Identifier} */ (id).name] : [];\n\t\t}\n\t}\n}\n\n/**\n * @param {AST.Pattern} pattern\n * @returns {string[]}\n */\nfunction pattern_names(pattern) {\n\tswitch (pattern.type) {\n\t\tcase 'Identifier':\n\t\t\treturn [pattern.name];\n\t\tcase 'ObjectPattern':\n\t\t\treturn pattern.properties.flatMap((property) =>\n\t\t\t\tproperty.type === 'RestElement'\n\t\t\t\t\t? pattern_names(property.argument)\n\t\t\t\t\t: pattern_names(property.value),\n\t\t\t);\n\t\tcase 'ArrayPattern':\n\t\t\treturn pattern.elements.flatMap((element) => (element ? pattern_names(element) : []));\n\t\tcase 'RestElement':\n\t\t\treturn pattern_names(pattern.argument);\n\t\tcase 'AssignmentPattern':\n\t\t\treturn pattern_names(pattern.left);\n\t\tdefault:\n\t\t\treturn [];\n\t}\n}\n","/**\n * Constants of the TypeScript 7 content-mapper protocol, kept in sync with\n * `tsc/internal/contentmapper` and `tsc/internal/spanmap` in microsoft/TypeScript.\n */\n\n/** Span kinds. */\nexport const SpanMapKind = /** @type {const} */ ({\n\t/** Same length and identical text; the only kind that supports text edits. */\n\tVerbatim: 0,\n\t/** Same entity, different text or length. */\n\tAtom: 1,\n\t/** Different text; diagnostics covering the whole span exactly show the original text. */\n\tAlias: 2,\n});\n\n/** Feature bits a span opts into. Diagnostics ignore them. */\nexport const SpanMapFeature = /** @type {const} */ ({\n\tHover: 1 << 0,\n\tSignatureHelp: 1 << 1,\n\tCompletion: 1 << 2,\n\tDefinition: 1 << 3,\n\tTypeDefinition: 1 << 4,\n\tImplementation: 1 << 5,\n\tReferences: 1 << 6,\n\tDocumentHighlights: 1 << 7,\n\tRename: 1 << 8,\n\tCallHierarchy: 1 << 9,\n\tCodeActions: 1 << 10,\n\tFormatting: 1 << 11,\n\tInlayHints: 1 << 12,\n\tSemanticTokens: 1 << 13,\n\tFoldingRanges: 1 << 14,\n\tSelectionRanges: 1 << 15,\n\tLinkedEditing: 1 << 16,\n\tAutoInsert: 1 << 17,\n\tDocumentSymbols: 1 << 18,\n\tCodeLens: 1 << 19,\n\tNone: 0,\n\tAll: (1 << 20) - 1,\n});\n\n/** Diagnostic-directive policies (unused by TSRX today; kept for completeness). */\nexport const DiagnosticDirectivePolicy = /** @type {const} */ ({ Ignore: 0, Expect: 1 });\n\n/** Prefix for mapper-authored diagnostics: `error tsrx(1000): ...`. */\nexport const DIAGNOSTIC_SOURCE = 'tsrx';\n\n/** Numeric code for a fatal compile error (the file could not be transformed). */\nexport const DIAGNOSTIC_CODE_COMPILE_ERROR = 1000;\n/** Numeric code for a usage error that carries no string code. */\nexport const DIAGNOSTIC_CODE_USAGE_ERROR = 1001;\n/** Numeric code when no TSRX compiler can be resolved for a file. */\nexport const DIAGNOSTIC_CODE_NO_COMPILER = 1002;\n/** Numeric code when the project's TSRX configuration is invalid. */\nexport const DIAGNOSTIC_CODE_INVALID_CONFIG = 1003;\n\n/**\n * @typedef {[\n * \tgeneratedStart: number,\n * \tgeneratedLength: number,\n * \toriginalStart: number,\n * \toriginalLength: number,\n * \tkind: 0 | 1 | 2,\n * \tfeatures: number,\n * ]} SpanMapping\n */\n\n/**\n * @typedef {object} MapperDiagnostic\n * @property {number} start Offset into the original text (UTF-16 code units).\n * @property {number} length\n * @property {number} code\n * @property {string} messageText\n */\n\n/**\n * @typedef {object} MappedOutput\n * @property {string} text\n * @property {'.js' | '.jsx' | '.mjs' | '.cjs' | '.ts' | '.tsx' | '.mts' | '.cts' | '.json'} extension\n * @property {SpanMapping[]} mappings\n */\n\n/**\n * @typedef {MappedOutput & {\n * \tdiagnostics?: MapperDiagnostic[],\n * \tsupplemental?: MappedOutput[],\n * }} TransformResult\n */\n\n/**\n * @typedef {object} InitializeParams\n * @property {string} [locale]\n * @property {Array<'utf-8' | 'utf-16'>} positionEncodings\n */\n\n/**\n * @typedef {object} InitializeResult\n * @property {'utf-8' | 'utf-16'} positionEncoding\n * @property {string} diagnosticSource\n */\n\n/**\n * @typedef {object} OpenProjectParams\n * @property {string} configFileName Empty for inferred projects.\n * @property {string} projectHandle\n * @property {Record<string, unknown>} [options] The mapper entry's `options` object.\n * @property {Record<string, unknown>} compilerOptions Effective compiler options (wire format).\n */\n\n/**\n * @typedef {object} OpenProjectResult\n * @property {string} configIdentity\n * @property {string[]} [watchedFiles]\n * @property {Array<{ path: Array<string | number>, messageText: string, code: number }>} [optionDiagnostics]\n */\n\n/**\n * @typedef {object} TransformParams\n * @property {string} fileName\n * @property {string} content\n * @property {string} [projectHandle]\n */\n","/** @import {CodeMapping} from '@tsrx/core/types' */\n/** @import {SpanMapping} from './protocol.js' */\n\nimport { SpanMapFeature, SpanMapKind } from './protocol.js';\n\nconst semantic_features =\n\tSpanMapFeature.Hover |\n\tSpanMapFeature.SignatureHelp |\n\tSpanMapFeature.InlayHints |\n\tSpanMapFeature.SemanticTokens;\nconst completion_features = SpanMapFeature.Completion | SpanMapFeature.AutoInsert;\nconst navigation_features =\n\tSpanMapFeature.Definition |\n\tSpanMapFeature.TypeDefinition |\n\tSpanMapFeature.Implementation |\n\tSpanMapFeature.References |\n\tSpanMapFeature.DocumentHighlights |\n\tSpanMapFeature.Rename |\n\tSpanMapFeature.CallHierarchy |\n\tSpanMapFeature.CodeActions |\n\tSpanMapFeature.LinkedEditing;\nconst structure_features =\n\tSpanMapFeature.FoldingRanges |\n\tSpanMapFeature.SelectionRanges |\n\tSpanMapFeature.DocumentSymbols |\n\tSpanMapFeature.CodeLens;\n\nconst identifier_pattern = /^[\\p{ID_Start}_$][\\p{ID_Continue}$‌‍]*$/u;\n\n/**\n * @typedef {object} Candidate\n * @property {number} generatedStart\n * @property {number} generatedEnd\n * @property {number} originalStart\n * @property {number} originalEnd\n * @property {0 | 1 | 2} kind\n * @property {number} features\n */\n\n/**\n * Translate a Volar `CodeMapping['data']` into content-mapper feature bits.\n *\n * `verification` has no bit: diagnostics always apply. Spans that carry CSS\n * class hover/definition metadata (`customData.hover` / `customData.definition`)\n * leave Hover and Definition off so the TSRX language server owns those\n * features. `semantic.shouldHighlight()` returning `false` (string-literal\n * spans) drops SemanticTokens.\n * @param {CodeMapping['data'] | undefined} data\n * @returns {number}\n */\nexport function features_from_mapping_data(data) {\n\tif (!data || typeof data !== 'object') return SpanMapFeature.None;\n\tlet features = SpanMapFeature.None;\n\tif (data.semantic) {\n\t\tfeatures |= semantic_features;\n\t\tif (typeof data.semantic === 'object' && data.semantic.shouldHighlight?.() === false) {\n\t\t\tfeatures &= ~SpanMapFeature.SemanticTokens;\n\t\t}\n\t}\n\tif (data.completion) {\n\t\tfeatures |= completion_features;\n\t}\n\tif (data.navigation) {\n\t\tfeatures |= navigation_features;\n\t\tif (typeof data.navigation === 'object') {\n\t\t\tif (data.navigation.shouldHighlight?.() === false) {\n\t\t\t\tfeatures &= ~SpanMapFeature.DocumentHighlights;\n\t\t\t}\n\t\t\tif (data.navigation.shouldRename?.() === false) {\n\t\t\t\tfeatures &= ~SpanMapFeature.Rename;\n\t\t\t}\n\t\t}\n\t}\n\tif (data.structure) {\n\t\tfeatures |= structure_features;\n\t}\n\tif (data.format) {\n\t\tfeatures |= SpanMapFeature.Formatting;\n\t}\n\tconst custom = data.customData;\n\tif (custom && (custom.hover !== undefined || custom.definition !== undefined)) {\n\t\tfeatures &= ~(SpanMapFeature.Hover | SpanMapFeature.Definition);\n\t}\n\treturn features;\n}\n\n/**\n * Convert the type-only transform's Volar mappings into a content-mapper span\n * map: an ordered, disjoint (in generated space) list of\n * `[generatedStart, generatedLength, originalStart, originalLength, kind, features]`.\n *\n * - Equal length and identical text → `Verbatim` (the only edit-safe kind).\n * - An identifier whose generated spelling differs (obfuscated `_$_` names,\n * renamed or capitalized identifiers) → `Alias`, so diagnostics that cover\n * the span exactly show the authored name.\n * - Anything else → `Atom`.\n *\n * The transform emits container spans (statements, control-flow bodies) that\n * enclose token spans. TypeScript requires generated spans to be disjoint, so\n * candidates are ranked Verbatim first, then shorter before longer, and a\n * candidate that overlaps an already selected span in generated space is\n * dropped. Overlap in original space is allowed by the protocol (one source\n * range may be projected several times) and is kept.\n *\n * Neighbouring Verbatim spans with equal feature bits whose gap is the same\n * text in both files are then coalesced into one span (see\n * {@link coalesce_verbatim_spans}), so a statement such as\n * `import { a } from './x';` is one edit-safe span rather than four tokens\n * with unmapped punctuation between them. TypeScript only applies text edits\n * (auto-import, rename, code actions) that fit inside a single Verbatim span.\n * @param {readonly CodeMapping[]} mappings\n * @param {string} generated_text\n * @param {string} original_text\n * @param {{ languageFeatures?: boolean }} [options] `languageFeatures: false` clears every feature bit (CLI-only projects).\n * @returns {SpanMapping[]}\n */\nexport function to_span_mappings(mappings, generated_text, original_text, options = {}) {\n\tconst language_features = options.languageFeatures !== false;\n\t/** @type {Candidate[]} */\n\tconst candidates = [];\n\n\tfor (const mapping of mappings) {\n\t\tconst count = Math.min(mapping.sourceOffsets.length, mapping.generatedOffsets.length);\n\t\tfor (let index = 0; index < count; index++) {\n\t\t\tconst original_start = mapping.sourceOffsets[index];\n\t\t\tconst generated_start = mapping.generatedOffsets[index];\n\t\t\tconst original_length = mapping.lengths[index] ?? mapping.lengths[0];\n\t\t\tconst generated_length =\n\t\t\t\tmapping.generatedLengths?.[index] ?? mapping.generatedLengths?.[0] ?? original_length;\n\t\t\tif (\n\t\t\t\t!Number.isInteger(original_start) ||\n\t\t\t\t!Number.isInteger(generated_start) ||\n\t\t\t\t!Number.isInteger(original_length) ||\n\t\t\t\t!Number.isInteger(generated_length) ||\n\t\t\t\toriginal_start < 0 ||\n\t\t\t\tgenerated_start < 0 ||\n\t\t\t\toriginal_length <= 0 ||\n\t\t\t\tgenerated_length <= 0\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst generated_end = generated_start + generated_length;\n\t\t\tconst original_end = original_start + original_length;\n\t\t\tif (generated_end > generated_text.length || original_end > original_text.length) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst generated_slice = generated_text.slice(generated_start, generated_end);\n\t\t\tconst original_slice = original_text.slice(original_start, original_end);\n\t\t\t/** @type {0 | 1 | 2} */\n\t\t\tlet kind;\n\t\t\tif (generated_length === original_length && generated_slice === original_slice) {\n\t\t\t\tkind = SpanMapKind.Verbatim;\n\t\t\t} else if (\n\t\t\t\tis_whole_identifier(generated_text, generated_start, generated_end) &&\n\t\t\t\tis_whole_token(original_text, original_start, original_end)\n\t\t\t) {\n\t\t\t\tkind = SpanMapKind.Alias;\n\t\t\t} else if (is_partial_identifier(original_text, original_start, original_end)) {\n\t\t\t\t// A fragment of an identifier (the transform's one-character file-start\n\t\t\t\t// anchor, `e` of `export` → `c` of a hoisted `const`) is not an entity.\n\t\t\t\t// Volar needed the anchor; under the content-mapper protocol it would\n\t\t\t\t// only make TypeScript project requests at the file start into\n\t\t\t\t// synthesized code.\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tkind = SpanMapKind.Atom;\n\t\t\t}\n\t\t\tcandidates.push({\n\t\t\t\tgeneratedStart: generated_start,\n\t\t\t\tgeneratedEnd: generated_end,\n\t\t\t\toriginalStart: original_start,\n\t\t\t\toriginalEnd: original_end,\n\t\t\t\tkind,\n\t\t\t\tfeatures: language_features\n\t\t\t\t\t? features_from_mapping_data(mapping.data)\n\t\t\t\t\t: SpanMapFeature.None,\n\t\t\t});\n\t\t}\n\t}\n\n\tcandidates.sort(\n\t\t(left, right) =>\n\t\t\tNumber(left.kind !== SpanMapKind.Verbatim) - Number(right.kind !== SpanMapKind.Verbatim) ||\n\t\t\tleft.generatedEnd - left.generatedStart - (right.generatedEnd - right.generatedStart) ||\n\t\t\tleft.generatedStart - right.generatedStart ||\n\t\t\tleft.originalStart - right.originalStart,\n\t);\n\n\t/** @type {Candidate[]} */\n\tconst selected = [];\n\tconst occupied = new IntervalSet();\n\tfor (const candidate of candidates) {\n\t\tif (!occupied.add(candidate.generatedStart, candidate.generatedEnd)) {\n\t\t\tcontinue;\n\t\t}\n\t\tselected.push(candidate);\n\t}\n\n\tselected.sort((left, right) => left.generatedStart - right.generatedStart);\n\treturn extend_verbatim_spans_over_whitespace(\n\t\tcoalesce_verbatim_spans(selected, generated_text, original_text),\n\t\tgenerated_text,\n\t\toriginal_text,\n\t).map((candidate) => [\n\t\tcandidate.generatedStart,\n\t\tcandidate.generatedEnd - candidate.generatedStart,\n\t\tcandidate.originalStart,\n\t\tcandidate.originalEnd - candidate.originalStart,\n\t\tcandidate.kind,\n\t\tcandidate.features,\n\t]);\n}\n\n/**\n * Merge runs of Verbatim spans, sorted by generated start, when the two spans\n * carry the same feature bits and the text between them is identical (and of\n * equal length) in the generated and the original file. The merged span is\n * Verbatim by construction: every position inside it maps with the same\n * offset and the same text.\n * @param {Candidate[]} spans\n * @param {string} generated_text\n * @param {string} original_text\n * @returns {Candidate[]}\n */\nexport function coalesce_verbatim_spans(spans, generated_text, original_text) {\n\t/** @type {Candidate[]} */\n\tconst merged = [];\n\tfor (const span of spans) {\n\t\tconst previous = merged[merged.length - 1];\n\t\tif (\n\t\t\tprevious &&\n\t\t\tprevious.kind === SpanMapKind.Verbatim &&\n\t\t\tspan.kind === SpanMapKind.Verbatim &&\n\t\t\tprevious.features === span.features &&\n\t\t\tspan.originalStart >= previous.originalEnd &&\n\t\t\tspan.generatedStart - previous.generatedEnd === span.originalStart - previous.originalEnd &&\n\t\t\tgenerated_text.slice(previous.generatedEnd, span.generatedStart) ===\n\t\t\t\toriginal_text.slice(previous.originalEnd, span.originalStart)\n\t\t) {\n\t\t\tprevious.generatedEnd = span.generatedEnd;\n\t\t\tprevious.originalEnd = span.originalEnd;\n\t\t\tcontinue;\n\t\t}\n\t\tmerged.push({ ...span });\n\t}\n\treturn merged;\n}\n\n/**\n * Extend every Verbatim span forward over whitespace that is identical in the\n * generated and the original file, up to the next span in either file.\n *\n * TypeScript's edits routinely end at the start of the line after a statement\n * (an organize-imports edit for the import block ends after the last import's\n * newline), and TypeScript 7 discards a whole edit when any of its ranges does\n * not map. A span that stops at a statement's last character therefore made\n * \"Organize Imports\" a no-op on `.tsrx` files; covering the newline that follows\n * fixes that at no cost, since identical whitespace maps verbatim.\n * @param {Candidate[]} spans Sorted by generated start, non-overlapping.\n * @param {string} generated_text\n * @param {string} original_text\n * @returns {Candidate[]}\n */\nexport function extend_verbatim_spans_over_whitespace(spans, generated_text, original_text) {\n\tfor (let index = 0; index < spans.length; index++) {\n\t\tconst span = spans[index];\n\t\tif (span.kind !== SpanMapKind.Verbatim) continue;\n\t\tconst next = spans[index + 1];\n\t\tconst generated_limit = next ? next.generatedStart : generated_text.length;\n\t\tconst original_limit = next ? next.originalStart : original_text.length;\n\t\twhile (\n\t\t\tspan.generatedEnd < generated_limit &&\n\t\t\tspan.originalEnd < original_limit &&\n\t\t\tgenerated_text[span.generatedEnd] === original_text[span.originalEnd] &&\n\t\t\t/[ \\t\\r\\n]/.test(generated_text[span.generatedEnd])\n\t\t) {\n\t\t\tspan.generatedEnd++;\n\t\t\tspan.originalEnd++;\n\t\t}\n\t}\n\treturn spans;\n}\n\nconst identifier_part = /[\\p{ID_Continue}$\\u200c\\u200d]/u;\nconst token_part = /[\\p{ID_Continue}$#@\\u200c\\u200d]/u;\n\n/**\n * Whether `[start, end)` is a complete identifier in `text`: identifier\n * syntax inside and no identifier character touching either edge.\n * @param {string} text\n * @param {number} start\n * @param {number} end\n */\nfunction is_whole_identifier(text, start, end) {\n\treturn (\n\t\tidentifier_pattern.test(text.slice(start, end)) &&\n\t\t(start === 0 || !identifier_part.test(text[start - 1])) &&\n\t\t(end === text.length || !identifier_part.test(text[end]))\n\t);\n}\n\n/**\n * Whether `[start, end)` is a piece of a longer identifier in `text`:\n * identifier characters inside and an identifier character touching an edge.\n * @param {string} text\n * @param {number} start\n * @param {number} end\n */\nfunction is_partial_identifier(text, start, end) {\n\tconst slice = text.slice(start, end);\n\treturn (\n\t\tslice.length > 0 &&\n\t\t[...slice].every((character) => identifier_part.test(character)) &&\n\t\t((start > 0 && identifier_part.test(text[start - 1])) ||\n\t\t\t(end < text.length && identifier_part.test(text[end])))\n\t);\n}\n\n/**\n * Whether `[start, end)` is a complete authored token: no whitespace inside\n * and no token character (identifier characters plus the TSRX `#`/`@`\n * sigils) touching either edge.\n * @param {string} text\n * @param {number} start\n * @param {number} end\n */\nfunction is_whole_token(text, start, end) {\n\tconst slice = text.slice(start, end);\n\treturn (\n\t\tslice.length > 0 &&\n\t\t!/\\s/.test(slice) &&\n\t\t(start === 0 || !token_part.test(text[start - 1])) &&\n\t\t(end === text.length || !token_part.test(text[end]))\n\t);\n}\n\n/**\n * Sorted set of half-open intervals supporting an \"add if disjoint\" query.\n * Intervals are kept sorted by start in a plain array; a binary search finds\n * the neighbours to test, so adding is O(n) in the worst case, which is fine\n * for the few thousand spans a file produces.\n */\nclass IntervalSet {\n\t/** @type {number[]} */\n\t#starts = [];\n\t/** @type {number[]} */\n\t#ends = [];\n\n\t/**\n\t * @param {number} start\n\t * @param {number} end\n\t * @returns {boolean} Whether the interval was added (it overlapped nothing).\n\t */\n\tadd(start, end) {\n\t\tconst starts = this.#starts;\n\t\tlet low = 0;\n\t\tlet high = starts.length;\n\t\twhile (low < high) {\n\t\t\tconst middle = (low + high) >>> 1;\n\t\t\tif (starts[middle] < start) low = middle + 1;\n\t\t\telse high = middle;\n\t\t}\n\t\t// `low` is the first interval starting at or after `start`.\n\t\tif (low < starts.length && starts[low] < end) return false;\n\t\tif (low > 0 && this.#ends[low - 1] > start) return false;\n\t\tstarts.splice(low, 0, start);\n\t\tthis.#ends.splice(low, 0, end);\n\t\treturn true;\n\t}\n}\n","/** @import * as AST from 'estree' */\n/** @import {CompileError} from '@tsrx/core/types' */\n/** @import {InitializeParams, InitializeResult, OpenProjectParams, OpenProjectResult, TransformParams, TransformResult, MapperDiagnostic} from './protocol.js' */\n\nimport { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { NODE_CONFIG_HOST } from '@tsrx/typescript-plugin/src/config-host.js';\nimport { resolve_consumer_platform_for_file } from '@tsrx/typescript-plugin/src/consumer-compiler.js';\nimport { resolve_package_entry } from '@tsrx/typescript-plugin/src/package-resolution.js';\nimport {\n\tget_compiler_entry_for_file,\n\tinvalidateCompilerResolutionCaches,\n\trequire_tsrx_compiler,\n\tsource_uses_platform_flag,\n} from '@tsrx/typescript-plugin/src/language.js';\nimport { transform_tsrx } from '@tsrx/typescript-plugin/src/transform.js';\nimport { build_export_stub } from './export-stub.js';\nimport {\n\tDIAGNOSTIC_CODE_COMPILE_ERROR,\n\tDIAGNOSTIC_CODE_INVALID_CONFIG,\n\tDIAGNOSTIC_CODE_NO_COMPILER,\n\tDIAGNOSTIC_CODE_USAGE_ERROR,\n\tDIAGNOSTIC_SOURCE,\n} from './protocol.js';\nimport { to_span_mappings } from './span-mappings.js';\n\nconst require = createRequire(import.meta.url);\nconst bare_package_specifier_pattern =\n\t/^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._~-]*)*$/;\n\n/**\n * The mapper entry's `options` object in tsconfig (`contentMappers[].options`)\n * or in an inferred-project contribution.\n * @typedef {object} MapperOptions\n * @property {string} [compiler] Bare package specifier of the TSRX compiler. Takes precedence over `tsrx.compiler` in the tsconfig chain.\n * @property {'web' | 'ios' | 'android'} [platform] Platform for `import.meta.env.platform` flags. Takes precedence over `tsrx.platform`.\n * @property {boolean} [languageFeatures] `false` clears every editor feature bit while keeping spans for diagnostics (CLI-only projects).\n */\n\n/**\n * @typedef {object} ProjectState\n * @property {string | undefined} configFileName\n * @property {MapperOptions} options\n * @property {Set<string>} dependencies Files whose content affects transform output.\n * @property {Map<string, AST.Program>} lastGood Last successfully parsed source AST per file, for the compile-failure stub. Shared by every project state of a mapper (see {@link create_tsrx_content_mapper}).\n */\n\n/**\n * @typedef {object} ContentMapper\n * @property {(params: InitializeParams) => InitializeResult} initialize\n * @property {(params: OpenProjectParams) => OpenProjectResult} openProject\n * @property {(params: { projectHandle: string }) => void} closeProject\n * @property {(params: TransformParams) => TransformResult} transform\n */\n\n/**\n * Create the `.tsrx` content mapper. Each `projectHandle` owns its own state;\n * nothing is shared between projects except the process-wide compiler\n * resolution caches, which are keyed by directory and reset on every\n * `openProject`, and the last successfully parsed AST per file. The latter is\n * keyed by file name and independent of the project, and TypeScript reopens a\n * project (same or new handle) whenever its identity or a watched file\n * changes, so keeping it at the mapper level is what lets a file that still\n * fails to compile keep its export stub across a reopen.\n * The mapper needs no TypeScript of its own: tsconfig files are read and\n * compilers resolved through `@tsrx/typescript-plugin`'s own reader and\n * package walk, so the native compiler's `typescript` package (which has no\n * JavaScript API) can be the only TypeScript in a project.\n * @param {{ host?: import('@tsrx/typescript-plugin/src/config-host.js').ConfigHost }} [context]\n * @returns {ContentMapper}\n */\nexport function create_tsrx_content_mapper(context = {}) {\n\tconst host = context.host ?? NODE_CONFIG_HOST;\n\t/** @type {Map<string, ProjectState>} */\n\tconst projects = new Map();\n\t/** @type {Map<string, AST.Program>} */\n\tconst last_good = new Map();\n\t/** Transforms that arrive without a project handle. */\n\tconst standalone = create_project_state(undefined, {});\n\n\t/** @type {ContentMapper['initialize']} */\n\tfunction initialize(params) {\n\t\tif (!params.positionEncodings?.includes('utf-16')) {\n\t\t\tthrow new Error('@tsrx/content-mapper requires UTF-16 position encoding');\n\t\t}\n\t\treturn { positionEncoding: 'utf-16', diagnosticSource: DIAGNOSTIC_SOURCE };\n\t}\n\n\t/** @type {ContentMapper['openProject']} */\n\tfunction openProject(params) {\n\t\t// TypeScript reopens a project when its identity or a watched file\n\t\t// changes, which is exactly when directory-keyed discovery caches\n\t\t// (installed compilers, package manifests) may be stale.\n\t\tinvalidateCompilerResolutionCaches();\n\t\tconst { options, optionDiagnostics } = validate_options(params.options);\n\t\tconst state = create_project_state(params.configFileName || undefined, options);\n\t\tprojects.set(params.projectHandle, state);\n\n\t\t// Resolve the compiler once up front so the tsconfig chain and the\n\t\t// compiler manifest are known and can be watched.\n\t\ttry {\n\t\t\tresolve_compiler(state, probe_file_name(state));\n\t\t} catch {\n\t\t\t// Reported per file at transform time.\n\t\t}\n\n\t\tconst watchedFiles = [...state.dependencies].sort();\n\t\treturn {\n\t\t\tconfigIdentity: compute_identity(state, watchedFiles),\n\t\t\twatchedFiles,\n\t\t\t...(optionDiagnostics.length > 0 ? { optionDiagnostics } : null),\n\t\t};\n\t}\n\n\t/** @type {ContentMapper['closeProject']} */\n\tfunction closeProject(params) {\n\t\tprojects.delete(params.projectHandle);\n\t}\n\n\t/** @type {ContentMapper['transform']} */\n\tfunction transform(params) {\n\t\tconst state = params.projectHandle ? projects.get(params.projectHandle) : standalone;\n\t\tif (!state) {\n\t\t\tthrow new Error(`Unknown @tsrx/content-mapper project handle: ${params.projectHandle}`);\n\t\t}\n\t\tconst file_name = params.fileName.replace(/\\\\/g, '/');\n\t\tconst content = params.content;\n\n\t\t/** @type {import('@tsrx/typescript-plugin/src/transform.js').TSRXCompilerModule | null} */\n\t\tlet compiler;\n\t\ttry {\n\t\t\tcompiler = resolve_compiler(state, file_name);\n\t\t} catch (error) {\n\t\t\treturn failure(state, file_name, content, {\n\t\t\t\tstart: 0,\n\t\t\t\tlength: 0,\n\t\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t\t\tmessageText: error_message(error),\n\t\t\t});\n\t\t}\n\t\tif (!compiler) {\n\t\t\treturn failure(state, file_name, content, {\n\t\t\t\tstart: 0,\n\t\t\t\tlength: 0,\n\t\t\t\tcode: DIAGNOSTIC_CODE_NO_COMPILER,\n\t\t\t\tmessageText:\n\t\t\t\t\t`No TSRX compiler found for ${file_name}. Install a target compiler ` +\n\t\t\t\t\t'(for example @tsrx/react) next to the project, or select one with ' +\n\t\t\t\t\t'\"tsrx\": { \"compiler\": \"<package>\" } in tsconfig.json or ' +\n\t\t\t\t\t'\"options\": { \"compiler\": \"<package>\" } on the content mapper entry.',\n\t\t\t});\n\t\t}\n\n\t\t/** @type {'web' | 'ios' | 'android' | undefined} */\n\t\tlet platform;\n\t\ttry {\n\t\t\tplatform =\n\t\t\t\tstate.options.platform ??\n\t\t\t\tresolve_consumer_platform_for_file(file_name, {\n\t\t\t\t\tconfigFileName: state.configFileName,\n\t\t\t\t\tconfigHost: host,\n\t\t\t\t\tdependencies: state.dependencies,\n\t\t\t\t\trequirePlatformResolution: source_uses_platform_flag(content),\n\t\t\t\t});\n\t\t} catch (error) {\n\t\t\treturn failure(state, file_name, content, {\n\t\t\t\tstart: 0,\n\t\t\t\tlength: 0,\n\t\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t\t\tmessageText: error_message(error),\n\t\t\t});\n\t\t}\n\n\t\tconst result = transform_tsrx(compiler, file_name, content, { platform });\n\t\tif (result.fatalError) {\n\t\t\treturn failure(\n\t\t\t\tstate,\n\t\t\t\tfile_name,\n\t\t\t\tcontent,\n\t\t\t\tto_diagnostic(result.fatalError, content.length, DIAGNOSTIC_CODE_COMPILE_ERROR),\n\t\t\t);\n\t\t}\n\t\tif (result.sourceAst) {\n\t\t\tstate.lastGood.set(file_name, result.sourceAst);\n\t\t}\n\n\t\tconst language_features = state.options.languageFeatures !== false;\n\t\tconst mappings = to_span_mappings(result.mappings, result.text, content, {\n\t\t\tlanguageFeatures: language_features,\n\t\t});\n\t\tconst diagnostics = result.errors.map((error) =>\n\t\t\tto_diagnostic(error, content.length, DIAGNOSTIC_CODE_USAGE_ERROR),\n\t\t);\n\t\treturn {\n\t\t\ttext: result.text,\n\t\t\textension: '.tsx',\n\t\t\tmappings,\n\t\t\t...(diagnostics.length > 0 ? { diagnostics } : null),\n\t\t};\n\t}\n\n\t/**\n\t * @param {string | undefined} config_file_name\n\t * @param {MapperOptions} options\n\t * @returns {ProjectState}\n\t */\n\tfunction create_project_state(config_file_name, options) {\n\t\treturn {\n\t\t\tconfigFileName: config_file_name ? path.normalize(config_file_name) : undefined,\n\t\t\toptions,\n\t\t\tdependencies: new Set(),\n\t\t\tlastGood: last_good,\n\t\t};\n\t}\n\n\t/**\n\t * A `.tsrx` path inside the project directory, used to drive compiler\n\t * resolution before any real file is transformed.\n\t * @param {ProjectState} state\n\t */\n\tfunction probe_file_name(state) {\n\t\tconst dir = state.configFileName ? path.dirname(state.configFileName) : process.cwd();\n\t\treturn path.join(dir, '__tsrx_content_mapper_probe__.tsrx').replace(/\\\\/g, '/');\n\t}\n\n\t/**\n\t * Precedence: the mapper entry's `options.compiler` wins over `tsrx.compiler`\n\t * in the tsconfig chain, which wins over auto-detection of an installed\n\t * target compiler. Whatever is found, its `package.json` joins the watched\n\t * files so a compiler upgrade invalidates the project.\n\t * @param {ProjectState} state\n\t * @param {string} file_name\n\t * @returns {import('@tsrx/typescript-plugin/src/transform.js').TSRXCompilerModule | null}\n\t */\n\tfunction resolve_compiler(state, file_name) {\n\t\t/** @type {string | undefined} */\n\t\tlet entry;\n\t\tif (state.options.compiler !== undefined) {\n\t\t\tentry = resolve_declared_compiler(state, file_name, state.options.compiler);\n\t\t} else {\n\t\t\tentry = get_compiler_entry_for_file(file_name, {\n\t\t\t\tconfigFileName: state.configFileName,\n\t\t\t\tconfigHost: host,\n\t\t\t\tdependencies: state.dependencies,\n\t\t\t});\n\t\t}\n\t\tif (!entry) {\n\t\t\treturn null;\n\t\t}\n\t\tconst manifest = nearest_package_manifest(entry);\n\t\tif (manifest) {\n\t\t\tstate.dependencies.add(manifest);\n\t\t}\n\t\treturn require_tsrx_compiler(entry);\n\t}\n\n\t/**\n\t * @param {ProjectState} state\n\t * @param {string} file_name\n\t * @param {string} specifier\n\t * @returns {string}\n\t */\n\tfunction resolve_declared_compiler(state, file_name, specifier) {\n\t\tif (!bare_package_specifier_pattern.test(specifier)) {\n\t\t\tthrow new Error(\n\t\t\t\t`The content mapper option \"compiler\" must be a bare package specifier, got ${JSON.stringify(specifier)}.`,\n\t\t\t);\n\t\t}\n\t\tconst anchor = state.configFileName ?? file_name;\n\t\ttry {\n\t\t\treturn createRequire(anchor).resolve(specifier);\n\t\t} catch {\n\t\t\t// Node keeps a negative lookup after a package is installed; the\n\t\t\t// package walk reads manifests fresh.\n\t\t\tconst resolved = resolve_package_entry(specifier, path.dirname(anchor), { host });\n\t\t\tif (!resolved) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unable to resolve the TSRX compiler ${JSON.stringify(specifier)} declared in the content mapper options from ${anchor}.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\t}\n\n\t/**\n\t * @param {ProjectState} state\n\t * @param {string[]} watched_files\n\t * @returns {string}\n\t */\n\tfunction compute_identity(state, watched_files) {\n\t\tconst hash = createHash('sha256');\n\t\thash.update(JSON.stringify(state.options));\n\t\thash.update('\\0');\n\t\tfor (const file of watched_files) {\n\t\t\thash.update(file);\n\t\t\thash.update('\\0');\n\t\t\thash.update(host.readFile(file) ?? '');\n\t\t\thash.update('\\0');\n\t\t}\n\t\treturn hash.digest('hex');\n\t}\n\n\t/**\n\t * @param {ProjectState} state\n\t * @param {string} file_name\n\t * @param {string} content\n\t * @param {MapperDiagnostic} diagnostic\n\t * @returns {TransformResult}\n\t */\n\tfunction failure(state, file_name, content, diagnostic) {\n\t\treturn {\n\t\t\ttext: build_export_stub(state.lastGood.get(file_name)),\n\t\t\textension: '.ts',\n\t\t\tmappings: [],\n\t\t\tdiagnostics: [clamp_diagnostic(diagnostic, content.length)],\n\t\t};\n\t}\n\n\treturn { initialize, openProject, closeProject, transform };\n}\n\n/**\n * @param {unknown} raw\n * @returns {{ options: MapperOptions, optionDiagnostics: NonNullable<OpenProjectResult['optionDiagnostics']> }}\n */\nexport function validate_options(raw) {\n\t/** @type {MapperOptions} */\n\tconst options = {};\n\t/** @type {NonNullable<OpenProjectResult['optionDiagnostics']>} */\n\tconst optionDiagnostics = [];\n\tif (raw === undefined || raw === null) {\n\t\treturn { options, optionDiagnostics };\n\t}\n\tif (typeof raw !== 'object' || Array.isArray(raw)) {\n\t\toptionDiagnostics.push({\n\t\t\tpath: [],\n\t\t\tmessageText: 'Content mapper options must be an object.',\n\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t});\n\t\treturn { options, optionDiagnostics };\n\t}\n\tconst record = /** @type {Record<string, unknown>} */ (raw);\n\tfor (const key of Object.keys(record)) {\n\t\tconst value = record[key];\n\t\tswitch (key) {\n\t\t\tcase 'compiler':\n\t\t\t\tif (typeof value === 'string' && bare_package_specifier_pattern.test(value.trim())) {\n\t\t\t\t\toptions.compiler = value.trim();\n\t\t\t\t} else {\n\t\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\t\tpath: [key],\n\t\t\t\t\t\tmessageText: '\"compiler\" must be a bare package specifier such as \"@tsrx/react\".',\n\t\t\t\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'platform':\n\t\t\t\tif (value === 'web' || value === 'ios' || value === 'android') {\n\t\t\t\t\toptions.platform = value;\n\t\t\t\t} else {\n\t\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\t\tpath: [key],\n\t\t\t\t\t\tmessageText: '\"platform\" must be \"web\", \"ios\", or \"android\".',\n\t\t\t\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'languageFeatures':\n\t\t\t\tif (typeof value === 'boolean') {\n\t\t\t\t\toptions.languageFeatures = value;\n\t\t\t\t} else {\n\t\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\t\tpath: [key],\n\t\t\t\t\t\tmessageText: '\"languageFeatures\" must be a boolean.',\n\t\t\t\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\toptionDiagnostics.push({\n\t\t\t\t\tpath: [key],\n\t\t\t\t\tmessageText: `Unknown content mapper option \"${key}\".`,\n\t\t\t\t\tcode: DIAGNOSTIC_CODE_INVALID_CONFIG,\n\t\t\t\t});\n\t\t}\n\t}\n\treturn { options, optionDiagnostics };\n}\n\n/**\n * Translate a compiler `CompileError` into a mapper diagnostic in original\n * offsets. Coded errors keep their string code in the message and derive a\n * stable numeric code from it; uncoded ones use `fallback_code`.\n * @param {CompileError} error\n * @param {number} content_length\n * @param {number} fallback_code\n * @returns {MapperDiagnostic}\n */\nexport function to_diagnostic(error, content_length, fallback_code) {\n\tconst start = typeof error.pos === 'number' ? error.pos : 0;\n\tconst end = typeof error.end === 'number' && error.end > start ? error.end : start + 1;\n\tconst code =\n\t\ttypeof error.code === 'string' && error.code ? numeric_code(error.code) : fallback_code;\n\tconst message = String(error.message ?? error);\n\treturn clamp_diagnostic(\n\t\t{\n\t\t\tstart,\n\t\t\tlength: end - start,\n\t\t\tcode,\n\t\t\tmessageText:\n\t\t\t\ttypeof error.code === 'string' && error.code ? `${message} [${error.code}]` : message,\n\t\t},\n\t\tcontent_length,\n\t);\n}\n\n/**\n * Stable numeric code for a TSRX string diagnostic code (FNV-1a 32-bit,\n * folded into the 10000..99999 range so it never collides with the fixed\n * codes below 10000).\n * @param {string} code\n * @returns {number}\n */\nexport function numeric_code(code) {\n\tlet hash = 0x811c9dc5;\n\tfor (let index = 0; index < code.length; index++) {\n\t\thash ^= code.charCodeAt(index);\n\t\thash = Math.imul(hash, 0x01000193);\n\t}\n\treturn 10000 + ((hash >>> 0) % 90000);\n}\n\n/**\n * @param {MapperDiagnostic} diagnostic\n * @param {number} content_length\n * @returns {MapperDiagnostic}\n */\nfunction clamp_diagnostic(diagnostic, content_length) {\n\tconst start = Math.max(0, Math.min(diagnostic.start, content_length));\n\tconst end = Math.max(start, Math.min(diagnostic.start + diagnostic.length, content_length));\n\treturn { ...diagnostic, start, length: end - start };\n}\n\n/**\n * @param {unknown} error\n * @returns {string}\n */\nfunction error_message(error) {\n\treturn error instanceof Error ? error.message : String(error);\n}\n\n/**\n * The `package.json` that owns a compiler entry file, stopping at a\n * `node_modules` boundary.\n * @param {string} entry\n * @returns {string | undefined}\n */\nfunction nearest_package_manifest(entry) {\n\tlet dir = path.dirname(entry);\n\twhile (dir) {\n\t\tconst candidate = path.join(dir, 'package.json');\n\t\tif (fs.existsSync(candidate)) return candidate;\n\t\tif (path.basename(dir) === 'node_modules') return undefined;\n\t\tconst parent = path.dirname(dir);\n\t\tif (parent === dir) return undefined;\n\t\tdir = parent;\n\t}\n\treturn undefined;\n}\n\nexport { require };\n","/**\n * Content-mapper transport: `Content-Length`-framed JSON-RPC 2.0 over stdio.\n * TypeScript is the only requester; the mapper never sends requests or\n * notifications. stdout is reserved for protocol messages, so everything\n * else (including `console.log`) goes to stderr.\n *\n * Kept separate from the executable entry (`server.js`) so hosts that bundle\n * the mapper (the VS Code extension ships it for inferred projects) can start\n * it from their own entry file.\n */\n\n/**\n * @typedef {{ jsonrpc: '2.0', id?: number | string | null, method: string, params?: unknown }} RequestMessage\n */\n\n/**\n * Run the mapper server on the given streams. Installs the stream handlers\n * and returns; the process exits (with `process.exitCode`) once the input\n * stream ends, which is how TypeScript shuts a mapper down.\n * @param {import('./mapper.js').ContentMapper} mapper\n * @param {{ input?: NodeJS.ReadableStream, output?: NodeJS.WritableStream }} [streams]\n */\nexport function run_mapper_server(mapper, streams = {}) {\n\tconst input = streams.input ?? process.stdin;\n\tconst output = streams.output ?? process.stdout;\n\tlet buffered = Buffer.alloc(0);\n\n\tinput.on('data', (chunk) => {\n\t\tbuffered = Buffer.concat([buffered, typeof chunk === 'string' ? Buffer.from(chunk) : chunk]);\n\t\tread_messages();\n\t});\n\tinput.on('error', (error) => {\n\t\tconsole.error(error);\n\t\tprocess.exitCode = 1;\n\t});\n\tinput.on('end', () => {\n\t\tprocess.exit(process.exitCode ?? 0);\n\t});\n\n\tfunction read_messages() {\n\t\twhile (true) {\n\t\t\tconst header_end = buffered.indexOf('\\r\\n\\r\\n');\n\t\t\tif (header_end < 0) return;\n\t\t\tconst header = buffered.subarray(0, header_end).toString('ascii');\n\t\t\tconst length_match = /^Content-Length:\\s*(\\d+)\\s*$/im.exec(header);\n\t\t\tif (!length_match) {\n\t\t\t\tconsole.error('@tsrx/content-mapper: missing Content-Length header');\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t\tconst content_length = Number(length_match[1]);\n\t\t\tconst message_start = header_end + 4;\n\t\t\tconst message_end = message_start + content_length;\n\t\t\tif (buffered.length < message_end) return;\n\t\t\tconst body = buffered.subarray(message_start, message_end).toString('utf8');\n\t\t\tbuffered = buffered.subarray(message_end);\n\t\t\t/** @type {RequestMessage} */\n\t\t\tlet message;\n\t\t\ttry {\n\t\t\t\tmessage = JSON.parse(body);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('@tsrx/content-mapper: invalid JSON-RPC message', error);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thandle_message(message);\n\t\t}\n\t}\n\n\t/** @param {RequestMessage} message */\n\tfunction handle_message(message) {\n\t\tif (message.id === undefined || message.id === null) {\n\t\t\t// Notifications need no response.\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\t/** @type {unknown} */\n\t\t\tlet result;\n\t\t\tswitch (message.method) {\n\t\t\t\tcase 'initialize':\n\t\t\t\t\tresult = mapper.initialize(/** @type {any} */ (message.params));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'openProject':\n\t\t\t\t\tresult = mapper.openProject(/** @type {any} */ (message.params));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'closeProject':\n\t\t\t\t\tmapper.closeProject(/** @type {any} */ (message.params));\n\t\t\t\t\tresult = null;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'transform':\n\t\t\t\t\tresult = mapper.transform(/** @type {any} */ (message.params));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twrite({\n\t\t\t\t\t\tjsonrpc: '2.0',\n\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\terror: { code: -32601, message: `Unknown method ${message.method}` },\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\twrite({ jsonrpc: '2.0', id: message.id, result });\n\t\t} catch (error) {\n\t\t\twrite({\n\t\t\t\tjsonrpc: '2.0',\n\t\t\t\tid: message.id,\n\t\t\t\terror: {\n\t\t\t\t\tcode: -32603,\n\t\t\t\t\tmessage: error instanceof Error ? (error.stack ?? error.message) : String(error),\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\t/** @param {unknown} message */\n\tfunction write(message) {\n\t\tconst body = Buffer.from(JSON.stringify(message), 'utf8');\n\t\toutput.write(`Content-Length: ${body.length}\\r\\n\\r\\n`);\n\t\toutput.write(body);\n\t}\n}\n\n/**\n * Route every console method to stderr so stray logging (from a target\n * compiler, for example) can never corrupt the protocol stream on stdout.\n */\nexport function redirect_console_to_stderr() {\n\tconsole.log = console.info = console.warn = console.debug = (...args) => console.error(...args);\n}\n","#!/usr/bin/env node\n/**\n * Executable entry of the content mapper: TypeScript spawns it through the\n * `typescript.contentMapper.exec` manifest entry and talks JSON-RPC over stdio.\n */\n\nimport { create_tsrx_content_mapper } from './mapper.js';\nimport { redirect_console_to_stderr, run_mapper_server } from './rpc.js';\n\nredirect_console_to_stderr();\nrun_mapper_server(create_tsrx_content_mapper());\n"],"x_google_ignoreList":[1,7,8,9,10,11,12,13,14,15],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,mCAAmC;CAC3C,MAAM,WAAW,cAAc,YAAY,GAAG;CAC9C,MAAM,UAAU,SAAS,QAAQ,cAAc,WAC9C,WAAW,OAAO,YAAY,IAAI,OAAO,YAAY,IAAI,OAAO,YAAY,CAC7E;CACA,IAAI,YAAY,UACf,OAAO;CAER,OAAO,CAAC,GAAG,WAAW,OAAO;AAC9B;;AAGA,IAAI;;AAGJ,SAAgB,gCAAgC;CAC/C,8BAA8B,iCAAiC;CAC/D,OAAO;AACR;;;;;AAMA,SAAS,KAAK,WAAW;CACxB,IAAI;EACH,OAAO,GAAG,SAAS,WAAW,EAAE,gBAAgB,MAAM,CAAC;CACxD,QAAQ;EACP;CACD;AACD;;AAGA,SAAgB,qBAAqB;CACpC,OAAO;EACN,aAAa,cAAc,KAAK,SAAS,CAAC,EAAE,OAAO,MAAM;EACzD,kBAAkB,mBAAmB,KAAK,cAAc,CAAC,EAAE,YAAY,MAAM;EAC7E,WAAW,cAAc;GACxB,IAAI;IACH,OAAO,GAAG,aAAa,WAAW,MAAM;GACzC,QAAQ;IACP;GACD;EACD;EACA,2BAA2B;EAC3B,kBAAkB,cAAc,KAAK,SAAS,CAAC,EAAE;EACjD,WAAW,cAAc;GACxB,IAAI;IACH,OAAO,GAAG,aAAa,SAAS;GACjC,QAAQ;IACP,OAAO;GACR;EACD;CACD;AACD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O,MAAM,mBAAmB,KAAK,OAAO,SAAS;EACrD,OAAO,MAAM,IAAI;CAClB;AACD;;;;;AAMA,SAAgB,6BAA6B;CAC5C,QAAQ,MAAM,QAAQ,OAAO,QAAQ,OAAO,QAAQ,SAAS,GAAG,SAAS,QAAQ,MAAM,GAAG,IAAI;AAC/F;;;;;;;;ACpHA,2BAA2B;AAC3B,kBAAkB,2BAA2B,CAAC"}
1
+ {"version":3,"file":"server.js","names":[],"sources":["../src/server.js"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Executable entry of the content mapper: TypeScript spawns it through the\n * `typescript.contentMapper.exec` manifest entry and talks JSON-RPC over stdio.\n */\n\nimport { create_tsrx_content_mapper } from './mapper.js';\nimport { redirect_console_to_stderr, run_mapper_server } from './rpc.js';\n\nredirect_console_to_stderr();\nrun_mapper_server(create_tsrx_content_mapper());\n"],"mappings":";;;;;;;;;AASA,2BAA2B;AAC3B,kBAAkB,2BAA2B,CAAC"}