t3 0.1.0-alpha.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/README.md +3 -0
  2. package/bin/t3.js +33 -0
  3. package/dist/bin.mjs +27 -0
  4. package/package.json +17 -14
  5. package/bin/t3 +0 -2
  6. package/dist/NodeSqliteClient-BgRtZPGk.cjs +0 -159
  7. package/dist/NodeSqliteClient-BgRtZPGk.cjs.map +0 -1
  8. package/dist/NodeSqliteClient-HpJMkQ8C.mjs +0 -141
  9. package/dist/NodeSqliteClient-HpJMkQ8C.mjs.map +0 -1
  10. package/dist/client/apple-touch-icon.png +0 -0
  11. package/dist/client/assets/DiffPanel-jB6j41Lm.js +0 -1405
  12. package/dist/client/assets/abap-BdvmRIgS.js +0 -1
  13. package/dist/client/assets/actionscript-3-CGv72Q9E.js +0 -1
  14. package/dist/client/assets/ada-DccgTE5d.js +0 -1
  15. package/dist/client/assets/andromeeda-Db4Ungye.js +0 -1
  16. package/dist/client/assets/angular-html-DPYVSHyE.js +0 -1
  17. package/dist/client/assets/angular-ts-Ctrmf7L8.js +0 -1
  18. package/dist/client/assets/apache-BIH3t0yU.js +0 -1
  19. package/dist/client/assets/apex-DDEdz31p.js +0 -1
  20. package/dist/client/assets/apl-BH37Twzj.js +0 -1
  21. package/dist/client/assets/applescript-D83o2tzk.js +0 -1
  22. package/dist/client/assets/ara-aMYTwTUq.js +0 -1
  23. package/dist/client/assets/asciidoc-BIk44EBQ.js +0 -1
  24. package/dist/client/assets/asm-DV1bto6h.js +0 -1
  25. package/dist/client/assets/astro-0S3ONaS6.js +0 -1
  26. package/dist/client/assets/aurora-x-Bh93n5xO.js +0 -1
  27. package/dist/client/assets/awk-FFWx9ZrE.js +0 -1
  28. package/dist/client/assets/ayu-dark-cnu7RpeM.js +0 -1
  29. package/dist/client/assets/ayu-light-fT-k4EEA.js +0 -1
  30. package/dist/client/assets/ayu-mirage-DZXsmI8I.js +0 -1
  31. package/dist/client/assets/ballerina-BCARR-zK.js +0 -1
  32. package/dist/client/assets/bat-DCRdiK45.js +0 -1
  33. package/dist/client/assets/beancount-f8f3BBqB.js +0 -1
  34. package/dist/client/assets/berry-K2BKJgA1.js +0 -1
  35. package/dist/client/assets/bibtex-DkakgDlR.js +0 -1
  36. package/dist/client/assets/bicep-CEma4qZD.js +0 -1
  37. package/dist/client/assets/blade-BaId-g9p.js +0 -1
  38. package/dist/client/assets/bsl-w_5qk-KK.js +0 -1
  39. package/dist/client/assets/c-D4Rl6rvo.js +0 -1
  40. package/dist/client/assets/c3-By3mlKPS.js +0 -1
  41. package/dist/client/assets/cadence-CtYAr_VT.js +0 -1
  42. package/dist/client/assets/cairo-Dwqgrkm6.js +0 -1
  43. package/dist/client/assets/catppuccin-frappe-DfuRPOsa.js +0 -1
  44. package/dist/client/assets/catppuccin-latte-BsQ4DjM-.js +0 -1
  45. package/dist/client/assets/catppuccin-macchiato-CDfGeQlU.js +0 -1
  46. package/dist/client/assets/catppuccin-mocha-l8I-Acgd.js +0 -1
  47. package/dist/client/assets/clarity-DApjatNb.js +0 -1
  48. package/dist/client/assets/clojure-BykelabX.js +0 -1
  49. package/dist/client/assets/cmake-Y7DIjNrP.js +0 -1
  50. package/dist/client/assets/cobol-G7Cf1Urg.js +0 -1
  51. package/dist/client/assets/codeowners-BG0ZtVWx.js +0 -1
  52. package/dist/client/assets/codeql-DFHUycm6.js +0 -1
  53. package/dist/client/assets/coffee-Dy4keSOU.js +0 -1
  54. package/dist/client/assets/common-lisp-B-vtBh5k.js +0 -1
  55. package/dist/client/assets/coq-CYI6Fu0p.js +0 -1
  56. package/dist/client/assets/cpp-CPwc8ANo.js +0 -1
  57. package/dist/client/assets/crystal-cwT2TVUR.js +0 -1
  58. package/dist/client/assets/csharp-SyZLz5MX.js +0 -1
  59. package/dist/client/assets/css-Wr-8600U.js +0 -1
  60. package/dist/client/assets/csv-DHZZZm7X.js +0 -1
  61. package/dist/client/assets/cue-CoG3mg2I.js +0 -1
  62. package/dist/client/assets/cypher-DXMjTNW2.js +0 -1
  63. package/dist/client/assets/d-CgG1_yzd.js +0 -1
  64. package/dist/client/assets/dark-plus-CXSzaZwK.js +0 -1
  65. package/dist/client/assets/dart-CBBhoFBf.js +0 -1
  66. package/dist/client/assets/dax-CmHFymtn.js +0 -1
  67. package/dist/client/assets/desktop-Db8-IVJE.js +0 -1
  68. package/dist/client/assets/diff-CcKimul9.js +0 -1
  69. package/dist/client/assets/docker-DerYNWsG.js +0 -1
  70. package/dist/client/assets/dotenv-B7nhh57a.js +0 -1
  71. package/dist/client/assets/dracula-B3WeBJmc.js +0 -1
  72. package/dist/client/assets/dracula-soft-znwpR7J7.js +0 -1
  73. package/dist/client/assets/dream-maker-lggPVUUF.js +0 -1
  74. package/dist/client/assets/edge-D3-7xVxb.js +0 -1
  75. package/dist/client/assets/elixir-DtOnOl8P.js +0 -1
  76. package/dist/client/assets/elm-DuybsITU.js +0 -1
  77. package/dist/client/assets/emacs-lisp-CCHFxp4J.js +0 -1
  78. package/dist/client/assets/erb-CfhI82v5.js +0 -1
  79. package/dist/client/assets/erlang-CiFIqHy7.js +0 -1
  80. package/dist/client/assets/everforest-dark-Buuww5F8.js +0 -1
  81. package/dist/client/assets/everforest-light-8IVF-uNj.js +0 -1
  82. package/dist/client/assets/fennel-CFfxI1rI.js +0 -1
  83. package/dist/client/assets/fish-71LcOjp4.js +0 -1
  84. package/dist/client/assets/fluent-BU_Ao1YA.js +0 -1
  85. package/dist/client/assets/fortran-fixed-form-Zrjf__wl.js +0 -1
  86. package/dist/client/assets/fortran-free-form-BY6kp7zD.js +0 -1
  87. package/dist/client/assets/fsharp-DzA60O5L.js +0 -1
  88. package/dist/client/assets/gdresource-BkZL9Kop.js +0 -1
  89. package/dist/client/assets/gdscript-loFXiTc4.js +0 -1
  90. package/dist/client/assets/gdshader-DnGwCtth.js +0 -1
  91. package/dist/client/assets/genie-Dv3uEwT1.js +0 -1
  92. package/dist/client/assets/gherkin-CW7GXiVM.js +0 -1
  93. package/dist/client/assets/git-commit-BiZza_8I.js +0 -1
  94. package/dist/client/assets/git-rebase-STWdmeS7.js +0 -1
  95. package/dist/client/assets/github-dark-Bt0UJmYQ.js +0 -1
  96. package/dist/client/assets/github-dark-default-CBjy4IHc.js +0 -1
  97. package/dist/client/assets/github-dark-dimmed-D_HhJpFE.js +0 -1
  98. package/dist/client/assets/github-dark-high-contrast-DVKQxfrK.js +0 -1
  99. package/dist/client/assets/github-light-CmXEz0Dj.js +0 -1
  100. package/dist/client/assets/github-light-default-C7iwGnqT.js +0 -1
  101. package/dist/client/assets/github-light-high-contrast-by6loxrx.js +0 -1
  102. package/dist/client/assets/gleam-DC353_2f.js +0 -1
  103. package/dist/client/assets/glimmer-js-B9HN2ue5.js +0 -1
  104. package/dist/client/assets/glimmer-ts-_KW2poKe.js +0 -1
  105. package/dist/client/assets/glsl-0G1JI6gc.js +0 -1
  106. package/dist/client/assets/gn-BT6NjD2b.js +0 -1
  107. package/dist/client/assets/gnuplot-CAlYZy39.js +0 -1
  108. package/dist/client/assets/go-CVxNRO9n.js +0 -1
  109. package/dist/client/assets/graphql-DTxuppb5.js +0 -1
  110. package/dist/client/assets/groovy-BkFseOo9.js +0 -1
  111. package/dist/client/assets/gruvbox-dark-hard-DN6fydWj.js +0 -1
  112. package/dist/client/assets/gruvbox-dark-medium-CQ8zX8bx.js +0 -1
  113. package/dist/client/assets/gruvbox-dark-soft-B7TFWNuO.js +0 -1
  114. package/dist/client/assets/gruvbox-light-hard-4IkLHmts.js +0 -1
  115. package/dist/client/assets/gruvbox-light-medium-GXeiXGL9.js +0 -1
  116. package/dist/client/assets/gruvbox-light-soft-C_VV_bLN.js +0 -1
  117. package/dist/client/assets/hack-CqxUiAHi.js +0 -1
  118. package/dist/client/assets/haml-CBGurAau.js +0 -1
  119. package/dist/client/assets/handlebars-jqSnFdcZ.js +0 -1
  120. package/dist/client/assets/haskell-CgBdys-g.js +0 -1
  121. package/dist/client/assets/haxe-Q_5-Us4F.js +0 -1
  122. package/dist/client/assets/hcl-D1Y6h8Ni.js +0 -1
  123. package/dist/client/assets/hjson-DpJrqEh-.js +0 -1
  124. package/dist/client/assets/hlsl-DWw1Hwsc.js +0 -1
  125. package/dist/client/assets/horizon-zJHXC0J5.js +0 -1
  126. package/dist/client/assets/houston-B3ogBwnz.js +0 -1
  127. package/dist/client/assets/html-DtFU64ae.js +0 -1
  128. package/dist/client/assets/html-derivative-9aHDoaPc.js +0 -1
  129. package/dist/client/assets/http-C0xxcP1S.js +0 -1
  130. package/dist/client/assets/hurl-BwlREA5l.js +0 -1
  131. package/dist/client/assets/hxml-CZ0s3AQV.js +0 -1
  132. package/dist/client/assets/hy-DcElotMq.js +0 -1
  133. package/dist/client/assets/imba-DYyLfx22.js +0 -1
  134. package/dist/client/assets/index-C6fNL4Bi.js +0 -279
  135. package/dist/client/assets/index-DiucgO6g.css +0 -1
  136. package/dist/client/assets/ini-csMV2D7T.js +0 -1
  137. package/dist/client/assets/java-BWaG8bYK.js +0 -1
  138. package/dist/client/assets/javascript-VUdkDKnk.js +0 -1
  139. package/dist/client/assets/jinja-CTOakmIM.js +0 -1
  140. package/dist/client/assets/jison-DwPBhY8Z.js +0 -1
  141. package/dist/client/assets/json-cptyroxv.js +0 -1
  142. package/dist/client/assets/json5-D6bd72oE.js +0 -1
  143. package/dist/client/assets/jsonc-CqkYFrbt.js +0 -1
  144. package/dist/client/assets/jsonl-RCf29gRP.js +0 -1
  145. package/dist/client/assets/jsonnet-CSrvooJ7.js +0 -1
  146. package/dist/client/assets/jssm-yiNjymqf.js +0 -1
  147. package/dist/client/assets/jsx-DOb89Tsg.js +0 -1
  148. package/dist/client/assets/julia-DAjDVHTq.js +0 -1
  149. package/dist/client/assets/kanagawa-dragon-CMFikbd6.js +0 -1
  150. package/dist/client/assets/kanagawa-lotus-C5UXF7Bs.js +0 -1
  151. package/dist/client/assets/kanagawa-wave-DyduAgCZ.js +0 -1
  152. package/dist/client/assets/kdl-ChNQ32U5.js +0 -1
  153. package/dist/client/assets/kotlin-CDf0F8oF.js +0 -1
  154. package/dist/client/assets/kusto-DMjUl49Y.js +0 -1
  155. package/dist/client/assets/laserwave-mA8Yjqfo.js +0 -1
  156. package/dist/client/assets/latex-Di49sFPd.js +0 -1
  157. package/dist/client/assets/lean-nKgJ_hld.js +0 -1
  158. package/dist/client/assets/less-Zf4u8fOP.js +0 -1
  159. package/dist/client/assets/light-plus-CxokWp27.js +0 -1
  160. package/dist/client/assets/liquid-DFUBxBzO.js +0 -1
  161. package/dist/client/assets/llvm-DvcEHvRz.js +0 -1
  162. package/dist/client/assets/log-B3gbyM7r.js +0 -1
  163. package/dist/client/assets/logo-DygXKddr.js +0 -1
  164. package/dist/client/assets/lua-Du_1zgSm.js +0 -1
  165. package/dist/client/assets/luau-CRvZZ_JL.js +0 -1
  166. package/dist/client/assets/make-Dym-awm2.js +0 -1
  167. package/dist/client/assets/markdown-C10XOqho.js +0 -1
  168. package/dist/client/assets/marko-tQy63sgr.js +0 -1
  169. package/dist/client/assets/material-theme-Dh0Hfgc9.js +0 -1
  170. package/dist/client/assets/material-theme-darker-r-dcYt7X.js +0 -1
  171. package/dist/client/assets/material-theme-lighter-gQ3JnqxW.js +0 -1
  172. package/dist/client/assets/material-theme-ocean-DY41XWl2.js +0 -1
  173. package/dist/client/assets/material-theme-palenight-BLbfB6xN.js +0 -1
  174. package/dist/client/assets/matlab-BuhzjafA.js +0 -1
  175. package/dist/client/assets/mdc-CBJ4985H.js +0 -1
  176. package/dist/client/assets/mdx-CqHRnH2I.js +0 -1
  177. package/dist/client/assets/mermaid-DkDwVNHp.js +0 -1
  178. package/dist/client/assets/min-dark-CS_cyN1u.js +0 -1
  179. package/dist/client/assets/min-light-AiCLxuDN.js +0 -1
  180. package/dist/client/assets/mipsasm-Dj4w76C6.js +0 -1
  181. package/dist/client/assets/mojo-KNFwB0KA.js +0 -1
  182. package/dist/client/assets/monokai-m_uBTyxm.js +0 -1
  183. package/dist/client/assets/moonbit-d7SMTL5u.js +0 -1
  184. package/dist/client/assets/move-BRqqSG_z.js +0 -1
  185. package/dist/client/assets/narrat-fDFgzhET.js +0 -1
  186. package/dist/client/assets/nextflow-C-Yfm6rp.js +0 -1
  187. package/dist/client/assets/nginx-O8yQj-tJ.js +0 -1
  188. package/dist/client/assets/night-owl-D9h5Ndkj.js +0 -1
  189. package/dist/client/assets/night-owl-light-B1H1b6pL.js +0 -1
  190. package/dist/client/assets/nim-DtE7ehVb.js +0 -1
  191. package/dist/client/assets/nix-2Q7B4-qB.js +0 -1
  192. package/dist/client/assets/nord-CtcF76NW.js +0 -1
  193. package/dist/client/assets/nushell-CFIIXPrv.js +0 -1
  194. package/dist/client/assets/objective-c-JwFKDEEO.js +0 -1
  195. package/dist/client/assets/objective-cpp-DIJvv15W.js +0 -1
  196. package/dist/client/assets/ocaml-BdBESWBU.js +0 -1
  197. package/dist/client/assets/odin-C6PSgTW1.js +0 -1
  198. package/dist/client/assets/one-dark-pro-BL6Mm10K.js +0 -1
  199. package/dist/client/assets/one-light-DIxQsRCk.js +0 -1
  200. package/dist/client/assets/openscad-DKkBtw-B.js +0 -1
  201. package/dist/client/assets/pascal-BAwp_qsa.js +0 -1
  202. package/dist/client/assets/perl-BGFMtzC0.js +0 -1
  203. package/dist/client/assets/php-tCfY24Tn.js +0 -1
  204. package/dist/client/assets/pierre-dark-OpLWNq1f.js +0 -1
  205. package/dist/client/assets/pierre-light-BRmWerDN.js +0 -1
  206. package/dist/client/assets/pkl-BEivFQY2.js +0 -1
  207. package/dist/client/assets/plastic-CdMFXOP4.js +0 -1
  208. package/dist/client/assets/plsql-B4tIQQvp.js +0 -1
  209. package/dist/client/assets/po-f6FM1fIA.js +0 -1
  210. package/dist/client/assets/poimandres-BeQo4lfK.js +0 -1
  211. package/dist/client/assets/polar-CpfoMG8j.js +0 -1
  212. package/dist/client/assets/postcss-9eGaqiLc.js +0 -1
  213. package/dist/client/assets/powerquery-Dx5UuWwk.js +0 -1
  214. package/dist/client/assets/powershell-C7z4Qkvz.js +0 -1
  215. package/dist/client/assets/prisma-BcnqMjD1.js +0 -1
  216. package/dist/client/assets/prolog-D0L_wBl0.js +0 -1
  217. package/dist/client/assets/proto-DfrN0jZ_.js +0 -1
  218. package/dist/client/assets/pug-Ce26j2GL.js +0 -1
  219. package/dist/client/assets/puppet-D-veBXwP.js +0 -1
  220. package/dist/client/assets/purescript-CCH5mmkO.js +0 -1
  221. package/dist/client/assets/python-DV-HoFeK.js +0 -1
  222. package/dist/client/assets/qml-BJUW5l7L.js +0 -1
  223. package/dist/client/assets/qmldir-CMfFJMYf.js +0 -1
  224. package/dist/client/assets/qss-dr-gRVUL.js +0 -1
  225. package/dist/client/assets/r-B5cWVq2i.js +0 -1
  226. package/dist/client/assets/racket-kW2n0Hud.js +0 -1
  227. package/dist/client/assets/raku-CIdRFxAz.js +0 -1
  228. package/dist/client/assets/razor-FJA4M6v6.js +0 -1
  229. package/dist/client/assets/red-D6D3HEMy.js +0 -1
  230. package/dist/client/assets/reg-DOtUpIZh.js +0 -1
  231. package/dist/client/assets/regexp-rRLdxVAX.js +0 -1
  232. package/dist/client/assets/rel-stkFJ73W.js +0 -1
  233. package/dist/client/assets/riscv-DlRusncW.js +0 -1
  234. package/dist/client/assets/ron-DdPfl6h5.js +0 -1
  235. package/dist/client/assets/rose-pine-BKM4KvAg.js +0 -1
  236. package/dist/client/assets/rose-pine-dawn-BJh4BDOk.js +0 -1
  237. package/dist/client/assets/rose-pine-moon-CAQpRBI5.js +0 -1
  238. package/dist/client/assets/rosmsg-B9A7ZmfK.js +0 -1
  239. package/dist/client/assets/rst-BRJuRMjC.js +0 -1
  240. package/dist/client/assets/ruby-BKafeQQT.js +0 -1
  241. package/dist/client/assets/rust-Cck_7SxM.js +0 -1
  242. package/dist/client/assets/sas-BYTF_sD3.js +0 -1
  243. package/dist/client/assets/sass-qpeWvYRh.js +0 -1
  244. package/dist/client/assets/scala-D41TovP3.js +0 -1
  245. package/dist/client/assets/scheme-BlD3mUkI.js +0 -1
  246. package/dist/client/assets/scss-BXa1jRAU.js +0 -1
  247. package/dist/client/assets/sdbl-BIGj5Rrw.js +0 -1
  248. package/dist/client/assets/shaderlab-CbzjbEvk.js +0 -1
  249. package/dist/client/assets/shellscript-D8doy93l.js +0 -1
  250. package/dist/client/assets/shellsession-_XRHw0R6.js +0 -1
  251. package/dist/client/assets/slack-dark-CB_uZ8EH.js +0 -1
  252. package/dist/client/assets/slack-ochin-B9Cn306E.js +0 -1
  253. package/dist/client/assets/smalltalk-CN6ty7MI.js +0 -1
  254. package/dist/client/assets/snazzy-light-rfyCCEIi.js +0 -1
  255. package/dist/client/assets/solarized-dark-DbzG1qZn.js +0 -1
  256. package/dist/client/assets/solarized-light-wTbgnQ9X.js +0 -1
  257. package/dist/client/assets/solidity-CiPHtV-S.js +0 -1
  258. package/dist/client/assets/soy-Dh8JOxoO.js +0 -1
  259. package/dist/client/assets/sparql-y7RYfVC1.js +0 -1
  260. package/dist/client/assets/splunk-qg6RMVBh.js +0 -1
  261. package/dist/client/assets/sql-Bx2ZsvsG.js +0 -1
  262. package/dist/client/assets/ssh-config-Bv05t-vj.js +0 -1
  263. package/dist/client/assets/stata-DS6rM_Jg.js +0 -1
  264. package/dist/client/assets/stylus-Dcn1iI3o.js +0 -1
  265. package/dist/client/assets/surrealql-Cag58mlx.js +0 -1
  266. package/dist/client/assets/svelte-DrbB1SFF.js +0 -1
  267. package/dist/client/assets/swift-D0-2Zecd.js +0 -1
  268. package/dist/client/assets/synthwave-84-2ka-NWz-.js +0 -1
  269. package/dist/client/assets/system-verilog-Bi2P60my.js +0 -1
  270. package/dist/client/assets/systemd-B-Uf9E5B.js +0 -1
  271. package/dist/client/assets/talonscript-78H25QY_.js +0 -1
  272. package/dist/client/assets/tasl-U22XnM7f.js +0 -1
  273. package/dist/client/assets/tcl-COq4pcak.js +0 -1
  274. package/dist/client/assets/templ-22od2Ht3.js +0 -1
  275. package/dist/client/assets/terraform-CN0y-ELc.js +0 -1
  276. package/dist/client/assets/tex-CvDc2lsT.js +0 -1
  277. package/dist/client/assets/tokyo-night-sc29NHmq.js +0 -1
  278. package/dist/client/assets/toml-DewJUUba.js +0 -1
  279. package/dist/client/assets/ts-tags-C4Ggxo0w.js +0 -1
  280. package/dist/client/assets/tsv-BxMH_xdg.js +0 -1
  281. package/dist/client/assets/tsx-BKiciJ3r.js +0 -1
  282. package/dist/client/assets/turtle-Ckif9282.js +0 -1
  283. package/dist/client/assets/twig-C6bN93Be.js +0 -1
  284. package/dist/client/assets/typescript-KKWuqWCW.js +0 -1
  285. package/dist/client/assets/typespec-B4M3EpQn.js +0 -1
  286. package/dist/client/assets/typst-Bz2n9x1G.js +0 -1
  287. package/dist/client/assets/v-UeLXtqZY.js +0 -1
  288. package/dist/client/assets/vala-Bp2nfBOB.js +0 -1
  289. package/dist/client/assets/vb-BNrt2LXf.js +0 -1
  290. package/dist/client/assets/verilog-DUvgRMGv.js +0 -1
  291. package/dist/client/assets/vesper-Bnk9mq_Q.js +0 -1
  292. package/dist/client/assets/vhdl-Rn0_vJR-.js +0 -1
  293. package/dist/client/assets/viml-1SBtGOaC.js +0 -1
  294. package/dist/client/assets/vitesse-black-PGXhEtSI.js +0 -1
  295. package/dist/client/assets/vitesse-dark-Ckw6u4sV.js +0 -1
  296. package/dist/client/assets/vitesse-light-B41llZUS.js +0 -1
  297. package/dist/client/assets/vue-DVe2iImK.js +0 -1
  298. package/dist/client/assets/vue-html-D7gxvfqU.js +0 -1
  299. package/dist/client/assets/vue-vine-Bn9ioC0p.js +0 -1
  300. package/dist/client/assets/vyper-Dk8xbVIz.js +0 -1
  301. package/dist/client/assets/wasm-Bv0dEfnC.js +0 -1
  302. package/dist/client/assets/wasm-CRsU_VQz.js +0 -1
  303. package/dist/client/assets/wenyan-BfC3Ct4H.js +0 -1
  304. package/dist/client/assets/wgsl-C2dHZDEF.js +0 -1
  305. package/dist/client/assets/wikitext-BbmA1MpW.js +0 -1
  306. package/dist/client/assets/wit-CyF_c9_v.js +0 -1
  307. package/dist/client/assets/wolfram-CkBk1rx1.js +0 -1
  308. package/dist/client/assets/worker-Dg3uKCvJ.js +0 -160
  309. package/dist/client/assets/xml-aPYpUjF-.js +0 -1
  310. package/dist/client/assets/xsl-CB7LAIzh.js +0 -1
  311. package/dist/client/assets/yaml-BqSIDv00.js +0 -1
  312. package/dist/client/assets/zenscript-B3xqRiFZ.js +0 -1
  313. package/dist/client/assets/zig-E_NO4z39.js +0 -1
  314. package/dist/client/favicon-16x16.png +0 -0
  315. package/dist/client/favicon-32x32.png +0 -0
  316. package/dist/client/favicon.ico +0 -0
  317. package/dist/client/favicon.svg +0 -4
  318. package/dist/client/index.html +0 -21
  319. package/dist/index.cjs +0 -13050
  320. package/dist/index.cjs.map +0 -1
  321. package/dist/index.mjs +0 -13004
  322. package/dist/index.mjs.map +0 -1
