@das-org/dascode 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BunHttpServer-YBQwrNiq.mjs +407 -0
- package/dist/BunPtyAdapter--Swo7U5P.mjs +120 -0
- package/dist/BunServices-RIDbItx-.mjs +115 -0
- package/dist/Cache-DyGeujxI.mjs +605 -0
- package/dist/Config-DcF-IZjO.mjs +1274 -0
- package/dist/FetchHttpClient-BmjpVs1I.mjs +5976 -0
- package/dist/NodePtyAdapter-H8kyf9St.mjs +115 -0
- package/dist/NodeServices-D8d9bE2V.mjs +152 -0
- package/dist/NodeSqliteClient-CmuXRT3w.mjs +178 -0
- package/dist/NodeTerminal-C6yhrF1E.mjs +1813 -0
- package/dist/Path-BB53LP8h.mjs +9050 -0
- package/dist/PtyAdapter-mAqTlv3d.mjs +60 -0
- package/dist/Schema-DuQUv9rO.mjs +33744 -0
- package/dist/SqlClient-Dp5XVCmr.mjs +922 -0
- package/dist/SqlError-D49f1UD-.mjs +409 -0
- package/dist/SqliteClient-DEcJdONi.mjs +147 -0
- package/dist/bin.mjs +201961 -0
- package/dist/client/assets/ChatView-HZc6-lKr.js +60 -0
- package/dist/client/assets/ClientOnly-FoswohdZ.js +2 -0
- package/dist/client/assets/CompositeRoot-Yff66Zmm.js +2 -0
- package/dist/client/assets/ConnectCliAuthSurface-BLD0XNSi.js +2 -0
- package/dist/client/assets/DiffDisplayControls-DsQS9IDw.js +1403 -0
- package/dist/client/assets/DiffPanel-DnIRg_Qy.js +98 -0
- package/dist/client/assets/DiffWorkerPoolProvider-DZJfC5kN.js +2 -0
- package/dist/client/assets/FieldControl-CuSMRkbi.js +2 -0
- package/dist/client/assets/FieldItemContext-Ba7ZZoDN.js +2 -0
- package/dist/client/assets/FilePreviewPanel-D3bq1Own.js +2220 -0
- package/dist/client/assets/KeybindingsSettings.logic-BQBQ8pFk.js +2 -0
- package/dist/client/assets/LocalAnnotatableCodeView-BS3qlDRM.js +2 -0
- package/dist/client/assets/PreviewPanel-C41OCDV3.js +2 -0
- package/dist/client/assets/ProviderModelPicker-BcQ3CMKb.js +2 -0
- package/dist/client/assets/PullRequestMarkdown-D5bDuXWN.js +2 -0
- package/dist/client/assets/RedactedSensitiveText-C3lDjv-5.js +2 -0
- package/dist/client/assets/ReviewActionsPanel-7rqPggzL.js +2 -0
- package/dist/client/assets/ReviewDiffWorkerPoolBoundary-CpqNaHWe.js +2 -0
- package/dist/client/assets/ReviewDiffWorkerSurface-fGPW1-P9.js +2 -0
- package/dist/client/assets/ReviewPatchView-Dt3GW4pP.js +4 -0
- package/dist/client/assets/Schema-DzLI5hMK.js +16 -0
- package/dist/client/assets/ServerUpdateAction-N9rNsTaN.js +2 -0
- package/dist/client/assets/SettingsPanels-DgK9Gy4R.js +3 -0
- package/dist/client/assets/SymbolsNerdFontMono-Regular-aK5vsLov.woff2 +0 -0
- package/dist/client/assets/WorkerPoolContext-BG9CEDyi.js +15 -0
- package/dist/client/assets/_chat-CDYErsvF.js +2 -0
- package/dist/client/assets/_chat._environmentId._threadId-Dn7yzuy5.js +2 -0
- package/dist/client/assets/_chat.draft._draftId-CKnp5OeX.js +2 -0
- package/dist/client/assets/_chat.index-CSOaDOiG.js +2 -0
- package/dist/client/assets/abap-CLvhMVsD.js +2 -0
- package/dist/client/assets/actionscript-3--17pq3dv.js +2 -0
- package/dist/client/assets/ada-C5qYipkI.js +2 -0
- package/dist/client/assets/alert-dialog-0GbcUK1u.js +2 -0
- package/dist/client/assets/andromeeda-WkhI09AS.js +2 -0
- package/dist/client/assets/andromeeda-vGVdxbeo.js +2 -0
- package/dist/client/assets/angular-html-BmcYSFCP.js +2 -0
- package/dist/client/assets/angular-ts-Ab3z1XOh.js +2 -0
- package/dist/client/assets/apache-U0d_L8uA.js +2 -0
- package/dist/client/assets/apex-VAyPSnFM.js +2 -0
- package/dist/client/assets/apl-DdAjc1Is.js +2 -0
- package/dist/client/assets/applescript-CCn79oCD.js +2 -0
- package/dist/client/assets/ara-4CJ0cIlV.js +2 -0
- package/dist/client/assets/asciidoc-DE70LPWp.js +2 -0
- package/dist/client/assets/asm-Cmm7eHzH.js +2 -0
- package/dist/client/assets/astro-jyGOnYUN.js +2 -0
- package/dist/client/assets/aurora-x-C7CFqhAd.js +2 -0
- package/dist/client/assets/aurora-x-CDeNXAV0.js +2 -0
- package/dist/client/assets/awk-BWXHIvNe.js +2 -0
- package/dist/client/assets/ayu-dark-CRu61w6_.js +2 -0
- package/dist/client/assets/ayu-dark-DluEY0Gj.js +2 -0
- package/dist/client/assets/ayu-light-C3h-C4tm.js +2 -0
- package/dist/client/assets/ayu-light-Dn6O_aYR.js +2 -0
- package/dist/client/assets/ayu-mirage-Bqwy1Gya.js +2 -0
- package/dist/client/assets/ayu-mirage-CTjYAbs-.js +2 -0
- package/dist/client/assets/ballerina-B7ZEbQpA.js +2 -0
- package/dist/client/assets/bat-Bo4NYOV-.js +2 -0
- package/dist/client/assets/beancount-D-usSTwE.js +2 -0
- package/dist/client/assets/berry-DKpUyyne.js +2 -0
- package/dist/client/assets/bibtex-Ci_nEsc7.js +2 -0
- package/dist/client/assets/bicep-CUHmPFLl.js +2 -0
- package/dist/client/assets/bird2-C6vDhewU.js +2 -0
- package/dist/client/assets/blade-C4dPlbVG.js +2 -0
- package/dist/client/assets/branding-DWKqECp7.js +2 -0
- package/dist/client/assets/bsl-BkkzgIyY.js +2 -0
- package/dist/client/assets/c-DtlEA5ZX.js +2 -0
- package/dist/client/assets/c3-BFHwR3_K.js +2 -0
- package/dist/client/assets/cadence-CQ2zXKGN.js +2 -0
- package/dist/client/assets/cairo-DLTphjLi.js +2 -0
- package/dist/client/assets/catppuccin-frappe-3VR1Za6u.js +2 -0
- package/dist/client/assets/catppuccin-frappe-DFlFW5gh.js +2 -0
- package/dist/client/assets/catppuccin-latte-CpxdcXpJ.js +2 -0
- package/dist/client/assets/catppuccin-latte-DwIHMF0Q.js +2 -0
- package/dist/client/assets/catppuccin-macchiato-DIdIQ04K.js +2 -0
- package/dist/client/assets/catppuccin-macchiato-DYnBP6_5.js +2 -0
- package/dist/client/assets/catppuccin-mocha-Co3Xjl64.js +2 -0
- package/dist/client/assets/catppuccin-mocha-DYhrFGRu.js +2 -0
- package/dist/client/assets/checkbox-Cuif7tF0.js +2 -0
- package/dist/client/assets/circle-x-F0441fqg.js +2 -0
- package/dist/client/assets/clarity-SemFz856.js +2 -0
- package/dist/client/assets/clojure-DqKBuwfJ.js +2 -0
- package/dist/client/assets/cmake-Bj61d0ZC.js +2 -0
- package/dist/client/assets/cobol-X9aU3UsG.js +2 -0
- package/dist/client/assets/codeowners-C8r90Shi.js +2 -0
- package/dist/client/assets/codeql-oeQT6MSM.js +2 -0
- package/dist/client/assets/coffee-BluyIHgc.js +2 -0
- package/dist/client/assets/combobox-D0sqVdtm.js +2 -0
- package/dist/client/assets/common-lisp-Cv5bFMCO.js +2 -0
- package/dist/client/assets/compiler-runtime-CUwoe8mk.js +2 -0
- package/dist/client/assets/connect-CshPrK5J.js +2 -0
- package/dist/client/assets/connect_.callback-1fxfJdnn.js +2 -0
- package/dist/client/assets/coq-BrsZFFmf.js +2 -0
- package/dist/client/assets/cpp-BAWTDsD2.js +2 -0
- package/dist/client/assets/crystal-DEAezpUc.js +2 -0
- package/dist/client/assets/csharp-oqKa8noW.js +2 -0
- package/dist/client/assets/css-ZG5tpaE7.js +2 -0
- package/dist/client/assets/csv-Dx-8-gkx.js +2 -0
- package/dist/client/assets/cue-CE9AQfxI.js +2 -0
- package/dist/client/assets/cypher-ClKdZ_lG.js +2 -0
- package/dist/client/assets/d-qD-0Kul2.js +2 -0
- package/dist/client/assets/dark-plus-Cs2F2srj.js +2 -0
- package/dist/client/assets/dark-plus-GAt2ZgX8.js +2 -0
- package/dist/client/assets/dart-CnvKMtbv.js +2 -0
- package/dist/client/assets/dax-BkyTk9wS.js +2 -0
- package/dist/client/assets/desktop-Dlh5hvp9.js +2 -0
- package/dist/client/assets/diff-woXpYk--.js +2 -0
- package/dist/client/assets/dm-sans-latin-ext-wght-normal-BOFOeGcA.woff2 +0 -0
- package/dist/client/assets/dm-sans-latin-wght-normal-Xz1IZZA0.woff2 +0 -0
- package/dist/client/assets/docker-IyjqRm3v.js +2 -0
- package/dist/client/assets/dotenv-_5a1GRtc.js +2 -0
- package/dist/client/assets/dracula-BHWKrbxM.js +2 -0
- package/dist/client/assets/dracula-C2uKkzgK.js +2 -0
- package/dist/client/assets/dracula-soft-5eyTD99u.js +2 -0
- package/dist/client/assets/dracula-soft-D1bVjxWZ.js +2 -0
- package/dist/client/assets/dream-maker-DW3nJb8Q.js +2 -0
- package/dist/client/assets/edge-BUUilOUR.js +2 -0
- package/dist/client/assets/elixir-amUSnRCT.js +2 -0
- package/dist/client/assets/elm-BjxEHjzr.js +2 -0
- package/dist/client/assets/emacs-lisp-B4R74twV.js +2 -0
- package/dist/client/assets/entities-EGZcO-rg.js +2 -0
- package/dist/client/assets/environments-DPUVdQJp.js +2 -0
- package/dist/client/assets/erb-t1kck8M-.js +2 -0
- package/dist/client/assets/erlang-Cphh6RMH.js +2 -0
- package/dist/client/assets/everforest-dark-D-DlICQR.js +2 -0
- package/dist/client/assets/everforest-dark-sB-x3p7T.js +2 -0
- package/dist/client/assets/everforest-light-CeVdGHYG.js +2 -0
- package/dist/client/assets/everforest-light-Df2xbC6M.js +2 -0
- package/dist/client/assets/eye-TogxKhHZ.js +2 -0
- package/dist/client/assets/fennel-DQxkIbk2.js +2 -0
- package/dist/client/assets/fileCommentAnnotations-uFcaPOph.js +2 -0
- package/dist/client/assets/fish-BJitypiv.js +2 -0
- package/dist/client/assets/fluent-C03EYrpw.js +2 -0
- package/dist/client/assets/fortran-fixed-form-DEKoE2YW.js +2 -0
- package/dist/client/assets/fortran-free-form-CYNrtFtB.js +2 -0
- package/dist/client/assets/fsharp-D13ZGOAj.js +2 -0
- package/dist/client/assets/gauge-DXknpyA8.js +2 -0
- package/dist/client/assets/gdresource-C0sCabJj.js +2 -0
- package/dist/client/assets/gdscript-Cp2uCuqX.js +2 -0
- package/dist/client/assets/gdshader-CBce3t8t.js +2 -0
- package/dist/client/assets/genie-CV2tkWYe.js +2 -0
- package/dist/client/assets/gherkin-DExj1W_8.js +2 -0
- package/dist/client/assets/ghostty-vt-DdA0Zryv.wasm +0 -0
- package/dist/client/assets/ghostty-write-pty-hgyAvVbe.wasm +0 -0
- package/dist/client/assets/git-commit-BSykSTBG.js +2 -0
- package/dist/client/assets/git-rebase-Cq4_6JTl.js +2 -0
- package/dist/client/assets/github-dark-C-LZuMrd.js +2 -0
- package/dist/client/assets/github-dark-DwbbXv51.js +2 -0
- package/dist/client/assets/github-dark-default-CxjRwzl6.js +2 -0
- package/dist/client/assets/github-dark-default-DXG-b-1a.js +2 -0
- package/dist/client/assets/github-dark-dimmed-Bx1FflLF.js +2 -0
- package/dist/client/assets/github-dark-dimmed-Cr1oaoul.js +2 -0
- package/dist/client/assets/github-dark-high-contrast-B4qJZLZa.js +2 -0
- package/dist/client/assets/github-dark-high-contrast-B_tTalzw.js +2 -0
- package/dist/client/assets/github-light-CsVXhIlR.js +2 -0
- package/dist/client/assets/github-light-EUqPIrTm.js +2 -0
- package/dist/client/assets/github-light-default-BXViO-2h.js +2 -0
- package/dist/client/assets/github-light-default-DB_IwZa6.js +2 -0
- package/dist/client/assets/github-light-high-contrast-B68TUdTA.js +2 -0
- package/dist/client/assets/github-light-high-contrast-DLgVeSB-.js +2 -0
- package/dist/client/assets/gleam-CSRkHgEL.js +2 -0
- package/dist/client/assets/glimmer-js-u4EGJ0zO.js +2 -0
- package/dist/client/assets/glimmer-ts-Gurbt52H.js +2 -0
- package/dist/client/assets/glsl-30pqDoZO.js +2 -0
- package/dist/client/assets/gn-ilITqXS6.js +2 -0
- package/dist/client/assets/gnuplot-7GGW24-e.js +2 -0
- package/dist/client/assets/go-rLFTqkRN.js +2 -0
- package/dist/client/assets/graphql-Bs5G1kBK.js +2 -0
- package/dist/client/assets/groovy-CacY0gHj.js +2 -0
- package/dist/client/assets/group-BUXx2pDS.js +2 -0
- package/dist/client/assets/gruvbox-dark-hard-C820rvS2.js +2 -0
- package/dist/client/assets/gruvbox-dark-hard-DXm60lX3.js +2 -0
- package/dist/client/assets/gruvbox-dark-medium-BPjhmG05.js +2 -0
- package/dist/client/assets/gruvbox-dark-medium-GE2thSmD.js +2 -0
- package/dist/client/assets/gruvbox-dark-soft-04Cj-4VZ.js +2 -0
- package/dist/client/assets/gruvbox-dark-soft-MrdJrrXF.js +2 -0
- package/dist/client/assets/gruvbox-light-hard-BC_s9l72.js +2 -0
- package/dist/client/assets/gruvbox-light-hard-K6wSn29D.js +2 -0
- package/dist/client/assets/gruvbox-light-medium-BAWPOn9u.js +2 -0
- package/dist/client/assets/gruvbox-light-medium-CVy3aSlc.js +2 -0
- package/dist/client/assets/gruvbox-light-soft-BSMLrYjP.js +2 -0
- package/dist/client/assets/gruvbox-light-soft-DNgJjaY0.js +2 -0
- package/dist/client/assets/hack-Cko6MX06.js +2 -0
- package/dist/client/assets/haml-Doizmjk4.js +2 -0
- package/dist/client/assets/handlebars-b-YSlzII.js +2 -0
- package/dist/client/assets/haskell-D8IpX4py.js +2 -0
- package/dist/client/assets/haxe-OTjmBuCE.js +2 -0
- package/dist/client/assets/hcl-Dh228itO.js +2 -0
- package/dist/client/assets/hex-color-picker-DfLvGsRa.js +2 -0
- package/dist/client/assets/history-D05vcMtj.js +2 -0
- package/dist/client/assets/hjson-CxZEssPk.js +2 -0
- package/dist/client/assets/hlsl-Cvrh5tZx.js +2 -0
- package/dist/client/assets/horizon-0-RkHfro.js +2 -0
- package/dist/client/assets/horizon-CE9ld1lL.js +2 -0
- package/dist/client/assets/horizon-bright-BgL2X9oq.js +2 -0
- package/dist/client/assets/horizon-bright-DSNQnXHK.js +2 -0
- package/dist/client/assets/hostedPairing-nVVe5x4p.js +2 -0
- package/dist/client/assets/houston-CsvMBhTu.js +2 -0
- package/dist/client/assets/houston-KyjWKfuY.js +2 -0
- package/dist/client/assets/html-FzejeGn1.js +2 -0
- package/dist/client/assets/html-derivative-CnAooqTz.js +2 -0
- package/dist/client/assets/http-BxFImlHF.js +2 -0
- package/dist/client/assets/hurl-qINZb_eJ.js +2 -0
- package/dist/client/assets/hxml-B0Qn7Nwc.js +2 -0
- package/dist/client/assets/hy-CZbG8q4J.js +2 -0
- package/dist/client/assets/imba-DsUTQ-LC.js +2 -0
- package/dist/client/assets/index-DCOpJfCm.js +475 -0
- package/dist/client/assets/index-zJhfLl9C.css +1 -0
- package/dist/client/assets/ini-B5eOa1yu.js +2 -0
- package/dist/client/assets/input-group-DTqnJGXS.js +2 -0
- package/dist/client/assets/java-dMRc_cVD.js +2 -0
- package/dist/client/assets/javascript-BWMpBhVQ.js +2 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/client/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/client/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/client/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/client/assets/jinja-VDH3C9Ij.js +2 -0
- package/dist/client/assets/jison-BB0XuJyA.js +2 -0
- package/dist/client/assets/json-BjGzD-SE.js +2 -0
- package/dist/client/assets/json5-BR5RXkoi.js +2 -0
- package/dist/client/assets/jsonc-CYpm1nAK.js +2 -0
- package/dist/client/assets/jsonl-CmCQp5Yx.js +2 -0
- package/dist/client/assets/jsonnet-CJTPZ8u_.js +2 -0
- package/dist/client/assets/jssm-DXw9l8Rf.js +2 -0
- package/dist/client/assets/jsx-DzJWGKks.js +2 -0
- package/dist/client/assets/julia-BgCkjxqD.js +2 -0
- package/dist/client/assets/just-CVxSIAWS.js +2 -0
- package/dist/client/assets/kanagawa-dragon-7TqgsUPC.js +2 -0
- package/dist/client/assets/kanagawa-dragon-CXtmUGW6.js +2 -0
- package/dist/client/assets/kanagawa-lotus-BN08jTvb.js +2 -0
- package/dist/client/assets/kanagawa-lotus-CqxMQulh.js +2 -0
- package/dist/client/assets/kanagawa-wave-CTweb8Dz.js +2 -0
- package/dist/client/assets/kanagawa-wave-D8CNn6T_.js +2 -0
- package/dist/client/assets/kdl-CsD5j6eV.js +2 -0
- package/dist/client/assets/kotlin-DhhofPvG.js +2 -0
- package/dist/client/assets/kusto-C7mF5XQf.js +2 -0
- package/dist/client/assets/laserwave-CQkdhozh.js +2 -0
- package/dist/client/assets/laserwave-C_8bwKvT.js +2 -0
- package/dist/client/assets/latex-D7_rfK40.js +2 -0
- package/dist/client/assets/lean-CewbzKMR.js +2 -0
- package/dist/client/assets/less-DVTAwKKz.js +2 -0
- package/dist/client/assets/lib-b9zyleUn.js +30 -0
- package/dist/client/assets/light-plus-CNQ8_7Y0.js +2 -0
- package/dist/client/assets/light-plus-DVQuIRkW.js +2 -0
- package/dist/client/assets/link-BL3GZ_rH.js +2 -0
- package/dist/client/assets/liquid-C5PsA06M.js +2 -0
- package/dist/client/assets/llvm-Cm23YOpf.js +2 -0
- package/dist/client/assets/localApi-5K0gg1WP.js +3 -0
- package/dist/client/assets/log-BNLmms1o.js +2 -0
- package/dist/client/assets/logo-Cluzi2Zq.js +2 -0
- package/dist/client/assets/lua-Bq1DnbZG.js +2 -0
- package/dist/client/assets/luau-FMPmPwt6.js +2 -0
- package/dist/client/assets/make-Dixweg8N.js +2 -0
- package/dist/client/assets/markdown-BYOwaDjH.js +2 -0
- package/dist/client/assets/marko-C7zk2YT1.js +2 -0
- package/dist/client/assets/matchContext-C4X6O3hW.js +2 -0
- package/dist/client/assets/material-theme-Bm3Qr25_.js +2 -0
- package/dist/client/assets/material-theme-CAtLaHa3.js +2 -0
- package/dist/client/assets/material-theme-darker-2IIEA8gg.js +2 -0
- package/dist/client/assets/material-theme-darker-k-s5Bc6K.js +2 -0
- package/dist/client/assets/material-theme-lighter-CD6a-c4d.js +2 -0
- package/dist/client/assets/material-theme-lighter-uhdI0v04.js +2 -0
- package/dist/client/assets/material-theme-ocean-B3mraInd.js +2 -0
- package/dist/client/assets/material-theme-ocean-CHQ94UKr.js +2 -0
- package/dist/client/assets/material-theme-palenight-B5W6OYN7.js +2 -0
- package/dist/client/assets/material-theme-palenight-DEhAARHw.js +2 -0
- package/dist/client/assets/matlab-D7qyCx1q.js +2 -0
- package/dist/client/assets/mdc-JKnKthIF.js +2 -0
- package/dist/client/assets/mdx-DQZ5AkYe.js +2 -0
- package/dist/client/assets/mermaid-Bk4SNUv9.js +2 -0
- package/dist/client/assets/min-dark-BFqTAwCr.js +2 -0
- package/dist/client/assets/min-dark-BSWPekZh.js +2 -0
- package/dist/client/assets/min-light-DDpmG2fV.js +2 -0
- package/dist/client/assets/min-light-O7UdaaxX.js +2 -0
- package/dist/client/assets/mipsasm-BMqwQI7S.js +2 -0
- package/dist/client/assets/mojo-BgCJLMeH.js +2 -0
- package/dist/client/assets/monokai-C0p7Qecz.js +2 -0
- package/dist/client/assets/monokai-CdkpiU2Y.js +2 -0
- package/dist/client/assets/moonbit-CaWjb8XO.js +2 -0
- package/dist/client/assets/move-B1IS1UjX.js +2 -0
- package/dist/client/assets/narrat-_X_XdTYD.js +2 -0
- package/dist/client/assets/nextflow-BJtWHP5T.js +2 -0
- package/dist/client/assets/nextflow-groovy-DJMQeKeT.js +2 -0
- package/dist/client/assets/nginx-DXZZx9Fe.js +2 -0
- package/dist/client/assets/night-owl-BsnCLAKc.js +2 -0
- package/dist/client/assets/night-owl-DhmEMT88.js +2 -0
- package/dist/client/assets/night-owl-light-BODRhcTU.js +2 -0
- package/dist/client/assets/night-owl-light-eJ-hLW7d.js +2 -0
- package/dist/client/assets/nim-CkvLrvYM.js +2 -0
- package/dist/client/assets/nix-IvuFDN5E.js +2 -0
- package/dist/client/assets/nord-Cb4Vim4T.js +2 -0
- package/dist/client/assets/nord-Cd-F4txO.js +2 -0
- package/dist/client/assets/nushell-DcLAeLz5.js +2 -0
- package/dist/client/assets/objective-c-D1A_Heim.js +2 -0
- package/dist/client/assets/objective-cpp-BsSzOQcm.js +2 -0
- package/dist/client/assets/ocaml-O90oeIOV.js +2 -0
- package/dist/client/assets/odin-B1RWQWA5.js +2 -0
- package/dist/client/assets/one-dark-pro-CLwyXe_n.js +2 -0
- package/dist/client/assets/one-dark-pro-DUS_IGRK.js +2 -0
- package/dist/client/assets/one-light-CVUd7yD5.js +2 -0
- package/dist/client/assets/one-light-D7Lr4KcI.js +2 -0
- package/dist/client/assets/openscad-BUDT5pXO.js +2 -0
- package/dist/client/assets/pair-D_sKBvJj.js +2 -0
- package/dist/client/assets/pascal-4ZHwLPI5.js +2 -0
- package/dist/client/assets/perl-DKUKw9CE.js +2 -0
- package/dist/client/assets/php-GHQk7Jua.js +2 -0
- package/dist/client/assets/pierre-dark-CpLgRqie.js +2 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +2 -0
- package/dist/client/assets/pierre-dark-soft-kZQmAZld.js +2 -0
- package/dist/client/assets/pierre-dark-tritanopia-CpjhbsIL.js +2 -0
- package/dist/client/assets/pierre-dark-vibrant-CpQYzh95.js +2 -0
- package/dist/client/assets/pierre-light-CoaEpmwp.js +2 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +2 -0
- package/dist/client/assets/pierre-light-soft-lWLdNTOI.js +2 -0
- package/dist/client/assets/pierre-light-tritanopia-CEbqgOJL.js +2 -0
- package/dist/client/assets/pierre-light-vibrant-D80Fkn33.js +2 -0
- package/dist/client/assets/pkl-ot-7Btpt.js +2 -0
- package/dist/client/assets/plastic-CF8VZTnn.js +2 -0
- package/dist/client/assets/plastic-DQwYfKfQ.js +2 -0
- package/dist/client/assets/plsql-DGHpHOYJ.js +2 -0
- package/dist/client/assets/po-BiJDBrnU.js +2 -0
- package/dist/client/assets/poimandres-BX2TyY6j.js +2 -0
- package/dist/client/assets/poimandres-DRFjx7u4.js +2 -0
- package/dist/client/assets/polar-C7UOKdEL.js +2 -0
- package/dist/client/assets/postcss-BXeXVLqQ.js +2 -0
- package/dist/client/assets/powerquery-DNMTfnFr.js +2 -0
- package/dist/client/assets/powershell-DshXNtvi.js +2 -0
- package/dist/client/assets/preload-helper-D2XUqLHy.js +1 -0
- package/dist/client/assets/previewActionBus-B2LYye0P.js +2 -0
- package/dist/client/assets/prisma-BsRQq5mF.js +2 -0
- package/dist/client/assets/projects-D9v9VLJo.js +2 -0
- package/dist/client/assets/prolog-iXnhIJG7.js +2 -0
- package/dist/client/assets/proto-DB4EqR-F.js +2 -0
- package/dist/client/assets/pug-DxCMAzbD.js +2 -0
- package/dist/client/assets/puppet-CDv2pdJW.js +2 -0
- package/dist/client/assets/purescript-9MfHhQsQ.js +2 -0
- package/dist/client/assets/python-gzcpVVnB.js +2 -0
- package/dist/client/assets/qml-D3IL06-0.js +2 -0
- package/dist/client/assets/qmldir-DCQb3MpD.js +2 -0
- package/dist/client/assets/qss-Fe1Jh2GI.js +2 -0
- package/dist/client/assets/query-BTlH8ppa.js +2 -0
- package/dist/client/assets/r-D2Zb3-aq.js +2 -0
- package/dist/client/assets/racket-DcIDlBhZ.js +2 -0
- package/dist/client/assets/radio-group-VXzWvOzu.js +2 -0
- package/dist/client/assets/raku-B3gFvitq.js +2 -0
- package/dist/client/assets/razor-BfPqrQiz.js +2 -0
- package/dist/client/assets/red-7ga_dcKu.js +2 -0
- package/dist/client/assets/red-CJ3rzSJv.js +2 -0
- package/dist/client/assets/redirect-CTDpd8-N.js +2 -0
- package/dist/client/assets/reg-CRGYupPL.js +2 -0
- package/dist/client/assets/regexp-BtCnpNi-.js +2 -0
- package/dist/client/assets/rel-BtDbiS_P.js +2 -0
- package/dist/client/assets/reviewPatchParser.worker-Bx0aLcXI.js +13 -0
- package/dist/client/assets/reviews-DqcOSrtz.js +2 -0
- package/dist/client/assets/reviews._environmentId._host._owner._repository._pullRequestNumber-QICycRVU.js +11 -0
- package/dist/client/assets/reviews.index-Dw9KYVnt.js +2 -0
- package/dist/client/assets/riscv-Ckw8ddFX.js +2 -0
- package/dist/client/assets/ron-VUp2lXgN.js +2 -0
- package/dist/client/assets/rose-pine-BthvhNj6.js +2 -0
- package/dist/client/assets/rose-pine-dawn-DSuRaP6u.js +2 -0
- package/dist/client/assets/rose-pine-dawn-Dg85fqjY.js +2 -0
- package/dist/client/assets/rose-pine-moon-DdHjCvFQ.js +2 -0
- package/dist/client/assets/rose-pine-moon-hon4tzzS.js +2 -0
- package/dist/client/assets/rose-pine-rh6ipraJ.js +2 -0
- package/dist/client/assets/rosmsg-CAekHB0j.js +2 -0
- package/dist/client/assets/rotate-ccw-BuHf9qmb.js +2 -0
- package/dist/client/assets/rst-DgVsEgbv.js +2 -0
- package/dist/client/assets/ruby-DM9zEDxk.js +2 -0
- package/dist/client/assets/rust-Cfkwpbl8.js +2 -0
- package/dist/client/assets/safeLog-NeXgoMPF.js +3 -0
- package/dist/client/assets/sas-DlL3ue79.js +2 -0
- package/dist/client/assets/sass-DXrisJhu.js +2 -0
- package/dist/client/assets/scala-DKOlJaKm.js +2 -0
- package/dist/client/assets/scheduler-8SgDf5Nb.js +2 -0
- package/dist/client/assets/scheme-DQCgrYNe.js +2 -0
- package/dist/client/assets/scss-LGD8fUVB.js +2 -0
- package/dist/client/assets/sdbl-bTVj8UrX.js +2 -0
- package/dist/client/assets/settings-D4XOj85b.js +2 -0
- package/dist/client/assets/settings.appearance-CZvAeZCN.js +42 -0
- package/dist/client/assets/settings.archived-Y06GoG0S.js +2 -0
- package/dist/client/assets/settings.beta-Bd5UrFtG.js +2 -0
- package/dist/client/assets/settings.connections-YjuBg0cD.js +2 -0
- package/dist/client/assets/settings.diagnostics-DujS7DMW.js +3 -0
- package/dist/client/assets/settings.general-sQSJC3Rq.js +2 -0
- package/dist/client/assets/settings.keybindings-C6b2im1-.js +2 -0
- package/dist/client/assets/settings.providers-CzhQRSvU.js +2 -0
- package/dist/client/assets/settings.source-control-Ocoxm1T5.js +2 -0
- package/dist/client/assets/shaderlab-TOUzSsQk.js +2 -0
- package/dist/client/assets/shell-BfrxrAzH.js +2 -0
- package/dist/client/assets/shellscript-CYVg9JP5.js +2 -0
- package/dist/client/assets/shellsession-Cn2QQjIy.js +2 -0
- package/dist/client/assets/slack-dark-DYvUXyrP.js +2 -0
- package/dist/client/assets/slack-dark-DnToyrRv.js +2 -0
- package/dist/client/assets/slack-ochin-B2OO5cIa.js +2 -0
- package/dist/client/assets/slack-ochin-bqtMVDfH.js +2 -0
- package/dist/client/assets/smalltalk-B16xEiuN.js +2 -0
- package/dist/client/assets/snazzy-light-4G7pJPwS.js +2 -0
- package/dist/client/assets/snazzy-light-D8dzFmq5.js +2 -0
- package/dist/client/assets/solarized-dark-BQwPDzxK.js +2 -0
- package/dist/client/assets/solarized-dark-DV17i1UV.js +2 -0
- package/dist/client/assets/solarized-light-BLaijb3X.js +2 -0
- package/dist/client/assets/solarized-light-DSh2HLQt.js +2 -0
- package/dist/client/assets/solidity-CKzVLygQ.js +2 -0
- package/dist/client/assets/soy-BNUH7AWp.js +2 -0
- package/dist/client/assets/sparql-D_iOobhT.js +2 -0
- package/dist/client/assets/splunk-BC2Px7Mm.js +2 -0
- package/dist/client/assets/sql-BLrhh1Yv.js +2 -0
- package/dist/client/assets/ssh-config-BgfXC-Er.js +2 -0
- package/dist/client/assets/stata-CbTJOr_m.js +2 -0
- package/dist/client/assets/stylus-B6D30XZt.js +2 -0
- package/dist/client/assets/surrealql-Bp6i6018.js +2 -0
- package/dist/client/assets/svelte-CuQ8bF4c.js +2 -0
- package/dist/client/assets/swift-DonLKvLd.js +2 -0
- package/dist/client/assets/switch-rJ-jJPhK.js +2 -0
- package/dist/client/assets/synthwave-84-CIknw8y7.js +2 -0
- package/dist/client/assets/synthwave-84-nFMaYfgc.js +2 -0
- package/dist/client/assets/system-verilog-DJ5XKQeo.js +2 -0
- package/dist/client/assets/systemd-BxMlprV5.js +2 -0
- package/dist/client/assets/talonscript-CohzipZa.js +2 -0
- package/dist/client/assets/tasl-DMoTqEGO.js +2 -0
- package/dist/client/assets/tcl-CZd0xW_V.js +2 -0
- package/dist/client/assets/templ-Bo-nf_t1.js +2 -0
- package/dist/client/assets/terminalAppearance-BqQ_2bv1.js +2 -0
- package/dist/client/assets/terraform-DswuEJGm.js +2 -0
- package/dist/client/assets/tex-BgvSMBks.js +2 -0
- package/dist/client/assets/textarea-XNVgJSPU.js +2 -0
- package/dist/client/assets/toggle-QDWstdFN.js +2 -0
- package/dist/client/assets/tokyo-night-iIspnLcq.js +2 -0
- package/dist/client/assets/tokyo-night-oM2G3aXe.js +2 -0
- package/dist/client/assets/toml-CcmNWLt0.js +2 -0
- package/dist/client/assets/ts-tags-Bm95_vpn.js +2 -0
- package/dist/client/assets/tsv-sltzmVWM.js +2 -0
- package/dist/client/assets/tsx-ToB8-PkG.js +2 -0
- package/dist/client/assets/turtle-ByJddavk.js +2 -0
- package/dist/client/assets/twig-D5eIhwLo.js +2 -0
- package/dist/client/assets/typescript-55S1t3b3.js +2 -0
- package/dist/client/assets/typespec-BRdr0IET.js +2 -0
- package/dist/client/assets/typst-DI99ib-x.js +2 -0
- package/dist/client/assets/uiStateStore-DKTfup26.js +2 -0
- package/dist/client/assets/use-atom-command-CbJ8L7ju.js +4 -0
- package/dist/client/assets/useAriaLabelledBy-DcnsWgtX.js +2 -0
- package/dist/client/assets/useParams-Iww6IHUG.js +2 -0
- package/dist/client/assets/useReviewMergeAction-BgjVNuJP.js +2 -0
- package/dist/client/assets/useSettings-CGh4Xw67.js +2 -0
- package/dist/client/assets/useStore-Bv9Rrp6F.js +2 -0
- package/dist/client/assets/utils-SYwD9hoF.js +2 -0
- package/dist/client/assets/utils-Yidpy5tB.js +30 -0
- package/dist/client/assets/v-DETTlOr0.js +2 -0
- package/dist/client/assets/vala-zf12oZj6.js +2 -0
- package/dist/client/assets/vb-Djn5o6TS.js +2 -0
- package/dist/client/assets/vcsRefInvalidation-CMdkUDtM.js +2 -0
- package/dist/client/assets/verilog-CiiDBU1e.js +2 -0
- package/dist/client/assets/vesper-BIFK_oDq.js +2 -0
- package/dist/client/assets/vesper-DdrHHSXu.js +2 -0
- package/dist/client/assets/vhdl-BroJfC0k.js +2 -0
- package/dist/client/assets/viml-DvXPmvsu.js +2 -0
- package/dist/client/assets/vitesse-black-D082JcaE.js +2 -0
- package/dist/client/assets/vitesse-black-fwtXNY1n.js +2 -0
- package/dist/client/assets/vitesse-dark-BZCL-v6S.js +2 -0
- package/dist/client/assets/vitesse-dark-z-nr_5O8.js +2 -0
- package/dist/client/assets/vitesse-light-VbXTXTou.js +2 -0
- package/dist/client/assets/vitesse-light-ojz42ZLy.js +2 -0
- package/dist/client/assets/vue-BWR1mbne.js +2 -0
- package/dist/client/assets/vue-html-DGrJOwF8.js +2 -0
- package/dist/client/assets/vue-vine-SedHajQj.js +2 -0
- package/dist/client/assets/vyper-CgoNMtux.js +2 -0
- package/dist/client/assets/wasm-BnjxR4X6.js +2 -0
- package/dist/client/assets/wasm-ByWQv1Qj.js +2 -0
- package/dist/client/assets/wenyan-C8pVoKbM.js +2 -0
- package/dist/client/assets/wgsl-BsKzXJz4.js +2 -0
- package/dist/client/assets/wikitext-ClFFjSW2.js +2 -0
- package/dist/client/assets/wit-DdvCle-K.js +2 -0
- package/dist/client/assets/with-selector-C3poe37J.js +2 -0
- package/dist/client/assets/wolfram-DLL8P-h_.js +2 -0
- package/dist/client/assets/worker-CIcqvLjo.js +159 -0
- package/dist/client/assets/workspaceTitlebar-CrNTdVrF.js +2 -0
- package/dist/client/assets/xml-BB6ezbMQ.js +2 -0
- package/dist/client/assets/xsl-DygAj9pT.js +2 -0
- package/dist/client/assets/yaml-CIJj2T9S.js +2 -0
- package/dist/client/assets/zenscript-BnlCZFoB.js +2 -0
- package/dist/client/assets/zig-CMLA9XwU.js +2 -0
- package/dist/client/index.html +327 -0
- package/dist/client/mockServiceWorker.js +349 -0
- package/dist/service-launcher.mjs +461 -0
- package/package.json +54 -0
|
@@ -0,0 +1,2220 @@
|
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./compiler-runtime-CUwoe8mk.js";import{Aa as i,Ba as a,C as o,Ma as s,O as c,Va as l,cn as u,t as d,za as f}from"./utils-Yidpy5tB.js";import{Tt as p,_t as m,t as h}from"./use-atom-command-CbJ8L7ju.js";import{Mi as g,Ms as _,Zr as v,n as y,na as b}from"./Schema-DzLI5hMK.js";import{A as x,_ as S,f as C,g as w,m as T,n as E,s as D,u as O,v as ee}from"./localApi-5K0gg1WP.js";import{t as k}from"./query-BTlH8ppa.js";import{A,C as j,S as M,b as N,d as P,f as te,h as ne,l as re,m as ie,p as ae,u as oe,w as se,x as ce,y as le}from"./ChatView-HZc6-lKr.js";import{J as ue,K as F,M as de,Y as fe,i as pe,s as me}from"./DiffDisplayControls-DsQS9IDw.js";import{t as he}from"./eye-TogxKhHZ.js";import{a as ge,n as _e}from"./environments-DPUVdQJp.js";import{t as ve}from"./useSettings-CGh4Xw67.js";import{M as ye}from"./entities-EGZcO-rg.js";import{C as be,S as xe,t as Se}from"./WorkerPoolContext-BG9CEDyi.js";import{a as Ce,c as we,i as I,n as Te,o as Ee,r as De,s as Oe,t as ke}from"./fileCommentAnnotations-uFcaPOph.js";import{$n as Ae,$o as je,Bt as Me,Fa as Ne,Gc as Pe,Gn as Fe,Go as Ie,Hc as Le,Ja as Re,Jt as ze,Mc as Be,No as Ve,Tr as He,Vc as Ue,Wo as We,Yc as Ge,Yt as Ke,Zo as qe,cr as Je,dn as Ye,en as Xe,er as Ze,gr as Qe,hr as $e,ls as et,mr as tt,nc as nt,nl as rt,nr as it,os as at,po as ot,pr as st,rr as L,sr as R,ss as ct,tr as lt,ts as ut,un as dt,wt as ft,yr as pt,zc as mt,zn as ht}from"./index-DCOpJfCm.js";import{t as gt}from"./toggle-QDWstdFN.js";import{r as z,t as _t}from"./input-group-DTqnJGXS.js";import{a as vt,i as yt,n as bt,o as xt,r as St,s as Ct,t as wt}from"./alert-dialog-0GbcUK1u.js";var Tt=s(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Et=s(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Dt=`file-tree-container`,Ot=`data-file-tree-style`,kt=`data-file-tree-unsafe-css`,At=`data-file-tree-scrollbar-measure`,jt=`data-file-tree-scrollbar-gutter-measured`,Mt=`--trees-scrollbar-gutter-measured`,Nt=`header`,Pt=`context-menu`,Ft=`context-menu-trigger`,It=5,Lt=1<<It,Rt=Lt*4;function zt(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Bt(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Vt(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function Ht(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function Ut(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function Wt(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function Gt(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,Yt(e,t)}function Kt(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=Ht(e).get(t);if(i===void 0)return;let a=i>>It;e.childVisibleChunkSums[a]+=r}function qt(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Xt(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=Lt}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Jt(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>It;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<It}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function Yt(e,t){if(t.childIds.length<Rt){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/Lt),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>It]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Xt(e,t,n,r){let i=Math.min(t.childIds.length,n+Lt),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var Zt=7,Qt=3,$t=1<<Qt,en=4;function tn(e,t,n=0){return e<<en|n<<Qt|t}function nn(e){return e.depthAndFlags>>>en}function rn(e){return(e.depthAndFlags&$t)>>Qt}function B(e){return(e.depthAndFlags&$t)!==0}function an(e){return e.depthAndFlags&Zt}function on(e,t){return(an(e)&t)!==0}function sn(e,t){e.depthAndFlags|=t}function cn(e,t){e.depthAndFlags=tn(t,an(e),rn(e))}var ln=Symbol(`benchmarkInstrumentation`);function un(e,t){return t==null||Object.defineProperty(e,ln,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function dn(e){return e==null?null:e[ln]??null}function V(e,t,n){return e==null?n():e.measurePhase(t,n)}function fn(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function pn(e){return e>=48&&e<=57}function mn(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!pn(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&pn(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function hn(e){let t=e.toLowerCase();return{lowerValue:t,tokens:mn(t)}}function gn(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function _n(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=gn(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function vn(e,t,n){let r=_n(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function yn(e,t){return vn(e,t,hn)}function bn(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function xn(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=bn(e,r);return a===bn(t,r)?yn(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Sn(e,t){return xn(e,t)}function Cn(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=hn(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=bn(e,n);return o===bn(t,n)?vn(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function wn(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=hn(r);return e.sortKeyById[t]=i,i}function Tn(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function En(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function Dn(e){let{hasTrailingSlash:t,segments:n}=En(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function On(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=En(e);return{requiresDirectory:t,segments:n}}var kn=``;function An(){let e=new Map;return e.set(kn,0),{idByValue:e,valueById:[kn],sortKeyById:[hn(kn)]}}function jn(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Mn(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Nn=Symbol(`pathStorePreparedInputKind`);function Pn(e,t){return e[Nn]=t,e}function Fn(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function In(e,t,n){return n==="default"?Sn(e,t):n(Fn(e),Fn(t))}function Ln(){return{depthAndFlags:tn(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Rn(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function zn(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Bn(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Vn(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Hn(e,t={}){return Jn(e,t).map(e=>e.path)}function Un(e,t={}){let n=Jn(e,t);return Pn({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function Wn(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Pn({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Gn(e){let t=e,n=t.preparedPaths;if(t[Nn]===`prepared`&&n!=null)return n;if(!Bn(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function Kn(e){let t=e;return t[Nn]===`presorted`&&t.presortedPaths!=null||Vn(t.presortedPaths)?t.presortedPaths:null}function qn(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Jn(e,t={}){let n=Tn(t),r=dn(t);fn(r,`workload.inputFiles`,e.length);let i=V(r,`store.preparePathEntries.parse`,()=>e.map(e=>Dn(e)));return V(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>In(e,t,n.sort))),i}var Yn=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Ln()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=An();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=dn(e),this.options=Tn(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,zt())}appendPaths(e){return V(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Dn(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,V(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return V(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:tn(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:tn(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:tn(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=Dn(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:tn(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:tn(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=Dn(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(V(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||V(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Cn(this.lastPreparedPath,e,this.segmentSortKeyCache):In(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=zn(e),i=n==null?0:zn(n),a=n==null?0:Rn(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=jn(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:tn(nn(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),Ut(i,s),s}createFileChildUnchecked(e,t){let n=jn(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:tn(nn(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Ut(r,a),a}getOrCreateDirectoryChild(e,t){let n=jn(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!B(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:tn(nn(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Ut(r,a),this.directories.set(a,zt()),a}createDirectoryChild(e,t){let n=jn(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:tn(nn(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Ut(r,a),this.directories.set(a,zt()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!B(n))throw Error(`Path is not a directory: "${t}"`);if(on(n,1))throw Error(`Duplicate path: "${t}"`);sn(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,Bt());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(B(a)){let t=Bt();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;B(n)&&this.directories.set(t,zt());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),Ut(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!B(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return Gt(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Xn(e,t=`closed`,n=null){let r=Qn(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Zn(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Qn(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function $n(e,t){return on(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:nn(t)<=e.defaultExpansion}function er(e,t,n=e.snapshot.nodes[t]){return n==null||!B(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:$n(e,n)}function tr(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!B(r))return;let i=$n(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function nr(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function rr(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function ir(e,t){let n=nr(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function ar(e,t){let n=nr(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function or(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function sr(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function cr(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function lr(e,t){e.directoryLoadInfoById.delete(t)}function ur(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function dr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function fr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function pr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function mr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function hr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function gr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function _r(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function vr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function yr(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function br(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function xr(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Sr(e,t,n){return{...n,visibleCountDelta:Nr(e)-t}}function Cr(e,t){let n=Nr(e),r=Zn();e.transactionStack.push(r);try{t()}catch(t){throw Er(e,r,!1),t}Er(e,r,!0,Nr(e)-n)}function wr(e,t){let n=e.instrumentation;if(n==null){Tr(e,t);return}V(n,`store.events.record`,()=>Tr(e,t))}function Tr(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){jr(e,t);return}n.events.push(t),Ar(n,t)}function Er(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?kr(i,t):V(n,`store.events.batch.merge`,()=>kr(i,t));return}let a=Dr(t,r),o=e.instrumentation;if(o==null){jr(e,a);return}V(o,`store.events.batch.commit`,()=>jr(e,a))}function Dr(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function Or(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function kr(e,t){for(let n of t.events)e.events.push(n);Or(e,t)}function Ar(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function jr(e,t){let n=e.instrumentation;if(n==null){Mr(e,t);return}V(n,`store.events.emit`,()=>Mr(e,t))}function Mr(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Nr(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Pr(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!B(n)||on(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!B(a)?null:i}function Fr(e,t){let n=t;for(;;){let t=Pr(e,n);if(t==null)return n;n=t}}function Ir(e,t){let n=[t],r=t;for(;;){let t=Pr(e,r);if(t==null)return n;n.push(t),r=t}}function Lr(e,t){let n=t==null?e.snapshot.rootId:Kr(e,t);return n==null?[]:Jr(e,n)}function Rr(e,t){let n=Dn(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=li(e,ci(e,r)),{createdNodeIds:a,directoryId:o}=Yr(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=W(e,o);if(on(n,1))throw Error(`Path already exists: "${t}"`);sn(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=Zr(e,o,n.basename),s.add(c);Ur(e,o);let l=li(e,o);return dr({affectedAncestorIds:Gr(e,c),affectedNodeIds:[...s],path:t,projectionChanged:ui(i,l)})}function zr(e,t,n){let r=Kr(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=W(e,r);if(on(i,2))throw Error(`The root node cannot be removed`);if(B(i)&&U(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=li(e,a),s=oi(e,r);ei(e,a,r,i.nameId),si(e,a),Ur(e,a);let c=li(e,a);return fr({affectedAncestorIds:Gr(e,a),affectedNodeIds:s,path:t,projectionChanged:ui(o,c),recursive:n.recursive===!0})}function Br(e,t,n,r){let i=Kr(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=W(e,i);if(on(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=ii(e,i,n),c=li(e,a.parentId),l=li(e,s.parentId),u=Mn(e.snapshot.segmentTable,a.nameId),d=jn(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(B(a)&&mi(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=Vt(e.snapshot.nodes,U(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&ai(e,p,o,rn(a))===`skip`)return null;let m=a.parentId;ei(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),pi(e,i),$r(e,s.parentId,i),si(e,m),e.pathCacheVersion++,Ur(e,m),s.parentId!==m&&Ur(e,s.parentId);let h=li(e,m),g=li(e,s.parentId);return pr({affectedAncestorIds:[...new Set([...Gr(e,m),...Gr(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:di([c,l],[h,g]),to:H(e,i)})}function Vr(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function Hr(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function H(e,t){let n=W(e,t),r=Vr(e,t);if(r!=null)return r;if(on(n,2))return Hr(e,t,``);let i=H(e,n.parentId),a=Mn(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return Hr(e,t,B(n)?`${o}/`:o)}function Ur(e,t){let n=e.instrumentation;if(n==null){gi(e,t);return}V(n,`store.recomputeCountsUpwardFrom`,()=>gi(e,t))}function Wr(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!B(o)){hi(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){hi(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function Gr(e,t){let n=[],r=t;for(;r!=null;){let t=W(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function Kr(e,t){if(t.length===0)return e.snapshot.rootId;let n=On(t);return qr(e,n.segments,n.requiresDirectory)}function qr(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=U(e,r),a=Vt(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=W(e,r);return n&&!B(i)?null:r}function U(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function W(e,t){let n=e.snapshot.nodes[t];if(n===void 0||on(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Jr(e,t){let n=e.snapshot.nodes[t];if(n===void 0||on(n,4))return[];if(!B(n))return[H(e,t)];if(U(e,t).childIds.length===0)return on(n,1)&&!on(n,2)?[H(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||on(n,4)){i.pop();continue}if(!B(n)){r.push(H(e,t.nodeId)),i.pop();continue}let a=U(e,t.nodeId);if(a.childIds.length===0){on(n,1)&&!on(n,2)&&r.push(H(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function Yr(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=jn(e.snapshot.segmentTable,i),a=U(e,r),o=Vt(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!B(W(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Xr(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Xr(e,t,n){let r=W(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:tn(nn(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,zt()),$r(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function Zr(e,t,n){let r=jn(e.snapshot.segmentTable,n),i=U(e,t);if(Vt(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${vi(e,t,n)}"`);let a=W(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:tn(nn(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),$r(e,t,o),e.activeNodeCount++,o}function Qr(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}ti(e,n,o)<0?i=a:r=a+1}return r}function $r(e,t,n){let r=U(e,t),i=W(e,n);Vt(e.snapshot.nodes,r).set(i.nameId,n),Kt(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Qr(e,r,n);r.childIds.splice(a,0,n),Wt(r,a),Yt(e.snapshot.nodes,r)}function ei(e,t,n,r){let i=U(e,t),a=Ht(i),o=a.get(n)??-1;Vt(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Kt(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),Wt(i,o),Yt(e.snapshot.nodes,i))}function ti(e,t,n){let r=e.snapshot.options.sort;return r==="default"?ni(e,t,n):r(ri(e,t),ri(e,n))}function ni(e,t,n){let r=W(e,t),i=W(e,n),a=B(r);if(a!==B(i))return a?-1:1;let o=_n(wn(e.snapshot.segmentTable,r.nameId),wn(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Mn(e.snapshot.segmentTable,r.nameId),c=Mn(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function ri(e,t){let n=W(e,t),r=H(e,t),i=B(n),a=i?r.slice(0,-1):r;return{basename:Mn(e.snapshot.segmentTable,n.nameId),depth:nn(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function ii(e,t,n){let r=W(e,t),i=Kr(e,n);if(i!=null){let t=W(e,i);if(B(t))return{basename:Mn(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=On(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=On(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:qr(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function ai(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${H(e,t)}"`);let i=W(e,t);if(rn(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(B(i)&&U(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return oi(e,t),ei(e,a,t,o),si(e,a),Ur(e,a),`handled`}function oi(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=W(e,t.nodeId);if(t.visitedChildren||!B(i)){B(i)&&e.snapshot.directories.delete(t.nodeId),sn(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),lr(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=U(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function si(e,t){let n=t;for(;n!=null;){let t=W(e,n);if(!B(t)||on(t,2)||U(e,n).childIds.length>0)return;sn(t,1),n=t.parentId===n?null:t.parentId}}function ci(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=Vt(e.snapshot.nodes,U(e,n)).get(t);if(i==null||!B(W(e,i)))break;n=i}return n}function li(e,t){let n=fi(e,t);if(n==null)return null;let r=Fr(e,n),i=W(e,r),a=n===r?null:Ir(e,n).map(t=>H(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:U(e,r).childIds.length>0,path:H(e,r),terminalKind:rn(i)})}function ui(e,t){return di([e],[t])}function di(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function fi(e,t){let n=t;for(;n!=null;){let t=W(e,n);if(!B(t)||on(t,2))return null;if(!er(e,n,t))return n;n=t.parentId}return null}function pi(e,t){let n=W(e,t);if(cn(n,(t===e.snapshot.rootId?-1:nn(W(e,n.parentId)))+1),!B(n))return;let r=U(e,t);for(let t of r.childIds)pi(e,t)}function mi(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=W(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function hi(e,t,n=W(e,t),r=!1){let i=e.instrumentation;if(i==null){_i(e,t,n,r);return}V(i,`store.recomputeNodeCounts`,()=>_i(e,t,n,r))}function gi(e,t){let n=t;for(;n!=null;){let t=W(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(hi(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Kt(U(e,s),n,a,o),n=s}}function _i(e,t,n,r){if(!B(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=U(e,t);if(r){let t=e.instrumentation;t==null?Gt(e.snapshot.nodes,i):V(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Gt(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,on(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Pr(e,t)==null?er(e,t,n)?1+o:1:o}function vi(e,t,n){let r=H(e,t);return r.length===0?n:`${r}${n}`}function yi(e){return e!=null&&!on(e,4)}function bi(e,t){let n=e.snapshot.nodes[t];return!yi(n)||!B(n)||on(n,2)?null:n}function xi(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&yi(e.snapshot.nodes[n])&&(t+=1);return t}function Si(e){return Math.max(0,e.valueById.length-1)}function Ci(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:xi(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Si(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function wi(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function Ti(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)bi(e,n)!=null&&t.push(H(e,n));for(let t of e.expandedDirectoryIds)bi(e,t)!=null&&n.push(H(e,t));return{collapsedPaths:t,expandedPaths:n}}function Ei(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)bi(e,n)==null||rr(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:H(e,n)});return t}function Di(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=Kr(e,n);t!=null&&tr(e,t,!0,W(e,t))}for(let n of t.collapsedPaths){let t=Kr(e,n);t!=null&&tr(e,t,!1,W(e,t))}}function Oi(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=Kr(e,n.path);t!=null&&bi(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function ki(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Ai(e){let t=e.snapshot.segmentTable,n=An();for(let r of e.snapshot.nodes)if(yi(r)){if(on(r,2)){r.nameId=0;continue}r.nameId=jn(n,Mn(t,r.nameId))}e.snapshot.segmentTable=n}function ji(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!yi(r)||!B(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return yi(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[W(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),Gt(e.snapshot.nodes,n)}}function Mi(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(yi(n))break;--t}e.snapshot.nodes.length=t+1}function Ni(e){let t=Ti(e),n=Ei(e);V(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>ki(e)),V(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Ai(e)),V(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>ji(e)),V(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>Mi(e)),V(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>Di(e,t)),V(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>Oi(e,n)),V(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>Wr(e,e.snapshot.rootId))}function Pi(e){let t=Ti(e),n=Ei(e),r=V(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>Lr(e)),i=un({...e.snapshot.options},e.instrumentation),a=V(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Yn(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,V(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>Di(e,t)),V(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>Oi(e,n)),V(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>Wr(e,e.snapshot.rootId))}function Fi(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function Ii(e,t){let n=Ci(e);t===`stable`?V(e.instrumentation,`store.cleanup.stable`,()=>Ni(e)):V(e.instrumentation,`store.cleanup.aggressive`,()=>Pi(e));let r=Ci(e);return wi(t,t===`stable`,n,r)}var Li=64;function Ri(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function zi(e){return W(e,e.snapshot.rootId).visibleSubtreeCount}function Bi(e,t,n,r){let i=W(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function Vi(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:oa(e,t.cursor),setSize:t.setSize,subtreeEndIndex:Bi(e,t.cursor,t.index,n)}}function Hi(e,t,n,r,i,a){let o=U(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=qt(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return Ui(e,u,l,r+c,i+1,s,o.childIds.length,a)}function Ui(e,t,n,r,i,a,o,s){if(!B(W(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=ea(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=W(e,c.terminalNodeId);if(!B(l)||!er(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Hi(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function Wi(e,t){let n=zi(e);if(t<0||t>=n)return null;let r=Hi(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>H(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=Vi(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:oa(e,r.cursor),setSize:r.setSize,subtreeEndIndex:Bi(e,r.cursor,r.index,n)}}function Gi(e,t,n){let r=e.instrumentation,i=zi(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return aa(e,o+1);let t=[],n=Zi(e,a);for(let r=a;r<=o&&n!=null;r++){let r=oa(e,n);t.push(r),n=na(e,n)}return t}let s=[],c=0,l=0,u=V(r,`store.getVisibleSlice.selectFirstRow`,()=>Zi(e,a));for(let t=a;t<=o&&u!=null;t++){let t=V(r,`store.getVisibleSlice.materializeRow`,()=>oa(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=V(r,`store.getVisibleSlice.advanceCursor`,()=>na(e,u))}return fn(r,`workload.visibleRowsRead`,s.length),fn(r,`workload.flattenedRowsRead`,c),fn(r,`workload.flattenedSegmentsRead`,l),s}function Ki(e,t=zi(e)){let n=e.instrumentation;return n==null?ia(e,t):V(n,`store.getVisibleTreeProjection`,()=>ia(e,t))}function qi(e){return ra(Ki(e))}function Ji(e,t){let n=Kr(e,t);if(n==null||n===e.snapshot.rootId||B(W(e,n))&&Fr(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=W(e,i).parentId,n=U(e,t),s=Ht(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Jt(a,n,s),t!==o){let n=W(e,t),a=Pr(e,t);if(!er(e,t,n)&&a!==i)return null;Fr(e,t)===t&&(r+=1)}i=t}return r}function Yi(e,t){let n=Kr(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=W(e,n);if(!B(r))throw Error(`Path is not a directory: "${t}"`);return er(e,n,r)?null:(tr(e,n,!0,r),Ur(e,n),mr({affectedAncestorIds:Gr(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function Xi(e,t){let n=Kr(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=W(e,n);if(!B(r))throw Error(`Path is not a directory: "${t}"`);return er(e,n,r)?(tr(e,n,!1,r),Ur(e,n),hr({affectedAncestorIds:Gr(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function Zi(e,t){return t<0||t>=zi(e)?null:Qi(e,e.snapshot.rootId,t,-1)}function Qi(e,t,n,r){let i=U(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?qt(e.snapshot.nodes,i,n):V(a,`store.getVisibleSlice.selectChildIndex`,()=>qt(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return $i(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function $i(e,t,n,r){if(!B(W(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=ea(e,t,r);if(n===0)return i;let a=W(e,i.terminalNodeId);if(!B(a)||!er(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return Qi(e,i.terminalNodeId,n-1,i.visibleDepth)}function ea(e,t,n){return B(W(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Fr(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:V(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Fr(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function ta(e,t){let n=W(e,t);if(!B(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:Pr(e,r)!==t}function na(e,t){let n=W(e,t.terminalNodeId);if(B(n)){let r=U(e,t.terminalNodeId);if(er(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:$i(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=W(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=U(e,n),o=Ht(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return $i(e,s,0,i);ta(e,r)&&i--,r=n}}function ra(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function ia(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(Li);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=Ri(o,y);let x,S=_;if(B(v))S=f?Fr(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:H(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&B(C)&&er(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function aa(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!B(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:H(e,f)};continue}let h=l?Fr(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=oa(e,g);let _=i[h];_!=null&&B(_)&&er(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function oa(e,t){let n=W(e,t.terminalNodeId),r=B(n)?sa(e,t):null,i=H(e,t.terminalNodeId),a=Mn(e.snapshot.segmentTable,n.nameId),o=B(n)&&U(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?Ir(e,t.headNodeId).map(n=>{let r=W(e,n);return{isTerminal:n===t.terminalNodeId,name:Mn(e.snapshot.segmentTable,r.nameId),nodeId:n,path:H(e,n)}}):V(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Ir(e,t.headNodeId).map(n=>{let r=W(e,n);return{isTerminal:n===t.terminalNodeId,name:Mn(e.snapshot.segmentTable,r.nameId),nodeId:n,path:H(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:B(n)&&er(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:B(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function sa(e,t){if(t.headNodeId===t.terminalNodeId)return rr(e,t.terminalNodeId);let n=Ir(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=rr(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function ca(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!B(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&Yt(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&B(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,Yt(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function la(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var ua=class e{#e;constructor(e={}){let t=dn(e),n=V(t,`store.builder.create`,()=>new Yn(e));if(e.preparedInput!=null){let t=Kn(e.preparedInput);t==null?n.appendPreparedPaths(Gn(e.preparedInput),!1):n.appendPresortedPaths(t,qn(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(V(t,`store.preparePathEntries`,()=>Jn(r,e)))}let r=V(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=V(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=V(t,`store.state.create`,()=>Xn(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:V(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||la(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&V(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?V(t,`store.state.initializeOpenVisibleCounts`,()=>ca(this.#e)):V(t,`store.state.recomputeCounts`,()=>Wr(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Hn(e,t)}static prepareInput(e,t={}){return Un(e,t)}static preparePresortedInput(e){return Wn(e)}list(e){return V(this.#e.instrumentation,`store.list`,()=>Lr(this.#e,e))}add(e){V(this.#e.instrumentation,`store.add`,()=>{let t=zi(this.#e);wr(this.#e,Sr(this.#e,t,Rr(this.#e,e)))})}remove(e,t={}){V(this.#e.instrumentation,`store.remove`,()=>{let n=zi(this.#e);wr(this.#e,Sr(this.#e,n,zr(this.#e,e,t)))})}move(e,t,n={}){V(this.#e.instrumentation,`store.move`,()=>{let r=zi(this.#e),i=Br(this.#e,e,t,n);i!=null&&wr(this.#e,Sr(this.#e,r,i))})}batch(e){Cr(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return V(this.#e.instrumentation,`store.getVisibleCount`,()=>zi(this.#e))}getVisibleSlice(e,t){return V(this.#e.instrumentation,`store.getVisibleSlice`,()=>Gi(this.#e,e,t))}getVisibleRowContext(e){return V(this.#e.instrumentation,`store.getVisibleRowContext`,()=>Wi(this.#e,e))}getVisibleTreeProjection(){return qi(this.#e)}getVisibleTreeProjectionData(e){return Ki(this.#e,e)}getVisibleIndex(e){return V(this.#e.instrumentation,`store.getVisibleIndex`,()=>Ji(this.#e,e))}getPathInfo(e){return V(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=Kr(this.#e,e);if(t==null)return null;let n=W(this.#e,t);return{depth:nn(n),kind:B(n)?`directory`:`file`,path:H(this.#e,t)}})}isExpanded(e){return V(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=W(this.#e,t);return er(this.#e,t,n)})}expand(e){V(this.#e.instrumentation,`store.expand`,()=>{let t=zi(this.#e),n=Yi(this.#e,e);n!=null&&wr(this.#e,Sr(this.#e,t,n))})}collapse(e){V(this.#e.instrumentation,`store.collapse`,()=>{let t=zi(this.#e),n=Xi(this.#e,e);n!=null&&wr(this.#e,Sr(this.#e,t,n))})}on(e,t){return ur(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return rr(this.#e,t)}markDirectoryUnloaded(e){V(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(U(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=zi(this.#e);ar(this.#e,t),wr(this.#e,Sr(this.#e,n,gr({affectedAncestorIds:Gr(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return V(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=zi(this.#e),r=ir(this.#e,t);return wr(this.#e,Sr(this.#e,n,_r({affectedAncestorIds:Gr(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return V(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||rr(this.#e,n)!==`loading`||!sr(this.#e,n,e.attemptId))return!1;let r=H(this.#e,n);this.validateChildPatch(r,t);let i=zi(this.#e),a=[];for(let e of t.operations){da(r,e);let t=zi(this.#e);switch(e.type){case`add`:a.push(Sr(this.#e,t,Rr(this.#e,e.path)));break;case`remove`:a.push(Sr(this.#e,t,zr(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Br(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Sr(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return wr(this.#e,Sr(this.#e,i,vr({affectedAncestorIds:Gr(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:H(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return V(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=zi(this.#e),r=or(this.#e,t,e.attemptId);return wr(this.#e,Sr(this.#e,n,yr({affectedAncestorIds:Gr(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:H(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return V(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=zi(this.#e),i=cr(this.#e,n,e.attemptId,t);return wr(this.#e,Sr(this.#e,r,br({affectedAncestorIds:Gr(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:H(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return V(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(Fi(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=zi(this.#e),n=Ii(this.#e,e.mode??`stable`);return wr(this.#e,Sr(this.#e,t,xr({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=U(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??hn(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=_n(wn(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!B(W(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=W(this.#e,n);er(this.#e,n,i)||(tr(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=W(this.#e,e);if(!er(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=Kr(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!B(W(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!B(W(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=W(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=W(this.#e,e),r=Pr(this.#e,e);if(!er(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function da(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var fa={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function pa(e,t){if(typeof e==`number`)return{itemHeight:t??fa.default.itemHeight,factor:e};let n=fa[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var ma=fa.default.itemHeight,ha=`@layer base, theme, unsafe;
|
|
2
|
+
|
|
3
|
+
@layer base {
|
|
4
|
+
:host {
|
|
5
|
+
/*
|
|
6
|
+
CSS variables use a fallback stack to ensure user and theme colors slot
|
|
7
|
+
in with ease. User colors take precedence over theme colors, which take
|
|
8
|
+
precedence over defaults.
|
|
9
|
+
|
|
10
|
+
Fallback order:
|
|
11
|
+
|
|
12
|
+
1. --trees-*-override (explicit)
|
|
13
|
+
2. --trees-theme-* (e.g. Shiki/VS Code tokens)
|
|
14
|
+
3. defaults
|
|
15
|
+
|
|
16
|
+
Theme variable names mirror Shiki/VS Code theme file JSON tokens.
|
|
17
|
+
|
|
18
|
+
// Available CSS Color Overrides
|
|
19
|
+
--trees-fg-override
|
|
20
|
+
--trees-fg-muted-override
|
|
21
|
+
--trees-bg-override
|
|
22
|
+
--trees-bg-muted-override
|
|
23
|
+
--trees-accent-override
|
|
24
|
+
--trees-border-color-override
|
|
25
|
+
|
|
26
|
+
--trees-focus-ring-color-override
|
|
27
|
+
--trees-focus-ring-width-override
|
|
28
|
+
--trees-focus-ring-offset-override
|
|
29
|
+
|
|
30
|
+
--trees-search-fg-override
|
|
31
|
+
--trees-search-font-weight-override
|
|
32
|
+
--trees-search-bg-override
|
|
33
|
+
|
|
34
|
+
--trees-selected-fg-override
|
|
35
|
+
--trees-selected-bg-override
|
|
36
|
+
--trees-selected-focused-border-color-override
|
|
37
|
+
|
|
38
|
+
// Git Status Color Overrides
|
|
39
|
+
--trees-status-added-override
|
|
40
|
+
--trees-status-ignored-override
|
|
41
|
+
--trees-status-modified-override
|
|
42
|
+
--trees-status-renamed-override
|
|
43
|
+
--trees-status-untracked-override
|
|
44
|
+
--trees-status-deleted-override
|
|
45
|
+
--trees-git-added-color-override
|
|
46
|
+
--trees-git-ignored-color-override
|
|
47
|
+
--trees-git-modified-color-override
|
|
48
|
+
--trees-git-renamed-color-override
|
|
49
|
+
--trees-git-untracked-color-override
|
|
50
|
+
--trees-git-deleted-color-override
|
|
51
|
+
|
|
52
|
+
// Built-in File Icon Color Overrides
|
|
53
|
+
--trees-file-icon-color
|
|
54
|
+
--trees-file-icon-color-astro
|
|
55
|
+
--trees-file-icon-color-babel
|
|
56
|
+
--trees-file-icon-color-bash
|
|
57
|
+
--trees-file-icon-color-biome
|
|
58
|
+
--trees-file-icon-color-bootstrap
|
|
59
|
+
--trees-file-icon-color-browserslist
|
|
60
|
+
--trees-file-icon-color-bun
|
|
61
|
+
--trees-file-icon-color-c
|
|
62
|
+
--trees-file-icon-color-cpp
|
|
63
|
+
--trees-file-icon-color-claude
|
|
64
|
+
--trees-file-icon-color-css
|
|
65
|
+
--trees-file-icon-color-database
|
|
66
|
+
--trees-file-icon-color-default
|
|
67
|
+
--trees-file-icon-color-docker
|
|
68
|
+
--trees-file-icon-color-eslint
|
|
69
|
+
--trees-file-icon-color-git
|
|
70
|
+
--trees-file-icon-color-go
|
|
71
|
+
--trees-file-icon-color-graphql
|
|
72
|
+
--trees-file-icon-color-html
|
|
73
|
+
--trees-file-icon-color-image
|
|
74
|
+
--trees-file-icon-color-javascript
|
|
75
|
+
--trees-file-icon-color-json
|
|
76
|
+
--trees-file-icon-color-markdown
|
|
77
|
+
--trees-file-icon-color-mcp
|
|
78
|
+
--trees-file-icon-color-npm
|
|
79
|
+
--trees-file-icon-color-oxc
|
|
80
|
+
--trees-file-icon-color-postcss
|
|
81
|
+
--trees-file-icon-color-prettier
|
|
82
|
+
--trees-file-icon-color-python
|
|
83
|
+
--trees-file-icon-color-react
|
|
84
|
+
--trees-file-icon-color-ruby
|
|
85
|
+
--trees-file-icon-color-rust
|
|
86
|
+
--trees-file-icon-color-sass
|
|
87
|
+
--trees-file-icon-color-svg
|
|
88
|
+
--trees-file-icon-color-svelte
|
|
89
|
+
--trees-file-icon-color-svgo
|
|
90
|
+
--trees-file-icon-color-swift
|
|
91
|
+
--trees-file-icon-color-table
|
|
92
|
+
--trees-file-icon-color-text
|
|
93
|
+
--trees-file-icon-color-tailwind
|
|
94
|
+
--trees-file-icon-color-terraform
|
|
95
|
+
--trees-file-icon-color-typescript
|
|
96
|
+
--trees-file-icon-color-vite
|
|
97
|
+
--trees-file-icon-color-vscode
|
|
98
|
+
--trees-file-icon-color-vue
|
|
99
|
+
--trees-file-icon-color-wasm
|
|
100
|
+
--trees-file-icon-color-webpack
|
|
101
|
+
--trees-file-icon-color-yml
|
|
102
|
+
--trees-file-icon-color-zig
|
|
103
|
+
--trees-file-icon-color-zip
|
|
104
|
+
|
|
105
|
+
// Density
|
|
106
|
+
//
|
|
107
|
+
// A unitless scale factor for padding, gaps, and indentation. Usually
|
|
108
|
+
// set via \`density\` on useFileTree. Individual overrides take precedence.
|
|
109
|
+
//
|
|
110
|
+
// Compact: 0.8
|
|
111
|
+
// Default: 1
|
|
112
|
+
// Relaxed: 1.2
|
|
113
|
+
//
|
|
114
|
+
--trees-density-override
|
|
115
|
+
|
|
116
|
+
// Available CSS Layout Overrides
|
|
117
|
+
--trees-gap-override
|
|
118
|
+
--trees-border-radius-override
|
|
119
|
+
--trees-font-family-override
|
|
120
|
+
--trees-font-size-override
|
|
121
|
+
--trees-font-weight-regular-override
|
|
122
|
+
--trees-font-weight-semibold-override
|
|
123
|
+
--trees-level-gap-override
|
|
124
|
+
--trees-item-padding-x-override
|
|
125
|
+
--trees-item-margin-x-override
|
|
126
|
+
--trees-item-row-gap-override
|
|
127
|
+
--trees-icon-width-override
|
|
128
|
+
--trees-icon-nudge-override
|
|
129
|
+
--trees-scrollbar-gutter-override
|
|
130
|
+
--trees-padding-inline-override
|
|
131
|
+
*/
|
|
132
|
+
|
|
133
|
+
--trees-accent: var(--trees-accent-override, #009fff);
|
|
134
|
+
--trees-fg: var(
|
|
135
|
+
--trees-fg-override,
|
|
136
|
+
var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
|
|
137
|
+
);
|
|
138
|
+
--trees-fg-muted: var(
|
|
139
|
+
--trees-fg-muted-override,
|
|
140
|
+
var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
|
|
141
|
+
);
|
|
142
|
+
--trees-bg: var(
|
|
143
|
+
--trees-bg-override,
|
|
144
|
+
var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
|
|
145
|
+
);
|
|
146
|
+
/* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
|
|
147
|
+
--trees-bg-muted: var(
|
|
148
|
+
--trees-bg-muted-override,
|
|
149
|
+
var(
|
|
150
|
+
--trees-theme-list-hover-bg,
|
|
151
|
+
light-dark(
|
|
152
|
+
color-mix(
|
|
153
|
+
in lab,
|
|
154
|
+
var(--trees-accent) var(--trees-bg-alpha-light, 8%),
|
|
155
|
+
var(--trees-bg)
|
|
156
|
+
),
|
|
157
|
+
color-mix(
|
|
158
|
+
in lab,
|
|
159
|
+
var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
|
|
160
|
+
var(--trees-bg)
|
|
161
|
+
)
|
|
162
|
+
)
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
--trees-input-bg: var(
|
|
166
|
+
--trees-input-bg-override,
|
|
167
|
+
light-dark(#f8f8f8, #070707)
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
--trees-added-light: #16a994;
|
|
171
|
+
--trees-added-dark: #00cab1;
|
|
172
|
+
--trees-ignored-light: #adadb1;
|
|
173
|
+
--trees-ignored-dark: #4a4a4e;
|
|
174
|
+
--trees-modified-light: #1ca1c7;
|
|
175
|
+
--trees-modified-dark: #08c0ef;
|
|
176
|
+
--trees-renamed-light: #d5a910;
|
|
177
|
+
--trees-renamed-dark: #ffd452;
|
|
178
|
+
--trees-untracked-light: #16a994;
|
|
179
|
+
--trees-untracked-dark: #00cab1;
|
|
180
|
+
--trees-deleted-light: #ff2e3f;
|
|
181
|
+
--trees-deleted-dark: #ff6762;
|
|
182
|
+
|
|
183
|
+
--trees-border-color: var(
|
|
184
|
+
--trees-border-color-override,
|
|
185
|
+
var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
|
|
186
|
+
);
|
|
187
|
+
--trees-indent-guide-bg: var(
|
|
188
|
+
--trees-indent-guide-bg-override,
|
|
189
|
+
color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
|
|
190
|
+
);
|
|
191
|
+
--trees-density: var(--trees-density-override, 1);
|
|
192
|
+
--trees-border-radius: var(
|
|
193
|
+
--trees-border-radius-override,
|
|
194
|
+
calc(6px * var(--trees-density))
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
--trees-font-family: var(--trees-font-family-override, system-ui);
|
|
198
|
+
--trees-font-size: var(--trees-font-size-override, 13px);
|
|
199
|
+
--trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
|
|
200
|
+
--trees-font-weight-semibold: var(
|
|
201
|
+
--trees-font-weight-semibold-override,
|
|
202
|
+
600
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
--trees-focus-ring-color: var(
|
|
206
|
+
--trees-focus-ring-color-override,
|
|
207
|
+
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
208
|
+
);
|
|
209
|
+
--trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
|
|
210
|
+
--trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
|
|
211
|
+
|
|
212
|
+
--trees-search-fg: var(
|
|
213
|
+
--trees-search-fg-override,
|
|
214
|
+
var(--trees-theme-input-fg, var(--trees-fg))
|
|
215
|
+
);
|
|
216
|
+
--trees-search-font-weight: var(--trees-search-font-weight-override, 600);
|
|
217
|
+
--trees-search-bg: var(
|
|
218
|
+
--trees-search-bg-override,
|
|
219
|
+
var(--trees-theme-input-bg, var(--trees-input-bg))
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
--trees-scrollbar-thumb: var(
|
|
223
|
+
--trees-scrollbar-thumb-override,
|
|
224
|
+
var(
|
|
225
|
+
--trees-theme-scrollbar-thumb,
|
|
226
|
+
color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
|
|
227
|
+
)
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
--trees-selected-fg: var(
|
|
231
|
+
--trees-selected-fg-override,
|
|
232
|
+
var(--trees-theme-list-active-selection-fg, var(--trees-fg))
|
|
233
|
+
);
|
|
234
|
+
--trees-selected-bg: var(
|
|
235
|
+
--trees-selected-bg-override,
|
|
236
|
+
var(
|
|
237
|
+
--trees-theme-list-active-selection-bg,
|
|
238
|
+
light-dark(
|
|
239
|
+
color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
|
|
240
|
+
color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
|
|
241
|
+
)
|
|
242
|
+
)
|
|
243
|
+
);
|
|
244
|
+
--trees-selected-focused-border-color: var(
|
|
245
|
+
--trees-selected-focused-border-color-override,
|
|
246
|
+
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
/* Git status (e.g. from Shiki theme gitDecoration.*) */
|
|
250
|
+
--trees-status-added: var(
|
|
251
|
+
--trees-status-added-override,
|
|
252
|
+
var(
|
|
253
|
+
--trees-theme-git-added-fg,
|
|
254
|
+
light-dark(var(--trees-added-light), var(--trees-added-dark))
|
|
255
|
+
)
|
|
256
|
+
);
|
|
257
|
+
--trees-status-ignored: var(
|
|
258
|
+
--trees-status-ignored-override,
|
|
259
|
+
var(
|
|
260
|
+
--trees-theme-git-ignored-fg,
|
|
261
|
+
light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
--trees-status-modified: var(
|
|
265
|
+
--trees-status-modified-override,
|
|
266
|
+
var(
|
|
267
|
+
--trees-theme-git-modified-fg,
|
|
268
|
+
light-dark(var(--trees-modified-light), var(--trees-modified-dark))
|
|
269
|
+
)
|
|
270
|
+
);
|
|
271
|
+
--trees-status-renamed: var(
|
|
272
|
+
--trees-status-renamed-override,
|
|
273
|
+
var(
|
|
274
|
+
--trees-theme-git-renamed-fg,
|
|
275
|
+
light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
|
|
276
|
+
)
|
|
277
|
+
);
|
|
278
|
+
--trees-status-untracked: var(
|
|
279
|
+
--trees-status-untracked-override,
|
|
280
|
+
var(
|
|
281
|
+
--trees-theme-git-untracked-fg,
|
|
282
|
+
light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
|
|
283
|
+
)
|
|
284
|
+
);
|
|
285
|
+
--trees-status-deleted: var(
|
|
286
|
+
--trees-status-deleted-override,
|
|
287
|
+
var(
|
|
288
|
+
--trees-theme-git-deleted-fg,
|
|
289
|
+
light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
|
|
290
|
+
)
|
|
291
|
+
);
|
|
292
|
+
--trees-git-modified-color: var(
|
|
293
|
+
--trees-git-modified-color-override,
|
|
294
|
+
var(--trees-status-modified)
|
|
295
|
+
);
|
|
296
|
+
--trees-git-added-color: var(
|
|
297
|
+
--trees-git-added-color-override,
|
|
298
|
+
var(--trees-status-added)
|
|
299
|
+
);
|
|
300
|
+
--trees-git-ignored-color: var(
|
|
301
|
+
--trees-git-ignored-color-override,
|
|
302
|
+
var(--trees-status-ignored)
|
|
303
|
+
);
|
|
304
|
+
--trees-git-deleted-color: var(
|
|
305
|
+
--trees-git-deleted-color-override,
|
|
306
|
+
var(--trees-status-deleted)
|
|
307
|
+
);
|
|
308
|
+
--trees-git-renamed-color: var(
|
|
309
|
+
--trees-git-renamed-color-override,
|
|
310
|
+
var(--trees-status-renamed)
|
|
311
|
+
);
|
|
312
|
+
--trees-git-untracked-color: var(
|
|
313
|
+
--trees-git-untracked-color-override,
|
|
314
|
+
var(--trees-status-untracked)
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
--trees-icon-gray: light-dark(#84848a, #adadb1);
|
|
318
|
+
--trees-icon-red: light-dark(#d52c36, #ff6762);
|
|
319
|
+
--trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
|
|
320
|
+
--trees-icon-orange: light-dark(#d47628, #ffa359);
|
|
321
|
+
--trees-icon-yellow: light-dark(#d5a910, #ffd452);
|
|
322
|
+
--trees-icon-green: light-dark(#199f43, #5ecc71);
|
|
323
|
+
--trees-icon-teal: light-dark(#17a5af, #64d1db);
|
|
324
|
+
--trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
|
|
325
|
+
--trees-icon-blue: light-dark(#1a85d4, #69b1ff);
|
|
326
|
+
--trees-icon-indigo: light-dark(#693acf, #9d6afb);
|
|
327
|
+
--trees-icon-purple: light-dark(#a631be, #d568ea);
|
|
328
|
+
--trees-icon-pink: light-dark(#d32a61, #ff678d);
|
|
329
|
+
--trees-icon-mauve: light-dark(#594c5b, #79697b);
|
|
330
|
+
|
|
331
|
+
--trees-file-icon-color-default: var(
|
|
332
|
+
--trees-file-icon-color,
|
|
333
|
+
var(--trees-icon-gray)
|
|
334
|
+
);
|
|
335
|
+
--trees-file-icon-color-astro: var(
|
|
336
|
+
--trees-file-icon-color,
|
|
337
|
+
var(--trees-icon-purple)
|
|
338
|
+
);
|
|
339
|
+
--trees-file-icon-color-babel: var(
|
|
340
|
+
--trees-file-icon-color,
|
|
341
|
+
var(--trees-icon-yellow)
|
|
342
|
+
);
|
|
343
|
+
--trees-file-icon-color-bash: var(
|
|
344
|
+
--trees-file-icon-color,
|
|
345
|
+
var(--trees-icon-green)
|
|
346
|
+
);
|
|
347
|
+
--trees-file-icon-color-biome: var(
|
|
348
|
+
--trees-file-icon-color,
|
|
349
|
+
var(--trees-icon-blue)
|
|
350
|
+
);
|
|
351
|
+
--trees-file-icon-color-bootstrap: var(
|
|
352
|
+
--trees-file-icon-color,
|
|
353
|
+
var(--trees-icon-indigo)
|
|
354
|
+
);
|
|
355
|
+
--trees-file-icon-color-browserslist: var(
|
|
356
|
+
--trees-file-icon-color,
|
|
357
|
+
var(--trees-icon-yellow)
|
|
358
|
+
);
|
|
359
|
+
--trees-file-icon-color-bun: var(
|
|
360
|
+
--trees-file-icon-color,
|
|
361
|
+
var(--trees-icon-mauve)
|
|
362
|
+
);
|
|
363
|
+
--trees-file-icon-color-c: var(
|
|
364
|
+
--trees-file-icon-color,
|
|
365
|
+
var(--trees-icon-blue)
|
|
366
|
+
);
|
|
367
|
+
--trees-file-icon-color-cpp: var(
|
|
368
|
+
--trees-file-icon-color,
|
|
369
|
+
var(--trees-icon-blue)
|
|
370
|
+
);
|
|
371
|
+
--trees-file-icon-color-claude: var(
|
|
372
|
+
--trees-file-icon-color,
|
|
373
|
+
var(--trees-icon-orange)
|
|
374
|
+
);
|
|
375
|
+
--trees-file-icon-color-css: var(
|
|
376
|
+
--trees-file-icon-color,
|
|
377
|
+
var(--trees-icon-indigo)
|
|
378
|
+
);
|
|
379
|
+
--trees-file-icon-color-database: var(
|
|
380
|
+
--trees-file-icon-color,
|
|
381
|
+
var(--trees-icon-purple)
|
|
382
|
+
);
|
|
383
|
+
--trees-file-icon-color-docker: var(
|
|
384
|
+
--trees-file-icon-color,
|
|
385
|
+
var(--trees-icon-blue)
|
|
386
|
+
);
|
|
387
|
+
--trees-file-icon-color-eslint: var(
|
|
388
|
+
--trees-file-icon-color,
|
|
389
|
+
var(--trees-icon-indigo)
|
|
390
|
+
);
|
|
391
|
+
--trees-file-icon-color-git: var(
|
|
392
|
+
--trees-file-icon-vermilion,
|
|
393
|
+
var(--trees-icon-vermilion)
|
|
394
|
+
);
|
|
395
|
+
--trees-file-icon-color-go: var(
|
|
396
|
+
--trees-file-icon-color,
|
|
397
|
+
var(--trees-icon-cyan)
|
|
398
|
+
);
|
|
399
|
+
--trees-file-icon-color-graphql: var(
|
|
400
|
+
--trees-file-icon-color,
|
|
401
|
+
var(--trees-icon-pink)
|
|
402
|
+
);
|
|
403
|
+
--trees-file-icon-color-html: var(
|
|
404
|
+
--trees-file-icon-color,
|
|
405
|
+
var(--trees-icon-orange)
|
|
406
|
+
);
|
|
407
|
+
--trees-file-icon-color-image: var(
|
|
408
|
+
--trees-file-icon-color,
|
|
409
|
+
var(--trees-icon-pink)
|
|
410
|
+
);
|
|
411
|
+
--trees-file-icon-color-javascript: var(
|
|
412
|
+
--trees-file-icon-color,
|
|
413
|
+
var(--trees-icon-yellow)
|
|
414
|
+
);
|
|
415
|
+
--trees-file-icon-color-json: var(
|
|
416
|
+
--trees-file-icon-color,
|
|
417
|
+
var(--trees-icon-orange)
|
|
418
|
+
);
|
|
419
|
+
--trees-file-icon-color-markdown: var(
|
|
420
|
+
--trees-file-icon-color,
|
|
421
|
+
var(--trees-icon-green)
|
|
422
|
+
);
|
|
423
|
+
--trees-file-icon-color-mcp: var(
|
|
424
|
+
--trees-file-icon-color,
|
|
425
|
+
var(--trees-icon-teal)
|
|
426
|
+
);
|
|
427
|
+
--trees-file-icon-color-npm: var(
|
|
428
|
+
--trees-file-icon-color,
|
|
429
|
+
var(--trees-icon-red)
|
|
430
|
+
);
|
|
431
|
+
--trees-file-icon-color-oxc: var(
|
|
432
|
+
--trees-file-icon-cyan,
|
|
433
|
+
var(--trees-icon-cyan)
|
|
434
|
+
);
|
|
435
|
+
--trees-file-icon-color-postcss: var(
|
|
436
|
+
--trees-file-icon-color,
|
|
437
|
+
var(--trees-icon-red)
|
|
438
|
+
);
|
|
439
|
+
--trees-file-icon-color-prettier: var(
|
|
440
|
+
--trees-file-icon-color,
|
|
441
|
+
var(--trees-icon-teal)
|
|
442
|
+
);
|
|
443
|
+
--trees-file-icon-color-python: var(
|
|
444
|
+
--trees-file-icon-color,
|
|
445
|
+
var(--trees-icon-blue)
|
|
446
|
+
);
|
|
447
|
+
--trees-file-icon-color-react: var(
|
|
448
|
+
--trees-file-icon-color,
|
|
449
|
+
var(--trees-icon-cyan)
|
|
450
|
+
);
|
|
451
|
+
--trees-file-icon-color-ruby: var(
|
|
452
|
+
--trees-file-icon-color,
|
|
453
|
+
var(--trees-icon-red)
|
|
454
|
+
);
|
|
455
|
+
--trees-file-icon-color-rust: var(
|
|
456
|
+
--trees-file-icon-color,
|
|
457
|
+
var(--trees-icon-orange)
|
|
458
|
+
);
|
|
459
|
+
--trees-file-icon-color-sass: var(
|
|
460
|
+
--trees-file-icon-color,
|
|
461
|
+
var(--trees-icon-pink)
|
|
462
|
+
);
|
|
463
|
+
--trees-file-icon-color-svg: var(
|
|
464
|
+
--trees-file-icon-color,
|
|
465
|
+
var(--trees-icon-orange)
|
|
466
|
+
);
|
|
467
|
+
--trees-file-icon-color-svelte: var(
|
|
468
|
+
--trees-file-icon-color,
|
|
469
|
+
var(--trees-icon-red)
|
|
470
|
+
);
|
|
471
|
+
--trees-file-icon-color-svgo: var(
|
|
472
|
+
--trees-file-icon-color,
|
|
473
|
+
var(--trees-icon-green)
|
|
474
|
+
);
|
|
475
|
+
--trees-file-icon-color-swift: var(
|
|
476
|
+
--trees-file-icon-color,
|
|
477
|
+
var(--trees-icon-orange)
|
|
478
|
+
);
|
|
479
|
+
--trees-file-icon-color-table: var(
|
|
480
|
+
--trees-file-icon-color,
|
|
481
|
+
var(--trees-icon-teal)
|
|
482
|
+
);
|
|
483
|
+
--trees-file-icon-color-text: var(
|
|
484
|
+
--trees-file-icon-color,
|
|
485
|
+
var(--trees-icon-gray)
|
|
486
|
+
);
|
|
487
|
+
--trees-file-icon-color-tailwind: var(
|
|
488
|
+
--trees-file-icon-color,
|
|
489
|
+
var(--trees-icon-cyan)
|
|
490
|
+
);
|
|
491
|
+
--trees-file-icon-color-terraform: var(
|
|
492
|
+
--trees-file-icon-color,
|
|
493
|
+
var(--trees-icon-indigo)
|
|
494
|
+
);
|
|
495
|
+
--trees-file-icon-color-typescript: var(
|
|
496
|
+
--trees-file-icon-color,
|
|
497
|
+
var(--trees-icon-blue)
|
|
498
|
+
);
|
|
499
|
+
--trees-file-icon-color-vite: var(
|
|
500
|
+
--trees-file-icon-color,
|
|
501
|
+
var(--trees-icon-purple)
|
|
502
|
+
);
|
|
503
|
+
--trees-file-icon-color-vscode: var(
|
|
504
|
+
--trees-file-icon-color,
|
|
505
|
+
var(--trees-icon-blue)
|
|
506
|
+
);
|
|
507
|
+
--trees-file-icon-color-vue: var(
|
|
508
|
+
--trees-file-icon-color,
|
|
509
|
+
var(--trees-icon-green)
|
|
510
|
+
);
|
|
511
|
+
--trees-file-icon-color-wasm: var(
|
|
512
|
+
--trees-file-icon-color,
|
|
513
|
+
var(--trees-icon-indigo)
|
|
514
|
+
);
|
|
515
|
+
--trees-file-icon-color-webpack: var(
|
|
516
|
+
--trees-file-icon-color,
|
|
517
|
+
var(--trees-icon-blue)
|
|
518
|
+
);
|
|
519
|
+
--trees-file-icon-color-yml: var(
|
|
520
|
+
--trees-file-icon-color,
|
|
521
|
+
var(--trees-icon-red)
|
|
522
|
+
);
|
|
523
|
+
--trees-file-icon-color-zig: var(
|
|
524
|
+
--trees-file-icon-color,
|
|
525
|
+
var(--trees-icon-orange)
|
|
526
|
+
);
|
|
527
|
+
--trees-file-icon-color-zip: var(
|
|
528
|
+
--trees-file-icon-color,
|
|
529
|
+
var(--trees-icon-orange)
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
--trees-level-gap: var(
|
|
533
|
+
--trees-level-gap-override,
|
|
534
|
+
calc(8px * var(--trees-density))
|
|
535
|
+
);
|
|
536
|
+
--trees-item-padding-x: var(
|
|
537
|
+
--trees-item-padding-x-override,
|
|
538
|
+
calc(8px * var(--trees-density))
|
|
539
|
+
);
|
|
540
|
+
--trees-item-margin-x: var(
|
|
541
|
+
--trees-item-margin-x-override,
|
|
542
|
+
calc(2px * var(--trees-density))
|
|
543
|
+
);
|
|
544
|
+
--trees-item-row-gap: var(
|
|
545
|
+
--trees-item-row-gap-override,
|
|
546
|
+
calc(6px * var(--trees-density))
|
|
547
|
+
);
|
|
548
|
+
--trees-icon-width: var(--trees-icon-width-override, 16px);
|
|
549
|
+
--trees-icon-nudge: var(
|
|
550
|
+
--trees-icon-nudge-override,
|
|
551
|
+
calc(1px * var(--trees-density))
|
|
552
|
+
);
|
|
553
|
+
--trees-row-height: var(--trees-item-height, 30px);
|
|
554
|
+
--trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
|
|
555
|
+
--trees-action-lane-width: var(
|
|
556
|
+
--trees-action-lane-width-override,
|
|
557
|
+
calc(var(--trees-icon-width) + 2px)
|
|
558
|
+
);
|
|
559
|
+
/* Keep the floating trigger aligned with the row's action lane. Going in
|
|
560
|
+
from the root's right edge: the scroll container reserves
|
|
561
|
+
\`--trees-padding-inline\` of effective inset on each side (its asymmetric
|
|
562
|
+
padding formula cancels the scrollbar gutter on the right), the row
|
|
563
|
+
sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
|
|
564
|
+
action lane itself. The trigger's own focus-ring margin then trims one
|
|
565
|
+
pixel back so the button's visible right edge lines up with the lane. */
|
|
566
|
+
--trees-context-menu-trigger-inline-offset: calc(
|
|
567
|
+
var(--trees-padding-inline) + var(--trees-item-padding-x) -
|
|
568
|
+
var(--trees-focus-ring-width)
|
|
569
|
+
);
|
|
570
|
+
|
|
571
|
+
--trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
|
|
572
|
+
--trees-padding-inline: var(--trees-padding-inline-override, 16px);
|
|
573
|
+
|
|
574
|
+
color-scheme: light dark;
|
|
575
|
+
display: flex;
|
|
576
|
+
flex-direction: column;
|
|
577
|
+
font-size: var(--trees-font-size);
|
|
578
|
+
color: var(--trees-fg);
|
|
579
|
+
background-color: var(--trees-bg);
|
|
580
|
+
--truncate-marker-background-color: var(--trees-bg);
|
|
581
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
582
|
+
font-family: var(--trees-font-family);
|
|
583
|
+
font-weight: var(--trees-font-weight-regular);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
:host([data-file-tree-virtualized='true']) {
|
|
587
|
+
height: 100%;
|
|
588
|
+
overflow: hidden;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
[data-file-tree-virtualized-wrapper='true'] {
|
|
592
|
+
height: 100%;
|
|
593
|
+
overflow: hidden;
|
|
594
|
+
display: flex;
|
|
595
|
+
flex-direction: column;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
[data-file-tree-virtualized-root='true'] {
|
|
599
|
+
height: 100%;
|
|
600
|
+
display: flex;
|
|
601
|
+
flex-direction: column;
|
|
602
|
+
overflow: hidden;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
[data-file-tree-virtualized-scroll='true'],
|
|
606
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
607
|
+
--trees-scrollbar-thumb-current: transparent;
|
|
608
|
+
overflow-y: auto;
|
|
609
|
+
scrollbar-gutter: stable;
|
|
610
|
+
|
|
611
|
+
&:hover {
|
|
612
|
+
--trees-scrollbar-thumb-current: var(--trees-scrollbar-thumb);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
&::-webkit-scrollbar {
|
|
616
|
+
width: var(--trees-scrollbar-gutter);
|
|
617
|
+
height: var(--trees-scrollbar-gutter);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
&::-webkit-scrollbar-track {
|
|
621
|
+
background: transparent;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
&::-webkit-scrollbar-thumb {
|
|
625
|
+
background-color: var(--trees-scrollbar-thumb-current);
|
|
626
|
+
border: 1px solid transparent;
|
|
627
|
+
background-clip: content-box;
|
|
628
|
+
border-radius: calc(var(--trees-scrollbar-gutter) / 2);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
&::-webkit-scrollbar-corner {
|
|
632
|
+
background-color: transparent;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/* These are styles for a temporarily generated element to measure the size
|
|
637
|
+
* of the scrollbar. It's intended to be somewhat similar in scrollbar style
|
|
638
|
+
* scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
|
|
639
|
+
* accurate reflection of the size the scrollbar gutter takes up. */
|
|
640
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
641
|
+
position: absolute;
|
|
642
|
+
top: 0;
|
|
643
|
+
left: 0;
|
|
644
|
+
visibility: hidden;
|
|
645
|
+
pointer-events: none;
|
|
646
|
+
width: 100px;
|
|
647
|
+
height: 100px;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
@supports (-moz-appearance: none) {
|
|
651
|
+
[data-file-tree-virtualized-scroll='true'],
|
|
652
|
+
[data-file-tree-scrollbar-measure='true'] {
|
|
653
|
+
scrollbar-width: thin;
|
|
654
|
+
scrollbar-color: var(--trees-scrollbar-thumb-current) transparent;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
659
|
+
position: relative;
|
|
660
|
+
overflow-y: auto;
|
|
661
|
+
flex: 1 1 0;
|
|
662
|
+
min-height: 0;
|
|
663
|
+
padding-inline: max(
|
|
664
|
+
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
665
|
+
0px
|
|
666
|
+
)
|
|
667
|
+
/* NOTE(amadeus): We can assume that all Webkit based browser gutters
|
|
668
|
+
* will align to the value of '--trees-scrollbar-gutter', however if not, then
|
|
669
|
+
* \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
|
|
670
|
+
* hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
|
|
671
|
+
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
672
|
+
*/
|
|
673
|
+
max(
|
|
674
|
+
calc(
|
|
675
|
+
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
676
|
+
var(
|
|
677
|
+
--trees-scrollbar-gutter-measured,
|
|
678
|
+
var(--trees-scrollbar-gutter)
|
|
679
|
+
)
|
|
680
|
+
),
|
|
681
|
+
0px
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
@supports (-moz-appearance: none) {
|
|
686
|
+
[data-file-tree-virtualized-scroll='true'] {
|
|
687
|
+
padding-inline: max(
|
|
688
|
+
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
689
|
+
0px
|
|
690
|
+
)
|
|
691
|
+
/* NOTE(amadeus): However on Firefox it can vary a little bit, but most
|
|
692
|
+
* likely the majority of cases will default to a 0px width scrollbar lets
|
|
693
|
+
* inherit that first to avoid SSR jumps. In non-SSR'd environments
|
|
694
|
+
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
695
|
+
*/
|
|
696
|
+
max(
|
|
697
|
+
calc(
|
|
698
|
+
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
699
|
+
var(--trees-scrollbar-gutter-measured, 0px)
|
|
700
|
+
),
|
|
701
|
+
0px
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
[data-file-tree-sticky-overlay='true'] {
|
|
707
|
+
position: sticky;
|
|
708
|
+
top: 0;
|
|
709
|
+
height: 0;
|
|
710
|
+
z-index: 4;
|
|
711
|
+
overflow: visible;
|
|
712
|
+
pointer-events: none;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/* The overlay DOM is kept populated even at scrollTop=0 so the browser has
|
|
716
|
+
* the rendered rows on hand the moment scrolling begins — otherwise the
|
|
717
|
+
* compositor paints a scrolled frame before React can mount the overlay,
|
|
718
|
+
* and the topmost sticky folder jumps up by a couple of pixels before it
|
|
719
|
+
* "snaps" into its pinned position. We hide it via CSS whenever the scroll
|
|
720
|
+
* is at the top and no scroll is in progress, so the preview doesn't leak
|
|
721
|
+
* through at rest. \`data-overlay-reveal\` is stamped on the root only when
|
|
722
|
+
* the user initiates a scroll while already at the top — exactly the case
|
|
723
|
+
* where we need the pre-mounted overlay to be visible through the first
|
|
724
|
+
* compositor frame. It is deliberately distinct from the general
|
|
725
|
+
* \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
|
|
726
|
+
* navigation) re-hides the overlay the instant the scroll lands, rather
|
|
727
|
+
* than waiting for the hover-suppression timer to elapse. */
|
|
728
|
+
[data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
|
|
729
|
+
[data-overlay-reveal]
|
|
730
|
+
)
|
|
731
|
+
[data-file-tree-sticky-overlay='true'] {
|
|
732
|
+
visibility: hidden;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
[data-file-tree-sticky-overlay-content='true'] {
|
|
736
|
+
background-color: var(--trees-bg);
|
|
737
|
+
position: relative;
|
|
738
|
+
pointer-events: none;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
[data-file-tree-virtualized-list='true'] {
|
|
742
|
+
background-color: var(--trees-bg);
|
|
743
|
+
position: relative;
|
|
744
|
+
min-height: 100%;
|
|
745
|
+
width: 100%;
|
|
746
|
+
overflow-anchor: none;
|
|
747
|
+
|
|
748
|
+
&[data-is-scrolling] {
|
|
749
|
+
pointer-events: none;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
[data-file-tree-virtualized-sticky-offset='true'] {
|
|
754
|
+
contain: layout size;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
[data-file-tree-virtualized-sticky='true'] {
|
|
758
|
+
position: sticky;
|
|
759
|
+
top: 0;
|
|
760
|
+
width: 100%;
|
|
761
|
+
display: flex;
|
|
762
|
+
flex-direction: column;
|
|
763
|
+
isolation: isolate;
|
|
764
|
+
/* Promote to its own compositor layer so text inside the window is
|
|
765
|
+
* rasterized once and GPU-translated during scroll. Without this, the
|
|
766
|
+
* browser re-paints the window (and its text) at every scroll frame,
|
|
767
|
+
* which produces visible 1px shake / character tearing. */
|
|
768
|
+
will-change: transform;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
[data-file-tree-search-container] {
|
|
772
|
+
display: flex;
|
|
773
|
+
padding: 0;
|
|
774
|
+
padding-inline: var(--trees-padding-inline);
|
|
775
|
+
margin-bottom: var(--trees-item-row-gap);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
[data-file-tree-search-input] {
|
|
779
|
+
--trees-focus-ring-width: 2px;
|
|
780
|
+
font-family: var(--trees-font-family);
|
|
781
|
+
font-size: var(--trees-font-size);
|
|
782
|
+
flex: 1;
|
|
783
|
+
height: var(--trees-row-height);
|
|
784
|
+
/* 1px breathing room so the focus-visible outline isn't clipped when the
|
|
785
|
+
* input sits flush against the top of the scroll container. */
|
|
786
|
+
margin-block: 1px;
|
|
787
|
+
padding-inline: var(--trees-item-padding-x);
|
|
788
|
+
line-height: var(--trees-row-height);
|
|
789
|
+
color: var(--trees-search-fg);
|
|
790
|
+
background-color: var(--trees-search-bg);
|
|
791
|
+
border: 1px solid var(--trees-border-color);
|
|
792
|
+
border-radius: var(--trees-border-radius);
|
|
793
|
+
outline: none;
|
|
794
|
+
|
|
795
|
+
&::placeholder {
|
|
796
|
+
color: color-mix(
|
|
797
|
+
in lab,
|
|
798
|
+
var(--trees-search-fg) 65%,
|
|
799
|
+
var(--trees-search-bg)
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
&:focus-visible,
|
|
804
|
+
&[data-file-tree-search-input-fake-focus='true'] {
|
|
805
|
+
outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
|
|
806
|
+
outline-offset: var(--trees-focus-ring-offset);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/* The wrapper for the tree items */
|
|
811
|
+
[role='tree'] {
|
|
812
|
+
position: relative;
|
|
813
|
+
display: flex;
|
|
814
|
+
flex-direction: column;
|
|
815
|
+
gap: var(--trees-gap-override, 0);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/* LIST ITEM */
|
|
819
|
+
[data-type='item'] {
|
|
820
|
+
color: inherit;
|
|
821
|
+
font-family: var(--trees-font-family);
|
|
822
|
+
font-size: var(--trees-font-size);
|
|
823
|
+
text-align: start;
|
|
824
|
+
outline: none;
|
|
825
|
+
background-color: var(--trees-bg);
|
|
826
|
+
border: none;
|
|
827
|
+
position: relative;
|
|
828
|
+
|
|
829
|
+
padding: 0 var(--trees-item-padding-x);
|
|
830
|
+
margin: 0 var(--trees-item-margin-x);
|
|
831
|
+
cursor: pointer;
|
|
832
|
+
-webkit-user-select: none;
|
|
833
|
+
user-select: none;
|
|
834
|
+
-webkit-touch-callout: none;
|
|
835
|
+
touch-action: manipulation;
|
|
836
|
+
display: flex;
|
|
837
|
+
flex: 0 0 var(--trees-row-height);
|
|
838
|
+
align-items: center;
|
|
839
|
+
height: var(--trees-row-height);
|
|
840
|
+
line-height: var(--trees-row-height);
|
|
841
|
+
gap: var(--trees-item-row-gap);
|
|
842
|
+
border-radius: var(--trees-border-radius);
|
|
843
|
+
/* Row states may be translucent, so markers paint the tree background first
|
|
844
|
+
* and then the state color on top to avoid compositing the same alpha twice. */
|
|
845
|
+
--truncate-marker-background-color: var(--trees-bg);
|
|
846
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
847
|
+
--truncate-marker-block-inset: 0px;
|
|
848
|
+
|
|
849
|
+
&:hover,
|
|
850
|
+
&[data-item-context-hover='true'] {
|
|
851
|
+
background-color: var(--trees-bg-muted);
|
|
852
|
+
--truncate-marker-background-overlay-color: var(--trees-bg-muted);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
&[data-item-focused='true'],
|
|
856
|
+
&:focus-visible {
|
|
857
|
+
z-index: 2;
|
|
858
|
+
|
|
859
|
+
/* Flattened segment markers sit high enough to cover the row outline unless
|
|
860
|
+
* their painted background is inset by the focus ring width. */
|
|
861
|
+
[data-item-flattened-subitems] {
|
|
862
|
+
--truncate-marker-block-inset: var(--trees-focus-ring-width);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
&::before {
|
|
866
|
+
position: absolute;
|
|
867
|
+
inset: 0;
|
|
868
|
+
content: '';
|
|
869
|
+
display: block;
|
|
870
|
+
border-radius: var(--trees-border-radius);
|
|
871
|
+
outline: var(--trees-focus-ring-width) solid
|
|
872
|
+
var(--trees-focus-ring-color);
|
|
873
|
+
outline-offset: var(--trees-focus-ring-offset);
|
|
874
|
+
pointer-events: none;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
&[data-item-selected='true']::before {
|
|
878
|
+
outline-color: var(--trees-selected-focused-border-color);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
&[data-item-selected='true'] {
|
|
883
|
+
color: var(--trees-selected-fg);
|
|
884
|
+
background-color: var(--trees-selected-bg);
|
|
885
|
+
--truncate-marker-background-overlay-color: var(--trees-selected-bg);
|
|
886
|
+
z-index: 3;
|
|
887
|
+
|
|
888
|
+
[data-item-section='icon'] {
|
|
889
|
+
color: var(--trees-selected-fg);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
&[data-item-search-match='true'] {
|
|
894
|
+
font-weight: var(--trees-search-font-weight);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
899
|
+
pointer-events: auto;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/* Sticky rows opt back into pointer events because the overlay wrapper is
|
|
903
|
+
* inert. During scroll, put them back under the same hover suppression as
|
|
904
|
+
* the virtualized list so translucent hover states and menu triggers do not
|
|
905
|
+
* paint over rows moving beneath the sticky stack. */
|
|
906
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
907
|
+
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
908
|
+
pointer-events: none;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
912
|
+
[data-type='item'][data-file-tree-sticky-row='true']:hover:not(
|
|
913
|
+
[data-item-selected='true']
|
|
914
|
+
),
|
|
915
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
916
|
+
[data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
|
|
917
|
+
[data-item-selected='true']
|
|
918
|
+
) {
|
|
919
|
+
background-color: var(--trees-bg);
|
|
920
|
+
--truncate-marker-background-overlay-color: transparent;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
[data-item-selected='true']:has(+ [data-item-selected='true']) {
|
|
924
|
+
border-bottom-left-radius: 0;
|
|
925
|
+
border-bottom-right-radius: 0;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
[data-item-selected='true'] + [data-item-selected='true'] {
|
|
929
|
+
border-top-left-radius: 0;
|
|
930
|
+
border-top-right-radius: 0;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/* Flattened Directory Parts */
|
|
934
|
+
[data-item-flattened-subitems] {
|
|
935
|
+
display: inline-flex;
|
|
936
|
+
align-items: center;
|
|
937
|
+
gap: 2px;
|
|
938
|
+
}
|
|
939
|
+
[data-item-flattened-subitem]:hover,
|
|
940
|
+
[data-item-flattened-subitem-drag-target='true'] {
|
|
941
|
+
text-decoration: underline;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/* Icon for each item */
|
|
945
|
+
[data-item-section='icon'] {
|
|
946
|
+
flex-shrink: 0;
|
|
947
|
+
display: flex;
|
|
948
|
+
align-items: center;
|
|
949
|
+
justify-content: center;
|
|
950
|
+
color: var(--trees-fg-muted);
|
|
951
|
+
fill: currentColor;
|
|
952
|
+
width: var(--trees-icon-width);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
:where([data-item-section='icon'] > [data-icon-token]) {
|
|
956
|
+
color: var(--trees-fg-muted);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-file-tree-colored-icons='true'] {
|
|
960
|
+
[data-icon-token='astro'] {
|
|
961
|
+
color: var(--trees-file-icon-color-astro);
|
|
962
|
+
}
|
|
963
|
+
[data-icon-token='babel'] {
|
|
964
|
+
color: var(--trees-file-icon-color-babel);
|
|
965
|
+
}
|
|
966
|
+
[data-icon-token='bash'] {
|
|
967
|
+
color: var(--trees-file-icon-color-bash);
|
|
968
|
+
}
|
|
969
|
+
[data-icon-token='biome'] {
|
|
970
|
+
color: var(--trees-file-icon-color-biome);
|
|
971
|
+
}
|
|
972
|
+
[data-icon-token='bootstrap'] {
|
|
973
|
+
color: var(--trees-file-icon-color-bootstrap);
|
|
974
|
+
}
|
|
975
|
+
[data-icon-token='browserslist'] {
|
|
976
|
+
color: var(--trees-file-icon-color-browserslist);
|
|
977
|
+
}
|
|
978
|
+
[data-icon-token='bun'] {
|
|
979
|
+
color: var(--trees-file-icon-color-bun);
|
|
980
|
+
}
|
|
981
|
+
[data-icon-token='c'] {
|
|
982
|
+
color: var(--trees-file-icon-color-c);
|
|
983
|
+
}
|
|
984
|
+
[data-icon-token='cpp'] {
|
|
985
|
+
color: var(--trees-file-icon-color-cpp);
|
|
986
|
+
}
|
|
987
|
+
[data-icon-token='claude'] {
|
|
988
|
+
color: var(--trees-file-icon-color-claude);
|
|
989
|
+
}
|
|
990
|
+
[data-icon-token='css'] {
|
|
991
|
+
color: var(--trees-file-icon-color-css);
|
|
992
|
+
}
|
|
993
|
+
[data-icon-token='database'] {
|
|
994
|
+
color: var(--trees-file-icon-color-database);
|
|
995
|
+
}
|
|
996
|
+
[data-icon-token='default'] {
|
|
997
|
+
color: var(--trees-file-icon-color-default);
|
|
998
|
+
}
|
|
999
|
+
[data-icon-token='docker'] {
|
|
1000
|
+
color: var(--trees-file-icon-color-docker);
|
|
1001
|
+
}
|
|
1002
|
+
[data-icon-token='eslint'] {
|
|
1003
|
+
color: var(--trees-file-icon-color-eslint);
|
|
1004
|
+
}
|
|
1005
|
+
[data-icon-token='git'] {
|
|
1006
|
+
color: var(--trees-file-icon-color-git);
|
|
1007
|
+
}
|
|
1008
|
+
[data-icon-token='go'] {
|
|
1009
|
+
color: var(--trees-file-icon-color-go);
|
|
1010
|
+
}
|
|
1011
|
+
[data-icon-token='graphql'] {
|
|
1012
|
+
color: var(--trees-file-icon-color-graphql);
|
|
1013
|
+
}
|
|
1014
|
+
[data-icon-token='html'] {
|
|
1015
|
+
color: var(--trees-file-icon-color-html);
|
|
1016
|
+
}
|
|
1017
|
+
[data-icon-token='image'] {
|
|
1018
|
+
color: var(--trees-file-icon-color-image);
|
|
1019
|
+
}
|
|
1020
|
+
[data-icon-token='javascript'] {
|
|
1021
|
+
color: var(--trees-file-icon-color-javascript);
|
|
1022
|
+
}
|
|
1023
|
+
[data-icon-token='json'] {
|
|
1024
|
+
color: var(--trees-file-icon-color-json);
|
|
1025
|
+
}
|
|
1026
|
+
[data-icon-token='markdown'] {
|
|
1027
|
+
color: var(--trees-file-icon-color-markdown);
|
|
1028
|
+
}
|
|
1029
|
+
[data-icon-token='mcp'] {
|
|
1030
|
+
color: var(--trees-file-icon-color-mcp);
|
|
1031
|
+
}
|
|
1032
|
+
[data-icon-token='npm'] {
|
|
1033
|
+
color: var(--trees-file-icon-color-npm);
|
|
1034
|
+
}
|
|
1035
|
+
[data-icon-token='oxc'] {
|
|
1036
|
+
color: var(--trees-file-icon-color-oxc);
|
|
1037
|
+
}
|
|
1038
|
+
[data-icon-token='postcss'] {
|
|
1039
|
+
color: var(--trees-file-icon-color-postcss);
|
|
1040
|
+
}
|
|
1041
|
+
[data-icon-token='prettier'] {
|
|
1042
|
+
color: var(--trees-file-icon-color-prettier);
|
|
1043
|
+
}
|
|
1044
|
+
[data-icon-token='python'] {
|
|
1045
|
+
color: var(--trees-file-icon-color-python);
|
|
1046
|
+
}
|
|
1047
|
+
[data-icon-token='react'] {
|
|
1048
|
+
color: var(--trees-file-icon-color-react);
|
|
1049
|
+
}
|
|
1050
|
+
[data-icon-token='ruby'] {
|
|
1051
|
+
color: var(--trees-file-icon-color-ruby);
|
|
1052
|
+
}
|
|
1053
|
+
[data-icon-token='rust'] {
|
|
1054
|
+
color: var(--trees-file-icon-color-rust);
|
|
1055
|
+
}
|
|
1056
|
+
[data-icon-token='sass'] {
|
|
1057
|
+
color: var(--trees-file-icon-color-sass);
|
|
1058
|
+
}
|
|
1059
|
+
[data-icon-token='svg'] {
|
|
1060
|
+
color: var(--trees-file-icon-color-svg);
|
|
1061
|
+
}
|
|
1062
|
+
[data-icon-token='svelte'] {
|
|
1063
|
+
color: var(--trees-file-icon-color-svelte);
|
|
1064
|
+
}
|
|
1065
|
+
[data-icon-token='svgo'] {
|
|
1066
|
+
color: var(--trees-file-icon-color-svgo);
|
|
1067
|
+
}
|
|
1068
|
+
[data-icon-token='swift'] {
|
|
1069
|
+
color: var(--trees-file-icon-color-swift);
|
|
1070
|
+
}
|
|
1071
|
+
[data-icon-token='table'] {
|
|
1072
|
+
color: var(--trees-file-icon-color-table);
|
|
1073
|
+
}
|
|
1074
|
+
[data-icon-token='text'] {
|
|
1075
|
+
color: var(--trees-file-icon-color-text);
|
|
1076
|
+
}
|
|
1077
|
+
[data-icon-token='tailwind'] {
|
|
1078
|
+
color: var(--trees-file-icon-color-tailwind);
|
|
1079
|
+
}
|
|
1080
|
+
[data-icon-token='terraform'] {
|
|
1081
|
+
color: var(--trees-file-icon-color-terraform);
|
|
1082
|
+
}
|
|
1083
|
+
[data-icon-token='typescript'] {
|
|
1084
|
+
color: var(--trees-file-icon-color-typescript);
|
|
1085
|
+
}
|
|
1086
|
+
[data-icon-token='vite'] {
|
|
1087
|
+
color: var(--trees-file-icon-color-vite);
|
|
1088
|
+
}
|
|
1089
|
+
[data-icon-token='vscode'] {
|
|
1090
|
+
color: var(--trees-file-icon-color-vscode);
|
|
1091
|
+
}
|
|
1092
|
+
[data-icon-token='vue'] {
|
|
1093
|
+
color: var(--trees-file-icon-color-vue);
|
|
1094
|
+
}
|
|
1095
|
+
[data-icon-token='wasm'] {
|
|
1096
|
+
color: var(--trees-file-icon-color-wasm);
|
|
1097
|
+
}
|
|
1098
|
+
[data-icon-token='webpack'] {
|
|
1099
|
+
color: var(--trees-file-icon-color-webpack);
|
|
1100
|
+
}
|
|
1101
|
+
[data-icon-token='yml'] {
|
|
1102
|
+
color: var(--trees-file-icon-color-yml);
|
|
1103
|
+
}
|
|
1104
|
+
[data-icon-token='zig'] {
|
|
1105
|
+
color: var(--trees-file-icon-color-zig);
|
|
1106
|
+
}
|
|
1107
|
+
[data-icon-token='zip'] {
|
|
1108
|
+
color: var(--trees-file-icon-color-zip);
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/* Chevron rotation and visual alignment */
|
|
1113
|
+
/* Chevron pointing down */
|
|
1114
|
+
[data-icon-name='file-tree-icon-chevron'] {
|
|
1115
|
+
&[data-align-capitals='false'] {
|
|
1116
|
+
transform: translate(0, var(--trees-icon-nudge));
|
|
1117
|
+
}
|
|
1118
|
+
&[data-align-capitals='true'] {
|
|
1119
|
+
transform: translate(0, 0);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
[data-item-section='content'] {
|
|
1124
|
+
flex: 0 1 auto;
|
|
1125
|
+
text-align: start;
|
|
1126
|
+
min-width: 0;
|
|
1127
|
+
max-width: 100%;
|
|
1128
|
+
overflow: hidden;
|
|
1129
|
+
text-overflow: ellipsis;
|
|
1130
|
+
/* Breaks middle truncate component to also set this */
|
|
1131
|
+
/* white-space: nowrap; */
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
[data-item-section='decoration'] {
|
|
1135
|
+
flex: 1 1 0;
|
|
1136
|
+
min-width: 0;
|
|
1137
|
+
display: flex;
|
|
1138
|
+
justify-content: flex-end;
|
|
1139
|
+
text-align: end;
|
|
1140
|
+
overflow: hidden;
|
|
1141
|
+
color: var(--trees-fg-muted);
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
[data-item-section='decoration'] > span {
|
|
1145
|
+
min-width: 0;
|
|
1146
|
+
max-width: 100%;
|
|
1147
|
+
display: inline-flex;
|
|
1148
|
+
align-items: center;
|
|
1149
|
+
justify-content: flex-end;
|
|
1150
|
+
overflow: hidden;
|
|
1151
|
+
text-overflow: ellipsis;
|
|
1152
|
+
white-space: nowrap;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
[data-item-section='git'],
|
|
1156
|
+
[data-item-section='action'] {
|
|
1157
|
+
flex: 0 0 auto;
|
|
1158
|
+
display: flex;
|
|
1159
|
+
align-items: center;
|
|
1160
|
+
justify-content: center;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
[data-item-section='git'] {
|
|
1164
|
+
width: var(--trees-git-lane-width);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
[data-item-section='action'] {
|
|
1168
|
+
width: var(--trees-action-lane-width);
|
|
1169
|
+
color: var(--trees-fg-muted);
|
|
1170
|
+
fill: currentColor;
|
|
1171
|
+
pointer-events: none;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
[data-item-section='git'] > span,
|
|
1175
|
+
[data-item-section='action'] > span {
|
|
1176
|
+
width: 100%;
|
|
1177
|
+
display: inline-flex;
|
|
1178
|
+
align-items: center;
|
|
1179
|
+
justify-content: center;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
[data-item-action-affordance='decorative'] {
|
|
1183
|
+
opacity: 0.85;
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
[data-item-rename-input] {
|
|
1187
|
+
appearance: none;
|
|
1188
|
+
width: 100%;
|
|
1189
|
+
min-width: 0;
|
|
1190
|
+
height: calc(var(--trees-row-height) - 4px);
|
|
1191
|
+
font-family: inherit;
|
|
1192
|
+
font-size: inherit;
|
|
1193
|
+
/* line-height: calc(var(--trees-row-height) - 8px); */
|
|
1194
|
+
color: inherit;
|
|
1195
|
+
background-color: transparent;
|
|
1196
|
+
border: 0;
|
|
1197
|
+
padding-inline: 6px;
|
|
1198
|
+
outline: none;
|
|
1199
|
+
box-sizing: border-box;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
[data-item-section='content']:has([data-item-rename-input])
|
|
1203
|
+
~ [data-item-section='action'],
|
|
1204
|
+
[data-item-section='content']:has([data-item-rename-input])
|
|
1205
|
+
~ [data-item-section='decoration'] {
|
|
1206
|
+
display: none;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
/* Chevron pointing right */
|
|
1210
|
+
[aria-expanded='false'][data-item-type='folder']
|
|
1211
|
+
> [data-item-section='icon']
|
|
1212
|
+
> [data-icon-name='file-tree-icon-chevron'] {
|
|
1213
|
+
&[data-align-capitals='true'] {
|
|
1214
|
+
transform: rotate(-90deg)
|
|
1215
|
+
translate(
|
|
1216
|
+
calc(var(--trees-icon-nudge) / 2),
|
|
1217
|
+
calc(var(--trees-icon-nudge) / 2)
|
|
1218
|
+
);
|
|
1219
|
+
}
|
|
1220
|
+
&[data-align-capitals='false'] {
|
|
1221
|
+
transform: rotate(-90deg)
|
|
1222
|
+
translate(
|
|
1223
|
+
calc(var(--trees-icon-nudge) / 2 * -1),
|
|
1224
|
+
calc(var(--trees-icon-nudge) / 2)
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/* LIST IDENTATION */
|
|
1230
|
+
/* Spacing container */
|
|
1231
|
+
[data-item-section='spacing'] {
|
|
1232
|
+
display: flex;
|
|
1233
|
+
flex-direction: row;
|
|
1234
|
+
align-items: center;
|
|
1235
|
+
justify-content: center;
|
|
1236
|
+
height: var(--trees-row-height);
|
|
1237
|
+
padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
|
|
1238
|
+
|
|
1239
|
+
&:empty {
|
|
1240
|
+
padding-left: 0;
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
/* Spacing per level */
|
|
1245
|
+
[data-item-section='spacing-item'] {
|
|
1246
|
+
transform: translateX(-0.25px);
|
|
1247
|
+
display: inline-block;
|
|
1248
|
+
border-left: 1px solid var(--trees-indent-guide-bg);
|
|
1249
|
+
height: 100%;
|
|
1250
|
+
margin-right: calc(var(--trees-level-gap) - 1px);
|
|
1251
|
+
opacity: 0;
|
|
1252
|
+
transition: opacity 150ms ease;
|
|
1253
|
+
|
|
1254
|
+
& + & {
|
|
1255
|
+
margin-left: calc(
|
|
1256
|
+
var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
|
|
1257
|
+
);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
:host(:hover) [data-item-section='spacing-item'] {
|
|
1262
|
+
opacity: 0.75;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
/* Git status indicator */
|
|
1266
|
+
|
|
1267
|
+
/* This is a folder that contains a git change */
|
|
1268
|
+
[data-item-contains-git-change='true'] > [data-item-section='git'] {
|
|
1269
|
+
color: var(--trees-git-modified-color);
|
|
1270
|
+
opacity: 0.5;
|
|
1271
|
+
fill: currentColor;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
/* These are files that have a git change */
|
|
1275
|
+
[data-item-git-status] {
|
|
1276
|
+
&
|
|
1277
|
+
> :where([data-item-section='icon'])
|
|
1278
|
+
> :where(:not([data-icon-name='file-tree-icon-chevron'])) {
|
|
1279
|
+
color: var(--trees-item-git-status-color);
|
|
1280
|
+
}
|
|
1281
|
+
& > [data-item-section='content'] {
|
|
1282
|
+
color: var(--trees-item-git-status-color);
|
|
1283
|
+
}
|
|
1284
|
+
& > [data-item-section='git'] {
|
|
1285
|
+
color: var(--trees-item-git-status-color);
|
|
1286
|
+
font-weight: var(--trees-font-weight-semibold);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
[data-item-git-status='added'] {
|
|
1291
|
+
--trees-item-git-status-color: var(--trees-git-added-color);
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
[data-item-git-status='deleted'] {
|
|
1295
|
+
--trees-item-git-status-color: var(--trees-git-deleted-color);
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
[data-item-git-status='ignored'] {
|
|
1299
|
+
--trees-item-git-status-color: var(--trees-git-ignored-color);
|
|
1300
|
+
|
|
1301
|
+
& > [data-item-section='icon'] {
|
|
1302
|
+
opacity: 0.5;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
[data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
|
|
1307
|
+
/* this is a nudge to align the dot with the likely lowercase text. it's slightly
|
|
1308
|
+
generalizable, but other fonts are gonna need other nudges i assume */
|
|
1309
|
+
transform: translateY(calc(0.65ex - 50%));
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
[data-item-git-status='modified'] {
|
|
1313
|
+
--trees-item-git-status-color: var(--trees-git-modified-color);
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
[data-item-git-status='renamed'] {
|
|
1317
|
+
--trees-item-git-status-color: var(--trees-git-renamed-color);
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
[data-item-git-status='untracked'] {
|
|
1321
|
+
--trees-item-git-status-color: var(--trees-git-untracked-color);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/* Drag and drop */
|
|
1325
|
+
[data-item-drag-target='true'] {
|
|
1326
|
+
background-color: var(--trees-selected-bg);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
[data-item-dragging='true'] {
|
|
1330
|
+
opacity: 0.5;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/* Lock icon for locked paths (sibling of content) */
|
|
1334
|
+
[data-item-section='lock'] {
|
|
1335
|
+
flex: 0 0 auto;
|
|
1336
|
+
margin-left: auto;
|
|
1337
|
+
display: flex;
|
|
1338
|
+
align-items: center;
|
|
1339
|
+
color: var(--trees-fg-muted);
|
|
1340
|
+
}
|
|
1341
|
+
[data-item-section='lock'] svg {
|
|
1342
|
+
display: block;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
[data-type='header-slot'] {
|
|
1346
|
+
display: block;
|
|
1347
|
+
flex: 0 0 auto;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
[data-type='context-menu-wash'] {
|
|
1351
|
+
position: absolute;
|
|
1352
|
+
inset: 0;
|
|
1353
|
+
z-index: 3;
|
|
1354
|
+
background-color: transparent;
|
|
1355
|
+
touch-action: none;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
[data-type='context-menu-anchor'] {
|
|
1359
|
+
position: absolute;
|
|
1360
|
+
top: 0;
|
|
1361
|
+
right: var(--trees-context-menu-trigger-inline-offset);
|
|
1362
|
+
z-index: 4;
|
|
1363
|
+
display: none;
|
|
1364
|
+
align-items: center;
|
|
1365
|
+
|
|
1366
|
+
&[data-visible='true'] {
|
|
1367
|
+
display: flex;
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/* Hide the floating trigger while the scroll container is actively moving.
|
|
1372
|
+
* The anchor is positioned against the root, not the scroll content, so its
|
|
1373
|
+
* \`top\` follows the row via a React state update — one frame behind the
|
|
1374
|
+
* compositor. That delay is visible as the trigger hovering over the wrong
|
|
1375
|
+
* row during the first frame of a scroll. The \`data-is-scrolling\` flag on
|
|
1376
|
+
* the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
|
|
1377
|
+
* the compositor commits the next paint, so this selector hides the anchor
|
|
1378
|
+
* in the same frame the scroll begins. */
|
|
1379
|
+
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1380
|
+
[data-type='context-menu-anchor'] {
|
|
1381
|
+
display: none;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
[data-type='context-menu-anchor'] > slot[name='context-menu'] {
|
|
1385
|
+
display: block;
|
|
1386
|
+
width: 0;
|
|
1387
|
+
min-width: 0;
|
|
1388
|
+
flex: 0 0 0;
|
|
1389
|
+
overflow: visible;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/* Single floating context menu trigger */
|
|
1393
|
+
[data-type='context-menu-trigger'] {
|
|
1394
|
+
all: unset;
|
|
1395
|
+
align-items: center;
|
|
1396
|
+
justify-content: center;
|
|
1397
|
+
width: var(--trees-action-lane-width);
|
|
1398
|
+
color: var(--trees-fg-muted);
|
|
1399
|
+
fill: currentColor;
|
|
1400
|
+
cursor: pointer;
|
|
1401
|
+
font-family: var(--trees-font-family);
|
|
1402
|
+
font-size: var(--trees-font-size);
|
|
1403
|
+
border-top-right-radius: var(--trees-border-radius);
|
|
1404
|
+
border-bottom-right-radius: var(--trees-border-radius);
|
|
1405
|
+
margin: var(--trees-focus-ring-width);
|
|
1406
|
+
height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
|
|
1407
|
+
border-width: 0;
|
|
1408
|
+
transition: color 120ms ease;
|
|
1409
|
+
|
|
1410
|
+
display: flex;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
[data-type='context-menu-trigger']:hover,
|
|
1414
|
+
[data-type='context-menu-trigger'][aria-expanded='true'] {
|
|
1415
|
+
color: var(--trees-fg);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/** @pierre/truncate css here, manually copy pasted for now */
|
|
1419
|
+
[data-truncate-container] {
|
|
1420
|
+
/* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
|
|
1421
|
+
margin-top: -1px;
|
|
1422
|
+
margin-bottom: -1px;
|
|
1423
|
+
|
|
1424
|
+
/* Width of the fade from default marker to text */
|
|
1425
|
+
--truncate-internal-marker-fade-width: var(
|
|
1426
|
+
--truncate-marker-fade-width,
|
|
1427
|
+
2px
|
|
1428
|
+
);
|
|
1429
|
+
/* Width of the solid color between the fade from the default marker to the text */
|
|
1430
|
+
--truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
|
|
1431
|
+
/* Opacity of the marker 'color' property, not of the element itself */
|
|
1432
|
+
--truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
|
|
1433
|
+
/* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
|
|
1434
|
+
--truncate-internal-middle-marker-opacity: var(
|
|
1435
|
+
--truncate-middle-marker-opacity,
|
|
1436
|
+
80%
|
|
1437
|
+
);
|
|
1438
|
+
/* Background color of the default marker */
|
|
1439
|
+
--truncate-internal-marker-background-color: var(
|
|
1440
|
+
--truncate-marker-background-color,
|
|
1441
|
+
light-dark(white, black)
|
|
1442
|
+
);
|
|
1443
|
+
--truncate-internal-marker-background-overlay-color: var(
|
|
1444
|
+
--truncate-marker-background-overlay-color,
|
|
1445
|
+
transparent
|
|
1446
|
+
);
|
|
1447
|
+
--truncate-internal-marker-block-inset: var(
|
|
1448
|
+
--truncate-marker-block-inset,
|
|
1449
|
+
0px
|
|
1450
|
+
);
|
|
1451
|
+
/* Duration of the fade out animation for the marker */
|
|
1452
|
+
--truncate-internal-marker-fade-out-duration: var(
|
|
1453
|
+
--truncate-marker-fade-out-duration,
|
|
1454
|
+
0ms
|
|
1455
|
+
);
|
|
1456
|
+
/* Duration of the fade in animation for the marker */
|
|
1457
|
+
--truncate-internal-marker-fade-in-duration: var(
|
|
1458
|
+
--truncate-marker-fade-in-duration,
|
|
1459
|
+
100ms
|
|
1460
|
+
);
|
|
1461
|
+
|
|
1462
|
+
/* FADE Variant specifics */
|
|
1463
|
+
--truncate-internal-fade-marker-color: var(
|
|
1464
|
+
--truncate-fade-marker-color,
|
|
1465
|
+
#000
|
|
1466
|
+
);
|
|
1467
|
+
--truncate-internal-fade-marker-width: var(
|
|
1468
|
+
--truncate-fade-marker-width,
|
|
1469
|
+
0.2lh
|
|
1470
|
+
);
|
|
1471
|
+
|
|
1472
|
+
/*
|
|
1473
|
+
In some special cases people might be adding spacing in other ways
|
|
1474
|
+
that would benefit from being able to override this, however the container
|
|
1475
|
+
query below can't use this and would need to be redeclared with the overridden
|
|
1476
|
+
value. It's a bad time, but better than nothing.
|
|
1477
|
+
*/
|
|
1478
|
+
--truncate-internal-single-line-height: 1lh;
|
|
1479
|
+
|
|
1480
|
+
height: var(--truncate-internal-single-line-height);
|
|
1481
|
+
min-width: 0;
|
|
1482
|
+
overflow: hidden;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
[data-truncate-marker] {
|
|
1486
|
+
display: flex;
|
|
1487
|
+
position: absolute;
|
|
1488
|
+
height: var(--truncate-internal-single-line-height);
|
|
1489
|
+
padding-block: var(--truncate-internal-marker-block-inset);
|
|
1490
|
+
box-sizing: border-box;
|
|
1491
|
+
align-items: center;
|
|
1492
|
+
background-clip: content-box;
|
|
1493
|
+
z-index: 2;
|
|
1494
|
+
color: color-mix(
|
|
1495
|
+
in srgb,
|
|
1496
|
+
currentColor var(--truncate-internal-marker-opacity),
|
|
1497
|
+
transparent
|
|
1498
|
+
);
|
|
1499
|
+
|
|
1500
|
+
/* Core trick for hiding the marker until overflow occurs */
|
|
1501
|
+
opacity: 0;
|
|
1502
|
+
transition: opacity var(--truncate-internal-marker-fade-out-duration)
|
|
1503
|
+
ease-in-out;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
@container measure (height > 1lh) {
|
|
1507
|
+
[data-truncate-marker] {
|
|
1508
|
+
opacity: 1;
|
|
1509
|
+
transition: opacity var(--truncate-internal-marker-fade-in-duration)
|
|
1510
|
+
ease-in-out;
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
[data-truncate-grid] {
|
|
1515
|
+
display: grid;
|
|
1516
|
+
position: relative;
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
[data-truncate-content='visible'] {
|
|
1520
|
+
white-space: nowrap;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
[data-truncate-content='overflow'] {
|
|
1524
|
+
opacity: 0;
|
|
1525
|
+
pointer-events: none;
|
|
1526
|
+
-webkit-user-select: none;
|
|
1527
|
+
user-select: none;
|
|
1528
|
+
word-break: break-all;
|
|
1529
|
+
margin-top: calc(-1 * var(--truncate-internal-single-line-height));
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
[data-truncate-marker-cell] {
|
|
1533
|
+
container: measure / size;
|
|
1534
|
+
overflow: visible;
|
|
1535
|
+
-webkit-user-select: none;
|
|
1536
|
+
user-select: none;
|
|
1537
|
+
pointer-events: none;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
[data-truncate-container='truncate'] {
|
|
1541
|
+
& [data-truncate-grid] {
|
|
1542
|
+
grid-template-columns: minmax(0, max-content) 0;
|
|
1543
|
+
}
|
|
1544
|
+
& [data-truncate-marker] {
|
|
1545
|
+
right: 0;
|
|
1546
|
+
}
|
|
1547
|
+
& [data-truncate-fade] {
|
|
1548
|
+
margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
[data-truncate-container='fruncate'] {
|
|
1553
|
+
& [data-truncate-grid] {
|
|
1554
|
+
grid-template-columns: 0 minmax(0, max-content) auto;
|
|
1555
|
+
}
|
|
1556
|
+
& [data-truncate-content] {
|
|
1557
|
+
direction: rtl;
|
|
1558
|
+
}
|
|
1559
|
+
& [data-truncate-content] > span {
|
|
1560
|
+
unicode-bidi: plaintext;
|
|
1561
|
+
}
|
|
1562
|
+
& [data-truncate-fade] {
|
|
1563
|
+
margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
[data-truncate-variant='default'] {
|
|
1568
|
+
& [data-truncate-marker] {
|
|
1569
|
+
background-color: var(--truncate-internal-marker-background-color);
|
|
1570
|
+
background-image: linear-gradient(
|
|
1571
|
+
var(--truncate-internal-marker-background-overlay-color),
|
|
1572
|
+
var(--truncate-internal-marker-background-overlay-color)
|
|
1573
|
+
);
|
|
1574
|
+
}
|
|
1575
|
+
& [data-truncate-marker]::after,
|
|
1576
|
+
& [data-truncate-marker]::before {
|
|
1577
|
+
content: '';
|
|
1578
|
+
position: absolute;
|
|
1579
|
+
width: calc(
|
|
1580
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1581
|
+
var(--truncate-internal-marker-gap)
|
|
1582
|
+
);
|
|
1583
|
+
inset-block-start: var(--truncate-internal-marker-block-inset);
|
|
1584
|
+
height: max(
|
|
1585
|
+
0px,
|
|
1586
|
+
calc(
|
|
1587
|
+
var(--truncate-internal-single-line-height) -
|
|
1588
|
+
var(--truncate-internal-marker-block-inset) * 2
|
|
1589
|
+
)
|
|
1590
|
+
);
|
|
1591
|
+
background-color: var(--truncate-internal-marker-background-color);
|
|
1592
|
+
background-image: linear-gradient(
|
|
1593
|
+
var(--truncate-internal-marker-background-overlay-color),
|
|
1594
|
+
var(--truncate-internal-marker-background-overlay-color)
|
|
1595
|
+
);
|
|
1596
|
+
mask-image: linear-gradient(
|
|
1597
|
+
var(--truncate-internal-fade-dir),
|
|
1598
|
+
#000 0%,
|
|
1599
|
+
#000 var(--truncate-internal-marker-gap),
|
|
1600
|
+
transparent 100%
|
|
1601
|
+
);
|
|
1602
|
+
}
|
|
1603
|
+
& [data-truncate-marker]::after {
|
|
1604
|
+
--truncate-internal-fade-dir: to right;
|
|
1605
|
+
right: calc(
|
|
1606
|
+
-1 *
|
|
1607
|
+
(
|
|
1608
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1609
|
+
var(--truncate-internal-marker-gap)
|
|
1610
|
+
)
|
|
1611
|
+
);
|
|
1612
|
+
}
|
|
1613
|
+
& [data-truncate-marker]::before {
|
|
1614
|
+
--truncate-internal-fade-dir: to left;
|
|
1615
|
+
left: calc(
|
|
1616
|
+
-1 *
|
|
1617
|
+
(
|
|
1618
|
+
var(--truncate-internal-marker-fade-width) +
|
|
1619
|
+
var(--truncate-internal-marker-gap)
|
|
1620
|
+
)
|
|
1621
|
+
);
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
[data-truncate-variant='fade'] {
|
|
1626
|
+
& [data-truncate-marker] {
|
|
1627
|
+
background: transparent;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
[data-truncate-fade] {
|
|
1632
|
+
box-shadow:
|
|
1633
|
+
0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
|
|
1634
|
+
var(--truncate-internal-fade-marker-color),
|
|
1635
|
+
0 0 var(--truncate-internal-fade-marker-width)
|
|
1636
|
+
var(--truncate-internal-fade-marker-color);
|
|
1637
|
+
width: calc(var(--truncate-internal-fade-marker-width) * 2);
|
|
1638
|
+
height: calc(
|
|
1639
|
+
var(--truncate-internal-single-line-height) -
|
|
1640
|
+
(var(--truncate-internal-fade-marker-width) * 2)
|
|
1641
|
+
);
|
|
1642
|
+
margin: var(--truncate-internal-fade-marker-width) 0;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
[data-truncate-group-container='middle'] {
|
|
1646
|
+
& [data-truncate-container] {
|
|
1647
|
+
--truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
display: flex;
|
|
1651
|
+
min-width: 0;
|
|
1652
|
+
|
|
1653
|
+
& > div {
|
|
1654
|
+
min-width: 0;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
& > div[data-truncate-segment-priority='1'] {
|
|
1658
|
+
flex: 0 1 max-content;
|
|
1659
|
+
}
|
|
1660
|
+
& > div[data-truncate-segment-priority='2'] {
|
|
1661
|
+
flex: 0 999999 max-content;
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
`,ga=`@layer base, unsafe;`;function _a(e){return`${ga}
|
|
1666
|
+
@layer base {
|
|
1667
|
+
${e}
|
|
1668
|
+
}`}function va(e){return`${ga}
|
|
1669
|
+
@layer unsafe {
|
|
1670
|
+
${e}
|
|
1671
|
+
}`}var ya=new WeakMap;function ba(e){let t=ya.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(At,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),ya.set(e,i),i}function xa(e,t){if(!e.isConnected)return;let n=ba(t);if(n==null)return;let r=t.querySelector(`style[${jt}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(jt,``),t.appendChild(i)),i.textContent=`:host { ${Mt}: ${n}px; }`}var Sa;function Ca(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Sa??(Sa=new CSSStyleSheet,Sa.replaceSync(_a(ha)));let t=!1;try{e.adoptedStyleSheets=[Sa],t=!0}catch{}if(t){e.querySelector(`style[${Ot}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Ot,``),t.textContent=_a(ha),e.prepend(t)}}function wa(e,t){Ta(e,t),Ca(t),xa(e,t)}function Ta(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});wa(this,e)}}if(customElements.define(Dt,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Dt)))e instanceof HTMLElement&&wa(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Ea=e=>e.startsWith(`f::`)?e.slice(3):e;function Da(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Oa(e,t){return e===``?t:`${e}/${t}`}function ka({files:e,path:t,isFolder:n,nextBasename:r}){let i=Ea(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Da(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Oa(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Aa(e){return e.endsWith(`/`)}function ja(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function Ma(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function Na(e,t){return t.includes(e)?Ma(t):[e]}function Pa(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Fa(e,t){return{draggedPaths:e,target:t}}function Ia(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Aa(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function La(e,t){return t.kind===`root`||t.directoryPath==null?ja(e):t.directoryPath}function Ra(e,t){let n=e.map(e=>{let n=La(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function za(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Ba(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!za(ua.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function Va(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function Ha(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function Ua(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function Wa(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return Ua(e,t.path)?n?e:null:e;case`move`:return Ha(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=Wa(r,e,n),r==null)return null;return r}}}function Ga(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Ka(e){switch(e.operation){case`add`:return{...Ga(e),operation:`add`,path:e.path};case`remove`:return{...Ga(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...Ga(e),from:e.from,operation:`move`,to:e.to}}}function qa(e){return{...Ga(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Ka(e)),operation:`batch`}}function Ja(e){switch(e.operation){case`add`:case`remove`:case`move`:return Ka(e);case`batch`:return qa(e);default:return null}}function Ya(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Xa(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function Za(e){return Xa(e).at(-1)??null}function Qa(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function $a(e){return e.endsWith(`/`)}var eo=e=>e.toLowerCase();function to(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function no(e){return e.endsWith(`/`)?e.slice(0,-1):e}function ro(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var io=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},ao=Symbol(`FILE_TREE_RENAME_VIEW`),oo=512,so=512;function co(e){return e===`top`||e===`center`?e:`nearest`}function lo(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Xa(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function uo(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:lo(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var fo=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=Ba({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=Za(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:co(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=so){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=Na(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Fa(t.draggedPaths,n);(Ia(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Pa(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=Fa(e.draggedPaths,t);if(Ia(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=Ra(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=$a(r),a=no(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Xa(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=to(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[ao](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,$a(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,$a(e)?{recursive:!0}:void 0);return}let t=$a(e),n=ka({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:no(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(ro(n.sourcePath,t),ro(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=Ba({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!Ya(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=Za(e),n=Qa(e,t),r=null,i=null;for(let e of this.#be()){if(Za(e)!==t)continue;let a=Qa(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=Xa(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!Ya(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new ua({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of Xa(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(eo),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(eo),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of Xa(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:io(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of Xa(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of Xa(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=uo(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,oo)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=Wa(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=Wa(this.#c,e,!0),r=[...this.#B].map(t=>Wa(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=Wa(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return Ya(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&Va(e)&&(this.#i=null);let t=Va(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=Ja(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},po=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function mo(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function ho(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function go(e,t){return t?`${e}/`:e}function _o(e,t=null){let n=po(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=mo(t.path);if(e==null)continue;let n=go(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of ho(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var G,vo,yo,bo,xo,So,Co,wo,To,Eo,Do={},Oo=[],ko=Array.isArray,Ao=Oo.slice,jo=Object.assign;function Mo(e){e&&e.parentNode&&e.remove()}function No(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?Ao.call(arguments,2):n),Po(e,o,r,i,null)}function Po(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++vo,__i:-1,__u:0};return i==null&&G.vnode!=null&&G.vnode(a),a}function Fo(e){return e.children}function Io(e,t){this.props=e,this.context=t,this.__g=0}function Lo(e,t){if(t==null)return e.__?Lo(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?Lo(e):null}function Ro(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Ro(e)}}function zo(e){(8&e.__g||!(e.__g|=8)||!yo.push(e)||xo++)&&bo==G.debounceRendering||((bo=G.debounceRendering)||queueMicrotask)(Bo)}function Bo(){for(var e,t,n,r,i,a,o,s,c=1;yo.length;)yo.length>c&&yo.sort(So),e=yo.shift(),c=yo.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=jo({},r)).__v=r.__v+1,G.vnode&&G.vnode(n),Jo(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??Lo(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Xo(a,n,o),n.__e!=i&&Ro(n)));xo=0}function Vo(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Oo,b=t.length;for(c=Ho(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Do:y[m.__i]||Do,m.__i=f,_=Jo(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&$o(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Uo(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Ho(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?Po(null,o,null,null,null):ko(o)?Po(Fo,{children:o},null,null,null):o.constructor==null&&o.__b>0?Po(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Wo(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Lo(s)),es(s,s));return r}function Uo(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Uo(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Lo(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Wo(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Go(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Ko(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Go(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Go(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Co,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=wo,e.addEventListener(t,a?Eo:To,a)):e.removeEventListener(t,a?Eo:To,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function qo(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=wo++;else if(t.u<n.l)return;return n(G.event?G.event(t):t)}}}function Jo(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,ee,k,A,j=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=G.__b)&&d(t);n:if(typeof j==`function`)try{if(v=t.props,y=`prototype`in j&&j.prototype.render,b=(d=j.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new j(v,x):(t.__c=f=new Io(v,x),f.constructor=j,f.render=ts),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&j.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=jo({},f.__s)),jo(f.__s,j.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&j.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&j.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=G.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=jo({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===Fo&&d.key==null&&(E=Zo(d.props.children)),s=Vo(e,ko(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],ee=0;ee<a.length;ee++)(k=a[ee])==null||O||(k.nodeType==8&&k.data==`$s`?(D>0&&t.__c.__z.push(k),D++,a[ee]=null):k.nodeType==8&&k.data==`/$s`?(--D>0&&t.__c.__z.push(k),O=D===0,s=a[ee],a[ee]=null):D>0&&(t.__c.__z.push(k),a[ee]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(A=a.length;A--;)Mo(a[A]);Yo(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Yo(t);G.__e(e,t,n)}else s=t.__e=Qo(n.__e,t,n,r,i,a,o,c,l,u);return(d=G.diffed)&&d(t),128&t.__u?void 0:s}function Yo(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Yo)}function Xo(e,t,n){for(var r=0;r<n.length;r++)$o(n[r],n[++r],n[++r]);G.__c&&G.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){G.__e(e,t.__v)}})}function Zo(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ko(e)?e.map(Zo):jo({},e)}function Qo(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(G.__m&&G.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Ao.call(e.childNodes),v=n.props||Do,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Ko(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Ko(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Vo(b==`template`?e.content:e,ko(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&Lo(n,0),s,c,l),a!=null)for(u=a.length;u--;)Mo(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Ko(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Ko(e,u,g,v[u],i))}return e}function $o(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){G.__e(e,n)}}function es(e,t,n){var r,i;if(G.unmount&&G.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||$o(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){G.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&es(r[i],t,n||typeof e.type!=`function`);n||Mo(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function ts(e,t,n){return this.constructor(e,n)}function ns(e,t){var n,r,i,a;t==document&&(t=document.documentElement),G.__&&G.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=No(Fo,null,[e]),i=[],a=[],Jo(t,e,r||Do,Do,t.namespaceURI,r?null:t.firstChild?Ao.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Xo(i,e,a)}function rs(e,t){e.__u|=32,ns(e,t)}G={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw xo=0,e}},vo=0,Io.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=jo({},this.state);typeof e==`function`&&(e=e(jo({},n),this.props)),e&&jo(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),zo(this))},Io.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),zo(this))},Io.prototype.render=Fo,yo=[],xo=0,So=function(e,t){return e.__v.__b-t.__v.__b},Co=/(PointerCapture)$|Capture$/i,wo=0,To=qo(!1),Eo=qo(!0);var is=0;Array.isArray;function K(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--is,__i:-1,__u:0,__source:i,__self:a};return G.vnode&&G.vnode(l),l}var as=16,os=16,ss={};function cs({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=ss[e]??{width:as,height:os},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return K(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:K(`use`,{href:c})})}var ls=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},us=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},ds=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},fs=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},ps=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},ms=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function hs({children:e,marker:t,variant:n=`default`}){"use no memo";return K(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:K(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?K(`span`,{"data-truncate-fade":!0}):t})})}function gs(e){"use no memo";let{mode:t,children:n}=e;return K(`div`,{children:[K(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?K(`span`,{children:n}):n}),K(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?K(`span`,{children:n}):n})]})}function _s({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=K(gs,{mode:t,children:e},`content`),o=K(hs,{marker:n,mode:t,variant:r},`marker`),s=K(`div`,{"data-truncate-fill":!0},`fill`);return K(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:K(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function vs({children:e,...t}){"use no memo";return K(_s,{mode:`truncate`,...t,children:e})}function ys({children:e,...t}){"use no memo";return K(_s,{mode:`fruncate`,...t,children:e})}function bs({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=K(vs,{...s,children:t[0]}),l=K(ys,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return K(`div`,{className:a,style:o});if(e.length<i)return K(n===`end`?ys:vs,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=ls:r===`extension`?t=us:r===`leaf-path`&&(t=ds);else if(typeof r==`number`)t=fs,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=ps:e===`first`&&(t=ms)}else typeof r==`function`&&(t=r);t??=ls;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=K(vs,{...s,..._,children:f}),l=K(ys,{...s,...v,children:p})}return K(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[K(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),K(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var xs={endIndex:-1,startIndex:-1};function Ss(e,t,n){return Math.min(Math.max(e,t),n)}function Cs(e,t){return e<0||t<e?xs:{endIndex:t,startIndex:e}}function ws(e){return e.startIndex<0||e.endIndex<e.startIndex}function Ts(e,t){return ws(e)?0:(e.endIndex-e.startIndex+1)*t}function Es(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function Ds(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function Os(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function ks(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function As(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function js(e,t,n){if(e.length===0||t<=0)return[];let r=As(e),i=Os(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=ks(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function Ms(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=Ss(t.scrollTop,0,o),c=t.stickyRows??js(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=Es(s,n,t.itemHeight),m=Es(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?xs:Cs(m,Ds(u+d,n,t.itemHeight)),y=g+1,b=ws(v)?xs:Cs(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=Ts(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:ws(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var Ns={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},Ps={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},Fs=`Contains git status items`;function Is(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function Ls(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return Is({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function Rs(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function zs(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function Bs(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function Vs(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Hs(e,t){return e!=null&&e>0?e:t}function Us(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function Ws(e,t,n,r,i=0){let a=Is({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Gs(e,t,n,r,i,a,o=0){let s=Ls({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function Ks(e,t,n,r,i,a){let o=Rs({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function qs(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function Js(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function Ys({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return K(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function Xs(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function Zs(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var Qs,$s,ec,tc,nc=Object.is,rc=0,ic=[],ac=G,oc=ac.__b,sc=ac.__r,cc=ac.diffed,lc=ac.__c,uc=ac.unmount,dc=ac.__;function fc(e,t){ac.__h&&ac.__h($s,e,rc||t),rc=0;var n=$s.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function pc(e){return rc=1,mc(Tc,e)}function mc(e,t,n){var r=fc(Qs++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Tc(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);nc(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=$s,!$s.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,nc(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};$s.__f=!0;var a=$s.shouldComponentUpdate,o=$s.componentWillUpdate;$s.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},$s.shouldComponentUpdate=i}return r.__N||r.__}function hc(e,t){var n=fc(Qs++,3);!ac.__s&&wc(n.__H,t)&&(n.__=e,n.u=t,$s.__H.__h.push(n))}function gc(e,t){var n=fc(Qs++,4);!ac.__s&&wc(n.__H,t)&&(n.__=e,n.u=t,$s.__h.push(n))}function q(e){return rc=5,_c(function(){return{current:e}},[])}function _c(e,t){var n=fc(Qs++,7);return wc(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function vc(e,t){return rc=8,_c(function(){return e},t)}function yc(){for(var e;e=ic.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Sc),e.__H.__h.forEach(Cc),e.__H.__h=[]}catch(t){e.__H.__h=[],ac.__e(t,e.__v)}}ac.__b=function(e){$s=null,oc&&oc(e)},ac.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),dc&&dc(e,t)},ac.__r=function(e){sc&&sc(e),Qs=0;var t=($s=e.__c).__H;t&&(ec===$s?(t.__h=[],$s.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Sc),t.__h.forEach(Cc),t.__h=[],Qs=0)),ec=$s},ac.diffed=function(e){cc&&cc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ic.push(t)!==1&&tc===ac.requestAnimationFrame||((tc=ac.requestAnimationFrame)||xc)(yc)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),ec=$s=null},ac.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Sc),e.__h=e.__h.filter(function(e){return!e.__||Cc(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],ac.__e(n,e.__v)}}),lc&&lc(e,t)},ac.unmount=function(e){uc&&uc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Sc(e)}catch(e){t=e}}),n.__H=void 0,t&&ac.__e(t,n.__v))};var bc=typeof requestAnimationFrame==`function`;function xc(e){var t,n=function(){clearTimeout(r),bc&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);bc&&(t=requestAnimationFrame(n))}function Sc(e){var t=$s,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),$s=t}function Cc(e){var t=$s;e.__c=e.__(),$s=t}function wc(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!nc(t,e[n])})}function Tc(e,t){return typeof t==`function`?t(e):t}function Ec(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:K(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return K(Fo,{children:[K(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:K(vs,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Dc(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Oc(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function kc(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function Ac({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=Ms(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:kc(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?kc(u,1,t,o):i&&r<=0&&c.length>0?js(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var jc=400,Mc=10,Nc=40,Pc=18;function Fc(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?Ic(e,t,n):a instanceof HTMLElement?a:null}function Ic(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function Lc(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function Rc(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function zc(){return navigator.vendor!==`Apple Computer, Inc.`}function Bc(e,t){let n=e-t.top;if(n<Nc)return-Math.ceil((Nc-Math.max(0,n))/Nc*Pc);let r=t.bottom-e;return r<Nc?Math.ceil((Nc-Math.max(0,r))/Nc*Pc):0}function Vc(e,t){if(e!=null){let t=Ns[e];return t==null?null:{text:t,title:Ps[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:Fs}:null}function Hc(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function Uc(e){return e!=null&&`toggle`in e}function Wc(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function Gc(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Kc(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function qc(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Jc(e,t){return t&&qc(e)||(e.ctrlKey||e.metaKey)&&Wc(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Yc=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Xc(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function Zc(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Qc(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function $c(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function el(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function tl(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function nl(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function rl(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function il(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=rl(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function al(e,t){return{kind:e.kind,name:Oc(e),path:t}}function ol(e){return e==null?void 0:`${e}__tree`}function sl(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function cl(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function ll(e,t){if(e==null)return null;if(`text`in e)return K(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?cl(e.icon)?t(e.icon):{name:e.icon}:cl(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return K(`span`,{title:e.title,children:K(cs,{...n})})}function ul(e){e!=null&&zs(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function dl(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Dc(e);return K(Fo,{children:[e.depth>0?K(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>K(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,K(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?K(cs,{...t(`file-tree-icon-chevron`)}):K(cs,{...t(`file-tree-icon-file`,u)})}),K(`div`,{"data-item-section":`content`,children:e.isFlattened?Ec(e,c,a):c??K(bs,{minimumLength:5,split:`extension`,children:e.name})}),i?K(`div`,{"data-item-section":`decoration`,children:r==null?null:ll(r,t)}):null,s?K(`div`,{"data-item-section":`git`,children:ll(o,t)}):null,n?K(`div`,{"data-item-section":`action`,children:l?K(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:K(cs,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function fl(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:ee,renderDecorationForRow:k,openContextMenuForRow:A,onRowClick:j,onKeyDown:M}=e,N=Dc(t),{isParked:P=!1,mode:te=`flow`,style:ne}=r,re=te===`sticky`,ie=_?.get(N)??null??Hc(t.ancestorPaths,v,y),ae=t.kind===`directory`&&(b?.has(N)??!1),oe=k(t,N),se=Vc(ie,ae),ce=S&&w,le=oe!=null||x||ce,ue=ce&&T===`always`,F=a.getPath()===N,de=F?a.getValue():``,fe=re||!F?null:K(Ys,{ref:D,ariaLabel:`Rename ${Oc(t)}`,isFlattened:t.isFlattened,value:de,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),pe=dl(t,ee,{actionLaneEnabled:ce,customDecoration:oe,decorationLaneEnabled:le,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:se,gitLaneActive:x,renameInput:fe,showDecorativeActionAffordance:ue}),me={...Xs({ariaLabel:Oc(t),domId:t.isFocused?sl(h,N,P):void 0,extraStyle:ne,features:{actionLaneEnabled:ce,contextMenuButtonVisibility:ce?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:P,itemHeight:g,mode:te,row:t,state:{containsGitChange:ae,effectiveGitStatus:ie,isContextHovered:s===N,isDragTarget:l?.kind===`directory`&&l.directoryPath===N,isDragging:c?.has(N)===!0,isFocusRinged:t.isFocused&&o===N},targetPath:N}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(N),A(t,N,{anchorRect:Qc(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:re?void 0:()=>{i.focusMountedPathFromInput(N)},onKeyDown:re?void 0:M,ref:e=>{O(N,e)}};return!re&&F?K(`div`,{...me,children:pe}):K(`button`,{...me,type:`button`,draggable:u&&!P,onDragEnd:u&&!P?p:void 0,onDragStart:u&&!P?e=>{f(e,t,N)}:void 0,onMouseDown:e=>{if(re){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!P?e=>{m(e,t,N)}:void 0,onClick:e=>{j(e,t,N,te)},children:pe})}function pl(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Dc(e))).map((n,r)=>fl(e,n,t.start+r))}function ml({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=ma,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=q(null),v=q(null),y=q(!1),b=q(null),x=q(null),S=q(null),C=q(null),w=q(null),T=q(new Map),E=q(new Map),D=q(()=>{}),O=q(null),ee=q(0),k=q(!1),A=q(null);A.current!==t&&(k.current=!1,A.current=t);let j=q(!1),M=q(null),N=q(null),P=q(!1),te=q(null),ne=q(null),re=q(null),ie=q(null),ae=q(null),oe=q(null),se=q(null),ce=q(null),le=q(!1),ue=q(null),F=q(null),de=q(null),fe=q(null),pe=_c(()=>new Map,[]),[,me]=pc(0),[he,ge]=pc(null),[_e,ve]=pc(null),[ye,be]=pc(null),[xe,Se]=pc(null),[Ce,we]=pc(0),[I,Te]=pc(null),Ee=q(I);Ee.current=I;let De=q(null),Oe=q(null),ke=q(null),Ae=q(null),je=q(null),Me=q(!1),Ne=()=>{Oe.current=null,ke.current=null,Ae.current=null},Pe=(e,t)=>{Oe.current=e,ke.current=null,Ae.current=t==null?null:{path:e,scrollTop:t}},Fe=(e,t)=>{Oe.current=null,ke.current={path:e,viewportOffset:t},Ae.current=null},Ie=q(d===`retain`&&t.isSearchOpen()),[Le,Re]=pc(p);hc(()=>{p||Re(!1)},[p]);let ze=q(!1),Be=vc(()=>{ze.current=!0,Re(e=>e&&!1)},[]),[Ve,He]=pc(()=>Ac({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ue,We]=pc(!1);hc(()=>{We(!0)},[]);let Ge=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ke=e?.contextMenu?.triggerMode??(Ge?`right-click`:`both`),qe=Ke===`both`||Ke===`button`,Je=e?.contextMenu?.buttonVisibility??`when-needed`,Ye=Ke===`both`||Ke===`right-click`;gc(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;je.current=t,ve(t),Se(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Me.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Xe=vc((e,t)=>{el(T.current,e,t)},[]),Ze=vc((e,t)=>{el(E.current,e,t)},[]),Qe=vc(e=>{x.current=e},[]),$e=vc(e=>tl(e,E.current,T.current),[]),et=n!=null||r!=null||i!=null,{resolveIcon:tt}=_c(()=>st(a),[a]),nt=t[ao](),rt=nt.getPath(),it=rt!=null,at=t.isSearchOpen(),ot=t.getSearchValue(),L=t.getFocusedPath(),R=t.getFocusedIndex(),ct=t.getScrollRequest(),lt=t.isDragAndDropEnabled(),ut=t.getDragSession(),dt=_c(()=>ut==null?null:new Set(ut.draggedPaths),[ut]),ft=ut?.target??null,pt=ut?.primaryPath??null,mt=ol(o),{overlayHeight:ht,overlayRows:gt,snapshot:z,visibleRows:_t}=Ve,vt=z.physical.viewportHeight,yt=_c(()=>({end:z.window.endIndex,start:z.window.startIndex}),[z.window.endIndex,z.window.startIndex]),bt=gt,xt=z.sticky.rows,St=z.physical.totalHeight,Ct=z.sticky.height,wt=_c(()=>new Set(xt.map(e=>Dc(e.row))),[xt]),Tt=R>=0&&R>=yt.start&&R<=yt.end,Et=vc((e,t)=>u?.({item:al(e,t),row:e})??null,[u]),Dt=vc(e=>zs(e==null?null:T.current.get(e)??null)?!0:zs(S.current),[]),Ot=vc(e=>{Dt(t.focusNearestPath(e))},[t,Dt]),kt=q(Ot);kt.current=Ot;let At=q(!0),jt=q(()=>{}),Mt=vc((t=!0)=>{let n=Ee.current;n!=null&&(At.current=At.current&&t,Te(null),e?.contextMenu?.onClose?.(),At.current&&Ot(n.path))},[e?.contextMenu,Ot]);jt.current=Mt;let It=vc(e=>{let t=e==null?null:$c(S.current,e);be(e=>e===t?e:t)},[]),Lt=vc((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=$e(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Pe(n,e?.scrollTop??null),j.current=!0,ge(e=>e===n?e:n)}i.focus(),It(a),At.current=!0,Te({anchorRect:r?.anchorRect??null,item:al(e,n),path:n,source:r?.source??`keyboard`})},[t,$e,It]),Rt=vc(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=Vs(e,vt);te.current=R<0||e==null?null:Math.max(0,Math.min(R*s-e.scrollTop,Math.max(0,t-s))),P.current=!0}t.startRenaming(e)!==!1&&(Se(`focus`),me(e=>e+1))}},[t,R,s,l,vt]),zt=vc((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=Vs(i,vt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:Ac({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return j.current=!0,Ks(i,a,s,l,u,d),D.current(),De.current=n?e:null,!0},[t,s,c,vt,h]),Bt=()=>y.current===!0||fe.current!=null||le.current===!0,Vt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Ht=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ut=()=>{ie.current!=null&&(clearTimeout(ie.current),ie.current=null),re.current=null},Wt=()=>{oe.current?.remove(),oe.current=null},Gt=()=>{Ht(ne.current),ne.current=null,ae.current=null},Kt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},qt=()=>{ce.current?.(),ce.current=null,fe.current!=null&&(clearTimeout(fe.current),fe.current=null),le.current=!1,ue.current=null,de.current=null,F.current!=null&&(F.current.setAttribute(`draggable`,`true`),F.current.style.removeProperty(`touch-action`),F.current=null),Wt(),Ut(),Gt(),se.current=null},Jt=(e,n)=>{let r=S.current?.getRootNode(),i=Lc(Fc(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Yt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ut();return}let r=t.getItem(e.directoryPath),i=Uc(r)?r:null;if(i==null||i.isExpanded()){Ut();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;re.current!==a&&(Ut(),re.current=a,ie.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Xt=()=>{ne.current=null;let e=ae.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Bc(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Yt(Jt(e.clientX,e.clientY)),ne.current=Vt(Xt)},Zt=(e,t)=>{ae.current={clientX:e,clientY:t},ne.current??=Vt(Xt)},Qt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(qt(),Wt(),Ut(),Gt(),t.startDrag(r)===!1){e.preventDefault();return}if(se.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),zc())){let t=Rc(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Kt(t),oe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},$t=()=>{Wt(),Ut(),Gt(),se.current=null,t.cancelDrag()},en=(e,n,r)=>{if(fe.current!=null||le.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;de.current={clientX:i.clientX,clientY:i.clientY},F.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!le.current;fe.current!=null&&(clearTimeout(fe.current),fe.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),ce.current===o&&(ce.current=null),t&&(a.setAttribute(`draggable`,`true`),F.current===a&&(F.current=null),de.current=null)},s=e=>{let t=e.touches[0],n=de.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=Mc*Mc||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),ce.current=o,fe.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),F.current===a&&(F.current=null),de.current=null;return}le.current=!0,F.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),se.current=n;let e=a.getBoundingClientRect(),s=Rc(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Kt(s),oe.current=s,ue.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=ue.current;n!=null&&oe.current!=null&&(oe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Yt(Jt(t.clientX,t.clientY)),Zt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Jt(n.clientX,n.clientY),t.completeDrag(),qt()},u=()=>{t.cancelDrag(),qt()};ce.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},jc)},tn=e=>{if(I!=null){if(e.key===`Escape`){Mt(),e.preventDefault(),e.stopPropagation();return}Yc.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(nt.isActive()){if(e.key===`Escape`)nt.cancel();else if(e.key===`Enter`)nt.commit();else return;Se(`focus`),me(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Rt(L??void 0),e.preventDefault(),e.stopPropagation();return}if(at){if(e.key===`Escape`)P.current=!1,te.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=Vs(n,vt);te.current=R<0||n==null?null:Math.max(0,Math.min(R*s-n.scrollTop,Math.max(0,r-s))),P.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Se(`focus`),me(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&Gc(e)){t.openSearch(e.key),me(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ge&&qc(e),r=Jc(e,Ge),i=r&&S.current!=null?Bs(S.current):null,a=r?new Set(nl(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==L&&a.has(o)){let e=C.current;Pe(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Uc(p)?p:null,h=u!=null&&(wt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=tl(u,E.current,T.current);e==null||n==null?y=!1:Lt(e,u)}else if((e.ctrlKey||e.metaKey)&&Wc(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Se(`focus`);let b=t.getFocusedPath(),x=b!=null&&(wt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Pe(b,v?.scrollTop??null),j.current=!0,ge(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Fe(b,il(S.current,v,i,u,s,Ct,vt)),j.current=!0,ge(e=>e===b?e:b)):Ne()}me(e=>e+1),e.preventDefault(),e.stopPropagation()};gc(()=>{if(!(!f||!at)){if(Ie.current){Ie.current=!1;return}zs(w.current)}},[at,f]),gc(()=>{let e=x.current;switch(Js({hasRenderedInput:e!=null,previousRenamingPath:N.current,renamingPath:rt})){case`reset`:N.current=null;return;case`reveal-canonical`:rt!=null&&zt(rt,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(De.current=null,N.current=rt,zs(e),e.select());return}},[yt.end,yt.start,rt,zt,wt]),gc(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Bs(e)?.dataset.itemPath??null;ge(e=>e===t?e:t)},i=()=>{n(),j.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Bs(e)!=null){r();return}j.current=!1,ge(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),j.current=!1,ge(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ge(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),gc(()=>{let e=S.current;e!=null&&(z.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[z.physical.scrollTop]),gc(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=Vs(n,g);let a=()=>{let e=t.getVisibleCount(),r=Hs(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),He(Ac({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!k.current){k.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=Hs(O.current,g),i=t.getVisibleRows(e,e)[0]??null;Ws(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?me(e=>e+1):o=!0,a()}),u=()=>{Me.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,we(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Me.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),Ee.current!=null&&y.current&&jt.current(),Me.current===!0){y.current=!1;return}ve(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:Us(e[0]))??Vs(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),gc(()=>{Ge||I==null||Mt(!1)},[Mt,Ge,I]);let nn=_c(()=>I==null?null:`${I.path}::${I.source}`,[I]);gc(()=>{if(nn==null){m?.clearSlotContent(Pt);return}let t=Ee.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??Zc(n.getBoundingClientRect()),close:e=>{jt.current(e?.restoreFocus??!0)},restoreFocus:()=>{At.current&&kt.current(Ee.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Pt,i),e?.contextMenu?.onOpen?.(t.item,r),ul(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&ul(i)}),()=>{m?.clearSlotContent(Pt)}},[nn,e?.contextMenu,m]),gc(()=>{I!=null&&t.getItem(I.path)==null&&Mt()},[Mt,I,t]),gc(()=>{if(I==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Xc(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Mt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Mt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Mt,I]),gc(()=>{let e=C.current,n=S.current;if(e==null||n==null){M.current=L;return}let r=L==null?null:T.current.get(L)??null,i=Bs(n),a=i?.dataset.itemPath??null,o=it&&x.current===i,c=f&&w.current===i,l=P.current&&!at,u=te.current??0,d=De.current,p=Oe.current,m=ke.current,g=Ae.current,_=i!=null,v=j.current||_,y=M.current!==L,b=p!=null&&p===L&&L!=null,E=!1,O=!1;if(ct!=null&&ct.id!==ee.current){ee.current=ct.id;let n=ct.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,vt-s))):Ct;E=!0,O=Gs(e,n,s,vt,St,ct.offset,t)}t.clearScrollRequest(ct.id)}let k=!E&&l&&Ks(e,R,s,vt,St,u),A=!E&&d!=null&&d===L&&Ks(e,R,s,vt,St,Ct),N=!E&&m!=null&&m.path===L&&Ks(e,R,s,vt,St,m.viewportOffset),ne=!E&&g!=null&&g.path===L&&e.scrollTop!==g.scrollTop;if(ne&&(e.scrollTop=g.scrollTop),(ne||O||A||N||k||v&&y&&d!==L&&!b&&Ws(e,R,s,vt,Ct))&&D.current(),E){M.current=L;return}if(!v){M.current=L;return}if(o){M.current=L;return}if(c&&!l){M.current=L;return}if(r==null){l&&R>=0&&(Ks(e,R,s,vt,St,u),D.current()),M.current=L;return}(y||l||d===L||p===L||m?.path===L||g?.path===L||a==null||a!==L)&&(zs(r),d===L&&(De.current=null),p===L&&(Oe.current=null),m?.path===L&&(ke.current=null),g?.path===L&&(Ae.current=null),P.current=!1,te.current=null),M.current=L},[t,R,L,Tt,s,it,at,yt,vt,f,ct,h,Ct,St,_t]);let rn=R>=0&&R>=z.visible.startIndex&&R<=z.visible.endIndex,B=L!=null&&bt.some(e=>Dc(e.row)===L),an=rn||B,on=qe&&j.current===!0&&an?L:null,sn=xe===`pointer`?_e:null,cn=I?.path??je.current??sn??on??_e,ln=I?.source===`right-click`;gc(()=>{y.current&&I==null||It($e(cn))},[I,$e,yt,vt,Ce,bt,cn,It,_t]);let un=vc(e=>{if(y.current||Xc(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Se(e=>e===`pointer`?e:`pointer`),ve(e=>e===i?e:i)},[]),dn=vc(()=>{ve(null)},[]);gc(()=>{if(!lt)return;let e=()=>{qt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),qt(),t.cancelDrag()}},[t,lt]);let V=e=>{if(!lt||t.getDragSession()==null||le.current)return;let n=Lc(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Yt(t.getDragSession()?.target??null),Zt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},fn=e=>{if(!lt||t.getDragSession()==null||le.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ut(),Gt(),t.setDragTarget(null))},pn=e=>{!lt||t.getDragSession()==null||le.current||(e.preventDefault(),Jt(e.clientX,e.clientY),t.completeDrag(),Wt(),Ut(),Gt(),se.current=null)},mn=z.window.height,hn=z.window.offsetTop,gn=Math.min(0,vt-mn),_n=Math.min(0,vt-mn-Ct),vn=he===L||P.current,yn=L!=null&&vn&&!Tt&&R>=0?_t[R]??t.getVisibleRows(R,R)[0]??null:null,bn=yn==null?null:qs(R,s,yt,mn),xn=se.current,Sn=pt!=null&&xn!=null&&xn.path===pt&&xn.index>=yt.start&&xn.index<=yt.end,Cn=pt!=null&&xn!=null&&xn.path===pt&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:qs(Cn.index,s,yt,mn),Tn=Kc((R>=0?_t[R]??t.getVisibleRows(R,R)[0]??null:null)?.ancestorPaths.at(-1)??null),En=at&&L!=null?sl(o,L,!Tt):void 0,Dn=I?.path??(at?L:he),On=I?.path??_e,kn=$e(cn),An=Ge&&qe&&!ln&&!it&&kn!=null&&ye!=null&&cn!=null,jn=Ge&&(An||I!=null),Mn=I?.anchorRect,Nn=Mn==null&&kn!=null&&ye!=null&&(I!=null||An)?ye:null,Pn=Mn==null?Nn==null?void 0:{top:`${Nn}px`}:{left:`${Mn.left}px`,position:`fixed`,right:`auto`,top:`${Mn.top}px`},Fn=ln?{opacity:`0`}:void 0,In=vc((e,n,r,i)=>{let a=Zs({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:at,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=z.visible.startIndex&&n.index<=z.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(j.current=!0,ge(e=>e===c?e:c),Se(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&zt(c,{targetOffset:`sticky-parents`})},[t,at,z.visible.endIndex,z.visible.startIndex,zt]),Ln=()=>{if(y.current||!qe||cn==null||kn==null)return;let e=t.getItem(cn);e!=null&&(It(kn),At.current=!0,Te({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:kn.getAttribute(`aria-label`)??cn,path:e.getPath()},path:e.getPath(),source:`button`}))},Rn={contextHoverPath:On,contextMenuButtonTriggerEnabled:qe,contextMenuButtonVisibility:Je,contextMenuEnabled:Ge,contextMenuRightClickEnabled:Ye,contextMenuTriggerMode:Ke,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:lt,draggedPathSet:dt,dragTarget:ft,gitLaneActive:et,gitStatusByPath:n,handleRowDragEnd:$t,handleRowDragStart:Qt,handleRowTouchStart:en,ignoredGitDirectories:r,ignoredInheritanceCache:pe,instanceId:o,itemHeight:s,onKeyDown:tn,onRowClick:In,openContextMenuForRow:Lt,registerButton:Xe,registerRenameInput:Qe,renameView:nt,renderDecorationForRow:Et,resolveIcon:tt,shouldSuppressContextMenu:Bt,visualFocusPath:Dn},zn={...Rn,registerButton:Ze};return K(`div`,{ref:S,id:mt,"data-file-tree-context-menu-button-visibility":Ge&&qe?Je:void 0,"data-file-tree-context-menu-trigger-mode":Ge?Ke:void 0,"data-file-tree-has-context-menu-action-lane":Ge&&qe?`true`:void 0,"data-file-tree-has-git-lane":et?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:lt?fn:void 0,onDragOver:lt?V:void 0,onDrop:lt?pn:void 0,onKeyDown:tn,onPointerLeave:Ge?dn:void 0,onPointerOver:Ge?un:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[K(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Tn}}),K(`slot`,{name:Nt,"data-type":`header-slot`}),f?K(`div`,{"data-file-tree-search-container":!0,"data-open":at?`true`:`false`,children:K(`input`,{ref:w,"aria-activedescendant":En,"aria-controls":mt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Le?`true`:void 0,value:ot,onBlur:()=>{d===`retain`&&!ze.current||t.closeSearch()},onFocus:Be,onPointerDown:Be,onInput:e=>{Be();let n=e.currentTarget;t.setSearch(n.value)}})}):null,K(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ue&&bt.length>0?K(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:K(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${ht}px`},children:bt.map((e,t)=>fl(zn,e.row,`sticky:${Dc(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${bt.length-t}`}}))})}):null,K(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${St}px`},children:[K(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${hn}px`}}),K(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${mn}px`,top:`${gn}px`,bottom:`${_n}px`},children:[pl(Rn,yt,wt),yn!=null&&bn!=null?fl(Rn,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:pt===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?fl(Rn,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),Ge?K(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":jn?`true`:`false`,style:Pn,children:[K(`button`,{ref:v,type:`button`,"data-type":Ft,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":I==null?`false`:`true`,"data-visible":An?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),I!=null){Mt();return}Ln()},tabIndex:-1,style:Fn,children:K(cs,{...tt(`file-tree-icon-ellipsis`)})}),I==null?null:K(`slot`,{name:Pt})]}):null,I==null?null:K(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Mt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Mt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var hl={hydrateRoot:(e,t)=>{rs(No(ml,t),e)},renderRoot:(e,t)=>{ns(No(ml,t),e)},unmountRoot:e=>{ns(null,e)}};function gl(e,t){hl.renderRoot(e,t)}function _l(e,t){hl.hydrateRoot(e,t)}function vl(e){hl.unmountRoot(e)}var yl=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},bl=`__c`,xl=`__k`,Sl=`__d`,Cl=`__s`,wl=/[\s\n\\/='"\0<>]/,Tl=/^(xlink|xmlns|xml)([A-Z])/,El=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,Dl=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,Ol=new Set([`draggable`,`spellcheck`]);function kl(e){e.__g===void 0?e[Sl]=!0:e.__g|=8}function Al(e){e.__g===void 0?e[Sl]=!1:e.__g&=-9}function jl(e){return e.__g===void 0?!0===e[Sl]:!!(8&e.__g)}var Ml=/["&<]/;function Nl(e){if(e.length===0||!1===Ml.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var Pl={},Fl=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),Il=/[A-Z]/g;function Ll(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:Pl[n]||(Pl[n]=n.replace(Il,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||Fl.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function Rl(){this.__d=!0}function zl(e,t){return{__v:e,context:t,props:e.props,setState:Rl,forceUpdate:Rl,__d:!0,__h:[]}}function Bl(e,t,n){if(!e.s){if(n instanceof Vl){if(!n.s)return void(n.o=Bl.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Bl.bind(null,e,t),Bl.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var Vl=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{Bl(r,1,a(this.v))}catch(e){Bl(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?Bl(r,1,t?t(i):i):n?Bl(r,1,n(i)):Bl(r,2,i)}catch(e){Bl(r,2,e)}},r},e}(),Hl,Ul,Wl,Gl,Kl={},ql=Array.isArray,Jl=Object.assign,Yl=``,Xl=`<!--$s-->`,Zl=`<!--/$s-->`;function Ql(e,t){var n,r=e.type,i=!0;return e[bl]?(i=!1,(n=e[bl]).state=n[Cl]):n=new r(e.props,t),e[bl]=n,n.__v=e,n.props=e.props,n.context=t,kl(n),n.state??=Kl,n[Cl]??(n[Cl]=n.state),r.getDerivedStateFromProps?n.state=Jl({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[Cl]===n.state?n.state:n[Cl]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),Wl&&Wl(e),n.render(n.props,n.state,t)}function $l(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===Yl)return Yl;var s=typeof e;if(s!=`object`)return s==`function`?Yl:s==`string`?Nl(e):e+Yl;if(ql(e)){var c,l=Yl;i[xl]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=$l(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=Yl,ql(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return Yl;e.__=i,Hl&&Hl(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===Fo){if(`tpl`in g){for(var x=Yl,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!ql(C)?x+=C:x+=$l(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+Nl(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=Ql(e,b),y=e[bl];else{e[bl]=y=zl(e,b);for(var E=0;jl(y)&&E++<25;){Al(y),Wl&&Wl(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}kl(y)}if(y.getChildContext!=null&&(t=Jl({},t,y.getChildContext())),T&&G.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===Fo&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return $l(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[Cl]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,Kl),jl(y)?(v=Ql(e,t),(y=e[bl]).getChildContext!=null&&(t=Jl({},t,y.getChildContext())),$l(v=v!=null&&v.type===Fo&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):Yl}finally{Ul&&Ul(e),Gl&&Gl(e)}}}v=v!=null&&v.type===Fo&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=$l(v,t,n,r,e,a,o);return Ul&&Ul(e),G.unmount&&G.unmount(e),e._suspended?typeof D==`string`?Xl+D+Zl:ql(D)?(D.unshift(Xl),D.push(Zl),D):D.then(function(e){return Xl+e+Zl}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return $l(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var ee=G.__e;return ee&&ee(i,e),Yl}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=$l(v,t,n,r,e,a,o);return e._suspended?Xl+s+Zl:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var k,A=`<`+h,j=Yl;for(var M in g){var N=g[M];if(typeof(N=tu(N)?N.value:N)!=`function`||M===`class`||M===`className`){switch(M){case`children`:k=N;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;M=`for`;break;case`className`:if(`class`in g)continue;M=`class`;break;case`defaultChecked`:M=`checked`;break;case`defaultSelected`:M=`selected`;break;case`defaultValue`:case`value`:switch(M=`value`,h){case`textarea`:k=N;continue;case`select`:r=N;continue;case`option`:r!=N||`selected`in g||(A+=` selected`)}break;case`dangerouslySetInnerHTML`:j=N&&N.__html;continue;case`style`:typeof N==`object`&&(N=Ll(N));break;case`acceptCharset`:M=`accept-charset`;break;case`httpEquiv`:M=`http-equiv`;break;default:if(Tl.test(M))M=M.replace(Tl,`$1:$2`).toLowerCase();else{if(wl.test(M))continue;M[4]!==`-`&&!Ol.has(M)||N==null?n?Dl.test(M)&&(M=M===`panose1`?`panose-1`:M.replace(/([A-Z])/g,`-$1`).toLowerCase()):El.test(M)&&(M=M.toLowerCase()):N+=Yl}}N!=null&&!1!==N&&(A=!0===N||N===Yl?A+` `+M:A+` `+M+`="`+(typeof N==`string`?Nl(N):N+Yl)+`"`)}}if(wl.test(h))throw Error(h+` is not a valid HTML tag name in `+A+`>`);if(j||(typeof k==`string`?j=Nl(k):k!=null&&!1!==k&&!0!==k&&(j=$l(k,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),Ul&&Ul(e),Gl&&Gl(e),!j&&eu.has(h))return A+`/>`;var P=`</`+h+`>`,te=A+`>`;return ql(j)?[te].concat(j,[P]):typeof j==`string`?te+j+P:[te,j,P]}var eu=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function tu(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var nu=0;function ru(e){return e!=null&&e.length>0?e:(nu+=1,`pst_ft_${nu}`)}function iu({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??ma)}function au(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function ou(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function su(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var cu=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new yl;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=ru(a),this.#p=_o(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=pa(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new fo({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(vl(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),gl(t.wrapper,this.#w()))}setGitStatus(e){this.#p=_o(e,this.#p);let t=this.#T();t!=null&&gl(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),gl(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),_l(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),gl(r,this.#w())}#C(){return{initialViewportHeight:iu({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(Nt,e());return}this.#l.setSlotHtml(Nt,this.#e?.header?.html??null)}#k(e){let t=su(e).find(e=>ou(e)),n=au($e(tt(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=su(e),n=t.find(e=>ou(e)),r=t.filter(e=>e!==n),i=tt(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=au(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=tt(this.#m);t.colored&&Qe(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${kt}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(kt,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=va(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return wa(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},J=t(n(),1),lu=typeof window>`u`?J.useEffect:J.useLayoutEffect;function uu({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c,contentEditable:l}){let u=ce(),d=r!==void 0,f=(0,J.useContext)(Se),p=se(),m=(0,J.useRef)(null),h=pe(r=>{if(r!=null){if(m.current!=null)throw Error(`File: An instance should not already exist when a node is created`);u==null?m.current=new we(du({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),c?void 0:f,!0):m.current=new Oe(du({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),u,a,c?void 0:f,!0),m.current.hydrate({file:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(m.current==null)throw Error(`File: A File instance should exist when unmounting`);m.current.cleanUp(),m.current=null}});return lu(()=>{if(m.current==null)return;let i=du({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),a=!F(m.current.options,i);m.current.setOptions(i),m.current.render({file:e,lineAnnotations:n,forceRender:a}),r!==void 0&&m.current.setSelectedLines(r)}),lu(()=>{if(l&&m.current!=null){if(p===void 0)throw Error(`File: Editor is not attached`);return p.edit(m.current)}},[l,p]),{ref:h,getHoveredLine:(0,J.useCallback)(()=>m.current?.getHoveredLine(),[])}}function du({options:e,controlledSelection:t,contentEditable:n,hasCustomHeader:r,hasEditor:i,hasGutterRenderUtility:a}){let o=n&&i,s=t||a||r;if(!s&&!o)return e;let c={...e};return s&&(c={...c,controlledSelection:t,renderCustomHeader:r?me:e?.renderCustomHeader,renderGutterUtility:a?me:e?.renderGutterUtility}),o&&(c={...c,useTokenTransformer:!0}),c}var Y=t(e(),1);function fu({file:e,lineAnnotations:t,selectedLines:n,options:r,metrics:i,className:a,style:o,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d,prerenderedHTML:f,renderGutterUtility:p,disableWorkerPool:m=!1,contentEditable:h=!1}){let{ref:g,getHoveredLine:_}=uu({file:e,options:r,metrics:i,lineAnnotations:t,selectedLines:n,prerenderedHTML:f,hasGutterRenderUtility:p!=null,hasCustomHeader:c!=null,disableWorkerPool:m,contentEditable:h});return(0,Y.jsx)(Fe,{ref:g,className:a,style:o,children:M(Ee({file:e,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d,renderGutterUtility:p,lineAnnotations:t,getHoveredLine:_}),f)})}var pu=r(),mu=[`.avif`,`.gif`,`.ico`,`.jpeg`,`.jpg`,`.png`,`.svg`,`.webp`];function hu(e,t){let n=e.split(/[?#]/,1)[0]?.toLowerCase()??``;return t.some(e=>n.endsWith(e))}function gu(e){return hu(e,mu)}var _u=100,vu=class{#e=[];#t=[];#n;constructor(e){this.#n=Math.max(1,e?.maxEntries??_u)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo()}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),e}};function yu(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[];for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice()}}function bu(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=Cu(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
1672
|
+
`)&&!a.text.includes(`
|
|
1673
|
+
`),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
|
|
1674
|
+
`)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=`insert`,n!==`insert`))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){if(c===i.end){if(n??=`delete`,n!==`delete`)return!1;continue}if(c+(o.end-o.start)!==i.start||(n??=`backspace`,n!==`backspace`))return!1;continue}return!1}return n!==void 0}function xu(e,t){let n=[],r=[];for(let i=0;i<e.forwardEdits.length;i++){let a=e.forwardEdits[i],o=e.inverseEdits[i],s=t.forwardEdits[i],c=t.inverseEdits[i],l=Cu(s.start,e.forwardEdits);if(a.text.length>0){n.push({start:a.start,end:a.end,text:a.text+s.text}),r.push(o.text);continue}if(l===a.end){n.push({start:a.start,end:l+(s.end-s.start),text:``}),r.push(o.text+c.text);continue}n.push({start:Math.min(a.start,l),end:a.end,text:``}),r.push(c.text+o.text)}return{forwardEdits:n,inverseEdits:Su(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice()}}function Su(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function Cu(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var wu=1e5,Tu=10,Eu=13,Du=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,Ou=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},ku=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=xe(e)}append(e){let t=this.text.length,n=xe(e);for(let e=1;e<n.length;e++)this.lineOffsets.push(t+n[e]);return this.text+=e,t}},Au=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!zu(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!zu(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},ju=class{#e;#t=new ku(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=2654435769;constructor(e){this.#e=new ku(e);let t=this.#v(Ou.Original,0,e.length);this.#n=t.length>0?this.#x(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#h();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#d(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#d(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&Mu(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=Nu(e,0,this.#r),i=Nu(t,r,this.#r);if(r>=i)return``;let a=this.#l(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#_(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&Mu(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#u(s)}return o.join(``)}charAt(e){let t=this.#l(e);if(t===void 0)return``;let[n,r]=t;return this.#_(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=Pu(e),n=0,r=!1;return this.#g(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=Fu(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=Pu(e),a=0,o=0,s,c;return this.#g(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!Iu(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
|
|
1675
|
+
`)||e.text.includes(`\r`)||e.regex&&(e.text.includes(`\\n`)||e.text.includes(`\\r`)))return[];let t;try{t=Gu(e.text,e.regex,e.caseSensitive)}catch{return[]}return this.#c(t,e.wholeWord,wu)}#c(e,t,n){let r=[],i=this.#r,a=e=>this.charAt(e);for(let o=0;o<this.#i;o++){let s=this.getLineText(o),c=this.offsetAt({line:o,character:0});e.lastIndex=0;let l;for(;(l=e.exec(s))!==null;){let o=l.index,u=l[0];if(u.length===0){e.lastIndex=Ju(s,o);continue}let d=c+o;if((!t||Uu(d,u.length,i,a))&&(r.push([d,d+u.length]),r.length>=n))return r;o===e.lastIndex&&(e.lastIndex=Ju(s,o))}}return r}insert(e,t){if(e.length===0)return;let n=Nu(t,0,this.#r);this.#y(n,n,e)}delete(e,t){if(t<=0||this.#r===0)return;let n=Nu(e,0,this.#r),r=Nu(n+t,n,this.#r);n!==r&&this.#y(n,r,``)}applyEdits(e){if(e.length!==0)for(let t=e.length-1;t>=0;t--){let n=e[t],r=Nu(n.start,0,this.#r),i=Nu(n.end,r,this.#r);this.#y(r,i,n.text)}}positionAt(e){let t=Nu(e,0,this.#r);if(this.#r===0)return{line:0,character:0};let n=this.#f(t);return{line:n,character:t-(n===0?0:this.#p(n-1))}}positionsAt(e){let t=Array.from({length:e.length});if(e.length===0)return t;if(this.#r===0)return t.fill({line:0,character:0});for(let n=0;n<e.length;n++)t[n]=this.positionAt(e[n]);return t}offsetAt(e){if(e.line<0||this.#r===0)return 0;if(e.line>=this.#i)throw Error(`Line index out of range: ${e.line}`);let t=this.#d(e.line);if(t===void 0)throw Error(`Line index out of range: ${e.line}`);let n=Nu(e.character,0,t[1]-t[0]);return t[0]+n}#l(e){if(e<0||e>=this.#r)return;let t=this.#n,n=e;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(n-=e,n<t.piece.length)return[t,n];n-=t.piece.length,t=t.right}}#u(e){if(e.right!==null){let t=e.right;for(;t.left!==null;)t=t.left;return t}let t=e;for(;t.parent!==null&&t===t.parent.right;)t=t.parent;return t.parent}#d(e){if(e<0)throw Error(`Line index out of range: ${e}`);if(this.#r===0){if(e===0)return[0,0];throw Error(`Line index out of range: ${e}`)}if(e>=this.#i)throw Error(`Line index out of range: ${e}`);return[e===0?0:this.#p(e-1),e<this.#i-1?this.#p(e):this.#r]}#f(e){let t=this.#n,n=Nu(e,0,this.#r),r=0;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(r+=(t.left?.subtreeLineBreakCount??0)-+!!zu(t.left?.subtreeLastCharCode,t.piece.firstCharCode),n-=e,n<=t.piece.length){let e=this.#_(t.piece.source),i=Math.min(Bu(e.lineOffsets,t.piece.offset+n),t.piece.lineOffsetEnd);return r+=i-t.piece.lineOffsetStart,n===t.piece.length&&t.piece.hasVirtualTrailingCRBreak&&r++,n===t.piece.length&&zu(t.piece.lastCharCode,this.#u(t)?.piece.firstCharCode)&&r--,r}r+=t.piece.lineBreakCount-+!!zu(t.piece.lastCharCode,t.right?.subtreeFirstCharCode),n-=t.piece.length,t=t.right}return this.#i-1}#p(e){let t=this.#n,n=e,r=0,i;for(;t!==null;){let e=(t.left?.subtreeLineBreakCount??0)-+!!zu(t.left?.subtreeLastCharCode,t.piece.firstCharCode);if(n<e){i=t.piece.firstCharCode,t=t.left;continue}let a=t.left?.subtreeLength??0;r+=a,n-=e;let o=t.right?.subtreeFirstCharCode??i,s=t.piece.lineBreakCount-+!!zu(t.piece.lastCharCode,o);if(n<s)return r+this.#m(t.piece,n);r+=t.piece.length,n-=s,t=t.right}return this.#r}#m(e,t){return t<e.lineOffsetEnd-e.lineOffsetStart?this.#_(e.source).lineOffsets[e.lineOffsetStart+t]-e.offset:e.length}#h(){let e=[];return this.#g(t=>{e.push(t.text.slice(t.start,t.end))}),e.join(``)}#g(e){this.#O(this.#n,t=>{let n=this.#_(t.piece.source);return e({text:n.text,lineOffsets:n.lineOffsets,lineOffsetStart:t.piece.lineOffsetStart,lineOffsetEnd:t.piece.lineOffsetEnd,start:t.piece.offset,end:t.piece.offset+t.piece.length})})}#_(e){return e===Ou.Original?this.#e:this.#t}#v(e,t,n){let r=this.#_(e),i=t+n,a=Bu(r.lineOffsets,t),o=Bu(r.lineOffsets,i),s=r.text.charCodeAt(i-1);return new Ou(e,t,n,a,o,s===Eu&&r.lineOffsets[o-1]!==i,r.text.charCodeAt(t),s)}#y(e,t,n){if(e===t&&n.length===0)return;let[r,i]=this.#w(this.#n,e),[,a]=this.#w(i,t-e),o;if(n.length>0){let e=this.#v(Ou.Added,this.#t.append(n),n.length);o=this.#T(this.#E(r,e),a)}else{let[e,t]=this.#D(a);o=e===void 0?r:this.#T(this.#E(r,e),t)}o!==null&&(o.parent=null),this.#n=o,this.#r=o?.subtreeLength??0,this.#i=(o?.subtreeLineBreakCount??0)+1,this.#a=null,this.#o=null}#b(){return this.#s=Math.imul(this.#s,1664525)+1013904223>>>0,this.#s}#x(e){let t=new Au(e);return t.priority=this.#b(),t}#S(e,t){e.left=t,t!==null&&(t.parent=e)}#C(e,t){e.right=t,t!==null&&(t.parent=e)}#w(e,t){if(e===null)return[null,null];let n=e.left?.subtreeLength??0;if(t<=n){let[n,r]=this.#w(e.left,t);return this.#S(e,r),e.updateSubtreeLength(),[n,e]}let r=e.piece.length;if(t>=n+r){let[i,a]=this.#w(e.right,t-n-r);return this.#C(e,i),e.updateSubtreeLength(),[e,a]}let i=t-n,a=new Au(this.#v(e.piece.source,e.piece.offset,i)),o=new Au(this.#v(e.piece.source,e.piece.offset+i,r-i));return a.priority=e.priority,o.priority=e.priority,this.#S(a,e.left),this.#C(o,e.right),a.updateSubtreeLength(),o.updateSubtreeLength(),[a,o]}#T(e,t){return e===null?t:t===null?e:e.priority>=t.priority?(this.#C(e,this.#T(e.right,t)),e.updateSubtreeLength(),e):(this.#S(t,this.#T(e,t.left)),t.updateSubtreeLength(),t)}#E(e,t){if(e===null)return this.#x(t);let n=e;for(;n.right!==null;)n=n.right;if(Lu(n.piece,t)){n.piece=Ru(n.piece,t);for(let t=n;t!==null&&(t.updateSubtreeLength(),t!==e);)t=t.parent;return e}return this.#T(e,this.#x(t))}#D(e){if(e===null)return[void 0,null];if(e.left===null)return[e.piece,e.right];let[t,n]=this.#D(e.left);return this.#S(e,n),e.updateSubtreeLength(),[t,e]}#O(e,t){return e===null?!0:!this.#O(e.left,t)||t(e)===!1?!1:this.#O(e.right,t)}};function Mu(e){return e===10||e===13}function Nu(e,t,n){return Math.min(Math.max(e,t),n)}function Pu(e){let t=Array.from({length:e.length}).fill(0),n=0;for(let r=1;r<e.length;r++){let i=e.charCodeAt(r);for(;n>0&&i!==e.charCodeAt(n);)n=t[n-1];i===e.charCodeAt(n)&&n++,t[r]=n}return t}function Fu(e,t){let n=[];for(let[r,i]of e){let e=Nu(r,0,t),a=Nu(i,e,t);e<a&&n.push([e,a])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let e of n){let t=r[r.length-1];if(t!==void 0&&e[0]<=t[1]){t[1]=Math.max(t[1],e[1]);continue}r.push(e)}return r}function Iu(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+Math.floor((i-r)/2);e[n][1]<=t?r=n+1:i=n}let a=e[r];return a!==void 0&&a[0]<n}function Lu(e,t){return e.source===t.source&&e.offset+e.length===t.offset&&!zu(e.lastCharCode,t.firstCharCode)}function Ru(e,t){return new Ou(e.source,e.offset,e.length+t.length,e.lineOffsetStart,t.lineOffsetEnd,t.hasVirtualTrailingCRBreak,e.firstCharCode,t.lastCharCode)}function zu(e,t){return e===Eu&&t===Tu}function Bu(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2);e[i]<=t?n=i+1:r=i}return n}function Vu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Hu(e){if(e<=32||e===127)return!0;let t=String.fromCharCode(e);return Du.includes(t)}function Uu(e,t,n,r){let i=e<=0||Hu(Wu(r,e-1)),a=e+t>=n||Hu(Wu(r,e+t));return i&&a}function Wu(e,t){let n=e(t);return n.length===0?0:n.charCodeAt(0)}function Gu(e,t,n){let r=t?e:Vu(e);return new RegExp(r,`g${n?``:`i`}${t?`m`:``}`)}function Ku(e,t){return e.replace(/\$([$&]|\d+)/g,(e,n)=>n===`$`?`$`:n===`&`?t[0]??``:t[Number(n)]??``)}function qu(e,t,n,r,i,a){if(!r.regex)return r.replaceText;let o=e(i),s=n(o.line),c=i-t({line:o.line,character:0}),l;try{l=Gu(r.text,!0,r.caseSensitive)}catch{return r.replaceText}l.lastIndex=c;let u=l.exec(s);return u===null||u.index!==c||u[0].length!==a-i?r.replaceText:Ku(r.replaceText,u)}function Ju(e,t){if(t+1<e.length){let n=e.charCodeAt(t),r=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&r>=56320&&r<=57343)return t+2}return t+1}var Yu=class e{#e;#t;#n;#r;#i;#a;constructor(e,t,n=`text`,r=0,i=new vu){this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new ju(t),this.#i=i;let a=this.#r.getLineText(0,!0);a.endsWith(`\r
|
|
1676
|
+
`)?this.#a=`\r
|
|
1677
|
+
`:a.endsWith(`\r`)?this.#a=`\r`:this.#a=`
|
|
1678
|
+
`}get uri(){return this.#e}get languageId(){return this.#t}get version(){return this.#n}get lineCount(){return this.#r.lineCount}get eol(){return this.#a}get canUndo(){return this.#i.canUndo}get canRedo(){return this.#i.canRedo}positionAt(e){return this.normalizePosition(this.#r.positionAt(e))}positionsAt(e){let t=this.#r.positionsAt(e);for(let e=0;e<t.length;e++)t[e]=this.normalizePosition(t[e]);return t}offsetAt(e){return this.#r.offsetAt(this.normalizePosition(e))}getText(e){return e===void 0?this.#r.getText():this.#r.getText({start:this.normalizePosition(e.start),end:this.normalizePosition(e.end)})}getLineText(e,t){return this.#r.getLineText(e,t)}normalizeEol(e){return e.replace(/\r\n|\r|\n/g,this.eol)}getLineLength(e,t){return this.#r.getLineLength(e,t)}charAt(e){return typeof e==`number`?this.#r.charAt(e):this.#r.charAt(this.offsetAt(e))}getTextSlice(e,t){return this.#r.getTextSlice(e,t)}findNextNonOverlappingSubstring(e,t){return this.#r.findNextNonOverlappingSubstring(e,t)}search(e){return this.#r.search(e)}applyEdits(e,t=!0,n,r,i=!1){if(e.length!==0)return this.#o(this.#d(this.resolveEdits(e)),t,n,r,i)}resolveEdits(e){return e.map(e=>this.#c(e))}applyResolvedEdits(e,t=!0,n,r,i=!1){if(e.length!==0)return this.#o(this.#d(e.map(e=>this.#l(e))),t,n,r,i)}#o(e,t,n,r,i){let a=yu(this,e,this.#n,this.#n+1,t?n:void 0,t?r:void 0);t&&i&&(a.undoBoundary=!0);let o=this.#i.peekUndo(),s=this.#f(e);return this.#n++,s.lineDelta===0&&bu(o,a)?this.#i.replaceLastUndo(xu(o,a)):this.#i.push(a),s}setLastUndoSelectionsAfter(e){this.#i.setLastUndoSelectionsAfter(e)}setLastUndoLineAnnotations(e,t){this.#i.setLastUndoLineAnnotations(e,t)}undo(){let e=this.#i.popUndoToRedo();if(e===void 0)return;let t=this.#f(e.inverseEdits);if(t===void 0)return;this.#n=e.versionBefore;let n=e.selectionsBefore?.slice();return[t,n,e.lineAnnotationsBefore?.slice(),n===void 0?e.inverseEdits.map(e=>({...e})):void 0]}redo(){let e=this.#i.popRedoToUndo();if(e===void 0)return;let t=this.#f(e.forwardEdits);if(t===void 0)return;this.#n=e.versionAfter;let n=e.selectionsAfter?.slice();return[t,n,e.lineAnnotationsAfter?.slice(),n===void 0?e.forwardEdits.map(e=>({...e})):void 0]}normalizePosition(t){let n=e.#s(t.line,this.lineCount-1);return{line:n,character:e.#s(t.character,this.getLineLength(n))}}static#s(e,t){return Number.isNaN(e)?0:Math.max(0,Math.min(Math.floor(e),t))}#c(e){let t=this.offsetAt(e.range.start),n=this.offsetAt(e.range.end);if(t>n){let e=t;t=n,n=e}return this.#l({start:t,end:n,text:e.newText})}#l(e){let{start:t,end:n}=e,r=t===n;return this.#u(t)&&t--,r?n=t:this.#u(n)&&n++,{start:t,end:n,text:e.text}}#u(e){let t=this.#r.charAt(e-1).charCodeAt(0),n=this.#r.charAt(e).charCodeAt(0);return t>=55296&&t<=56319&&n>=56320&&n<=57343}#d(e){let t=[...e].sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});for(let e=0;e<t.length-1;e++)if(t[e].end>t[e+1].start)throw Error(`Overlapping text edits are not supported`);return t}#f(e){let t=this.#r.lineCount,n=this.positionsAt(e.flatMap(e=>[e.start,e.end])),r=this.#p(e,n),i=n[0],a=n[n.length-1],o=a.line===t-1&&a.character===this.#r.getLineLength(a.line);this.#r.applyEdits(e);let s=this.#r.lineCount;return{startLine:r.startLine,startCharacter:i.character,endCharacter:a.character,endLine:Math.min(r.endLine,Math.max(0,s-1)),endedAtDocumentEnd:o,previousLineCount:t,lineCount:s,lineDelta:s-t,changedLineRanges:r.ranges,changedLineChanges:r.changes}}#p(e,t){let n=1/0,r=0,i=0,a=[],o=[],s=this.#r.lineCount-1,c=this.#r.getLineLength(s);for(let l=0;l<e.length;l++){let u=e[l],d=t[l*2],f=t[l*2+1],p=d.line,m=f.line,h=be(u.text),g=p+i,_=g+h,v=h-(m-p);n=Math.min(n,p),r=Math.max(r,_);let y=a[a.length-1];y!==void 0&&g<=y[1]+1?a[a.length-1]=[y[0],Math.max(y[1],_)]:a.push([g,_]),o.push([g,_,v,d.character,f.character,m===s&&f.character===c]),i+=v}return n===1/0?{startLine:0,endLine:0,ranges:[[0,0]],changes:[[0,0,0,0,0,!1]]}:{startLine:n,endLine:r,ranges:a,changes:o}}},Xu=void 0,Zu=void 0;function Qu(){return Xu??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(nd())}function $u(){return Zu??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ed({metaKey:e,ctrlKey:t},n=Qu()){return n?e&&!t:t&&!e}function td(e){if(Qu()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(ed(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}function nd(){let e=globalThis.navigator;return e?.platform??e?.userAgentData?.platform??`unknown`}var rd={a:`selectAll`,d:`findNextMatch`};function id(e,t=Qu()){let n=ed(e,t),{shiftKey:r,altKey:i,key:a}=e,o=a.length===1?a.toLowerCase():a;if(t&&e.ctrlKey&&!e.metaKey&&!r&&!i&&(o===`k`||e.code===`KeyK`))return`deleteHardLineForward`;if(!e.metaKey&&!e.ctrlKey&&r&&i&&(o===`a`||e.code===`KeyA`))return`toggleBlockComment`;if(!e.metaKey&&!e.ctrlKey&&r&&i){if(o===`ArrowUp`)return`copyLineUp`;if(o===`ArrowDown`)return`copyLineDown`}if(!e.metaKey&&!e.ctrlKey&&!r&&!i&&o===`Escape`)return`simplifySelection`;if(!e.metaKey&&!r){if(!e.ctrlKey&&i&&o===`ArrowUp`)return`moveLineUp`;if(!e.ctrlKey&&i&&o===`ArrowDown`)return`moveLineDown`;if((t||navigator.platform.includes(`Linux`))&&e.ctrlKey&&i){if(o===`p`||e.code===`KeyP`)return`moveLineUp`;if(o===`n`||e.code===`KeyN`)return`moveLineDown`}}if(n&&(o===`f`||e.code===`KeyF`))return i?`openSearchReplacePanel`:`openSearchPanel`;if(!i){if(!n&&o===`Tab`)return r?`outdent`:`indent`;if(n)return!r&&o===`Enter`?`insertBlankLine`:!r&&(o===`/`||e.code===`Slash`)?`toggleComment`:!r&&o===`[`?`indentLess`:!r&&o===`]`?`indentMore`:o===`z`?r?`redo`:`undo`:!t&&o===`y`?`redo`:o===`Home`||t&&o===`ArrowUp`?r?`expandSelectionDocStart`:`moveCursorToDocStart`:o===`End`||t&&o===`ArrowDown`?r?`expandSelectionDocEnd`:`moveCursorToDocEnd`:rd[o]}}function ad(e,t=Qu()){if(!e.altKey&&ed(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var od=`::selection {
|
|
1679
|
+
background-color: #0000;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
[data-deleted-text-selection] [data-deletions] ::selection, [data-deleted-text-selection] [data-line-type="change-deletion"] ::selection {
|
|
1683
|
+
background-color: var(--diffs-editor-selection-bg);
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
@keyframes blinking {
|
|
1687
|
+
0% {
|
|
1688
|
+
opacity: 1;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
50% {
|
|
1692
|
+
opacity: 0;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
100% {
|
|
1696
|
+
opacity: 1;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
|
|
1700
|
+
:host, [data-code], [data-content], [data-diff-type="split"][data-overflow="wrap"] {
|
|
1701
|
+
position: relative;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
[data-code] {
|
|
1705
|
+
container-type: inline-size;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
[data-content] {
|
|
1709
|
+
cursor: text;
|
|
1710
|
+
caret-color: var(--diffs-bg-caret);
|
|
1711
|
+
background-color: #0000;
|
|
1712
|
+
outline: none;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
[data-line] {
|
|
1716
|
+
cursor: text;
|
|
1717
|
+
background-color: #0000;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
[data-line]:after {
|
|
1721
|
+
content: "";
|
|
1722
|
+
z-index: -20;
|
|
1723
|
+
background-color: var(--diffs-line-bg);
|
|
1724
|
+
pointer-events: none;
|
|
1725
|
+
position: absolute;
|
|
1726
|
+
inset: 0;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
[data-line][data-selected-line]:after {
|
|
1730
|
+
background-color: var(--diffs-computed-diff-line-bg, var(--diffs-bg));
|
|
1731
|
+
background-image: linear-gradient(var(--diffs-editor-line-highlight-bg),
|
|
1732
|
+
var(--diffs-editor-line-highlight-bg));
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
[data-editor-overlay] {
|
|
1736
|
+
display: contents;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
[data-caret], [data-selection-range], [data-match-range], [data-bracket-match-range], [data-marker-range] {
|
|
1740
|
+
height: 1lh;
|
|
1741
|
+
line-height: var(--diffs-line-height);
|
|
1742
|
+
pointer-events: none;
|
|
1743
|
+
position: absolute;
|
|
1744
|
+
top: 0;
|
|
1745
|
+
left: 0;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
[data-caret] {
|
|
1749
|
+
background-color: var(--diffs-bg-caret-override, var(--diffs-editor-cursor-fg, light-dark(color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg)))));
|
|
1750
|
+
visibility: hidden;
|
|
1751
|
+
width: 2px;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
1755
|
+
[data-caret] {
|
|
1756
|
+
animation: 1.2s .8s infinite blinking;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
[data-selection-range] {
|
|
1761
|
+
z-index: -10;
|
|
1762
|
+
background-color: var(--diffs-editor-selection-bg);
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
[data-selection-corner] {
|
|
1766
|
+
background-color: var(--diffs-selection-corner-bg, var(--diffs-bg));
|
|
1767
|
+
width: 100%;
|
|
1768
|
+
height: 100%;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
[data-match-range] {
|
|
1772
|
+
z-index: -10;
|
|
1773
|
+
background-color: var(--diffs-editor-match-bg, var(--diffs-editor-selection-bg));
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
[data-match-range]:not([data-focus]) {
|
|
1777
|
+
background-color: var(--diffs-editor-match-highlight-bg, light-dark(#ff963288, #ff963266));
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
[data-bracket-match-range] {
|
|
1781
|
+
z-index: -9;
|
|
1782
|
+
box-sizing: border-box;
|
|
1783
|
+
border-bottom: 1px solid
|
|
1784
|
+
var(--diffs-editor-bracket-match-border, color-mix(in lab, var(--diffs-fg) 60%, transparent));
|
|
1785
|
+
background-color: var(--diffs-editor-bracket-match-bg, color-mix(in lab, var(--diffs-fg) 5%, transparent));
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
[data-rtl] {
|
|
1789
|
+
border-top-left-radius: 3px;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
[data-rtr] {
|
|
1793
|
+
border-top-right-radius: 3px;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
[data-rbl] {
|
|
1797
|
+
border-bottom-left-radius: 3px;
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
[data-rbr] {
|
|
1801
|
+
border-bottom-right-radius: 3px;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
[data-marker-range] {
|
|
1805
|
+
z-index: 1;
|
|
1806
|
+
background-color: var(--diffs-marker-bg);
|
|
1807
|
+
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+");
|
|
1808
|
+
mask-position: 0 100%;
|
|
1809
|
+
mask-size: 6px 3px;
|
|
1810
|
+
mask-repeat: repeat-x;
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
[data-marker-error] {
|
|
1814
|
+
--diffs-marker-contrast: #fff;
|
|
1815
|
+
--diffs-marker-bg: var(--diffs-editor-error-fg, var(--diffs-deletion-base));
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
[data-marker-warning] {
|
|
1819
|
+
--diffs-marker-contrast: #000;
|
|
1820
|
+
--diffs-marker-bg: var(--diffs-editor-warning-fg, light-dark(var(--diffs-warning-light), var(--diffs-warning-dark)));
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
[data-marker-info] {
|
|
1824
|
+
--diffs-marker-contrast: #fff;
|
|
1825
|
+
--diffs-marker-bg: var(--diffs-editor-info-fg, var(--diffs-modified-base));
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
[data-marker-hint] {
|
|
1829
|
+
--diffs-marker-contrast: light-dark(#fff, #000);
|
|
1830
|
+
--diffs-marker-bg: var(--diffs-editor-hint-fg, var(--diffs-fg-number));
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
@media (width >= 480px) {
|
|
1834
|
+
[data-content] {
|
|
1835
|
+
caret-color: #0000;
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
[data-content]:focus ~ [data-editor-overlay] [data-caret] {
|
|
1839
|
+
visibility: visible;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
[data-editor-widget] {
|
|
1844
|
+
--diffs-widget-fg: var(--diffs-fg);
|
|
1845
|
+
--diffs-widget-bg: color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));
|
|
1846
|
+
--diffs-widget-border: color-mix(in lab, var(--diffs-fg) 20%, transparent);
|
|
1847
|
+
--diffs-widget-shadow: inset 0 0 0 1px var(--diffs-bg), 0 4px 8px #00000013,
|
|
1848
|
+
0 6px 18px #00000013;
|
|
1849
|
+
z-index: 100;
|
|
1850
|
+
width: fit-content;
|
|
1851
|
+
max-width: calc(100% - 24px);
|
|
1852
|
+
font: 14px/20px var(--diffs-header-font-fallback);
|
|
1853
|
+
border: 1px solid var(--diffs-widget-border);
|
|
1854
|
+
background-color: var(--diffs-widget-bg);
|
|
1855
|
+
box-shadow: var(--diffs-widget-shadow);
|
|
1856
|
+
background-clip: padding-box;
|
|
1857
|
+
border-radius: 9px;
|
|
1858
|
+
position: absolute;
|
|
1859
|
+
top: 0;
|
|
1860
|
+
left: 0;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
[data-marker-popup], [data-selection-action-popover] {
|
|
1864
|
+
--popover-viewport-left: 0px;
|
|
1865
|
+
--popover-viewport-right: 100cqw;
|
|
1866
|
+
--popover-min-left: calc(var(--popover-viewport-left) + var(--gutter-width, 0px) + 8px);
|
|
1867
|
+
--popover-available-width: max(0px,
|
|
1868
|
+
calc(var(--popover-viewport-right) - var(--popover-min-left) - 8px));
|
|
1869
|
+
max-width: min(640px, var(--popover-available-width));
|
|
1870
|
+
translate: clamp(var(--popover-min-left),
|
|
1871
|
+
var(--popover-x, var(--popover-min-left)),
|
|
1872
|
+
calc(var(--popover-viewport-right) - 8px - 100%))
|
|
1873
|
+
calc(var(--popover-y, 0px) + var(--popover-y-shift, 0px));
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
[data-marker-popup] {
|
|
1877
|
+
--diffs-widget-bg: var(--diffs-marker-bg);
|
|
1878
|
+
--diffs-widget-shadow: 0 4px 8px #00000026, 0 6px 18px #00000026;
|
|
1879
|
+
min-width: min(180px, var(--popover-available-width));
|
|
1880
|
+
overflow-wrap: anywhere;
|
|
1881
|
+
color: var(--diffs-marker-contrast, contrast-color(#fff, #000));
|
|
1882
|
+
white-space: normal;
|
|
1883
|
+
pointer-events: auto;
|
|
1884
|
+
border: 0;
|
|
1885
|
+
padding: 8px 12px;
|
|
1886
|
+
|
|
1887
|
+
& [data-marker-message] {
|
|
1888
|
+
white-space: normal;
|
|
1889
|
+
overflow-wrap: anywhere;
|
|
1890
|
+
|
|
1891
|
+
& code {
|
|
1892
|
+
white-space: normal;
|
|
1893
|
+
color: inherit;
|
|
1894
|
+
background-color: #0000;
|
|
1895
|
+
display: inline;
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
[data-selection-action-popover] {
|
|
1901
|
+
pointer-events: auto;
|
|
1902
|
+
flex-wrap: wrap;
|
|
1903
|
+
align-items: center;
|
|
1904
|
+
gap: 4px;
|
|
1905
|
+
width: max-content;
|
|
1906
|
+
padding: 4px;
|
|
1907
|
+
display: flex;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
[data-search-panel] {
|
|
1911
|
+
z-index: 100;
|
|
1912
|
+
flex-direction: column;
|
|
1913
|
+
justify-content: right;
|
|
1914
|
+
width: 100%;
|
|
1915
|
+
height: 0;
|
|
1916
|
+
display: flex;
|
|
1917
|
+
position: sticky;
|
|
1918
|
+
top: 16px;
|
|
1919
|
+
right: 16px;
|
|
1920
|
+
container: search-panel / inline-size;
|
|
1921
|
+
|
|
1922
|
+
& [data-editor-widget] {
|
|
1923
|
+
z-index: 100;
|
|
1924
|
+
flex-shrink: 0;
|
|
1925
|
+
align-items: stretch;
|
|
1926
|
+
gap: 8px;
|
|
1927
|
+
min-width: 260px;
|
|
1928
|
+
max-width: 100%;
|
|
1929
|
+
margin-inline: auto 16px;
|
|
1930
|
+
padding: 4px;
|
|
1931
|
+
display: flex;
|
|
1932
|
+
position: relative;
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
& svg {
|
|
1936
|
+
fill: currentColor;
|
|
1937
|
+
width: 12px;
|
|
1938
|
+
height: 12px;
|
|
1939
|
+
display: block;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
[data-search-grid] {
|
|
1944
|
+
grid-template-columns: auto auto auto;
|
|
1945
|
+
grid-template-areas: "find matches nav"
|
|
1946
|
+
"replace actions .";
|
|
1947
|
+
align-items: center;
|
|
1948
|
+
gap: 4px 6px;
|
|
1949
|
+
width: 100%;
|
|
1950
|
+
display: grid;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
[data-input-box][data-find] {
|
|
1954
|
+
grid-area: find;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
[data-search-nav] {
|
|
1958
|
+
grid-area: nav;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
[data-input-box][data-replace] {
|
|
1962
|
+
grid-area: replace;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
[data-replace-actions] {
|
|
1966
|
+
grid-area: actions;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
[data-search-grid][data-mode="find"] {
|
|
1970
|
+
grid-template-areas: "find matches nav";
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
[data-search-grid][data-mode="find"] [data-replace-cell] {
|
|
1974
|
+
display: none;
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
@container search-panel (width < 400px) {
|
|
1978
|
+
[data-search-panel] [data-editor-widget] {
|
|
1979
|
+
padding: 10px;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
[data-search-grid][data-mode="replace"] {
|
|
1983
|
+
grid-template-columns: auto 1fr auto;
|
|
1984
|
+
grid-template-areas: "find find find"
|
|
1985
|
+
"replace replace replace"
|
|
1986
|
+
"nav matches actions";
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
[data-search-grid][data-mode="find"] {
|
|
1990
|
+
grid-template-columns: auto 1fr auto;
|
|
1991
|
+
grid-template-areas: "find find find"
|
|
1992
|
+
"nav matches matches";
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
[data-replace-actions] {
|
|
1996
|
+
justify-self: end;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
[data-search-grid] [data-input-box] {
|
|
2000
|
+
width: auto;
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
[data-input-box] {
|
|
2005
|
+
align-items: center;
|
|
2006
|
+
width: 200px;
|
|
2007
|
+
display: flex;
|
|
2008
|
+
position: relative;
|
|
2009
|
+
|
|
2010
|
+
& input {
|
|
2011
|
+
width: 100%;
|
|
2012
|
+
min-width: 0;
|
|
2013
|
+
color: var(--diffs-fg);
|
|
2014
|
+
background-color: var(--diffs-bg);
|
|
2015
|
+
border: 1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));
|
|
2016
|
+
border-radius: 6px;
|
|
2017
|
+
outline: none;
|
|
2018
|
+
flex-grow: 1;
|
|
2019
|
+
padding-inline: 6px;
|
|
2020
|
+
font-size: 13px;
|
|
2021
|
+
line-height: 24px;
|
|
2022
|
+
|
|
2023
|
+
&::selection {
|
|
2024
|
+
background-color: color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg));
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
&:focus-visible {
|
|
2028
|
+
outline: 1px solid var(--diffs-modified-base);
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
&[data-find] input {
|
|
2033
|
+
padding-inline-end: 72px;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
& [data-search-icon] {
|
|
2037
|
+
--diffs-search-icon-size: 20px;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
[data-search-toggles] {
|
|
2042
|
+
align-items: center;
|
|
2043
|
+
gap: 1px;
|
|
2044
|
+
display: flex;
|
|
2045
|
+
position: absolute;
|
|
2046
|
+
top: 50%;
|
|
2047
|
+
right: 4px;
|
|
2048
|
+
transform: translateY(-50%);
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
[data-matches] {
|
|
2052
|
+
white-space: nowrap;
|
|
2053
|
+
min-width: 50px;
|
|
2054
|
+
color: color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));
|
|
2055
|
+
flex-shrink: 0;
|
|
2056
|
+
grid-area: matches;
|
|
2057
|
+
font-size: 12px;
|
|
2058
|
+
font-weight: 500;
|
|
2059
|
+
line-height: 20px;
|
|
2060
|
+
|
|
2061
|
+
&[data-no-matches] {
|
|
2062
|
+
color: color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg));
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
[data-replace-actions], [data-search-nav] {
|
|
2067
|
+
align-items: center;
|
|
2068
|
+
display: flex;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
[data-search-icon] {
|
|
2072
|
+
appearance: none;
|
|
2073
|
+
width: var(--diffs-search-icon-size, 24px);
|
|
2074
|
+
height: var(--diffs-search-icon-size, 24px);
|
|
2075
|
+
color: color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));
|
|
2076
|
+
border-radius: var(--diffs-search-icon-radius, 4px);
|
|
2077
|
+
cursor: pointer;
|
|
2078
|
+
background: none;
|
|
2079
|
+
border: 0;
|
|
2080
|
+
flex-shrink: 0;
|
|
2081
|
+
justify-content: center;
|
|
2082
|
+
align-items: center;
|
|
2083
|
+
margin: 0;
|
|
2084
|
+
padding: 0;
|
|
2085
|
+
transition: background-color .1s ease-in-out, color .1s ease-in-out;
|
|
2086
|
+
display: flex;
|
|
2087
|
+
|
|
2088
|
+
&:disabled {
|
|
2089
|
+
opacity: .25;
|
|
2090
|
+
cursor: default;
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
&:not(:disabled):hover {
|
|
2094
|
+
color: var(--diffs-fg);
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
&:focus-visible {
|
|
2098
|
+
outline: 1px solid var(--diffs-modified-base);
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
&[aria-pressed="true"] {
|
|
2102
|
+
color: var(--diffs-modified-base);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
[data-search-close] {
|
|
2107
|
+
--diffs-search-icon-size: 20px;
|
|
2108
|
+
--diffs-search-icon-radius: 50%;
|
|
2109
|
+
color: var(--diffs-widget-bg);
|
|
2110
|
+
background-color: color-mix(in lab,
|
|
2111
|
+
var(--diffs-widget-fg) 50%,
|
|
2112
|
+
var(--diffs-bg));
|
|
2113
|
+
position: absolute;
|
|
2114
|
+
top: 0;
|
|
2115
|
+
right: 0;
|
|
2116
|
+
transform: translate(50%, -50%);
|
|
2117
|
+
|
|
2118
|
+
&:not(:disabled):hover {
|
|
2119
|
+
opacity: 1;
|
|
2120
|
+
color: var(--diffs-widget-bg);
|
|
2121
|
+
background-color: var(--diffs-widget-fg);
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
`,sd=`//`,cd=[`/*`,`*/`],ld={sql:{lineComment:`--`},ruby:{lineComment:`#`,blockComment:[`=begin`,`=end`]},rst:{lineComment:`..`},coffeescript:{lineComment:`#`,blockComment:[`###`,`###`]},cmd:{lineComment:`@REM`},julia:{lineComment:`#`,blockComment:[`#=`,`=#`]},yaml:{lineComment:`#`},yml:{lineComment:`#`},markdown:{lineComment:null,blockComment:[`<!--`,`-->`]},zsh:{lineComment:`#`},makefile:{lineComment:`#`},handlebars:{lineComment:null,blockComment:[`{{!--`,`--}}`]},ini:{lineComment:`;`,blockComment:[`;`,` `]},powershell:{lineComment:`#`,blockComment:[`<#`,`#>`]},vb:{lineComment:`'`},xml:{lineComment:null,blockComment:[`<!--`,`-->`]},lua:{lineComment:`--`,blockComment:[`--[[`,`]]`]},html:{lineComment:null,blockComment:[`<!--`,`-->`]},diff:{lineComment:`#`,blockComment:[`#`,` `]},r:{lineComment:`#`},fsharp:{blockComment:[`(*`,`*)`]},pug:{lineComment:`//-`},perl:{lineComment:`#`},tex:{lineComment:`%`},clojure:{lineComment:`;;`},css:{lineComment:null},python:{lineComment:`#`,blockComment:[`"""`,`"""`]},dotenv:{lineComment:`#`},dockerfile:{lineComment:`#`},razor:{lineComment:null,blockComment:[`<!--`,`-->`]},prompt:{lineComment:null,blockComment:[`<!--`,`-->`]}};function ud(e,t){let n={...ld[e],...t?.[e]};return{lineComment:n.lineComment===void 0?sd:n.lineComment,blockComment:n.blockComment??cd}}function dd(e,t,n){let r=[],i=new Set;for(let a of t){let t=a.end.line;a.start.line<t&&a.end.character===0&&t--;let o=r.length,s=1/0;for(let o=a.start.line;o<=t;o++){if(i.has(o))continue;i.add(o);let t=e.getLineText(o),a=t.length-t.trimStart().length,c=a===t.length;c||(s=Math.min(s,a)),r.push({line:o,comment:t.slice(a,a+n.length)===n?a:-1,empty:c,indent:a,single:!1})}if(s!==1/0)for(let e=o;e<r.length;e++)r[e].empty||(r[e].indent=s);r.length===o+1&&(r[o].single=!0)}let a=r.some(e=>e.comment<0&&(!e.empty||e.single)),o=[];if(a){for(let e of r){if(e.empty&&!e.single)continue;let t={line:e.line,character:e.indent};o.push({range:{start:t,end:t},newText:n+` `})}return o}for(let t of r){if(t.comment<0)continue;let r=e.getLineText(t.line),i=t.comment,a=i+n.length+ +(r[i+n.length]===` `);o.push({range:{start:{line:t.line,character:i},end:{line:t.line,character:a}},newText:``})}return o}var fd=50;function pd(e,t,n,r,i){let a=Math.max(0,r-fd),o=e.getTextSlice(a,r),s=e.getTextSlice(i,i+fd),c=o.length-o.trimEnd().length,l=s.length-s.trimStart().length,u=o.length-c;if(o.slice(u-t.length,u)===t&&s.slice(l,l+n.length)===n)return{open:{start:r-c-t.length,end:r-c+ +(c>0),text:``},close:{start:i+l-+(l>0),end:i+l+n.length,text:``},contentStart:r,contentEnd:i};let d=i-r<=fd*2?e.getTextSlice(r,i):void 0,f=d??e.getTextSlice(r,r+fd),p=d??e.getTextSlice(i-fd,i),m=f.length-f.trimStart().length,h=i-(p.length-p.trimEnd().length)-n.length;if(f.slice(m,m+t.length)!==t||e.getTextSlice(h,h+n.length)!==n)return;let g=r+m,_=g+t.length+ +!!/\s/.test(f[t.length+m]??``),v=h-+!!/\s/.test(e.getTextSlice(h-1,h));return{open:{start:g,end:_,text:``},close:{start:v,end:h+n.length,text:``},contentStart:_,contentEnd:v}}function md(e,t,n,r){let i=0,a=t.length;for(;i<a;){let n=i+a>>>1;t[n].end<e?i=n+1:a=n}let o=n[i];for(let n=i;n<t.length;n++){let i=t[n];if(e<i.start)break;if(i.start===i.end&&e===i.start){if(r<0)break;o+=i.text.length;continue}if(e>i.end){o+=i.text.length-(i.end-i.start);continue}return e===i.end?i.start+o+i.text.length:i.start+o+(r>0?i.text.length:0)}return e+o}function hd(e,t,[n,r],i=!1){let a=t.map(t=>{let{start:n,end:r}=t;if(i){let t=r.line;n.line<t&&r.character===0&&t--;let i=e.getLineText(n.line),a=i.length-i.trimStart().length;n={line:n.line,character:a},r={line:t,character:e.getLineLength(t)}}return{from:e.offsetAt(n),to:e.offsetAt(r),direction:t.direction,comment:void 0}});if(i&&a.length>1){a.sort((e,t)=>{let n=e.from-t.from;return n===0?e.to-t.to:n});let e=0;for(let t=1;t<a.length;t++){let n=a[e],r=a[t];r.from<=n.to?n.to=Math.max(n.to,r.to):a[++e]=r}a.length=e+1}for(let t of a)t.comment=pd(e,n,r,t.from,t.to);let o=a.every(e=>e.comment!==void 0),s=[];for(let e of a){let t=e.comment;if(o&&t!==void 0){s.push(t.open,t.close);continue}if(t===void 0){if(e.from===e.to){s.push({start:e.from,end:e.to,text:n+` `+r});continue}s.push({start:e.from,end:e.from,text:n+` `},{start:e.to,end:e.to,text:` `+r})}}if(s.length===0)return;s.sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});let c=s.map(t=>({range:{start:e.positionAt(t.start),end:e.positionAt(t.end)},newText:t.text}));if(i)return{edits:c,nextSelectionOffsets:[]};let l=a.map(e=>{let t=e.comment;return o&&t!==void 0?{start:t.contentStart,end:t.contentEnd,startAssociation:1,endAssociation:-1}:t===void 0?e.from===e.to?{start:e.from,end:e.to,startAssociation:-1,endAssociation:-1,collapsedInset:n.length+1}:{start:e.from,end:e.to,startAssociation:1,endAssociation:-1}:{start:e.from,end:e.to,startAssociation:1,endAssociation:1}}),u=Array(s.length+1);u[0]=0;for(let e=0;e<s.length;e++){let t=s[e];u[e+1]=u[e]+t.text.length-(t.end-t.start)}return{edits:c,nextSelectionOffsets:l.map((e,t)=>{let n=md(e.start,s,u,e.startAssociation)+(e.collapsedInset??0);return[n,e.collapsedInset===void 0?md(e.end,s,u,e.endAssociation):n,a[t].direction]})}}function X(e,t,n){let{style:r,dataset:i,children:a,...o}=t??{},s=document.createElement(e);return Object.assign(s,o),r!==void 0&&(typeof r==`string`?s.style.cssText=r:Object.assign(s.style,r)),i!==void 0&&(typeof i==`string`?s.dataset[i]=``:Array.isArray(i)?i.forEach(e=>{s.dataset[e]=``}):Object.assign(s.dataset,i)),a!==void 0&&s.replaceChildren(...a),n!==void 0&&n.appendChild(s),s}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gd(e,t=`line`){let n=e.dataset[t];if(n===void 0)return;let r=parseInt(n,10);if(!Number.isNaN(r))return r}function _d(e,t){if(e.nodeType===3){let n=e.textContent?.length??0;return Math.max(0,Math.min(t,n))}return e.nodeType===1?Math.max(0,Math.min(t,e.childNodes.length)):0}function vd(e,t){return Object.assign(e,t)}function yd(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function bd(e,t=1e3){return Math.round(e*t)/t}function xd(e){return e.endsWith(`
|
|
2125
|
+
`)||e.endsWith(`\r`)}function Sd(e){if(!(typeof Intl>`u`||typeof Intl.Segmenter!=`function`))return new Intl.Segmenter(void 0,e)}var Cd,wd=!1;function Td(){return wd||=(Cd=Sd({granularity:`grapheme`}),!0),Cd}function Ed(e,t){let n=Dd(e);if(n.length===0)return;let r=[],i=!1;for(let a of t){if(a.side===`deletions`||a.lineNumber<=0){r.push(a);continue}let t=a.lineNumber-1,o=e.previousLineCount,s=!1;for(let e of n){let n=Math.max(1,o+e.lineDelta),r=Od(t,e,n);if(r===void 0){s=!0,t=void 0;break}(r!==t||Ad(t,e))&&(s=!0),t=r,o=n}if(t===void 0){i=!0;continue}let c=t+1;if(s){r.push(c===a.lineNumber?a:{...a,lineNumber:c}),i=!0;continue}r.push(a)}return i?r:void 0}function Dd(e){if(e.changedLineChanges!==void 0)return e.changedLineChanges.flatMap(([e,t,n,r=0,i=0,a=!1])=>{if(n===0)return[];let o=Math.max(0,t-e);return[{startLine:e,startCharacter:r,endLine:e+Math.max(0,o-n),deletesEndLine:n<0&&a,insertedLineBreaks:o,lineDelta:n}]});if(e.lineDelta===0)return e.changedLineRanges.flatMap(([e,t])=>{let n=t-e;return n<=0?[]:[{startLine:e,startCharacter:0,endLine:e,deletesEndLine:!1,insertedLineBreaks:n,lineDelta:n}]});let t=Math.max(0,-e.lineDelta),n=e.endedAtDocumentEnd&&e.startLine+t===e.previousLineCount-1;return[{startLine:e.startLine,startCharacter:e.startCharacter,endLine:e.startLine+t,deletesEndLine:n,insertedLineBreaks:Math.max(0,e.lineDelta),lineDelta:e.lineDelta}]}function Od(e,t,n){if(e<t.startLine)return e;if(e>t.endLine||t.endLine>t.startLine&&e===t.endLine&&!t.deletesEndLine)return e+t.lineDelta;if(t.startLine===t.endLine)return t.startCharacter===0?e+t.insertedLineBreaks:e;if(kd(e,t))return;let r=Math.min(Math.max(0,e-t.startLine),t.insertedLineBreaks);return jd(t.startLine+r,n)}function kd(e,t){return!(t.lineDelta>=0||e<t.startLine||e>t.endLine||e===t.startLine&&t.startCharacter>0||e===t.endLine&&!t.deletesEndLine)}function Ad(e,t){return t.lineDelta===0||e<t.startLine||e>t.endLine?!1:!(t.endLine>t.startLine&&e===t.endLine&&!t.deletesEndLine)}function jd(e,t){return Math.max(0,Math.min(e,Math.max(0,t-1)))}function Md(e,t,n){let r=new Map,i=new Map;for(let t of e){let e=t.lineNumber;r.has(e)||r.set(e,[]),i.has(e)||i.set(e,[]),(t.side===`deletions`?i:r).get(e).push(de(t))}let a=t.parentElement?.previousElementSibling,o,s;if(a!=null&&a instanceof HTMLElement&&a.dataset.deletions!==void 0)for(let e of a.children){let t=e,{gutter:n,content:r}=t.dataset;n===void 0?r!==void 0&&(s=t):o=t}Nd(t,n),s!==void 0&&Nd(s,o);let c=Pd(r,t,n);if(s===void 0)return;let l=Pd(i,s,o);requestAnimationFrame(()=>{Fd(r,i,c,l)})}function Nd(e,t){let n=[];for(let r=1;r<e.childElementCount;r++){let i=e.children[r];i.dataset.lineAnnotation!==void 0&&(n.push(i),t!==void 0&&n.push(t.children[r]))}for(let e of n)e.remove()}function Pd(e,t,n){let r=new Map;for(let n of t.children){let t=gd(n);if(t!==void 0){let i=e.get(t);if(i!==void 0){let e=X(`div`,{dataset:{lineAnnotation:`0,`+(t-1)},children:[X(`div`,{dataset:`annotationContent`,children:i.map(e=>X(`slot`,{name:e}))})]});n.after(e),r.set(t,e)}}}if(n!==void 0)for(let t of n.children){let n=gd(t,`columnNumber`);if(n!==void 0&&e.has(n)){let e=X(`div`,{dataset:{gutterBuffer:`annotation`,bufferSize:`1`},style:{gridRow:`span 1`}});t.after(e)}}return r}function Fd(e,t,n,r){let i=new Map;for(let[t,n]of e.entries()){let e=r.get(t);if(n.length===0&&e!==void 0){let n=Id(e);n>0&&i.set(t,n)}}for(let[e,r]of t.entries()){let t=n.get(e);if(r.length===0&&t!==void 0){let n=Id(t);n>0&&i.set(e,n)}}Ld(e,n,i),Ld(t,r,i)}function Id(e){let t=e.firstElementChild;return t instanceof HTMLElement?t.getBoundingClientRect().height:0}function Ld(e,t,n){for(let[r,i]of t.entries()){let t=e.get(r),a=n.get(r);t?.length===0&&a!==void 0&&i.style.setProperty(`--diffs-annotation-min-height`,`${a}px`)}}var Rd=class{#e;#t;#n;#r;#i;#a;#o=0;#s=0;#c=0;#l=!0;#u;#d=new Map;#f;#p;constructor(e){this.#f=e.hasActivePopover,this.#p=e.updateActivePopover}setViewportElements(e,t){let n=this.#e!==e||this.#t!==t;this.#e=e,n&&(this.#t=t,this.#l=!0,this.#u?.forEach(e=>e()),this.#u=void 0)}cleanUp(){this.#t=void 0,this.#e=void 0,this.#n=void 0,this.#r=void 0,this.#i=void 0,this.#a=void 0,this.#o=0,this.#s=0,this.#c=0,this.#l=!0,this.#u?.forEach(e=>e()),this.#u=void 0,this.#d.clear()}resetPlacement(e=`default`){this.#d.delete(e)}setPlacement(e,t=`default`){this.#d.set(t,e)}choosePlacement(e){let{preferred:t,fallback:n,viewport:r,popoverHeight:i,atDocumentEdge:a,placementKey:o=`default`}=e,s=this.#d.get(o),c;if(r!==void 0&&i>0){let e=(e,t=0)=>e.top>=r.top+t&&e.bottom<=r.bottom-t;c=s===`fallback`&&e(n)&&!e(t,4)||!e(t)&&e(n)?`fallback`:`preferred`}else c=a?`fallback`:`preferred`;return this.#d.set(o,c),c}getPlacementBounds(){let e=this.#g();if(e===void 0)return;let t=this.#_(),n,r;if(t===void 0?(n=0,r=window.innerHeight):(n=t.top,r=t.bottom),n=Math.max(n,e.top),r=Math.min(r,e.bottom),r<=n)return;let i=this.#o,a=this.#s,o=this.#c>0?this.#c:e.width,s=t===void 0?0:t.left,c=t===void 0?window.innerWidth:t.right,l=i,u=i+o,d=Math.max(l,s-e.left+i),f=Math.min(u,c-e.left+i);return{top:n-e.top+a,bottom:r-e.top+a,left:d,right:Math.max(d,f)}}#m(){let e=this.#e;if(e===void 0)return;if(this.#r===e&&(this.#n===void 0||this.#n.isConnected))return this.#n;let t=e.parentElement;for(;t!==null;){let n=getComputedStyle(t).overflowY;if(n===`auto`||n===`scroll`||n===`overlay`)return this.#n=t,this.#r=e,t;t=t.parentElement}this.#n=void 0,this.#r=e}#h(){if(!this.#l)return;this.#v();let e=this.#t;this.#i=e?.getBoundingClientRect(),this.#o=e?.scrollLeft??0,this.#s=e?.scrollTop??0,this.#c=e?.clientWidth??0,this.#a=this.#m()?.getBoundingClientRect(),this.#l=!1}#g(){return this.#h(),this.#i}#_(){return this.#h(),this.#a}#v(){if(this.#u!==void 0)return;let e,t=()=>{this.#l=!0,!(!this.#f()||e!==void 0)&&(e=requestAnimationFrame(()=>{e=void 0,this.#p()}))},n=this.#m(),r=this.#t;this.#u=[Z(n===void 0?window:n,`scroll`,t,{passive:!0}),...r===void 0?[]:[Z(r,`scroll`,t,{passive:!0})],Z(window,`resize`,t,{passive:!0}),()=>{e!==void 0&&(cancelAnimationFrame(e),e=void 0)}]}};function zd(e,{gutterWidth:t,placeAbove:n,viewport:r,x:i,y:a}){if(e.style.setProperty(`--gutter-width`,t+`px`),e.style.setProperty(`--popover-x`,i+`px`),e.style.setProperty(`--popover-y`,a+`px`),e.style.setProperty(`--popover-y-shift`,n?`-100%`:`0px`),r===void 0){e.style.removeProperty(`--popover-viewport-left`),e.style.removeProperty(`--popover-viewport-right`);return}e.style.setProperty(`--popover-viewport-left`,r.left+`px`),e.style.setProperty(`--popover-viewport-right`,r.right+`px`)}var Bd=new Map([[`'`,`'`],[`"`,`"`],["`","`"],[`{`,`}`],[`[`,`]`],[`<`,`>`],[`(`,`)`]]),Vd=new Set([`'`,`"`,"`"]),Hd=new Set([`{`,`[`,`(`,`<`]);function Ud(e,t=0){let n=Jf(e.startContainer,e.startOffset),r=Jf(e.endContainer,e.endOffset);if(!(n===null||r===null))return{start:n,end:r,direction:t}}function Wd(e,t,n,r){if(e===void 0)return[[],t];let{start:i,end:a}=t,o=[],s={...t},c=i.line!==a.line,l=a.line;i.line<a.line&&a.character===0&&l--;for(let t=i.line;t<=l;t++){let l=e.getLineText(t);if(l===void 0||c&&l.trim().length===0)continue;let u=l.startsWith(` `)?` `:` `.repeat(n),d=0,f=u;if(r){if(l.startsWith(` `))d=1;else if(l.startsWith(` `)){let e=l.length-l.trimStart().length;d=Math.min(u.length,e)}if(d===0)continue;f=``}o.push({range:{start:{line:t,character:0},end:{line:t,character:d}},newText:f});let p=f.length-d;t===i.line&&(s={...s,start:{...i,character:Math.max(0,i.character+p)}}),t===a.line&&(s={...s,end:{...a,character:Math.max(0,a.character+p)}})}return[o,s]}function Gd(e,t,n,r={}){let i=e.lineCount;return t.map(t=>{let{line:a,character:o}=n===`up`||n===`left`?t.start:t.end;if(n===`textStart`||n===`start`||n===`end`){let i=df(t);a=i.line,o=i.character;let s=Jd(e,a,o,r);if(n===`textStart`){let t=e.getLineText(a).slice(s.start,s.end),n=s.start+Gf(t);o=o===n?s.start:n}else o=n===`start`?s.start:s.end}else if(n===`up`){let t=Kd(e,a,o,-1,r);t===void 0?a>0&&(a=r.resolveRenderableLine==null?a-1:r.resolveRenderableLine(a-1,`up`)??a):(a=t.line,o=t.character)}else if(n===`down`){let t=Kd(e,a,o,1,r);if(t!==void 0)a=t.line,o=t.character;else{let e=Math.max(i-1,0);a<e&&(a=r.resolveRenderableLine==null?a+1:Math.min(r.resolveRenderableLine(a+1,`down`)??a,e))}}else if(Q(t)){let t=e.getLineLength(a);if(o=Math.min(o,t),n===`left`){if(o>0)o=Vf(e,a,o,!1);else if(a>0){let t=r.resolveRenderableLine==null?a-1:r.resolveRenderableLine(a-1,`up`);t!==void 0&&(a=t,o=e.getLineLength(a))}}else if(o<t)o=Vf(e,a,o,!0);else if(a<i-1){let e=r.resolveRenderableLine==null?a+1:r.resolveRenderableLine(a+1,`down`);e!==void 0&&(a=Math.min(e,i-1),o=0)}}let s={line:a,character:o};return{start:s,end:s,direction:0}})}function Kd(e,t,n,r,i){if(i.getSoftLineOffsets===void 0)return;let a=Jd(e,t,n,i),o=a.index+r,s=t,c;if(o>=0&&o<a.count)c=Xd(e,s,o,i);else{let a=t+r;if(a<0||a>=e.lineCount)return{line:t,character:n};let o=i.resolveRenderableLine==null?a:i.resolveRenderableLine(a,r<0?`up`:`down`);if(o===void 0)return{line:t,character:n};s=Math.min(o,e.lineCount-1);let l=Yd(e,s,i);c=Xd(e,s,r<0?l-1:0,i)}let l=Math.max(0,n-a.start),u=c.start+l,d=c.index===c.count-1?u:Math.min(u,c.end),f=e.getLineText(s);return{line:s,character:d>f.length?d:qd(f,d)}}function qd(e,t){if(t<=0||t>=e.length)return t;let n=Td();if(n!==void 0){for(let r of n.segment(e)){if(t<=r.index)return t;let e=r.index+r.segment.length;if(t<e)return e}return t}let r=0;for(let n of e){if(t<=r)return t;let e=r+n.length;if(t<e)return e;r=e}return t}function Jd(e,t,n,r){let i=e.getLineLength(t),a=r.getSoftLineOffsets?.(t);if(a===void 0||a.length<2)return{start:0,end:i,index:0,count:1};for(let i=0;i+1<a.length;i++){let a=Xd(e,t,i,r);if(n>=a.start&&n<=a.end)return a}return Xd(e,t,n<(a[0]??0)?0:a.length-2,r)}function Yd(e,t,n){let r=n.getSoftLineOffsets?.(t);return r===void 0||r.length<2?1:r.length-1}function Xd(e,t,n,r){let i=e.getLineLength(t),a=r.getSoftLineOffsets?.(t);if(a===void 0||a.length<2)return{start:0,end:i,index:0,count:1};let o=a.length-1,s=Math.max(0,Math.min(n,o-1)),c=Math.max(0,Math.min(i,a[s]??0));return{start:c,end:Math.max(c,Math.min(i,a[s+1]??i)),index:s,count:o}}function Zd(e,t,n,r={}){return t.map(t=>{let i=t.direction===-1?t.start:t.end,[a]=Gd(e,[{start:i,end:i,direction:0}],n,r);return _f(t,a)})}function Qd(e,t,n,r,i=2,a=!1){if(t[t.length-1]===void 0)return{nextSelections:[]};let o=[];for(let e of t)o.push(e.start,e.end);let s=o.map(t=>e.offsetAt(t)),c=s[(t.length-1)*2],l=s[(t.length-1)*2+1],u=[],d=!0;for(let e=0;e<t.length;e++){let t={index:e,start:s[e*2],end:s[e*2+1]},n=u[u.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(d=!1),u.push(t)}d||u.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let f=qf(e,n,i),p=[],m=Array.from({length:t.length}),h=0,g,_=()=>{if(g===void 0)return;let t=qf(e,{start:g.start,end:g.end,text:f.text},i),n=Wf(e,t.text,t.start);p.push({start:t.start,end:t.end,text:n});let r=[g.start+h+n.length,g.start+h+n.length];for(let e of g.indices)m[e]=r;h+=n.length-(t.end-t.start),g=void 0};for(let e of u){let t=Math.max(0,e.start+(f.start-c)),n=Math.max(t,e.end+(f.end-l));if(g!==void 0&&t<g.end){g.end=Math.max(g.end,n),g.indices.push(e.index);continue}_(),g={start:t,end:n,indices:[e.index]}}_();let v=e.applyResolvedEdits(p,!0,t,void 0,a),y=Kf(e,m.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(y),v!==void 0&&r!==void 0){let t=Ed(v,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:y,change:v}}function $d(e,t){if(t.length!==e.length+2)return;let n=Bd.get(t[0]);if(!(n===void 0||t[t.length-1]!==n||t.slice(1,-1)!==e))return 1}function ef(e,t,n,r){let i=t.start+n,a=i+r.length;if(t.end-t.start>0){let n=e.getTextSlice(t.start,t.end),a=$d(n,r)??r.indexOf(n);if(a!==-1&&a+n.length<=r.length){let e=i+a;return[e,e+n.length]}}return[a,a]}function tf(e,t,n,r,i=!1,a=`selection`){if(t.length!==n.length)throw Error(`Selection text replacements must match the selection count`);let o=[];for(let e of t)o.push(e.start,e.end);let s=o.map(t=>e.offsetAt(t)),c=[],l=!0;for(let e=0;e<t.length;e++){let t={index:e,start:s[e*2],end:s[e*2+1]},n=c[c.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(l=!1),c.push(t)}l||c.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let u=n.every(e=>e===``),d,f=Array.from({length:t.length});if(u){d=[];let e=!1;for(let t of c){if(f[t.index]=[t.end,t.end],t.start>=t.end)continue;e=!0;let n=d[d.length-1];n!==void 0&&t.start<n.end?d[d.length-1]={start:n.start,end:Math.max(n.end,t.end),text:``}:d.push({start:t.start,end:t.end,text:``})}if(!e)return{nextSelections:t};for(let e of c){let t=e.end,n=0,r=t;for(let e of d){if(t<=e.start)break;if(t>=e.end){n-=e.end-e.start;continue}r=e.start+n;break}r===t&&(r+=n),f[e.index]=[r,r]}}else{d=[];let t=0,r=-1;for(let i=0;i<c.length;i++){let o=c[i];if(o.start<r)throw Error(`Overlapping multi-selection edits are not supported`);r=o.end;let s=Wf(e,n[a===`document`?i:o.index],o.start);d.push({start:o.start,end:o.end,text:s}),f[o.index]=ef(e,o,t,s),t+=s.length-(o.end-o.start)}}let p=e.applyResolvedEdits(d,!0,t,void 0,i),m=Kf(e,f.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(m),p!==void 0&&r!==void 0){let t=Ed(p,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:m,change:p}}function nf(e,t){return e===`never`?!1:e===`brackets`?Hd.has(t):e===`quotes`?Vd.has(t):!0}function rf(e,t,n,r){if(n.length!==1||t.length===0)return;let i=Bd.get(n);if(i===void 0||!nf(r,n))return;let a=[];for(let r of t){if(Q(r))return;a.push(n+e.getText(r)+i)}return a}function af(e,t,n){let r=[],i=[];for(let n of t){let[t,a]=Hf(e,n);if(!Q(n)){i.push([t,a]);continue}let{line:o,character:s}=n.start,c=t,l=e.getLineText(o),u=l.length,d=c-s,f=Bf(l),p;if(s>0&&s<u){let e=zf(l,s,!1,f),t=zf(l,s,!0,f);p={start:d+e,end:d+t,text:l.slice(s,t)+l.slice(e,s)},i.push([d+t,d+t])}else if(s===u&&f.length>=2){let e=f[f.length-1],t=f[f.length-2];p={start:d+t,end:c,text:l.slice(e,u)+l.slice(t,e)},i.push([c,c])}else if(s===0&&o>0&&u>0){let t=o-1,n=e.getLineText(t),r=n.length,a=e.offsetAt({line:t,character:r}),s=r>0?zf(n,r,!1,Bf(n)):r,u=zf(l,0,!0,f),d=a-(r-s),m=l.slice(0,u)+e.getTextSlice(a,c)+n.slice(s,r);p={start:d,end:c+u,text:m};let h=d+m.length;i.push([h,h])}else{i.push([t,a]);continue}r.push(p)}if(r.length===0)return{nextSelections:t};r.sort((e,t)=>e.start-t.start);for(let e=1;e<r.length;e++)if(r[e].start<r[e-1].end)throw Error(`Overlapping multi-selection edits are not supported`);let a=e.applyResolvedEdits(r,!0,t),o=Kf(e,i);if(e.setLastUndoSelectionsAfter(o),a!==void 0&&n!==void 0){let t=Ed(a,n);t!==void 0&&e.setLastUndoLineAnnotations(n,t)}return{nextSelections:o,change:a}}function of(e,t,n){let r=t.map(t=>{let n=Uf(e,t);return{start:n.start,end:n.end,direction:0}});return tf(e,r,r.map(()=>``),n)}function sf(e,t,n,r){let i=t.map(t=>{if(!Q(t))return{start:t.start,end:t.end,direction:0};let r=df(t),{line:i,character:a}=r,o=n?.(i,a)??0;if(a>o)return{start:{line:i,character:o},end:{line:i,character:a},direction:0};if(i===0)return{start:r,end:r,direction:0};let s=e.getLineLength(i-1);return{start:{line:i-1,character:s},end:{line:i,character:0},direction:0}});return tf(e,i,i.map(()=>``),r)}function cf(e,t,n){let r=t.map(t=>{let[n,r]=Rf(e,t);return{start:n,end:r,direction:0}});return tf(e,r,r.map(()=>``),n)}function lf(e,t,n){if(!Q(t))return[t.start,t.end];let r=df(t),{line:i,character:a}=r,o=e.getLineLength(i),s=e.lineCount;if(a=Math.min(a,o),n)return a<o?[{line:i,character:a},{line:i,character:Vf(e,i,a,!0)}]:i<s-1?[{line:i,character:o},{line:i+1,character:0}]:[r,r];if(a>0)return[{line:i,character:Vf(e,i,a,!1)},{line:i,character:a}];if(i>0){let t=e.getLineLength(i-1);return[{line:i-1,character:t},{line:i,character:0}]}return[r,r]}function uf(e,t,n,r,i=2){let a=t.map(t=>{let[r,a]=lf(e,t,n);if(!n&&Q(t)){let t=qf(e,{start:e.offsetAt(r),end:e.offsetAt(a),text:``},i);r=e.positionAt(t.start),a=e.positionAt(t.end)}return{start:r,end:a,direction:0}});return tf(e,a,a.map(()=>``),r)}function Q(e){return e.start.line===e.end.line&&e.start.character===e.end.character}function df(e){let{start:t,end:n,direction:r}=e;return r===-1?t:n}function ff(e){return e===`context`||e===`context-expanded`||e===`change-addition`}function pf(e,t){let n=Q(e),r=Q(t);return n&&r?$(e.start,t.start)===0:n?$(t.start,e.start)<=0&&$(e.start,t.end)<=0:r?$(e.start,t.start)<=0&&$(t.start,e.end)<=0:$(e.start,t.end)<0&&$(t.start,e.end)<0}function $(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function mf(e,t,n){let r=t===n?0:t<n?1:-1,i=Math.min(t,n),a=Math.max(t,n);return{start:e.positionAt(i),end:e.positionAt(a),direction:r}}function hf(e,t){let n=0;for(let r of t){if(e<r.start)break;if(e>=r.end)n+=r.text.length-(r.end-r.start);else return r.start+n+r.text.length}return e+n}function gf(e,t,n,r){return t.map((t,i)=>{let[a,o]=n[i],s=hf(a,r),c=hf(o,r);return mf(e,t.direction===-1?c:s,t.direction===-1?s:c)})}function _f(e,t){let n=e.direction===-1?e.end:e.start,r=$(n,t.start),i=$(n,t.end),a=t.end;a=r<=0?t.end:i>=0?t.start:r===0?t.end:t.start;let o=$(n,a);return{start:o<=0?n:a,end:o<=0?a:n,direction:o===0?0:o<0?1:-1}}function vf(e,t){let n=$(t.start,e.start)<0,r=$(t.end,e.end)>0;return n&&!r?{start:t.start,end:e.end,direction:-1}:r&&!n?{start:e.start,end:t.end,direction:1}:e.direction===-1?{start:t.start,end:e.end,direction:$(t.start,e.end)===0?0:-1}:{start:e.start,end:t.end,direction:$(e.start,t.end)===0?0:1}}function yf(e,t){return bf(e.map(e=>vf(e,t)))}function bf(e){if(e.length<=1)return e;let t=e.map((e,t)=>({index:t,selection:e})).sort((e,t)=>{let n=$(e.selection.start,t.selection.start);if(n!==0)return n;let r=$(e.selection.end,t.selection.end);return r===0?e.index-t.index:r}),n=[],r=t[0];for(let e of t.slice(1)){if(pf(r.selection,e.selection)){let t=e.index>r.index?e:r,n=$(e.selection.start,r.selection.start)<0?e.selection.start:r.selection.start,i=$(e.selection.end,r.selection.end)>0?e.selection.end:r.selection.end,a=t.selection.direction;a===0&&$(n,i)!==0&&(a=$(t.selection.start,n)===0?-1:1),r={index:t.index,selection:{direction:a,end:i,start:n}};continue}n.push(r),r=e}return n.push(r),n.sort((e,t)=>e.index-t.index).map(({selection:e})=>e)}function xf(e){let t=e.map(e=>{let t=e.end.line;return e.end.character===0&&$(e.start,e.end)!==0&&t--,{startLine:e.start.line,endLine:Math.max(e.start.line,t)}}).sort((e,t)=>{let n=e.startLine-t.startLine;return n===0?e.endLine-t.endLine:n}),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&e.startLine<=t.endLine+1?t.endLine=Math.max(t.endLine,e.endLine):n.push({...e})}return n}function Sf(e,t,n,r){let i=e=>{let i=e.line+t;if(i>=n){let e=Math.max(0,n-1);return{line:e,character:r(e)}}return i<0?{line:0,character:0}:{line:i,character:e.character}};return{start:i(e.start),end:i(e.end),direction:e.direction}}function Cf(e,t){if(t.length===0)return;let n=t.map(t=>Q(t)?If(e,t):t),r=n.map(t=>e.getText(t)),i=r[0];if(i.length===0||r.some(e=>e!==i))return;let a=n.map(t=>[e.offsetAt(t.start),e.offsetAt(t.end)]),o=e.findNextNonOverlappingSubstring(i,a);if(o===void 0)return n.some((e,n)=>{let r=t[n];return $(e.start,r.start)!==0||$(e.end,r.end)!==0||e.direction!==r.direction})?n:void 0;let s=mf(e,o,o+i.length);return[...n,s]}function wf(e){let t=e.lineCount-1;return{start:{line:0,character:0},end:{line:t,character:e.getLineLength(t)},direction:1}}function Tf(e,t,n){let r=0;if(t){let t=e.lineCount-1;r=n===!0&&t>0&&e.getLineLength(t)===0?t-1:t}let i=t?e.getLineLength(r):0,a={line:r,character:i};return{start:a,end:a,direction:1}}function Ef(e,t){if(Q(t)){let n=t.start.line;return{start:e.offsetAt({line:n,character:0}),end:n<e.lineCount-1?e.offsetAt({line:n+1,character:0}):e.offsetAt({line:n,character:e.getLineLength(n)})}}let n=e.offsetAt(t.start),r=e.offsetAt(t.end);return n<=r?{start:n,end:r}:{start:r,end:n}}function Df(e,t){return t.map(t=>Ef(e,t)).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n})}function Of(e,t){return Df(e,t).map(({start:t,end:n})=>e.getTextSlice(t,n))}function kf(e,t){let n=Df(e,t),r=e.eol,i=``,a=-1;for(let t of n)if(!(t.end<=t.start)){if(t.start<=a){t.end>a&&(i+=e.getTextSlice(a,t.end),a=t.end);continue}i.length>0&&!xd(i)&&(i+=r),i+=e.getTextSlice(t.start,t.end),a=t.end}return i}function Af(e,t){if(Q(t))return jf(e,t);let[n,r]=$(t.start,t.end)<=0?[t.start,t.end]:[t.end,t.start];return{start:e.offsetAt(n),end:e.offsetAt(r),text:``}}function jf(e,t){let n=t.start.line,r=e.offsetAt({line:n,character:0}),i=e.offsetAt({line:n,character:e.getLineLength(n)});return n<e.lineCount-1?{start:r,end:e.offsetAt({line:n+1,character:0}),text:``}:n>0?{start:e.offsetAt({line:n-1,character:e.getLineLength(n-1)}),end:i,text:``}:{start:r,end:i,text:``}}function Mf(e){let t=[];for(let{edit:n}of e){if(n.start>=n.end)continue;let e=t.at(-1);e!==void 0&&n.start<=e.end?t[t.length-1]={start:e.start,end:Math.max(e.end,n.end),text:``}:t.push(n)}return t}function Nf(e,t){let n=Array.from({length:e.length}),r=0,i=0;for(let a of e){for(;r<t.length&&a.edit.start>t[r].end;){let e=t[r];i-=e.end-e.start,r++}let e=t[r];e!==void 0&&a.edit.start>=e.start&&a.edit.start<=e.end?n[a.index]=e.start+i:n[a.index]=a.edit.start+i}return n}function Pf(e,t){let n=[...t.map((t,n)=>({index:n,edit:Af(e,t)}))].sort((e,t)=>{let n=e.edit.start-t.edit.start;if(n!==0)return n;let r=e.edit.end-t.edit.end;return r===0?e.index-t.index:r}),r=Mf(n);return{text:kf(e,t),edits:r,nextSelectionOffsets:Nf(n,r)}}function Ff(e,t){let n=Math.max(0,t),r=Yf(e),i=null;for(let e of r){i=e;let t=rp(e);if(n<=t+(e.textContent?.length??0)){let r=Xf(e,n<t?0:n-t);if(r!==null)return r}}if(i!==null){let e=Xf(i,i.textContent?.length??0);return e===null?[i,0]:e}let a=0,o=null;for(let t of e.childNodes){if(t.nodeType===1&&t.tagName===`BR`)return[t,0];if(t.nodeType!==3)continue;o=t;let e=ip(o.textContent,o.textContent?.length??0);if(n<=a+e)return[o,ip(o.textContent,n-a)];a+=e}return o===null?[e,0]:[o,ip(o.textContent,o.textContent?.length??0)]}function If(e,t){let{line:n,character:r}=t.start,i=e.getLineText(n),a=Lf(i,Math.max(0,Math.min(r,i.length)));return a===void 0?t:{start:{line:n,character:a.start},end:{line:n,character:a.end},direction:1}}function Lf(e,t){let n=Sd({granularity:`word`});if(n!==void 0){for(let r of n.segment(e)){if(r.isWordLike!==!0)continue;let e=r.index,n=e+r.segment.length;if(t>=e&&t<=n)return{start:e,end:n}}return}let r=/[\p{Alphabetic}\p{Number}_]+/gu,i;for(;(i=r.exec(e))!==null;){let e=i.index,n=e+i[0].length;if(t>=e&&t<=n)return{start:e,end:n}}}function Rf(e,t){if(!Q(t))return[t.start,t.end];let n=df(t),{line:r,character:i}=n;if(i===0){if(r===0)return[n,n];let t=e.getLineLength(r-1);return[{line:r-1,character:t},{line:r,character:0}]}let a=e.getLineText(r),o=Bf(a),s=i,c;for(;s>0;){let e=zf(a,s,!1,o),t=a.slice(e,s),n=/\S/.test(t)?/\p{Alphabetic}|\p{Number}|_/u.test(t)?1:2:0;if(c!==void 0&&n!==c)break;(n!==0||s!==i)&&(c=n),s=e}return[{line:r,character:s},{line:r,character:i}]}function zf(e,t,n,r){if(n){for(let e of r)if(e>t)return e;return e.length}for(let e=r.length-1;e>=0;e--){let n=r[e];if(n<t)return n}return 0}function Bf(e){let t=[0],n=Td();if(n!==void 0){for(let r of n.segment(e))r.index>0&&t.push(r.index);return t}let r=0;for(let n of e)r>0&&t.push(r),r+=n.length;return t}function Vf(e,t,n,r){let i=e.getLineLength(t);if(r){if(n>=i)return i;let r=e.offsetAt({line:t,character:0}),a=e.getTextSlice(r+n,r+i),o=Td();if(o!==void 0){for(let e of o.segment(a))return n+e.segment.length;return i}for(let e of a)return n+e.length;return i}if(n<=0)return 0;let a=e.offsetAt({line:t,character:0}),o=e.getTextSlice(a,a+n),s=0,c=Td();if(c!==void 0){for(let e of c.segment(o))s=e.index;return s}let l=0;for(let e of o)s=l,l+=e.length;return s}function Hf(e,t){let n=t.direction===-1;return[e.offsetAt(n?t.end:t.start),e.offsetAt(df(t))]}function Uf(e,t){if(!Q(t))return{start:t.start,end:t.end};let{line:n,character:r}=t.start,i=e.getLineText(n).length;return r<i?{start:{line:n,character:r},end:{line:n,character:i}}:n<e.lineCount-1?{start:{line:n,character:r},end:{line:n+1,character:0}}:{start:{line:n,character:r},end:{line:n,character:r}}}function Wf(e,t,n){if(t!==`
|
|
2126
|
+
`&&t!==`\r`&&t!==`\r
|
|
2127
|
+
`)return t;let r=e.positionAt(n).line,i=e.getLineText(r),a=Gf(i);return a===0?t:t+i.slice(0,a)}function Gf(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}return t}function Kf(e,t){let n=[];for(let[e,r]of t)n.push(Math.min(e,r),Math.max(e,r));let r=e.positionsAt(n);return t.map(([e,t],n)=>{let i=e===t?0:e<t?1:-1;return{start:r[n*2],end:r[n*2+1],direction:i}})}function qf(e,t,n){if(t.text!==``||t.start!==t.end-1)return t;let r=e.positionAt(t.end);if(r.character===0)return t;let i=e.getLineText(r.line),a=i.slice(0,r.character);if(/[^ \t]/.test(a)||i[r.character-1]===` `)return t;let o=Math.max(0,r.character-n),s=i.slice(o,r.character);return s.length===n&&/^ +$/.test(s)?{...t,start:t.end-s.length}:t}function Jf(e,t){let n=e.nodeType===1?e:e.parentElement;for(;n!==null&&np(n)===void 0;)n=n.parentElement;if(n===null)return null;let r=np(n);if(r===void 0)return null;if(e.nodeType===3)return e.parentElement===null?null:ep(e.parentElement)===null?{line:r,character:$f(n,e)+ip(e.textContent,t)}:{line:r,character:tp(e,t)};if(e.nodeType===1){let i=e;if(i.tagName===`DIV`){let e=0;for(let n=0;n<t;n++)e=tp(i.childNodes[n]);return{line:r,character:e}}if(i.tagName===`BR`)return{line:r,character:0};if(i.tagName===`SPAN`){if(t<i.childNodes.length){let e=i.childNodes[t];if(e?.nodeType===1){let t=rp(e);if(t!==void 0)return{line:r,character:t};let n=ep(e),i=n===null?void 0:rp(n);if(i!==void 0)return{line:r,character:i}}}return{line:r,character:t>0?tp(i.childNodes[t-1]):$f(n,i)}}return{line:r,character:$f(n,i)}}return null}function Yf(e){let t=[];for(let n of e.childNodes){if(n.nodeType!==1)continue;let e=n;if(e.tagName===`SPAN`){if(rp(e)!==void 0){t.push(e);continue}for(let n of e.childNodes)n.nodeType===1&&rp(n)!==void 0&&t.push(n)}}return t}function Xf(e,t){let n=Math.max(0,t),r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let t=e.container.childNodes[e.index];if(e.index++,t.nodeType===3){let e=ip(t.textContent,t.textContent?.length??0);if(n<=e)return[t,n];n-=e}else t.nodeType===1&&r.push({container:t,index:0})}return null}function Zf(e,t){let n=0,r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let i=e.container.childNodes[e.index];if(i===t)return n;e.index++,i.nodeType===3?n+=ip(i.textContent,i.textContent?.length??0):i.nodeType===1&&r.push({container:i,index:0})}return n}function Qf(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=n.parentElement}return!1}function $f(e,t){if(t.parentElement===e){let n=0,r=Array.prototype.indexOf.call(e.childNodes,t);for(let t=0;t<r;t++)n=tp(e.childNodes[t]);return n}for(let n of Yf(e))if(Qf(n,t))return rp(n)+(t.nodeType===3?Zf(n,t):0);let n=0,r=t.nodeType===1?t:t.parentElement;for(;r!==null&&r.parentElement!==null&&np(r.parentElement)===void 0;){let e=r.parentElement,t=Array.prototype.indexOf.call(e.childNodes,r);for(let r=0;r<t;r++)n=tp(e.childNodes[r]);r=e}return n}function ep(e){let t=e;for(;t!==null;){if(np(t)!==void 0)return null;if(rp(t)!==void 0)return t;t=t.parentElement}return null}function tp(e,t){if(e===void 0)return 0;if(e.nodeType===3){let n=e.parentElement;if(n===null)return 0;let r=ep(n);if(r===null)return 0;let i=rp(r);if(i===void 0)return 0;let a=t===void 0?ip(e.textContent,e.textContent?.length??0):ip(e.textContent,t);return i+Zf(r,e)+a}if(e.nodeType!==1)return 0;let n=e;if(n.tagName!==`SPAN`&&n.tagName!==`BR`)return 0;let r=rp(n);if(r!==void 0)return r+(n.textContent?.length??0);let i=0;for(let e of n.childNodes)i=Math.max(i,tp(e));return i}function np(e){let{line:t,lineType:n}=e.dataset;if(t!==void 0&&n!==`change-deletion`){let e=parseInt(t,10);if(!Number.isNaN(e))return e-1}}function rp(e){let{char:t}=e.dataset;if(t!==void 0){let e=parseInt(t,10);if(!Number.isNaN(e))return e}}function ip(e,t){let n=e??``,r=n.search(/[\r\n]/);return Math.min(t,r===-1?n.length:r)}var ap=300,op=100,sp=`marker-popup`,cp=class{#e;#t=[];#n=0;#r;#i;#a;#o;#s;#c;#l;#u=!1;constructor(e){this.#e=e}get markers(){return this.#t}isPopupVisible(){return this.#l!==void 0}updatePopupPosition(){let e=this.#l,t=this.#r;if(e===void 0||t===void 0)return;let n=this.#t[e];if(n===void 0){this.removePopup();return}this.#_(t,n.start.line,n.start.character)}setMarkers(e,t){this.#n=t.lineCount,this.#t=e.map(e=>({...e,start:t.normalizePosition(e.start),end:t.normalizePosition(e.end)})),this.removePopup()}listenHover(e){this.#a?.forEach(e=>e()),this.#a=void 0,this.#t.length!==0&&(this.#a=[Z(e,`mouseover`,e=>{if(this.#e.isMouseDown())return;let t=e.composedPath()[0];if(t===void 0)return;let n=this.#d(t);n===void 0?(this.#f(),this.#h()):this.#m(n)}),Z(e,`mouseleave`,()=>{this.#f(),this.#h()})])}removePopup(){this.#f(),this.#p(),this.#v()}cleanup(){this.#a?.forEach(e=>e()),this.#a=void 0,this.removePopup(),this.#t=[]}#d(e){let t=e.closest(`[data-line]`);if(t==null)return;let n=gd(t);if(n===void 0)return;let r;if(e.tagName===`SPAN`){let t=e.dataset.char;if(t===void 0||(r=parseInt(t,10),Number.isNaN(r)))return}else if(e.tagName===`BR`)r=0;else return;let i={line:n-1,character:r};for(let e=this.#t.length-1;e>=0;e--)if(pf({start:i,end:i},this.#t[e]))return e}#f(){this.#o!==void 0&&(clearTimeout(this.#o),this.#o=void 0),this.#c=void 0}#p(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0)}#m(e){if(e===this.#l||e===this.#c){this.#p();return}if(this.#f(),this.#p(),this.#r!==void 0){this.#y(e);return}this.#c=e,this.#o=setTimeout(()=>{this.#o=void 0,this.#c=void 0,this.#y(e)},ap)}#h(){this.#u||(this.#p(),this.#s=setTimeout(()=>{this.#s=void 0,this.#u||this.removePopup()},op))}#g(e,t,n,r,i=this.#e.popoverManager.getPlacementBounds()){zd(e,{gutterWidth:this.#e.getGutterWidth(),placeAbove:r,viewport:i,x:t,y:n})}#_(e,t,n){let{getCharX:r,getLineY:i,getLineHeight:a,popoverManager:o}=this.#e,[s,c]=r(t,n),l=a(),u=i(t)+c*l,d=e.offsetHeight,f={top:u+l,bottom:u+l+d},p={top:u-d,bottom:u},m=t>=this.#n-3,h=o.getPlacementBounds(),g=o.choosePlacement({preferred:f,fallback:p,viewport:h,popoverHeight:d,atDocumentEdge:m,placementKey:sp})===`fallback`;this.#g(e,s,g?u:u+l,g,h)}#v(){this.#i?.forEach(e=>e()),this.#i=void 0,this.#r?.remove(),this.#r=void 0,this.#l=void 0,this.#u=!1,this.#e.popoverManager.resetPlacement(sp)}#y(e){if(e===this.#l)return;let t=this.#e.getOverlayElement();if(e>=this.#t.length||t==null)return;let{start:n,message:r,severity:i}=this.#t[e],{line:a,character:o}=n,s=this.#r;if(this.#e.popoverManager.resetPlacement(sp),s!==void 0){up(s,i);let t=s.firstElementChild;t?.dataset.markerMessage!==void 0&&(typeof r==`string`?t.textContent=r:r instanceof HTMLElement?t.replaceChildren(r):t.innerHTML=r.html),this.#_(s,a,o),this.#l=e;return}this.#r=X(`div`,{dataset:{editorWidget:``,markerPopup:``,[dp(i)]:``},children:[X(`div`,{dataset:`markerMessage`,...typeof r==`string`?{textContent:r}:r instanceof HTMLElement?{children:[r]}:{innerHTML:r.html}})]},t),this.#_(this.#r,a,o),this.#l=e,this.#i=[Z(this.#r,`mouseenter`,()=>{this.#u=!0,this.#p()}),Z(this.#r,`mouseleave`,()=>{this.#u=!1,this.#h()})]}},lp=[`error`,`warning`,`info`,`hint`];function up(e,t){for(let t of lp)delete e.dataset[dp(t)];e.dataset[dp(t)]=``}function dp(e){switch(e){case`error`:return`markerError`;case`warning`:return`markerWarning`;case`info`:return`markerInfo`;case`hint`:return`markerHint`}}var fp=new Map([[`(`,`)`],[`[`,`]`],[`{`,`}`]]),pp=new Map([...fp].map(([e,t])=>[t,e])),mp=1e3,hp=5e4;function gp(e,t,n){let r=_p(e,t,e.normalizePosition(n));if(r===void 0)return;let i=fp.get(r.char),a=pp.get(r.char);if(i!==void 0)return Ep(r,bp(e,t,r,i));if(a!==void 0)return Ep(xp(e,t,r,a),r)}function _p(e,t,n){let r=vp(n);if(r!==void 0){let n=yp(e,t,r);if(n!==void 0)return n}return yp(e,t,n)}function vp(e){if(e.character>0)return{line:e.line,character:e.character-1}}function yp(e,t,n){let r=e.getLineText(n.line)[n.character];if(!(r===void 0||!fp.has(r)&&!pp.has(r)||Sp(t,n)))return{...n,char:r}}function bp(e,t,n,r){let i=0,a=0,o=0;for(let s=n.line;s<e.lineCount;s++){if(a>=mp)return;a++;let c=e.getLineText(s),l=t.getStringCommentRegexpRangesInLine(s),u={index:0},d=s===n.line?n.character:0;for(let e=d;e<c.length;e++){if(o>=hp)return;if(o++,wp(l,e,u))continue;let t=c[e];if(t===n.char)i++;else if(t===r&&(i--,i===0))return{line:s,character:e,char:t}}}}function xp(e,t,n,r){let i=0,a=0,o=0;for(let s=n.line;s>=0;s--){if(a>=mp)return;a++;let c=e.getLineText(s),l=t.getStringCommentRegexpRangesInLine(s),u={index:l===null?-1:l.length-1},d=s===n.line?n.character:c.length-1;for(let e=d;e>=0;e--){if(o>=hp)return;if(o++,Tp(l,e,u))continue;let t=c[e];if(t===n.char)i++;else if(t===r&&(i--,i===0))return{line:s,character:e,char:t}}}}function Sp(e,t){return Cp(e.getStringCommentRegexpRangesInLine(t.line),t.character)}function Cp(e,t){if(e===null)return!1;for(let[n,r]of e){if(t<n)return!1;if(t<r)return!0}return!1}function wp(e,t,n){if(e===null)return!1;for(;n.index<e.length&&t>=e[n.index][1];)n.index++;let r=e[n.index];return r!==void 0&&t>=r[0]}function Tp(e,t,n){if(e===null)return!1;for(;n.index>=0&&t<e[n.index][0];)n.index--;let r=e[n.index];return r!==void 0&&t<r[1]}function Ep(e,t){if(!(e===void 0||t===void 0))return[Dp(e),Dp(t)]}function Dp(e){return{start:{line:e.line,character:e.character},end:{line:e.line,character:e.character+1}}}var Op=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
2128
|
+
<symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
|
|
2129
|
+
<path fill="currentColor" d="M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z"></path>
|
|
2130
|
+
</symbol>
|
|
2131
|
+
<symbol id="diffs-editor-icon-arrow-up" viewBox="0 0 16 16">
|
|
2132
|
+
<path fill="currentColor" transform="rotate(-90 8 8)" d="M8.46967 2.21967C8.17678 2.51256 8.17678 2.98744 8.46967 3.28033L12.4393 7.25H1.75C1.33579 7.25 1 7.58579 1 8C1 8.41421 1.33579 8.75 1.75 8.75H12.4393L8.46967 12.7197C8.17678 13.0126 8.17678 13.4874 8.46967 13.7803C8.76256 14.0732 9.23744 14.0732 9.53033 13.7803L14.7803 8.53033C15.0732 8.23744 15.0732 7.76256 14.7803 7.46967L9.53033 2.21967C9.23744 1.92678 8.76256 1.92678 8.46967 2.21967Z"></path>
|
|
2133
|
+
</symbol>
|
|
2134
|
+
<symbol id="diffs-editor-icon-arrow-down" viewBox="0 0 16 16">
|
|
2135
|
+
<path fill="currentColor" transform="rotate(90 8 8)" d="M8.46967 2.21967C8.17678 2.51256 8.17678 2.98744 8.46967 3.28033L12.4393 7.25H1.75C1.33579 7.25 1 7.58579 1 8C1 8.41421 1.33579 8.75 1.75 8.75H12.4393L8.46967 12.7197C8.17678 13.0126 8.17678 13.4874 8.46967 13.7803C8.76256 14.0732 9.23744 14.0732 9.53033 13.7803L14.7803 8.53033C15.0732 8.23744 15.0732 7.76256 14.7803 7.46967L9.53033 2.21967C9.23744 1.92678 8.76256 1.92678 8.46967 2.21967Z"></path>
|
|
2136
|
+
</symbol>
|
|
2137
|
+
<symbol id="diffs-editor-icon-case" viewBox="0 0 16 16">
|
|
2138
|
+
<path fill="currentColor" d="M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z"></path>
|
|
2139
|
+
<path fill="currentColor" d="M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z"></path>
|
|
2140
|
+
</symbol>
|
|
2141
|
+
<symbol id="diffs-editor-icon-whole-word" viewBox="0 0 16 16">
|
|
2142
|
+
<path fill="currentColor" d="M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z"></path>
|
|
2143
|
+
<path fill="currentColor" d="M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z"></path>
|
|
2144
|
+
<path fill="currentColor" d="M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z"></path>
|
|
2145
|
+
</symbol>
|
|
2146
|
+
<symbol id="diffs-editor-icon-regex" viewBox="0 0 16 16">
|
|
2147
|
+
<path fill="currentColor" d="M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z"></path>
|
|
2148
|
+
<path fill="currentColor" d="M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z"></path>
|
|
2149
|
+
</symbol>
|
|
2150
|
+
<symbol id="diffs-editor-icon-replace" viewBox="0 0 16 16">
|
|
2151
|
+
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M5.28033 5.71967C5.57322 6.01256 5.57322 6.48744 5.28033 6.78033L3.56066 8.5H11.75C12.7165 8.5 13.5 7.7165 13.5 6.75V2.75C13.5 2.33579 13.8358 2 14.25 2C14.6642 2 15 2.33579 15 2.75V6.75C15 8.54493 13.5449 10 11.75 10H3.56066L5.28033 11.7197C5.57322 12.0126 5.57322 12.4874 5.28033 12.7803C4.98744 13.0732 4.51256 13.0732 4.21967 12.7803L1.21967 9.78033C0.926777 9.48744 0.926777 9.01256 1.21967 8.71967L4.21967 5.71967C4.51256 5.42678 4.98744 5.42678 5.28033 5.71967Z"></path>
|
|
2152
|
+
</symbol>
|
|
2153
|
+
<symbol id="diffs-editor-icon-replace-all" viewBox="0 0 16 16">
|
|
2154
|
+
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M10.7197 0.21967C11.0126 -0.0732233 11.4874 -0.0732233 11.7803 0.21967L14.7803 3.21967C15.0732 3.51256 15.0732 3.98744 14.7803 4.28033L11.7803 7.28033C11.4874 7.57322 11.0126 7.57322 10.7197 7.28033C10.4268 6.98744 10.4268 6.51256 10.7197 6.21967L12.4393 4.5H4.25C3.2835 4.5 2.5 5.2835 2.5 6.25V6.875C2.5 7.28921 2.16421 7.625 1.75 7.625C1.33579 7.625 1 7.28921 1 6.875V6.25C1 4.45507 2.45508 3 4.25 3H12.4393L10.7197 1.28033C10.4268 0.987437 10.4268 0.512563 10.7197 0.21967ZM5.28033 8.71967C5.57322 9.01256 5.57322 9.48744 5.28033 9.78033L3.56066 11.5H11.75C12.7165 11.5 13.5 10.7165 13.5 9.75V9.125C13.5 8.71079 13.8358 8.375 14.25 8.375C14.6642 8.375 15 8.71079 15 9.125V9.75C15 11.5449 13.5449 13 11.75 13H3.56066L5.28033 14.7197C5.57322 15.0126 5.57322 15.4874 5.28033 15.7803C4.98744 16.0732 4.51256 16.0732 4.21967 15.7803L1.21967 12.7803C0.926777 12.4874 0.926777 12.0126 1.21967 11.7197L4.21967 8.71967C4.51256 8.42678 4.98744 8.42678 5.28033 8.71967Z"></path>
|
|
2155
|
+
</symbol>
|
|
2156
|
+
</svg>`,kp=()=>{let e=document.createElement(`div`);e.innerHTML=Op;let t=e.firstElementChild;if(t===null||!(t instanceof SVGSVGElement))throw Error(`Failed to create sprite element`);return t},Ap=(e,t=16)=>`<svg width="${t}" height="${t}" aria-hidden="true" focusable="false">
|
|
2157
|
+
<use href="#diffs-editor-icon-${e}"></use>
|
|
2158
|
+
</svg>`,jp=class{#e;#t;#n;#r;#i;#a;constructor(e){let{textDocument:t,containerElement:n,defaultQuery:r,mode:i=`find`,initialMatch:a,scrollToMatch:o,applyReplace:s,onUpdate:c,onClose:l}=e,u={text:r,replaceText:``,caseSensitive:!1,wholeWord:!1,regex:!1},d={all:[],current:void 0},f=X(`div`,{dataset:{matches:``,noMatches:``},textContent:`No results`}),p=e=>{d.all=u.text===``?[]:t.search(u);let n=d.all.length===0;if(A.disabled=n,j.disabled=n,n){f.textContent=`No results`,f.dataset.noMatches=``,d.current=void 0,c([]);return}if(delete f.dataset.noMatches,e?.syncSelection===!1){m(c(d.all,{syncSelection:!1}));return}m(c(d.all))};this.#n=p;let m=e=>{if(e===void 0)f.textContent=`${d.all.length} results`;else{let[t,n]=e;f.textContent=`${d.all.findIndex(e=>e[0]===t&&e[1]===n)+1} of ${d.all.length}`}d.current=e},h=(e,t)=>{u[e]=t,p()},g=(e=!1,t=!1)=>{let n=d.all,r=n[0];if(n.length>0)if(e){let e=d.current?.[0]??0;r=n.at(-1);for(let t of n)if(t[1]<=e)r=t;else break}else{let e=d.current?.[1]??0;for(let t of n)if(t[0]>=e){r=t;break}}r!==void 0&&(m(r),o(r,t)),d.current=r};this.#i=e=>g(e,!0);let _=(e,n)=>({start:e,end:n,text:qu(e=>t.positionAt(e),e=>t.offsetAt(e),e=>t.getLineText(e),u,e,n)}),v=()=>{if(u.text===``||d.all.length===0)return;let e=d.current;if(e===void 0&&(g(!1,!0),e=d.current,e===void 0))return;let[t,n]=e,r=_(t,n);s([r]),o([t+r.text.length,t+r.text.length],!0),d.current=void 0,p()},y=()=>{u.text===``||d.all.length===0||(s(d.all.map(([e,t])=>_(e,t))),d.current=void 0,p())},b=()=>{this.cleanup(),l()};this.#a=b;let x=e=>X(`button`,{type:`button`,title:e.label,ariaLabel:e.label,dataset:{searchIcon:``,...e.dataset},innerHTML:Ap(e.icon,e.size??16),onclick:e.onClick}),S=(e,t,n)=>{let r=x({icon:e,label:t,size:14,onClick:()=>{let e=!u[n];r.ariaPressed=String(e),h(n,e)}});return r.ariaPressed=String(u[n]),r},C=S(`case`,`Match Case`,`caseSensitive`),w=S(`whole-word`,`Whole Word`,`wholeWord`),T=S(`regex`,`Regexp`,`regex`),E=X(`input`,{type:`text`,placeholder:`Replace`,dataset:`replace`,value:``,oninput:e=>{u.replaceText=e.target.value},onkeydown:e=>{if(e.isComposing)return;let t=ad(e);e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),v()):t!==void 0&&(e.preventDefault(),g(t===`previous`,!0))}});this.#t=X(`input`,{type:`text`,placeholder:`Search`,dataset:`search`,value:r,oninput:e=>{u.text=e.target.value,d.current=void 0,p()},onkeydown:e=>{let t=ad(e);e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),g(e.shiftKey,!0)):t===void 0?ed(e)&&(e.key===`f`||e.code===`KeyF`)&&(e.preventDefault(),te(e.altKey?`replace`:`find`)):(e.preventDefault(),g(t===`previous`,!0))}});let D=X(`div`,{dataset:`searchToggles`,children:[C,w,T]}),O=X(`div`,{dataset:{inputBox:``,find:``},children:[this.#t,D]}),ee=X(`div`,{dataset:{inputBox:``,replace:``,replaceCell:``},children:[E]}),k=X(`div`,{dataset:{replaceActions:``,replaceCell:``},children:[x({icon:`replace`,label:`Replace`,onClick:v}),x({icon:`replace-all`,label:`Replace All`,onClick:y})]}),A=x({icon:`arrow-up`,label:`Previous`,onClick:()=>{g(!0)}}),j=x({icon:`arrow-down`,label:`Next`,onClick:()=>{g()}});A.disabled=!0,j.disabled=!0;let M=X(`div`,{dataset:`searchNav`,children:[A,j]}),N=x({icon:`close`,label:`Close`,onClick:b,dataset:{searchClose:``}}),P=X(`div`,{dataset:{searchGrid:``,mode:i},children:[O,ee,k,f,M,N]}),te=e=>{P.dataset.mode=e,this.#t.focus(),this.#t.select()};this.#r=te,this.#e=X(`div`,{dataset:`searchPanel`,children:[X(`div`,{dataset:`editorWidget`,children:[P]})]}),d.current=a,n.before(this.#e),requestAnimationFrame(()=>{a===void 0?c([]):p(),this.#t.select()})}focus(){this.#t.focus()}navigate(e){this.#i?.(e)}updateMatches(e){this.#n?.(e)}setMode(e){this.#r?.(e)}close(){this.#a?.()}cleanup(){this.#e.remove()}},Mp=class{#e;#t;#n;constructor(e,t,n){this.#e=X(`div`,{dataset:{editorWidget:``,selectionActionPopover:``},contentEditable:`false`,children:[e]},t),this.#t=this.#e.offsetHeight,this.#n=new ResizeObserver(()=>{let e=this.#e.offsetHeight;e!==this.#t&&(this.#t=e,n())}),this.#n.observe(this.#e)}reposition(e,t,n,r,i){zd(this.#e,{gutterWidth:n,placeAbove:r,viewport:i,x:e,y:t})}get height(){return this.#t}cleanup(){this.#n.disconnect(),this.#e.remove()}};function Np(e){return{selections:e.selections?.map(e=>({start:{...e.start},end:{...e.end},direction:e.direction})),view:e.view===void 0?void 0:{...e.view}}}function Pp(e){return typeof e==`object`?e:e===`indexedDB`?new zp:new Fp}var Fp=class{#e=new Map;get(e){let t=this.#e.get(e);return t===void 0?void 0:Np(t)}set(e,t){this.#e.set(e,Np(t))}},Ip=`pierre-diffs-editor-state`,Lp=1,Rp=`states`,zp=class{#e=Bp();async get(e){let t=await this.#e;if(t===void 0)return;let n=await Vp(t.transaction(Rp,`readonly`).objectStore(Rp).get(e));return n===void 0?void 0:Np(n)}async set(e,t){let n=await this.#e;n!==void 0&&await Vp(n.transaction(Rp,`readwrite`).objectStore(Rp).put(Np(t),e))}};function Bp(){try{let e=globalThis.indexedDB;if(e===void 0)return Promise.resolve(void 0);let t=e.open(Ip,Lp);return t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(Rp)||e.createObjectStore(Rp)},Vp(t)}catch{return Promise.resolve(void 0)}}function Vp(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}var Hp=4096,Up=/\p{Mark}/u,Wp=class{#e;#t;#n;#r=new Map;ch=-1;tabSize=2;lineHeight=20;paddingTop=0;init(e){if(this.#e===e&&this.#t!==void 0&&this.ch!==-1)return;if(this.#e=e,this.#t??=document.createElement(`canvas`).getContext(`2d`)??void 0,this.#t===void 0)throw Error(`Could not get canvas context`);let t=e.parentElement;if(t!==null){let{paddingTop:e}=getComputedStyle(t);e.endsWith(`px`)&&(this.paddingTop=parseFloat(e.slice(0,-2)))}let{fontSize:n,fontFamily:r,tabSize:i,lineHeight:a}=getComputedStyle(e);a.endsWith(`px`)?this.lineHeight=parseFloat(a.slice(0,-2)):n.endsWith(`px`)&&(this.lineHeight=bd(parseFloat(n.slice(0,-2))*parseFloat(a)));let o=n+` `+r;(this.#n!==o||this.ch===-1)&&(this.#n=o,this.#t.font=o,this.ch=this.canvasMeasureTextWidth(`0`),this.clearTextWidthCache());let s=parseInt(i,10);Number.isNaN(s)||(this.tabSize=s)}remeasureCharacterWidth(){if(this.#t===void 0||this.#n===void 0)return!1;this.#t.font=this.#n;let e=this.canvasMeasureTextWidth(`0`),t=e!==this.ch;t&&(this.ch=e);let n=this.#a();return t||n}measureTextWidth(e){if(!e.includes(` `))return this.#i(e);if(this.#t===void 0)throw Error(`Metrics not initialized`);let t=Jp(e,this.tabSize);if(t!==-1)return t*this.ch;let n=0,r=0,i=this.tabSize*this.ch;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)===9){if(t>r&&(n+=this.#i(e.slice(r,t))),i>0){let e=n%i;n+=e===0?i:i-e}r=t+1}return r<e.length&&(n+=this.#i(e.slice(r))),bd(n)}#i(e){return Gp(e)?this.domMeasureTextWidth(e):this.canvasMeasureTextWidth(e)}canvasMeasureTextWidth(e){if(this.#t===void 0)throw Error(`Metrics not initialized`);return bd(this.#t.measureText(e).width)}domMeasureTextWidth(e){if(this.#e===void 0)throw Error(`Metrics not initialized`);let t=e+`|`+this.#n,n=this.#r.get(t);if(n!==void 0)return n;let r=X(`span`,{style:{position:`absolute`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,font:`inherit`},textContent:e},this.#e),i;try{i=bd(r.getBoundingClientRect().width)}finally{r.remove()}if(this.#r.size>=Hp){let e=this.#r.keys().next().value;e!==void 0&&this.#r.delete(e)}return this.#r.set(t,i),i}clearTextWidthCache(){this.#a()}#a(){let e=this.#r.size>0;return this.#r.clear(),e}};function Gp(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=57343||n===8205||n===65038||n===65039||n>127&&Up.test(e.charAt(t)))return!0}return!1}function Kp(e,t){let n=Math.max(0,Math.min(t,e.length));if(n===0||n===e.length||!Gp(e))return n;let r=Td();if(r!==void 0){for(let t of r.segment(e)){let e=t.index,r=e+t.segment.length;if(n>e&&n<r)return r;if(n<=e)break}return n}let i=0;for(let t of e){let e=i+t.length;if(n>i&&n<e)return e;if(n<=i)break;i=e}return n}function qp(e){if(!Gp(e))return;let t=[0],n=Td();if(n!==void 0){for(let r of n.segment(e))t.push(r.index+r.segment.length);return t}let r=0;for(let n of e)r+=n.length,t.push(r);return t}function Jp(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i>127)return-1;n+=i===9?t-n%t:1}return n}var Yp=500,Xp=class{#e;#t;#n;#r=`dark`;#i=``;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=!1;#h=[Ye];#g=[];#_=-1;#v=!0;#y=!1;#b=0;#x;#S=0;#C=new Map;#w=!1;#T=yd(async e=>{if(this.#m)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#o.lineCount);if(this.#t===void 0&&!$p(this.#o.languageId)){if(await this.#e.loadLanguage(this.#o.languageId),this.#m)return;this.#t=this.#e.getLanguage(this.#o.languageId)}this.#A(),this.#B(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,jobId:n}=e;t===`tokenize`&&typeof n==`number`&&n===this.#b&&this.#V(n)};get themeType(){return this.#r}getStringCommentRegexpRangesInLine(e){if(!this.#d||e<0||e>=this.#o.lineCount||(this.#j(),this.#t===void 0))return null;if(!this.#C.has(e)){this.#B(e);let t=this.#h[e]??Ye,n=this.#I(e,t);this.#h[e+1]=n.state}return this.#C.get(e)??null}constructor({codeOptions:e,highlighter:t,textDocument:n,matchBrackets:r,setStyle:i,onDeferTokenize:a,onThemeChange:o,__debug:s}){let{themeType:c=`system`,theme:l=ht,tokenizeMaxLineLength:u=1e3}=e;this.#n=window.matchMedia(`(prefers-color-scheme: dark)`);let d;if(d=c===`system`?this.#O():c,typeof l!=`string`&&c===`system`){let e=new MutationObserver(e=>{for(let{type:t,attributeName:n}of e)if(t===`attributes`&&n!==null&&(n===`class`||n.startsWith(`data-`))){let e=this.#O();this.#D(l[e],e);break}});e.observe(document.documentElement,{attributes:!0}),e.observe(document.body,{attributes:!0}),this.#p=[Z(this.#n,`change`,()=>{let e=this.#O();this.#D(l[e],e)}),()=>e.disconnect()]}this.#e=t,this.#o=n,this.#s=u,this.#c=i,this.#l=a,this.#u=o,this.#d=r!==!1,this.#f=s??!1,this.#j(),this.#a=[],this.#k(typeof l==`string`?l:l[d],d)}#D(e,t){this.#k(e,t),this.stopBackgroundTokenize(),this.#h=[Ye],this.#g=[],this.#t!==void 0&&this.#o.lineCount>0&&this.#F(0),this.#u?.()}#O(){try{if(typeof document<`u`&&typeof getComputedStyle==`function`&&document.body!=null)return getComputedStyle(document.body).colorScheme===`dark`?`dark`:`light`}catch{}return this.#n.matches?`dark`:`light`}syncTheme(e){let{themeType:t=`system`,theme:n=ht}=e,r=t===`system`?this.#O():t,i=typeof n==`string`?n:n[r];r===this.#r&&i===this.#i||this.#D(i,r)}#k(e,t){let{theme:n,colorMap:r}=this.#e.setTheme(e),{colors:i={}}=this.#e.getTheme(e),a=i[`editor.selectionBackground`],o=i[`editor.lineHighlightBackground`],s=i[`editorCursor.foreground`],c=i[`editor.findMatchBackground`],l=i[`editor.findMatchHighlightBackground`],u=i[`editorBracketMatch.background`],d=i[`editorBracketMatch.border`],f=i[`editorHint.foreground`],p=i[`editorInfo.foreground`],m=i[`editorWarning.foreground`],h=i[`editorError.foreground`];this.#c(`:host {
|
|
2159
|
+
--diffs-editor-selection-bg: ${a??`var(--diffs-line-bg)`};
|
|
2160
|
+
--diffs-editor-line-highlight-bg: ${o??`var(--diffs-line-bg)`};
|
|
2161
|
+
--diffs-editor-match-bg: ${c??`initial`};
|
|
2162
|
+
--diffs-editor-match-highlight-bg: ${l??`initial`};
|
|
2163
|
+
--diffs-editor-bracket-match-bg: ${u??`initial`};
|
|
2164
|
+
--diffs-editor-bracket-match-border: ${d??`initial`};
|
|
2165
|
+
--diffs-editor-cursor-fg: ${s??`initial`};
|
|
2166
|
+
--diffs-editor-hint-fg: ${f??`initial`};
|
|
2167
|
+
--diffs-editor-info-fg: ${p??`initial`};
|
|
2168
|
+
--diffs-editor-warning-fg: ${m??`initial`};
|
|
2169
|
+
--diffs-editor-error-fg: ${h??`initial`};
|
|
2170
|
+
}`),this.#i=e,this.#r=t??n.type,this.#a=r}#A(){if(this.#i===``)return;let{colorMap:e}=this.#e.setTheme(this.#i);this.#a=e}cleanUp(){this.#m=!0,this.stopBackgroundTokenize(),this.#N(),this.#p?.forEach(e=>e()),this.#p=void 0}tokenize(e,t){if(this.#j(),this.#A(),this.#t===void 0&&!$p(this.#o.languageId))throw Error(`Grammar for language "${this.#o.languageId}" not loaded`);if(this.#d)for(let t of this.#C.keys())t>=e.startLine&&this.#C.delete(t);let{lineCount:n}=this.#o,{startingLine:r=0,totalLines:i=1/0}=t??{},a=i===1/0?n:Math.min(r+i,n),o=e.startLine,s=Math.max(r,o),c=t!==void 0&&i!==1/0&&e.lineDelta>0&&o<a&&e.endLine>=a,l=e.lineDelta===0,u=l||t===void 0||o>=s,d=e.changedLineRanges??[[o,e.endLine]];this.#g=[];let f=-1;if(o<s)for(let[e,t]of d)e<s&&(f=Math.max(f,Math.min(t,s-1)));let p=f>=o&&(l||e.lineDelta<0);l?this.#B(o):(this.#R(e),(t===void 0||o>=s)&&this.#B(s));let m=0,h=d[m][1],g,_=0,v=l?d[m][0]:s,y=!1,b=new Map,x=p?new Map:void 0;if(x!==void 0&&!l){let e=Math.min(f+1,s,a);if(e>o){this.#B(e);let t=o,n=this.#h[t]??Ye;for(;t<e;t++){let e=this.#I(t,n);n=e.state,x.set(t,e.resolvedTokens)}this.#h[e]=n}}let S=this.#h[v]??Ye;for(;v<a;){let e=l?this.#h[v+1]:void 0;u&&(this.#h[v]=S);let{resolvedTokens:t,state:n}=this.#I(v,S);if(S=n,v>=s?b.set(v,t):x?.set(v,t),u&&(this.#h[v+1]=S),y=v>=h&&l&&e!==void 0&&S.equals(e),y){m++;let e=d[m];if(e===void 0)break;if(e[0]>=a){g=e[0],_=m;break}this.#h[e[0]]===void 0?(h=e[1],v++):(v=e[0],S=this.#h[v]??S,h=e[1]),y=!1;continue}v++}if(u&&(v<a?this.#h[v+1]=S:this.#h[v]=S),x!==void 0&&x.size>0&&this.#l(x,this.#r),g!==void 0)this.#F(g,d,_);else if(!y&&v<n){let e=c&&o>=s?a:o<s&&!l?o:v;this.#F(e,d,m)}return b}prebuildStateStack(e){this.#j(),this.#T(e)}stopBackgroundTokenize(){this.#v||(this.#v=!0,this.#y=!1,this.#_=-1,this.#x=void 0,this.#S=0,this.#g=[],this.#N())}pauseBackgroundTokenize(){this.#v||this.#y||(this.#f&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#b}),this.#y=!0)}resumeBackgroundTokenize(){this.#v||!this.#y||this.#t===void 0||this.#_<0||(this.#f&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#b}),this.#y=!1,this.#P(this.#b))}#j(){this.#t===void 0&&!$p(this.#o.languageId)&&this.#e.getLoadedLanguages().includes(this.#o.languageId)&&(this.#t=this.#e.getLanguage(this.#o.languageId))}#M(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#N(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#P(e){globalThis.postMessage({type:`tokenize`,jobId:e})}#F(e,t,n=0){if($p(this.#o.languageId))return;let r=++this.#b;this.#f&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#v=!1,this.#y=!1,this.#_=e,this.#x=t,this.#S=n,this.#M(),this.#P(r)}#I(e,t){let n=this.#o.getLineText(e);if(n.length>this.#s)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#L(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t===void 0||n===``||n.trim()===``)return this.#L(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=Zp(this.#t,this.#a,n,t,Yp,this.#d);return this.#L(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#L(e,t){this.#d&&this.#C.set(e,t)}#R(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=this.#h.slice();for(let[e,r,i]of t){if(i===0)continue;let t=r-e,a=e+(t-i)+1,o=e+t+1,s=n.length;if(i>0)for(let e=s-1;e>=a;e--){let t=e+i;e in n?n[t]=n[e]:Reflect.deleteProperty(n,t)}else{for(let e=a;e<s;e++){let t=e+i;e in n?n[t]=n[e]:Reflect.deleteProperty(n,t)}n.length=Math.max(Math.min(s,e+1),s+i)}for(let t=e+1;t<o;t++)Reflect.deleteProperty(n,t)}this.#h.length=Math.min(this.#h.length,e.startLine+1),n.length=Math.min(n.length,this.#o.lineCount+1);for(let t=0;t<=e.startLine;t++)Reflect.deleteProperty(n,t);this.#g=n}#z(e){return this.#g[e]??this.#h[e]}#B(e){let t=Math.min(Math.max(0,e),this.#o.lineCount);if(this.#h.length>t||this.#t===void 0)return;let n=this.#h.length-1,r=this.#h[n]??Ye;for(;n<t;n++){this.#h[n]=r;let e=this.#o.getLineText(n);if(e.length<=this.#s&&e!==``&&e.trim()!==``){let t=Zp(this.#t,this.#a,e,r,Yp,this.#d);this.#L(n,t.bracketIgnoredRanges),r=t.ruleStack}else this.#L(n,null)}this.#h[n]=r}#V(e){if(this.#v||this.#y||this.#t===void 0||e!==this.#b)return;this.#A();let t=performance.now(),n=new Map,r=this.#o.lineCount,i=this.#x,a=this.#_,o=this.#h[a]??Ye,s=!1,c=this.#S,l=i?.[c]?.[1];for(;a<r;){this.#h[a]=o;let e=l===void 0?void 0:this.#z(a+1),r=this.#o.getLineText(a);if(r.length>this.#s)console.warn(`[diffs] Line(${a}) too long to tokenize: ${r.length}`),n.set(a,[[0,``,r]]),this.#L(a,null);else if(r===``||r.trim()===``)n.set(a,[[0,``,r]]),this.#L(a,null);else{let e=Zp(this.#t,this.#a,r,o,Yp,this.#d);n.set(a,e.resolvedTokens),this.#L(a,e.bracketIgnoredRanges),o=e.ruleStack}if(this.#h[a+1]=o,s=l!==void 0&&a>=l&&e!==void 0&&o.equals(e),a++,s){c++;let e=i?.[c];if(e===void 0)break;if(l=e[1],this.#h[e[0]]===void 0)s=!1;else{a=e[0],o=this.#h[a]??o,s=!1;continue}}if(performance.now()-t>1)break}if(this.#l(n,this.#r),!(this.#v||this.#y||e!==this.#b)){if(s||a>=r){this.stopBackgroundTokenize();return}this.#_=a,this.#S=c,this.#P(e)}}};function Zp(e,t,n,r,i,a=!0){let o=e.tokenizeLine2(n,r,i);o.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);let s=o.tokens,c=s.length/2,l=[],u=[];for(let e=0;e<c;e++){let r=s[2*e],i=e+1<c?s[2*e+2]:n.length;if(r===i)continue;let o=s[2*e+1],d=dt.getForeground(o),f=n.slice(r,i);l.push([r,t[d],f]),a&&dt.getTokenType(o)>0&&u.push([r,i])}return{ruleStack:o.ruleStack,resolvedTokens:l,bracketIgnoredRanges:u}}function Qp(e){return e.map(([e,t,n])=>e===0&&t===``?n===``?X(`br`):n:X(`span`,{dataset:{char:e.toString()},style:`color:${t};`,textContent:n}))}function $p(e){return e===`text`||e===`ansi`}function em(e){let t=e.getSelection?.();if(t==null||t.rangeCount===0)return;let n=t.getRangeAt(0);return{collapsed:n.collapsed,startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}}function tm(e){if(typeof e.cacheKey!=`string`||e.cacheKey.length===0)throw Error(`Editor persistState requires a non-empty file.cacheKey for "${e.name}". Provide a unique, stable cacheKey for every editable file.`);return e.cacheKey}function nm(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}var rm=2,im=`selection-action`,am=`application/vnd.pierre.diffs-selections+json`,om=class{#e;#t=new Wp;#n;#r;#i=new Map;#a;#o;#s=new Map;#c;#l=0;#u=!1;#d;#f;#p;#m;#h;#g;#_;#v=new Map;#y=new Map;#b=new Map;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H=!1;#U=!1;#W=!1;#G=!1;#K=!1;#q=!1;#J=!1;#Y;#X=``;#Z;#Q;#$;#ee;#te;#ne;#re=!1;#ie=!1;#ae=!1;#oe=!1;#se;#ce=(e,t)=>{if(this.#N?.updateRenderCache(e,t,!1,!1),this.#L!==void 0&&this.#L.totalLines!==1/0){let{startingLine:t,totalLines:n}=this.#L,r=Math.min(t+n,this.#I?.lineCount??0);for(let[n,i]of e)if(n>=t&&n<r){let e=this.#Tt(n);e!==void 0&&e.replaceChildren(...Qp(i))}}};constructor(e={}){this.#e=e}setOptions(e){let t=this.#e.persistStateStorage??`inMemory`,n={...this.#e,...e};if(n.persistState===!0&&this.#N?.type===`file`){let e=this.#N.__getCurrentFile?.()??this.#P;e!==void 0&&tm(e)}this.#e=n,this.#e.persistState!==!0&&(this.#i.clear(),this.#l++,this.#u=!1),(this.#e.persistStateStorage??`inMemory`)!==t&&(this.#l++,this.#a=void 0,this.#o=void 0,this.#s.clear())}edit(e){if(this.#e.persistState===!0&&e.type===`file`){let t=e.__getCurrentFile?.();t!==void 0&&tm(t)}let{useTokenTransformer:t,...n}=e.options;return t!==!0&&(e.setOptions({...n,useTokenTransformer:!0}),e.rerender()),this.#N=e,this.#Te(),this.#m=e.attachEditor(this),()=>this.cleanUp()}applyEdits(e,t=!0){let n=this.#I;if(n==null)throw Error(`Editor is not attached`);let r=this.#W,i=this.#$,a=i?.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]),o=i===void 0?void 0:n.resolveEdits(e).sort((e,t)=>e.start-t.start),s=n.applyEdits(e,t,i);if(s===void 0)return;let c;i!==void 0&&a!==void 0&&o!==void 0&&(c=gf(n,i,a,o),t&&n.setLastUndoSelectionsAfter(c)),this.#St(s,c,this.#Ct(s),{skipFocus:!r})}get canUndo(){return this.#I?.canUndo??!1}get canRedo(){return this.#I?.canRedo??!1}undo(){this.#je(`undo`)}redo(){this.#je(`redo`)}getFile(){let e=this.#P,t=this.#I;if(e===void 0||t===void 0)return;let n={...e};return Object.defineProperty(n,"contents",{enumerable:!0,get:()=>t.getText()}),n}getText(){return this.#I?.getText()??``}getState(){let e=this.#N?.getScrollContainer?.();return{selections:this.#$,view:e===void 0?void 0:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}}setState({selections:e,view:t}){if(this.#N===void 0||this.#I===void 0)throw Error(`Editor is not attached`);if(this.#nt(e??[]),t!==void 0){let e=this.#N.getScrollContainer?.();e!==void 0&&e.scrollTo({left:t.scrollLeft,top:t.scrollTop,behavior:`instant`});return}this.#Ue()}setSelections(e){let t=this.#I;if(t===void 0)throw Error(`Text document is not initialized`);let n=e.map(e=>{let n=t.normalizePosition(e.start),r=t.normalizePosition(e.end),i=e.direction===`none`?0:e.direction===`backward`?-1:1;return $(n,r)>0&&([n,r]=[r,n],i!==0&&(i=i===1?-1:1)),{direction:i,start:n,end:r}});this.#nt(n);let r=n.at(-1);r!==void 0&&this.#ve(df(r).line),this.#Ue()}setMarkers(e){let t=this.#I;if(t===void 0)throw Error(`Text document is not initialized`);if(e.length===0){this.#z?.cleanup(),this.#z=void 0,this.#nt(this.#$??[]);return}this.#z??=new cp({popoverManager:this.#Se(),getLineHeight:()=>this.#t.lineHeight,getOverlayElement:()=>this.#k,getGutterWidth:()=>this.#Et(),getCharX:(e,t)=>this.#kt(e,t),getLineY:e=>this.#Ot(e),isMouseDown:()=>this.#q||this.#K}),this.#z.setMarkers(e,t),this.#O!==void 0&&this.#z.listenHover(this.#O),this.#nt(this.#$??[])}focus(e){let t=e?.preventScroll??!1,n=this.#$?.at(-1);if(n!==void 0){let e=n.direction===-1?n.end:n.start;this.#Ve(e,t)}else this.#Ve(void 0,t)}blur(){this.#O?.blur()}cleanUp(e=!1){let t=this.#le;this.#l++,this.#fe(),this.#u=t,ue(this.#Oe),this.#n?.cleanUp(),this.#n=void 0,e||(this.#I=void 0,this.#P=void 0),this.#f?.forEach(e=>e()),this.#f=void 0,this.#d?.forEach(e=>e()),this.#d=void 0,this.#p?.forEach(e=>e()),this.#p=void 0,this.#m?.(e),this.#m=void 0,this.#g=void 0,this.#_=void 0,this.#v.clear(),this.#y.clear(),this.#b.clear(),this.#x=void 0,this.#S?.remove(),this.#S=void 0,this.#C?.remove(),this.#C=void 0,this.#w?.remove(),this.#w=void 0,this.#T?.remove(),this.#T=void 0,this.#E=void 0,this.#r?.cleanUp(),this.#r=void 0,this.#D=void 0,this.#O?.removeAttribute(`contentEditable`),this.#O=void 0,this.#W=!1,this.#k?.remove(),this.#k=void 0,this.#M?.disconnect(),this.#M=void 0,this.#oe=!1,this.#se!==void 0&&(cancelAnimationFrame(this.#se),this.#se=void 0),this.#we()}__prepareFile(e){if(this.#e.persistState!==!0)return e;let t=tm(e),n=this.#P,r=e.lang??Xe(e.name);n!==void 0&&(tm(n)!==t||n.name!==e.name||this.#I?.languageId!==r)&&(this.#l++,this.#fe());let i=this.#ue(e,t);return i===void 0||i.getText()===e.contents?e:{...e,contents:i.getText()}}__postponeBgTokenizeToNextFrame(){let e=this.#n;e!==void 0&&(e.pauseBackgroundTokenize(),requestAnimationFrame(()=>{e.resumeBackgroundTokenize()}))}__syncRenderView=(e,t,n,r,i)=>{let a=t.shadowRoot;if(a==null){console.error(`[editor] Could not find the shadow root.`);return}let o,s,c;for(let e of a.querySelectorAll(`[data-code]`))if(e.dataset.deletions===void 0){o=e;for(let t of e.children){let e=t,{gutter:n,content:r}=e.dataset;n===void 0?r!==void 0&&(c=e):s=e}break}if(o===void 0||c===void 0)return;this.#Se().setViewportElements(t,o),this.#E!==t&&(this.#E=t,this.#S!==void 0&&t.appendChild(this.#S),this.#C!==void 0&&a.appendChild(this.#C),this.#w!==void 0&&a.appendChild(this.#w),this.#T!==void 0&&a.prepend(this.#T));let l=this.#I===void 0||this.#P===void 0||this.#P.name!==n.name||this.#P.lang!==n.lang||this.#P.cacheKey!==n.cacheKey,u=this.#le?tm(n):void 0,d;if(l){let e=``;e=`contents`in n?n.contents:n.additionLines.join(``);let t=new vu({maxEntries:this.#e.historyMaxEntries}),{name:r,lang:i,cacheKey:a}=n,o=i??Xe(n.name),s=(u===void 0?void 0:this.#ue(n,u))??new Yu(n.name,e,o,0,t);this.#P={name:r,lang:i,cacheKey:a},this.#I=s,u!==void 0&&(this.#i.set(u,s),d={cacheKey:u,textDocument:s}),this.#n?.cleanUp(),this.#n=void 0,this.#we(),this.#$=this.#Q,requestAnimationFrame(()=>{this.#e.onAttach?.(this,this.#N)}),this.#I!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] text document rebuilt from`,n.name)}d===void 0&&this.#u&&u!==void 0&&this.#I!==void 0&&(d={cacheKey:u,textDocument:this.#I});let f=this.#I;if(this.#n==null&&f!=null&&(this.#n=new Xp({highlighter:e,textDocument:f,codeOptions:this.#N?.options??{},matchBrackets:this.#e.matchBrackets,onDeferTokenize:this.#ce,onThemeChange:()=>this.#tt(),setStyle:e=>{this.#w.textContent=e},__debug:this.#e.__debug})),this.#O!==c&&(this.#D=s,this.#O=vd(c,{contentEditable:`true`,role:`textbox`,ariaMultiLine:`true`,autocapitalize:`off`,writingSuggestions:`off`,autocorrect:!1,spellcheck:!1,translate:!1}),this.#k!==void 0&&c.after(this.#k),this.#t.init(c),this.#Re(),this.#De(c,s),this.#O!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] full re-render triggered !!!`)),c.ariaLabel!==n.name&&(c.ariaLabel=n.name),r!==void 0&&r.length>0||this.#be)for(let e of this.#O.children){let t=e,{lineAnnotation:n,lineType:r,separator:i}=t.dataset;(n!==void 0||i!==void 0||r===`change-deletion`)&&t.setAttribute(`contenteditable`,`false`)}if(this.#Ce(),this.#n?.syncTheme(this.#N?.options??{}),this.#F=r,this.#L=i,this.#R=i?.totalLines,this.#n?.prebuildStateStack(i),this.#z?.removePopup(),(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&this.#nt(this.#$??[]),this.#Q!==void 0&&this.#j!==void 0?(this.#Q=void 0,this.#Ue(!1,`center`)):this.#te===void 0?this.#$!==void 0&&this.#$.length>0&&!this.#ae&&this.focus({preventScroll:!0}):this.#Ge(this.#te,this.#ne,this.#ie),this.#ae&&this.#B?.focus(),this.#e.__debug===!0&&i!==void 0){let{startingLine:e,totalLines:t}=i;console.log(`[diffs/editor] render file:`,n.name,`RenderRange:`,e+`-`+(e+t),`of`,this.#I?.lineCount,`lines`)}d!==void 0&&(this.#u=!1,this.#he(d.cacheKey,d.textDocument))};get#le(){return this.#e.persistState===!0&&this.#N?.type===`file`}#ue(e,t){let n=this.#i.get(t),r=e.lang??Xe(e.name);return n?.languageId===r?n:void 0}#de(){let e=this.#e.persistStateStorage??`inMemory`;return(this.#a===void 0||this.#o!==e)&&(this.#a=Pp(e),this.#o=e),this.#a}#fe(){let e=this.#P,t=this.#I;if(!this.#le||e===void 0||t===void 0)return;let n=tm(e);this.#i.set(n,t);let r;try{r=this.#de()}catch{return}let i=Np(this.getState()),a=this.#c;if(a?.cacheKey===n&&a.textDocument===t){if(this.#c=void 0,t.version===a.documentVersion&&this.#$===a.selections&&i.view?.scrollLeft===a.view?.scrollLeft&&i.view?.scrollTop===a.view?.scrollTop)return;this.#pe(r,n,i,a.completion);return}this.#pe(r,n,i)}#pe(e,t,n,r){let i=this.#s.get(t);if(r!==void 0||i!==void 0){let a=r??Promise.resolve();i!==void 0&&(a=a.then(()=>i)),this.#me(t,a.then(()=>e.set(t,n)));return}let a;try{a=e.set(t,n)}catch{return}nm(a)&&this.#me(t,a)}#me(e,t){let n=t.catch(()=>{});this.#s.set(e,n),n.finally(()=>{this.#s.get(e)===n&&this.#s.delete(e)})}#he(e,t){let n=++this.#l,r=t.version,i=this.#$,a=this.getState().view,o=o=>{let s=this.getState().view;o===void 0||n!==this.#l||this.#I!==t||t.version!==r||this.#$!==i||s?.scrollLeft!==a?.scrollLeft||s?.scrollTop!==a?.scrollTop||this.#P===void 0||tm(this.#P)!==e||this.setState(Np(o))},s=()=>{let t;try{t=this.#de().get(e)}catch{return}if(nm(t))return t.then(o).catch(()=>{});try{o(t)}catch{}},c=this.#s.get(e),l=c===void 0?s():c.then(s);if(nm(l)){let n={cacheKey:e,textDocument:t,documentVersion:r,selections:i,view:a,completion:l.catch(()=>{})};this.#c=n,n.completion.finally(()=>{this.#c===n&&(this.#c=void 0)})}}#ge(e){return this.#N?.isLineRenderable?.(e+1)??!0}get#_e(){let e=this.#N;if(e?.getNearestRenderableLine!=null)return(t,n)=>{let r=e.getNearestRenderableLine(t+1,n);return r==null?void 0:r-1}}#ve(e){this.#ge(e)||this.#N?.revealLine?.(e+1)}get#ye(){return this.#N?.options.diffStyle??`split`}get#be(){return this.#N?.type===`file-diff`}get#xe(){return this.#N?.options.overflow===`wrap`}#Se(){return this.#r??=new Rd({hasActivePopover:()=>this.#V!==void 0||this.#z?.isPopupVisible()===!0,updateActivePopover:()=>{this.#ct(),this.#z?.updatePopupPosition()}})}#Ce(){this.#v.clear(),this.#y.clear(),this.#b.clear(),this.#x=void 0}#we(){this.#et(null),this.#g=void 0,this.#_=void 0,this.#H=!1,this.#A?.forEach(e=>e.remove()),this.#A=void 0,this.#$=void 0,this.#Z=void 0,this.#te=void 0,this.#z?.cleanup(),this.#z=void 0,this.#B?.cleanup(),this.#B=void 0,this.#V?.cleanup(),this.#V=void 0}#Te(){this.#S=X(`style`,{dataset:`editorGlobalCss`,textContent:`
|
|
2171
|
+
[data-annotation-slot] {
|
|
2172
|
+
user-select: none;
|
|
2173
|
+
-webkit-user-select: none;
|
|
2174
|
+
}
|
|
2175
|
+
`}),this.#C=X(`style`,{dataset:`editorCss`,textContent:od}),this.#w=X(`style`,{dataset:`editorThemeCss`}),this.#T=kp(),this.#k=X(`div`,{dataset:`editorOverlay`}),this.#f=[Z(document,`selectionchange`,()=>{let e=this.#E?.shadowRoot;if(this.#H||this.#U||e==null||!this.#W||this.#$!==void 0&&this.#$.length>1&&!this.#q)return;let t=document.getSelection();if(t==null)return;let n=typeof t.getComposedRanges==`function`?t.getComposedRanges({shadowRoots:[e]})?.[0]:em(e);if(n===void 0||!this.#jt(n))return;let r=Ud(n,0);if(r!==void 0){if(this.#q&&this.#J&&this.#$!==void 0&&this.#$.length>0){let e=this.#$.at(-1);this.#nt([vf(e,r)]);return}if(this.#q)this.#Y===void 0?this.#Y=r:r=_f(this.#Y,r);else if(this.#Y!==void 0)r.direction=_f(this.#Y,r).direction;else if(this.#$!==void 0&&this.#$.length===1){let e=this.#$[0];$(e.start,r.start)===0&&$(e.end,r.end)===0&&(r.direction=e.direction)}this.#Z===void 0?this.#nt([r]):this.#nt([...this.#Z.filter(e=>!pf(e,r)),r])}},{passive:!0}),Z(document,`pointerup`,e=>{e.pointerType===`mouse`&&(this.#p?.forEach(e=>e()),this.#p=void 0,this.#K&&(this.#K=!1,this.#Ve()),this.#H=!1,this.#q=!1,this.#J=!1,this.#Y=void 0,this.#Z=void 0,this.#e.enabledSelectionAction===!0&&this.#$!==void 0&&this.#$.length>0&&!Q(this.#$.at(-1))&&this.#nt(this.#$))},{passive:!0}),Z(document,`keydown`,e=>{e.key===`Shift`&&(this.#Y=this.#$?.at(-1))},{passive:!0}),Z(document,`keyup`,e=>{e.key===`Shift`&&(this.#Y=void 0)},{passive:!0})]}#Ee(e){this.#p?.forEach(e=>e()),this.#p=e}#De(e,t){let{onFocus:n,onBlur:r}=this.#e,i=t=>{let n=t.composedPath()[0];return n!==void 0&&(n===e||e.contains(n))};this.#d?.forEach(e=>e()),this.#d=[Z(e,`focus`,()=>{this.#W=!0,n?.(),!this.#q&&!this.#H&&this.#$!==void 0&&this.#$.length>0&&this.#He(this.#$.at(-1))},{passive:!0}),Z(e,`blur`,()=>{this.#W=!1,r?.()},{passive:!0}),Z(e,`pointerdown`,t=>{if(this.#U=!1,t.pointerType===`mouse`){if(this.#qe(t)){this.#$e(!0),this.#$!==void 0&&this.#nt([]);return}if(this.#$e(!1),this.#z?.removePopup(),$u()&&this.#F!==void 0&&this.#F.length>0){let t=[...e.querySelectorAll(`[data-line-annotation]`)].map(e=>[Z(e,`mouseenter`,()=>{this.#H=!0}),Z(e,`mouseleave`,()=>{this.#H=!1})]).flat();this.#Ee(t)}if(this.#q=!0,this.#Y=void 0,t.button===0&&ed(t)&&(this.#Z=this.#$?.map(e=>({...e}))),t.shiftKey){let e=this.#$?.at(-1);if(e!==void 0){let t=e.direction===-1?e.end:e.start;this.#He({start:t,end:t,direction:0})}this.#J=!0}}},{passive:!0}),Z(e,`keydown`,e=>{if(e.key===`Escape`){e.preventDefault(),this.#B?.close(),this.#B=void 0,this.#ae=!1,this.#V?.cleanup(),this.#V=void 0,this.#je(`simplifySelection`);return}if(!i(e))return;this.#U=!1;let t=td(e),n=this.#I;if(this.#$!==void 0&&this.#$.length>0&&t!==void 0&&n!==void 0){let r={getSoftLineOffsets:this.#xe?e=>this.#At(e):void 0,resolveRenderableLine:this.#_e};e.shiftKey?this.#nt(Zd(n,this.#$,t,r)):this.#nt(Gd(n,this.#$,t,r)),this.#Ue(),e.preventDefault();return}if((e.key.length===1?e.key.toLowerCase():e.key)===`v`&&ed(e)){if(e.repeat&&this.#be){e.preventDefault();return}if(this.#e.clipboard!==void 0){e.preventDefault(),fe(this.#Oe);return}}if(this.#B!==void 0){let t=ad(e);if(t!==void 0){e.preventDefault(),this.#B.navigate(t===`previous`);return}}let r=id(e);r!==void 0&&(e.preventDefault(),this.#je(r))}),Z(e,`copy`,e=>{i(e)&&(e.preventDefault(),this.#Ze()?e.clipboardData?.setData(`text`,this.#Qe()):this.#pt(e.clipboardData,this.#dt(),this.#ft()))}),Z(e,`cut`,e=>{if(i(e))if(e.preventDefault(),this.#Ze())e.clipboardData?.setData(`text`,this.#Qe());else{let t=this.#ft();this.#pt(e.clipboardData,this.#mt(),t)}}),Z(e,`paste`,e=>{if(!i(e))return;e.preventDefault();let t=e.clipboardData,n=this.#I;if(t===null||n===void 0)return;let r=t.getData(`text`),a=this.#$?.length??0;if(a>1){let e=t.getData(am);if(e!==void 0)try{let t=JSON.parse(e);Array.isArray(t)&&t.length===a&&(r=t)}catch{}}this.#gt(Array.isArray(r)?r.map(e=>n.normalizeEol(e)):n.normalizeEol(r),void 0,!0,`document`)}),Z(e,`beforeinput`,e=>{i(e)&&e.inputType!==`insertCompositionText`&&(e.preventDefault(),this.#Be(e.inputType,e.data))}),Z(e,`drop`,e=>{i(e)&&e.preventDefault()}),Z(e,`compositionstart`,e=>{i(e)&&(this.#G=!0,this.#H=!0)},{passive:!0}),Z(e,`compositionend`,e=>{if(!i(e))return;this.#H=!1;let t=this.#G;this.#G=!1,(e.data!==``||!t)&&this.#Be(`insertText`,e.data)},{passive:!0})];let a=this.#E?.shadowRoot?.querySelector(`[data-deletions]`);if(a!=null&&this.#d.push(Z(a,`pointerdown`,e=>{let t=e.composedPath()[0],n=t instanceof HTMLElement?t.closest(`[data-column-number]`):null;n instanceof HTMLElement&&this.#Xe(n,a,e.pointerType===`mouse`)||(this.#$e(!0),this.#$!==void 0&&this.#nt([]))},{passive:!0})),t!==void 0){let e=(e,t=!1)=>{let n=e;return n?.dataset.lineNumberContent===void 0?t&&n?.tagName===`SPAN`&&(n=n.closest(`[data-line]`)):n=n.parentElement??void 0,n},n=e=>{if(e===void 0)return;let t=e.dataset.lineType,n=gd(e)??gd(e,`columnNumber`);if(!(n===void 0||t===void 0||!ff(t)))return n-1};this.#d.push(Z(t,`pointerdown`,t=>{if(this.#N?.options.enableLineSelection===!0)return;let r=e(t.composedPath()[0]);if(r?.dataset.lineType===`change-deletion`){let e=r.closest(`[data-code]`);e!=null&&this.#Xe(r,e,t.pointerType===`mouse`);return}if(t.pointerType!==`mouse`)return;let i=this.#I,a=n(r);if(a===void 0||i===void 0)return;this.#z?.removePopup();let o=this.#Ke(a,a,i);this.#K=!0,this.#Y=o,this.#nt([o]),this.#He(o),this.#Ve(),this.#Ee([Z(document,`mousemove`,t=>{if(!this.#K)return;let r=this.#I,i=n(e(t.composedPath()[0],!0));if(i===void 0||r===void 0)return;let a=this.#Y?.start.line??i,o=this.#Ke(a,i,r);this.#Y??=o,this.#nt([o]),this.#Ve(o.direction===-1?o.start:o.end)},{passive:!0})])},{passive:!0}))}this.#z?.listenHover(e),this.#M?.disconnect(),this.#M=new ResizeObserver(this.#Le),this.#M.observe(e),this.#M.observe(e.parentElement),this.#ke(e)}#Oe=async()=>{let e=this.#e.clipboard;if(e!==void 0){let t=await e.readText(),n=this.#$?.length??0;if(n>1){let r=await e.readText(am);try{let e=JSON.parse(r);Array.isArray(e)&&e.length===n&&(t=e)}catch{}}let r=this.#I;r!==void 0&&this.#gt(Array.isArray(t)?t.map(e=>r.normalizeEol(e)):r.normalizeEol(t),void 0,!0,`document`)}};#ke(e){this.#be&&this.#ye===`split`&&this.#xe&&(this.#h={top:e.offsetTop,left:e.offsetLeft-this.#Et()},this.#e.__debug===!0&&console.log(`[diffs/editor] content offset:`,this.#h))}get#Ae(){if(this.#be&&this.#ye===`split`&&this.#xe)return this.#h}#je(e){let t=this.#I;if(t!==void 0)switch(e){case`openSearchPanel`:this.#lt(`find`);break;case`openSearchReplacePanel`:this.#lt(`replace`);break;case`findNextMatch`:{let e=this.#$;if(e===void 0)break;if(e.some(Q)){let n=e.map(e=>Q(e)?If(t,e):e);this.#nt(n),this.focus()}else{let n=Cf(t,e);if(n!==void 0){this.#nt(n);let e=n.at(-1);e!==void 0&&this.#ve(df(e).line),this.#Ue()}}break}case`moveLineUp`:case`moveLineDown`:this.#Ie(e===`moveLineUp`?-1:1);break;case`copyLineUp`:case`copyLineDown`:this.#Pe(e===`copyLineUp`?-1:1);break;case`simplifySelection`:{let e=this.#$,t=e?.at(-1);if(e===void 0||t===void 0)break;if(e.length>1)this.#nt([t]),this.#Ve(df(t));else if(!Q(t)){let e=df(t);this.#nt([{start:e,end:e,direction:0}]),this.#Ve(e)}break}case`insertBlankLine`:this.#Fe();break;case`deleteHardLineForward`:this.#bt();break;case`toggleComment`:case`toggleBlockComment`:{let n=this.#$;if(n===void 0)break;let{lineComment:r,blockComment:i}=ud(t.languageId,this.#e.languageCommentConfig);if(e===`toggleComment`&&r!==null){this.#Ne(dd(t,n,r));break}let a=e===`toggleComment`,o=hd(t,n,i,a);o!==void 0&&this.#Ne(o.edits,a?void 0:e=>o.nextSelectionOffsets.map(([t,n,r])=>({start:e.positionAt(t),end:e.positionAt(n),direction:r})));break}case`indent`:case`outdent`:case`indentLess`:case`indentMore`:if(this.#$!==void 0){let n=[],r=[],i=new Set,a=[];for(let o of this.#$){let s=o.start.line,c=e===`outdent`||e===`indentLess`,l=e===`indentLess`||e===`indentMore`;if(s!==o.end.line||c||l){let e=Wd(t,o,this.#t.tabSize,c);for(let t of e[0]){let e=t.range.start.line;i.has(e)||(i.add(e),n.push(t))}r.push(e[1])}else{let e=t.charAt({line:s,character:0})===` `?` `:` `.repeat(this.#t.tabSize);n.push({range:o,newText:e}),a.push({line:s,startCharacter:o.start.character,addedLength:e.length-(o.end.character-o.start.character),selectionIndex:r.length});let i={line:o.start.line,character:o.start.character+e.length};r.push({start:i,end:i,direction:0})}}for(let e of a){let t=0;for(let n of a)n.line===e.line&&n.startCharacter<e.startCharacter&&(t+=n.addedLength);if(t!==0){let n=r[e.selectionIndex],i={line:e.line,character:n.start.character+t};r[e.selectionIndex]={start:i,end:i,direction:0}}}let o=t.applyEdits(n,!0,this.#$,r);o!==void 0&&this.#St(o,r)}break;case`selectAll`:{let e=wf(t);this.#nt([e]),this.focus();let n=this.#wt();n!==void 0&&(this.#U=!0,this.#He({start:{line:n.first,character:0},end:{line:n.last,character:t.getLineLength(n.last)},direction:1}));break}case`moveCursorToDocStart`:case`moveCursorToDocEnd`:{let n=Tf(t,e===`moveCursorToDocEnd`,this.#be);this.#nt([n]),this.#ve(df(n).line),this.#Ue()}break;case`expandSelectionDocStart`:case`expandSelectionDocEnd`:{let n=e===`expandSelectionDocEnd`,r=this.#$;if(r!==void 0){let e=Tf(t,n,this.#be);this.#nt(yf(r,e)),this.#ve(df(e).line),this.#Ue()}}break;case`undo`:case`redo`:this.#Me(e);break}}#Me(e){let t=this.#I;if(t===void 0||e===`undo`&&!t.canUndo||e===`redo`&&!t.canRedo)return;let n=this.#$,r=n?.map(e=>[t.offsetAt(e.start),t.offsetAt(e.end)]),i=e===`undo`?t.undo():t.redo();if(i===void 0)return;let[a,o,s,c]=i,l=o??(n!==void 0&&r!==void 0&&c!==void 0?gf(t,n,r,c):void 0);this.#St(a,l,s)}#Ne(e,t){let n=this.#I,r=this.#$;if(n===void 0||r===void 0)return;let i=t===void 0,a=i?r.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]):void 0,o=i?e.map(e=>{let t=n.offsetAt(e.range.start),r=n.offsetAt(e.range.end);return{start:Math.min(t,r),end:Math.max(t,r),text:e.newText}}).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n}):void 0,s=n.applyEdits(e,!0,r,void 0,!0);if(s===void 0)return;let c=i?gf(n,r,a,o):t(n);n.setLastUndoSelectionsAfter(c),this.#St(s,c,this.#Ct(s))}#Pe(e){let t=this.#I,n=this.#$;if(t===void 0||n===void 0)return;let r=xf(n);if(r.length===0)return;let i=[],a=0,o=[];for(let n of r){i.push(a);let r=n.endLine-n.startLine+1;a+=r;let s=t.getText({start:{line:n.startLine,character:0},end:{line:n.endLine,character:t.getLineLength(n.endLine)}});if(e>0){let e={line:n.startLine,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else if(n.endLine<t.lineCount-1){let e={line:n.endLine+1,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else{let e={line:n.endLine,character:t.getLineLength(n.endLine)};o.push({range:{start:e,end:e},newText:t.eol+s})}}let s=n.map(t=>{let n=t.start.line,a=0,o=r.length-1;for(;a<=o;){let e=a+o>>>1,t=r[e];if(n<t.startLine)o=e-1;else if(n>t.endLine)a=e+1;else{a=e;break}}let s=Math.max(0,a<=o?a:o),c=r[s],l=i[s]+(e>0?c.endLine-c.startLine+1:0);return{start:{...t.start,line:t.start.line+l},end:{...t.end,line:t.end.line+l},direction:t.direction}});this.#Ne(o,()=>s)}#Fe(){let e=this.#I,t=this.#$;if(e===void 0||t===void 0)return;let n=t.map(e=>df(e).line),r=Array.from(new Set(n)).sort((e,t)=>e-t),i=new Map,a=new Map,o=[];for(let t=0;t<r.length;t++){let n=r[t],s=e.getLineText(n),c=/^\s*/.exec(s)?.[0]??``;i.set(n,t),a.set(n,c);let l={line:n,character:e.getLineLength(n)};o.push({range:{start:l,end:l},newText:e.eol+c})}let s=t.map((e,t)=>{let r=n[t],o={line:r+1+i.get(r),character:a.get(r).length};return{start:o,end:o,direction:0}});this.#Ne(o,()=>s)}#Ie(e){let t=this.#I,n=this.#$;if(t===void 0||n===void 0)return;let r=xf(n);if(r.length===0||e<0&&r[0].startLine===0||e>0&&r.at(-1).endLine>=t.lineCount-1)return;let i=t.lineCount,a=e=>e<i-1?{line:e+1,character:0}:{line:e,character:t.getLineLength(e)},o=(e,n)=>{let r=e.map(e=>t.getLineText(e)).join(t.eol);return n?r+t.eol:r},s=[];if(e<0)for(let e of r){let t=e.startLine-1,n=[];for(let t=e.startLine;t<=e.endLine;t++)n.push(t);s.push({range:{start:{line:t,character:0},end:a(e.endLine)},newText:o([...n,t],e.endLine<i-1)})}else for(let e=r.length-1;e>=0;e--){let t=r[e],n=t.endLine+1,c=[];for(let e=t.startLine;e<=t.endLine;e++)c.push(e);s.push({range:{start:{line:t.startLine,character:0},end:a(n)},newText:o([n,...c],n<i-1)})}let c=r.at(-1),l=e>0&&c.endLine===i-2?t.getLineLength(c.endLine):t.getLineLength(i-1),u=n.map(n=>Sf(n,e,i,e=>e===i-1?l:t.getLineLength(e))),d=t.applyEdits(s,!0,n,u,!0);d!==void 0&&this.#St(d,u)}#Le=()=>{let e=this.#F?.length??0,t=this.#g,n=this.#_;this.#g=void 0,this.#_=void 0;let r=this.#Et()!==t,i=this.#Dt()!==n;!r&&!i||(this.#b.clear(),this.#x=void 0,this.#t.clearTextWidthCache(),i&&(this.#xe||e>0)&&(this.#v.clear(),this.#y.clear()),(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&(this.#nt(this.#$??[]),this.#$!==void 0&&this.focus()),this.#z?.removePopup(),this.#ke(this.#O))};#Re(){if(this.#oe)return;let e=document.fonts;e!==void 0&&(this.#oe=!0,e.ready.then(()=>{this.#O===void 0||!this.#t.remeasureCharacterWidth()||(this.#g=void 0,this.#_=void 0,this.#Ce(),(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&this.#nt(this.#$??[]),this.#z?.removePopup())}))}#ze(e,t,n=this.#L,r){let i=this.#n,a=this.#N,o=this.#I,s=this.#D,c=this.#O;if(i===void 0||a===void 0||o===void 0||c===void 0)return;i.stopBackgroundTokenize();let l=performance.now(),u=i.tokenize(e,n),d=performance.now();if(u.size>0){let e=c.children,t=new Set;for(let e of u.keys())this.#ge(e)&&t.add(e);for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0){let e=gd(r),n=r.dataset.lineType;if(e===void 0||n===`change-deletion`)continue;let i=e-1;if(t.has(i)){let e=u.get(i);if(r.replaceChildren(...Qp(e)),t.delete(i),t.size===0)break}}}if(t.size>0){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t],i=gd(r);if(i!==void 0&&r.dataset.lineType!==`change-deletion`){n=i;break}}for(let e of t){if(e<n)continue;let t=u.get(e),r=String(e+1);X(`div`,{dataset:{line:r,lineType:`context`,lineIndex:e.toString()},children:Qp(t)},c),s!==void 0&&X(`div`,{dataset:{lineType:`context`,columnNumber:r,lineIndex:e.toString()},children:[X(`span`,{dataset:{lineNumberContent:``},textContent:r})]},s)}}}if(e.lineDelta<0)for(let t of[c.children,s?.children??[]])for(let n=t.length-1;n>=0;n--){let r=t[n],i=gd(r)??gd(r,`columnNumber`),a=r.dataset.lineType;if(!(i===void 0||a===`change-deletion`)){if(i-1<e.lineCount)break;r.remove()}}let f=e.lineDelta!==0;if(f){let e=c.children.length;for(let t of c.children){let{bufferSize:n}=t.dataset;n!==void 0&&(e+=parseInt(n)-1)}c.style.gridRow=`span `+e,s!==void 0&&(s.style.gridRow=`span `+e)}a.updateRenderCache(u,i.themeType,!f,f),a.file!==void 0&&(a.file.contents=o.getText()),f&&a.applyDocumentChange(o,t,r),this.#be&&(this.#ye===`unified`||f)&&this.#Ce(),t!==void 0&&(this.#F=t,Md(t,c,s)),this.#e.__debug===!0&&console.log(`[diffs/editor] re-render in: ${bd(performance.now()-d)}ms,`,`tokenize in: ${bd(d-l)}ms (${u.size} dirty lines)`)}#Be(e,t){switch(e){case`insertText`:{let e=t??``,n=this.#I,r=this.#$,i=n!==void 0&&r!==void 0?rf(n,r,e,this.#e.autoSurround):void 0;this.#gt(i??e);break}case`insertCompositionText`:break;case`insertLineBreak`:case`insertParagraph`:this.#gt(this.#I?.eol??`
|
|
2176
|
+
`);break;case`deleteContentBackward`:this.#_t();break;case`deleteContentForward`:this.#_t(!0);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:this.#vt();break;case`deleteWordBackward`:this.#yt();break;case`insertTranspose`:this.#xt();break;default:console.warn(`[diffs] Unknown input type: ${e}`,t);break}}#Ve(e,t=!0){this.#W=!0,e===void 0?this.#O?.focus({preventScroll:t}):(this.#H=!0,this.#He({start:e,end:e,direction:0}),requestAnimationFrame(()=>{this.#O?.focus({preventScroll:t}),requestAnimationFrame(()=>{this.#H=!1})}))}#He(e){let t=window.getSelection();if(t===null)return;let{start:n,end:r,direction:i}=e;$(n,r)>0&&([n,r]=[r,n]);let a=this.#Tt(n.line),o=this.#Tt(r.line);if(a===void 0||o===void 0)return;let[s,c]=Ff(a,n.character),[l,u]=Ff(o,r.character);i===-1&&([s,c,l,u]=[l,u,s,c]);try{t.setBaseAndExtent(s,_d(s,c),l,_d(l,u))}catch(e){console.error(`[diffs/editor] failed to update window selection:`,e)}}#Ue(e=!1,t=`nearest`){let n=this.#$?.at(-1);if(n===void 0)return;let r=this.#j;if(r!==void 0)r.scrollIntoView({block:t,inline:`nearest`}),e||this.#Ve(n.direction===-1?n.end:n.start);else{let t=df(n);this.#Ge(t.line,t.character,e)}}#We(){let e=this.#B===void 0?0:48,t=this.#Et()+this.#t.ch;return`${e}px ${this.#t.ch}px 0 ${t}px`}#Ge(e,t=0,n=!1){this.__postponeBgTokenizeToNextFrame();let r=X(`div`,{style:{position:`absolute`,left:`0`,width:`2px`,height:this.#t.lineHeight+`px`,scrollMargin:this.#We()}});if(this.#Tt(e)!==void 0){let[i,a]=this.#kt(e,t),o=this.#Ot(e)+a*this.#t.lineHeight;r.style.top=o+`px`,r.style.left=i+`px`,this.#k?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),n||this.#Ve({line:e,character:t}),this.#te=void 0,this.#ne=void 0,this.#re=!1,this.#ie=!1}else{let i=this.#N?.getLinePosition?.(e+1);if(i!==void 0)r.style.top=i.top+`px`,this.#E?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),i.height>0&&this.#ge(e)?(this.#te=e,this.#ne=t,this.#ie=n):(this.#te=void 0,this.#ne=void 0,this.#ie=!1);else{let i=0;if(this.#te===e&&this.#O!==void 0)for(let t=this.#O.childElementCount-1;t>=0;t--){let n=this.#O.children[t],r=n.dataset.lineType,a=gd(n);if(r!==void 0&&ff(r)&&a!==void 0){i=(e-(a-1))*this.#t.lineHeight;break}}let a=((this.#F??[]).filter(t=>t.lineNumber<e).length+e)*this.#t.lineHeight+i;r.style.top=a+`px`,this.#E?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),this.#te===e&&(i===0||this.#re)||!this.#ge(e)?(this.#te=void 0,this.#ne=void 0,this.#re=!1,this.#ie=!1):(this.#te=e,this.#ne=t,this.#re=i!==0,this.#ie=n)}}r.remove()}#Ke(e,t,n){let r=e=>({line:e,character:0}),i=e=>({line:e,character:n.getLineText(e).length});return t<e?{start:r(t),end:i(e),direction:-1}:{start:r(e),end:i(t),direction:1}}#qe(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&t.closest(`[data-line]`)?.getAttribute(`data-line-type`)===`change-deletion`}#Je(e,t,n){let r=[...n.querySelectorAll(`[data-content] > [data-line]`)],i=r.indexOf(e),a=r.indexOf(t),[o,s]=a<i?[t,e]:[e,t],c=window.getSelection();if(c!==null){let e=document.createRange();e.setStart(o,0),e.setEnd(s,s.childNodes.length),c.removeAllRanges(),c.addRange(e)}this.#$e(!0),this.#nt([]),[...n.querySelectorAll(`[data-gutter] > [data-column-number]`)][a]?.setAttribute(`data-selected-line`,`single`);let l=Math.min(i,a),u=Math.max(i,a);this.#X=l<0?``:r.slice(l,u+1).filter(e=>e.getAttribute(`data-line-type`)===`change-deletion`).map(e=>e.textContent??``).join(`
|
|
2177
|
+
`)}#Ye(e,t){let n=e.parentElement;if(n==null||t==null)return;let r=[...n.children].indexOf(e),i=t.children[r];return i instanceof HTMLElement?i:void 0}#Xe(e,t,n){let r=t.querySelector(`[data-content]`),i=this.#Ye(e,r);return i===void 0?!1:(this.#Je(i,i,t),n&&this.#Ee([Z(document,`mousemove`,e=>{let n=e.composedPath()[0],a=n instanceof HTMLElement?n.closest(`[data-column-number]`):null;if(a instanceof HTMLElement&&t.contains(a)){let e=this.#Ye(a,r);e!==void 0&&this.#Je(i,e,t)}},{passive:!0})]),!0)}#Ze(){return this.#E?.shadowRoot?.querySelector(`pre`)?.hasAttribute(`data-deleted-text-selection`)??!1}#Qe(){return this.#X===``?window.getSelection()?.toString()??``:this.#X}#$e(e){let t=this.#E?.shadowRoot?.querySelector(`pre`);if(t!=null)if(e){t.setAttribute(`data-deleted-text-selection`,``);for(let e of t.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);this.#X=``}else t.removeAttribute(`data-deleted-text-selection`),this.#X=``}#et(e,t=!1){if(this.#N?.options.controlledSelection!==!0)try{this.#N?.setSelectedLines(e,{notify:!1,activeLineSide:`additions`,lineNumberOnly:t})}catch{}}#tt(){this.#se===void 0&&(this.#se=requestAnimationFrame(()=>{this.#se=void 0,(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&this.#nt(this.#$??[])}))}#nt(e){if(this.__postponeBgTokenizeToNextFrame(),this.#j=void 0,this.#et(null),e.length===0&&this.#ee===void 0&&this.#z===void 0){this.#$=void 0,this.#A?.forEach(e=>e.remove()),this.#A?.clear(),this.#V?.cleanup(),this.#V=void 0;return}let t=document.createDocumentFragment(),n={fragment:t,elements:new Map};if(e.length>0){let t=bf(e),r=t.at(-1);this.#$=t;let i=t.some(e=>!Q(e)),a=df(r).line+1;this.#et({start:a,end:a},i);for(let e of t)Q(e)||this.#rt(n,`selection`,e),this.#st(n,e,e===r);let o=this.#e.matchBrackets!==!1&&this.#I!==void 0&&this.#n!==void 0&&Q(r)?gp(this.#I,this.#n,r.start):void 0;if(o!==void 0)for(let e of o)this.#rt(n,`bracketMatch`,e)}let r=this.#I;if(this.#ee!==void 0&&r!==void 0){let e=this.#$?.at(-1),t=e===void 0?-1:r.offsetAt(e.start),i=e===void 0?-1:r.offsetAt(e.end);for(let[e,a]of this.#ee){let o={start:r.positionAt(e),end:r.positionAt(a)},s=t===e&&i===a;this.#rt(n,`match`,o,s?`focus`:void 0)}}if(this.#z!==void 0&&r!==void 0)for(let e of this.#z.markers)this.#rt(n,`marker`,e,dp(e.severity));this.#k?.appendChild(t),this.#A?.forEach(e=>e.remove()),this.#A?.clear(),this.#A=n.elements,this.#ct()}#rt(e,t,n,r){if(this.#I===void 0)return;let{start:i,end:a}=n;for(let n=i.line;n<=a.line;n++){if(!this.#Mt(n))continue;let o=n===a.line,s=n===i.line?i.character:0,c=o?a.character:this.#I.getLineLength(n);if(this.#xe){let i=this.#Dt(),a=this.#I.getLineText(n);if(2*this.#t.ch+this.#t.measureTextWidth(a)>i){this.#it(e,n,a,s,c,o,t,r);continue}}let l=0,u=0,d=0;l=s===0?this.#Et()+this.#t.ch+(this.#Ae?.left??0):this.#kt(n,s)[0],!o&&t===`selection`&&(d=this.#t.ch),u=s===c?d:this.#kt(n,c)[0]-l+d,this.#ot(e,t,n,0,l,u,r)}}#it(e,t,n,r,i,a,o,s){let c=this.#At(t),l=c.length-1,u=this.#Et()+this.#t.ch+(this.#Ae?.left??0);for(let d=0;d<l;d++){let f=c[d],p=c[d+1],m=Math.max(r,f),h=Math.min(i,p);if(m>h)continue;let g=this.#at(n,f,m),_=u+g,v=0;!a&&d===l-1&&o===`selection`&&(v=this.#t.ch);let y=m===h?v:this.#at(n,f,h)-g+v;this.#ot(e,o,t,d,_,y,s)}}#at(e,t,n){if(n<=t)return 0;let r=e.slice(t,n),i=Jp(r,this.#t.tabSize);return i===-1?this.#t.measureTextWidth(r):i*this.#t.ch}#ot(e,t,n,r,i,a,o){if(a===0)return;let{ch:s,lineHeight:c}=this.#t,l=this.#Ot(n)+r*c,u=`${t}-${n}/${r}-${i}-${a} ${o??``}`,d=this.#A,f=(this.#e.roundedSelection??!0)&&t===`selection`,p=(n,r,i,a)=>{let o=this.#Ot(n)+r*c,l=this.#Tt(n),u=`initial`;this.#be&&l?.dataset.lineType===`change-addition`&&(u=getComputedStyle(l).getPropertyValue(`--diffs-line-bg`));let f=`width:${s}px;transform:translateX(${i}px) translateY(${o}px);--diffs-selection-corner-bg:${u}`,p={selectionCorner:``,[a]:``},m=`${t}-block-${n}/${r}-${i}-1ch`,h=m+`-`+a;if(a===`rbl`){let t=m+`-rtl`,n=e.elements.get(t);n!==void 0&&(n.remove(),e.elements.delete(t),h+=`-rtl`,p.rtl=``)}let g=e.elements.get(h);g===void 0&&(d?.has(h)===!0?(g=d.get(h),g.style.cssText=f,d.delete(h)):g=X(`div`,{dataset:`selectionRange`,style:{cssText:f},children:[X(`div`,{dataset:p})]},e.fragment),e.elements.set(h,g))},m=t=>{let o=i+a,c=t.dataset,l=e.previousSelectionRange;if((l===void 0||l.line!==n||l.wrapLine!==r)&&(e.previousSelectionRange={element:t,line:n,wrapLine:r,left:i,width:a}),l===void 0||o<=l.left)[`rtl`,`rtr`,`rbl`,`rbr`].forEach(e=>{c[e]=``});else{let e=l.line,t=l.wrapLine,a=l.left,u=l.element.dataset,d=a+l.width;a>i&&p(e,t,a-s,`rbr`),delete u.rbl,delete c.rtl,delete c.rtr,o>=d&&delete u.rbr,o>d&&(p(e,t,d,`rbl`),c.rtr=``),o<d&&p(n,r,o,`rtl`),i<a&&(c.rtl=``),c.rbl=``,c.rbr=``}},h=e.elements.get(u);if(h!==void 0){f&&m(h);return}d?.has(u)===!0?(h=d.get(u),d.delete(u)):h=X(`div`,{dataset:o?[t+`Range`,o]:t+`Range`},e.fragment),h.style.width=`${a}px`,h.style.transform=`translateX(${i}px) translateY(${l}px)`,f&&m(h),e.elements.set(u,h)}#st(e,t,n){let{line:r,character:i}=df(t);if(!this.#Mt(r))return;let[a,o]=this.#kt(r,i),s=`caret-`+r+`/`+o+`:`+i;if(e.elements.has(s))return;let c=X(`div`,{dataset:`caret`,style:{transform:`translateX(${a-1}px) translateY(${this.#Ot(r)+o*this.#t.lineHeight}px)`}},e.fragment);e.elements.set(s,c),n&&(c.style.scrollMargin=this.#We(),this.#j=c)}#ct(){let e=this.#$?.at(-1),t=this.#k,n=this.#I,r=this.#e.renderSelectionAction,i=()=>{this.#V?.cleanup(),this.#V=void 0};if(this.#e.enabledSelectionAction!==!0||r===void 0||e===void 0||Q(e)||this.#q||t===void 0||n===void 0){i();return}let a=df(e);if(!this.#Mt(a.line)){i();return}if(this.#V===void 0){let a=()=>this.#$?.at(-1)??e,o=r({textDocument:n,get selection(){return a()},applyEdits:e=>this.applyEdits(e),getSelectionText:()=>this.#I?.getText(a())??``,replaceSelectionText:e=>{this.#gt(e,[a()])},close:()=>{i(),this.#Ue()}});this.#V=new Mp(o,t,()=>this.#ct()),this.#Se().resetPlacement(im)}let o=this.#t.lineHeight,s=e.direction===-1,c={placeAbove:s,anchor:a},l=s?{placeAbove:!1,anchor:e.end}:{placeAbove:!0,anchor:e.start},u=this.#V.height,d=e=>{let[t,n]=this.#kt(e.anchor.line,e.anchor.character),r=this.#Ot(e.anchor.line)+n*o,i=e.placeAbove?r:r+o,a=e.placeAbove?i-u:i;return{top:a,bottom:a+u,left:t,anchorTop:i}},f=d(c),p=d(l),m=n.lineCount,h=s?a.line<3:a.line>=m-3,g=this.#Mt(l.anchor.line),_=this.#Se(),v=_.getPlacementBounds(),y=g&&_.choosePlacement({preferred:f,fallback:p,viewport:v,popoverHeight:u,atDocumentEdge:h,placementKey:im})===`fallback`;g||_.setPlacement(`preferred`,im);let{placeAbove:b}=y?l:c,{left:x,anchorTop:S}=y?p:f;this.#V.reposition(x,S,this.#Et(),b,v)}#lt(e){if(this.#B!==void 0){this.#B.setMode(e);return}this.#ut(e)}#ut(e){this.#B?.cleanup();let t=this.#I,n=this.#E?.shadowRoot?.querySelector(`pre`),r=this.#$;if(t===void 0||n==null)return;let i=``,a;if(r!==void 0&&r.length>0){let e=r.at(-1);if(Q(e)){e=If(t,e),this.#nt([...r.slice(0,-1),e]);let n=t.getText(e);n!==``&&!n.includes(`
|
|
2178
|
+
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=mf(t,e,n);this.#nt([i]),this.#ve(df(i).line),this.#Ue(!0),this.#ae=r},s=new jp({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#$);n!==void 0&&this.#St(n,void 0,this.#Ct(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#ee=void 0,this.#nt(this.#$??[]);return}if(this.#ee=e,n?.syncSelection===!1){this.#nt(this.#$??[]);let n=this.#$?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#$?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#nt(this.#$??[]):o(a,!0),a},onClose:()=>{this.#B=void 0,this.#ae=!1,this.#ee=void 0,this.#nt(this.#$??[])}});this.#B=s,this.#ae=!1}#dt(){let e=this.#I,t=this.#$;return e===void 0||t===void 0?``:kf(e,t)}#ft(){let e=this.#I,t=this.#$;return e===void 0||t===void 0?[]:Of(e,t)}#pt(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(am,JSON.stringify(n)))}#mt(){let e=this.#I,t=this.#$;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>Q(e))){let n=Pf(e,t);return this.#ht(n.edits,n.nextSelectionOffsets),n.text}let n=kf(e,t);return this.#gt(``,void 0,!0),n}#ht(e,t){let n=this.#I,r=this.#$;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#St(i,a,this.#Ct(i))}#gt(e,t=this.#$,n=!1,r=`selection`){if(t===void 0)return;let i=this.#I,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?tf(i,t,e,this.#F,n,r):Qd(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#F,void 0,n);s!==void 0&&this.#St(s,o,this.#Ct(s))}#_t(e=!1){let t=this.#$,n=this.#I;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=uf(n,t,e,this.#F,this.#t.tabSize);i!==void 0&&this.#St(i,r,this.#Ct(i))}#vt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=sf(t,e,this.#xe?(e,t)=>{let n=this.#At(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#yt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=cf(t,e,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#bt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=of(t,e,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#xt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=af(t,e,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#St(e,t,n,r){let i=this.getFile(),a=this.#e.onChange;if(i!==void 0&&a!==void 0&&a(i,n??this.#F),e.lineDelta!==0||this.#xe)for(let t of this.#v.keys())t>=e.startLine&&this.#v.delete(t);if(this.#xe)for(let t of this.#y.keys())t>=e.startLine&&this.#y.delete(t);this.#x=void 0;let o=this.#L,s;if(o!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=o.startingLine+o.totalLines;if(n.end.line>=r){let t=n.end.line-o.startingLine+1,i=this.#R===void 0||this.#R===1/0?1/0:this.#R*rm;e.startLine<=r&&t<=i&&this.#ge(n.end.line)?(n.end.line>r&&(s=!0),o={...o,totalLines:t},this.#L=o):s=!0}}if(this.#ze(e,n,o,s),r?.skipSearchRefresh!==!0&&this.#B!==void 0&&this.#ee!==void 0&&this.#B.updateMatches({syncSelection:!1}),t!==void 0&&(this.#nt(t),r?.skipFocus!==!0)){let e=t.at(-1);if(e!==void 0&&this.#ve(df(e).line),this.#j!==void 0)requestAnimationFrame(()=>{this.#j?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=df(t.at(-1));this.#Ge(e.line,e.character)}this.focus({preventScroll:!0})}}#Ct(e){if(this.#F!==void 0){let t=Ed(e,this.#F);if(t!==void 0)return this.#I?.setLastUndoLineAnnotations(this.#F,t),t}}#wt(){let e=this.#O;if(e===void 0)return;let t,n;for(let r of e.children){let e=r,i=e.dataset.lineType,a=gd(e);if(a===void 0||i===void 0||!ff(i))continue;let o=a-1;(t===void 0||o<t)&&(t=o),(n===void 0||o>n)&&(n=o)}return t===void 0||n===void 0?void 0:{first:t,last:n}}#Tt(e){let t=this.#b.get(e);if(t!==void 0)return t??void 0;let n=this.#O;if(n!==void 0){if(this.#L!==void 0){let{startingLine:r}=this.#L,{children:i}=n;for(let n=e-r;n<=i.length;n++){let r=i[n];if(r===void 0)break;let a=gd(r),o=r.dataset.lineType;if(a!==void 0&&a===e+1&&o!==void 0&&ff(o)){t=r;break}}}return t??=n.querySelector(`[data-line="${e+1}"]`+(this.#ye===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#b.set(e,t),t??void 0}}#Et(){if(this.#D===void 0)return 0;if(this.#g===void 0){let e=this.#O?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#g=parseInt(e.slice(0,-2),10):this.#g=this.#D.offsetWidth}return this.#g}#Dt(){if(this.#O===void 0)return 0;if(this.#_===void 0){let e=this.#O.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#_=parseFloat(e.slice(0,-2)):this.#_=this.#O.offsetWidth}return this.#_}#Ot(e){let t=this.#v.get(e);if(t!==void 0)return t;let n=this.#Tt(e);if(n===void 0)return-1;let r=n.offsetTop+this.#t.paddingTop;return r+=this.#Ae?.top??0,this.#v.set(e,r),r}#kt(e,t){if(this.#x!==void 0&&this.#x[0]===e&&this.#x[1]===t)return[this.#x[2],this.#x[3]];let n=this.#I?.getLineText(e),r=this.#Et()+this.#t.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#Ae?.left??0),0];let i=Kp(n,Math.min(t,n.length)),a=n.slice(0,i),o=Jp(a,this.#t.tabSize),s=0,c=0;if(s=o===-1?r+this.#t.measureTextWidth(a):r+o*this.#t.ch,this.#xe){let t=this.#Dt();if(2*this.#t.ch+this.#t.measureTextWidth(n)>t){let t=this.#At(e);for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=Jp(t,this.#t.tabSize);s=o===-1?r+this.#t.measureTextWidth(t):r+o*this.#t.ch;break}}}s+=this.#Ae?.left??0}return this.#x===void 0?this.#x=[e,t,s,c]:(this.#x[0]=e,this.#x[1]=t,this.#x[2]=s,this.#x[3]=c),[s,c]}#At(e){let t=this.#y.get(e);if(t!==void 0)return t;let n=this.#I?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#y.set(e,t),t}let r=X(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#t.tabSize.toString()},textContent:n},this.#O),i=r.firstChild,a=document.createRange(),o=[];try{let t=qp(n),s=r.getBoundingClientRect().left+this.#t.ch,c=0,l=-1/0;for(let e=0,r=0;e<n.length;){let n=t===void 0?e+1:t[r+1];a.setStart(i,e),a.setEnd(i,n);let{left:u,top:d}=a.getBoundingClientRect();if(d>l){let t=$u()&&o.length>0&&u-s>this.#t.ch/2;o.push(t?c:e),l=d}c=e,e=n,r++}let u=new Uint32Array(o.length+1);for(let e=0;e<o.length;e++)u[e]=o[e];return u[o.length]=n.length,this.#y.set(e,u),u}finally{r.remove()}}#jt({startContainer:e,endContainer:t}){let n=this.#O;return n===void 0?!1:n.contains(e)&&n.contains(t)}#Mt(e){let t=this.#I?.lineCount??0;return e<0||e>=t?!1:this.#Tt(e)!==void 0}},sm=3e4,cm=5*6e4,lm=``,um=class extends g(`VcsFileDiffError`){};function dm(e){return[e.environmentId,e.cwd,e.relativePath,e.source,e.revision].map(encodeURIComponent).join(`|`)}function fm(e){return e.split(`|`).map(decodeURIComponent)}var pm=C(e=>T(v({try:()=>{if(e===lm)return Promise.resolve(null);let[t,n,r,i]=fm(e);return Re(t).vcs.fileDiff({cwd:n,relativePath:r,source:i})},catch:e=>new um({message:`Could not load the file diff.`,cause:e})})).pipe(S({staleTime:sm,revalidateOnMount:!0}),w(cm),ee(`vcs:fileDiff:${e}`)));function mm(e){if(e._tag!==`Failure`)return null;let t=b(e.cause);return t instanceof Error?t.message:`File diff query failed.`}function hm(e){let t=(0,pu.c)(13),n;t[0]===e?n=t[1]:(n=pm(e?dm(e):lm),t[0]=e,t[1]=n);let r=n,i=O(r),a;t[2]===r?a=t[3]:(a=()=>D.refresh(r),t[2]=r,t[3]=a);let o=a,s;t[4]===i?s=t[5]:(s=_(x(i)),t[4]=i,t[5]=s);let c;t[6]===i?c=t[7]:(c=mm(i),t[6]=i,t[7]=c);let l;return t[8]!==o||t[9]!==i.waiting||t[10]!==s||t[11]!==c?(l={data:s,error:c,isPending:i.waiting,refresh:o},t[8]=o,t[9]=i.waiting,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}var gm=typeof window>`u`?J.useEffect:J.useLayoutEffect;function _m(e,t,n){let r=e==null?null:(0,Y.jsx)(`div`,{slot:Nt,children:e}),i=t!=null&&n!=null?(0,Y.jsx)(`div`,{slot:Pt,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Y.jsxs)(Y.Fragment,{children:[r,i]})}function vm(e,t){return typeof window>`u`&&t!=null?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Y.jsx)(Y.Fragment,{children:e})}function ym(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function bm(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function xm({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)(null),u=(0,J.useRef)(n.getComposition()),d=(0,J.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,J.useCallback)(()=>{s(null)},[]),m=(0,J.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,J.useMemo)(()=>bm(h,e,f,p,m),[h,p,m,f,e]),_=(0,J.useCallback)(e=>{l(e)},[]);(0,J.useEffect)(()=>{f||s(null)},[f]),gm(()=>{n.setComposition(g)},[g,n]),gm(()=>{if(c!=null)return r!=null&&ym(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=vm(_m(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Y.jsx)(Dt,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function Sm(e){let[t]=(0,J.useState)(()=>new cu(e)),n=(0,J.useRef)({timeout:null,model:t});return(0,J.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function Cm(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Object.is(e[n],t[n]))return!1;return!0}function wm(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function Tm(e,t,n){let r=(0,J.useRef)({hasValue:!1,model:null,selector:null,value:void 0}),i=(0,J.useCallback)(t=>e.subscribe(t),[e]),a=(0,J.useCallback)(()=>{let i=r.current,a=t(e);if(i.model!==e||i.selector!==t||!i.hasValue)return i.hasValue=!0,i.model=e,i.selector=t,i.value=a,a;let o=i.value;return wm(o,a,n)?o:(i.value=a,a)},[n,e,t]);return(0,J.useSyncExternalStore)(i,a,a)}function Em(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&Cm(e.matchingPaths,t.matchingPaths)}function Dm(e){let t=Tm(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),Em);return(0,J.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}var Om=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function km(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=Om(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>oe(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(re,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}var Am=`
|
|
2179
|
+
:host {
|
|
2180
|
+
--trees-bg-override: transparent;
|
|
2181
|
+
--trees-selected-bg-override: color-mix(in srgb, currentColor 12%, transparent);
|
|
2182
|
+
--trees-hover-bg-override: color-mix(in srgb, currentColor 7%, transparent);
|
|
2183
|
+
--trees-border-color-override: color-mix(in srgb, currentColor 14%, transparent);
|
|
2184
|
+
--trees-font-family-override: var(--font-sans);
|
|
2185
|
+
--trees-font-size-override: var(--app-text-xs);
|
|
2186
|
+
}
|
|
2187
|
+
button[data-type='item'] { border-radius: 5px; }
|
|
2188
|
+
`;function jm(e){return e.kind===`directory`?`${e.path}/`:e.path}function Mm(e){let t=(0,pu.c)(14),n;t[0]===e.onRefresh?n=t[1]:(n=(0,Y.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh workspace files`,onClick:e.onRefresh}),t[0]=e.onRefresh,t[1]=n);let r=e.isPending&&`animate-spin`,i;t[2]===r?i=t[3]:(i=d(r),t[2]=r,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,Y.jsx)(mt,{className:i}),t[4]=i,t[5]=a);let o;t[6]!==n||t[7]!==a?(o=(0,Y.jsx)(et,{render:n,children:a}),t[6]=n,t[7]=a,t[8]=o):o=t[8];let s=e.isPending?`Refreshing…`:`Refresh files`,c;t[9]===s?c=t[10]:(c=(0,Y.jsx)(ct,{children:s}),t[9]=s,t[10]=c);let l;return t[11]!==o||t[12]!==c?(l=(0,Y.jsxs)(at,{children:[o,c]}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Nm(e){let t=(0,pu.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):(n=t=>e.onValueChange(t.target.value),r=t=>{t.key===`Escape`&&(e.onClose(),t.currentTarget.blur())},t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==e.ariaLabel||t[4]!==e.name||t[5]!==e.value||t[6]!==n||t[7]!==r?(i=(0,Y.jsx)(_t,{variant:`ghost`,className:`h-7 min-w-0 flex-1 rounded-md`,children:(0,Y.jsx)(z,{type:`search`,name:e.name,size:`sm`,value:e.value,"aria-label":e.ariaLabel,placeholder:`Search files`,spellCheck:!1,onChange:n,onKeyDown:r})}),t[3]=e.ariaLabel,t[4]=e.name,t[5]=e.value,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function Pm({environmentId:e,cwd:t,projectName:n,selectedPath:r,selectedPathRevealId:i,onOpenFile:a}){let{resolvedTheme:o}=pt(),s=Me(),c=it(e,t),l=c.data?.entries??[],u=(0,J.useMemo)(()=>new Map(l.map(e=>[e.path,e.kind])),[l]),d=(0,J.useRef)(u),f=(0,J.useMemo)(()=>l.map(jm),[l]),p=(0,J.useRef)([]),m=(0,J.useRef)(!1),h=(0,J.useRef)(null),g=(0,J.useRef)(null),_=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=e=>{_.current={x:e.clientX,y:e.clientY,at:e.timeStamp}};return document.addEventListener(`contextmenu`,e,!0),()=>document.removeEventListener(`contextmenu`,e,!0)},[]);let v=async(e,t)=>{let n=E();if(!n){t.close();return}let r=e.path.replace(/\/$/,``),i=P(r),a=_.current,o=a!==null&&performance.now()-a.at<1e3,c=t.anchorElement.getBoundingClientRect(),l=o?{x:a.x,y:a.y}:{x:c.left,y:c.bottom};try{let e=await n.contextMenu.show([{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],l);if(e===`copy-mention`){try{await qe(i),We.add({type:`success`,title:`Mention copied`,description:r})}catch(e){We.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=s?.current;if(!e){We.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${i} `,{ensureLeadingBoundary:!0})||We.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{t.close()}},y=(0,J.useRef)(v);(0,J.useEffect)(()=>{y.current=v});let b=(0,J.useRef)(null),x=(0,J.useMemo)(()=>km({deselect:e=>b.current?.getItem(e)?.deselect()}),[]),{model:S}=Sm({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{y.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:1,icons:Je,onSelectionChange:e=>{if(x.handleSelectionChange(e),m.current||x.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&d.current.get(t)===`file`&&(h.current=t,a(t))},paths:[],search:!1,unsafeCSS:Am}),C=Dm(S),w=e=>{if(e.trim().length===0){C.close();return}C.setValue(e)};(0,J.useEffect)(()=>{p.current!==f&&(d.current=u,p.current=f,S.resetPaths(f))},[u,S,f]),(0,J.useEffect)(()=>{if(!r){g.current=null;return}let e={path:r,revealId:i},t=g.current;if(t?.path===e.path&&t.revealId===e.revealId||u.get(r)!==`file`)return;let n=S.getItem(r);if(!n)return;if(S.getSelectedPaths().some(e=>e.replace(/\/$/,``)===r)&&h.current===r){h.current=null,g.current=e;return}h.current=null,g.current=e,m.current=!0,S.closeSearch();for(let e of S.getSelectedPaths())S.getItem(e)?.deselect();let a=r.split(`/`),o=``;for(let e of a.slice(0,-1)){o=o?`${o}/${e}`:e;let t=S.getItem(`${o}/`)??S.getItem(o);t&&`expand`in t&&t.expand()}n.select(),S.scrollToPath(r,{focus:!0,offset:`center`}),queueMicrotask(()=>{m.current=!1})},[u,S,r,i,f]);let T=(0,J.useRef)(null);return(0,J.useEffect)(()=>{b.current=S},[S]),(0,J.useEffect)(()=>{let e=T.current;if(e===null)return;let t=e=>x.handleDragStart(e),n=()=>x.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[x]),(0,Y.jsxs)(`div`,{ref:T,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,children:[(0,Y.jsxs)(`div`,{className:`surface-subheader gap-1 px-2`,"data-surface-subheader":!0,children:[(0,Y.jsx)(Mm,{isPending:c.isPending,onRefresh:c.refresh}),(0,Y.jsx)(Nm,{name:`project-files-search`,ariaLabel:`Search ${n} files`,value:C.value,onValueChange:w,onClose:C.close})]}),c.error&&c.data===null?(0,Y.jsx)(`div`,{className:`p-4 text-xs leading-relaxed text-destructive`,children:c.error}):(0,Y.jsx)(xm,{model:S,"aria-label":`${n} files`,className:`min-h-0 flex-1 overflow-hidden`,style:{colorScheme:o,"--trees-fg-override":`var(--foreground)`}})]})}function Fm(e){let t=(0,pu.c)(24),{diff:n,relativePath:r,isPending:i,error:a,truncated:o}=e,s=o===void 0?!1:o,{resolvedTheme:c}=pt(),l=n??void 0,u=`scm:${c}`,d;t[0]!==l||t[1]!==u?(d=ze(l,u),t[0]=l,t[1]=u,t[2]=d):d=t[2];let f=d;if(a){let e;return t[3]===a?e=t[4]:(e=(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:a}),t[3]=a,t[4]=e),e}let p=f?.kind===`files`&&f.files.length>0;if(!p&&i){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,Y.jsx)(Pe,{className:`size-5 animate-spin`})}),t[5]=e):e=t[5],e}if(f?.kind===`raw`){let e;return t[6]===f.text?e=t[7]:(e=(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,Y.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-ui-11 text-muted-foreground`,children:f.text})}),t[6]=f.text,t[7]=e),e}if(!p){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs text-muted-foreground`,children:`No changes to show for this file.`}),t[8]=e):e=t[8],e}let m;t[9]===s?m=t[10]:(m=s?(0,Y.jsx)(`div`,{className:`shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-ui-11 text-amber-700 dark:text-amber-300`,children:`Diff truncated — this change is too large to display in full.`}):null,t[9]=s,t[10]=m);let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h={overscrollSize:600,intersectionObserverMargin:1200},t[11]=h):h=t[11];let g;if(t[12]!==r||t[13]!==f.files||t[14]!==c){let e;t[16]!==r||t[17]!==c?(e=e=>(0,Y.jsx)(`div`,{className:`diff-render-file mb-2 rounded-md first:mt-2 last:mb-0`,children:(0,Y.jsx)(le,{fileDiff:e,options:{diffStyle:`unified`,lineDiffType:`none`,overflow:`scroll`,theme:Ke(c),themeType:c}})},`${r}:${c}`),t[16]=r,t[17]=c,t[18]=e):e=t[18],g=f.files.map(e),t[12]=r,t[13]=f.files,t[14]=c,t[15]=g}else g=t[15];let _;t[19]===g?_=t[20]:(_=(0,Y.jsx)(N,{className:`diff-render-surface min-h-0 flex-1 overflow-auto px-2 pb-2`,config:h,children:g}),t[19]=g,t[20]=_);let v;return t[21]!==m||t[22]!==_?(v=(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[m,_]}),t[21]=m,t[22]=_,t[23]=v):v=t[23],v}function Im(e,t){let n=t?e.index??null:e.worktree??null;return{path:e.path,origPath:e.origPath??null,status:n?.status??`modified`,staged:t,insertions:n?.insertions??e.insertions,deletions:n?.deletions??e.deletions}}function Lm(e){let t=[],n=[];for(let r of e){let e=r.index??null,i=r.worktree??null;e&&t.push(Im(r,!0)),i&&n.push(Im(r,!1)),!e&&!i&&n.push({path:r.path,origPath:r.origPath??null,status:`modified`,staged:!1,insertions:r.insertions,deletions:r.deletions})}let r=[];return t.length>0&&r.push({id:`staged`,title:`Staged Changes`,entries:t}),n.length>0&&r.push({id:`changes`,title:`Changes`,entries:n}),r}function Rm(e){switch(e){case`modified`:return`M`;case`added`:return`A`;case`deleted`:return`D`;case`renamed`:return`R`;case`copied`:return`C`;case`typechange`:return`T`;case`untracked`:return`U`;case`conflicted`:return`!`}}function zm(e){switch(e){case`modified`:return`Modified`;case`added`:return`Added`;case`deleted`:return`Deleted`;case`renamed`:return`Renamed`;case`copied`:return`Copied`;case`typechange`:return`Type changed`;case`untracked`:return`Untracked`;case`conflicted`:return`Conflicted`}}function Bm(e,t){return e?.find(e=>e.path===t)??null}function Vm(e){return e&&!e.worktree&&e.index?`index`:`worktree`}function Hm(e){return!(!e||e.worktree?.status===`deleted`||!e.worktree&&e.index?.status===`deleted`)}function Um(e){return e?`${e.index?`${e.index.status}:${e.index.insertions}:${e.index.deletions}`:`-`}|${e.worktree?`${e.worktree.status}:${e.worktree.insertions}:${e.worktree.deletions}`:`-`}`:`none`}function Wm(e){switch(e){case`added`:case`untracked`:return`text-emerald-600 dark:text-emerald-400`;case`deleted`:return`text-rose-600 dark:text-rose-400`;case`renamed`:case`copied`:return`text-sky-600 dark:text-sky-400`;case`conflicted`:return`text-orange-600 dark:text-orange-400`;case`typechange`:return`text-violet-600 dark:text-violet-400`;case`modified`:return`text-amber-600 dark:text-amber-400`}}function Gm(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t+1),name:e.slice(t+1)}}function Km({environmentId:e,cwd:t,files:n,isPending:r,activePath:i,activeSource:a,onOpenChangedFile:o}){let{resolvedTheme:s}=pt(),c=(0,J.useMemo)(()=>Lm(n),[n]),[l,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(null),m=h(nt.refreshStatus,{reportFailure:!1}),g=(0,J.useCallback)(async(n,r,i)=>{if(r.length!==0){d(!0);try{let i=Re(e).vcs,a={cwd:t,paths:[...r]};n===`stage`?await i.stagePaths(a):n===`unstage`?await i.unstagePaths(a):await i.discardPaths(a)}catch(e){We.add(Ie({type:`error`,title:i,description:e instanceof Error?e.message:`An error occurred.`}))}finally{m({environmentId:e,input:{cwd:t}}),d(!1)}}},[t,e,m]),_=(0,J.useCallback)(e=>void g(`stage`,e,`Could not stage changes`),[g]),v=(0,J.useCallback)(e=>void g(`unstage`,e,`Could not unstage changes`),[g]),y=(0,J.useCallback)((e,t)=>{e.length!==0&&p({paths:[...e],description:t})},[]),b=(0,J.useCallback)(()=>{f&&(g(`discard`,f.paths,`Could not discard changes`),p(null))},[f,g]);return n.length===0?(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-6 text-center text-muted-foreground`,children:r?(0,Y.jsx)(Pe,{className:`size-5 animate-spin`}):(0,Y.jsx)(`p`,{className:`text-xs`,children:`No changes — your working tree is clean.`})}):(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto py-1`,children:c.map(e=>{let t=e.entries.map(e=>e.path);return(0,Y.jsxs)(`div`,{className:`mb-1`,children:[(0,Y.jsxs)(`div`,{className:`surface-subheader sticky top-0 z-10 gap-1 bg-background/95 px-3 backdrop-blur`,children:[(0,Y.jsxs)(`span`,{className:`flex-1 truncate font-medium text-ui-11 text-muted-foreground uppercase tracking-wide`,children:[e.title,(0,Y.jsx)(`span`,{className:`ml-1.5 text-muted-foreground/60`,children:e.entries.length})]}),(0,Y.jsx)(qm,{groupId:e.id,disabled:l,onStageAll:()=>_(t),onUnstageAll:()=>v(t),onDiscardAll:()=>y(t,`Discard all changes in “Changes” (${t.length} file${t.length===1?``:`s`})?`)})]}),(0,Y.jsx)(`ul`,{children:e.entries.map(t=>(0,Y.jsx)(Jm,{entry:t,theme:s,active:i===t.path&&(a===null||a===(t.staged?`index`:`worktree`)),disabled:l,onOpen:()=>o(t.path,t.staged?`index`:`worktree`),onStage:()=>_([t.path]),onUnstage:()=>v([t.path]),onDiscard:()=>y([t.path],`Discard changes to “${t.path}”? This cannot be undone.`)},`${e.id}:${t.path}`))})]},e.id)})}),(0,Y.jsx)(wt,{open:f!==null,onOpenChange:e=>{e||p(null)},children:(0,Y.jsxs)(xt,{children:[(0,Y.jsxs)(vt,{children:[(0,Y.jsx)(Ct,{children:`Discard changes?`}),(0,Y.jsxs)(St,{children:[f?.description,` Discarded changes cannot be recovered.`]})]}),(0,Y.jsxs)(yt,{children:[(0,Y.jsx)(bt,{render:(0,Y.jsx)(u,{variant:`outline`,children:`Cancel`})}),(0,Y.jsx)(u,{variant:`destructive`,onClick:b,children:`Discard changes`})]})]})})]})}function qm(e){let t=(0,pu.c)(15),{groupId:n,disabled:r,onStageAll:i,onUnstageAll:a,onDiscardAll:o}=e;if(n===`staged`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(Le,{className:`size-3.5`}),t[0]=e):e=t[0];let n;return t[1]!==r||t[2]!==a?(n=(0,Y.jsx)(Ym,{label:`Unstage all changes`,disabled:r,onClick:a,children:e}),t[1]=r,t[2]=a,t[3]=n):n=t[3],n}let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(Be,{className:`size-3.5`}),t[4]=s):s=t[4];let c;t[5]!==r||t[6]!==o?(c=(0,Y.jsx)(Ym,{label:`Discard all changes`,disabled:r,onClick:o,children:s}),t[5]=r,t[6]=o,t[7]=c):c=t[7];let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(Ue,{className:`size-3.5`}),t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==i?(u=(0,Y.jsx)(Ym,{label:`Stage all changes`,disabled:r,onClick:i,children:l}),t[9]=r,t[10]=i,t[11]=u):u=t[11];let d;return t[12]!==c||t[13]!==u?(d=(0,Y.jsxs)(Y.Fragment,{children:[c,u]}),t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function Jm(e){let t=(0,pu.c)(42),{entry:n,theme:r,active:i,disabled:a,onOpen:o,onStage:s,onUnstage:c,onDiscard:l}=e,u;t[0]===n.path?u=t[1]:(u=Gm(n.path),t[0]=n.path,t[1]=u);let{dir:f,name:p}=u,m=n.origPath?`${n.origPath} → ${n.path}`:n.path,h=i&&`bg-muted`,g;t[2]===h?g=t[3]:(g=d(`group/scm-row flex h-7 cursor-pointer items-center gap-1.5 px-3 text-xs hover:bg-muted/60`,h),t[2]=h,t[3]=g);let _;t[4]!==n.path||t[5]!==r?(_=(0,Y.jsx)(R,{pathValue:n.path,kind:`file`,theme:r,className:`size-3.5`}),t[4]=n.path,t[5]=r,t[6]=_):_=t[6];let v;t[7]===p?v=t[8]:(v=(0,Y.jsx)(`span`,{className:`text-foreground`,children:p}),t[7]=p,t[8]=v);let y;t[9]===f?y=t[10]:(y=f?(0,Y.jsx)(`span`,{className:`ml-1.5 text-ui-11 text-muted-foreground/70`,children:f}):null,t[9]=f,t[10]=y);let b;t[11]!==v||t[12]!==y?(b=(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[v,y]}),t[11]=v,t[12]=y,t[13]=b):b=t[13];let x;t[14]!==a||t[15]!==n.staged||t[16]!==l||t[17]!==s||t[18]!==c?(x=(0,Y.jsx)(`span`,{className:`hidden items-center gap-0.5 group-hover/scm-row:flex`,children:n.staged?(0,Y.jsx)(Ym,{label:`Unstage`,disabled:a,onClick:c,children:(0,Y.jsx)(Le,{className:`size-3.5`})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ym,{label:`Discard`,disabled:a,onClick:l,children:(0,Y.jsx)(Be,{className:`size-3.5`})}),(0,Y.jsx)(Ym,{label:`Stage`,disabled:a,onClick:s,children:(0,Y.jsx)(Ue,{className:`size-3.5`})})]})}),t[14]=a,t[15]=n.staged,t[16]=l,t[17]=s,t[18]=c,t[19]=x):x=t[19];let S;t[20]===n.status?S=t[21]:(S=d(`w-4 shrink-0 text-center font-semibold text-ui-11`,Wm(n.status)),t[20]=n.status,t[21]=S);let C;t[22]===n.status?C=t[23]:(C=Rm(n.status),t[22]=n.status,t[23]=C);let w;t[24]!==C||t[25]!==S?(w=(0,Y.jsx)(et,{render:(0,Y.jsx)(`span`,{className:S,children:C})}),t[24]=C,t[25]=S,t[26]=w):w=t[26];let T;t[27]===n.status?T=t[28]:(T=zm(n.status),t[27]=n.status,t[28]=T);let E;t[29]===T?E=t[30]:(E=(0,Y.jsx)(ct,{children:T}),t[29]=T,t[30]=E);let D;t[31]!==w||t[32]!==E?(D=(0,Y.jsxs)(at,{children:[w,E]}),t[31]=w,t[32]=E,t[33]=D):D=t[33];let O;return t[34]!==o||t[35]!==D||t[36]!==g||t[37]!==_||t[38]!==b||t[39]!==x||t[40]!==m?(O=(0,Y.jsxs)(`li`,{className:g,onClick:o,title:m,children:[_,b,x,D]}),t[34]=o,t[35]=D,t[36]=g,t[37]=_,t[38]=b,t[39]=x,t[40]=m,t[41]=O):O=t[41],O}function Ym(e){let t=(0,pu.c)(12),{label:n,disabled:r,onClick:i,children:a}=e,o;t[0]===i?o=t[1]:(o=e=>{e.stopPropagation(),i()},t[0]=i,t[1]=o);let s;t[2]!==a||t[3]!==r||t[4]!==n||t[5]!==o?(s=(0,Y.jsx)(et,{render:(0,Y.jsx)(`button`,{type:`button`,className:`inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:bg-foreground/10 hover:text-foreground focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50`,"aria-label":n,disabled:r,onClick:o,children:a})}),t[2]=a,t[3]=r,t[4]=n,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n?c=t[8]:(c=(0,Y.jsx)(ct,{children:n}),t[7]=n,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Y.jsxs)(at,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Xm({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function Zm(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function Qm({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||Xm({root:e,editor:t,onDismiss:r})},a=i=>{i.key!==`Escape`||n()||!Zm(e)||(i.preventDefault(),i.stopImmediatePropagation(),Xm({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function $m(e){let t=e.renderedLine===void 0?e.fileTop+e.estimatedLine.top:e.scrollTop+e.renderedLine.top-e.viewportTop,n=e.renderedLine?.height??e.estimatedLine.height,r=Math.max(0,t-Math.max(0,(e.viewportHeight-n)/2));return Math.min(r,Math.max(0,e.scrollHeight-e.viewportHeight))}function eh(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function th(e,t,n){return`${e}:${t}:${eh(n)}`}function nh(e,t,n,r,i){return i?.contents===r&&i.cacheKey?i.cacheKey:`editor:${e}:${th(t,n,r)}`}function rh(e,t){let n=t.split(`/`).filter(Boolean);return[{label:e,path:``,kind:`project`},...n.map((e,t)=>({label:e,path:n.slice(0,t+1).join(`/`),kind:t===n.length-1?`file`:`directory`}))]}var ih=e=>/\.(?:md|mdx)$/i.test(e);function ah(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}var oh=`t3code.fileExplorerOpen`,sh=`t3code.fileExplorerMode`,ch=`dascode.renderMarkdown`,lh=500,uh=[],dh=`data-file-link-reveal`,fh=`
|
|
2189
|
+
[${dh}][data-line] {
|
|
2190
|
+
background-color: light-dark(
|
|
2191
|
+
color-mix(
|
|
2192
|
+
in lab,
|
|
2193
|
+
var(--diffs-computed-diff-line-bg) 82%,
|
|
2194
|
+
var(--diffs-bg-selection-override, var(--diffs-selection-base))
|
|
2195
|
+
),
|
|
2196
|
+
color-mix(
|
|
2197
|
+
in lab,
|
|
2198
|
+
var(--diffs-computed-diff-line-bg) 75%,
|
|
2199
|
+
var(--diffs-bg-selection-override, var(--diffs-selection-base))
|
|
2200
|
+
)
|
|
2201
|
+
) !important;
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
[${dh}][data-column-number] {
|
|
2205
|
+
background-color: light-dark(
|
|
2206
|
+
color-mix(
|
|
2207
|
+
in lab,
|
|
2208
|
+
var(--diffs-computed-diff-line-bg) 75%,
|
|
2209
|
+
var(--diffs-bg-selection-number-override, var(--diffs-selection-base))
|
|
2210
|
+
),
|
|
2211
|
+
color-mix(
|
|
2212
|
+
in lab,
|
|
2213
|
+
var(--diffs-computed-diff-line-bg) 60%,
|
|
2214
|
+
var(--diffs-bg-selection-number-override, var(--diffs-selection-base))
|
|
2215
|
+
)
|
|
2216
|
+
) !important;
|
|
2217
|
+
color: var(--diffs-selection-number-fg) !important;
|
|
2218
|
+
}
|
|
2219
|
+
`;function ph(e){let t=(0,pu.c)(8),n;t[0]!==e.absolutePath||t[1]!==e.threadRef.threadId?(n={_tag:`workspace-file`,threadId:e.threadRef.threadId,path:e.absolutePath},t[0]=e.absolutePath,t[1]=e.threadRef.threadId,t[2]=n):n=t[2];let r=je(e.environmentId,n),[i,a]=(0,J.useState)(null);if(r._tag===`Failure`||r._tag===`Success`&&i===r.url){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[3]=e):e=t[3],e}let o;return t[4]!==r._tag||t[5]!==r.url||t[6]!==e.alt?(o=r._tag===`Success`?(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,Y.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:r.url,alt:e.alt,onError:()=>a(r.url)})}):(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,Y.jsx)(Pe,{className:`size-5 animate-spin`})}),t[4]=r._tag,t[5]=r.url,t[6]=e.alt,t[7]=o):o=t[7],o}function mh(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function hh(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${dh}]`))e.removeAttribute(dh);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(dh,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(dh,``))}var gh=30,_h=20,vh=2;function yh(e,t,n){let r=(0,pu.c)(5),[i]=(0,J.useState)(bh),a;return r[0]!==e||r[1]!==t||r[2]!==n||r[3]!==i?(a=(r,a,o)=>{if(e===null)return;let s=i.get(e),c=s??{frameId:null,cancelGuard:null,handledRequestId:null,latestRequestId:null};s||i.set(e,c);let l=()=>{c.frameId!==null&&(cancelAnimationFrame(c.frameId),c.frameId=null),c.cancelGuard?.()};if(o===`unmount`){l();return}let u=a.file?.contents;if(hh(r,t===null||u===void 0?null:mh(u,t)),!(a instanceof Oe))return;if(c.latestRequestId!==n&&(l(),c.latestRequestId=n,c.handledRequestId=null),t===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);if(!d||(r.style.minHeight=`${Math.ceil(Math.max(a.height,d.clientHeight))}px`,c.handledRequestId===n||c.frameId!==null))return;let f=e=>{let t=a.getLinePosition(e);if(!t)return null;let n=d.getBoundingClientRect(),i=d.scrollTop+r.getBoundingClientRect().top-n.top,o=(r.shadowRoot??r).querySelector(`[data-line="${e}"]`)?.getBoundingClientRect();return $m({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,viewportTop:n.top,viewportHeight:d.clientHeight,fileTop:i,estimatedLine:t,...o&&o.height>0?{renderedLine:{top:o.top,height:o.height}}:{}})},p=e=>{let t=_h,n=null,r=()=>{n!==null&&(cancelAnimationFrame(n),n=null),d.removeEventListener(`wheel`,r),d.removeEventListener(`touchstart`,r),d.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,r,!0),c.cancelGuard===r&&(c.cancelGuard=null)};d.addEventListener(`wheel`,r,{passive:!0}),d.addEventListener(`touchstart`,r,{passive:!0}),d.addEventListener(`pointerdown`,r,{passive:!0,capture:!0}),window.addEventListener(`keydown`,r,!0);let i=()=>{if(n=null,--t,t<=0||!d.isConnected){r();return}let a=f(e);a!==null&&Math.abs(d.scrollTop-a)>vh&&(d.scrollTop=a),n=requestAnimationFrame(i)};n=requestAnimationFrame(i),c.cancelGuard=r},m=e=>{c.frameId=requestAnimationFrame(()=>{if(c.frameId=null,c.latestRequestId!==n||!r.isConnected)return;let i=a.file?.contents,o=i===void 0?null:mh(i,t),s=o===null?null:f(o);if(o===null||s===null){e<gh&&m(e+1);return}hh(r,o),d.scrollTop=s,c.handledRequestId=n,p(o)})};m(0)},r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a):a=r[4],a}function bh(){return new Map}function xh({environmentId:e,cwd:t,relativePath:n,onPendingChange:r,onSaved:i}){let a=(0,J.useRef)(i);a.current=i;let o=h(ye.writeFile),s=h(nt.refreshStatus,{reportFailure:!1}),c=(0,J.useMemo)(()=>new ft({debounceMs:lh,onPendingChange:e=>r(n,e),persist:r=>o({environmentId:e,input:{cwd:t,relativePath:n,contents:r}}),onConfirmed:r=>{Ae(e,t,n,r),s({environmentId:e,input:{cwd:t}}),a.current?.()}}),[t,e,r,s,n,o]);return(0,J.useEffect)(()=>()=>c.dispose(),[c]),c}function Sh(e){let t=(0,pu.c)(79),{environmentId:n,cwd:r,relativePath:i,composerDraftTarget:a,contents:s,resolvedTheme:l,revealRequestId:u,wordWrap:d,onPostRender:f,onPendingChange:p,onSaved:m}=e,h=o(kh),g=o(Oh),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],t[0]=_):_=t[0];let[v,y]=(0,J.useState)(_),[b,x]=(0,J.useState)(null),S=b?.revealRequestId===u?b.range:null,C;t[1]===u?C=t[2]:(C=e=>{x({revealRequestId:u,range:e})},t[1]=u,t[2]=C);let w=C,T=(0,J.useRef)(null),E=(0,J.useRef)(null),D;t[3]===m?D=t[4]:(D=m?{onSaved:m}:{},t[3]=m,t[4]=D);let O;t[5]!==r||t[6]!==n||t[7]!==p||t[8]!==i||t[9]!==D?(O={environmentId:n,cwd:r,relativePath:i,onPendingChange:p,...D},t[5]=r,t[6]=n,t[7]=p,t[8]=i,t[9]=D,t[10]=O):O=t[10];let ee=xh(O),k;t[11]!==h||t[12]!==a||t[13]!==r||t[14]!==n||t[15]!==i||t[16]!==ee?(k=new om({persistState:!0,persistStateStorage:`inMemory`,onChange:(e,t)=>{if(lt(n,r,i,e.contents),ee.change(e.contents),t){let n=I(t);y(n);for(let t of n)for(let n of t.metadata.entries)n.kind===`comment`&&h(a,c({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:n.text,contents:e.contents}))}}}),t[11]=h,t[12]=a,t[13]=r,t[14]=n,t[15]=i,t[16]=ee,t[17]=k):k=t[17];let A=k,M,P;t[18]===A?(M=t[19],P=t[20]):(M=()=>()=>{A.cleanUp()},P=[A],t[18]=A,t[19]=M,t[20]=P),(0,J.useEffect)(M,P);let te;t[21]!==a||t[22]!==g||t[23]!==w?(te=e=>{w(null),g(a,e),y(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},t[21]=a,t[22]=g,t[23]=w,t[24]=te):te=t[24];let ne=te,re;t[25]!==h||t[26]!==a||t[27]!==s||t[28]!==v||t[29]!==i||t[30]!==w?(re=(e,t)=>{w(null);let n=v.flatMap(Dh).find(t=>t.id===e);n&&h(a,c({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:t,contents:s})),y(n=>n.map(n=>({...n,metadata:{entries:n.metadata.entries.map(n=>n.id===e?{...n,kind:`comment`,text:t}:n)}})))},t[25]=h,t[26]=a,t[27]=s,t[28]=v,t[29]=i,t[30]=w,t[31]=re):re=t[31];let ie=re,ae;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{let{startLine:t,endLine:n}=De(e),r={id:Te(),kind:`draft`,startLine:t,endLine:n,text:``};y(e=>{let t=e.flatMap(Th),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},t[32]=ae):ae=t[32];let oe=ae,se;t[33]===v?se=t[34]:(se=v.some(Ch),t[33]=v,t[34]=se);let ce=se,le,ue;t[35]!==A||t[36]!==ce||t[37]!==w?(le=()=>{let e=T.current;if(e)return Qm({root:e,editor:A,isBlocked:()=>ce,onDismiss:()=>w(null)})},ue=[A,ce,w],t[35]=A,t[36]=ce,t[37]=w,t[38]=le,t[39]=ue):(le=t[38],ue=t[39]),(0,J.useEffect)(le,ue);let F;t[40]===w?F=t[41]:(F=e=>{w(e),e&&oe(e)},t[40]=w,t[41]=F);let de=F,fe;t[42]!==f||t[43]!==S?(fe=(e,t,n)=>{f(e,t,n),E.current!==null&&(cancelAnimationFrame(E.current),E.current=null),n!==`unmount`&&(E.current=requestAnimationFrame(()=>{E.current=null,e.isConnected&&t.setSelectedLines(S,{notify:!1})}))},t[42]=f,t[43]=S,t[44]=fe):fe=t[44];let pe=fe,me;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(me={overscrollSize:600,intersectionObserverMargin:1200},t[45]=me):me=t[45];let he;t[46]!==s||t[47]!==r||t[48]!==A||t[49]!==n||t[50]!==i?(he=nh(n,r,i,s,A.getFile()),t[46]=s,t[47]=r,t[48]=A,t[49]=n,t[50]=i,t[51]=he):he=t[51];let ge;t[52]!==s||t[53]!==i||t[54]!==he?(ge={name:i,contents:s,cacheKey:he},t[52]=s,t[53]=i,t[54]=he,t[55]=ge):ge=t[55];let _e=!ce,ve=!ce,ye=d?`wrap`:`scroll`,be;t[56]===l?be=t[57]:(be=Ke(l),t[56]=l,t[57]=be);let xe;t[58]!==de||t[59]!==pe||t[60]!==l||t[61]!==w||t[62]!==_e||t[63]!==ve||t[64]!==ye||t[65]!==be?(xe={disableFileHeader:!0,enableGutterUtility:_e,enableLineSelection:ve,onGutterUtilityClick:w,onLineSelectionChange:w,onLineSelectionEnd:de,overflow:ye,theme:be,themeType:l,unsafeCSS:fh,onPostRender:pe},t[58]=de,t[59]=pe,t[60]=l,t[61]=w,t[62]=_e,t[63]=ve,t[64]=ye,t[65]=be,t[66]=xe):xe=t[66];let Se;t[67]!==ne||t[68]!==ie?(Se=e=>(0,Y.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,Y.jsx)(Ce,{kind:e.kind,rangeLabel:ke(e.startLine,e.endLine),text:e.text,onCancel:()=>ne(e.id),onComment:t=>ie(e.id,t),onDelete:()=>ne(e.id)},e.id))}),t[67]=ne,t[68]=ie,t[69]=Se):Se=t[69];let we;t[70]!==v||t[71]!==S||t[72]!==ge||t[73]!==xe||t[74]!==Se?(we=(0,Y.jsx)(`div`,{ref:T,className:`flex min-h-0 flex-1`,children:(0,Y.jsx)(N,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:me,children:(0,Y.jsx)(fu,{file:ge,options:xe,selectedLines:S,lineAnnotations:v,renderAnnotation:Se,className:`min-h-full`,contentEditable:!0})})}),t[70]=v,t[71]=S,t[72]=ge,t[73]=xe,t[74]=Se,t[75]=we):we=t[75];let Ee;return t[76]!==A||t[77]!==we?(Ee=(0,Y.jsx)(j,{editor:A,children:we}),t[76]=A,t[77]=we,t[78]=Ee):Ee=t[78],Ee}function Ch(e){return e.metadata.entries.some(wh)}function wh(e){return e.kind===`draft`}function Th(e){let t=e.metadata.entries.filter(Eh);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function Eh(e){return e.kind!==`draft`}function Dh(e){return e.metadata.entries}function Oh(e){return e.removeReviewComment}function kh(e){return e.addReviewComment}function Ah(e){let t=(0,pu.c)(19),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,onPendingChange:s,onSaved:c}=e,l;t[0]===c?l=t[1]:(l=c?{onSaved:c}:{},t[0]=c,t[1]=l);let u;t[2]!==r||t[3]!==n||t[4]!==s||t[5]!==i||t[6]!==l?(u={environmentId:n,cwd:r,relativePath:i,onPendingChange:s,...l},t[2]=r,t[3]=n,t[4]=s,t[5]=i,t[6]=l,t[7]=u):u=t[7];let d=xh(u),f;t[8]!==a||t[9]!==r||t[10]!==n||t[11]!==i||t[12]!==d?(f=e=>{let{markerOffset:t,checked:o}=e,s=Ze(n,r,i)?.contents??a,c=ah(s,t,o);c!==s&&(lt(n,r,i,c),d.change(c))},t[8]=a,t[9]=r,t[10]=n,t[11]=i,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==a||t[15]!==r||t[16]!==f||t[17]!==o?(p=(0,Y.jsx)(Ne,{className:`min-h-0 flex-1`,children:(0,Y.jsx)(ae,{text:a,cwd:r,threadRef:o,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:f})}),t[14]=a,t[15]=r,t[16]=f,t[17]=o,t[18]=p):p=t[18],p}function jh(){try{return f(oh,y)??!0}catch(e){return console.error(e),!0}}function Mh(){try{return window.localStorage.getItem(sh)===`git`?`git`:`files`}catch{return`files`}}function Nh(e){let t=(0,pu.c)(114),{environmentId:n,cwd:r,projectName:a,relativePath:o,threadRef:s,composerDraftTarget:c,keybindings:u,availableEditors:f,revealLine:g,revealRequestId:_,onOpenFile:v,onPendingChange:b}=e,{resolvedTheme:x}=pt(),S=ve(Ih),C=ge(),w=_e(n),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T={reportFailure:!1},t[0]=T):T=t[0];let E=He(ut.createUrl,T),D;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(D={reportFailure:!1},t[1]=D):D=t[1];let O=h(Ve.open,D),ee;t[2]===o?ee=t[3]:(ee=o!==null&&gu(o),t[2]=o,t[3]=ee);let j=ee,M=L(n,r,o,!j),[P,re]=(0,J.useState)(jh),[ae,oe]=l(ch,!1,y),[se,ce]=(0,J.useState)(null),le=(0,J.useRef)(null),ue;t[4]===o?ue=t[5]:(ue=o?ih(o):!1,t[4]=o,t[5]=ue);let F=ue,de=F&&ae&&(g===null||se?.path===o&&se.requestId===_),fe;t[6]===o?fe=t[7]:(fe=o!==null&&ot()&&ie(o),t[6]=o,t[7]=fe);let pe=fe,me;t[8]!==r||t[9]!==o?(me=o?A(o,r):null,t[8]=r,t[9]=o,t[10]=me):me=t[10];let ye=me,be;t[11]!==a||t[12]!==o?(be=o?rh(a,o):[],t[11]=a,t[12]=o,t[13]=be):be=t[13];let xe=be,Se=yh(o,g,_),[Ce,we]=(0,J.useState)(Mh),[I,Te]=(0,J.useState)(`edit`),[Ee,De]=(0,J.useState)(`worktree`),[Oe,ke]=(0,J.useState)(0),Ae=(0,J.useRef)(null),je;t[14]!==r||t[15]!==n?(je=nt.status({environmentId:n,input:{cwd:r}}),t[14]=r,t[15]=n,t[16]=je):je=t[16];let Me=k(je),Fe=Me.data?.workingTree.files??uh,Le=Me.data?.isRepo??!1,Re=Le?Ce:`files`,ze,Be,Ue,qe,Je;if(t[17]!==r||t[18]!==Oe||t[19]!==Ee||t[20]!==n||t[21]!==I||t[22]!==o||t[23]!==Fe){let e=o?Bm(Fe,o):null;Ue=e!==null,ze=Hm(e),qe=Ue?ze?I:`diff`:`edit`;let i=!!e?.index,a=!!e?.worktree;Be=Ee===`index`&&i?`index`:Ee===`worktree`&&a?`worktree`:Vm(e),Je=Ue&&qe===`diff`&&o?{environmentId:n,cwd:r,relativePath:o,source:Be,revision:`${Um(e)}#${Oe}`}:null,t[17]=r,t[18]=Oe,t[19]=Ee,t[20]=n,t[21]=I,t[22]=o,t[23]=Fe,t[24]=ze,t[25]=Be,t[26]=Ue,t[27]=qe,t[28]=Je}else ze=t[24],Be=t[25],Ue=t[26],qe=t[27],Je=t[28];let Ye=hm(Je),Xe=Ue&&qe===`diff`?Be:null,Ze;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=e=>{we(e);try{window.localStorage.setItem(sh,e)}catch{}},t[29]=Ze):Ze=t[29];let Qe=Ze,$e;t[30]===v?$e=t[31]:($e=(e,t)=>{Ae.current={path:e,mode:`diff`},De(t),Te(`diff`),v(e)},t[30]=v,t[31]=$e);let tt=$e,it;t[32]===v?it=t[33]:(it=e=>{Ae.current={path:e,mode:`edit`},Te(`edit`),v(e)},t[32]=v,t[33]=it);let st=it,R,lt;t[34]===o?(R=t[35],lt=t[36]):(R=()=>{if(!o)return;let e=Ae.current;Ae.current=null,Te(e&&e.path===o?e.mode:`edit`)},lt=[o],t[34]=o,t[35]=R,t[36]=lt),(0,J.useEffect)(R,lt);let dt;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(dt=()=>ke(Fh),t[37]=dt):dt=t[37];let ft=dt,mt;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>{(le.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},t[38]=mt):mt=t[38];let ht;t[39]===o?ht=t[40]:(ht=[o],t[39]=o,t[40]=ht),(0,J.useEffect)(mt,ht);let z;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>{re(Ph)},t[41]=z):z=t[41];let _t=z,vt;t[42]!==ye||t[43]!==E||t[44]!==w||t[45]!==O||t[46]!==s?(vt=()=>{!ye||!w||(async()=>{let e=await ne({threadRef:s,filePath:ye,httpBaseUrl:w,createAssetUrl:E,openPreview:O});if(e._tag===`Success`||m(e))return;let t=p(e);We.add(Ie({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},t[42]=ye,t[43]=E,t[44]=w,t[45]=O,t[46]=s,t[47]=vt):vt=t[47];let yt=vt,bt;t[48]!==ye||t[49]!==f||t[50]!==xe||t[51]!==ze||t[52]!==pe||t[53]!==n||t[54]!==P||t[55]!==Ue||t[56]!==yt||t[57]!==F||t[58]!==u||t[59]!==C||t[60]!==a||t[61]!==o||t[62]!==de||t[63]!==qe||t[64]!==_||t[65]!==oe?(bt=o?(0,Y.jsxs)(`div`,{className:`surface-subheader gap-2 px-3`,"data-surface-subheader":!0,children:[(0,Y.jsx)(Ne,{ref:le,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1 rounded-none`,"data-file-breadcrumbs":!0,children:(0,Y.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:xe.map((e,t)=>(0,Y.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":e.kind===`file`,children:[t>0?(0,Y.jsx)(i,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,(0,Y.jsx)(`span`,{className:d(`max-w-40 truncate`,e.kind===`file`?`font-medium text-foreground`:`text-muted-foreground`),title:e.path||a,children:e.label})]},e.path||`project`))})}),ye&&n===C?(0,Y.jsx)(te,{environmentId:n,keybindings:u,availableEditors:f,openInCwd:ye,compact:!0,enableShortcut:!1}):null,F?(0,Y.jsxs)(at,{children:[(0,Y.jsx)(et,{render:(0,Y.jsx)(gt,{className:`shrink-0`,pressed:de,onPressedChange:e=>{oe(e),ce(e&&o!==null?{path:o,requestId:_}:null)},"aria-label":de?`Show markdown source`:`Show rendered markdown`,variant:`ghost`,size:`sm`,children:de?(0,Y.jsx)(Tt,{className:`size-3.5`}):(0,Y.jsx)(he,{className:`size-3.5`})})}),(0,Y.jsx)(ct,{children:de?`Show markdown source`:`Show rendered markdown`})]}):null,pe?(0,Y.jsxs)(at,{children:[(0,Y.jsx)(et,{render:(0,Y.jsx)(gt,{className:`shrink-0`,pressed:!1,onPressedChange:yt,"aria-label":`Open file in preview browser`,variant:`ghost`,size:`sm`,children:(0,Y.jsx)(rt,{className:`size-3.5`})})}),(0,Y.jsx)(ct,{children:`Open file in preview browser`})]}):null,Ue?(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded-md border border-border/60 p-0.5 text-ui-11`,children:[(0,Y.jsx)(`button`,{type:`button`,className:d(`rounded-sm px-1.5 py-0.5 transition-colors`,qe===`diff`?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),"aria-pressed":qe===`diff`,onClick:()=>Te(`diff`),children:`Diff`}),(0,Y.jsx)(`button`,{type:`button`,className:d(`rounded-sm px-1.5 py-0.5 transition-colors disabled:opacity-50`,qe===`edit`?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),"aria-pressed":qe===`edit`,disabled:!ze,title:ze?void 0:`This file has no editable working-tree version`,onClick:()=>Te(`edit`),children:`Edit`})]}):null,(0,Y.jsxs)(at,{children:[(0,Y.jsx)(et,{render:(0,Y.jsx)(gt,{className:`shrink-0`,pressed:P,onPressedChange:_t,"aria-label":P?`Hide file explorer`:`Show file explorer`,variant:`ghost`,size:`sm`,children:(0,Y.jsx)(Et,{className:`size-3.5`})})}),(0,Y.jsx)(ct,{children:P?`Hide file explorer`:`Show file explorer`})]})]}):null,t[48]=ye,t[49]=f,t[50]=xe,t[51]=ze,t[52]=pe,t[53]=n,t[54]=P,t[55]=Ue,t[56]=yt,t[57]=F,t[58]=u,t[59]=C,t[60]=a,t[61]=o,t[62]=de,t[63]=qe,t[64]=_,t[65]=oe,t[66]=bt):bt=t[66];let xt;t[67]!==M||t[68]!==o?(xt=o&&M.data?.truncated?(0,Y.jsxs)(`div`,{className:`shrink-0 border-b border-amber-500/20 bg-amber-500/8 px-3 py-1.5 text-ui-11 text-amber-700 dark:text-amber-300`,children:[`Preview limited to the first 1 MB of a `,M.data.byteLength.toLocaleString(),` byte file.`]}):null,t[67]=M,t[68]=o,t[69]=xt):xt=t[69];let St=o?`flex`:`hidden`,Ct;t[70]===St?Ct=t[71]:(Ct=d(`min-w-0 flex-1 flex-col overflow-hidden`,St),t[70]=St,t[71]=Ct);let wt;t[72]!==ye||t[73]!==c||t[74]!==r||t[75]!==n||t[76]!==M||t[77]!==Ye||t[78]!==j||t[79]!==F||t[80]!==Se||t[81]!==b||t[82]!==o||t[83]!==de||t[84]!==qe||t[85]!==x||t[86]!==_||t[87]!==s||t[88]!==S?(wt=o&&qe===`diff`?(0,Y.jsx)(Fm,{diff:Ye.data?.diff??null,relativePath:o,isPending:Ye.isPending,error:Ye.error,truncated:Ye.data?.truncated??!1}):o&&j&&ye?(0,Y.jsx)(ph,{environmentId:n,threadRef:s,absolutePath:ye,alt:o},ye):o&&M.error&&M.data===null?(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:M.error}):o&&M.data===null?(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,Y.jsx)(Pe,{className:`size-5 animate-spin`})}):o&&M.data?F&&de?(0,Y.jsx)(Ah,{environmentId:n,cwd:r,relativePath:o,threadRef:s,contents:M.data.contents,onPendingChange:b,onSaved:ft}):M.data.truncated?(0,Y.jsx)(N,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:(0,Y.jsx)(fu,{file:{name:o,contents:M.data.contents,cacheKey:th(r,o,M.data.contents)},options:{disableFileHeader:!0,overflow:S?`wrap`:`scroll`,theme:Ke(x),themeType:x,unsafeCSS:fh,onPostRender:Se},className:`min-h-full`})},`${o}:${x}:${M.data.byteLength}`):(0,Y.jsx)(Sh,{environmentId:n,cwd:r,relativePath:o,composerDraftTarget:c,contents:M.data.contents,resolvedTheme:x,revealRequestId:_,wordWrap:S,onPostRender:Se,onPendingChange:b,onSaved:ft},`${o}:${x}`):null,t[72]=ye,t[73]=c,t[74]=r,t[75]=n,t[76]=M,t[77]=Ye,t[78]=j,t[79]=F,t[80]=Se,t[81]=b,t[82]=o,t[83]=de,t[84]=qe,t[85]=x,t[86]=_,t[87]=s,t[88]=S,t[89]=wt):wt=t[89];let Dt;t[90]!==Ct||t[91]!==wt?(Dt=(0,Y.jsx)(`div`,{className:Ct,children:wt}),t[90]=Ct,t[91]=wt,t[92]=Dt):Dt=t[92];let Ot;t[93]!==Xe||t[94]!==r||t[95]!==Re||t[96]!==n||t[97]!==P||t[98]!==Le||t[99]!==tt||t[100]!==st||t[101]!==a||t[102]!==o||t[103]!==_||t[104]!==Fe||t[105]!==Me.isPending?(Ot=P||o===null?(0,Y.jsx)(`aside`,{className:d(`flex min-h-0 shrink-0 bg-background`,o?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[Le?(0,Y.jsx)(`div`,{className:`surface-subheader shrink-0 px-3`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-0.5 rounded-md border border-border/60 p-0.5 text-ui-11`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:d(`flex items-center gap-1 rounded-sm px-1.5 py-0.5 transition-colors`,Re===`files`?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),"aria-pressed":Re===`files`,onClick:()=>Qe(`files`),children:[(0,Y.jsx)(Et,{className:`size-3.5`}),`Files`]}),(0,Y.jsxs)(`button`,{type:`button`,className:d(`flex items-center gap-1 rounded-sm px-1.5 py-0.5 transition-colors`,Re===`git`?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),"aria-pressed":Re===`git`,onClick:()=>Qe(`git`),children:[(0,Y.jsx)(Ge,{className:`size-3.5`}),`Git`]})]})}):null,Re===`git`?(0,Y.jsx)(Km,{environmentId:n,cwd:r,files:Fe,isPending:Me.isPending,activePath:o,activeSource:Xe,onOpenChangedFile:tt}):(0,Y.jsx)(Pm,{environmentId:n,cwd:r,projectName:a,selectedPath:o,selectedPathRevealId:_,onOpenFile:st},`${n}:${r}`)]})}):null,t[93]=Xe,t[94]=r,t[95]=Re,t[96]=n,t[97]=P,t[98]=Le,t[99]=tt,t[100]=st,t[101]=a,t[102]=o,t[103]=_,t[104]=Fe,t[105]=Me.isPending,t[106]=Ot):Ot=t[106];let kt;t[107]!==Dt||t[108]!==Ot?(kt=(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[Dt,Ot]}),t[107]=Dt,t[108]=Ot,t[109]=kt):kt=t[109];let At;return t[110]!==bt||t[111]!==xt||t[112]!==kt?(At=(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[bt,xt,kt]}),t[110]=bt,t[111]=xt,t[112]=kt,t[113]=At):At=t[113],At}function Ph(e){let t=!e;try{a(oh,t,y)}catch(e){console.error(e)}return t}function Fh(e){return e+1}function Ih(e){return e.wordWrap}export{Nh as default};
|
|
2220
|
+
//# sourceMappingURL=FilePreviewPanel-D3bq1Own.js.map
|