vite-hub 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (646) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +49 -24
  3. package/dist/_internal/agent/eve.d.ts +1 -0
  4. package/dist/_internal/agent/eve.js +2 -0
  5. package/dist/_internal/database/runtime/state.d.ts +4 -0
  6. package/dist/_internal/database/runtime/state.js +5 -0
  7. package/dist/_internal/workflow/runtime/cloudflare-runner.d.ts +1 -0
  8. package/dist/_internal/workflow/runtime/cloudflare-runner.js +2 -0
  9. package/dist/_internal/workflow/runtime/cloudflare-vite.d.ts +1 -0
  10. package/dist/_internal/workflow/runtime/cloudflare-vite.js +2 -0
  11. package/dist/_internal/workflow/runtime/vercel-vite.d.ts +1 -0
  12. package/dist/_internal/workflow/runtime/vercel-vite.js +2 -0
  13. package/dist/agent/capabilities.d.ts +20 -1
  14. package/dist/agent/capabilities.js +7 -1
  15. package/dist/agent/invocations/sqlite.d.ts +1 -0
  16. package/dist/agent/invocations/sqlite.js +2 -0
  17. package/dist/agent/mcp.d.ts +1 -0
  18. package/dist/agent/mcp.js +2 -0
  19. package/dist/agent/runtime/process.d.ts +1 -0
  20. package/dist/agent/runtime/process.js +2 -0
  21. package/dist/agent/vue.d.ts +1 -0
  22. package/dist/agent/vue.js +2 -0
  23. package/dist/agent.d.ts +7 -1
  24. package/dist/agent.js +31 -1
  25. package/dist/agents-DGL-2SS3.js +53 -0
  26. package/dist/auth/vue.d.ts +1 -0
  27. package/dist/auth/vue.js +2 -0
  28. package/dist/bin.js +57 -8
  29. package/dist/blob-_CeYUuZh.d.ts +8 -0
  30. package/dist/browser/actions.d.ts +1 -0
  31. package/dist/browser/actions.js +2 -0
  32. package/dist/channels/server.d.ts +1 -0
  33. package/dist/channels/server.js +2 -0
  34. package/dist/channels.d.ts +1 -0
  35. package/dist/channels.js +2 -0
  36. package/dist/cloudflare-prerender.mjs +24 -0
  37. package/dist/cloudflare-types.d.ts +1 -0
  38. package/dist/console/runtime/client/request.d.ts +23 -0
  39. package/dist/console/runtime/client/request.js +133 -0
  40. package/dist/console/runtime/client/sections.d.ts +12 -0
  41. package/dist/console/runtime/client/sections.js +41 -0
  42. package/dist/console/runtime/client/time.d.ts +4 -0
  43. package/dist/console/runtime/client/time.js +8 -0
  44. package/dist/console/runtime/components/console-app.vue +1450 -0
  45. package/dist/console/runtime/components/console-blob.vue +341 -0
  46. package/dist/console/runtime/components/console-brand.vue +37 -0
  47. package/dist/console/runtime/components/console-database-model.ts +219 -0
  48. package/dist/console/runtime/components/console-database.vue +701 -0
  49. package/dist/console/runtime/components/console-definitions.vue +440 -0
  50. package/dist/console/runtime/components/console-frame.vue +13 -0
  51. package/dist/console/runtime/components/console-health-model.ts +54 -0
  52. package/dist/console/runtime/components/console-health.vue +236 -0
  53. package/dist/console/runtime/components/console-home.vue +231 -0
  54. package/dist/console/runtime/components/console-kv.vue +541 -0
  55. package/dist/console/runtime/components/console-mark.vue +10 -0
  56. package/dist/console/runtime/components/console-primitive-switcher.vue +69 -0
  57. package/dist/console/runtime/components/console-provider.vue +12 -0
  58. package/dist/console/runtime/components/console-search.vue +435 -0
  59. package/dist/console/runtime/components/console-session-bootstrap.ts +110 -0
  60. package/dist/console/runtime/components/console-session-code-preview.vue +76 -0
  61. package/dist/console/runtime/components/console-session-inspector.vue +726 -0
  62. package/dist/console/runtime/components/console-session-loading.vue +121 -0
  63. package/dist/console/runtime/components/console-session-navbar.vue +112 -0
  64. package/dist/console/runtime/components/console-session-trace-model.ts +414 -0
  65. package/dist/console/runtime/components/console-session-trace.vue +695 -0
  66. package/dist/console/runtime/components/console-session.css +1482 -0
  67. package/dist/console/runtime/components/console-usage.vue +596 -0
  68. package/dist/console/runtime/console-route.d.ts +10 -0
  69. package/dist/console/runtime/console-route.js +37 -0
  70. package/dist/console/runtime/definitions.d.ts +2 -0
  71. package/dist/console/runtime/definitions.js +15 -0
  72. package/dist/console/runtime/pages/agents.vue +58 -0
  73. package/dist/console/runtime/pages/blob.vue +30 -0
  74. package/dist/console/runtime/pages/databases.vue +67 -0
  75. package/dist/console/runtime/pages/index.vue +29 -0
  76. package/dist/console/runtime/pages/kv.vue +68 -0
  77. package/dist/console/runtime/pages/queues.vue +30 -0
  78. package/dist/console/runtime/pages/rate-limits.vue +30 -0
  79. package/dist/console/runtime/pages/sandboxes.vue +27 -0
  80. package/dist/console/runtime/pages/schedules.vue +30 -0
  81. package/dist/console/runtime/pages/workflows.vue +30 -0
  82. package/dist/console/runtime/pages/workspaces.vue +30 -0
  83. package/dist/console/runtime/public/console/chunks/ChatMessage-CVruGJWM.js +1 -0
  84. package/dist/console/runtime/public/console/chunks/ChatPrompt-BmTjPf5_.js +1 -0
  85. package/dist/console/runtime/public/console/chunks/ChatPromptSubmit-DcxguvaS.js +1 -0
  86. package/dist/console/runtime/public/console/chunks/ChatReasoning-DIMO2K2F.js +1 -0
  87. package/dist/console/runtime/public/console/chunks/ChatShimmer-C613EbHI.js +1 -0
  88. package/dist/console/runtime/public/console/chunks/ChatTool-DDmc-ZK6.js +1 -0
  89. package/dist/console/runtime/public/console/chunks/Collapsible-C0CXnWpw.js +1 -0
  90. package/dist/console/runtime/public/console/chunks/CollapsibleTrigger-CmJucLnT.js +1 -0
  91. package/dist/console/runtime/public/console/chunks/Icon-D-AnqCok.js +1 -0
  92. package/dist/console/runtime/public/console/chunks/abap-LtYK6g-v-CLvhMVsD.js +1 -0
  93. package/dist/console/runtime/public/console/chunks/actionscript-3-Czo0lKSf--17pq3dv.js +1 -0
  94. package/dist/console/runtime/public/console/chunks/ada-twHwrVWN-C5qYipkI.js +1 -0
  95. package/dist/console/runtime/public/console/chunks/andromeeda-DnSv6o6l-vGVdxbeo.js +1 -0
  96. package/dist/console/runtime/public/console/chunks/andromeeda-vGVdxbeo.js +1 -0
  97. package/dist/console/runtime/public/console/chunks/angular-html-Ct-40ew8-D8X9MCxo.js +1 -0
  98. package/dist/console/runtime/public/console/chunks/angular-html-DTyieMYv.js +1 -0
  99. package/dist/console/runtime/public/console/chunks/angular-ts-D3gV1N-x.js +1 -0
  100. package/dist/console/runtime/public/console/chunks/angular-ts-D6akBVit-CAEqTior.js +1 -0
  101. package/dist/console/runtime/public/console/chunks/apache-BIl2qPOf-U0d_L8uA.js +1 -0
  102. package/dist/console/runtime/public/console/chunks/apex-BkQQFAhi-VAyPSnFM.js +1 -0
  103. package/dist/console/runtime/public/console/chunks/apl-Cxjn4xYu-QUZjoXcb.js +1 -0
  104. package/dist/console/runtime/public/console/chunks/applescript-CJ80B5XJ-CCn79oCD.js +1 -0
  105. package/dist/console/runtime/public/console/chunks/ara-IxnQjO6j-4CJ0cIlV.js +1 -0
  106. package/dist/console/runtime/public/console/chunks/asciidoc-Dsw6zvwf-DE70LPWp.js +1 -0
  107. package/dist/console/runtime/public/console/chunks/asm-wBDSgBbA-Cmm7eHzH.js +1 -0
  108. package/dist/console/runtime/public/console/chunks/astro-BPVTb8uX-BMHg0UsI.js +1 -0
  109. package/dist/console/runtime/public/console/chunks/astro-CLAWI0Fn.js +1 -0
  110. package/dist/console/runtime/public/console/chunks/aurora-x-CDeNXAV0.js +1 -0
  111. package/dist/console/runtime/public/console/chunks/aurora-x-XJ5I8rFc-CDeNXAV0.js +1 -0
  112. package/dist/console/runtime/public/console/chunks/awk-D6dA05Ye-BWXHIvNe.js +1 -0
  113. package/dist/console/runtime/public/console/chunks/ayu-dark-CBRGL64--DluEY0Gj.js +1 -0
  114. package/dist/console/runtime/public/console/chunks/ayu-dark-DluEY0Gj.js +1 -0
  115. package/dist/console/runtime/public/console/chunks/ayu-light-BlrCS3Ih-C3h-C4tm.js +1 -0
  116. package/dist/console/runtime/public/console/chunks/ayu-light-C3h-C4tm.js +1 -0
  117. package/dist/console/runtime/public/console/chunks/ayu-mirage-Bqwy1Gya.js +1 -0
  118. package/dist/console/runtime/public/console/chunks/ayu-mirage-CqpTmLcF-Bqwy1Gya.js +1 -0
  119. package/dist/console/runtime/public/console/chunks/ballerina-DIdXD2KH-B7ZEbQpA.js +1 -0
  120. package/dist/console/runtime/public/console/chunks/bat-hQslfzu--Bo4NYOV-.js +1 -0
  121. package/dist/console/runtime/public/console/chunks/beancount-CXtOQ8oS-D-usSTwE.js +1 -0
  122. package/dist/console/runtime/public/console/chunks/berry-CgA2ea0_-DKpUyyne.js +1 -0
  123. package/dist/console/runtime/public/console/chunks/bibtex-BzgdqG3s-Ci_nEsc7.js +1 -0
  124. package/dist/console/runtime/public/console/chunks/bicep-CZ338dSk-CUHmPFLl.js +1 -0
  125. package/dist/console/runtime/public/console/chunks/bird2-GLyzhwkD-C6vDhewU.js +1 -0
  126. package/dist/console/runtime/public/console/chunks/blade-0LMawyyw-CZBPwR53.js +1 -0
  127. package/dist/console/runtime/public/console/chunks/blade-CP_mgflB.js +1 -0
  128. package/dist/console/runtime/public/console/chunks/bsl-0NWGiiFE-mk7PqslV.js +1 -0
  129. package/dist/console/runtime/public/console/chunks/bundle-web-DTJmdyvB.js +13 -0
  130. package/dist/console/runtime/public/console/chunks/c-BhmuwSav.js +1 -0
  131. package/dist/console/runtime/public/console/chunks/c-Dc0_AVM6-CjS7AEt5.js +1 -0
  132. package/dist/console/runtime/public/console/chunks/c3-BLXk7BLN-BFHwR3_K.js +1 -0
  133. package/dist/console/runtime/public/console/chunks/cadence-B1ELWULD-CQ2zXKGN.js +1 -0
  134. package/dist/console/runtime/public/console/chunks/cairo-DjG4M3vq-xb-J0v0e.js +1 -0
  135. package/dist/console/runtime/public/console/chunks/catppuccin-frappe-3VR1Za6u.js +1 -0
  136. package/dist/console/runtime/public/console/chunks/catppuccin-frappe-COUg_LSX-3VR1Za6u.js +1 -0
  137. package/dist/console/runtime/public/console/chunks/catppuccin-latte-DwIHMF0Q.js +1 -0
  138. package/dist/console/runtime/public/console/chunks/catppuccin-latte-r30LFfsa-DwIHMF0Q.js +1 -0
  139. package/dist/console/runtime/public/console/chunks/catppuccin-macchiato-D-EwZyPh-DYnBP6_5.js +1 -0
  140. package/dist/console/runtime/public/console/chunks/catppuccin-macchiato-DYnBP6_5.js +1 -0
  141. package/dist/console/runtime/public/console/chunks/catppuccin-mocha-C6RD5yh3-DYhrFGRu.js +1 -0
  142. package/dist/console/runtime/public/console/chunks/catppuccin-mocha-DYhrFGRu.js +1 -0
  143. package/dist/console/runtime/public/console/chunks/chunk-DK3Fl9T5.js +1 -0
  144. package/dist/console/runtime/public/console/chunks/clarity-2iIoRiLx-SemFz856.js +1 -0
  145. package/dist/console/runtime/public/console/chunks/clojure-DDsQ0FaV-DqKBuwfJ.js +1 -0
  146. package/dist/console/runtime/public/console/chunks/cmake-DPsCB_V6-Bj61d0ZC.js +1 -0
  147. package/dist/console/runtime/public/console/chunks/cobol-CocL1RYn-DoHa8rFw.js +1 -0
  148. package/dist/console/runtime/public/console/chunks/codeowners-CxEKPWu0-C8r90Shi.js +1 -0
  149. package/dist/console/runtime/public/console/chunks/codeql-BwdvwJnv-oeQT6MSM.js +1 -0
  150. package/dist/console/runtime/public/console/chunks/coffee-DtqnQNu5-Ca3s2Keu.js +1 -0
  151. package/dist/console/runtime/public/console/chunks/coffee-PUiKoj8Q.js +1 -0
  152. package/dist/console/runtime/public/console/chunks/common-lisp-DJtwvW4V-Cv5bFMCO.js +1 -0
  153. package/dist/console/runtime/public/console/chunks/coq-Ds6Ye5el-BrsZFFmf.js +1 -0
  154. package/dist/console/runtime/public/console/chunks/cpp-CxycoGSa.js +1 -0
  155. package/dist/console/runtime/public/console/chunks/cpp-Mb4ikSI3-tLY9dtiu.js +1 -0
  156. package/dist/console/runtime/public/console/chunks/crystal-D4OMbAh_-C9omPlZ-.js +1 -0
  157. package/dist/console/runtime/public/console/chunks/csharp-CFKaLbHg-oqKa8noW.js +1 -0
  158. package/dist/console/runtime/public/console/chunks/css-DLlZbWMi.js +1 -0
  159. package/dist/console/runtime/public/console/chunks/css-DTzmO9U0-CbxoEllx.js +1 -0
  160. package/dist/console/runtime/public/console/chunks/csv-DqIVFkK7-Dx-8-gkx.js +1 -0
  161. package/dist/console/runtime/public/console/chunks/csv-Dx-8-gkx.js +1 -0
  162. package/dist/console/runtime/public/console/chunks/cue-B5KneM5p-CE9AQfxI.js +1 -0
  163. package/dist/console/runtime/public/console/chunks/cypher-D8Bb8Cq2-ClKdZ_lG.js +1 -0
  164. package/dist/console/runtime/public/console/chunks/d-BQY8TDgQ-qD-0Kul2.js +1 -0
  165. package/dist/console/runtime/public/console/chunks/dark-plus-BCxGtnt0-Cs2F2srj.js +1 -0
  166. package/dist/console/runtime/public/console/chunks/dark-plus-Cs2F2srj.js +1 -0
  167. package/dist/console/runtime/public/console/chunks/dart-C6DUdjib-CnvKMtbv.js +1 -0
  168. package/dist/console/runtime/public/console/chunks/dax-S-Noo-ku-BkyTk9wS.js +1 -0
  169. package/dist/console/runtime/public/console/chunks/desktop-BgOb7Aj4-Dlh5hvp9.js +1 -0
  170. package/dist/console/runtime/public/console/chunks/diff-Blb4MjsC-woXpYk--.js +1 -0
  171. package/dist/console/runtime/public/console/chunks/docker-PC1tuYpa-IyjqRm3v.js +1 -0
  172. package/dist/console/runtime/public/console/chunks/dotenv-Dkdv7Sm2-_5a1GRtc.js +1 -0
  173. package/dist/console/runtime/public/console/chunks/dracula-BHWKrbxM.js +1 -0
  174. package/dist/console/runtime/public/console/chunks/dracula-fPErIccy-BHWKrbxM.js +1 -0
  175. package/dist/console/runtime/public/console/chunks/dracula-soft-5eyTD99u.js +1 -0
  176. package/dist/console/runtime/public/console/chunks/dracula-soft-BrQbqXs8-5eyTD99u.js +1 -0
  177. package/dist/console/runtime/public/console/chunks/dream-maker-CngiPd8U-DW3nJb8Q.js +1 -0
  178. package/dist/console/runtime/public/console/chunks/edge-DrFNu-N9-BY3pzybO.js +1 -0
  179. package/dist/console/runtime/public/console/chunks/elixir-OpZyQ8Ht-CwWfuiQ1.js +1 -0
  180. package/dist/console/runtime/public/console/chunks/elm-CjX_545P-Dn-DqM39.js +1 -0
  181. package/dist/console/runtime/public/console/chunks/emacs-lisp-DxhFFVu_-B4R74twV.js +1 -0
  182. package/dist/console/runtime/public/console/chunks/erb-trZRdc47-DRBdWH-D.js +1 -0
  183. package/dist/console/runtime/public/console/chunks/erlang-BJeTH9QH-BfDtvnHZ.js +1 -0
  184. package/dist/console/runtime/public/console/chunks/everforest-dark-gTeBQCos-sB-x3p7T.js +1 -0
  185. package/dist/console/runtime/public/console/chunks/everforest-dark-sB-x3p7T.js +1 -0
  186. package/dist/console/runtime/public/console/chunks/everforest-light-DUjxsp-2-Df2xbC6M.js +1 -0
  187. package/dist/console/runtime/public/console/chunks/everforest-light-Df2xbC6M.js +1 -0
  188. package/dist/console/runtime/public/console/chunks/fennel-B3wtZRne-DQxkIbk2.js +1 -0
  189. package/dist/console/runtime/public/console/chunks/fish-D7qAeWQz-BJitypiv.js +1 -0
  190. package/dist/console/runtime/public/console/chunks/fluent-BjfpB34g-C03EYrpw.js +1 -0
  191. package/dist/console/runtime/public/console/chunks/fortran-fixed-form-B_eBTsj9-C2-rkbip.js +1 -0
  192. package/dist/console/runtime/public/console/chunks/fortran-free-form-yxJ7igsv-CYNrtFtB.js +1 -0
  193. package/dist/console/runtime/public/console/chunks/fsharp-UvrT6oWG-LCdvSpj6.js +1 -0
  194. package/dist/console/runtime/public/console/chunks/gdresource-Dl9wvKCd-C3MGX-jo.js +1 -0
  195. package/dist/console/runtime/public/console/chunks/gdscript-jjgTGGzd-Cp2uCuqX.js +1 -0
  196. package/dist/console/runtime/public/console/chunks/gdshader-D7JfdFV3-CBce3t8t.js +1 -0
  197. package/dist/console/runtime/public/console/chunks/genie-DnK2KWIP-CV2tkWYe.js +1 -0
  198. package/dist/console/runtime/public/console/chunks/gherkin-D6Lr12YQ-DExj1W_8.js +1 -0
  199. package/dist/console/runtime/public/console/chunks/git-commit-2LMniMoO-CfgJCLX7.js +1 -0
  200. package/dist/console/runtime/public/console/chunks/git-rebase-DUOURRPN-DbPsFIae.js +1 -0
  201. package/dist/console/runtime/public/console/chunks/github-dark-C-LZuMrd.js +1 -0
  202. package/dist/console/runtime/public/console/chunks/github-dark-Dg1hl_QD-C-LZuMrd.js +1 -0
  203. package/dist/console/runtime/public/console/chunks/github-dark-default-DXG-b-1a.js +1 -0
  204. package/dist/console/runtime/public/console/chunks/github-dark-default-Dym2P842-DXG-b-1a.js +1 -0
  205. package/dist/console/runtime/public/console/chunks/github-dark-dimmed-7iDMx266-Bx1FflLF.js +1 -0
  206. package/dist/console/runtime/public/console/chunks/github-dark-dimmed-Bx1FflLF.js +1 -0
  207. package/dist/console/runtime/public/console/chunks/github-dark-high-contrast-B_tTalzw.js +1 -0
  208. package/dist/console/runtime/public/console/chunks/github-dark-high-contrast-DkV2fyPG-B_tTalzw.js +1 -0
  209. package/dist/console/runtime/public/console/chunks/github-light-BQKYgor9-EUqPIrTm.js +1 -0
  210. package/dist/console/runtime/public/console/chunks/github-light-EUqPIrTm.js +1 -0
  211. package/dist/console/runtime/public/console/chunks/github-light-default-BXViO-2h.js +1 -0
  212. package/dist/console/runtime/public/console/chunks/github-light-default-BZhIfzqQ-BXViO-2h.js +1 -0
  213. package/dist/console/runtime/public/console/chunks/github-light-high-contrast-B68TUdTA.js +1 -0
  214. package/dist/console/runtime/public/console/chunks/github-light-high-contrast-C7zHfx4C-B68TUdTA.js +1 -0
  215. package/dist/console/runtime/public/console/chunks/gleam-CTllUdfC-CSRkHgEL.js +1 -0
  216. package/dist/console/runtime/public/console/chunks/glimmer-js-D_32hFh8-Dv_1Q6fk.js +1 -0
  217. package/dist/console/runtime/public/console/chunks/glimmer-ts-CVt002zd-PmMLyqBp.js +1 -0
  218. package/dist/console/runtime/public/console/chunks/glsl-8MDrjpMp.js +1 -0
  219. package/dist/console/runtime/public/console/chunks/glsl-pHhzolba-D3h1XPFw.js +1 -0
  220. package/dist/console/runtime/public/console/chunks/gn-DDjbVPF4-ilITqXS6.js +1 -0
  221. package/dist/console/runtime/public/console/chunks/gnuplot-DgWvVXI8-7GGW24-e.js +1 -0
  222. package/dist/console/runtime/public/console/chunks/go-aXtTCanQ-rLFTqkRN.js +1 -0
  223. package/dist/console/runtime/public/console/chunks/graphql-BjqekQIR-CtUxCAnJ.js +1 -0
  224. package/dist/console/runtime/public/console/chunks/graphql-C4iAGs1_.js +1 -0
  225. package/dist/console/runtime/public/console/chunks/groovy-Bw2Ku4bU-CacY0gHj.js +1 -0
  226. package/dist/console/runtime/public/console/chunks/gruvbox-dark-hard-C820rvS2.js +1 -0
  227. package/dist/console/runtime/public/console/chunks/gruvbox-dark-hard-CQiwpF03-C820rvS2.js +1 -0
  228. package/dist/console/runtime/public/console/chunks/gruvbox-dark-medium-BKe6XKBS-BPjhmG05.js +1 -0
  229. package/dist/console/runtime/public/console/chunks/gruvbox-dark-medium-BPjhmG05.js +1 -0
  230. package/dist/console/runtime/public/console/chunks/gruvbox-dark-soft-Cz6U6pa4-MrdJrrXF.js +1 -0
  231. package/dist/console/runtime/public/console/chunks/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  232. package/dist/console/runtime/public/console/chunks/gruvbox-light-hard-BC_s9l72.js +1 -0
  233. package/dist/console/runtime/public/console/chunks/gruvbox-light-hard-DgU_i19B-BC_s9l72.js +1 -0
  234. package/dist/console/runtime/public/console/chunks/gruvbox-light-medium-BAWPOn9u.js +1 -0
  235. package/dist/console/runtime/public/console/chunks/gruvbox-light-medium-D64I06ER-BAWPOn9u.js +1 -0
  236. package/dist/console/runtime/public/console/chunks/gruvbox-light-soft-B-YxAs1L-BSMLrYjP.js +1 -0
  237. package/dist/console/runtime/public/console/chunks/gruvbox-light-soft-BSMLrYjP.js +1 -0
  238. package/dist/console/runtime/public/console/chunks/hack-BITNGzgt-BwY4KWmq.js +1 -0
  239. package/dist/console/runtime/public/console/chunks/haml-BJGeH8A5.js +1 -0
  240. package/dist/console/runtime/public/console/chunks/haml-DVwRP8W9-C4Ue42xj.js +1 -0
  241. package/dist/console/runtime/public/console/chunks/handlebars-OC1LcHwO.js +1 -0
  242. package/dist/console/runtime/public/console/chunks/handlebars-T3TJj8Il-BLQCwuJT.js +1 -0
  243. package/dist/console/runtime/public/console/chunks/haskell-CfGsE1Cf-D8IpX4py.js +1 -0
  244. package/dist/console/runtime/public/console/chunks/haxe-B0odltAZ-OTjmBuCE.js +1 -0
  245. package/dist/console/runtime/public/console/chunks/hcl-DHg_Osgo-Dh228itO.js +1 -0
  246. package/dist/console/runtime/public/console/chunks/hjson-Cuaphql8-CxZEssPk.js +1 -0
  247. package/dist/console/runtime/public/console/chunks/hlsl-BJLUNfne-Cvrh5tZx.js +1 -0
  248. package/dist/console/runtime/public/console/chunks/horizon-CE9ld1lL.js +1 -0
  249. package/dist/console/runtime/public/console/chunks/horizon-DYoumREk-CE9ld1lL.js +1 -0
  250. package/dist/console/runtime/public/console/chunks/horizon-bright-CPyV7XIA-DSNQnXHK.js +1 -0
  251. package/dist/console/runtime/public/console/chunks/horizon-bright-DSNQnXHK.js +1 -0
  252. package/dist/console/runtime/public/console/chunks/houston-B3NWfq0V-CsvMBhTu.js +1 -0
  253. package/dist/console/runtime/public/console/chunks/houston-CsvMBhTu.js +1 -0
  254. package/dist/console/runtime/public/console/chunks/html-CamevgpM-BbT95zHF.js +1 -0
  255. package/dist/console/runtime/public/console/chunks/html-Cs160JwT.js +1 -0
  256. package/dist/console/runtime/public/console/chunks/html-derivative-GiQ9zDJU.js +1 -0
  257. package/dist/console/runtime/public/console/chunks/html-derivative-jMOJf6rB-Kh3SdD3S.js +1 -0
  258. package/dist/console/runtime/public/console/chunks/http-BEHztmFP-BxphIJE7.js +1 -0
  259. package/dist/console/runtime/public/console/chunks/http-Cgwuv9UR.js +1 -0
  260. package/dist/console/runtime/public/console/chunks/hurl-DMKCZZMv.js +1 -0
  261. package/dist/console/runtime/public/console/chunks/hurl-LmFBxrwm-CGo4dqUD.js +1 -0
  262. package/dist/console/runtime/public/console/chunks/hxml-BQ4V4Tez-BaHUc7lX.js +1 -0
  263. package/dist/console/runtime/public/console/chunks/hy-CJKxDzbh-CZbG8q4J.js +1 -0
  264. package/dist/console/runtime/public/console/chunks/imba-96qKoJCa-DsUTQ-LC.js +1 -0
  265. package/dist/console/runtime/public/console/chunks/imba-DsUTQ-LC.js +1 -0
  266. package/dist/console/runtime/public/console/chunks/ini-C24lZfdM-B5eOa1yu.js +1 -0
  267. package/dist/console/runtime/public/console/chunks/java-CUcXVav_.js +1 -0
  268. package/dist/console/runtime/public/console/chunks/java-Cfowl-Ex-BnGnzH2k.js +1 -0
  269. package/dist/console/runtime/public/console/chunks/javascript-C4sF7sej-B29qPxDa.js +1 -0
  270. package/dist/console/runtime/public/console/chunks/javascript-DrVpc-sp.js +1 -0
  271. package/dist/console/runtime/public/console/chunks/jinja-C17UUgXU.js +1 -0
  272. package/dist/console/runtime/public/console/chunks/jinja-CCAEwzP4-PaInFpq5.js +1 -0
  273. package/dist/console/runtime/public/console/chunks/jison-BKCoBkyT-BRL7eVgb.js +1 -0
  274. package/dist/console/runtime/public/console/chunks/jison-ByjIV4zh.js +1 -0
  275. package/dist/console/runtime/public/console/chunks/json-E4f3l6hr-DuNL0Aj9.js +1 -0
  276. package/dist/console/runtime/public/console/chunks/json-qhed-kSA.js +1 -0
  277. package/dist/console/runtime/public/console/chunks/json5-BR5RXkoi.js +1 -0
  278. package/dist/console/runtime/public/console/chunks/json5-xULSgPQI-BR5RXkoi.js +1 -0
  279. package/dist/console/runtime/public/console/chunks/jsonc-CYpm1nAK.js +1 -0
  280. package/dist/console/runtime/public/console/chunks/jsonc-Cu6rqcrJ-CYpm1nAK.js +1 -0
  281. package/dist/console/runtime/public/console/chunks/jsonl-Bp0qqr10-CmCQp5Yx.js +1 -0
  282. package/dist/console/runtime/public/console/chunks/jsonl-CmCQp5Yx.js +1 -0
  283. package/dist/console/runtime/public/console/chunks/jsonnet-BafgE6cE-CJTPZ8u_.js +1 -0
  284. package/dist/console/runtime/public/console/chunks/jssm-Dx5A5sBR-DXw9l8Rf.js +1 -0
  285. package/dist/console/runtime/public/console/chunks/jsx-BZjOirBP-Dga5sQe3.js +1 -0
  286. package/dist/console/runtime/public/console/chunks/jsx-C-HlKHLe.js +1 -0
  287. package/dist/console/runtime/public/console/chunks/julia-Ca_tGyZB.js +1 -0
  288. package/dist/console/runtime/public/console/chunks/julia-nEdJo0dp-CJRta6ZT.js +1 -0
  289. package/dist/console/runtime/public/console/chunks/just-Brtw3q7S-DmytbepJ.js +1 -0
  290. package/dist/console/runtime/public/console/chunks/kanagawa-dragon-CXtmUGW6.js +1 -0
  291. package/dist/console/runtime/public/console/chunks/kanagawa-dragon-DExkuQAs-CXtmUGW6.js +1 -0
  292. package/dist/console/runtime/public/console/chunks/kanagawa-lotus-BN08jTvb.js +1 -0
  293. package/dist/console/runtime/public/console/chunks/kanagawa-lotus-qdYh7_RY-BN08jTvb.js +1 -0
  294. package/dist/console/runtime/public/console/chunks/kanagawa-wave-CSW_hADG-CTweb8Dz.js +1 -0
  295. package/dist/console/runtime/public/console/chunks/kanagawa-wave-CTweb8Dz.js +1 -0
  296. package/dist/console/runtime/public/console/chunks/kdl-DkTyxPcj-CsD5j6eV.js +1 -0
  297. package/dist/console/runtime/public/console/chunks/kotlin-BHE8CoV9-DhhofPvG.js +1 -0
  298. package/dist/console/runtime/public/console/chunks/kusto-6FdaWTzR-C7mF5XQf.js +1 -0
  299. package/dist/console/runtime/public/console/chunks/laserwave-C_8bwKvT.js +1 -0
  300. package/dist/console/runtime/public/console/chunks/laserwave-DkfjiLxA-C_8bwKvT.js +1 -0
  301. package/dist/console/runtime/public/console/chunks/latex-QHQNiZDD-fcyJN6QK.js +1 -0
  302. package/dist/console/runtime/public/console/chunks/lean-BwOKScIt-CewbzKMR.js +1 -0
  303. package/dist/console/runtime/public/console/chunks/less-BzbdhFUi-DVTAwKKz.js +1 -0
  304. package/dist/console/runtime/public/console/chunks/less-DVTAwKKz.js +1 -0
  305. package/dist/console/runtime/public/console/chunks/light-plus-DVQuIRkW.js +1 -0
  306. package/dist/console/runtime/public/console/chunks/light-plus-DuO6rXxZ-DVQuIRkW.js +1 -0
  307. package/dist/console/runtime/public/console/chunks/liquid-DYQ7uW5u-JGNMHTpg.js +1 -0
  308. package/dist/console/runtime/public/console/chunks/llvm-uY68ROGz-Cm23YOpf.js +1 -0
  309. package/dist/console/runtime/public/console/chunks/log-Dad54gsi-BNLmms1o.js +1 -0
  310. package/dist/console/runtime/public/console/chunks/logo-DTXV8SKw-Cluzi2Zq.js +1 -0
  311. package/dist/console/runtime/public/console/chunks/lua-BhkUWs1q-CVcL4bwV.js +1 -0
  312. package/dist/console/runtime/public/console/chunks/luau-YC4aaMmR-FMPmPwt6.js +1 -0
  313. package/dist/console/runtime/public/console/chunks/make-B2ukzWs3-Dixweg8N.js +1 -0
  314. package/dist/console/runtime/public/console/chunks/markdown-BYOwaDjH.js +1 -0
  315. package/dist/console/runtime/public/console/chunks/markdown-CkmxmzqY-BYOwaDjH.js +1 -0
  316. package/dist/console/runtime/public/console/chunks/marko-BHWvxp04-U7nYXRKW.js +1 -0
  317. package/dist/console/runtime/public/console/chunks/marko-DmV4Eg2F.js +1 -0
  318. package/dist/console/runtime/public/console/chunks/material-theme-Bm3Qr25_.js +1 -0
  319. package/dist/console/runtime/public/console/chunks/material-theme-C_YrwKEa-Bm3Qr25_.js +1 -0
  320. package/dist/console/runtime/public/console/chunks/material-theme-darker-2IIEA8gg.js +1 -0
  321. package/dist/console/runtime/public/console/chunks/material-theme-darker-DB3YVCla-2IIEA8gg.js +1 -0
  322. package/dist/console/runtime/public/console/chunks/material-theme-lighter-D2fgNrBK-uhdI0v04.js +1 -0
  323. package/dist/console/runtime/public/console/chunks/material-theme-lighter-uhdI0v04.js +1 -0
  324. package/dist/console/runtime/public/console/chunks/material-theme-ocean-CHQ94UKr.js +1 -0
  325. package/dist/console/runtime/public/console/chunks/material-theme-ocean-DVy172Rs-CHQ94UKr.js +1 -0
  326. package/dist/console/runtime/public/console/chunks/material-theme-palenight-B5W6OYN7.js +1 -0
  327. package/dist/console/runtime/public/console/chunks/material-theme-palenight-uMMwIfpG-B5W6OYN7.js +1 -0
  328. package/dist/console/runtime/public/console/chunks/matlab-CfRK6IMC-D7qyCx1q.js +1 -0
  329. package/dist/console/runtime/public/console/chunks/mdc-BVkdQPZX.js +1 -0
  330. package/dist/console/runtime/public/console/chunks/mdc-Dg7VPYLa-CshLRYP7.js +1 -0
  331. package/dist/console/runtime/public/console/chunks/mdx-BK9ZufRc-DQZ5AkYe.js +1 -0
  332. package/dist/console/runtime/public/console/chunks/mdx-DQZ5AkYe.js +1 -0
  333. package/dist/console/runtime/public/console/chunks/mermaid-r7OoIYpE-Bk4SNUv9.js +1 -0
  334. package/dist/console/runtime/public/console/chunks/min-dark-BSWPekZh.js +1 -0
  335. package/dist/console/runtime/public/console/chunks/min-dark-C7Ec8I_2-BSWPekZh.js +1 -0
  336. package/dist/console/runtime/public/console/chunks/min-light-Be6foA7m-DDpmG2fV.js +1 -0
  337. package/dist/console/runtime/public/console/chunks/min-light-DDpmG2fV.js +1 -0
  338. package/dist/console/runtime/public/console/chunks/mipsasm-EL46Y4Xg-BMqwQI7S.js +1 -0
  339. package/dist/console/runtime/public/console/chunks/mojo-YCzvCoMT-BgCJLMeH.js +1 -0
  340. package/dist/console/runtime/public/console/chunks/monokai-CREPpJ3k-CdkpiU2Y.js +1 -0
  341. package/dist/console/runtime/public/console/chunks/monokai-CdkpiU2Y.js +1 -0
  342. package/dist/console/runtime/public/console/chunks/moonbit-B_9L5rST-CaWjb8XO.js +1 -0
  343. package/dist/console/runtime/public/console/chunks/move-Dqi5fhOb-B1IS1UjX.js +1 -0
  344. package/dist/console/runtime/public/console/chunks/narrat-D9rrR0H5-_X_XdTYD.js +1 -0
  345. package/dist/console/runtime/public/console/chunks/nextflow-CgUAk9iA-CTMUe4Ca.js +1 -0
  346. package/dist/console/runtime/public/console/chunks/nextflow-groovy-CdFFX-gF-DJMQeKeT.js +1 -0
  347. package/dist/console/runtime/public/console/chunks/nginx-Q-E8IJvs-DiQO9reH.js +1 -0
  348. package/dist/console/runtime/public/console/chunks/night-owl-CqqbiLON-DhmEMT88.js +1 -0
  349. package/dist/console/runtime/public/console/chunks/night-owl-DhmEMT88.js +1 -0
  350. package/dist/console/runtime/public/console/chunks/night-owl-light-B9vYgGRt-eJ-hLW7d.js +1 -0
  351. package/dist/console/runtime/public/console/chunks/night-owl-light-eJ-hLW7d.js +1 -0
  352. package/dist/console/runtime/public/console/chunks/nim-CNcTuF14-W9Ucwkhx.js +1 -0
  353. package/dist/console/runtime/public/console/chunks/nix-Bm1Ax-Z3-IvuFDN5E.js +1 -0
  354. package/dist/console/runtime/public/console/chunks/nord-BZ9DVmcN-Cb4Vim4T.js +1 -0
  355. package/dist/console/runtime/public/console/chunks/nord-Cb4Vim4T.js +1 -0
  356. package/dist/console/runtime/public/console/chunks/nushell-r7hBzeS_-DcLAeLz5.js +1 -0
  357. package/dist/console/runtime/public/console/chunks/objective-c-6dJF64Dt-D1A_Heim.js +1 -0
  358. package/dist/console/runtime/public/console/chunks/objective-cpp-_ooRQ-PY-BsSzOQcm.js +1 -0
  359. package/dist/console/runtime/public/console/chunks/ocaml-vm1Y8An6-O90oeIOV.js +1 -0
  360. package/dist/console/runtime/public/console/chunks/odin-vjOJSyfV-B1RWQWA5.js +1 -0
  361. package/dist/console/runtime/public/console/chunks/one-dark-pro-CLwyXe_n.js +1 -0
  362. package/dist/console/runtime/public/console/chunks/one-dark-pro-Ev8UPkf4-CLwyXe_n.js +1 -0
  363. package/dist/console/runtime/public/console/chunks/one-light-CzxBC38_-D7Lr4KcI.js +1 -0
  364. package/dist/console/runtime/public/console/chunks/one-light-D7Lr4KcI.js +1 -0
  365. package/dist/console/runtime/public/console/chunks/openscad-jn-f1Ocl-BUDT5pXO.js +1 -0
  366. package/dist/console/runtime/public/console/chunks/pascal-D8-gNZ2I-4ZHwLPI5.js +1 -0
  367. package/dist/console/runtime/public/console/chunks/perl-Bbgb6Twx-CHGXAzGq.js +1 -0
  368. package/dist/console/runtime/public/console/chunks/php-CBOR45_G-D5pyod9R.js +1 -0
  369. package/dist/console/runtime/public/console/chunks/php-J5BBb-PR.js +1 -0
  370. package/dist/console/runtime/public/console/chunks/pierre-code-view-DYpF5M8R-BiohFcCD.js +1511 -0
  371. package/dist/console/runtime/public/console/chunks/pierre-dark-DDWDl8g6-CpLgRqie.js +1 -0
  372. package/dist/console/runtime/public/console/chunks/pierre-dark-protanopia-deuteranopia-C35UMuvO-B35FxJx-.js +1 -0
  373. package/dist/console/runtime/public/console/chunks/pierre-dark-soft-Bb-4-biO-kZQmAZld.js +1 -0
  374. package/dist/console/runtime/public/console/chunks/pierre-dark-tritanopia-CIJISGWF-CpjhbsIL.js +1 -0
  375. package/dist/console/runtime/public/console/chunks/pierre-dark-vibrant-8oZzB3gw-CpQYzh95.js +1 -0
  376. package/dist/console/runtime/public/console/chunks/pierre-light-CWhW4NrH-CoaEpmwp.js +1 -0
  377. package/dist/console/runtime/public/console/chunks/pierre-light-protanopia-deuteranopia-u0U7N4Hn-0fSaH845.js +1 -0
  378. package/dist/console/runtime/public/console/chunks/pierre-light-soft-BCU6fuhO-lWLdNTOI.js +1 -0
  379. package/dist/console/runtime/public/console/chunks/pierre-light-tritanopia-3c8Yx3co-CEbqgOJL.js +1 -0
  380. package/dist/console/runtime/public/console/chunks/pierre-light-vibrant-Cwh332o_-D80Fkn33.js +1 -0
  381. package/dist/console/runtime/public/console/chunks/pkl-C7lWzykI-ot-7Btpt.js +1 -0
  382. package/dist/console/runtime/public/console/chunks/plastic-BGkJ2das-DQwYfKfQ.js +1 -0
  383. package/dist/console/runtime/public/console/chunks/plastic-DQwYfKfQ.js +1 -0
  384. package/dist/console/runtime/public/console/chunks/plsql-DCNXypXO-DGHpHOYJ.js +1 -0
  385. package/dist/console/runtime/public/console/chunks/po-IjpR1yHO-BiJDBrnU.js +1 -0
  386. package/dist/console/runtime/public/console/chunks/poimandres-CpnMgZuc-DRFjx7u4.js +1 -0
  387. package/dist/console/runtime/public/console/chunks/poimandres-DRFjx7u4.js +1 -0
  388. package/dist/console/runtime/public/console/chunks/polar-4pN1JrJ8-C7UOKdEL.js +1 -0
  389. package/dist/console/runtime/public/console/chunks/postcss-BXeXVLqQ.js +1 -0
  390. package/dist/console/runtime/public/console/chunks/postcss-D1gKt4z_-BXeXVLqQ.js +1 -0
  391. package/dist/console/runtime/public/console/chunks/powerquery-SrvS_NBM-DNMTfnFr.js +1 -0
  392. package/dist/console/runtime/public/console/chunks/powershell-CpTLv_ai-DshXNtvi.js +1 -0
  393. package/dist/console/runtime/public/console/chunks/prisma-BWfa4-tI-BsRQq5mF.js +1 -0
  394. package/dist/console/runtime/public/console/chunks/prolog-Bacii3Ue-iXnhIJG7.js +1 -0
  395. package/dist/console/runtime/public/console/chunks/proto-ClkOcAW0-DB4EqR-F.js +1 -0
  396. package/dist/console/runtime/public/console/chunks/pug-CfJcGJfh.js +1 -0
  397. package/dist/console/runtime/public/console/chunks/pug-Cn_U_o_I-Cw4zFEpZ.js +1 -0
  398. package/dist/console/runtime/public/console/chunks/puppet-CQlPp728-CDv2pdJW.js +1 -0
  399. package/dist/console/runtime/public/console/chunks/purescript-CLpaGMbw-9MfHhQsQ.js +1 -0
  400. package/dist/console/runtime/public/console/chunks/python-BjnOIxPe-gzcpVVnB.js +1 -0
  401. package/dist/console/runtime/public/console/chunks/python-gzcpVVnB.js +1 -0
  402. package/dist/console/runtime/public/console/chunks/qml-DNlrbxJT-B_IzAFFX.js +1 -0
  403. package/dist/console/runtime/public/console/chunks/qmldir-Dz8ttxjf-DCQb3MpD.js +1 -0
  404. package/dist/console/runtime/public/console/chunks/qss-Iltvkn1C-Fe1Jh2GI.js +1 -0
  405. package/dist/console/runtime/public/console/chunks/r-Dzep-lPg.js +1 -0
  406. package/dist/console/runtime/public/console/chunks/r-VqTZMNY_-EnO4GoeC.js +1 -0
  407. package/dist/console/runtime/public/console/chunks/racket-DRv7j6nv-DcIDlBhZ.js +1 -0
  408. package/dist/console/runtime/public/console/chunks/raku-DI9yGpeW-B3gFvitq.js +1 -0
  409. package/dist/console/runtime/public/console/chunks/razor-Bw2un3e8-CtGvw0jo.js +1 -0
  410. package/dist/console/runtime/public/console/chunks/red-CJ3rzSJv.js +1 -0
  411. package/dist/console/runtime/public/console/chunks/red-EHiRGXSv-CJ3rzSJv.js +1 -0
  412. package/dist/console/runtime/public/console/chunks/reg-DpJf71oO-CRGYupPL.js +1 -0
  413. package/dist/console/runtime/public/console/chunks/regexp-5HbFqwky-C3xQXL6t.js +1 -0
  414. package/dist/console/runtime/public/console/chunks/regexp-R83qIIH_.js +1 -0
  415. package/dist/console/runtime/public/console/chunks/rel-BT0iIKKw-BtDbiS_P.js +1 -0
  416. package/dist/console/runtime/public/console/chunks/riscv-CvzikGLb-Ckw8ddFX.js +1 -0
  417. package/dist/console/runtime/public/console/chunks/ron-DzAo6FTJ-VUp2lXgN.js +1 -0
  418. package/dist/console/runtime/public/console/chunks/rose-pine-BthvhNj6.js +1 -0
  419. package/dist/console/runtime/public/console/chunks/rose-pine-DTI-z1Qp-BthvhNj6.js +1 -0
  420. package/dist/console/runtime/public/console/chunks/rose-pine-dawn-BIiGXpWs-Dg85fqjY.js +1 -0
  421. package/dist/console/runtime/public/console/chunks/rose-pine-dawn-Dg85fqjY.js +1 -0
  422. package/dist/console/runtime/public/console/chunks/rose-pine-moon-DU4wt90U-hon4tzzS.js +1 -0
  423. package/dist/console/runtime/public/console/chunks/rose-pine-moon-hon4tzzS.js +1 -0
  424. package/dist/console/runtime/public/console/chunks/rosmsg-CyYq6XdT-CAekHB0j.js +1 -0
  425. package/dist/console/runtime/public/console/chunks/rst-BZPDb03W-BDIwqmQR.js +1 -0
  426. package/dist/console/runtime/public/console/chunks/ruby-BbVp0_gQ-BUOn3oxT.js +1 -0
  427. package/dist/console/runtime/public/console/chunks/rust-COBzcmTx-Cfkwpbl8.js +1 -0
  428. package/dist/console/runtime/public/console/chunks/sas-DSkdG4wF-BE4zxtJ7.js +1 -0
  429. package/dist/console/runtime/public/console/chunks/sass-DI2zJwx7-DXrisJhu.js +1 -0
  430. package/dist/console/runtime/public/console/chunks/sass-DXrisJhu.js +1 -0
  431. package/dist/console/runtime/public/console/chunks/scala-CtSYTRYT-DKOlJaKm.js +1 -0
  432. package/dist/console/runtime/public/console/chunks/scheme-D3A2QBtM-DQCgrYNe.js +1 -0
  433. package/dist/console/runtime/public/console/chunks/scss-BQ7uffpQ-D2aPazKS.js +1 -0
  434. package/dist/console/runtime/public/console/chunks/scss-DTeHeodw.js +1 -0
  435. package/dist/console/runtime/public/console/chunks/sdbl-CdQg5gu1-bTVj8UrX.js +1 -0
  436. package/dist/console/runtime/public/console/chunks/shaderlab-CWP9wBCf-C6U2tjWC.js +1 -0
  437. package/dist/console/runtime/public/console/chunks/shellscript-B42c0JAn-D5OxpxEd.js +1 -0
  438. package/dist/console/runtime/public/console/chunks/shellscript-CLZ0U2zV.js +1 -0
  439. package/dist/console/runtime/public/console/chunks/shellsession-Oc9-NqAv-C1K_F4Is.js +1 -0
  440. package/dist/console/runtime/public/console/chunks/slack-dark-BS2AOOdo-DnToyrRv.js +1 -0
  441. package/dist/console/runtime/public/console/chunks/slack-dark-DnToyrRv.js +1 -0
  442. package/dist/console/runtime/public/console/chunks/slack-ochin-B2OO5cIa.js +1 -0
  443. package/dist/console/runtime/public/console/chunks/slack-ochin-Nc7Cucwk-B2OO5cIa.js +1 -0
  444. package/dist/console/runtime/public/console/chunks/smalltalk-BEQkVl4K-B16xEiuN.js +1 -0
  445. package/dist/console/runtime/public/console/chunks/snazzy-light-4G7pJPwS.js +1 -0
  446. package/dist/console/runtime/public/console/chunks/snazzy-light-C2ghKZXY-4G7pJPwS.js +1 -0
  447. package/dist/console/runtime/public/console/chunks/solarized-dark-DV17i1UV.js +1 -0
  448. package/dist/console/runtime/public/console/chunks/solarized-dark-UHgjRWhr-DV17i1UV.js +1 -0
  449. package/dist/console/runtime/public/console/chunks/solarized-light-B-Zcwve2-DSh2HLQt.js +1 -0
  450. package/dist/console/runtime/public/console/chunks/solarized-light-DSh2HLQt.js +1 -0
  451. package/dist/console/runtime/public/console/chunks/solidity-lB9VjfB9-CKzVLygQ.js +1 -0
  452. package/dist/console/runtime/public/console/chunks/soy-tgh9u9aW-Cm_LtJoW.js +1 -0
  453. package/dist/console/runtime/public/console/chunks/sparql-B4t0ZbEe-CXgkFCv7.js +1 -0
  454. package/dist/console/runtime/public/console/chunks/splunk-xP_ZjUH2-BC2Px7Mm.js +1 -0
  455. package/dist/console/runtime/public/console/chunks/sql-C7n9abzK.js +1 -0
  456. package/dist/console/runtime/public/console/chunks/sql-CrPlEQn4-COghB3-E.js +1 -0
  457. package/dist/console/runtime/public/console/chunks/ssh-config-DXFPABYp-BgfXC-Er.js +1 -0
  458. package/dist/console/runtime/public/console/chunks/stata-D_KqT8cj-oQQpG6t_.js +1 -0
  459. package/dist/console/runtime/public/console/chunks/stylus-B6D30XZt.js +1 -0
  460. package/dist/console/runtime/public/console/chunks/stylus-ZZDn1yUO-B6D30XZt.js +1 -0
  461. package/dist/console/runtime/public/console/chunks/surrealql-C0KhgoyZ-DqXNFH_A.js +1 -0
  462. package/dist/console/runtime/public/console/chunks/svelte-CRpWSJAY.js +1 -0
  463. package/dist/console/runtime/public/console/chunks/svelte-DuHT0xxw-Bs0TxuUS.js +1 -0
  464. package/dist/console/runtime/public/console/chunks/swift-BTPQlRLK-DonLKvLd.js +1 -0
  465. package/dist/console/runtime/public/console/chunks/synthwave-84-CPtGYwOz-nFMaYfgc.js +1 -0
  466. package/dist/console/runtime/public/console/chunks/synthwave-84-nFMaYfgc.js +1 -0
  467. package/dist/console/runtime/public/console/chunks/system-verilog-BEoxaBuU-DJ5XKQeo.js +1 -0
  468. package/dist/console/runtime/public/console/chunks/systemd-DFbUltlW-BxMlprV5.js +1 -0
  469. package/dist/console/runtime/public/console/chunks/talonscript-CLxaFu-b-CohzipZa.js +1 -0
  470. package/dist/console/runtime/public/console/chunks/tasl-_AAbKiWM-DMoTqEGO.js +1 -0
  471. package/dist/console/runtime/public/console/chunks/tcl-DLe0Tsfm-CZd0xW_V.js +1 -0
  472. package/dist/console/runtime/public/console/chunks/templ-DF54artD-BPb_zNLV.js +1 -0
  473. package/dist/console/runtime/public/console/chunks/terraform-v0KN9QQh-DswuEJGm.js +1 -0
  474. package/dist/console/runtime/public/console/chunks/tex-Bbhb8xAP-9R8lE_en.js +1 -0
  475. package/dist/console/runtime/public/console/chunks/tokyo-night-BKYoawWu-oM2G3aXe.js +1 -0
  476. package/dist/console/runtime/public/console/chunks/tokyo-night-oM2G3aXe.js +1 -0
  477. package/dist/console/runtime/public/console/chunks/toml-B7BHZIqX-CcmNWLt0.js +1 -0
  478. package/dist/console/runtime/public/console/chunks/ts-tags-DH1AB-Ri-CgEe3BFX.js +1 -0
  479. package/dist/console/runtime/public/console/chunks/ts-tags-DJjZLMnt.js +1 -0
  480. package/dist/console/runtime/public/console/chunks/tsv-BorGVq2Z-sltzmVWM.js +1 -0
  481. package/dist/console/runtime/public/console/chunks/tsx-B7QamQLF.js +1 -0
  482. package/dist/console/runtime/public/console/chunks/tsx-BR8s1Lhs-DiW36VFk.js +1 -0
  483. package/dist/console/runtime/public/console/chunks/turtle-BEG5g_eT-ByJddavk.js +1 -0
  484. package/dist/console/runtime/public/console/chunks/tv-WsfYJXat.js +1 -0
  485. package/dist/console/runtime/public/console/chunks/twig-DziFF7iU-DLOFbR4k.js +1 -0
  486. package/dist/console/runtime/public/console/chunks/typescript-D8TR6ff2-CCKRkaRI.js +1 -0
  487. package/dist/console/runtime/public/console/chunks/typescript-DzLO-qqB.js +1 -0
  488. package/dist/console/runtime/public/console/chunks/typespec-C_R5TbvO-BRdr0IET.js +1 -0
  489. package/dist/console/runtime/public/console/chunks/typst-BV9w0z8--DI99ib-x.js +1 -0
  490. package/dist/console/runtime/public/console/chunks/v-DfbeXLo8-DETTlOr0.js +1 -0
  491. package/dist/console/runtime/public/console/chunks/vala-BnnASFsX-zf12oZj6.js +1 -0
  492. package/dist/console/runtime/public/console/chunks/vb-DU29mvss-Djn5o6TS.js +1 -0
  493. package/dist/console/runtime/public/console/chunks/verilog-BW5U03XW-CiiDBU1e.js +1 -0
  494. package/dist/console/runtime/public/console/chunks/vesper-ClvmKzqD-DdrHHSXu.js +1 -0
  495. package/dist/console/runtime/public/console/chunks/vesper-DdrHHSXu.js +1 -0
  496. package/dist/console/runtime/public/console/chunks/vhdl-Co2XFKY7-BroJfC0k.js +1 -0
  497. package/dist/console/runtime/public/console/chunks/viml-BReTXeDA-DvXPmvsu.js +1 -0
  498. package/dist/console/runtime/public/console/chunks/vitesse-black-BY6Qtyq--fwtXNY1n.js +1 -0
  499. package/dist/console/runtime/public/console/chunks/vitesse-black-fwtXNY1n.js +1 -0
  500. package/dist/console/runtime/public/console/chunks/vitesse-dark-BT-v_EgR-BZCL-v6S.js +1 -0
  501. package/dist/console/runtime/public/console/chunks/vitesse-dark-BZCL-v6S.js +1 -0
  502. package/dist/console/runtime/public/console/chunks/vitesse-light-Box8ZFz6-VbXTXTou.js +1 -0
  503. package/dist/console/runtime/public/console/chunks/vitesse-light-VbXTXTou.js +1 -0
  504. package/dist/console/runtime/public/console/chunks/vue-BRy8iDCZ-CL7P9CNz.js +1 -0
  505. package/dist/console/runtime/public/console/chunks/vue-CQQ6_PvN.js +1 -0
  506. package/dist/console/runtime/public/console/chunks/vue-html-B24bjO_3-BY2skbNe.js +1 -0
  507. package/dist/console/runtime/public/console/chunks/vue-html-Ce5SCNOK.js +1 -0
  508. package/dist/console/runtime/public/console/chunks/vue-vine-DKH1_YEZ.js +1 -0
  509. package/dist/console/runtime/public/console/chunks/vue-vine-l7O7Mg81-CFWzX3HC.js +1 -0
  510. package/dist/console/runtime/public/console/chunks/vue.runtime.esm-bundler-COh-O3z7.js +3 -0
  511. package/dist/console/runtime/public/console/chunks/vyper-C6KGx0YU-CgoNMtux.js +1 -0
  512. package/dist/console/runtime/public/console/chunks/wasm-BRCjOXGL-BnjxR4X6.js +1 -0
  513. package/dist/console/runtime/public/console/chunks/wasm-BnjxR4X6.js +1 -0
  514. package/dist/console/runtime/public/console/chunks/wasm-ByWQv1Qj.js +1 -0
  515. package/dist/console/runtime/public/console/chunks/wasm-gNIKwGlD-ByWQv1Qj.js +1 -0
  516. package/dist/console/runtime/public/console/chunks/wenyan-BeysbCrW-C8pVoKbM.js +1 -0
  517. package/dist/console/runtime/public/console/chunks/wgsl-1s5rV5xS-BsKzXJz4.js +1 -0
  518. package/dist/console/runtime/public/console/chunks/wgsl-BsKzXJz4.js +1 -0
  519. package/dist/console/runtime/public/console/chunks/wikitext-wjhjmmzD-ClFFjSW2.js +1 -0
  520. package/dist/console/runtime/public/console/chunks/wit-CeQiCbz_-DdvCle-K.js +1 -0
  521. package/dist/console/runtime/public/console/chunks/wit-DdvCle-K.js +1 -0
  522. package/dist/console/runtime/public/console/chunks/wolfram-CcZPfnLd-DLL8P-h_.js +1 -0
  523. package/dist/console/runtime/public/console/chunks/xml-CduVPlYa-BZCwbgEk.js +1 -0
  524. package/dist/console/runtime/public/console/chunks/xml-G-voesMw.js +1 -0
  525. package/dist/console/runtime/public/console/chunks/xsl-BeH_vLTK-DeKk-5KU.js +1 -0
  526. package/dist/console/runtime/public/console/chunks/yaml-Cb0uRU1q-CkSC4c4u.js +1 -0
  527. package/dist/console/runtime/public/console/chunks/yaml-rwi0_p6S.js +1 -0
  528. package/dist/console/runtime/public/console/chunks/zenscript-BoijL7rl-BnlCZFoB.js +1 -0
  529. package/dist/console/runtime/public/console/chunks/zig-lTQvxhLD-CMLA9XwU.js +1 -0
  530. package/dist/console/runtime/public/console/console-Bwq3z75a.css +3 -0
  531. package/dist/console/runtime/public/console/console-Cl-xrMah.js +1371 -0
  532. package/dist/console/runtime/rpc.d.ts +35 -0
  533. package/dist/console/runtime/rpc.js +16 -0
  534. package/dist/console/runtime/sections.d.ts +2 -0
  535. package/dist/console/runtime/sections.js +126 -0
  536. package/dist/console/runtime/server/agents.get.d.ts +9 -0
  537. package/dist/console/runtime/server/agents.get.js +12 -0
  538. package/dist/console/runtime/server/blob.d.ts +2 -0
  539. package/dist/console/runtime/server/blob.get.d.ts +25 -0
  540. package/dist/console/runtime/server/blob.get.js +74 -0
  541. package/dist/console/runtime/server/blob.js +18 -0
  542. package/dist/console/runtime/server/database.d.ts +2 -0
  543. package/dist/console/runtime/server/database.get.d.ts +51 -0
  544. package/dist/console/runtime/server/database.get.js +192 -0
  545. package/dist/console/runtime/server/database.js +17 -0
  546. package/dist/console/runtime/server/definitions.d.ts +2 -0
  547. package/dist/console/runtime/server/definitions.get.d.ts +10 -0
  548. package/dist/console/runtime/server/definitions.get.js +23 -0
  549. package/dist/console/runtime/server/definitions.js +22 -0
  550. package/dist/console/runtime/server/devframe.d.ts +13 -0
  551. package/dist/console/runtime/server/devframe.js +133 -0
  552. package/dist/console/runtime/server/invocation-capabilities.get.d.ts +8 -0
  553. package/dist/console/runtime/server/invocation-capabilities.get.js +14 -0
  554. package/dist/console/runtime/server/invocation.get.d.ts +36 -0
  555. package/dist/console/runtime/server/invocation.get.js +46 -0
  556. package/dist/console/runtime/server/invocations.get.d.ts +7 -0
  557. package/dist/console/runtime/server/invocations.get.js +225 -0
  558. package/dist/console/runtime/server/kv.d.ts +2 -0
  559. package/dist/console/runtime/server/kv.get.d.ts +24 -0
  560. package/dist/console/runtime/server/kv.get.js +236 -0
  561. package/dist/console/runtime/server/kv.js +18 -0
  562. package/dist/console/runtime/server/page.get.d.ts +6 -0
  563. package/dist/console/runtime/server/page.get.js +33 -0
  564. package/dist/console/runtime/server/search.get.d.ts +8 -0
  565. package/dist/console/runtime/server/search.get.js +2 -0
  566. package/dist/console/runtime/server/sections.d.ts +2 -0
  567. package/dist/console/runtime/server/sections.get.d.ts +9 -0
  568. package/dist/console/runtime/server/sections.get.js +13 -0
  569. package/dist/console/runtime/server/sections.js +16 -0
  570. package/dist/console/runtime/server/usage.get.d.ts +6 -0
  571. package/dist/console/runtime/server/usage.get.js +44 -0
  572. package/dist/console/server.d.ts +7 -0
  573. package/dist/console/server.js +28 -0
  574. package/dist/console.d.ts +4 -0
  575. package/dist/console.js +4 -0
  576. package/dist/database/drizzle.d.ts +16 -1
  577. package/dist/database/drizzle.js +8 -1
  578. package/dist/database-CW-WjW4u.d.ts +8 -0
  579. package/dist/definitions-BHmB22eM.d.ts +7 -0
  580. package/dist/definitions-CfSmoS5G.d.ts +17 -0
  581. package/dist/env/provider.d.ts +1 -0
  582. package/dist/env/provider.js +2 -0
  583. package/dist/env.d.ts +1 -0
  584. package/dist/index-B072hyCd.d.ts +59 -0
  585. package/dist/index.d.ts +2 -44
  586. package/dist/index.js +2 -1
  587. package/dist/internal-12r-XCbk.d.ts +20 -0
  588. package/dist/internal-DzLLx0iR.js +304 -0
  589. package/dist/invocations-qwMRTSy7.js +364 -0
  590. package/dist/kv-DLGscNQ_.d.ts +8 -0
  591. package/dist/nuxt.d.ts +56 -4
  592. package/dist/nuxt.js +701 -21
  593. package/dist/realtime/server.d.ts +1 -0
  594. package/dist/realtime/server.js +2 -0
  595. package/dist/realtime/vue.d.ts +1 -0
  596. package/dist/realtime/vue.js +2 -0
  597. package/dist/realtime.d.ts +1 -0
  598. package/dist/realtime.js +2 -0
  599. package/dist/request-DxBwxGnk.js +72 -0
  600. package/dist/request-NErg_P5m.d.ts +43 -0
  601. package/dist/runtime/node.d.ts +1 -0
  602. package/dist/runtime/node.js +2 -0
  603. package/dist/search.get-ClTCn-mh.js +100 -0
  604. package/dist/sections-7HoMOIGH.d.ts +9 -0
  605. package/dist/sections-DVsqeLAF.d.ts +100 -0
  606. package/dist/server-BFxDhCzA.d.ts +78 -0
  607. package/dist/source/client.d.ts +1 -0
  608. package/dist/source/client.js +2 -0
  609. package/dist/source/content/client.d.ts +1 -0
  610. package/dist/source/content/client.js +2 -0
  611. package/dist/source/content.d.ts +1 -0
  612. package/dist/source/content.js +2 -0
  613. package/dist/source/file.d.ts +1 -0
  614. package/dist/source/file.js +2 -0
  615. package/dist/source/github.d.ts +1 -0
  616. package/dist/source/github.js +2 -0
  617. package/dist/source/glob.d.ts +1 -0
  618. package/dist/source/glob.js +2 -0
  619. package/dist/source/markdown.d.ts +1 -0
  620. package/dist/source/markdown.js +2 -0
  621. package/dist/source/mcp.d.ts +1 -0
  622. package/dist/source/mcp.js +2 -0
  623. package/dist/source/server.d.ts +24 -0
  624. package/dist/source/server.js +25 -0
  625. package/dist/source/vite.d.ts +8 -0
  626. package/dist/source/vite.js +18 -0
  627. package/dist/source.d.ts +66 -1
  628. package/dist/source.js +103 -1
  629. package/dist/src-XEJGHDr9.js +5247 -0
  630. package/dist/types-BucGTJnk.js +168 -0
  631. package/dist/ui/headless.d.ts +1 -0
  632. package/dist/ui/headless.js +2 -0
  633. package/dist/ui/nuxt.d.ts +3 -0
  634. package/dist/ui/nuxt.js +3 -0
  635. package/dist/ui/styles.css +2562 -0
  636. package/dist/ui/vite.d.ts +3 -0
  637. package/dist/ui/vite.js +3 -0
  638. package/dist/ui.d.ts +1 -0
  639. package/dist/ui.js +2 -0
  640. package/dist/usage-CoZa_8fx.js +361 -0
  641. package/package.json +119 -31
  642. package/dist/agent/harness/local-sandbox.d.ts +0 -1
  643. package/dist/agent/harness/local-sandbox.js +0 -2
  644. package/dist/email/drivers/smtp.d.ts +0 -1
  645. package/dist/email/drivers/smtp.js +0 -2
  646. package/dist/src-o6zB-soj.js +0 -1135