@@ -1,1405 +0,0 @@
1
- import{$ as e,A as t,At as n,B as r,Bt as i,C as a,Ct as o,D as s,Dt as c,E as l,Et as u,F as d,Ft as f,G as p,H as m,I as h,It as g,J as _,K as v,L as y,Lt as b,M as x,Mt as S,N as C,Nt as w,O as T,Ot as E,P as D,Pt as O,Q as k,R as A,Rt as j,S as M,St as N,T as ee,Tt as P,U as te,V as F,W as I,X as ne,Y as L,Z as R,_ as re,_t as ie,a as ae,at as z,b as B,bt as V,c as oe,ct as se,d as H,dt as ce,et as le,f as ue,ft as de,g as fe,gt as pe,h as me,ht as he,i as ge,it as _e,j as ve,jt as ye,k as be,kt as xe,l as Se,lt as Ce,m as we,mt as Te,n as Ee,nt as De,o as Oe,ot as ke,p as Ae,pt as je,q as Me,r as Ne,rt as Pe,s as Fe,st as Ie,t as Le,tt as Re,u as ze,ut as Be,v as Ve,vt as He,w as Ue,wt as U,x as We,xt as Ge,y as Ke,yt as qe,z as Je}from"./index-C6fNL4Bi.js";var Ye=ce(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Xe=ce(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Ze={position:`absolute`,top:0,bottom:0,textAlign:`center`};function W(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}var G=b();function Qe(e,t){return typeof window>`u`&&t!=null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,G.jsx)(G.Fragment,{children:e})}var K=new Set,q=new Set,$e=null,et=!1;function J(e){if(et){K.add(e);return}q.add(e),$e??=requestAnimationFrame(tt)}function tt(e){et=!0;for(let t of q)try{t(e)}catch(e){console.error(e)}q.clear(),K.size>0?(q=new Set(K),K.clear(),$e=requestAnimationFrame(tt)):$e=null,et=!1}function nt(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}function rt({scrollTop:e,scrollHeight:t,height:n,containerOffset:r=0,fitPerfectly:i,overscrollSize:a}){let o=n+a*2,s=i?n:o;if(t=Math.max(t,s),o>=t||i){let n=Math.max(e-r,0),i=Math.min(e+s,t)-r;return{top:n,bottom:Math.max(i,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-r,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t)-r,c))}}var it=1e3,at=it*4,ot=[0,1e-6,.99999,1],st={overscrollSize:it,intersectionObserverMargin:at,resizeDebugging:!1},Y=0,ct=-1,lt=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++ct}`;config;type=`basic`;intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...st,...e}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:ot,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),J(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),J(this.computeRenderRangeAndEmit)}}instanceChanged(e){this.instancesChanged.add(e),J(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=rt({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: content size change`,this.__id,{sizeChange:e-Y,newSize:e}),Y=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: scroller size change`,this.__id,{sizeChange:e-Y,newSize:e}),Y=e))}t&&J(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw Error(`Virtualizer.setupWindow: Invalid setup method`);window.addEventListener(`scroll`,this.handleWindowScroll,{passive:!0}),window.addEventListener(`resize`,this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleElementScroll),window.removeEventListener(`scroll`,this.handleWindowScroll),window.removeEventListener(`resize`,this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+X(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),J(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),J(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,J(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{e.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,J(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,J(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;if(this.instancesChanged.size===0){let e=rt({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize});if(nt(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let n=this.getScrollAnchor(this.height),r=new Set;for(let e of this.visibleInstances.values())e.onRender(t)&&r.add(e);for(let e of this.instancesChanged)r.has(e)||e.onRender(t)&&r.add(e);this.scrollFix(n),this.instancesChanged.size>0&&this.markDOMDirty();for(let e of r)e.reconcileHeights();(this.instancesChanged.size>0||t)&&J(this.computeRenderRangeAndEmit),r.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=X(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=X(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=X(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=X(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);if(e==null)throw Error(`Virtualizer.handleIntersectionChange: no instance for target`);n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0)}this.visibleInstancesDirty&&J(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function X(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}var Z=i(j(),1),ut=(0,Z.createContext)(void 0);function dt({children:e,config:t,className:n,style:r,contentClassName:i,contentStyle:a}){let[o]=(0,Z.useState)(()=>typeof window<`u`?new lt(t):void 0),s=(0,Z.useCallback)(e=>{e==null?o?.cleanUp():o?.setup(e)},[o]);return(0,G.jsx)(ut.Provider,{value:o,children:(0,G.jsx)(`div`,{className:n,style:r,ref:s,children:(0,G.jsx)(`div`,{className:i,style:a,children:e})})})}function ft(){return(0,Z.useContext)(ut)}function pt(e){let t=(0,Z.useRef)(e);return(0,Z.useInsertionEffect)(()=>void(t.current=e)),(0,Z.useCallback)((...e)=>t.current(...e),[])}function mt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}var ht=class{pre;selectedRange=null;renderedSelectionRange;anchor;_queuedRender;constructor(e={}){this.options=e}setOptions(e){this.options={...this.options,...e},this.removeEventListeners(),this.options.enableLineSelection===!0&&this.attachEventListeners()}cleanUp(){this.removeEventListeners(),this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0}setup(e){if(this.setDirty(),this.pre!==e){this.cleanUp(),this.pre=e;let{enableLineSelection:t=!1}=this.options;t?this.attachEventListeners():this.removeEventListeners()}this.setSelection(this.selectedRange)}setDirty(){this.renderedSelectionRange=void 0}isDirty(){return this.renderedSelectionRange===void 0}setSelection(e){let t=!(e===this.selectedRange||mt(e??void 0,this.selectedRange??void 0));!this.isDirty()&&!t||(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionChange())}getSelection(){return this.selectedRange}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}attachEventListeners(){this.pre!=null&&(this.removeEventListeners(),this.pre.setAttribute(`data-interactive-line-numbers`,``),this.pre.addEventListener(`pointerdown`,this.handleMouseDown))}removeEventListeners(){this.pre!=null&&(this.pre.removeEventListener(`pointerdown`,this.handleMouseDown),document.removeEventListener(`pointermove`,this.handleMouseMove),document.removeEventListener(`pointerup`,this.handleMouseUp),this.pre.removeAttribute(`data-interactive-line-numbers`))}handleMouseDown=e=>{let t=e.button===0?this.getMouseEventDataForPath(e.composedPath(),`click`):void 0;if(t==null||this.pre==null)return;e.preventDefault();let{lineNumber:n,eventSide:r,lineIndex:i}=t;if(e.shiftKey&&this.selectedRange!=null){let e=this.getIndexesFromSelection(this.selectedRange,this.pre.getAttribute(`data-diff-type`)===`split`);if(e==null)return;let t=e.start<=e.end?i>=e.start:i<=e.end;this.anchor={line:t?this.selectedRange.start:this.selectedRange.end,side:(t?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side)??`additions`},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}else{if(this.selectedRange?.start===n&&this.selectedRange?.end===n){this.updateSelection(null),this.notifySelectionEnd(null),this.notifySelectionChange();return}this.selectedRange=null,this.anchor={line:n,side:r},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}document.addEventListener(`pointermove`,this.handleMouseMove),document.addEventListener(`pointerup`,this.handleMouseUp)};handleMouseMove=e=>{let t=this.getMouseEventDataForPath(e.composedPath(),`move`);if(t==null||this.anchor==null)return;let{lineNumber:n,eventSide:r}=t;this.updateSelection(n,r)};handleMouseUp=()=>{this.anchor=void 0,document.removeEventListener(`pointermove`,this.handleMouseMove),document.removeEventListener(`pointerup`,this.handleMouseUp),this.notifySelectionEnd(this.selectedRange),this.notifySelectionChange()};updateSelection(e,t){if(e==null)this.selectedRange=null;else{let n=this.anchor?.side??t;this.selectedRange={start:this.anchor?.line??e,end:e,side:n,endSide:n===t?void 0:t}}this._queuedRender??=requestAnimationFrame(this.renderSelection)}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}renderSelection=()=>{if(this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`LineSelectionManager.applySelectionToDOM: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`LineSelectionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`LineSelectionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&s.nextSibling.hasAttribute(`data-line-annotation`)&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionChange(){let{onLineSelected:e}=this.options;e?.(this.selectedRange??null)}notifySelectionStart(e){let{onLineSelectionStart:t}=this.options;t?.(e)}notifySelectionEnd(e){let{onLineSelectionEnd:t}=this.options;t?.(e)}getMouseEventDataForPath(e,t){if(this.pre==null)return;let n,r,i=!1,a;for(let t of e){if(n!=null&&r!=null&&a!=null)break;if(t instanceof HTMLElement){if(t.hasAttribute(`data-line-index`)){i=t.hasAttribute(`data-column-number`),n=this.getLineNumber(t),r=this.parseLineIndex(t,this.pre.getAttribute(`data-diff-type`)===`split`);let e=t.getAttribute(`data-line-type`);e===`change-deletion`?a=`deletions`:e===`change-additions`&&(a=`additions`);continue}if(a==null&&t.hasAttribute(`data-code`)){a=t.hasAttribute(`data-deletions`)?`deletions`:t.hasAttribute(`data-additions`)?`additions`:void 0;break}}}if(!(t===`click`&&!i||r==null||n==null))return{lineIndex:r,lineNumber:n,eventSide:a??`additions`}}getLineNumber(e){let t=parseInt(e.getAttribute(`data-column-number`)??e.getAttribute(`data-line`)??``,10);return Number.isNaN(t)?void 0:t}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>parseInt(e)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function gt({enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r},i){return{enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r,getLineIndex:i}}function _t(e,t){return e==null?!1:t===`file`?e.type===`line`:e.type===`diff-line`}function vt(e){return e?.type===`line-info`}var yt=class{hoveredLine;pre;hoverSlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasEventListeners=!1;constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handleMouseClick),this.pre?.removeEventListener(`pointermove`,this.handleMouseMove),this.pre?.removeEventListener(`pointerleave`,this.handleMouseLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.clearHoveredLine(),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasEventListeners=!1,this.pre=void 0}setup(e){let{__debugMouseEvents:t,onLineClick:n,onLineNumberClick:r,onLineEnter:i,onLineLeave:a,onHunkExpand:o,enableHoverUtility:s=!1,lineHoverHighlight:c=`disabled`}=this.options,l=this.pre!==e;if(l&&(this.cleanUp(),this.pre=e,this.hasEventListeners=!1),s&&this.hoverSlot==null){this.hoverSlot=document.createElement(`div`),this.hoverSlot.setAttribute(`data-hover-slot`,``);let e=document.createElement(`slot`);e.name=`hover-slot`,this.hoverSlot.appendChild(e)}else !s&&this.hoverSlot!=null&&(this.hoverSlot.parentNode?.removeChild(this.hoverSlot),this.hoverSlot=void 0);let u=c!==`disabled`||n!=null||r!=null||o!=null||i!=null||a!=null||s;(l||!this.hasEventListeners)&&u?(this.hasEventListeners=!0,e.addEventListener(`click`,this.handleMouseClick),n==null?r!=null&&(e.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!0):(e.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0,this.interactiveLineNumbersAttr=!1),Q(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(n!=null&&e.push(`onLineClick`),r!=null&&e.push(`onLineNumberClick`),o!=null&&e.push(`expandable hunk separators`)),e})()),e.addEventListener(`pointermove`,this.handleMouseMove),Q(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),e.addEventListener(`pointerleave`,this.handleMouseLeave),Q(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!u&&this.hasEventListeners&&(this.pre?.removeEventListener(`click`,this.handleMouseClick),this.pre?.removeEventListener(`pointermove`,this.handleMouseMove),this.pre?.removeEventListener(`pointerleave`,this.handleMouseLeave),this.hasEventListeners=!1),l||(n==null?r==null?(this.interactiveLinesAttr&&=(e.removeAttribute(`data-interactive-lines`),!1),this.interactiveLineNumbersAttr&&=(e.removeAttribute(`data-interactive-line-numbers`),!1)):(this.interactiveLinesAttr&&=(e.removeAttribute(`data-interactive-lines`),!1),this.interactiveLineNumbersAttr||=(e.setAttribute(`data-interactive-line-numbers`,``),!0)):(this.interactiveLineNumbersAttr&&=(e.removeAttribute(`data-interactive-line-numbers`),!1),this.interactiveLinesAttr||=(e.setAttribute(`data-interactive-lines`,``),!0)))}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode===`diff`&&this.hoveredLine.type===`diff-line`)return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode===`file`&&this.hoveredLine.type===`line`)return{lineNumber:this.hoveredLine.lineNumber}}};handleMouseClick=e=>{let{onLineClick:t,onLineNumberClick:n,onHunkExpand:r}=this.options;t==null&&n==null&&r==null||(Q(this.options.__debugMouseEvents,`click`,`FileDiff.DEBUG.handleMouseClick:`,e),this.handleMouseEvent({eventType:`click`,event:e}))};handleMouseMove=e=>{let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,enableHoverUtility:i=!1}=this.options;t===`disabled`&&!i&&n==null&&r==null||(Q(this.options.__debugMouseEvents,`move`,`FileDiff.DEBUG.handleMouseMove:`,e),this.handleMouseEvent({eventType:`move`,event:e}))};handleMouseLeave=e=>{let{__debugMouseEvents:t}=this.options;if(Q(t,`move`,`FileDiff.DEBUG.handleMouseLeave: no event`),this.hoveredLine==null){Q(t,`move`,`FileDiff.DEBUG.handleMouseLeave: returned early, no .hoveredLine`);return}this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()};handleMouseEvent({eventType:e,event:t}){let{__debugMouseEvents:n}=this.options,r=t.composedPath();Q(n,e,`FileDiff.DEBUG.handleMouseEvent:`,{eventType:e,composedPath:r});let i=this.getLineData(r);Q(n,e,`FileDiff.DEBUG.handleMouseEvent: getLineData result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onHunkExpand:l}=this.options;switch(e){case`move`:if(_t(i,this.mode)&&this.hoveredLine?.lineElement===i.lineElement){Q(n,`move`,`FileDiff.DEBUG.handleMouseEvent: switch, 'move', returned early because same line`);break}this.hoveredLine!=null&&(Q(n,`move`,`FileDiff.DEBUG.handleMouseEvent: switch, 'move', clearing an existing hovered line and firing onLineLeave`),this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),_t(i,this.mode)&&(Q(n,`move`,`FileDiff.DEBUG.handleMouseEvent: switch, 'move', setting up a new hoveredLine and firing onLineEnter`),this.setHoveredLine(i),this.hoverSlot!=null&&i.numberElement?.appendChild(this.hoverSlot),s?.({...this.hoveredLine,event:t}));break;case`click`:if(Q(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', with data:`,i),i==null)break;if(vt(i)&&l!=null){Q(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', expanding a hunk`),l(i.hunkIndex,i.direction);break}_t(i,this.mode)&&(o!=null&&i.numberColumn?(Q(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineNumberClick'`),o({...i,event:t})):a==null?Q(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', fell through, no event to fire`):(Q(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineClick'`),a({...i,event:t})));break}}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`,``))}getLineData(e){let t=!1,n,r,i,a,o,s,c;for(let l of e){if(!(l instanceof HTMLElement))continue;let e=o==null?l.getAttribute(`data-column-number`)??void 0:void 0;if(e){o=l,c=Number.parseInt(e,10),t=!0,n=St(l),a=l.getAttribute(`data-line-index`)??void 0;continue}let u=i==null?l.getAttribute(`data-line`)??void 0:void 0;if(u){i=l,c=Number.parseInt(u,10),n=St(l),a=l.getAttribute(`data-line-index`)??void 0;continue}if(s==null&&l.hasAttribute(`data-expand-button`)){s={hunkIndex:void 0,direction:l.hasAttribute(`data-expand-up`)?`up`:l.hasAttribute(`data-expand-down`)?`down`:`both`};continue}let d=s==null?void 0:l.getAttribute(`data-expand-index`)??void 0;if(s!=null&&d!=null){let e=Number.parseInt(d,10);Number.isNaN(e)||(s.hunkIndex=e);continue}if(r==null&&l.hasAttribute(`data-code`)){r=l;break}}if(s?.hunkIndex!=null){let{hunkIndex:e,direction:t}=s;return{type:`line-info`,hunkIndex:e,direction:t}}if(i??=a==null?void 0:xt(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:xt(r,`[data-column-number][data-line-index="${a}"]`),!(r==null||i==null||o==null||n==null))return this.mode===`file`?{type:`line`,lineElement:i,lineNumber:c,numberElement:o,numberColumn:t}:{type:`diff-line`,annotationSide:(()=>{switch(n){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return r.hasAttribute(`data-deletions`)?`deletions`:`additions`}})(),lineType:n,lineElement:i,numberElement:o,lineNumber:c,numberColumn:t}}};function Q(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)}function bt({lineHoverHighlight:e,onLineClick:t,onLineNumberClick:n,onLineEnter:r,onLineLeave:i,enableHoverUtility:a,__debugMouseEvents:o},s){return{lineHoverHighlight:e,onLineClick:t,onLineNumberClick:n,onLineEnter:r,onLineLeave:i,enableHoverUtility:a,__debugMouseEvents:o,onHunkExpand:s}}function xt(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function St(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}}var Ct=class{observedNodes=new Map;timeoutID;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.timeoutID!=null&&clearTimeout(this.timeoutID)}resizeObserver;setup(e,t){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);let n=e.querySelectorAll(`code`),r=new Map(this.observedNodes);this.observedNodes.clear();for(let e of n){let t=r.get(e);if(t!=null){this.observedNodes.set(e,t),r.delete(e);continue}let n=e.querySelector(`[data-gutter]`);n instanceof HTMLElement||(n=null),t={type:`code`,codeElement:e,numberElement:n,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,t),this.resizeObserver.observe(e),n!=null&&(this.observedNodes.set(n,t),this.resizeObserver.observe(n))}if(n.length>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let{lineAnnotation:t=``}=e.dataset;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,o=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement))continue;let s=r.get(a);if(s!=null){this.observedNodes.set(a,s),this.observedNodes.set(o,s),r.delete(a),r.delete(o);continue}s={type:`annotations`,column1:{container:n,child:a,childHeight:a.getBoundingClientRect().height},column2:{container:i,child:o,childHeight:o.getBoundingClientRect().height},currentHeight:`auto`};let c=Math.max(s.column1.childHeight,s.column2.childHeight);this.applyNewHeight(s,c),this.observedNodes.set(a,s),this.observedNodes.set(o,s),this.resizeObserver.observe(a),this.resizeObserver.observe(o)}}for(let e of r.keys())e.isConnected&&(e.style.removeProperty(`--diffs-column-content-width`),e.style.removeProperty(`--diffs-column-number-width`),e.style.removeProperty(`--diffs-column-width`),e.parentElement instanceof HTMLElement&&e.parentElement.style.removeProperty(`--diffs-annotation-min-height`)),this.resizeObserver.unobserve(e);r.clear()}handleResizeObserver=e=>{for(let t of e){let{target:e,borderBoxSize:n}=t;if(!(e instanceof HTMLElement)){console.error(`FileDiff.handleResizeObserver: Invalid element for ResizeObserver`,t);continue}let r=this.observedNodes.get(e);if(r==null){console.error(`FileDiff.handleResizeObserver: Not a valid observed node`,t);continue}let i=n[0];if(r.type===`annotations`){let t=(()=>{if(e===r.column1.child)return r.column1;if(e===r.column2.child)return r.column2})();if(t==null){console.error(`FileDiff.handleResizeObserver: Couldn't find a column for`,{item:r,target:e});continue}t.childHeight=i.blockSize;let n=Math.max(r.column1.childHeight,r.column2.childHeight);this.applyNewHeight(r,n)}else r.type===`code`&&(this.queuedUpdates.set(e,[r,i]),this.queueColumnUpdate())}};queueColumnUpdate(){this.timeoutID!=null&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(this.handleColumnChange,1e3/30)}handleColumnChange=()=>{this.timeoutID=void 0;for(let[e,[t,n]]of this.queuedUpdates)if(e===t.codeElement){let e=Math.max(Math.floor(n.inlineSize),0);if(e!==t.codeWidth){t.codeWidth=e;let n=Math.max(t.codeWidth-t.numberWidth,0);t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n===0?`auto`:`${n}px`}`),t.codeElement.style.setProperty(`--diffs-column-width`,`${t.codeWidth===0?`auto`:`${t.codeWidth}px`}`)}}else if(e===t.numberElement){let e=Math.max(Math.ceil(n.inlineSize),0);if(e!==t.numberWidth&&(t.numberWidth=e,t.codeElement.style.setProperty(`--diffs-column-number-width`,`${t.numberWidth===0?`auto`:`${t.numberWidth}px`}`),t.codeWidth!==`auto`)){let e=Math.max(t.codeWidth-t.numberWidth,0);t.codeElement.style.setProperty(`--diffs-column-content-width`,`${e===0?`auto`:`${e}px`}`)}}this.queuedUpdates.clear()};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 wt(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 Tt(e){for(let t of Array.isArray(e)?e:[e])if(!te.has(t))return!1;return!0}function Et(e){for(let t of Je(e))if(!I.has(t))return!1;return!0}function Dt(e){return C({tagName:`div`,children:[C({tagName:`div`,children:e.annotations?.map(e=>C({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Ot(e,t){return C({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function kt(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 At({fileOrDiff:e,themeStyles:t,themeType:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":``,"data-change-type":r?.type,"data-theme-type":n===`system`?void 0:n,style:t};return C({tagName:`div`,children:[jt({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),Mt(r)],properties:i})}function jt({name:e,prevName:t,iconType:n}){let r=[D({name:kt(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(C({tagName:`div`,children:[d(t)],properties:{"data-prev-name":``}})),r.push(D({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(C({tagName:`div`,children:[d(e)],properties:{"data-title":``}})),C({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Mt(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(C({tagName:`span`,children:[d(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(C({tagName:`span`,children:[d(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(C({tagName:`slot`,properties:{name:De}})),C({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Nt(e){return C({tagName:`pre`,properties:Pt(e)})}function Pt({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,themeType:a,themeStyles:o,totalLines:s,type:c}){let l={"data-diff":c===`diff`?``:void 0,"data-file":c===`file`?``:void 0,"data-diff-type":c===`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,"data-theme-type":a===`system`?void 0:a,style:o,tabIndex:0};return l.style+=`--diffs-min-number-column-width-default:${`${s}`.length}ch;`,l}function Ft(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:Je(t),preferredHighlighter:n}}var It=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2
- <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
3
- <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"/>
4
- </symbol>
5
- <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
6
- <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"/>
7
- </symbol>
8
- <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
9
- <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"/>
10
- </symbol>
11
- <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
12
- <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"/>
13
- </symbol>
14
- <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
15
- <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"/>
16
- </symbol>
17
- <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
18
- <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"/>
19
- </symbol>
20
- <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
21
- <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"/>
22
- </symbol>
23
- <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
24
- <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"/>
25
- </symbol>
26
- <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
27
- <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"/>
28
- </symbol>
29
- <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
30
- <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"/>
31
- </symbol>
32
- <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
33
- <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"/>
34
- </symbol>
35
- <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
36
- <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"/>
37
- </symbol>
38
- <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
39
- <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"/>
40
- </symbol>
41
- <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
42
- <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"/>
43
- </symbol>
44
- <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
45
- <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"/>
46
- </symbol>
47
- <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
48
- <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"/>
49
- </symbol>
50
- </svg>`;function Lt(e,t){return e==null||t==null?e===t: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.themeStyles===t.themeStyles&&e.themeType===t.themeType&&e.totalLines===t.totalLines}function Rt(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function zt(){let e=document.createElement(`div`);return e.slot=`hover-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e}function Bt(){let e=document.createElement(`style`);return e.setAttribute(Ie,``),e}var Vt=`@layer base, theme, unsafe;
51
-
52
- @layer base {
53
- :host {
54
- --diffs-bg: #fff;
55
- --diffs-fg: #000;
56
- --diffs-font-fallback:
57
- 'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono',
58
- 'Courier New', monospace;
59
- --diffs-header-font-fallback:
60
- system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
61
- 'Noto Sans', 'Liberation Sans', Arial, sans-serif;
62
-
63
- --diffs-mixer: light-dark(black, white);
64
- --diffs-gap-fallback: 8px;
65
-
66
- /*
67
- // Available CSS Color Overrides
68
- --diffs-bg-buffer-override
69
- --diffs-bg-hover-override
70
- --diffs-bg-context-override
71
- --diffs-bg-separator-override
72
-
73
- --diffs-fg-number-override
74
- --diffs-fg-number-addition-override
75
- --diffs-fg-number-deletion-override
76
-
77
- --diffs-deletion-color-override
78
- --diffs-addition-color-override
79
- --diffs-modified-color-override
80
-
81
- --diffs-bg-deletion-override
82
- --diffs-bg-deletion-number-override
83
- --diffs-bg-deletion-hover-override
84
- --diffs-bg-deletion-emphasis-override
85
-
86
- --diffs-bg-addition-override
87
- --diffs-bg-addition-number-override
88
- --diffs-bg-addition-hover-override
89
- --diffs-bg-addition-emphasis-override
90
-
91
- // Line Selection Color Overrides (for enableLineSelection)
92
- --diffs-selection-color-override
93
- --diffs-bg-selection-override
94
- --diffs-bg-selection-number-override
95
- --diffs-bg-selection-background-override
96
- --diffs-bg-selection-number-background-override
97
-
98
- // Available CSS Layout Overrides
99
- --diffs-gap-inline
100
- --diffs-gap-block
101
- --diffs-gap-style
102
- --diffs-tab-size
103
- */
104
-
105
- color-scheme: light dark;
106
- display: block;
107
- font-family: var(
108
- --diffs-header-font-family,
109
- var(--diffs-header-font-fallback)
110
- );
111
- font-size: var(--diffs-font-size, 13px);
112
- line-height: var(--diffs-line-height, 20px);
113
- font-feature-settings: var(--diffs-font-features);
114
- }
115
-
116
- /* NOTE(mdo): Some semantic HTML elements (e.g. \`pre\`, \`code\`) have default
117
- * user-agent styles. These must be overridden to use our custom styles. */
118
- pre,
119
- code,
120
- [data-error-wrapper] {
121
- isolation: isolate;
122
- margin: 0;
123
- padding: 0;
124
- display: block;
125
- outline: none;
126
- font-family: var(--diffs-font-family, var(--diffs-font-fallback));
127
- }
128
-
129
- pre,
130
- code {
131
- background-color: var(--diffs-bg);
132
- }
133
-
134
- code {
135
- contain: content;
136
- }
137
-
138
- *,
139
- *::before,
140
- *::after {
141
- box-sizing: border-box;
142
- }
143
-
144
- [data-icon-sprite] {
145
- display: none;
146
- }
147
-
148
- /* NOTE(mdo): Headers and separators are within pre/code, so we need to reset
149
- * their font-family explicitly. */
150
- [data-diffs-header],
151
- [data-separator] {
152
- font-family: var(
153
- --diffs-header-font-family,
154
- var(--diffs-header-font-fallback)
155
- );
156
- }
157
-
158
- [data-file-info] {
159
- padding: 10px;
160
- font-weight: 700;
161
- color: var(--fg);
162
- /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
163
- * and vscode use an older build of chrome that appears to have a bug with
164
- * color-mix and 'in oklch', so use 'in lab' instead */
165
- background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
166
- border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
167
- }
168
-
169
- [data-diffs-header],
170
- [data-diff],
171
- [data-file],
172
- [data-error-wrapper],
173
- [data-virtualizer-buffer] {
174
- --diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg));
175
- /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
176
- * and vscode use an older build of chrome that appears to have a bug with
177
- * color-mix and 'in oklch', so use 'in lab' instead */
178
- --diffs-bg-buffer: var(
179
- --diffs-bg-buffer-override,
180
- light-dark(
181
- color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),
182
- color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))
183
- )
184
- );
185
- --diffs-bg-hover: var(
186
- --diffs-bg-hover-override,
187
- light-dark(
188
- color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)),
189
- color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))
190
- )
191
- );
192
-
193
- --diffs-bg-context: var(
194
- --diffs-bg-context-override,
195
- light-dark(
196
- color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),
197
- color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))
198
- )
199
- );
200
- --diffs-bg-context-number: var(
201
- --diffs-bg-context-number-override,
202
- light-dark(
203
- color-mix(in lab, var(--diffs-bg-context) 80%, var(--diffs-bg)),
204
- color-mix(in lab, var(--diffs-bg-context) 60%, var(--diffs-bg))
205
- )
206
- );
207
-
208
- --diffs-bg-separator: var(
209
- --diffs-bg-separator-override,
210
- light-dark(
211
- color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),
212
- color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))
213
- )
214
- );
215
-
216
- --diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark));
217
- --diffs-fg-number: var(
218
- --diffs-fg-number-override,
219
- light-dark(
220
- color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),
221
- color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))
222
- )
223
- );
224
-
225
- --diffs-deletion-base: var(
226
- --diffs-deletion-color-override,
227
- light-dark(
228
- var(
229
- --diffs-light-deletion-color,
230
- var(--diffs-deletion-color, rgb(255, 0, 0))
231
- ),
232
- var(
233
- --diffs-dark-deletion-color,
234
- var(--diffs-deletion-color, rgb(255, 0, 0))
235
- )
236
- )
237
- );
238
- --diffs-addition-base: var(
239
- --diffs-addition-color-override,
240
- light-dark(
241
- var(
242
- --diffs-light-addition-color,
243
- var(--diffs-addition-color, rgb(0, 255, 0))
244
- ),
245
- var(
246
- --diffs-dark-addition-color,
247
- var(--diffs-addition-color, rgb(0, 255, 0))
248
- )
249
- )
250
- );
251
- --diffs-modified-base: var(
252
- --diffs-modified-color-override,
253
- light-dark(
254
- var(
255
- --diffs-light-modified-color,
256
- var(--diffs-modified-color, rgb(0, 0, 255))
257
- ),
258
- var(
259
- --diffs-dark-modified-color,
260
- var(--diffs-modified-color, rgb(0, 0, 255))
261
- )
262
- )
263
- );
264
-
265
- /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
266
- * and vscode use an older build of chrome that appears to have a bug with
267
- * color-mix and 'in oklch', so use 'in lab' instead */
268
- --diffs-bg-deletion: var(
269
- --diffs-bg-deletion-override,
270
- light-dark(
271
- color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),
272
- color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))
273
- )
274
- );
275
- --diffs-bg-deletion-number: var(
276
- --diffs-bg-deletion-number-override,
277
- light-dark(
278
- color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)),
279
- color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))
280
- )
281
- );
282
- --diffs-bg-deletion-hover: var(
283
- --diffs-bg-deletion-hover-override,
284
- light-dark(
285
- color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)),
286
- color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))
287
- )
288
- );
289
- --diffs-bg-deletion-emphasis: var(
290
- --diffs-bg-deletion-emphasis-override,
291
- light-dark(
292
- rgb(from var(--diffs-deletion-base) r g b / 0.15),
293
- rgb(from var(--diffs-deletion-base) r g b / 0.2)
294
- )
295
- );
296
-
297
- --diffs-bg-addition: var(
298
- --diffs-bg-addition-override,
299
- light-dark(
300
- color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),
301
- color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))
302
- )
303
- );
304
- --diffs-bg-addition-number: var(
305
- --diffs-bg-addition-number-override,
306
- light-dark(
307
- color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)),
308
- color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))
309
- )
310
- );
311
- --diffs-bg-addition-hover: var(
312
- --diffs-bg-addition-hover-override,
313
- light-dark(
314
- color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)),
315
- color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))
316
- )
317
- );
318
- --diffs-bg-addition-emphasis: var(
319
- --diffs-bg-addition-emphasis-override,
320
- light-dark(
321
- rgb(from var(--diffs-addition-base) r g b / 0.15),
322
- rgb(from var(--diffs-addition-base) r g b / 0.2)
323
- )
324
- );
325
-
326
- --diffs-selection-base: var(--diffs-modified-base);
327
- --diffs-selection-number-fg: light-dark(
328
- color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),
329
- color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer))
330
- );
331
- --diffs-bg-selection: var(
332
- --diffs-bg-selection-override,
333
- light-dark(
334
- color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)),
335
- color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base))
336
- )
337
- );
338
- --diffs-bg-selection-number: var(
339
- --diffs-bg-selection-number-override,
340
- light-dark(
341
- color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)),
342
- color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base))
343
- )
344
- );
345
-
346
- background-color: var(--diffs-bg);
347
- color: var(--diffs-fg);
348
- }
349
-
350
- [data-diff],
351
- [data-file] {
352
- /* This feels a bit crazy to me... so I need to think about it a bit more... */
353
- --diffs-grid-number-column-width: minmax(min-content, max-content);
354
- --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
355
-
356
- &[data-dehydrated] {
357
- --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
358
- }
359
-
360
- &[data-theme-type='light'],
361
- & {
362
- [data-line] span {
363
- color: light-dark(
364
- var(--diffs-token-light, var(--diffs-light)),
365
- var(--diffs-token-dark, var(--diffs-dark))
366
- );
367
- font-weight: var(--diffs-token-light-font-weight, inherit);
368
- font-style: var(--diffs-token-light-font-style, inherit);
369
- -webkit-text-decoration: var(--diffs-token-light-text-decoration, inherit);
370
- text-decoration: var(--diffs-token-light-text-decoration, inherit);
371
- }
372
- }
373
-
374
- &[data-theme-type='dark'] [data-line] span {
375
- font-weight: var(--diffs-token-dark-font-weight, inherit);
376
- font-style: var(--diffs-token-dark-font-style, inherit);
377
- -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit);
378
- text-decoration: var(--diffs-token-dark-text-decoration, inherit);
379
- }
380
-
381
- &:hover [data-code]::-webkit-scrollbar-thumb {
382
- background-color: var(--diffs-bg-context);
383
- }
384
- }
385
-
386
- [data-line] span {
387
- background-color: light-dark(
388
- var(--diffs-token-light-bg, inherit),
389
- var(--diffs-token-dark-bg, inherit)
390
- );
391
- }
392
-
393
- [data-line],
394
- [data-gutter-buffer],
395
- [data-line-annotation],
396
- [data-no-newline] {
397
- color: var(--diffs-fg);
398
- background-color: var(--diffs-line-bg, var(--diffs-bg));
399
- }
400
-
401
- [data-no-newline] {
402
- -webkit-user-select: none;
403
- user-select: none;
404
-
405
- span {
406
- opacity: 0.6;
407
- }
408
- }
409
-
410
- @media (prefers-color-scheme: dark) {
411
- [data-diffs-header],
412
- [data-error-wrapper],
413
- [data-diff],
414
- [data-file] {
415
- color-scheme: dark;
416
- }
417
-
418
- [data-content] [data-line] span {
419
- font-weight: var(--diffs-token-dark-font-weight, inherit);
420
- font-style: var(--diffs-token-dark-font-style, inherit);
421
- -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit);
422
- text-decoration: var(--diffs-token-dark-text-decoration, inherit);
423
- }
424
- }
425
-
426
- [data-diffs-header],
427
- [data-diff],
428
- [data-file] {
429
- &[data-theme-type='light'] {
430
- color-scheme: light;
431
- }
432
-
433
- &[data-theme-type='dark'] {
434
- color-scheme: dark;
435
- }
436
- }
437
-
438
- [data-diff-type='split'][data-overflow='scroll'] {
439
- display: grid;
440
- grid-template-columns: 1fr 1fr;
441
-
442
- [data-additions] {
443
- border-left: 1px solid var(--diffs-bg);
444
- }
445
-
446
- [data-deletions] {
447
- border-right: 1px solid var(--diffs-bg);
448
- }
449
- }
450
-
451
- [data-code] {
452
- display: grid;
453
- grid-auto-flow: dense;
454
- grid-template-columns: var(--diffs-code-grid);
455
- overflow: scroll clip;
456
- overscroll-behavior-x: none;
457
- tab-size: var(--diffs-tab-size, 2);
458
- align-self: flex-start;
459
- padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
460
- padding-bottom: max(
461
- 0px,
462
- calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px)
463
- );
464
- }
465
-
466
- [data-container-size] {
467
- container-type: inline-size;
468
- }
469
-
470
- [data-code]::-webkit-scrollbar {
471
- width: 0;
472
- height: 6px;
473
- }
474
-
475
- [data-code]::-webkit-scrollbar-track {
476
- background: transparent;
477
- }
478
-
479
- [data-code]::-webkit-scrollbar-thumb {
480
- background-color: transparent;
481
- border: 1px solid transparent;
482
- background-clip: content-box;
483
- border-radius: 3px;
484
- }
485
-
486
- [data-code]::-webkit-scrollbar-corner {
487
- background-color: transparent;
488
- }
489
-
490
- /*
491
- * If we apply these rules globally it will mean that webkit will opt into the
492
- * standards compliant version of custom css scrollbars, which we do not want
493
- * because the custom stuff will look better
494
- */
495
- @supports (-moz-appearance: none) {
496
- [data-code] {
497
- scrollbar-width: thin;
498
- scrollbar-color: var(--diffs-bg-context) transparent;
499
- padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
500
- }
501
- }
502
-
503
- [data-diffs-header] ~ [data-diff],
504
- [data-diffs-header] ~ [data-file] {
505
- [data-code],
506
- &[data-overflow='wrap'] {
507
- padding-top: 0;
508
- }
509
- }
510
-
511
- [data-gutter] {
512
- display: grid;
513
- grid-template-rows: subgrid;
514
- grid-template-columns: subgrid;
515
- grid-column: 1;
516
- z-index: 3;
517
- position: relative;
518
- background-color: var(--diffs-bg);
519
-
520
- [data-gutter-buffer],
521
- [data-column-number] {
522
- border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
523
- }
524
- }
525
-
526
- [data-content] {
527
- display: grid;
528
- grid-template-rows: subgrid;
529
- grid-template-columns: subgrid;
530
- grid-column: 2;
531
- min-width: 0;
532
- }
533
-
534
- [data-diff-type='split'][data-overflow='wrap'] {
535
- display: grid;
536
- grid-auto-flow: dense;
537
- grid-template-columns: repeat(2, var(--diffs-code-grid));
538
- padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
539
-
540
- [data-deletions] {
541
- display: contents;
542
-
543
- [data-gutter] {
544
- grid-column: 1;
545
- }
546
-
547
- [data-content] {
548
- grid-column: 2;
549
- border-right: 1px solid var(--diffs-bg);
550
- }
551
- }
552
-
553
- [data-additions] {
554
- display: contents;
555
-
556
- [data-gutter] {
557
- grid-column: 3;
558
- border-left: 1px solid var(--diffs-bg);
559
- }
560
-
561
- [data-content] {
562
- grid-column: 4;
563
- }
564
- }
565
- }
566
-
567
- [data-overflow='scroll'] [data-gutter] {
568
- position: sticky;
569
- left: 0;
570
- }
571
-
572
- [data-line-annotation][data-selected-line] {
573
- background-color: unset;
574
-
575
- &::before {
576
- content: '';
577
- /* FIXME(amadeus): This needs to be audited ... */
578
- position: sticky;
579
- top: 0;
580
- left: 0;
581
- display: block;
582
- border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));
583
- background-color: var(--diffs-bg-selection-number);
584
- }
585
-
586
- [data-annotation-content] {
587
- background-color: var(--diffs-bg-selection);
588
- }
589
- }
590
-
591
- [data-interactive-lines] [data-line] {
592
- cursor: pointer;
593
- }
594
-
595
- [data-content-buffer],
596
- [data-gutter-buffer] {
597
- position: relative;
598
- -webkit-user-select: none;
599
- user-select: none;
600
- min-height: 1lh;
601
- }
602
-
603
- [data-gutter-buffer='annotation'] {
604
- min-height: 0;
605
- }
606
-
607
- [data-gutter-buffer='buffer'] {
608
- background-size: 8px 8px;
609
- background-position: 0 0;
610
- background-origin: border-box;
611
- background-color: var(--diffs-bg);
612
- /* This is incredibley expensive... */
613
- background-image: repeating-linear-gradient(
614
- -45deg,
615
- transparent,
616
- transparent calc(3px * 1.414),
617
- rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(3px * 1.414),
618
- rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(4px * 1.414)
619
- );
620
- }
621
-
622
- [data-content-buffer] {
623
- grid-column: 1;
624
- /* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */
625
- background-size: 8px 8px;
626
- background-position: 5px 0;
627
- background-origin: border-box;
628
- background-color: var(--diffs-bg);
629
- /* This is incredibley expensive... */
630
- background-image: repeating-linear-gradient(
631
- -45deg,
632
- transparent,
633
- transparent calc(3px * 1.414),
634
- var(--diffs-bg-buffer) calc(3px * 1.414),
635
- var(--diffs-bg-buffer) calc(4px * 1.414)
636
- );
637
- }
638
-
639
- [data-separator] {
640
- box-sizing: content-box;
641
- background-color: var(--diffs-bg);
642
- }
643
-
644
- [data-separator='simple'] {
645
- min-height: 4px;
646
- }
647
-
648
- [data-separator='line-info'],
649
- [data-separator='line-info-basic'],
650
- [data-separator='metadata'],
651
- [data-separator='simple'] {
652
- background-color: var(--diffs-bg-separator);
653
- }
654
-
655
- [data-separator='line-info'],
656
- [data-separator='line-info-basic'],
657
- [data-separator='metadata'] {
658
- height: 32px;
659
- position: relative;
660
- }
661
-
662
- [data-separator-wrapper] {
663
- -webkit-user-select: none;
664
- user-select: none;
665
- fill: currentColor;
666
- position: absolute;
667
- inset-inline: 0;
668
- display: flex;
669
- align-items: center;
670
- background-color: var(--diffs-bg);
671
- height: 100%;
672
- }
673
-
674
- [data-content] [data-separator-wrapper] {
675
- display: none;
676
- }
677
-
678
- [data-separator='metadata'] [data-separator-wrapper] {
679
- inset-inline: 100% auto;
680
- padding-inline: 1ch;
681
- height: 100%;
682
- background-color: var(--diffs-bg-separator);
683
- color: var(--diffs-fg-number);
684
- white-space: nowrap;
685
- overflow: hidden;
686
- text-overflow: ellipsis;
687
- min-width: min-content;
688
- }
689
-
690
- [data-separator='line-info'] {
691
- margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
692
- }
693
-
694
- [data-separator='line-info-basic'],
695
- [data-separator='metadata'] {
696
- margin-block: 0;
697
- }
698
-
699
- [data-separator='line-info'][data-separator-first] {
700
- margin-top: 0;
701
- }
702
-
703
- [data-separator='line-info'][data-separator-last] {
704
- margin-bottom: 0;
705
- }
706
-
707
- [data-expand-index] [data-separator-wrapper] {
708
- display: grid;
709
- grid-template-columns: 32px auto;
710
- }
711
-
712
- [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
713
- grid-template-columns: 32px 32px auto;
714
- }
715
-
716
- [data-expand-button],
717
- [data-separator-content] {
718
- display: flex;
719
- flex: 0 0 auto;
720
- align-items: center;
721
- background-color: var(--diffs-bg-separator);
722
- }
723
-
724
- [data-expand-button] {
725
- justify-content: center;
726
- flex-shrink: 0;
727
- cursor: pointer;
728
- min-width: 32px;
729
- align-self: stretch;
730
- color: var(--diffs-fg-number);
731
- border-right: 2px solid var(--diffs-bg);
732
-
733
- &:hover {
734
- color: var(--diffs-fg);
735
- }
736
- }
737
-
738
- [data-expand-down] [data-icon] {
739
- transform: scaleY(-1);
740
- }
741
-
742
- [data-separator-content] {
743
- flex: 1 1 auto;
744
- padding: 0 1ch;
745
- height: 100%;
746
- color: var(--diffs-fg-number);
747
-
748
- overflow: hidden;
749
- justify-content: flex-start;
750
- }
751
-
752
- [data-separator='line-info'],
753
- [data-separator='line-info-basic'] {
754
- [data-separator-content] {
755
- height: 100%;
756
- -webkit-user-select: none;
757
- user-select: none;
758
- overflow: clip;
759
- }
760
- }
761
-
762
- @supports (width: 1cqi) {
763
- [data-unified] {
764
- [data-separator='line-info'] [data-separator-wrapper] {
765
- padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
766
- width: 100cqi;
767
-
768
- [data-separator-content] {
769
- border-radius: 6px;
770
- }
771
- }
772
-
773
- [data-separator='line-info'][data-expand-index]
774
- [data-separator-wrapper]
775
- [data-separator-content] {
776
- border-top-left-radius: unset;
777
- border-bottom-left-radius: unset;
778
- }
779
- }
780
-
781
- [data-gutter] {
782
- [data-separator='line-info'] [data-separator-wrapper] {
783
- padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
784
- }
785
-
786
- [data-separator='line-info'] [data-separator-content] {
787
- border-top-left-radius: 6px;
788
- border-bottom-left-radius: 6px;
789
- }
790
-
791
- [data-separator='line-info'][data-expand-index] [data-separator-content] {
792
- border-top-left-radius: unset;
793
- border-bottom-left-radius: unset;
794
- }
795
- }
796
-
797
- [data-additions] {
798
- [data-content] [data-separator='line-info'] {
799
- background-color: var(--diffs-bg);
800
-
801
- [data-separator-wrapper] {
802
- display: none;
803
- }
804
- }
805
-
806
- [data-gutter] [data-separator='line-info'] [data-separator-wrapper] {
807
- display: block;
808
- height: 100%;
809
- background-color: var(--diffs-bg-separator);
810
- border-top-right-radius: 6px;
811
- border-bottom-right-radius: 6px;
812
-
813
- [data-separator-content],
814
- [data-expand-button] {
815
- display: none;
816
- }
817
- }
818
- }
819
-
820
- [data-overflow='scroll']
821
- [data-additions]
822
- [data-gutter]
823
- [data-separator='line-info']
824
- [data-separator-wrapper] {
825
- width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
826
- }
827
-
828
- [data-overflow='wrap']
829
- [data-additions]
830
- [data-content]
831
- [data-separator='line-info']
832
- [data-separator-wrapper] {
833
- background-color: var(--diffs-bg-separator);
834
- display: block;
835
- height: 100%;
836
- margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
837
- border-top-right-radius: 6px;
838
- border-bottom-right-radius: 6px;
839
-
840
- [data-separator-content],
841
- [data-expand-button] {
842
- display: none;
843
- }
844
- }
845
-
846
- [data-separator='line-info'] [data-separator-wrapper] {
847
- [data-expand-both],
848
- [data-expand-down],
849
- [data-expand-up] {
850
- border-top-left-radius: 6px;
851
- border-bottom-left-radius: 6px;
852
- }
853
- }
854
-
855
- @media (pointer: fine) {
856
- [data-separator='line-info'] [data-separator-wrapper] {
857
- &[data-separator-multi-button] {
858
- [data-expand-up] {
859
- border-top-left-radius: 6px;
860
- border-bottom-left-radius: unset;
861
- }
862
-
863
- [data-expand-down] {
864
- border-bottom-left-radius: 6px;
865
- border-top-left-radius: unset;
866
- }
867
- }
868
- }
869
- }
870
- }
871
-
872
- @media (pointer: coarse) {
873
- [data-separator='line-info-basic']
874
- [data-separator-wrapper][data-separator-multi-button] {
875
- grid-template-columns: 34px 34px auto;
876
-
877
- [data-separator-content] {
878
- grid-column: unset;
879
- grid-row: unset;
880
- }
881
- }
882
-
883
- @supports (width: 1cqi) {
884
- [data-separator='line-info'] [data-separator-wrapper] {
885
- [data-expand-both],
886
- [data-expand-down],
887
- [data-expand-up] {
888
- border-top-left-radius: 6px;
889
- border-bottom-left-radius: 6px;
890
- }
891
-
892
- &[data-separator-multi-button] {
893
- [data-expand-up] {
894
- border-top-left-radius: 6px;
895
- border-bottom-left-radius: 6px;
896
- }
897
-
898
- [data-expand-down] {
899
- border-bottom-left-radius: unset;
900
- border-top-left-radius: unset;
901
- }
902
- }
903
- }
904
- }
905
- }
906
-
907
- @media (pointer: fine) {
908
- [data-separator-wrapper][data-separator-multi-button] {
909
- display: grid;
910
- grid-template-rows: 50% 50%;
911
-
912
- [data-separator-content] {
913
- grid-column: 2;
914
- grid-row: 1 / -1;
915
- min-width: min-content;
916
- }
917
-
918
- [data-expand-button] {
919
- grid-column: 1;
920
- }
921
- }
922
-
923
- [data-separator='line-info'] [data-separator-wrapper],
924
- [data-separator='line-info']
925
- [data-separator-wrapper][data-separator-multi-button] {
926
- grid-template-columns: 34px auto;
927
- }
928
-
929
- [data-separator='line-info-basic'][data-expand-index]
930
- [data-separator-wrapper] {
931
- grid-template-columns: 100% auto;
932
- }
933
-
934
- [data-separator='line-info'],
935
- [data-separator='line-info-basic'] {
936
- [data-separator-multi-button] {
937
- [data-expand-up] {
938
- border-bottom: 1px solid var(--diffs-bg);
939
- border-right: 2px solid var(--diffs-bg);
940
- }
941
- [data-expand-down] {
942
- border-top: 1px solid var(--diffs-bg);
943
- border-right: 2px solid var(--diffs-bg);
944
- }
945
- }
946
- }
947
- }
948
-
949
- [data-additions] [data-gutter] [data-separator-wrapper],
950
- [data-additions] [data-separator='line-info-basic'] [data-separator-wrapper],
951
- [data-content] [data-separator-wrapper] {
952
- display: none;
953
- }
954
-
955
- [data-line-annotation],
956
- [data-gutter-buffer='annotation'] {
957
- --diffs-line-bg: var(--diffs-bg-context);
958
- }
959
-
960
- [data-line-annotation] {
961
- min-height: var(--diffs-annotation-min-height, 0);
962
- z-index: 2;
963
- }
964
-
965
- [data-separator='custom'] {
966
- display: grid;
967
- grid-template-columns: subgrid;
968
- }
969
-
970
- [data-line],
971
- [data-column-number],
972
- [data-no-newline] {
973
- position: relative;
974
- padding-inline: 1ch;
975
- }
976
-
977
- [data-indicators='classic'] [data-line] {
978
- padding-inline-start: 2ch;
979
- }
980
-
981
- [data-indicators='classic'] {
982
- [data-line-type='change-addition'],
983
- [data-line-type='change-deletion'] {
984
- &[data-no-newline],
985
- &[data-line] {
986
- &::before {
987
- display: inline-block;
988
- width: 1ch;
989
- height: 1lh;
990
- position: absolute;
991
- top: 0;
992
- left: 0;
993
- -webkit-user-select: none;
994
- user-select: none;
995
- }
996
- }
997
- }
998
-
999
- [data-line-type='change-addition'] {
1000
- &[data-line],
1001
- &[data-no-newline] {
1002
- &::before {
1003
- content: '+';
1004
- color: var(--diffs-addition-base);
1005
- }
1006
- }
1007
- }
1008
-
1009
- [data-line-type='change-deletion'] {
1010
- &[data-line],
1011
- &[data-no-newline] {
1012
- &::before {
1013
- content: '-';
1014
- color: var(--diffs-deletion-base);
1015
- }
1016
- }
1017
- }
1018
- }
1019
-
1020
- [data-indicators='bars'] {
1021
- [data-line-type='change-deletion'],
1022
- [data-line-type='change-addition'] {
1023
- &[data-column-number] {
1024
- &::before {
1025
- content: '';
1026
- display: block;
1027
- width: 4px;
1028
- height: 100%;
1029
- position: absolute;
1030
- top: 0;
1031
- left: 0;
1032
- -webkit-user-select: none;
1033
- user-select: none;
1034
- contain: strict;
1035
- }
1036
- }
1037
- }
1038
-
1039
- [data-line-type='change-deletion'] {
1040
- &[data-column-number] {
1041
- &::before {
1042
- background-image: linear-gradient(
1043
- 0deg,
1044
- var(--diffs-bg-deletion) 50%,
1045
- var(--diffs-deletion-base) 50%
1046
- );
1047
- background-repeat: repeat;
1048
- background-size: 2px 2px;
1049
- background-size: calc(1lh / round(1lh / 2px))
1050
- calc(1lh / round(1lh / 2px));
1051
- }
1052
- }
1053
- }
1054
-
1055
- [data-line-type='change-addition'] {
1056
- &[data-column-number] {
1057
- &::before {
1058
- background-color: var(--diffs-addition-base);
1059
- }
1060
- }
1061
- }
1062
- }
1063
-
1064
- [data-overflow='wrap'] {
1065
- [data-line],
1066
- [data-annotation-content] {
1067
- white-space: pre-wrap;
1068
- word-break: break-word;
1069
- }
1070
- }
1071
-
1072
- [data-overflow='scroll'] [data-line] {
1073
- white-space: pre;
1074
- min-height: 1lh;
1075
- }
1076
-
1077
- [data-column-number] {
1078
- box-sizing: content-box;
1079
- text-align: right;
1080
- -webkit-user-select: none;
1081
- user-select: none;
1082
- background-color: var(--diffs-bg);
1083
- color: var(--diffs-fg-number);
1084
- padding-left: 2ch;
1085
- }
1086
-
1087
- [data-line-number-content] {
1088
- display: inline-block;
1089
- min-width: var(
1090
- --diffs-min-number-column-width,
1091
- var(--diffs-min-number-column-width-default, 3ch)
1092
- );
1093
- }
1094
-
1095
- [data-disable-line-numbers] {
1096
- [data-column-number] {
1097
- min-width: 4px;
1098
- padding: 0;
1099
- }
1100
-
1101
- [data-line-number-content] {
1102
- display: none;
1103
- }
1104
-
1105
- [data-hover-slot] {
1106
- right: unset;
1107
- left: 0;
1108
- justify-content: flex-start;
1109
- }
1110
-
1111
- &[data-indicators='bars'] [data-hover-slot] {
1112
- /* Using 5px here because theres a 1px separator after the bar */
1113
- left: 5px;
1114
- }
1115
- }
1116
-
1117
- [data-file][data-disable-line-numbers] {
1118
- [data-gutter-buffer],
1119
- [data-column-number] {
1120
- min-width: 0;
1121
- border-right: 0;
1122
- }
1123
- }
1124
-
1125
- [data-interactive-line-numbers] [data-column-number] {
1126
- cursor: pointer;
1127
- }
1128
-
1129
- [data-diff-span] {
1130
- border-radius: 3px;
1131
- -webkit-box-decoration-break: clone;
1132
- box-decoration-break: clone;
1133
- }
1134
-
1135
- [data-line-type='change-addition'] {
1136
- &[data-column-number] {
1137
- color: var(
1138
- --diffs-fg-number-addition-override,
1139
- var(--diffs-addition-base)
1140
- );
1141
- }
1142
-
1143
- > [data-diff-span] {
1144
- background-color: var(--diffs-bg-addition-emphasis);
1145
- }
1146
- }
1147
-
1148
- [data-line-type='change-deletion'] {
1149
- &[data-column-number] {
1150
- color: var(
1151
- --diffs-fg-number-deletion-override,
1152
- var(--diffs-deletion-base)
1153
- );
1154
- }
1155
-
1156
- [data-diff-span] {
1157
- background-color: var(--diffs-bg-deletion-emphasis);
1158
- }
1159
- }
1160
-
1161
- [data-background] [data-line-type='change-addition'] {
1162
- --diffs-line-bg: var(--diffs-bg-addition);
1163
-
1164
- &[data-column-number] {
1165
- background-color: var(--diffs-bg-addition-number);
1166
- }
1167
- }
1168
-
1169
- [data-background] [data-line-type='change-deletion'] {
1170
- --diffs-line-bg: var(--diffs-bg-deletion);
1171
-
1172
- &[data-column-number] {
1173
- background-color: var(--diffs-bg-deletion-number);
1174
- }
1175
- }
1176
-
1177
- @media (pointer: fine) {
1178
- [data-column-number],
1179
- [data-line] {
1180
- &[data-hovered] {
1181
- background-color: var(--diffs-bg-hover);
1182
- }
1183
- }
1184
-
1185
- [data-background] {
1186
- [data-column-number],
1187
- [data-line] {
1188
- &[data-hovered] {
1189
- &[data-line-type='change-deletion'] {
1190
- background-color: var(--diffs-bg-deletion-hover);
1191
- }
1192
-
1193
- &[data-line-type='change-addition'] {
1194
- background-color: var(--diffs-bg-addition-hover);
1195
- }
1196
- }
1197
- }
1198
- }
1199
- }
1200
-
1201
- [data-diffs-header] {
1202
- position: relative;
1203
- display: flex;
1204
- flex-direction: row;
1205
- justify-content: space-between;
1206
- align-items: center;
1207
- gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1208
- min-height: calc(
1209
- 1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3)
1210
- );
1211
- padding-inline: 16px;
1212
- top: 0;
1213
- z-index: 2;
1214
- }
1215
-
1216
- [data-header-content] {
1217
- display: flex;
1218
- flex-direction: row;
1219
- align-items: center;
1220
- gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1221
- min-width: 0;
1222
- white-space: nowrap;
1223
- }
1224
-
1225
- [data-header-content] [data-prev-name],
1226
- [data-header-content] [data-title] {
1227
- direction: rtl;
1228
- overflow: hidden;
1229
- text-overflow: ellipsis;
1230
- min-width: 0;
1231
- white-space: nowrap;
1232
- }
1233
-
1234
- [data-prev-name] {
1235
- opacity: 0.7;
1236
- }
1237
-
1238
- [data-rename-icon] {
1239
- fill: currentColor;
1240
- flex-shrink: 0;
1241
- flex-grow: 0;
1242
- }
1243
-
1244
- [data-diffs-header] [data-metadata] {
1245
- display: flex;
1246
- align-items: center;
1247
- gap: 1ch;
1248
- white-space: nowrap;
1249
- }
1250
-
1251
- [data-diffs-header] [data-additions-count] {
1252
- font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1253
- color: var(--diffs-addition-base);
1254
- }
1255
-
1256
- [data-diffs-header] [data-deletions-count] {
1257
- font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1258
- color: var(--diffs-deletion-base);
1259
- }
1260
-
1261
- [data-annotation-content] {
1262
- position: relative;
1263
- display: flow-root;
1264
- align-self: flex-start;
1265
- z-index: 2;
1266
- min-width: 0;
1267
- isolation: isolate;
1268
- }
1269
-
1270
- /* Sticky positioning has a composite costs, so we should _only_ pay it if we
1271
- * need to */
1272
- [data-overflow='scroll'] [data-annotation-content] {
1273
- position: sticky;
1274
- width: var(--diffs-column-content-width, auto);
1275
- left: var(--diffs-column-number-width, 0);
1276
- }
1277
-
1278
- /* Undo some of the stuff that the 'pre' tag does */
1279
- [data-annotation-slot] {
1280
- text-wrap-mode: wrap;
1281
- word-break: normal;
1282
- white-space-collapse: collapse;
1283
- }
1284
-
1285
- [data-change-icon] {
1286
- fill: currentColor;
1287
- flex-shrink: 0;
1288
- }
1289
-
1290
- [data-change-icon='change'],
1291
- [data-change-icon='rename-pure'],
1292
- [data-change-icon='rename-changed'] {
1293
- color: var(--diffs-modified-base);
1294
- }
1295
-
1296
- [data-change-icon='new'] {
1297
- color: var(--diffs-addition-base);
1298
- }
1299
-
1300
- [data-change-icon='deleted'] {
1301
- color: var(--diffs-deletion-base);
1302
- }
1303
-
1304
- [data-change-icon='file'] {
1305
- opacity: 0.6;
1306
- }
1307
-
1308
- /* Line selection highlighting */
1309
- [data-selected-line] {
1310
- &[data-gutter-buffer='annotation'],
1311
- &[data-column-number] {
1312
- color: var(--diffs-selection-number-fg);
1313
- background-color: var(--diffs-bg-selection-number);
1314
- }
1315
-
1316
- &[data-line] {
1317
- background-color: var(--diffs-bg-selection);
1318
- }
1319
- }
1320
-
1321
- [data-line-type='change-addition'],
1322
- [data-line-type='change-deletion'] {
1323
- &[data-selected-line] {
1324
- &[data-line],
1325
- &[data-line][data-hovered] {
1326
- background-color: light-dark(
1327
- color-mix(
1328
- in lab,
1329
- var(--diffs-line-bg, var(--diffs-bg)) 82%,
1330
- var(--diffs-selection-base)
1331
- ),
1332
- color-mix(
1333
- in lab,
1334
- var(--diffs-line-bg, var(--diffs-bg)) 75%,
1335
- var(--diffs-selection-base)
1336
- )
1337
- );
1338
- }
1339
-
1340
- &[data-column-number],
1341
- &[data-column-number][data-hovered] {
1342
- color: var(--diffs-selection-number-fg);
1343
- background-color: light-dark(
1344
- color-mix(
1345
- in lab,
1346
- var(--diffs-line-bg, var(--diffs-bg)) 75%,
1347
- var(--diffs-selection-base)
1348
- ),
1349
- color-mix(
1350
- in lab,
1351
- var(--diffs-line-bg, var(--diffs-bg)) 60%,
1352
- var(--diffs-selection-base)
1353
- )
1354
- );
1355
- }
1356
- }
1357
- }
1358
-
1359
- [data-hover-slot] {
1360
- position: absolute;
1361
- top: 0;
1362
- bottom: 0;
1363
- right: 0;
1364
- display: flex;
1365
- justify-content: flex-end;
1366
- }
1367
-
1368
- [data-unmodified-lines] {
1369
- display: block;
1370
- overflow: hidden;
1371
- min-width: 0;
1372
- text-overflow: ellipsis;
1373
- white-space: nowrap;
1374
- flex: 0 1 auto;
1375
- }
1376
-
1377
- [data-error-wrapper] {
1378
- overflow: auto;
1379
- padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
1380
- var(--diffs-gap-inline, var(--diffs-gap-fallback));
1381
- max-height: 400px;
1382
- scrollbar-width: none;
1383
-
1384
- [data-error-message] {
1385
- font-weight: bold;
1386
- font-size: 18px;
1387
- color: var(--diffs-deletion-base);
1388
- }
1389
-
1390
- [data-error-stack] {
1391
- color: var(--diffs-fg-number);
1392
- }
1393
- }
1394
-
1395
- [data-placeholder] {
1396
- contain: strict;
1397
- }
1398
- }
1399
- `,Ht=`@layer base, theme, unsafe;`;function Ut(e){return`${Ht}
1400
- @layer unsafe {
1401
- ${e}
1402
- }`}function Wt({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 Gt(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Kt(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,themeStyles:s,themeType:c,totalLines:l}){switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),c===`system`?e.removeAttribute(`data-theme-type`):e.setAttribute(`data-theme-type`,c),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.tabIndex=0,e.style=s,e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${l}`.length}ch`),e}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(Vt)),t.adoptedStyleSheets=[e]}}customElements.define(R,t)}function qt(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 Jt(e,t){return A(e?.theme??L,t?.theme??L)&&qt(e,t,[`theme`])}function Yt({fileDiff:e,deletionFile:t,additionFile:n,renderHeaderMetadata:r,renderAnnotation:i,renderHoverUtility:a,lineAnnotations:o,getHoveredLine:s}){let c=r?.({fileDiff:e,deletionFile:t,additionFile:n});return(0,G.jsxs)(G.Fragment,{children:[c!=null&&(0,G.jsx)(`div`,{slot:`header-metadata`,children:c}),i!=null&&o?.map((e,t)=>(0,G.jsx)(`div`,{slot:W(e),children:i(e)},t)),a!=null&&(0,G.jsx)(`div`,{slot:`hover-slot`,style:Ze,children:a(s)})]})}var Xt=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 Zt(e){return C({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Qt(e){return C({tagName:`div`,children:[C({tagName:`span`,children:[d(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function $t(e){return C({tagName:`div`,children:[D({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{"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 $({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=[];if(e===`metadata`&&t!=null&&s.push(C({tagName:`div`,children:[d(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||e.push($t(`up`)),o||e.push($t(`down`))):e.push($t(!a&&!o?`both`:a?`down`:`up`))),e.push(C({tagName:`div`,children:[C({tagName:`span`,children:[d(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),s.push(C({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":e.length>2?``:void 0}}))}return e===`custom`&&i!=null&&s.push(C({tagName:`slot`,properties:{name:i}})),C({tagName:`div`,children:s,properties:{"data-separator":s.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function en(e,t){return`hunk-separator-${e}-${t}`}function tn(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function nn(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}var rn=-1,an=class{__id=`diff-hunks-renderer:${++rn}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:L},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Et(e.theme??L)?r():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){this.getOptionsWithDefaults().themeType!==e&&this.mergeOptions({themeType:e})}expandHunk(e,t){let{expansionLineCount:n}=this.getOptionsWithDefaults(),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.renderCache=void 0),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??Me}getExpandedHunksMap(){return this.expandedHunks}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)}}getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1,expansionLineCount:c=100,hunkSeparators:l=`line-info`,lineDiffType:u=`word-alt`,maxLineDiffLength:d=1e3,overflow:f=`scroll`,theme:p=L,themeType:m=`system`,tokenizeMaxLineLength:h=1e3,useCSSClasses:g=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,expandUnchanged:o,collapsedContextThreshold:s,expansionLineCount:c,hunkSeparators:l,lineDiffType:u,maxLineDiffLength:d,overflow:f,theme:this.workerManager?.getDiffRenderOptions().theme??p,themeType:m,tokenizeMaxLineLength:h,useCSSClasses:g}}async initializeHighlighter(){return this.highlighter=await F(Ft(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getDiffResultCache(e);n!=null&&!on(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!0,options:t,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(e).then(({result:t,options:n})=>{this.onHighlightSuccess(e,t,n)})}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n}=this.getOptionsWithDefaults();return{theme:e,tokenizeMaxLineLength:t,lineDiffType:n}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||e!==n.diff||!on(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff,t=_){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),i=this.workerManager?.getDiffResultCache(e);i!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...i});let{options:a,forceRender:o}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&!wt(this.renderCache.renderRange,t))&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,nn(t)||n?!0:this.expandedHunks,r),this.renderCache.renderRange=t),t.totalLines>0&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??y(e.name);let t=this.highlighter!=null&&Et(a.theme),n=this.highlighter!=null&&Tt(this.computedLang);if(this.highlighter!=null&&t&&(o||!this.renderCache.highlighted&&n||this.renderCache.result==null)){let{result:t,options:r}=this.renderDiffWithHighlighter(e,this.highlighter,!n);this.renderCache={diff:e,options:r,highlighted:n,result:t,renderRange:void 0}}(!t||!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.onHighlightSuccess(e,t,n)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=_){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n,r){let{diffIndicators:i,disableBackground:a,disableLineNumbers:o,overflow:s,themeType:c}=this.getOptionsWithDefaults();return Nt({type:`diff`,diffIndicators:i,disableBackground:a,disableLineNumbers:o,overflow:s,themeStyles:n,split:e,themeType:r??c,totalLines:t})}async asyncHighlight(e){this.computedLang=e.lang??y(e.name);let t=this.highlighter!=null&&Et(this.options.theme??L),n=this.highlighter!=null&&Tt(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:l(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;let r=this.renderCache.diff!==e||!this.renderCache.highlighted||!on(this.renderCache.options,n);this.renderCache={diff:e,options:n,highlighted:!0,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,n,{code:r,themeStyles:i,baseThemeType:a}){let{diffStyle:o,disableFileHeader:s,expandUnchanged:c,expansionLineCount:l,collapsedContextThreshold:u,hunkSeparators:d}=this.getOptionsWithDefaults();this.diff=e;let f=o===`unified`,p=[],m=[],h=[],g=[],{additionLines:_,deletionLines:v}=r,y={rowCount:0,hunkSeparators:d,additionsContentAST:p,deletionsContentAST:m,unifiedContentAST:h,unifiedGutterAST:x(),deletionsGutterAST:x(),additionsGutterAST:x(),expansionLineCount:l,hunkData:g,incrementRowCount(e=1){y.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:y.unifiedGutterAST.children.push(t);break;case`deletions`:y.deletionsGutterAST.children.push(t);break;case`additions`:y.additionsGutterAST.children.push(t);break}}},b=un(e),S=0,C;function w(e,t,n,r){y.pushToGutter(e,ve(t,n,r))}function E(){if(o!==`unified`){if(S<=0||C==null){S=0,C=void 0;return}C===`additions`?(y.pushToGutter(`additions`,t(void 0,`buffer`,S)),p?.push(Zt(S))):(y.pushToGutter(`deletions`,t(void 0,`buffer`,S)),m?.push(Zt(S))),S=0,C=void 0}}function D(e){E(),o===`unified`?ln(`unified`,e,y):(ln(`deletions`,e,y),ln(`additions`,e,y))}T({diff:e,diffStyle:o,startingLine:n.startingLine,totalLines:n.totalLines,expandedHunks:c?!0:this.expandedHunks,collapsedContextThreshold:u,callback:({hunkIndex:n,hunk:r,collapsedBefore:i,collapsedAfter:a,additionLine:s,deletionLine:c,type:l})=>{let u=c==null?s.splitLineIndex:c.splitLineIndex,f=s==null?c.unifiedLineIndex:s.unifiedLineIndex;o===`split`&&l!==`change`&&E(),i>0&&D({hunkIndex:n,collapsedLines:i,rangeSize:Math.max(r?.collapsedBefore??0,0),hunkSpecs:r?.hunkSpecs,isFirstHunk:n===0,isLastHunk:!1,isExpandable:!e.isPartial});let p=o===`unified`?f:u;if(o===`unified`){let t=c==null?void 0:v[c.lineIndex],r=s==null?void 0:_[s.lineIndex];if(t==null&&r==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}w(`unified`,l===`change`?s==null?`change-deletion`:`change-addition`:l,s==null?c.lineNumber:s.lineNumber,`${f},${u}`),cn({diffStyle:`unified`,type:l,deletionLine:t,additionLine:r,unifiedSpan:this.getAnnotations(`unified`,c?.lineNumber,s?.lineNumber,n,p),context:y})}else{let t=c==null?void 0:v[c.lineIndex],r=s==null?void 0:_[s.lineIndex];if(t==null&&r==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let i=(()=>{if(l===`change`){if(r==null)return`additions`;if(t==null)return`deletions`}})();if(i!=null){if(C!=null&&C!==i)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);C=i,S++}let a=this.getAnnotations(`split`,c?.lineNumber,s?.lineNumber,n,p);a!=null&&S>0&&E(),c!=null&&w(`deletions`,l===`change`?`change-deletion`:l,c.lineNumber,`${c.unifiedLineIndex},${u}`),s!=null&&w(`additions`,l===`change`?`change-addition`:l,s.lineNumber,`${s.unifiedLineIndex},${u}`),cn({diffStyle:`split`,type:l,additionLine:r,deletionLine:t,...a,context:y})}let m=c?.noEOFCR??!1,h=s?.noEOFCR??!1;if(h||m){if(m){let e=l===`context`||l===`context-expanded`?l:`change-deletion`;o===`unified`?(y.unifiedContentAST.push(Qt(e)),y.pushToGutter(`unified`,t(e,`metadata`,1))):(y.deletionsContentAST.push(Qt(e)),y.pushToGutter(`deletions`,t(e,`metadata`,1)),h||(y.pushToGutter(`additions`,t(void 0,`buffer`,1)),y.additionsContentAST.push(Zt(1))))}if(h){let e=l===`context`||l===`context-expanded`?l:`change-addition`;o===`unified`?(y.unifiedContentAST.push(Qt(e)),y.pushToGutter(`unified`,t(e,`metadata`,1))):(y.additionsContentAST.push(Qt(e)),y.pushToGutter(`additions`,t(e,`metadata`,1)),m||(y.pushToGutter(`deletions`,t(void 0,`buffer`,1)),y.deletionsContentAST.push(Zt(1))))}y.incrementRowCount(1)}a>0&&d!==`simple`&&D({hunkIndex:l===`context-expanded`?n:n+1,collapsedLines:a,rangeSize:b,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),y.incrementRowCount(1)}}),o===`split`&&E();let O=Math.max(tn(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),k=n.bufferBefore>0||n.bufferAfter>0,A=!f&&e.type!==`deleted`,j=!f&&e.type!==`new`,M=y.rowCount>0||k;p=A&&M?p:void 0,m=j&&M?m:void 0,h=f&&M?h:void 0;let N=this.createPreElement(m!=null&&p!=null,O,i,a);return{unifiedGutterAST:f&&M?y.unifiedGutterAST.children:void 0,unifiedContentAST:h,deletionsGutterAST:j&&M?y.deletionsGutterAST.children:void 0,deletionsContentAST:m,additionsGutterAST:A&&M?y.additionsGutterAST.children:void 0,additionsContentAST:p,hunkData:g,preNode:N,themeStyles:i,baseThemeType:a,headerElement:s?void 0:this.renderHeader(this.diff,i,a),totalLines:O,rowCount:y.rowCount,bufferBefore:n.bufferBefore,bufferAfter:n.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=x(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Ot(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(C({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(C({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(C({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return m(this.renderFullAST(e,t))}renderPartialHTML(e,t){return m(t==null?e:C({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}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(W(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(W(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,t,n){let{themeType:r}=this.getOptionsWithDefaults();return At({fileOrDiff:e,themeStyles:t,themeType:n??r})}};function on(e,t){return A(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType}function sn(e){return`${e} unmodified line${e>1?`s`:``}`}function cn({diffStyle:e,type:n,deletionLine:r,additionLine:i,unifiedSpan:a,deletionSpan:o,additionSpan:s,context:c}){let l=!1;if(e===`unified`){if(i==null?r!=null&&c.unifiedContentAST.push(r):c.unifiedContentAST.push(i),a!=null){let e=n===`change`?r==null?`change-addition`:`change-deletion`:n;c.unifiedContentAST.push(Dt(a)),c.pushToGutter(`unified`,t(e,`annotation`,1)),l=!0}}else if(e===`split`){if(r!=null&&c.deletionsContentAST.push(r),i!=null&&c.additionsContentAST.push(i),o!=null){let e=n===`change`?r==null?`context`:`change-deletion`:n;c.deletionsContentAST.push(Dt(o)),c.pushToGutter(`deletions`,t(e,`annotation`,1)),l=!0}if(s!=null){let e=n===`change`?i==null?`context`:`change-addition`:n;c.additionsContentAST.push(Dt(s)),c.pushToGutter(`additions`,t(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function ln(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,$({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push($({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,$({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push($({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=en(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,$({type:c.hunkSeparators,content:sn(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push($({type:c.hunkSeparators,content:sn(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function un(e){let t=e.hunks.at(-1);if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let n=e.additionLines.length-(t.additionLineIndex+t.additionCount),r=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);if(n!==r)throw Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${r}) for ${e.name}`);return Math.min(n,r)}function dn(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function fn(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function pn(e){let t=e[0];if(t!==`+`&&t!==`-`&&t!==` `&&t!==`\\`){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}let n=e.substring(1);return{line:n===``?`
1403
- `:n,type:t===` `?`context`:t===`\\`?`metadata`:t===`+`?`addition`:`deletion`}}function mn(e,t,n=!1){let r=Re.test(e),i=e.split(r?Re:ke),a,o=[];for(let e of i){if(r&&!Re.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!ke.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=hn(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function hn(t,{cacheKey:n,isGitDiff:r=Re.test(t),oldFile:i,newFile:a,throwOnError:o=!1}={}){let s=0,c=t.split(le),l,u=i==null||a==null,d=0,f=0;for(let t of c){let c=t.split(z),m=c.shift();if(m==null){if(o)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,t);continue}let g=m.match(Pe),_=0,v=0;if(g==null||l==null){if(l!=null){if(o)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,t);continue}l={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:u,additionLines:!u&&i!=null&&a!=null?a.contents.split(z):[],deletionLines:!u&&i!=null&&a!=null?i.contents.split(z):[],cacheKey:n},l.additionLines.length===1&&a?.contents===``&&(l.additionLines.length=0),l.deletionLines.length===1&&i?.contents===``&&(l.deletionLines.length=0),c.unshift(m);for(let t of c){let n=t.match(r?e:k);if(t.startsWith(`diff --git`)){let[,,e,,n]=t.trim().match(p)??[];l.name=n.trim(),e!==n&&(l.prevName=e.trim())}else if(n!=null){let[,e,t]=n;e===`---`&&t!==`/dev/null`?(l.prevName=t.trim(),l.name=t.trim()):e===`+++`&&t!==`/dev/null`&&(l.name=t.trim())}else if(r){if(t.startsWith(`new mode `)&&(l.mode=t.replace(`new mode`,``).trim()),t.startsWith(`old mode `)&&(l.prevMode=t.replace(`old mode`,``).trim()),t.startsWith(`new file mode`)&&(l.type=`new`,l.mode=t.replace(`new file mode`,``).trim()),t.startsWith(`deleted file mode`)&&(l.type=`deleted`,l.mode=t.replace(`deleted file mode`,``).trim()),t.startsWith(`similarity index`)&&(t.startsWith(`similarity index 100%`)?l.type=`rename-pure`:l.type=`rename-changed`),t.startsWith(`index `)){let[,e,n,r]=t.trim().match(_e)??[];e!=null&&(l.prevObjectId=e),n!=null&&(l.newObjectId=n),r!=null&&(l.mode=r)}t.startsWith(`rename from `)&&(l.prevName=t.replace(`rename from `,``)),t.startsWith(`rename to `)&&(l.name=t.replace(`rename to `,``).trim())}}continue}let y,b;for(;c.length>0&&(c[c.length-1]===`
1404
- `||c[c.length-1]===`\r`||c[c.length-1]===`\r
1405
- `||c[c.length-1]===``);)c.pop();let x=parseInt(g[3]),S=parseInt(g[1]);d=u?d:S-1,f=u?f:x-1;let C={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(g[4]??`1`),additionStart:x,additionLines:_,deletionCount:parseInt(g[2]??`1`),deletionStart:S,deletionLines:v,deletionLineIndex:d,additionLineIndex:f,hunkContent:[],hunkContext:g[5],hunkSpecs:m,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(C.additionCount)||isNaN(C.deletionCount)||isNaN(C.additionStart)||isNaN(C.deletionStart)){if(o)throw Error(`parsePatchContent: invalid hunk metadata`);console.error(`parsePatchContent: invalid hunk metadata`,C);continue}for(let e of c){let t=pn(e);if(t==null){console.error(`processFile: invalid rawLine:`,e);continue}let{type:n,line:r}=t;if(n===`addition`)(y==null||y.type!==`change`)&&(y=_n(`change`,d,f),C.hunkContent.push(y)),f++,u&&l.additionLines.push(r),y.additions++,_++,b=`addition`;else if(n===`deletion`)(y==null||y.type!==`change`)&&(y=_n(`change`,d,f),C.hunkContent.push(y)),d++,u&&l.deletionLines.push(r),y.deletions++,v++,b=`deletion`;else if(n===`context`)(y==null||y.type!==`context`)&&(y=_n(`context`,d,f),C.hunkContent.push(y)),f++,d++,u&&(l.deletionLines.push(r),l.additionLines.push(r)),y.lines++,b=`context`;else if(n===`metadata`&&y!=null){if(y.type===`context`?(C.noEOFCRAdditions=!0,C.noEOFCRDeletions=!0):b===`deletion`?C.noEOFCRDeletions=!0:b===`addition`&&(C.noEOFCRAdditions=!0),u&&(b===`addition`||b===`context`)){let e=l.additionLines.length-1;e>=0&&(l.additionLines[e]=h(l.additionLines[e]))}if(u&&(b===`deletion`||b===`context`)){let e=l.deletionLines.length-1;e>=0&&(l.deletionLines[e]=h(l.deletionLines[e]))}}}C.additionLines=_,C.deletionLines=v,C.collapsedBefore=Math.max(C.additionStart-1-s,0),l.hunks.push(C),s=C.additionStart+C.additionCount-1;for(let e of C.hunkContent)e.type===`context`?(C.splitLineCount+=e.lines,C.unifiedLineCount+=e.lines):(C.splitLineCount+=Math.max(e.additions,e.deletions),C.unifiedLineCount+=e.deletions+e.additions);C.splitLineStart=l.splitLineCount+C.collapsedBefore,C.unifiedLineStart=l.unifiedLineCount+C.collapsedBefore,l.splitLineCount+=C.collapsedBefore+C.splitLineCount,l.unifiedLineCount+=C.collapsedBefore+C.unifiedLineCount}if(l!=null){if(l.hunks.length>0&&!u&&l.additionLines.length>0&&l.deletionLines.length>0){let e=l.hunks[l.hunks.length-1],t=e.additionStart+e.additionCount-1,n=l.additionLines.length,r=Math.max(n-t,0);l.splitLineCount+=r,l.unifiedLineCount+=r}return r||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type=`rename-changed`:l.type=`rename-pure`:a!=null&&a.contents===``?l.type=`deleted`:i!=null&&i.contents===``&&(l.type=`new`)),l.type!==`rename-pure`&&l.type!==`rename-changed`&&(l.prevName=void 0),l}}function gn(e,t,n=!1){let r=[];for(let i of e.split(v))try{r.push(mn(i,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function _n(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function vn(e,t,n,r=!1){let i=hn(s(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return i}var yn=-1,bn=class{static LoadedCustomComponent=!0;__id=`file-diff:${++yn}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:L},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=new an({...e,hunkSeparators:typeof e.hunkSeparators==`function`?`custom`:e.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new Ct,this.scrollSyncManager=new Xt,this.mouseEventManager=new yt(`diff`,bt(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0)),this.lineSelectionManager=new ht(gt(e,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof e.hunkSeparators==`function`?`custom`:e.hunkSeparators}),this.mouseEventManager.setOptions(bt(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(gt(e,this.getLineIndex)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.hunksRenderer.setThemeType(e),this.headerElement!=null&&(e===`system`?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=e),this.pre!=null))switch(e){case`system`:delete this.pre.dataset.themeType;break;case`light`:case`dark`:this.pre.dataset.themeType=e;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=``),this.fileContainer=void 0,this.pre!=null&&(this.pre.innerHTML=``,this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=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.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{overflow:t=`scroll`,diffStyle:n=`split`}=this.options,{fileContainer:r,prerenderedHTML:i}=e;Gt(r,i);for(let e of r.shadowRoot?.children??[]){if(e instanceof SVGElement){this.spriteSVG=e;continue}if(e instanceof HTMLElement){if(e instanceof HTMLPreElement){this.pre=e;for(let t of e.children)!(t instanceof HTMLElement)||t.tagName.toLowerCase()!==`code`||(`deletions`in t.dataset&&(this.codeDeletions=t),`additions`in t.dataset&&(this.codeAdditions=t),`unified`in t.dataset&&(this.codeUnified=t));continue}if(`diffsHeader`in e.dataset){this.headerElement=e;continue}if(e instanceof HTMLStyleElement&&e.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=e;continue}}}if(this.pre!=null&&this.syncCodeNodesFromPre(this.pre),this.pre==null)this.render(e);else{let{lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.fileContainer=r,delete this.pre.dataset.dehydrated,this.lineAnnotations=i??this.lineAnnotations,this.additionFile=o,this.deletionFile=a,this.fileDiff=s??(a!=null&&o!=null?vn(a,o):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),this.resizeManager.setup(this.pre,t===`wrap`),t===`scroll`&&n===`split`&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions)}}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({oldFile:this.deletionFile,newFile:this.additionFile,fileDiff:this.fileDiff,forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t)=>{this.expandHunk(e,t)};expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.rerender()}render({oldFile:e,newFile:t,fileDiff:n,forceRender:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let c=e!=null&&t!=null&&(!be(e,this.deletionFile)||!be(t,this.additionFile)),l=n!=null&&n!==this.fileDiff,u=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(wt(s,this.renderRange)&&!r&&!u&&(n!=null&&n===this.fileDiff||n==null&&!c))return!1;let{renderRange:d}=this;if(this.renderRange=s,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&c&&(l=!0,this.fileDiff=vn(e,t)):this.fileDiff=n,i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators==`function`?`custom`:this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{diffStyle:f=`split`,disableErrorHandling:p=!1,disableFileHeader:m=!1,overflow:h=`scroll`}=this.options;m&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),a=this.getOrCreateFileContainer(a,o);try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(r,u,c||l)&&this.applyPartialRender({previousRenderRange:d,renderRange:s}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,s);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;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.parentNode?.removeChild(this.pre),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,s),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderHoverUtility(),this.mouseEventManager.setup(e),this.lineSelectionManager.setup(e),this.resizeManager.setup(e,h===`wrap`),h===`scroll`&&f===`split`?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(p)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return!0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(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}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.mouseEventManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.hoverContent?.remove(),this.pre?.remove(),this.spriteSVG?.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.hoverContent=void 0,this.pre=void 0,this.spriteSVG=void 0,this.unsafeCSSStyle=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}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.parentNode?.removeChild(e);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||!fn(r,i.hunkData)){i?.element.parentNode?.removeChild(i.element);let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName,n.appendChild(t(r,this)),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.parentNode?.removeChild(t)}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.parentNode?.removeChild(e);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}-${W(r)}`,a=this.annotationCache.get(i);if(a==null||!dn(r,a.annotation)){a?.element.parentElement?.removeChild(a.element);let e=t(r);if(e==null)continue;a={element:Rt(W(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.parentNode?.removeChild(n)}renderHoverUtility(){let{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;let t=e(this.mouseEventManager.getHoveredLine);if(!(t!=null&&this.hoverContent!=null)){if(t==null){this.hoverContent?.parentNode?.removeChild(this.hoverContent),this.hoverContent=void 0;return}this.hoverContent=zt(),this.hoverContent.appendChild(t),this.fileContainer.appendChild(this.hoverContent)}}getOrCreateFileContainer(e,t){let n=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(`diffs-container`),n!=null&&n!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=It;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}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&&(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&&(`unified`in t.dataset?this.codeUnified=t:`deletions`in t.dataset?this.codeDeletions=t:`additions`in t.dataset&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let n=m(e);if(n!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=n;let r=e.firstElementChild;if(!(r instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(r):t.shadowRoot?.replaceChild(r,this.headerElement),this.headerElement=r,this.lastRenderedHeaderHTML=n}if(this.isContainerManaged)return;let{renderHeaderMetadata:r}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);let i=r?.({deletionFile:this.deletionFile,additionFile:this.additionFile,fileDiff:this.fileDiff})??void 0;i!=null&&(this.headerMetadata=document.createElement(`div`),this.headerMetadata.slot=De,i instanceof Element?this.headerMetadata.appendChild(i):this.headerMetadata.innerText=`${i}`,t.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;let{unsafeCSS:e}=this.options;e==null||e===``||(this.unsafeCSSStyle??(this.unsafeCSSStyle=Bt(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Ut(e))}applyHunksToDOM(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);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=Wt({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),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=Wt({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),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=Wt({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),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(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`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`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=xn(t[0]),i=xn(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}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)`)}getCodeColumns(e,t,n,r){function i(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}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||t==null){this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),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.parentNode?.removeChild(this.bufferBefore),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.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{themeStyles:t,baseThemeType:n,additionsContentAST:r,deletionsContentAST:i,totalLines:a}){let{diffIndicators:o=`bars`,disableBackground:s=!1,disableLineNumbers:c=!1,overflow:l=`scroll`,themeType:u=`system`,diffStyle:d=`split`}=this.options,f={type:`diff`,diffIndicators:o,disableBackground:s,disableLineNumbers:c,overflow:l,split:d===`unified`?!1:r!=null&&i!=null,themeStyles:t,themeType:n??u,totalLines:a};Lt(f,this.appliedPreAttributes)||(Kt(e,f),this.appliedPreAttributes=f)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML=``,n.parentNode?.removeChild(n),this.pre=void 0,this.appliedPreAttributes=void 0;let r=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.innerHTML=``,r.appendChild(this.errorWrapper);let i=document.createElement(`div`);i.dataset.errorMessage=``,i.innerText=e.message,this.errorWrapper.appendChild(i);let a=document.createElement(`pre`);a.dataset.errorStack=``,a.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};function xn(e){if(!(e==null||e.type!==`element`))return e.children??[]}function Sn(e,t){let n={...ne,...t};return n.hunkSeparatorHeight=Cn(e,t?.hunkSeparatorHeight),n}function Cn(e,t){if(t!=null)return t;switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var wn=-1,Tn=class extends bn{__id=`little-virtualized-file-diff:${++wn}`;top;height=0;metrics;heightCache=new Map;isVisible=!1;virtualizer;constructor(e,t,n,r,i=!1){super(e,r,i);let{hunkSeparators:a=`line-info`}=this.options;this.virtualizer=t,this.metrics=Sn(typeof a==`function`?`custom`:a,n)}getLineHeight(e,t=!1){let n=this.heightCache.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(e==null)return;let t=this.options.diffStyle,n=this.options.overflow;super.setOptions(e),(t!==this.options.diffStyle||n!==this.options.overflow)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){let{overflow:e=`scroll`}=this.options;if(this.fileContainer!=null&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.fileContainer==null||this.fileDiff==null){this.height=0;return}if(e===`scroll`&&this.lineAnnotations.length===0&&!this.virtualizer.config.resizeDebugging)return;let t=this.getDiffStyle(),n=!1,r=t===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];for(let e of r){if(e==null)continue;let r=e.children[1];if(r instanceof HTMLElement)for(let e of r.children){if(!(e instanceof HTMLElement))continue;let r=e.dataset.lineIndex;if(r==null)continue;let i=Dn(r,t),a=e.getBoundingClientRect().height,o=!1;e.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in e.nextElementSibling.dataset||`noNewline`in e.nextElementSibling.dataset)&&(`noNewline`in e.nextElementSibling.dataset&&(o=!0),a+=e.nextElementSibling.getBoundingClientRect().height);let s=this.getLineHeight(i,o);a!==s&&(n=!0,a===this.metrics.lineHeight*(o?2:1)?this.heightCache.delete(i):this.heightCache.set(i,a))}}(n||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)}setVisibility(e){this.fileContainer!=null&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){let e=this.height===0;if(this.height=0,this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1,hunkSeparators:i=`line-info`}=this.options,{diffHeaderHeight:a,fileGap:o,hunkSeparatorHeight:s}=this.metrics,c=this.getDiffStyle(),l=i!==`simple`&&i!==`metadata`&&i!==`line-info-basic`?o:0;if(t?i!==`simple`&&i!==`metadata`&&(this.height+=o):this.height+=a,T({diff:this.fileDiff,diffStyle:c,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:r,additionLine:a})=>{let o=a==null?r.splitLineIndex:a.splitLineIndex,u=a==null?r.unifiedLineIndex:a.unifiedLineIndex,d=(a?.noEOFCR??!1)||(r?.noEOFCR??!1);t>0&&(e>0&&(this.height+=l),this.height+=s+l),this.height+=this.getLineHeight(c===`split`?o:u,d),n>0&&i!==`simple`&&(this.height+=l+s)}}),this.fileDiff.hunks.length>0&&(this.height+=o),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!e){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height})}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...i}={}){let a=this.fileContainer==null;if(this.fileDiff??=r??(t!=null&&n!=null?vn(t,n):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(a?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top,o);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:s,oldFile:t,newFile:n,...i})}getDiffStyle(){return this.options.diffStyle??`split`}getExpandedRegion(e,t,n){if(n<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(n,0),renderAll:!1};let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;if(r||n<=i)return{fromStart:n,fromEnd:0,collapsedLines:0,renderAll:!0};let a=this.hunksRenderer.getExpandedHunk(t),o=Math.min(Math.max(a.fromStart,0),n),s=Math.min(Math.max(a.fromEnd,0),n),c=o+s,l=c>=n;return{fromStart:o,fromEnd:s,collapsedLines:Math.max(n-c,0),renderAll:l}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}for(let[r,i]of e.hunks.entries()){let a=t===`split`?i.splitLineCount:i.unifiedLineCount;n+=a;let o=Math.max(i.collapsedBefore,0),{fromStart:s,fromEnd:c,renderAll:l}=this.getExpandedRegion(e.isPartial,r,o);o>0&&(n+=l?o:s+c)}let r=e.hunks.at(-1);if(r!=null&&En(e)){let t=e.additionLines.length-(r.additionLineIndex+r.additionCount),i=e.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(r!=null&&t!==i)throw Error(`VirtualizedFileDiff: trailing context mismatch (additions=${t}, deletions=${i}) for ${e.name}`);let a=Math.min(t,i);if(r!=null&&a>0){let{fromStart:t,renderAll:r}=this.getExpandedRegion(e.isPartial,e.hunks.length,a);n+=r?a:t}}return n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1,hunkSeparators:s=`line-info`}=this.options,{diffHeaderHeight:c,fileGap:l,hunkLineCount:u,hunkSeparatorHeight:d,lineHeight:f}=this.metrics,p=this.getDiffStyle(),m=this.height,h=this.getExpandedLineCount(e,p),g=i?l:c;if(t<n-m||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-l};if(h<=u||e.hunks.length===0)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};let _=Math.ceil(Math.max(r-n,0)/f),v=Math.ceil(_/u)*u+u,y=v/u,b=y,x=[],S=(n+r)/2,C=s===`simple`||s===`metadata`||s===`line-info-basic`?0:l,w=t+g,E=0,D,O,k;if(T({diff:e,diffStyle:p,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,collapsedBefore:i,collapsedAfter:a,deletionLine:o,additionLine:c})=>{let l=c==null?o.splitLineIndex:c.splitLineIndex,f=c==null?o.unifiedLineIndex:c.unifiedLineIndex,m=(c?.noEOFCR??!1)||(o?.noEOFCR??!1),h=i>0?d+C+(e>0?C:0):0;e===0&&s===`simple`&&(h=0),w+=h;let _=E%u===0;if(_&&(x.push(w-(t+g+h)),k!=null)){if(k<=0)return!0;k--}let v=this.getLineHeight(p===`split`?l:f,m),y=Math.floor(E/u);return w>n-v&&w<r&&(D??=y),O==null&&w+v>S&&(O=y),k==null&&w>=r&&_&&(k=b),E++,w+=v,a>0&&s!==`simple`&&(w+=d+C),!1}}),D==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-l};let A=x.length;O??=D;let j=Math.round(O-y/2),M=Math.max(0,A-y),N=Math.max(0,Math.min(j,M)),ee=N*u,P=j<0?v+j*u:v,te=x[N]??0,F=N+P/u;return{startingLine:ee,totalLines:P,bufferBefore:te,bufferAfter:F<x.length?m-g-x[F]-l:m-(w-t)-l}}};function En(e){let t=e.hunks.at(-1);return t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0?!1:t.additionLineIndex+t.additionCount<e.additionLines.length||t.deletionLineIndex+t.deletionCount<e.deletionLines.length}function Dn(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}var On=typeof window>`u`?Z.useEffect:Z.useLayoutEffect;function kn({oldFile:e,newFile:t,fileDiff:n,options:r,lineAnnotations:i,selectedLines:a,prerenderedHTML:o,metrics:s}){let c=ft(),l=(0,Z.useContext)(ee),u=(0,Z.useRef)(null),d=pt(a=>{if(a!=null){if(u.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);c==null?u.current=new bn(r,l,!0):u.current=new Tn(r,c,s,l,!0),u.current.hydrate({fileDiff:n,oldFile:e,newFile:t,fileContainer:a,lineAnnotations:i,prerenderedHTML:o})}else{if(u.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);u.current.cleanUp(),u.current=null}});return On(()=>{if(u.current==null)return;let o=u.current,s=!Jt(o.options,r);o.setOptions(r),o.render({forceRender:s,fileDiff:n,oldFile:e,newFile:t,lineAnnotations:i}),a!==void 0&&o.setSelectedLines(a)}),{ref:d,getHoveredLine:(0,Z.useCallback)(()=>u.current?.getHoveredLine(),[])}}function An({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:c,renderHeaderMetadata:l,renderHoverUtility:u}){let{ref:d,getHoveredLine:f}=kn({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s});return(0,G.jsx)(R,{ref:d,className:a,style:o,children:Qe(Yt({fileDiff:e,renderHeaderMetadata:l,renderAnnotation:c,lineAnnotations:r,renderHoverUtility:u,getHoveredLine:f}),s)})}var jn=2166136261,Mn=16777619,Nn=2654435769,Pn=2246822507;function Fn(e,t,n){let r=t>>>0;for(let t=0;t<e.length;t+=1)r^=e.charCodeAt(t),r=Math.imul(r,n)>>>0;return r>>>0}function In(e,t=`diff-panel`){let n=e.trim(),r=Fn(n,jn,Mn).toString(36),i=Fn(n,Nn,Pn).toString(36);return`${t}:${n.length}:${r}:${i}`}function Ln(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Rn=[];function zn(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:s,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:f=!1,disabledIndices:p,modifierKeys:m=Rn}=e,[h,g]=Z.useState(0),_=n>1,v=Z.useRef(null),y=E(v,u),b=Z.useRef([]),x=Z.useRef(!1),S=c??h,C=o((e,t=!1)=>{if((l??g)(e),t){let t=b.current[e];We(v.current,t,s,a)}}),w=o(e=>{if(e.size===0||x.current)return;x.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&C(r),We(v.current,n,s,a)}),T=Z.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:y,onFocus(e){!v.current||!B(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let o=d?oe:ze;if(!o.has(e.key)||Bn(e,m)||!v.current)return;let c=s===`rtl`,l=c?H:ue,u={horizontal:l,vertical:Se,both:l}[a],h=c?ue:H,g={horizontal:h,vertical:Ae,both:h}[a];if(B(e.target)&&!Ln(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==g&&t<r.length||e.key!==u&&t>0)return}let y=S,x=V(b,p),w=qe(b,p);if(_){let o=t||Array.from({length:b.current.length},()=>({width:1,height:1})),s=Te(o,n,i),l=s.findIndex(e=>e!=null&&!N(b,e,p)),u=s.reduce((e,t,n)=>t!=null&&!N(b,t,p)?n:e,-1);y=s[He({current:s.map(e=>e?b.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:ie([...p||b.current.map((e,t)=>N(b,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:pe(S>w?x:S,o,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[Se],both:[l,Se]}[a],E={horizontal:[h],vertical:[Ae],both:[h,Ae]}[a],D=_?o:{horizontal:d?fe:me,vertical:d?Ke:Ve,both:o}[a];d&&(e.key===`Home`?y=x:e.key===`End`&&(y=w)),y===S&&(T.includes(e.key)||E.includes(e.key))&&(y=r&&y===w&&T.includes(e.key)?x:r&&y===x&&E.includes(e.key)?w:he(b,{startingIndex:y,decrement:E.includes(e.key),disabledIndices:p})),y!==S&&!Ge(b,y)&&(f&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),C(y,!0),queueMicrotask(()=>{b.current[y]?.focus()}))}}),[n,i,s,p,b,d,S,_,t,r,y,m,C,a,f]);return Z.useMemo(()=>({props:T,highlightedIndex:S,onHighlightedIndexChange:C,elementsRef:b,disabledIndices:p,onMapChange:w,relayKeyboardEvent:T.onKeyDown}),[T,S,C,b,p,w])}function Bn(e,t){for(let n of re.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Vn(e){let{render:t,className:n,refs:r=u,props:i=u,state:a=c,stateAttributesMapping:o,highlightedIndex:s,onHighlightedIndexChange:l,orientation:d,dense:f,itemSizes:p,loopFocus:m,cols:h,enableHomeAndEndKeys:g,onMapChange:_,stopEventPropagation:v=!0,rootRef:y,disabledIndices:b,modifierKeys:x,highlightItemOnHover:S=!1,tag:C=`div`,...w}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=zn({itemSizes:p,cols:h,loopFocus:m,dense:f,orientation:d,highlightedIndex:s,onHighlightedIndexChange:l,rootRef:y,stopEventPropagation:v,enableHomeAndEndKeys:g,direction:de(),disabledIndices:b,modifierKeys:x}),j=P(C,e,{state:a,ref:r,props:[T,...i,w],stateAttributesMapping:o}),M=Z.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:S,relayKeyboardEvent:A}),[E,D,S,A]);return(0,G.jsx)(je.Provider,{value:M,children:(0,G.jsx)(ge,{elementsRef:O,onMapChange:e=>{_?.(e),k(e)},children:j})})}let Hn=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({});var Un={multiple(e){return e?{[Hn.multiple]:``}:null}};const Wn=Z.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:s=`horizontal`,multiple:c=!1,value:l,className:u,render:d,...f}=e,p=Ne(!0),m=Z.useMemo(()=>{if(l===void 0)return n??[]},[l,n]),h=Z.useMemo(()=>l!==void 0||n!==void 0,[l,n]),g=(p?.disabled??!1)||r,[_,v]=M({controlled:l,default:m,name:`ToggleGroup`,state:`value`}),y=o((e,t,n)=>{let r;if(c?(r=_.slice(),t?r.push(e):r.splice(_.indexOf(e),1)):r=t?[e]:[],Array.isArray(r)){if(a?.(r,n),n.isCanceled)return;v(r)}}),b={disabled:g,multiple:c,orientation:s},x=Z.useMemo(()=>({disabled:g,orientation:s,setGroupValue:y,value:_,isValueInitialized:h}),[g,s,y,_,h]),S={role:`group`},C=P(`div`,e,{enabled:!!p,state:b,ref:t,props:[S,f],stateAttributesMapping:Un});return(0,G.jsx)(Ee.Provider,{value:x,children:p?C:(0,G.jsx)(Vn,{render:d,className:u,state:b,refs:[t],props:[S,f],stateAttributesMapping:Un,loopFocus:i,enableHomeAndEndKeys:!0})})});var Gn=S(),Kn=Z.createContext({size:`default`,variant:`default`});function qn(e){let t=(0,Gn.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,variant:a,size:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`default`:a,l=o===void 0?`default`:o,u=s===void 0?`horizontal`:s,d=u===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,f=c===`default`?`gap-0.5`:u===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,p;t[7]!==r||t[8]!==d||t[9]!==f?(p=U(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,d,f,r),t[7]=r,t[8]=d,t[9]=f,t[10]=p):p=t[10];let m,h;t[11]!==l||t[12]!==c?(h={size:l,variant:c},t[11]=l,t[12]=c,t[13]=h):h=t[13],m=h;let g;t[14]!==n||t[15]!==m?(g=(0,G.jsx)(Kn.Provider,{value:m,children:n}),t[14]=n,t[15]=m,t[16]=g):g=t[16];let _;return t[17]!==u||t[18]!==i||t[19]!==l||t[20]!==p||t[21]!==g||t[22]!==c?(_=(0,G.jsx)(Wn,{className:p,"data-size":l,"data-slot":`toggle-group`,"data-variant":c,orientation:u,...i,children:g}),t[17]=u,t[18]=i,t[19]=l,t[20]=p,t[21]=g,t[22]=c,t[23]=_):_=t[23],_}function Jn(e){let t=(0,Gn.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=Z.useContext(Kn),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,G.jsx)(Le,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}function Yn(e){return e===`dark`?`pierre-dark`:`pierre-light`}function Xn(e,t=`diff-panel`){if(!e)return null;let n=e.trim();if(n.length===0)return null;try{let e=gn(n,In(n,t)).flatMap(e=>e.files);return e.length>0?{kind:`files`,files:e}:{kind:`raw`,text:n,reason:`Unsupported diff format. Showing raw patch.`}}catch{return{kind:`raw`,text:n,reason:`Failed to parse patch. Showing raw patch.`}}}function Zn(e){let t=e.name??e.prevName??``;return t.startsWith(`a/`)||t.startsWith(`b/`)?t.slice(2):t}function Qn(e){return e.cacheKey??`${e.prevName??`none`}:${e.name}`}function $n(e){return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(e))}function er({mode:e=`inline`}){let t=w(),{resolvedTheme:r}=Ue(),{state:i}=n(),[a,o]=(0,Z.useState)(`stacked`),s=(0,Z.useRef)(null),c=(0,Z.useRef)(null),[l,u]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(!1),m=f({strict:!1,select:e=>e.threadId?ye.makeUnsafe(e.threadId):null}),h=O({strict:!1,select:e=>Oe(e)}),_=m,v=i.threads.find(e=>e.id===_),{turnDiffSummaries:y,inferredCheckpointTurnCountByTurnId:b}=ae(v),x=(0,Z.useMemo)(()=>[...y].toSorted((e,t)=>{let n=e.checkpointTurnCount??b[e.turnId]??0,r=t.checkpointTurnCount??b[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[b,y]),S=h.diffTurnId??null,C=S===null?null:h.diffFilePath??null,T=S===null?void 0:x.find(e=>e.turnId===S)??x[0],E=T&&(T.checkpointTurnCount??b[T.turnId]),D=(0,Z.useMemo)(()=>typeof E==`number`?{fromTurnCount:Math.max(0,E-1),toTurnCount:E}:null,[E]),k=(0,Z.useMemo)(()=>{let e=x.map(e=>e.checkpointTurnCount??b[e.turnId]).filter(e=>typeof e==`number`);if(e.length===0)return;let t=Math.max(...e);return t>0?t:void 0},[b,x]),A=(0,Z.useMemo)(()=>!T&&typeof k==`number`?{fromTurnCount:0,toTurnCount:k}:null,[k,T]),j=T?D:A,M=(0,Z.useMemo)(()=>T||x.length===0?null:`conversation:${x.map(e=>e.turnId).join(`,`)}`,[x,T]),N=g(se({threadId:_,fromTurnCount:j?.fromTurnCount??null,toTurnCount:j?.toTurnCount??null,cacheScope:T?`turn:${T.turnId}`:M})),ee=T?N.data?.diff:void 0,P=T?void 0:N.data?.diff,te=N.isLoading,F=N.error instanceof Error?N.error.message:N.error?`Failed to load checkpoint diff.`:null,I=T?ee:P,ne=typeof I==`string`&&I.trim().length===0,L=(0,Z.useMemo)(()=>Xn(I,`diff-panel:${r}`),[r,I]),R=(0,Z.useMemo)(()=>!L||L.kind!==`files`?[]:L.files.toSorted((e,t)=>Zn(e).localeCompare(Zn(t),void 0,{numeric:!0,sensitivity:`base`})),[L]);(0,Z.useEffect)(()=>{!C||!s.current||Array.from(s.current.querySelectorAll(`[data-diff-file-path]`)).find(e=>e.dataset.diffFilePath===C)?.scrollIntoView({block:`nearest`})},[C,R]);let re=e=>{v&&t({to:`/$threadId`,params:{threadId:v.id},search:t=>({...Fe(t),diff:`1`,diffTurnId:e})})},ie=()=>{v&&t({to:`/$threadId`,params:{threadId:v.id},search:e=>({...Fe(e),diff:`1`})})},z=(0,Z.useCallback)(()=>{let e=c.current;if(!e){u(!1),p(!1);return}let t=Math.max(0,e.scrollWidth-e.clientWidth);u(e.scrollLeft>4),p(e.scrollLeft<t-4)},[]),B=(0,Z.useCallback)(e=>{let t=c.current;t&&t.scrollBy({left:e,behavior:`smooth`})},[]),V=(0,Z.useCallback)(e=>{let t=c.current;t&&(t.scrollWidth<=t.clientWidth+1||Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),t.scrollBy({left:e.deltaY,behavior:`auto`})))},[]);(0,Z.useEffect)(()=>{let e=c.current;if(!e)return;z();let t=()=>z();e.addEventListener(`scroll`,t,{passive:!0}),e.addEventListener(`wheel`,V,{passive:!1});let n=new ResizeObserver(()=>z());return n.observe(e),()=>{e.removeEventListener(`scroll`,t),e.removeEventListener(`wheel`,V),n.disconnect()}},[z,V]),(0,Z.useEffect)(()=>{z()},[x,S,z]),(0,Z.useEffect)(()=>{let e=c.current;e&&e.querySelector(`[data-turn-chip-selected='true']`)?.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})},[T?.turnId,S]);let oe=xe&&e!==`sheet`,H=(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`relative min-w-0 flex-1 [-webkit-app-region:no-drag]`,children:[l&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-8 z-10 w-7 bg-linear-to-r from-card to-transparent`}),d&&(0,G.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 right-8 z-10 w-7 bg-linear-to-l from-card to-transparent`}),(0,G.jsx)(`button`,{type:`button`,className:U(`absolute left-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,l?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>B(-180),disabled:!l,"aria-label":`Scroll turn list left`,children:(0,G.jsx)(Be,{className:`size-3.5`})}),(0,G.jsx)(`button`,{type:`button`,className:U(`absolute right-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,d?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>B(180),disabled:!d,"aria-label":`Scroll turn list right`,children:(0,G.jsx)(Ce,{className:`size-3.5`})}),(0,G.jsxs)(`div`,{ref:c,className:`turn-chip-strip flex gap-1 overflow-x-auto px-8 py-0.5`,children:[(0,G.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:ie,"data-turn-chip-selected":S===null,children:(0,G.jsx)(`div`,{className:U(`rounded-md border px-2 py-1 text-left transition-colors`,S===null?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,G.jsx)(`div`,{className:`text-[10px] leading-tight font-medium`,children:`All turns`})})}),x.map(e=>(0,G.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:()=>re(e.turnId),title:e.turnId,"data-turn-chip-selected":e.turnId===T?.turnId,children:(0,G.jsx)(`div`,{className:U(`rounded-md border px-2 py-1 text-left transition-colors`,e.turnId===T?.turnId?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsxs)(`span`,{className:`text-[10px] leading-tight font-medium`,children:[`Turn`,` `,e.checkpointTurnCount??b[e.turnId]??`?`]}),(0,G.jsx)(`span`,{className:`text-[9px] leading-tight opacity-70`,children:$n(e.completedAt)})]})})},e.turnId))]})]}),(0,G.jsxs)(qn,{className:`shrink-0 [-webkit-app-region:no-drag]`,variant:`outline`,size:`xs`,value:[a],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&o(t)},children:[(0,G.jsx)(Jn,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,G.jsx)(Xe,{className:`size-3`})}),(0,G.jsx)(Jn,{"aria-label":`Split diff view`,value:`split`,children:(0,G.jsx)(Ye,{className:`size-3`})})]})]}),ce=U(`flex items-center justify-between gap-2 px-4`,oe?`drag-region h-[52px] border-b border-border`:`h-12`);return(0,G.jsxs)(`div`,{className:U(`flex h-full min-w-0 flex-col bg-card`,e===`inline`?`w-[42vw] min-w-[360px] max-w-[560px] shrink-0 border-l border-border`:`w-full`),children:[oe?(0,G.jsx)(`div`,{className:ce,children:H}):(0,G.jsx)(`div`,{className:`border-b border-border`,children:(0,G.jsx)(`div`,{className:ce,children:H})}),v?x.length===0?(0,G.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):(0,G.jsx)(G.Fragment,{children:(0,G.jsxs)(`div`,{ref:s,className:`min-h-0 min-w-0 flex-1 overflow-hidden`,children:[F&&!L&&(0,G.jsx)(`div`,{className:`px-3`,children:(0,G.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:F})}),L?L.kind===`files`?(0,G.jsx)(dt,{className:`h-full min-h-0 overflow-auto px-3 py-2`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:R.map(e=>{let t=Zn(e),n=`${Qn(e)}:${r}`;return(0,G.jsx)(`div`,{"data-diff-file-path":t,className:`rounded-md`,children:(0,G.jsx)(An,{fileDiff:e,options:{diffStyle:a===`split`?`split`:`unified`,lineDiffType:`none`,theme:Yn(r),themeType:r}})},n)})}):(0,G.jsx)(`div`,{className:`h-full overflow-auto px-3 py-2`,children:(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:L.reason}),(0,G.jsx)(`pre`,{className:`max-h-[72vh] overflow-auto rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,children:L.text})]})}):(0,G.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,G.jsx)(`p`,{children:te?`Loading checkpoint diff...`:ne?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,G.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})]})}export{a as DiffWorkerPoolProvider,er as default};