laplus 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/ui/dist/assets/{DiffPanel-CmLwL5Y4.js → DiffPanel-DRLb5V2O.js} +2 -2
- package/ui/dist/assets/{DiffPanel-CmLwL5Y4.js.map → DiffPanel-DRLb5V2O.js.map} +1 -1
- package/ui/dist/assets/{FilePreviewPanel-7UYO5Mra.js → FilePreviewPanel-CNxX4J5k.js} +2 -2
- package/ui/dist/assets/{FilePreviewPanel-7UYO5Mra.js.map → FilePreviewPanel-CNxX4J5k.js.map} +1 -1
- package/ui/dist/assets/{PreviewPanel-VFr5-jjQ.js → PreviewPanel-D1RgBgdC.js} +2 -2
- package/ui/dist/assets/{PreviewPanel-VFr5-jjQ.js.map → PreviewPanel-D1RgBgdC.js.map} +1 -1
- package/ui/dist/assets/{fileCommentAnnotations-3602doIr.js → fileCommentAnnotations-CLPA7umr.js} +2 -2
- package/ui/dist/assets/{fileCommentAnnotations-3602doIr.js.map → fileCommentAnnotations-CLPA7umr.js.map} +1 -1
- package/ui/dist/assets/{index-BIRnPNNR.js → index-c0OLJn1C.js} +4 -4
- package/ui/dist/assets/{index-BIRnPNNR.js.map → index-c0OLJn1C.js.map} +1 -1
- package/ui/dist/index.html +1 -1
- package/ui/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileCommentAnnotations-3602doIr.js","names":["Fragment","instanceId","instanceId","MessageCircle","Trash2","useState","Button","Textarea","LocalCommentAnnotationProps","kind","rangeLabel","text","onCancel","onComment","onDelete","LocalCommentAnnotation","t0","$","_c","savedText","setText","t1","t2","Symbol","for","t3","t4","t5","t6","t7","t8","_temp","event_1","event","target","value","event_2","key","preventDefault","metaKey","ctrlKey","trim","t9","t10","t11","t12","t13","_temp2","event_0","stopPropagation","LineAnnotation","SelectedLineRange","FileCommentAnnotationEntry","id","kind","startLine","endLine","text","FileCommentAnnotationGroup","entries","FileCommentLineAnnotation","fileCommentSequence","nextFileCommentId","Date","now","normalizeFileCommentRange","range","Math","min","start","end","max","formatFileCommentRange","remapFileCommentAnnotations","annotations","ReadonlyArray","map","annotation","metadata","entry","lineCount","lineNumber"],"sources":["../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/components/File.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js","../../src/components/files/LocalCommentAnnotation.tsx","../../src/components/files/fileCommentAnnotations.ts"],"sourcesContent":["import { CUSTOM_HEADER_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from \"../../constants.js\";\nimport { getLineAnnotationName } from \"../../utils/getLineAnnotationName.js\";\nimport { GutterUtilitySlotStyles } from \"../constants.js\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/react/utils/renderFileChildren.tsx\nfunction renderFileChildren({ file, renderCustomHeader, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, lineAnnotations, renderGutterUtility, getHoveredLine }) {\n\tconst customHeader = renderCustomHeader?.(file);\n\tconst prefix = renderHeaderPrefix?.(file);\n\tconst metadata = renderHeaderMetadata?.(file);\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\tcustomHeader != null ? /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: CUSTOM_HEADER_SLOT_ID,\n\t\t\tchildren: customHeader\n\t\t}) : /* @__PURE__ */ jsxs(Fragment, { children: [prefix != null && /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: HEADER_PREFIX_SLOT_ID,\n\t\t\tchildren: prefix\n\t\t}), metadata != null && /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: HEADER_METADATA_SLOT_ID,\n\t\t\tchildren: metadata\n\t\t})] }),\n\t\trenderAnnotation != null && lineAnnotations?.map((annotation, index) => /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: getLineAnnotationName(annotation),\n\t\t\tchildren: renderAnnotation(annotation)\n\t\t}, index)),\n\t\trenderGutterUtility != null && /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: \"gutter-utility-slot\",\n\t\t\tstyle: GutterUtilitySlotStyles,\n\t\t\tchildren: renderGutterUtility(getHoveredLine)\n\t\t})\n\t] });\n}\n\n//#endregion\nexport { renderFileChildren };\n//# sourceMappingURL=renderFileChildren.js.map","import { DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH } from \"../constants.js\";\nimport { areFilesEqual } from \"../utils/areFilesEqual.js\";\nimport { FILE_ANNOTATION_HUNK_INDEX, FILE_ANNOTATION_LINE_INDEX, getFileAnnotations, shouldRenderFileAnnotations } from \"../utils/includesFileAnnotations.js\";\nimport { createGutterGap, createGutterItem, createGutterWrapper, createHastElement } from \"../utils/hast_utils.js\";\nimport { areLanguagesAttached } from \"../highlighter/languages/areLanguagesAttached.js\";\nimport { getHighlighterIfLoaded, getSharedHighlighter } from \"../highlighter/shared_highlighter.js\";\nimport { getThemes } from \"../utils/getThemes.js\";\nimport { areThemesAttached } from \"../highlighter/themes/areThemesAttached.js\";\nimport { hasResolvedThemes } from \"../highlighter/themes/hasResolvedThemes.js\";\nimport { areFileRenderOptionsEqual } from \"../utils/areFileRenderOptionsEqual.js\";\nimport { areRenderRangesEqual } from \"../utils/areRenderRangesEqual.js\";\nimport { linesFromFileContents } from \"../utils/computeFileOffsets.js\";\nimport { createAnnotationElement } from \"../utils/createAnnotationElement.js\";\nimport { createContentColumn } from \"../utils/createContentColumn.js\";\nimport { createFileHeaderElement } from \"../utils/createFileHeaderElement.js\";\nimport { createPreElement } from \"../utils/createPreElement.js\";\nimport { getFiletypeFromFileName } from \"../utils/getFiletypeFromFileName.js\";\nimport { getHighlighterOptions } from \"../utils/getHighlighterOptions.js\";\nimport { getLineAnnotationName } from \"../utils/getLineAnnotationName.js\";\nimport { isFilePlainText } from \"../utils/isFilePlainText.js\";\nimport { renderFileWithHighlighter } from \"../utils/renderFileWithHighlighter.js\";\nimport { shouldUseTokenTransformer } from \"../utils/shouldUseTokenTransformer.js\";\nimport { toHtml } from \"hast-util-to-html\";\n\n//#region src/renderers/FileRenderer.ts\nlet instanceId = -1;\nvar FileRenderer = class {\n\t__id = `file-renderer:${++instanceId}`;\n\thighlighter;\n\trenderCache;\n\tcomputedLang = \"text\";\n\tlineAnnotations = {};\n\tlineCache;\n\ttextDoucmentCache = /* @__PURE__ */ new WeakMap();\n\tconstructor(options = { theme: DEFAULT_THEMES }, onRenderUpdate, workerManager) {\n\t\tthis.options = options;\n\t\tthis.onRenderUpdate = onRenderUpdate;\n\t\tthis.workerManager = workerManager;\n\t\tif (workerManager?.isWorkingPool() !== true) this.highlighter = areThemesAttached(options.theme ?? DEFAULT_THEMES) ? getHighlighterIfLoaded() : void 0;\n\t}\n\tsetOptions(options) {\n\t\tthis.options = options;\n\t}\n\tmergeOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\tsetLineAnnotations(lineAnnotations) {\n\t\tthis.lineAnnotations = {};\n\t\tfor (const annotation of lineAnnotations) {\n\t\t\tconst arr = this.lineAnnotations[annotation.lineNumber] ?? [];\n\t\t\tthis.lineAnnotations[annotation.lineNumber] = arr;\n\t\t\tarr.push(annotation);\n\t\t}\n\t}\n\tcleanUp() {\n\t\tthis.recycle();\n\t\tthis.workerManager = void 0;\n\t\tthis.onRenderUpdate = void 0;\n\t}\n\trecycle() {\n\t\tthis.clearRenderCache();\n\t\tthis.highlighter = void 0;\n\t\tthis.workerManager?.cleanUpTasks(this);\n\t\tthis.lineCache = void 0;\n\t}\n\tclearRenderCache() {\n\t\tconst renderCache = this.renderCache;\n\t\tthis.renderCache = void 0;\n\t\tif (renderCache != null && renderCache.isDirty === true && renderCache.file.cacheKey != null) this.workerManager?.evictFileFromCache(renderCache.file.cacheKey);\n\t}\n\thydrate(file) {\n\t\tconst { options } = this.getRenderOptions(file);\n\t\tconst massiveFile = isFileMassive(this.getOrCreateLineCache(file).length, this.getTokenizeMaxLength());\n\t\tlet cache = this.workerManager?.getFileResultCache(file);\n\t\tif (cache != null && !areFileRenderOptionsEqual(options, cache.options)) cache = void 0;\n\t\tthis.renderCache ??= {\n\t\t\tfile,\n\t\t\toptions,\n\t\t\thighlighted: !massiveFile && !isFilePlainText(file),\n\t\t\tresult: massiveFile ? void 0 : cache?.result,\n\t\t\trenderRange: void 0\n\t\t};\n\t\tif (this.workerManager?.isWorkingPool() === true) {\n\t\t\tif (this.renderCache.result == null && !massiveFile) this.workerManager.highlightFileAST(this, file);\n\t\t} else if (this.highlighter == null) {\n\t\t\tthis.computedLang = file.lang ?? getFiletypeFromFileName(file.name);\n\t\t\tthis.initializeHighlighter();\n\t\t}\n\t}\n\tgetRenderOptions(file) {\n\t\tconst options = (() => {\n\t\t\tif (this.workerManager?.isWorkingPool() === true) return this.workerManager.getFileRenderOptions();\n\t\t\tconst { theme = DEFAULT_THEMES, tokenizeMaxLineLength = 1e3 } = this.options;\n\t\t\treturn {\n\t\t\t\ttheme,\n\t\t\t\tuseTokenTransformer: shouldUseTokenTransformer(this.options),\n\t\t\t\ttokenizeMaxLineLength\n\t\t\t};\n\t\t})();\n\t\tconst { renderCache } = this;\n\t\tif (renderCache?.result == null) return {\n\t\t\toptions,\n\t\t\tforceHighlight: true\n\t\t};\n\t\tif (!areFilesEqual(file, renderCache.file) || !areFileRenderOptionsEqual(options, renderCache.options)) return {\n\t\t\toptions,\n\t\t\tforceHighlight: true\n\t\t};\n\t\treturn {\n\t\t\toptions,\n\t\t\tforceHighlight: false\n\t\t};\n\t}\n\tgetOrCreateLineCache(file) {\n\t\tif (file.cacheKey == null) {\n\t\t\tthis.lineCache = void 0;\n\t\t\treturn linesFromFileContents(file.contents);\n\t\t}\n\t\tlet { lineCache } = this;\n\t\tif (lineCache == null || lineCache.cacheKey !== file.cacheKey) lineCache = {\n\t\t\tcacheKey: file.cacheKey,\n\t\t\tlines: linesFromFileContents(file.contents)\n\t\t};\n\t\tthis.lineCache = lineCache;\n\t\treturn lineCache.lines;\n\t}\n\tgetLineCount(file) {\n\t\treturn this.textDoucmentCache.get(file)?.lineCount ?? this.getOrCreateLineCache(file).length;\n\t}\n\tupdateRenderCache(dirtyLines, themeType) {\n\t\tif (this.renderCache == null) return;\n\t\tconst { result } = this.renderCache;\n\t\tif (result == null) return;\n\t\tfor (const [line, tokens] of dirtyLines) result.code[line] = {\n\t\t\ttype: \"element\",\n\t\t\ttagName: \"div\",\n\t\t\tproperties: {\n\t\t\t\t\"data-line\": line + 1,\n\t\t\t\t\"data-line-type\": \"context\",\n\t\t\t\t\"data-line-index\": line\n\t\t\t},\n\t\t\tchildren: tokens.map(([char, fg, text]) => {\n\t\t\t\tif (char === 0 && fg === \"\") {\n\t\t\t\t\tif (text === \"\") return {\n\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\ttagName: \"br\",\n\t\t\t\t\t\tproperties: {},\n\t\t\t\t\t\tchildren: []\n\t\t\t\t\t};\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tvalue: text\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"element\",\n\t\t\t\t\ttagName: \"span\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\"data-char\": char,\n\t\t\t\t\t\tstyle: `--diffs-token-${themeType}:${fg};`\n\t\t\t\t\t},\n\t\t\t\t\tchildren: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tvalue: text\n\t\t\t\t\t}]\n\t\t\t\t};\n\t\t\t})\n\t\t};\n\t\tresult.baseThemeType = themeType;\n\t\tthis.renderCache.isDirty = true;\n\t}\n\tapplyDocumentChange(textDocument) {\n\t\tif (this.renderCache == null) return;\n\t\tconst { file, result } = this.renderCache;\n\t\tif (result != null && result.code.length !== textDocument.lineCount) {\n\t\t\tfor (let i = result.code.length; i < textDocument.lineCount; i++) result.code.push({\n\t\t\t\ttype: \"element\",\n\t\t\t\ttagName: \"div\",\n\t\t\t\tproperties: {\n\t\t\t\t\t\"data-line\": i + 1,\n\t\t\t\t\t\"data-line-type\": \"context\",\n\t\t\t\t\t\"data-line-index\": i\n\t\t\t\t},\n\t\t\t\tchildren: [{\n\t\t\t\t\ttype: \"element\",\n\t\t\t\t\ttagName: \"span\",\n\t\t\t\t\tproperties: { \"data-char\": 0 },\n\t\t\t\t\tchildren: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tvalue: textDocument.getLineText(i)\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t});\n\t\t\tthis.renderCache.isDirty = true;\n\t\t}\n\t\tthis.textDoucmentCache.set(file, textDocument);\n\t}\n\trenderFile(file = this.renderCache?.file, renderRange = DEFAULT_RENDER_RANGE) {\n\t\tif (file == null) return;\n\t\tlet { options, forceHighlight } = this.getRenderOptions(file);\n\t\tconst cache = this.getMatchingWorkerResultCache(file, options);\n\t\tif (cache != null && !this.hasHighlightedRenderCache(file, options)) {\n\t\t\tthis.renderCache = {\n\t\t\t\tfile,\n\t\t\t\thighlighted: true,\n\t\t\t\trenderRange: void 0,\n\t\t\t\t...cache\n\t\t\t};\n\t\t\tforceHighlight = false;\n\t\t}\n\t\tthis.renderCache ??= {\n\t\t\tfile,\n\t\t\thighlighted: false,\n\t\t\toptions,\n\t\t\tresult: void 0,\n\t\t\trenderRange: void 0\n\t\t};\n\t\tconst lines = this.getOrCreateLineCache(file);\n\t\tconst hasContent = file.contents.length > 0;\n\t\tconst forcePlainText = !hasContent || isFilePlainText(file) || isFileMassive(lines.length, this.getTokenizeMaxLength());\n\t\tconst newContent = !areFilesEqual(file, this.renderCache.file);\n\t\tconst newRenderRange = !areRenderRangesEqual(this.renderCache.renderRange, renderRange);\n\t\tif (this.workerManager?.isWorkingPool() === true) {\n\t\t\tif (forcePlainText || this.renderCache.result == null || !this.renderCache.highlighted && (newContent || newRenderRange)) {\n\t\t\t\tthis.renderCache.file = file;\n\t\t\t\tthis.renderCache.options = options;\n\t\t\t\tthis.renderCache.highlighted = false;\n\t\t\t\tif (this.renderCache.result == null || newContent || newRenderRange || forceHighlight) this.renderCache.result = this.workerManager.getPlainFileAST(file, renderRange.startingLine, renderRange.totalLines, lines);\n\t\t\t\tthis.renderCache.renderRange = renderRange;\n\t\t\t}\n\t\t\tif (!forcePlainText && hasContent && (!this.renderCache.highlighted || forceHighlight)) this.workerManager.highlightFileAST(this, file);\n\t\t} else {\n\t\t\tthis.computedLang = file.lang ?? getFiletypeFromFileName(file.name);\n\t\t\tconst hasThemes = this.highlighter != null && areThemesAttached(options.theme);\n\t\t\tconst hasLangs = this.highlighter != null && areLanguagesAttached(this.computedLang);\n\t\t\tconst canHighlight = !forcePlainText && hasLangs;\n\t\t\tif (this.highlighter != null && hasThemes && (forceHighlight || forcePlainText || !this.renderCache.highlighted && canHighlight || this.renderCache.result == null)) {\n\t\t\t\tconst { result, options: options$1 } = this.renderFileWithHighlighter(file, this.highlighter, forcePlainText || !hasLangs);\n\t\t\t\tthis.renderCache = {\n\t\t\t\t\tfile,\n\t\t\t\t\toptions: options$1,\n\t\t\t\t\thighlighted: canHighlight,\n\t\t\t\t\tresult,\n\t\t\t\t\trenderRange: void 0\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!hasThemes || !forcePlainText && !hasLangs) this.asyncHighlight(file).then(({ result, options: options$1 }) => {\n\t\t\t\tif (this.renderCache != null) this.renderCache.highlighted = false;\n\t\t\t\tthis.onHighlightSuccess(file, result, options$1, !forcePlainText);\n\t\t\t});\n\t\t}\n\t\treturn this.renderCache.result != null ? this.processFileResult(this.renderCache.file, renderRange, this.renderCache.result) : void 0;\n\t}\n\tasync asyncRender(file, renderRange = DEFAULT_RENDER_RANGE) {\n\t\tconst { result } = await this.asyncHighlight(file);\n\t\treturn this.processFileResult(file, renderRange, result);\n\t}\n\tasync asyncHighlight(file) {\n\t\tconst forcePlainText = isFileMassive(this.getOrCreateLineCache(file).length, this.getTokenizeMaxLength());\n\t\tthis.computedLang = forcePlainText ? \"text\" : file.lang ?? getFiletypeFromFileName(file.name);\n\t\tconst hasThemes = this.highlighter != null && hasResolvedThemes(getThemes(this.options.theme));\n\t\tconst hasLangs = forcePlainText || this.highlighter != null && areLanguagesAttached(this.computedLang);\n\t\tif (this.highlighter == null || !hasThemes || !hasLangs) this.highlighter = await this.initializeHighlighter();\n\t\treturn this.renderFileWithHighlighter(file, this.highlighter, forcePlainText);\n\t}\n\trenderFileWithHighlighter(file, highlighter, forcePlainText = false) {\n\t\tconst { options } = this.getRenderOptions(file);\n\t\treturn {\n\t\t\tresult: renderFileWithHighlighter(file, highlighter, options, { forcePlainText }),\n\t\t\toptions\n\t\t};\n\t}\n\tprocessFileResult(file, renderRange, { code, themeStyles, baseThemeType }) {\n\t\tconst totalLines = this.getLineCount(file);\n\t\tconst { disableFileHeader = false } = this.options;\n\t\tconst contentArray = [];\n\t\tconst gutter = createGutterWrapper();\n\t\tconst endLine = Math.min(renderRange.startingLine + renderRange.totalLines, totalLines);\n\t\tlet rowCount = 0;\n\t\tconst fileLevelAnnotations = shouldRenderFileAnnotations(renderRange) ? getFileAnnotations(this.lineAnnotations) : void 0;\n\t\tif (fileLevelAnnotations != null) {\n\t\t\tgutter.children.push(createGutterGap(\"context\", \"annotation\", 1));\n\t\t\tcontentArray.push(createAnnotationElement({\n\t\t\t\ttype: \"annotation\",\n\t\t\t\thunkIndex: FILE_ANNOTATION_HUNK_INDEX,\n\t\t\t\tlineIndex: FILE_ANNOTATION_LINE_INDEX,\n\t\t\t\tannotations: fileLevelAnnotations.map((annotation) => getLineAnnotationName(annotation))\n\t\t\t}));\n\t\t\trowCount++;\n\t\t}\n\t\tfor (let lineIndex = renderRange.startingLine; lineIndex < endLine; lineIndex++) {\n\t\t\tconst lineNumber = lineIndex + 1;\n\t\t\tconst line = code[lineIndex];\n\t\t\tif (line == null) {\n\t\t\t\tconst message = \"FileRenderer.processFileResult: Line doesnt exist\";\n\t\t\t\tconsole.error(message, {\n\t\t\t\t\tname: file.name,\n\t\t\t\t\tlineIndex,\n\t\t\t\t\tlineNumber\n\t\t\t\t});\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\t\t\tgutter.children.push(createGutterItem(\"context\", lineNumber, `${lineIndex}`));\n\t\t\tcontentArray.push(line);\n\t\t\trowCount++;\n\t\t\tconst annotations = this.lineAnnotations[lineNumber];\n\t\t\tif (annotations != null) {\n\t\t\t\tgutter.children.push(createGutterGap(\"context\", \"annotation\", 1));\n\t\t\t\tcontentArray.push(createAnnotationElement({\n\t\t\t\t\ttype: \"annotation\",\n\t\t\t\t\thunkIndex: 0,\n\t\t\t\t\tlineIndex: lineNumber,\n\t\t\t\t\tannotations: annotations.map((annotation) => getLineAnnotationName(annotation))\n\t\t\t\t}));\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t}\n\t\tgutter.properties.style = `grid-row: span ${rowCount}`;\n\t\treturn {\n\t\t\tgutterAST: gutter.children ?? [],\n\t\t\tcontentAST: contentArray,\n\t\t\tpreAST: this.createPreElement(totalLines),\n\t\t\theaderAST: !disableFileHeader ? this.renderHeader(file) : void 0,\n\t\t\ttotalLines,\n\t\t\trowCount,\n\t\t\tthemeStyles,\n\t\t\tbaseThemeType,\n\t\t\tbufferBefore: renderRange.bufferBefore,\n\t\t\tbufferAfter: renderRange.bufferAfter,\n\t\t\tcss: \"\"\n\t\t};\n\t}\n\trenderHeader(file) {\n\t\tconst { headerRenderMode = \"default\", stickyHeader = false } = this.options;\n\t\treturn createFileHeaderElement({\n\t\t\tfileOrDiff: file,\n\t\t\tmode: headerRenderMode,\n\t\t\tstickyHeader\n\t\t});\n\t}\n\trenderFullHTML(result) {\n\t\treturn toHtml(this.renderFullAST(result));\n\t}\n\trenderFullAST(result, children = []) {\n\t\tchildren.push(createHastElement({\n\t\t\ttagName: \"code\",\n\t\t\tchildren: this.renderCodeAST(result),\n\t\t\tproperties: { \"data-code\": \"\" }\n\t\t}));\n\t\treturn {\n\t\t\t...result.preAST,\n\t\t\tchildren\n\t\t};\n\t}\n\trenderCodeAST(result) {\n\t\tconst gutter = createGutterWrapper();\n\t\tgutter.children = result.gutterAST;\n\t\tgutter.properties.style = `grid-row: span ${result.rowCount}`;\n\t\treturn [gutter, createContentColumn(result.contentAST, result.rowCount)];\n\t}\n\trenderPartialHTML(children, includeCodeNode = false) {\n\t\tif (!includeCodeNode) return toHtml(children);\n\t\treturn toHtml(createHastElement({\n\t\t\ttagName: \"code\",\n\t\t\tchildren,\n\t\t\tproperties: { \"data-code\": \"\" }\n\t\t}));\n\t}\n\tasync initializeHighlighter() {\n\t\tthis.highlighter = await getSharedHighlighter(getHighlighterOptions(this.computedLang, this.options));\n\t\treturn this.highlighter;\n\t}\n\tonHighlightSuccess(file, result, options, highlighted = true) {\n\t\tif (this.renderCache == null) return;\n\t\tconst triggerRenderUpdate = !areFilesEqual(file, this.renderCache.file) || !this.renderCache.highlighted || !areFileRenderOptionsEqual(options, this.renderCache.options);\n\t\tthis.renderCache = {\n\t\t\tfile,\n\t\t\toptions,\n\t\t\thighlighted,\n\t\t\tresult,\n\t\t\trenderRange: void 0\n\t\t};\n\t\tif (triggerRenderUpdate) this.onRenderUpdate?.();\n\t}\n\tgetMatchingWorkerResultCache(file, options) {\n\t\tconst cache = this.workerManager?.getFileResultCache(file);\n\t\tif (cache == null || !areFileRenderOptionsEqual(options, cache.options)) return;\n\t\treturn cache;\n\t}\n\thasHighlightedRenderCache(file, options) {\n\t\tconst { renderCache } = this;\n\t\treturn renderCache?.result != null && renderCache.highlighted && areFilesEqual(file, renderCache.file) && areFileRenderOptionsEqual(options, renderCache.options);\n\t}\n\tonHighlightError(error) {\n\t\tconsole.error(error);\n\t}\n\tgetTokenizeMaxLength() {\n\t\treturn this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH;\n\t}\n\tcreatePreElement(totalLines) {\n\t\tconst { disableLineNumbers = false, overflow = \"scroll\" } = this.options;\n\t\treturn createPreElement({\n\t\t\ttype: \"file\",\n\t\t\tdiffIndicators: \"none\",\n\t\t\tdisableBackground: true,\n\t\t\tdisableLineNumbers,\n\t\t\toverflow,\n\t\t\tsplit: false,\n\t\t\ttotalLines\n\t\t});\n\t}\n};\nfunction isFileMassive(lineCount, tokenizeMaxLength) {\n\treturn lineCount > tokenizeMaxLength;\n}\n\n//#endregion\nexport { FileRenderer };\n//# sourceMappingURL=FileRenderer.js.map","//#region src/utils/areLineAnnotationsEqual.ts\nfunction areLineAnnotationsEqual(annotationA, annotationB) {\n\treturn annotationA.lineNumber === annotationB.lineNumber && annotationA.metadata === annotationB.metadata;\n}\n\n//#endregion\nexport { areLineAnnotationsEqual };\n//# sourceMappingURL=areLineAnnotationsEqual.js.map","//#region src/utils/getFileRendererOptions.ts\nfunction getFileRendererOptions(options) {\n\treturn {\n\t\ttheme: options?.theme,\n\t\tdisableLineNumbers: options?.disableLineNumbers,\n\t\toverflow: options?.overflow,\n\t\tthemeType: options?.themeType,\n\t\tcollapsed: options?.collapsed,\n\t\tdisableFileHeader: options?.disableFileHeader,\n\t\tdisableVirtualizationBuffers: options?.disableVirtualizationBuffers,\n\t\tstickyHeader: options?.stickyHeader,\n\t\tpreferredHighlighter: options?.preferredHighlighter,\n\t\tuseCSSClasses: options?.useCSSClasses,\n\t\tuseTokenTransformer: options?.useTokenTransformer,\n\t\ttokenizeMaxLineLength: options?.tokenizeMaxLineLength,\n\t\ttokenizeMaxLength: options?.tokenizeMaxLength,\n\t\tunsafeCSS: options?.unsafeCSS,\n\t\theaderRenderMode: options?.renderCustomHeader != null ? \"custom\" : \"default\"\n\t};\n}\n\n//#endregion\nexport { getFileRendererOptions };\n//# sourceMappingURL=getFileRendererOptions.js.map","import { CUSTOM_HEADER_SLOT_ID, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH, DIFFS_TAG_NAME, EMPTY_RENDER_RANGE, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, THEME_CSS_ATTRIBUTE, UNSAFE_CSS_ATTRIBUTE } from \"../constants.js\";\nimport { queueRender } from \"../managers/UniversalRenderingManager.js\";\nimport { areThemesEqual } from \"../utils/areThemesEqual.js\";\nimport { isStyleNode } from \"../utils/isStyleNode.js\";\nimport { areFilesEqual } from \"../utils/areFilesEqual.js\";\nimport { InteractionManager, pluckInteractionOptions } from \"../managers/InteractionManager.js\";\nimport { ResizeManager } from \"../managers/ResizeManager.js\";\nimport { areRenderRangesEqual } from \"../utils/areRenderRangesEqual.js\";\nimport { getLineAnnotationName } from \"../utils/getLineAnnotationName.js\";\nimport { isFilePlainText } from \"../utils/isFilePlainText.js\";\nimport { FileRenderer } from \"../renderers/FileRenderer.js\";\nimport { SVGSpriteSheet } from \"../sprite.js\";\nimport { areLineAnnotationsEqual } from \"../utils/areLineAnnotationsEqual.js\";\nimport { arePrePropertiesEqual } from \"../utils/arePrePropertiesEqual.js\";\nimport { createAnnotationWrapperNode } from \"../utils/createAnnotationWrapperNode.js\";\nimport { createGutterUtilityContentNode } from \"../utils/createGutterUtilityContentNode.js\";\nimport { createUnsafeCSSStyleNode } from \"../utils/createUnsafeCSSStyleNode.js\";\nimport { getMeasuredScrollbarGutter } from \"../utils/scrollbarGutter.js\";\nimport { patchScrollbarGutterSize, wrapThemeCSS, wrapUnsafeCSS } from \"../utils/cssWrappers.js\";\nimport { getFileRendererOptions } from \"../utils/getFileRendererOptions.js\";\nimport { getOrCreateCodeNode } from \"../utils/getOrCreateCodeNode.js\";\nimport { upsertHostThemeStyle } from \"../utils/hostTheme.js\";\nimport { prerenderHTMLIfNecessary } from \"../utils/prerenderHTMLIfNecessary.js\";\nimport { setPreNodeProperties } from \"../utils/setWrapperNodeProps.js\";\nimport { DiffsContainerLoaded } from \"./web-components.js\";\nimport { toHtml } from \"hast-util-to-html\";\n\n//#region src/components/File.ts\nconst EMPTY_STRINGS = [\"\"];\nlet instanceId = -1;\nvar File = class {\n\tstatic LoadedCustomComponent = DiffsContainerLoaded;\n\t__id = `file:${++instanceId}`;\n\ttype = \"file\";\n\tfileContainer;\n\tspriteSVG;\n\tpre;\n\tcode;\n\tbufferBefore;\n\tbufferAfter;\n\tthemeCSSStyle;\n\tappliedThemeCSS;\n\thasAdoptedThemeCSS = false;\n\tunsafeCSSStyle;\n\tappliedUnsafeCSS;\n\tgutterUtilityContent;\n\terrorWrapper;\n\tplaceHolder;\n\tlastRenderedHeaderHTML;\n\tcachedHeaderHTML;\n\tappliedPreAttributes;\n\tlastRowCount;\n\tmounted = false;\n\theaderElement;\n\theaderCustom;\n\theaderPrefix;\n\theaderMetadata;\n\tfileRenderer;\n\tresizeManager;\n\tinteractionManager;\n\tannotationCache = /* @__PURE__ */ new Map();\n\tlineAnnotations = [];\n\tmanagersDirty = false;\n\tfile;\n\trenderRange;\n\tenabled = true;\n\teditor;\n\tconstructor(options = { theme: DEFAULT_THEMES }, workerManager, isContainerManaged = false) {\n\t\tthis.options = options;\n\t\tthis.workerManager = workerManager;\n\t\tthis.isContainerManaged = isContainerManaged;\n\t\tthis.fileRenderer = new FileRenderer(options, this.handleHighlightRender, this.workerManager);\n\t\tthis.resizeManager = new ResizeManager();\n\t\tthis.interactionManager = new InteractionManager(\"file\", pluckInteractionOptions(options));\n\t\tthis.workerManager?.subscribeToThemeChanges(this);\n\t}\n\thandleHighlightRender = () => {\n\t\tthis.rerender();\n\t};\n\trerender() {\n\t\tif (!this.enabled || this.file == null) return;\n\t\tthis.render({\n\t\t\tfile: this.file,\n\t\t\tforceRender: true,\n\t\t\trenderRange: this.renderRange\n\t\t});\n\t}\n\tonThemeChange() {\n\t\tthis.fileRenderer.clearRenderCache();\n\t\tthis.rerender();\n\t}\n\tsetOptions(options) {\n\t\tif (options == null) return;\n\t\tthis.options = options;\n\t\tthis.cachedHeaderHTML = void 0;\n\t\tthis.syncInteractionOptions();\n\t}\n\tsyncInteractionOptions() {\n\t\tthis.interactionManager.setOptions(pluckInteractionOptions(this.options));\n\t}\n\tmergeOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\tsetThemeType(themeType) {\n\t\tif ((this.options.themeType ?? \"system\") === themeType) return;\n\t\tthis.mergeOptions({ themeType });\n\t\tthis.applyCachedThemeState(themeType);\n\t}\n\tapplyCachedThemeState(themeType) {\n\t\tif (typeof this.options.theme === \"string\" || this.fileContainer == null || this.appliedThemeCSS == null) return false;\n\t\tconst effectiveThemeType = this.appliedThemeCSS.baseThemeType ?? themeType;\n\t\tif (this.appliedThemeCSS.themeType === effectiveThemeType) return false;\n\t\tthis.applyThemeState(this.fileContainer, this.appliedThemeCSS.themeStyles, themeType, this.appliedThemeCSS.baseThemeType);\n\t\treturn true;\n\t}\n\thasThemeChanged() {\n\t\treturn this.appliedThemeCSS != null && !areThemesEqual(this.appliedThemeCSS.theme, this.options.theme ?? DEFAULT_THEMES);\n\t}\n\tgetHoveredLine = () => {\n\t\treturn this.interactionManager.getHoveredLine();\n\t};\n\tsetLineAnnotations(lineAnnotations) {\n\t\tthis.lineAnnotations = lineAnnotations;\n\t}\n\tsetSelectedLines(range, options) {\n\t\tthis.interactionManager.setSelection(range, options);\n\t}\n\tflushManagers() {\n\t\tif (!this.managersDirty || this.pre == null) {\n\t\t\tthis.managersDirty = false;\n\t\t\treturn;\n\t\t}\n\t\tconst { overflow = \"scroll\" } = this.options;\n\t\tthis.interactionManager.setup(this.pre);\n\t\tthis.resizeManager.setup(this.pre, overflow === \"wrap\");\n\t\tthis.managersDirty = false;\n\t}\n\tcleanUp(recycle = false) {\n\t\tthis.emitPostRender(true);\n\t\tthis.resizeManager.cleanUp();\n\t\tthis.interactionManager.cleanUp();\n\t\tthis.managersDirty = false;\n\t\tthis.workerManager?.unsubscribeToThemeChanges(this);\n\t\tthis.renderRange = void 0;\n\t\tif (!this.isContainerManaged) this.fileContainer?.remove();\n\t\tthis.fileContainer = void 0;\n\t\tthis.mounted = false;\n\t\tif (!recycle) this.lineAnnotations = [];\n\t\tthis.annotationCache.clear();\n\t\tthis.pre = void 0;\n\t\tthis.bufferBefore = void 0;\n\t\tthis.bufferAfter = void 0;\n\t\tthis.appliedPreAttributes = void 0;\n\t\tthis.lastRowCount = void 0;\n\t\tthis.headerElement = void 0;\n\t\tthis.headerPrefix = void 0;\n\t\tthis.headerMetadata = void 0;\n\t\tthis.headerCustom = void 0;\n\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\tif (!recycle) this.cachedHeaderHTML = void 0;\n\t\tthis.errorWrapper = void 0;\n\t\tthis.themeCSSStyle = void 0;\n\t\tthis.appliedThemeCSS = void 0;\n\t\tthis.hasAdoptedThemeCSS = false;\n\t\tthis.unsafeCSSStyle = void 0;\n\t\tthis.appliedUnsafeCSS = void 0;\n\t\tthis.placeHolder = void 0;\n\t\tthis.unsafeCSSStyle = void 0;\n\t\tif (recycle) this.fileRenderer.recycle();\n\t\telse {\n\t\t\tthis.fileRenderer.cleanUp();\n\t\t\tthis.workerManager = void 0;\n\t\t\tthis.file = void 0;\n\t\t}\n\t\tthis.enabled = false;\n\t\tthis.editor?.cleanUp();\n\t\tthis.editor = void 0;\n\t}\n\tvirtualizedSetup() {\n\t\tthis.enabled = true;\n\t\tthis.workerManager?.subscribeToThemeChanges(this);\n\t}\n\thydrate(props) {\n\t\tconst { fileContainer, prerenderedHTML, preventEmit = false, file, lineAnnotations } = props;\n\t\tthis.hydrateElements(fileContainer, prerenderedHTML);\n\t\tif (shouldRenderCode(this.pre, file, this.options.collapsed) || shouldRenderHeader(this.headerElement, file, this.options.disableFileHeader)) this.render({\n\t\t\t...props,\n\t\t\tpreventEmit: true\n\t\t});\n\t\telse this.hydrationSetup({\n\t\t\tfile,\n\t\t\tlineAnnotations\n\t\t});\n\t\tif (!preventEmit) this.emitPostRender();\n\t}\n\thydrateElements(fileContainer, prerenderedHTML) {\n\t\tif (this.fileContainer !== fileContainer) this.emitPostRender(true);\n\t\tprerenderHTMLIfNecessary(fileContainer, prerenderedHTML);\n\t\tfor (const element of Array.from(fileContainer.shadowRoot?.children ?? [])) {\n\t\t\tif (element instanceof SVGElement) {\n\t\t\t\tthis.spriteSVG = element;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!(element instanceof HTMLElement)) continue;\n\t\t\tif (element instanceof HTMLPreElement) {\n\t\t\t\tthis.pre = element;\n\t\t\t\tthis.appliedPreAttributes = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (element instanceof HTMLStyleElement && element.hasAttribute(THEME_CSS_ATTRIBUTE)) {\n\t\t\t\tthis.themeCSSStyle = element;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (element instanceof HTMLStyleElement && element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)) {\n\t\t\t\tthis.unsafeCSSStyle = element;\n\t\t\t\tthis.appliedUnsafeCSS = element.textContent;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (\"diffsHeader\" in element.dataset) {\n\t\t\t\tthis.headerElement = element;\n\t\t\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (this.pre != null) {\n\t\t\tthis.syncCodeNodeFromPre(this.pre);\n\t\t\tthis.pre.removeAttribute(\"data-dehydrated\");\n\t\t}\n\t\tthis.fileContainer = fileContainer;\n\t\tthis.hydrateMeasuredScrollbar();\n\t}\n\thydrationSetup({ file, lineAnnotations }) {\n\t\tthis.lineAnnotations = lineAnnotations ?? this.lineAnnotations;\n\t\tthis.file = file;\n\t\tthis.fileRenderer.setOptions(getFileRendererOptions(this.options));\n\t\tthis.syncInteractionOptions();\n\t\tif (this.pre == null) return;\n\t\tthis.fileRenderer.hydrate(file);\n\t\tthis.renderAnnotations();\n\t\tthis.renderGutterUtility();\n\t\tthis.injectUnsafeCSS();\n\t\tthis.managersDirty = true;\n\t\tthis.flushManagers();\n\t}\n\tgetOrCreateLineCache(file = this.file) {\n\t\treturn file != null ? this.fileRenderer.getOrCreateLineCache(file) : EMPTY_STRINGS;\n\t}\n\tupdateBuffers(renderRange) {\n\t\tif (this.pre != null) this.applyBuffers(this.pre, renderRange);\n\t}\n\tsyncRenderView = () => {\n\t\tconst editor = this.editor;\n\t\tconst fileContainer = this.fileContainer;\n\t\tconst file = this.file;\n\t\tif (editor != null && fileContainer != null && file != null) this.fileRenderer.initializeHighlighter().then((highlighter) => {\n\t\t\teditor.__syncRenderView(highlighter, fileContainer, file, this.lineAnnotations, this.renderRange);\n\t\t});\n\t};\n\tattachEditor(editor) {\n\t\tthis.editor?.cleanUp();\n\t\tthis.editor = editor;\n\t\tqueueRender(this.syncRenderView);\n\t\treturn () => {\n\t\t\tthis.editor = void 0;\n\t\t};\n\t}\n\tapplyDocumentChange(textDocument, newLineAnnotations) {\n\t\tthis.fileRenderer.applyDocumentChange(textDocument);\n\t\tif (newLineAnnotations != null && newLineAnnotations !== this.lineAnnotations && this.file != null) {\n\t\t\tthis.setLineAnnotations(newLineAnnotations);\n\t\t\tthis.fileRenderer.setLineAnnotations(this.lineAnnotations);\n\t\t\tthis.renderAnnotations();\n\t\t}\n\t}\n\tupdateRenderCache(dirtyLines, themeType) {\n\t\tthis.fileRenderer.updateRenderCache(dirtyLines, themeType);\n\t}\n\trender({ file, fileContainer, forceRender = false, preventEmit = false, containerWrapper, deferManagers = false, lineAnnotations, renderRange }) {\n\t\tif (!this.enabled) throw new Error(\"File.render: attempting to call render after cleaned up\");\n\t\tthis.editor?.__postponeBackgroundTokenizeToNextFrame();\n\t\tconst { collapsed = false, themeType = \"system\" } = this.options;\n\t\tconst nextRenderRange = collapsed ? void 0 : renderRange;\n\t\tconst previousRenderRange = this.renderRange;\n\t\tconst themeChanged = this.hasThemeChanged();\n\t\tconst annotationsChanged = lineAnnotations != null && (lineAnnotations.length > 0 || this.lineAnnotations.length > 0) ? lineAnnotations !== this.lineAnnotations : false;\n\t\tconst didFileChange = !areFilesEqual(this.file, file);\n\t\tif (!collapsed && !forceRender && areRenderRangesEqual(nextRenderRange, this.renderRange) && !didFileChange && !annotationsChanged && !themeChanged) return this.applyCachedThemeState(themeType);\n\t\tthis.renderRange = nextRenderRange;\n\t\tif (didFileChange) this.cachedHeaderHTML = void 0;\n\t\tthis.file = file;\n\t\tthis.fileRenderer.setOptions(getFileRendererOptions(this.options));\n\t\tthis.syncInteractionOptions();\n\t\tif (lineAnnotations != null) this.setLineAnnotations(lineAnnotations);\n\t\tthis.fileRenderer.setLineAnnotations(this.lineAnnotations);\n\t\tconst { disableErrorHandling = false, disableFileHeader = false } = this.options;\n\t\tif (disableFileHeader) {\n\t\t\tif (this.headerElement != null) {\n\t\t\t\tthis.headerElement.remove();\n\t\t\t\tthis.headerElement = void 0;\n\t\t\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\t\t}\n\t\t\tthis.clearHeaderSlots();\n\t\t}\n\t\tfileContainer = this.getOrCreateFileContainerNode(fileContainer, containerWrapper);\n\t\tthis.applyCachedThemeState(themeType);\n\t\tif (collapsed) {\n\t\t\tthis.removeRenderedCode();\n\t\t\tthis.clearAuxiliaryNodes();\n\t\t\ttry {\n\t\t\t\tconst fileResult = this.fileRenderer.renderFile(file, EMPTY_RENDER_RANGE);\n\t\t\t\tif (fileResult != null) this.applyThemeState(fileContainer, fileResult.themeStyles, themeType, fileResult.baseThemeType);\n\t\t\t\tif (fileResult?.headerAST != null) this.applyHeaderToDOM(fileResult.headerAST, fileContainer);\n\t\t\t\tthis.injectUnsafeCSS();\n\t\t\t} catch (error) {\n\t\t\t\tif (disableErrorHandling) throw error;\n\t\t\t\tconsole.error(error);\n\t\t\t\tif (error instanceof Error) this.applyErrorToDOM(error, fileContainer);\n\t\t\t}\n\t\t\tif (!preventEmit) this.emitPostRender();\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tconst pre = this.getOrCreatePreNode(fileContainer);\n\t\t\tif (!this.canPartiallyRender(forceRender, annotationsChanged, didFileChange || themeChanged) || !this.applyPartialRender(previousRenderRange, nextRenderRange)) {\n\t\t\t\tconst fileResult = this.fileRenderer.renderFile(file, nextRenderRange);\n\t\t\t\tif (fileResult == null) {\n\t\t\t\t\tif (this.workerManager?.isInitialized() === false) this.workerManager.initialize().then(() => this.rerender());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthis.applyThemeState(fileContainer, fileResult.themeStyles, themeType, fileResult.baseThemeType);\n\t\t\t\tif (fileResult.headerAST != null) this.applyHeaderToDOM(fileResult.headerAST, fileContainer);\n\t\t\t\tthis.applyFullRender(fileResult, pre);\n\t\t\t}\n\t\t\tthis.applyBuffers(pre, nextRenderRange);\n\t\t\tthis.injectUnsafeCSS();\n\t\t\tthis.managersDirty = true;\n\t\t\tif (!deferManagers) this.flushManagers();\n\t\t\tthis.renderAnnotations();\n\t\t\tthis.renderGutterUtility();\n\t\t\tif (this.editor != null) queueRender(this.syncRenderView);\n\t\t} catch (error) {\n\t\t\tif (disableErrorHandling) throw error;\n\t\t\tconsole.error(error);\n\t\t\tif (error instanceof Error) this.applyErrorToDOM(error, fileContainer);\n\t\t}\n\t\tif (!preventEmit) this.emitPostRender();\n\t\treturn true;\n\t}\n\temitPostRender(unmount = false) {\n\t\tconst { fileContainer, options: { onPostRender } } = this;\n\t\tif (unmount) {\n\t\t\tif (!this.mounted) return;\n\t\t\tthis.mounted = false;\n\t\t\tif (fileContainer == null) return;\n\t\t\tonPostRender?.(fileContainer, this, \"unmount\");\n\t\t\treturn;\n\t\t}\n\t\tif (fileContainer == null) return;\n\t\tconst phase = this.mounted ? \"update\" : \"mount\";\n\t\tthis.mounted = true;\n\t\tonPostRender?.(fileContainer, this, phase);\n\t}\n\tremoveRenderedCode() {\n\t\tthis.resizeManager.cleanUp();\n\t\tthis.interactionManager.cleanUp();\n\t\tthis.bufferBefore?.remove();\n\t\tthis.bufferBefore = void 0;\n\t\tthis.bufferAfter?.remove();\n\t\tthis.bufferAfter = void 0;\n\t\tthis.code?.remove();\n\t\tthis.code = void 0;\n\t\tthis.pre?.remove();\n\t\tthis.pre = void 0;\n\t\tthis.appliedPreAttributes = void 0;\n\t\tthis.lastRowCount = void 0;\n\t}\n\tclearAuxiliaryNodes() {\n\t\tfor (const { element } of this.annotationCache.values()) element.remove();\n\t\tthis.annotationCache.clear();\n\t\tthis.gutterUtilityContent?.remove();\n\t\tthis.gutterUtilityContent = void 0;\n\t}\n\tcanPartiallyRender(forceRender, annotationsChanged, didContentChange) {\n\t\tif (forceRender || annotationsChanged || didContentChange) return false;\n\t\treturn true;\n\t}\n\trenderPlaceholder(height) {\n\t\tif (this.fileContainer == null) return false;\n\t\tthis.emitPostRender(true);\n\t\tthis.cleanChildNodes();\n\t\tif (this.placeHolder == null) {\n\t\t\tconst shadowRoot = this.fileContainer.shadowRoot ?? this.fileContainer.attachShadow({ mode: \"open\" });\n\t\t\tthis.placeHolder = document.createElement(\"div\");\n\t\t\tthis.placeHolder.dataset.placeholder = \"\";\n\t\t\tshadowRoot.appendChild(this.placeHolder);\n\t\t}\n\t\tthis.placeHolder.style.setProperty(\"height\", `${height}px`);\n\t\treturn true;\n\t}\n\tprimeHighlightCache() {\n\t\tconst { file, workerManager } = this;\n\t\tif (file == null || file.cacheKey == null || workerManager == null || isFilePlainText(file)) return;\n\t\tif (this.fileRenderer.getOrCreateLineCache(file).length > (this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH)) return;\n\t\tworkerManager.primeFileHighlightCache(file);\n\t}\n\tcleanChildNodes() {\n\t\tthis.resizeManager.cleanUp();\n\t\tthis.interactionManager.cleanUp();\n\t\tthis.bufferAfter?.remove();\n\t\tthis.bufferBefore?.remove();\n\t\tthis.code?.remove();\n\t\tthis.errorWrapper?.remove();\n\t\tthis.headerElement?.remove();\n\t\tthis.gutterUtilityContent?.remove();\n\t\tthis.headerPrefix?.remove();\n\t\tthis.headerMetadata?.remove();\n\t\tthis.headerCustom?.remove();\n\t\tthis.pre?.remove();\n\t\tthis.spriteSVG?.remove();\n\t\tthis.themeCSSStyle?.remove();\n\t\tthis.unsafeCSSStyle?.remove();\n\t\tthis.bufferAfter = void 0;\n\t\tthis.bufferBefore = void 0;\n\t\tthis.code = void 0;\n\t\tthis.errorWrapper = void 0;\n\t\tthis.headerElement = void 0;\n\t\tthis.gutterUtilityContent = void 0;\n\t\tthis.headerPrefix = void 0;\n\t\tthis.headerMetadata = void 0;\n\t\tthis.headerCustom = void 0;\n\t\tthis.pre = void 0;\n\t\tthis.spriteSVG = void 0;\n\t\tthis.themeCSSStyle = void 0;\n\t\tthis.appliedThemeCSS = void 0;\n\t\tthis.hasAdoptedThemeCSS = false;\n\t\tthis.unsafeCSSStyle = void 0;\n\t\tthis.appliedUnsafeCSS = void 0;\n\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\tthis.lastRowCount = void 0;\n\t\tthis.mounted = false;\n\t}\n\trenderAnnotations() {\n\t\tif (this.isContainerManaged || this.fileContainer == null) {\n\t\t\tfor (const { element } of this.annotationCache.values()) element.remove();\n\t\t\tthis.annotationCache.clear();\n\t\t\treturn;\n\t\t}\n\t\tconst staleAnnotations = new Map(this.annotationCache);\n\t\tconst { renderAnnotation } = this.options;\n\t\tif (renderAnnotation != null && this.lineAnnotations.length > 0) for (const [index, annotation] of this.lineAnnotations.entries()) {\n\t\t\tconst id = `${index}-${getLineAnnotationName(annotation)}`;\n\t\t\tlet cache = this.annotationCache.get(id);\n\t\t\tif (cache == null || !areLineAnnotationsEqual(annotation, cache.annotation)) {\n\t\t\t\tcache?.element.remove();\n\t\t\t\tconst content = renderAnnotation(annotation);\n\t\t\t\tif (content == null) continue;\n\t\t\t\tcache = {\n\t\t\t\t\telement: createAnnotationWrapperNode(getLineAnnotationName(annotation)),\n\t\t\t\t\tannotation\n\t\t\t\t};\n\t\t\t\tcache.element.appendChild(content);\n\t\t\t\tthis.fileContainer.appendChild(cache.element);\n\t\t\t\tthis.annotationCache.set(id, cache);\n\t\t\t}\n\t\t\tstaleAnnotations.delete(id);\n\t\t}\n\t\tfor (const [id, { element }] of staleAnnotations.entries()) {\n\t\t\tthis.annotationCache.delete(id);\n\t\t\telement.remove();\n\t\t}\n\t}\n\trenderGutterUtility() {\n\t\tconst { renderGutterUtility } = this.options;\n\t\tif (this.fileContainer == null || renderGutterUtility == null) {\n\t\t\tthis.gutterUtilityContent?.remove();\n\t\t\tthis.gutterUtilityContent = void 0;\n\t\t\treturn;\n\t\t}\n\t\tconst element = renderGutterUtility(this.interactionManager.getHoveredLine);\n\t\tif (element != null && this.gutterUtilityContent != null) return;\n\t\telse if (element == null) {\n\t\t\tthis.gutterUtilityContent?.remove();\n\t\t\tthis.gutterUtilityContent = void 0;\n\t\t\treturn;\n\t\t}\n\t\tconst gutterUtilityContent = createGutterUtilityContentNode();\n\t\tgutterUtilityContent.appendChild(element);\n\t\tthis.fileContainer.appendChild(gutterUtilityContent);\n\t\tthis.gutterUtilityContent = gutterUtilityContent;\n\t}\n\tinjectUnsafeCSS() {\n\t\tconst { unsafeCSS } = this.options;\n\t\tconst shadowRoot = this.fileContainer?.shadowRoot;\n\t\tif (shadowRoot == null) return;\n\t\tif (unsafeCSS == null || unsafeCSS === \"\") {\n\t\t\tif (this.unsafeCSSStyle != null) {\n\t\t\t\tthis.unsafeCSSStyle.remove();\n\t\t\t\tthis.unsafeCSSStyle = void 0;\n\t\t\t}\n\t\t\tthis.appliedUnsafeCSS = void 0;\n\t\t\treturn;\n\t\t}\n\t\tif (this.unsafeCSSStyle?.parentNode === shadowRoot && this.appliedUnsafeCSS === unsafeCSS) return;\n\t\tthis.unsafeCSSStyle ??= createUnsafeCSSStyleNode();\n\t\tif (this.unsafeCSSStyle.parentNode !== shadowRoot) shadowRoot.appendChild(this.unsafeCSSStyle);\n\t\tthis.unsafeCSSStyle.textContent = wrapUnsafeCSS(unsafeCSS);\n\t\tthis.appliedUnsafeCSS = unsafeCSS;\n\t}\n\tapplyThemeState(container, themeStyles, themeType, baseThemeType) {\n\t\tconst shadowRoot = container.shadowRoot ?? container.attachShadow({ mode: \"open\" });\n\t\tconst effectiveThemeType = baseThemeType ?? themeType;\n\t\tconst currentTheme = this.options.theme ?? DEFAULT_THEMES;\n\t\tconst theme = typeof currentTheme === \"string\" ? currentTheme : { ...currentTheme };\n\t\tconst scrollbarGutter = getMeasuredScrollbarGutter(shadowRoot);\n\t\tif (this.themeCSSStyle?.parentNode === shadowRoot && this.appliedThemeCSS?.themeStyles === themeStyles && this.appliedThemeCSS.themeType === effectiveThemeType && this.appliedThemeCSS.scrollbarGutter === scrollbarGutter) {\n\t\t\tthis.appliedThemeCSS.theme = theme;\n\t\t\treturn;\n\t\t}\n\t\tif (this.hasAdoptedThemeCSS && this.themeCSSStyle?.parentNode === shadowRoot) {\n\t\t\tthis.hasAdoptedThemeCSS = false;\n\t\t\tthis.appliedThemeCSS = {\n\t\t\t\ttheme,\n\t\t\t\tthemeStyles,\n\t\t\t\tthemeType: effectiveThemeType,\n\t\t\t\tbaseThemeType,\n\t\t\t\tscrollbarGutter\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\t\tthis.themeCSSStyle = upsertHostThemeStyle({\n\t\t\tshadowRoot,\n\t\t\tcurrentNode: this.themeCSSStyle,\n\t\t\tthemeCSS: wrapThemeCSS(themeStyles, effectiveThemeType, scrollbarGutter)\n\t\t});\n\t\tthis.appliedThemeCSS = this.themeCSSStyle != null ? {\n\t\t\ttheme,\n\t\t\tthemeStyles,\n\t\t\tthemeType: effectiveThemeType,\n\t\t\tbaseThemeType,\n\t\t\tscrollbarGutter\n\t\t} : void 0;\n\t}\n\thydrateMeasuredScrollbar() {\n\t\tconst shadowRoot = this.fileContainer?.shadowRoot;\n\t\tif (shadowRoot == null || this.themeCSSStyle == null) return;\n\t\tthis.themeCSSStyle.textContent = patchScrollbarGutterSize(this.themeCSSStyle.textContent ?? \"\", getMeasuredScrollbarGutter(shadowRoot));\n\t}\n\tapplyFullRender(result, pre) {\n\t\tthis.cleanupErrorWrapper();\n\t\tthis.applyPreNodeAttributes(pre, result);\n\t\tthis.code = getOrCreateCodeNode({ code: this.code });\n\t\tconst codeAst = this.fileRenderer.renderCodeAST(result);\n\t\tif (this.code.childElementCount >= 2) for (let i = 0; i < 2; i++) {\n\t\t\tconst domEl = this.code.children[i];\n\t\t\tconst astEl = codeAst[i];\n\t\t\tdomEl.innerHTML = toHtml(astEl.children);\n\t\t\tdomEl.style.cssText = astEl.properties.style;\n\t\t}\n\t\telse this.code.innerHTML = toHtml(codeAst);\n\t\tif (!pre.contains(this.code)) pre.replaceChildren(this.code);\n\t\tthis.lastRowCount = result.rowCount;\n\t}\n\tapplyPartialRender(previousRenderRange, renderRange) {\n\t\tif (previousRenderRange == null || renderRange == null) return false;\n\t\tconst { file, code } = this;\n\t\tconst columns = code != null ? this.getColumns(code) : void 0;\n\t\tif (file == null || code == null || columns == null) return false;\n\t\tconst previousStart = previousRenderRange.startingLine;\n\t\tconst nextStart = renderRange.startingLine;\n\t\tconst previousEnd = previousRenderRange.totalLines === Infinity ? Number.POSITIVE_INFINITY : previousStart + previousRenderRange.totalLines;\n\t\tconst nextEnd = renderRange.totalLines === Infinity ? Number.POSITIVE_INFINITY : nextStart + renderRange.totalLines;\n\t\tconst overlapStart = Math.max(previousStart, nextStart);\n\t\tconst overlapEnd = Math.min(previousEnd, nextEnd);\n\t\tif (overlapEnd <= overlapStart) return false;\n\t\tif (!this.trimDOMToOverlap(columns.gutter, overlapStart, overlapEnd) || !this.trimDOMToOverlap(columns.content, overlapStart, overlapEnd)) return false;\n\t\tlet { length: rowCount } = columns.content.children;\n\t\tconst renderChunk = (startingLine, totalLines) => {\n\t\t\tif (totalLines <= 0) return;\n\t\t\treturn this.fileRenderer.renderFile(file, {\n\t\t\t\tstartingLine,\n\t\t\t\ttotalLines,\n\t\t\t\tbufferBefore: 0,\n\t\t\t\tbufferAfter: 0\n\t\t\t});\n\t\t};\n\t\tconst prependResult = nextStart < overlapStart ? renderChunk(nextStart, overlapStart - nextStart) : void 0;\n\t\tif (prependResult === void 0 && nextStart < overlapStart) return false;\n\t\tconst appendTotalLines = nextEnd === Number.POSITIVE_INFINITY ? Number.POSITIVE_INFINITY : Math.max(0, nextEnd - overlapEnd);\n\t\tconst appendResult = nextEnd > overlapEnd ? renderChunk(overlapEnd, appendTotalLines) : void 0;\n\t\tif (appendResult === void 0 && nextEnd > overlapEnd) return false;\n\t\tthis.cleanupErrorWrapper();\n\t\tif (prependResult != null) {\n\t\t\tcolumns.gutter.insertAdjacentHTML(\"afterbegin\", this.fileRenderer.renderPartialHTML(prependResult.gutterAST));\n\t\t\tcolumns.content.insertAdjacentHTML(\"afterbegin\", this.fileRenderer.renderPartialHTML(prependResult.contentAST));\n\t\t\trowCount += prependResult.rowCount;\n\t\t}\n\t\tif (appendResult != null) {\n\t\t\tcolumns.gutter.insertAdjacentHTML(\"beforeend\", this.fileRenderer.renderPartialHTML(appendResult.gutterAST));\n\t\t\tcolumns.content.insertAdjacentHTML(\"beforeend\", this.fileRenderer.renderPartialHTML(appendResult.contentAST));\n\t\t\trowCount += appendResult.rowCount;\n\t\t}\n\t\tif (this.lastRowCount !== rowCount) {\n\t\t\tcolumns.gutter.style.setProperty(\"grid-row\", `span ${rowCount}`);\n\t\t\tcolumns.content.style.setProperty(\"grid-row\", `span ${rowCount}`);\n\t\t\tthis.lastRowCount = rowCount;\n\t\t}\n\t\treturn true;\n\t}\n\tgetColumns(code) {\n\t\tconst gutter = code.children[0];\n\t\tconst content = code.children[1];\n\t\tif (!(gutter instanceof HTMLElement) || !(content instanceof HTMLElement) || gutter.dataset.gutter == null || content.dataset.content == null) return;\n\t\treturn {\n\t\t\tgutter,\n\t\t\tcontent\n\t\t};\n\t}\n\ttrimDOMToOverlap(container, overlapStart, overlapEnd) {\n\t\tconst boundaryIndices = this.getDOMBoundaryIndices(container, [overlapStart, overlapEnd]);\n\t\tconst startIndex = boundaryIndices.get(overlapStart) ?? container.children.length;\n\t\tconst endIndex = boundaryIndices.get(overlapEnd) ?? container.children.length;\n\t\tif (startIndex > endIndex) return false;\n\t\tfor (let i = container.children.length - 1; i >= endIndex; i -= 1) container.children[i]?.remove();\n\t\tfor (let i = startIndex - 1; i >= 0; i -= 1) container.children[i]?.remove();\n\t\treturn true;\n\t}\n\tgetDOMBoundaryIndices(container, boundaries) {\n\t\tconst sortedBoundaries = [...new Set(boundaries)].sort((a, b) => a - b);\n\t\tconst boundaryIndices = /* @__PURE__ */ new Map();\n\t\tif (sortedBoundaries.length === 0) return boundaryIndices;\n\t\tlet boundaryIndex = 0;\n\t\tlet nextBoundary = sortedBoundaries[boundaryIndex];\n\t\tconst { children } = container;\n\t\tif (nextBoundary === 0) {\n\t\t\tboundaryIndices.set(0, 0);\n\t\t\tboundaryIndex += 1;\n\t\t\tnextBoundary = sortedBoundaries[boundaryIndex];\n\t\t}\n\t\tfor (let i = 0; i < children.length; i += 1) {\n\t\t\tconst child = children[i];\n\t\t\tif (!(child instanceof HTMLElement)) continue;\n\t\t\tconst lineIndex = this.getLineIndexFromDOMNode(child);\n\t\t\tif (lineIndex == null) continue;\n\t\t\twhile (nextBoundary != null && lineIndex >= nextBoundary) {\n\t\t\t\tboundaryIndices.set(nextBoundary, i);\n\t\t\t\tboundaryIndex += 1;\n\t\t\t\tnextBoundary = sortedBoundaries[boundaryIndex];\n\t\t\t}\n\t\t\tif (boundaryIndex >= sortedBoundaries.length) break;\n\t\t}\n\t\tfor (const boundary of sortedBoundaries) if (!boundaryIndices.has(boundary)) boundaryIndices.set(boundary, children.length);\n\t\treturn boundaryIndices;\n\t}\n\tgetLineIndexFromDOMNode(node) {\n\t\tconst lineIndexAttr = node.dataset.lineIndex;\n\t\tif (lineIndexAttr == null) return;\n\t\tconst parsed = Number(lineIndexAttr);\n\t\treturn Number.isNaN(parsed) ? void 0 : parsed;\n\t}\n\tapplyBuffers(pre, renderRange) {\n\t\tif (renderRange == null || this.shouldDisableVirtualizationBuffers()) {\n\t\t\tif (this.bufferBefore != null) {\n\t\t\t\tthis.bufferBefore.remove();\n\t\t\t\tthis.bufferBefore = void 0;\n\t\t\t}\n\t\t\tif (this.bufferAfter != null) {\n\t\t\t\tthis.bufferAfter.remove();\n\t\t\t\tthis.bufferAfter = void 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (renderRange.bufferBefore > 0) {\n\t\t\tif (this.bufferBefore == null) {\n\t\t\t\tthis.bufferBefore = document.createElement(\"div\");\n\t\t\t\tthis.bufferBefore.dataset.virtualizerBuffer = \"before\";\n\t\t\t\tpre.before(this.bufferBefore);\n\t\t\t}\n\t\t\tthis.bufferBefore.style.setProperty(\"height\", `${renderRange.bufferBefore}px`);\n\t\t\tthis.bufferBefore.style.setProperty(\"contain\", \"strict\");\n\t\t} else if (this.bufferBefore != null) {\n\t\t\tthis.bufferBefore.remove();\n\t\t\tthis.bufferBefore = void 0;\n\t\t}\n\t\tif (renderRange.bufferAfter > 0) {\n\t\t\tif (this.bufferAfter == null) {\n\t\t\t\tthis.bufferAfter = document.createElement(\"div\");\n\t\t\t\tthis.bufferAfter.dataset.virtualizerBuffer = \"after\";\n\t\t\t\tpre.after(this.bufferAfter);\n\t\t\t}\n\t\t\tthis.bufferAfter.style.setProperty(\"height\", `${renderRange.bufferAfter}px`);\n\t\t\tthis.bufferAfter.style.setProperty(\"contain\", \"strict\");\n\t\t} else if (this.bufferAfter != null) {\n\t\t\tthis.bufferAfter.remove();\n\t\t\tthis.bufferAfter = void 0;\n\t\t}\n\t}\n\tshouldDisableVirtualizationBuffers() {\n\t\treturn this.options.disableVirtualizationBuffers ?? false;\n\t}\n\tapplyHeaderToDOM(headerAST, container) {\n\t\tconst { file } = this;\n\t\tif (file == null) return;\n\t\tthis.cleanupErrorWrapper();\n\t\tthis.placeHolder?.remove();\n\t\tthis.placeHolder = void 0;\n\t\tconst headerHTML = this.cachedHeaderHTML ?? toHtml(headerAST);\n\t\tthis.cachedHeaderHTML = headerHTML;\n\t\tif (headerHTML !== this.lastRenderedHeaderHTML) {\n\t\t\tconst tempDiv = document.createElement(\"div\");\n\t\t\ttempDiv.innerHTML = headerHTML;\n\t\t\tconst newHeader = tempDiv.firstElementChild;\n\t\t\tif (!(newHeader instanceof HTMLElement)) return;\n\t\t\tif (this.headerElement != null) container.shadowRoot?.replaceChild(newHeader, this.headerElement);\n\t\t\telse container.shadowRoot?.prepend(newHeader);\n\t\t\tthis.headerElement = newHeader;\n\t\t\tthis.lastRenderedHeaderHTML = headerHTML;\n\t\t}\n\t\tif (this.isContainerManaged) return;\n\t\tconst { renderHeaderPrefix, renderCustomHeader, renderHeaderMetadata } = this.options;\n\t\tif (renderCustomHeader != null) {\n\t\t\tconst content = renderCustomHeader(file) ?? void 0;\n\t\t\tthis.headerCustom = this.upsertHeaderSlotElement(container, this.headerCustom, CUSTOM_HEADER_SLOT_ID, content);\n\t\t\tthis.headerPrefix?.remove();\n\t\t\tthis.headerMetadata?.remove();\n\t\t\tthis.headerPrefix = void 0;\n\t\t\tthis.headerMetadata = void 0;\n\t\t} else {\n\t\t\tconst prefix = renderHeaderPrefix?.(file) ?? void 0;\n\t\t\tconst content = renderHeaderMetadata?.(file) ?? void 0;\n\t\t\tthis.headerPrefix = this.upsertHeaderSlotElement(container, this.headerPrefix, HEADER_PREFIX_SLOT_ID, prefix);\n\t\t\tthis.headerMetadata = this.upsertHeaderSlotElement(container, this.headerMetadata, HEADER_METADATA_SLOT_ID, content);\n\t\t\tthis.headerCustom?.remove();\n\t\t\tthis.headerCustom = void 0;\n\t\t}\n\t}\n\tclearHeaderSlots() {\n\t\tthis.headerPrefix?.remove();\n\t\tthis.headerMetadata?.remove();\n\t\tthis.headerCustom?.remove();\n\t\tthis.headerPrefix = void 0;\n\t\tthis.headerMetadata = void 0;\n\t\tthis.headerCustom = void 0;\n\t}\n\tupsertHeaderSlotElement(container, current, slot, content) {\n\t\tif (content == null) {\n\t\t\tcurrent?.remove();\n\t\t\treturn;\n\t\t}\n\t\tconst element = current ?? this.createHeaderSlotElement(slot);\n\t\tif (current == null) container.appendChild(element);\n\t\tthis.replaceHeaderSlotContent(element, content);\n\t\treturn element;\n\t}\n\treplaceHeaderSlotContent(element, content) {\n\t\telement.replaceChildren();\n\t\tif (content instanceof Element) element.appendChild(content);\n\t\telse element.innerText = `${content}`;\n\t}\n\tcreateHeaderSlotElement(slot) {\n\t\tconst element = document.createElement(\"div\");\n\t\telement.slot = slot;\n\t\treturn element;\n\t}\n\tgetOrCreateFileContainerNode(fileContainer, parentNode) {\n\t\tconst { fileContainer: previousContainer } = this;\n\t\tconst nextContainer = fileContainer ?? previousContainer ?? document.createElement(DIFFS_TAG_NAME);\n\t\tconst containerChanged = previousContainer !== nextContainer;\n\t\tif (containerChanged) this.emitPostRender(true);\n\t\tthis.fileContainer = nextContainer;\n\t\tif (previousContainer != null && containerChanged) {\n\t\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\t\tthis.headerElement = void 0;\n\t\t}\n\t\tif (parentNode != null && this.fileContainer.parentNode !== parentNode) parentNode.appendChild(this.fileContainer);\n\t\tif (containerChanged) this.adoptReusableShellElements(this.fileContainer);\n\t\tthis.ensureSpriteSVG(this.fileContainer);\n\t\treturn this.fileContainer;\n\t}\n\tadoptReusableShellElements(fileContainer) {\n\t\tconst { shadowRoot } = fileContainer;\n\t\tif (shadowRoot == null) return;\n\t\tfor (const element of shadowRoot.children) if (element instanceof SVGElement) this.spriteSVG ??= element;\n\t\telse if (isStyleNode(element) && element.hasAttribute(THEME_CSS_ATTRIBUTE)) {\n\t\t\tthis.themeCSSStyle ??= element;\n\t\t\tthis.hasAdoptedThemeCSS = true;\n\t\t} else if (isStyleNode(element) && element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)) {\n\t\t\tthis.unsafeCSSStyle ??= element;\n\t\t\tthis.appliedUnsafeCSS ??= this.options.unsafeCSS ?? void 0;\n\t\t}\n\t}\n\tensureSpriteSVG(fileContainer) {\n\t\tconst shadowRoot = fileContainer.shadowRoot ?? fileContainer.attachShadow({ mode: \"open\" });\n\t\tif (this.spriteSVG == null) {\n\t\t\tconst fragment = document.createElement(\"div\");\n\t\t\tfragment.innerHTML = SVGSpriteSheet;\n\t\t\tconst firstChild = fragment.firstChild;\n\t\t\tif (firstChild instanceof SVGElement) this.spriteSVG = firstChild;\n\t\t}\n\t\tif (this.spriteSVG != null && this.spriteSVG.parentNode !== shadowRoot) shadowRoot.appendChild(this.spriteSVG);\n\t}\n\tgetOrCreatePreNode(container) {\n\t\tconst shadowRoot = container.shadowRoot ?? container.attachShadow({ mode: \"open\" });\n\t\tif (this.pre == null) {\n\t\t\tthis.pre = document.createElement(\"pre\");\n\t\t\tthis.appliedPreAttributes = void 0;\n\t\t\tthis.code = void 0;\n\t\t\tshadowRoot.appendChild(this.pre);\n\t\t} else if (this.pre.parentNode !== shadowRoot) {\n\t\t\tcontainer.shadowRoot?.appendChild(this.pre);\n\t\t\tthis.appliedPreAttributes = void 0;\n\t\t}\n\t\tthis.placeHolder?.remove();\n\t\tthis.placeHolder = void 0;\n\t\treturn this.pre;\n\t}\n\tsyncCodeNodeFromPre(pre) {\n\t\tthis.code = void 0;\n\t\tfor (const child of Array.from(pre.children)) {\n\t\t\tif (!(child instanceof HTMLElement)) continue;\n\t\t\tif (child.hasAttribute(\"data-code\")) {\n\t\t\t\tthis.code = child;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\tapplyPreNodeAttributes(pre, { totalLines }) {\n\t\tconst { overflow = \"scroll\", disableLineNumbers = false } = this.options;\n\t\tconst preProperties = {\n\t\t\ttype: \"file\",\n\t\t\tsplit: false,\n\t\t\toverflow,\n\t\t\tdisableLineNumbers,\n\t\t\tdiffIndicators: \"none\",\n\t\t\tdisableBackground: true,\n\t\t\ttotalLines\n\t\t};\n\t\tif (arePrePropertiesEqual(preProperties, this.appliedPreAttributes)) return;\n\t\tsetPreNodeProperties(pre, preProperties);\n\t\tthis.appliedPreAttributes = preProperties;\n\t}\n\tapplyErrorToDOM(error, container) {\n\t\tthis.cleanupErrorWrapper();\n\t\tthis.pre?.remove();\n\t\tthis.pre = void 0;\n\t\tthis.appliedPreAttributes = void 0;\n\t\tconst shadowRoot = container.shadowRoot ?? container.attachShadow({ mode: \"open\" });\n\t\tthis.errorWrapper ??= document.createElement(\"div\");\n\t\tthis.errorWrapper.dataset.errorWrapper = \"\";\n\t\tthis.errorWrapper.textContent = \"\";\n\t\tshadowRoot.appendChild(this.errorWrapper);\n\t\tconst errorMessage = document.createElement(\"div\");\n\t\terrorMessage.dataset.errorMessage = \"\";\n\t\terrorMessage.innerText = error.message;\n\t\tthis.errorWrapper.appendChild(errorMessage);\n\t\tconst errorStack = document.createElement(\"pre\");\n\t\terrorStack.dataset.errorStack = \"\";\n\t\terrorStack.innerText = error.stack ?? \"No Error Stack\";\n\t\tthis.errorWrapper.appendChild(errorStack);\n\t}\n\tcleanupErrorWrapper() {\n\t\tthis.errorWrapper?.remove();\n\t\tthis.errorWrapper = void 0;\n\t}\n};\nfunction shouldRenderCode(pre, file, collapsed = false) {\n\treturn !collapsed && pre == null && file != null;\n}\nfunction shouldRenderHeader(headerElement, file, disableFileHeader = false) {\n\treturn headerElement == null && file != null && !disableFileHeader;\n}\n\n//#endregion\nexport { File };\n//# sourceMappingURL=File.js.map","import { DEFAULT_VIRTUAL_FILE_METRICS } from \"../constants.js\";\nimport { areObjectsEqual } from \"../utils/areObjectsEqual.js\";\nimport { areOptionsEqual } from \"../utils/areOptionsEqual.js\";\nimport { areFilesEqual } from \"../utils/areFilesEqual.js\";\nimport { getVirtualFileHeaderRegion, getVirtualFilePaddingBottom } from \"../utils/computeVirtualFileMetrics.js\";\nimport { FILE_ANNOTATION_DOM_KEY, FILE_ANNOTATION_LINE_NUMBER, includesFileAnnotations, shouldRenderFileAnnotations } from \"../utils/includesFileAnnotations.js\";\nimport { File } from \"./File.js\";\n\n//#region src/components/VirtualizedFile.ts\nconst LAYOUT_CHECKPOINT_INTERVAL = 5e3;\nlet instanceId = -1;\nfunction hasFileLayoutOptionChanged(previousOptions, nextOptions) {\n\treturn (previousOptions.overflow ?? \"scroll\") !== (nextOptions.overflow ?? \"scroll\") || (previousOptions.collapsed ?? false) !== (nextOptions.collapsed ?? false) || (previousOptions.disableLineNumbers ?? false) !== (nextOptions.disableLineNumbers ?? false) || (previousOptions.disableFileHeader ?? false) !== (nextOptions.disableFileHeader ?? false) || previousOptions.unsafeCSS !== nextOptions.unsafeCSS;\n}\nvar VirtualizedFile = class extends File {\n\t__id = `virtualized-file:${++instanceId}`;\n\ttop;\n\theight = 0;\n\tcache = {\n\t\theights: /* @__PURE__ */ new Map(),\n\t\tcheckpoints: [],\n\t\tfileAnnotationHeight: 0\n\t};\n\tisVisible = false;\n\tisSetup = false;\n\tlayoutDirty = true;\n\tforceRenderOverride;\n\tcurrentCollapsed;\n\tconstructor(options, virtualizer, metrics = DEFAULT_VIRTUAL_FILE_METRICS, workerManager, isContainerManaged = false) {\n\t\tsuper(options, workerManager, isContainerManaged);\n\t\tthis.virtualizer = virtualizer;\n\t\tthis.metrics = metrics;\n\t}\n\tsetMetrics(metrics, force = false) {\n\t\tif (!force && areObjectsEqual(this.metrics, metrics)) return;\n\t\tthis.metrics = metrics;\n\t\tthis.resetLayoutCache();\n\t}\n\tsetLineAnnotations(lineAnnotations) {\n\t\tif (this.syncLineAnnotations(lineAnnotations)) this.resetLayoutCache();\n\t}\n\tsyncLineAnnotations(lineAnnotations) {\n\t\tif (lineAnnotations == null || lineAnnotations === this.lineAnnotations) return false;\n\t\tif (lineAnnotations.length === 0 && this.lineAnnotations.length === 0) return false;\n\t\tsuper.setLineAnnotations(lineAnnotations);\n\t\treturn true;\n\t}\n\thasLineAnnotations() {\n\t\treturn this.lineAnnotations.some((annotation) => annotation.lineNumber > FILE_ANNOTATION_LINE_NUMBER);\n\t}\n\tgetLineHeight(lineIndex, hasMetadataLine = false) {\n\t\tconst cached = this.cache.heights.get(lineIndex);\n\t\tif (cached != null) return cached;\n\t\tconst multiplier = hasMetadataLine ? 2 : 1;\n\t\treturn this.metrics.lineHeight * multiplier;\n\t}\n\tsetOptions(options) {\n\t\tif (this.isAdvancedMode()) throw new Error(\"VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.\");\n\t\tif (options == null) return;\n\t\tconst { options: previousOptions } = this;\n\t\tconst optionsChanged = !areOptionsEqual(previousOptions, options);\n\t\tconst layoutChanged = hasFileLayoutOptionChanged(previousOptions, options);\n\t\tsuper.setOptions(options);\n\t\tif (layoutChanged) this.resetLayoutCache(true);\n\t\tif (optionsChanged) this.forceRenderOverride = true;\n\t\tif (optionsChanged) this.virtualizer.instanceChanged(this, layoutChanged);\n\t}\n\tsetThemeType(themeType) {\n\t\tif (this.isAdvancedMode()) throw new Error(\"VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.\");\n\t\tsuper.setThemeType(themeType);\n\t}\n\tresetLayoutCache(recompute = false) {\n\t\tthis.layoutDirty = true;\n\t\tthis.cache.fileAnnotationHeight = 0;\n\t\tif (this.cache.heights.size > 0) this.cache.heights.clear();\n\t\tif (this.cache.checkpoints.length > 0) this.cache.checkpoints.length = 0;\n\t\tif (this.renderRange != null) this.renderRange = void 0;\n\t\tif (recompute && this.isSimpleMode()) this.computeApproximateSize();\n\t}\n\treconcileHeights() {\n\t\tlet hasHeightChange = false;\n\t\tif (this.fileContainer == null || this.file == null) {\n\t\t\tif (this.height !== 0) hasHeightChange = true;\n\t\t\tthis.height = 0;\n\t\t\treturn hasHeightChange;\n\t\t}\n\t\tconst { overflow = \"scroll\" } = this.options;\n\t\tthis.top = this.getVirtualizedTop();\n\t\tif (overflow === \"scroll\" && this.lineAnnotations.length === 0 && !this.isResizeDebuggingEnabled()) return hasHeightChange;\n\t\tif (this.code == null) return hasHeightChange;\n\t\tconst content = this.code.children[1];\n\t\tif (!(content instanceof HTMLElement)) return hasHeightChange;\n\t\tconst hasFileAnnotations = includesFileAnnotations(this.lineAnnotations);\n\t\tif (this.renderRange != null && hasFileAnnotations && shouldRenderFileAnnotations(this.renderRange)) {\n\t\t\tconst nextFileAnnotationHeight = measureFileAnnotationHeight(content) ?? 0;\n\t\t\tif (nextFileAnnotationHeight !== this.cache.fileAnnotationHeight) {\n\t\t\t\tthis.cache.fileAnnotationHeight = nextFileAnnotationHeight;\n\t\t\t\thasHeightChange = true;\n\t\t\t}\n\t\t} else if (!hasFileAnnotations && this.cache.fileAnnotationHeight !== 0) {\n\t\t\tthis.cache.fileAnnotationHeight = 0;\n\t\t\thasHeightChange = true;\n\t\t}\n\t\tfor (const line of content.children) {\n\t\t\tif (!(line instanceof HTMLElement)) continue;\n\t\t\tconst lineIndexAttr = line.dataset.lineIndex;\n\t\t\tif (lineIndexAttr == null) continue;\n\t\t\tconst lineIndex = Number(lineIndexAttr);\n\t\t\tlet measuredHeight = line.getBoundingClientRect().height;\n\t\t\tlet hasMetadata = false;\n\t\t\tif (line.nextElementSibling instanceof HTMLElement && (\"lineAnnotation\" in line.nextElementSibling.dataset || \"noNewline\" in line.nextElementSibling.dataset)) {\n\t\t\t\tif (\"noNewline\" in line.nextElementSibling.dataset) hasMetadata = true;\n\t\t\t\tmeasuredHeight += line.nextElementSibling.getBoundingClientRect().height;\n\t\t\t}\n\t\t\tconst expectedHeight = this.getLineHeight(lineIndex, hasMetadata);\n\t\t\tif (measuredHeight === expectedHeight) continue;\n\t\t\thasHeightChange = true;\n\t\t\tif (measuredHeight === this.metrics.lineHeight * (hasMetadata ? 2 : 1)) this.cache.heights.delete(lineIndex);\n\t\t\telse this.cache.heights.set(lineIndex, measuredHeight);\n\t\t}\n\t\tif (hasHeightChange || this.isResizeDebuggingEnabled()) this.computeApproximateSize(true);\n\t\treturn hasHeightChange;\n\t}\n\tonRender = (dirty) => {\n\t\tif (this.fileContainer == null || this.file == null) return false;\n\t\tif (dirty) this.top = this.getVirtualizedTop();\n\t\treturn this.render({ file: this.file });\n\t};\n\tprepareCodeViewItem(file, top, reset, lineAnnotations) {\n\t\tconst annotationsChanged = this.syncLineAnnotations(lineAnnotations);\n\t\tlet shouldResetLayoutCache = reset?.resetFileLayoutCache === true || annotationsChanged;\n\t\tif (reset?.metrics != null) {\n\t\t\tthis.metrics = reset.metrics;\n\t\t\tshouldResetLayoutCache = true;\n\t\t}\n\t\tconst { collapsed = false } = this.options;\n\t\tif (this.currentCollapsed !== collapsed) {\n\t\t\tthis.currentCollapsed = collapsed;\n\t\t\tshouldResetLayoutCache = true;\n\t\t}\n\t\tif (shouldResetLayoutCache) this.resetLayoutCache();\n\t\tif (this.file !== file) this.layoutDirty = true;\n\t\tthis.file = file;\n\t\tthis.top = top;\n\t\tthis.computeApproximateSize();\n\t\treturn this.height;\n\t}\n\tgetLinePosition(lineNumber) {\n\t\tif (this.file == null || lineNumber < 1) return;\n\t\tconst { disableFileHeader = false, collapsed = false } = this.options;\n\t\tconst lastLineIndex = this.fileRenderer.getLineCount(this.file) - 1;\n\t\tlet top = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tif (collapsed || lastLineIndex < 0) return {\n\t\t\ttop,\n\t\t\theight: 0\n\t\t};\n\t\tconst clampedLineIndex = Math.min(Math.max(lineNumber - 1, 0), lastLineIndex);\n\t\tconst { overflow = \"scroll\" } = this.options;\n\t\tconst { lineHeight } = this.metrics;\n\t\ttop += this.cache.fileAnnotationHeight;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) return {\n\t\t\ttop: top + clampedLineIndex * lineHeight,\n\t\t\theight: lineHeight\n\t\t};\n\t\tconst checkpoint = this.getLayoutCheckpointBeforeLineIndex(clampedLineIndex);\n\t\ttop = checkpoint?.top ?? top;\n\t\tfor (let lineIndex = checkpoint?.lineIndex ?? 0; lineIndex < clampedLineIndex; lineIndex++) top += this.getLineHeight(lineIndex, false);\n\t\treturn {\n\t\t\ttop,\n\t\t\theight: this.getLineHeight(clampedLineIndex, false)\n\t\t};\n\t}\n\tgetNumericScrollAnchor(localViewportTop) {\n\t\tif (this.file == null || this.renderRange == null) return;\n\t\tconst { disableFileHeader = false, collapsed = false, overflow = \"scroll\" } = this.options;\n\t\tif (collapsed || this.renderRange.totalLines <= 0) return;\n\t\tconst lastLineIndex = this.fileRenderer.getLineCount(this.file) - 1;\n\t\tif (lastLineIndex < 0) return;\n\t\tconst headerRegion = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tconst firstRenderedLineIndex = Math.min(this.renderRange.startingLine, lastLineIndex);\n\t\tconst lastRenderedLineIndex = Math.min(firstRenderedLineIndex + this.renderRange.totalLines - 1, lastLineIndex);\n\t\tif (lastRenderedLineIndex < firstRenderedLineIndex) return;\n\t\tconst { fileAnnotationHeight } = this.cache;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) {\n\t\t\tconst { lineHeight } = this.metrics;\n\t\t\tconst firstRenderedLineTop = headerRegion + (firstRenderedLineIndex === 0 ? fileAnnotationHeight : this.renderRange.bufferBefore);\n\t\t\tconst lineIndex = firstRenderedLineIndex + Math.max(Math.ceil((localViewportTop - firstRenderedLineTop) / lineHeight), 0);\n\t\t\tif (lineIndex > lastRenderedLineIndex) return;\n\t\t\treturn {\n\t\t\t\tlineNumber: lineIndex + 1,\n\t\t\t\ttop: headerRegion + fileAnnotationHeight + lineIndex * lineHeight\n\t\t\t};\n\t\t}\n\t\tlet top = headerRegion + (firstRenderedLineIndex === 0 ? fileAnnotationHeight : this.renderRange.bufferBefore);\n\t\tfor (let lineIndex = firstRenderedLineIndex; lineIndex <= lastRenderedLineIndex; lineIndex++) {\n\t\t\tif (top >= localViewportTop) return {\n\t\t\t\tlineNumber: lineIndex + 1,\n\t\t\t\ttop\n\t\t\t};\n\t\t\ttop += this.getLineHeight(lineIndex);\n\t\t}\n\t}\n\tgetVirtualizedHeight() {\n\t\treturn this.height;\n\t}\n\tgetAdvancedStickySpecs(windowSpecs) {\n\t\tif (this.top == null || this.file == null) return;\n\t\tif (this.options.collapsed === true) return {\n\t\t\ttopOffset: this.top,\n\t\t\theight: this.height\n\t\t};\n\t\tconst renderRange = windowSpecs != null ? this.computeRenderRangeFromWindow(this.file, this.top, windowSpecs) : this.renderRange;\n\t\tif (renderRange == null) return;\n\t\tconst { bufferBefore, bufferAfter, totalLines } = renderRange;\n\t\tlet headerOnlyOffset = 0;\n\t\tif (totalLines === 0) {\n\t\t\tconst activeWindow = windowSpecs ?? this.virtualizer.getWindowSpecs();\n\t\t\tif (this.top < activeWindow.top) headerOnlyOffset = bufferAfter;\n\t\t}\n\t\treturn {\n\t\t\ttopOffset: this.top + bufferBefore + headerOnlyOffset,\n\t\t\theight: this.height - (bufferBefore + bufferAfter)\n\t\t};\n\t}\n\tcleanUp(recycle = false) {\n\t\tif (this.fileContainer != null && this.isSimpleMode()) this.getSimpleVirtualizer()?.disconnect(this.fileContainer);\n\t\tif (!recycle) this.resetLayoutCache();\n\t\tthis.isSetup = false;\n\t\tsuper.cleanUp(recycle);\n\t}\n\tcomputeApproximateSize(force = false) {\n\t\tconst shouldValidateSize = this.isResizeDebuggingEnabled();\n\t\tif (!force && !this.layoutDirty && !shouldValidateSize) return;\n\t\tconst isFirstCompute = this.height === 0;\n\t\tthis.height = 0;\n\t\tthis.cache.checkpoints = [];\n\t\tif (this.file == null) {\n\t\t\tthis.layoutDirty = false;\n\t\t\treturn;\n\t\t}\n\t\tconst { disableFileHeader = false, collapsed = false, overflow = \"scroll\" } = this.options;\n\t\tconst { lineHeight } = this.metrics;\n\t\tconst lineCount = this.fileRenderer.getLineCount(this.file);\n\t\tconst headerRegion = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tconst paddingBottom = getVirtualFilePaddingBottom(this.metrics);\n\t\tthis.height += headerRegion;\n\t\tif (collapsed) {\n\t\t\tthis.layoutDirty = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.height += this.cache.fileAnnotationHeight;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) this.height += lineCount * lineHeight;\n\t\telse for (let lineIndex = 0; lineIndex < lineCount; lineIndex++) {\n\t\t\tthis.addLayoutCheckpoint(lineIndex, this.height);\n\t\t\tthis.height += this.getLineHeight(lineIndex, false);\n\t\t}\n\t\tif (lineCount > 0) this.height += paddingBottom;\n\t\tif (this.fileContainer != null && shouldValidateSize && !isFirstCompute) {\n\t\t\tconst rect = this.fileContainer.getBoundingClientRect();\n\t\t\tif (rect.height !== this.height) console.log(\"VirtualizedFile.computeApproximateSize: computed height doesnt match\", {\n\t\t\t\tname: this.file.name,\n\t\t\t\telementHeight: rect.height,\n\t\t\t\tcomputedHeight: this.height\n\t\t\t});\n\t\t\telse console.log(\"VirtualizedFile.computeApproximateSize: computed height IS CORRECT\");\n\t\t}\n\t\tthis.layoutDirty = false;\n\t}\n\tsetVisibility(visible) {\n\t\tif (this.isAdvancedMode() || this.fileContainer == null) return;\n\t\tif (visible && !this.isVisible) {\n\t\t\tthis.top = this.getVirtualizedTop();\n\t\t\tthis.isVisible = true;\n\t\t} else if (!visible && this.isVisible) {\n\t\t\tthis.isVisible = false;\n\t\t\tthis.rerender();\n\t\t}\n\t}\n\trerender() {\n\t\tif (!this.enabled || this.file == null) return;\n\t\tthis.forceRenderOverride = true;\n\t\tthis.virtualizer.instanceChanged(this, false);\n\t}\n\tapplyDocumentChange(textDocument, newLineAnnotations, shouldUpdateBuffer = false) {\n\t\tconst { heights, checkpoints } = this.cache;\n\t\tconst previousRenderRange = this.renderRange;\n\t\tsuper.applyDocumentChange(textDocument, newLineAnnotations);\n\t\tthis.getSimpleVirtualizer()?.markDOMDirty();\n\t\tthis.layoutDirty = true;\n\t\tif (heights.size > 0) heights.clear();\n\t\tif (checkpoints.length > 0) checkpoints.length = 0;\n\t\tif (this.isSimpleMode()) this.computeApproximateSize();\n\t\tif (shouldUpdateBuffer && previousRenderRange !== void 0 && this.file !== void 0) {\n\t\t\tconst windowSpecs = this.virtualizer.getWindowSpecs();\n\t\t\tconst renderRange = this.computeRenderRangeFromWindow(this.file, this.top ?? 0, windowSpecs);\n\t\t\tif (renderRange.bufferAfter !== previousRenderRange.bufferAfter) this.updateBuffers(renderRange);\n\t\t}\n\t}\n\trender({ fileContainer, file, forceRender = false, lineAnnotations,...props }) {\n\t\tconst didFileChange = this.file == null || !areFilesEqual(this.file, file);\n\t\tconst { forceRenderOverride, isSetup } = this;\n\t\tthis.forceRenderOverride = void 0;\n\t\tconst annotationsChanged = this.syncLineAnnotations(lineAnnotations);\n\t\tif (annotationsChanged) this.resetLayoutCache();\n\t\tthis.file = file;\n\t\tfileContainer = this.getOrCreateFileContainerNode(fileContainer);\n\t\tif (this.file == null) {\n\t\t\tconsole.error(\"VirtualizedFile.render: attempting to virtually render when we dont have file\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!isSetup) {\n\t\t\tthis.computeApproximateSize();\n\t\t\tconst virtualizer = this.getSimpleVirtualizer();\n\t\t\tthis.top ??= this.getVirtualizedTop();\n\t\t\tif (this.isAdvancedMode()) this.isVisible = true;\n\t\t\telse {\n\t\t\t\tif (virtualizer == null) throw new Error(\"VirtualizedFile.render: simple virtualizer is not available\");\n\t\t\t\tvirtualizer.connect(fileContainer, this);\n\t\t\t\tthis.isVisible = virtualizer.isInstanceVisible(this.top ?? 0, this.height);\n\t\t\t}\n\t\t\tthis.isSetup = true;\n\t\t} else {\n\t\t\tthis.top ??= this.getVirtualizedTop();\n\t\t\tif (didFileChange && this.isSimpleMode()) {\n\t\t\t\tthis.getSimpleVirtualizer()?.markDOMDirty();\n\t\t\t\tthis.resetLayoutCache(true);\n\t\t\t}\n\t\t}\n\t\tif (!this.isVisible && this.isSimpleMode()) return this.renderPlaceholder(this.height);\n\t\tconst windowSpecs = this.virtualizer.getWindowSpecs();\n\t\tconst fileTop = this.top ?? 0;\n\t\tconst renderRange = this.computeRenderRangeFromWindow(this.file, fileTop, windowSpecs);\n\t\treturn super.render({\n\t\t\tfile: this.file,\n\t\t\tfileContainer,\n\t\t\trenderRange,\n\t\t\tlineAnnotations,\n\t\t\tforceRender: (forceRenderOverride ?? forceRender) || annotationsChanged,\n\t\t\t...props\n\t\t});\n\t}\n\tsyncVirtualizedTop() {\n\t\tthis.top = this.getVirtualizedTop();\n\t}\n\tshouldDisableVirtualizationBuffers() {\n\t\treturn this.isAdvancedMode() || super.shouldDisableVirtualizationBuffers();\n\t}\n\tisSimpleMode() {\n\t\treturn this.virtualizer.type === \"simple\";\n\t}\n\tisAdvancedMode() {\n\t\treturn this.virtualizer.type === \"advanced\";\n\t}\n\taddLayoutCheckpoint(lineIndex, top) {\n\t\tif (lineIndex % LAYOUT_CHECKPOINT_INTERVAL !== 0) return;\n\t\tthis.cache.checkpoints.push({\n\t\t\tlineIndex,\n\t\t\ttop\n\t\t});\n\t}\n\tgetLayoutCheckpointBeforeLineIndex(lineIndex) {\n\t\tif (lineIndex <= 0 || this.cache.checkpoints.length === 0) return;\n\t\tlet low = 0;\n\t\tlet high = this.cache.checkpoints.length - 1;\n\t\tlet result;\n\t\twhile (low <= high) {\n\t\t\tconst mid = low + high >> 1;\n\t\t\tconst checkpoint = this.cache.checkpoints[mid];\n\t\t\tif (checkpoint == null) throw new Error(\"VirtualizedFile: invalid checkpoint index\");\n\t\t\tif (checkpoint.lineIndex <= lineIndex) {\n\t\t\t\tresult = checkpoint;\n\t\t\t\tlow = mid + 1;\n\t\t\t} else high = mid - 1;\n\t\t}\n\t\treturn result;\n\t}\n\tgetLayoutCheckpointBeforeTop(top, hunkLineCount) {\n\t\tlet low = 0;\n\t\tlet high = this.cache.checkpoints.length - 1;\n\t\tlet resultIndex = -1;\n\t\twhile (low <= high) {\n\t\t\tconst mid = low + high >> 1;\n\t\t\tconst checkpoint = this.cache.checkpoints[mid];\n\t\t\tif (checkpoint == null) throw new Error(\"VirtualizedFile: invalid checkpoint index\");\n\t\t\tif (checkpoint.top <= top) {\n\t\t\t\tresultIndex = mid;\n\t\t\t\tlow = mid + 1;\n\t\t\t} else high = mid - 1;\n\t\t}\n\t\tif (hunkLineCount == null) return resultIndex >= 0 ? this.cache.checkpoints[resultIndex] : void 0;\n\t\tfor (let index = resultIndex; index >= 0; index--) {\n\t\t\tconst checkpoint = this.cache.checkpoints[index];\n\t\t\tif (checkpoint == null) throw new Error(\"VirtualizedFile: invalid checkpoint index\");\n\t\t\tif (checkpoint.lineIndex % hunkLineCount === 0) return checkpoint;\n\t\t}\n\t}\n\tgetVirtualizedTop() {\n\t\tif (this.virtualizer.type === \"advanced\") return this.virtualizer.getLocalTopForInstance(this);\n\t\treturn this.fileContainer != null ? this.virtualizer.getOffsetInScrollContainer(this.fileContainer) : 0;\n\t}\n\tgetSimpleVirtualizer() {\n\t\treturn this.virtualizer.type === \"simple\" ? this.virtualizer : void 0;\n\t}\n\tisResizeDebuggingEnabled() {\n\t\treturn this.getSimpleVirtualizer()?.config.resizeDebugging ?? false;\n\t}\n\tcomputeRenderRangeFromWindow(file, fileTop, { top, bottom }) {\n\t\tconst { disableFileHeader = false, overflow = \"scroll\" } = this.options;\n\t\tconst { hunkLineCount, lineHeight } = this.metrics;\n\t\tconst lineCount = this.fileRenderer.getLineCount(file);\n\t\tconst fileHeight = this.height;\n\t\tconst headerRegion = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tconst paddingBottom = lineCount > 0 ? getVirtualFilePaddingBottom(this.metrics) : 0;\n\t\tconst { fileAnnotationHeight } = this.cache;\n\t\tconst codeRegionTop = headerRegion + fileAnnotationHeight;\n\t\tconst codeRowsHeight = Math.max(0, fileHeight - headerRegion - fileAnnotationHeight - paddingBottom);\n\t\tconst hasFileAnnotations = includesFileAnnotations(this.lineAnnotations);\n\t\tconst fileAnnotationTop = fileTop + headerRegion;\n\t\tconst measuredFileAnnotationVisible = fileAnnotationHeight > 0 && hasFileAnnotations && fileAnnotationTop < bottom && fileAnnotationTop + fileAnnotationHeight > top;\n\t\tif (fileTop < top - fileHeight || fileTop > bottom) return {\n\t\t\tstartingLine: 0,\n\t\t\ttotalLines: 0,\n\t\t\tbufferBefore: 0,\n\t\t\tbufferAfter: fileHeight - headerRegion - paddingBottom\n\t\t};\n\t\tif (lineCount <= hunkLineCount) return {\n\t\t\tstartingLine: 0,\n\t\t\ttotalLines: hunkLineCount,\n\t\t\tbufferBefore: 0,\n\t\t\tbufferAfter: 0\n\t\t};\n\t\tconst estimatedTargetLines = Math.ceil(Math.max(bottom - top, 0) / lineHeight);\n\t\tconst totalLines = Math.ceil(estimatedTargetLines / hunkLineCount) * hunkLineCount + hunkLineCount * 2;\n\t\tconst totalHunks = totalLines / hunkLineCount;\n\t\tconst viewportCenter = (top + bottom) / 2;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) {\n\t\t\tconst sourceRowsTop = fileTop + codeRegionTop;\n\t\t\tconst sourceRowsBottom = sourceRowsTop + codeRowsHeight;\n\t\t\tif (!measuredFileAnnotationVisible && !(sourceRowsTop < bottom && sourceRowsBottom > top)) return {\n\t\t\t\tstartingLine: 0,\n\t\t\t\ttotalLines: 0,\n\t\t\t\tbufferBefore: 0,\n\t\t\t\tbufferAfter: fileHeight - headerRegion - paddingBottom\n\t\t\t};\n\t\t\tconst centerLine = Math.floor(measuredFileAnnotationVisible && viewportCenter < fileTop + codeRegionTop ? 0 : (viewportCenter - (fileTop + codeRegionTop)) / lineHeight);\n\t\t\tconst idealStartHunk$1 = Math.floor(centerLine / hunkLineCount) - Math.floor(totalHunks / 2);\n\t\t\tconst totalHunksInFile = Math.ceil(lineCount / hunkLineCount);\n\t\t\tconst startingLine$1 = Math.max(0, Math.min(idealStartHunk$1, totalHunksInFile)) * hunkLineCount;\n\t\t\tconst clampedTotalLines$1 = idealStartHunk$1 < 0 ? totalLines + idealStartHunk$1 * hunkLineCount : totalLines;\n\t\t\tconst bufferBefore$1 = startingLine$1 === 0 ? 0 : fileAnnotationHeight + startingLine$1 * lineHeight;\n\t\t\tconst renderedLines = Math.min(clampedTotalLines$1, lineCount - startingLine$1);\n\t\t\treturn {\n\t\t\t\tstartingLine: startingLine$1,\n\t\t\t\ttotalLines: clampedTotalLines$1,\n\t\t\t\tbufferBefore: bufferBefore$1,\n\t\t\t\tbufferAfter: Math.max(0, (lineCount - startingLine$1 - renderedLines) * lineHeight)\n\t\t\t};\n\t\t}\n\t\tconst overflowHunks = totalHunks;\n\t\tconst hunkOffsets = [];\n\t\tconst checkpoint = this.getLayoutCheckpointBeforeTop(Math.max(0, top - fileTop - totalLines * lineHeight * 2), hunkLineCount);\n\t\tlet absoluteLineTop = fileTop + (checkpoint?.top ?? codeRegionTop);\n\t\tlet currentLine = checkpoint?.lineIndex ?? 0;\n\t\tlet firstVisibleHunk;\n\t\tlet centerHunk;\n\t\tlet overflowCounter;\n\t\tconst startingLineIndex = checkpoint?.lineIndex ?? 0;\n\t\tfor (let lineIndex = startingLineIndex; lineIndex < lineCount; lineIndex++) {\n\t\t\tconst isAtHunkBoundary = currentLine % hunkLineCount === 0;\n\t\t\tconst currentHunk = Math.floor(currentLine / hunkLineCount);\n\t\t\tif (isAtHunkBoundary) {\n\t\t\t\thunkOffsets[currentHunk] = absoluteLineTop - (fileTop + codeRegionTop);\n\t\t\t\tif (overflowCounter != null) {\n\t\t\t\t\tif (overflowCounter <= 0) break;\n\t\t\t\t\toverflowCounter--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst lineHeight$1 = this.getLineHeight(lineIndex, false);\n\t\t\tif (absoluteLineTop > top - lineHeight$1 && absoluteLineTop < bottom) firstVisibleHunk ??= currentHunk;\n\t\t\tif (absoluteLineTop + lineHeight$1 > viewportCenter) centerHunk ??= currentHunk;\n\t\t\tif (overflowCounter == null && absoluteLineTop >= bottom && isAtHunkBoundary) overflowCounter = overflowHunks;\n\t\t\tcurrentLine++;\n\t\t\tabsoluteLineTop += lineHeight$1;\n\t\t}\n\t\tif (firstVisibleHunk == null) if (measuredFileAnnotationVisible) {\n\t\t\tfirstVisibleHunk = 0;\n\t\t\tcenterHunk = 0;\n\t\t} else return {\n\t\t\tstartingLine: 0,\n\t\t\ttotalLines: 0,\n\t\t\tbufferBefore: 0,\n\t\t\tbufferAfter: fileHeight - headerRegion - paddingBottom\n\t\t};\n\t\tcenterHunk ??= firstVisibleHunk;\n\t\tconst idealStartHunk = Math.round(centerHunk - totalHunks / 2);\n\t\tconst maxStartHunk = Math.max(0, Math.ceil(lineCount / hunkLineCount) - totalHunks);\n\t\tconst startHunk = Math.max(0, Math.min(idealStartHunk, maxStartHunk));\n\t\tconst startingLine = startHunk * hunkLineCount;\n\t\tconst clampedTotalLines = idealStartHunk < 0 ? totalLines + idealStartHunk * hunkLineCount : totalLines;\n\t\tconst codeBufferBefore = hunkOffsets[startHunk] ?? 0;\n\t\tconst bufferBefore = startingLine === 0 ? 0 : fileAnnotationHeight + codeBufferBefore;\n\t\tconst finalHunkIndex = startHunk + clampedTotalLines / hunkLineCount;\n\t\tconst bufferAfter = finalHunkIndex < hunkOffsets.length ? codeRowsHeight - hunkOffsets[finalHunkIndex] : codeRowsHeight - (absoluteLineTop - fileTop - codeRegionTop);\n\t\treturn {\n\t\t\tstartingLine,\n\t\t\ttotalLines: clampedTotalLines,\n\t\t\tbufferBefore,\n\t\t\tbufferAfter: Math.max(0, bufferAfter)\n\t\t};\n\t}\n};\nfunction measureFileAnnotationHeight(content) {\n\tlet height;\n\tfor (const child of content.children) {\n\t\tif (!(child instanceof HTMLElement)) continue;\n\t\tif (child.dataset.lineAnnotation !== FILE_ANNOTATION_DOM_KEY) continue;\n\t\theight = Math.max(height ?? 0, child.getBoundingClientRect().height);\n\t}\n\treturn height;\n}\n\n//#endregion\nexport { VirtualizedFile };\n//# sourceMappingURL=VirtualizedFile.js.map","import { MessageCircle, Trash2 } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport { Button } from \"~/components/ui/button\";\nimport { Textarea } from \"~/components/ui/textarea\";\n\ninterface LocalCommentAnnotationProps {\n kind: \"draft\" | \"comment\";\n rangeLabel: string;\n text: string;\n onCancel: () => void;\n onComment: (text: string) => void;\n onDelete: () => void;\n}\n\nexport function LocalCommentAnnotation({\n kind,\n rangeLabel,\n text: savedText,\n onCancel,\n onComment,\n onDelete,\n}: LocalCommentAnnotationProps) {\n const [text, setText] = useState(\"\");\n\n if (kind === \"comment\") {\n return (\n <div\n data-file-comment-annotation\n className=\"mx-3 my-2 rounded-xl border border-border/70 bg-background p-3 shadow-sm\"\n contentEditable={false}\n onPointerDown={(event) => event.stopPropagation()}\n >\n <div className=\"flex items-center gap-2\">\n <MessageCircle className=\"size-4 text-muted-foreground\" />\n <span className=\"text-xs font-medium\">Local comment</span>\n <span className=\"ml-auto text-[11px] text-muted-foreground\">{rangeLabel}</span>\n <Button variant=\"ghost\" size=\"icon-xs\" aria-label=\"Delete comment\" onClick={onDelete}>\n <Trash2 className=\"size-3.5\" />\n </Button>\n </div>\n <p className=\"mt-2 whitespace-pre-wrap text-sm leading-relaxed text-foreground\">\n {savedText}\n </p>\n </div>\n );\n }\n\n return (\n <div\n data-file-comment-annotation\n className=\"mx-3 my-2 rounded-xl border border-border/70 bg-background p-3 shadow-lg\"\n contentEditable={false}\n onPointerDown={(event) => event.stopPropagation()}\n >\n <div className=\"flex items-center gap-2\">\n <MessageCircle className=\"size-4 text-muted-foreground\" />\n <span className=\"text-sm font-medium\">Local comment</span>\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Comment on lines {rangeLabel}</div>\n <Textarea\n autoFocus\n className=\"mt-3\"\n size=\"sm\"\n value={text}\n placeholder=\"Request change\"\n aria-label={`Comment on lines ${rangeLabel}`}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n onCancel();\n }\n if ((event.metaKey || event.ctrlKey) && event.key === \"Enter\" && text.trim()) {\n event.preventDefault();\n onComment(text.trim());\n }\n }}\n />\n <div className=\"mt-3 flex justify-end gap-2\">\n <Button variant=\"ghost\" size=\"sm\" onClick={onCancel}>\n Cancel\n </Button>\n <Button size=\"sm\" disabled={!text.trim()} onClick={() => onComment(text.trim())}>\n Comment\n </Button>\n </div>\n </div>\n );\n}\n","import type { LineAnnotation, SelectedLineRange } from \"@pierre/diffs\";\n\nexport interface FileCommentAnnotationEntry {\n id: string;\n kind: \"draft\" | \"comment\";\n startLine: number;\n endLine: number;\n text: string;\n}\n\nexport interface FileCommentAnnotationGroup {\n entries: FileCommentAnnotationEntry[];\n}\n\nexport type FileCommentLineAnnotation = LineAnnotation<FileCommentAnnotationGroup>;\n\nlet fileCommentSequence = 0;\n\nexport function nextFileCommentId(): string {\n fileCommentSequence += 1;\n return `file-comment-${Date.now()}-${fileCommentSequence}`;\n}\n\nexport function normalizeFileCommentRange(range: SelectedLineRange): {\n startLine: number;\n endLine: number;\n} {\n return {\n startLine: Math.min(range.start, range.end),\n endLine: Math.max(range.start, range.end),\n };\n}\n\nexport function formatFileCommentRange(startLine: number, endLine: number): string {\n return startLine === endLine ? `L${startLine}` : `L${startLine} to L${endLine}`;\n}\n\nexport function remapFileCommentAnnotations(\n annotations: ReadonlyArray<FileCommentLineAnnotation>,\n): FileCommentLineAnnotation[] {\n return annotations.map((annotation) => ({\n ...annotation,\n metadata: {\n entries: annotation.metadata.entries.map((entry) => {\n const lineCount = entry.endLine - entry.startLine;\n return {\n ...entry,\n endLine: annotation.lineNumber,\n startLine: Math.max(1, annotation.lineNumber - lineCount),\n };\n }),\n },\n }));\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"8mBAMA,SAAS,GAAmB,CAAE,OAAM,qBAAoB,qBAAoB,uBAAsB,mBAAkB,kBAAiB,sBAAqB,kBAAkB,CAC3K,IAAM,EAAe,IAAqB,CAAI,EACxC,EAAS,IAAqB,CAAI,EAClC,EAAW,IAAuB,CAAI,EAC5C,OAAuB,EAAA,EAAA,KAAA,CAAKA,EAAAA,SAAU,CAAE,SAAU,CACjD,GAAgB,MAGK,EAAA,EAAA,KAAA,CAAKA,EAAAA,SAAU,CAAE,SAAU,CAAC,GAAU,OAAwB,EAAA,EAAA,IAAA,CAAI,MAAO,CAC7F,KAAA,gBACA,SAAU,CACX,CAAC,EAAG,GAAY,OAAwB,EAAA,EAAA,IAAA,CAAI,MAAO,CAClD,KAAA,kBACA,SAAU,CACX,CAAC,CAAC,CAAE,CAAC,GATkC,EAAA,EAAA,IAAA,CAAI,MAAO,CACjD,KAAM,EACN,SAAU,CACX,CAAC,EAOD,GAAoB,MAAQ,GAAiB,KAAK,EAAY,KAA0B,EAAA,EAAA,IAAA,CAAI,MAAO,CAClG,KAAM,EAAsB,CAAU,EACtC,SAAU,EAAiB,CAAU,CACtC,EAAG,CAAK,CAAC,EACT,GAAuB,OAAwB,EAAA,EAAA,IAAA,CAAI,MAAO,CACzD,KAAM,sBACN,MAAO,GACP,SAAU,EAAoB,CAAc,CAC7C,CAAC,CACF,CAAE,CAAC,CACJ,CCNA,IAAIC,GAAa,GACb,GAAe,KAAM,CACxB,KAAO,iBAAiB,EAAEA,KAC1B,YACA,YACA,aAAe,OACf,gBAAkB,CAAC,EACnB,UACA,kBAAoC,I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M,EAmBAiB,CAQI,IAAA5B,EAAA,IAAA4B,EAAA5B,EAAA,IAAAK,EAAAL,EAAA,IAAAW,EAAAX,EAAA,IAAA6B,GAAAA,EAAA7B,EAAA,IAtCN6B,CAsCM,CAxEH,SAAAC,GAAAC,EAAA,CAAA,OAsCyBf,EAAKgB,gBAAiB,CAAC,CAtChD,SAAAlB,GAAAE,EAAA,CAAA,OAgB2BA,EAAKgB,gBAAiB,CAAC,CCfzD,IAAIY,GAAsB,EAE1B,SAAgBC,IAA4B,CAE1C,MADAD,KAAuB,EAChB,gBAAgBE,KAAKC,IAAI,EAAC,GAAIH,IACvC,CAEA,SAAgBI,GAA0BC,EAGxC,CACA,MAAO,CACLX,UAAWY,KAAKC,IAAIF,EAAMG,MAAOH,EAAMI,GAAG,EAC1Cd,QAASW,KAAKI,IAAIL,EAAMG,MAAOH,EAAMI,GAAG,CAC1C,CACF,CAEA,SAAgBE,GAAuBjB,EAAmBC,EAAyB,CACjF,OAAOD,IAAcC,EAAU,IAAID,IAAc,IAAIA,EAAS,OAAQC,GACxE,CAEA,SAAgBiB,GACdC,EAC6B,CAC7B,OAAOA,EAAYE,IAAKC,IAAgB,CACtC,GAAGA,EACHC,SAAU,CACRnB,QAASkB,EAAWC,SAASnB,QAAQiB,IAAKG,GAAU,CAClD,IAAMC,EAAYD,EAAMvB,QAAUuB,EAAMxB,UACxC,MAAO,CACL,GAAGwB,EACHvB,QAASqB,EAAWI,WACpB1B,UAAWY,KAAKI,IAAI,EAAGM,EAAWI,WAAaD,CAAS,CAC1D,CACF,CAAC,CACH,CACF,EAAE,CACJ"}
|
|
1
|
+
{"version":3,"file":"fileCommentAnnotations-CLPA7umr.js","names":["Fragment","instanceId","instanceId","MessageCircle","Trash2","useState","Button","Textarea","LocalCommentAnnotationProps","kind","rangeLabel","text","onCancel","onComment","onDelete","LocalCommentAnnotation","t0","$","_c","savedText","setText","t1","t2","Symbol","for","t3","t4","t5","t6","t7","t8","_temp","event_1","event","target","value","event_2","key","preventDefault","metaKey","ctrlKey","trim","t9","t10","t11","t12","t13","_temp2","event_0","stopPropagation","LineAnnotation","SelectedLineRange","FileCommentAnnotationEntry","id","kind","startLine","endLine","text","FileCommentAnnotationGroup","entries","FileCommentLineAnnotation","fileCommentSequence","nextFileCommentId","Date","now","normalizeFileCommentRange","range","Math","min","start","end","max","formatFileCommentRange","remapFileCommentAnnotations","annotations","ReadonlyArray","map","annotation","metadata","entry","lineCount","lineNumber"],"sources":["../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/react/utils/renderFileChildren.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/utils/areLineAnnotationsEqual.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/utils/getFileRendererOptions.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/components/File.js","../../../../node_modules/.pnpm/@pierre+diffs@1.3.0-beta.5_patch_hash=7cb6da88544119adda056b2f46f43956f99326227732da0b3_3b51331382fbad9d080c5033ee1e2a6a/node_modules/@pierre/diffs/dist/components/VirtualizedFile.js","../../src/components/files/LocalCommentAnnotation.tsx","../../src/components/files/fileCommentAnnotations.ts"],"sourcesContent":["import { CUSTOM_HEADER_SLOT_ID, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID } from \"../../constants.js\";\nimport { getLineAnnotationName } from \"../../utils/getLineAnnotationName.js\";\nimport { GutterUtilitySlotStyles } from \"../constants.js\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\n\n//#region src/react/utils/renderFileChildren.tsx\nfunction renderFileChildren({ file, renderCustomHeader, renderHeaderPrefix, renderHeaderMetadata, renderAnnotation, lineAnnotations, renderGutterUtility, getHoveredLine }) {\n\tconst customHeader = renderCustomHeader?.(file);\n\tconst prefix = renderHeaderPrefix?.(file);\n\tconst metadata = renderHeaderMetadata?.(file);\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [\n\t\tcustomHeader != null ? /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: CUSTOM_HEADER_SLOT_ID,\n\t\t\tchildren: customHeader\n\t\t}) : /* @__PURE__ */ jsxs(Fragment, { children: [prefix != null && /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: HEADER_PREFIX_SLOT_ID,\n\t\t\tchildren: prefix\n\t\t}), metadata != null && /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: HEADER_METADATA_SLOT_ID,\n\t\t\tchildren: metadata\n\t\t})] }),\n\t\trenderAnnotation != null && lineAnnotations?.map((annotation, index) => /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: getLineAnnotationName(annotation),\n\t\t\tchildren: renderAnnotation(annotation)\n\t\t}, index)),\n\t\trenderGutterUtility != null && /* @__PURE__ */ jsx(\"div\", {\n\t\t\tslot: \"gutter-utility-slot\",\n\t\t\tstyle: GutterUtilitySlotStyles,\n\t\t\tchildren: renderGutterUtility(getHoveredLine)\n\t\t})\n\t] });\n}\n\n//#endregion\nexport { renderFileChildren };\n//# sourceMappingURL=renderFileChildren.js.map","import { DEFAULT_RENDER_RANGE, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH } from \"../constants.js\";\nimport { areFilesEqual } from \"../utils/areFilesEqual.js\";\nimport { FILE_ANNOTATION_HUNK_INDEX, FILE_ANNOTATION_LINE_INDEX, getFileAnnotations, shouldRenderFileAnnotations } from \"../utils/includesFileAnnotations.js\";\nimport { createGutterGap, createGutterItem, createGutterWrapper, createHastElement } from \"../utils/hast_utils.js\";\nimport { areLanguagesAttached } from \"../highlighter/languages/areLanguagesAttached.js\";\nimport { getHighlighterIfLoaded, getSharedHighlighter } from \"../highlighter/shared_highlighter.js\";\nimport { getThemes } from \"../utils/getThemes.js\";\nimport { areThemesAttached } from \"../highlighter/themes/areThemesAttached.js\";\nimport { hasResolvedThemes } from \"../highlighter/themes/hasResolvedThemes.js\";\nimport { areFileRenderOptionsEqual } from \"../utils/areFileRenderOptionsEqual.js\";\nimport { areRenderRangesEqual } from \"../utils/areRenderRangesEqual.js\";\nimport { linesFromFileContents } from \"../utils/computeFileOffsets.js\";\nimport { createAnnotationElement } from \"../utils/createAnnotationElement.js\";\nimport { createContentColumn } from \"../utils/createContentColumn.js\";\nimport { createFileHeaderElement } from \"../utils/createFileHeaderElement.js\";\nimport { createPreElement } from \"../utils/createPreElement.js\";\nimport { getFiletypeFromFileName } from \"../utils/getFiletypeFromFileName.js\";\nimport { getHighlighterOptions } from \"../utils/getHighlighterOptions.js\";\nimport { getLineAnnotationName } from \"../utils/getLineAnnotationName.js\";\nimport { isFilePlainText } from \"../utils/isFilePlainText.js\";\nimport { renderFileWithHighlighter } from \"../utils/renderFileWithHighlighter.js\";\nimport { shouldUseTokenTransformer } from \"../utils/shouldUseTokenTransformer.js\";\nimport { toHtml } from \"hast-util-to-html\";\n\n//#region src/renderers/FileRenderer.ts\nlet instanceId = -1;\nvar FileRenderer = class {\n\t__id = `file-renderer:${++instanceId}`;\n\thighlighter;\n\trenderCache;\n\tcomputedLang = \"text\";\n\tlineAnnotations = {};\n\tlineCache;\n\ttextDoucmentCache = /* @__PURE__ */ new WeakMap();\n\tconstructor(options = { theme: DEFAULT_THEMES }, onRenderUpdate, workerManager) {\n\t\tthis.options = options;\n\t\tthis.onRenderUpdate = onRenderUpdate;\n\t\tthis.workerManager = workerManager;\n\t\tif (workerManager?.isWorkingPool() !== true) this.highlighter = areThemesAttached(options.theme ?? DEFAULT_THEMES) ? getHighlighterIfLoaded() : void 0;\n\t}\n\tsetOptions(options) {\n\t\tthis.options = options;\n\t}\n\tmergeOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\tsetLineAnnotations(lineAnnotations) {\n\t\tthis.lineAnnotations = {};\n\t\tfor (const annotation of lineAnnotations) {\n\t\t\tconst arr = this.lineAnnotations[annotation.lineNumber] ?? [];\n\t\t\tthis.lineAnnotations[annotation.lineNumber] = arr;\n\t\t\tarr.push(annotation);\n\t\t}\n\t}\n\tcleanUp() {\n\t\tthis.recycle();\n\t\tthis.workerManager = void 0;\n\t\tthis.onRenderUpdate = void 0;\n\t}\n\trecycle() {\n\t\tthis.clearRenderCache();\n\t\tthis.highlighter = void 0;\n\t\tthis.workerManager?.cleanUpTasks(this);\n\t\tthis.lineCache = void 0;\n\t}\n\tclearRenderCache() {\n\t\tconst renderCache = this.renderCache;\n\t\tthis.renderCache = void 0;\n\t\tif (renderCache != null && renderCache.isDirty === true && renderCache.file.cacheKey != null) this.workerManager?.evictFileFromCache(renderCache.file.cacheKey);\n\t}\n\thydrate(file) {\n\t\tconst { options } = this.getRenderOptions(file);\n\t\tconst massiveFile = isFileMassive(this.getOrCreateLineCache(file).length, this.getTokenizeMaxLength());\n\t\tlet cache = this.workerManager?.getFileResultCache(file);\n\t\tif (cache != null && !areFileRenderOptionsEqual(options, cache.options)) cache = void 0;\n\t\tthis.renderCache ??= {\n\t\t\tfile,\n\t\t\toptions,\n\t\t\thighlighted: !massiveFile && !isFilePlainText(file),\n\t\t\tresult: massiveFile ? void 0 : cache?.result,\n\t\t\trenderRange: void 0\n\t\t};\n\t\tif (this.workerManager?.isWorkingPool() === true) {\n\t\t\tif (this.renderCache.result == null && !massiveFile) this.workerManager.highlightFileAST(this, file);\n\t\t} else if (this.highlighter == null) {\n\t\t\tthis.computedLang = file.lang ?? getFiletypeFromFileName(file.name);\n\t\t\tthis.initializeHighlighter();\n\t\t}\n\t}\n\tgetRenderOptions(file) {\n\t\tconst options = (() => {\n\t\t\tif (this.workerManager?.isWorkingPool() === true) return this.workerManager.getFileRenderOptions();\n\t\t\tconst { theme = DEFAULT_THEMES, tokenizeMaxLineLength = 1e3 } = this.options;\n\t\t\treturn {\n\t\t\t\ttheme,\n\t\t\t\tuseTokenTransformer: shouldUseTokenTransformer(this.options),\n\t\t\t\ttokenizeMaxLineLength\n\t\t\t};\n\t\t})();\n\t\tconst { renderCache } = this;\n\t\tif (renderCache?.result == null) return {\n\t\t\toptions,\n\t\t\tforceHighlight: true\n\t\t};\n\t\tif (!areFilesEqual(file, renderCache.file) || !areFileRenderOptionsEqual(options, renderCache.options)) return {\n\t\t\toptions,\n\t\t\tforceHighlight: true\n\t\t};\n\t\treturn {\n\t\t\toptions,\n\t\t\tforceHighlight: false\n\t\t};\n\t}\n\tgetOrCreateLineCache(file) {\n\t\tif (file.cacheKey == null) {\n\t\t\tthis.lineCache = void 0;\n\t\t\treturn linesFromFileContents(file.contents);\n\t\t}\n\t\tlet { lineCache } = this;\n\t\tif (lineCache == null || lineCache.cacheKey !== file.cacheKey) lineCache = {\n\t\t\tcacheKey: file.cacheKey,\n\t\t\tlines: linesFromFileContents(file.contents)\n\t\t};\n\t\tthis.lineCache = lineCache;\n\t\treturn lineCache.lines;\n\t}\n\tgetLineCount(file) {\n\t\treturn this.textDoucmentCache.get(file)?.lineCount ?? this.getOrCreateLineCache(file).length;\n\t}\n\tupdateRenderCache(dirtyLines, themeType) {\n\t\tif (this.renderCache == null) return;\n\t\tconst { result } = this.renderCache;\n\t\tif (result == null) return;\n\t\tfor (const [line, tokens] of dirtyLines) result.code[line] = {\n\t\t\ttype: \"element\",\n\t\t\ttagName: \"div\",\n\t\t\tproperties: {\n\t\t\t\t\"data-line\": line + 1,\n\t\t\t\t\"data-line-type\": \"context\",\n\t\t\t\t\"data-line-index\": line\n\t\t\t},\n\t\t\tchildren: tokens.map(([char, fg, text]) => {\n\t\t\t\tif (char === 0 && fg === \"\") {\n\t\t\t\t\tif (text === \"\") return {\n\t\t\t\t\t\ttype: \"element\",\n\t\t\t\t\t\ttagName: \"br\",\n\t\t\t\t\t\tproperties: {},\n\t\t\t\t\t\tchildren: []\n\t\t\t\t\t};\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tvalue: text\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"element\",\n\t\t\t\t\ttagName: \"span\",\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\"data-char\": char,\n\t\t\t\t\t\tstyle: `--diffs-token-${themeType}:${fg};`\n\t\t\t\t\t},\n\t\t\t\t\tchildren: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tvalue: text\n\t\t\t\t\t}]\n\t\t\t\t};\n\t\t\t})\n\t\t};\n\t\tresult.baseThemeType = themeType;\n\t\tthis.renderCache.isDirty = true;\n\t}\n\tapplyDocumentChange(textDocument) {\n\t\tif (this.renderCache == null) return;\n\t\tconst { file, result } = this.renderCache;\n\t\tif (result != null && result.code.length !== textDocument.lineCount) {\n\t\t\tfor (let i = result.code.length; i < textDocument.lineCount; i++) result.code.push({\n\t\t\t\ttype: \"element\",\n\t\t\t\ttagName: \"div\",\n\t\t\t\tproperties: {\n\t\t\t\t\t\"data-line\": i + 1,\n\t\t\t\t\t\"data-line-type\": \"context\",\n\t\t\t\t\t\"data-line-index\": i\n\t\t\t\t},\n\t\t\t\tchildren: [{\n\t\t\t\t\ttype: \"element\",\n\t\t\t\t\ttagName: \"span\",\n\t\t\t\t\tproperties: { \"data-char\": 0 },\n\t\t\t\t\tchildren: [{\n\t\t\t\t\t\ttype: \"text\",\n\t\t\t\t\t\tvalue: textDocument.getLineText(i)\n\t\t\t\t\t}]\n\t\t\t\t}]\n\t\t\t});\n\t\t\tthis.renderCache.isDirty = true;\n\t\t}\n\t\tthis.textDoucmentCache.set(file, textDocument);\n\t}\n\trenderFile(file = this.renderCache?.file, renderRange = DEFAULT_RENDER_RANGE) {\n\t\tif (file == null) return;\n\t\tlet { options, forceHighlight } = this.getRenderOptions(file);\n\t\tconst cache = this.getMatchingWorkerResultCache(file, options);\n\t\tif (cache != null && !this.hasHighlightedRenderCache(file, options)) {\n\t\t\tthis.renderCache = {\n\t\t\t\tfile,\n\t\t\t\thighlighted: true,\n\t\t\t\trenderRange: void 0,\n\t\t\t\t...cache\n\t\t\t};\n\t\t\tforceHighlight = false;\n\t\t}\n\t\tthis.renderCache ??= {\n\t\t\tfile,\n\t\t\thighlighted: false,\n\t\t\toptions,\n\t\t\tresult: void 0,\n\t\t\trenderRange: void 0\n\t\t};\n\t\tconst lines = this.getOrCreateLineCache(file);\n\t\tconst hasContent = file.contents.length > 0;\n\t\tconst forcePlainText = !hasContent || isFilePlainText(file) || isFileMassive(lines.length, this.getTokenizeMaxLength());\n\t\tconst newContent = !areFilesEqual(file, this.renderCache.file);\n\t\tconst newRenderRange = !areRenderRangesEqual(this.renderCache.renderRange, renderRange);\n\t\tif (this.workerManager?.isWorkingPool() === true) {\n\t\t\tif (forcePlainText || this.renderCache.result == null || !this.renderCache.highlighted && (newContent || newRenderRange)) {\n\t\t\t\tthis.renderCache.file = file;\n\t\t\t\tthis.renderCache.options = options;\n\t\t\t\tthis.renderCache.highlighted = false;\n\t\t\t\tif (this.renderCache.result == null || newContent || newRenderRange || forceHighlight) this.renderCache.result = this.workerManager.getPlainFileAST(file, renderRange.startingLine, renderRange.totalLines, lines);\n\t\t\t\tthis.renderCache.renderRange = renderRange;\n\t\t\t}\n\t\t\tif (!forcePlainText && hasContent && (!this.renderCache.highlighted || forceHighlight)) this.workerManager.highlightFileAST(this, file);\n\t\t} else {\n\t\t\tthis.computedLang = file.lang ?? getFiletypeFromFileName(file.name);\n\t\t\tconst hasThemes = this.highlighter != null && areThemesAttached(options.theme);\n\t\t\tconst hasLangs = this.highlighter != null && areLanguagesAttached(this.computedLang);\n\t\t\tconst canHighlight = !forcePlainText && hasLangs;\n\t\t\tif (this.highlighter != null && hasThemes && (forceHighlight || forcePlainText || !this.renderCache.highlighted && canHighlight || this.renderCache.result == null)) {\n\t\t\t\tconst { result, options: options$1 } = this.renderFileWithHighlighter(file, this.highlighter, forcePlainText || !hasLangs);\n\t\t\t\tthis.renderCache = {\n\t\t\t\t\tfile,\n\t\t\t\t\toptions: options$1,\n\t\t\t\t\thighlighted: canHighlight,\n\t\t\t\t\tresult,\n\t\t\t\t\trenderRange: void 0\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (!hasThemes || !forcePlainText && !hasLangs) this.asyncHighlight(file).then(({ result, options: options$1 }) => {\n\t\t\t\tif (this.renderCache != null) this.renderCache.highlighted = false;\n\t\t\t\tthis.onHighlightSuccess(file, result, options$1, !forcePlainText);\n\t\t\t});\n\t\t}\n\t\treturn this.renderCache.result != null ? this.processFileResult(this.renderCache.file, renderRange, this.renderCache.result) : void 0;\n\t}\n\tasync asyncRender(file, renderRange = DEFAULT_RENDER_RANGE) {\n\t\tconst { result } = await this.asyncHighlight(file);\n\t\treturn this.processFileResult(file, renderRange, result);\n\t}\n\tasync asyncHighlight(file) {\n\t\tconst forcePlainText = isFileMassive(this.getOrCreateLineCache(file).length, this.getTokenizeMaxLength());\n\t\tthis.computedLang = forcePlainText ? \"text\" : file.lang ?? getFiletypeFromFileName(file.name);\n\t\tconst hasThemes = this.highlighter != null && hasResolvedThemes(getThemes(this.options.theme));\n\t\tconst hasLangs = forcePlainText || this.highlighter != null && areLanguagesAttached(this.computedLang);\n\t\tif (this.highlighter == null || !hasThemes || !hasLangs) this.highlighter = await this.initializeHighlighter();\n\t\treturn this.renderFileWithHighlighter(file, this.highlighter, forcePlainText);\n\t}\n\trenderFileWithHighlighter(file, highlighter, forcePlainText = false) {\n\t\tconst { options } = this.getRenderOptions(file);\n\t\treturn {\n\t\t\tresult: renderFileWithHighlighter(file, highlighter, options, { forcePlainText }),\n\t\t\toptions\n\t\t};\n\t}\n\tprocessFileResult(file, renderRange, { code, themeStyles, baseThemeType }) {\n\t\tconst totalLines = this.getLineCount(file);\n\t\tconst { disableFileHeader = false } = this.options;\n\t\tconst contentArray = [];\n\t\tconst gutter = createGutterWrapper();\n\t\tconst endLine = Math.min(renderRange.startingLine + renderRange.totalLines, totalLines);\n\t\tlet rowCount = 0;\n\t\tconst fileLevelAnnotations = shouldRenderFileAnnotations(renderRange) ? getFileAnnotations(this.lineAnnotations) : void 0;\n\t\tif (fileLevelAnnotations != null) {\n\t\t\tgutter.children.push(createGutterGap(\"context\", \"annotation\", 1));\n\t\t\tcontentArray.push(createAnnotationElement({\n\t\t\t\ttype: \"annotation\",\n\t\t\t\thunkIndex: FILE_ANNOTATION_HUNK_INDEX,\n\t\t\t\tlineIndex: FILE_ANNOTATION_LINE_INDEX,\n\t\t\t\tannotations: fileLevelAnnotations.map((annotation) => getLineAnnotationName(annotation))\n\t\t\t}));\n\t\t\trowCount++;\n\t\t}\n\t\tfor (let lineIndex = renderRange.startingLine; lineIndex < endLine; lineIndex++) {\n\t\t\tconst lineNumber = lineIndex + 1;\n\t\t\tconst line = code[lineIndex];\n\t\t\tif (line == null) {\n\t\t\t\tconst message = \"FileRenderer.processFileResult: Line doesnt exist\";\n\t\t\t\tconsole.error(message, {\n\t\t\t\t\tname: file.name,\n\t\t\t\t\tlineIndex,\n\t\t\t\t\tlineNumber\n\t\t\t\t});\n\t\t\t\tthrow new Error(message);\n\t\t\t}\n\t\t\tgutter.children.push(createGutterItem(\"context\", lineNumber, `${lineIndex}`));\n\t\t\tcontentArray.push(line);\n\t\t\trowCount++;\n\t\t\tconst annotations = this.lineAnnotations[lineNumber];\n\t\t\tif (annotations != null) {\n\t\t\t\tgutter.children.push(createGutterGap(\"context\", \"annotation\", 1));\n\t\t\t\tcontentArray.push(createAnnotationElement({\n\t\t\t\t\ttype: \"annotation\",\n\t\t\t\t\thunkIndex: 0,\n\t\t\t\t\tlineIndex: lineNumber,\n\t\t\t\t\tannotations: annotations.map((annotation) => getLineAnnotationName(annotation))\n\t\t\t\t}));\n\t\t\t\trowCount++;\n\t\t\t}\n\t\t}\n\t\tgutter.properties.style = `grid-row: span ${rowCount}`;\n\t\treturn {\n\t\t\tgutterAST: gutter.children ?? [],\n\t\t\tcontentAST: contentArray,\n\t\t\tpreAST: this.createPreElement(totalLines),\n\t\t\theaderAST: !disableFileHeader ? this.renderHeader(file) : void 0,\n\t\t\ttotalLines,\n\t\t\trowCount,\n\t\t\tthemeStyles,\n\t\t\tbaseThemeType,\n\t\t\tbufferBefore: renderRange.bufferBefore,\n\t\t\tbufferAfter: renderRange.bufferAfter,\n\t\t\tcss: \"\"\n\t\t};\n\t}\n\trenderHeader(file) {\n\t\tconst { headerRenderMode = \"default\", stickyHeader = false } = this.options;\n\t\treturn createFileHeaderElement({\n\t\t\tfileOrDiff: file,\n\t\t\tmode: headerRenderMode,\n\t\t\tstickyHeader\n\t\t});\n\t}\n\trenderFullHTML(result) {\n\t\treturn toHtml(this.renderFullAST(result));\n\t}\n\trenderFullAST(result, children = []) {\n\t\tchildren.push(createHastElement({\n\t\t\ttagName: \"code\",\n\t\t\tchildren: this.renderCodeAST(result),\n\t\t\tproperties: { \"data-code\": \"\" }\n\t\t}));\n\t\treturn {\n\t\t\t...result.preAST,\n\t\t\tchildren\n\t\t};\n\t}\n\trenderCodeAST(result) {\n\t\tconst gutter = createGutterWrapper();\n\t\tgutter.children = result.gutterAST;\n\t\tgutter.properties.style = `grid-row: span ${result.rowCount}`;\n\t\treturn [gutter, createContentColumn(result.contentAST, result.rowCount)];\n\t}\n\trenderPartialHTML(children, includeCodeNode = false) {\n\t\tif (!includeCodeNode) return toHtml(children);\n\t\treturn toHtml(createHastElement({\n\t\t\ttagName: \"code\",\n\t\t\tchildren,\n\t\t\tproperties: { \"data-code\": \"\" }\n\t\t}));\n\t}\n\tasync initializeHighlighter() {\n\t\tthis.highlighter = await getSharedHighlighter(getHighlighterOptions(this.computedLang, this.options));\n\t\treturn this.highlighter;\n\t}\n\tonHighlightSuccess(file, result, options, highlighted = true) {\n\t\tif (this.renderCache == null) return;\n\t\tconst triggerRenderUpdate = !areFilesEqual(file, this.renderCache.file) || !this.renderCache.highlighted || !areFileRenderOptionsEqual(options, this.renderCache.options);\n\t\tthis.renderCache = {\n\t\t\tfile,\n\t\t\toptions,\n\t\t\thighlighted,\n\t\t\tresult,\n\t\t\trenderRange: void 0\n\t\t};\n\t\tif (triggerRenderUpdate) this.onRenderUpdate?.();\n\t}\n\tgetMatchingWorkerResultCache(file, options) {\n\t\tconst cache = this.workerManager?.getFileResultCache(file);\n\t\tif (cache == null || !areFileRenderOptionsEqual(options, cache.options)) return;\n\t\treturn cache;\n\t}\n\thasHighlightedRenderCache(file, options) {\n\t\tconst { renderCache } = this;\n\t\treturn renderCache?.result != null && renderCache.highlighted && areFilesEqual(file, renderCache.file) && areFileRenderOptionsEqual(options, renderCache.options);\n\t}\n\tonHighlightError(error) {\n\t\tconsole.error(error);\n\t}\n\tgetTokenizeMaxLength() {\n\t\treturn this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH;\n\t}\n\tcreatePreElement(totalLines) {\n\t\tconst { disableLineNumbers = false, overflow = \"scroll\" } = this.options;\n\t\treturn createPreElement({\n\t\t\ttype: \"file\",\n\t\t\tdiffIndicators: \"none\",\n\t\t\tdisableBackground: true,\n\t\t\tdisableLineNumbers,\n\t\t\toverflow,\n\t\t\tsplit: false,\n\t\t\ttotalLines\n\t\t});\n\t}\n};\nfunction isFileMassive(lineCount, tokenizeMaxLength) {\n\treturn lineCount > tokenizeMaxLength;\n}\n\n//#endregion\nexport { FileRenderer };\n//# sourceMappingURL=FileRenderer.js.map","//#region src/utils/areLineAnnotationsEqual.ts\nfunction areLineAnnotationsEqual(annotationA, annotationB) {\n\treturn annotationA.lineNumber === annotationB.lineNumber && annotationA.metadata === annotationB.metadata;\n}\n\n//#endregion\nexport { areLineAnnotationsEqual };\n//# sourceMappingURL=areLineAnnotationsEqual.js.map","//#region src/utils/getFileRendererOptions.ts\nfunction getFileRendererOptions(options) {\n\treturn {\n\t\ttheme: options?.theme,\n\t\tdisableLineNumbers: options?.disableLineNumbers,\n\t\toverflow: options?.overflow,\n\t\tthemeType: options?.themeType,\n\t\tcollapsed: options?.collapsed,\n\t\tdisableFileHeader: options?.disableFileHeader,\n\t\tdisableVirtualizationBuffers: options?.disableVirtualizationBuffers,\n\t\tstickyHeader: options?.stickyHeader,\n\t\tpreferredHighlighter: options?.preferredHighlighter,\n\t\tuseCSSClasses: options?.useCSSClasses,\n\t\tuseTokenTransformer: options?.useTokenTransformer,\n\t\ttokenizeMaxLineLength: options?.tokenizeMaxLineLength,\n\t\ttokenizeMaxLength: options?.tokenizeMaxLength,\n\t\tunsafeCSS: options?.unsafeCSS,\n\t\theaderRenderMode: options?.renderCustomHeader != null ? \"custom\" : \"default\"\n\t};\n}\n\n//#endregion\nexport { getFileRendererOptions };\n//# sourceMappingURL=getFileRendererOptions.js.map","import { CUSTOM_HEADER_SLOT_ID, DEFAULT_THEMES, DEFAULT_TOKENIZE_MAX_LENGTH, DIFFS_TAG_NAME, EMPTY_RENDER_RANGE, HEADER_METADATA_SLOT_ID, HEADER_PREFIX_SLOT_ID, THEME_CSS_ATTRIBUTE, UNSAFE_CSS_ATTRIBUTE } from \"../constants.js\";\nimport { queueRender } from \"../managers/UniversalRenderingManager.js\";\nimport { areThemesEqual } from \"../utils/areThemesEqual.js\";\nimport { isStyleNode } from \"../utils/isStyleNode.js\";\nimport { areFilesEqual } from \"../utils/areFilesEqual.js\";\nimport { InteractionManager, pluckInteractionOptions } from \"../managers/InteractionManager.js\";\nimport { ResizeManager } from \"../managers/ResizeManager.js\";\nimport { areRenderRangesEqual } from \"../utils/areRenderRangesEqual.js\";\nimport { getLineAnnotationName } from \"../utils/getLineAnnotationName.js\";\nimport { isFilePlainText } from \"../utils/isFilePlainText.js\";\nimport { FileRenderer } from \"../renderers/FileRenderer.js\";\nimport { SVGSpriteSheet } from \"../sprite.js\";\nimport { areLineAnnotationsEqual } from \"../utils/areLineAnnotationsEqual.js\";\nimport { arePrePropertiesEqual } from \"../utils/arePrePropertiesEqual.js\";\nimport { createAnnotationWrapperNode } from \"../utils/createAnnotationWrapperNode.js\";\nimport { createGutterUtilityContentNode } from \"../utils/createGutterUtilityContentNode.js\";\nimport { createUnsafeCSSStyleNode } from \"../utils/createUnsafeCSSStyleNode.js\";\nimport { getMeasuredScrollbarGutter } from \"../utils/scrollbarGutter.js\";\nimport { patchScrollbarGutterSize, wrapThemeCSS, wrapUnsafeCSS } from \"../utils/cssWrappers.js\";\nimport { getFileRendererOptions } from \"../utils/getFileRendererOptions.js\";\nimport { getOrCreateCodeNode } from \"../utils/getOrCreateCodeNode.js\";\nimport { upsertHostThemeStyle } from \"../utils/hostTheme.js\";\nimport { prerenderHTMLIfNecessary } from \"../utils/prerenderHTMLIfNecessary.js\";\nimport { setPreNodeProperties } from \"../utils/setWrapperNodeProps.js\";\nimport { DiffsContainerLoaded } from \"./web-components.js\";\nimport { toHtml } from \"hast-util-to-html\";\n\n//#region src/components/File.ts\nconst EMPTY_STRINGS = [\"\"];\nlet instanceId = -1;\nvar File = class {\n\tstatic LoadedCustomComponent = DiffsContainerLoaded;\n\t__id = `file:${++instanceId}`;\n\ttype = \"file\";\n\tfileContainer;\n\tspriteSVG;\n\tpre;\n\tcode;\n\tbufferBefore;\n\tbufferAfter;\n\tthemeCSSStyle;\n\tappliedThemeCSS;\n\thasAdoptedThemeCSS = false;\n\tunsafeCSSStyle;\n\tappliedUnsafeCSS;\n\tgutterUtilityContent;\n\terrorWrapper;\n\tplaceHolder;\n\tlastRenderedHeaderHTML;\n\tcachedHeaderHTML;\n\tappliedPreAttributes;\n\tlastRowCount;\n\tmounted = false;\n\theaderElement;\n\theaderCustom;\n\theaderPrefix;\n\theaderMetadata;\n\tfileRenderer;\n\tresizeManager;\n\tinteractionManager;\n\tannotationCache = /* @__PURE__ */ new Map();\n\tlineAnnotations = [];\n\tmanagersDirty = false;\n\tfile;\n\trenderRange;\n\tenabled = true;\n\teditor;\n\tconstructor(options = { theme: DEFAULT_THEMES }, workerManager, isContainerManaged = false) {\n\t\tthis.options = options;\n\t\tthis.workerManager = workerManager;\n\t\tthis.isContainerManaged = isContainerManaged;\n\t\tthis.fileRenderer = new FileRenderer(options, this.handleHighlightRender, this.workerManager);\n\t\tthis.resizeManager = new ResizeManager();\n\t\tthis.interactionManager = new InteractionManager(\"file\", pluckInteractionOptions(options));\n\t\tthis.workerManager?.subscribeToThemeChanges(this);\n\t}\n\thandleHighlightRender = () => {\n\t\tthis.rerender();\n\t};\n\trerender() {\n\t\tif (!this.enabled || this.file == null) return;\n\t\tthis.render({\n\t\t\tfile: this.file,\n\t\t\tforceRender: true,\n\t\t\trenderRange: this.renderRange\n\t\t});\n\t}\n\tonThemeChange() {\n\t\tthis.fileRenderer.clearRenderCache();\n\t\tthis.rerender();\n\t}\n\tsetOptions(options) {\n\t\tif (options == null) return;\n\t\tthis.options = options;\n\t\tthis.cachedHeaderHTML = void 0;\n\t\tthis.syncInteractionOptions();\n\t}\n\tsyncInteractionOptions() {\n\t\tthis.interactionManager.setOptions(pluckInteractionOptions(this.options));\n\t}\n\tmergeOptions(options) {\n\t\tthis.options = {\n\t\t\t...this.options,\n\t\t\t...options\n\t\t};\n\t}\n\tsetThemeType(themeType) {\n\t\tif ((this.options.themeType ?? \"system\") === themeType) return;\n\t\tthis.mergeOptions({ themeType });\n\t\tthis.applyCachedThemeState(themeType);\n\t}\n\tapplyCachedThemeState(themeType) {\n\t\tif (typeof this.options.theme === \"string\" || this.fileContainer == null || this.appliedThemeCSS == null) return false;\n\t\tconst effectiveThemeType = this.appliedThemeCSS.baseThemeType ?? themeType;\n\t\tif (this.appliedThemeCSS.themeType === effectiveThemeType) return false;\n\t\tthis.applyThemeState(this.fileContainer, this.appliedThemeCSS.themeStyles, themeType, this.appliedThemeCSS.baseThemeType);\n\t\treturn true;\n\t}\n\thasThemeChanged() {\n\t\treturn this.appliedThemeCSS != null && !areThemesEqual(this.appliedThemeCSS.theme, this.options.theme ?? DEFAULT_THEMES);\n\t}\n\tgetHoveredLine = () => {\n\t\treturn this.interactionManager.getHoveredLine();\n\t};\n\tsetLineAnnotations(lineAnnotations) {\n\t\tthis.lineAnnotations = lineAnnotations;\n\t}\n\tsetSelectedLines(range, options) {\n\t\tthis.interactionManager.setSelection(range, options);\n\t}\n\tflushManagers() {\n\t\tif (!this.managersDirty || this.pre == null) {\n\t\t\tthis.managersDirty = false;\n\t\t\treturn;\n\t\t}\n\t\tconst { overflow = \"scroll\" } = this.options;\n\t\tthis.interactionManager.setup(this.pre);\n\t\tthis.resizeManager.setup(this.pre, overflow === \"wrap\");\n\t\tthis.managersDirty = false;\n\t}\n\tcleanUp(recycle = false) {\n\t\tthis.emitPostRender(true);\n\t\tthis.resizeManager.cleanUp();\n\t\tthis.interactionManager.cleanUp();\n\t\tthis.managersDirty = false;\n\t\tthis.workerManager?.unsubscribeToThemeChanges(this);\n\t\tthis.renderRange = void 0;\n\t\tif (!this.isContainerManaged) this.fileContainer?.remove();\n\t\tthis.fileContainer = void 0;\n\t\tthis.mounted = false;\n\t\tif (!recycle) this.lineAnnotations = [];\n\t\tthis.annotationCache.clear();\n\t\tthis.pre = void 0;\n\t\tthis.bufferBefore = void 0;\n\t\tthis.bufferAfter = void 0;\n\t\tthis.appliedPreAttributes = void 0;\n\t\tthis.lastRowCount = void 0;\n\t\tthis.headerElement = void 0;\n\t\tthis.headerPrefix = void 0;\n\t\tthis.headerMetadata = void 0;\n\t\tthis.headerCustom = void 0;\n\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\tif (!recycle) this.cachedHeaderHTML = void 0;\n\t\tthis.errorWrapper = void 0;\n\t\tthis.themeCSSStyle = void 0;\n\t\tthis.appliedThemeCSS = void 0;\n\t\tthis.hasAdoptedThemeCSS = false;\n\t\tthis.unsafeCSSStyle = void 0;\n\t\tthis.appliedUnsafeCSS = void 0;\n\t\tthis.placeHolder = void 0;\n\t\tthis.unsafeCSSStyle = void 0;\n\t\tif (recycle) this.fileRenderer.recycle();\n\t\telse {\n\t\t\tthis.fileRenderer.cleanUp();\n\t\t\tthis.workerManager = void 0;\n\t\t\tthis.file = void 0;\n\t\t}\n\t\tthis.enabled = false;\n\t\tthis.editor?.cleanUp();\n\t\tthis.editor = void 0;\n\t}\n\tvirtualizedSetup() {\n\t\tthis.enabled = true;\n\t\tthis.workerManager?.subscribeToThemeChanges(this);\n\t}\n\thydrate(props) {\n\t\tconst { fileContainer, prerenderedHTML, preventEmit = false, file, lineAnnotations } = props;\n\t\tthis.hydrateElements(fileContainer, prerenderedHTML);\n\t\tif (shouldRenderCode(this.pre, file, this.options.collapsed) || shouldRenderHeader(this.headerElement, file, this.options.disableFileHeader)) this.render({\n\t\t\t...props,\n\t\t\tpreventEmit: true\n\t\t});\n\t\telse this.hydrationSetup({\n\t\t\tfile,\n\t\t\tlineAnnotations\n\t\t});\n\t\tif (!preventEmit) this.emitPostRender();\n\t}\n\thydrateElements(fileContainer, prerenderedHTML) {\n\t\tif (this.fileContainer !== fileContainer) this.emitPostRender(true);\n\t\tprerenderHTMLIfNecessary(fileContainer, prerenderedHTML);\n\t\tfor (const element of Array.from(fileContainer.shadowRoot?.children ?? [])) {\n\t\t\tif (element instanceof SVGElement) {\n\t\t\t\tthis.spriteSVG = element;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!(element instanceof HTMLElement)) continue;\n\t\t\tif (element instanceof HTMLPreElement) {\n\t\t\t\tthis.pre = element;\n\t\t\t\tthis.appliedPreAttributes = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (element instanceof HTMLStyleElement && element.hasAttribute(THEME_CSS_ATTRIBUTE)) {\n\t\t\t\tthis.themeCSSStyle = element;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (element instanceof HTMLStyleElement && element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)) {\n\t\t\t\tthis.unsafeCSSStyle = element;\n\t\t\t\tthis.appliedUnsafeCSS = element.textContent;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (\"diffsHeader\" in element.dataset) {\n\t\t\t\tthis.headerElement = element;\n\t\t\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (this.pre != null) {\n\t\t\tthis.syncCodeNodeFromPre(this.pre);\n\t\t\tthis.pre.removeAttribute(\"data-dehydrated\");\n\t\t}\n\t\tthis.fileContainer = fileContainer;\n\t\tthis.hydrateMeasuredScrollbar();\n\t}\n\thydrationSetup({ file, lineAnnotations }) {\n\t\tthis.lineAnnotations = lineAnnotations ?? this.lineAnnotations;\n\t\tthis.file = file;\n\t\tthis.fileRenderer.setOptions(getFileRendererOptions(this.options));\n\t\tthis.syncInteractionOptions();\n\t\tif (this.pre == null) return;\n\t\tthis.fileRenderer.hydrate(file);\n\t\tthis.renderAnnotations();\n\t\tthis.renderGutterUtility();\n\t\tthis.injectUnsafeCSS();\n\t\tthis.managersDirty = true;\n\t\tthis.flushManagers();\n\t}\n\tgetOrCreateLineCache(file = this.file) {\n\t\treturn file != null ? this.fileRenderer.getOrCreateLineCache(file) : EMPTY_STRINGS;\n\t}\n\tupdateBuffers(renderRange) {\n\t\tif (this.pre != null) this.applyBuffers(this.pre, renderRange);\n\t}\n\tsyncRenderView = () => {\n\t\tconst editor = this.editor;\n\t\tconst fileContainer = this.fileContainer;\n\t\tconst file = this.file;\n\t\tif (editor != null && fileContainer != null && file != null) this.fileRenderer.initializeHighlighter().then((highlighter) => {\n\t\t\teditor.__syncRenderView(highlighter, fileContainer, file, this.lineAnnotations, this.renderRange);\n\t\t});\n\t};\n\tattachEditor(editor) {\n\t\tthis.editor?.cleanUp();\n\t\tthis.editor = editor;\n\t\tqueueRender(this.syncRenderView);\n\t\treturn () => {\n\t\t\tthis.editor = void 0;\n\t\t};\n\t}\n\tapplyDocumentChange(textDocument, newLineAnnotations) {\n\t\tthis.fileRenderer.applyDocumentChange(textDocument);\n\t\tif (newLineAnnotations != null && newLineAnnotations !== this.lineAnnotations && this.file != null) {\n\t\t\tthis.setLineAnnotations(newLineAnnotations);\n\t\t\tthis.fileRenderer.setLineAnnotations(this.lineAnnotations);\n\t\t\tthis.renderAnnotations();\n\t\t}\n\t}\n\tupdateRenderCache(dirtyLines, themeType) {\n\t\tthis.fileRenderer.updateRenderCache(dirtyLines, themeType);\n\t}\n\trender({ file, fileContainer, forceRender = false, preventEmit = false, containerWrapper, deferManagers = false, lineAnnotations, renderRange }) {\n\t\tif (!this.enabled) throw new Error(\"File.render: attempting to call render after cleaned up\");\n\t\tthis.editor?.__postponeBackgroundTokenizeToNextFrame();\n\t\tconst { collapsed = false, themeType = \"system\" } = this.options;\n\t\tconst nextRenderRange = collapsed ? void 0 : renderRange;\n\t\tconst previousRenderRange = this.renderRange;\n\t\tconst themeChanged = this.hasThemeChanged();\n\t\tconst annotationsChanged = lineAnnotations != null && (lineAnnotations.length > 0 || this.lineAnnotations.length > 0) ? lineAnnotations !== this.lineAnnotations : false;\n\t\tconst didFileChange = !areFilesEqual(this.file, file);\n\t\tif (!collapsed && !forceRender && areRenderRangesEqual(nextRenderRange, this.renderRange) && !didFileChange && !annotationsChanged && !themeChanged) return this.applyCachedThemeState(themeType);\n\t\tthis.renderRange = nextRenderRange;\n\t\tif (didFileChange) this.cachedHeaderHTML = void 0;\n\t\tthis.file = file;\n\t\tthis.fileRenderer.setOptions(getFileRendererOptions(this.options));\n\t\tthis.syncInteractionOptions();\n\t\tif (lineAnnotations != null) this.setLineAnnotations(lineAnnotations);\n\t\tthis.fileRenderer.setLineAnnotations(this.lineAnnotations);\n\t\tconst { disableErrorHandling = false, disableFileHeader = false } = this.options;\n\t\tif (disableFileHeader) {\n\t\t\tif (this.headerElement != null) {\n\t\t\t\tthis.headerElement.remove();\n\t\t\t\tthis.headerElement = void 0;\n\t\t\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\t\t}\n\t\t\tthis.clearHeaderSlots();\n\t\t}\n\t\tfileContainer = this.getOrCreateFileContainerNode(fileContainer, containerWrapper);\n\t\tthis.applyCachedThemeState(themeType);\n\t\tif (collapsed) {\n\t\t\tthis.removeRenderedCode();\n\t\t\tthis.clearAuxiliaryNodes();\n\t\t\ttry {\n\t\t\t\tconst fileResult = this.fileRenderer.renderFile(file, EMPTY_RENDER_RANGE);\n\t\t\t\tif (fileResult != null) this.applyThemeState(fileContainer, fileResult.themeStyles, themeType, fileResult.baseThemeType);\n\t\t\t\tif (fileResult?.headerAST != null) this.applyHeaderToDOM(fileResult.headerAST, fileContainer);\n\t\t\t\tthis.injectUnsafeCSS();\n\t\t\t} catch (error) {\n\t\t\t\tif (disableErrorHandling) throw error;\n\t\t\t\tconsole.error(error);\n\t\t\t\tif (error instanceof Error) this.applyErrorToDOM(error, fileContainer);\n\t\t\t}\n\t\t\tif (!preventEmit) this.emitPostRender();\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tconst pre = this.getOrCreatePreNode(fileContainer);\n\t\t\tif (!this.canPartiallyRender(forceRender, annotationsChanged, didFileChange || themeChanged) || !this.applyPartialRender(previousRenderRange, nextRenderRange)) {\n\t\t\t\tconst fileResult = this.fileRenderer.renderFile(file, nextRenderRange);\n\t\t\t\tif (fileResult == null) {\n\t\t\t\t\tif (this.workerManager?.isInitialized() === false) this.workerManager.initialize().then(() => this.rerender());\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tthis.applyThemeState(fileContainer, fileResult.themeStyles, themeType, fileResult.baseThemeType);\n\t\t\t\tif (fileResult.headerAST != null) this.applyHeaderToDOM(fileResult.headerAST, fileContainer);\n\t\t\t\tthis.applyFullRender(fileResult, pre);\n\t\t\t}\n\t\t\tthis.applyBuffers(pre, nextRenderRange);\n\t\t\tthis.injectUnsafeCSS();\n\t\t\tthis.managersDirty = true;\n\t\t\tif (!deferManagers) this.flushManagers();\n\t\t\tthis.renderAnnotations();\n\t\t\tthis.renderGutterUtility();\n\t\t\tif (this.editor != null) queueRender(this.syncRenderView);\n\t\t} catch (error) {\n\t\t\tif (disableErrorHandling) throw error;\n\t\t\tconsole.error(error);\n\t\t\tif (error instanceof Error) this.applyErrorToDOM(error, fileContainer);\n\t\t}\n\t\tif (!preventEmit) this.emitPostRender();\n\t\treturn true;\n\t}\n\temitPostRender(unmount = false) {\n\t\tconst { fileContainer, options: { onPostRender } } = this;\n\t\tif (unmount) {\n\t\t\tif (!this.mounted) return;\n\t\t\tthis.mounted = false;\n\t\t\tif (fileContainer == null) return;\n\t\t\tonPostRender?.(fileContainer, this, \"unmount\");\n\t\t\treturn;\n\t\t}\n\t\tif (fileContainer == null) return;\n\t\tconst phase = this.mounted ? \"update\" : \"mount\";\n\t\tthis.mounted = true;\n\t\tonPostRender?.(fileContainer, this, phase);\n\t}\n\tremoveRenderedCode() {\n\t\tthis.resizeManager.cleanUp();\n\t\tthis.interactionManager.cleanUp();\n\t\tthis.bufferBefore?.remove();\n\t\tthis.bufferBefore = void 0;\n\t\tthis.bufferAfter?.remove();\n\t\tthis.bufferAfter = void 0;\n\t\tthis.code?.remove();\n\t\tthis.code = void 0;\n\t\tthis.pre?.remove();\n\t\tthis.pre = void 0;\n\t\tthis.appliedPreAttributes = void 0;\n\t\tthis.lastRowCount = void 0;\n\t}\n\tclearAuxiliaryNodes() {\n\t\tfor (const { element } of this.annotationCache.values()) element.remove();\n\t\tthis.annotationCache.clear();\n\t\tthis.gutterUtilityContent?.remove();\n\t\tthis.gutterUtilityContent = void 0;\n\t}\n\tcanPartiallyRender(forceRender, annotationsChanged, didContentChange) {\n\t\tif (forceRender || annotationsChanged || didContentChange) return false;\n\t\treturn true;\n\t}\n\trenderPlaceholder(height) {\n\t\tif (this.fileContainer == null) return false;\n\t\tthis.emitPostRender(true);\n\t\tthis.cleanChildNodes();\n\t\tif (this.placeHolder == null) {\n\t\t\tconst shadowRoot = this.fileContainer.shadowRoot ?? this.fileContainer.attachShadow({ mode: \"open\" });\n\t\t\tthis.placeHolder = document.createElement(\"div\");\n\t\t\tthis.placeHolder.dataset.placeholder = \"\";\n\t\t\tshadowRoot.appendChild(this.placeHolder);\n\t\t}\n\t\tthis.placeHolder.style.setProperty(\"height\", `${height}px`);\n\t\treturn true;\n\t}\n\tprimeHighlightCache() {\n\t\tconst { file, workerManager } = this;\n\t\tif (file == null || file.cacheKey == null || workerManager == null || isFilePlainText(file)) return;\n\t\tif (this.fileRenderer.getOrCreateLineCache(file).length > (this.options.tokenizeMaxLength ?? DEFAULT_TOKENIZE_MAX_LENGTH)) return;\n\t\tworkerManager.primeFileHighlightCache(file);\n\t}\n\tcleanChildNodes() {\n\t\tthis.resizeManager.cleanUp();\n\t\tthis.interactionManager.cleanUp();\n\t\tthis.bufferAfter?.remove();\n\t\tthis.bufferBefore?.remove();\n\t\tthis.code?.remove();\n\t\tthis.errorWrapper?.remove();\n\t\tthis.headerElement?.remove();\n\t\tthis.gutterUtilityContent?.remove();\n\t\tthis.headerPrefix?.remove();\n\t\tthis.headerMetadata?.remove();\n\t\tthis.headerCustom?.remove();\n\t\tthis.pre?.remove();\n\t\tthis.spriteSVG?.remove();\n\t\tthis.themeCSSStyle?.remove();\n\t\tthis.unsafeCSSStyle?.remove();\n\t\tthis.bufferAfter = void 0;\n\t\tthis.bufferBefore = void 0;\n\t\tthis.code = void 0;\n\t\tthis.errorWrapper = void 0;\n\t\tthis.headerElement = void 0;\n\t\tthis.gutterUtilityContent = void 0;\n\t\tthis.headerPrefix = void 0;\n\t\tthis.headerMetadata = void 0;\n\t\tthis.headerCustom = void 0;\n\t\tthis.pre = void 0;\n\t\tthis.spriteSVG = void 0;\n\t\tthis.themeCSSStyle = void 0;\n\t\tthis.appliedThemeCSS = void 0;\n\t\tthis.hasAdoptedThemeCSS = false;\n\t\tthis.unsafeCSSStyle = void 0;\n\t\tthis.appliedUnsafeCSS = void 0;\n\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\tthis.lastRowCount = void 0;\n\t\tthis.mounted = false;\n\t}\n\trenderAnnotations() {\n\t\tif (this.isContainerManaged || this.fileContainer == null) {\n\t\t\tfor (const { element } of this.annotationCache.values()) element.remove();\n\t\t\tthis.annotationCache.clear();\n\t\t\treturn;\n\t\t}\n\t\tconst staleAnnotations = new Map(this.annotationCache);\n\t\tconst { renderAnnotation } = this.options;\n\t\tif (renderAnnotation != null && this.lineAnnotations.length > 0) for (const [index, annotation] of this.lineAnnotations.entries()) {\n\t\t\tconst id = `${index}-${getLineAnnotationName(annotation)}`;\n\t\t\tlet cache = this.annotationCache.get(id);\n\t\t\tif (cache == null || !areLineAnnotationsEqual(annotation, cache.annotation)) {\n\t\t\t\tcache?.element.remove();\n\t\t\t\tconst content = renderAnnotation(annotation);\n\t\t\t\tif (content == null) continue;\n\t\t\t\tcache = {\n\t\t\t\t\telement: createAnnotationWrapperNode(getLineAnnotationName(annotation)),\n\t\t\t\t\tannotation\n\t\t\t\t};\n\t\t\t\tcache.element.appendChild(content);\n\t\t\t\tthis.fileContainer.appendChild(cache.element);\n\t\t\t\tthis.annotationCache.set(id, cache);\n\t\t\t}\n\t\t\tstaleAnnotations.delete(id);\n\t\t}\n\t\tfor (const [id, { element }] of staleAnnotations.entries()) {\n\t\t\tthis.annotationCache.delete(id);\n\t\t\telement.remove();\n\t\t}\n\t}\n\trenderGutterUtility() {\n\t\tconst { renderGutterUtility } = this.options;\n\t\tif (this.fileContainer == null || renderGutterUtility == null) {\n\t\t\tthis.gutterUtilityContent?.remove();\n\t\t\tthis.gutterUtilityContent = void 0;\n\t\t\treturn;\n\t\t}\n\t\tconst element = renderGutterUtility(this.interactionManager.getHoveredLine);\n\t\tif (element != null && this.gutterUtilityContent != null) return;\n\t\telse if (element == null) {\n\t\t\tthis.gutterUtilityContent?.remove();\n\t\t\tthis.gutterUtilityContent = void 0;\n\t\t\treturn;\n\t\t}\n\t\tconst gutterUtilityContent = createGutterUtilityContentNode();\n\t\tgutterUtilityContent.appendChild(element);\n\t\tthis.fileContainer.appendChild(gutterUtilityContent);\n\t\tthis.gutterUtilityContent = gutterUtilityContent;\n\t}\n\tinjectUnsafeCSS() {\n\t\tconst { unsafeCSS } = this.options;\n\t\tconst shadowRoot = this.fileContainer?.shadowRoot;\n\t\tif (shadowRoot == null) return;\n\t\tif (unsafeCSS == null || unsafeCSS === \"\") {\n\t\t\tif (this.unsafeCSSStyle != null) {\n\t\t\t\tthis.unsafeCSSStyle.remove();\n\t\t\t\tthis.unsafeCSSStyle = void 0;\n\t\t\t}\n\t\t\tthis.appliedUnsafeCSS = void 0;\n\t\t\treturn;\n\t\t}\n\t\tif (this.unsafeCSSStyle?.parentNode === shadowRoot && this.appliedUnsafeCSS === unsafeCSS) return;\n\t\tthis.unsafeCSSStyle ??= createUnsafeCSSStyleNode();\n\t\tif (this.unsafeCSSStyle.parentNode !== shadowRoot) shadowRoot.appendChild(this.unsafeCSSStyle);\n\t\tthis.unsafeCSSStyle.textContent = wrapUnsafeCSS(unsafeCSS);\n\t\tthis.appliedUnsafeCSS = unsafeCSS;\n\t}\n\tapplyThemeState(container, themeStyles, themeType, baseThemeType) {\n\t\tconst shadowRoot = container.shadowRoot ?? container.attachShadow({ mode: \"open\" });\n\t\tconst effectiveThemeType = baseThemeType ?? themeType;\n\t\tconst currentTheme = this.options.theme ?? DEFAULT_THEMES;\n\t\tconst theme = typeof currentTheme === \"string\" ? currentTheme : { ...currentTheme };\n\t\tconst scrollbarGutter = getMeasuredScrollbarGutter(shadowRoot);\n\t\tif (this.themeCSSStyle?.parentNode === shadowRoot && this.appliedThemeCSS?.themeStyles === themeStyles && this.appliedThemeCSS.themeType === effectiveThemeType && this.appliedThemeCSS.scrollbarGutter === scrollbarGutter) {\n\t\t\tthis.appliedThemeCSS.theme = theme;\n\t\t\treturn;\n\t\t}\n\t\tif (this.hasAdoptedThemeCSS && this.themeCSSStyle?.parentNode === shadowRoot) {\n\t\t\tthis.hasAdoptedThemeCSS = false;\n\t\t\tthis.appliedThemeCSS = {\n\t\t\t\ttheme,\n\t\t\t\tthemeStyles,\n\t\t\t\tthemeType: effectiveThemeType,\n\t\t\t\tbaseThemeType,\n\t\t\t\tscrollbarGutter\n\t\t\t};\n\t\t\treturn;\n\t\t}\n\t\tthis.themeCSSStyle = upsertHostThemeStyle({\n\t\t\tshadowRoot,\n\t\t\tcurrentNode: this.themeCSSStyle,\n\t\t\tthemeCSS: wrapThemeCSS(themeStyles, effectiveThemeType, scrollbarGutter)\n\t\t});\n\t\tthis.appliedThemeCSS = this.themeCSSStyle != null ? {\n\t\t\ttheme,\n\t\t\tthemeStyles,\n\t\t\tthemeType: effectiveThemeType,\n\t\t\tbaseThemeType,\n\t\t\tscrollbarGutter\n\t\t} : void 0;\n\t}\n\thydrateMeasuredScrollbar() {\n\t\tconst shadowRoot = this.fileContainer?.shadowRoot;\n\t\tif (shadowRoot == null || this.themeCSSStyle == null) return;\n\t\tthis.themeCSSStyle.textContent = patchScrollbarGutterSize(this.themeCSSStyle.textContent ?? \"\", getMeasuredScrollbarGutter(shadowRoot));\n\t}\n\tapplyFullRender(result, pre) {\n\t\tthis.cleanupErrorWrapper();\n\t\tthis.applyPreNodeAttributes(pre, result);\n\t\tthis.code = getOrCreateCodeNode({ code: this.code });\n\t\tconst codeAst = this.fileRenderer.renderCodeAST(result);\n\t\tif (this.code.childElementCount >= 2) for (let i = 0; i < 2; i++) {\n\t\t\tconst domEl = this.code.children[i];\n\t\t\tconst astEl = codeAst[i];\n\t\t\tdomEl.innerHTML = toHtml(astEl.children);\n\t\t\tdomEl.style.cssText = astEl.properties.style;\n\t\t}\n\t\telse this.code.innerHTML = toHtml(codeAst);\n\t\tif (!pre.contains(this.code)) pre.replaceChildren(this.code);\n\t\tthis.lastRowCount = result.rowCount;\n\t}\n\tapplyPartialRender(previousRenderRange, renderRange) {\n\t\tif (previousRenderRange == null || renderRange == null) return false;\n\t\tconst { file, code } = this;\n\t\tconst columns = code != null ? this.getColumns(code) : void 0;\n\t\tif (file == null || code == null || columns == null) return false;\n\t\tconst previousStart = previousRenderRange.startingLine;\n\t\tconst nextStart = renderRange.startingLine;\n\t\tconst previousEnd = previousRenderRange.totalLines === Infinity ? Number.POSITIVE_INFINITY : previousStart + previousRenderRange.totalLines;\n\t\tconst nextEnd = renderRange.totalLines === Infinity ? Number.POSITIVE_INFINITY : nextStart + renderRange.totalLines;\n\t\tconst overlapStart = Math.max(previousStart, nextStart);\n\t\tconst overlapEnd = Math.min(previousEnd, nextEnd);\n\t\tif (overlapEnd <= overlapStart) return false;\n\t\tif (!this.trimDOMToOverlap(columns.gutter, overlapStart, overlapEnd) || !this.trimDOMToOverlap(columns.content, overlapStart, overlapEnd)) return false;\n\t\tlet { length: rowCount } = columns.content.children;\n\t\tconst renderChunk = (startingLine, totalLines) => {\n\t\t\tif (totalLines <= 0) return;\n\t\t\treturn this.fileRenderer.renderFile(file, {\n\t\t\t\tstartingLine,\n\t\t\t\ttotalLines,\n\t\t\t\tbufferBefore: 0,\n\t\t\t\tbufferAfter: 0\n\t\t\t});\n\t\t};\n\t\tconst prependResult = nextStart < overlapStart ? renderChunk(nextStart, overlapStart - nextStart) : void 0;\n\t\tif (prependResult === void 0 && nextStart < overlapStart) return false;\n\t\tconst appendTotalLines = nextEnd === Number.POSITIVE_INFINITY ? Number.POSITIVE_INFINITY : Math.max(0, nextEnd - overlapEnd);\n\t\tconst appendResult = nextEnd > overlapEnd ? renderChunk(overlapEnd, appendTotalLines) : void 0;\n\t\tif (appendResult === void 0 && nextEnd > overlapEnd) return false;\n\t\tthis.cleanupErrorWrapper();\n\t\tif (prependResult != null) {\n\t\t\tcolumns.gutter.insertAdjacentHTML(\"afterbegin\", this.fileRenderer.renderPartialHTML(prependResult.gutterAST));\n\t\t\tcolumns.content.insertAdjacentHTML(\"afterbegin\", this.fileRenderer.renderPartialHTML(prependResult.contentAST));\n\t\t\trowCount += prependResult.rowCount;\n\t\t}\n\t\tif (appendResult != null) {\n\t\t\tcolumns.gutter.insertAdjacentHTML(\"beforeend\", this.fileRenderer.renderPartialHTML(appendResult.gutterAST));\n\t\t\tcolumns.content.insertAdjacentHTML(\"beforeend\", this.fileRenderer.renderPartialHTML(appendResult.contentAST));\n\t\t\trowCount += appendResult.rowCount;\n\t\t}\n\t\tif (this.lastRowCount !== rowCount) {\n\t\t\tcolumns.gutter.style.setProperty(\"grid-row\", `span ${rowCount}`);\n\t\t\tcolumns.content.style.setProperty(\"grid-row\", `span ${rowCount}`);\n\t\t\tthis.lastRowCount = rowCount;\n\t\t}\n\t\treturn true;\n\t}\n\tgetColumns(code) {\n\t\tconst gutter = code.children[0];\n\t\tconst content = code.children[1];\n\t\tif (!(gutter instanceof HTMLElement) || !(content instanceof HTMLElement) || gutter.dataset.gutter == null || content.dataset.content == null) return;\n\t\treturn {\n\t\t\tgutter,\n\t\t\tcontent\n\t\t};\n\t}\n\ttrimDOMToOverlap(container, overlapStart, overlapEnd) {\n\t\tconst boundaryIndices = this.getDOMBoundaryIndices(container, [overlapStart, overlapEnd]);\n\t\tconst startIndex = boundaryIndices.get(overlapStart) ?? container.children.length;\n\t\tconst endIndex = boundaryIndices.get(overlapEnd) ?? container.children.length;\n\t\tif (startIndex > endIndex) return false;\n\t\tfor (let i = container.children.length - 1; i >= endIndex; i -= 1) container.children[i]?.remove();\n\t\tfor (let i = startIndex - 1; i >= 0; i -= 1) container.children[i]?.remove();\n\t\treturn true;\n\t}\n\tgetDOMBoundaryIndices(container, boundaries) {\n\t\tconst sortedBoundaries = [...new Set(boundaries)].sort((a, b) => a - b);\n\t\tconst boundaryIndices = /* @__PURE__ */ new Map();\n\t\tif (sortedBoundaries.length === 0) return boundaryIndices;\n\t\tlet boundaryIndex = 0;\n\t\tlet nextBoundary = sortedBoundaries[boundaryIndex];\n\t\tconst { children } = container;\n\t\tif (nextBoundary === 0) {\n\t\t\tboundaryIndices.set(0, 0);\n\t\t\tboundaryIndex += 1;\n\t\t\tnextBoundary = sortedBoundaries[boundaryIndex];\n\t\t}\n\t\tfor (let i = 0; i < children.length; i += 1) {\n\t\t\tconst child = children[i];\n\t\t\tif (!(child instanceof HTMLElement)) continue;\n\t\t\tconst lineIndex = this.getLineIndexFromDOMNode(child);\n\t\t\tif (lineIndex == null) continue;\n\t\t\twhile (nextBoundary != null && lineIndex >= nextBoundary) {\n\t\t\t\tboundaryIndices.set(nextBoundary, i);\n\t\t\t\tboundaryIndex += 1;\n\t\t\t\tnextBoundary = sortedBoundaries[boundaryIndex];\n\t\t\t}\n\t\t\tif (boundaryIndex >= sortedBoundaries.length) break;\n\t\t}\n\t\tfor (const boundary of sortedBoundaries) if (!boundaryIndices.has(boundary)) boundaryIndices.set(boundary, children.length);\n\t\treturn boundaryIndices;\n\t}\n\tgetLineIndexFromDOMNode(node) {\n\t\tconst lineIndexAttr = node.dataset.lineIndex;\n\t\tif (lineIndexAttr == null) return;\n\t\tconst parsed = Number(lineIndexAttr);\n\t\treturn Number.isNaN(parsed) ? void 0 : parsed;\n\t}\n\tapplyBuffers(pre, renderRange) {\n\t\tif (renderRange == null || this.shouldDisableVirtualizationBuffers()) {\n\t\t\tif (this.bufferBefore != null) {\n\t\t\t\tthis.bufferBefore.remove();\n\t\t\t\tthis.bufferBefore = void 0;\n\t\t\t}\n\t\t\tif (this.bufferAfter != null) {\n\t\t\t\tthis.bufferAfter.remove();\n\t\t\t\tthis.bufferAfter = void 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (renderRange.bufferBefore > 0) {\n\t\t\tif (this.bufferBefore == null) {\n\t\t\t\tthis.bufferBefore = document.createElement(\"div\");\n\t\t\t\tthis.bufferBefore.dataset.virtualizerBuffer = \"before\";\n\t\t\t\tpre.before(this.bufferBefore);\n\t\t\t}\n\t\t\tthis.bufferBefore.style.setProperty(\"height\", `${renderRange.bufferBefore}px`);\n\t\t\tthis.bufferBefore.style.setProperty(\"contain\", \"strict\");\n\t\t} else if (this.bufferBefore != null) {\n\t\t\tthis.bufferBefore.remove();\n\t\t\tthis.bufferBefore = void 0;\n\t\t}\n\t\tif (renderRange.bufferAfter > 0) {\n\t\t\tif (this.bufferAfter == null) {\n\t\t\t\tthis.bufferAfter = document.createElement(\"div\");\n\t\t\t\tthis.bufferAfter.dataset.virtualizerBuffer = \"after\";\n\t\t\t\tpre.after(this.bufferAfter);\n\t\t\t}\n\t\t\tthis.bufferAfter.style.setProperty(\"height\", `${renderRange.bufferAfter}px`);\n\t\t\tthis.bufferAfter.style.setProperty(\"contain\", \"strict\");\n\t\t} else if (this.bufferAfter != null) {\n\t\t\tthis.bufferAfter.remove();\n\t\t\tthis.bufferAfter = void 0;\n\t\t}\n\t}\n\tshouldDisableVirtualizationBuffers() {\n\t\treturn this.options.disableVirtualizationBuffers ?? false;\n\t}\n\tapplyHeaderToDOM(headerAST, container) {\n\t\tconst { file } = this;\n\t\tif (file == null) return;\n\t\tthis.cleanupErrorWrapper();\n\t\tthis.placeHolder?.remove();\n\t\tthis.placeHolder = void 0;\n\t\tconst headerHTML = this.cachedHeaderHTML ?? toHtml(headerAST);\n\t\tthis.cachedHeaderHTML = headerHTML;\n\t\tif (headerHTML !== this.lastRenderedHeaderHTML) {\n\t\t\tconst tempDiv = document.createElement(\"div\");\n\t\t\ttempDiv.innerHTML = headerHTML;\n\t\t\tconst newHeader = tempDiv.firstElementChild;\n\t\t\tif (!(newHeader instanceof HTMLElement)) return;\n\t\t\tif (this.headerElement != null) container.shadowRoot?.replaceChild(newHeader, this.headerElement);\n\t\t\telse container.shadowRoot?.prepend(newHeader);\n\t\t\tthis.headerElement = newHeader;\n\t\t\tthis.lastRenderedHeaderHTML = headerHTML;\n\t\t}\n\t\tif (this.isContainerManaged) return;\n\t\tconst { renderHeaderPrefix, renderCustomHeader, renderHeaderMetadata } = this.options;\n\t\tif (renderCustomHeader != null) {\n\t\t\tconst content = renderCustomHeader(file) ?? void 0;\n\t\t\tthis.headerCustom = this.upsertHeaderSlotElement(container, this.headerCustom, CUSTOM_HEADER_SLOT_ID, content);\n\t\t\tthis.headerPrefix?.remove();\n\t\t\tthis.headerMetadata?.remove();\n\t\t\tthis.headerPrefix = void 0;\n\t\t\tthis.headerMetadata = void 0;\n\t\t} else {\n\t\t\tconst prefix = renderHeaderPrefix?.(file) ?? void 0;\n\t\t\tconst content = renderHeaderMetadata?.(file) ?? void 0;\n\t\t\tthis.headerPrefix = this.upsertHeaderSlotElement(container, this.headerPrefix, HEADER_PREFIX_SLOT_ID, prefix);\n\t\t\tthis.headerMetadata = this.upsertHeaderSlotElement(container, this.headerMetadata, HEADER_METADATA_SLOT_ID, content);\n\t\t\tthis.headerCustom?.remove();\n\t\t\tthis.headerCustom = void 0;\n\t\t}\n\t}\n\tclearHeaderSlots() {\n\t\tthis.headerPrefix?.remove();\n\t\tthis.headerMetadata?.remove();\n\t\tthis.headerCustom?.remove();\n\t\tthis.headerPrefix = void 0;\n\t\tthis.headerMetadata = void 0;\n\t\tthis.headerCustom = void 0;\n\t}\n\tupsertHeaderSlotElement(container, current, slot, content) {\n\t\tif (content == null) {\n\t\t\tcurrent?.remove();\n\t\t\treturn;\n\t\t}\n\t\tconst element = current ?? this.createHeaderSlotElement(slot);\n\t\tif (current == null) container.appendChild(element);\n\t\tthis.replaceHeaderSlotContent(element, content);\n\t\treturn element;\n\t}\n\treplaceHeaderSlotContent(element, content) {\n\t\telement.replaceChildren();\n\t\tif (content instanceof Element) element.appendChild(content);\n\t\telse element.innerText = `${content}`;\n\t}\n\tcreateHeaderSlotElement(slot) {\n\t\tconst element = document.createElement(\"div\");\n\t\telement.slot = slot;\n\t\treturn element;\n\t}\n\tgetOrCreateFileContainerNode(fileContainer, parentNode) {\n\t\tconst { fileContainer: previousContainer } = this;\n\t\tconst nextContainer = fileContainer ?? previousContainer ?? document.createElement(DIFFS_TAG_NAME);\n\t\tconst containerChanged = previousContainer !== nextContainer;\n\t\tif (containerChanged) this.emitPostRender(true);\n\t\tthis.fileContainer = nextContainer;\n\t\tif (previousContainer != null && containerChanged) {\n\t\t\tthis.lastRenderedHeaderHTML = void 0;\n\t\t\tthis.headerElement = void 0;\n\t\t}\n\t\tif (parentNode != null && this.fileContainer.parentNode !== parentNode) parentNode.appendChild(this.fileContainer);\n\t\tif (containerChanged) this.adoptReusableShellElements(this.fileContainer);\n\t\tthis.ensureSpriteSVG(this.fileContainer);\n\t\treturn this.fileContainer;\n\t}\n\tadoptReusableShellElements(fileContainer) {\n\t\tconst { shadowRoot } = fileContainer;\n\t\tif (shadowRoot == null) return;\n\t\tfor (const element of shadowRoot.children) if (element instanceof SVGElement) this.spriteSVG ??= element;\n\t\telse if (isStyleNode(element) && element.hasAttribute(THEME_CSS_ATTRIBUTE)) {\n\t\t\tthis.themeCSSStyle ??= element;\n\t\t\tthis.hasAdoptedThemeCSS = true;\n\t\t} else if (isStyleNode(element) && element.hasAttribute(UNSAFE_CSS_ATTRIBUTE)) {\n\t\t\tthis.unsafeCSSStyle ??= element;\n\t\t\tthis.appliedUnsafeCSS ??= this.options.unsafeCSS ?? void 0;\n\t\t}\n\t}\n\tensureSpriteSVG(fileContainer) {\n\t\tconst shadowRoot = fileContainer.shadowRoot ?? fileContainer.attachShadow({ mode: \"open\" });\n\t\tif (this.spriteSVG == null) {\n\t\t\tconst fragment = document.createElement(\"div\");\n\t\t\tfragment.innerHTML = SVGSpriteSheet;\n\t\t\tconst firstChild = fragment.firstChild;\n\t\t\tif (firstChild instanceof SVGElement) this.spriteSVG = firstChild;\n\t\t}\n\t\tif (this.spriteSVG != null && this.spriteSVG.parentNode !== shadowRoot) shadowRoot.appendChild(this.spriteSVG);\n\t}\n\tgetOrCreatePreNode(container) {\n\t\tconst shadowRoot = container.shadowRoot ?? container.attachShadow({ mode: \"open\" });\n\t\tif (this.pre == null) {\n\t\t\tthis.pre = document.createElement(\"pre\");\n\t\t\tthis.appliedPreAttributes = void 0;\n\t\t\tthis.code = void 0;\n\t\t\tshadowRoot.appendChild(this.pre);\n\t\t} else if (this.pre.parentNode !== shadowRoot) {\n\t\t\tcontainer.shadowRoot?.appendChild(this.pre);\n\t\t\tthis.appliedPreAttributes = void 0;\n\t\t}\n\t\tthis.placeHolder?.remove();\n\t\tthis.placeHolder = void 0;\n\t\treturn this.pre;\n\t}\n\tsyncCodeNodeFromPre(pre) {\n\t\tthis.code = void 0;\n\t\tfor (const child of Array.from(pre.children)) {\n\t\t\tif (!(child instanceof HTMLElement)) continue;\n\t\t\tif (child.hasAttribute(\"data-code\")) {\n\t\t\t\tthis.code = child;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\tapplyPreNodeAttributes(pre, { totalLines }) {\n\t\tconst { overflow = \"scroll\", disableLineNumbers = false } = this.options;\n\t\tconst preProperties = {\n\t\t\ttype: \"file\",\n\t\t\tsplit: false,\n\t\t\toverflow,\n\t\t\tdisableLineNumbers,\n\t\t\tdiffIndicators: \"none\",\n\t\t\tdisableBackground: true,\n\t\t\ttotalLines\n\t\t};\n\t\tif (arePrePropertiesEqual(preProperties, this.appliedPreAttributes)) return;\n\t\tsetPreNodeProperties(pre, preProperties);\n\t\tthis.appliedPreAttributes = preProperties;\n\t}\n\tapplyErrorToDOM(error, container) {\n\t\tthis.cleanupErrorWrapper();\n\t\tthis.pre?.remove();\n\t\tthis.pre = void 0;\n\t\tthis.appliedPreAttributes = void 0;\n\t\tconst shadowRoot = container.shadowRoot ?? container.attachShadow({ mode: \"open\" });\n\t\tthis.errorWrapper ??= document.createElement(\"div\");\n\t\tthis.errorWrapper.dataset.errorWrapper = \"\";\n\t\tthis.errorWrapper.textContent = \"\";\n\t\tshadowRoot.appendChild(this.errorWrapper);\n\t\tconst errorMessage = document.createElement(\"div\");\n\t\terrorMessage.dataset.errorMessage = \"\";\n\t\terrorMessage.innerText = error.message;\n\t\tthis.errorWrapper.appendChild(errorMessage);\n\t\tconst errorStack = document.createElement(\"pre\");\n\t\terrorStack.dataset.errorStack = \"\";\n\t\terrorStack.innerText = error.stack ?? \"No Error Stack\";\n\t\tthis.errorWrapper.appendChild(errorStack);\n\t}\n\tcleanupErrorWrapper() {\n\t\tthis.errorWrapper?.remove();\n\t\tthis.errorWrapper = void 0;\n\t}\n};\nfunction shouldRenderCode(pre, file, collapsed = false) {\n\treturn !collapsed && pre == null && file != null;\n}\nfunction shouldRenderHeader(headerElement, file, disableFileHeader = false) {\n\treturn headerElement == null && file != null && !disableFileHeader;\n}\n\n//#endregion\nexport { File };\n//# sourceMappingURL=File.js.map","import { DEFAULT_VIRTUAL_FILE_METRICS } from \"../constants.js\";\nimport { areObjectsEqual } from \"../utils/areObjectsEqual.js\";\nimport { areOptionsEqual } from \"../utils/areOptionsEqual.js\";\nimport { areFilesEqual } from \"../utils/areFilesEqual.js\";\nimport { getVirtualFileHeaderRegion, getVirtualFilePaddingBottom } from \"../utils/computeVirtualFileMetrics.js\";\nimport { FILE_ANNOTATION_DOM_KEY, FILE_ANNOTATION_LINE_NUMBER, includesFileAnnotations, shouldRenderFileAnnotations } from \"../utils/includesFileAnnotations.js\";\nimport { File } from \"./File.js\";\n\n//#region src/components/VirtualizedFile.ts\nconst LAYOUT_CHECKPOINT_INTERVAL = 5e3;\nlet instanceId = -1;\nfunction hasFileLayoutOptionChanged(previousOptions, nextOptions) {\n\treturn (previousOptions.overflow ?? \"scroll\") !== (nextOptions.overflow ?? \"scroll\") || (previousOptions.collapsed ?? false) !== (nextOptions.collapsed ?? false) || (previousOptions.disableLineNumbers ?? false) !== (nextOptions.disableLineNumbers ?? false) || (previousOptions.disableFileHeader ?? false) !== (nextOptions.disableFileHeader ?? false) || previousOptions.unsafeCSS !== nextOptions.unsafeCSS;\n}\nvar VirtualizedFile = class extends File {\n\t__id = `virtualized-file:${++instanceId}`;\n\ttop;\n\theight = 0;\n\tcache = {\n\t\theights: /* @__PURE__ */ new Map(),\n\t\tcheckpoints: [],\n\t\tfileAnnotationHeight: 0\n\t};\n\tisVisible = false;\n\tisSetup = false;\n\tlayoutDirty = true;\n\tforceRenderOverride;\n\tcurrentCollapsed;\n\tconstructor(options, virtualizer, metrics = DEFAULT_VIRTUAL_FILE_METRICS, workerManager, isContainerManaged = false) {\n\t\tsuper(options, workerManager, isContainerManaged);\n\t\tthis.virtualizer = virtualizer;\n\t\tthis.metrics = metrics;\n\t}\n\tsetMetrics(metrics, force = false) {\n\t\tif (!force && areObjectsEqual(this.metrics, metrics)) return;\n\t\tthis.metrics = metrics;\n\t\tthis.resetLayoutCache();\n\t}\n\tsetLineAnnotations(lineAnnotations) {\n\t\tif (this.syncLineAnnotations(lineAnnotations)) this.resetLayoutCache();\n\t}\n\tsyncLineAnnotations(lineAnnotations) {\n\t\tif (lineAnnotations == null || lineAnnotations === this.lineAnnotations) return false;\n\t\tif (lineAnnotations.length === 0 && this.lineAnnotations.length === 0) return false;\n\t\tsuper.setLineAnnotations(lineAnnotations);\n\t\treturn true;\n\t}\n\thasLineAnnotations() {\n\t\treturn this.lineAnnotations.some((annotation) => annotation.lineNumber > FILE_ANNOTATION_LINE_NUMBER);\n\t}\n\tgetLineHeight(lineIndex, hasMetadataLine = false) {\n\t\tconst cached = this.cache.heights.get(lineIndex);\n\t\tif (cached != null) return cached;\n\t\tconst multiplier = hasMetadataLine ? 2 : 1;\n\t\treturn this.metrics.lineHeight * multiplier;\n\t}\n\tsetOptions(options) {\n\t\tif (this.isAdvancedMode()) throw new Error(\"VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.\");\n\t\tif (options == null) return;\n\t\tconst { options: previousOptions } = this;\n\t\tconst optionsChanged = !areOptionsEqual(previousOptions, options);\n\t\tconst layoutChanged = hasFileLayoutOptionChanged(previousOptions, options);\n\t\tsuper.setOptions(options);\n\t\tif (layoutChanged) this.resetLayoutCache(true);\n\t\tif (optionsChanged) this.forceRenderOverride = true;\n\t\tif (optionsChanged) this.virtualizer.instanceChanged(this, layoutChanged);\n\t}\n\tsetThemeType(themeType) {\n\t\tif (this.isAdvancedMode()) throw new Error(\"VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.\");\n\t\tsuper.setThemeType(themeType);\n\t}\n\tresetLayoutCache(recompute = false) {\n\t\tthis.layoutDirty = true;\n\t\tthis.cache.fileAnnotationHeight = 0;\n\t\tif (this.cache.heights.size > 0) this.cache.heights.clear();\n\t\tif (this.cache.checkpoints.length > 0) this.cache.checkpoints.length = 0;\n\t\tif (this.renderRange != null) this.renderRange = void 0;\n\t\tif (recompute && this.isSimpleMode()) this.computeApproximateSize();\n\t}\n\treconcileHeights() {\n\t\tlet hasHeightChange = false;\n\t\tif (this.fileContainer == null || this.file == null) {\n\t\t\tif (this.height !== 0) hasHeightChange = true;\n\t\t\tthis.height = 0;\n\t\t\treturn hasHeightChange;\n\t\t}\n\t\tconst { overflow = \"scroll\" } = this.options;\n\t\tthis.top = this.getVirtualizedTop();\n\t\tif (overflow === \"scroll\" && this.lineAnnotations.length === 0 && !this.isResizeDebuggingEnabled()) return hasHeightChange;\n\t\tif (this.code == null) return hasHeightChange;\n\t\tconst content = this.code.children[1];\n\t\tif (!(content instanceof HTMLElement)) return hasHeightChange;\n\t\tconst hasFileAnnotations = includesFileAnnotations(this.lineAnnotations);\n\t\tif (this.renderRange != null && hasFileAnnotations && shouldRenderFileAnnotations(this.renderRange)) {\n\t\t\tconst nextFileAnnotationHeight = measureFileAnnotationHeight(content) ?? 0;\n\t\t\tif (nextFileAnnotationHeight !== this.cache.fileAnnotationHeight) {\n\t\t\t\tthis.cache.fileAnnotationHeight = nextFileAnnotationHeight;\n\t\t\t\thasHeightChange = true;\n\t\t\t}\n\t\t} else if (!hasFileAnnotations && this.cache.fileAnnotationHeight !== 0) {\n\t\t\tthis.cache.fileAnnotationHeight = 0;\n\t\t\thasHeightChange = true;\n\t\t}\n\t\tfor (const line of content.children) {\n\t\t\tif (!(line instanceof HTMLElement)) continue;\n\t\t\tconst lineIndexAttr = line.dataset.lineIndex;\n\t\t\tif (lineIndexAttr == null) continue;\n\t\t\tconst lineIndex = Number(lineIndexAttr);\n\t\t\tlet measuredHeight = line.getBoundingClientRect().height;\n\t\t\tlet hasMetadata = false;\n\t\t\tif (line.nextElementSibling instanceof HTMLElement && (\"lineAnnotation\" in line.nextElementSibling.dataset || \"noNewline\" in line.nextElementSibling.dataset)) {\n\t\t\t\tif (\"noNewline\" in line.nextElementSibling.dataset) hasMetadata = true;\n\t\t\t\tmeasuredHeight += line.nextElementSibling.getBoundingClientRect().height;\n\t\t\t}\n\t\t\tconst expectedHeight = this.getLineHeight(lineIndex, hasMetadata);\n\t\t\tif (measuredHeight === expectedHeight) continue;\n\t\t\thasHeightChange = true;\n\t\t\tif (measuredHeight === this.metrics.lineHeight * (hasMetadata ? 2 : 1)) this.cache.heights.delete(lineIndex);\n\t\t\telse this.cache.heights.set(lineIndex, measuredHeight);\n\t\t}\n\t\tif (hasHeightChange || this.isResizeDebuggingEnabled()) this.computeApproximateSize(true);\n\t\treturn hasHeightChange;\n\t}\n\tonRender = (dirty) => {\n\t\tif (this.fileContainer == null || this.file == null) return false;\n\t\tif (dirty) this.top = this.getVirtualizedTop();\n\t\treturn this.render({ file: this.file });\n\t};\n\tprepareCodeViewItem(file, top, reset, lineAnnotations) {\n\t\tconst annotationsChanged = this.syncLineAnnotations(lineAnnotations);\n\t\tlet shouldResetLayoutCache = reset?.resetFileLayoutCache === true || annotationsChanged;\n\t\tif (reset?.metrics != null) {\n\t\t\tthis.metrics = reset.metrics;\n\t\t\tshouldResetLayoutCache = true;\n\t\t}\n\t\tconst { collapsed = false } = this.options;\n\t\tif (this.currentCollapsed !== collapsed) {\n\t\t\tthis.currentCollapsed = collapsed;\n\t\t\tshouldResetLayoutCache = true;\n\t\t}\n\t\tif (shouldResetLayoutCache) this.resetLayoutCache();\n\t\tif (this.file !== file) this.layoutDirty = true;\n\t\tthis.file = file;\n\t\tthis.top = top;\n\t\tthis.computeApproximateSize();\n\t\treturn this.height;\n\t}\n\tgetLinePosition(lineNumber) {\n\t\tif (this.file == null || lineNumber < 1) return;\n\t\tconst { disableFileHeader = false, collapsed = false } = this.options;\n\t\tconst lastLineIndex = this.fileRenderer.getLineCount(this.file) - 1;\n\t\tlet top = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tif (collapsed || lastLineIndex < 0) return {\n\t\t\ttop,\n\t\t\theight: 0\n\t\t};\n\t\tconst clampedLineIndex = Math.min(Math.max(lineNumber - 1, 0), lastLineIndex);\n\t\tconst { overflow = \"scroll\" } = this.options;\n\t\tconst { lineHeight } = this.metrics;\n\t\ttop += this.cache.fileAnnotationHeight;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) return {\n\t\t\ttop: top + clampedLineIndex * lineHeight,\n\t\t\theight: lineHeight\n\t\t};\n\t\tconst checkpoint = this.getLayoutCheckpointBeforeLineIndex(clampedLineIndex);\n\t\ttop = checkpoint?.top ?? top;\n\t\tfor (let lineIndex = checkpoint?.lineIndex ?? 0; lineIndex < clampedLineIndex; lineIndex++) top += this.getLineHeight(lineIndex, false);\n\t\treturn {\n\t\t\ttop,\n\t\t\theight: this.getLineHeight(clampedLineIndex, false)\n\t\t};\n\t}\n\tgetNumericScrollAnchor(localViewportTop) {\n\t\tif (this.file == null || this.renderRange == null) return;\n\t\tconst { disableFileHeader = false, collapsed = false, overflow = \"scroll\" } = this.options;\n\t\tif (collapsed || this.renderRange.totalLines <= 0) return;\n\t\tconst lastLineIndex = this.fileRenderer.getLineCount(this.file) - 1;\n\t\tif (lastLineIndex < 0) return;\n\t\tconst headerRegion = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tconst firstRenderedLineIndex = Math.min(this.renderRange.startingLine, lastLineIndex);\n\t\tconst lastRenderedLineIndex = Math.min(firstRenderedLineIndex + this.renderRange.totalLines - 1, lastLineIndex);\n\t\tif (lastRenderedLineIndex < firstRenderedLineIndex) return;\n\t\tconst { fileAnnotationHeight } = this.cache;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) {\n\t\t\tconst { lineHeight } = this.metrics;\n\t\t\tconst firstRenderedLineTop = headerRegion + (firstRenderedLineIndex === 0 ? fileAnnotationHeight : this.renderRange.bufferBefore);\n\t\t\tconst lineIndex = firstRenderedLineIndex + Math.max(Math.ceil((localViewportTop - firstRenderedLineTop) / lineHeight), 0);\n\t\t\tif (lineIndex > lastRenderedLineIndex) return;\n\t\t\treturn {\n\t\t\t\tlineNumber: lineIndex + 1,\n\t\t\t\ttop: headerRegion + fileAnnotationHeight + lineIndex * lineHeight\n\t\t\t};\n\t\t}\n\t\tlet top = headerRegion + (firstRenderedLineIndex === 0 ? fileAnnotationHeight : this.renderRange.bufferBefore);\n\t\tfor (let lineIndex = firstRenderedLineIndex; lineIndex <= lastRenderedLineIndex; lineIndex++) {\n\t\t\tif (top >= localViewportTop) return {\n\t\t\t\tlineNumber: lineIndex + 1,\n\t\t\t\ttop\n\t\t\t};\n\t\t\ttop += this.getLineHeight(lineIndex);\n\t\t}\n\t}\n\tgetVirtualizedHeight() {\n\t\treturn this.height;\n\t}\n\tgetAdvancedStickySpecs(windowSpecs) {\n\t\tif (this.top == null || this.file == null) return;\n\t\tif (this.options.collapsed === true) return {\n\t\t\ttopOffset: this.top,\n\t\t\theight: this.height\n\t\t};\n\t\tconst renderRange = windowSpecs != null ? this.computeRenderRangeFromWindow(this.file, this.top, windowSpecs) : this.renderRange;\n\t\tif (renderRange == null) return;\n\t\tconst { bufferBefore, bufferAfter, totalLines } = renderRange;\n\t\tlet headerOnlyOffset = 0;\n\t\tif (totalLines === 0) {\n\t\t\tconst activeWindow = windowSpecs ?? this.virtualizer.getWindowSpecs();\n\t\t\tif (this.top < activeWindow.top) headerOnlyOffset = bufferAfter;\n\t\t}\n\t\treturn {\n\t\t\ttopOffset: this.top + bufferBefore + headerOnlyOffset,\n\t\t\theight: this.height - (bufferBefore + bufferAfter)\n\t\t};\n\t}\n\tcleanUp(recycle = false) {\n\t\tif (this.fileContainer != null && this.isSimpleMode()) this.getSimpleVirtualizer()?.disconnect(this.fileContainer);\n\t\tif (!recycle) this.resetLayoutCache();\n\t\tthis.isSetup = false;\n\t\tsuper.cleanUp(recycle);\n\t}\n\tcomputeApproximateSize(force = false) {\n\t\tconst shouldValidateSize = this.isResizeDebuggingEnabled();\n\t\tif (!force && !this.layoutDirty && !shouldValidateSize) return;\n\t\tconst isFirstCompute = this.height === 0;\n\t\tthis.height = 0;\n\t\tthis.cache.checkpoints = [];\n\t\tif (this.file == null) {\n\t\t\tthis.layoutDirty = false;\n\t\t\treturn;\n\t\t}\n\t\tconst { disableFileHeader = false, collapsed = false, overflow = \"scroll\" } = this.options;\n\t\tconst { lineHeight } = this.metrics;\n\t\tconst lineCount = this.fileRenderer.getLineCount(this.file);\n\t\tconst headerRegion = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tconst paddingBottom = getVirtualFilePaddingBottom(this.metrics);\n\t\tthis.height += headerRegion;\n\t\tif (collapsed) {\n\t\t\tthis.layoutDirty = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.height += this.cache.fileAnnotationHeight;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) this.height += lineCount * lineHeight;\n\t\telse for (let lineIndex = 0; lineIndex < lineCount; lineIndex++) {\n\t\t\tthis.addLayoutCheckpoint(lineIndex, this.height);\n\t\t\tthis.height += this.getLineHeight(lineIndex, false);\n\t\t}\n\t\tif (lineCount > 0) this.height += paddingBottom;\n\t\tif (this.fileContainer != null && shouldValidateSize && !isFirstCompute) {\n\t\t\tconst rect = this.fileContainer.getBoundingClientRect();\n\t\t\tif (rect.height !== this.height) console.log(\"VirtualizedFile.computeApproximateSize: computed height doesnt match\", {\n\t\t\t\tname: this.file.name,\n\t\t\t\telementHeight: rect.height,\n\t\t\t\tcomputedHeight: this.height\n\t\t\t});\n\t\t\telse console.log(\"VirtualizedFile.computeApproximateSize: computed height IS CORRECT\");\n\t\t}\n\t\tthis.layoutDirty = false;\n\t}\n\tsetVisibility(visible) {\n\t\tif (this.isAdvancedMode() || this.fileContainer == null) return;\n\t\tif (visible && !this.isVisible) {\n\t\t\tthis.top = this.getVirtualizedTop();\n\t\t\tthis.isVisible = true;\n\t\t} else if (!visible && this.isVisible) {\n\t\t\tthis.isVisible = false;\n\t\t\tthis.rerender();\n\t\t}\n\t}\n\trerender() {\n\t\tif (!this.enabled || this.file == null) return;\n\t\tthis.forceRenderOverride = true;\n\t\tthis.virtualizer.instanceChanged(this, false);\n\t}\n\tapplyDocumentChange(textDocument, newLineAnnotations, shouldUpdateBuffer = false) {\n\t\tconst { heights, checkpoints } = this.cache;\n\t\tconst previousRenderRange = this.renderRange;\n\t\tsuper.applyDocumentChange(textDocument, newLineAnnotations);\n\t\tthis.getSimpleVirtualizer()?.markDOMDirty();\n\t\tthis.layoutDirty = true;\n\t\tif (heights.size > 0) heights.clear();\n\t\tif (checkpoints.length > 0) checkpoints.length = 0;\n\t\tif (this.isSimpleMode()) this.computeApproximateSize();\n\t\tif (shouldUpdateBuffer && previousRenderRange !== void 0 && this.file !== void 0) {\n\t\t\tconst windowSpecs = this.virtualizer.getWindowSpecs();\n\t\t\tconst renderRange = this.computeRenderRangeFromWindow(this.file, this.top ?? 0, windowSpecs);\n\t\t\tif (renderRange.bufferAfter !== previousRenderRange.bufferAfter) this.updateBuffers(renderRange);\n\t\t}\n\t}\n\trender({ fileContainer, file, forceRender = false, lineAnnotations,...props }) {\n\t\tconst didFileChange = this.file == null || !areFilesEqual(this.file, file);\n\t\tconst { forceRenderOverride, isSetup } = this;\n\t\tthis.forceRenderOverride = void 0;\n\t\tconst annotationsChanged = this.syncLineAnnotations(lineAnnotations);\n\t\tif (annotationsChanged) this.resetLayoutCache();\n\t\tthis.file = file;\n\t\tfileContainer = this.getOrCreateFileContainerNode(fileContainer);\n\t\tif (this.file == null) {\n\t\t\tconsole.error(\"VirtualizedFile.render: attempting to virtually render when we dont have file\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!isSetup) {\n\t\t\tthis.computeApproximateSize();\n\t\t\tconst virtualizer = this.getSimpleVirtualizer();\n\t\t\tthis.top ??= this.getVirtualizedTop();\n\t\t\tif (this.isAdvancedMode()) this.isVisible = true;\n\t\t\telse {\n\t\t\t\tif (virtualizer == null) throw new Error(\"VirtualizedFile.render: simple virtualizer is not available\");\n\t\t\t\tvirtualizer.connect(fileContainer, this);\n\t\t\t\tthis.isVisible = virtualizer.isInstanceVisible(this.top ?? 0, this.height);\n\t\t\t}\n\t\t\tthis.isSetup = true;\n\t\t} else {\n\t\t\tthis.top ??= this.getVirtualizedTop();\n\t\t\tif (didFileChange && this.isSimpleMode()) {\n\t\t\t\tthis.getSimpleVirtualizer()?.markDOMDirty();\n\t\t\t\tthis.resetLayoutCache(true);\n\t\t\t}\n\t\t}\n\t\tif (!this.isVisible && this.isSimpleMode()) return this.renderPlaceholder(this.height);\n\t\tconst windowSpecs = this.virtualizer.getWindowSpecs();\n\t\tconst fileTop = this.top ?? 0;\n\t\tconst renderRange = this.computeRenderRangeFromWindow(this.file, fileTop, windowSpecs);\n\t\treturn super.render({\n\t\t\tfile: this.file,\n\t\t\tfileContainer,\n\t\t\trenderRange,\n\t\t\tlineAnnotations,\n\t\t\tforceRender: (forceRenderOverride ?? forceRender) || annotationsChanged,\n\t\t\t...props\n\t\t});\n\t}\n\tsyncVirtualizedTop() {\n\t\tthis.top = this.getVirtualizedTop();\n\t}\n\tshouldDisableVirtualizationBuffers() {\n\t\treturn this.isAdvancedMode() || super.shouldDisableVirtualizationBuffers();\n\t}\n\tisSimpleMode() {\n\t\treturn this.virtualizer.type === \"simple\";\n\t}\n\tisAdvancedMode() {\n\t\treturn this.virtualizer.type === \"advanced\";\n\t}\n\taddLayoutCheckpoint(lineIndex, top) {\n\t\tif (lineIndex % LAYOUT_CHECKPOINT_INTERVAL !== 0) return;\n\t\tthis.cache.checkpoints.push({\n\t\t\tlineIndex,\n\t\t\ttop\n\t\t});\n\t}\n\tgetLayoutCheckpointBeforeLineIndex(lineIndex) {\n\t\tif (lineIndex <= 0 || this.cache.checkpoints.length === 0) return;\n\t\tlet low = 0;\n\t\tlet high = this.cache.checkpoints.length - 1;\n\t\tlet result;\n\t\twhile (low <= high) {\n\t\t\tconst mid = low + high >> 1;\n\t\t\tconst checkpoint = this.cache.checkpoints[mid];\n\t\t\tif (checkpoint == null) throw new Error(\"VirtualizedFile: invalid checkpoint index\");\n\t\t\tif (checkpoint.lineIndex <= lineIndex) {\n\t\t\t\tresult = checkpoint;\n\t\t\t\tlow = mid + 1;\n\t\t\t} else high = mid - 1;\n\t\t}\n\t\treturn result;\n\t}\n\tgetLayoutCheckpointBeforeTop(top, hunkLineCount) {\n\t\tlet low = 0;\n\t\tlet high = this.cache.checkpoints.length - 1;\n\t\tlet resultIndex = -1;\n\t\twhile (low <= high) {\n\t\t\tconst mid = low + high >> 1;\n\t\t\tconst checkpoint = this.cache.checkpoints[mid];\n\t\t\tif (checkpoint == null) throw new Error(\"VirtualizedFile: invalid checkpoint index\");\n\t\t\tif (checkpoint.top <= top) {\n\t\t\t\tresultIndex = mid;\n\t\t\t\tlow = mid + 1;\n\t\t\t} else high = mid - 1;\n\t\t}\n\t\tif (hunkLineCount == null) return resultIndex >= 0 ? this.cache.checkpoints[resultIndex] : void 0;\n\t\tfor (let index = resultIndex; index >= 0; index--) {\n\t\t\tconst checkpoint = this.cache.checkpoints[index];\n\t\t\tif (checkpoint == null) throw new Error(\"VirtualizedFile: invalid checkpoint index\");\n\t\t\tif (checkpoint.lineIndex % hunkLineCount === 0) return checkpoint;\n\t\t}\n\t}\n\tgetVirtualizedTop() {\n\t\tif (this.virtualizer.type === \"advanced\") return this.virtualizer.getLocalTopForInstance(this);\n\t\treturn this.fileContainer != null ? this.virtualizer.getOffsetInScrollContainer(this.fileContainer) : 0;\n\t}\n\tgetSimpleVirtualizer() {\n\t\treturn this.virtualizer.type === \"simple\" ? this.virtualizer : void 0;\n\t}\n\tisResizeDebuggingEnabled() {\n\t\treturn this.getSimpleVirtualizer()?.config.resizeDebugging ?? false;\n\t}\n\tcomputeRenderRangeFromWindow(file, fileTop, { top, bottom }) {\n\t\tconst { disableFileHeader = false, overflow = \"scroll\" } = this.options;\n\t\tconst { hunkLineCount, lineHeight } = this.metrics;\n\t\tconst lineCount = this.fileRenderer.getLineCount(file);\n\t\tconst fileHeight = this.height;\n\t\tconst headerRegion = getVirtualFileHeaderRegion(this.metrics, disableFileHeader);\n\t\tconst paddingBottom = lineCount > 0 ? getVirtualFilePaddingBottom(this.metrics) : 0;\n\t\tconst { fileAnnotationHeight } = this.cache;\n\t\tconst codeRegionTop = headerRegion + fileAnnotationHeight;\n\t\tconst codeRowsHeight = Math.max(0, fileHeight - headerRegion - fileAnnotationHeight - paddingBottom);\n\t\tconst hasFileAnnotations = includesFileAnnotations(this.lineAnnotations);\n\t\tconst fileAnnotationTop = fileTop + headerRegion;\n\t\tconst measuredFileAnnotationVisible = fileAnnotationHeight > 0 && hasFileAnnotations && fileAnnotationTop < bottom && fileAnnotationTop + fileAnnotationHeight > top;\n\t\tif (fileTop < top - fileHeight || fileTop > bottom) return {\n\t\t\tstartingLine: 0,\n\t\t\ttotalLines: 0,\n\t\t\tbufferBefore: 0,\n\t\t\tbufferAfter: fileHeight - headerRegion - paddingBottom\n\t\t};\n\t\tif (lineCount <= hunkLineCount) return {\n\t\t\tstartingLine: 0,\n\t\t\ttotalLines: hunkLineCount,\n\t\t\tbufferBefore: 0,\n\t\t\tbufferAfter: 0\n\t\t};\n\t\tconst estimatedTargetLines = Math.ceil(Math.max(bottom - top, 0) / lineHeight);\n\t\tconst totalLines = Math.ceil(estimatedTargetLines / hunkLineCount) * hunkLineCount + hunkLineCount * 2;\n\t\tconst totalHunks = totalLines / hunkLineCount;\n\t\tconst viewportCenter = (top + bottom) / 2;\n\t\tif (overflow === \"scroll\" && !this.hasLineAnnotations()) {\n\t\t\tconst sourceRowsTop = fileTop + codeRegionTop;\n\t\t\tconst sourceRowsBottom = sourceRowsTop + codeRowsHeight;\n\t\t\tif (!measuredFileAnnotationVisible && !(sourceRowsTop < bottom && sourceRowsBottom > top)) return {\n\t\t\t\tstartingLine: 0,\n\t\t\t\ttotalLines: 0,\n\t\t\t\tbufferBefore: 0,\n\t\t\t\tbufferAfter: fileHeight - headerRegion - paddingBottom\n\t\t\t};\n\t\t\tconst centerLine = Math.floor(measuredFileAnnotationVisible && viewportCenter < fileTop + codeRegionTop ? 0 : (viewportCenter - (fileTop + codeRegionTop)) / lineHeight);\n\t\t\tconst idealStartHunk$1 = Math.floor(centerLine / hunkLineCount) - Math.floor(totalHunks / 2);\n\t\t\tconst totalHunksInFile = Math.ceil(lineCount / hunkLineCount);\n\t\t\tconst startingLine$1 = Math.max(0, Math.min(idealStartHunk$1, totalHunksInFile)) * hunkLineCount;\n\t\t\tconst clampedTotalLines$1 = idealStartHunk$1 < 0 ? totalLines + idealStartHunk$1 * hunkLineCount : totalLines;\n\t\t\tconst bufferBefore$1 = startingLine$1 === 0 ? 0 : fileAnnotationHeight + startingLine$1 * lineHeight;\n\t\t\tconst renderedLines = Math.min(clampedTotalLines$1, lineCount - startingLine$1);\n\t\t\treturn {\n\t\t\t\tstartingLine: startingLine$1,\n\t\t\t\ttotalLines: clampedTotalLines$1,\n\t\t\t\tbufferBefore: bufferBefore$1,\n\t\t\t\tbufferAfter: Math.max(0, (lineCount - startingLine$1 - renderedLines) * lineHeight)\n\t\t\t};\n\t\t}\n\t\tconst overflowHunks = totalHunks;\n\t\tconst hunkOffsets = [];\n\t\tconst checkpoint = this.getLayoutCheckpointBeforeTop(Math.max(0, top - fileTop - totalLines * lineHeight * 2), hunkLineCount);\n\t\tlet absoluteLineTop = fileTop + (checkpoint?.top ?? codeRegionTop);\n\t\tlet currentLine = checkpoint?.lineIndex ?? 0;\n\t\tlet firstVisibleHunk;\n\t\tlet centerHunk;\n\t\tlet overflowCounter;\n\t\tconst startingLineIndex = checkpoint?.lineIndex ?? 0;\n\t\tfor (let lineIndex = startingLineIndex; lineIndex < lineCount; lineIndex++) {\n\t\t\tconst isAtHunkBoundary = currentLine % hunkLineCount === 0;\n\t\t\tconst currentHunk = Math.floor(currentLine / hunkLineCount);\n\t\t\tif (isAtHunkBoundary) {\n\t\t\t\thunkOffsets[currentHunk] = absoluteLineTop - (fileTop + codeRegionTop);\n\t\t\t\tif (overflowCounter != null) {\n\t\t\t\t\tif (overflowCounter <= 0) break;\n\t\t\t\t\toverflowCounter--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst lineHeight$1 = this.getLineHeight(lineIndex, false);\n\t\t\tif (absoluteLineTop > top - lineHeight$1 && absoluteLineTop < bottom) firstVisibleHunk ??= currentHunk;\n\t\t\tif (absoluteLineTop + lineHeight$1 > viewportCenter) centerHunk ??= currentHunk;\n\t\t\tif (overflowCounter == null && absoluteLineTop >= bottom && isAtHunkBoundary) overflowCounter = overflowHunks;\n\t\t\tcurrentLine++;\n\t\t\tabsoluteLineTop += lineHeight$1;\n\t\t}\n\t\tif (firstVisibleHunk == null) if (measuredFileAnnotationVisible) {\n\t\t\tfirstVisibleHunk = 0;\n\t\t\tcenterHunk = 0;\n\t\t} else return {\n\t\t\tstartingLine: 0,\n\t\t\ttotalLines: 0,\n\t\t\tbufferBefore: 0,\n\t\t\tbufferAfter: fileHeight - headerRegion - paddingBottom\n\t\t};\n\t\tcenterHunk ??= firstVisibleHunk;\n\t\tconst idealStartHunk = Math.round(centerHunk - totalHunks / 2);\n\t\tconst maxStartHunk = Math.max(0, Math.ceil(lineCount / hunkLineCount) - totalHunks);\n\t\tconst startHunk = Math.max(0, Math.min(idealStartHunk, maxStartHunk));\n\t\tconst startingLine = startHunk * hunkLineCount;\n\t\tconst clampedTotalLines = idealStartHunk < 0 ? totalLines + idealStartHunk * hunkLineCount : totalLines;\n\t\tconst codeBufferBefore = hunkOffsets[startHunk] ?? 0;\n\t\tconst bufferBefore = startingLine === 0 ? 0 : fileAnnotationHeight + codeBufferBefore;\n\t\tconst finalHunkIndex = startHunk + clampedTotalLines / hunkLineCount;\n\t\tconst bufferAfter = finalHunkIndex < hunkOffsets.length ? codeRowsHeight - hunkOffsets[finalHunkIndex] : codeRowsHeight - (absoluteLineTop - fileTop - codeRegionTop);\n\t\treturn {\n\t\t\tstartingLine,\n\t\t\ttotalLines: clampedTotalLines,\n\t\t\tbufferBefore,\n\t\t\tbufferAfter: Math.max(0, bufferAfter)\n\t\t};\n\t}\n};\nfunction measureFileAnnotationHeight(content) {\n\tlet height;\n\tfor (const child of content.children) {\n\t\tif (!(child instanceof HTMLElement)) continue;\n\t\tif (child.dataset.lineAnnotation !== FILE_ANNOTATION_DOM_KEY) continue;\n\t\theight = Math.max(height ?? 0, child.getBoundingClientRect().height);\n\t}\n\treturn height;\n}\n\n//#endregion\nexport { VirtualizedFile };\n//# sourceMappingURL=VirtualizedFile.js.map","import { MessageCircle, Trash2 } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport { Button } from \"~/components/ui/button\";\nimport { Textarea } from \"~/components/ui/textarea\";\n\ninterface LocalCommentAnnotationProps {\n kind: \"draft\" | \"comment\";\n rangeLabel: string;\n text: string;\n onCancel: () => void;\n onComment: (text: string) => void;\n onDelete: () => void;\n}\n\nexport function LocalCommentAnnotation({\n kind,\n rangeLabel,\n text: savedText,\n onCancel,\n onComment,\n onDelete,\n}: LocalCommentAnnotationProps) {\n const [text, setText] = useState(\"\");\n\n if (kind === \"comment\") {\n return (\n <div\n data-file-comment-annotation\n className=\"mx-3 my-2 rounded-xl border border-border/70 bg-background p-3 shadow-sm\"\n contentEditable={false}\n onPointerDown={(event) => event.stopPropagation()}\n >\n <div className=\"flex items-center gap-2\">\n <MessageCircle className=\"size-4 text-muted-foreground\" />\n <span className=\"text-xs font-medium\">Local comment</span>\n <span className=\"ml-auto text-[11px] text-muted-foreground\">{rangeLabel}</span>\n <Button variant=\"ghost\" size=\"icon-xs\" aria-label=\"Delete comment\" onClick={onDelete}>\n <Trash2 className=\"size-3.5\" />\n </Button>\n </div>\n <p className=\"mt-2 whitespace-pre-wrap text-sm leading-relaxed text-foreground\">\n {savedText}\n </p>\n </div>\n );\n }\n\n return (\n <div\n data-file-comment-annotation\n className=\"mx-3 my-2 rounded-xl border border-border/70 bg-background p-3 shadow-lg\"\n contentEditable={false}\n onPointerDown={(event) => event.stopPropagation()}\n >\n <div className=\"flex items-center gap-2\">\n <MessageCircle className=\"size-4 text-muted-foreground\" />\n <span className=\"text-sm font-medium\">Local comment</span>\n </div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Comment on lines {rangeLabel}</div>\n <Textarea\n autoFocus\n className=\"mt-3\"\n size=\"sm\"\n value={text}\n placeholder=\"Request change\"\n aria-label={`Comment on lines ${rangeLabel}`}\n onChange={(event) => setText(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n onCancel();\n }\n if ((event.metaKey || event.ctrlKey) && event.key === \"Enter\" && text.trim()) {\n event.preventDefault();\n onComment(text.trim());\n }\n }}\n />\n <div className=\"mt-3 flex justify-end gap-2\">\n <Button variant=\"ghost\" size=\"sm\" onClick={onCancel}>\n Cancel\n </Button>\n <Button size=\"sm\" disabled={!text.trim()} onClick={() => onComment(text.trim())}>\n Comment\n </Button>\n </div>\n </div>\n );\n}\n","import type { LineAnnotation, SelectedLineRange } from \"@pierre/diffs\";\n\nexport interface FileCommentAnnotationEntry {\n id: string;\n kind: \"draft\" | \"comment\";\n startLine: number;\n endLine: number;\n text: string;\n}\n\nexport interface FileCommentAnnotationGroup {\n entries: FileCommentAnnotationEntry[];\n}\n\nexport type FileCommentLineAnnotation = LineAnnotation<FileCommentAnnotationGroup>;\n\nlet fileCommentSequence = 0;\n\nexport function nextFileCommentId(): string {\n fileCommentSequence += 1;\n return `file-comment-${Date.now()}-${fileCommentSequence}`;\n}\n\nexport function normalizeFileCommentRange(range: SelectedLineRange): {\n startLine: number;\n endLine: number;\n} {\n return {\n startLine: Math.min(range.start, range.end),\n endLine: Math.max(range.start, range.end),\n };\n}\n\nexport function formatFileCommentRange(startLine: number, endLine: number): string {\n return startLine === endLine ? `L${startLine}` : `L${startLine} to L${endLine}`;\n}\n\nexport function remapFileCommentAnnotations(\n annotations: ReadonlyArray<FileCommentLineAnnotation>,\n): FileCommentLineAnnotation[] {\n return annotations.map((annotation) => ({\n ...annotation,\n metadata: {\n entries: annotation.metadata.entries.map((entry) => {\n const lineCount = entry.endLine - entry.startLine;\n return {\n ...entry,\n endLine: annotation.lineNumber,\n startLine: Math.max(1, annotation.lineNumber - lineCount),\n };\n }),\n },\n }));\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5],"mappings":"8mBAMA,SAAS,GAAmB,CAAE,OAAM,qBAAoB,qBAAoB,uBAAsB,mBAAkB,kBAAiB,sBAAqB,kBAAkB,CAC3K,IAAM,EAAe,IAAqB,CAAI,EACxC,EAAS,IAAqB,CAAI,EAClC,EAAW,IAAuB,CAAI,EAC5C,OAAuB,EAAA,EAAA,KAAA,CAAKA,EAAAA,SAAU,CAAE,SAAU,CACjD,GAAgB,MAGK,EAAA,EAAA,KAAA,CAAKA,EAAAA,SAAU,CAAE,SAAU,CAAC,GAAU,OAAwB,EAAA,EAAA,IAAA,CAAI,MAAO,CAC7F,KAAA,gBACA,SAAU,CACX,CAAC,EAAG,GAAY,OAAwB,EAAA,EAAA,IAAA,CAAI,MAAO,CAClD,KAAA,kBACA,SAAU,CACX,CAAC,CAAC,CAAE,CAAC,GATkC,EAAA,EAAA,IAAA,CAAI,MAAO,CACjD,KAAM,EACN,SAAU,CACX,CAAC,EAOD,GAAoB,MAAQ,GAAiB,KAAK,EAAY,KAA0B,EAAA,EAAA,IAAA,CAAI,MAAO,CAClG,KAAM,EAAsB,CAAU,EACtC,SAAU,EAAiB,CAAU,CACtC,EAAG,CAAK,CAAC,EACT,GAAuB,OAAwB,EAAA,EAAA,IAAA,CAAI,MAAO,CACzD,KAAM,sBACN,MAAO,GACP,SAAU,EAAoB,CAAc,CAC7C,CAAC,CACF,CAAE,CAAC,CACJ,CCNA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