@@ -0,0 +1,1511 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/angular-html-Ct-40ew8-D8X9MCxo.js","chunks/html-CamevgpM-BbT95zHF.js","chunks/chunk-DK3Fl9T5.js","chunks/css-DTzmO9U0-CbxoEllx.js","chunks/javascript-C4sF7sej-B29qPxDa.js","chunks/angular-ts-D6akBVit-CAEqTior.js","chunks/scss-BQ7uffpQ-D2aPazKS.js","chunks/apl-Cxjn4xYu-QUZjoXcb.js","chunks/json-E4f3l6hr-DuNL0Aj9.js","chunks/xml-CduVPlYa-BZCwbgEk.js","chunks/java-Cfowl-Ex-BnGnzH2k.js","chunks/astro-BPVTb8uX-BMHg0UsI.js","chunks/postcss-D1gKt4z_-BXeXVLqQ.js","chunks/tsx-BR8s1Lhs-DiW36VFk.js","chunks/typescript-D8TR6ff2-CCKRkaRI.js","chunks/blade-0LMawyyw-CZBPwR53.js","chunks/html-derivative-jMOJf6rB-Kh3SdD3S.js","chunks/sql-CrPlEQn4-COghB3-E.js","chunks/bsl-0NWGiiFE-mk7PqslV.js","chunks/sdbl-CdQg5gu1-bTVj8UrX.js","chunks/c-Dc0_AVM6-CjS7AEt5.js","chunks/cairo-DjG4M3vq-xb-J0v0e.js","chunks/python-BjnOIxPe-gzcpVVnB.js","chunks/cobol-CocL1RYn-DoHa8rFw.js","chunks/coffee-DtqnQNu5-Ca3s2Keu.js","chunks/cpp-Mb4ikSI3-tLY9dtiu.js","chunks/glsl-pHhzolba-D3h1XPFw.js","chunks/regexp-5HbFqwky-C3xQXL6t.js","chunks/crystal-D4OMbAh_-C9omPlZ-.js","chunks/shellscript-B42c0JAn-D5OxpxEd.js","chunks/edge-DrFNu-N9-BY3pzybO.js","chunks/elixir-OpZyQ8Ht-CwWfuiQ1.js","chunks/elm-CjX_545P-Dn-DqM39.js","chunks/erb-trZRdc47-DRBdWH-D.js","chunks/ruby-BbVp0_gQ-BUOn3oxT.js","chunks/graphql-BjqekQIR-CtUxCAnJ.js","chunks/jsx-BZjOirBP-Dga5sQe3.js","chunks/haml-DVwRP8W9-C4Ue42xj.js","chunks/lua-BhkUWs1q-CVcL4bwV.js","chunks/yaml-Cb0uRU1q-CkSC4c4u.js","chunks/erlang-BJeTH9QH-BfDtvnHZ.js","chunks/markdown-CkmxmzqY-BYOwaDjH.js","chunks/fortran-fixed-form-B_eBTsj9-C2-rkbip.js","chunks/fortran-free-form-yxJ7igsv-CYNrtFtB.js","chunks/fsharp-UvrT6oWG-LCdvSpj6.js","chunks/gdresource-Dl9wvKCd-C3MGX-jo.js","chunks/gdscript-jjgTGGzd-Cp2uCuqX.js","chunks/gdshader-D7JfdFV3-CBce3t8t.js","chunks/git-commit-2LMniMoO-CfgJCLX7.js","chunks/diff-Blb4MjsC-woXpYk--.js","chunks/git-rebase-DUOURRPN-DbPsFIae.js","chunks/glimmer-js-D_32hFh8-Dv_1Q6fk.js","chunks/glimmer-ts-CVt002zd-PmMLyqBp.js","chunks/hack-BITNGzgt-BwY4KWmq.js","chunks/handlebars-T3TJj8Il-BLQCwuJT.js","chunks/http-BEHztmFP-BxphIJE7.js","chunks/hurl-LmFBxrwm-CGo4dqUD.js","chunks/csv-DqIVFkK7-Dx-8-gkx.js","chunks/hxml-BQ4V4Tez-BaHUc7lX.js","chunks/haxe-B0odltAZ-OTjmBuCE.js","chunks/jinja-CCAEwzP4-PaInFpq5.js","chunks/jison-BKCoBkyT-BRL7eVgb.js","chunks/julia-nEdJo0dp-CJRta6ZT.js","chunks/r-VqTZMNY_-EnO4GoeC.js","chunks/just-Brtw3q7S-DmytbepJ.js","chunks/perl-Bbgb6Twx-CHGXAzGq.js","chunks/latex-QHQNiZDD-fcyJN6QK.js","chunks/tex-Bbhb8xAP-9R8lE_en.js","chunks/liquid-DYQ7uW5u-JGNMHTpg.js","chunks/marko-BHWvxp04-U7nYXRKW.js","chunks/less-BzbdhFUi-DVTAwKKz.js","chunks/mdc-Dg7VPYLa-CshLRYP7.js","chunks/nextflow-CgUAk9iA-CTMUe4Ca.js","chunks/nextflow-groovy-CdFFX-gF-DJMQeKeT.js","chunks/nginx-Q-E8IJvs-DiQO9reH.js","chunks/nim-CNcTuF14-W9Ucwkhx.js","chunks/php-CBOR45_G-D5pyod9R.js","chunks/pug-Cn_U_o_I-Cw4zFEpZ.js","chunks/qml-DNlrbxJT-B_IzAFFX.js","chunks/razor-Bw2un3e8-CtGvw0jo.js","chunks/csharp-CFKaLbHg-oqKa8noW.js","chunks/rst-BZPDb03W-BDIwqmQR.js","chunks/cmake-DPsCB_V6-Bj61d0ZC.js","chunks/sas-DSkdG4wF-BE4zxtJ7.js","chunks/shaderlab-CWP9wBCf-C6U2tjWC.js","chunks/hlsl-BJLUNfne-Cvrh5tZx.js","chunks/shellsession-Oc9-NqAv-C1K_F4Is.js","chunks/soy-tgh9u9aW-Cm_LtJoW.js","chunks/sparql-B4t0ZbEe-CXgkFCv7.js","chunks/turtle-BEG5g_eT-ByJddavk.js","chunks/stata-D_KqT8cj-oQQpG6t_.js","chunks/surrealql-C0KhgoyZ-DqXNFH_A.js","chunks/svelte-DuHT0xxw-Bs0TxuUS.js","chunks/templ-DF54artD-BPb_zNLV.js","chunks/go-aXtTCanQ-rLFTqkRN.js","chunks/ts-tags-DH1AB-Ri-CgEe3BFX.js","chunks/twig-DziFF7iU-DLOFbR4k.js","chunks/vue-BRy8iDCZ-CL7P9CNz.js","chunks/vue-html-B24bjO_3-BY2skbNe.js","chunks/vue-vine-l7O7Mg81-CFWzX3HC.js","chunks/stylus-ZZDn1yUO-B6D30XZt.js","chunks/xsl-BeH_vLTK-DeKk-5KU.js"])))=>i.map(i=>d[i]);
2
+ import{C as e,M as t,Z as n,b as r,d as i,ht as a}from"./vue.runtime.esm-bundler-COh-O3z7.js";import{A as o,B as s,C as c,D as l,E as u,F as d,I as f,L as p,M as m,N as h,O as g,P as _,R as v,S as y,T as b,_ as x,b as S,d as C,f as w,g as T,h as E,j as ee,k as D,m as O,p as k,u as te,v as A,w as j,x as ne,y as re,z as M}from"../console-Cl-xrMah.js";var ie=Object.defineProperty,ae=(e,t)=>{let n={};for(var r in e)ie(n,r,{get:e[r],enumerable:!0});return t||ie(n,Symbol.toStringTag,{value:`Module`}),n},oe=new Set,se=null;function ce(e){oe.add(e),se??=requestAnimationFrame(ue)}function le(e){oe.delete(e)&&oe.size===0&&se!=null&&(cancelAnimationFrame(se),se=null)}function ue(e){let t=new Set(oe);oe.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}se=oe.size>0?requestAnimationFrame(ue):null}function de(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function fe(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function pe(e,t){let n=e?.theme??A,r=t?.theme??A,i=me(e),a=me(t);return fe(n,r)&&de(e,t,[`theme`,`parseDiffOptions`])&&de(i,a)}function me(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function he(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function ge({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function _e(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function N(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function P(e){return{type:`text`,value:e}}function F({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function ve({name:e,width:t=16,height:n=16,properties:r}){return F({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[F({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function ye(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function be(e){return F({tagName:`div`,properties:{"data-gutter":``},children:e})}function xe(e,t,n,r={}){return F({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[F({tagName:`span`,properties:{"data-line-number-content":``},children:[P(`${t}`)]})]})}function I(e,t,n){return F({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Se(){return F({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[ve({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Ce(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function we(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Te=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Ee=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ee.prototype.normal={},Ee.prototype.property={},Ee.prototype.space=void 0;function De(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ee(n,r,t)}function Oe(e){return e.toLowerCase()}var L=class{constructor(e,t){this.attribute=t,this.property=e}};L.prototype.attribute=``,L.prototype.booleanish=!1,L.prototype.boolean=!1,L.prototype.commaOrSpaceSeparated=!1,L.prototype.commaSeparated=!1,L.prototype.defined=!1,L.prototype.mustUseProperty=!1,L.prototype.number=!1,L.prototype.overloadedBoolean=!1,L.prototype.property=``,L.prototype.spaceSeparated=!1,L.prototype.space=void 0;var ke=ae({boolean:()=>R,booleanish:()=>z,commaOrSpaceSeparated:()=>H,commaSeparated:()=>Me,number:()=>B,overloadedBoolean:()=>je,spaceSeparated:()=>V}),Ae=0,R=Ne(),z=Ne(),je=Ne(),B=Ne(),V=Ne(),Me=Ne(),H=Ne();function Ne(){return 2**++Ae}var Pe=Object.keys(ke),Fe=class extends L{constructor(e,t,n,r){let i=-1;if(super(e,t),Ie(this,`space`,r),typeof n==`number`)for(;++i<Pe.length;){let e=Pe[i];Ie(this,Pe[i],(n&ke[e])===ke[e])}}};Fe.prototype.defined=!0;function Ie(e,t,n){n&&(e[t]=n)}function Le(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Fe(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Oe(r)]=r,n[Oe(a.attribute)]=r}return new Ee(t,n,e.space)}var Re=Le({properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:z,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:V,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:z,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ze(e,t){return t in e?e[t]:t}function Be(e,t){return ze(e,t.toLowerCase())}var Ve=Le({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Me,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:V,autoFocus:R,autoPlay:R,blocking:V,capture:null,charSet:null,checked:R,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:z,controls:R,controlsList:V,coords:B|Me,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:je,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:V,height:B,hidden:je,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:V,itemRef:V,itemScope:R,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:V,required:R,reversed:R,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:z,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:Me,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:Be}),He=Le({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:H,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Me,g2:Me,glyphName:Me,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:H,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:H,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:H,rev:H,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:H,requiredFeatures:H,requiredFonts:H,requiredFormats:H,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:H,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:H,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:H,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ze}),Ue=Le({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),We=Le({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Be}),Ge=Le({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ke=/[A-Z]/g,qe=/-[a-z]/g,Je=/^data[-\w.:]+$/i;function Ye(e,t){let n=Oe(t),r=t,i=L;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Je.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(qe,Ze);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!qe.test(e)){let n=e.replace(Ke,Xe);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Fe}return new i(r,t)}function Xe(e){return`-`+e.toLowerCase()}function Ze(e){return e.charAt(1).toUpperCase()}var Qe=De([Re,Ve,Ue,We,Ge],`html`),$e=De([Re,He,Ue,We,Ge],`svg`),et={}.hasOwnProperty;function tt(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&et.call(t,e)){let n=String(t[e]);i=et.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var nt=/["&'<>`]/g,rt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,it=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,at=/[|\\{}()[\]^$+*?.]/g,ot=new WeakMap;function st(e,t){if(e=e.replace(t.subset?ct(t.subset):nt,r),t.subset||t.escapeOnly)return e;return e.replace(rt,n).replace(it,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function ct(e){let t=ot.get(e);return t||(t=lt(e),ot.set(e,t)),t}function lt(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(at,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var ut=/[\dA-Fa-f]/;function dt(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!ut.test(String.fromCharCode(t))?r:r+`;`}var ft=/\d/;function pt(e,t,n){let r=`&#`+String(e);return n&&t&&!ft.test(String.fromCharCode(t))?r:r+`;`}var mt=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ht={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},gt=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],_t={}.hasOwnProperty,vt={},yt;for(yt in ht)_t.call(ht,yt)&&(vt[ht[yt]]=yt);var bt=/[^\dA-Za-z]/;function xt(e,t,n,r){let i=String.fromCharCode(e);if(_t.call(vt,i)){let e=vt[i],a=`&`+e;return n&&mt.includes(e)&&!gt.includes(e)&&(!r||t&&t!==61&&bt.test(String.fromCharCode(t)))?a:a+`;`}return``}function St(e,t,n){let r=dt(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=xt(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=pt(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Ct(e,t){return st(e,Object.assign({format:St},t))}var wt=/^>|^->|<!--|-->|--!>|<!-$/g,Tt=[`>`],Et=[`<`,`>`];function Dt(e,t,n,r){return r.settings.bogusComments?`<?`+Ct(e.value,Object.assign({},r.settings.characterReferences,{subset:Tt}))+`>`:`<!--`+e.value.replace(wt,i)+`-->`;function i(e){return Ct(e,Object.assign({},r.settings.characterReferences,{subset:Et}))}}function Ot(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function kt(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function At(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function jt(e){return e.join(` `).trim()}var Mt=/[ \t\n\f\r]/g;function Nt(e){return typeof e==`object`?e.type===`text`?Pt(e.value):!1:Pt(e)}function Pt(e){return e.replace(Mt,``)===``}var U=Lt(1),Ft=Lt(-1),It=[];function Lt(e){return t;function t(t,n,r){let i=t?t.children:It,a=(n||0)+e,o=i[a];if(!r)for(;o&&Nt(o);)a+=e,o=i[a];return o}}var Rt={}.hasOwnProperty;function zt(e){return t;function t(t,n,r){return Rt.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Bt=zt({body:Ut,caption:Vt,colgroup:Vt,dd:qt,dt:Kt,head:Vt,html:Ht,li:Gt,optgroup:Yt,option:Xt,p:Wt,rp:Jt,rt:Jt,tbody:Qt,td:tn,tfoot:$t,th:tn,thead:Zt,tr:en});function Vt(e,t,n){let r=U(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Nt(r.value.charAt(0)))}function Ht(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function Ut(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function Wt(e,t,n){let r=U(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Gt(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Kt(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function qt(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Jt(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Yt(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Xt(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Zt(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Qt(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function $t(e,t,n){return!U(n,t)}function en(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function tn(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var nn=zt({body:on,colgroup:sn,head:an,html:rn,tbody:cn});function rn(e){let t=U(e,-1);return!t||t.type!==`comment`}function an(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function on(e){let t=U(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Nt(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function sn(e,t,n){let r=Ft(n,t),i=U(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Bt(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function cn(e,t,n){let r=Ft(n,t),i=U(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Bt(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var ln={name:[[`
3
+ \f\r &/=>`.split(``),`
4
+ \f\r "&'/=>\``.split(``)],[`\0
5
+ \f\r "&'/<=>`.split(``),`\0
6
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
7
+ \f\r &>`.split(``),`\0
8
+ \f\r "&'<=>\``.split(``)],[`\0
9
+ \f\r "&'<=>\``.split(``),`\0
10
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function un(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=$e);let l=dn(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!nn(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!Bt(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function dn(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=fn(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function fn(e,t,n){let r=Ye(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Ct(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ln.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?At:jt)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Ct(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ln.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&kt(n,o)>kt(n,e.alternative)&&(o=e.alternative),s=o+Ct(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?ln.single:ln.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var pn=[`<`,`&`];function mn(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Ct(e.value,Object.assign({},r.settings.characterReferences,{subset:pn}))}function hn(e,t,n,r){return r.settings.allowDangerousHtml?e.value:mn(e,t,n,r)}function gn(e,t,n,r){return r.all(e)}var _n=tt(`type`,{invalid:vn,unknown:yn,handlers:{comment:Dt,doctype:Ot,element:un,raw:hn,root:gn,text:mn}});function vn(e){throw Error("Expected node, not `"+e+"`")}function yn(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var bn={},xn={},Sn=[];function W(e,t){let n=t||bn,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Cn,all:wn,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Te,characterReferences:n.characterReferences||xn,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?$e:Qe,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Cn(e,t,n){return _n(e,t,n,this)}function wn(e){let t=[],n=e&&e.children||Sn,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Tn=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),le(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||he(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&we(e.composedPath())||(Wn(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(Wn(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(Wn(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){Wn(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();Wn(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);Wn(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=An(i)&&this.hoveredLine?.lineElement===i.lineElement;kn(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),kn(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),An(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Mn(i)&&p!=null){p(i);break}if(jn(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!An(i))break;kn(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,Wn(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),Wn(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),Wn(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();we(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r==null||i==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Ce(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=W(Se());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);On(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(!(r==null||i==null))return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(Fn(t));if(On(n)&&!(this.mode===`diff`&&e.side!=null&&n.side!==e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(On(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(On(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&we(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=Fn(e);if(t&&we(n))return;let r=In(e);return r==null?this.pathFromAnnotationSlot(e):Fn(r)}pathFromAnnotationSlot(e){let t=Rn(Ln(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:Fn(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=zn(t)?t:zn(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}he(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,ce(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{le(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!Vn(this.renderedSelectedLinesState,n),i=!Vn(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Nn(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=Un(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=Un(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:Pn(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Pn(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Hn(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Hn(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function En({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Dn({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Dn({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function On(e){return e!=null&&`kind`in e&&e.kind===`line`}function kn(e){return e!=null&&`kind`in e&&e.kind===`token`}function An(e){return On(e)||kn(e)}function jn(e){return`type`in e&&e.type===`line-info`}function Mn(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Nn(e){return e===`current`||e===`incoming`||e===`both`}function Pn(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Fn(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function In(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function Ln(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function Rn(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function zn(e){return e!=null&&typeof e.elementFromPoint==`function`}function Bn(e,t){return e===t||he(e??void 0,t??void 0)}function Vn(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Bn(e?.range??null,t.range)}function Hn(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function Un(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function Wn(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return;break}console.log(...n)}var Gn=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),Jn(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?Zn(t):Qn(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:Kn(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:qn(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&Yn(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function Kn(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function qn(e){return Math.max(Math.ceil(e),0)}function Jn(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Yn(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Xn(e))}function Yn(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function Xn(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function Zn(e){e.codeElement.isConnected&&Xn(e)}function Qn(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var $n=new Map,er=new Map,tr=new Map,nr=new Set;function rr(e){for(let t of Array.isArray(e)?e:[e])if(!(t===`text`||t===`ansi`)&&!nr.has(t))return!1;return!0}function ir(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(nr.has(n.name))continue;let e=$n.get(n.name);e??(e=n,$n.set(n.name,e)),nr.add(e.name),t.loadLanguageSync(e.data)}}function ar(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var or=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,cr=Object.getOwnPropertyNames,lr=Object.prototype.hasOwnProperty,ur=(e,t)=>{let n={};for(var r in e)or(n,r,{get:e[r],enumerable:!0});return t||or(n,Symbol.toStringTag,{value:`Module`}),n},dr=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=cr(t),a=0,o=i.length,s;a<o;a++)s=i[a],!lr.call(e,s)&&s!==n&&or(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=sr(t,s))||r.enumerable});return e},fr=(e,t,n)=>(dr(e,t,`default`),n&&dr(n,t,`default`)),pr=[{id:`abap`,name:`ABAP`,import:(()=>s(()=>import(`./abap-LtYK6g-v-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>s(()=>import(`./actionscript-3-Czo0lKSf--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>s(()=>import(`./ada-twHwrVWN-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>s(()=>import(`./angular-html-Ct-40ew8-D8X9MCxo.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>s(()=>import(`./angular-ts-D6akBVit-CAEqTior.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>s(()=>import(`./apache-BIl2qPOf-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>s(()=>import(`./apex-BkQQFAhi-VAyPSnFM.js`),[]))},{id:`apl`,name:`APL`,import:(()=>s(()=>import(`./apl-Cxjn4xYu-QUZjoXcb.js`),__vite__mapDeps([7,3,2,1,4,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>s(()=>import(`./applescript-CJ80B5XJ-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>s(()=>import(`./ara-IxnQjO6j-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>s(()=>import(`./asciidoc-Dsw6zvwf-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>s(()=>import(`./asm-wBDSgBbA-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>s(()=>import(`./astro-BPVTb8uX-BMHg0UsI.js`),__vite__mapDeps([11,3,2,4,8,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>s(()=>import(`./awk-D6dA05Ye-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>s(()=>import(`./ballerina-DIdXD2KH-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>s(()=>import(`./bat-hQslfzu--Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>s(()=>import(`./beancount-CXtOQ8oS-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>s(()=>import(`./berry-CgA2ea0_-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>s(()=>import(`./bibtex-BzgdqG3s-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>s(()=>import(`./bicep-CZ338dSk-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>s(()=>import(`./bird2-GLyzhwkD-C6vDhewU.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>s(()=>import(`./blade-0LMawyyw-CZBPwR53.js`),__vite__mapDeps([15,3,2,1,4,16,8,17,9,10])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>s(()=>import(`./bsl-0NWGiiFE-mk7PqslV.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>s(()=>import(`./c-Dc0_AVM6-CjS7AEt5.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([20,2])))},{id:`c3`,name:`C3`,import:(()=>s(()=>import(`./c3-BLXk7BLN-BFHwR3_K.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>s(()=>import(`./cadence-B1ELWULD-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>s(()=>import(`./cairo-DjG4M3vq-xb-J0v0e.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>s(()=>import(`./clarity-2iIoRiLx-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>s(()=>import(`./clojure-DDsQ0FaV-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>s(()=>import(`./cmake-DPsCB_V6-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>s(()=>import(`./cobol-CocL1RYn-DoHa8rFw.js`),__vite__mapDeps([23,1,2,3,4,10])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>s(()=>import(`./codeowners-CxEKPWu0-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>s(()=>import(`./codeql-BwdvwJnv-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>s(()=>import(`./coffee-DtqnQNu5-Ca3s2Keu.js`),__vite__mapDeps([24,4,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>s(()=>import(`./common-lisp-DJtwvW4V-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>s(()=>import(`./coq-Ds6Ye5el-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>s(()=>import(`./cpp-Mb4ikSI3-tLY9dtiu.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([25,2,26,20,27,17])))},{id:`crystal`,name:`Crystal`,import:(()=>s(()=>import(`./crystal-D4OMbAh_-C9omPlZ-.js`),__vite__mapDeps([28,20,2,3,1,4,29,17])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>s(()=>import(`./csharp-CFKaLbHg-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>s(()=>import(`./css-DTzmO9U0-CbxoEllx.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([3,2])))},{id:`csv`,name:`CSV`,import:(()=>s(()=>import(`./csv-DqIVFkK7-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>s(()=>import(`./cue-B5KneM5p-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>s(()=>import(`./cypher-D8Bb8Cq2-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>s(()=>import(`./d-BQY8TDgQ-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>s(()=>import(`./dart-C6DUdjib-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>s(()=>import(`./dax-S-Noo-ku-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>s(()=>import(`./desktop-BgOb7Aj4-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>s(()=>import(`./diff-Blb4MjsC-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>s(()=>import(`./docker-PC1tuYpa-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>s(()=>import(`./dotenv-Dkdv7Sm2-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>s(()=>import(`./dream-maker-CngiPd8U-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>s(()=>import(`./edge-DrFNu-N9-BY3pzybO.js`),__vite__mapDeps([30,1,2,3,4,16,14])))},{id:`elixir`,name:`Elixir`,import:(()=>s(()=>import(`./elixir-OpZyQ8Ht-CwWfuiQ1.js`),__vite__mapDeps([31,1,2,3,4])))},{id:`elm`,name:`Elm`,import:(()=>s(()=>import(`./elm-CjX_545P-Dn-DqM39.js`),__vite__mapDeps([32,26,2,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>s(()=>import(`./emacs-lisp-DxhFFVu_-B4R74twV.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>s(()=>import(`./erb-trZRdc47-DRBdWH-D.js`),__vite__mapDeps([33,1,2,3,4,34,20,25,26,27,17,35,36,13,14,37,38,29,9,10,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>s(()=>import(`./erlang-BJeTH9QH-BfDtvnHZ.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>s(()=>import(`./fennel-B3wtZRne-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>s(()=>import(`./fish-D7qAeWQz-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>s(()=>import(`./fluent-BjfpB34g-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>s(()=>import(`./fortran-fixed-form-B_eBTsj9-C2-rkbip.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>s(()=>import(`./fortran-free-form-yxJ7igsv-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>s(()=>import(`./fsharp-UvrT6oWG-LCdvSpj6.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>s(()=>import(`./gdresource-Dl9wvKCd-C3MGX-jo.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>s(()=>import(`./gdscript-jjgTGGzd-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>s(()=>import(`./gdshader-D7JfdFV3-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>s(()=>import(`./genie-DnK2KWIP-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>s(()=>import(`./gherkin-D6Lr12YQ-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>s(()=>import(`./git-commit-2LMniMoO-CfgJCLX7.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>s(()=>import(`./git-rebase-DUOURRPN-DbPsFIae.js`),__vite__mapDeps([50,29,2])))},{id:`gleam`,name:`Gleam`,import:(()=>s(()=>import(`./gleam-CTllUdfC-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>s(()=>import(`./glimmer-js-D_32hFh8-Dv_1Q6fk.js`),__vite__mapDeps([51,3,2,1,4,14])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>s(()=>import(`./glimmer-ts-CVt002zd-PmMLyqBp.js`),__vite__mapDeps([52,3,2,1,4,14])))},{id:`glsl`,name:`GLSL`,import:(()=>s(()=>import(`./glsl-pHhzolba-D3h1XPFw.js`).then(e=>e.n).then(e=>e.n),__vite__mapDeps([26,2,20])))},{id:`gn`,name:`GN`,import:(()=>s(()=>import(`./gn-DDjbVPF4-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>s(()=>import(`./gnuplot-DgWvVXI8-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>s(()=>import(`./go-aXtTCanQ-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>s(()=>import(`./graphql-BjqekQIR-CtUxCAnJ.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([35,2,4,36,13,14])))},{id:`groovy`,name:`Groovy`,import:(()=>s(()=>import(`./groovy-Bw2Ku4bU-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>s(()=>import(`./hack-BITNGzgt-BwY4KWmq.js`),__vite__mapDeps([53,1,2,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>s(()=>import(`./haml-DVwRP8W9-C4Ue42xj.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([37,2,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>s(()=>import(`./handlebars-T3TJj8Il-BLQCwuJT.js`),__vite__mapDeps([54,3,2,1,4,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>s(()=>import(`./haskell-CfGsE1Cf-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>s(()=>import(`./haxe-B0odltAZ-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>s(()=>import(`./hcl-DHg_Osgo-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>s(()=>import(`./hjson-Cuaphql8-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>s(()=>import(`./hlsl-BJLUNfne-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>s(()=>import(`./html-CamevgpM-BbT95zHF.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([1,2,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>s(()=>import(`./html-derivative-jMOJf6rB-Kh3SdD3S.js`),__vite__mapDeps([16,1,2,3,4])))},{id:`http`,name:`HTTP`,import:(()=>s(()=>import(`./http-BEHztmFP-BxphIJE7.js`),__vite__mapDeps([55,35,2,4,36,13,14,8,29,9,10])))},{id:`hurl`,name:`Hurl`,import:(()=>s(()=>import(`./hurl-LmFBxrwm-CGo4dqUD.js`),__vite__mapDeps([56,57,35,2,4,36,13,14,9,10])))},{id:`hxml`,name:`HXML`,import:(()=>s(()=>import(`./hxml-BQ4V4Tez-BaHUc7lX.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>s(()=>import(`./hy-CJKxDzbh-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>s(()=>import(`./imba-96qKoJCa-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>s(()=>import(`./ini-C24lZfdM-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>s(()=>import(`./java-Cfowl-Ex-BnGnzH2k.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([10,2])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>s(()=>import(`./javascript-C4sF7sej-B29qPxDa.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([4,2])))},{id:`jinja`,name:`Jinja`,import:(()=>s(()=>import(`./jinja-CCAEwzP4-PaInFpq5.js`),__vite__mapDeps([60,1,2,3,4])))},{id:`jison`,name:`Jison`,import:(()=>s(()=>import(`./jison-BKCoBkyT-BRL7eVgb.js`),__vite__mapDeps([61,4,2])))},{id:`json`,name:`JSON`,import:(()=>s(()=>import(`./json-E4f3l6hr-DuNL0Aj9.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([8,2])))},{id:`json5`,name:`JSON5`,import:(()=>s(()=>import(`./json5-xULSgPQI-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>s(()=>import(`./jsonc-Cu6rqcrJ-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>s(()=>import(`./jsonl-Bp0qqr10-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>s(()=>import(`./jsonnet-BafgE6cE-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>s(()=>import(`./jssm-Dx5A5sBR-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>s(()=>import(`./jsx-BZjOirBP-Dga5sQe3.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([36,2])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>s(()=>import(`./julia-nEdJo0dp-CJRta6ZT.js`),__vite__mapDeps([62,25,2,26,20,27,17,4,22,63])))},{id:`just`,name:`Just`,import:(()=>s(()=>import(`./just-Brtw3q7S-DmytbepJ.js`),__vite__mapDeps([64,4,2,65,3,1,17,9,10,22,34,20,25,26,27,35,36,13,14,37,38,29,39])))},{id:`kdl`,name:`KDL`,import:(()=>s(()=>import(`./kdl-DkTyxPcj-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>s(()=>import(`./kotlin-BHE8CoV9-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>s(()=>import(`./kusto-6FdaWTzR-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>s(()=>import(`./latex-QHQNiZDD-fcyJN6QK.js`),__vite__mapDeps([66,67,63,2])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>s(()=>import(`./lean-BwOKScIt-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>s(()=>import(`./less-BzbdhFUi-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>s(()=>import(`./liquid-DYQ7uW5u-JGNMHTpg.js`),__vite__mapDeps([68,3,2,1,4,8])))},{id:`llvm`,name:`LLVM IR`,import:(()=>s(()=>import(`./llvm-uY68ROGz-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>s(()=>import(`./log-Dad54gsi-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>s(()=>import(`./logo-DTXV8SKw-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>s(()=>import(`./lua-BhkUWs1q-CVcL4bwV.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([38,2,20])))},{id:`luau`,name:`Luau`,import:(()=>s(()=>import(`./luau-YC4aaMmR-FMPmPwt6.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>s(()=>import(`./make-B2ukzWs3-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>s(()=>import(`./markdown-CkmxmzqY-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>s(()=>import(`./marko-BHWvxp04-U7nYXRKW.js`),__vite__mapDeps([69,3,2,70,6,14])))},{id:`matlab`,name:`MATLAB`,import:(()=>s(()=>import(`./matlab-CfRK6IMC-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>s(()=>import(`./mdc-Dg7VPYLa-CshLRYP7.js`),__vite__mapDeps([71,16,1,2,3,4,41,39])))},{id:`mdx`,name:`MDX`,import:(()=>s(()=>import(`./mdx-BK9ZufRc-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>s(()=>import(`./mermaid-r7OoIYpE-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>s(()=>import(`./mipsasm-EL46Y4Xg-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>s(()=>import(`./mojo-YCzvCoMT-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>s(()=>import(`./moonbit-B_9L5rST-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>s(()=>import(`./move-Dqi5fhOb-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>s(()=>import(`./narrat-D9rrR0H5-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>s(()=>import(`./nextflow-CgUAk9iA-CTMUe4Ca.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>s(()=>import(`./nextflow-groovy-CdFFX-gF-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>s(()=>import(`./nginx-Q-E8IJvs-DiQO9reH.js`),__vite__mapDeps([74,38,2,20])))},{id:`nim`,name:`Nim`,import:(()=>s(()=>import(`./nim-CNcTuF14-W9Ucwkhx.js`),__vite__mapDeps([75,20,2,3,26,1,4,41,9,10])))},{id:`nix`,name:`Nix`,import:(()=>s(()=>import(`./nix-Bm1Ax-Z3-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>s(()=>import(`./nushell-r7hBzeS_-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>s(()=>import(`./objective-c-6dJF64Dt-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>s(()=>import(`./objective-cpp-_ooRQ-PY-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>s(()=>import(`./ocaml-vm1Y8An6-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>s(()=>import(`./odin-vjOJSyfV-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>s(()=>import(`./openscad-jn-f1Ocl-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>s(()=>import(`./pascal-D8-gNZ2I-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>s(()=>import(`./perl-Bbgb6Twx-CHGXAzGq.js`),__vite__mapDeps([65,3,2,1,4,17,9,10])))},{id:`php`,name:`PHP`,import:(()=>s(()=>import(`./php-CBOR45_G-D5pyod9R.js`),__vite__mapDeps([76,3,2,1,4,8,17,9,10])))},{id:`pkl`,name:`Pkl`,import:(()=>s(()=>import(`./pkl-C7lWzykI-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>s(()=>import(`./plsql-DCNXypXO-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>s(()=>import(`./po-IjpR1yHO-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>s(()=>import(`./polar-4pN1JrJ8-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>s(()=>import(`./postcss-D1gKt4z_-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>s(()=>import(`./powerquery-SrvS_NBM-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>s(()=>import(`./powershell-CpTLv_ai-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>s(()=>import(`./prisma-BWfa4-tI-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>s(()=>import(`./prolog-Bacii3Ue-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>s(()=>import(`./proto-ClkOcAW0-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>s(()=>import(`./pug-Cn_U_o_I-Cw4zFEpZ.js`),__vite__mapDeps([77,3,2,1,4])))},{id:`puppet`,name:`Puppet`,import:(()=>s(()=>import(`./puppet-CQlPp728-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>s(()=>import(`./purescript-CLpaGMbw-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>s(()=>import(`./python-BjnOIxPe-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>s(()=>import(`./qml-DNlrbxJT-B_IzAFFX.js`),__vite__mapDeps([78,4,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>s(()=>import(`./qmldir-Dz8ttxjf-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>s(()=>import(`./qss-Iltvkn1C-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>s(()=>import(`./r-VqTZMNY_-EnO4GoeC.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([63,2])))},{id:`racket`,name:`Racket`,import:(()=>s(()=>import(`./racket-DRv7j6nv-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>s(()=>import(`./raku-DI9yGpeW-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>s(()=>import(`./razor-Bw2un3e8-CtGvw0jo.js`),__vite__mapDeps([79,80,1,2,3,4])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>s(()=>import(`./reg-DpJf71oO-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>s(()=>import(`./regexp-5HbFqwky-C3xQXL6t.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([27,2])))},{id:`rel`,name:`Rel`,import:(()=>s(()=>import(`./rel-BT0iIKKw-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>s(()=>import(`./riscv-CvzikGLb-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>s(()=>import(`./ron-DzAo6FTJ-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>s(()=>import(`./rosmsg-CyYq6XdT-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>s(()=>import(`./rst-BZPDb03W-BDIwqmQR.js`),__vite__mapDeps([81,82,25,2,26,20,27,17,16,1,3,4,22,34,35,36,13,14,37,38,29,9,10,39])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>s(()=>import(`./ruby-BbVp0_gQ-BUOn3oxT.js`),__vite__mapDeps([34,20,2,25,26,27,17,3,35,4,36,13,14,37,1,38,29,9,10,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>s(()=>import(`./rust-COBzcmTx-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>s(()=>import(`./sas-DSkdG4wF-BE4zxtJ7.js`),__vite__mapDeps([83,17,2])))},{id:`sass`,name:`Sass`,import:(()=>s(()=>import(`./sass-DI2zJwx7-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>s(()=>import(`./scala-CtSYTRYT-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>s(()=>import(`./scheme-D3A2QBtM-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>s(()=>import(`./scss-BQ7uffpQ-D2aPazKS.js`).then(e=>e.n),__vite__mapDeps([6,3,2])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>s(()=>import(`./sdbl-CdQg5gu1-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>s(()=>import(`./shaderlab-CWP9wBCf-C6U2tjWC.js`),__vite__mapDeps([84,85])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>s(()=>import(`./shellscript-B42c0JAn-D5OxpxEd.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([29,2])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>s(()=>import(`./shellsession-Oc9-NqAv-C1K_F4Is.js`),__vite__mapDeps([86,29,2])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>s(()=>import(`./smalltalk-BEQkVl4K-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>s(()=>import(`./solidity-lB9VjfB9-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>s(()=>import(`./soy-tgh9u9aW-Cm_LtJoW.js`),__vite__mapDeps([87,1,2,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>s(()=>import(`./sparql-B4t0ZbEe-CXgkFCv7.js`),__vite__mapDeps([88,89])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>s(()=>import(`./splunk-xP_ZjUH2-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>s(()=>import(`./sql-CrPlEQn4-COghB3-E.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([17,2])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>s(()=>import(`./ssh-config-DXFPABYp-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>s(()=>import(`./stata-D_KqT8cj-oQQpG6t_.js`),__vite__mapDeps([90,17,2])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>s(()=>import(`./stylus-ZZDn1yUO-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>s(()=>import(`./surrealql-C0KhgoyZ-DqXNFH_A.js`),__vite__mapDeps([91,4,2])))},{id:`svelte`,name:`Svelte`,import:(()=>s(()=>import(`./svelte-DuHT0xxw-Bs0TxuUS.js`),__vite__mapDeps([92,3,2,4,12,14])))},{id:`swift`,name:`Swift`,import:(()=>s(()=>import(`./swift-BTPQlRLK-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>s(()=>import(`./system-verilog-BEoxaBuU-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>s(()=>import(`./systemd-DFbUltlW-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>s(()=>import(`./talonscript-CLxaFu-b-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>s(()=>import(`./tasl-_AAbKiWM-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>s(()=>import(`./tcl-DLe0Tsfm-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>s(()=>import(`./templ-DF54artD-BPb_zNLV.js`),__vite__mapDeps([93,3,2,94,4])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>s(()=>import(`./terraform-v0KN9QQh-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>s(()=>import(`./tex-Bbhb8xAP-9R8lE_en.js`),__vite__mapDeps([67,63,2])))},{id:`toml`,name:`TOML`,import:(()=>s(()=>import(`./toml-B7BHZIqX-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>s(()=>import(`./ts-tags-DH1AB-Ri-CgEe3BFX.js`),__vite__mapDeps([95,3,2,26,20,1,4,17,14,9,10])))},{id:`tsv`,name:`TSV`,import:(()=>s(()=>import(`./tsv-BorGVq2Z-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>s(()=>import(`./tsx-BR8s1Lhs-DiW36VFk.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([13,2])))},{id:`turtle`,name:`Turtle`,import:(()=>s(()=>import(`./turtle-BEG5g_eT-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>s(()=>import(`./twig-DziFF7iU-DLOFbR4k.js`),__vite__mapDeps([96,3,2,4,76,1,8,17,9,10,22,34,20,25,26,27,35,36,13,14,37,38,29,39,6])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>s(()=>import(`./typescript-D8TR6ff2-CCKRkaRI.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([14,2])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>s(()=>import(`./typespec-C_R5TbvO-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>s(()=>import(`./typst-BV9w0z8--DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>s(()=>import(`./v-DfbeXLo8-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>s(()=>import(`./vala-BnnASFsX-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>s(()=>import(`./vb-DU29mvss-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>s(()=>import(`./verilog-BW5U03XW-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>s(()=>import(`./vhdl-Co2XFKY7-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>s(()=>import(`./viml-BReTXeDA-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>s(()=>import(`./vue-BRy8iDCZ-CL7P9CNz.js`),__vite__mapDeps([97,3,2,1,4,16,8,14])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>s(()=>import(`./vue-html-B24bjO_3-BY2skbNe.js`),__vite__mapDeps([98,4,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>s(()=>import(`./vue-vine-l7O7Mg81-CFWzX3HC.js`),__vite__mapDeps([99,3,2,4,70,12,6,100])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>s(()=>import(`./vyper-C6KGx0YU-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>s(()=>import(`./wasm-gNIKwGlD-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>s(()=>import(`./wenyan-BeysbCrW-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>s(()=>import(`./wgsl-1s5rV5xS-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>s(()=>import(`./wikitext-wjhjmmzD-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>s(()=>import(`./wit-CeQiCbz_-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>s(()=>import(`./wolfram-CcZPfnLd-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>s(()=>import(`./xml-CduVPlYa-BZCwbgEk.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([9,2,10])))},{id:`xsl`,name:`XSL`,import:(()=>s(()=>import(`./xsl-BeH_vLTK-DeKk-5KU.js`),__vite__mapDeps([101,9,2,10])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>s(()=>import(`./yaml-Cb0uRU1q-CkSC4c4u.js`).then(e=>e.t).then(e=>e.n),__vite__mapDeps([39,2])))},{id:`zenscript`,name:`ZenScript`,import:(()=>s(()=>import(`./zenscript-BoijL7rl-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>s(()=>import(`./zig-lTQvxhLD-CMLA9XwU.js`),[]))}],mr=Object.fromEntries(pr.map(e=>[e.id,e.import])),hr=Object.fromEntries(pr.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),gr={...mr,...hr},_r=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>s(()=>import(`./andromeeda-DnSv6o6l-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>s(()=>import(`./aurora-x-XJ5I8rFc-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>s(()=>import(`./ayu-dark-CBRGL64--DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>s(()=>import(`./ayu-light-BlrCS3Ih-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>s(()=>import(`./ayu-mirage-CqpTmLcF-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>s(()=>import(`./catppuccin-frappe-COUg_LSX-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>s(()=>import(`./catppuccin-latte-r30LFfsa-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>s(()=>import(`./catppuccin-macchiato-D-EwZyPh-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>s(()=>import(`./catppuccin-mocha-C6RD5yh3-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>s(()=>import(`./dark-plus-BCxGtnt0-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>s(()=>import(`./dracula-fPErIccy-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>s(()=>import(`./dracula-soft-BrQbqXs8-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>s(()=>import(`./everforest-dark-gTeBQCos-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>s(()=>import(`./everforest-light-DUjxsp-2-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>s(()=>import(`./github-dark-Dg1hl_QD-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>s(()=>import(`./github-dark-default-Dym2P842-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>s(()=>import(`./github-dark-dimmed-7iDMx266-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>s(()=>import(`./github-dark-high-contrast-DkV2fyPG-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>s(()=>import(`./github-light-BQKYgor9-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>s(()=>import(`./github-light-default-BZhIfzqQ-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>s(()=>import(`./github-light-high-contrast-C7zHfx4C-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>s(()=>import(`./gruvbox-dark-hard-CQiwpF03-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>s(()=>import(`./gruvbox-dark-medium-BKe6XKBS-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>s(()=>import(`./gruvbox-dark-soft-Cz6U6pa4-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>s(()=>import(`./gruvbox-light-hard-DgU_i19B-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>s(()=>import(`./gruvbox-light-medium-D64I06ER-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>s(()=>import(`./gruvbox-light-soft-B-YxAs1L-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>s(()=>import(`./horizon-DYoumREk-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>s(()=>import(`./horizon-bright-CPyV7XIA-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>s(()=>import(`./houston-B3NWfq0V-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>s(()=>import(`./kanagawa-dragon-DExkuQAs-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>s(()=>import(`./kanagawa-lotus-qdYh7_RY-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>s(()=>import(`./kanagawa-wave-CSW_hADG-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>s(()=>import(`./laserwave-DkfjiLxA-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>s(()=>import(`./light-plus-DuO6rXxZ-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>s(()=>import(`./material-theme-C_YrwKEa-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>s(()=>import(`./material-theme-darker-DB3YVCla-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>s(()=>import(`./material-theme-lighter-D2fgNrBK-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>s(()=>import(`./material-theme-ocean-DVy172Rs-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>s(()=>import(`./material-theme-palenight-uMMwIfpG-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>s(()=>import(`./min-dark-C7Ec8I_2-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>s(()=>import(`./min-light-Be6foA7m-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>s(()=>import(`./monokai-CREPpJ3k-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>s(()=>import(`./night-owl-CqqbiLON-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>s(()=>import(`./night-owl-light-B9vYgGRt-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>s(()=>import(`./nord-BZ9DVmcN-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>s(()=>import(`./one-dark-pro-Ev8UPkf4-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>s(()=>import(`./one-light-CzxBC38_-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>s(()=>import(`./plastic-BGkJ2das-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>s(()=>import(`./poimandres-CpnMgZuc-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>s(()=>import(`./red-EHiRGXSv-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>s(()=>import(`./rose-pine-DTI-z1Qp-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>s(()=>import(`./rose-pine-dawn-BIiGXpWs-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>s(()=>import(`./rose-pine-moon-DU4wt90U-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>s(()=>import(`./slack-dark-BS2AOOdo-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>s(()=>import(`./slack-ochin-Nc7Cucwk-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>s(()=>import(`./snazzy-light-C2ghKZXY-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>s(()=>import(`./solarized-dark-UHgjRWhr-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>s(()=>import(`./solarized-light-B-Zcwve2-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>s(()=>import(`./synthwave-84-CPtGYwOz-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>s(()=>import(`./tokyo-night-BKYoawWu-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>s(()=>import(`./vesper-ClvmKzqD-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>s(()=>import(`./vitesse-black-BY6Qtyq--fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>s(()=>import(`./vitesse-dark-BT-v_EgR-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>s(()=>import(`./vitesse-light-Box8ZFz6-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),vr=ae({createOnigurumaEngine:()=>Wr,getDefaultWasmLoader:()=>Ur,loadWasm:()=>Lr,setDefaultWasmLoader:()=>Hr}),yr=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function br(){return 2147483648}function xr(){return typeof performance<`u`?performance.now():Date.now()}var Sr=(e,t)=>e+(t-e%t)%t;async function Cr(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=br();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Sr(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:xr,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var wr=Object.defineProperty,Tr=(e,t,n)=>t in e?wr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t,n)=>Tr(e,typeof t==`symbol`?t:t+``,n),K=null;function Er(e){throw new yr(e.UTF8ToString(e.getLastOnigError()))}var Dr=class e{constructor(t){G(this,`utf16Length`),G(this,`utf8Length`),G(this,`utf16Value`),G(this,`utf8Value`),G(this,`utf16OffsetToUtf8`),G(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Or=class e{constructor(t){if(G(this,`id`,++e.LAST_ID),G(this,`_onigBinding`),G(this,`content`),G(this,`utf16Length`),G(this,`utf8Length`),G(this,`utf16OffsetToUtf8`),G(this,`utf8OffsetToUtf16`),G(this,`ptr`),!K)throw new yr(`Must invoke loadWasm first.`);this._onigBinding=K,this.content=t;let n=new Dr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=K.omalloc(1e4),e._sharedPtrInUse=!0,K.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(K)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};G(Or,`LAST_ID`,0),G(Or,`_sharedPtr`,0),G(Or,`_sharedPtrInUse`,!1);var kr=Or,Ar=class{constructor(e){if(G(this,`_onigBinding`),G(this,`_ptr`),!K)throw new yr(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Dr(e[r]);t[r]=i.createString(K),n[r]=i.utf8Length}let r=K.omalloc(4*e.length);K.HEAPU32.set(t,r/4);let i=K.omalloc(4*e.length);K.HEAPU32.set(n,i/4);let a=K.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)K.ofree(t[n]);K.ofree(i),K.ofree(r),a===0&&Er(K),this._onigBinding=K,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new kr(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function jr(e){return typeof e.instantiator==`function`}function Mr(e){return typeof e.default==`function`}function Nr(e){return e.data!==void 0}function Pr(e){return typeof Response<`u`&&e instanceof Response}function Fr(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Ir;function Lr(e){if(Ir)return Ir;async function t(){K=await Cr(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),jr(n)?n=await n.instantiator(t):Mr(n)?n=await n.default(t):(Nr(n)&&(n=n.data),Pr(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await zr(n)(t):await Br(n)(t):Fr(n)||n instanceof WebAssembly.Module?n=await Rr(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Rr(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Ir=t(),Ir}function Rr(e){return t=>WebAssembly.instantiate(e,t)}function zr(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Br(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Vr;function Hr(e){Vr=e}function Ur(){return Vr}async function Wr(e){return e&&await Lr(e),{createScanner(e){return new Ar(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new kr(e)}}}var Gr=ur({});fr(Gr,vr);var q=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Kr(e){return qr(e)}function qr(e){return Array.isArray(e)?Jr(e):e instanceof RegExp?e:typeof e==`object`?Yr(e):e}function Jr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=qr(e[n]);return t}function Yr(e){let t={};for(let n in e)t[n]=qr(e[n]);return t}function Xr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Zr(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Zr(e.substring(0,e.length-1)):e.substr(~t+1)}var Qr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,$r=class{static hasCaptures(e){return e===null?!1:(Qr.lastIndex=0,Qr.test(e))}static replaceCaptures(e,t,n){return e.replace(Qr,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function ei(e,t){return e<t?-1:+(e>t)}function ti(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=ei(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function ni(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ri(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ii=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},ai=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ui(e),t)}static createFromParsedTheme(e,t){return fi(e,t)}_cachedMatchRoot=new ii(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>si(e.parent,t.parentScopes));return n?new li(n.fontStyle,n.foreground,n.background):null}},oi=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function si(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!ci(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ci(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var li=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ui(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&ni(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&ni(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new di(l,u,e,o,s,c)}}return n}var di=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},J=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(J||{});function fi(e,t){e.sort((e,t)=>{let n=ei(e.scope,t.scope);return n!==0||(n=ti(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new pi(t),o=new li(n,a.getId(r),a.getId(i)),s=new gi(new hi(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new ai(a,o,s)}var pi=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},mi=Object.freeze([]),hi=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||mi,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},gi=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),hi.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ti(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new hi(e,t,n,r,i))}},_i=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=yi(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function vi(e){return e}function yi(e){return e}function bi(e,t){let n=[],r=Si(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(xi(i)){let e=[];do e.push(i),i=r.next();while(xi(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function xi(e){return!!e&&!!e.match(/[\w\.:]+/)}function Si(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Ci(e){typeof e.dispose==`function`&&e.dispose()}var wi=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Ti=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ei=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Di=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new wi(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Ei;for(let n of e)Oi(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof wi){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Oi(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof wi?Ai({baseGrammar:a,selfGrammar:i},r):ki(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new wi(e))}function ki(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];ji([r],t,n)}}function Ai(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ji(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ji(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ji(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Xr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ji(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Li(i);switch(a.kind){case 0:Ai({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ai(t,n);break;case 2:ki(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?ki(a.ruleName,i,n):Ai(i,n)}else a.kind===4?n.add(new Ti(a.scopeName,a.ruleName)):n.add(new wi(a.scopeName));break}}}var Mi=class{kind=0},Ni=class{kind=1},Pi=class{constructor(e){this.ruleName=e}kind=2},Fi=class{constructor(e){this.scopeName=e}kind=3},Ii=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Li(e){if(e===`$base`)return new Mi;if(e===`$self`)return new Ni;let t=e.indexOf(`#`);return t===-1?new Fi(e):t===0?new Pi(e.substring(1)):new Ii(e.substring(0,t),e.substring(t+1))}var Ri=/\\(\d+)/,zi=/\\(\d+)/g,Bi=-1,Vi=-2;function Hi(e){return e}function Ui(e){return e}var Wi=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=$r.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=$r.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Zr(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:$r.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:$r.replaceCaptures(this._contentName,e,t)}},Gi=class extends Wi{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Ki=class extends Wi{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Zi(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Qi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qi=class extends Wi{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Qi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ji=class extends Wi{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Zi(i,this.id),this.beginCaptures=a,this._end=new Zi(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Qi;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Yi=class extends Wi{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Zi(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Zi(o,Vi),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Qi;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Qi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Xi=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Gi(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ki(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Xr({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new qi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Yi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ji(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Li(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof qi||e instanceof Ji||e instanceof Yi)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Zi=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Ri.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return zi.lastIndex=0,this.source.replace(zi,(e,t)=>ri(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Qi=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new $i(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new $i(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},$i=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
11
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},ea=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ta=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new ea(e,8),this._embeddedLanguagesMatcher=new na(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ea(0,0);_getBasicScopeAttributes=new ii(e=>new ea(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},na=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>ri(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var ra=!1,ia=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function aa(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=oa(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new ia(i,!0);f()}return new ia(i,!1);function f(){let o=sa(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Bi){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),pa(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Ji){let r=o;pa(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Yi){let r=o;pa(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(pa(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function oa(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Yi&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=da(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Vi){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),pa(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function sa(e,t,n,r,i,a){let o=ca(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=la(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function ca(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=ua(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function la(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=ua(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function ua(e,t,n,r,i){return ra?{ruleScanner:e.compile(t,n),findOptions:fa(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function da(e,t,n,r,i){return ra?{ruleScanner:e.compileWhile(t,n),findOptions:fa(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function fa(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function pa(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));aa(e,p,n&&d.start===0,d.start,f,i,!1,0),Ci(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new ma(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ma=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ha(e,t,n,r,i,a,o,s){return new ya(e,t,n,r,i,a,o,s)}function ga(e,t,n,r,i){let a=bi(t,_a),o=Xi.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function _a(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(va(t[r],e))return n=r+1,!0;return!1})}function va(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var ya=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new ta(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ba(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=bi(e,_a);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)ga(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&ga(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Hi(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Ui(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ba(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Xi.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Sa.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=_i.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?xa.createRootAndLookUpScopeName(a,r,this):xa.createRoot(`unknown`,r),t=new Sa(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
12
+ `;let a=this.createOnigString(e),o=a.content.length,s=new wa(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=aa(this,a,i,0,t,s,!0,r);return Ci(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ba(e,t){return e=Kr(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var xa=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=oi.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new oi(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new oi(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),_i.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Sa=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?xa.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Ui(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=xa.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Hi(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,xa.fromExtension(r,n.contentNameScopesList))}},Ca=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):bi(e,_a).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>bi(e,_a).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},wa=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=_i.set(n,0,vi(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=_i.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Ta=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,ha(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Ea=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Ta(ai.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ai.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Ca(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Di(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Da=Sa.NULL;function Oa(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function ka(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Aa(e){return Array.isArray(e)?e:[e]}async function ja(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Ma(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Na(e){return e===`ansi`||Ma(e)}function Pa(e){return e===`none`}function Fa(e){return Pa(e)}var Ia=/(\r?\n)/g;function La(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Ia),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Ra={light:`#333333`,dark:`#bbbbbb`},za={light:`#fffffe`,dark:`#1e1e1e`},Ba=`__shiki_resolved`;function Va(e){if(e?.[Ba])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Ra.light:Ra.dark,n||=t.type===`light`?za.light:za.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Ba,{enumerable:!1,writable:!1,value:!0}),t}async function Ha(e){return[...new Set((await Promise.all(e.filter(e=>!Na(e)).map(async e=>await ja(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ua(e){return(await Promise.all(e.map(async e=>Fa(e)?null:Va(await ja(e))))).filter(e=>!!e)}function Wa(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new q(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Ga=class extends Ea{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Va(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=ai.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Wa(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new q(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Ka=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},qa=0;function Ja(e){qa+=1,e.warnings!==!1&&qa>=10&&qa%10==0&&console.warn(`[Shiki] ${qa} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new q("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Va),i=new Ga(new Ka(e.engine,n),r,n,e.langAlias),a;function o(t){return Wa(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new q(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new q(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Ha(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ua(e))}function g(){if(t)throw new q(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--qa)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ya(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ua(e.themes||[]),Ha(e.langs||[]),e.engine]);return Ja({...e,themes:t,langs:n,engine:r})}var Xa=new WeakMap;function Za(e,t){Xa.set(e,t)}function Qa(e){return Xa.get(e)}var $a=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(Aa(n).map(e=>[e,Da])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return eo(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function eo(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function to(e,t){if(!(e instanceof $a))throw new q(`Invalid grammar state`);return e.getInternalStack(t)}var no=/,/,ro=/ /;function io(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Ma(e.resolveLangAlias(n.lang||`text`))||Pa(r))return La(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new q(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new q(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return oo(t,o,i,a,n)}function ao(...e){if(e.length===2)return Qa(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Ma(i)||Pa(a))throw new q(`Plain language does not have grammar state`);if(i===`ansi`)throw new q(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new $a(so(n,c,o,s,r).stateStack,c.name,o.name)}function oo(e,t,n,r,i){let a=so(e,t,n,r,i),o=new $a(a.stateStack,t.name,n.name);return Za(a.tokens,o),a.tokens}function so(e,t,n,r,i){let a=Oa(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=La(e),u=i.grammarState?to(i.grammarState,n.name)??Da:i.grammarContextCode==null?Da:so(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=ka(r[_i.getForeground(s)],a),u=_i.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=_i.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(no).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(ro))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?co(t.scopes):lo(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function co(e){return e.map(e=>({scopeName:e}))}function lo(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:po(e,i,t.slice(0,r))}}return n}function uo(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function fo(e,t,n){if(!uo(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)uo(e[r],n[i])&&--r,--i;return r===-1}function po(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(fo(e,t,n)){r.push(a);break}return r}function mo(e,t,n,r=io){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Qa(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=ho(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new $a(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Za(s,c),s}function ho(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var go=/\s+/g;function _o(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(go)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(go);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var vo=/:?lang=["']([^"']+)["']/g,yo=/(?:```|~~~)([\w-]+)/g,bo=/\\begin\{([\w-]+)\}/g,xo=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function So(e){let t=La(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Co(e,t,n){let r=new Set;for(let t of e.matchAll(vo)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(yo)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(bo)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(xo)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var wo=[`color`,`background-color`];function To(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Eo(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?To(e,t):e})):e}function Do(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Oo(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&wo.includes(a))if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new q('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Oo(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&J.Italic&&(t[`font-style`]=`italic`),e.fontStyle&J.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&J.Underline&&n.push(`underline`),e.fontStyle&J.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function ko(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Ao(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=So(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new q(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new q(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new q(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));jo(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Eo(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new q(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Mo(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new q(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new q(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&_o(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function jo(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new q(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new q(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Mo(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Mo).join(``):``}var No=[Ao()];function Po(e){let t=Fo(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...No]}function Fo(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Io=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Lo={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ro(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function zo(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Bo(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Lo[r]&&t.push({type:`setDecoration`,value:Lo[r]});else if(r<=29){let e=Lo[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Io[r-30]}});else if(r===38){let n=zo(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Io[r-40]}});else if(r===48){let n=zo(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Io[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Io[r-100+8]}})}return t}function Vo(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ro(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Bo(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Ho={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Uo(e=Ho){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Io.length;e++)r.push(t(Io[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Wo=/#([0-9a-f]{3,8})/i,Go=/var\((--[\w-]+-ansi-[\w-]+)\)/,Ko={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function qo(e,t,n){let r=Oa(e,n),i=La(t),a=Uo(Object.fromEntries(Io.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Ko[t]]}))),o=Vo();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=ka(i,r),o=ka(o,r),n.decorations.has(`dim`)&&(i=Jo(i));let s=J.None;return n.decorations.has(`bold`)&&(s|=J.Bold),n.decorations.has(`italic`)&&(s|=J.Italic),n.decorations.has(`underline`)&&(s|=J.Underline),n.decorations.has(`strikethrough`)&&(s|=J.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Jo(e){let t=e.match(Wo);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}else if(e.length===6)return`#${e}80`;else if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}else if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Go);return n?`var(${n[1]}-dim)`:e}function Yo(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Ma(r)&&!Pa(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return qo(r,t,n)}return io(e,t,n)}function Xo(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new q("`themes` option must not be empty");let p=mo(e,t,n,Yo);if(c=Qa(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new q(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Do(e,h,u,l,d))),c&&Za(a,c);let g=f.map(e=>Oa(e.theme,n));i=Zo(f,m,g,u,l,`fg`,d),r=Zo(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Oa(n.theme,n);a=Yo(e,t,n);let l=e.getTheme(n.theme);r=ka(l.bg,s),i=ka(l.fg,s),o=l.name,c=Qa(a)}else throw new q("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Zo(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=ka(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new q('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ka(t[r][a],n[r])||`inherit`}, ${ka(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Qo=/^\s+$/,$o=/^(\s*)(.*?)(\s*)$/;function es(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>es(e,t,n),codeToTokens:(t,n)=>Xo(e,t,n)}){let i=t;for(let e of Po(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Xo(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=ns(a):d===`never`&&(a=rs(a)),f&&(a=is(a));let p={...r,get source(){return i}};for(let e of Po(n))a=e.tokens?.call(p,a)||a;return ts(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function ts(e,t,n,r=Qa(e)){let i=Po(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:_o,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
13
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=ko(a.htmlStyle||Oo(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Za(m,r),m}function ns(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&J.Underline||i.fontStyle&J.Strikethrough));o&&Qo.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function rs(e){return e.map(e=>e.flatMap(e=>{if(Qo.test(e.content))return e;let t=e.content.match($o);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function is(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=ko(e.htmlStyle||Oo(e)),i=ko(n.htmlStyle||Oo(n)),a=e.fontStyle&&(e.fontStyle&J.Underline||e.fontStyle&J.Strikethrough),o=n.fontStyle&&(n.fontStyle&J.Underline||n.fontStyle&J.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var as=W;function os(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>es(e,t,n),codeToTokens:(t,n)=>Xo(e,t,n)},i=as(es(e,t,n,r));for(let e of Po(n))i=e.postprocess?.call(r,i,n)||i;return i}async function ss(e){let t=await Ya(e);return{getLastGrammarState:(...e)=>ao(t,...e),codeToTokensBase:(e,n)=>Yo(t,e,n),codeToTokensWithThemes:(e,n)=>mo(t,e,n),codeToTokens:(e,n)=>Xo(t,e,n),codeToHast:(e,n)=>es(t,e,n),codeToHtml:(e,n)=>os(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function cs(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Na(n))return[];let r=t[n];if(!r)throw new q(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Fa(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new q(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await ss({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function ls(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}else{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function us(e,t){let n=ls(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var ds=cs({langs:gr,themes:_r,engine:()=>(0,Gr.createOnigurumaEngine)(s(()=>import(`./wasm-BRCjOXGL-BnjxR4X6.js`),[]))}),{codeToHtml:fs,codeToHast:ps,codeToTokens:ms,codeToTokensBase:hs,codeToTokensWithThemes:gs,getSingletonHighlighter:_s,getLastGrammarState:vs}=us(ds,{guessEmbeddedLanguages:Co}),ys=4294967295,bs=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:ys,end:ys,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function xs(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Ss(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Cs=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Y=String.raw;function ws(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Ts=Y`\[\^?`,Es=`c.? | C(?:-.?)?|${Y`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Y`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Y`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Y`o\{[^\}]*\}?`}|${Y`\d{1,3}`}`,Ds=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Os=new RegExp(Y`
14
+ \\ (?:
15
+ ${Es}
16
+ | [gk]<[^>]*>?
17
+ | [gk]'[^']*'?
18
+ | .
19
+ )
20
+ | \( (?:
21
+ \? (?:
22
+ [:=!>({]
23
+ | <[=!]
24
+ | <[^>]*>
25
+ | '[^']*'
26
+ | ~\|?
27
+ | #(?:[^)\\]|\\.?)*
28
+ | [^:)]*[:)]
29
+ )?
30
+ | \*[^\)]*\)?
31
+ )?
32
+ | (?:${Ds.source})+
33
+ | ${Ts}
34
+ | .
35
+ `.replace(/\s+/g,``),`gsu`),ks=new RegExp(Y`
36
+ \\ (?:
37
+ ${Es}
38
+ | .
39
+ )
40
+ | \[:(?:\^?\p{Alpha}+|\^):\]
41
+ | ${Ts}
42
+ | &&
43
+ | .
44
+ `.replace(/\s+/g,``),`gsu`);function As(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=oc(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Os.lastIndex=0;s=Os.exec(e);){let t=js(a,e,s[0],Os.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Os.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?cc(e,u):e).flat(),flags:r}}function js(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Ms(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Is(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Xs(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Ls(n)}}if(a===`K`)return{token:Ws(`keep`,n)};if(a===`N`||a===`R`)return{token:Us(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Us(`any`,n)};if(a===`X`)return{token:Us(`text_segment`,n)};let e=Ps(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:tc(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:ec(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:qs(`group`,n)};if(n===`(?>`)return{token:qs(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:qs(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:qs(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:qs(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Ks(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
45
+ `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Us(`dot`,n)}:n===`^`||n===`$`?{token:Is(e.singleline?{"^":Y`\A`,$:Y`\Z`}[n]:n,n)}:n===`|`?{token:Fs(n)}:Ds.test(n)?{tokens:lc(n)}:{token:Rs(xs(n),n)}}function Ms(e,t,n){let r=[Hs(t[1]===`^`,t)],i=1,a;for(ks.lastIndex=n;a=ks.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Hs(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Rs(93,e));else if(i--,r.push(zs(e)),!i)break}else{let t=Ns(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:ks.lastIndex||e.length}}function Ns(e){if(e[0]===`\\`)return Ps(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Cs.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Us(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Bs(e):e===`&&`?Vs(e):Rs(xs(e),e)}function Ps(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return $s(e);if(`dDhHsSwW`.includes(n))return rc(e);if(e.startsWith(Y`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return ic(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Rs(xs(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Rs(sc(e),e);if(Qs.has(n))return Rs(Qs.get(n),e);if(/\d/.test(n))return Gs(t,e);if(e===`\\`)throw Error(Y`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Rs(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function Fs(e){return{type:`Alternator`,raw:e}}function Is(e,t){return{type:`Assertion`,kind:e,raw:t}}function Ls(e){return{type:`Backreference`,raw:e}}function Rs(e,t){return{type:`Character`,value:e,raw:t}}function zs(e){return{type:`CharacterClassClose`,raw:e}}function Bs(e){return{type:`CharacterClassHyphen`,raw:e}}function Vs(e){return{type:`CharacterClassIntersector`,raw:e}}function Hs(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Us(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Ws(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:ws(n.flags),raw:t}}function Gs(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Ks(e){return{type:`GroupClose`,raw:e}}function qs(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Js(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Ys(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Xs(e){return{type:`Subroutine`,raw:e}}var Zs=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Qs=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function $s(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Rs(xs(t.toUpperCase())-64,e)}function ec(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=ac(n),o=ac(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Ws(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,qs(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function tc(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=Zs.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Js(l,r??null,i?.split(`,`)??null,e)}function nc(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Ys(t,n,r,e)}function rc(e){let t=e[1].toLowerCase();return Us({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function ic(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Us(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function ac(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function oc(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function sc(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function cc(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Ls(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(Y`Octal encoded byte above 177 unsupported "${n}"`)}else r=xs(t);a.push(Rs(r,(e===0?`\\`:``)+t))}return a}function lc(e){let t=[],n=new RegExp(Ds,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(nc(e.slice(0,-1)));continue}}}t.push(nc(e))}return t}function uc(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function dc(e){return fc.has(e.type)}var fc=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function pc(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=As(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return Cc();case`Assertion`:return mc(n);case`Backreference`:return hc(n,a);case`Character`:return Dc(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return gc(n,a,t);case`CharacterClassOpen`:return _c(n,a,t);case`CharacterSet`:return vc(n,a);case`Directive`:return jc(n.kind,{flags:n.flags});case`GroupOpen`:return yc(n,a,t);case`NamedCallout`:return Fc(n.kind,n.tag,n.arguments);case`Quantifier`:return bc(n,a);case`Subroutine`:return xc(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Rc(Mc(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(Y`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(Y`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function mc({kind:e}){return wc(ws({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===Y`\B`||e===Y`\Y`})}function hc({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i)if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Tc(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return Tc(r)}return i(+r)}function gc(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),kc(o,e);throw Error(`Invalid character class range`)}return Dc(xs(`-`))}function _c({negate:e},t,n){let{tokens:r,walk:i}=t,a=[Oc()],o=r[t.nextIndex],s=Yc(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(Oc()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Yc(r[t.nextIndex],o)}let c=Oc({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function vc({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Jc(n);if(Cs.has(r)&&!o?.has(r))e=`posix`,n=r;else return Bc(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Ic(n,{negate:t}):Ac(e,{negate:t})}function yc(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Vc(e),l=c.type===`AbsenceFunction`,u=Gc(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Ss(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=Xc(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(Cc()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(Wc(t)||t.type===`CapturingGroup`)throw Error(e)}else if(Wc(t)||Gc(t)&&t.negate)throw Error(e)}}f=Xc(r[t.nextIndex])}return t.nextIndex++,c}function bc({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!dc(a))throw Error(`Quantifier requires a repeatable token`);let o=Lc(e,t,n,a);return i.body.pop(),o}function xc({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=zc(i);return r.push(o),o}function Sc(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Hc(t?.body)}}function Cc(e){return{type:`Alternative`,body:Uc(e?.body)}}function wc(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function Tc(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function Ec(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Kc(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Hc(t?.body)}}function Dc(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Oc(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:Uc(e?.body)}}function kc(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function Ac(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function jc(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:ws(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function Mc(e){return{type:`Flags`,...e}}function Nc(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:Hc(e?.body)}}function Pc(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Hc(e?.body)}}function Fc(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function Ic(e,t){let n=!!t?.negate;if(!Cs.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Lc(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function Rc(e,t){return{type:`Regex`,body:Hc(t?.body),flags:e}}function zc(e){return{type:`Subroutine`,ref:e}}function Bc(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Jc(e));if(!r){if(n.normalizeUnknownPropertyNames)r=qc(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Y`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Vc({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return Sc(`repeater`);case`atomic`:return Nc({atomic:!0});case`capturing`:return Ec(i,{name:n});case`group`:return Nc({flags:e});case`lookahead`:case`lookbehind`:return Pc({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Hc(e){if(e===void 0)e=[Cc()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function Uc(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function Wc(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Gc(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Kc(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function qc(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Jc(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Yc(e,t){let n=t;return ws(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function Xc(e){return ws(e,`Unclosed group`)}function Zc(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Qc(c).splice(Math.max(0,$c(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Qc(c).splice($c(s)+1)},removeAllPrevSiblings(){let e=$c(s)+l;return l-=e,Qc(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,$c(s)+l)]=e:ws(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Qc(c).splice(Math.max(0,$c(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,$c(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Qc(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function $c(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var el=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function tl(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function nl(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var rl=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function il(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===rl.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?rl.CHAR_CLASS:rl.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function al(e,t,n,r){il(e,t,n,r)}function ol(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===rl.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function sl(e,t,n){return!!ol(e,t,0,n)}function cl(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var ll=new RegExp(String.raw`(?<noncapturingStart>${el})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function ul(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(ll.lastIndex=Number.isNaN(c)?0:c+7;f=ll.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),tl(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=il(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},rl.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var dl=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,fl=new RegExp(String.raw`
46
+ \\(?: \d+
47
+ | c[A-Za-z]
48
+ | [gk]<[^>]+>
49
+ | [pPu]\{[^\}]+\}
50
+ | u[A-Fa-f\d]{4}
51
+ | x[A-Fa-f\d]{2}
52
+ )
53
+ | \((?: \? (?: [:=!>]
54
+ | <(?:[=!]|[^>]+>)
55
+ | [A-Za-z\-]+:
56
+ | \(DEFINE\)
57
+ ))?
58
+ | (?<qBase>${dl})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
59
+ | \\?.
60
+ `.replace(/\s+/g,``),`gsu`);function pl(e){if(!RegExp(`${dl}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(fl.lastIndex=0;o=fl.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a)if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=nl(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}fl.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null);i=s}return{pattern:e}}var ml=String.raw,hl=ml`\(\?R=(?<rDepth>[^\)]+)\)|${ml`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,gl=ml`\(\?<(?![=!])(?<captureName>[^>]+)>`,_l=ml`${gl}|(?<unnamed>\()(?!\?)`,vl=new RegExp(ml`${gl}|${hl}|\(\?|\\?.`,`gsu`),yl=`Cannot use multiple overlapping recursions`;function bl(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(hl,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&sl(e,ml`\(\?\(DEFINE\)`,rl.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=sl(e,ml`\\[1-9]`,rl.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(vl.lastIndex=0;f=vl.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else if(m){if(xl(m),l)throw Error(yl);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(vl.lastIndex);if(sl(s,hl,rl.DEFAULT))throw Error(yl);let c=m-1;e=Sl(t,s,c,!1,n,a,d),i=Tl(i,t,c,a.length,0,d);break}else if(h){xl(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(yl);break}if(!u)throw Error(ml`Recursive \g cannot be used outside the referenced group "${r===`external`?h:ml`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=cl(e,p);if(o&&sl(m,ml`${gl}|\((?!\?)`,rl.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=Sl(_,v,b,!0,n,a,d);i=Tl(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,vl.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),vl.lastIndex),s.set(p,vl.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),vl.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function xl(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function Sl(e,t,n,r,i,a,o){let s=new Set;r&&al(e+t,gl,({groups:{captureName:e}})=>{s.add(e)},rl.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Cl(`(?:${e}`,`forward`,...c)}(?:)${Cl(`${t})`,`backward`,...c)}${t}`}function Cl(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=il(e,ml`${_l}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),wl(i,n),s?e:`(?<${t}${l}>`}return ml`\k<${c}${l}>`},rl.DEFAULT)}return c}function wl(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Tl(e,t,n,r,i,a){if(e.size&&r){let o=0;al(t,_l,()=>o++,rl.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var X=String.fromCodePoint,Z=String.raw,El={},Dl=globalThis.RegExp;El.flagGroups=(()=>{try{new Dl(`(?i:)`)}catch{return!1}return!0})(),El.unicodeSets=(()=>{try{new Dl(`[[]]`,`v`)}catch{return!1}return!0})(),El.bugFlagVLiteralHyphenIsRange=El.unicodeSets?(()=>{try{new Dl(Z`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,El.bugNestedClassIgnoresNegation=El.unicodeSets&&new Dl(`[[^a]]`,`v`).test(`a`);function Ol(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function kl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Al(e,t){return Ml[e]>=Ml[t]}function jl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Ml={ES2025:2025,ES2024:2024,ES2018:2018},Nl={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function Pl(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Nl[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=El.flagGroups?`ES2025`:El.unicodeSets?`ES2024`:`ES2018`),t}var Fl=`[ -\r ]`,Il=new Set([X(304),X(305)]),Ll=Z`[\p{L}\p{M}\p{N}\p{Pc}]`;function Rl(e){if(Il.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Hl.get(n),a=Bl.get(n),o=Vl.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var zl=new Map(`C Other
61
+ Cc Control cntrl
62
+ Cf Format
63
+ Cn Unassigned
64
+ Co Private_Use
65
+ Cs Surrogate
66
+ L Letter
67
+ LC Cased_Letter
68
+ Ll Lowercase_Letter
69
+ Lm Modifier_Letter
70
+ Lo Other_Letter
71
+ Lt Titlecase_Letter
72
+ Lu Uppercase_Letter
73
+ M Mark Combining_Mark
74
+ Mc Spacing_Mark
75
+ Me Enclosing_Mark
76
+ Mn Nonspacing_Mark
77
+ N Number
78
+ Nd Decimal_Number digit
79
+ Nl Letter_Number
80
+ No Other_Number
81
+ P Punctuation punct
82
+ Pc Connector_Punctuation
83
+ Pd Dash_Punctuation
84
+ Pe Close_Punctuation
85
+ Pf Final_Punctuation
86
+ Pi Initial_Punctuation
87
+ Po Other_Punctuation
88
+ Ps Open_Punctuation
89
+ S Symbol
90
+ Sc Currency_Symbol
91
+ Sk Modifier_Symbol
92
+ Sm Math_Symbol
93
+ So Other_Symbol
94
+ Z Separator
95
+ Zl Line_Separator
96
+ Zp Paragraph_Separator
97
+ Zs Space_Separator
98
+ ASCII
99
+ ASCII_Hex_Digit AHex
100
+ Alphabetic Alpha
101
+ Any
102
+ Assigned
103
+ Bidi_Control Bidi_C
104
+ Bidi_Mirrored Bidi_M
105
+ Case_Ignorable CI
106
+ Cased
107
+ Changes_When_Casefolded CWCF
108
+ Changes_When_Casemapped CWCM
109
+ Changes_When_Lowercased CWL
110
+ Changes_When_NFKC_Casefolded CWKCF
111
+ Changes_When_Titlecased CWT
112
+ Changes_When_Uppercased CWU
113
+ Dash
114
+ Default_Ignorable_Code_Point DI
115
+ Deprecated Dep
116
+ Diacritic Dia
117
+ Emoji
118
+ Emoji_Component EComp
119
+ Emoji_Modifier EMod
120
+ Emoji_Modifier_Base EBase
121
+ Emoji_Presentation EPres
122
+ Extended_Pictographic ExtPict
123
+ Extender Ext
124
+ Grapheme_Base Gr_Base
125
+ Grapheme_Extend Gr_Ext
126
+ Hex_Digit Hex
127
+ IDS_Binary_Operator IDSB
128
+ IDS_Trinary_Operator IDST
129
+ ID_Continue IDC
130
+ ID_Start IDS
131
+ Ideographic Ideo
132
+ Join_Control Join_C
133
+ Logical_Order_Exception LOE
134
+ Lowercase Lower
135
+ Math
136
+ Noncharacter_Code_Point NChar
137
+ Pattern_Syntax Pat_Syn
138
+ Pattern_White_Space Pat_WS
139
+ Quotation_Mark QMark
140
+ Radical
141
+ Regional_Indicator RI
142
+ Sentence_Terminal STerm
143
+ Soft_Dotted SD
144
+ Terminal_Punctuation Term
145
+ Unified_Ideograph UIdeo
146
+ Uppercase Upper
147
+ Variation_Selector VS
148
+ White_Space space
149
+ XID_Continue XIDC
150
+ XID_Start XIDS`.split(/\s/).map(e=>[Jc(e),e])),Bl=new Map([[`s`,X(383)],[X(383),`s`]]),Vl=new Map([[X(223),X(7838)],[X(107),X(8490)],[X(229),X(8491)],[X(969),X(8486)]]),Hl=new Map([Gl(453),Gl(456),Gl(459),Gl(498),...Kl(8072,8079),...Kl(8088,8095),...Kl(8104,8111),Gl(8124),Gl(8140),Gl(8188)]),Ul=new Map([[`alnum`,Z`[\p{Alpha}\p{Nd}]`],[`alpha`,Z`\p{Alpha}`],[`ascii`,Z`\p{ASCII}`],[`blank`,Z`[\p{Zs}\t]`],[`cntrl`,Z`\p{Cc}`],[`digit`,Z`\p{Nd}`],[`graph`,Z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Z`\p{Lower}`],[`print`,Z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Z`[\p{P}\p{S}]`],[`space`,Z`\p{space}`],[`upper`,Z`\p{Upper}`],[`word`,Z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Z`\p{AHex}`]]);function Wl(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Gl(e){let t=X(e);return[t.toLowerCase(),t]}function Kl(e,t){return Wl(e,t).map(e=>Gl(e))}var ql=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Jl(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Ql(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Al(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Zc(e,Yl,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Zc(e,Xl,a),Zc(e,Zl,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Yl={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Nc();e.body[0].body.push(Pc({negate:!0,body:r}),Bc(`Any`));let i=Nc();i.body[0].body.push(Lc(`greedy`,0,1/0,e)),n(Q(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];kl(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=au(t.get(e));if(n){let t=Nc({flags:n});t.body[0].body=e.body,e.body=[Q(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Q(Pc({body:[Cc({body:[wc(`string_end`)]}),Cc({body:[Dc(10)]})]}),t));else if(c===`line_start`)o(Q(mu(Z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`)if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&du(e))o(Q(Pc({negate:!0}),t));else if(d)throw Error(Z`Uses "\G" in a way that requires a subclass`);else o(gu(wc(`string_start`),t)),s.strategy=`clip_search`}else if(!(c===`string_end`||c===`string_start`))if(c===`string_end_newline`)o(Q(mu(Z`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Ll})(?!${Ll})|(?<!${Ll})(?=${Ll}))`,n=`(?:(?<=${Ll})(?=${Ll})|(?<!${Ll})(?!${Ll}))`;o(Q(mu(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!pu(n)&&(n=iu(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!pu(r)&&(r=iu(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Q(Oc({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(gu(Ac(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Q(hu(mu(Fl),l),t));return}if(s&&(c===`word`||u===`word`)){n(gu(Ac(`word`,{negate:l}),t));return}if(c===`any`)n(gu(Bc(`Any`),t));else if(c===`digit`)n(gu(Bc(`Nd`,{negate:l}),t));else if(c!==`dot`)if(c===`text_segment`){if(r===`strict`)throw Error(Z`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Z`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Q(mu(Z`(?>\r\n|${i?Z`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(gu(Bc(`AHex`,{negate:l}),t));else if(c===`newline`)n(Q(mu(l?`[^
151
+ ]`:`(?>\r
152
+ ?|[
153
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`)if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${X(e.codePointAt(0)-1)}${X(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Q(mu(`[${e}]`),t))}else n(Q(hu(mu(Ul.get(u)),l),t));else if(c===`property`)zl.has(Jc(u))||(e.key=`sc`);else if(c===`space`)n(gu(Bc(`space`,{negate:l}),t));else if(c===`word`)n(Q(hu(mu(Ll),l),t));else throw Error(`Unexpected character set kind "${c}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`)if(!c.enable&&!c.disable)r();else{let e=Nc({flags:c});e.body[0].body=o(),i(Q(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&uc(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=Pc({behind:!0});o.body[0].body=a(),i(Q(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Q(Pc({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Nc();t.body[0].body.push(e.body),e.body=Q(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=cu(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!pu(n)&&(n=iu(n,t),e.ref=n)}},Xl={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=gu(nu(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&kl(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=kl(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Ol(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&!(n.type===`CapturingGroup`&&(n.name===a||n.number===a)););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?nu(0):tu(o,r.groupOriginByCopy,null),l=c;if(!s){let e=au(ru(o,e=>e.type===`Group`&&!!e.flags)),t=e?Ol(r.globalFlags,e):r.globalFlags;$l(t,r.currentFlags)||(l=Nc({flags:ou(t)}),l.body[0].body.push(c))}n(Q(l,t),{traverse:!s})}},Zl={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>eu(t,e));i.length?i.length>1?n(Q(Nc({atomic:!0,body:i.reverse().map(e=>Cc({body:[Tc(e.number)]}))}),t)):e.ref=i[0].number:n(Q(Pc({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Ec();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Ql(e){Zc(e,{"*"({node:e,parent:t}){e.parent=t}})}function $l(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function eu(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=su(n.parent);for(let r of t){if(r===n)break;if(r===e||lu(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function tu(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=tu(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function nu(e){let t=zc(e);return t.isRecursive=!0,t}function ru(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function iu(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function au(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function ou({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function su(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function cu(e){let t=e.find(e=>e.kind===`search_start`||fu(e,{negate:!1})||!uu(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=cu(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function lu(e,t){let n=su(e)??[];for(let e of n)if(e===t||lu(e,t))return!0;return!1}function uu({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function du(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function fu(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&uc(e.body[0],{type:`Assertion`,kind:`search_start`})}function pu(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function mu(e,t){let n=pc(e,{...t,unicodePropertyMap:zl}).body;return n.length>1||n[0].body.length>1?Nc({body:n}):n[0].body[0]}function hu(e,t){return e.negate=t,e}function gu(e,t){return e.parent=t,e}function Q(e,t){return Ql(e),e.parent=t,e}function _u(e,t){let n=Pl(t),r=Al(n.target,`ES2024`),i=Al(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Zc(e,vu,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,jl(yu[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&kl(f._captureTransfers,e.transferTo,[]).push(t)}),f}var vu={"*":{enter({node:e},t){if(ju(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Ol({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){ju(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Tu(X(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Eu(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&ql.has(e.value)&&t.setHasCasedChar()}},yu={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=X(e),r=Du(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Tu(n)){let e=Rl(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);El.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(Nu)&&(o=[Dc(45),...o.filter(e=>!Nu(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||El.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Nc(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=Cc({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(El.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Du(n,i),o=Du(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Ou(Eu(e)).forEach(e=>{s.add(Array.isArray(e)?`${Du(e[0],i)}-${Du(e[1],i)}`:Du(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&ql.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Ol(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${ku(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Au(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},bu=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),xu=new Set([`-`,`\\`,`]`,`^`,`[`]),Su=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Cu=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),wu=/^\p{Cased}$/u;function Tu(e){return wu.test(e)}function Eu(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=X(e);if(!Tu(t))continue;let o=Rl(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Du(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Cu.has(e))return Cu.get(e);if(e<32||e>126&&e<160||e>262143||t&&Mu(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Su:xu:bu,a=X(e);return(i.has(a)?`\\`:``)+a}function Ou(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function ku(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Au({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function ju({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Mu(e){return e>47&&e<58}function Nu({type:e,value:t}){return e===`Character`&&t===45}var Pu=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Iu(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Fu(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Lu(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Fu(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Iu(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)kl(n,t,{}).transferTo=e;return n}function Lu(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Ru(e,t){let n=zu(e,t);return n.options?new Pu(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function zu(e,t){let n=Pl(t),r=Jl(pc(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:zl}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=_u(r,n),a=bl(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=ul(pl(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Bu(e,t){return Ru(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Vu(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Bu(e,{target:t.target}),{createScanner(e){return new bs(e,t)},createString(e){return{content:e}}}}async function Hu(e){if(ar())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=er.get(e);if(t!=null)return t;try{let t=tr.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(gr,e)&&(t=gr[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return $n.has(e)||$n.set(e,n),n});return er.set(e,n),await n}finally{er.delete(e)}}function Uu(e){return $n.get(e)??Hu(e)}var Wu=new Set;function Gu(e){let t=[],n=new Set;for(let r of Ku(e.themes)){let e=Yu(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Gu({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Gu({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Ku(e){return qu(e)?[e]:e}function qu(e){return Yu(e)||Ju(e)}function Ju(e){return typeof e.name==`string`&&typeof e.load==`function`}function Yu(e){return typeof e.getThemes==`function`}function Xu(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Zu=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Qu=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},$u=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function ed(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Zu(t);e.set(t,n)}function a(t,n){return e.has(t)?!1:(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new Qu(i));let c=r,l=s().then(e=>{let a=Xu(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new $u(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var td=ed();function nd(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=td.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,td.getResolvedTheme(n)??td.seedResolvedTheme(n,e);Wu.has(n)||(Wu.add(n),t.loadThemeSync(e))}}function rd({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:id(t)}}function id(e){return async()=>Va(Xu(await e()))}var ad=`pierre`,od=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],sd=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],cd=[...sd,...od],ld=new Set(sd);function ud(e){return ld.has(e)?`light`:`dark`}var dd={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},fd={"pierre-dark":()=>s(()=>import(`./pierre-dark-DDWDl8g6-CpLgRqie.js`),[]),"pierre-dark-soft":()=>s(()=>import(`./pierre-dark-soft-Bb-4-biO-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>s(()=>import(`./pierre-dark-vibrant-8oZzB3gw-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>s(()=>import(`./pierre-dark-protanopia-deuteranopia-C35UMuvO-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>s(()=>import(`./pierre-dark-tritanopia-CIJISGWF-CpjhbsIL.js`),[]),"pierre-light":()=>s(()=>import(`./pierre-light-CWhW4NrH-CoaEpmwp.js`),[]),"pierre-light-soft":()=>s(()=>import(`./pierre-light-soft-BCU6fuhO-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>s(()=>import(`./pierre-light-vibrant-Cwh332o_-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>s(()=>import(`./pierre-light-protanopia-deuteranopia-u0U7N4Hn-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>s(()=>import(`./pierre-light-tritanopia-3c8Yx3co-CEbqgOJL.js`),[])};function pd(e){return rd({name:e,collection:ad,colorScheme:ud(e),displayName:dd[e],load:fd[e]})}var md=Gu({themes:cd.map(e=>pd(e))}),hd=`shiki`,gd=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],_d=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),vd=new Set(gd);function yd(e){return vd.has(e)?`light`:`dark`}var bd={andromeeda:()=>s(()=>import(`./andromeeda-DnSv6o6l-vGVdxbeo.js`),[]),"aurora-x":()=>s(()=>import(`./aurora-x-XJ5I8rFc-CDeNXAV0.js`),[]),"ayu-dark":()=>s(()=>import(`./ayu-dark-CBRGL64--DluEY0Gj.js`),[]),"ayu-light":()=>s(()=>import(`./ayu-light-BlrCS3Ih-C3h-C4tm.js`),[]),"ayu-mirage":()=>s(()=>import(`./ayu-mirage-CqpTmLcF-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>s(()=>import(`./catppuccin-frappe-COUg_LSX-3VR1Za6u.js`),[]),"catppuccin-latte":()=>s(()=>import(`./catppuccin-latte-r30LFfsa-DwIHMF0Q.js`),[]),"catppuccin-macchiato":()=>s(()=>import(`./catppuccin-macchiato-D-EwZyPh-DYnBP6_5.js`),[]),"catppuccin-mocha":()=>s(()=>import(`./catppuccin-mocha-C6RD5yh3-DYhrFGRu.js`),[]),"dark-plus":()=>s(()=>import(`./dark-plus-BCxGtnt0-Cs2F2srj.js`),[]),dracula:()=>s(()=>import(`./dracula-fPErIccy-BHWKrbxM.js`),[]),"dracula-soft":()=>s(()=>import(`./dracula-soft-BrQbqXs8-5eyTD99u.js`),[]),"everforest-dark":()=>s(()=>import(`./everforest-dark-gTeBQCos-sB-x3p7T.js`),[]),"everforest-light":()=>s(()=>import(`./everforest-light-DUjxsp-2-Df2xbC6M.js`),[]),"github-dark":()=>s(()=>import(`./github-dark-Dg1hl_QD-C-LZuMrd.js`),[]),"github-dark-default":()=>s(()=>import(`./github-dark-default-Dym2P842-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>s(()=>import(`./github-dark-dimmed-7iDMx266-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>s(()=>import(`./github-dark-high-contrast-DkV2fyPG-B_tTalzw.js`),[]),"github-light":()=>s(()=>import(`./github-light-BQKYgor9-EUqPIrTm.js`),[]),"github-light-default":()=>s(()=>import(`./github-light-default-BZhIfzqQ-BXViO-2h.js`),[]),"github-light-high-contrast":()=>s(()=>import(`./github-light-high-contrast-C7zHfx4C-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>s(()=>import(`./gruvbox-dark-hard-CQiwpF03-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>s(()=>import(`./gruvbox-dark-medium-BKe6XKBS-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>s(()=>import(`./gruvbox-dark-soft-Cz6U6pa4-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>s(()=>import(`./gruvbox-light-hard-DgU_i19B-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>s(()=>import(`./gruvbox-light-medium-D64I06ER-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>s(()=>import(`./gruvbox-light-soft-B-YxAs1L-BSMLrYjP.js`),[]),horizon:()=>s(()=>import(`./horizon-DYoumREk-CE9ld1lL.js`),[]),"horizon-bright":()=>s(()=>import(`./horizon-bright-CPyV7XIA-DSNQnXHK.js`),[]),houston:()=>s(()=>import(`./houston-B3NWfq0V-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>s(()=>import(`./kanagawa-dragon-DExkuQAs-CXtmUGW6.js`),[]),"kanagawa-lotus":()=>s(()=>import(`./kanagawa-lotus-qdYh7_RY-BN08jTvb.js`),[]),"kanagawa-wave":()=>s(()=>import(`./kanagawa-wave-CSW_hADG-CTweb8Dz.js`),[]),laserwave:()=>s(()=>import(`./laserwave-DkfjiLxA-C_8bwKvT.js`),[]),"light-plus":()=>s(()=>import(`./light-plus-DuO6rXxZ-DVQuIRkW.js`),[]),"material-theme":()=>s(()=>import(`./material-theme-C_YrwKEa-Bm3Qr25_.js`),[]),"material-theme-darker":()=>s(()=>import(`./material-theme-darker-DB3YVCla-2IIEA8gg.js`),[]),"material-theme-lighter":()=>s(()=>import(`./material-theme-lighter-D2fgNrBK-uhdI0v04.js`),[]),"material-theme-ocean":()=>s(()=>import(`./material-theme-ocean-DVy172Rs-CHQ94UKr.js`),[]),"material-theme-palenight":()=>s(()=>import(`./material-theme-palenight-uMMwIfpG-B5W6OYN7.js`),[]),"min-dark":()=>s(()=>import(`./min-dark-C7Ec8I_2-BSWPekZh.js`),[]),"min-light":()=>s(()=>import(`./min-light-Be6foA7m-DDpmG2fV.js`),[]),monokai:()=>s(()=>import(`./monokai-CREPpJ3k-CdkpiU2Y.js`),[]),"night-owl":()=>s(()=>import(`./night-owl-CqqbiLON-DhmEMT88.js`),[]),"night-owl-light":()=>s(()=>import(`./night-owl-light-B9vYgGRt-eJ-hLW7d.js`),[]),nord:()=>s(()=>import(`./nord-BZ9DVmcN-Cb4Vim4T.js`),[]),"one-dark-pro":()=>s(()=>import(`./one-dark-pro-Ev8UPkf4-CLwyXe_n.js`),[]),"one-light":()=>s(()=>import(`./one-light-CzxBC38_-D7Lr4KcI.js`),[]),plastic:()=>s(()=>import(`./plastic-BGkJ2das-DQwYfKfQ.js`),[]),poimandres:()=>s(()=>import(`./poimandres-CpnMgZuc-DRFjx7u4.js`),[]),red:()=>s(()=>import(`./red-EHiRGXSv-CJ3rzSJv.js`),[]),"rose-pine":()=>s(()=>import(`./rose-pine-DTI-z1Qp-BthvhNj6.js`),[]),"rose-pine-dawn":()=>s(()=>import(`./rose-pine-dawn-BIiGXpWs-Dg85fqjY.js`),[]),"rose-pine-moon":()=>s(()=>import(`./rose-pine-moon-DU4wt90U-hon4tzzS.js`),[]),"slack-dark":()=>s(()=>import(`./slack-dark-BS2AOOdo-DnToyrRv.js`),[]),"slack-ochin":()=>s(()=>import(`./slack-ochin-Nc7Cucwk-B2OO5cIa.js`),[]),"snazzy-light":()=>s(()=>import(`./snazzy-light-C2ghKZXY-4G7pJPwS.js`),[]),"solarized-dark":()=>s(()=>import(`./solarized-dark-UHgjRWhr-DV17i1UV.js`),[]),"solarized-light":()=>s(()=>import(`./solarized-light-B-Zcwve2-DSh2HLQt.js`),[]),"synthwave-84":()=>s(()=>import(`./synthwave-84-CPtGYwOz-nFMaYfgc.js`),[]),"tokyo-night":()=>s(()=>import(`./tokyo-night-BKYoawWu-oM2G3aXe.js`),[]),vesper:()=>s(()=>import(`./vesper-ClvmKzqD-DdrHHSXu.js`),[]),"vitesse-black":()=>s(()=>import(`./vitesse-black-BY6Qtyq--fwtXNY1n.js`),[]),"vitesse-dark":()=>s(()=>import(`./vitesse-dark-BT-v_EgR-BZCL-v6S.js`),[]),"vitesse-light":()=>s(()=>import(`./vitesse-light-Box8ZFz6-VbXTXTou.js`),[])};function xd(e){return rd({name:e,collection:hd,colorScheme:yd(e),load:bd[e]})}var Sd=Gu({themes:Object.freeze([...gd.map(e=>xd(e)),..._d.map(e=>xd(e))])});function Cd(e){if(ar())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(td.hasRegisteredTheme(e))return;let t=Sd.getTheme(e);if(t!=null){td.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function wd(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Td(e){Cd(e);let t=await td.resolveTheme(e);return wd(e,t),t}function Ed(e){return td.getResolvedTheme(e)??Td(e)}var Dd;async function Od({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){Dd??=ds({themes:[],langs:[`text`],engine:n===`shiki-wasm`?Wr(s(()=>import(`./wasm-BRCjOXGL-BnjxR4X6.js`),[])):Vu()});let r=Ad(Dd)?await Dd:Dd;Dd=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Uu(e);`then`in t?i.push(t):ir(t,r)}let a=[];for(let t of e){let e=Ed(t);`then`in e?a.push(e):nd(e,Dd)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{ir(e,r)}),Promise.all(a).then(e=>{nd(e,r)})]),r}function kd(){if(Dd!=null&&!(`then`in Dd))return Dd}function Ad(e=Dd){return e!=null&&`then`in e}for(let e of md.getThemes())td.registerThemeIfAbsent(e.name,e.load);function jd(e=A){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Md(e){for(let t of jd(e))if(!Wu.has(t))return!1;return!0}function Nd(e){return td.hasResolvedThemes(e)}function Pd(e,t){return fe(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Fd(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Id(e){return F({tagName:`div`,children:[F({tagName:`div`,children:e.annotations?.map(e=>F({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Ld(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function Rd({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return F({tagName:`div`,children:[t===`custom`?F({tagName:`slot`,properties:{name:w}}):zd({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[Bd(r)]],properties:i})}function zd({name:e,prevName:t,iconType:n}){let r=[F({tagName:`slot`,properties:{name:g}}),ve({name:Ld(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(F({tagName:`div`,children:[F({tagName:`bdi`,children:[P(t)]})],properties:{"data-prev-name":``}})),r.push(ve({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(F({tagName:`div`,children:[F({tagName:`bdi`,children:[P(e)]})],properties:{"data-title":``}})),r.push(F({tagName:`slot`,properties:{name:u}})),F({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Bd(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(F({tagName:`span`,children:[P(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(F({tagName:`span`,children:[P(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(F({tagName:`slot`,properties:{name:l}})),F({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Vd(e){return F({tagName:`pre`,properties:Hd(e)})}function Hd({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Ud=new Map,Wd={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Gd(e){if(Ud.has(e))return Ud.get(e)??`text`;if(Wd[e]!=null)return Wd[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ud.has(t[1]))return Ud.get(t[1])??`text`;if(Wd[t[1]]!=null)return Wd[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Ud.has(n)?Ud.get(n)??`text`:Wd[n]??`text`}function Kd(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:jd(t),preferredHighlighter:n}}function qd(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Jd(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(P(`
154
+ `)),e}var Yd=Symbol(`no-token`),Xd=Symbol(`multiple-tokens`);function Zd(e){let t=Qd(e);if(t!=null)return t;let n=Yd,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){ef(e,a);for(let t of e.children)$d(t)}else $d(e);r.push(e),i=[],a=void 0;return}for(let e of i)$d(e);r.push(F({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Yd){if(e===Xd){n=Xd;return}if(n===Yd){n=e;return}n!==e&&(n=Xd)}};for(let t of e.children){let e=t.type===`element`?Zd(t):Yd;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function Qd(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function $d(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)$d(t)}}function ef(e,t){e.properties[`data-char`]=t}function tf(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=t+nf(typeof e==`string`?e:a(e))+n;return o=r(o),i.has(o)||i.set(o,typeof e==`string`?e:{...e}),o}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function nf(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function rf(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=ye(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Zd(a),i.push(Jd(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(of,af),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:af}}var af=tf({classPrefix:`hl-`}),of={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function $(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var sf=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,cf=/^0(?:\.0+)?%?$/;function lf(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function uf(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function df(e){if(e==null)return null;let t=uf(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function ff(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||sf.test(t))return!0;let n=lf(t);return n!=null&&cf.test(n)}function pf(e,t,n){if(t==null||n==null)return!1;let r=df(e),i=df(t),a=df(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var mf=new WeakMap;function hf(e){let t=mf.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;gf(r,`editor.background`,i),gf(r,`editor.foreground`,a),gf(r,`sideBar.background`,o),gf(r,`sideBar.foreground`,s),gf(r,`input.background`,n[`input.background`]??o),gf(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),gf(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),gf(r,`gitDecoration.addedResourceForeground`,_f(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),gf(r,`gitDecoration.modifiedResourceForeground`,_f(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),gf(r,`gitDecoration.deletedResourceForeground`,_f(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(ff(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(ff(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(vf(l,o)||pf(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return mf.set(e,u),u}function gf(e,t,n){n!=null&&n!==``&&(e[t]=n)}function _f(...e){for(let t of e)if(t!=null&&t!==``)return t}function vf(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function yf({theme:e=A,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=hf(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${$(`global`)}fg:${a.fg};`,r+=`${$(`global`)}bg:${a.bg};`,r+=bf(i,n)}else{let n=t.getTheme(e.dark),i=hf(n);r+=`${$(`global`)}dark:${i.fg};`,r+=`${$(`global`)}dark-bg:${i.bg};`,r+=bf(n,`dark`),n=t.getTheme(e.light),i=hf(n),r+=`${$(`global`)}light:${i.fg};`,r+=`${$(`global`)}light-bg:${i.bg};`,r+=bf(n,`light`)}return r}function bf(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${$(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${$(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${$(`global`)}${t}modified-color:${a};`),n}function xf(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}var Sf=10,Cf=13,wf=4,Tf=40;function Ef(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
155
+ `),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
156
+ `,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
157
+ `,o)),t.push(o),++a===wf){if(o-i<=Tf){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===Sf||r===Cf)&&(r===Cf&&n+1<e.length&&e.charCodeAt(n+1)===Sf&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function Df(e){let t=Ef(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}var Of={forcePlainText:!1};function kf(e,t,{theme:n=A,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=Of){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=rf(i),f=a?`text`:e.lang??Gd(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=yf({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=xf(t.codeToHast(l?Af(c??Df(e.contents),o,s):e.contents,h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function Af(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}var jf=`-1,-1`;function Mf(e){return e?.some(e=>e.lineNumber===0)??!1}function Nf(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Pf(e){return e.startingLine===0&&e.totalLines>0}function Ff(e,t){return e.endsWith(`\r
158
+ `)?t+`\r
159
+ `:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
160
+ `)?t+`
161
+ `:t}function If(e,t){return F({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function Lf(e){return(e.lang??Gd(e.name))===`text`}function Rf(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}var zf=-1,Bf=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++zf}`;highlighter;renderCache;computedLang=`text`;lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:A},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Md(e.theme??A)?kd():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(){this.editSessionActive=!0}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}syncEditedContentsToFile(){let{renderCache:e,lineCache:t}=this;e?.isDirty!==!0||t==null||!Rf(t,e.file)||(e.file.contents=t.lines.join(``))}hasUnkeyedFileContentsChanged(e){let{lineCache:t}=this;return e.cacheKey==null&&t!=null&&t.file===e&&t.sourceContents!==e.contents}invalidateChangedUnkeyedFile(e){this.hasUnkeyedFileContentsChanged(e)&&(this.workerManager?.cleanUpTasks(this),this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap)}clearRenderCache(){this.syncEditedContentsToFile(),this.pendingStructuralRows=void 0;let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.file.cacheKey!=null&&this.workerManager?.evictFileFromCache(e.file.cacheKey)}hydrate(e){let{options:t}=this.getRenderOptions(e),n=Vf(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!Pd(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!Lf(e),result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter??(this.computedLang=e.lang??Gd(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??A}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getFileRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{tokenizeMaxLineLength:e=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:e}})(),{renderCache:n}=this;return n?.result==null||!N(e,n.file)||!Pd(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;return(t==null||!Rf(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:Df(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){let t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){if(this.pendingStructuralRows=void 0,this.renderCache==null)return;let{file:r,result:i}=this.renderCache;if(i==null)return;let a=n?new Map:void 0;this.pendingStructuralRows=a;let o=this.lineCache!=null&&Rf(this.lineCache,r)?this.lineCache:void 0;for(let[t,n]of e){if(a===void 0&&o!=null&&t<o.lines.length){let e=n.map(e=>e[2]).join(``);o.lines[t]=Ff(o.lines[t]??``,e)}let e={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};a===void 0?i.code[t]=e:a.set(t,e)}i.baseThemeType=t,this.renderCache.isDirty=!0}applyDocumentChange(e){let t=this.pendingStructuralRows;if(this.pendingStructuralRows=void 0,this.renderCache==null)return;let{file:n,result:r}=this.renderCache;if(r==null)return;let i=this.lineCache!=null&&Rf(this.lineCache,n)?this.lineCache.lines:Df(n.contents),a=Df(e.getText());if(i.length!==a.length){let n=Math.min(i.length,a.length),o=0;for(;o<n&&i[o]===a[o];)o++;let s=0;for(;s<n-o&&i[i.length-1-s]===a[a.length-1-s];)s++;let c=r.code;r.code=Array(a.length);for(let e=0;e<o;e++)r.code[e]=c[e];for(let e=0;e<s;e++)r.code[a.length-1-e]=c[i.length-1-e];if(t!==void 0)for(let[e,n]of t)e<a.length&&(r.code[e]=n);for(let t=o;t<a.length-s;t++)r.code[t]??={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:e.getLineText(t)}]}]};for(let e=0;e<r.code.length;e++){let t=r.code[e];t?.type===`element`&&(t.properties[`data-line`]=e+1,t.properties[`data-line-index`]=e)}this.renderCache.isDirty=!0}this.lineCache={cacheKey:n.cacheKey,file:n,sourceContents:n.contents,lines:a},this.textDocumentCache.set(n,e)}renderFile(e=this.renderCache?.file,t=T){if(e==null)return;this.invalidateChangedUnkeyedFile(e),this.renderCache?.isDirty===!0&&!N(e,this.renderCache.file)&&(this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap);let{options:n,forceHighlight:r}=this.getRenderOptions(e);this.renderCache?.isDirty===!0&&!Pd(n,this.renderCache.options)&&this.clearRenderCache();let i=this.getMatchingWorkerResultCache(e,n);i!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...i},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};let a=this.getOrCreateLineCache(e),o=e.contents.length>0,s=!o||Lf(e)||Vf(a.length,this.getTokenizeMaxLength()),c=!N(e,this.renderCache.file),l=!Fd(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0)(s||this.renderCache.result==null||!this.renderCache.highlighted&&(c||l))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||c||l||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,a)),this.renderCache.renderRange=t),!s&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??Gd(e.name);let t=this.highlighter!=null&&Md(n.theme),i=this.highlighter!=null&&rr(this.computedLang),a=!s&&i;if(this.highlighter!=null&&t&&(r||s||!this.renderCache.highlighted&&a||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,s||!i);this.renderCache={file:e,options:n,highlighted:a,result:t,renderRange:void 0}}(!t||!s&&!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!s)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,t,this.renderCache.result)}async asyncRender(e,t=T){let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=Vf(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Gd(e.name);let n=this.highlighter!=null&&Nd(jd(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&rr(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:kf(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let a=this.getLineCount(e),{disableFileHeader:o=!1}=this.options,s=[],c=be(),l=Math.min(t.startingLine+t.totalLines,a),u=0,d=Pf(t)?Nf(this.lineAnnotations):void 0;d!=null&&(c.children.push(I(`context`,`annotation`,1)),s.push(Id({type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:d.map(e=>qd(e))})),u++);for(let r=t.startingLine;r<l;r++){let t=r+1,i=n[r];if(i==null){let n=`FileRenderer.processFileResult: Line doesnt exist`;throw console.error(n,{name:e.name,lineIndex:r,lineNumber:t}),Error(n)}c.children.push(xe(`context`,t,`${r}`)),s.push(i),u++;let a=this.lineAnnotations[t];a!=null&&(c.children.push(I(`context`,`annotation`,1)),s.push(Id({type:`annotation`,hunkIndex:0,lineIndex:t,annotations:a.map(e=>qd(e))})),u++)}return c.properties.style=`grid-row: span ${u}`,{gutterAST:c.children??[],contentAST:s,preAST:this.createPreElement(a),headerAST:o?void 0:this.renderHeader(e),totalLines:a,rowCount:u,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderHeader(e){let{headerRenderMode:t=`default`,stickyHeader:n=!1}=this.options;return Rd({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return W(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(F({tagName:`code`,children:this.renderCodeAST(e),properties:{"data-code":``}})),{...e.preAST,children:t}}renderCodeAST(e){let t=be();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,If(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return W(t?F({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await Od(Kd(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=!N(e,this.renderCache.file)||!this.renderCache.highlighted||!Pd(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Pd(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&N(e,n.file)&&Pd(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n=`scroll`}=this.options;return Vd({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Vf(e,t){return e>t}var Hf=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
162
+ <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
163
+ <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
164
+ </symbol>
165
+ <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
166
+ <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
167
+ </symbol>
168
+ <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
169
+ <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
170
+ </symbol>
171
+ <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
172
+ <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
173
+ </symbol>
174
+ <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
175
+ <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
176
+ </symbol>
177
+ <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
178
+ <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
179
+ </symbol>
180
+ <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
181
+ <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
182
+ </symbol>
183
+ <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
184
+ <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
185
+ </symbol>
186
+ <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
187
+ <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
188
+ </symbol>
189
+ <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
190
+ <path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
191
+ </symbol>
192
+ <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
193
+ <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
194
+ </symbol>
195
+ <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
196
+ <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
197
+ </symbol>
198
+ <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
199
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
200
+ </symbol>
201
+ <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
202
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
203
+ </symbol>
204
+ <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
205
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
206
+ </symbol>
207
+ <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
208
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
209
+ </symbol>
210
+ <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
211
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
212
+ </symbol>
213
+ </svg>`;function Uf(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function Wf(e,t){return e==null||t==null?e===t:Kf(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var Gf={};function Kf(e=Gf,t=Gf){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function qf(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Jf(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function Yf(){let e=document.createElement(`style`);return e.setAttribute(ee,``),e}var Xf=`@layer base {
214
+ :host {
215
+ --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
216
+ "Courier New", monospace;
217
+ --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
218
+ "Noto Sans", "Liberation Sans", Arial, sans-serif;
219
+ --diffs-mixer: light-dark(#000, #fff);
220
+ --diffs-gap-fallback: 8px;
221
+ --diffs-scrollbar-gutter-fallback: 6px;
222
+ --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
223
+ --diffs-added-light: #0dbe4e;
224
+ --diffs-added-dark: #5ecc71;
225
+ --diffs-modified-light: #009fff;
226
+ --diffs-modified-dark: #69b1ff;
227
+ --diffs-deleted-light: #ff2e3f;
228
+ --diffs-deleted-dark: #ff6762;
229
+ --diffs-warning-light: #d5a910;
230
+ --diffs-warning-dark: #ffd452;
231
+ color-scheme: light dark;
232
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
233
+ font-size: var(--diffs-font-size, 13px);
234
+ line-height: var(--diffs-line-height, 20px);
235
+ font-feature-settings: var(--diffs-font-features);
236
+ --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
237
+ --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
238
+ --diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
239
+ --diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
240
+ --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
241
+ --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
242
+ --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
243
+ --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
244
+ --diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
245
+ --diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
246
+ --diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
247
+ --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
248
+ --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
249
+ --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
250
+ --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
251
+ --diffs-selection-base: var(--diffs-modified-base);
252
+ --diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
253
+ background-color: var(--diffs-bg);
254
+ color: var(--diffs-fg);
255
+ display: block;
256
+ }
257
+
258
+ pre, code, [data-error-wrapper] {
259
+ isolation: isolate;
260
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
261
+ outline: none;
262
+ margin: 0;
263
+ padding: 0;
264
+ display: block;
265
+ }
266
+
267
+ pre, code {
268
+ background-color: var(--diffs-bg);
269
+ }
270
+
271
+ code {
272
+ contain: content;
273
+ }
274
+
275
+ input, button {
276
+ font-family: inherit;
277
+ font-size: inherit;
278
+ line-height: inherit;
279
+ }
280
+
281
+ *, :before, :after {
282
+ box-sizing: border-box;
283
+ }
284
+
285
+ [data-icon-sprite] {
286
+ display: none;
287
+ }
288
+
289
+ [data-diffs-header], [data-separator] {
290
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
291
+ }
292
+
293
+ [data-diffs-header][data-sticky] {
294
+ z-index: 1;
295
+ background-color: var(--diffs-bg);
296
+ position: sticky;
297
+ top: 0;
298
+ }
299
+
300
+ [data-file-info] {
301
+ color: var(--fg);
302
+ background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
303
+ border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
304
+ padding: 10px;
305
+ font-weight: 700;
306
+ }
307
+
308
+ [data-diff], [data-file] {
309
+ --diffs-grid-number-column-width: minmax(min-content, max-content);
310
+ --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
311
+
312
+ &[data-dehydrated] {
313
+ --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
314
+ }
315
+
316
+ &:hover [data-code]::-webkit-scrollbar-thumb {
317
+ background-color: var(--diffs-bg-context);
318
+ }
319
+ }
320
+
321
+ @supports (-webkit-touch-callout: none) {
322
+ :host {
323
+ --diffs-scrollbar-gutter-fallback: 0px;
324
+ }
325
+ }
326
+
327
+ [data-line] span {
328
+ color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
329
+ background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
330
+ font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
331
+ font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
332
+ text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
333
+ }
334
+
335
+ [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
336
+ --diffs-computed-decoration-bg: var(--diffs-bg);
337
+ --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
338
+ --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
339
+ --diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
340
+ --diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
341
+ --diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
342
+ --diffs-line-bg: var(--diffs-computed-hovered-line-bg);
343
+ color: var(--diffs-fg);
344
+ background-color: var(--diffs-line-bg, var(--diffs-bg));
345
+ }
346
+
347
+ [data-line], [data-no-newline] {
348
+ &[data-decoration-bg] {
349
+ --mix-deco-light: 92%;
350
+ --mix-deco-dark: 85%;
351
+
352
+ &[data-decoration-bg-depth="2"] {
353
+ --mix-deco-light: 88%;
354
+ --mix-deco-dark: 80%;
355
+ }
356
+
357
+ &[data-decoration-bg-depth="3"] {
358
+ --mix-deco-light: 85%;
359
+ --mix-deco-dark: 78%;
360
+ }
361
+
362
+ --diffs-hover-mix-target: var(--diffs-decoration-bg);
363
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
364
+ var(--diffs-bg) var(--mix-deco-light),
365
+ var(--diffs-decoration-bg)), color-mix(in lab,
366
+ var(--diffs-bg) var(--mix-deco-dark),
367
+ var(--diffs-decoration-bg)));
368
+ }
369
+ }
370
+
371
+ [data-line-annotation], [data-gutter-buffer="annotation"] {
372
+ --diffs-annotation-bg: var(--diffs-bg-context);
373
+ --diffs-computed-decoration-bg: var(--diffs-annotation-bg);
374
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
375
+ }
376
+
377
+ [data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
378
+ --diffs-computed-decoration-bg: var(--diffs-bg-context);
379
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
380
+ }
381
+
382
+ [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
383
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
384
+ var(--diffs-bg) 78%,
385
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
386
+ var(--diffs-bg) 68%,
387
+ var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
388
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
389
+ }
390
+
391
+ [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
392
+ --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
393
+ var(--diffs-bg) 78%,
394
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
395
+ var(--diffs-bg) 68%,
396
+ var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
397
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
398
+ }
399
+
400
+ [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
401
+ --diffs-computed-decoration-bg: var(--diffs-bg);
402
+ --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
403
+ }
404
+
405
+ :where([data-background]) {
406
+ & [data-gutter-buffer], & [data-column-number] {
407
+ --mix-light: 91%;
408
+ --mix-dark: 85%;
409
+ }
410
+
411
+ & [data-line], & [data-no-newline] {
412
+ --mix-light: 88%;
413
+ --mix-dark: 80%;
414
+ }
415
+
416
+ & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
417
+ --diffs-diff-line-mix-target: var(--diffs-bg);
418
+
419
+ &[data-line-type="change-deletion"] {
420
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
421
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
422
+
423
+ &:where([data-gutter-buffer], [data-column-number]) {
424
+ color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
425
+ --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
426
+ }
427
+
428
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
429
+ var(--diffs-computed-decoration-bg) var(--mix-light),
430
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
431
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
432
+ var(--diffs-diff-line-mix-target)));
433
+ }
434
+
435
+ &[data-line-type="change-addition"] {
436
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
437
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
438
+
439
+ &:where([data-gutter-buffer], [data-column-number]) {
440
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
441
+ --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
442
+ }
443
+
444
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
445
+ var(--diffs-computed-decoration-bg) var(--mix-light),
446
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
447
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
448
+ var(--diffs-diff-line-mix-target)));
449
+ }
450
+
451
+ &[data-merge-conflict="current"] {
452
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
453
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
454
+
455
+ &:where([data-gutter-buffer], [data-column-number]) {
456
+ color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
457
+ --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
458
+ }
459
+
460
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
461
+ var(--diffs-computed-decoration-bg) var(--mix-light),
462
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
463
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
464
+ var(--diffs-diff-line-mix-target)));
465
+ }
466
+
467
+ &[data-merge-conflict="incoming"] {
468
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
469
+ --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
470
+
471
+ &:where([data-gutter-buffer], [data-column-number]) {
472
+ color: var(--diffs-modified-base);
473
+ --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
474
+ }
475
+
476
+ --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
477
+ var(--diffs-computed-decoration-bg) var(--mix-light),
478
+ var(--diffs-diff-line-mix-target)), color-mix(in lab,
479
+ var(--diffs-computed-decoration-bg) var(--mix-dark),
480
+ var(--diffs-diff-line-mix-target)));
481
+ }
482
+ }
483
+ }
484
+
485
+ [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
486
+ --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
487
+ --diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
488
+
489
+ &:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
490
+ --mix-selection-light: 82%;
491
+ --mix-selection-dark: 75%;
492
+ --diffs-hover-mix-target: var(--diffs-selection-mix-target);
493
+ }
494
+
495
+ &:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
496
+ --mix-selection-light: 75%;
497
+ --mix-selection-dark: 60%;
498
+ --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
499
+ --diffs-hover-mix-target: var(--diffs-selection-mix-target);
500
+ }
501
+
502
+ &:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
503
+ --diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
504
+ var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
505
+ var(--mix-selection-light),
506
+ var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
507
+ }
508
+
509
+ &:where([data-editor-overlay]), &[data-selected-line] {
510
+ --diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
511
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
512
+ var(--diffs-selection-mix-target)), color-mix(in lab,
513
+ var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
514
+ var(--diffs-selection-mix-target)));
515
+ }
516
+ }
517
+
518
+ [data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
519
+ --diffs-computed-editor-active-line-bg: color-mix(in lab,
520
+ var(--diffs-computed-selected-line-bg)
521
+ var(--diffs-editor-active-line-source-mix, 100%),
522
+ var(--diffs-selection-emphasis-mix-target));
523
+ }
524
+
525
+ @media (pointer: fine) {
526
+ [data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
527
+ --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
528
+ var(--diffs-computed-editor-active-line-bg) 97%,
529
+ var(--diffs-hover-mix-target)), color-mix(in lab,
530
+ var(--diffs-computed-editor-active-line-bg) 91%,
531
+ var(--diffs-hover-mix-target)));
532
+ }
533
+ }
534
+
535
+ [data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
536
+ color: var(--diffs-selection-number-fg);
537
+ }
538
+
539
+ [data-no-newline] {
540
+ user-select: none;
541
+
542
+ & span {
543
+ opacity: .6;
544
+ }
545
+ }
546
+
547
+ [data-diff-type="split"][data-overflow="scroll"] {
548
+ grid-template-columns: 1fr 1fr;
549
+ display: grid;
550
+
551
+ & [data-additions] {
552
+ border-left: 1px solid var(--diffs-bg);
553
+ }
554
+
555
+ & [data-deletions] {
556
+ border-right: 1px solid var(--diffs-bg);
557
+ }
558
+ }
559
+
560
+ [data-code] {
561
+ grid-auto-flow: dense;
562
+ grid-template-columns: var(--diffs-code-grid);
563
+ overflow: var(--diffs-overflow-override, scroll) clip;
564
+ overscroll-behavior-x: none;
565
+ tab-size: var(--diffs-tab-size, 2);
566
+ padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
567
+ padding-bottom: max(0px,
568
+ calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
569
+ var(--diffs-scrollbar-gutter)));
570
+ scrollbar-gutter: stable;
571
+ align-self: flex-start;
572
+ display: grid;
573
+ }
574
+
575
+ [data-diffs-scrollbar-measure] {
576
+ opacity: 0;
577
+ pointer-events: none;
578
+ scrollbar-gutter: auto;
579
+ grid-template-columns: none;
580
+ width: 100px;
581
+ height: 100px;
582
+ padding: 0;
583
+ position: absolute;
584
+ top: -200px;
585
+ left: -200px;
586
+ }
587
+
588
+ [data-container-size] {
589
+ container-type: inline-size;
590
+ }
591
+
592
+ [data-code]::-webkit-scrollbar {
593
+ width: 0;
594
+ height: var(--diffs-scrollbar-gutter);
595
+ }
596
+
597
+ [data-code]::-webkit-scrollbar-track {
598
+ background: none;
599
+ }
600
+
601
+ [data-code]::-webkit-scrollbar-thumb {
602
+ background-color: #0000;
603
+ background-clip: content-box;
604
+ border: 1px solid #0000;
605
+ border-radius: 3px;
606
+ }
607
+
608
+ [data-code]::-webkit-scrollbar-corner {
609
+ background-color: #0000;
610
+ }
611
+
612
+ @supports ((-moz-appearance: none)) {
613
+ [data-code] {
614
+ scrollbar-width: thin;
615
+ scrollbar-color: var(--diffs-bg-context) transparent;
616
+ padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
617
+ }
618
+ }
619
+
620
+ [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
621
+ & [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
622
+ padding-top: 0;
623
+ }
624
+ }
625
+
626
+ [data-gutter] {
627
+ grid-template-rows: subgrid;
628
+ grid-template-columns: subgrid;
629
+ z-index: 3;
630
+ background-color: var(--diffs-bg);
631
+ grid-column: 1;
632
+ display: grid;
633
+ position: relative;
634
+
635
+ & [data-gutter-buffer], & [data-column-number] {
636
+ border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
637
+ }
638
+ }
639
+
640
+ [data-content] {
641
+ grid-template-rows: subgrid;
642
+ grid-template-columns: subgrid;
643
+ background-color: var(--diffs-bg);
644
+ grid-column: 2;
645
+ min-width: 0;
646
+ display: grid;
647
+ }
648
+
649
+ [data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
650
+ grid-auto-flow: dense;
651
+ grid-template-columns: repeat(2, var(--diffs-code-grid));
652
+ padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
653
+ display: grid;
654
+
655
+ & [data-code] {
656
+ display: contents;
657
+ }
658
+
659
+ & [data-deletions] {
660
+ & [data-gutter] {
661
+ grid-column: 1;
662
+ }
663
+
664
+ & [data-content] {
665
+ border-right: 1px solid var(--diffs-bg);
666
+ grid-column: 2;
667
+ }
668
+ }
669
+
670
+ & [data-additions] {
671
+ & [data-gutter] {
672
+ border-left: 1px solid var(--diffs-bg);
673
+ grid-column: 3;
674
+ }
675
+
676
+ & [data-content] {
677
+ grid-column: 4;
678
+ }
679
+ }
680
+ }
681
+
682
+ [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
683
+ overflow: clip;
684
+ }
685
+
686
+ [data-overflow="scroll"] [data-gutter] {
687
+ position: sticky;
688
+ left: 0;
689
+ }
690
+
691
+ [data-interactive-lines] [data-line] {
692
+ cursor: pointer;
693
+ }
694
+
695
+ [data-interactive-line-numbers] [data-column-number] {
696
+ cursor: pointer;
697
+ touch-action: none;
698
+ }
699
+
700
+ [data-content-buffer], [data-gutter-buffer] {
701
+ user-select: none;
702
+ min-height: 1lh;
703
+ position: relative;
704
+ }
705
+
706
+ [data-gutter-buffer] {
707
+ padding-left: 2ch;
708
+ padding-right: 1ch;
709
+
710
+ &:before {
711
+ content: "";
712
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
713
+ display: block;
714
+ }
715
+ }
716
+
717
+ [data-gutter-buffer="annotation"] {
718
+ --diffs-annotation-bg: var(--diffs-bg-context-gutter);
719
+ min-height: 0;
720
+ }
721
+
722
+ [data-gutter-buffer="buffer"] {
723
+ --diffs-line-bg: var(--diffs-bg-context-gutter);
724
+ }
725
+
726
+ [data-content-buffer] {
727
+ background-position: 5px 0;
728
+ background-size: 8px 8px;
729
+ background-origin: border-box;
730
+ background-image: repeating-linear-gradient(-45deg,
731
+ transparent,
732
+ transparent calc(3px * 1.414),
733
+ var(--diffs-bg-buffer) calc(3px * 1.414),
734
+ var(--diffs-bg-buffer) calc(4px * 1.414));
735
+ grid-column: 1;
736
+ }
737
+
738
+ [data-separator] {
739
+ box-sizing: content-box;
740
+ background-color: var(--diffs-bg);
741
+ }
742
+
743
+ [data-separator="simple"] {
744
+ min-height: 4px;
745
+ }
746
+
747
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
748
+ background-color: var(--diffs-bg-separator);
749
+ }
750
+
751
+ [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
752
+ height: 32px;
753
+ position: relative;
754
+ }
755
+
756
+ [data-separator-wrapper] {
757
+ user-select: none;
758
+ fill: currentColor;
759
+ background-color: var(--diffs-bg);
760
+ align-items: center;
761
+ height: 100%;
762
+ display: flex;
763
+ position: absolute;
764
+ inset-inline: 0;
765
+ }
766
+
767
+ [data-content] [data-separator-wrapper] {
768
+ display: none;
769
+ }
770
+
771
+ [data-separator="metadata"] [data-separator-wrapper] {
772
+ background-color: var(--diffs-bg-separator);
773
+ height: 100%;
774
+ color: var(--diffs-fg-number);
775
+ white-space: nowrap;
776
+ text-overflow: ellipsis;
777
+ min-width: min-content;
778
+ padding-inline: 1ch;
779
+ inset-inline: 100% auto;
780
+ overflow: hidden;
781
+ }
782
+
783
+ [data-separator="line-info"] {
784
+ margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
785
+
786
+ & [data-separator-wrapper] {
787
+ min-width: 16px;
788
+ }
789
+ }
790
+
791
+ [data-separator="line-info-basic"], [data-separator="metadata"] {
792
+ margin-block: 0;
793
+ }
794
+
795
+ [data-separator="line-info"][data-separator-first] {
796
+ margin-top: 0;
797
+ }
798
+
799
+ [data-separator="line-info"][data-separator-last] {
800
+ margin-bottom: 0;
801
+ }
802
+
803
+ [data-expand-index] [data-separator-wrapper] {
804
+ grid-template-columns: 32px auto;
805
+ display: grid;
806
+ }
807
+
808
+ [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
809
+ grid-template-columns: 32px 32px auto;
810
+ }
811
+
812
+ [data-expand-button], [data-separator-content] {
813
+ background-color: var(--diffs-bg-separator);
814
+ flex: none;
815
+ align-items: center;
816
+ display: flex;
817
+ }
818
+
819
+ [data-expand-index] [data-separator-content]:hover {
820
+ cursor: pointer;
821
+ text-decoration: underline;
822
+ }
823
+
824
+ [data-expand-button] {
825
+ cursor: pointer;
826
+ min-width: 32px;
827
+ color: var(--diffs-fg-number);
828
+ border-right: 2px solid var(--diffs-bg);
829
+ flex-shrink: 0;
830
+ justify-content: center;
831
+ align-self: stretch;
832
+
833
+ &:hover {
834
+ color: var(--diffs-fg);
835
+ }
836
+
837
+ &[data-expand-all-button] {
838
+ display: none;
839
+ }
840
+ }
841
+
842
+ [data-expand-down] [data-icon] {
843
+ transform: scaleY(-1);
844
+ }
845
+
846
+ [data-separator-content] {
847
+ height: 100%;
848
+ color: var(--diffs-fg-number);
849
+ flex: auto;
850
+ justify-content: flex-start;
851
+ padding: 0 1ch;
852
+ overflow: hidden;
853
+ }
854
+
855
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
856
+ & [data-separator-content] {
857
+ user-select: none;
858
+ height: 100%;
859
+ overflow: clip;
860
+ }
861
+ }
862
+
863
+ [data-unmodified-lines] {
864
+ text-overflow: ellipsis;
865
+ white-space: nowrap;
866
+ flex: 0 auto;
867
+ min-width: 0;
868
+ display: block;
869
+ overflow: hidden;
870
+ }
871
+
872
+ @supports (width: 1cqi) {
873
+ [data-unified] {
874
+ & [data-separator="line-info"] [data-separator-wrapper] {
875
+ padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
876
+ width: 100cqi;
877
+
878
+ & [data-separator-content] {
879
+ border-radius: 6px;
880
+ }
881
+ }
882
+
883
+ & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
884
+ border-top-left-radius: unset;
885
+ border-bottom-left-radius: unset;
886
+ }
887
+ }
888
+
889
+ [data-gutter] {
890
+ & [data-separator="line-info"] [data-separator-wrapper] {
891
+ padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
892
+ }
893
+
894
+ & [data-separator="line-info"] [data-separator-content] {
895
+ border-top-left-radius: 6px;
896
+ border-bottom-left-radius: 6px;
897
+ }
898
+
899
+ & [data-separator="line-info"][data-expand-index] [data-separator-content] {
900
+ border-top-left-radius: unset;
901
+ border-bottom-left-radius: unset;
902
+ }
903
+ }
904
+
905
+ [data-additions] {
906
+ & [data-content] [data-separator="line-info"] {
907
+ background-color: var(--diffs-bg);
908
+
909
+ & [data-separator-wrapper] {
910
+ display: none;
911
+ }
912
+ }
913
+
914
+ & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
915
+ background-color: var(--diffs-bg-separator);
916
+ border-top-right-radius: 6px;
917
+ border-bottom-right-radius: 6px;
918
+ height: 100%;
919
+ display: block;
920
+
921
+ & [data-separator-content], & [data-expand-button] {
922
+ display: none;
923
+ }
924
+ }
925
+ }
926
+
927
+ [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
928
+ width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
929
+ }
930
+
931
+ [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
932
+ background-color: var(--diffs-bg-separator);
933
+ height: 100%;
934
+ margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
935
+ border-top-right-radius: 6px;
936
+ border-bottom-right-radius: 6px;
937
+ display: block;
938
+
939
+ & [data-separator-content], & [data-expand-button] {
940
+ display: none;
941
+ }
942
+ }
943
+
944
+ [data-separator="line-info"] [data-separator-wrapper] {
945
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
946
+ border-top-left-radius: 6px;
947
+ border-bottom-left-radius: 6px;
948
+ }
949
+ }
950
+
951
+ @media (pointer: fine) {
952
+ [data-separator="line-info"] [data-separator-wrapper] {
953
+ &[data-separator-multi-button] {
954
+ & [data-expand-up] {
955
+ border-top-left-radius: 6px;
956
+ border-bottom-left-radius: unset;
957
+ }
958
+
959
+ & [data-expand-down] {
960
+ border-bottom-left-radius: 6px;
961
+ border-top-left-radius: unset;
962
+ }
963
+ }
964
+ }
965
+ }
966
+ }
967
+
968
+ @media (pointer: coarse) {
969
+ [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
970
+ grid-template-columns: 34px 34px auto;
971
+
972
+ & [data-separator-content] {
973
+ grid-column: unset;
974
+ grid-row: unset;
975
+ }
976
+ }
977
+
978
+ @supports (width: 1cqi) {
979
+ [data-separator="line-info"] [data-separator-wrapper] {
980
+ & [data-expand-both], & [data-expand-down], & [data-expand-up] {
981
+ border-top-left-radius: 6px;
982
+ border-bottom-left-radius: 6px;
983
+ }
984
+
985
+ &[data-separator-multi-button] {
986
+ & [data-expand-up] {
987
+ border-top-left-radius: 6px;
988
+ border-bottom-left-radius: 6px;
989
+ }
990
+
991
+ & [data-expand-down] {
992
+ border-bottom-left-radius: unset;
993
+ border-top-left-radius: unset;
994
+ }
995
+ }
996
+ }
997
+ }
998
+ }
999
+
1000
+ @media (pointer: fine) {
1001
+ [data-separator-wrapper][data-separator-multi-button] {
1002
+ grid-template-rows: 50% 50%;
1003
+ display: grid;
1004
+
1005
+ & [data-separator-content] {
1006
+ grid-area: 1 / 2 / -1;
1007
+ min-width: min-content;
1008
+ }
1009
+
1010
+ & [data-expand-button] {
1011
+ grid-column: 1;
1012
+ }
1013
+ }
1014
+
1015
+ [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
1016
+ grid-template-columns: 34px auto;
1017
+ }
1018
+
1019
+ [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
1020
+ grid-template-columns: 100% auto;
1021
+ }
1022
+
1023
+ [data-separator="line-info"], [data-separator="line-info-basic"] {
1024
+ & [data-separator-multi-button] {
1025
+ & [data-expand-up] {
1026
+ border-bottom: 1px solid var(--diffs-bg);
1027
+ border-right: 2px solid var(--diffs-bg);
1028
+ }
1029
+
1030
+ & [data-expand-down] {
1031
+ border-top: 1px solid var(--diffs-bg);
1032
+ border-right: 2px solid var(--diffs-bg);
1033
+ }
1034
+ }
1035
+ }
1036
+ }
1037
+
1038
+ [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
1039
+ display: none;
1040
+ }
1041
+
1042
+ [data-line-annotation] {
1043
+ min-height: var(--diffs-annotation-min-height, 0);
1044
+ z-index: 2;
1045
+ }
1046
+
1047
+ [data-merge-conflict-actions] {
1048
+ z-index: 2;
1049
+ }
1050
+
1051
+ [data-separator="custom"] {
1052
+ grid-template-columns: subgrid;
1053
+ display: grid;
1054
+ }
1055
+
1056
+ [data-line], [data-column-number], [data-no-newline] {
1057
+ padding-inline: 1ch;
1058
+ position: relative;
1059
+ }
1060
+
1061
+ [data-indicators="classic"] [data-line] {
1062
+ padding-inline-start: 2ch;
1063
+ }
1064
+
1065
+ [data-indicators="classic"] {
1066
+ & [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
1067
+ &[data-no-newline], &[data-line] {
1068
+ &:before {
1069
+ user-select: none;
1070
+ width: 1ch;
1071
+ height: 1lh;
1072
+ display: inline-block;
1073
+ position: absolute;
1074
+ top: 0;
1075
+ left: 0;
1076
+ }
1077
+ }
1078
+ }
1079
+
1080
+ & [data-line-type="change-addition"] {
1081
+ &[data-line], &[data-no-newline] {
1082
+ &:before {
1083
+ content: "+";
1084
+ color: var(--diffs-addition-base);
1085
+ }
1086
+ }
1087
+ }
1088
+
1089
+ & [data-line-type="change-deletion"] {
1090
+ &[data-line], &[data-no-newline] {
1091
+ &:before {
1092
+ content: "-";
1093
+ color: var(--diffs-deletion-base);
1094
+ }
1095
+ }
1096
+ }
1097
+ }
1098
+
1099
+ [data-indicators="bars"] {
1100
+ & [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
1101
+ &[data-column-number] {
1102
+ &:before {
1103
+ content: "";
1104
+ user-select: none;
1105
+ contain: strict;
1106
+ width: 4px;
1107
+ height: 100%;
1108
+ display: block;
1109
+ position: absolute;
1110
+ top: 0;
1111
+ left: 0;
1112
+ }
1113
+ }
1114
+ }
1115
+
1116
+ & [data-line-type="change-deletion"] {
1117
+ &[data-column-number] {
1118
+ &:before {
1119
+ background-image: linear-gradient(0deg,
1120
+ var(--diffs-bg-deletion) 50%,
1121
+ var(--diffs-deletion-base) 50%);
1122
+ background-repeat: repeat;
1123
+ background-size: 2px 2px;
1124
+ background-size: calc(1lh / round(1lh / 2px))
1125
+ calc(1lh / round(1lh / 2px));
1126
+ }
1127
+ }
1128
+ }
1129
+
1130
+ & [data-line-type="change-addition"] {
1131
+ &[data-column-number] {
1132
+ &:before {
1133
+ background-color: var(--diffs-addition-base);
1134
+ }
1135
+ }
1136
+ }
1137
+ }
1138
+
1139
+ [data-overflow="wrap"] {
1140
+ & [data-line] {
1141
+ white-space: pre-wrap;
1142
+ word-break: break-word;
1143
+ }
1144
+
1145
+ & [data-annotation-content] {
1146
+ word-break: break-word;
1147
+ }
1148
+ }
1149
+
1150
+ [data-overflow="scroll"] [data-line] {
1151
+ white-space: pre;
1152
+ min-height: 1lh;
1153
+ }
1154
+
1155
+ [data-column-number] {
1156
+ box-sizing: content-box;
1157
+ text-align: right;
1158
+ user-select: none;
1159
+ color: var(--diffs-fg-number);
1160
+ padding-left: 2ch;
1161
+ }
1162
+
1163
+ [data-line-number-content] {
1164
+ min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
1165
+ z-index: 1;
1166
+ display: inline-block;
1167
+ position: relative;
1168
+ }
1169
+
1170
+ [data-disable-line-numbers] {
1171
+ & [data-gutter-buffer], & [data-column-number] {
1172
+ min-width: 4px;
1173
+ padding: 0;
1174
+
1175
+ &:before {
1176
+ min-width: 0;
1177
+ }
1178
+ }
1179
+
1180
+ & [data-line-number-content] {
1181
+ display: none;
1182
+ }
1183
+
1184
+ & [data-gutter-utility-slot] {
1185
+ right: unset;
1186
+ justify-content: flex-start;
1187
+ left: 0;
1188
+ }
1189
+
1190
+ &[data-indicators="bars"] [data-gutter-utility-slot] {
1191
+ left: 6px;
1192
+ }
1193
+ }
1194
+
1195
+ [data-file][data-disable-line-numbers] {
1196
+ & [data-gutter-buffer], & [data-column-number] {
1197
+ border-right: 0;
1198
+ min-width: 0;
1199
+ }
1200
+ }
1201
+
1202
+ [data-diff-span] {
1203
+ box-decoration-break: clone;
1204
+ border-radius: 3px;
1205
+ }
1206
+
1207
+ [data-line-type="change-addition"] [data-diff-span] {
1208
+ background-color: var(--diffs-bg-addition-emphasis);
1209
+ }
1210
+
1211
+ [data-line-type="change-deletion"] [data-diff-span] {
1212
+ background-color: var(--diffs-bg-deletion-emphasis);
1213
+ }
1214
+
1215
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
1216
+ color: var(--diffs-fg);
1217
+ padding-left: 1ch;
1218
+ }
1219
+
1220
+ [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
1221
+ align-items: center;
1222
+ display: flex;
1223
+
1224
+ &:after {
1225
+ color: var(--diffs-fg-conflict-marker);
1226
+ font-size: .75rem;
1227
+ font-style: normal;
1228
+ line-height: 1.25rem;
1229
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1230
+ padding-left: 1ch;
1231
+ }
1232
+ }
1233
+
1234
+ [data-merge-conflict="marker-start"]:after {
1235
+ content: "(Current Change)";
1236
+ }
1237
+
1238
+ [data-merge-conflict="marker-end"]:after {
1239
+ content: "(Incoming Change)";
1240
+ }
1241
+
1242
+ [data-merge-conflict-actions-content] {
1243
+ min-height: 1.75rem;
1244
+ font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1245
+ color: var(--diffs-fg);
1246
+ align-items: center;
1247
+ gap: .25rem;
1248
+ padding-inline: .5rem;
1249
+ font-size: .75rem;
1250
+ line-height: 1.2;
1251
+ display: flex;
1252
+ }
1253
+
1254
+ [data-merge-conflict-action] {
1255
+ appearance: none;
1256
+ color: var(--diffs-fg-number);
1257
+ font: inherit;
1258
+ cursor: pointer;
1259
+ background: none;
1260
+ border: 0;
1261
+ padding: 0;
1262
+ font-style: normal;
1263
+ }
1264
+
1265
+ [data-merge-conflict-action]:hover {
1266
+ color: var(--diffs-fg);
1267
+ }
1268
+
1269
+ [data-merge-conflict-action="current"]:hover {
1270
+ color: var(--diffs-addition-base);
1271
+ }
1272
+
1273
+ [data-merge-conflict-action="incoming"]:hover {
1274
+ color: var(--diffs-modified-base);
1275
+ }
1276
+
1277
+ [data-merge-conflict-action-separator] {
1278
+ color: var(--diffs-fg-number);
1279
+ opacity: .6;
1280
+ user-select: none;
1281
+ }
1282
+
1283
+ [data-diffs-header="default"] {
1284
+ background-color: var(--diffs-bg);
1285
+ justify-content: space-between;
1286
+ align-items: center;
1287
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1288
+ min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
1289
+ z-index: 2;
1290
+ flex-direction: row;
1291
+ padding-inline: 16px;
1292
+ display: flex;
1293
+ position: relative;
1294
+ top: 0;
1295
+ }
1296
+
1297
+ [data-header-content] {
1298
+ align-items: center;
1299
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1300
+ white-space: nowrap;
1301
+ flex-direction: row;
1302
+ min-width: 0;
1303
+ display: flex;
1304
+ }
1305
+
1306
+ [data-header-content] [data-prev-name], [data-header-content] [data-title] {
1307
+ text-overflow: ellipsis;
1308
+ white-space: nowrap;
1309
+ direction: rtl;
1310
+ min-width: 0;
1311
+ overflow: hidden;
1312
+ }
1313
+
1314
+ [data-prev-name] {
1315
+ opacity: .7;
1316
+ }
1317
+
1318
+ [data-rename-icon] {
1319
+ fill: currentColor;
1320
+ flex-grow: 0;
1321
+ flex-shrink: 0;
1322
+ }
1323
+
1324
+ [data-diffs-header="default"] [data-metadata] {
1325
+ white-space: nowrap;
1326
+ align-items: center;
1327
+ gap: 1ch;
1328
+ display: flex;
1329
+ }
1330
+
1331
+ [data-diffs-header="default"] [data-additions-count] {
1332
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1333
+ color: var(--diffs-addition-base);
1334
+ }
1335
+
1336
+ [data-diffs-header="default"] [data-deletions-count] {
1337
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1338
+ color: var(--diffs-deletion-base);
1339
+ }
1340
+
1341
+ [data-change-icon] {
1342
+ fill: currentColor;
1343
+ flex-shrink: 0;
1344
+ }
1345
+
1346
+ [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
1347
+ color: var(--diffs-modified-base);
1348
+ }
1349
+
1350
+ [data-change-icon="new"] {
1351
+ color: var(--diffs-addition-base);
1352
+ }
1353
+
1354
+ [data-change-icon="deleted"] {
1355
+ color: var(--diffs-deletion-base);
1356
+ }
1357
+
1358
+ [data-change-icon="file"] {
1359
+ opacity: .6;
1360
+ }
1361
+
1362
+ [data-annotation-content] {
1363
+ z-index: 2;
1364
+ isolation: isolate;
1365
+ white-space: normal;
1366
+ align-self: flex-start;
1367
+ min-width: 0;
1368
+ display: flow-root;
1369
+ position: relative;
1370
+ }
1371
+
1372
+ [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
1373
+ width: var(--diffs-column-content-width, auto);
1374
+ left: var(--diffs-column-number-width, 0);
1375
+ position: sticky;
1376
+ }
1377
+
1378
+ [data-annotation-slot] {
1379
+ text-wrap-mode: wrap;
1380
+ word-break: normal;
1381
+ white-space-collapse: collapse;
1382
+ }
1383
+
1384
+ [data-gutter-utility-slot] {
1385
+ touch-action: none;
1386
+ justify-content: flex-end;
1387
+ display: flex;
1388
+ position: absolute;
1389
+ top: 0;
1390
+ bottom: 0;
1391
+ right: 0;
1392
+ }
1393
+
1394
+ [data-utility-button] {
1395
+ appearance: none;
1396
+ cursor: pointer;
1397
+ width: 1lh;
1398
+ height: 1lh;
1399
+ font-size: var(--diffs-font-size, 13px);
1400
+ line-height: var(--diffs-line-height, 20px);
1401
+ background-color: var(--diffs-modified-base);
1402
+ color: var(--diffs-bg);
1403
+ fill: currentColor;
1404
+ z-index: 4;
1405
+ touch-action: none;
1406
+ border: none;
1407
+ border-radius: 4px;
1408
+ justify-content: center;
1409
+ align-items: center;
1410
+ margin-right: calc(-1lh + 1ch);
1411
+ padding: 0;
1412
+ display: flex;
1413
+ position: relative;
1414
+
1415
+ &:before {
1416
+ content: "";
1417
+ display: block;
1418
+ position: absolute;
1419
+ inset: 0 0 0 -4px;
1420
+ }
1421
+ }
1422
+
1423
+ [data-decoration-bar-stack] {
1424
+ pointer-events: none;
1425
+ isolation: isolate;
1426
+ z-index: 1;
1427
+ background-color: var(--diffs-decoration-bar-color, transparent);
1428
+ box-sizing: content-box;
1429
+ border-left: 2px solid var(--diffs-bg);
1430
+ border-right: 2px solid var(--diffs-bg);
1431
+ width: 6px;
1432
+ position: absolute;
1433
+ top: 0;
1434
+ bottom: 0;
1435
+ right: -2px;
1436
+
1437
+ [data-decoration-bar-depth="1"] & {
1438
+ background-color: color-mix(in lab,
1439
+ var(--diffs-bg) 20%,
1440
+ var(--diffs-decoration-bar-color, transparent));
1441
+ }
1442
+
1443
+ [data-decoration-bar-depth="2"] & {
1444
+ background-color: color-mix(in lab,
1445
+ var(--diffs-bg) 45%,
1446
+ var(--diffs-decoration-bar-color, transparent));
1447
+ }
1448
+
1449
+ [data-decoration-bar-depth="3"] & {
1450
+ background-color: color-mix(in lab,
1451
+ var(--diffs-bg) 65%,
1452
+ var(--diffs-decoration-bar-color, transparent));
1453
+ }
1454
+
1455
+ [data-decoration-bar-start] & {
1456
+ border-top-left-radius: 5px;
1457
+ border-top-right-radius: 5px;
1458
+ }
1459
+
1460
+ [data-decoration-bar-end] & {
1461
+ z-index: 3;
1462
+ border-bottom-right-radius: 5px;
1463
+ border-bottom-left-radius: 5px;
1464
+ }
1465
+ }
1466
+
1467
+ [data-placeholder] {
1468
+ contain: strict;
1469
+ }
1470
+
1471
+ [data-error-wrapper] {
1472
+ padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
1473
+ var(--diffs-gap-inline, var(--diffs-gap-fallback));
1474
+ scrollbar-width: none;
1475
+ max-height: 400px;
1476
+ overflow: auto;
1477
+
1478
+ & [data-error-message] {
1479
+ color: var(--diffs-deletion-base);
1480
+ font-size: 18px;
1481
+ font-weight: bold;
1482
+ }
1483
+
1484
+ & [data-error-stack] {
1485
+ color: var(--diffs-fg-number);
1486
+ }
1487
+ }
1488
+ }
1489
+
1490
+ @layer theme, rendered, unsafe;
1491
+ `,Zf;function Qf(e){if(Zf!=null)return Zf;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(c,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),Zf=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Zf}function $f(e){return`${y}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var ep=`@layer base, theme, rendered, unsafe;`,tp=RegExp(`${ap(y)}\\s*:\\s*[^;]+;`);function np(e){return`${ep}
1492
+ @layer unsafe {
1493
+ ${e}
1494
+ }`}function rp(e,t=`system`,n){return`${ep}
1495
+ @layer rendered {
1496
+ :host {${t===`system`?``:`
1497
+ color-scheme: ${t};`}
1498
+ ${$f(n)}
1499
+ ${e}
1500
+ }
1501
+ }`}function ip(e,t){let n=$f(t);return e.replace(tp,n)}function ap(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function op({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function sp(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function cp(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`);break}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function lp(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function up(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function dp(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:up(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function fp(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function pp({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=mp(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function mp(){let e=document.createElement(`style`);return e.setAttribute(o,``),e}var hp=void 0;function gp(){return hp??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(Xf)),t.adoptedStyleSheets=[e]}connectedCallback(){Qf(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(j,t)}var _p=[``],vp=-1,yp=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++vp}`;type=`file`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;editor;constructor(e={theme:A},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new Bf(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new Gn,this.interactionManager=new Tn(`file`,En(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}__getCurrentFile(){return this.file}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(En(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!fe(this.appliedThemeCSS.theme,this.options.theme??A)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){this.code!=null&&(this.code.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e===`wrap`,columnVariables:this.shouldApplyColumnVariables(e)?`apply`:`measure`}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e===`scroll`&&this.lineAnnotations.length>0}cleanUp(e=!1){this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,file:i,lineAnnotations:a}=e;if(!this.enabled)throw Error(`File.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`File.hydrate: hydrate can only be called before the instance has rendered or hydrated`);this.hydrateElements(t,n),bp(this.pre,i,this.options.collapsed)||xp(this.headerElement,i,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:i,lineAnnotations:a}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),sp(e,t);for(let t of Array.from(e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t,this.appliedPreAttributes=void 0;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}if(`diffsHeader`in t.dataset){this.headerElement=t,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(dp(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e==null?_p:this.fileRenderer.getOrCreateLineCache(e)}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.file,r=this.lineAnnotations,i=this.renderRange;e!=null&&t!=null&&n!=null&&this.fileRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.file!==n||e.__syncRenderView(a,t,n,r,i)})}attachEditor(e){this.editor?.cleanUp(),this.editor=e,this.fileRenderer.beginEditSession();let t=this.file==null?void 0:e.__prepareFile?.(this.file);return t!==void 0&&t!==this.file?this.renderPreparedFile({file:t,forceRender:!0,preventEmit:!0,renderRange:this.renderRange}):this.fileRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),()=>{this.editor=void 0,this.fileRenderer.endEditSession()}}applyDocumentChange(e,t){this.fileRenderer.applyDocumentChange(e),t!=null&&t!==this.lineAnnotations&&this.file!=null&&(this.setLineAnnotations(t),this.fileRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations())}updateRenderCache(e,t,n){this.fileRenderer.updateRenderCache(e,t,n?.lineCountChangeInFlight)}render(e){if(!this.enabled)throw Error(`File.render: attempting to call render after cleaned up`);let t=this.editor?.__prepareFile?.(e.file)??e.file;return this.renderPreparedFile(t===e.file?e:{...e,file:t})}renderPreparedFile({file:e,fileContainer:t,forceRender:n=!1,preventEmit:r=!1,containerWrapper:i,deferManagers:a=!1,lineAnnotations:o,renderRange:s}){this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:c=!1,themeType:l=`system`}=this.options,u=c?void 0:s,d=this.renderRange,f=this.hasThemeChanged(),p=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1,m=!N(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);if(!c&&!n&&Fd(u,this.renderRange)&&!m&&!p&&!f)return this.applyCachedThemeState(l);this.renderRange=u,m&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions(dp(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:h=!1,disableFileHeader:g=!1}=this.options;if(g&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,i),this.applyCachedThemeState(l),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let n=this.fileRenderer.renderFile(e,b);n!=null&&this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n?.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.injectUnsafeCSS()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}try{let r=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,p,m||f)||!this.applyPartialRender(d,u)){let n=this.fileRenderer.renderFile(e,u);if(n==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.applyFullRender(n,r)}this.applyBuffers(r,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,a||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.file){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Lf(e))return;let n=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(e).length>n||await t.primeFileHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${qd(r)}`,a=this.annotationCache.get(i);if(a==null||!Uf(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:qf(qd(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Jf();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Yf(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=np(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??A,s=typeof o==`string`?o:{...o},c=Qf(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=pp({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:rp(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=ip(this.themeCSSStyle.textContent??``,Qf(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&gp()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let n=this.code=op({code:this.code}),r=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();let i=()=>{if(n.childElementCount>=2)for(let e=0;e<2;e++){let t=n.children[e],i=r[e];t.innerHTML=W(i.children),t.style.cssText=i.properties.style}else n.innerHTML=W(r);t.contains(n)||t.replaceChildren(n)};this.shouldGuardRebuildScroll()?fp(t,i):i(),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;let{file:n,code:r}=this,i=r==null?void 0:this.getColumns(r);if(n==null||r==null||i==null)return!1;let a=e.startingLine,o=t.startingLine,s=e.totalLines===1/0?1/0:a+e.totalLines,c=t.totalLines===1/0?1/0:o+t.totalLines,l=Math.max(a,o),u=Math.min(s,c);if(u<=l)return!1;if(!this.trimDOMToOverlap(i.gutter,l,u)||!this.trimDOMToOverlap(i.content,l,u))throw Error(`File.applyPartialRender: failed to trim to overlap`);let{length:d}=i.content.children,f=(e,t)=>{if(!(t<=0))return this.fileRenderer.renderFile(n,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},p=o<l?f(o,l-o):void 0;if(p===void 0&&o<l)return!1;let m=c===1/0?1/0:Math.max(0,c-u),h=c>u?f(u,m):void 0;return h===void 0&&c>u?!1:(this.cleanupErrorWrapper(),p!=null&&(i.gutter.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.gutterAST)),i.content.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.contentAST)),d+=p.rowCount),h!=null&&(i.gutter.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.gutterAST)),i.content.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.contentAST)),d+=h.rowCount),this.lastRowCount!==d&&(i.gutter.style.setProperty(`grid-row`,`span ${d}`),i.content.style.setProperty(`grid-row`,`span ${d}`),this.lastRowCount=d),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let r=this.getDOMBoundaryIndices(e,[t,n]),i=r.get(t)??e.children.length,a=r.get(n)??e.children.length;if(i>a)return!1;for(let t=e.children.length-1;t>=a;--t)e.children[t]?.remove();for(let t=i-1;t>=0;--t)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),r=new Map;if(n.length===0)return r;let i=0,a=n[i],{children:o}=e;a===0&&(r.set(0,0),i+=1,a=n[i]);for(let e=0;e<o.length;e+=1){let t=o[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(s!=null){for(;a!=null&&s>=a;)r.set(a,e),i+=1,a=n[i];if(i>=n.length)break}}for(let e of n)r.has(e)||r.set(e,o.length);return r}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){let{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=this.cachedHeaderHTML??W(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:i,renderHeaderFilenameSuffix:a,renderCustomHeader:o,renderHeaderMetadata:s}=this.options;if(o!=null){let e=o(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,w,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{let e=i?.(n)??void 0,r=a?.(n)??void 0,o=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,g,e),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,u,r),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,l,o),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}getOrCreateFileContainerNode(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:lp(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):lp(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Hf;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute(`data-code`)){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n=`scroll`,disableLineNumbers:r=!1}=this.options,i={type:`file`,split:!1,overflow:n,disableLineNumbers:r,diffIndicators:`none`,disableBackground:!0,totalLines:t};Wf(i,this.appliedPreAttributes)||(cp(e,i),this.appliedPreAttributes=i)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function bp(e,t,n=!1){return!n&&e==null&&t!=null}function xp(e,t,n=!1){return e==null&&t!=null&&!n}function Sp(e){return{...S,...e}}function Cp(e,t){let n=wp(e,t);return t?n:e.diffHeaderHeight+n}function wp(e,t){return e.paddingTop??(t?e.spacing:0)}function Tp(e){return e.paddingBottom??e.spacing}function Ep(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var Dp=5e3,Op=-1;function kp(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var Ap=class extends yp{virtualizer;metrics;__id=`virtualized-file:${++Op}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=S,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){let n=Sp(e);!t&&de(this.metrics,n)||(this.metrics=n,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){let n=this.cache.heights.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!pe(t,e),r=kp(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;let{overflow:t=`scroll`}=this.options;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;let n=this.code.children[1];if(!(n instanceof HTMLElement))return e;let r=Mf(this.lineAnnotations);if(this.renderRange!=null&&r&&Pf(this.renderRange)){let t=jp(n)??0;t!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=t,e=!0)}else !r&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(let t of n.children){if(!(t instanceof HTMLElement))continue;let n=t.dataset.lineIndex;if(n==null)continue;let r=Number(n),i=t.getBoundingClientRect().height,a=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(a=!0),i+=t.nextElementSibling.getBoundingClientRect().height);let o=this.getLineHeight(r,a);i!==o&&(e=!0,i===this.metrics.lineHeight*(a?2:1)?this.cache.heights.delete(r):this.cache.heights.set(r,i))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,r){let i=this.syncLineAnnotations(r),a=!N(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e),o=n?.resetFileLayoutCache===!0||a||i;n?.metrics!=null&&(this.metrics=n.metrics,o=!0);let{collapsed:s=!1}=this.options;return this.currentCollapsed!==s&&(this.currentCollapsed=s,o=!0),o&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;let{disableFileHeader:t=!1,collapsed:n=!1}=this.options,r=this.fileRenderer.getLineCount(this.file)-1,i=Cp(this.metrics,t);if(n||r<0)return{top:i,height:0};let a=Math.min(Math.max(e-1,0),r),{overflow:o=`scroll`}=this.options,{lineHeight:s}=this.metrics;if(i+=this.cache.fileAnnotationHeight,o===`scroll`&&!this.hasLineAnnotations())return{top:i+a*s,height:s};let c=this.getLayoutCheckpointBeforeLineIndex(a);i=c?.top??i;for(let e=c?.lineIndex??0;e<a;e++)i+=this.getLineHeight(e,!1);return{top:i,height:this.getLineHeight(a,!1)}}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;let{disableFileHeader:t=!1,collapsed:n=!1,overflow:r=`scroll`}=this.options;if(n||this.renderRange.totalLines<=0)return;let i=this.fileRenderer.getLineCount(this.file)-1;if(i<0)return;let a=Cp(this.metrics,t),o=Math.min(this.renderRange.startingLine,i),s=Math.min(o+this.renderRange.totalLines-1,i);if(s<o)return;let{fileAnnotationHeight:c}=this.cache;if(r===`scroll`&&!this.hasLineAnnotations()){let{lineHeight:t}=this.metrics,n=a+(o===0?c:this.renderRange.bufferBefore),r=o+Math.max(Math.ceil((e-n)/t),0);return r>s?void 0:{lineNumber:r+1,top:a+c+r*t}}let l=a+(o===0?c:this.renderRange.bufferBefore);for(let t=o;t<=s;t++){if(l>=e)return{lineNumber:t+1,top:l};l+=this.getLineHeight(t)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.file,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1,t=this.file){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}let{disableFileHeader:i=!1,collapsed:a=!1,overflow:o=`scroll`}=this.options,{lineHeight:s}=this.metrics,c=this.fileRenderer.getLineCount(t),l=Cp(this.metrics,i),u=Tp(this.metrics);if(this.height+=l,a){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,o===`scroll`&&!this.hasLineAnnotations())this.height+=c*s;else for(let e=0;e<c;e++)this.addLayoutCheckpoint(e,this.height),this.height+=this.getLineHeight(e,!1);if(c>0&&(this.height+=u),this.fileContainer!=null&&n&&!r){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFile.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFile.computeApproximateSize: computed height doesnt match`,{name:t.name,elementHeight:e.height,computedHeight:this.height})}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!==void 0&&this.file!==void 0){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(this.file,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}renderPreparedFile({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...i}){let a=this.file==null||!N(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t),{forceRenderOverride:o,isSetup:s}=this;this.forceRenderOverride=void 0;let c=this.syncLineAnnotations(r);if(c&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),t==null)return console.error(`VirtualizedFile.render: attempting to virtually render when we dont have file`),!1;if(s)this.top??=this.getVirtualizedTop(),a&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(!1),this.computeApproximateSize(!1,t));else{this.computeApproximateSize(!1,t);let n=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(n==null)throw Error(`VirtualizedFile.render: simple virtualizer is not available`);n.connect(e,this),this.isVisible=n.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!a||!s))return this.file=t,a&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let l=this.virtualizer.getWindowSpecs(),u=this.top??0,d=this.computeRenderRangeFromWindow(t,u,l),f=super.renderPreparedFile({file:t,fileContainer:e,renderRange:d,lineAnnotations:r,forceRender:(o??n)||c||a,...i});return this.isSimpleMode()&&f&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),f}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}addLayoutCheckpoint(e,t){e%Dp===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFile: invalid checkpoint index`);if(n.lineIndex%t===0)return n}}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,overflow:a=`scroll`}=this.options,{hunkLineCount:o,lineHeight:s}=this.metrics,c=this.fileRenderer.getLineCount(e),l=this.height,u=Cp(this.metrics,i),d=c>0?Tp(this.metrics):0,{fileAnnotationHeight:f}=this.cache,p=u+f,m=Math.max(0,l-u-f-d),h=Mf(this.lineAnnotations),g=t+u,_=f>0&&h&&g<r&&g+f>n;if(t<n-l||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-u-d};if(c<=o)return{startingLine:0,totalLines:o,bufferBefore:0,bufferAfter:0};let v=Math.ceil(Math.max(r-n,0)/s),y=Math.ceil(v/o)*o+o,b=y/o,x=(n+r)/2;if(a===`scroll`&&!this.hasLineAnnotations()){let e=t+p,i=e+m;if(!_&&!(e<r&&i>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-u-d};let a=Math.floor(_&&x<t+p?0:(x-(t+p))/s),h=Math.floor(a/o)-Math.floor(b/2),g=Math.ceil(c/o),v=Math.max(0,Math.min(h,g))*o,S=h<0?y+h*o:y,C=v===0?0:f+v*s,w=Math.min(S,c-v);return{startingLine:v,totalLines:S,bufferBefore:C,bufferAfter:Math.max(0,(c-v-w)*s)}}let S=b,C=[],w=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-y*s*2),o),T=t+(w?.top??p),E=w?.lineIndex??0,ee,D,O,k=w?.lineIndex??0;for(let e=k;e<c;e++){let i=E%o===0,a=Math.floor(E/o);if(i&&(C[a]=T-(t+p),O!=null)){if(O<=0)break;O--}let s=this.getLineHeight(e,!1);T>n-s&&T<r&&(ee??=a),T+s>x&&(D??=a),O==null&&T>=r&&i&&(O=S),E++,T+=s}if(ee==null)if(_)ee=0,D=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-u-d};D??=ee;let te=Math.round(D-b/2),A=Math.max(0,Math.ceil(c/o)-b),j=Math.max(0,Math.min(te,A)),ne=j*o,re=te<0?y+te*o:y,M=C[j]??0,ie=ne===0?0:f+M,ae=j+re/o,oe=ae<C.length?m-C[ae]:m-(T-t-p);return{startingLine:ne,totalLines:re,bufferBefore:ie,bufferAfter:Math.max(0,oe)}}};function jp(e){let t;for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===jf&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function Mp(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function Np(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function Pp(e){return e===``?[]:e.split(D)}function Fp(e,t,n){let r=e===`clone`?Np(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return Ip(r,Rp(r,n),zp(r,n));case`rename-pure`:{let e=zp(r,n);Bp(r,n);let t=Pp(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,Hp(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function Ip(e,t,n){let r=Pp(t.contents),i=Pp(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=Lp(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,Hp(e,t,n),e}function Lp(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,p=0,m=0,h=[];for(let e of t.hunkContent){if(e.type===`context`){h.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,p+=e.lines,m+=e.lines;continue}h.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,p+=Math.max(e.additions,e.deletions),m+=e.additions+e.deletions}let g=Math.max(f(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:g,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:h,splitLineStart:n+g,unifiedLineStart:r+g,splitLineCount:p,unifiedLineCount:m}),n+=g+p,r+=g+m,i=d(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=d(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function Rp(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function zp(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Bp(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Vp(e,t,n){return e.cacheKey==null?Up(t,n):`${e.cacheKey}:hydrated`}function Hp(e,t,n){let r=Vp(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function Up(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var Wp=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Gp(e,t){return fe(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Kp(e){return F({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function qp(e){return F({tagName:`div`,children:[F({tagName:`span`,children:[P(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function Jp(e){return F({tagName:`div`,children:[ve({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function Yp({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(F({tagName:`div`,children:[P(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(Jp(`up`)),s++),o||(e.push(Jp(`down`)),s++)):(e.push(Jp(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(F({tagName:`div`,children:[F({tagName:`span`,children:[P(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(F({tagName:`div`,children:[P(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(F({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(F({tagName:`slot`,properties:{name:i}})),F({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function Xp(e,t){return`hunk-separator-${e}-${t}`}function Zp(e){let t=e.at(-1);return t==null?0:Math.max(d(t.additionStart,t.additionCount),d(t.deletionStart,t.deletionCount))}function Qp(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function $p({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function em({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function tm(e){return[f(e.additionStart,e.additionCount)+1,d(e.additionStart,e.additionCount)+1]}function nm({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function rm(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-d(t.additionStart,t.additionCount),r=e.deletionLines.length-d(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function im({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-d(n.additionStart,n.additionCount),i=e.deletionLines.length-d(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function am({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=im({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function om({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=tm(a);if(t<o){let s=nm({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=am({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=tm(a);return t<o+i.fromStart||t>=o+i.rangeSize}function sm({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=tm(n),l=nm({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=am({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function cm({type:e,metrics:t}){return t.hunkSeparatorHeight??Ep(e)}function lm({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function um({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function dm(e){return e!==`simple`&&e!==`metadata`}function fm({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!um({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=cm({type:e,metrics:t}),a=lm({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function pm({type:e,metrics:t}){if(!dm(e))return;let n=cm({type:e,metrics:t}),r=lm({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function mm({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=hm({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=f(r.deletionStart,r.deletionCount),s=f(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=nm({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),p=n===c.finalHunkIndex?am({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,m=d.fromStart+d.fromEnd;function h(e,n){return p==null||p.collapsedLines<=0||p.fromStart+p.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?p.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?p.collapsedLines:0}let g=d.collapsedLines===0;function _(){return g?0:(g=!0,d.collapsedLines)}if(c.shouldSkip(m,m))c.incrementCounts(m,m),_();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(vm(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,vm(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:_(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{_()})))break hunkIterator}let v=r.unifiedLineStart,y=r.splitLineStart,b=l,x=u,S=o+1,C=s+1,w=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===w;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),_();else if(vm(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=v+t,s=y+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:_(),collapsedAfter:h(o,s),type:`context`,deletionLine:{lineNumber:S+t,lineIndex:b+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:x+t,lineNumber:C+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{_()}))break hunkIterator;v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines,C+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=ym(c,e,t);(s[0]?.[0]??0)>0&&_();for(let[l,u]of s)for(let s=l;s<u;s++){let l=h(v+s,t===`unified`?y+(s<e.deletions?s:s-e.deletions):y+s);if(c.emit(bm({hunkIndex:n,hunk:r,collapsedBefore:_(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:v,splitLineIndex:y,additionLineIndex:x,deletionLineIndex:b,additionLineNumber:C,deletionLineNumber:S,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}_(),c.incrementCounts(o,a),v+=o,y+=a,b+=e.deletions,x+=e.additions,S+=e.deletions,C+=e.additions}}if(p!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=p,a=r+i;if(vm(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:S+t,lineIndex:b+t,noEOFCR:!1,unifiedLineIndex:v+t,splitLineIndex:y+t},additionLine:{unifiedLineIndex:v+t,splitLineIndex:y+t,lineIndex:x+t,lineNumber:C+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function hm({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=gm({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function gm({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=nm({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?am({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function _m(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function vm(e,t,n,r,i,a){let[o,s]=_m(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function ym(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function bm({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}var xm={forcePlainText:!1};function Sm(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=xm){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=yf({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??wm();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}mm({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:c?h:!0,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&Cm({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=Tm({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function Cm({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=m(e),t=m(t),e.length>s||t.length>s))return;let c=o===`char`?h(e,t):_(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(em({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),em({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?em({item:e,arr:l,enableJoin:d,isLastItem:t}):em({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push($p({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push($p({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function wm(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function Tm({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=A,...l}}){let u=s??Gd(e.name),d=s??Gd(t.name),{state:f,transformers:p}=rf(l.useTokenTransformer),h=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:$(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(h.lang=u,f.lineInfo=n,h.decorations=a,xf(i.codeToHast(m(e.contents),h))),additionLines:t.contents===``?[]:(h.lang=d,h.decorations=o,f.lineInfo=r,xf(i.codeToHast(m(t.contents),h)))}}function Em(e,t){let n=v({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function Dm(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function Om(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function km(e,t){return t.length>0&&t.length<e.deletionLines.length&&Om(t)}function Am(e,t,n){let r=e.deletionLines.join(``),i=Dm(t.length,r),a=v({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function jm(e,t){return Am(e,[``],t)}function Mm(e,t){if(e.additionLines.length===0)return jm(e,t);if(km(e,e.additionLines))return Am(e,e.additionLines,t);let n=e.additionLines,r=Em(e,t);return Pm(r,n),r}function Nm(e){return e.length>1&&e.at(-1)===``}function Pm(e,t){if(!Nm(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&d(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,Wm(e);return}}}function Fm(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return Im(e,Em(e,n));let r=Array.from(t);if(r.length===0)return Im(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||m(r)===m(i))return Im(e,Em(e,n))}let i=Lm(e,r);if(i.size===0)return Im(e,Em(e,n));for(let t of i)if(!zm(e,t,n))return Im(e,Em(e,n));return Wm(e),rm(e)?Im(e,Em(e,n)):Im(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function Im(e,t){return Object.assign(e,t),t}function Lm(e,t){let n=new Set;for(let r of t){let t=Rm(e,r);if(t==null)return new Set;n.add(t)}return n}function Rm(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function zm(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=v({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(Vm(r,s),Bm(e,t),!0)}function Bm(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
1502
+ `),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
1503
+ `)}function Vm(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>Hm(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Um(e)}function Hm(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Um(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function Wm(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(f(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,Um(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=d(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-d(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var Gm=new WeakMap;function Km(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function qm(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(!(r===i&&r===a))return{start:r,deletionEnd:i,additionEnd:a}}function Jm(e,t){let n=e.hunks,r=e.additionLines,i=Km(r),a=i===r?e:{...e,additionLines:i},o=ih(n,rh(a,t),e.deletionLines.length),s=sh(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,_h(e),Pm(e,r),uh(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function Ym(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<ph(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:ph(r);if(i==null||t<i||o!=null&&o!==s)return Jm(e,n);o=s}if(o!=null){if(Xm(e,i,o,r,n)){e.editSessionDirty=!0;return}return Jm(e,n)}}function Xm(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=Zm(e),o=e.hunks[n];if(o.hunkContent.some(Qm))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function Zm(e){let t=Gm.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return Gm.set(e,{lines:e.deletionLines,set:n}),n}function Qm(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function $m(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function eh(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=nm({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=mh(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=am({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=mh(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function th(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=mh(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,mh(i)+i.deletionCount,e.deletionLines.length),n}function nh(e,t){return e.editSessionDirty===!0?(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?Em(e,t):Mm(e,t)),!0):!1}function rh(e,t){if(qm(e.deletionLines,e.additionLines)==null)return[];let n=v({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=Hm(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function ih(e,t,n){let r=e.map((e,t)=>{let n=mh(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&ah(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=oh(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function ah(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function oh(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function sh(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);lh(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);lh(s,c,i,r),r+=c,i+=c,n.push(ch(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function ch(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:hh(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:gh(t.additionStart,r),deletionStart:hh(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:gh(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${hh(t.deletionStart,i)},${i} +${hh(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Um(s),s}function lh(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function uh(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(mh(r)!==mh(i)||r.deletionCount!==i.deletionCount||ph(r)!==ph(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!dh(r,i))return!0}return!1}function dh(e,t){let n=fh(e),r=fh(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*fh(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function ph(e){return f(e.additionStart,e.additionCount)}function mh(e){return f(e.deletionStart,e.deletionCount)}function hh(e,t){return t===0?e:e+1}function gh(e,t){return t===0?e-1:e}function _h(e){Wm(e);for(let t=0;t<e.hunks.length;t++)Bm(e,t)}function vh(e){let t=e.lang??Gd(e.name),n=e.lang??(e.prevName==null?`text`:Gd(e.prevName));return t===`text`&&n===`text`}var yh=-1,bh=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++yh}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:A},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Md(e.theme??A)?kd():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,jm(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||vh(e.diff)||Fh(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);Gp(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??E}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=m(l);c&&(i.additionLines[t]=Ff(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0)if(this.editSessionActive&&!i.isPartial){if(!n)if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,jm(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(km(i,i.additionLines))Object.assign(i,Am(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=Ym(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}else Object.assign(i,Fm(i,o,this.options.parseDiffOptions));return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=$m(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=Mh(e,r),n.code.additionLines=Ah(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,jm(t,this.options.parseDiffOptions)),n.code.additionLines[0]=jh(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,Mm(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(km(e,n)){Object.assign(e,Am(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(Jm(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>Id(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=A,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=re,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await Od(Kd(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=Fh(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!Gp(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!vh(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??Gd(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??A}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!Mp(e,n.diff)||!Gp(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=T){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||vh(e)||Fh(e,this.getTokenizeMaxLength()),l=!Mp(e,this.renderCache.diff),u=!Fd(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&Qp(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Qp(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??Gd(e.name);let t=this.highlighter!=null&&Md(i.theme),n=this.highlighter!=null&&rr(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=T){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return Vd({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Fh(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Gd(e.name);let n=this.highlighter!=null&&Md(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&rr(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=Sm(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(mm({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=jh(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!Gp(this.renderCache.options,n)||!Mp(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Gp(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Mp(e,n.diff)&&Gp(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=Ih(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:be(),deletionsGutterAST:be(),additionsGutterAST:be(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t);break}}},S=im({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,I(void 0,`buffer`,this.size)),h?.push(Kp(this.size))):(x.pushToGutter(`deletions`,I(void 0,`buffer`,this.size)),g?.push(Kp(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,xe(t,n,r,i))};function T(e){C.flush(),a===`unified`?Dh(`unified`,e,x):(Dh(`deletions`,e,x),Dh(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),mm({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&T({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&wh(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Oh(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Oh(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Eh({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&wh(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&Th(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Oh(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Oh(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Eh({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Th(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),E=_?n.noEOFCRDeletions:!1,ee=_?n.noEOFCRAdditions:!1,D=(s?.noEOFCR??!1)||E,O=(o?.noEOFCR??!1)||ee;if(O||D){if(a===`split`&&C.flush(),D){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(qp(e)),x.pushToGutter(`unified`,I(e,`metadata`,1))):(x.deletionsContentAST.push(qp(e)),x.pushToGutter(`deletions`,I(e,`metadata`,1)),O||(x.pushToGutter(`additions`,I(void 0,`buffer`,1)),x.additionsContentAST.push(Kp(1))))}if(O){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(qp(e)),x.pushToGutter(`unified`,I(e,`metadata`,1))):(x.additionsContentAST.push(qp(e)),x.pushToGutter(`additions`,I(e,`metadata`,1)),D||(x.pushToGutter(`deletions`,I(void 0,`buffer`,1)),x.deletionsContentAST.push(Kp(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&T({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let E=Math.max(Zp(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),ee=t.bufferBefore>0||t.bufferAfter>0,D=!f&&e.type!==`deleted`,O=!f&&e.type!==`new`,k=x.rowCount>0||ee;h=D&&k?h:void 0,g=O&&k?g:void 0,_=f&&k?_:void 0;let te=this.createPreElement(g!=null&&h!=null,E);return{unifiedGutterAST:f&&k?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:O&&k?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:D&&k?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:te,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:E,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=be(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,If(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(F({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(F({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(F({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return W(this.renderFullAST(e,t))}renderPartialHTML(e,t){return W(t==null?e:F({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!Pf(n))return;let i=e.type===`new`?[]:xh(Nf(this.deletionAnnotations)),a=e.type===`deleted`?[]:xh(Nf(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Eh({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Eh({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(qd(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(qd(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Rd({fileOrDiff:e,mode:t,stickyHeader:n})}};function xh(e){return e?.map(e=>qd(e))??[]}var Sh=new Intl.PluralRules(`en-US`);function Ch(e){return`${e} unmodified line${Sh.select(e)===`one`?``:`s`}`}function wh(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Th(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Eh({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,I(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,I(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,I(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Dh(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,Yp({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(Yp({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,Yp({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(Yp({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=Xp(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?Ch(n):`More unchanged context may be available`;c.pushToGutter(e,Yp({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(Yp({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Oh(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function kh(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Ah(e,t,n,r){let i=kh(e),a=kh(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=jh(e,r.getLineText(e));return l}function jh(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function Mh(e,t){let n=[],r=Ph(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!Nh(i)?i+r:i)}return n}function Nh(e){return e.endsWith(`
1504
+ `)||e.endsWith(`\r`)}function Ph(e){for(let t of e){if(t.endsWith(`\r
1505
+ `))return`\r
1506
+ `;if(t.endsWith(`
1507
+ `))return`
1508
+ `;if(t.endsWith(`\r`))return`\r`}return`
1509
+ `}function Fh(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Ih(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Lh(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Rh(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function zh(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function Bh({oldFile:e,newFile:t},n){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function Vh(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:up(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Hh(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Uh=-1,Wh=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Uh}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:A},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Gn,this.scrollSyncManager=new Wp,this.interactionManager=new Tn(`diff`,En(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return Vh(e)}createHunksRenderer(e){return new bh(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=f(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`)if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}else c+=n.lines,l+=n.lines,u+=n.lines;else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}else c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(!(i==null||a==null))return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(En(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!fe(this.appliedThemeCSS.theme,this.options.theme??A)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`?!0:e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){le(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=Bh(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Jh(this.pre,Kh({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Yh(this.headerElement,qh({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),sp(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?v(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!Hh(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(Fp(`merge`,e,t),this.setHydratedState(t),await zh(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=Bh(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,y=_&&(!Gh(u,this.deletionFile)||!Gh(d,this.additionFile)),x=e!=null&&e!==this.fileDiff,S=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!f&&Fd(h,this.renderRange)&&!n&&!S&&!g&&(e!=null&&e===this.fileDiff||e==null&&!y))return this.applyCachedThemeState(p);let C;e==null&&_&&(y||this.fileDiff==null)&&(C=v(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:w}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?C!=null&&(x=!0,this.fileDiff=C):this.fileDiff=e,x&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(nh(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:T=!1,disableFileHeader:E=!1}=this.options;if(E&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,b);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(T)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,S,y||x||g)&&this.applyPartialRender({previousRenderRange:w,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(T)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||Qp(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return mm({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=eh(e,this.hunksRenderer.getExpandedHunksMap(),t);return nh(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(th(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return om({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return sm({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=tm(o);if(e<s){let c=nm({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=am({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=tm(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){ce(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||vh(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Rh(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${qd(r)}`,a=this.annotationCache.get(i);if(a==null||!Lh(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:qf(qd(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Jf();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:lp(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):lp(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Hf;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??W(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,w,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,d=o?.(n)??void 0,f=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,g,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,u,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,l,f),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Yf(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=np(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??A,s=typeof o==`string`?o:{...o},c=Qf(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=pp({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:rp(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=ip(this.themeCSSStyle.textContent??``,Qf(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&gp()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?fp(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Xh(t[0]),a=Xh(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=W(i),r.content.innerHTML=W(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=op({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=op({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=op({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=Xh(r?.[0]),a=Xh(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=Xh(n?.[0]),i=Xh(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=W(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?fp(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Xh(t[0]),i=Xh(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}else throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l===`unified`?!1:t!=null&&n!=null,totalLines:r,customProperties:i};Wf(u,this.appliedPreAttributes)||(cp(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Gh(e,t){return e==null||t==null?e==null&&t==null:N(e,t)}function Kh({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function qh({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Jh(e,t,n=!1){return!n&&e==null&&t}function Yh(e,t,n=!1){return e==null&&t&&!n}function Xh(e){if(!(e==null||e.type!==`element`))return e.children??[]}function Zh({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=Cp(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=nm({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=fm({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=Qh(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?am({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=pm({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=pm({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=Tp(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function Qh(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return $h(e,t)}function $h(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var eg=3e3,tg=-1,ng=class extends Wh{__id=`little-virtualized-file-diff:${++tg}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=Sp(n)}setMetrics(e,t=!1){let n=Sp(e);!t&&de(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!Mf(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type===`deleted`?t.side===`deletions`:!0:!1)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!pe(t,e),r=n&&ug(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:dg(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1,{overflow:t=`scroll`}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r=n===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&i&&Pf(this.renderRange)){let t=rg(r)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else !i&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of r){if(t==null)continue;let r=t.children[1];if(r instanceof HTMLElement)for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(r==null)continue;let i=hg(r,n),a=t.getBoundingClientRect().height,o=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(o=!0),a+=t.nextElementSibling.getBoundingClientRect().height);let s=this.getEstimatedLineHeight(o),c=this.cache.heightDeltas.get(i)??0,l=a-s;l!==c&&(e=!0,this.cache.measuredHeightDeltaTotal+=l-c,l===0?this.cache.heightDeltas.delete(i):this.cache.heightDeltas.set(i,l))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,r){let i=!Mp(this.fileDiff,e),a=this.syncLineAnnotations(r),o=n?.resetDiffLayoutCache===!0||i||a,s=i||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=Sp(n.metrics),o=!0,s=!0);let{collapsed:c=!1,expandUnchanged:l=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,o=!0),this.currentExpandUnchanged!==l&&(this.currentExpandUnchanged=l,o=!0,s=!0),o&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t=`additions`){if(this.fileDiff==null||e<1)return;let n=this.getLineIndex(e,t);if(n==null)return;let{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:a=!1,collapsedContextThreshold:o=1}=this.options,s=this.getDiffStyle(),c=this.getHunkSeparatorType(),l=s===`split`?n[1]:n[0];this.approximateLayoutCheckpoints();let u=Cp(this.metrics,r),d=this.getLayoutCheckpointBeforeLineIndex(l),f=d?.top??u+this.cache.fileAnnotationHeight;if(a)return{top:u,height:0};let p;return mm({diff:this.fileDiff,diffStyle:s,startingLine:d?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=s===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=fm({type:c,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(f+=r.gapBefore,l>=o-n&&l<o)return p={top:f,height:r.height},!0;f+=r.height+r.gapAfter}}let u=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===l)return p={top:f,height:u},!0;if(f+=u,r>0){let e=pm({type:c,metrics:this.metrics});if(e!=null){if(l>o&&l<=o+r)return p={top:f+e.gapBefore,height:e.height},!0;f+=e.totalHeight}}return!1}}),p}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=1}=this.options;if(r)return;let a=this.getDiffStyle(),o=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let s=this.getLayoutCheckpointBeforeTop(e),c=s?.top??Cp(this.metrics,t)+this.cache.fileAnnotationHeight,l;return mm({diff:this.fileDiff,diffStyle:a,startingLine:s?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:s,additionLine:u})=>{let d=a===`split`?u?.splitLineIndex??s?.splitLineIndex:u?.unifiedLineIndex??s?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=fm({type:o,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(c+=e.totalHeight)}if(c>=e&&(s==null?u!=null&&(l={lineNumber:u.lineNumber,side:`additions`,top:c}):l={lineNumber:s.lineNumber,side:`deletions`,top:c},l!=null))return!0;let f=this.getLineHeight(d,(u?.noEOFCR??!1)||(s?.noEOFCR??!1));if(c+=f,i>0){let e=pm({type:o,metrics:this.metrics});e!=null&&(c+=e.totalHeight)}return!1}}),l}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.fileDiff,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){let n=Fp(`clone`,e,t);if(await zh(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(Fp(`merge`,e,t),this.setHydratedState(t),await zh(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t=!1,n,{pendingExpansions:r,pendingHydratedDiff:i}=this;if(r!=null){this.pendingExpansions=void 0;for(let e of r)this.hunksRenderer.expandHunk(e.hunkIndex,e.direction,e.expansionLineCountOverride),t=!0}return i!=null&&(this.pendingHydratedDiff=void 0,i.expectedDiff===e&&(this.setHydratedState(i.files),n=i.nextDiff)),n==null?t&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)):(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})),n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return om({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!==void 0&&this.fileDiff!==void 0){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=Cp(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=Zh({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:fg(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=Bh(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!mg(s,this.deletionFile)||!mg(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=v(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=this.syncLineAnnotations(r);p&&this.resetLayoutCache({includeEstimatedHeights:!1});let m=t!=null&&t!==this.fileDiff,h=u!=null&&!Mp(this.fileDiff,u),g=m||l;if(h&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(f)this.top??=this.getVirtualizedTop(),h&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,u));else{this.computeApproximateSize(!1,u);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!g||!f))return this.fileDiff=u,a!=null&&(this.deletionFile=s,this.additionFile=c),h&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let _=this.virtualizer.getWindowSpecs(),y=this.top??0,b=this.computeRenderRangeFromWindow(u,y,_),x=super.render({fileDiff:u,fileContainer:e,renderRange:b,lineAnnotations:r,forceRender:(d??n)||p||h,...a,...i});return this.isSimpleMode()&&x&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),x}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return pg(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=fg(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=ig(this.cache.heightDeltas),u=Cp(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=sg(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+cg(i,e)*this.metrics.lineHeight+ag(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=eg}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+ag(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=nm({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?fm({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?am({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?pm({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:lg({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=nm({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=am({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=fg(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=Cp(this.metrics,i),h=e.hunks.length>0?Tp(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,w=C/s,T=w,E=[],ee=(n+r)/2,D=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),O=t+(D?.top??_),k=D?.renderedLineIndex??0,te,A,j;if(mm({diff:e,diffStyle:l,startingLine:D?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?fm({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;O+=y;let b=k%s===0,x=Math.floor(k/s);if(b&&(E[x]=O-(t+_+y),j!=null)){if(j<=0)return!0;j--}let S=this.getLineHeight(l===`split`?m:h,g);if(O>n-S&&O<r&&(te??=x),A==null&&O+S>ee&&(A=x),j==null&&O>=r&&b&&(j=T),k++,O+=S,c>0||v&&d){let e=pm({type:u,metrics:this.metrics});e!=null&&(O<r&&O+e.totalHeight>n&&(te??=x),A==null&&O+e.totalHeight>ee&&(A=x),O+=e.totalHeight)}return!1}}),te==null)if(x)te=0,A=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};A??=te;let ne=Math.round(A-w/2),re=Math.max(0,Math.ceil(p/s)-w),M=Math.max(0,Math.min(ne,re)),ie=M*s,ae=ne<0?C+ne*s:C,oe=E[M]??0,se=ie===0?0:g+oe,ce=M+ae/s,le=ce<E.length?v-E[ce]:v-(O-t-_);return{startingLine:ie,totalLines:ae,bufferBefore:se,bufferAfter:Math.max(0,le)}}};function rg(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===jf&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function ig(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function ag({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=og(e,n);return(t[og(e,r)]??0)-(t[i]??0)}function og(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function sg(e){return Math.ceil(e/eg)*eg}function cg(e,t){let n=0;for(let r of e)r<t&&n++;return n}function lg({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function ug(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function dg(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function fg(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function pg(e){return typeof e==`function`?`custom`:e??`line-info`}function mg(e,t){return e==null||t==null?e==null&&t==null:N(e,t)}function hg(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function gg(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:_g(e.items,t.items)}function _g(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function vg(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(C,``),t.before(r)):(r.setAttribute(te,``),t.after(r)),n?.observe(r),r}function yg(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var bg=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),xg=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],Sg=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],Cg=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],wg=Symbol(`CodeView.itemOptionsState`);function Tg(e,t){Object.defineProperty(e,wg,{configurable:!1,enumerable:!1,value:t})}function Eg(e){return e[wg]}function Dg(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var Og=120,kg=1,Ag=`--diffs-overflow-override`,jg=12e6,Mg=1e6,Ng=2e6,Pg=jg-Ng,Fg=jg-Mg;function Ig(e){if(e==null)throw Error(`CodeView: createEditor is required for items with edit: true`)}var Lg=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),Rg=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=k;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:A},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??O}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??k.hunkLineCount,lineHeight:e?.lineHeight??k.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??k.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??k.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??x}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return ne&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<kg||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),Lg&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(Ag,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Og)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(Ag,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element==null?!1:(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??vg(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){le(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let e of this.itemEditors.values())e.editor.cleanUp();this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(j),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))Ug(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return _e()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncItemEditors(),this.syncSelection(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(r.state.id=t,this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncItemEditors(),this.syncSelection()}removeItem(e){let t=this.idToItem.get(e);if(t==null)return console.error(`CodeView.removeItem: unknown item id "${e}"`),!1;let n=[];for(let e of this.items)e!==t&&n.push(e.item);return this.setItems(n),!0}setItems(e){let t;this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||(t=this.reconcileItems(e)),this.syncItemEditors(t),this.syncSelection()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=zg(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;Bg(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!de(r,i),o=!de(n,this.getLayout());o&&this.syncLayout();let s=a||Vg(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||Hg(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),pe(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(e=this.idToItem){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),e))}render(t=!1){e.__STOP||(t?(le(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):ce(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=Yg(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(!(t==null&&n==null&&r==null))return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new ng(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new Ap(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&he(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return e.item.edit===!0&&e.item.collapsed!==!0}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t),i=!1;try{if(r==null){Ig(n);let e={id:t},a=n({onChange:(t,n)=>{let r=this.idToItem.get(e.id);r!=null&&(e.lastChange={item:r.item,file:t,lineAnnotations:n},this.options.onItemEditChange?.(r.item,t,n))}});if(a==null)return;r={editor:a,state:e},this.itemEditors.set(t,r),i=!0}r.editor.edit(e.instance),this.attachedEditors.add(t)}catch(n){throw i&&r!=null&&(this.itemEditors.delete(t),r.editor.cleanUp()),this.releaseRenderedItem(e),n}}syncItemEditors(e){if(this.itemEditors.size===0)return;let t=[];for(let[n,r]of this.itemEditors){let i=this.idToItem.get(n),a=e?.get(n);if(a==null&&i!=null&&this.isItemInEditMode(i))continue;r.editor.cleanUp(),this.itemEditors.delete(n),this.attachedEditors.delete(n);let{lastChange:o}=r.state,s=a==null?i?.item??o?.item:o?.item??a.item;s?.type===`diff`&&(a==null&&i!=null&&i.type===`diff`&&i.instance.completeEditSession()&&(this.markItemLayoutDirty(i),this.render()),nh(s.fileDiff)),o!=null&&t.push(a!=null||i==null?o:{...o,item:i.item})}for(let{item:e,file:n,lineAnnotations:r}of t)this.options.onItemEditComplete?.(e,n,r)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of xg)Dg(e,t,()=>this.options[t]);Dg(e,`stickyHeader`,()=>this.options.stickyHeaders),Dg(e,`collapsed`,e=>{let t=Eg(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed});for(let t of Sg)this.defineItemSharedCallback(e,`file`,t);for(let t of Cg)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of bg)Dg(e,t,()=>this.options[t]);Dg(e,`stickyHeader`,()=>this.options.stickyHeaders),Dg(e,`hunkSeparators`,()=>this.options.hunkSeparators),Dg(e,`collapsed`,e=>{let t=Eg(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed});for(let t of Sg)this.defineItemSharedCallback(e,`diff`,t);for(let t of Cg)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return Tg(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return Tg(t,{id:e}),t}updateItemOptionsId(e,t){let n=Eg(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){Dg(e,n,e=>{if(this.options[n]==null)return;let r=Eg(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){Dg(e,n,e=>{let r=Eg(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),i[n]=a),a})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s=new Map,c;for(let s=0;s<e.length;s++){let l=e[s];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,s,0);d.index=s,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(c=Math.min(c??s,s))):c=Math.min(c??s,s),t[s]!==d&&(c=Math.min(c??s,s)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}if(c==null){if(r.size===0)return;c=Math.max(i.length-1,0)}this.capturePendingLayoutAnchor(a);for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;s.set(n.item.id,n),this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);c=Math.min(c??a,a)}return this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(c),this.scrollDirty=!0,this.render(),s.size>0?s:void 0}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>Fg}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),jg):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=yg(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=yg(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>Fg&&t<i,o=n<Mg&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(Pg,r):Ng):{pagedScrollTop:yg(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=yg(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Wg(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Wg(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=ge({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),qg(this.stickyContainer,t.element,h),n.virtualizedSetup(),Kg(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(qg(this.stickyContainer,t.element,h),Kg(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=yg(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null){this.renderState.firstIndex===-1&&(this.stickyOffset.style.height=``);return}let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{let t=!1;for(let n of e)if(n.target===this.stickyContainer){let e=n.borderBoxSize[0].blockSize;if(Math.abs(e-this.renderState.stickyHeight)>=kg){let e=this.getScrollTop(),n=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let r=n==null?void 0:this.resolveAnchoredScrollTop(n);if(r!=null){let t=r-e;this.applyScrollFix(r,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else if(n.target===this.header.element||n.target===this.footer.element){let e=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==e.height){let n=this.getScrollTop(),i=this.getScrollAnchor(n);this.setHostHeight(e,r);let a=i==null?void 0:this.resolveAnchoredScrollTop(i);if(a!=null){let e=a-n;this.applyScrollFix(a,n,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else this.scrollDirty=!0,this.heightDirty=!0,t=!0;t&&this.render(!0)};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e,t=this.idToItem){let n,{pendingLayoutAnchor:r}=this;if(r!=null){let e=this.idToItem.get(r.id);if(e!=null&&t.get(r.id)===e)return r;e!=null&&(n=e)}if(e<=0)return;let{firstIndex:i,lastIndex:a,stickyTop:o,stickyBottom:s}=this.renderState;if(i===-1||a===-1)return;let c=this.getHeight();if(!(o===-1||s===-1)){for(let r=i;r<=a;r++){let i=this.items[r];if(i==null)continue;let a=this.getItemTopOffset()+i.top;if(a+i.height<=e)continue;if(a>=e+c)break;if(t.get(i.item.id)!==i){n??=i;continue}if(a>=e)return{type:`item`,id:i.item.id,viewportOffset:a-e};let o=this.getScrollAnchorViewportTop(a,e)-a,s=i.instance.getNumericScrollAnchor(o);if(s!=null){let t=a+s.top;return{type:`line`,id:i.item.id,lineNumber:s.lineNumber,side:s.side,viewportOffset:t-e}}}if(n!=null)for(let e=n.index+1;e<this.items.length;e++){let n=this.items[e];if(n!=null&&t.get(n.item.id)===n)return{type:`item`,id:n.item.id,viewportOffset:0}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=yg(this.clampScrollTop(e)),i=yg(t),{scrollPageOffset:a}=this,o=yg(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:yg(this.getScrollTop())===yg(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);gg(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);if(e.top=r,e.type===`diff`){let n=e.instance.consumeCodeViewLayoutChanges(e.item.fileDiff);n!=null&&Object.assign(e.item.fileDiff,n),e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[])}else e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]);r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function zg(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function Bg(e,t){return!fe(e.theme??A,t.theme??A)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function Vg(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Hg(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Ug(e){return e instanceof SVGElement?!0:lp(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Wg(e){let t=Gg(e.start,e.side),n=Gg(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function Gg(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Kg(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function qg(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function Jg(e){return(e.annotations?.length??0)>0}function Yg(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)Jg(t.item)&&i.push(t);return i.length>0?i:void 0}function Xg(e,t){let{resolution:n,hunkIndex:r,startContentIndex:i,endContentIndex:a,indexesToDelete:o=new Set}=t,s=e.hunks[r];if(s==null)throw console.error({diff:e,hunkIndex:r}),Error(`resolveRegion: Invalid hunk index: ${r}`);if(i<0||a>=s.hunkContent.length||i>a)throw Error(`resolveRegion: Invalid content range, ${i}, ${a}`);let{hunks:c,additionLines:l,deletionLines:u}=e,p={...e,hunks:[],deletionLines:[],additionLines:[],splitLineCount:0,unifiedLineCount:0,cacheKey:e.cacheKey==null?void 0:`${e.cacheKey}:${n[0]}-${r}:${i}-${a}`},m={nextAdditionLineIndex:0,nextDeletionLineIndex:0,nextAdditionStart:1,nextDeletionStart:1,splitLineCount:0,unifiedLineCount:0},h=r===c.length-1&&a===s.hunkContent.length-1,g=!e.isPartial;for(let[t,s]of c.entries()){Qg(e,p,m,f(s.deletionStart,s.deletionCount)-s.collapsedBefore,f(s.additionStart,s.additionCount)-s.collapsedBefore,s.collapsedBefore,g);let c={...s,hunkContent:[],additionStart:m.nextAdditionStart,deletionStart:m.nextDeletionStart,additionLineIndex:m.nextAdditionLineIndex,deletionLineIndex:m.nextDeletionLineIndex,additionCount:0,deletionCount:0,deletionLines:0,additionLines:0,splitLineStart:m.splitLineCount,unifiedLineStart:m.unifiedLineCount,splitLineCount:0,unifiedLineCount:0};for(let[e,d]of s.hunkContent.entries())if(t!==r||e<i||e>a){$g(d,p,u,l);let e={...d,additionLineIndex:m.nextAdditionLineIndex,deletionLineIndex:m.nextDeletionLineIndex};c.hunkContent.push(e),t_(e,m,c)}else if(o.has(e))c.hunkContent.push({type:`context`,lines:0,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex});else if(d.type===`context`){$g(d,p,u,l);let e={...d,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};c.hunkContent.push(e),t_(e,m,c)}else{e_(n,d,p,u,l);let e={type:`context`,lines:n===`deletions`?d.deletions:n===`additions`?d.additions:d.deletions+d.additions,deletionLineIndex:m.nextDeletionLineIndex,additionLineIndex:m.nextAdditionLineIndex};c.hunkContent.push(e),t_(e,m,c)}if(t===r&&h){let e=n===`deletions`?s.noEOFCRDeletions:s.noEOFCRAdditions;c.noEOFCRAdditions=e,c.noEOFCRDeletions=e}c.additionCount===0&&(c.additionStart--,e.isPartial||c.additionLineIndex--),c.deletionCount===0&&(c.deletionStart--,e.isPartial||c.deletionLineIndex--),p.hunks.push(c)}let _=c.at(-1);if(_!=null&&!e.isPartial){let e=d(_.deletionStart,_.deletionCount),t=d(_.additionStart,_.additionCount),n=Math.min(u.length-e,l.length-t);Zg(p,u,l,e,t,n),m.splitLineCount+=n,m.unifiedLineCount+=n}return p.splitLineCount=m.splitLineCount,p.unifiedLineCount=m.unifiedLineCount,p}function Zg(e,t,n,r,i,a){for(let o=0;o<a;o++){let a=t[r+o],s=n[i+o];if(a==null||s==null)throw Error(`pushCollapsedContextLines: missing collapsed context line`);e.deletionLines.push(a),e.additionLines.push(s)}}function Qg(e,t,n,r,i,a,o){a<=0||(o&&(Zg(t,e.deletionLines,e.additionLines,r,i,a),n.nextAdditionLineIndex+=a,n.nextDeletionLineIndex+=a),n.nextAdditionStart+=a,n.nextDeletionStart+=a,n.splitLineCount+=a,n.unifiedLineCount+=a)}function $g(e,t,n,r){if(e.type===`context`)for(let n=0;n<e.lines;n++){let i=r[e.additionLineIndex+n];if(i==null)throw console.error({additionLines:r,content:e,i:n}),Error(`pushContentLinesToDiff: Context line does not exist`);t.deletionLines.push(i),t.additionLines.push(i)}else{let i=Math.max(e.deletions,e.additions);for(let a=0;a<i;a++){if(a<e.deletions){let r=n[e.deletionLineIndex+a];if(r==null)throw console.error({deletionLines:n,content:e,i:a}),Error(`pushContentLinesToDiff: Deletion line does not exist`);t.deletionLines.push(r)}if(a<e.additions){let n=r[e.additionLineIndex+a];if(n==null)throw console.error({additionLines:r,content:e,i:a}),Error(`pushContentLinesToDiff: Addition line does not exist`);t.additionLines.push(n)}}}}function e_(e,t,n,r,i){if(e===`deletions`||e===`both`)for(let e=0;e<t.deletions;e++){let i=r[t.deletionLineIndex+e];if(i==null)throw console.error({deletionLines:r,content:t,i:e}),Error(`pushResolveLinesToDiff: Deletion line does not exist`);n.deletionLines.push(i),n.additionLines.push(i)}if(e===`additions`||e===`both`)for(let e=0;e<t.additions;e++){let r=i[t.additionLineIndex+e];if(r==null)throw console.error({additionLines:i,content:t,i:e}),Error(`pushResolveLinesToDiff: Addition line does not exist`);n.deletionLines.push(r),n.additionLines.push(r)}}function t_(e,t,n){e.type===`context`?(t.nextAdditionLineIndex+=e.lines,t.nextDeletionLineIndex+=e.lines,t.nextAdditionStart+=e.lines,t.nextDeletionStart+=e.lines,t.splitLineCount+=e.lines,t.unifiedLineCount+=e.lines,n.additionCount+=e.lines,n.deletionCount+=e.lines,n.splitLineCount+=e.lines,n.unifiedLineCount+=e.lines):(t.nextAdditionLineIndex+=e.additions,t.nextDeletionLineIndex+=e.deletions,t.nextAdditionStart+=e.additions,t.nextDeletionStart+=e.deletions,t.splitLineCount+=Math.max(e.deletions,e.additions),t.unifiedLineCount+=e.deletions+e.additions,n.deletionCount+=e.deletions,n.deletionLines+=e.deletions,n.additionCount+=e.additions,n.additionLines+=e.additions,n.splitLineCount+=Math.max(e.deletions,e.additions),n.unifiedLineCount+=e.deletions+e.additions)}function n_(e){let t=typeof e==`string`?e:e.type;return t===`accept`||t===`incoming`?`additions`:t===`reject`||t===`current`?`deletions`:`both`}function r_(e,t,n){return Xg(e,{resolution:n_(n),hunkIndex:t.hunkIndex,startContentIndex:t.startContentIndex,endContentIndex:t.endContentIndex,indexesToDelete:i_(t)})}function i_(e){let t=new Set;return e.baseContentIndex!=null&&t.add(e.baseContentIndex),e.endMarkerContentIndex!==e.endContentIndex&&t.add(e.endMarkerContentIndex),t}function a_({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function o_(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:D_(n,e.startContentIndex)}}function s_(e,t=6){t=Math.max(t,1);let n={deletionLines:[],additionLines:[],conflictStack:[],conflictBuilders:[],actions:[],hunks:[],nextConflictIndex:0,splitLineCount:0,unifiedLineCount:0,lastHunkEnd:0,activeHunk:void 0,maxContextLines:t,maxContextLines2:t*2},r=e.contents,i=r.length;if(i>0){let e=0,t=0,a=r.indexOf(`
1510
+ `,e);for(;a!==-1;)c_(n,r.slice(e,a+1),t),e=a+1,t++,a=r.indexOf(`
1511
+ `,e);e<i&&c_(n,r.slice(e),t)}if(n.conflictStack.length>0)throw Error(`parseMergeConflictDiffFromFile: unfinished merge conflict marker stack`);n.activeHunk!=null&&n.activeHunk.hunkContent.length>0&&(f_(n,n.activeHunk,`trailing`),p_(n));for(let e=0;e<n.conflictBuilders.length;e++){let t=n.conflictBuilders[e];if(t==null||!t.completed)throw Error(`parseMergeConflictDiffFromFile: failed to build merge conflict action ${e}`)}if(n.hunks.length>0&&n.additionLines.length>0&&n.deletionLines.length>0){let e=n.hunks[n.hunks.length-1],t=Math.max(n.additionLines.length-d(e.additionStart,e.additionCount),0);n.splitLineCount+=t,n.unifiedLineCount+=t}let a=n.deletionLines.join(``),o=n.additionLines.join(``),s=w_(e,`current`,a),c=w_(e,`incoming`,o),l=`change`;o===``?l=`deleted`:a===``&&(l=`new`);let u={name:e.name,prevName:void 0,type:l,hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,isPartial:!1,deletionLines:n.deletionLines,additionLines:n.additionLines,cacheKey:e.cacheKey==null?void 0:`${e.cacheKey}:merge-conflict-diff`};return{fileDiff:u,currentFile:s,incomingFile:c,actions:n.actions,markerRows:T_(u,n.actions)}}function c_(e,t,n){let r=e.conflictStack[e.conflictStack.length-1];if(r==null){if(t.length>=7&&t.charCodeAt(0)===60&&x_(t)===`start`){v_(e,t,n);return}h_(e,t);return}let i=x_(t);if(i===`start`){v_(e,t,n);return}if(i===`base`){r.stage=`base`,r.baseMarkerLineIndex=n,r.markerLines.base=t;return}if(i===`separator`){r.stage=`incoming`,r.separatorLineIndex=n,r.markerLines.separator=t;return}if(i===`end`){let r=e.conflictStack.pop();if(r==null)throw Error(`parseMergeConflictDiffFromFile: encountered end marker before start marker`);__(e,r,n,t);return}r.stage===`current`?g_(e,`deletion`,t,r.conflictIndex,`current`):r.stage===`base`?h_(e,t,r.conflictIndex):g_(e,`addition`,t,r.conflictIndex,`incoming`)}function l_(e){return e.activeHunk??=y_(e.additionLines.length+1,e.deletionLines.length+1),e.activeHunk}function u_(e,t,n,r){let i=e.conflictBuilders[t];if(i==null)throw Error(`parseMergeConflictDiffFromFile: failed to locate conflict action ${t}`);let a=i.action,o=e.hunks.length;if(a.hunkIndex<0)a.hunkIndex=o;else if(a.hunkIndex!==o)throw Error(`parseMergeConflictDiffFromFile: conflict ${t} spans multiple hunks and cannot be anchored`);if(a.startContentIndex<0&&(a.startContentIndex=r),a.endContentIndex=r,a.endMarkerContentIndex=r,n===`current`){a.currentContentIndex??=r;return}if(n===`base`){a.baseContentIndex??=r;return}a.incomingContentIndex=r}function d_(e,t,n,r){let i=e.hunkContent,a=i[i.length-1];return a?.type===`change`?(t===`addition`?a.additions++:a.deletions++,i.length-1):(i.push({type:`change`,additions:+(t===`addition`),deletions:+(t===`deletion`),additionLineIndex:n,deletionLineIndex:r}),i.length-1)}function f_(e,t,n){let r=t.contextBufferCount,i=t.contextBufferAdditionStart,a=t.contextBufferDeletionStart;if(n===`leading`&&r>e.maxContextLines){let n=r-e.maxContextLines;i+=n,a+=n,r=e.maxContextLines,t.additionStart+=n,t.deletionStart+=n,t.additionLineIndex+=n,t.deletionLineIndex+=n}if(n===`trailing`&&r>e.maxContextLines&&(r=e.maxContextLines),r===0){t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0;return}let o=t.hunkContent,s=o[o.length-1],c;s?.type===`context`?(s.lines+=r,c=o.length-1):(o.push({type:`context`,lines:r,additionLineIndex:i,deletionLineIndex:a}),c=o.length-1),t.additionCount+=r,t.deletionCount+=r;let l=t.contextBufferBaseConflicts;if(l!=null){let n=i-t.contextBufferAdditionStart;for(let[t,i]of l)t>=n&&t<n+r&&u_(e,i,`base`,c)}t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0}function p_(e){if(e.activeHunk==null)return;let t=e.activeHunk;if(e.activeHunk=void 0,t.hunkContent.length===0)return;let n=0,r=0;for(let e of t.hunkContent)e.type===`context`?(n+=e.lines,r+=e.lines):(n+=Math.max(e.additions,e.deletions),r+=e.additions+e.deletions);let i=t.additionCount===0?t.additionStart-1:t.additionStart,a=t.deletionCount===0?t.deletionStart-1:t.deletionStart,o=Math.max(f(i,t.additionCount)-e.lastHunkEnd,0),s={collapsedBefore:o,additionStart:i,additionCount:t.additionCount,additionLines:t.additionLines,additionLineIndex:t.additionLineIndex,deletionStart:a,deletionCount:t.deletionCount,deletionLines:t.deletionLines,deletionLineIndex:t.deletionLineIndex,hunkContent:t.hunkContent,hunkContext:void 0,hunkSpecs:`@@ -${b_(a,t.deletionCount)} +${b_(i,t.additionCount)} @@\n`,splitLineStart:e.splitLineCount+o,splitLineCount:n,unifiedLineStart:e.unifiedLineCount+o,unifiedLineCount:r,noEOFCRAdditions:!1,noEOFCRDeletions:!1};e.hunks.push(s),e.splitLineCount+=o+n,e.unifiedLineCount+=o+r,e.lastHunkEnd=d(i,t.additionCount)}function m_(e){if(e.activeHunk==null)return;let t=e.activeHunk,n=t.contextBufferCount,r=n-e.maxContextLines2,i=t.contextBufferAdditionStart+n-e.maxContextLines,a=t.contextBufferDeletionStart+n-e.maxContextLines,o;if(t.contextBufferBaseConflicts!=null){let r=n-e.maxContextLines;for(let[e,n]of t.contextBufferBaseConflicts)e>=r&&(o??=new Map,o.set(e-r,n))}f_(e,t,`trailing`);let s=t.additionCount,c=t.deletionCount;p_(e),e.activeHunk=y_(t.additionStart+s+r,t.deletionStart+c+r),e.activeHunk.contextBufferAdditionStart=i,e.activeHunk.contextBufferDeletionStart=a,e.activeHunk.contextBufferCount=e.maxContextLines,e.activeHunk.contextBufferBaseConflicts=o}function h_(e,t,n=-1){let r=l_(e);r.contextBufferCount===0&&(r.contextBufferAdditionStart=e.additionLines.length,r.contextBufferDeletionStart=e.deletionLines.length),e.additionLines.push(t),e.deletionLines.push(t),n>=0&&(r.contextBufferBaseConflicts??=new Map,r.contextBufferBaseConflicts.set(r.contextBufferCount,n)),r.contextBufferCount++}function g_(e,t,n,r,i){let a=l_(e);a.hunkContent.length>0&&a.contextBufferCount>e.maxContextLines2&&(m_(e),a=e.activeHunk),f_(e,a,a.hunkContent.length===0?`leading`:`before-change`);let o=e.additionLines.length,s=e.deletionLines.length;t===`addition`?e.additionLines.push(n):e.deletionLines.push(n);let c=d_(a,t,o,s);t===`addition`?(a.additionCount++,a.additionLines++):(a.deletionCount++,a.deletionLines++),u_(e,r,i,c)}function __(e,t,n,r){if(t.separatorLineIndex==null||t.markerLines.separator==null)throw Error(`parseMergeConflictDiffFromFile: conflict ${t.conflictIndex} is missing a separator marker`);let i=e.conflictBuilders[t.conflictIndex];if(i==null)throw Error(`parseMergeConflictDiffFromFile: failed to finalize conflict ${t.conflictIndex}`);let a=i.action;a.markerLines.separator=t.markerLines.separator,a.markerLines.end=r,t.markerLines.base!=null&&(a.markerLines.base=t.markerLines.base),a.conflict={conflictIndex:t.conflictIndex,startLineIndex:t.startLineIndex,startLineNumber:t.startLineIndex+1,separatorLineIndex:t.separatorLineIndex,separatorLineNumber:t.separatorLineIndex+1,endLineIndex:n,endLineNumber:n+1,baseMarkerLineIndex:t.baseMarkerLineIndex,baseMarkerLineNumber:t.baseMarkerLineIndex==null?void 0:t.baseMarkerLineIndex+1};let o=a.currentContentIndex??a.incomingContentIndex;if(a.currentContentIndex??=o,a.incomingContentIndex??=o,a.startContentIndex<0&&o!=null&&(a.startContentIndex=o),a.endContentIndex<0&&o!=null&&(a.endContentIndex=o),a.endMarkerContentIndex<0&&o!=null&&(a.endMarkerContentIndex=o),a.hunkIndex<0||a.startContentIndex<0||a.endContentIndex<0||a.endMarkerContentIndex<0)throw Error(`parseMergeConflictDiffFromFile: failed to anchor merge conflict ${t.conflictIndex}`);e.actions[a.conflictIndex]=a,i.completed=!0}function v_(e,t,n){let r=e.nextConflictIndex;e.nextConflictIndex++,e.conflictStack.push({conflictIndex:r,stage:`current`,startLineIndex:n,markerLines:{start:t}}),e.conflictBuilders[r]={completed:!1,action:{conflict:{conflictIndex:r,startLineIndex:n,startLineNumber:n+1,separatorLineIndex:n,separatorLineNumber:n+1,endLineIndex:n,endLineNumber:n+1,baseMarkerLineIndex:void 0,baseMarkerLineNumber:void 0},conflictIndex:r,hunkIndex:-1,startContentIndex:-1,endContentIndex:-1,endMarkerContentIndex:-1,markerLines:{start:t,separator:``,end:``}}}}function y_(e,t){return{additionStart:e,deletionStart:t,additionCount:0,deletionCount:0,additionLines:0,deletionLines:0,additionLineIndex:Math.max(e-1,0),deletionLineIndex:Math.max(t-1,0),hunkContent:[],contextBufferAdditionStart:Math.max(e-1,0),contextBufferDeletionStart:Math.max(t-1,0),contextBufferCount:0,contextBufferBaseConflicts:void 0}}function b_(e,t){return t===1?`${e}`:`${e},${t}`}function x_(e){if(e.length<7)return;let t=e.charCodeAt(0);if(t!==60&&t!==62&&t!==61&&t!==124)return;let n=S_(e);if(n<7)return;let r=1;for(;r<n&&e.charCodeAt(r)===t;)r++;if(!(r<7)){if(t===61)return r===n?`separator`:void 0;if(!(r!==n&&!C_(e.charCodeAt(r))))return t===60?`start`:t===62?`end`:`base`}}function S_(e){let t=e.length;return t>0&&e.charCodeAt(t-1)===10&&t--,t>0&&e.charCodeAt(t-1)===13&&t--,t}function C_(e){return e===9||e===10||e===11||e===12||e===13||e===32}function w_(e,t,n){return{...e,contents:n,cacheKey:e.cacheKey==null?void 0:`${e.cacheKey}:merge-conflict-${t}`}}function T_(e,t){let n=[],r=Array(e.hunks.length),i=(t,n)=>{let i=e.hunks[t];if(i==null)return 0;let a=r[t];if(a==null){a=Array(i.hunkContent.length+1);let e=i.unifiedLineStart;a[0]=e;for(let t=0;t<i.hunkContent.length;t++){let n=i.hunkContent[t];e+=n.type===`context`?n.lines:n.deletions+n.additions,a[t+1]=e}r[t]=a}return a[Math.max(n,0)]??i.unifiedLineStart},a=(e,t)=>{let n=i(e,t),a=r[e]?.[Math.max(t+1,0)]??i(e,t+1);return Math.max(n,a-1)};for(let r of t){if(r==null)continue;let t=e.hunks[r.hunkIndex];if(t==null)continue;let o=i(r.hunkIndex,r.startContentIndex);if(n.push(E_(r,`marker-start`,r.startContentIndex,r.markerLines.start,o)),r.baseContentIndex!=null){let e=r.currentContentIndex,o=r.incomingContentIndex;if(e==null||o==null)continue;let s=r.markerLines.base;if(s==null)continue;let c=t.hunkContent[e],l=t.hunkContent[r.baseContentIndex],u=t.hunkContent[o];if(c?.type!==`change`||l?.type!==`context`||u?.type!==`change`)continue;let d=i(r.hunkIndex,e),f=i(r.hunkIndex,o);n.push(E_(r,`marker-base`,r.baseContentIndex,s,d+c.deletions)),n.push(E_(r,`marker-separator`,r.baseContentIndex,r.markerLines.separator,f),E_(r,`marker-end`,r.endMarkerContentIndex,r.markerLines.end,a(r.hunkIndex,r.endMarkerContentIndex)));continue}let s=r.currentContentIndex;if(s==null)continue;let c=t.hunkContent[s];if(c?.type!==`change`)continue;let l=i(r.hunkIndex,s),u=c.deletions>0?l+c.deletions:o;n.push(E_(r,`marker-separator`,s,r.markerLines.separator,u),E_(r,`marker-end`,r.endMarkerContentIndex,r.markerLines.end,a(r.hunkIndex,r.endMarkerContentIndex)))}return n}function E_(e,t,n,r,i){return{type:t,hunkIndex:e.hunkIndex,contentIndex:n,conflictIndex:e.conflictIndex,lineText:r,lineIndex:i}}function D_(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}var O_=class extends bh{pendingConflictActions=[];pendingMarkerRows=[];injectedRows=new Map;options;constructor(e={theme:A},t,n){super(void 0,t,n),this.options=e}setConflictState(e,t,n){this.pendingConflictActions=e,this.pendingMarkerRows=t,this.syncInjectedRows(e,t,n)}syncInjectedRows(e,t,n){this.injectedRows.clear();for(let t of e){let e=t==null?void 0:o_(t,n);if(t==null||e==null)continue;let r={type:`actions`,hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:t.conflictIndex};this.addInjectedRow(r)}for(let e of t)this.addInjectedRow(e)}addInjectedRow(e){let t=`${e.hunkIndex}:${e.lineIndex}`,n=this.injectedRows.get(t);n==null?this.injectedRows.set(t,[e]):n.push(e)}renderDiff(e,t=T){return e!=null&&this.syncInjectedRows(this.pendingConflictActions,this.pendingMarkerRows,e),super.renderDiff(e,t)}async asyncRender(e,t=T){return this.syncInjectedRows(this.pendingConflictActions,this.pendingMarkerRows,e),super.asyncRender(e,t)}createPreElement(e,t){return super.createPreElement(e,t,{"data-has-merge-conflict":``})}getUnifiedLineDecoration({type:e,lineType:t}){let n=e===`change`?t===`change-deletion`?`current`:`incoming`:void 0;return{gutterLineType:e===`change`?`context`:t,gutterProperties:k_(n),contentProperties:A_(e,n)}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`current`:`incoming`:void 0;return{gutterLineType:t===`change`?`context`:t,gutterProperties:k_(n),contentProperties:A_(t,n)}}getUnifiedInjectedRowsForLine=e=>{let t=this.injectedRows.get(`${e.hunkIndex}:${e.lineIndex}`);if(t==null||t.length===0)return;let{mergeConflictActionsType:n}=this.getOptionsWithDefaults(),r=[],i=[];for(let e of t){if(e.type===`actions`){r.push({content:M_({row:e,includeDefaultActions:n==="default",includeSlot:!0}),gutter:j_(`action`)});continue}(e.type===`marker-end`?i:r).push({content:N_(e),gutter:j_(`marker`,e.type)})}return{before:r.length>0?r:void 0,after:i.length>0?i:void 0}};getOptionsWithDefaults(){let e=super.getOptionsWithDefaults();return e.diffStyle=`unified`,e.lineDiffType=`none`,e.mergeConflictActionsType=this.options.mergeConflictActionsType??`default`,e}};function k_(e){return e==null?void 0:{"data-merge-conflict":e}}function A_(e,t){if(t!=null){if(e===`change`)return t===`current`||t===`incoming`?{"data-line-type":`context`,"data-merge-conflict":t}:void 0;if(t===`marker-start`||t===`marker-base`||t===`marker-separator`||t===`marker-end`)return{"data-merge-conflict":t}}}function j_(e,t){let n=I(void 0,`annotation`,1);return n.properties[`data-gutter-buffer`]=e===`action`?`merge-conflict-action`:`merge-conflict-${t??`marker`}`,n}function M_({row:e,includeDefaultActions:t,includeSlot:n}){let r=t?P_(e.conflictIndex):[];return n&&r.push(F({tagName:`slot`,properties:{name:a_({hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:e.conflictIndex}),"data-merge-conflict-action-slot":``}})),F({tagName:`div`,properties:{"data-merge-conflict-actions":``},children:[F({tagName:`div`,properties:{"data-merge-conflict-actions-content":``},children:r})]})}function N_(e){return F({tagName:`div`,properties:{"data-merge-conflict":e.type,"data-merge-conflict-marker-row":``},children:[P(e.lineText.replace(/(?:\r\n|\n|\r)$/,``))]})}function P_(e){return[F_({resolution:`current`,label:`Accept current change`,conflictIndex:e}),I_(),F_({resolution:`incoming`,label:`Accept incoming change`,conflictIndex:e}),I_(),F_({resolution:`both`,label:`Accept both`,conflictIndex:e})]}function F_({resolution:e,label:t,conflictIndex:n}){return F({tagName:`button`,properties:{type:`button`,"data-merge-conflict-action":e,"data-merge-conflict-conflict-index":`${n}`},children:[P(t)]})}function I_(){return F({tagName:`span`,properties:{"data-merge-conflict-action-separator":``},children:[P(`|`)]})}function L_(e,t){return e.hunkIndex===t.hunkIndex&&e.startContentIndex===t.startContentIndex&&e.endContentIndex===t.endContentIndex&&e.currentContentIndex===t.currentContentIndex&&e.baseContentIndex===t.baseContentIndex&&e.incomingContentIndex===t.incomingContentIndex&&e.endMarkerContentIndex===t.endMarkerContentIndex&&e.conflictIndex===t.conflictIndex&&R_(e.conflict,t.conflict)}function R_(e,t){return e.conflictIndex===t.conflictIndex&&e.startLineIndex===t.startLineIndex&&e.startLineNumber===t.startLineNumber&&e.separatorLineIndex===t.separatorLineIndex&&e.separatorLineNumber===t.separatorLineNumber&&e.endLineIndex===t.endLineIndex&&e.endLineNumber===t.endLineNumber&&e.baseMarkerLineIndex===t.baseMarkerLineIndex&&e.baseMarkerLineNumber===t.baseMarkerLineNumber}var z_=-1,B_=class extends Wh{options;__id=`unresolved-file:${++z_}`;type=`unresolved-file`;computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0};conflictActions=[];markerRows=[];conflictActionCache=new Map;constructor(e={theme:A},t,n=!1){super(void 0,t,n),this.options=e,this.setOptions(e)}setOptions(e){if(e!=null){if(e.onMergeConflictAction!=null&&e.onMergeConflictResolve!=null)throw Error(`UnresolvedFile: onMergeConflictAction and onMergeConflictResolve are mutually exclusive. Use only one callback.`);this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions()}}syncInteractionOptions(){this.interactionManager.setOptions(En(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex,this.handleMergeConflictActionClick))}createHunksRenderer(e){return new O_(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getHunksRendererOptions(e){return Y_(e,this.options)}applyPreNodeAttributes(e,t){super.applyPreNodeAttributes(e,t,{"data-has-merge-conflict":``})}cleanUp(){this.emitPostRender(!0),this.clearMergeConflictActionCache(),this.computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0},this.conflictActions=[],super.cleanUp()}getOrComputeDiff({file:e,fileDiff:t,actions:n,markerRows:r}){let{maxContextLines:i,onMergeConflictAction:a}=this.options;wrapper:if(a!=null){let a=t!=null;if(a!==(n!=null)||a!==(r!=null))throw Error(`UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows must be passed together`);if(t!=null&&n!=null&&r!=null){this.computedCache={file:e??this.computedCache.file,fileDiff:t,actions:n,markerRows:r};break wrapper}else if(e!=null||this.computedCache.file!=null){if(e!=null&&this.computedCache.file!=null&&!N(e,this.computedCache.file)&&this.computedCache.fileDiff!=null&&this.computedCache.actions!=null)throw Error(`UnresolvedFile.getOrComputeDiff: file can only be used to initialize unresolved state once. Pass fileDiff and actions for subsequent updates.`);if(e??=this.computedCache.file,e==null)throw Error(`UnresolvedFile.getOrComputeDiff: file is null, should be impossible`);if(!N(e,this.computedCache.file)||this.computedCache.fileDiff==null||this.computedCache.actions==null){let t=s_(e,i);this.computedCache={file:e,fileDiff:t.fileDiff,actions:t.actions,markerRows:t.markerRows}}t=this.computedCache.fileDiff,n=this.computedCache.actions,r=this.computedCache.markerRows;break wrapper}else{t=this.computedCache.fileDiff,n=this.computedCache.actions,r=this.computedCache.markerRows;break wrapper}}else{if(t!=null||n!=null||r!=null)throw Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows are only usable in controlled mode, you must pass in `onMergeConflictAction`");if(e!=null&&this.computedCache.file!=null&&!N(e,this.computedCache.file))throw Error(`UnresolvedFile.getOrComputeDiff: uncontrolled unresolved files parse the file only once. Later updates must come from the cached diff state.`);if(this.computedCache.file??=e,this.computedCache.fileDiff==null&&this.computedCache.file!=null){let e=s_(this.computedCache.file,i);this.computedCache.fileDiff=e.fileDiff,this.computedCache.actions=e.actions,this.computedCache.markerRows=e.markerRows}t=this.computedCache.fileDiff,n=this.computedCache.actions,r=this.computedCache.markerRows;break wrapper}if(!(t==null||n==null||r==null))return{fileDiff:t,actions:n,markerRows:r}}hydrate(e){let{file:t,fileDiff:n,actions:r,markerRows:i,lineAnnotations:a,fileContainer:o,prerenderedHTML:s,preventEmit:c=!1}=e,l=this.getOrComputeDiff({file:t,fileDiff:n,actions:r,markerRows:i});l!=null&&(this.hydrateElements(o,s),this.setActiveMergeConflictState(l.actions,l.markerRows),q_(this.pre,l.fileDiff,this.options.collapsed)||J_(this.headerElement,l.fileDiff,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):(this.hydrationSetup({fileDiff:l.fileDiff,lineAnnotations:a}),this.pre!=null&&this.renderMergeConflictActionSlots()),c||this.emitPostRender())}rerender(){!this.enabled||this.fileDiff==null||this.render({forceRender:!0,renderRange:this.renderRange})}render(e={}){let{file:t,fileDiff:n,actions:r,markerRows:i,lineAnnotations:a,preventEmit:o=!1,...s}=e,c=this.getOrComputeDiff({file:t,fileDiff:n,actions:r,markerRows:i});if(c==null)return!1;this.setActiveMergeConflictState(c.actions,c.markerRows);let l=super.render({...s,fileDiff:c.fileDiff,lineAnnotations:a,preventEmit:!0});return l&&(this.renderMergeConflictActionSlots(),o||this.emitPostRender()),l}resolveConflict(e,t,n=this.computedCache.fileDiff){let r=this.conflictActions[e];if(n==null||r==null)return;if(r.conflictIndex!==e)throw console.error({conflictIndex:e,action:r}),Error(`UnresolvedFile.resolveConflict: conflictIndex and conflictAction don't match`);let i=r_(n,r,t),a=this.computedCache.file,{file:o,actions:s,markerRows:c}=V_({fileDiff:i,previousActions:this.conflictActions,resolvedConflictIndex:e,previousFile:a,resolution:t});return{file:o,fileDiff:i,actions:s,markerRows:c}}resolveConflictAndRender(e,t){let n=this.conflictActions[e];if(n==null)return;if(n.conflictIndex!==e)throw console.error({conflictIndex:e,action:n}),Error(`UnresolvedFile.resolveConflictAndRender: conflictIndex and conflictAction don't match`);let r={resolution:t,conflict:n.conflict},{file:i,fileDiff:a,actions:o,markerRows:s}=this.resolveConflict(e,t)??{};i==null||a==null||o==null||s==null||(this.computedCache={file:i,fileDiff:a,actions:o,markerRows:s},this.setActiveMergeConflictState(o,s),this.workerManager==null?this.render({forceRender:!0}):this.hunksRenderer.renderDiff(a),this.options.onMergeConflictResolve?.(i,r))}setActiveMergeConflictState(e=this.conflictActions,t=this.markerRows){this.conflictActions=e,this.markerRows=t,this.computedCache.fileDiff!=null&&this.hunksRenderer instanceof O_&&this.hunksRenderer.setConflictState(this.options.mergeConflictActionsType===`none`?[]:e,t,this.computedCache.fileDiff)}handleMergeConflictActionClick=e=>{let t=this.conflictActions[e.conflictIndex];if(t==null)return;if(t.conflictIndex!==e.conflictIndex)throw console.error({conflictIndex:e.conflictIndex,action:t}),Error(`UnresolvedFile.handleMergeConflictActionClick: conflictIndex and conflictAction don't match`);let n={resolution:e.resolution,conflict:t.conflict};if(this.options.onMergeConflictAction!=null){this.options.onMergeConflictAction(n,this);return}this.resolveConflictAndRender(e.conflictIndex,e.resolution)};renderMergeConflictActionSlots(){let{fileDiff:e}=this.computedCache;if(this.isContainerManaged||this.fileContainer==null||typeof this.options.mergeConflictActionsType!=`function`||this.conflictActions.length===0||e==null){this.clearMergeConflictActionCache();return}let t=new Map(this.conflictActionCache);for(let n=0;n<this.conflictActions.length;n++){let r=this.conflictActions[n];if(r==null)continue;if(r.conflictIndex!==n)throw console.error({conflictIndex:n,action:r}),Error(`UnresolvedFile.renderMergeConflictActionSlots: conflictIndex and conflictAction don't match`);let i=o_(r,e);if(i==null)continue;let a=r.conflictIndex,o=a_({hunkIndex:i.hunkIndex,lineIndex:i.lineIndex,conflictIndex:a}),s=`${n}-${o}`,c=this.conflictActionCache.get(s);if(c==null||!L_(c.action,r)){c?.element.remove();let e=this.renderMergeConflictAction(r);if(e==null)continue;let t=qf(o);t.appendChild(e),this.fileContainer.appendChild(t),c={element:t,action:r},this.conflictActionCache.set(s,c)}t.delete(s)}for(let[e,{element:n}]of t.entries())this.conflictActionCache.delete(e),n.remove()}renderMergeConflictAction(e){if(typeof this.options.mergeConflictActionsType!=`function`)return;let t=this.options.mergeConflictActionsType(e,this);if(t!=null){if(t instanceof HTMLElement)return t;if(typeof DocumentFragment<`u`&&t instanceof DocumentFragment){let e=document.createElement(`div`);return e.style.display=`contents`,e.appendChild(t),e}}}clearMergeConflictActionCache(){for(let{element:e}of this.conflictActionCache.values())e.remove();this.conflictActionCache.clear()}};function V_({fileDiff:e,previousActions:t,resolvedConflictIndex:n,previousFile:r,resolution:i}){let a=t[n];if(a==null)throw Error(`rebuildFileAndActions: missing resolved action for unresolved file rebuild`);let o=W_(t,n,a,i),s=T_(e,o);return{file:H_({fileDiff:e,resolvedAction:a,resolvedConflictIndex:n,previousFile:r,resolution:i}),actions:o,markerRows:s}}function H_({resolvedAction:e,resolvedConflictIndex:t,previousFile:n,fileDiff:r,resolution:i}){let a=Pp(n?.contents??``),{conflict:o}=e,s=U_(a,o,i),c=[...a.slice(0,o.startLineIndex),...s,...a.slice(o.endLineIndex+1)].join(``);return{name:n?.name??r.name,contents:c,cacheKey:n?.cacheKey==null?void 0:`${n.cacheKey}:mc-${t}-${i}`}}function U_(e,t,n){let r=e.slice(t.startLineIndex+1,t.baseMarkerLineIndex??t.separatorLineIndex),i=e.slice(t.separatorLineIndex+1,t.endLineIndex);return n===`current`?r:n===`incoming`?i:[...r,...i]}function W_(e,t,n,r){let i=G_(n.conflict,r);return e.map((e,r)=>{if(r!==t&&e!=null)return e.conflict.startLineIndex>n.conflict.endLineIndex?{...e,conflict:K_(e.conflict,i)}:e})}function G_(e,t){let n=(e.baseMarkerLineIndex??e.separatorLineIndex)-e.startLineIndex-1,r=e.endLineIndex-e.separatorLineIndex-1;return(t===`current`?n:t===`incoming`?r:n+r)-(e.endLineIndex-e.startLineIndex+1)}function K_(e,t){return{...e,startLineIndex:e.startLineIndex+t,startLineNumber:e.startLineNumber+t,separatorLineIndex:e.separatorLineIndex+t,separatorLineNumber:e.separatorLineNumber+t,endLineIndex:e.endLineIndex+t,endLineNumber:e.endLineNumber+t,baseMarkerLineIndex:e.baseMarkerLineIndex==null?void 0:e.baseMarkerLineIndex+t,baseMarkerLineNumber:e.baseMarkerLineNumber==null?void 0:e.baseMarkerLineNumber+t}}function q_(e,t,n=!1){return!n&&e==null&&t!=null}function J_(e,t,n=!1){return e==null&&t!=null&&!n}function Y_(e,t){let n={...t,...e};return{...n,useTokenTransformer:up(n),hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,mergeConflictActionsType:typeof e?.mergeConflictActionsType==`function`?`custom`:e?.mergeConflictActionsType}}var X_={default:void 0,type:M.selectedLines};function Z_(e,t){let n=ev(e);return t===void 0?n:{...n,controlledSelection:!0}}function Q_(e,t){return{...Z_(e,t),enableLineSelection:!1}}function $_(e,t){return{...Q_(e,t),expandUnchanged:!0}}function ev(e){let t=Object(e);if(!Object.is(t,e))return a(e);for(let e of Reflect.ownKeys(t))Reflect.get(t,e);return a(e)}function tv(e){if(!e)return e;for(let t of e)ev(t);return a(e)}function nv(e){return e===null?null:{...e}}function rv(e){if(e)return{...e,headerOptions:e.headerOptions?{...e.headerOptions}:void 0}}var iv=r({name:`ViteHubPierreDiff`,inheritAttrs:!1,props:{fileDiff:{type:M.fileDiff},lineAnnotations:{type:M.diffLineAnnotations},newFile:{type:M.nullableFileContents},oldFile:{type:M.nullableFileContents},options:{type:M.fileDiffOptions},patch:{type:String},selectedLines:X_},setup(r,{attrs:a,expose:o}){let s=null,c,l=i(()=>{if(r.fileDiff)return ev(r.fileDiff);if(r.patch!==void 0)return p(r.patch);if(r.oldFile!==void 0&&r.newFile!==void 0)return v(nv(r.oldFile),nv(r.newFile),rv(r.options?.parseDiffOptions))}),u=()=>{if(!s)return;if(!l.value){c?.cleanUp(),c=void 0;return}let e=$_(r.options,r.selectedLines);c||=new Wh(e,void 0,!0),c.setOptions(e),c.render({fileContainer:s,fileDiff:l.value,forceRender:!0,lineAnnotations:tv(r.lineAnnotations)??[]}),r.selectedLines!==void 0&&c.setSelectedLines(ev(r.selectedLines))},d=e=>{s=e instanceof HTMLElement?e:null};return n(u,{flush:`post`}),t(()=>c?.cleanUp()),o({getInstance:()=>c}),()=>e(j,{...a,ref:d})}}),av=r({name:`ViteHubPierreFile`,inheritAttrs:!1,props:{file:{type:M.fileContents},lineAnnotations:{type:M.lineAnnotations},options:{type:M.fileOptions},selectedLines:X_},setup(r,{attrs:a,expose:o}){let s=null,c,l=i(()=>r.file?nv(r.file):void 0),u=()=>{if(!s)return;if(!l.value){c?.cleanUp(),c=void 0;return}let e=Q_(r.options,r.selectedLines);c||=new yp(e,void 0,!0),c.setOptions(e),c.render({file:l.value,fileContainer:s,forceRender:!0,lineAnnotations:tv(r.lineAnnotations)??[]}),r.selectedLines!==void 0&&c.setSelectedLines(ev(r.selectedLines))},d=e=>{s=e instanceof HTMLElement?e:null};return n(u,{flush:`post`}),t(()=>c?.cleanUp()),o({getInstance:()=>c}),()=>e(j,{...a,ref:d})}}),ov=r({name:`ViteHubPierreUnresolvedFile`,inheritAttrs:!1,props:{file:{type:M.fileContents},lineAnnotations:{type:M.diffLineAnnotations},options:{type:M.unresolvedFileOptions},selectedLines:X_},setup(r,{attrs:a,expose:o}){let s=null,c,l,u=i(()=>r.file?nv(r.file):void 0),d=()=>{if(!s)return;if(!u.value){c?.cleanUp(),c=void 0,l=void 0;return}c&&l!==u.value&&(c.cleanUp(),c=void 0);let e=Q_(r.options,r.selectedLines);c||=new B_(e,void 0,!0),c.setOptions(e),c.render({file:u.value,fileContainer:s,forceRender:!0,lineAnnotations:tv(r.lineAnnotations)??[]}),l=u.value,r.selectedLines!==void 0&&c.setSelectedLines(ev(r.selectedLines))},f=e=>{s=e instanceof HTMLElement?e:null};return n(d,{flush:`post`}),t(()=>c?.cleanUp()),o({getInstance:()=>c}),()=>e(j,{...a,ref:f})}}),sv=r({name:`ViteHubPierreCodeView`,inheritAttrs:!1,props:{items:{required:!0,type:M.codeViewItems},options:{type:M.codeViewOptions},selectedLines:{default:void 0,type:M.codeViewSelection}},setup(r,{attrs:i,expose:a}){let o=null,s,c=()=>{if(!o)return;let e=Q_(r.options,r.selectedLines);s||(s=new Rg(e,void 0,!0),s.setup(o)),s.setOptions(e),s.setItems(tv(r.items)),r.selectedLines!==void 0&&s.setSelectedLines(ev(r.selectedLines),{notify:!1}),s.render(!0)},l=e=>{o=e instanceof HTMLElement?e:null};return n(c,{flush:`post`}),t(()=>s?.cleanUp()),a({getInstance:()=>s}),()=>e(`div`,{...i,ref:l})}});export{sv as PierreCodeView,iv as PierreDiff,av as PierreFile,ov as PierreUnresolvedFile,ae as t};