qraftbox 0.0.1

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 (603) hide show
  1. package/bin/qraftbox.js +2 -0
  2. package/dist/client/assets/abap-BdImnpbu.js +1 -0
  3. package/dist/client/assets/actionscript-3-CoDkCxhg.js +1 -0
  4. package/dist/client/assets/ada-bCR0ucgS.js +1 -0
  5. package/dist/client/assets/andromeeda-C4gqWexZ.js +1 -0
  6. package/dist/client/assets/angular-html-CU67Zn6k.js +1 -0
  7. package/dist/client/assets/angular-ts-BwZT4LLn.js +1 -0
  8. package/dist/client/assets/apache-Pmp26Uib.js +1 -0
  9. package/dist/client/assets/apex-D8_7TLub.js +1 -0
  10. package/dist/client/assets/apl-dKokRX4l.js +1 -0
  11. package/dist/client/assets/applescript-Co6uUVPk.js +1 -0
  12. package/dist/client/assets/ara-BRHolxvo.js +1 -0
  13. package/dist/client/assets/asciidoc-Dv7Oe6Be.js +1 -0
  14. package/dist/client/assets/asm-D_Q5rh1f.js +1 -0
  15. package/dist/client/assets/astro-CbQHKStN.js +1 -0
  16. package/dist/client/assets/aurora-x-D-2ljcwZ.js +1 -0
  17. package/dist/client/assets/awk-DMzUqQB5.js +1 -0
  18. package/dist/client/assets/ayu-dark-CMjwMIkn.js +1 -0
  19. package/dist/client/assets/ayu-light-C47S-Tmv.js +1 -0
  20. package/dist/client/assets/ayu-mirage-CjoLj4QM.js +1 -0
  21. package/dist/client/assets/ballerina-BFfxhgS-.js +1 -0
  22. package/dist/client/assets/bat-BkioyH1T.js +1 -0
  23. package/dist/client/assets/beancount-k_qm7-4y.js +1 -0
  24. package/dist/client/assets/berry-uYugtg8r.js +1 -0
  25. package/dist/client/assets/bibtex-CHM0blh-.js +1 -0
  26. package/dist/client/assets/bicep-Bmn6On1c.js +1 -0
  27. package/dist/client/assets/blade-D4QpJJKB.js +1 -0
  28. package/dist/client/assets/bsl-BO_Y6i37.js +1 -0
  29. package/dist/client/assets/c-BIGW1oBm.js +1 -0
  30. package/dist/client/assets/c3-VCDPK7BO.js +1 -0
  31. package/dist/client/assets/cadence-Bv_4Rxtq.js +1 -0
  32. package/dist/client/assets/cairo-KRGpt6FW.js +1 -0
  33. package/dist/client/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  34. package/dist/client/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  35. package/dist/client/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  36. package/dist/client/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  37. package/dist/client/assets/clarity-D53aC0YG.js +1 -0
  38. package/dist/client/assets/clojure-P80f7IUj.js +1 -0
  39. package/dist/client/assets/cmake-D1j8_8rp.js +1 -0
  40. package/dist/client/assets/cobol-nwyudZeR.js +1 -0
  41. package/dist/client/assets/codeowners-Bp6g37R7.js +1 -0
  42. package/dist/client/assets/codeql-DsOJ9woJ.js +1 -0
  43. package/dist/client/assets/coffee-Ch7k5sss.js +1 -0
  44. package/dist/client/assets/common-lisp-Cg-RD9OK.js +1 -0
  45. package/dist/client/assets/coq-DkFqJrB1.js +1 -0
  46. package/dist/client/assets/cpp-CofmeUqb.js +1 -0
  47. package/dist/client/assets/crystal-tKQVLTB8.js +1 -0
  48. package/dist/client/assets/csharp-COcwbKMJ.js +1 -0
  49. package/dist/client/assets/css-DPfMkruS.js +1 -0
  50. package/dist/client/assets/csv-fuZLfV_i.js +1 -0
  51. package/dist/client/assets/cue-D82EKSYY.js +1 -0
  52. package/dist/client/assets/cypher-COkxafJQ.js +1 -0
  53. package/dist/client/assets/d-85-TOEBH.js +1 -0
  54. package/dist/client/assets/dark-plus-C3mMm8J8.js +1 -0
  55. package/dist/client/assets/dart-CF10PKvl.js +1 -0
  56. package/dist/client/assets/dax-CEL-wOlO.js +1 -0
  57. package/dist/client/assets/desktop-BmXAJ9_W.js +1 -0
  58. package/dist/client/assets/diff-D97Zzqfu.js +1 -0
  59. package/dist/client/assets/docker-BcOcwvcX.js +1 -0
  60. package/dist/client/assets/dotenv-Da5cRb03.js +1 -0
  61. package/dist/client/assets/dracula-BzJJZx-M.js +1 -0
  62. package/dist/client/assets/dracula-soft-BXkSAIEj.js +1 -0
  63. package/dist/client/assets/dream-maker-BtqSS_iP.js +1 -0
  64. package/dist/client/assets/edge-BkV0erSs.js +1 -0
  65. package/dist/client/assets/elixir-CDX3lj18.js +1 -0
  66. package/dist/client/assets/elm-DbKCFpqz.js +1 -0
  67. package/dist/client/assets/emacs-lisp-C9XAeP06.js +1 -0
  68. package/dist/client/assets/erb-CgJxNhIT.js +1 -0
  69. package/dist/client/assets/erlang-DsQrWhSR.js +1 -0
  70. package/dist/client/assets/everforest-dark-BgDCqdQA.js +1 -0
  71. package/dist/client/assets/everforest-light-C8M2exoo.js +1 -0
  72. package/dist/client/assets/fennel-BYunw83y.js +1 -0
  73. package/dist/client/assets/fish-BvzEVeQv.js +1 -0
  74. package/dist/client/assets/fluent-C4IJs8-o.js +1 -0
  75. package/dist/client/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
  76. package/dist/client/assets/fortran-free-form-BxgE0vQu.js +1 -0
  77. package/dist/client/assets/fsharp-CXgrBDvD.js +1 -0
  78. package/dist/client/assets/gdresource-BOOCDP_w.js +1 -0
  79. package/dist/client/assets/gdscript-C5YyOfLZ.js +1 -0
  80. package/dist/client/assets/gdshader-DkwncUOv.js +1 -0
  81. package/dist/client/assets/genie-D0YGMca9.js +1 -0
  82. package/dist/client/assets/gherkin-DyxjwDmM.js +1 -0
  83. package/dist/client/assets/git-commit-F4YmCXRG.js +1 -0
  84. package/dist/client/assets/git-rebase-r7XF79zn.js +1 -0
  85. package/dist/client/assets/github-dark-DHJKELXO.js +1 -0
  86. package/dist/client/assets/github-dark-default-Cuk6v7N8.js +1 -0
  87. package/dist/client/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  88. package/dist/client/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  89. package/dist/client/assets/github-light-DAi9KRSo.js +1 -0
  90. package/dist/client/assets/github-light-default-D7oLnXFd.js +1 -0
  91. package/dist/client/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  92. package/dist/client/assets/gleam-BspZqrRM.js +1 -0
  93. package/dist/client/assets/glimmer-js-Rg0-pVw9.js +1 -0
  94. package/dist/client/assets/glimmer-ts-U6CK756n.js +1 -0
  95. package/dist/client/assets/glsl-DplSGwfg.js +1 -0
  96. package/dist/client/assets/gn-n2N0HUVH.js +1 -0
  97. package/dist/client/assets/gnuplot-DdkO51Og.js +1 -0
  98. package/dist/client/assets/go-CxLEBnE3.js +1 -0
  99. package/dist/client/assets/graphql-ChdNCCLP.js +1 -0
  100. package/dist/client/assets/groovy-gcz8RCvz.js +1 -0
  101. package/dist/client/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  102. package/dist/client/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  103. package/dist/client/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  104. package/dist/client/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  105. package/dist/client/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  106. package/dist/client/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  107. package/dist/client/assets/hack-CaT9iCJl.js +1 -0
  108. package/dist/client/assets/haml-B8DHNrY2.js +1 -0
  109. package/dist/client/assets/handlebars-BL8al0AC.js +1 -0
  110. package/dist/client/assets/haskell-Df6bDoY_.js +1 -0
  111. package/dist/client/assets/haxe-CzTSHFRz.js +1 -0
  112. package/dist/client/assets/hcl-BWvSN4gD.js +1 -0
  113. package/dist/client/assets/hjson-D5-asLiD.js +1 -0
  114. package/dist/client/assets/hlsl-D3lLCCz7.js +1 -0
  115. package/dist/client/assets/horizon-BUw7H-hv.js +1 -0
  116. package/dist/client/assets/houston-DnULxvSX.js +1 -0
  117. package/dist/client/assets/html-GMplVEZG.js +1 -0
  118. package/dist/client/assets/html-derivative-BFtXZ54Q.js +1 -0
  119. package/dist/client/assets/http-jrhK8wxY.js +1 -0
  120. package/dist/client/assets/hurl-irOxFIW8.js +1 -0
  121. package/dist/client/assets/hxml-Bvhsp5Yf.js +1 -0
  122. package/dist/client/assets/hy-DFXneXwc.js +1 -0
  123. package/dist/client/assets/imba-DGztddWO.js +1 -0
  124. package/dist/client/assets/index-4ovQTGMY.js +471 -0
  125. package/dist/client/assets/index-DTGpjO_P.css +32 -0
  126. package/dist/client/assets/ini-BEwlwnbL.js +1 -0
  127. package/dist/client/assets/java-CylS5w8V.js +1 -0
  128. package/dist/client/assets/javascript-wDzz0qaB.js +1 -0
  129. package/dist/client/assets/jinja-4LBKfQ-Z.js +1 -0
  130. package/dist/client/assets/jison-wvAkD_A8.js +1 -0
  131. package/dist/client/assets/json-Cp-IABpG.js +1 -0
  132. package/dist/client/assets/json5-C9tS-k6U.js +1 -0
  133. package/dist/client/assets/jsonc-Des-eS-w.js +1 -0
  134. package/dist/client/assets/jsonl-DcaNXYhu.js +1 -0
  135. package/dist/client/assets/jsonnet-DFQXde-d.js +1 -0
  136. package/dist/client/assets/jssm-C2t-YnRu.js +1 -0
  137. package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
  138. package/dist/client/assets/julia-CxzCAyBv.js +1 -0
  139. package/dist/client/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  140. package/dist/client/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  141. package/dist/client/assets/kanagawa-wave-DWedfzmr.js +1 -0
  142. package/dist/client/assets/kdl-DV7GczEv.js +1 -0
  143. package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
  144. package/dist/client/assets/kusto-DZf3V79B.js +1 -0
  145. package/dist/client/assets/laserwave-DUszq2jm.js +1 -0
  146. package/dist/client/assets/latex-DGMBWnxU.js +1 -0
  147. package/dist/client/assets/lean-BZvkOJ9d.js +1 -0
  148. package/dist/client/assets/less-B1dDrJ26.js +1 -0
  149. package/dist/client/assets/light-plus-B7mTdjB0.js +1 -0
  150. package/dist/client/assets/liquid-DYVedYrR.js +1 -0
  151. package/dist/client/assets/llvm-BtvRca6l.js +1 -0
  152. package/dist/client/assets/log-2UxHyX5q.js +1 -0
  153. package/dist/client/assets/logo-BtOb2qkB.js +1 -0
  154. package/dist/client/assets/lua-BaeVxFsk.js +1 -0
  155. package/dist/client/assets/luau-C-HG3fhB.js +1 -0
  156. package/dist/client/assets/make-CHLpvVh8.js +1 -0
  157. package/dist/client/assets/markdown-Cvjx9yec.js +1 -0
  158. package/dist/client/assets/marko-DZsq8hO1.js +1 -0
  159. package/dist/client/assets/material-theme-D5KoaKCx.js +1 -0
  160. package/dist/client/assets/material-theme-darker-BfHTSMKl.js +1 -0
  161. package/dist/client/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  162. package/dist/client/assets/material-theme-ocean-CyktbL80.js +1 -0
  163. package/dist/client/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  164. package/dist/client/assets/matlab-D7o27uSR.js +1 -0
  165. package/dist/client/assets/mdc-DUICxH0z.js +1 -0
  166. package/dist/client/assets/mdx-Cmh6b_Ma.js +1 -0
  167. package/dist/client/assets/mermaid-mWjccvbQ.js +1 -0
  168. package/dist/client/assets/min-dark-CafNBF8u.js +1 -0
  169. package/dist/client/assets/min-light-CTRr51gU.js +1 -0
  170. package/dist/client/assets/mipsasm-CKIfxQSi.js +1 -0
  171. package/dist/client/assets/mojo-B93PlW-d.js +1 -0
  172. package/dist/client/assets/monokai-D4h5O-jR.js +1 -0
  173. package/dist/client/assets/moonbit-Ba13S78F.js +1 -0
  174. package/dist/client/assets/move-IF9eRakj.js +1 -0
  175. package/dist/client/assets/narrat-DRg8JJMk.js +1 -0
  176. package/dist/client/assets/nextflow-BrzmwbiE.js +1 -0
  177. package/dist/client/assets/nginx-BpAMiNFr.js +1 -0
  178. package/dist/client/assets/night-owl-C39BiMTA.js +1 -0
  179. package/dist/client/assets/night-owl-light-CMTm3GFP.js +1 -0
  180. package/dist/client/assets/nim-CVrawwO9.js +1 -0
  181. package/dist/client/assets/nix-CwoSXNpI.js +1 -0
  182. package/dist/client/assets/nord-Ddv68eIx.js +1 -0
  183. package/dist/client/assets/nushell-C-sUppwS.js +1 -0
  184. package/dist/client/assets/objective-c-DXmwc3jG.js +1 -0
  185. package/dist/client/assets/objective-cpp-CLxacb5B.js +1 -0
  186. package/dist/client/assets/ocaml-C0hk2d4L.js +1 -0
  187. package/dist/client/assets/odin-BBf5iR-q.js +1 -0
  188. package/dist/client/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  189. package/dist/client/assets/one-light-C3Wv6jpd.js +1 -0
  190. package/dist/client/assets/openscad-C4EeE6gA.js +1 -0
  191. package/dist/client/assets/pascal-D93ZcfNL.js +1 -0
  192. package/dist/client/assets/perl-C0TMdlhV.js +1 -0
  193. package/dist/client/assets/php-Dhbhpdrm.js +1 -0
  194. package/dist/client/assets/pkl-u5AG7uiY.js +1 -0
  195. package/dist/client/assets/plastic-3e1v2bzS.js +1 -0
  196. package/dist/client/assets/plsql-ChMvpjG-.js +1 -0
  197. package/dist/client/assets/po-BTJTHyun.js +1 -0
  198. package/dist/client/assets/poimandres-CS3Unz2-.js +1 -0
  199. package/dist/client/assets/polar-C0HS_06l.js +1 -0
  200. package/dist/client/assets/postcss-CXtECtnM.js +1 -0
  201. package/dist/client/assets/powerquery-CEu0bR-o.js +1 -0
  202. package/dist/client/assets/powershell-Dpen1YoG.js +1 -0
  203. package/dist/client/assets/prisma-Dd19v3D-.js +1 -0
  204. package/dist/client/assets/prolog-CbFg5uaA.js +1 -0
  205. package/dist/client/assets/proto-C7zT0LnQ.js +1 -0
  206. package/dist/client/assets/pug-CGlum2m_.js +1 -0
  207. package/dist/client/assets/puppet-BMWR74SV.js +1 -0
  208. package/dist/client/assets/purescript-CklMAg4u.js +1 -0
  209. package/dist/client/assets/python-B6aJPvgy.js +1 -0
  210. package/dist/client/assets/qml-3beO22l8.js +1 -0
  211. package/dist/client/assets/qmldir-C8lEn-DE.js +1 -0
  212. package/dist/client/assets/qss-IeuSbFQv.js +1 -0
  213. package/dist/client/assets/r-Dspwwk_N.js +1 -0
  214. package/dist/client/assets/racket-BqYA7rlc.js +1 -0
  215. package/dist/client/assets/raku-DXvB9xmW.js +1 -0
  216. package/dist/client/assets/razor-Uh8Bk_45.js +1 -0
  217. package/dist/client/assets/red-bN70gL4F.js +1 -0
  218. package/dist/client/assets/reg-C-SQnVFl.js +1 -0
  219. package/dist/client/assets/regexp-CDVJQ6XC.js +1 -0
  220. package/dist/client/assets/rel-C3B-1QV4.js +1 -0
  221. package/dist/client/assets/riscv-BM1_JUlF.js +1 -0
  222. package/dist/client/assets/ron-BhRPY-oY.js +1 -0
  223. package/dist/client/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  224. package/dist/client/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  225. package/dist/client/assets/rose-pine-qdsjHGoJ.js +1 -0
  226. package/dist/client/assets/rosmsg-BJDFO7_C.js +1 -0
  227. package/dist/client/assets/rst-D5oM4XIm.js +1 -0
  228. package/dist/client/assets/ruby-Cw6WdidG.js +1 -0
  229. package/dist/client/assets/rust-B1yitclQ.js +1 -0
  230. package/dist/client/assets/sas-cz2c8ADy.js +1 -0
  231. package/dist/client/assets/sass-Cj5Yp3dK.js +1 -0
  232. package/dist/client/assets/scala-C151Ov-r.js +1 -0
  233. package/dist/client/assets/scheme-C98Dy4si.js +1 -0
  234. package/dist/client/assets/scss-OYdSNvt2.js +1 -0
  235. package/dist/client/assets/sdbl-DVxCFoDh.js +1 -0
  236. package/dist/client/assets/shaderlab-Dg9Lc6iA.js +1 -0
  237. package/dist/client/assets/shellscript-Yzrsuije.js +1 -0
  238. package/dist/client/assets/shellsession-BADoaaVG.js +1 -0
  239. package/dist/client/assets/slack-dark-BthQWCQV.js +1 -0
  240. package/dist/client/assets/slack-ochin-DqwNpetd.js +1 -0
  241. package/dist/client/assets/smalltalk-BERRCDM3.js +1 -0
  242. package/dist/client/assets/snazzy-light-Bw305WKR.js +1 -0
  243. package/dist/client/assets/solarized-dark-DXbdFlpD.js +1 -0
  244. package/dist/client/assets/solarized-light-L9t79GZl.js +1 -0
  245. package/dist/client/assets/solidity-rGO070M0.js +1 -0
  246. package/dist/client/assets/soy-Brmx7dQM.js +1 -0
  247. package/dist/client/assets/sparql-rVzFXLq3.js +1 -0
  248. package/dist/client/assets/splunk-BtCnVYZw.js +1 -0
  249. package/dist/client/assets/sql-BLtJtn59.js +1 -0
  250. package/dist/client/assets/ssh-config-_ykCGR6B.js +1 -0
  251. package/dist/client/assets/stata-BH5u7GGu.js +1 -0
  252. package/dist/client/assets/stylus-BEDo0Tqx.js +1 -0
  253. package/dist/client/assets/surrealql-Bq5Q-fJD.js +1 -0
  254. package/dist/client/assets/svelte-zxCyuUbr.js +1 -0
  255. package/dist/client/assets/swift-Dg5xB15N.js +1 -0
  256. package/dist/client/assets/synthwave-84-CbfX1IO0.js +1 -0
  257. package/dist/client/assets/system-verilog-CnnmHF94.js +1 -0
  258. package/dist/client/assets/systemd-4A_iFExJ.js +1 -0
  259. package/dist/client/assets/talonscript-CkByrt1z.js +1 -0
  260. package/dist/client/assets/tasl-QIJgUcNo.js +1 -0
  261. package/dist/client/assets/tcl-dwOrl1Do.js +1 -0
  262. package/dist/client/assets/templ-P3uqSqPl.js +1 -0
  263. package/dist/client/assets/terraform-BETggiCN.js +1 -0
  264. package/dist/client/assets/tex-CvyZ59Mk.js +1 -0
  265. package/dist/client/assets/tokyo-night-hegEt444.js +1 -0
  266. package/dist/client/assets/toml-vGWfd6FD.js +1 -0
  267. package/dist/client/assets/ts-tags-zn1MmPIZ.js +1 -0
  268. package/dist/client/assets/tsv-B_m7g4N7.js +1 -0
  269. package/dist/client/assets/tsx-COt5Ahok.js +1 -0
  270. package/dist/client/assets/turtle-BsS91CYL.js +1 -0
  271. package/dist/client/assets/twig-ChbOoGGc.js +1 -0
  272. package/dist/client/assets/typescript-BPQ3VLAy.js +1 -0
  273. package/dist/client/assets/typespec-BGHnOYBU.js +1 -0
  274. package/dist/client/assets/typst-DHCkPAjA.js +1 -0
  275. package/dist/client/assets/v-BcVCzyr7.js +1 -0
  276. package/dist/client/assets/vala-CsfeWuGM.js +1 -0
  277. package/dist/client/assets/vb-D17OF-Vu.js +1 -0
  278. package/dist/client/assets/verilog-BQ8w6xss.js +1 -0
  279. package/dist/client/assets/vesper-DU1UobuO.js +1 -0
  280. package/dist/client/assets/vhdl-CeAyd5Ju.js +1 -0
  281. package/dist/client/assets/viml-CJc9bBzg.js +1 -0
  282. package/dist/client/assets/vitesse-black-Bkuqu6BP.js +1 -0
  283. package/dist/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
  284. package/dist/client/assets/vitesse-light-CVO1_9PV.js +1 -0
  285. package/dist/client/assets/vue-DN_0RTcg.js +1 -0
  286. package/dist/client/assets/vue-html-AaS7Mt5G.js +1 -0
  287. package/dist/client/assets/vue-vine-CQOfvN7w.js +1 -0
  288. package/dist/client/assets/vyper-CDx5xZoG.js +1 -0
  289. package/dist/client/assets/wasm-CG6Dc4jp.js +1 -0
  290. package/dist/client/assets/wasm-MzD3tlZU.js +1 -0
  291. package/dist/client/assets/wenyan-BV7otONQ.js +1 -0
  292. package/dist/client/assets/wgsl-Dx-B1_4e.js +1 -0
  293. package/dist/client/assets/wikitext-BhOHFoWU.js +1 -0
  294. package/dist/client/assets/wit-5i3qLPDT.js +1 -0
  295. package/dist/client/assets/wolfram-lXgVvXCa.js +1 -0
  296. package/dist/client/assets/xml-sdJ4AIDG.js +1 -0
  297. package/dist/client/assets/xsl-CtQFsRM5.js +1 -0
  298. package/dist/client/assets/yaml-Buea-lGh.js +1 -0
  299. package/dist/client/assets/zenscript-DVFEvuxE.js +1 -0
  300. package/dist/client/assets/zig-VOosw3JB.js +1 -0
  301. package/dist/client/client/assets/abap-BdImnpbu.js +1 -0
  302. package/dist/client/client/assets/actionscript-3-CoDkCxhg.js +1 -0
  303. package/dist/client/client/assets/ada-bCR0ucgS.js +1 -0
  304. package/dist/client/client/assets/andromeeda-C4gqWexZ.js +1 -0
  305. package/dist/client/client/assets/angular-html-CU67Zn6k.js +1 -0
  306. package/dist/client/client/assets/angular-ts-BwZT4LLn.js +1 -0
  307. package/dist/client/client/assets/apache-Pmp26Uib.js +1 -0
  308. package/dist/client/client/assets/apex-D8_7TLub.js +1 -0
  309. package/dist/client/client/assets/apl-dKokRX4l.js +1 -0
  310. package/dist/client/client/assets/applescript-Co6uUVPk.js +1 -0
  311. package/dist/client/client/assets/ara-BRHolxvo.js +1 -0
  312. package/dist/client/client/assets/asciidoc-Dv7Oe6Be.js +1 -0
  313. package/dist/client/client/assets/asm-D_Q5rh1f.js +1 -0
  314. package/dist/client/client/assets/astro-CbQHKStN.js +1 -0
  315. package/dist/client/client/assets/aurora-x-D-2ljcwZ.js +1 -0
  316. package/dist/client/client/assets/awk-DMzUqQB5.js +1 -0
  317. package/dist/client/client/assets/ayu-dark-CMjwMIkn.js +1 -0
  318. package/dist/client/client/assets/ayu-light-C47S-Tmv.js +1 -0
  319. package/dist/client/client/assets/ayu-mirage-CjoLj4QM.js +1 -0
  320. package/dist/client/client/assets/ballerina-BFfxhgS-.js +1 -0
  321. package/dist/client/client/assets/bat-BkioyH1T.js +1 -0
  322. package/dist/client/client/assets/beancount-k_qm7-4y.js +1 -0
  323. package/dist/client/client/assets/berry-uYugtg8r.js +1 -0
  324. package/dist/client/client/assets/bibtex-CHM0blh-.js +1 -0
  325. package/dist/client/client/assets/bicep-Bmn6On1c.js +1 -0
  326. package/dist/client/client/assets/blade-D4QpJJKB.js +1 -0
  327. package/dist/client/client/assets/bsl-BO_Y6i37.js +1 -0
  328. package/dist/client/client/assets/c-BIGW1oBm.js +1 -0
  329. package/dist/client/client/assets/c3-VCDPK7BO.js +1 -0
  330. package/dist/client/client/assets/cadence-Bv_4Rxtq.js +1 -0
  331. package/dist/client/client/assets/cairo-KRGpt6FW.js +1 -0
  332. package/dist/client/client/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  333. package/dist/client/client/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  334. package/dist/client/client/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  335. package/dist/client/client/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  336. package/dist/client/client/assets/clarity-D53aC0YG.js +1 -0
  337. package/dist/client/client/assets/clojure-P80f7IUj.js +1 -0
  338. package/dist/client/client/assets/cmake-D1j8_8rp.js +1 -0
  339. package/dist/client/client/assets/cobol-nwyudZeR.js +1 -0
  340. package/dist/client/client/assets/codeowners-Bp6g37R7.js +1 -0
  341. package/dist/client/client/assets/codeql-DsOJ9woJ.js +1 -0
  342. package/dist/client/client/assets/coffee-Ch7k5sss.js +1 -0
  343. package/dist/client/client/assets/common-lisp-Cg-RD9OK.js +1 -0
  344. package/dist/client/client/assets/coq-DkFqJrB1.js +1 -0
  345. package/dist/client/client/assets/cpp-CofmeUqb.js +1 -0
  346. package/dist/client/client/assets/crystal-tKQVLTB8.js +1 -0
  347. package/dist/client/client/assets/csharp-COcwbKMJ.js +1 -0
  348. package/dist/client/client/assets/css-DPfMkruS.js +1 -0
  349. package/dist/client/client/assets/csv-fuZLfV_i.js +1 -0
  350. package/dist/client/client/assets/cue-D82EKSYY.js +1 -0
  351. package/dist/client/client/assets/cypher-COkxafJQ.js +1 -0
  352. package/dist/client/client/assets/d-85-TOEBH.js +1 -0
  353. package/dist/client/client/assets/dark-plus-C3mMm8J8.js +1 -0
  354. package/dist/client/client/assets/dart-CF10PKvl.js +1 -0
  355. package/dist/client/client/assets/dax-CEL-wOlO.js +1 -0
  356. package/dist/client/client/assets/desktop-BmXAJ9_W.js +1 -0
  357. package/dist/client/client/assets/diff-D97Zzqfu.js +1 -0
  358. package/dist/client/client/assets/docker-BcOcwvcX.js +1 -0
  359. package/dist/client/client/assets/dotenv-Da5cRb03.js +1 -0
  360. package/dist/client/client/assets/dracula-BzJJZx-M.js +1 -0
  361. package/dist/client/client/assets/dracula-soft-BXkSAIEj.js +1 -0
  362. package/dist/client/client/assets/dream-maker-BtqSS_iP.js +1 -0
  363. package/dist/client/client/assets/edge-BkV0erSs.js +1 -0
  364. package/dist/client/client/assets/elixir-CDX3lj18.js +1 -0
  365. package/dist/client/client/assets/elm-DbKCFpqz.js +1 -0
  366. package/dist/client/client/assets/emacs-lisp-C9XAeP06.js +1 -0
  367. package/dist/client/client/assets/erb-CgJxNhIT.js +1 -0
  368. package/dist/client/client/assets/erlang-DsQrWhSR.js +1 -0
  369. package/dist/client/client/assets/everforest-dark-BgDCqdQA.js +1 -0
  370. package/dist/client/client/assets/everforest-light-C8M2exoo.js +1 -0
  371. package/dist/client/client/assets/fennel-BYunw83y.js +1 -0
  372. package/dist/client/client/assets/fish-BvzEVeQv.js +1 -0
  373. package/dist/client/client/assets/fluent-C4IJs8-o.js +1 -0
  374. package/dist/client/client/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
  375. package/dist/client/client/assets/fortran-free-form-BxgE0vQu.js +1 -0
  376. package/dist/client/client/assets/fsharp-CXgrBDvD.js +1 -0
  377. package/dist/client/client/assets/gdresource-BOOCDP_w.js +1 -0
  378. package/dist/client/client/assets/gdscript-C5YyOfLZ.js +1 -0
  379. package/dist/client/client/assets/gdshader-DkwncUOv.js +1 -0
  380. package/dist/client/client/assets/genie-D0YGMca9.js +1 -0
  381. package/dist/client/client/assets/gherkin-DyxjwDmM.js +1 -0
  382. package/dist/client/client/assets/git-commit-F4YmCXRG.js +1 -0
  383. package/dist/client/client/assets/git-rebase-r7XF79zn.js +1 -0
  384. package/dist/client/client/assets/github-dark-DHJKELXO.js +1 -0
  385. package/dist/client/client/assets/github-dark-default-Cuk6v7N8.js +1 -0
  386. package/dist/client/client/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  387. package/dist/client/client/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  388. package/dist/client/client/assets/github-light-DAi9KRSo.js +1 -0
  389. package/dist/client/client/assets/github-light-default-D7oLnXFd.js +1 -0
  390. package/dist/client/client/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  391. package/dist/client/client/assets/gleam-BspZqrRM.js +1 -0
  392. package/dist/client/client/assets/glimmer-js-Rg0-pVw9.js +1 -0
  393. package/dist/client/client/assets/glimmer-ts-U6CK756n.js +1 -0
  394. package/dist/client/client/assets/glsl-DplSGwfg.js +1 -0
  395. package/dist/client/client/assets/gn-n2N0HUVH.js +1 -0
  396. package/dist/client/client/assets/gnuplot-DdkO51Og.js +1 -0
  397. package/dist/client/client/assets/go-CxLEBnE3.js +1 -0
  398. package/dist/client/client/assets/graphql-ChdNCCLP.js +1 -0
  399. package/dist/client/client/assets/groovy-gcz8RCvz.js +1 -0
  400. package/dist/client/client/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  401. package/dist/client/client/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  402. package/dist/client/client/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  403. package/dist/client/client/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  404. package/dist/client/client/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  405. package/dist/client/client/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  406. package/dist/client/client/assets/hack-CaT9iCJl.js +1 -0
  407. package/dist/client/client/assets/haml-B8DHNrY2.js +1 -0
  408. package/dist/client/client/assets/handlebars-BL8al0AC.js +1 -0
  409. package/dist/client/client/assets/haskell-Df6bDoY_.js +1 -0
  410. package/dist/client/client/assets/haxe-CzTSHFRz.js +1 -0
  411. package/dist/client/client/assets/hcl-BWvSN4gD.js +1 -0
  412. package/dist/client/client/assets/hjson-D5-asLiD.js +1 -0
  413. package/dist/client/client/assets/hlsl-D3lLCCz7.js +1 -0
  414. package/dist/client/client/assets/horizon-BUw7H-hv.js +1 -0
  415. package/dist/client/client/assets/houston-DnULxvSX.js +1 -0
  416. package/dist/client/client/assets/html-GMplVEZG.js +1 -0
  417. package/dist/client/client/assets/html-derivative-BFtXZ54Q.js +1 -0
  418. package/dist/client/client/assets/http-jrhK8wxY.js +1 -0
  419. package/dist/client/client/assets/hurl-irOxFIW8.js +1 -0
  420. package/dist/client/client/assets/hxml-Bvhsp5Yf.js +1 -0
  421. package/dist/client/client/assets/hy-DFXneXwc.js +1 -0
  422. package/dist/client/client/assets/imba-DGztddWO.js +1 -0
  423. package/dist/client/client/assets/index-4ovQTGMY.js +471 -0
  424. package/dist/client/client/assets/index-DTGpjO_P.css +32 -0
  425. package/dist/client/client/assets/ini-BEwlwnbL.js +1 -0
  426. package/dist/client/client/assets/java-CylS5w8V.js +1 -0
  427. package/dist/client/client/assets/javascript-wDzz0qaB.js +1 -0
  428. package/dist/client/client/assets/jinja-4LBKfQ-Z.js +1 -0
  429. package/dist/client/client/assets/jison-wvAkD_A8.js +1 -0
  430. package/dist/client/client/assets/json-Cp-IABpG.js +1 -0
  431. package/dist/client/client/assets/json5-C9tS-k6U.js +1 -0
  432. package/dist/client/client/assets/jsonc-Des-eS-w.js +1 -0
  433. package/dist/client/client/assets/jsonl-DcaNXYhu.js +1 -0
  434. package/dist/client/client/assets/jsonnet-DFQXde-d.js +1 -0
  435. package/dist/client/client/assets/jssm-C2t-YnRu.js +1 -0
  436. package/dist/client/client/assets/jsx-g9-lgVsj.js +1 -0
  437. package/dist/client/client/assets/julia-CxzCAyBv.js +1 -0
  438. package/dist/client/client/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  439. package/dist/client/client/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  440. package/dist/client/client/assets/kanagawa-wave-DWedfzmr.js +1 -0
  441. package/dist/client/client/assets/kdl-DV7GczEv.js +1 -0
  442. package/dist/client/client/assets/kotlin-BdnUsdx6.js +1 -0
  443. package/dist/client/client/assets/kusto-DZf3V79B.js +1 -0
  444. package/dist/client/client/assets/laserwave-DUszq2jm.js +1 -0
  445. package/dist/client/client/assets/latex-DGMBWnxU.js +1 -0
  446. package/dist/client/client/assets/lean-BZvkOJ9d.js +1 -0
  447. package/dist/client/client/assets/less-B1dDrJ26.js +1 -0
  448. package/dist/client/client/assets/light-plus-B7mTdjB0.js +1 -0
  449. package/dist/client/client/assets/liquid-DYVedYrR.js +1 -0
  450. package/dist/client/client/assets/llvm-BtvRca6l.js +1 -0
  451. package/dist/client/client/assets/log-2UxHyX5q.js +1 -0
  452. package/dist/client/client/assets/logo-BtOb2qkB.js +1 -0
  453. package/dist/client/client/assets/lua-BaeVxFsk.js +1 -0
  454. package/dist/client/client/assets/luau-C-HG3fhB.js +1 -0
  455. package/dist/client/client/assets/make-CHLpvVh8.js +1 -0
  456. package/dist/client/client/assets/markdown-Cvjx9yec.js +1 -0
  457. package/dist/client/client/assets/marko-DZsq8hO1.js +1 -0
  458. package/dist/client/client/assets/material-theme-D5KoaKCx.js +1 -0
  459. package/dist/client/client/assets/material-theme-darker-BfHTSMKl.js +1 -0
  460. package/dist/client/client/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  461. package/dist/client/client/assets/material-theme-ocean-CyktbL80.js +1 -0
  462. package/dist/client/client/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  463. package/dist/client/client/assets/matlab-D7o27uSR.js +1 -0
  464. package/dist/client/client/assets/mdc-DUICxH0z.js +1 -0
  465. package/dist/client/client/assets/mdx-Cmh6b_Ma.js +1 -0
  466. package/dist/client/client/assets/mermaid-mWjccvbQ.js +1 -0
  467. package/dist/client/client/assets/min-dark-CafNBF8u.js +1 -0
  468. package/dist/client/client/assets/min-light-CTRr51gU.js +1 -0
  469. package/dist/client/client/assets/mipsasm-CKIfxQSi.js +1 -0
  470. package/dist/client/client/assets/mojo-B93PlW-d.js +1 -0
  471. package/dist/client/client/assets/monokai-D4h5O-jR.js +1 -0
  472. package/dist/client/client/assets/moonbit-Ba13S78F.js +1 -0
  473. package/dist/client/client/assets/move-IF9eRakj.js +1 -0
  474. package/dist/client/client/assets/narrat-DRg8JJMk.js +1 -0
  475. package/dist/client/client/assets/nextflow-BrzmwbiE.js +1 -0
  476. package/dist/client/client/assets/nginx-BpAMiNFr.js +1 -0
  477. package/dist/client/client/assets/night-owl-C39BiMTA.js +1 -0
  478. package/dist/client/client/assets/night-owl-light-CMTm3GFP.js +1 -0
  479. package/dist/client/client/assets/nim-CVrawwO9.js +1 -0
  480. package/dist/client/client/assets/nix-CwoSXNpI.js +1 -0
  481. package/dist/client/client/assets/nord-Ddv68eIx.js +1 -0
  482. package/dist/client/client/assets/nushell-C-sUppwS.js +1 -0
  483. package/dist/client/client/assets/objective-c-DXmwc3jG.js +1 -0
  484. package/dist/client/client/assets/objective-cpp-CLxacb5B.js +1 -0
  485. package/dist/client/client/assets/ocaml-C0hk2d4L.js +1 -0
  486. package/dist/client/client/assets/odin-BBf5iR-q.js +1 -0
  487. package/dist/client/client/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  488. package/dist/client/client/assets/one-light-C3Wv6jpd.js +1 -0
  489. package/dist/client/client/assets/openscad-C4EeE6gA.js +1 -0
  490. package/dist/client/client/assets/pascal-D93ZcfNL.js +1 -0
  491. package/dist/client/client/assets/perl-C0TMdlhV.js +1 -0
  492. package/dist/client/client/assets/php-Dhbhpdrm.js +1 -0
  493. package/dist/client/client/assets/pkl-u5AG7uiY.js +1 -0
  494. package/dist/client/client/assets/plastic-3e1v2bzS.js +1 -0
  495. package/dist/client/client/assets/plsql-ChMvpjG-.js +1 -0
  496. package/dist/client/client/assets/po-BTJTHyun.js +1 -0
  497. package/dist/client/client/assets/poimandres-CS3Unz2-.js +1 -0
  498. package/dist/client/client/assets/polar-C0HS_06l.js +1 -0
  499. package/dist/client/client/assets/postcss-CXtECtnM.js +1 -0
  500. package/dist/client/client/assets/powerquery-CEu0bR-o.js +1 -0
  501. package/dist/client/client/assets/powershell-Dpen1YoG.js +1 -0
  502. package/dist/client/client/assets/prisma-Dd19v3D-.js +1 -0
  503. package/dist/client/client/assets/prolog-CbFg5uaA.js +1 -0
  504. package/dist/client/client/assets/proto-C7zT0LnQ.js +1 -0
  505. package/dist/client/client/assets/pug-CGlum2m_.js +1 -0
  506. package/dist/client/client/assets/puppet-BMWR74SV.js +1 -0
  507. package/dist/client/client/assets/purescript-CklMAg4u.js +1 -0
  508. package/dist/client/client/assets/python-B6aJPvgy.js +1 -0
  509. package/dist/client/client/assets/qml-3beO22l8.js +1 -0
  510. package/dist/client/client/assets/qmldir-C8lEn-DE.js +1 -0
  511. package/dist/client/client/assets/qss-IeuSbFQv.js +1 -0
  512. package/dist/client/client/assets/r-Dspwwk_N.js +1 -0
  513. package/dist/client/client/assets/racket-BqYA7rlc.js +1 -0
  514. package/dist/client/client/assets/raku-DXvB9xmW.js +1 -0
  515. package/dist/client/client/assets/razor-Uh8Bk_45.js +1 -0
  516. package/dist/client/client/assets/red-bN70gL4F.js +1 -0
  517. package/dist/client/client/assets/reg-C-SQnVFl.js +1 -0
  518. package/dist/client/client/assets/regexp-CDVJQ6XC.js +1 -0
  519. package/dist/client/client/assets/rel-C3B-1QV4.js +1 -0
  520. package/dist/client/client/assets/riscv-BM1_JUlF.js +1 -0
  521. package/dist/client/client/assets/ron-BhRPY-oY.js +1 -0
  522. package/dist/client/client/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  523. package/dist/client/client/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  524. package/dist/client/client/assets/rose-pine-qdsjHGoJ.js +1 -0
  525. package/dist/client/client/assets/rosmsg-BJDFO7_C.js +1 -0
  526. package/dist/client/client/assets/rst-D5oM4XIm.js +1 -0
  527. package/dist/client/client/assets/ruby-Cw6WdidG.js +1 -0
  528. package/dist/client/client/assets/rust-B1yitclQ.js +1 -0
  529. package/dist/client/client/assets/sas-cz2c8ADy.js +1 -0
  530. package/dist/client/client/assets/sass-Cj5Yp3dK.js +1 -0
  531. package/dist/client/client/assets/scala-C151Ov-r.js +1 -0
  532. package/dist/client/client/assets/scheme-C98Dy4si.js +1 -0
  533. package/dist/client/client/assets/scss-OYdSNvt2.js +1 -0
  534. package/dist/client/client/assets/sdbl-DVxCFoDh.js +1 -0
  535. package/dist/client/client/assets/shaderlab-Dg9Lc6iA.js +1 -0
  536. package/dist/client/client/assets/shellscript-Yzrsuije.js +1 -0
  537. package/dist/client/client/assets/shellsession-BADoaaVG.js +1 -0
  538. package/dist/client/client/assets/slack-dark-BthQWCQV.js +1 -0
  539. package/dist/client/client/assets/slack-ochin-DqwNpetd.js +1 -0
  540. package/dist/client/client/assets/smalltalk-BERRCDM3.js +1 -0
  541. package/dist/client/client/assets/snazzy-light-Bw305WKR.js +1 -0
  542. package/dist/client/client/assets/solarized-dark-DXbdFlpD.js +1 -0
  543. package/dist/client/client/assets/solarized-light-L9t79GZl.js +1 -0
  544. package/dist/client/client/assets/solidity-rGO070M0.js +1 -0
  545. package/dist/client/client/assets/soy-Brmx7dQM.js +1 -0
  546. package/dist/client/client/assets/sparql-rVzFXLq3.js +1 -0
  547. package/dist/client/client/assets/splunk-BtCnVYZw.js +1 -0
  548. package/dist/client/client/assets/sql-BLtJtn59.js +1 -0
  549. package/dist/client/client/assets/ssh-config-_ykCGR6B.js +1 -0
  550. package/dist/client/client/assets/stata-BH5u7GGu.js +1 -0
  551. package/dist/client/client/assets/stylus-BEDo0Tqx.js +1 -0
  552. package/dist/client/client/assets/surrealql-Bq5Q-fJD.js +1 -0
  553. package/dist/client/client/assets/svelte-zxCyuUbr.js +1 -0
  554. package/dist/client/client/assets/swift-Dg5xB15N.js +1 -0
  555. package/dist/client/client/assets/synthwave-84-CbfX1IO0.js +1 -0
  556. package/dist/client/client/assets/system-verilog-CnnmHF94.js +1 -0
  557. package/dist/client/client/assets/systemd-4A_iFExJ.js +1 -0
  558. package/dist/client/client/assets/talonscript-CkByrt1z.js +1 -0
  559. package/dist/client/client/assets/tasl-QIJgUcNo.js +1 -0
  560. package/dist/client/client/assets/tcl-dwOrl1Do.js +1 -0
  561. package/dist/client/client/assets/templ-P3uqSqPl.js +1 -0
  562. package/dist/client/client/assets/terraform-BETggiCN.js +1 -0
  563. package/dist/client/client/assets/tex-CvyZ59Mk.js +1 -0
  564. package/dist/client/client/assets/tokyo-night-hegEt444.js +1 -0
  565. package/dist/client/client/assets/toml-vGWfd6FD.js +1 -0
  566. package/dist/client/client/assets/ts-tags-zn1MmPIZ.js +1 -0
  567. package/dist/client/client/assets/tsv-B_m7g4N7.js +1 -0
  568. package/dist/client/client/assets/tsx-COt5Ahok.js +1 -0
  569. package/dist/client/client/assets/turtle-BsS91CYL.js +1 -0
  570. package/dist/client/client/assets/twig-ChbOoGGc.js +1 -0
  571. package/dist/client/client/assets/typescript-BPQ3VLAy.js +1 -0
  572. package/dist/client/client/assets/typespec-BGHnOYBU.js +1 -0
  573. package/dist/client/client/assets/typst-DHCkPAjA.js +1 -0
  574. package/dist/client/client/assets/v-BcVCzyr7.js +1 -0
  575. package/dist/client/client/assets/vala-CsfeWuGM.js +1 -0
  576. package/dist/client/client/assets/vb-D17OF-Vu.js +1 -0
  577. package/dist/client/client/assets/verilog-BQ8w6xss.js +1 -0
  578. package/dist/client/client/assets/vesper-DU1UobuO.js +1 -0
  579. package/dist/client/client/assets/vhdl-CeAyd5Ju.js +1 -0
  580. package/dist/client/client/assets/viml-CJc9bBzg.js +1 -0
  581. package/dist/client/client/assets/vitesse-black-Bkuqu6BP.js +1 -0
  582. package/dist/client/client/assets/vitesse-dark-D0r3Knsf.js +1 -0
  583. package/dist/client/client/assets/vitesse-light-CVO1_9PV.js +1 -0
  584. package/dist/client/client/assets/vue-DN_0RTcg.js +1 -0
  585. package/dist/client/client/assets/vue-html-AaS7Mt5G.js +1 -0
  586. package/dist/client/client/assets/vue-vine-CQOfvN7w.js +1 -0
  587. package/dist/client/client/assets/vyper-CDx5xZoG.js +1 -0
  588. package/dist/client/client/assets/wasm-CG6Dc4jp.js +1 -0
  589. package/dist/client/client/assets/wasm-MzD3tlZU.js +1 -0
  590. package/dist/client/client/assets/wenyan-BV7otONQ.js +1 -0
  591. package/dist/client/client/assets/wgsl-Dx-B1_4e.js +1 -0
  592. package/dist/client/client/assets/wikitext-BhOHFoWU.js +1 -0
  593. package/dist/client/client/assets/wit-5i3qLPDT.js +1 -0
  594. package/dist/client/client/assets/wolfram-lXgVvXCa.js +1 -0
  595. package/dist/client/client/assets/xml-sdJ4AIDG.js +1 -0
  596. package/dist/client/client/assets/xsl-CtQFsRM5.js +1 -0
  597. package/dist/client/client/assets/yaml-Buea-lGh.js +1 -0
  598. package/dist/client/client/assets/zenscript-DVFEvuxE.js +1 -0
  599. package/dist/client/client/assets/zig-VOosw3JB.js +1 -0
  600. package/dist/client/client/index.html +16 -0
  601. package/dist/client/index.html +16 -0
  602. package/dist/main.js +28540 -0
  603. package/package.json +23 -0
@@ -0,0 +1,471 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-D4QpJJKB.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-CgJxNhIT.js","assets/ruby-Cw6WdidG.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/latex-DGMBWnxU.js","assets/tex-CvyZ59Mk.js","assets/liquid-DYVedYrR.js","assets/marko-DZsq8hO1.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-BpAMiNFr.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-Dhbhpdrm.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-Uh8Bk_45.js","assets/csharp-COcwbKMJ.js","assets/rst-D5oM4XIm.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-zxCyuUbr.js","assets/templ-P3uqSqPl.js","assets/go-CxLEBnE3.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-ChbOoGGc.js","assets/vue-DN_0RTcg.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-CQOfvN7w.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
2
+ var Cd=Object.defineProperty;var ka=t=>{throw TypeError(t)};var kd=(t,e,i)=>e in t?Cd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Se=(t,e,i)=>kd(t,typeof e!="symbol"?e+"":e,i),ro=(t,e,i)=>e.has(t)||ka("Cannot "+i);var ke=(t,e,i)=>(ro(t,e,"read from private field"),i?i.call(t):e.get(t)),Ut=(t,e,i)=>e.has(t)?ka("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),jt=(t,e,i,n)=>(ro(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),kr=(t,e,i)=>(ro(t,e,"access private method"),i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const v of a)if(v.type==="childList")for(const _ of v.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&n(_)}).observe(document,{childList:!0,subtree:!0});function i(a){const v={};return a.integrity&&(v.integrity=a.integrity),a.referrerPolicy&&(v.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?v.credentials="include":a.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function n(a){if(a.ep)return;a.ep=!0;const v=i(a);fetch(a.href,v)}})();const Ed="5";var Cl;typeof window<"u"&&((Cl=window.__svelte??(window.__svelte={})).v??(Cl.v=new Set)).add(Ed);const Ld=1,Pd=2,Ll=4,Rd=8,Ad=16,Td=1,Dd=4,Id=8,Md=16,Pl=1,Od=2,yr=Symbol(),Bd=Symbol("filename"),Nd="http://www.w3.org/1999/xhtml";var kl,El;const Ea=(El=(kl=globalThis.process)==null?void 0:kl.env)==null?void 0:El.NODE_ENV,vt=Ea&&!Ea.toLowerCase().startsWith("prod");var Qo=Array.isArray,jd=Array.prototype.indexOf,nn=Array.prototype.includes,Vs=Array.from,sn=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,Fd=Object.getOwnPropertyDescriptors,Hd=Object.prototype,Vd=Array.prototype,Rl=Object.getPrototypeOf,La=Object.isExtensible;const ws=()=>{};function Wd(t){for(var e=0;e<t.length;e++)t[e]()}function Al(){var t,e,i=new Promise((n,a)=>{t=n,e=a});return{promise:i,resolve:t,reject:e}}function Tl(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const i=[];for(const n of t)if(i.push(n),i.length===e)break;return i}const wr=2,Ss=4,Ws=8,Dl=1<<24,Ri=16,li=32,ln=64,Xo=128,Zr=512,gr=1024,Ar=2048,Ai=4096,zr=8192,Ci=16384,Yo=32768,Cn=65536,Cs=1<<17,Il=1<<18,An=1<<19,Ud=1<<20,Si=1<<25,Hi=32768,So=1<<21,Us=1<<22,Bi=1<<23,en=Symbol("$state"),zd=Symbol("legacy props"),qd=Symbol(""),Ml=Symbol("proxy path"),fn=new class extends Error{constructor(){super(...arguments);Se(this,"name","StaleReactionError");Se(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Ol(t){if(vt){const e=new Error(`lifecycle_outside_component
3
+ \`${t}(...)\` can only be used during component initialisation
4
+ https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Gd(){if(vt){const t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Pa(){if(vt){const t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function Kd(){if(vt){const t=new Error(`derived_references_self
5
+ A derived value cannot reference itself recursively
6
+ https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function Jd(t){if(vt){const e=new Error(`effect_in_teardown
7
+ \`${t}\` cannot be used inside an effect cleanup function
8
+ https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function Qd(){if(vt){const t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Xd(t){if(vt){const e=new Error(`effect_orphan
9
+ \`${t}\` can only be used inside an effect (e.g. during component initialisation)
10
+ https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function Yd(){if(vt){const t=new Error(`effect_update_depth_exceeded
11
+ Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
12
+ https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Zd(t){if(vt){const e=new Error(`props_invalid_value
13
+ Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value
14
+ https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function $d(t){if(vt){const e=new Error(`rune_outside_svelte
15
+ The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
16
+ https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function eu(){if(vt){const t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function tu(){if(vt){const t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function ru(){if(vt){const t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function iu(){if(vt){const t=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Zo="font-weight: bold",$o="font-weight: normal";function nu(){vt?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",Zo,$o):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function io(t){vt?console.warn(`%c[svelte] state_proxy_equality_mismatch
17
+ %cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results
18
+ https://svelte.dev/e/state_proxy_equality_mismatch`,Zo,$o):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function su(){vt?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Zo,$o):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Bl(t){return t===this.v}function ou(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Nl(t){return!ou(t,this.v)}let au=!1;function hi(t,e){return t.label=e,jl(t.v,e),t}function jl(t,e){var i;return(i=t==null?void 0:t[Ml])==null||i.call(t,e),t}function lu(t){const e=new Error,i=cu();return i.length===0?null:(i.unshift(`
19
+ `),sn(e,"stack",{value:i.join(`
20
+ `)}),sn(e,"name",{value:t}),e)}function cu(){const t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;const e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];const i=e.split(`
21
+ `),n=[];for(let a=0;a<i.length;a++){const v=i[a],_=v.replaceAll("\\","/");if(v.trim()!=="Error"){if(v.includes("validate_each_keys"))return[];_.includes("svelte/src/internal")||_.includes("node_modules/.vite")||n.push(v)}}return n}let pr=null;function kn(t){pr=t}let qn=null;function ks(t){qn=t}let rs=null;function Ra(t){rs=t}function Tt(t,e=!1,i){pr={p:pr,i:!1,c:null,e:null,s:t,x:null,l:null},vt&&(pr.function=i,rs=i)}function Dt(t){var e=pr,i=e.e;if(i!==null){e.e=null;for(var n of i)ic(n)}return t!==void 0&&(e.x=t),e.i=!0,pr=e.p,vt&&(rs=(pr==null?void 0:pr.function)??null),t??{}}function Fl(){return!0}let zi=[];function Hl(){var t=zi;zi=[],Wd(t)}function ki(t){if(zi.length===0&&!Hn){var e=zi;queueMicrotask(()=>{e===zi&&Hl()})}zi.push(t)}function du(){for(;zi.length>0;)Hl()}const Co=new WeakMap;function Vl(t){var e=Jt;if(e===null)return zt.f|=Bi,t;if(vt&&t instanceof Error&&!Co.has(t)&&Co.set(t,uu(t,e)),(e.f&Yo)===0){if((e.f&Xo)===0)throw vt&&!e.parent&&t instanceof Error&&Wl(t),t;e.b.error(t)}else En(t,e)}function En(t,e){for(;e!==null;){if((e.f&Xo)!==0)try{e.b.error(t);return}catch(i){t=i}e=e.parent}throw vt&&t instanceof Error&&Wl(t),t}function uu(t,e){var _,s,o;const i=$i(t,"message");if(!(i&&!i.configurable)){for(var n=ia?" ":" ",a=`
22
+ ${n}in ${((_=e.fn)==null?void 0:_.name)||"<unknown>"}`,v=e.ctx;v!==null;)a+=`
23
+ ${n}in ${(s=v.function)==null?void 0:s[Bd].split("/").pop()}`,v=v.p;return{message:t.message+`
24
+ ${a}
25
+ `,stack:(o=t.stack)==null?void 0:o.split(`
26
+ `).filter(h=>!h.includes("svelte/src/internal")).join(`
27
+ `)}}}function Wl(t){const e=Co.get(t);e&&(sn(t,"message",{value:e.message}),sn(t,"stack",{value:e.stack}))}const hu=-7169;function lr(t,e){t.f=t.f&hu|e}function ea(t){(t.f&Zr)!==0||t.deps===null?lr(t,gr):lr(t,Ai)}function Ul(t){if(t!==null)for(const e of t)(e.f&wr)===0||(e.f&Hi)===0||(e.f^=Hi,Ul(e.deps))}function zl(t,e,i){(t.f&Ar)!==0?e.add(t):(t.f&Ai)!==0&&i.add(t),Ul(t.deps),lr(t,gr)}const as=new Set;let Bt=null,Es=null,xr=null,Vr=[],zs=null,ko=!1,Hn=!1;var gn,mn,Ki,bn,Zn,$n,Ji,yn,mi,Eo,Lo,ql;const Ca=class Ca{constructor(){Ut(this,mi);Se(this,"committed",!1);Se(this,"current",new Map);Se(this,"previous",new Map);Ut(this,gn,new Set);Ut(this,mn,new Set);Ut(this,Ki,0);Ut(this,bn,0);Ut(this,Zn,null);Ut(this,$n,new Set);Ut(this,Ji,new Set);Se(this,"skipped_effects",new Set);Se(this,"is_fork",!1);Ut(this,yn,!1)}is_deferred(){return this.is_fork||ke(this,bn)>0}process(e){var a;Vr=[],this.apply();var i=[],n=[];for(const v of e)kr(this,mi,Eo).call(this,v,i,n);if(this.is_deferred()){kr(this,mi,Lo).call(this,n),kr(this,mi,Lo).call(this,i);for(const v of this.skipped_effects)Ql(v)}else{for(const v of ke(this,gn))v();ke(this,gn).clear(),ke(this,Ki)===0&&kr(this,mi,ql).call(this),Es=this,Bt=null,Aa(n),Aa(i),Es=null,(a=ke(this,Zn))==null||a.resolve()}xr=null}capture(e,i){i!==yr&&!this.previous.has(e)&&this.previous.set(e,i),(e.f&Bi)===0&&(this.current.set(e,e.v),xr==null||xr.set(e,e.v))}activate(){Bt=this,this.apply()}deactivate(){Bt===this&&(Bt=null,xr=null)}flush(){if(this.activate(),Vr.length>0){if(Gl(),Bt!==null&&Bt!==this)return}else ke(this,Ki)===0&&this.process([]);this.deactivate()}discard(){for(const e of ke(this,mn))e(this);ke(this,mn).clear()}increment(e){jt(this,Ki,ke(this,Ki)+1),e&&jt(this,bn,ke(this,bn)+1)}decrement(e){jt(this,Ki,ke(this,Ki)-1),e&&jt(this,bn,ke(this,bn)-1),!ke(this,yn)&&(jt(this,yn,!0),ki(()=>{jt(this,yn,!1),this.is_deferred()?Vr.length>0&&this.flush():this.revive()}))}revive(){for(const e of ke(this,$n))ke(this,Ji).delete(e),lr(e,Ar),Li(e);for(const e of ke(this,Ji))lr(e,Ai),Li(e);this.flush()}oncommit(e){ke(this,gn).add(e)}ondiscard(e){ke(this,mn).add(e)}settled(){return(ke(this,Zn)??jt(this,Zn,Al())).promise}static ensure(){if(Bt===null){const e=Bt=new Ca;as.add(Bt),Hn||ki(()=>{Bt===e&&e.flush()})}return Bt}apply(){}};gn=new WeakMap,mn=new WeakMap,Ki=new WeakMap,bn=new WeakMap,Zn=new WeakMap,$n=new WeakMap,Ji=new WeakMap,yn=new WeakMap,mi=new WeakSet,Eo=function(e,i,n){e.f^=gr;for(var a=e.first,v=null;a!==null;){var _=a.f,s=(_&(li|ln))!==0,o=s&&(_&gr)!==0,h=o||(_&zr)!==0||this.skipped_effects.has(a);if(!h&&a.fn!==null){s?a.f^=gr:v!==null&&(_&(Ss|Ws|Dl))!==0?v.b.defer_effect(a):(_&Ss)!==0?i.push(a):ns(a)&&((_&Ri)!==0&&ke(this,Ji).add(a),Gn(a));var g=a.first;if(g!==null){a=g;continue}}var c=a.parent;for(a=a.next;a===null&&c!==null;)c===v&&(v=null),a=c.next,c=c.parent}},Lo=function(e){for(var i=0;i<e.length;i+=1)zl(e[i],ke(this,$n),ke(this,Ji))},ql=function(){var a;if(as.size>1){this.previous.clear();var e=xr,i=!0;for(const v of as){if(v===this){i=!1;continue}const _=[];for(const[o,h]of this.current){if(v.current.has(o))if(i&&h!==v.current.get(o))v.current.set(o,h);else continue;_.push(o)}if(_.length===0)continue;const s=[...v.current.keys()].filter(o=>!this.current.has(o));if(s.length>0){var n=Vr;Vr=[];const o=new Set,h=new Map;for(const g of _)Kl(g,s,o,h);if(Vr.length>0){Bt=v,v.apply();for(const g of Vr)kr(a=v,mi,Eo).call(a,g,[],[]);v.deactivate()}Vr=n}}Bt=null,xr=e}this.committed=!0,as.delete(this)};let Ni=Ca;function fu(t){var e=Hn;Hn=!0;try{for(var i;;){if(du(),Vr.length===0&&(Bt==null||Bt.flush(),Vr.length===0))return zs=null,i;Gl()}}finally{Hn=e}}function Gl(){ko=!0;var t=vt?new Set:null;try{for(var e=0;Vr.length>0;){var i=Ni.ensure();if(e++>1e3){if(vt){var n=new Map;for(const v of i.current.keys())for(const[_,s]of v.updated??[]){var a=n.get(_);a||(a={error:s.error,count:0},n.set(_,a)),a.count+=s.count}for(const v of n.values())v.error&&console.error(v.error)}vu()}if(i.process(Vr),ji.clear(),vt)for(const v of i.current.keys())t.add(v)}}finally{if(ko=!1,zs=null,vt)for(const v of t)v.updated=null}}function vu(){try{Yd()}catch(t){vt&&sn(t,"stack",{value:""}),En(t,zs)}}let ii=null;function Aa(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var n=t[i++];if((n.f&(Ci|zr))===0&&ns(n)&&(ii=new Set,Gn(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?ac(n):n.fn=null),(ii==null?void 0:ii.size)>0)){ji.clear();for(const a of ii){if((a.f&(Ci|zr))!==0)continue;const v=[a];let _=a.parent;for(;_!==null;)ii.has(_)&&(ii.delete(_),v.push(_)),_=_.parent;for(let s=v.length-1;s>=0;s--){const o=v[s];(o.f&(Ci|zr))===0&&Gn(o)}}ii.clear()}}ii=null}}function Kl(t,e,i,n){if(!i.has(t)&&(i.add(t),t.reactions!==null))for(const a of t.reactions){const v=a.f;(v&wr)!==0?Kl(a,e,i,n):(v&(Us|Ri))!==0&&(v&Ar)===0&&Jl(a,e,n)&&(lr(a,Ar),Li(a))}}function Jl(t,e,i){const n=i.get(t);if(n!==void 0)return n;if(t.deps!==null)for(const a of t.deps){if(nn.call(e,a))return!0;if((a.f&wr)!==0&&Jl(a,e,i))return i.set(a,!0),!0}return i.set(t,!1),!1}function Li(t){for(var e=zs=t;e.parent!==null;){e=e.parent;var i=e.f;if(ko&&e===Jt&&(i&Ri)!==0&&(i&Il)===0)return;if((i&(ln|li))!==0){if((i&gr)===0)return;e.f^=gr}}Vr.push(e)}function Ql(t){if(!((t.f&li)!==0&&(t.f&gr)!==0)){lr(t,gr);for(var e=t.first;e!==null;)Ql(e),e=e.next}}function _u(t){let e=0,i=on(0),n;return vt&&hi(i,"createSubscriber version"),()=>{sa()&&(r(i),Js(()=>(e===0&&(n=Wi(()=>t(()=>Vn(i)))),e+=1,()=>{ki(()=>{e-=1,e===0&&(n==null||n(),n=void 0,Vn(i))})})))}}var pu=Cn|An|Xo;function gu(t,e,i){new mu(t,e,i)}var Jr,Jo,fi,Qi,vi,Qr,Tr,_i,xi,Mi,Xi,Oi,xn,Yi,wn,Sn,pi,Fs,mr,bu,yu,Po,ps,gs,Ro;class mu{constructor(e,i,n){Ut(this,mr);Se(this,"parent");Se(this,"is_pending",!1);Ut(this,Jr);Ut(this,Jo,null);Ut(this,fi);Ut(this,Qi);Ut(this,vi);Ut(this,Qr,null);Ut(this,Tr,null);Ut(this,_i,null);Ut(this,xi,null);Ut(this,Mi,null);Ut(this,Xi,0);Ut(this,Oi,0);Ut(this,xn,!1);Ut(this,Yi,!1);Ut(this,wn,new Set);Ut(this,Sn,new Set);Ut(this,pi,null);Ut(this,Fs,_u(()=>(jt(this,pi,on(ke(this,Xi))),vt&&hi(ke(this,pi),"$effect.pending()"),()=>{jt(this,pi,null)})));jt(this,Jr,e),jt(this,fi,i),jt(this,Qi,n),this.parent=Jt.b,this.is_pending=!!ke(this,fi).pending,jt(this,vi,aa(()=>{Jt.b=this;{var a=kr(this,mr,Po).call(this);try{jt(this,Qr,Xr(()=>n(a)))}catch(v){this.error(v)}ke(this,Oi)>0?kr(this,mr,gs).call(this):this.is_pending=!1}return()=>{var v;(v=ke(this,Mi))==null||v.remove()}},pu))}defer_effect(e){zl(e,ke(this,wn),ke(this,Sn))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!ke(this,fi).pending}update_pending_count(e){kr(this,mr,Ro).call(this,e),jt(this,Xi,ke(this,Xi)+e),!(!ke(this,pi)||ke(this,xn))&&(jt(this,xn,!0),ki(()=>{jt(this,xn,!1),ke(this,pi)&&Pn(ke(this,pi),ke(this,Xi))}))}get_effect_pending(){return ke(this,Fs).call(this),r(ke(this,pi))}error(e){var i=ke(this,fi).onerror;let n=ke(this,fi).failed;if(ke(this,Yi)||!i&&!n)throw e;ke(this,Qr)&&(Mr(ke(this,Qr)),jt(this,Qr,null)),ke(this,Tr)&&(Mr(ke(this,Tr)),jt(this,Tr,null)),ke(this,_i)&&(Mr(ke(this,_i)),jt(this,_i,null));var a=!1,v=!1;const _=()=>{if(a){su();return}a=!0,v&&iu(),Ni.ensure(),jt(this,Xi,0),ke(this,_i)!==null&&tn(ke(this,_i),()=>{jt(this,_i,null)}),this.is_pending=this.has_pending_snippet(),jt(this,Qr,kr(this,mr,ps).call(this,()=>(jt(this,Yi,!1),Xr(()=>ke(this,Qi).call(this,ke(this,Jr)))))),ke(this,Oi)>0?kr(this,mr,gs).call(this):this.is_pending=!1};ki(()=>{try{v=!0,i==null||i(e,_),v=!1}catch(s){En(s,ke(this,vi)&&ke(this,vi).parent)}n&&jt(this,_i,kr(this,mr,ps).call(this,()=>{Ni.ensure(),jt(this,Yi,!0);try{return Xr(()=>{n(ke(this,Jr),()=>e,()=>_)})}catch(s){return En(s,ke(this,vi).parent),null}finally{jt(this,Yi,!1)}}))})}}Jr=new WeakMap,Jo=new WeakMap,fi=new WeakMap,Qi=new WeakMap,vi=new WeakMap,Qr=new WeakMap,Tr=new WeakMap,_i=new WeakMap,xi=new WeakMap,Mi=new WeakMap,Xi=new WeakMap,Oi=new WeakMap,xn=new WeakMap,Yi=new WeakMap,wn=new WeakMap,Sn=new WeakMap,pi=new WeakMap,Fs=new WeakMap,mr=new WeakSet,bu=function(){try{jt(this,Qr,Xr(()=>ke(this,Qi).call(this,ke(this,Jr))))}catch(e){this.error(e)}},yu=function(){const e=ke(this,fi).pending;e&&(jt(this,Tr,Xr(()=>e(ke(this,Jr)))),ki(()=>{var i=kr(this,mr,Po).call(this);jt(this,Qr,kr(this,mr,ps).call(this,()=>(Ni.ensure(),Xr(()=>ke(this,Qi).call(this,i))))),ke(this,Oi)>0?kr(this,mr,gs).call(this):(tn(ke(this,Tr),()=>{jt(this,Tr,null)}),this.is_pending=!1)}))},Po=function(){var e=ke(this,Jr);return this.is_pending&&(jt(this,Mi,Ei()),ke(this,Jr).before(ke(this,Mi)),e=ke(this,Mi)),e},ps=function(e){var i=Jt,n=zt,a=pr;oi(ke(this,vi)),ei(ke(this,vi)),kn(ke(this,vi).ctx);try{return e()}catch(v){return Vl(v),null}finally{oi(i),ei(n),kn(a)}},gs=function(){const e=ke(this,fi).pending;ke(this,Qr)!==null&&(jt(this,xi,document.createDocumentFragment()),ke(this,xi).append(ke(this,Mi)),dc(ke(this,Qr),ke(this,xi))),ke(this,Tr)===null&&jt(this,Tr,Xr(()=>e(ke(this,Jr))))},Ro=function(e){var i;if(!this.has_pending_snippet()){this.parent&&kr(i=this.parent,mr,Ro).call(i,e);return}if(jt(this,Oi,ke(this,Oi)+e),ke(this,Oi)===0){this.is_pending=!1;for(const n of ke(this,wn))lr(n,Ar),Li(n);for(const n of ke(this,Sn))lr(n,Ai),Li(n);ke(this,wn).clear(),ke(this,Sn).clear(),ke(this,Tr)&&tn(ke(this,Tr),()=>{jt(this,Tr,null)}),ke(this,xi)&&(ke(this,Jr).before(ke(this,xi)),jt(this,xi,null))}};function xu(t,e,i,n){const a=qs;var v=t.filter(p=>!p.settled);if(i.length===0&&v.length===0){n(e.map(a));return}var _=Bt,s=Jt,o=wu(),h=v.length===1?v[0].promise:v.length>1?Promise.all(v.map(p=>p.promise)):null;function g(p){o();try{n(p)}catch(b){(s.f&Ci)===0&&En(b,s)}_==null||_.deactivate(),Ao()}if(i.length===0){h.then(()=>g(e.map(a)));return}function c(){o(),Promise.all(i.map(p=>Cu(p))).then(p=>g([...e.map(a),...p])).catch(p=>En(p,s))}h?h.then(c):c()}function wu(){var t=Jt,e=zt,i=pr,n=Bt;if(vt)var a=qn;return function(_=!0){oi(t),ei(e),kn(i),_&&(n==null||n.activate()),vt&&ks(a)}}function Ao(){oi(null),ei(null),kn(null),vt&&ks(null)}const Su=new Set;function qs(t){var e=wr|Ar,i=zt!==null&&(zt.f&wr)!==0?zt:null;return Jt!==null&&(Jt.f|=An),{ctx:pr,deps:null,effects:null,equals:Bl,f:e,fn:t,reactions:null,rv:0,v:yr,wv:0,parent:i??Jt,ac:null}}function Cu(t,e,i){let n=Jt;n===null&&Gd();var a=n.b,v=void 0,_=on(yr);vt&&(_.label=e);var s=!zt,o=new Map;return Fu(()=>{var b;var h=Al();v=h.promise;try{Promise.resolve(t()).then(h.resolve,h.reject).then(()=>{g===Bt&&g.committed&&g.deactivate(),Ao()})}catch(w){h.reject(w),Ao()}var g=Bt;if(s){var c=a.is_rendered();a.update_pending_count(1),g.increment(c),(b=o.get(g))==null||b.reject(fn),o.delete(g),o.set(g,h)}const p=(w,m=void 0)=>{if(g.activate(),m)m!==fn&&(_.f|=Bi,Pn(_,m));else{(_.f&Bi)!==0&&(_.f^=Bi),Pn(_,w);for(const[u,l]of o){if(o.delete(u),u===g)break;l.reject(fn)}}s&&(a.update_pending_count(-1),g.decrement(c))};h.promise.then(p,w=>p(null,w||"unknown"))}),oa(()=>{for(const h of o.values())h.reject(fn)}),vt&&(_.f|=Us),new Promise(h=>{function g(c){function p(){c===v?h(_):g(v)}c.then(p,p)}g(v)})}function ge(t){const e=qs(t);return uc(e),e}function Xl(t){const e=qs(t);return e.equals=Nl,e}function To(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)Mr(e[i])}}let no=[];function ku(t){for(var e=t.parent;e!==null;){if((e.f&wr)===0)return(e.f&Ci)===0?e:null;e=e.parent}return null}function ta(t){var e,i=Jt;if(oi(ku(t)),vt){let n=Ln;Ta(new Set);try{nn.call(no,t)&&Kd(),no.push(t),t.f&=~Hi,To(t),e=Do(t)}finally{oi(i),Ta(n),no.pop()}}else try{t.f&=~Hi,To(t),e=Do(t)}finally{oi(i)}return e}function Yl(t){var e=ta(t);if(!t.equals(e)&&(t.wv=fc(),(!(Bt!=null&&Bt.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){lr(t,gr);return}Vi||(xr!==null?(sa()||Bt!=null&&Bt.is_fork)&&xr.set(t,e):ea(t))}let Ln=new Set;const ji=new Map;function Ta(t){Ln=t}let ra=!1;function Eu(){ra=!0}function on(t,e){var i={f:0,v:t,reactions:null,equals:Bl,rv:0,wv:0};return i}function K(t,e){const i=on(t);return uc(i),i}function Lu(t,e=!1,i=!0){const n=on(t);return e||(n.equals=Nl),n}function k(t,e,i=!1){zt!==null&&(!si||(zt.f&Cs)!==0)&&Fl()&&(zt.f&(wr|Ri|Us|Cs))!==0&&($r===null||!nn.call($r,t))&&ru();let n=i?gt(e):e;return vt&&jl(n,t.label),Pn(t,n)}function Pn(t,e){var a;if(!t.equals(e)){var i=t.v;Vi?ji.set(t,e):ji.set(t,i),t.v=e;var n=Ni.ensure();if(n.capture(t,i),vt){if(Jt!==null){t.updated??(t.updated=new Map);const v=(((a=t.updated.get(""))==null?void 0:a.count)??0)+1;if(t.updated.set("",{error:null,count:v}),v>5){const _=lu("updated at");if(_!==null){let s=t.updated.get(_.stack);s||(s={error:_,count:0},t.updated.set(_.stack,s)),s.count++}}}Jt!==null&&(t.set_during_effect=!0)}if((t.f&wr)!==0){const v=t;(t.f&Ar)!==0&&ta(v),ea(v)}t.wv=fc(),$l(t,Ar),Jt!==null&&(Jt.f&gr)!==0&&(Jt.f&(li|ln))===0&&(Kr===null?Vu([t]):Kr.push(t)),!n.is_fork&&Ln.size>0&&!ra&&Zl()}return e}function Zl(){ra=!1;for(const t of Ln)(t.f&gr)!==0&&lr(t,Ai),ns(t)&&Gn(t);Ln.clear()}function Da(t,e=1){var i=r(t),n=e===1?i++:i--;return k(t,i),n}function Vn(t){k(t,t.v+1)}function $l(t,e){var i=t.reactions;if(i!==null)for(var n=i.length,a=0;a<n;a++){var v=i[a],_=v.f;if(vt&&(_&Cs)!==0){Ln.add(v);continue}var s=(_&Ar)===0;if(s&&lr(v,e),(_&wr)!==0){var o=v;xr==null||xr.delete(o),(_&Hi)===0&&(_&Zr&&(v.f|=Hi),$l(o,Ai))}else s&&((_&Ri)!==0&&ii!==null&&ii.add(v),Li(v))}}const Pu=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function gt(t){if(typeof t!="object"||t===null||en in t)return t;const e=Rl(t);if(e!==Hd&&e!==Vd)return t;var i=new Map,n=Qo(t),a=K(0),v=rn,_=g=>{if(rn===v)return g();var c=zt,p=rn;ei(null),Oa(v);var b=g();return ei(c),Oa(p),b};n&&(i.set("length",K(t.length)),vt&&(t=Tu(t)));var s="";let o=!1;function h(g){if(!o){o=!0,s=g,hi(a,`${s} version`);for(const[c,p]of i)hi(p,Ui(s,c));o=!1}}return new Proxy(t,{defineProperty(g,c,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&eu();var b=i.get(c);return b===void 0?b=_(()=>{var w=K(p.value);return i.set(c,w),vt&&typeof c=="string"&&hi(w,Ui(s,c)),w}):k(b,p.value,!0),!0},deleteProperty(g,c){var p=i.get(c);if(p===void 0){if(c in g){const b=_(()=>K(yr));i.set(c,b),Vn(a),vt&&hi(b,Ui(s,c))}}else k(p,yr),Vn(a);return!0},get(g,c,p){var u;if(c===en)return t;if(vt&&c===Ml)return h;var b=i.get(c),w=c in g;if(b===void 0&&(!w||(u=$i(g,c))!=null&&u.writable)&&(b=_(()=>{var l=gt(w?g[c]:yr),d=K(l);return vt&&hi(d,Ui(s,c)),d}),i.set(c,b)),b!==void 0){var m=r(b);return m===yr?void 0:m}return Reflect.get(g,c,p)},getOwnPropertyDescriptor(g,c){var p=Reflect.getOwnPropertyDescriptor(g,c);if(p&&"value"in p){var b=i.get(c);b&&(p.value=r(b))}else if(p===void 0){var w=i.get(c),m=w==null?void 0:w.v;if(w!==void 0&&m!==yr)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return p},has(g,c){var m;if(c===en)return!0;var p=i.get(c),b=p!==void 0&&p.v!==yr||Reflect.has(g,c);if(p!==void 0||Jt!==null&&(!b||(m=$i(g,c))!=null&&m.writable)){p===void 0&&(p=_(()=>{var u=b?gt(g[c]):yr,l=K(u);return vt&&hi(l,Ui(s,c)),l}),i.set(c,p));var w=r(p);if(w===yr)return!1}return b},set(g,c,p,b){var S;var w=i.get(c),m=c in g;if(n&&c==="length")for(var u=p;u<w.v;u+=1){var l=i.get(u+"");l!==void 0?k(l,yr):u in g&&(l=_(()=>K(yr)),i.set(u+"",l),vt&&hi(l,Ui(s,u)))}if(w===void 0)(!m||(S=$i(g,c))!=null&&S.writable)&&(w=_(()=>K(void 0)),vt&&hi(w,Ui(s,c)),k(w,gt(p)),i.set(c,w));else{m=w.v!==yr;var d=_(()=>gt(p));k(w,d)}var f=Reflect.getOwnPropertyDescriptor(g,c);if(f!=null&&f.set&&f.set.call(b,p),!m){if(n&&typeof c=="string"){var y=i.get("length"),E=Number(c);Number.isInteger(E)&&E>=y.v&&k(y,E+1)}Vn(a)}return!0},ownKeys(g){r(a);var c=Reflect.ownKeys(g).filter(w=>{var m=i.get(w);return m===void 0||m.v!==yr});for(var[p,b]of i)b.v!==yr&&!(p in g)&&c.push(p);return c},setPrototypeOf(){tu()}})}function Ui(t,e){return typeof e=="symbol"?`${t}[Symbol(${e.description??""})]`:Pu.test(e)?`${t}.${e}`:/^\d+$/.test(e)?`${t}[${e}]`:`${t}['${e}']`}function Wn(t){try{if(t!==null&&typeof t=="object"&&en in t)return t[en]}catch{}return t}function Ru(t,e){return Object.is(Wn(t),Wn(e))}const Au=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function Tu(t){return new Proxy(t,{get(e,i,n){var a=Reflect.get(e,i,n);return Au.has(i)?function(...v){Eu();var _=a.apply(this,v);return Zl(),_}:a}})}function Du(){const t=Array.prototype,e=Array.__svelte_cleanup;e&&e();const{indexOf:i,lastIndexOf:n,includes:a}=t;t.indexOf=function(v,_){const s=i.call(this,v,_);if(s===-1){for(let o=_??0;o<this.length;o+=1)if(Wn(this[o])===v){io("array.indexOf(...)");break}}return s},t.lastIndexOf=function(v,_){const s=n.call(this,v,_??this.length-1);if(s===-1){for(let o=0;o<=(_??this.length-1);o+=1)if(Wn(this[o])===v){io("array.lastIndexOf(...)");break}}return s},t.includes=function(v,_){const s=a.call(this,v,_);if(!s){for(let o=0;o<this.length;o+=1)if(Wn(this[o])===v){io("array.includes(...)");break}}return s},Array.__svelte_cleanup=()=>{t.indexOf=i,t.lastIndexOf=n,t.includes=a}}var ai,ia,ec,tc;function Iu(){if(ai===void 0){ai=window,ia=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;ec=$i(e,"firstChild").get,tc=$i(e,"nextSibling").get,La(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),La(i)&&(i.__t=void 0),vt&&(t.__svelte_meta=null,Du())}}function Ei(t=""){return document.createTextNode(t)}function Wr(t){return ec.call(t)}function is(t){return tc.call(t)}function C(t,e){return Wr(t)}function Ae(t,e=!1){{var i=Wr(t);return i instanceof Comment&&i.data===""?is(i):i}}function R(t,e=1,i=!1){let n=t;for(;e--;)n=is(n);return n}function Mu(t){t.textContent=""}function rc(){return!1}let Ia=!1;function Ou(){Ia||(Ia=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const i of t.target.elements)(e=i.__on_r)==null||e.call(i)})},{capture:!0}))}function Gs(t){var e=zt,i=Jt;ei(null),oi(null);try{return t()}finally{ei(e),oi(i)}}function na(t,e,i,n=i){t.addEventListener(e,()=>Gs(i));const a=t.__on_r;a?t.__on_r=()=>{a(),n(!0)}:t.__on_r=()=>n(!0),Ou()}function Bu(t){Jt===null&&(zt===null&&Xd(t),Qd()),Vi&&Jd(t)}function Nu(t,e){var i=e.last;i===null?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}function Ti(t,e,i){var n=Jt;if(vt)for(;n!==null&&(n.f&Cs)!==0;)n=n.parent;n!==null&&(n.f&zr)!==0&&(t|=zr);var a={ctx:pr,deps:null,nodes:null,f:t|Ar|Zr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(vt&&(a.component_function=rs),i)try{Gn(a),a.f|=Yo}catch(s){throw Mr(a),s}else e!==null&&Li(a);var v=a;if(i&&v.deps===null&&v.teardown===null&&v.nodes===null&&v.first===v.last&&(v.f&An)===0&&(v=v.first,(t&Ri)!==0&&(t&Cn)!==0&&v!==null&&(v.f|=Cn)),v!==null&&(v.parent=n,n!==null&&Nu(v,n),zt!==null&&(zt.f&wr)!==0&&(t&ln)===0)){var _=zt;(_.effects??(_.effects=[])).push(v)}return a}function sa(){return zt!==null&&!si}function oa(t){const e=Ti(Ws,null,!1);return lr(e,gr),e.teardown=t,e}function St(t){Bu("$effect"),vt&&sn(t,"name",{value:"$effect"});var e=Jt.f,i=!zt&&(e&li)!==0&&(e&Yo)===0;if(i){var n=pr;(n.e??(n.e=[])).push(t)}else return ic(t)}function ic(t){return Ti(Ss|Ud,t,!1)}function ju(t){Ni.ensure();const e=Ti(ln|An,t,!0);return(i={})=>new Promise(n=>{i.outro?tn(e,()=>{Mr(e),n(void 0)}):(Mr(e),n(void 0))})}function Ks(t){return Ti(Ss,t,!1)}function Fu(t){return Ti(Us|An,t,!0)}function Js(t,e=0){return Ti(Ws|e,t,!0)}function ee(t,e=[],i=[],n=[]){xu(n,e,i,a=>{Ti(Ws,()=>t(...a.map(r)),!0)})}function aa(t,e=0){var i=Ti(Ri|e,t,!0);return vt&&(i.dev_stack=qn),i}function Xr(t){return Ti(li|An,t,!0)}function nc(t){var e=t.teardown;if(e!==null){const i=Vi,n=zt;Ma(!0),ei(null);try{e.call(null)}finally{Ma(i),ei(n)}}}function sc(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const a=i.ac;a!==null&&Gs(()=>{a.abort(fn)});var n=i.next;(i.f&ln)!==0?i.parent=null:Mr(i,e),i=n}}function Hu(t){for(var e=t.first;e!==null;){var i=e.next;(e.f&li)===0&&Mr(e),e=i}}function Mr(t,e=!0){var i=!1;(e||(t.f&Il)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(oc(t.nodes.start,t.nodes.end),i=!0),sc(t,e&&!i),Ls(t,0),lr(t,Ci);var n=t.nodes&&t.nodes.t;if(n!==null)for(const v of n)v.stop();nc(t);var a=t.parent;a!==null&&a.first!==null&&ac(t),vt&&(t.component_function=null),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function oc(t,e){for(;t!==null;){var i=t===e?null:is(t);t.remove(),t=i}}function ac(t){var e=t.parent,i=t.prev,n=t.next;i!==null&&(i.next=n),n!==null&&(n.prev=i),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=i))}function tn(t,e,i=!0){var n=[];lc(t,n,!0);var a=()=>{i&&Mr(t),e&&e()},v=n.length;if(v>0){var _=()=>--v||a();for(var s of n)s.out(_)}else a()}function lc(t,e,i){if((t.f&zr)===0){t.f^=zr;var n=t.nodes&&t.nodes.t;if(n!==null)for(const s of n)(s.is_global||i)&&e.push(s);for(var a=t.first;a!==null;){var v=a.next,_=(a.f&Cn)!==0||(a.f&li)!==0&&(t.f&Ri)!==0;lc(a,e,_?i:!1),a=v}}}function la(t){cc(t,!0)}function cc(t,e){if((t.f&zr)!==0){t.f^=zr,(t.f&gr)===0&&(lr(t,Ar),Li(t));for(var i=t.first;i!==null;){var n=i.next,a=(i.f&Cn)!==0||(i.f&li)!==0;cc(i,a?e:!1),i=n}var v=t.nodes&&t.nodes.t;if(v!==null)for(const _ of v)(_.is_global||e)&&_.in()}}function dc(t,e){if(t.nodes)for(var i=t.nodes.start,n=t.nodes.end;i!==null;){var a=i===n?null:is(i);e.append(i),i=a}}let ms=!1,Vi=!1;function Ma(t){Vi=t}let zt=null,si=!1;function ei(t){zt=t}let Jt=null;function oi(t){Jt=t}let $r=null;function uc(t){zt!==null&&($r===null?$r=[t]:$r.push(t))}let Ir=null,Fr=0,Kr=null;function Vu(t){Kr=t}let hc=1,qi=0,rn=qi;function Oa(t){rn=t}function fc(){return++hc}function ns(t){var e=t.f;if((e&Ar)!==0)return!0;if(e&wr&&(t.f&=~Hi),(e&Ai)!==0){for(var i=t.deps,n=i.length,a=0;a<n;a++){var v=i[a];if(ns(v)&&Yl(v),v.wv>t.wv)return!0}(e&Zr)!==0&&xr===null&&lr(t,gr)}return!1}function vc(t,e,i=!0){var n=t.reactions;if(n!==null&&!($r!==null&&nn.call($r,t)))for(var a=0;a<n.length;a++){var v=n[a];(v.f&wr)!==0?vc(v,e,!1):e===v&&(i?lr(v,Ar):(v.f&gr)!==0&&lr(v,Ai),Li(v))}}function Do(t){var m;var e=Ir,i=Fr,n=Kr,a=zt,v=$r,_=pr,s=si,o=rn,h=t.f;Ir=null,Fr=0,Kr=null,zt=(h&(li|ln))===0?t:null,$r=null,kn(t.ctx),si=!1,rn=++qi,t.ac!==null&&(Gs(()=>{t.ac.abort(fn)}),t.ac=null);try{t.f|=So;var g=t.fn,c=g(),p=t.deps,b=Bt==null?void 0:Bt.is_fork;if(Ir!==null){var w;if(b||Ls(t,Fr),p!==null&&Fr>0)for(p.length=Fr+Ir.length,w=0;w<Ir.length;w++)p[Fr+w]=Ir[w];else t.deps=p=Ir;if(sa()&&(t.f&Zr)!==0)for(w=Fr;w<p.length;w++)((m=p[w]).reactions??(m.reactions=[])).push(t)}else!b&&p!==null&&Fr<p.length&&(Ls(t,Fr),p.length=Fr);if(Fl()&&Kr!==null&&!si&&p!==null&&(t.f&(wr|Ai|Ar))===0)for(w=0;w<Kr.length;w++)vc(Kr[w],t);if(a!==null&&a!==t){if(qi++,a.deps!==null)for(let u=0;u<i;u+=1)a.deps[u].rv=qi;if(e!==null)for(const u of e)u.rv=qi;Kr!==null&&(n===null?n=Kr:n.push(...Kr))}return(t.f&Bi)!==0&&(t.f^=Bi),c}catch(u){return Vl(u)}finally{t.f^=So,Ir=e,Fr=i,Kr=n,zt=a,$r=v,kn(_),si=s,rn=o}}function Wu(t,e){let i=e.reactions;if(i!==null){var n=jd.call(i,t);if(n!==-1){var a=i.length-1;a===0?i=e.reactions=null:(i[n]=i[a],i.pop())}}if(i===null&&(e.f&wr)!==0&&(Ir===null||!nn.call(Ir,e))){var v=e;(v.f&Zr)!==0&&(v.f^=Zr,v.f&=~Hi),ea(v),To(v),Ls(v,0)}}function Ls(t,e){var i=t.deps;if(i!==null)for(var n=e;n<i.length;n++)Wu(t,i[n])}function Gn(t){var e=t.f;if((e&Ci)===0){lr(t,gr);var i=Jt,n=ms;if(Jt=t,ms=!0,vt){var a=rs;Ra(t.component_function);var v=qn;ks(t.dev_stack??qn)}try{(e&(Ri|Dl))!==0?Hu(t):sc(t),nc(t);var _=Do(t);t.teardown=typeof _=="function"?_:null,t.wv=hc;var s;vt&&au&&(t.f&Ar)!==0&&t.deps}finally{ms=n,Jt=i,vt&&(Ra(a),ks(v))}}}async function _c(){await Promise.resolve(),fu()}function r(t){var e=t.f,i=(e&wr)!==0;if(zt!==null&&!si){var n=Jt!==null&&(Jt.f&Ci)!==0;if(!n&&($r===null||!nn.call($r,t))){var a=zt.deps;if((zt.f&So)!==0)t.rv<qi&&(t.rv=qi,Ir===null&&a!==null&&a[Fr]===t?Fr++:Ir===null?Ir=[t]:Ir.push(t));else{(zt.deps??(zt.deps=[])).push(t);var v=t.reactions;v===null?t.reactions=[zt]:nn.call(v,zt)||v.push(zt)}}}if(vt&&Su.delete(t),Vi&&ji.has(t))return ji.get(t);if(i){var _=t;if(Vi){var s=_.v;return((_.f&gr)===0&&_.reactions!==null||gc(_))&&(s=ta(_)),ji.set(_,s),s}var o=(_.f&Zr)===0&&!si&&zt!==null&&(ms||(zt.f&Zr)!==0),h=_.deps===null;ns(_)&&(o&&(_.f|=Zr),Yl(_)),o&&!h&&pc(_)}if(xr!=null&&xr.has(t))return xr.get(t);if((t.f&Bi)!==0)throw t.v;return t.v}function pc(t){if(t.deps!==null){t.f|=Zr;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&wr)!==0&&(e.f&Zr)===0&&pc(e)}}function gc(t){if(t.v===yr)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(ji.has(e)||(e.f&wr)!==0&&gc(e))return!0;return!1}function Wi(t){var e=si;try{return si=!0,t()}finally{si=e}}const mc=new Set,Io=new Set;function Uu(t,e,i,n={}){function a(v){if(n.capture||On.call(e,v),!v.cancelBubble)return Gs(()=>i==null?void 0:i.call(this,v))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?ki(()=>{e.addEventListener(t,a,n)}):e.addEventListener(t,a,n),a}function Qt(t,e,i,n,a){var v={capture:n,passive:a},_=Uu(t,e,i,v);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&oa(()=>{e.removeEventListener(t,_,v)})}function Ft(t){for(var e=0;e<t.length;e++)mc.add(t[e]);for(var i of Io)i(t)}let Ba=null;function On(t){var u;var e=this,i=e.ownerDocument,n=t.type,a=((u=t.composedPath)==null?void 0:u.call(t))||[],v=a[0]||t.target;Ba=t;var _=0,s=Ba===t&&t.__root;if(s){var o=a.indexOf(s);if(o!==-1&&(e===document||e===window)){t.__root=e;return}var h=a.indexOf(e);if(h===-1)return;o<=h&&(_=o)}if(v=a[_]||t.target,v!==e){sn(t,"currentTarget",{configurable:!0,get(){return v||i}});var g=zt,c=Jt;ei(null),oi(null);try{for(var p,b=[];v!==null;){var w=v.assignedSlot||v.parentNode||v.host||null;try{var m=v["__"+n];m!=null&&(!v.disabled||t.target===v)&&m.call(v,t)}catch(l){p?b.push(l):p=l}if(t.cancelBubble||w===e||w===null)break;v=w}if(p){for(let l of b)queueMicrotask(()=>{throw l});throw p}}finally{t.__root=e,delete t.currentTarget,ei(g),oi(c)}}}function ca(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function an(t,e){var i=Jt;i.nodes===null&&(i.nodes={start:t,end:e,a:null,t:null})}function I(t,e){var i=(e&Pl)!==0,n=(e&Od)!==0,a,v=!t.startsWith("<!>");return()=>{a===void 0&&(a=ca(v?t:"<!>"+t),i||(a=Wr(a)));var _=n||ia?document.importNode(a,!0):a.cloneNode(!0);if(i){var s=Wr(_),o=_.lastChild;an(s,o)}else an(_,_);return _}}function zu(t,e,i="svg"){var n=!t.startsWith("<!>"),a=(e&Pl)!==0,v=`<${i}>${n?t:"<!>"+t}</${i}>`,_;return()=>{if(!_){var s=ca(v),o=Wr(s);if(a)for(_=document.createDocumentFragment();Wr(o);)_.appendChild(Wr(o));else _=Wr(o)}var h=_.cloneNode(!0);if(a){var g=Wr(h),c=h.lastChild;an(g,c)}else an(h,h);return h}}function rr(t,e){return zu(t,e,"svg")}function Xt(t=""){{var e=Ei(t+"");return an(e,e),e}}function et(){var t=document.createDocumentFragment(),e=document.createComment(""),i=Ei();return t.append(e,i),an(e,i),t}function A(t,e){t!==null&&t.before(e)}const qu=["touchstart","touchmove"];function Gu(t){return qu.includes(t)}function Y(t,e){var i=e==null?"":typeof e=="object"?e+"":e;i!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=i,t.nodeValue=i+"")}function Ku(t,e){return Ju(t,e)}const hn=new Map;function Ju(t,{target:e,anchor:i,props:n={},events:a,context:v,intro:_=!0}){Iu();var s=new Set,o=c=>{for(var p=0;p<c.length;p++){var b=c[p];if(!s.has(b)){s.add(b);var w=Gu(b);e.addEventListener(b,On,{passive:w});var m=hn.get(b);m===void 0?(document.addEventListener(b,On,{passive:w}),hn.set(b,1)):hn.set(b,m+1)}}};o(Vs(mc)),Io.add(o);var h=void 0,g=ju(()=>{var c=i??e.appendChild(Ei());return gu(c,{pending:()=>{}},p=>{if(v){Tt({});var b=pr;b.c=v}a&&(n.$$events=a),h=t(p,n)||{},v&&Dt()}),()=>{var w;for(var p of s){e.removeEventListener(p,On);var b=hn.get(p);--b===0?(document.removeEventListener(p,On),hn.delete(p)):hn.set(p,b)}Io.delete(o),c!==i&&((w=c.parentNode)==null||w.removeChild(c))}});return Qu.set(h,g),h}let Qu=new WeakMap;var ni,gi,Hr,Zi,es,ts,Hs;class Xu{constructor(e,i=!0){Se(this,"anchor");Ut(this,ni,new Map);Ut(this,gi,new Map);Ut(this,Hr,new Map);Ut(this,Zi,new Set);Ut(this,es,!0);Ut(this,ts,()=>{var e=Bt;if(ke(this,ni).has(e)){var i=ke(this,ni).get(e),n=ke(this,gi).get(i);if(n)la(n),ke(this,Zi).delete(i);else{var a=ke(this,Hr).get(i);a&&(ke(this,gi).set(i,a.effect),ke(this,Hr).delete(i),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),n=a.effect)}for(const[v,_]of ke(this,ni)){if(ke(this,ni).delete(v),v===e)break;const s=ke(this,Hr).get(_);s&&(Mr(s.effect),ke(this,Hr).delete(_))}for(const[v,_]of ke(this,gi)){if(v===i||ke(this,Zi).has(v))continue;const s=()=>{if(Array.from(ke(this,ni).values()).includes(v)){var h=document.createDocumentFragment();dc(_,h),h.append(Ei()),ke(this,Hr).set(v,{effect:_,fragment:h})}else Mr(_);ke(this,Zi).delete(v),ke(this,gi).delete(v)};ke(this,es)||!n?(ke(this,Zi).add(v),tn(_,s,!1)):s()}}});Ut(this,Hs,e=>{ke(this,ni).delete(e);const i=Array.from(ke(this,ni).values());for(const[n,a]of ke(this,Hr))i.includes(n)||(Mr(a.effect),ke(this,Hr).delete(n))});this.anchor=e,jt(this,es,i)}ensure(e,i){var n=Bt,a=rc();if(i&&!ke(this,gi).has(e)&&!ke(this,Hr).has(e))if(a){var v=document.createDocumentFragment(),_=Ei();v.append(_),ke(this,Hr).set(e,{effect:Xr(()=>i(_)),fragment:v})}else ke(this,gi).set(e,Xr(()=>i(this.anchor)));if(ke(this,ni).set(n,e),a){for(const[s,o]of ke(this,gi))s===e?n.skipped_effects.delete(o):n.skipped_effects.add(o);for(const[s,o]of ke(this,Hr))s===e?n.skipped_effects.delete(o.effect):n.skipped_effects.add(o.effect);n.oncommit(ke(this,ts)),n.ondiscard(ke(this,Hs))}else ke(this,ts).call(this)}}ni=new WeakMap,gi=new WeakMap,Hr=new WeakMap,Zi=new WeakMap,es=new WeakMap,ts=new WeakMap,Hs=new WeakMap;if(vt){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;$d(e)},set:n=>{i=n}})}};var Zw=t;t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function bc(t){pr===null&&Ol("onMount"),St(()=>{const e=Wi(t);if(typeof e=="function")return e})}function Yu(t){pr===null&&Ol("onDestroy"),bc(()=>()=>Wi(t))}function H(t,e,i=!1){var n=new Xu(t),a=i?Cn:0;function v(_,s){n.ensure(_,s)}aa(()=>{var _=!1;e((s,o=!0)=>{_=!0,v(o,s)}),_||v(!1,null)},a)}function Pr(t,e){return e}function Zu(t,e,i){for(var n=[],a=e.length,v,_=e.length,s=0;s<a;s++){let c=e[s];tn(c,()=>{if(v){if(v.pending.delete(c),v.done.add(c),v.pending.size===0){var p=t.outrogroups;Mo(Vs(v.done)),p.delete(v),p.size===0&&(t.outrogroups=null)}}else _-=1},!1)}if(_===0){var o=n.length===0&&i!==null;if(o){var h=i,g=h.parentNode;Mu(g),g.append(h),t.items.clear()}Mo(e,!o)}else v={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(v)}function Mo(t,e=!0){for(var i=0;i<t.length;i++)Mr(t[i],e)}var Na;function At(t,e,i,n,a,v=null){var _=t,s=new Map,o=(e&Ll)!==0;if(o){var h=t;_=h.appendChild(Ei())}var g=null,c=Xl(()=>{var l=i();return Qo(l)?l:l==null?[]:Vs(l)}),p,b=!0;function w(){u.fallback=g,$u(u,p,_,e,n),g!==null&&(p.length===0?(g.f&Si)===0?la(g):(g.f^=Si,Bn(g,null,_)):tn(g,()=>{g=null}))}var m=aa(()=>{p=r(c);for(var l=p.length,d=new Set,f=Bt,y=rc(),E=0;E<l;E+=1){var S=p[E],L=n(S,E),x=b?null:s.get(L);x?(x.v&&Pn(x.v,S),x.i&&Pn(x.i,E),y&&f.skipped_effects.delete(x.e)):(x=eh(s,b?_:Na??(Na=Ei()),S,L,E,a,e,i),b||(x.e.f|=Si),s.set(L,x)),d.add(L)}if(l===0&&v&&!g&&(b?g=Xr(()=>v(_)):(g=Xr(()=>v(Na??(Na=Ei()))),g.f|=Si)),!b)if(y){for(const[P,B]of s)d.has(P)||f.skipped_effects.add(B.e);f.oncommit(w),f.ondiscard(()=>{})}else w();r(c)}),u={effect:m,items:s,outrogroups:null,fallback:g};b=!1}function In(t){for(;t!==null&&(t.f&li)===0;)t=t.next;return t}function $u(t,e,i,n,a){var B,j,V,N,X,W,Q,ne,le;var v=(n&Rd)!==0,_=e.length,s=t.items,o=In(t.effect.first),h,g=null,c,p=[],b=[],w,m,u,l;if(v)for(l=0;l<_;l+=1)w=e[l],m=a(w,l),u=s.get(m).e,(u.f&Si)===0&&((j=(B=u.nodes)==null?void 0:B.a)==null||j.measure(),(c??(c=new Set)).add(u));for(l=0;l<_;l+=1){if(w=e[l],m=a(w,l),u=s.get(m).e,t.outrogroups!==null)for(const D of t.outrogroups)D.pending.delete(u),D.done.delete(u);if((u.f&Si)!==0)if(u.f^=Si,u===o)Bn(u,null,i);else{var d=g?g.next:o;u===t.effect.last&&(t.effect.last=u.prev),u.prev&&(u.prev.next=u.next),u.next&&(u.next.prev=u.prev),Ii(t,g,u),Ii(t,u,d),Bn(u,d,i),g=u,p=[],b=[],o=In(g.next);continue}if((u.f&zr)!==0&&(la(u),v&&((N=(V=u.nodes)==null?void 0:V.a)==null||N.unfix(),(c??(c=new Set)).delete(u))),u!==o){if(h!==void 0&&h.has(u)){if(p.length<b.length){var f=b[0],y;g=f.prev;var E=p[0],S=p[p.length-1];for(y=0;y<p.length;y+=1)Bn(p[y],f,i);for(y=0;y<b.length;y+=1)h.delete(b[y]);Ii(t,E.prev,S.next),Ii(t,g,E),Ii(t,S,f),o=f,g=S,l-=1,p=[],b=[]}else h.delete(u),Bn(u,o,i),Ii(t,u.prev,u.next),Ii(t,u,g===null?t.effect.first:g.next),Ii(t,g,u),g=u;continue}for(p=[],b=[];o!==null&&o!==u;)(h??(h=new Set)).add(o),b.push(o),o=In(o.next);if(o===null)continue}(u.f&Si)===0&&p.push(u),g=u,o=In(u.next)}if(t.outrogroups!==null){for(const D of t.outrogroups)D.pending.size===0&&(Mo(Vs(D.done)),(X=t.outrogroups)==null||X.delete(D));t.outrogroups.size===0&&(t.outrogroups=null)}if(o!==null||h!==void 0){var L=[];if(h!==void 0)for(u of h)(u.f&zr)===0&&L.push(u);for(;o!==null;)(o.f&zr)===0&&o!==t.fallback&&L.push(o),o=In(o.next);var x=L.length;if(x>0){var P=(n&Ll)!==0&&_===0?i:null;if(v){for(l=0;l<x;l+=1)(Q=(W=L[l].nodes)==null?void 0:W.a)==null||Q.measure();for(l=0;l<x;l+=1)(le=(ne=L[l].nodes)==null?void 0:ne.a)==null||le.fix()}Zu(t,L,P)}}v&&ki(()=>{var D,T;if(c!==void 0)for(u of c)(T=(D=u.nodes)==null?void 0:D.a)==null||T.apply()})}function eh(t,e,i,n,a,v,_,s){var o=(_&Ld)!==0?(_&Ad)===0?Lu(i,!1,!1):on(i):null,h=(_&Pd)!==0?on(a):null;return vt&&o&&(o.trace=()=>{s()[(h==null?void 0:h.v)??a]}),{v:o,i:h,e:Xr(()=>(v(e,o??i,h??a,s),()=>{t.delete(n)}))}}function Bn(t,e,i){if(t.nodes)for(var n=t.nodes.start,a=t.nodes.end,v=e&&(e.f&Si)===0?e.nodes.start:i;n!==null;){var _=is(n);if(v.before(n),n===a)return;n=_}}function Ii(t,e,i){e===null?t.effect.first=i:e.next=i,i===null?t.effect.last=e:i.prev=e}function Qs(t,e,i=!1,n=!1,a=!1){var v=t,_="";ee(()=>{var s=Jt;if(_!==(_=e()??"")&&(s.nodes!==null&&(oc(s.nodes.start,s.nodes.end),s.nodes=null),_!=="")){var o=_+"";i?o=`<svg>${o}</svg>`:n&&(o=`<math>${o}</math>`);var h=ca(o);if((i||n)&&(h=Wr(h)),an(Wr(h),h.lastChild),i||n)for(;Wr(h);)v.before(Wr(h));else v.before(h)}})}function th(t,e,i){Ks(()=>{var n=Wi(()=>e(t,i==null?void 0:i())||{});if(n!=null&&n.destroy)return()=>n.destroy()})}function yc(t){var e,i,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(i=yc(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function rh(){for(var t,e,i=0,n="",a=arguments.length;i<a;i++)(t=arguments[i])&&(e=yc(t))&&(n&&(n+=" "),n+=e);return n}function Pi(t){return typeof t=="object"?rh(t):t??""}const ja=[...`
28
+ \r\f \v\uFEFF`];function ih(t,e,i){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),i){for(var a in i)if(i[a])n=n?n+" "+a:a;else if(n.length)for(var v=a.length,_=0;(_=n.indexOf(a,_))>=0;){var s=_+v;(_===0||ja.includes(n[_-1]))&&(s===n.length||ja.includes(n[s]))?n=(_===0?"":n.substring(0,_))+n.substring(s+1):_=s}}return n===""?null:n}function Fa(t,e=!1){var i=e?" !important;":";",n="";for(var a in t){var v=t[a];v!=null&&v!==""&&(n+=" "+a+": "+v+i)}return n}function so(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function nh(t,e){if(e){var i="",n,a;if(Array.isArray(e)?(n=e[0],a=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var v=!1,_=0,s=!1,o=[];n&&o.push(...Object.keys(n).map(so)),a&&o.push(...Object.keys(a).map(so));var h=0,g=-1;const m=t.length;for(var c=0;c<m;c++){var p=t[c];if(s?p==="/"&&t[c-1]==="*"&&(s=!1):v?v===p&&(v=!1):p==="/"&&t[c+1]==="*"?s=!0:p==='"'||p==="'"?v=p:p==="("?_++:p===")"&&_--,!s&&v===!1&&_===0){if(p===":"&&g===-1)g=c;else if(p===";"||c===m-1){if(g!==-1){var b=so(t.substring(h,g).trim());if(!o.includes(b)){p!==";"&&c++;var w=t.substring(h,c).trim();i+=" "+w+";"}}h=c+1,g=-1}}}}return n&&(i+=Fa(n)),a&&(i+=Fa(a,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function Pe(t,e,i,n,a,v){var _=t.__className;if(_!==i||_===void 0){var s=ih(i,n,v);s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s),t.__className=i}else if(v&&a!==v)for(var o in v){var h=!!v[o];(a==null||h!==!!a[o])&&t.classList.toggle(o,h)}return v}function oo(t,e={},i,n){for(var a in i){var v=i[a];e[a]!==v&&(i[a]==null?t.style.removeProperty(a):t.style.setProperty(a,v,n))}}function nr(t,e,i,n){var a=t.__style;if(a!==e){var v=nh(e,n);v==null?t.removeAttribute("style"):t.style.cssText=v,t.__style=e}else n&&(Array.isArray(n)?(oo(t,i==null?void 0:i[0],n[0]),oo(t,i==null?void 0:i[1],n[1],"important")):oo(t,i,n));return n}function da(t,e,i=!1){if(t.multiple){if(e==null)return;if(!Qo(e))return nu();for(var n of t.options)n.selected=e.includes(Un(n));return}for(n of t.options){var a=Un(n);if(Ru(a,e)){n.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function xc(t){var e=new MutationObserver(()=>{da(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),oa(()=>{e.disconnect()})}function Nn(t,e,i=e){var n=new WeakSet,a=!0;na(t,"change",v=>{var _=v?"[selected]":":checked",s;if(t.multiple)s=[].map.call(t.querySelectorAll(_),Un);else{var o=t.querySelector(_)??t.querySelector("option:not([disabled])");s=o&&Un(o)}i(s),Bt!==null&&n.add(Bt)}),Ks(()=>{var v=e();if(t===document.activeElement){var _=Es??Bt;if(n.has(_))return}if(da(t,v,a),a&&v===void 0){var s=t.querySelector(":checked");s!==null&&(v=Un(s),i(v))}t.__value=v,a=!1}),xc(t)}function Un(t){return"__value"in t?t.__value:t.value}const sh=Symbol("is custom element"),oh=Symbol("is html");function Xs(t,e){var i=wc(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function ze(t,e,i,n){var a=wc(t);a[e]!==(a[e]=i)&&(e==="loading"&&(t[qd]=i),i==null?t.removeAttribute(e):typeof i!="string"&&ah(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function wc(t){return t.__attributes??(t.__attributes={[sh]:t.nodeName.includes("-"),[oh]:t.namespaceURI===Nd})}var Ha=new Map;function ah(t){var e=t.getAttribute("is")||t.nodeName,i=Ha.get(e);if(i)return i;Ha.set(e,i=[]);for(var n,a=t,v=Element.prototype;v!==a;){n=Fd(a);for(var _ in n)n[_].set&&i.push(_);a=Rl(a)}return i}function Rr(t,e,i=e){var n=new WeakSet;na(t,"input",async a=>{vt&&t.type==="checkbox"&&Pa();var v=a?t.defaultValue:t.value;if(v=ao(t)?lo(v):v,i(v),Bt!==null&&n.add(Bt),await _c(),v!==(v=e())){var _=t.selectionStart,s=t.selectionEnd,o=t.value.length;if(t.value=v??"",s!==null){var h=t.value.length;_===s&&s===o&&h>o?(t.selectionStart=h,t.selectionEnd=h):(t.selectionStart=_,t.selectionEnd=Math.min(s,h))}}}),Wi(e)==null&&t.value&&(i(ao(t)?lo(t.value):t.value),Bt!==null&&n.add(Bt)),Js(()=>{vt&&t.type==="checkbox"&&Pa();var a=e();if(t===document.activeElement){var v=Es??Bt;if(n.has(v))return}ao(t)&&a===lo(t.value)||t.type==="date"&&!a&&!t.value||a!==t.value&&(t.value=a??"")})}function lh(t,e,i=e){na(t,"change",n=>{var a=n?t.defaultChecked:t.checked;i(a)}),Wi(e)==null&&i(t.checked),Js(()=>{var n=e();t.checked=!!n})}function ao(t){var e=t.type;return e==="number"||e==="range"}function lo(t){return t===""?null:+t}function Va(t,e){return t===e||(t==null?void 0:t[en])===e}function er(t={},e,i,n){return Ks(()=>{var a,v;return Js(()=>{a=v,v=[],Wi(()=>{t!==i(...v)&&(e(t,...v),a&&Va(i(...a),t)&&e(null,...a))})}),()=>{ki(()=>{v&&Va(i(...v),t)&&e(null,...v)})}}),t}let ls=!1;function ch(t){var e=ls;try{return ls=!1,[t(),ls]}finally{ls=e}}function We(t,e,i,n){var d;var a=(i&Id)!==0,v=(i&Md)!==0,_=n,s=!0,o=()=>(s&&(s=!1,_=v?Wi(n):n),_),h;if(a){var g=en in t||zd in t;h=((d=$i(t,e))==null?void 0:d.set)??(g&&e in t?f=>t[e]=f:void 0)}var c,p=!1;a?[c,p]=ch(()=>t[e]):c=t[e],c===void 0&&n!==void 0&&(c=o(),h&&(Zd(e),h(c)));var b;if(b=()=>{var f=t[e];return f===void 0?o():(s=!0,f)},(i&Dd)===0)return b;if(h){var w=t.$$legacy;return(function(f,y){return arguments.length>0?((!y||w||p)&&h(y?b():f),f):b()})}var m=!1,u=((i&Td)!==0?qs:Xl)(()=>(m=!1,b()));vt&&(u.label=e),a&&r(u);var l=Jt;return(function(f,y){if(arguments.length>0){const E=y?r(u):a?gt(f):f;return k(u,E),m=!0,_!==void 0&&(_=E),f}return Vi&&m||(l.f&Ci)!==0?u.v:r(u)})}function Sc(){const t=typeof performance<"u"?Math.floor(performance.now()*1e3+performance.timeOrigin*1e3):Date.now()*1e3,e=String(t)+"Qraft";let i=2166136261;for(let n=0;n<e.length;n++)i^=e.charCodeAt(n),i=Math.imul(i,16777619);return`qs_${(i>>>0).toString(36)}`}const Wa=new Set(["files","commits","terminal","sessions","project","tools","system-info","model-config"]);function Oo(t){const i=t.replace(/^#\/?/,"").split("/").filter(Boolean);if(i.length>=2){const n=i[0]??null,a=i[1]??"files";return{slug:n,screen:Wa.has(a)?a:"files"}}if(i.length===1){const n=i[0]??"";return Wa.has(n)?{slug:null,screen:n}:{slug:n,screen:"files"}}return{slug:null,screen:"files"}}function dh(t){return Oo(t).screen}function cs(t,e){return t!==null?`#/${t}/${e}`:`#/${e}`}function uh(t){const e={name:"",path:"",isDirectory:!0,children:[]};for(const i of t){const n=i.path.split("/");let a=e;for(let v=0;v<n.length;v++){const _=n[v];if(_===void 0||_.length===0)continue;const s=n.slice(0,v+1).join("/"),o=v===n.length-1,h=a.children??[],g=h.find(c=>c.name===_);if(g!==void 0)a=g;else{const c=o?{name:_,path:s,isDirectory:!1,status:i.status==="renamed"?"modified":i.status}:{name:_,path:s,isDirectory:!0,children:[]};h.push(c),a.children=h,a=c}}}return Cc(e),e}function Cc(t){if(!t.isDirectory||t.children===void 0)return;const e=t.children;e.sort((i,n)=>i.isDirectory&&!n.isDirectory?-1:!i.isDirectory&&n.isDirectory?1:i.name.localeCompare(n.name));for(const i of e)Cc(i)}function ua(t,e){if(t.isDirectory&&t.children){const n=t.children.map(v=>ua(v,e));return n.some((v,_)=>v!==t.children[_])?{...t,children:n}:t}if(t.isDirectory&&t.children===void 0){const n=t.path===""?"":t.path+"/";for(const a of e.keys())if(a.startsWith(n))return{...t,status:"modified"};return t}const i=e.get(t.path);return i!==void 0&&t.status===void 0?{...t,status:i}:t}function jn(t){var i;const e=t.status==="added"||t.status==="modified"||t.status==="deleted"||t.status==="untracked"||t.status==="ignored"?t.status:void 0;return{name:t.name,path:t.path,isDirectory:t.type==="directory",children:(i=t.children)==null?void 0:i.map(jn),status:e,isBinary:t.isBinary===!0?!0:void 0}}function kc(t,e,i){if(t.path===e&&t.isDirectory)return{...t,children:i};if(!t.isDirectory||t.children===void 0)return t;const n=t.children.map(v=>v.isDirectory&&(v.path===e||e.startsWith(v.path+"/"))?kc(v,e,i):v);return n.some((v,_)=>v!==t.children[_])?{...t,children:n}:t}function co(t){try{return JSON.parse(t)}catch{return null}}function hh(t,e){var i,n;if(typeof e.sessionId!="string")return t;if(e.type==="message"){const a=(i=e.data)==null?void 0:i.content;return typeof a!="string"?t:t.map(v=>v.id===e.sessionId?{...v,lastAssistantMessage:a,currentActivity:void 0}:v)}if(e.type==="thinking"||e.type==="session_started")return t.map(a=>a.id===e.sessionId?{...a,currentActivity:"Thinking..."}:a);if(e.type==="tool_use"){const a=(n=e.data)==null?void 0:n.toolName;return t.map(v=>v.id===e.sessionId?{...v,currentActivity:typeof a=="string"&&a.length>0?`Using ${a}...`:"Using tool..."}:v)}return e.type==="tool_result"?t.map(a=>a.id===e.sessionId?{...a,currentActivity:"Processing tool result..."}:a):t}function Ec(t){const e=t.filter(n=>n.status==="running"),i=t.filter(n=>n.status==="queued");return{runningCount:e.length,queuedCount:i.length,runningSessionIds:[],totalCount:e.length+i.length}}function fh(t){const e=new Map;async function i(o){await t.fetchActiveSessions(),await t.fetchPromptQueue(),t.getRunningSessions().some(g=>g.id===o)||a(o)}function n(o){t.setRunningSessions(hh(t.getRunningSessions(),o))}function a(o){const h=e.get(o);h!==void 0&&(h.close(),e.delete(o))}function v(o){if(e.has(o))return;const h=new EventSource(`/api/ai/sessions/${o}/stream`);h.onmessage=p=>{const b=co(p.data);b!==null&&n(b)};const g=()=>{a(o),i(o)};h.addEventListener("completed",g),h.addEventListener("failed",g),h.addEventListener("cancelled",g),h.addEventListener("error",p=>{if(!(p instanceof MessageEvent))return;const b=co(p.data);if(b===null){g();return}if(b.type==="error"){g();return}n(b)});const c=["session_started","thinking","tool_use","tool_result","message"];for(const p of c)h.addEventListener(p,b=>{if(!(b instanceof MessageEvent))return;const w=co(b.data);w!==null&&n(w)});h.onerror=()=>{i(o)},e.set(o,h)}function _(){const o=new Set(t.getRunningSessions().map(h=>h.id));for(const[h]of e)o.has(h)||a(h);for(const h of o)v(h)}function s(){for(const[,o]of e)o.close();e.clear()}return{sync:_,close:a,closeAll:s}}function Ua(t,e){return`/api/ctx/${t}/files/file-raw/${e}`}function br(t,e){if(!t.ok)throw new Error(`${e}: ${t.status}`);return t}async function vh(){const t=await fetch("/api/workspace");br(t,"Failed to fetch workspace");const e=await t.json();return{tabs:e.workspace.tabs??[],activeTabId:e.workspace.activeTabId??null}}async function za(t){const e=await fetch(`/api/workspace/tabs/${t}/activate`,{method:"POST"});br(e,"Failed to activate tab")}async function _h(t){const e=await fetch(`/api/workspace/tabs/${t}`,{method:"DELETE"});br(e,"Failed to close tab");const i=await e.json();return{tabs:i.workspace.tabs,activeTabId:i.workspace.activeTabId}}async function ph(t){const e=await fetch("/api/workspace/tabs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})});if(!e.ok){const n=await e.json();throw new Error(n.error??`Failed to open (${e.status})`)}const i=await e.json();return{tab:i.tab,tabs:i.workspace.tabs}}async function gh(){const t=await fetch("/api/workspace/recent");return br(t,"Failed to fetch recent projects"),(await t.json()).recent}async function mh(t){await fetch("/api/workspace/recent",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})})}async function bh(t){const e=await fetch("/api/browse/pick-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({startPath:t})});if(!e.ok){const n=await e.json();throw new Error(n.error??"Failed to open directory picker")}return(await e.json()).path}async function yh(t){const e=await fetch(`/api/ctx/${t}/diff`);return br(e,"Diff API error"),(await e.json()).files}async function uo(t,e,i){const n=new URLSearchParams({mode:"all"});e&&n.set("shallow","true"),(i==null?void 0:i.showIgnored)===!0&&n.set("showIgnored","true"),(i==null?void 0:i.showAllFiles)===!0&&n.set("showAllFiles","true");const a=await fetch(`/api/ctx/${t}/files?${n.toString()}`);return br(a,"Files API error"),(await a.json()).tree}async function xh(t,e,i){const n=new URLSearchParams({path:e});(i==null?void 0:i.showIgnored)===!0&&n.set("showIgnored","true"),(i==null?void 0:i.showAllFiles)===!0&&n.set("showAllFiles","true");const a=await fetch(`/api/ctx/${t}/files/children?${n.toString()}`);return br(a,"Children API error"),(await a.json()).children}async function wh(t,e){const i=await fetch(`/api/ctx/${t}/files/file/${e}`);return br(i,"File API error"),await i.json()}async function Sh(t,e,i=50){const n=new URLSearchParams({q:e,limit:String(i)}),a=await fetch(`/api/ctx/${t}/files/autocomplete?${n.toString()}`);return br(a,"File autocomplete API error"),(await a.json()).results}async function Ch(t){const e=await fetch("/api/ai/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({run_immediately:t.runImmediately,message:t.message,context:t.context,project_path:t.projectPath,qraft_ai_session_id:t.qraftAiSessionId,model_profile_id:t.modelProfileId})});br(e,"AI submit error")}async function Lc(){const t=await fetch("/api/model-config");return br(t,"Model config API error"),await t.json()}async function kh(t){const e=await fetch("/api/model-config/profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return br(e,"Failed to create model profile"),(await e.json()).profile}async function Eh(t){const e=await fetch(`/api/model-config/profiles/${t}`,{method:"DELETE"});br(e,"Failed to delete model profile")}async function Lh(t){const e=await fetch("/api/model-config/bindings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return br(e,"Failed to update model bindings"),(await e.json()).operationBindings}async function Ph(){const t=await fetch("/api/ai/prompt-queue");return br(t,"Prompt queue error"),(await t.json()).prompts}async function Rh(){const t=await fetch("/api/ai/sessions");return br(t,"AI sessions error"),(await t.json()).sessions}async function Ah(t){const e=await fetch(`/api/ai/sessions/${t}/cancel`,{method:"POST"});br(e,"Failed to cancel session")}async function Th(t){const e=await fetch(`/api/ai/prompt-queue/${t}/cancel`,{method:"POST"});br(e,"Failed to cancel queued prompt")}function ho(t){try{localStorage.setItem("qraftbox:recent-projects",JSON.stringify(t))}catch{}}function Dh(){try{const t=localStorage.getItem("qraftbox:recent-projects");if(t!==null)return JSON.parse(t)}catch{}return[]}function Ih(t){function e(){t.setDiffFiles([]),t.setSelectedPath(null),t.setAllFilesTree(null),t.setAllFilesTreeStale(!1),t.setFileContent(null)}async function i(u){const l=await yh(u);t.setDiffFiles(l),l.length>0&&l[0]!==void 0&&t.setSelectedPath(l[0].path)}function n(){const u=t.getContextId();if(u===null)return null;const l=t.getWorkspaceTabs().find(d=>d.id===u);return(l==null?void 0:l.projectSlug)??null}function a(u){t.setCurrentScreen(u);const l=n(),d=cs(l,u);window.location.hash!==d&&(window.location.hash=d)}function v(u){if(t.getWorkspaceTabs().some(y=>y.path===u.path))return;const d=t.getRecentProjects(),f=[{path:u.path,name:u.name,isGitRepo:u.isGitRepo},...d.filter(y=>y.path!==u.path)].slice(0,20);t.setRecentProjects(f),ho(f)}async function _(){const u=await vh(),l=u.tabs;if(l.length>0){t.setWorkspaceTabs(l);const f=(u.activeTabId!==null?l.find(y=>y.id===u.activeTabId):void 0)??l[0];if(f!==void 0)return t.setProjectPath(f.path),f.id}return t.setWorkspaceTabs([]),t.setCurrentScreen("project"),""}async function s(u){if(u===t.getContextId())return;const l=t.getWorkspaceTabs().find(d=>d.id===u);if(l!==void 0)try{if(await za(u),t.setContextId(u),t.setProjectPath(l.path),e(),t.setLoading(!0),l.isGitRepo?(await i(u),t.getFileTreeMode()==="all"&&t.fetchAllFiles(u)):(t.setFileTreeMode("all"),t.setShowAllFiles(!0),t.fetchAllFiles(u)),t.fetchPromptQueue(),t.fetchActiveSessions(),t.getCurrentScreen()==="project")a("files");else if(l.projectSlug.length>0){const d=cs(l.projectSlug,t.getCurrentScreen());window.location.hash!==d&&(window.location.hash=d)}}catch(d){console.error("Failed to switch project:",d)}finally{t.setLoading(!1)}}async function o(u,l){l.stopPropagation();const d=t.getWorkspaceTabs().find(f=>f.id===u);try{const f=await _h(u);if(t.setWorkspaceTabs(f.tabs),d!==void 0&&v(d),u!==t.getContextId())return;const y=f.tabs;if(y.length===0){t.setContextId(null),t.setProjectPath(""),e(),t.setLoading(!1),a("project");return}const E=f.activeTabId!==null?y.find(S=>S.id===f.activeTabId):y[0];if(E===void 0)return;t.setContextId(E.id),t.setProjectPath(E.path),e(),E.isGitRepo?(await i(E.id),t.getFileTreeMode()==="all"&&t.fetchAllFiles(E.id)):(t.setFileTreeMode("all"),t.setShowAllFiles(!0),t.fetchAllFiles(E.id)),t.fetchPromptQueue(),t.fetchActiveSessions(),E.projectSlug.length>0&&(window.location.hash=cs(E.projectSlug,t.getCurrentScreen()))}catch(f){console.error("Failed to close project tab:",f)}}async function h(){try{const u=await gh(),l=t.getWorkspaceTabs(),d=new Set(l.map(S=>S.path)),f=t.getRecentProjects(),y=new Set(f.map(S=>S.path)),E=[...f];for(const S of u)!y.has(S.path)&&!d.has(S.path)&&E.push(S);t.setRecentProjects(E.slice(0,20))}catch{}}async function g(u){const l=u.trim();if(l.length!==0){t.setNewProjectLoading(!0),t.setNewProjectError(null);try{const d=await ph(l);t.setWorkspaceTabs(d.tabs);const f=t.getRecentProjects().filter(y=>y.path!==l);t.setRecentProjects(f),ho(f),t.setNewProjectPath(""),await s(d.tab.id)}catch(d){t.setNewProjectError(d instanceof Error?d.message:"Failed to open project")}finally{t.setNewProjectLoading(!1)}}}async function c(u){await g(u)}async function p(u){try{await mh(u)}catch{}const l=t.getRecentProjects().filter(d=>d.path!==u);t.setRecentProjects(l),ho(l)}async function b(){if(t.setNewProjectError(null),t.isMobileDirectoryPickerClient()){t.setDirectoryPickerOpen(!0);return}t.setPickingDirectory(!0);try{const u=t.getProjectPath(),l=await bh(u.length>0?u:void 0);if(l===null)return;await g(l)}catch(u){t.setNewProjectError(u instanceof Error?u.message:"Failed to open directory picker")}finally{t.setPickingDirectory(!1)}}function w(){const u=Oo(window.location.hash);if(u.screen!==t.getCurrentScreen()&&t.setCurrentScreen(u.screen),u.slug!==null){const l=t.getWorkspaceTabs().find(d=>d.projectSlug===u.slug);l!==void 0&&l.id!==t.getContextId()&&s(l.id)}}async function m(){t.setRecentProjects(Dh());try{t.setLoading(!0),t.setError(null);const u=Oo(window.location.hash),l=await _();if(l===""){h(),t.setLoading(!1);return}if(t.setContextId(l),u.slug!==null){const E=t.getWorkspaceTabs().find(S=>S.projectSlug===u.slug);E!==void 0&&E.id!==l&&(t.setContextId(E.id),t.setProjectPath(E.path),await za(E.id))}u.screen!==t.getCurrentScreen()&&t.setCurrentScreen(u.screen);const d=t.getWorkspaceTabs().find(E=>E.id===t.getContextId()),f=t.getContextId();f!==null&&((d==null?void 0:d.isGitRepo)===!0?(await i(f),t.getFileTreeMode()==="all"&&t.fetchAllFiles(f)):(t.setFileTreeMode("all"),t.setShowAllFiles(!0),t.fetchAllFiles(f))),t.fetchPromptQueue(),t.fetchActiveSessions(),h();const y=n();if(y!==null){const E=cs(y,t.getCurrentScreen());window.location.hash!==E&&(window.location.hash=E)}}catch(u){const l=u instanceof Error?u.message:"Failed to load";t.setError(l),console.error("Init error:",u)}finally{t.setLoading(!1)}}return{init:m,switchProject:s,closeProjectTab:o,fetchRecentProjects:h,openProjectByPath:g,openRecentProject:c,removeRecentProject:p,pickDirectory:b,fetchDiff:i,navigateToScreen:a,handleHashChange:w}}function Mh(t){let e=null,i=null,n=null,a=1e3;function v(){if(e!==null&&e.readyState<=WebSocket.OPEN)return;const s=location.protocol==="https:"?"wss:":"ws:";e=new WebSocket(`${s}//${location.host}/ws`),e.onopen=()=>{a=1e3},e.onmessage=o=>{try{const h=JSON.parse(o.data);if(h.event==="file-change"){const g=t.getContextId();if(g===null)return;const c=h.data,p=t.getSelectedPath(),b=t.getProjectPath(),w=c.projectPath===void 0||c.projectPath===b;t.markAllFilesTreeStale(),n!==null&&clearTimeout(n),n=setTimeout(()=>{const m=t.getContextId();m!==null&&(t.fetchDiff(m),t.refreshAllFiles(m)),n=null},500),w&&p!==null&&c.changes.some(m=>m.path===p)&&t.fetchFileContent(g,p);return}if(h.event==="ai:queue_update"){const g=h.data;t.setPromptQueue(g.prompts),t.setQueueStatus(Ec(g.prompts)),t.fetchActiveSessions()}}catch{}},e.onclose=()=>{e=null,i=setTimeout(()=>{a=Math.min(a*2,1e4),v()},a)},e.onerror=()=>{}}function _(){i!==null&&(clearTimeout(i),i=null),n!==null&&(clearTimeout(n),n=null),e!==null&&(e.onclose=null,e.close(),e=null)}return{connect:v,disconnect:_}}const Pc="qraftbox-ai-completion-notifications-enabled";function Rc(){return typeof window<"u"&&"Notification"in window}function ha(){if(typeof window>"u")return!0;try{const t=localStorage.getItem(Pc);return t===null?!0:t!=="false"}catch{return!0}}function Oh(t){if(!(typeof window>"u"))try{localStorage.setItem(Pc,String(t))}catch{}}function Bh(t){const e=t.trim().replace(/\s+/g," ");return e.length<=80?e:`${e.slice(0,77)}...`}async function Nh(){if(ha()&&Rc()&&Notification.permission==="default")try{await Notification.requestPermission()}catch{}}function jh(t){if(!ha()||!Rc()||Notification.permission!=="granted")return;const e=Bh(t.prompt),i=e.length>0?e:"Your AI prompt execution has completed.";try{new Notification("QraftBox AI prompt completed",{body:i,tag:`qraftbox-ai-session-${t.id}`})}catch{}}function Fh(t){let e=null,i=!1;const n=new Set;async function a(){try{const w=await Ph();t.setServerPromptQueue(w),t.setQueueStatus(Ec(w))}catch{}}async function v(){try{const w=await Rh(),m=[],u=[],l=[],d=[],f=Date.now(),y=6e4;for(const E of w){const S={...E,id:E.id,state:E.state,context:E.context,turns:[],currentActivity:E.currentActivity};if(S.state==="running")m.push(S);else if(S.state==="queued")u.push(S);else if(S.state==="completed"){d.push(S);const L=S.completedAt??S.startedAt??S.createdAt,x=new Date(L).getTime();(Number.isNaN(x)||f-x<y)&&l.push(S)}else if(S.state==="failed"||S.state==="cancelled"){const L=S.completedAt??S.startedAt??S.createdAt,x=new Date(L).getTime();(Number.isNaN(x)||f-x<y)&&l.push(S)}}if(i)for(const E of d)n.has(E.id)||(jh(E),n.add(E.id));else{for(const E of d)n.add(E.id);i=!0}l.length>0?e={session:l[0],expiresAt:f+y}:e!==null&&e.expiresAt>f&&m.length===0&&u.length===0?l.push(e.session):e!==null&&e.expiresAt<=f&&(e=null),t.setRunningSessions(m),t.setQueuedSessions(u),t.setRecentlyCompletedSessions(l),a()}catch{}}async function _(w,m,u){if(t.getContextId()!==null)try{await Nh();const l=u.resumeSessionId??t.getQraftAiSessionId(),d={runImmediately:m,message:w,context:u,projectPath:t.getProjectPath(),qraftAiSessionId:l,modelProfileId:u.modelProfileId};await Ch(d),t.setSessionMessageSubmitted(!0),a(),v()}catch(l){console.error("AI prompt submit error:",l)}}async function s(w){try{await Ah(w),t.setRunningSessions(t.getRunningSessions().filter(m=>m.id!==w)),t.setQueuedSessions(t.getQueuedSessions().filter(m=>m.id!==w)),a()}catch(m){console.error("Failed to cancel session:",m)}}async function o(w){try{await Th(w),t.setServerPromptQueue(t.getServerPromptQueue().filter(m=>m.id!==w)),a()}catch(m){console.error("Failed to cancel queued prompt:",m)}}function h(w){t.setQraftAiSessionId(w),t.setResumeDisplaySessionId(w),t.navigateToScreen("files"),v(),a()}function g(w){t.getContextId()!==null&&(t.setQraftAiSessionId(w),t.setResumeDisplaySessionId(w),t.setSessionMessageSubmitted(!0),v(),a())}function c(){t.setResumeDisplaySessionId(null),t.setQraftAiSessionId(Sc()),t.setSessionMessageSubmitted(!1)}function p(){t.navigateToScreen("sessions"),v(),a()}function b(){return t.getRunningSessions().length>0||t.getQueuedSessions().length>0||t.getServerPromptQueue().some(w=>w.status==="queued"||w.status==="running")||t.getRecentlyCompletedSessions().length>0}return{submitPrompt:_,fetchPromptQueue:a,fetchActiveSessions:v,handleCancelActiveSession:s,handleCancelQueuedPrompt:o,handleResumeToChanges:h,handleResumeCliSession:g,handleNewSession:c,handleSearchSession:p,hasActiveSessionWork:b}}function Hh(t){try{const e=localStorage.getItem(t.storageKey);if(e!==null){const i=Number(e);if(!Number.isNaN(i)&&i>=t.min&&i<=t.max)return i}}catch{}return t.fallback}function qa(t,e){try{localStorage.setItem(t,String(e))}catch{}}function Vh(t){async function e(s){if(!(t.getAllFilesTree()!==null&&!t.getAllFilesTreeStale())){t.setAllFilesLoading(t.getAllFilesTree()===null),t.setAllFilesTreeStale(!1);try{const o=t.getShowIgnored(),h=t.getShowAllFiles(),g=await uo(s,!0,{showIgnored:o,showAllFiles:h});t.setAllFilesTree(jn(g))}catch(o){console.error("Failed to fetch all files:",o)}finally{t.setAllFilesLoading(!1)}}}async function i(s){try{const o=t.getShowIgnored(),h=t.getShowAllFiles(),g=await uo(s,!1,{showIgnored:o,showAllFiles:h});t.setAllFilesTree(jn(g)),t.setAllFilesTreeStale(!1)}catch(o){console.error("Failed to refresh all files:",o)}}async function n(s){const o=t.getContextId();if(o!==null)try{const h=t.getShowIgnored(),g=t.getShowAllFiles(),c=await xh(o,s,{showIgnored:h,showAllFiles:g}),p=t.getAllFilesTree();if(p!==null){const b=c.map(jn);t.setAllFilesTree(kc(p,s,b))}}catch(h){console.error(`Failed to load directory children for ${s}:`,h)}}async function a(){const s=t.getContextId();if(s!==null)try{const o=t.getShowIgnored(),h=t.getShowAllFiles(),g=await uo(s,!1,{showIgnored:o,showAllFiles:h}),c=jn(g);return t.setAllFilesTree(c),ua(c,t.getDiffStatusMap())}catch(o){console.error("Failed to load full tree:",o);return}}async function v(s,o){t.setFileContentLoading(!0);try{const h=await wh(s,o);t.setFileContent({path:h.path,content:h.content,language:h.language,isBinary:h.isBinary===!0?!0:void 0,isImage:h.isImage===!0?!0:void 0,isVideo:h.isVideo===!0?!0:void 0,isPdf:h.isPdf===!0?!0:void 0,mimeType:h.mimeType,ctxId:s})}catch(h){console.error("Failed to fetch file content:",h),t.setFileContent(null)}finally{t.setFileContentLoading(!1)}}function _(s,o){return s?o:"full-file"}return{fetchAllFiles:e,refreshAllFiles:i,handleDirectoryExpand:n,handleLoadFullTree:a,fetchFileContent:v,getEffectiveViewMode:_}}var Wh=rr('<svg class="animate-spin" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 1.5a6.5 6.5 0 1 1-4.6 1.9" stroke-linecap="round"></path></svg> Pulling...',1),Uh=rr('<svg class="animate-spin" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 1.5a6.5 6.5 0 1 1-4.6 1.9" stroke-linecap="round"></path></svg> AI generating...',1),zh=rr('<svg class="animate-spin" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 1.5a6.5 6.5 0 1 1-4.6 1.9" stroke-linecap="round"></path></svg> Pushing...',1),qh=rr('<svg class="animate-spin" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2"><path d="M8 1.5a6.5 6.5 0 1 1-4.6 1.9" stroke-linecap="round"></path></svg> AI generating...',1),Gh=I(`<button type="button" class="px-3 py-1 text-xs font-medium border border-border-default rounded
29
+ bg-danger-emphasis text-white hover:opacity-90
30
+ transition-colors disabled:opacity-50 disabled:cursor-not-allowed"> </button>`),Kh=I(`<div class="px-3 py-2 border-t border-border-default bg-bg-primary" role="presentation"><textarea class="w-full h-20 px-2 py-1.5 text-xs bg-bg-secondary border border-border-default
31
+ rounded text-text-primary font-mono resize-y
32
+ focus:outline-none focus:border-accent-emphasis" placeholder="Enter additional context for commit..."></textarea> <button type="button" class="mt-1 px-3 py-1 text-xs bg-success-emphasis text-white rounded
33
+ hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed"> </button></div>`),Jh=I('<span class="text-xs text-text-tertiary ml-1"> </span>'),Qh=I('<span class="text-xs text-text-tertiary ml-1">(unavailable)</span>'),Xh=I("<option> </option>"),Yh=I('<div class="flex items-center gap-2 mb-2"><label for="create-pr-base" class="text-xs text-text-secondary">Base:</label> <select id="create-pr-base" class="flex-1 px-2 py-1 text-xs bg-bg-secondary border border-border-default rounded text-text-primary focus:outline-none focus:border-accent-emphasis"></select></div>'),Zh=I('<div class="px-3 py-2 border-t border-border-default bg-bg-primary" role="presentation"><!> <button type="button" class="px-3 py-1 text-xs bg-success-emphasis text-white rounded hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed"> </button></div>'),$h=I('<span class="text-xs text-text-tertiary ml-1">(no PR)</span>'),ef=I(`<div class="git-actions-dropdown fixed w-64 bg-bg-secondary border border-border-default
34
+ rounded-lg shadow-lg overflow-hidden" role="menu"><button type="button" role="menuitem">Commit with custom ctx</button> <!> <div class="border-t border-border-default"></div> <button type="button" role="menuitem"> <!></button> <!> <div class="border-t border-border-default"></div> <button type="button" role="menuitem">Open current PR in Browser <!></button></div>`),tf=rr('<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" class="shrink-0 mt-0.5"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575ZM8 5a.75.75 0 0 0-.75.75v2.5a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path></svg>'),rf=rr('<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" class="shrink-0 mt-0.5"><path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-1.06-1.06L7 8.94 5.28 7.22a.751.751 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.06 0Z"></path></svg>'),nf=I('<div><div><!> <span class="toast-text svelte-h2ybgu"> </span> <button type="button" class="toast-dismiss svelte-h2ybgu"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button></div></div>'),sf=I(`<div class="flex items-center gap-1 git-actions-menu-container"><button type="button" class="px-3 py-1 text-xs font-medium border border-border-default rounded
35
+ bg-attention-emphasis text-white hover:opacity-90
36
+ transition-colors disabled:opacity-50 disabled:cursor-not-allowed
37
+ flex items-center gap-1.5"><!></button> <button type="button" class="px-3 py-1 text-xs font-medium border border-border-default rounded
38
+ bg-success-emphasis text-white hover:opacity-90
39
+ transition-colors disabled:opacity-50 disabled:cursor-not-allowed
40
+ flex items-center gap-1.5"><!></button> <button type="button" class="px-3 py-1 text-xs font-medium border border-border-default rounded
41
+ bg-accent-emphasis text-white hover:opacity-90
42
+ transition-colors disabled:opacity-50 disabled:cursor-not-allowed
43
+ flex items-center gap-1.5"><!></button> <button type="button" class="px-3 py-1 text-xs font-medium border border-border-default rounded
44
+ bg-done-emphasis text-white hover:opacity-90
45
+ transition-colors disabled:opacity-50 disabled:cursor-not-allowed
46
+ flex items-center gap-1.5"><!></button> <!> <button type="button" class="px-1.5 py-1 text-sm border border-border-default rounded
47
+ hover:bg-bg-tertiary transition-colors text-text-secondary
48
+ disabled:opacity-50 disabled:cursor-not-allowed" aria-label="More git actions"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><circle cx="8" cy="3" r="1.5"></circle><circle cx="8" cy="8" r="1.5"></circle><circle cx="8" cy="13" r="1.5"></circle></svg></button></div> <!> <!>`,1);function of(t,e){Tt(e,!0);const i=We(e,"hasChanges",3,!0),n=We(e,"isGitRepo",3,!0);let a=K(!1),v=K(null),_=K(""),s=K(0),o=K(0),h=K(null),g=K(!1),c=K("idle"),p=K(null),b=K(!1),w=K(null),m=K("success"),u=K(!1),l=null;function d(ve,_e){l!==null&&clearTimeout(l),k(w,ve,!0),k(m,_e,!0),k(u,!0),l=setTimeout(()=>{k(u,!1),setTimeout(()=>{k(w,null)},300)},_e==="error"?5e3:3e3)}function f(){l!==null&&(clearTimeout(l),l=null),k(u,!1),setTimeout(()=>{k(w,null)},300)}function y(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`action_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}let E=K(null),S=K(null),L=K(!1),x=K(!1),P=K(""),B=K(gt([])),j=K(!1),V=K("");const N=ge(()=>r(S)!==null),X=ge(()=>r(N)?"Update PR":"Create PR"),W=ge(()=>!r(g)&&!r(L)&&(r(x)||r(N))),Q=ge(()=>r(g)&&(r(c)==="committing"||r(c)==="creating-pr")&&r(p)!==null&&!r(b));function ne(){if(r(h)===null)return;const ve=r(h).getBoundingClientRect();k(s,ve.bottom+4),k(o,window.innerWidth-ve.right)}function le(ve){ve.stopPropagation(),r(a)?(k(a,!1),k(v,null),k(_,"")):(ne(),k(a,!0))}async function D(){k(L,!0);try{const ve=await fetch(`/api/git-actions/pr-status?projectPath=${encodeURIComponent(e.projectPath)}`);if(ve.ok){const _e=await ve.json();_e.status.hasPR&&_e.status.pr!==null?(k(E,_e.status.pr.url,!0),k(S,_e.status.pr.number,!0)):(k(E,null),k(S,null)),k(x,_e.status.canCreatePR,!0),k(P,_e.status.baseBranch,!0),k(B,_e.status.availableBaseBranches,!0),k(V,_e.status.baseBranch,!0)}}catch{}finally{k(L,!1)}}async function T(){var _e;const ve=y();k(g,!0),k(c,"committing"),k(p,ve,!0),k(b,!1);try{const Oe=await fetch("/api/git-actions/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath,actionId:ve})});if(!Oe.ok){const nt=await Oe.json().catch(()=>({}));throw new Error(nt.error??`Commit failed: ${Oe.status}`)}const Ke=await Oe.json();if(!Ke.success)throw new Error(Ke.error??"Commit failed");d("Commit completed","success"),(_e=e.onSuccess)==null||_e.call(e)}catch(Oe){const Ke=Oe instanceof Error?Oe.message:"Commit failed";d(Ke,"error")}finally{k(g,!1),k(c,"idle"),k(p,null),k(b,!1)}}async function M(){var ve;k(g,!0),k(c,"pushing");try{const _e=await fetch("/api/git-actions/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath})});if(!_e.ok){const Ke=await _e.json().catch(()=>({}));throw new Error(Ke.error??`Push failed: ${_e.status}`)}const Oe=await _e.json();if(!Oe.success)throw new Error(Oe.error??"Push failed");d("Push completed","success"),(ve=e.onSuccess)==null||ve.call(e)}catch(_e){const Oe=_e instanceof Error?_e.message:"Push failed";d(Oe,"error")}finally{k(g,!1),k(c,"idle")}}async function z(){var ve;k(g,!0),k(c,"pulling");try{const _e=await fetch("/api/git-actions/pull",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath})});if(!_e.ok){const Ke=await _e.json().catch(()=>({}));throw new Error(Ke.error??`Pull failed: ${_e.status}`)}const Oe=await _e.json();if(!Oe.success)throw new Error(Oe.error??"Pull failed");d("Pull completed","success"),(ve=e.onSuccess)==null||ve.call(e)}catch(_e){const Oe=_e instanceof Error?_e.message:"Pull failed";d(Oe,"error")}finally{k(g,!1),k(c,"idle")}}async function J(){var Oe;if(r(v)===null)return;const ve=r(_).trim(),_e=y();k(g,!0),k(c,"committing"),k(p,_e,!0),k(b,!1);try{const Ke=await fetch("/api/git-actions/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath,actionId:_e,...ve.length>0?{customCtx:ve}:{}})});if(!Ke.ok){const $e=await Ke.json().catch(()=>({}));throw new Error($e.error??`Commit failed: ${Ke.status}`)}const nt=await Ke.json();if(!nt.success)throw new Error(nt.error??"Commit failed");d("Commit completed","success"),(Oe=e.onSuccess)==null||Oe.call(e),k(v,null),k(_,""),k(a,!1)}catch(Ke){const nt=Ke instanceof Error?Ke.message:"Operation failed";d(nt,"error")}finally{k(g,!1),k(c,"idle"),k(p,null),k(b,!1)}}function Z(){r(E)!==null&&window.open(r(E),"_blank"),k(a,!1)}function re(ve){const _e=/https:\/\/github\.com\/[^\s]+\/pull\/\d+/.exec(ve);return _e!==null?_e[0]:null}async function se(){var Ke;const ve=r(S)!==null,_e=r(V).length>0?r(V):r(P).length>0?r(P):"main",Oe=y();k(g,!0),k(c,"creating-pr"),k(p,Oe,!0),k(b,!1);try{const $e=await fetch(ve?"/api/git-actions/update-pr":"/api/git-actions/create-pr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.projectPath,baseBranch:_e,actionId:Oe})});if(!$e.ok){const lt=await $e.text().catch(()=>"");let ye=null;try{ye=JSON.parse(lt)}catch{ye=null}throw new Error((ye!==null&&typeof ye.error=="string"?ye.error:lt.trim().length>0?lt:void 0)??`${ve?"Update PR":"Create PR"} failed: ${$e.status}`)}const dt=await $e.json();if(!dt.success)throw new Error(dt.error??`${ve?"Update PR":"Create PR"} failed`);let ut=re(dt.output);ut===null?(await D(),ut=r(E)):await D();const bt=ut!==null?`PR ${ve?"updated":"created"}: ${ut}`:`PR ${ve?"updated":"created"}`;d(bt,"success"),(Ke=e.onSuccess)==null||Ke.call(e)}catch(nt){const $e=nt instanceof Error?nt.message:`${ve?"Update PR":"Create PR"} failed`;d($e,"error")}finally{k(g,!1),k(c,"idle"),k(p,null),k(b,!1)}}async function G(){r(V)===""&&r(S)===null||(await se(),k(j,!1),k(a,!1))}async function O(){if(!(!r(Q)||r(p)===null)){k(b,!0);try{const ve=await fetch("/api/git-actions/cancel",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({actionId:r(p)})});if(!ve.ok){const _e=await ve.json().catch(()=>({}));throw new Error(_e.error??`Cancel failed: ${ve.status}`)}d("Cancellation requested","success")}catch(ve){const _e=ve instanceof Error?ve.message:"Failed to cancel operation";d(_e,"error"),k(b,!1)}}}function ie(ve){const _e=ve.target;!_e.closest(".git-actions-menu-container")&&!_e.closest(".git-actions-dropdown")&&(k(a,!1),r(v)!==null&&(k(v,null),k(_,"")))}St(()=>{n()&&D()});var F=sf();Qt("click",ai,ie);var U=Ae(F),$=C(U);$.__click=()=>void z();var be=C($);{var xe=ve=>{var _e=Wh();A(ve,_e)},ae=ve=>{var _e=Xt("Pull");A(ve,_e)};H(be,ve=>{r(g)&&r(c)==="pulling"?ve(xe):ve(ae,!1)})}var he=R($,2);he.__click=()=>void T();var fe=C(he);{var Ee=ve=>{var _e=Uh();A(ve,_e)},He=ve=>{var _e=Xt("Commit");A(ve,_e)};H(fe,ve=>{r(g)&&r(c)==="committing"?ve(Ee):ve(He,!1)})}var Le=R(he,2);Le.__click=()=>void M();var ce=C(Le);{var Te=ve=>{var _e=zh();A(ve,_e)},De=ve=>{var _e=Xt("Push");A(ve,_e)};H(ce,ve=>{r(g)&&r(c)==="pushing"?ve(Te):ve(De,!1)})}var pe=R(Le,2);pe.__click=()=>void se();var Be=C(pe);{var Qe=ve=>{var _e=qh();A(ve,_e)},Ne=ve=>{var _e=Xt();ee(()=>Y(_e,r(X))),A(ve,_e)};H(Be,ve=>{r(g)&&r(c)==="creating-pr"?ve(Qe):ve(Ne,!1)})}var Me=R(pe,2);{var Fe=ve=>{var _e=Gh();_e.__click=()=>void O();var Oe=C(_e);ee(()=>{_e.disabled=!r(Q),Y(Oe,r(b)?"Cancelling...":"Cancel")}),A(ve,_e)};H(Me,ve=>{r(g)&&(r(c)==="committing"||r(c)==="creating-pr")&&ve(Fe)})}var tt=R(Me,2);tt.__click=le,er(tt,ve=>k(h,ve),()=>r(h));var Ve=R(U,2);{var Xe=ve=>{var _e=ef();_e.__click=we=>we.stopPropagation(),_e.__keydown=we=>we.stopPropagation();var Oe=C(_e);Oe.__click=we=>{we.stopPropagation(),k(v,r(v)==="commit"?null:"commit",!0),k(_,"")};var Ke=R(Oe,2);{var nt=we=>{var Re=Kh(),je=C(Re),Ye=R(je,2);Ye.__click=()=>void J();var rt=C(Ye);ee(()=>{je.disabled=r(g),Ye.disabled=r(g),Y(rt,r(g)?"Running...":"Commit")}),Rr(je,()=>r(_),ht=>k(_,ht)),A(we,Re)};H(Ke,we=>{r(v)==="commit"&&we(nt)})}var $e=R(Ke,4);$e.__click=we=>{we.stopPropagation(),k(j,!r(j))};var dt=C($e),ut=R(dt);{var bt=we=>{var Re=Jh(),je=C(Re);ee(()=>Y(je,`(#${r(S)??""})`)),A(we,Re)},lt=we=>{var Re=et(),je=Ae(Re);{var Ye=rt=>{var ht=Qh();A(rt,ht)};H(je,rt=>{!r(x)&&!r(L)&&rt(Ye)},!0)}A(we,Re)};H(ut,we=>{r(S)!==null?we(bt):we(lt,!1)})}var ye=R($e,2);{var te=we=>{var Re=Zh(),je=C(Re);{var Ye=_t=>{var ct=Yh(),kt=R(C(ct),2);At(kt,21,()=>r(B),Pr,(It,Ze)=>{var at=Xh(),ft=C(at),mt={};ee(()=>{Y(ft,r(Ze)),mt!==(mt=r(Ze))&&(at.value=(at.__value=r(Ze))??"")}),A(It,at)}),Nn(kt,()=>r(V),It=>k(V,It)),A(_t,ct)};H(je,_t=>{r(S)===null&&_t(Ye)})}var rt=R(je,2);rt.__click=()=>void G();var ht=C(rt);ee(()=>{rt.disabled=r(g)||r(S)===null&&r(V)==="",Y(ht,r(g)&&r(c)==="creating-pr"?"AI generating...":r(X))}),A(we,Re)};H(ye,we=>{r(j)&&(r(x)||r(S)!==null)&&we(te)})}var oe=R(ye,4);oe.__click=Z;var me=R(C(oe));{var Ie=we=>{var Re=$h();A(we,Re)};H(me,we=>{r(E)===null&&!r(L)&&we(Ie)})}ee(()=>{nr(_e,`top: ${r(s)??""}px; right: ${r(o)??""}px; z-index: 9999;`),Pe(Oe,1,`w-full px-3 py-2 text-left text-sm hover:bg-bg-tertiary transition-colors
49
+ text-text-primary ${r(v)==="commit"?"bg-bg-tertiary":""}`),Oe.disabled=r(g),Pe($e,1,`w-full px-3 py-2 text-left text-sm hover:bg-bg-tertiary transition-colors
50
+ ${r(x)||r(S)!==null?"text-text-primary":"text-text-tertiary cursor-not-allowed"}
51
+ ${r(j)?"bg-bg-tertiary":""}`),$e.disabled=!r(x)&&r(S)===null||r(L),Y(dt,`${r(X)??""} `),Pe(oe,1,`w-full px-3 py-2 text-left text-sm hover:bg-bg-tertiary transition-colors
52
+ ${r(E)!==null?"text-text-primary":"text-text-tertiary cursor-not-allowed"}`),oe.disabled=r(E)===null||r(L)}),A(ve,_e)};H(Ve,ve=>{r(a)&&ve(Xe)})}var Ue=R(Ve,2);{var Je=ve=>{var _e=nf();let Oe;var Ke=C(_e);let nt;var $e=C(Ke);{var dt=te=>{var oe=tf();A(te,oe)},ut=te=>{var oe=rf();A(te,oe)};H($e,te=>{r(m)==="error"?te(dt):te(ut,!1)})}var bt=R($e,2),lt=C(bt),ye=R(bt,2);ye.__click=f,ee(()=>{Oe=Pe(_e,1,"toast-overlay svelte-h2ybgu",null,Oe,{"toast-visible":r(u),"toast-hidden":!r(u)}),nt=Pe(Ke,1,"toast-content svelte-h2ybgu",null,nt,{"toast-success":r(m)==="success","toast-error":r(m)==="error"}),Y(lt,r(w))}),A(ve,_e)};H(Ue,ve=>{r(w)!==null&&ve(Je)})}ee(()=>{$.disabled=!n()||r(g),ze($,"title",n()?"":"Not a git repository"),he.disabled=!n()||r(g)||!i(),ze(he,"title",n()?"":"Not a git repository"),Le.disabled=!n()||r(g),ze(Le,"title",n()?"":"Not a git repository"),pe.disabled=!n()||!r(W),ze(pe,"title",n()?"":"Not a git repository"),tt.disabled=!n(),ze(tt,"title",n()?"":"Not a git repository")}),A(t,F),Dt()}Ft(["click","keydown"]);var af=I('<button type="button" title="Create new branch"><svg class="w-3.5 h-3.5" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M7.75 2a.75.75 0 01.75.75V7h4.25a.75.75 0 110 1.5H8.5v4.25a.75.75 0 11-1.5 0V8.5H2.75a.75.75 0 010-1.5H7V2.75A.75.75 0 017.75 2z"></path></svg></button>'),lf=I('<div class="text-[11px] text-danger-fg mt-1"> </div>'),cf=I('<div class="text-[11px] text-danger-fg mt-1"> </div>'),df=I('<div class="px-3 py-2 border-b border-border-default bg-bg-secondary"><div class="flex items-center gap-1.5"><input type="text" placeholder="New branch name..."/> <button type="button"> </button></div> <!> <!></div>'),uf=I('<div class="px-3 py-1.5 text-xs bg-attention-subtle text-attention-fg border-b border-border-default flex items-center gap-1.5"><svg class="w-3.5 h-3.5 shrink-0" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"></path></svg> </div>'),hf=I('<div class="px-3 py-1.5 text-xs bg-danger-subtle text-danger-fg border-b border-border-default"> </div>'),ff=I('<div class="px-3 py-4 text-sm text-text-secondary text-center">Loading branches...</div>'),vf=I('<div class="px-3 py-4 text-sm text-text-secondary text-center"> </div>'),_f=rr('<svg class="w-4 h-4" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>'),pf=I('<span class="text-[10px] px-1 py-0 rounded bg-accent-subtle text-accent-fg border border-accent-muted leading-tight">default</span>'),gf=I('<span class="text-[10px] px-1 py-0 rounded bg-success-subtle text-success-fg border border-success-muted leading-tight">current</span>'),mf=I('<span class="text-text-placeholder ml-1"> </span>'),bf=I('<div class="text-[11px] text-text-tertiary truncate mt-0.5"> <!></div>'),yf=I('<span title="Ahead of upstream"> </span>'),xf=I('<span title="Behind upstream"> </span>'),wf=I('<div class="flex items-center gap-1 text-[10px] text-text-tertiary shrink-0"><!> <!></div>'),Sf=I(`<span class="w-6 h-6 flex items-center justify-center rounded shrink-0
53
+ text-text-tertiary hover:text-accent-fg hover:bg-bg-tertiary
54
+ transition-colors cursor-pointer" role="button" tabindex="-1" title="Fetch from remote"><svg class="w-3.5 h-3.5" viewBox="0 0 16 16" fill="currentColor"><path d="M8 2a.75.75 0 01.75.75v7.19l2.72-2.72a.75.75 0 111.06 1.06l-4 4a.75.75 0 01-1.06 0l-4-4a.75.75 0 111.06-1.06l2.72 2.72V2.75A.75.75 0 018 2z"></path><path d="M2.75 13.5a.75.75 0 000 1.5h10.5a.75.75 0 000-1.5H2.75z"></path></svg></span>`),Cf=I(`<span class="w-6 h-6 flex items-center justify-center rounded shrink-0
55
+ text-text-tertiary hover:text-success-fg hover:bg-bg-tertiary
56
+ transition-colors cursor-pointer" role="button" tabindex="-1"><svg class="w-3.5 h-3.5" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M5 3.254V3.25v.005a.75.75 0 110-.005v.004zm.45 1.9a2.25 2.25 0 10-1.95.218v5.256a2.25 2.25 0 101.5 0V7.123A5.735 5.735 0 009.25 9h1.378a2.251 2.251 0 100-1.5H9.25a4.25 4.25 0 01-3.8-2.346zM12.75 9a.75.75 0 100-1.5.75.75 0 000 1.5zm-8.5 4.5a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg></span>`),kf=I('<button type="button" role="option"><span class="w-4 shrink-0 text-success-fg"><!></span> <div class="flex-1 min-w-0"><div class="flex items-center gap-1.5"><span> </span> <!> <!></div> <!></div> <!> <!> <!></button>'),Ef=I('<div class="px-3 py-2 text-xs text-text-secondary text-center">Loading more...</div>'),Lf=I("<!> <!>",1),Pf=I(`<div class="flex flex-col max-h-80" role="listbox"><div class="px-3 py-2 border-b border-border-default"><div class="flex items-center justify-between mb-1.5"><div class="text-xs text-text-secondary font-semibold"> </div> <!></div> <input type="text" class="w-full px-2 py-1 text-sm bg-bg-secondary border border-border-default rounded
57
+ text-text-primary placeholder:text-text-placeholder
58
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis focus:border-accent-emphasis"/></div> <!> <!> <!> <div class="overflow-y-auto flex-1"><!></div> <div class="px-3 py-1.5 text-[11px] text-text-tertiary border-t border-border-default"> </div></div>`);function Ac(t,e){Tt(e,!0);const i=We(e,"filterPlaceholder",3,"Filter branches..."),n=We(e,"warningMessage",3,void 0),a=We(e,"disabled",3,!1),v=We(e,"disableCurrentBranch",3,!1),_=We(e,"selectedBranch",3,void 0),s=We(e,"onCreateBranch",3,void 0),o=We(e,"onFetchBranch",3,void 0),h=We(e,"onMergeBranch",3,void 0),g=30;let c=K(""),p=K(gt([])),b=K(0),w=K(0),m=K(!1),u=K(!1);const l=ge(()=>r(p).length<r(b));let d=K(null),f=K(void 0),y=K(-1),E=K(void 0),S=K(""),L=K(!1),x=K(""),P=K(null),B=K(!1),j=K(void 0);const V=ge(()=>{if(r(x).trim().length===0)return!1;const pe=r(x).trim().toLowerCase();return r(p).some(Be=>Be.name.toLowerCase()===pe)});function N(pe){return!(pe.trim().length===0||/[ ~^:?*[\]\\@{]/.test(pe)||pe.includes("..")||pe.startsWith("/")||pe.endsWith("/")||pe.includes("//")||pe.endsWith(".lock"))}function X(){k(L,!r(L)),k(P,null),k(x,""),r(L)&&requestAnimationFrame(()=>{var pe;(pe=r(j))==null||pe.focus()})}function W(){if(s()===void 0||a())return;const pe=r(x).trim();if(pe.length===0){k(P,"Branch name is required");return}if(!N(pe)){k(P,"Invalid branch name");return}if(r(V)){k(P,`Branch '${pe}' already exists`);return}k(P,null),s()(pe)}const Q=ge(()=>{if(r(c).trim().length===0)return r(p);const pe=r(c).toLowerCase();return r(p).filter(Be=>Be.name.toLowerCase().includes(pe))});async function ne(pe,Be){k(Be?u:m,!0),k(d,null);try{const Qe=new URLSearchParams({offset:String(pe),limit:String(g)}),Ne=await fetch(`/api/ctx/${e.contextId}/branches?${Qe.toString()}`);if(Ne.ok){const Me=await Ne.json();Be?k(p,[...r(p),...Me.branches],!0):(k(p,[...Me.branches],!0),k(S,Me.defaultBranch,!0)),k(b,Me.total,!0),k(w,pe+Me.branches.length)}else k(d,"Failed to load branches")}catch{k(d,"Failed to load branches")}finally{k(m,!1),k(u,!1)}}async function le(){r(u)||!r(l)||await ne(r(w),!0)}function D(){if(r(E)===void 0||r(u)||!r(l))return;const{scrollTop:pe,scrollHeight:Be,clientHeight:Qe}=r(E);Be-pe-Qe<100&&le()}function T(){k(c,""),k(y,-1),k(d,null),k(p,[],!0),k(b,0),k(w,0),k(L,!1),k(x,""),k(P,null),k(B,!1),ne(0,!1),requestAnimationFrame(()=>{var pe;(pe=r(f))==null||pe.focus()})}function M(pe){if(pe.key==="ArrowDown"){pe.preventDefault(),r(y)<r(Q).length-1&&Da(y);return}if(pe.key==="ArrowUp"){pe.preventDefault(),r(y)>0&&Da(y,-1);return}if(pe.key==="Enter"&&r(y)>=0){pe.preventDefault();const Be=r(Q)[r(y)];Be!==void 0&&!a()&&(v()&&Be.name===e.currentBranch||e.onSelect(Be))}}function z(pe){const Qe=Date.now()-pe,Ne=Math.floor(Qe/6e4);if(Ne<1)return"just now";if(Ne<60)return`${String(Ne)}m ago`;const Me=Math.floor(Ne/60);if(Me<24)return`${String(Me)}h ago`;const Fe=Math.floor(Me/24);if(Fe<30)return`${String(Fe)}d ago`;const tt=Math.floor(Fe/30);return`${String(tt)}mo ago`}var J={initialize:T},Z=Pf();Z.__keydown=M;var re=C(Z),se=C(re),G=C(se),O=C(G),ie=R(G,2);{var F=pe=>{var Be=af();Be.__click=X,ee(()=>{Pe(Be,1,`w-5 h-5 flex items-center justify-center rounded text-text-secondary
59
+ hover:text-accent-fg hover:bg-bg-tertiary transition-colors cursor-pointer
60
+ ${a()?"opacity-50 cursor-default":""}`),Be.disabled=a()}),A(pe,Be)};H(ie,pe=>{s()!==void 0&&pe(F)})}var U=R(se,2);U.__input=()=>{k(y,-1)},er(U,pe=>k(f,pe),()=>r(f));var $=R(re,2);{var be=pe=>{var Be=df(),Qe=C(Be),Ne=C(Qe);Ne.__keydown=Je=>{Je.key==="Enter"&&(Je.preventDefault(),W()),Je.key==="Escape"&&(Je.preventDefault(),X())},er(Ne,Je=>k(j,Je),()=>r(j));var Me=R(Ne,2);Me.__click=W;var Fe=C(Me),tt=R(Qe,2);{var Ve=Je=>{var ve=lf(),_e=C(ve);ee(Oe=>Y(_e,`Branch '${Oe??""}' already exists`),[()=>r(x).trim()]),A(Je,ve)};H(tt,Je=>{r(V)&&Je(Ve)})}var Xe=R(tt,2);{var Ue=Je=>{var ve=cf(),_e=C(ve);ee(()=>Y(_e,r(P))),A(Je,ve)};H(Xe,Je=>{r(P)!==null&&!r(V)&&Je(Ue)})}ee((Je,ve)=>{Pe(Ne,1,`flex-1 px-2 py-1 text-sm bg-bg-primary border rounded
61
+ text-text-primary placeholder:text-text-placeholder
62
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis
63
+ ${r(V)?"border-danger-emphasis":"border-border-default focus:border-accent-emphasis"}`),Ne.disabled=r(B),Pe(Me,1,`px-2 py-1 text-xs font-medium rounded transition-colors
64
+ ${Je??""}`),Me.disabled=ve,Y(Fe,r(B)?"Creating...":"Create")},[()=>r(x).trim().length===0||r(V)||r(B)||a()?"bg-bg-tertiary text-text-placeholder cursor-default":"bg-accent-emphasis text-white hover:bg-accent-fg cursor-pointer",()=>r(x).trim().length===0||r(V)||r(B)||a()]),Rr(Ne,()=>r(x),Je=>k(x,Je)),A(pe,Be)};H($,pe=>{r(L)&&s()!==void 0&&pe(be)})}var xe=R($,2);{var ae=pe=>{var Be=uf(),Qe=R(C(Be));ee(()=>Y(Qe,` ${n()??""}`)),A(pe,Be)};H(xe,pe=>{n()!==void 0&&pe(ae)})}var he=R(xe,2);{var fe=pe=>{var Be=hf(),Qe=C(Be);ee(()=>Y(Qe,r(d))),A(pe,Be)};H(he,pe=>{r(d)!==null&&pe(fe)})}var Ee=R(he,2),He=C(Ee);{var Le=pe=>{var Be=ff();A(pe,Be)},ce=pe=>{var Be=et(),Qe=Ae(Be);{var Ne=Fe=>{var tt=vf(),Ve=C(tt);ee(Xe=>Y(Ve,Xe),[()=>r(c).trim().length>0?"No branches match filter":"No branches found"]),A(Fe,tt)},Me=Fe=>{var tt=Lf(),Ve=Ae(tt);At(Ve,17,()=>r(Q),Pr,(Je,ve,_e)=>{const Oe=ge(()=>r(ve).name===e.currentBranch),Ke=ge(()=>_()!==void 0?r(ve).name===_():!1),nt=ge(()=>a()||v()&&r(Oe));var $e=kf();$e.__click=()=>{r(nt)||e.onSelect(r(ve))};var dt=C($e),ut=C(dt);{var bt=Ze=>{var at=_f();A(Ze,at)};H(ut,Ze=>{r(Ke)&&Ze(bt)})}var lt=R(dt,2),ye=C(lt),te=C(ye),oe=C(te),me=R(te,2);{var Ie=Ze=>{var at=pf();A(Ze,at)};H(me,Ze=>{r(ve).isDefault&&Ze(Ie)})}var we=R(me,2);{var Re=Ze=>{var at=gf();A(Ze,at)};H(we,Ze=>{r(Oe)&&Ze(Re)})}var je=R(ye,2);{var Ye=Ze=>{var at=bf(),ft=C(at),mt=R(ft);{var xt=pt=>{var it=mf(),Et=C(it);ee(Pt=>Y(Et,Pt),[()=>z(r(ve).lastCommit.date)]),A(pt,it)};H(mt,pt=>{r(ve).lastCommit.date>0&&pt(xt)})}ee(()=>Y(ft,`${r(ve).lastCommit.message??""} `)),A(Ze,at)};H(je,Ze=>{r(ve).lastCommit.message.length>0&&Ze(Ye)})}var rt=R(lt,2);{var ht=Ze=>{var at=wf(),ft=C(at);{var mt=it=>{var Et=yf(),Pt=C(Et);ee(()=>Y(Pt,`${r(ve).aheadBehind.ahead??""}^`)),A(it,Et)};H(ft,it=>{r(ve).aheadBehind.ahead>0&&it(mt)})}var xt=R(ft,2);{var pt=it=>{var Et=xf(),Pt=C(Et);ee(()=>Y(Pt,`${r(ve).aheadBehind.behind??""}v`)),A(it,Et)};H(xt,it=>{r(ve).aheadBehind.behind>0&&it(pt)})}A(Ze,at)};H(rt,Ze=>{r(ve).aheadBehind!==void 0&&(r(ve).aheadBehind.ahead>0||r(ve).aheadBehind.behind>0)&&Ze(ht)})}var _t=R(rt,2);{var ct=Ze=>{var at=Sf();at.__click=ft=>{var mt;ft.stopPropagation(),(mt=o())==null||mt()},at.__keydown=ft=>{var mt;ft.key==="Enter"&&(ft.stopPropagation(),(mt=o())==null||mt())},A(Ze,at)};H(_t,Ze=>{r(Oe)&&o()!==void 0&&Ze(ct)})}var kt=R(_t,2);{var It=Ze=>{var at=Cf();at.__click=ft=>{var mt;ft.stopPropagation(),(mt=h())==null||mt(r(ve))},at.__keydown=ft=>{var mt;ft.key==="Enter"&&(ft.stopPropagation(),(mt=h())==null||mt(r(ve)))},ee(()=>ze(at,"title",`Merge into ${e.currentBranch??""}`)),A(Ze,at)};H(kt,Ze=>{!r(Oe)&&h()!==void 0&&Ze(It)})}ee(()=>{Pe($e,1,`w-full text-left px-3 py-1.5 text-sm flex items-center gap-2 transition-colors
65
+ ${r(y)===_e?"bg-bg-tertiary":"hover:bg-bg-secondary"}
66
+ ${r(Ke)?"font-semibold":""}
67
+ ${r(nt)?"cursor-default opacity-50":"cursor-pointer"}`),$e.disabled=r(nt),ze($e,"aria-selected",r(Ke)),Pe(te,1,`font-mono text-xs truncate ${r(Ke)?"text-text-primary":"text-text-secondary"}`),Y(oe,r(ve).name)}),Qt("mouseenter",$e,()=>{k(y,_e,!0)}),A(Je,$e)});var Xe=R(Ve,2);{var Ue=Je=>{var ve=Ef();A(Je,ve)};H(Xe,Je=>{r(u)&&Je(Ue)})}A(Fe,tt)};H(Qe,Fe=>{r(Q).length===0?Fe(Ne):Fe(Me,!1)},!0)}A(pe,Be)};H(He,pe=>{r(m)?pe(Le):pe(ce,!1)})}er(Ee,pe=>k(E,pe),()=>r(E));var Te=R(Ee,2),De=C(Te);return ee(()=>{ze(Z,"aria-label",e.headerText),Y(O,e.headerText),ze(U,"placeholder",i()),Y(De,`${r(p).length??""} of ${r(b)??""} branches`)}),Rr(U,()=>r(c),pe=>k(c,pe)),Qt("scroll",Ee,D),A(t,Z),Dt(J)}Ft(["keydown","click","input"]);var Rf=I('<div class="px-3 py-1.5 text-xs bg-danger-subtle text-danger-fg border-b border-border-default"> </div>'),Af=I('<div class="px-3 py-1.5 text-xs bg-success-subtle text-success-fg border-b border-border-default"> </div>'),Tf=I('<div class="fixed inset-0 z-40" role="presentation"></div> <div class="fixed w-[min(20rem,calc(100vw-1rem))] max-h-96 bg-bg-primary border border-border-default rounded-md shadow-lg z-50 flex flex-col"><!> <!> <!></div>',1),Df=I('<button type="button" title="Click to switch branches"><svg viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M11.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122V6A2.5 2.5 0 0110 8.5H6a1 1 0 00-1 1v1.128a2.251 2.251 0 11-1.5 0V5.372a2.25 2.25 0 111.5 0v1.836A2.492 2.492 0 016 7h4a1 1 0 001-1v-.628A2.25 2.25 0 019.5 3.25zM4.25 12a.75.75 0 100 1.5.75.75 0 000-1.5zM3.5 3.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0z"></path></svg> <span> </span> <svg viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M12.78 6.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.22 7.28a.75.75 0 011.06-1.06L8 9.94l3.72-3.72a.75.75 0 011.06 0z"></path></svg></button> <!>',1);function If(t,e){Tt(e,!0);let i=K(!1),n=K(!1),a=K(null),v=K(null),_=K(!1),s=K(""),o=K(void 0),h=K(void 0),g=K(0),c=K(0),p=K(!1);function b(){return window.innerWidth<=768}function w(){r(i)?l():u()}async function m(){try{const W=await fetch("/api/git-actions/operating");if(W.ok){const Q=await W.json();k(_,Q.operating,!0),k(s,Q.phase,!0)}}catch{k(_,!1),k(s,"")}}function u(){if(r(o)!==void 0){const W=r(o).getBoundingClientRect();k(g,W.bottom+4);const Q=8,ne=Math.min(320,window.innerWidth-16),le=Math.max(Q,window.innerWidth-ne-Q);k(c,Math.min(Math.max(W.left,Q),le),!0)}k(i,!0),k(a,null),k(v,null),m(),requestAnimationFrame(()=>{var W;(W=r(h))==null||W.initialize()})}function l(){k(i,!1),k(a,null)}async function d(W){if(W.name!==e.currentBranch){if(await m(),r(_)){k(a,`Cannot switch branches while ${r(s)} is in progress`);return}k(n,!0),k(a,null);try{const ne=await(await fetch(`/api/ctx/${e.contextId}/branches/checkout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:W.name})})).json();ne.success?(k(v,`Switched to ${ne.currentBranch}`),setTimeout(()=>{l(),k(v,null),window.location.reload()},800)):k(a,ne.error??"Checkout failed",!0)}catch{k(a,"Checkout failed")}finally{k(n,!1)}}}async function f(W){if(await m(),r(_)){k(a,`Cannot create branches while ${r(s)} is in progress`);return}k(a,null);try{const ne=await(await fetch(`/api/ctx/${e.contextId}/branches/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:W})})).json();ne.success?(k(v,`Created branch '${ne.branch}'`),setTimeout(()=>{l(),k(v,null),window.location.reload()},800)):k(a,ne.error??"Branch creation failed",!0)}catch{k(a,"Branch creation failed")}}async function y(){if(await m(),r(_)){k(a,`Cannot fetch while ${r(s)} is in progress`);return}k(a,null);try{const Q=await(await fetch(`/api/ctx/${e.contextId}/branches/fetch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:e.currentBranch})})).json();Q.success?(k(v,`Fetched ${e.currentBranch}`),setTimeout(()=>{var ne;k(v,null),(ne=r(h))==null||ne.initialize()},800)):k(a,Q.error??"Fetch failed",!0)}catch{k(a,"Fetch failed")}}async function E(W){if(await m(),r(_)){k(a,`Cannot merge while ${r(s)} is in progress`);return}k(a,null);try{const ne=await(await fetch(`/api/ctx/${e.contextId}/branches/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:W.name})})).json();ne.success?(k(v,`Merged ${ne.mergedBranch} into ${ne.currentBranch}`),setTimeout(()=>{l(),k(v,null),window.location.reload()},1200)):k(a,ne.error??"Merge failed",!0)}catch{k(a,"Merge failed")}}function S(W){W.key==="Escape"&&l()}St(()=>{if(!r(i))return;const W=setInterval(()=>{m()},2e3);return()=>{clearInterval(W)}}),St(()=>{const W=()=>{k(p,b(),!0)};return W(),window.addEventListener("resize",W),window.addEventListener("orientationchange",W),()=>{window.removeEventListener("resize",W),window.removeEventListener("orientationchange",W)}});var L=Df(),x=Ae(L);x.__click=w;var P=C(x),B=R(P,2),j=C(B),V=R(B,2);er(x,W=>k(o,W),()=>r(o));var N=R(x,2);{var X=W=>{var Q=Tf(),ne=Ae(Q);ne.__click=()=>l(),ne.__keydown=()=>{};var le=R(ne,2);le.__keydown=S;var D=C(le);{var T=Z=>{var re=Rf(),se=C(re);ee(()=>Y(se,r(a))),A(Z,re)};H(D,Z=>{r(a)!==null&&Z(T)})}var M=R(D,2);{var z=Z=>{var re=Af(),se=C(re);ee(()=>Y(se,r(v))),A(Z,re)};H(M,Z=>{r(v)!==null&&Z(z)})}var J=R(M,2);{let Z=ge(()=>r(_)?`Branch switching disabled while ${r(s)} is in progress`:void 0);er(Ac(J,{get contextId(){return e.contextId},get currentBranch(){return e.currentBranch},headerText:"Switch branches",get warningMessage(){return r(Z)},get disabled(){return r(_)},onSelect:re=>void d(re),disableCurrentBranch:!1,get selectedBranch(){return e.currentBranch},onCreateBranch:re=>void f(re),onFetchBranch:()=>void y(),onMergeBranch:re=>void E(re)}),re=>k(h,re,!0),()=>r(h))}ee(()=>nr(le,`top: ${r(g)??""}px; left: ${r(c)??""}px;`)),A(W,Q)};H(N,W=>{r(i)&&W(X)})}ee(()=>{Pe(x,1,`font-mono text-accent-fg hover:text-accent-emphasis hover:underline cursor-pointer
68
+ ${r(p)?"text-base px-2 py-1.5 min-h-[40px] gap-1.5":"text-sm"}
69
+ flex items-center transition-colors`),Pe(P,0,`${r(p)?"w-4.5 h-4.5":"w-3.5 h-3.5"} shrink-0`),Y(j,e.currentBranch),Pe(V,0,`${r(p)?"w-4 h-4":"w-3 h-3"} shrink-0 transition-transform ${r(i)?"rotate-180":""}`)}),A(t,L),Dt()}Ft(["click","keydown"]);var Mf=I('<span class="px-1.5 py-0.5 text-xs rounded bg-attention-muted text-attention-fg"> </span>'),Of=I('<span class="text-border-default">|</span>'),Bf=I('<a target="_blank" rel="noopener noreferrer" class="text-xs text-accent-fg hover:underline"> </a>'),Nf=I('<div class="flex items-center gap-3 text-sm"><!> <!> <!> <!></div>');function jf(t,e){Tt(e,!0);let i=K(null),n=K(null),a=K(null);const v=ge(()=>{var S;return((S=r(i))==null?void 0:S.branch)??""}),_=ge(()=>{var S;return(S=r(n))!=null&&S.status.hasPR&&r(n).status.pr!==null&&r(n).status.pr.state==="open"?r(n).status.pr:null});async function s(){try{const S=await fetch(`/api/ctx/${e.contextId}/status`);S.ok&&k(i,await S.json(),!0)}catch{}}async function o(){try{const S=await fetch(`/api/ctx/${e.contextId}/pr/${e.contextId}/status`);S.ok&&k(n,await S.json(),!0)}catch{}}async function h(){try{const S=await fetch(`/api/ctx/${e.contextId}/worktree/${e.contextId}/worktree/main`);S.ok&&k(a,await S.json(),!0)}catch{}}function g(S){const L=S.replace(/\/$/,"").split("/"),x=L[L.length-1];return x!==void 0&&x.length>0?x:"/"}const c=ge(()=>e.projectPath!==void 0&&e.projectPath.length>0?g(e.projectPath):null);async function p(){await Promise.all([s(),o(),h()])}St(()=>{p();const S=setInterval(()=>{p()},3e4);return()=>{clearInterval(S)}});var b=Nf(),w=C(b);{var m=S=>{If(S,{get contextId(){return e.contextId},get currentBranch(){return r(v)}})};H(w,S=>{r(v).length>0&&S(m)})}var u=R(w,2);{var l=S=>{var L=Mf(),x=C(L);ee(()=>{ze(L,"title",`Worktree: ${e.projectPath??""??""}`),Y(x,`worktree:${r(c)??""}`)}),A(S,L)};H(u,S=>{var L;(L=r(a))!=null&&L.isWorktree&&r(c)!==null&&S(l)})}var d=R(u,2);{var f=S=>{var L=Of();A(S,L)};H(d,S=>{r(v).length>0&&r(_)!==null&&S(f)})}var y=R(d,2);{var E=S=>{var L=Bf(),x=C(L);ee(()=>{ze(L,"href",r(_).url),Y(x,`PR #${r(_).number??""}`)}),A(S,L)};H(y,S=>{r(_)!==null&&S(E)})}A(t,b),Dt()}var Ff=I('<div class="fixed inset-0 z-40" role="presentation"></div>'),Hf=I('<div class="mx-3 mt-3 p-2 rounded border border-danger-muted bg-danger-subtle text-danger-fg text-xs" role="alert"> </div>'),Vf=I(`<div><label for="wt-base" class="block text-xs text-text-secondary mb-1">Base branch (optional)</label> <input id="wt-base" type="text" placeholder="main" class="w-full px-2 py-1.5 text-sm rounded border border-border-default
70
+ bg-bg-primary text-text-primary
71
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
72
+ placeholder:text-text-tertiary"/></div>`),Wf=I(`<div class="fixed w-[min(20rem,calc(100vw-1rem))] bg-bg-secondary border border-border-default rounded-lg shadow-lg z-50"><div class="p-3 border-b border-border-default"><h3 class="text-sm font-semibold text-text-primary">Create New Worktree</h3></div> <!> <div class="p-3 space-y-3"><div><label for="wt-branch" class="block text-xs text-text-secondary mb-1">Branch name</label> <input id="wt-branch" type="text" placeholder="feature/my-branch" class="w-full px-2 py-1.5 text-sm rounded border border-border-default
73
+ bg-bg-primary text-text-primary
74
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
75
+ placeholder:text-text-tertiary"/></div> <label class="flex items-center gap-2 text-sm text-text-secondary"><input type="checkbox" class="rounded border-border-default"/> Create new branch</label> <!> <div class="flex items-center gap-2 pt-1"><button type="button" class="px-3 py-1.5 rounded text-sm font-medium
76
+ bg-success-emphasis hover:brightness-110 text-white
77
+ disabled:opacity-50 disabled:cursor-not-allowed
78
+ transition-colors"> </button> <button type="button" class="px-3 py-1.5 rounded text-sm
79
+ text-text-secondary hover:text-text-primary
80
+ hover:bg-bg-tertiary transition-colors">Cancel</button></div></div></div>`),Uf=I('<div class="mx-3 mt-3 p-2 rounded border border-danger-muted bg-danger-subtle text-danger-fg text-xs shrink-0" role="alert"> </div>'),zf=I('<div class="flex items-center justify-center py-6"><svg class="animate-spin h-5 w-5 text-accent-fg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></div>'),qf=I('<div class="py-6 text-center text-sm text-text-tertiary">No worktrees found</div>'),Gf=I('<span class="px-1.5 py-0.5 text-xs rounded bg-bg-tertiary text-text-secondary shrink-0">root</span>'),Kf=I('<span class="px-1.5 py-0.5 text-xs rounded bg-accent-subtle text-accent-fg shrink-0">current</span>'),Jf=I('<button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> <div class="flex-1 min-w-0"><div class="flex items-center gap-2"><span> </span> <!> <!></div> <p class="text-xs text-text-tertiary font-mono truncate mt-0.5"> </p></div></button>'),Qf=I('<div class="fixed w-[min(20rem,calc(100vw-1rem))] max-h-96 bg-bg-secondary border border-border-default rounded-lg shadow-lg z-50 flex flex-col"><div class="p-3 border-b border-border-default shrink-0"><h3 class="text-sm font-semibold text-text-primary">Worktrees</h3></div> <!> <div class="flex-1 overflow-y-auto"><!></div></div>'),Xf=I('<!> <div class="flex items-center h-full"><button type="button"><svg viewBox="0 0 16 16" fill="currentColor" class="shrink-0"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"></path></svg> Worktree</button> <button type="button"><svg viewBox="0 0 16 16" fill="currentColor"><path d="m4.427 7.427 3.396 3.396a.25.25 0 0 0 .354 0l3.396-3.396A.25.25 0 0 0 11.396 7H4.604a.25.25 0 0 0-.177.427Z"></path></svg></button></div> <!> <!>',1);function Yf(t,e){Tt(e,!0);const i=We(e,"disabled",3,!1);let n=K(!1),a=K(gt([])),v=K(!1),_=K(null),s=K(!1),o=K(""),h=K(!0),g=K(""),c=K(!1),p=K(null),b=K(void 0),w=K(void 0),m=K(0),u=K(0),l=K(!1);function d(){return window.innerWidth<=768}async function f(){try{k(v,!0),k(_,null);const J=await fetch(`/api/ctx/${e.contextId}/worktree/${e.contextId}/worktree`);if(!J.ok){const re=await J.json();throw new Error(re.error??`HTTP ${J.status}`)}const Z=await J.json();k(a,Z.worktrees,!0)}catch(J){k(_,J instanceof Error?J.message:"Failed to fetch worktrees",!0)}finally{k(v,!1)}}function y(J){if(J!==void 0){const Z=J.getBoundingClientRect();k(m,Z.bottom+4);const re=8,se=Math.min(320,window.innerWidth-16),G=Math.max(re,window.innerWidth-se-re);k(u,Math.min(Math.max(Z.left,re),G),!0)}}async function E(){if(r(n)){k(n,!1);return}y(r(b)),k(n,!0),k(s,!1),await f()}async function S(){if(r(s)){k(s,!1);return}y(r(b)),k(s,!0),k(n,!1),k(o,""),k(h,!0),k(g,""),k(p,null),await f()}async function L(){const J=r(o).trim();if(J.length!==0)try{k(c,!0),k(p,null);const Z={branch:J};if(r(h)){Z.createBranch=!0;const G=r(g).trim();G.length>0&&(Z.baseBranch=G)}const re=await fetch(`/api/ctx/${e.contextId}/worktree/${e.contextId}/worktree`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Z)});if(!re.ok){const G=await re.json();throw new Error(G.error??`HTTP ${re.status}`)}const se=await re.json();if(!se.success)throw new Error(se.error??"Failed to create worktree");await x(se.path),k(s,!1)}catch(Z){k(p,Z instanceof Error?Z.message:"Failed to create worktree",!0)}finally{k(c,!1)}}async function x(J){if(J===e.projectPath){k(n,!1);return}try{const Z=await fetch("/api/workspace/tabs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:J})});if(!Z.ok){const re=await Z.json();throw new Error(re.error??`HTTP ${Z.status}`)}k(n,!1),k(s,!1),e.onWorktreeSwitch()}catch(Z){k(_,Z instanceof Error?Z.message:"Failed to switch directory",!0)}}function P(){k(n,!1),k(s,!1)}function B(J,Z){return J.length<=Z?J:"..."+J.slice(J.length-Z+3)}St(()=>{const J=()=>{k(l,d(),!0)};return J(),window.addEventListener("resize",J),window.addEventListener("orientationchange",J),()=>{window.removeEventListener("resize",J),window.removeEventListener("orientationchange",J)}});var j=Xf(),V=Ae(j);{var N=J=>{var Z=Ff();Z.__click=P,Z.__keydown=()=>{},A(J,Z)};H(V,J=>{(r(n)||r(s))&&J(N)})}var X=R(V,2),W=C(X);W.__click=()=>{i()||S()};var Q=C(W);er(W,J=>k(b,J),()=>r(b));var ne=R(W,2);ne.__click=()=>{i()||E()};var le=C(ne);er(ne,J=>k(w,J),()=>r(w));var D=R(X,2);{var T=J=>{var Z=Wf(),re=R(C(Z),2);{var se=Ee=>{var He=Hf(),Le=C(He);ee(()=>Y(Le,r(p))),A(Ee,He)};H(re,Ee=>{r(p)!==null&&Ee(se)})}var G=R(re,2),O=C(G),ie=R(C(O),2);ie.__keydown=Ee=>{Ee.key==="Enter"&&r(o).trim().length>0&&(Ee.preventDefault(),L())};var F=R(O,2),U=C(F),$=R(F,2);{var be=Ee=>{var He=Vf(),Le=R(C(He),2);Rr(Le,()=>r(g),ce=>k(g,ce)),A(Ee,He)};H($,Ee=>{r(h)&&Ee(be)})}var xe=R($,2),ae=C(xe);ae.__click=()=>void L();var he=C(ae),fe=R(ae,2);fe.__click=()=>{k(s,!1)},ee(Ee=>{nr(Z,`top: ${r(m)??""}px; left: ${r(u)??""}px;`),ae.disabled=Ee,Y(he,r(c)?"Creating...":"Create & Switch")},[()=>r(c)||r(o).trim().length===0]),Rr(ie,()=>r(o),Ee=>k(o,Ee)),lh(U,()=>r(h),Ee=>k(h,Ee)),A(J,Z)};H(D,J=>{r(s)&&J(T)})}var M=R(D,2);{var z=J=>{var Z=Qf(),re=R(C(Z),2);{var se=U=>{var $=Uf(),be=C($);ee(()=>Y(be,r(_))),A(U,$)};H(re,U=>{r(_)!==null&&U(se)})}var G=R(re,2),O=C(G);{var ie=U=>{var $=zf();A(U,$)},F=U=>{var $=et(),be=Ae($);{var xe=he=>{var fe=qf();A(he,fe)},ae=he=>{var fe=et(),Ee=Ae(fe);At(Ee,17,()=>r(a),He=>He.path,(He,Le)=>{var ce=Jf();ce.__click=()=>void x(r(Le).path);var Te=C(ce),De=R(Te,2),pe=C(De),Be=C(pe),Qe=C(Be),Ne=R(Be,2);{var Me=Ue=>{var Je=Gf();A(Ue,Je)};H(Ne,Ue=>{r(Le).isMain&&Ue(Me)})}var Fe=R(Ne,2);{var tt=Ue=>{var Je=Kf();A(Ue,Je)};H(Fe,Ue=>{r(Le).path===e.projectPath&&Ue(tt)})}var Ve=R(pe,2),Xe=C(Ve);ee(Ue=>{Pe(ce,1,`w-full text-left px-4 py-2.5 flex items-center gap-3
81
+ hover:bg-bg-tertiary transition-colors
82
+ border-b border-border-default last:border-b-0
83
+ ${r(Le).path===e.projectPath?"bg-accent-subtle":""}`),ce.disabled=r(Le).path===e.projectPath,Pe(Te,0,`shrink-0 ${r(Le).path===e.projectPath?"text-accent-fg":"text-text-tertiary"}`),Pe(Be,1,`text-sm text-text-primary truncate ${r(Le).path===e.projectPath?"font-semibold":""}`),Y(Qe,r(Le).branch??"(detached)"),ze(Ve,"title",r(Le).path),Y(Xe,Ue)},[()=>B(r(Le).path,50)]),A(He,ce)}),A(he,fe)};H(be,he=>{r(a).length===0?he(xe):he(ae,!1)},!0)}A(U,$)};H(O,U=>{r(v)?U(ie):U(F,!1)})}ee(()=>nr(Z,`top: ${r(m)??""}px; left: ${r(u)??""}px;`)),A(J,Z)};H(M,J=>{r(n)&&J(z)})}ee(()=>{Pe(W,1,`${r(l)?"px-3 py-2 min-h-[40px]":"px-2 py-1.5"} text-sm transition-colors h-full flex items-center gap-1
84
+ ${i()?"text-text-tertiary cursor-not-allowed opacity-50":r(s)?"text-text-primary font-semibold":"text-text-secondary hover:text-text-primary"}`),ze(W,"title",i()?"Not a git repository":"Create new worktree"),W.disabled=i(),ze(Q,"width",r(l)?"16":"14"),ze(Q,"height",r(l)?"16":"14"),Pe(ne,1,`${r(l)?"px-2.5 py-2 min-h-[40px] min-w-[32px]":"px-1 py-1.5"} text-sm transition-colors h-full flex items-center justify-center
85
+ ${i()?"text-text-tertiary cursor-not-allowed opacity-50":r(n)?"text-text-primary":"text-text-secondary hover:text-text-primary"}`),ze(ne,"title",i()?"Not a git repository":"Show worktrees"),ne.disabled=i(),ze(le,"width",r(l)?"14":"12"),ze(le,"height",r(l)?"14":"12"),Pe(le,0,`transition-transform ${r(n)?"rotate-180":""}`)}),A(t,j),Dt()}Ft(["click","keydown"]);var Zf=I('<div class="flex items-center h-full shrink-0 group svelte-1heq4ss"><button type="button"> </button> <button type="button"><svg width="10" height="10" viewBox="0 0 16 16" fill="currentColor"><path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button></div>'),$f=I('<span class="text-border-default mx-1 shrink-0">|</span> <!>',1),ev=I('<div class="absolute right-0 top-full mt-1 w-40 bg-bg-secondary border border-border-default rounded-md shadow-lg z-50 py-1"><button type="button">Tools</button> <button type="button">System Info</button> <button type="button">Model Config</button></div>'),tv=I('<div class="fixed inset-0 z-40" role="presentation"></div>'),rv=I('<p class="mt-1.5 text-xs text-danger-fg"> </p>'),iv=I('<div class="flex items-center hover:bg-bg-tertiary transition-colors"><button type="button" class="flex-1 text-left px-4 py-1.5 text-sm text-text-secondary hover:text-text-primary transition-colors flex items-center gap-2 min-w-0"><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> <span class="truncate flex-1"> </span> <span class="text-xs text-text-tertiary truncate max-w-[120px]"> </span></button> <button type="button" class="shrink-0 p-1 mr-2 rounded text-text-tertiary hover:text-danger-fg hover:bg-danger-subtle transition-colors" title="Remove from history"><svg width="10" height="10" viewBox="0 0 16 16" fill="currentColor"><path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button></div>'),nv=I('<div class="border-t border-border-default my-1"></div> <div class="px-4 py-1 text-xs text-text-tertiary font-semibold uppercase tracking-wider">Previous Projects</div> <div class="max-h-60 overflow-y-auto"></div>',1),sv=I(`<div class="fixed w-80 bg-bg-secondary border border-border-default rounded-md shadow-lg z-50 py-1"><div class="px-3 py-2"><label for="open-directory-input" class="text-xs text-text-tertiary font-semibold uppercase tracking-wider mb-1.5 block">Open Directory</label> <form class="flex items-center gap-1.5"><input id="open-directory-input" type="text" class="flex-1 px-2 py-1.5 text-sm rounded border border-border-default
86
+ bg-bg-primary text-text-primary font-mono
87
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
88
+ placeholder:text-text-tertiary" placeholder="/path/to/project"/> <button type="button" class="p-1.5 rounded text-text-secondary hover:text-accent-fg hover:bg-bg-tertiary
89
+ disabled:opacity-50 disabled:cursor-not-allowed
90
+ transition-colors shrink-0" title="Browse directories"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg></button> <button type="submit" class="px-2 py-1.5 rounded text-sm font-medium
91
+ bg-bg-tertiary text-text-primary hover:bg-border-default
92
+ disabled:opacity-50 disabled:cursor-not-allowed
93
+ transition-colors shrink-0"> </button></form> <!></div> <!></div>`),ov=rr('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z" fill="currentColor"></path></svg>'),av=rr('<svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M5.75 1a.75.75 0 0 0-.75.75v.5h-.5A1.75 1.75 0 0 0 2.75 4v9.5c0 .966.784 1.75 1.75 1.75h7a1.75 1.75 0 0 0 1.75-1.75V4a1.75 1.75 0 0 0-1.75-1.75h-.5v-.5A.75.75 0 0 0 10.25 1h-4.5zM10 2.5v.5h-4v-.5h4zm-6.5 2a.25.25 0 0 1 .25-.25h7.5a.25.25 0 0 1 .25.25v9.5a.25.25 0 0 1-.25.25h-7.5a.25.25 0 0 1-.25-.25V4.5z" fill="currentColor"></path></svg>'),lv=I('<div class="py-2 px-4 text-sm border-b-2 border-accent-emphasis text-text-primary flex items-center gap-1"><span class="overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]"> </span> <button type="button" class="text-text-secondary hover:text-text-primary transition-colors" title="Copy path to clipboard"><!></button></div>'),cv=I('<!> <span class="text-border-default mx-1">|</span>',1),dv=I('<header class="h-12 border-b border-border-default flex items-center px-4 bg-bg-secondary gap-4"><h1 class="text-lg font-semibold">QraftBox</h1> <div class="flex items-center ml-4 h-full flex-1 min-w-0"><nav class="flex items-center gap-0 h-full overflow-x-auto project-tabs-nav flex-1 min-w-0 svelte-1heq4ss"><button type="button">Project</button> <!> <button type="button" class="px-2 py-1 text-sm text-text-tertiary hover:text-text-primary transition-colors h-full shrink-0 svelte-1heq4ss" title="Add project">+</button></nav></div> <div class="ml-auto relative"><button type="button" class="p-2 rounded text-text-secondary hover:text-text-primary hover:bg-bg-tertiary transition-colors" aria-label="Open menu" title="Open menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M1 2.75A.75.75 0 0 1 1.75 2h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 2.75Zm0 5A.75.75 0 0 1 1.75 7h12.5a.75.75 0 0 1 0 1.5H1.75A.75.75 0 0 1 1 7.75ZM1.75 12h12.5a.75.75 0 0 1 0 1.5H1.75a.75.75 0 0 1 0-1.5Z"></path></svg></button> <!></div></header> <!> <!> <div class="flex items-center bg-bg-secondary border-b border-border-default px-2 overflow-x-auto"><!> <!> <!> <nav class="flex items-center gap-0 h-full"><button type="button">Files</button> <button type="button">Sessions</button> <button type="button">Commits</button> <button type="button">Terminal</button></nav> <div class="ml-auto py-1 px-2"><!></div></div>',1);function uv(t,e){Tt(e,!0);let i=K(!1),n=K(!1),a=K(void 0),v=K(!1);function _(){navigator.clipboard.writeText(e.projectPath).then(()=>{k(v,!0),setTimeout(()=>{k(v,!1)},1500)})}function s(J,Z=30){return J.length<=Z?J:"..."+J.slice(-Z)}var o=dv(),h=Ae(o),g=R(C(h),2),c=C(g),p=C(c);p.__click=()=>e.onNavigateToScreen("project");var b=R(p,2);{var w=J=>{var Z=$f(),re=R(Ae(Z),2);At(re,17,()=>e.workspaceTabs,se=>se.id,(se,G)=>{var O=Zf(),ie=C(O);ie.__click=()=>void e.onSwitchProject(r(G).id);var F=C(ie),U=R(ie,2);U.__click=$=>void e.onCloseProjectTab(r(G).id,$),ee(()=>{Pe(ie,1,`pl-3 pr-1 py-1.5 text-sm transition-colors h-full border-b-2 whitespace-nowrap touch-manipulation
94
+ ${r(G).id===e.contextId?"text-text-primary font-semibold border-accent-emphasis":"text-text-secondary border-transparent hover:text-text-primary hover:border-border-emphasis"}`,"svelte-1heq4ss"),ze(ie,"title",r(G).path),Y(F,r(G).name),Pe(U,1,`project-tab-close w-4 h-4 flex items-center justify-center shrink-0 mr-1
95
+ rounded-sm text-text-tertiary hover:text-text-primary hover:bg-bg-tertiary
96
+ ${r(G).id===e.contextId?"project-tab-close-active":""}`,"svelte-1heq4ss"),ze(U,"title",`Close ${r(G).name??""}`)}),A(se,O)}),A(J,Z)};H(b,J=>{e.workspaceTabs.length>0&&J(w)})}var m=R(b,2);m.__click=()=>{k(n,!r(n)),r(n)&&(e.onNewProjectPathChange(""),e.onFetchRecentProjects())},er(m,J=>k(a,J),()=>r(a));var u=R(g,2),l=C(u);l.__click=()=>k(i,!r(i));var d=R(l,2);{var f=J=>{var Z=ev(),re=C(Z);re.__click=()=>{e.onNavigateToScreen("tools"),k(i,!1)};var se=R(re,2);se.__click=()=>{e.onNavigateToScreen("system-info"),k(i,!1)};var G=R(se,2);G.__click=()=>{e.onNavigateToScreen("model-config"),k(i,!1)},ee(()=>{Pe(re,1,`w-full text-left px-4 py-2 text-sm hover:bg-bg-tertiary transition-colors
97
+ ${e.currentScreen==="tools"?"text-text-primary font-semibold":"text-text-secondary"}`),Pe(se,1,`w-full text-left px-4 py-2 text-sm hover:bg-bg-tertiary transition-colors
98
+ ${e.currentScreen==="system-info"?"text-text-primary font-semibold":"text-text-secondary"}`),Pe(G,1,`w-full text-left px-4 py-2 text-sm hover:bg-bg-tertiary transition-colors
99
+ ${e.currentScreen==="model-config"?"text-text-primary font-semibold":"text-text-secondary"}`)}),A(J,Z)};H(d,J=>{r(i)&&J(f)})}var y=R(h,2);{var E=J=>{var Z=tv();Z.__click=()=>{k(i,!1),k(n,!1)},Z.__keydown=()=>{},A(J,Z)};H(y,J=>{(r(i)||r(n))&&J(E)})}var S=R(y,2);{var L=J=>{const Z=ge(()=>r(a).getBoundingClientRect());var re=sv(),se=C(re),G=R(C(se),2),O=C(G);O.__input=he=>e.onNewProjectPathChange(he.currentTarget.value);var ie=R(O,2);ie.__click=()=>void e.onPickDirectory();var F=R(ie,2),U=C(F),$=R(G,2);{var be=he=>{var fe=rv(),Ee=C(fe);ee(()=>Y(Ee,e.newProjectError)),A(he,fe)};H($,he=>{e.newProjectError!==null&&he(be)})}var xe=R(se,2);{var ae=he=>{var fe=nv(),Ee=R(Ae(fe),4);At(Ee,21,()=>e.availableRecentProjects,He=>He.path,(He,Le)=>{var ce=iv(),Te=C(ce);Te.__click=()=>void e.onOpenRecentProject(r(Le).path);var De=C(Te),pe=R(De,2),Be=C(pe),Qe=R(pe,2),Ne=C(Qe),Me=R(Te,2);Me.__click=Fe=>{Fe.stopPropagation(),e.onRemoveRecentProject(r(Le).path)},ee(Fe=>{ze(Te,"title",r(Le).path),Pe(De,0,`shrink-0 ${r(Le).isGitRepo?"text-accent-fg":"text-text-tertiary"}`),Y(Be,r(Le).name),Y(Ne,Fe)},[()=>s(r(Le).path,20)]),A(He,ce)}),A(he,fe)};H(xe,he=>{e.availableRecentProjects.length>0&&he(ae)})}ee((he,fe)=>{nr(re,`top: ${r(Z).bottom+4}px; left: ${he??""}px;`),Xs(O,e.newProjectPath),O.disabled=e.newProjectLoading||e.pickingDirectory,ie.disabled=e.pickingDirectory||e.newProjectLoading,F.disabled=fe,Y(U,e.newProjectLoading?"...":"Open")},[()=>Math.min(r(Z).left,window.innerWidth-336),()=>e.newProjectPath.trim().length===0||e.newProjectLoading]),Qt("submit",G,he=>{he.preventDefault(),e.onOpenProjectByPath(e.newProjectPath)}),A(J,re)};H(S,J=>{r(n)&&r(a)!==void 0&&J(L)})}var x=R(S,2),P=C(x);{var B=J=>{var Z=lv(),re=C(Z),se=C(re),G=R(re,2);G.__click=_;var O=C(G);{var ie=U=>{var $=ov();A(U,$)},F=U=>{var $=av();A(U,$)};H(O,U=>{r(v)?U(ie):U(F,!1)})}ee(U=>{ze(Z,"title",e.projectPath),Y(se,U)},[()=>s(e.projectPath)]),A(J,Z)};H(P,J=>{e.projectPath&&J(B)})}var j=R(P,2);{var V=J=>{{let Z=ge(()=>!e.activeTabIsGitRepo);Yf(J,{get contextId(){return e.contextId},get projectPath(){return e.projectPath},get onWorktreeSwitch(){return e.onWorktreeSwitch},get disabled(){return r(Z)}})}};H(j,J=>{e.contextId!==null&&J(V)})}var N=R(j,2);{var X=J=>{var Z=cv(),re=Ae(Z);jf(re,{get contextId(){return e.contextId},get projectPath(){return e.projectPath}}),A(J,Z)};H(N,J=>{e.contextId!==null&&e.activeTabIsGitRepo&&J(X)})}var W=R(N,2),Q=C(W);Q.__click=()=>e.onNavigateToScreen("files");var ne=R(Q,2);ne.__click=()=>e.onNavigateToScreen("sessions");var le=R(ne,2);le.__click=()=>e.onNavigateToScreen("commits");var D=R(le,2);D.__click=()=>e.onNavigateToScreen("terminal");var T=R(W,2),M=C(T);{var z=J=>{of(J,{get contextId(){return e.contextId},get projectPath(){return e.projectPath},get hasChanges(){return e.hasChanges},get onSuccess(){return e.onPushSuccess},get isGitRepo(){return e.activeTabIsGitRepo}})};H(M,J=>{e.contextId!==null&&J(z)})}ee(()=>{Pe(p,1,`px-3 py-1.5 text-sm transition-colors h-full border-b-2 shrink-0 touch-manipulation
100
+ ${e.currentScreen==="project"?"text-text-primary font-semibold border-accent-emphasis":"text-text-secondary border-transparent hover:text-text-primary hover:border-border-emphasis"}`,"svelte-1heq4ss"),Pe(Q,1,`px-3 py-1.5 text-sm transition-colors h-full border-b-2
101
+ ${e.currentScreen==="files"?"text-text-primary font-semibold border-accent-emphasis":"text-text-secondary border-transparent hover:text-text-primary hover:border-border-emphasis"}`),Pe(ne,1,`px-3 py-1.5 text-sm transition-colors h-full border-b-2
102
+ ${e.currentScreen==="sessions"?"text-text-primary font-semibold border-accent-emphasis":"text-text-secondary border-transparent hover:text-text-primary hover:border-border-emphasis"}`),Pe(le,1,`px-3 py-1.5 text-sm transition-colors h-full border-b-2
103
+ ${e.currentScreen==="commits"?"text-text-primary font-semibold border-accent-emphasis":"text-text-secondary border-transparent hover:text-text-primary hover:border-border-emphasis"}`),Pe(D,1,`px-3 py-1.5 text-sm transition-colors h-full border-b-2
104
+ ${e.currentScreen==="terminal"?"text-text-primary font-semibold border-accent-emphasis":"text-text-secondary border-transparent hover:text-text-primary hover:border-border-emphasis"}`)}),A(t,o),Dt()}Ft(["click","keydown","input"]);var hv=I(`<span class="px-2 py-0.5 text-xs font-medium
105
+ bg-accent-subtle text-accent-fg rounded
106
+ flex-shrink-0" title="Git repository">Git</span>`),fv=I(`<span class="px-2 py-0.5 text-xs font-medium
107
+ bg-bg-secondary text-text-secondary rounded
108
+ flex-shrink-0" title="Hidden file">Hidden</span>`),vv=I('<span class="text-text-tertiary text-xs flex-shrink-0" title="Symbolic link">→</span>'),_v=I('<div class="flex-shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg></div>'),pv=I('<div role="option" tabindex="0"><div class="flex-shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path></path></svg></div> <div class="flex-1 min-w-0"><div class="flex items-center gap-2"><span> </span> <!> <!> <!></div></div> <!></div>');function gv(t,e){Tt(e,!0);let i=null;function n(){i!==null?(clearTimeout(i),i=null,e.onClick()):(e.onSelect(),i=setTimeout(()=>{i=null},300))}function a(x){x.key==="Enter"&&(x.preventDefault(),e.onClick())}const v=ge(()=>e.entry.isDirectory?(e.entry.isGitRepo,"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"):"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"),_=ge(()=>e.entry.isDirectory?e.entry.isGitRepo?"text-accent-fg":"text-attention-fg":"text-text-tertiary"),s=ge(()=>e.entry.isHidden?"text-text-tertiary opacity-60":"text-text-primary");var o=pv();o.__click=n,o.__keydown=a;var h=C(o),g=C(h),c=C(g),p=R(h,2),b=C(p),w=C(b),m=C(w),u=R(w,2);{var l=x=>{var P=hv();A(x,P)};H(u,x=>{e.entry.isGitRepo&&e.entry.isDirectory&&x(l)})}var d=R(u,2);{var f=x=>{var P=fv();A(x,P)};H(d,x=>{e.entry.isHidden&&x(f)})}var y=R(d,2);{var E=x=>{var P=vv();A(x,P)};H(y,x=>{e.entry.isSymlink&&x(E)})}var S=R(p,2);{var L=x=>{var P=_v();A(x,P)};H(S,x=>{e.entry.isDirectory&&x(L)})}ee(()=>{ze(o,"aria-selected",e.selected),Pe(o,1,`directory-entry px-6 py-3 min-h-[60px]
109
+ flex items-center gap-3
110
+ border-b border-border-default
111
+ hover:bg-bg-hover
112
+ cursor-pointer
113
+ transition-colors
114
+ ${e.selected?"bg-accent-subtle border-l-4 border-l-accent-fg":"border-l-4 border-l-transparent"}`,"svelte-kv9zjf"),Pe(g,0,Pi(r(_)),"svelte-kv9zjf"),ze(c,"d",r(v)),Pe(w,1,`text-base truncate ${r(s)??""}`,"svelte-kv9zjf"),Y(m,e.entry.name)}),A(t,o),Dt()}Ft(["click","keydown"]);var mv=I(`<span class="px-1.5 py-0.5 text-xs font-medium
115
+ bg-accent-subtle text-accent-fg rounded
116
+ flex-shrink-0" title="Git repository">Git</span>`),bv=I(`<button type="button" class="w-full px-4 py-3 text-left
117
+ flex items-start gap-3
118
+ hover:bg-bg-hover
119
+ border-b border-border-default last:border-b-0
120
+ focus:outline-none focus:bg-bg-hover
121
+ transition-colors svelte-1laeufy" role="menuitem"><div class="flex-shrink-0 pt-0.5"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg></div> <div class="flex-1 min-w-0"><div class="flex items-center gap-2 mb-1"><span class="text-sm font-medium text-text-primary truncate"> </span> <!></div> <div class="flex items-center gap-2"><code class="text-xs text-text-tertiary font-mono truncate"> </code> <span class="text-xs text-text-tertiary flex-shrink-0"> </span></div></div></button>`),yv=I(`<div class="absolute top-full left-0 mt-2 w-80
122
+ bg-bg-primary border border-border-default rounded-lg
123
+ shadow-xl z-10
124
+ max-h-96 overflow-y-auto svelte-1laeufy" role="menu"></div>`),xv=I(`<div class="recent-dropdown relative svelte-1laeufy"><button type="button" class="px-4 py-2 min-h-[48px]
125
+ flex items-center gap-2
126
+ text-text-primary bg-bg-tertiary
127
+ border border-border-default rounded-lg
128
+ hover:bg-bg-hover
129
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
130
+ transition-colors svelte-1laeufy" aria-haspopup="true" title="Recent directories"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> <span class="text-sm font-medium"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <!></div>`),wv=I(`<div class="quick-access-bar px-6 py-3 border-b border-border-default
131
+ bg-bg-secondary flex items-center gap-3"><button type="button" class="px-4 py-2 min-h-[48px]
132
+ flex items-center gap-2
133
+ text-text-primary bg-bg-tertiary
134
+ border border-border-default rounded-lg
135
+ hover:bg-bg-hover
136
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
137
+ transition-colors" title="Go to home directory"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg> <span class="text-sm font-medium">Home</span></button> <!></div>`);function Sv(t,e){Tt(e,!0);let i=K(!1);function n(){k(i,!r(i))}function a(c){e.onRecentClick(c),k(i,!1)}function v(c){c.target.closest(".recent-dropdown")||k(i,!1)}function _(c){const b=Date.now()-c,w=Math.floor(b/1e3),m=Math.floor(w/60),u=Math.floor(m/60),l=Math.floor(u/24);return l>0?`${l}d ago`:u>0?`${u}h ago`:m>0?`${m}m ago`:"Just now"}var s=wv();Qt("click",ai,v);var o=C(s);o.__click=function(...c){var p;(p=e.onHomeClick)==null||p.apply(this,c)};var h=R(o,2);{var g=c=>{var p=xv(),b=C(p);b.__click=n;var w=R(C(b),2),m=C(w),u=R(w,2),l=R(b,2);{var d=f=>{var y=yv();At(y,21,()=>e.recentDirectories,E=>E.path,(E,S)=>{var L=bv();L.__click=()=>a(r(S).path);var x=C(L),P=C(x),B=R(x,2),j=C(B),V=C(j),N=C(V),X=R(V,2);{var W=M=>{var z=mv();A(M,z)};H(X,M=>{r(S).isGitRepo&&M(W)})}var Q=R(j,2),ne=C(Q),le=C(ne),D=R(ne,2),T=C(D);ee(M=>{Pe(P,0,Pi(r(S).isGitRepo?"text-accent-fg":"text-attention-fg")),Y(N,r(S).name),ze(ne,"title",r(S).path),Y(le,r(S).path),Y(T,M)},[()=>_(r(S).lastOpened)]),A(E,L)}),A(f,y)};H(l,f=>{r(i)&&f(d)})}ee(()=>{ze(b,"aria-expanded",r(i)),Y(m,`Recent (${e.recentDirectories.length??""})`),Pe(u,0,`transition-transform ${r(i)?"rotate-180":""}`)}),A(c,p)};H(h,c=>{e.recentDirectories.length>0&&c(g)})}A(t,s),Dt()}Ft(["click"]);var Cv=I('<div class="flex items-center justify-center h-full text-text-tertiary"><div class="flex flex-col items-center gap-3"><svg class="animate-spin h-8 w-8" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="text-sm">Loading...</span></div></div>'),kv=I('<div class="flex items-center justify-center h-full text-danger-fg px-6"><div class="text-center"><svg class="h-12 w-12 mx-auto mb-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"></path></svg> <p class="text-sm"> </p></div></div>'),Ev=I('<div class="flex items-center justify-center h-full text-text-tertiary"><div class="text-center"><svg class="h-12 w-12 mx-auto mb-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg> <p class="text-sm">No entries in this directory</p></div></div>'),Lv=I('<div role="listbox" aria-label="Directory entries"></div>'),Pv=I(`<div class="directory-picker-overlay fixed inset-0 z-50 bg-black/50
138
+ flex items-center justify-center p-2 sm:p-4
139
+ backdrop-blur-sm svelte-5esbg5" role="dialog" aria-modal="true" aria-labelledby="picker-title"><div class="directory-picker-modal w-full max-w-3xl
140
+ h-[calc(100dvh-1rem)] max-h-[calc(100dvh-1rem)]
141
+ sm:h-[90vh] sm:max-h-[90vh]
142
+ bg-bg-primary rounded-lg shadow-2xl
143
+ flex flex-col
144
+ border border-border-default svelte-5esbg5"><div class="picker-header px-6 py-4 border-b border-border-default
145
+ flex items-center justify-between bg-bg-secondary"><h2 id="picker-title" class="text-xl font-semibold text-text-primary">Select Directory</h2> <button type="button" class="p-2 min-w-[44px] min-h-[44px]
146
+ text-text-secondary hover:text-text-primary
147
+ hover:bg-bg-hover rounded-lg
148
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis" aria-label="Close directory picker" title="Close (Esc)"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <!> <div class="current-path px-6 py-3 border-b border-border-default
149
+ bg-bg-secondary flex items-center gap-2"><button type="button" class="p-2 min-w-[44px] min-h-[44px]
150
+ text-text-secondary hover:text-text-primary
151
+ hover:bg-bg-hover rounded
152
+ disabled:opacity-30 disabled:cursor-not-allowed
153
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis" aria-label="Go to parent directory" title="Up"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="18 15 12 9 6 15"></polyline></svg></button> <div class="flex-1 min-w-0"><code class="text-sm text-text-primary font-mono truncate block"> </code></div></div> <div class="directory-list flex-1 overflow-y-auto svelte-5esbg5"><!></div> <div class="picker-footer px-6 py-4 border-t border-border-default
154
+ pb-[calc(1rem+env(safe-area-inset-bottom,0px))]
155
+ pr-[calc(1.5rem+env(safe-area-inset-right,0px))]
156
+ pl-[calc(1.5rem+env(safe-area-inset-left,0px))]
157
+ bg-bg-secondary flex items-center justify-end gap-3"><button type="button" class="px-6 py-3 min-h-[52px] min-w-[100px]
158
+ text-text-primary bg-bg-tertiary
159
+ border border-border-default rounded-lg
160
+ hover:bg-bg-hover
161
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
162
+ font-medium transition-colors">Cancel</button> <button type="button" class="px-6 py-3 min-h-[52px] min-w-[100px]
163
+ text-white bg-success-emphasis
164
+ rounded-lg
165
+ hover:brightness-110
166
+ disabled:opacity-50 disabled:cursor-not-allowed
167
+ focus:outline-none focus:ring-2 focus:ring-success-emphasis
168
+ font-medium transition-colors">Select</button></div></div></div>`);function Rv(t,e){Tt(e,!0);let i=K(""),n=K(gt([])),a=K(!1),v=K(null),_=K(null),s=K(null),o=K(!1);async function h(L){k(a,!0),k(v,null);try{const x=encodeURIComponent(L),P=await fetch(`/api/browse?path=${x}`);if(!P.ok)throw new Error(`Failed to load directory: ${P.statusText}`);const B=await P.json();k(i,B.path,!0),k(n,B.entries,!0),k(s,B.parentPath,!0),k(o,B.canGoUp,!0),k(_,B.path,!0),k(a,!1)}catch(x){const P=x instanceof Error?x.message:"Failed to load directory";k(v,P,!0),k(a,!1)}}async function g(){try{const L=await fetch("/api/browse/home");if(!L.ok)throw new Error(`Failed to get home directory: ${L.statusText}`);const x=await L.json();await h(x.path)}catch(L){const x=L instanceof Error?L.message:"Failed to load home directory";k(v,x,!0)}}async function c(){r(s)!==null&&r(o)&&await h(r(s))}async function p(L){L.isDirectory?await h(L.path):k(_,r(i),!0)}function b(L){L.isDirectory&&k(_,L.path,!0)}function w(){r(_)!==null&&e.onSelect(r(_))}function m(){e.onClose()}async function u(){await g()}async function l(L){await h(L)}function d(L){L.key==="Escape"?(L.preventDefault(),m()):L.key==="Enter"&&r(_)!==null&&(L.preventDefault(),w())}St(()=>{e.isOpen&&r(i)===""&&g()});function f(L){L.target===L.currentTarget&&m()}var y=et(),E=Ae(y);{var S=L=>{var x=Pv();x.__click=f,x.__keydown=d;var P=C(x);P.__click=re=>re.stopPropagation();var B=C(P),j=R(C(B),2);j.__click=m;var V=R(B,2);Sv(V,{get recentDirectories(){return e.recentDirectories},onHomeClick:u,onRecentClick:l});var N=R(V,2),X=C(N);X.__click=c;var W=R(X,2),Q=C(W),ne=C(Q),le=R(N,2),D=C(le);{var T=re=>{var se=Cv();A(re,se)},M=re=>{var se=et(),G=Ae(se);{var O=F=>{var U=kv(),$=C(U),be=R(C($),2),xe=C(be);ee(()=>Y(xe,r(v))),A(F,U)},ie=F=>{var U=et(),$=Ae(U);{var be=ae=>{var he=Ev();A(ae,he)},xe=ae=>{var he=Lv();At(he,21,()=>r(n),fe=>fe.path,(fe,Ee)=>{{let He=ge(()=>r(_)===r(Ee).path);gv(fe,{get entry(){return r(Ee)},get selected(){return r(He)},onClick:()=>p(r(Ee)),onSelect:()=>b(r(Ee))})}}),A(ae,he)};H($,ae=>{r(n).length===0?ae(be):ae(xe,!1)},!0)}A(F,U)};H(G,F=>{r(v)!==null?F(O):F(ie,!1)},!0)}A(re,se)};H(D,re=>{r(a)?re(T):re(M,!1)})}var z=R(le,2),J=C(z);J.__click=m;var Z=R(J,2);Z.__click=w,ee(()=>{X.disabled=!r(o),ze(Q,"title",r(i)),Y(ne,r(i)||"/"),Z.disabled=r(_)===null}),A(L,x)};H(E,L=>{e.isOpen&&L(S)})}A(t,y),Dt()}Ft(["click","keydown"]);var Av=I(`<button type="button" class="comment-trigger absolute left-0 top-1 w-6 h-6 flex items-center justify-center
169
+ rounded bg-accent-emphasis text-white text-xs font-bold
170
+ opacity-0 group-hover/gutter:opacity-100
171
+ hover:bg-accent-emphasis transition-opacity z-10 cursor-pointer svelte-1miguua">+</button>`),Tv=I('<span class="highlighted-line svelte-1miguua"><!></span>'),Dv=I('<pre class="m-0 p-0 svelte-1miguua"> </pre>'),Iv=I('<div role="button" tabindex="0"><div class="w-16 flex-shrink-0 px-2 flex items-start justify-end text-text-secondary border-r border-border-default relative group/gutter"><!> <span class="cursor-pointer"> </span></div> <div><span class="font-bold"> </span></div> <div class="flex-1 px-2 overflow-x-auto cursor-pointer"><!></div></div>');function Bo(t,e){Tt(e,!0);let i=We(e,"highlighted",3,void 0),n=We(e,"selected",3,!1),a=We(e,"onSelect",3,void 0),v=We(e,"onLongPress",3,void 0),_=We(e,"onCommentClick",3,void 0),s=K(void 0);function o(V){switch(V){case"add":return"bg-diff-add-bg";case"delete":return"bg-diff-del-bg";case"context":return"bg-transparent";default:const N=V;throw new Error(`Unhandled change type: ${N}`)}}function h(V){switch(V){case"add":return"+";case"delete":return"-";case"context":return" ";default:const N=V;throw new Error(`Unhandled change type: ${N}`)}}function g(V){switch(V){case"add":return"text-success-fg";case"delete":return"text-danger-fg";case"context":return"text-text-secondary";default:const N=V;throw new Error(`Unhandled change type: ${N}`)}}function c(){a()!==void 0&&a()()}function p(){v()!==void 0&&k(s,setTimeout(()=>{v()!==void 0&&v()()},500),!0)}function b(){r(s)!==void 0&&(clearTimeout(r(s)),k(s,void 0))}function w(){r(s)!==void 0&&(clearTimeout(r(s)),k(s,void 0))}var m=Iv();m.__pointerdown=p,m.__pointerup=b;var u=C(m),l=C(u);{var d=V=>{var N=Av();N.__click=X=>{var W;X.stopPropagation(),(W=_())==null||W(X.shiftKey)},ee(()=>ze(N,"aria-label",`Add comment on line ${e.lineNumber??""}`)),A(V,N)};H(l,V=>{_()!==void 0&&V(d)})}var f=R(l,2);f.__click=c;var y=C(f),E=R(u,2),S=C(E),L=C(S),x=R(E,2);x.__click=c;var P=C(x);{var B=V=>{var N=Tv(),X=C(N);Qs(X,i),A(V,N)},j=V=>{var N=Dv(),X=C(N);ee(()=>Y(X,e.change.content)),A(V,N)};H(P,V=>{i()!==void 0?V(B):V(j,!1)})}ee((V,N,X)=>{Pe(m,1,`diff-line-row flex font-mono text-xs leading-5 select-none overflow-hidden ${V??""} ${n()?"ring-2 ring-accent-emphasis ring-inset":""}`,"svelte-1miguua"),ze(m,"aria-label",`Diff line ${e.lineNumber??""}: ${e.change.content??""}`),ze(m,"aria-selected",n()),Y(y,e.lineNumber),Pe(E,1,`w-8 flex-shrink-0 flex items-start justify-center ${N??""} border-r border-border-default`,"svelte-1miguua"),Y(L,X)},[()=>o(e.change.type),()=>g(e.change.type),()=>h(e.change.type)]),Qt("pointerleave",m,w),A(t,m),Dt()}Ft(["pointerdown","pointerup","click"]);var Mv=I(`<div class="absolute bottom-full right-0 mb-1 w-48
172
+ bg-bg-secondary border border-border-default rounded-lg shadow-lg z-50"><button type="button" class="w-full px-3 py-2 text-left text-sm text-text-primary
173
+ hover:bg-bg-tertiary rounded-lg
174
+ transition-colors duration-150
175
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis"> </button></div>`),Ov=I(`<div class="split-button-container relative flex"><button type="button" class="h-9 px-3
176
+ bg-success-emphasis hover:brightness-110
177
+ text-white text-sm font-medium rounded-l
178
+ disabled:opacity-50 disabled:cursor-not-allowed
179
+ transition-all duration-150
180
+ focus:outline-none focus:ring-2 focus:ring-success-emphasis"> </button> <button type="button" class="h-9 px-2
181
+ bg-success-emphasis hover:brightness-110
182
+ text-white rounded-r
183
+ border-l border-white/20
184
+ disabled:opacity-50 disabled:cursor-not-allowed
185
+ transition-all duration-150
186
+ focus:outline-none focus:ring-2 focus:ring-success-emphasis" aria-label="More submit options" aria-haspopup="true"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"></polyline></svg></button> <!></div>`);function Ps(t,e){const i=We(e,"disabled",3,!1),n=We(e,"primaryLabel",3,"Submit"),a=We(e,"secondaryLabel",3,"Submit & Run Now");let v=K(!1);function _(){k(v,!r(v))}function s(m){r(v)&&(m.target.closest(".split-button-container")||k(v,!1))}function o(m){m.key==="Escape"&&r(v)&&(m.preventDefault(),k(v,!1))}var h=Ov();Qt("click",ai,s),Qt("keydown",ai,o);var g=C(h);g.__click=function(...m){var u;(u=e.onPrimaryClick)==null||u.apply(this,m)};var c=C(g),p=R(g,2);p.__click=_;var b=R(p,2);{var w=m=>{var u=Mv(),l=C(u);l.__click=function(...f){var y;(y=e.onSecondaryClick)==null||y.apply(this,f)};var d=C(l);ee(()=>Y(d,a())),A(m,u)};H(b,m=>{r(v)&&m(w)})}ee(()=>{g.disabled=i(),Y(c,n()),p.disabled=i(),ze(p,"aria-expanded",r(v))}),A(t,h)}Ft(["click"]);var Bv=I('<div class="flex items-center justify-center h-full text-text-secondary p-8"><p class="text-sm">No old content (new file)</p></div>'),Nv=I(`<div class="border-t-2 border-b-2 border-accent-emphasis bg-bg-secondary p-3"><textarea class="w-full min-h-[80px] p-2 text-sm font-sans bg-bg-primary border border-border-default rounded resize-y
187
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis" placeholder="Ask AI about this code..."></textarea> <div class="flex items-center justify-between mt-2"><div class="text-xs text-text-tertiary font-mono"> </div> <div class="flex items-center gap-2"><button type="button" class="px-3 py-1 text-sm text-text-secondary hover:text-text-primary">Cancel</button> <!></div></div></div>`),jv=I("<div><!></div> <!>",1),Fv=I('<div class="flex items-center justify-center h-full text-text-secondary p-8"><p class="text-sm">No new content (deleted file)</p></div>'),Hv=I(`<div class="border-t-2 border-b-2 border-accent-emphasis bg-bg-secondary p-3"><textarea class="w-full min-h-[80px] p-2 text-sm font-sans bg-bg-primary border border-border-default rounded resize-y
188
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis" placeholder="Ask AI about this code..."></textarea> <div class="flex items-center justify-between mt-2"><div class="text-xs text-text-tertiary font-mono"> </div> <div class="flex items-center gap-2"><button type="button" class="px-3 py-1 text-sm text-text-secondary hover:text-text-primary">Cancel</button> <!></div></div></div>`),Vv=I("<div><!></div> <!>",1),Wv=I('<div class="flex w-full h-full"><div class="w-1/2 overflow-y-auto overflow-x-hidden border-r border-border-default svelte-ngva0x" style="scroll-behavior: smooth;"><div class="min-h-full svelte-ngva0x"><!></div></div> <div class="w-1/2 overflow-y-auto overflow-x-hidden svelte-ngva0x" style="scroll-behavior: smooth;"><div class="min-h-full svelte-ngva0x"><!></div></div></div>');function Uv(t,e){Tt(e,!0);let i=We(e,"onLineSelect",3,void 0),n=We(e,"onCommentOpen",3,void 0),a=We(e,"onCommentSubmit",3,void 0),v=We(e,"onCommentCancel",3,void 0),_=We(e,"commentLine",3,void 0);We(e,"placeholder",3,"Ask AI about this line...");let s=We(e,"rangeLines",19,()=>[]),o=We(e,"oldHighlightMap",3,void 0),h=We(e,"newHighlightMap",3,void 0),g=We(e,"filePath",3,void 0),c=K("");const p=ge(()=>{if(_()===void 0||g()===void 0)return"";const T=_().startLine===_().endLine?`L${_().startLine}`:`L${_().startLine}-L${_().endLine}`;return`${g()}:${T}`});let b=K(0),w=K(0),m=K(!1);function u(T){if(r(m))return;const M=T.target;M!==null&&(k(m,!0),k(b,M.scrollTop,!0),k(w,M.scrollTop,!0),requestAnimationFrame(()=>{k(m,!1)}))}function l(T){if(r(m))return;const M=T.target;M!==null&&(k(m,!0),k(w,M.scrollTop,!0),k(b,M.scrollTop,!0),requestAnimationFrame(()=>{k(m,!1)}))}const d=ge(()=>{const T=[];for(const M of e.chunks)for(const z of M.changes)if(z.type==="delete"||z.type==="context"){const J=z.oldLine??0;T.push({change:z,lineNumber:J})}return T}),f=ge(()=>{const T=[];for(const M of e.chunks)for(const z of M.changes)if(z.type==="add"||z.type==="context"){const J=z.newLine??0;T.push({change:z,lineNumber:J})}return T});function y(T){i()!==void 0&&i()("old",T)}function E(T){i()!==void 0&&i()("new",T)}function S(T,M){n()!==void 0&&n()("old",T,M)}function L(T,M){n()!==void 0&&n()("new",T,M)}function x(T,M){return _()===void 0||_().side!==T?!1:s().includes(M)}var P=Wv(),B=C(P),j=C(B),V=C(j);{var N=T=>{var M=Bv();A(T,M)},X=T=>{var M=et(),z=Ae(M);At(z,17,()=>r(d),Pr,(J,Z)=>{let re=()=>r(Z).change,se=()=>r(Z).lineNumber;var G=jv(),O=Ae(G),ie=C(O);{let $=ge(()=>{var be;return(be=o())==null?void 0:be.get(se())});Bo(ie,{get change(){return re()},get lineNumber(){return se()},get highlighted(){return r($)},onSelect:()=>y(se()),onCommentClick:be=>S(se(),be)})}var F=R(O,2);{var U=$=>{var be=Nv(),xe=C(be);xe.__keydown=ce=>{ce.key==="Enter"&&ce.ctrlKey&&a()!==void 0&&(ce.preventDefault(),a()(r(c),!0),k(c,"")),ce.key==="Escape"&&v()!==void 0&&(v()(),k(c,""))};var ae=R(xe,2),he=C(ae),fe=C(he),Ee=R(he,2),He=C(Ee);He.__click=()=>{v()!==void 0&&(v()(),k(c,""))};var Le=R(He,2);{let ce=ge(()=>r(c).trim().length===0);Ps(Le,{get disabled(){return r(ce)},onPrimaryClick:()=>{a()!==void 0&&(a()(r(c),!1),k(c,""))},onSecondaryClick:()=>{a()!==void 0&&(a()(r(c),!0),k(c,""))}})}ee(()=>Y(fe,r(p))),Rr(xe,()=>r(c),ce=>k(c,ce)),A($,be)};H(F,$=>{_()!==void 0&&_().side==="old"&&_().endLine===se()&&$(U)})}ee($=>Pe(O,1,$),[()=>Pi(x("old",se())?"bg-accent-muted":"")]),A(J,G)}),A(T,M)};H(V,T=>{r(d).length===0?T(N):T(X,!1)})}var W=R(B,2),Q=C(W),ne=C(Q);{var le=T=>{var M=Fv();A(T,M)},D=T=>{var M=et(),z=Ae(M);At(z,17,()=>r(f),Pr,(J,Z)=>{let re=()=>r(Z).change,se=()=>r(Z).lineNumber;var G=Vv(),O=Ae(G),ie=C(O);{let $=ge(()=>{var be;return(be=h())==null?void 0:be.get(se())});Bo(ie,{get change(){return re()},get lineNumber(){return se()},get highlighted(){return r($)},onSelect:()=>E(se()),onCommentClick:be=>L(se(),be)})}var F=R(O,2);{var U=$=>{var be=Hv(),xe=C(be);xe.__keydown=ce=>{ce.key==="Enter"&&ce.ctrlKey&&a()!==void 0&&(ce.preventDefault(),a()(r(c),!0),k(c,"")),ce.key==="Escape"&&v()!==void 0&&(v()(),k(c,""))};var ae=R(xe,2),he=C(ae),fe=C(he),Ee=R(he,2),He=C(Ee);He.__click=()=>{v()!==void 0&&(v()(),k(c,""))};var Le=R(He,2);{let ce=ge(()=>r(c).trim().length===0);Ps(Le,{get disabled(){return r(ce)},onPrimaryClick:()=>{a()!==void 0&&(a()(r(c),!1),k(c,""))},onSecondaryClick:()=>{a()!==void 0&&(a()(r(c),!0),k(c,""))}})}ee(()=>Y(fe,r(p))),Rr(xe,()=>r(c),ce=>k(c,ce)),A($,be)};H(F,$=>{_()!==void 0&&_().side==="new"&&_().endLine===se()&&$(U)})}ee($=>Pe(O,1,$),[()=>Pi(x("new",se())?"bg-accent-muted":"")]),A(J,G)}),A(T,M)};H(ne,T=>{r(f).length===0?T(le):T(D,!1)})}Qt("scroll",B,u),Qt("scroll",W,l),A(t,P),Dt()}Ft(["keydown","click"]);var zv=I('<div class="flex items-center justify-center py-12 text-text-secondary text-sm">No changes to display</div>'),qv=I(`<button type="button" class="absolute left-0 top-1 w-6 h-6 flex items-center justify-center
189
+ rounded bg-accent-emphasis text-white text-xs font-bold
190
+ opacity-0 group-hover/inlinerow:opacity-100
191
+ hover:bg-accent-fg transition-opacity z-10 cursor-pointer" aria-label="Add comment">+</button>`),Gv=I('<span class="leading-5"> </span>'),Kv=I('<span class="leading-5 opacity-30">-</span>'),Jv=I('<span class="leading-5"> </span>'),Qv=I('<span class="leading-5 opacity-30">-</span>'),Xv=I(`<div class="border-t-2 border-b-2 border-accent-emphasis bg-bg-secondary p-3"><textarea class="w-full min-h-[80px] p-2 text-sm font-sans bg-bg-primary border border-border-default rounded resize-y
192
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis svelte-1757rrd" placeholder="Ask AI about this code..."></textarea> <div class="flex items-center justify-between mt-2"><div class="text-xs text-text-tertiary font-mono"> </div> <div class="flex items-center gap-2"><button type="button" class="px-3 py-1 text-sm text-text-secondary hover:text-text-primary">Cancel</button> <!></div></div></div>`),Yv=I('<div><div class="w-16 flex-shrink-0 px-2 flex items-start justify-end text-text-secondary bg-bg-secondary border-r border-border-default relative"><!> <!></div> <div class="w-16 flex-shrink-0 px-2 flex items-start justify-end text-text-secondary bg-bg-secondary border-r border-border-default"><!></div> <div class="flex-1"><!></div></div> <!>',1),Zv=I('<div class="w-full font-mono text-xs leading-5 svelte-1757rrd"><!></div>');function Tc(t,e){Tt(e,!0);let i=We(e,"onLineSelect",3,void 0),n=We(e,"onCommentOpen",3,void 0),a=We(e,"onCommentSubmit",3,void 0),v=We(e,"onCommentCancel",3,void 0),_=We(e,"commentLine",3,void 0);We(e,"placeholder",3,"Ask AI about this line...");let s=We(e,"rangeLines",19,()=>[]),o=We(e,"oldHighlightMap",3,void 0),h=We(e,"newHighlightMap",3,void 0),g=We(e,"filePath",3,void 0),c=K("");const p=ge(()=>{if(_()===void 0||g()===void 0)return"";const S=_().startLine===_().endLine?`L${_().startLine}`:`L${_().startLine}-L${_().endLine}`;return`${g()}:${S}`}),b=ge(()=>{const S=[];let L=0;for(const x of e.chunks)for(const P of x.changes)S.push({change:P,chunkHeader:x.header,index:L++});return S});function w(S,L){i()!==void 0&&(L!==void 0?i()(L,"new"):S!==void 0&&i()(S,"old"))}function m(S,L,x){n()!==void 0&&(L!==void 0?n()(L,"new",x):S!==void 0&&n()(S,"old",x))}function u(S,L){return _()===void 0?!1:_().type==="new"&&L===_().endLine||_().type==="old"&&S===_().endLine}function l(S,L){return _()===void 0?!1:_().type==="new"&&L!==void 0?s().includes(L):_().type==="old"&&S!==void 0?s().includes(S):!1}var d=Zv(),f=C(d);{var y=S=>{var L=zv();A(S,L)},E=S=>{var L=et(),x=Ae(L);At(x,17,()=>r(b),({change:P,index:B})=>B,(P,B)=>{let j=()=>r(B).change,V=()=>r(B).index;var N=Yv(),X=Ae(N),W=C(X),Q=C(W);{var ne=ie=>{var F=qv();F.__click=U=>{U.stopPropagation(),m(j().oldLine,j().newLine,U.shiftKey)},A(ie,F)};H(Q,ie=>{n()!==void 0&&ie(ne)})}var le=R(Q,2);{var D=ie=>{var F=Gv(),U=C(F);ee(()=>Y(U,j().oldLine)),A(ie,F)},T=ie=>{var F=Kv();A(ie,F)};H(le,ie=>{j().oldLine!==void 0?ie(D):ie(T,!1)})}var M=R(W,2),z=C(M);{var J=ie=>{var F=Jv(),U=C(F);ee(()=>Y(U,j().newLine)),A(ie,F)},Z=ie=>{var F=Qv();A(ie,F)};H(z,ie=>{j().newLine!==void 0?ie(J):ie(Z,!1)})}var re=R(M,2),se=C(re);{let ie=ge(()=>j().newLine??j().oldLine??V()+1),F=ge(()=>{var U,$;return j().type==="delete"?(U=o())==null?void 0:U.get(j().oldLine??0):($=h())==null?void 0:$.get(j().newLine??0)});Bo(se,{get change(){return j()},get lineNumber(){return r(ie)},get highlighted(){return r(F)},onSelect:()=>w(j().oldLine,j().newLine)})}var G=R(X,2);{var O=ie=>{var F=Xv(),U=C(F);U.__keydown=Ee=>{Ee.key==="Enter"&&Ee.ctrlKey&&a()!==void 0&&(Ee.preventDefault(),a()(r(c),!0),k(c,"")),Ee.key==="Escape"&&v()!==void 0&&(v()(),k(c,""))};var $=R(U,2),be=C($),xe=C(be),ae=R(be,2),he=C(ae);he.__click=()=>{v()!==void 0&&(v()(),k(c,""))};var fe=R(he,2);{let Ee=ge(()=>r(c).trim().length===0);Ps(fe,{get disabled(){return r(Ee)},onPrimaryClick:()=>{a()!==void 0&&(a()(r(c),!1),k(c,""))},onSecondaryClick:()=>{a()!==void 0&&(a()(r(c),!0),k(c,""))}})}ee(()=>Y(xe,r(p))),Rr(U,()=>r(c),Ee=>k(c,Ee)),A(ie,F)};H(G,ie=>{u(j().oldLine,j().newLine)&&ie(O)})}ee(ie=>Pe(X,1,`flex diff-line-row group/inlinerow ${ie??""}`),[()=>l(j().oldLine,j().newLine)?"bg-accent-muted":""]),A(P,N)}),A(S,L)};H(f,S=>{r(b).length===0?S(y):S(E,!1)})}A(t,d),Dt()}Ft(["click","keydown"]);const $v="modulepreload",e_=function(t){return"/"+t},Ga={},q=function(e,i,n){let a=Promise.resolve();if(i&&i.length>0){let _=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(c=>({status:"fulfilled",value:c}),c=>({status:"rejected",reason:c}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));a=_(i.map(h=>{if(h=e_(h),h in Ga)return;Ga[h]=!0;const g=h.endsWith(".css"),c=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${c}`))return;const p=document.createElement("link");if(p.rel=g?"stylesheet":$v,g||(p.as="script"),p.crossOrigin="",p.href=h,o&&p.setAttribute("nonce",o),document.head.appendChild(p),g)return new Promise((b,w)=>{p.addEventListener("load",b),p.addEventListener("error",()=>w(Error(`Unable to preload CSS for ${h}`)))})}))}function v(_){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=_,window.dispatchEvent(s),!s.defaultPrevented)throw _}return a.then(_=>{for(const s of _||[])s.status==="rejected"&&v(s.reason);return e().catch(v)})};let or=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function t_(t){return fa(t)}function fa(t){return Array.isArray(t)?r_(t):t instanceof RegExp?t:typeof t=="object"?i_(t):t}function r_(t){let e=[];for(let i=0,n=t.length;i<n;i++)e[i]=fa(t[i]);return e}function i_(t){let e={};for(let i in t)e[i]=fa(t[i]);return e}function Dc(t,...e){return e.forEach(i=>{for(let n in i)t[n]=i[n]}),t}function Ic(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Ic(t.substring(0,t.length-1)):t.substr(~e+1)}var fo=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ds=class{static hasCaptures(t){return t===null?!1:(fo.lastIndex=0,fo.test(t))}static replaceCaptures(t,e,i){return t.replace(fo,(n,a,v,_)=>{let s=i[parseInt(a||v,10)];if(s){let o=e.substring(s.start,s.end);for(;o[0]===".";)o=o.substring(1);switch(_){case"downcase":return o.toLowerCase();case"upcase":return o.toUpperCase();default:return o}}else return n})}};function Mc(t,e){return t<e?-1:t>e?1:0}function Oc(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let i=t.length,n=e.length;if(i===n){for(let a=0;a<i;a++){let v=Mc(t[a],e[a]);if(v!==0)return v}return 0}return i-n}function Ka(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Bc(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Nc=class{constructor(t){Se(this,"cache",new Map);this.fn=t}get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},Rs=class{constructor(t,e,i){Se(this,"_cachedMatchRoot",new Nc(t=>this._root.match(t)));this._colorMap=t,this._defaults=e,this._root=i}static createFromRawTheme(t,e){return this.createFromParsedTheme(o_(t),e)}static createFromParsedTheme(t,e){return l_(t,e)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(a=>n_(t.parent,a.parentScopes));return n?new jc(n.fontStyle,n.foreground,n.background):null}},vo=class bs{constructor(e,i){this.parent=e,this.scopeName=i}static push(e,i){for(const n of i)e=new bs(e,n);return e}static from(...e){let i=null;for(let n=0;n<e.length;n++)i=new bs(i,e[n]);return i}push(e){return new bs(this,e)}getSegments(){let e=this;const i=[];for(;e;)i.push(e.scopeName),e=e.parent;return i.reverse(),i}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const i=[];let n=this;for(;n&&n!==e;)i.push(n.scopeName),n=n.parent;return n===e?i.reverse():void 0}};function n_(t,e){if(e.length===0)return!0;for(let i=0;i<e.length;i++){let n=e[i],a=!1;if(n===">"){if(i===e.length-1)return!1;n=e[++i],a=!0}for(;t&&!s_(t.scopeName,n);){if(a)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function s_(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var jc=class{constructor(t,e,i){this.fontStyle=t,this.foregroundId=e,this.backgroundId=i}};function o_(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,i=[],n=0;for(let a=0,v=e.length;a<v;a++){let _=e[a];if(!_.settings)continue;let s;if(typeof _.scope=="string"){let c=_.scope;c=c.replace(/^[,]+/,""),c=c.replace(/[,]+$/,""),s=c.split(",")}else Array.isArray(_.scope)?s=_.scope:s=[""];let o=-1;if(typeof _.settings.fontStyle=="string"){o=0;let c=_.settings.fontStyle.split(" ");for(let p=0,b=c.length;p<b;p++)switch(c[p]){case"italic":o=o|1;break;case"bold":o=o|2;break;case"underline":o=o|4;break;case"strikethrough":o=o|8;break}}let h=null;typeof _.settings.foreground=="string"&&Ka(_.settings.foreground)&&(h=_.settings.foreground);let g=null;typeof _.settings.background=="string"&&Ka(_.settings.background)&&(g=_.settings.background);for(let c=0,p=s.length;c<p;c++){let w=s[c].trim().split(" "),m=w[w.length-1],u=null;w.length>1&&(u=w.slice(0,w.length-1),u.reverse()),i[n++]=new a_(m,u,a,o,h,g)}}return i}var a_=class{constructor(t,e,i,n,a,v){this.scope=t,this.parentScopes=e,this.index=i,this.fontStyle=n,this.foreground=a,this.background=v}},Lr=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Lr||{});function l_(t,e){t.sort((o,h)=>{let g=Mc(o.scope,h.scope);return g!==0||(g=Oc(o.parentScopes,h.parentScopes),g!==0)?g:o.index-h.index});let i=0,n="#000000",a="#ffffff";for(;t.length>=1&&t[0].scope==="";){let o=t.shift();o.fontStyle!==-1&&(i=o.fontStyle),o.foreground!==null&&(n=o.foreground),o.background!==null&&(a=o.background)}let v=new c_(e),_=new jc(i,v.getId(n),v.getId(a)),s=new u_(new No(0,null,-1,0,0),[]);for(let o=0,h=t.length;o<h;o++){let g=t[o];s.insert(0,g.scope,g.parentScopes,g.fontStyle,v.getId(g.foreground),v.getId(g.background))}return new Rs(v,_,s)}var c_=class{constructor(t){Se(this,"_isFrozen");Se(this,"_lastColorId");Se(this,"_id2color");Se(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,i=t.length;e<i;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},d_=Object.freeze([]),No=class Fc{constructor(e,i,n,a,v){Se(this,"scopeDepth");Se(this,"parentScopes");Se(this,"fontStyle");Se(this,"foreground");Se(this,"background");this.scopeDepth=e,this.parentScopes=i||d_,this.fontStyle=n,this.foreground=a,this.background=v}clone(){return new Fc(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let i=[];for(let n=0,a=e.length;n<a;n++)i[n]=e[n].clone();return i}acceptOverwrite(e,i,n,a){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,i!==-1&&(this.fontStyle=i),n!==0&&(this.foreground=n),a!==0&&(this.background=a)}},u_=class jo{constructor(e,i=[],n={}){Se(this,"_rulesWithParentScopes");this._mainRule=e,this._children=n,this._rulesWithParentScopes=i}static _cmpBySpecificity(e,i){if(e.scopeDepth!==i.scopeDepth)return i.scopeDepth-e.scopeDepth;let n=0,a=0;for(;e.parentScopes[n]===">"&&n++,i.parentScopes[a]===">"&&a++,!(n>=e.parentScopes.length||a>=i.parentScopes.length);){const v=i.parentScopes[a].length-e.parentScopes[n].length;if(v!==0)return v;n++,a++}return i.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let n=e.indexOf("."),a,v;if(n===-1?(a=e,v=""):(a=e.substring(0,n),v=e.substring(n+1)),this._children.hasOwnProperty(a))return this._children[a].match(v)}const i=this._rulesWithParentScopes.concat(this._mainRule);return i.sort(jo._cmpBySpecificity),i}insert(e,i,n,a,v,_){if(i===""){this._doInsertHere(e,n,a,v,_);return}let s=i.indexOf("."),o,h;s===-1?(o=i,h=""):(o=i.substring(0,s),h=i.substring(s+1));let g;this._children.hasOwnProperty(o)?g=this._children[o]:(g=new jo(this._mainRule.clone(),No.cloneArr(this._rulesWithParentScopes)),this._children[o]=g),g.insert(e+1,h,n,a,v,_)}_doInsertHere(e,i,n,a,v){if(i===null){this._mainRule.acceptOverwrite(e,n,a,v);return}for(let _=0,s=this._rulesWithParentScopes.length;_<s;_++){let o=this._rulesWithParentScopes[_];if(Oc(o.parentScopes,i)===0){o.acceptOverwrite(e,n,a,v);return}}n===-1&&(n=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),v===0&&(v=this._mainRule.background),this._rulesWithParentScopes.push(new No(e,i,n,a,v))}},Rn=class Gr{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const i=Gr.getLanguageId(e),n=Gr.getTokenType(e),a=Gr.getFontStyle(e),v=Gr.getForeground(e),_=Gr.getBackground(e);console.log({languageId:i,tokenType:n,fontStyle:a,foreground:v,background:_})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,i,n,a,v,_,s){let o=Gr.getLanguageId(e),h=Gr.getTokenType(e),g=Gr.containsBalancedBrackets(e)?1:0,c=Gr.getFontStyle(e),p=Gr.getForeground(e),b=Gr.getBackground(e);return i!==0&&(o=i),n!==8&&(h=n),a!==null&&(g=a?1:0),v!==-1&&(c=v),_!==0&&(p=_),s!==0&&(b=s),(o<<0|h<<8|g<<10|c<<11|p<<15|b<<24)>>>0}};function As(t,e){const i=[],n=h_(t);let a=n.next();for(;a!==null;){let o=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=n.next()}let h=_();if(i.push({matcher:h,priority:o}),a!==",")break;a=n.next()}return i;function v(){if(a==="-"){a=n.next();const o=v();return h=>!!o&&!o(h)}if(a==="("){a=n.next();const o=s();return a===")"&&(a=n.next()),o}if(Ja(a)){const o=[];do o.push(a),a=n.next();while(Ja(a));return h=>e(o,h)}return null}function _(){const o=[];let h=v();for(;h;)o.push(h),h=v();return g=>o.every(c=>c(g))}function s(){const o=[];let h=_();for(;h&&(o.push(h),a==="|"||a===",");){do a=n.next();while(a==="|"||a===",");h=_()}return g=>o.some(c=>c(g))}}function Ja(t){return!!t&&!!t.match(/[\w\.:]+/)}function h_(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,i=e.exec(t);return{next:()=>{if(!i)return null;const n=i[0];return i=e.exec(t),n}}}function Hc(t){typeof t.dispose=="function"&&t.dispose()}var Kn=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},f_=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},v_=class{constructor(){Se(this,"_references",[]);Se(this,"_seenReferenceKeys",new Set);Se(this,"visitedRule",new Set)}get references(){return this._references}add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},__=class{constructor(t,e){Se(this,"seenFullScopeRequests",new Set);Se(this,"seenPartialScopeRequests",new Set);Se(this,"Q");this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Kn(this.initialScopeName)]}processQueue(){const t=this.Q;this.Q=[];const e=new v_;for(const i of t)p_(i,this.initialScopeName,this.repo,e);for(const i of e.references)if(i instanceof Kn){if(this.seenFullScopeRequests.has(i.scopeName))continue;this.seenFullScopeRequests.add(i.scopeName),this.Q.push(i)}else{if(this.seenFullScopeRequests.has(i.scopeName)||this.seenPartialScopeRequests.has(i.toKey()))continue;this.seenPartialScopeRequests.add(i.toKey()),this.Q.push(i)}}};function p_(t,e,i,n){const a=i.lookup(t.scopeName);if(!a){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const v=i.lookup(e);t instanceof Kn?ys({baseGrammar:v,selfGrammar:a},n):Fo(t.ruleName,{baseGrammar:v,selfGrammar:a,repository:a.repository},n);const _=i.injections(t.scopeName);if(_)for(const s of _)n.add(new Kn(s))}function Fo(t,e,i){if(e.repository&&e.repository[t]){const n=e.repository[t];Ts([n],e,i)}}function ys(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Ts(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Ts(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Ts(t,e,i){for(const n of t){if(i.visitedRule.has(n))continue;i.visitedRule.add(n);const a=n.repository?Dc({},e.repository,n.repository):e.repository;Array.isArray(n.patterns)&&Ts(n.patterns,{...e,repository:a},i);const v=n.include;if(!v)continue;const _=Vc(v);switch(_.kind){case 0:ys({...e,selfGrammar:e.baseGrammar},i);break;case 1:ys(e,i);break;case 2:Fo(_.ruleName,{...e,repository:a},i);break;case 3:case 4:const s=_.scopeName===e.selfGrammar.scopeName?e.selfGrammar:_.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(s){const o={baseGrammar:e.baseGrammar,selfGrammar:s,repository:a};_.kind===4?Fo(_.ruleName,o,i):ys(o,i)}else _.kind===4?i.add(new f_(_.scopeName,_.ruleName)):i.add(new Kn(_.scopeName));break}}}var g_=class{constructor(){Se(this,"kind",0)}},m_=class{constructor(){Se(this,"kind",1)}},b_=class{constructor(t){Se(this,"kind",2);this.ruleName=t}},y_=class{constructor(t){Se(this,"kind",3);this.scopeName=t}},x_=class{constructor(t,e){Se(this,"kind",4);this.scopeName=t,this.ruleName=e}};function Vc(t){if(t==="$base")return new g_;if(t==="$self")return new m_;const e=t.indexOf("#");if(e===-1)return new y_(t);if(e===0)return new b_(t.substring(1));{const i=t.substring(0,e),n=t.substring(e+1);return new x_(i,n)}}var w_=/\\(\d+)/,Qa=/\\(\d+)/g,S_=-1,Wc=-2;var ss=class{constructor(t,e,i,n){Se(this,"$location");Se(this,"id");Se(this,"_nameIsCapturing");Se(this,"_name");Se(this,"_contentNameIsCapturing");Se(this,"_contentName");this.$location=t,this.id=e,this._name=i||null,this._nameIsCapturing=ds.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=ds.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Ic(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:ds.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ds.replaceCaptures(this._contentName,t,e)}},C_=class extends ss{constructor(e,i,n,a,v){super(e,i,n,a);Se(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=v}dispose(){}collectPatterns(e,i){throw new Error("Not supported!")}compile(e,i){throw new Error("Not supported!")}compileAG(e,i,n,a){throw new Error("Not supported!")}},k_=class extends ss{constructor(e,i,n,a,v){super(e,i,n,null);Se(this,"_match");Se(this,"captures");Se(this,"_cachedCompiledPatterns");this._match=new Jn(a,this.id),this.captures=v,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,i){i.push(this._match)}compile(e,i){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,i,n,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Qn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Xa=class extends ss{constructor(e,i,n,a,v){super(e,i,n,a);Se(this,"hasMissingPatterns");Se(this,"patterns");Se(this,"_cachedCompiledPatterns");this.patterns=v.patterns,this.hasMissingPatterns=v.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,i){for(const n of this.patterns)e.getRule(n).collectPatterns(e,i)}compile(e,i){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,i,n,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Qn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ho=class extends ss{constructor(e,i,n,a,v,_,s,o,h,g){super(e,i,n,a);Se(this,"_begin");Se(this,"beginCaptures");Se(this,"_end");Se(this,"endHasBackReferences");Se(this,"endCaptures");Se(this,"applyEndPatternLast");Se(this,"hasMissingPatterns");Se(this,"patterns");Se(this,"_cachedCompiledPatterns");this._begin=new Jn(v,this.id),this.beginCaptures=_,this._end=new Jn(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=o,this.applyEndPatternLast=h||!1,this.patterns=g.patterns,this.hasMissingPatterns=g.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,i){return this._end.resolveBackReferences(e,i)}collectPatterns(e,i){i.push(this._begin)}compile(e,i){return this._getCachedCompiledPatterns(e,i).compile(e)}compileAG(e,i,n,a){return this._getCachedCompiledPatterns(e,i).compileAG(e,n,a)}_getCachedCompiledPatterns(e,i){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Qn;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,i):this._cachedCompiledPatterns.setSource(0,i)),this._cachedCompiledPatterns}},Ds=class extends ss{constructor(e,i,n,a,v,_,s,o,h){super(e,i,n,a);Se(this,"_begin");Se(this,"beginCaptures");Se(this,"whileCaptures");Se(this,"_while");Se(this,"whileHasBackReferences");Se(this,"hasMissingPatterns");Se(this,"patterns");Se(this,"_cachedCompiledPatterns");Se(this,"_cachedCompiledWhilePatterns");this._begin=new Jn(v,this.id),this.beginCaptures=_,this.whileCaptures=o,this._while=new Jn(s,Wc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,i){return this._while.resolveBackReferences(e,i)}collectPatterns(e,i){i.push(this._begin)}compile(e,i){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,i,n,a){return this._getCachedCompiledPatterns(e).compileAG(e,n,a)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Qn;for(const i of this.patterns)e.getRule(i).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,i){return this._getCachedCompiledWhilePatterns(e,i).compile(e)}compileWhileAG(e,i,n,a){return this._getCachedCompiledWhilePatterns(e,i).compileAG(e,n,a)}_getCachedCompiledWhilePatterns(e,i){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Qn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,i||"￿"),this._cachedCompiledWhilePatterns}},Uc=class Er{static createCaptureRule(e,i,n,a,v){return e.registerRule(_=>new C_(i,_,n,a,v))}static getCompiledRuleId(e,i,n){return e.id||i.registerRule(a=>{if(e.id=a,e.match)return new k_(e.$vscodeTextmateLocation,e.id,e.name,e.match,Er._compileCaptures(e.captures,i,n));if(typeof e.begin>"u"){e.repository&&(n=Dc({},n,e.repository));let v=e.patterns;return typeof v>"u"&&e.include&&(v=[{include:e.include}]),new Xa(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Er._compilePatterns(v,i,n))}return e.while?new Ds(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Er._compileCaptures(e.beginCaptures||e.captures,i,n),e.while,Er._compileCaptures(e.whileCaptures||e.captures,i,n),Er._compilePatterns(e.patterns,i,n)):new Ho(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Er._compileCaptures(e.beginCaptures||e.captures,i,n),e.end,Er._compileCaptures(e.endCaptures||e.captures,i,n),e.applyEndPatternLast,Er._compilePatterns(e.patterns,i,n))}),e.id}static _compileCaptures(e,i,n){let a=[];if(e){let v=0;for(const _ in e){if(_==="$vscodeTextmateLocation")continue;const s=parseInt(_,10);s>v&&(v=s)}for(let _=0;_<=v;_++)a[_]=null;for(const _ in e){if(_==="$vscodeTextmateLocation")continue;const s=parseInt(_,10);let o=0;e[_].patterns&&(o=Er.getCompiledRuleId(e[_],i,n)),a[s]=Er.createCaptureRule(i,e[_].$vscodeTextmateLocation,e[_].name,e[_].contentName,o)}}return a}static _compilePatterns(e,i,n){let a=[];if(e)for(let v=0,_=e.length;v<_;v++){const s=e[v];let o=-1;if(s.include){const h=Vc(s.include);switch(h.kind){case 0:case 1:o=Er.getCompiledRuleId(n[s.include],i,n);break;case 2:let g=n[h.ruleName];g&&(o=Er.getCompiledRuleId(g,i,n));break;case 3:case 4:const c=h.scopeName,p=h.kind===4?h.ruleName:null,b=i.getExternalGrammar(c,n);if(b)if(p){let w=b.repository[p];w&&(o=Er.getCompiledRuleId(w,i,b.repository))}else o=Er.getCompiledRuleId(b.repository.$self,i,b.repository);break}}else o=Er.getCompiledRuleId(s,i,n);if(o!==-1){const h=i.getRule(o);let g=!1;if((h instanceof Xa||h instanceof Ho||h instanceof Ds)&&h.hasMissingPatterns&&h.patterns.length===0&&(g=!0),g)continue;a.push(o)}}return{patterns:a,hasMissingPatterns:(e?e.length:0)!==a.length}}},Jn=class zc{constructor(e,i){Se(this,"source");Se(this,"ruleId");Se(this,"hasAnchor");Se(this,"hasBackReferences");Se(this,"_anchorCache");if(e&&typeof e=="string"){const n=e.length;let a=0,v=[],_=!1;for(let s=0;s<n;s++)if(e.charAt(s)==="\\"&&s+1<n){const h=e.charAt(s+1);h==="z"?(v.push(e.substring(a,s)),v.push("$(?!\\n)(?<!\\n)"),a=s+2):(h==="A"||h==="G")&&(_=!0),s++}this.hasAnchor=_,a===0?this.source=e:(v.push(e.substring(a,n)),this.source=v.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=i,typeof this.source=="string"?this.hasBackReferences=w_.test(this.source):this.hasBackReferences=!1}clone(){return new zc(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,i){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=i.map(a=>e.substring(a.start,a.end));return Qa.lastIndex=0,this.source.replace(Qa,(a,v)=>Bc(n[parseInt(v,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],i=[],n=[],a=[],v,_,s,o;for(v=0,_=this.source.length;v<_;v++)s=this.source.charAt(v),e[v]=s,i[v]=s,n[v]=s,a[v]=s,s==="\\"&&v+1<_&&(o=this.source.charAt(v+1),o==="A"?(e[v+1]="￿",i[v+1]="￿",n[v+1]="A",a[v+1]="A"):o==="G"?(e[v+1]="￿",i[v+1]="G",n[v+1]="￿",a[v+1]="G"):(e[v+1]=o,i[v+1]=o,n[v+1]=o,a[v+1]=o),v++);return{A0_G0:e.join(""),A0_G1:i.join(""),A1_G0:n.join(""),A1_G1:a.join("")}}resolveAnchors(e,i){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?i?this._anchorCache.A1_G1:this._anchorCache.A1_G0:i?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Qn=class{constructor(){Se(this,"_items");Se(this,"_hasAnchors");Se(this,"_cached");Se(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(i=>i.source);this._cached=new Ya(t,e,this._items.map(i=>i.ruleId))}return this._cached}compileAG(t,e,i){return this._hasAnchors?e?i?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,i)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,i)),this._anchorCache.A1_G0):i?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,i)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,i)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,i){let n=this._items.map(a=>a.resolveAnchors(e,i));return new Ya(t,n,this._items.map(a=>a.ruleId))}},Ya=class{constructor(t,e,i){Se(this,"scanner");this.regExps=e,this.rules=i,this.scanner=t.createOnigScanner(e)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,i=this.rules.length;e<i;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
193
+ `)}findNextMatchSync(t,e,i){const n=this.scanner.findNextMatchSync(t,e,i);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},_o=class{constructor(t,e){this.languageId=t,this.tokenType=e}},wi,E_=(wi=class{constructor(e,i){Se(this,"_defaultAttributes");Se(this,"_embeddedLanguagesMatcher");Se(this,"_getBasicScopeAttributes",new Nc(e=>{const i=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new _o(i,n)}));this._defaultAttributes=new _o(e,8),this._embeddedLanguagesMatcher=new L_(Object.entries(i||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?wi._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const i=e.match(wi.STANDARD_TOKEN_TYPE_REGEXP);if(!i)return 8;switch(i[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},Se(wi,"_NULL_SCOPE_METADATA",new _o(0,0)),Se(wi,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),wi),L_=class{constructor(t){Se(this,"values");Se(this,"scopesRegExp");if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([i,n])=>Bc(i));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},Za=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function qc(t,e,i,n,a,v,_,s){const o=e.content.length;let h=!1,g=-1;if(_){const b=P_(t,e,i,n,a,v);a=b.stack,n=b.linePos,i=b.isFirstLine,g=b.anchorPosition}const c=Date.now();for(;!h;){if(s!==0&&Date.now()-c>s)return new Za(a,!0);p()}return new Za(a,!1);function p(){const b=R_(t,e,i,n,a,g);if(!b){v.produce(a,o),h=!0;return}const w=b.captureIndices,m=b.matchedRuleId,u=w&&w.length>0?w[0].end>n:!1;if(m===S_){const l=a.getRule(t);v.produce(a,w[0].start),a=a.withContentNameScopesList(a.nameScopesList),Fn(t,e,i,a,v,l.endCaptures,w),v.produce(a,w[0].end);const d=a;if(a=a.parent,g=d.getAnchorPos(),!u&&d.getEnterPos()===n){a=d,v.produce(a,o),h=!0;return}}else{const l=t.getRule(m);v.produce(a,w[0].start);const d=a,f=l.getName(e.content,w),y=a.contentNameScopesList.pushAttributed(f,t);if(a=a.push(m,n,g,w[0].end===o,null,y,y),l instanceof Ho){const E=l;Fn(t,e,i,a,v,E.beginCaptures,w),v.produce(a,w[0].end),g=w[0].end;const S=E.getContentName(e.content,w),L=y.pushAttributed(S,t);if(a=a.withContentNameScopesList(L),E.endHasBackReferences&&(a=a.withEndRule(E.getEndWithResolvedBackReferences(e.content,w))),!u&&d.hasSameRuleAs(a)){a=a.pop(),v.produce(a,o),h=!0;return}}else if(l instanceof Ds){const E=l;Fn(t,e,i,a,v,E.beginCaptures,w),v.produce(a,w[0].end),g=w[0].end;const S=E.getContentName(e.content,w),L=y.pushAttributed(S,t);if(a=a.withContentNameScopesList(L),E.whileHasBackReferences&&(a=a.withEndRule(E.getWhileWithResolvedBackReferences(e.content,w))),!u&&d.hasSameRuleAs(a)){a=a.pop(),v.produce(a,o),h=!0;return}}else if(Fn(t,e,i,a,v,l.captures,w),v.produce(a,w[0].end),a=a.pop(),!u){a=a.safePop(),v.produce(a,o),h=!0;return}}w[0].end>n&&(n=w[0].end,i=!1)}}function P_(t,e,i,n,a,v){let _=a.beginRuleCapturedEOL?0:-1;const s=[];for(let o=a;o;o=o.pop()){const h=o.getRule(t);h instanceof Ds&&s.push({rule:h,stack:o})}for(let o=s.pop();o;o=s.pop()){const{ruleScanner:h,findOptions:g}=D_(o.rule,t,o.stack.endRule,i,n===_),c=h.findNextMatchSync(e,n,g);if(c){if(c.ruleId!==Wc){a=o.stack.pop();break}c.captureIndices&&c.captureIndices.length&&(v.produce(o.stack,c.captureIndices[0].start),Fn(t,e,i,o.stack,v,o.rule.whileCaptures,c.captureIndices),v.produce(o.stack,c.captureIndices[0].end),_=c.captureIndices[0].end,c.captureIndices[0].end>n&&(n=c.captureIndices[0].end,i=!1))}else{a=o.stack.pop();break}}return{stack:a,linePos:n,anchorPosition:_,isFirstLine:i}}function R_(t,e,i,n,a,v){const _=A_(t,e,i,n,a,v),s=t.getInjections();if(s.length===0)return _;const o=T_(s,t,e,i,n,a,v);if(!o)return _;if(!_)return o;const h=_.captureIndices[0].start,g=o.captureIndices[0].start;return g<h||o.priorityMatch&&g===h?o:_}function A_(t,e,i,n,a,v){const _=a.getRule(t),{ruleScanner:s,findOptions:o}=Gc(_,t,a.endRule,i,n===v),h=s.findNextMatchSync(e,n,o);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function T_(t,e,i,n,a,v,_){let s=Number.MAX_VALUE,o=null,h,g=0;const c=v.contentNameScopesList.getScopeNames();for(let p=0,b=t.length;p<b;p++){const w=t[p];if(!w.matcher(c))continue;const m=e.getRule(w.ruleId),{ruleScanner:u,findOptions:l}=Gc(m,e,null,n,a===_),d=u.findNextMatchSync(i,a,l);if(!d)continue;const f=d.captureIndices[0].start;if(!(f>=s)&&(s=f,o=d.captureIndices,h=d.ruleId,g=w.priority,s===a))break}return o?{priorityMatch:g===-1,captureIndices:o,matchedRuleId:h}:null}function Gc(t,e,i,n,a){return{ruleScanner:t.compileAG(e,i,n,a),findOptions:0}}function D_(t,e,i,n,a){return{ruleScanner:t.compileWhileAG(e,i,n,a),findOptions:0}}function Fn(t,e,i,n,a,v,_){if(v.length===0)return;const s=e.content,o=Math.min(v.length,_.length),h=[],g=_[0].end;for(let c=0;c<o;c++){const p=v[c];if(p===null)continue;const b=_[c];if(b.length===0)continue;if(b.start>g)break;for(;h.length>0&&h[h.length-1].endPos<=b.start;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?a.produceFromScopes(h[h.length-1].scopes,b.start):a.produce(n,b.start),p.retokenizeCapturedWithRuleId){const m=p.getName(s,_),u=n.contentNameScopesList.pushAttributed(m,t),l=p.getContentName(s,_),d=u.pushAttributed(l,t),f=n.push(p.retokenizeCapturedWithRuleId,b.start,-1,!1,null,u,d),y=t.createOnigString(s.substring(0,b.end));qc(t,y,i&&b.start===0,b.start,f,a,!1,0),Hc(y);continue}const w=p.getName(s,_);if(w!==null){const u=(h.length>0?h[h.length-1].scopes:n.contentNameScopesList).pushAttributed(w,t);h.push(new I_(u,b.end))}}for(;h.length>0;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var I_=class{constructor(t,e){Se(this,"scopes");Se(this,"endPos");this.scopes=t,this.endPos=e}};function M_(t,e,i,n,a,v,_,s){return new B_(t,e,i,n,a,v,_,s)}function $a(t,e,i,n,a){const v=As(e,Is),_=Uc.getCompiledRuleId(i,n,a.repository);for(const s of v)t.push({debugSelector:e,matcher:s.matcher,ruleId:_,grammar:a,priority:s.priority})}function Is(t,e){if(e.length<t.length)return!1;let i=0;return t.every(n=>{for(let a=i;a<e.length;a++)if(O_(e[a],n))return i=a+1,!0;return!1})}function O_(t,e){if(!t)return!1;if(t===e)return!0;const i=e.length;return t.length>i&&t.substr(0,i)===e&&t[i]==="."}var B_=class{constructor(t,e,i,n,a,v,_,s){Se(this,"_rootId");Se(this,"_lastRuleId");Se(this,"_ruleId2desc");Se(this,"_includedGrammars");Se(this,"_grammarRepository");Se(this,"_grammar");Se(this,"_injections");Se(this,"_basicScopeAttributesProvider");Se(this,"_tokenTypeMatchers");if(this._rootScopeName=t,this.balancedBracketSelectors=v,this._onigLib=s,this._basicScopeAttributesProvider=new E_(i,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=_,this._grammar=el(e,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const o of Object.keys(a)){const h=As(o,Is);for(const g of h)this._tokenTypeMatchers.push({matcher:g.matcher,type:a[o]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},e=[],i=this._rootScopeName,n=t.lookup(i);if(n){const a=n.injections;if(a)for(let _ in a)$a(e,_,a[_],this,n);const v=this._grammarRepository.injections(i);v&&v.forEach(_=>{const s=this.getExternalGrammar(_);if(s){const o=s.injectionSelector;o&&$a(e,o,s,this,s)}})}return e.sort((a,v)=>a.priority-v.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,i=t(e);return this._ruleId2desc[e]=i,i}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const i=this._grammarRepository.lookup(t);if(i)return this._includedGrammars[t]=el(i,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,i=0){const n=this._tokenize(t,e,!1,i);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(t,e,i=0){const n=this._tokenize(t,e,!0,i);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(t,e,i,n){this._rootId===-1&&(this._rootId=Uc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!e||e===Vo.NULL){a=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),g=this.themeProvider.getDefaults(),c=Rn.set(0,h.languageId,h.tokenType,null,g.fontStyle,g.foregroundId,g.backgroundId),p=this.getRule(this._rootId).getName(null,null);let b;p?b=zn.createRootAndLookUpScopeName(p,c,this):b=zn.createRoot("unknown",c),e=new Vo(null,this._rootId,-1,-1,!1,null,b,b)}else a=!1,e.reset();t=t+`
194
+ `;const v=this.createOnigString(t),_=v.content.length,s=new j_(i,t,this._tokenTypeMatchers,this.balancedBracketSelectors),o=qc(this,v,a,0,e,s,!0,n);return Hc(v),{lineLength:_,lineTokens:s,ruleStack:o.stack,stoppedEarly:o.stoppedEarly}}};function el(t,e){return t=t_(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var zn=class di{constructor(e,i,n){this.parent=e,this.scopePath=i,this.tokenAttributes=n}static fromExtension(e,i){let n=e,a=(e==null?void 0:e.scopePath)??null;for(const v of i)a=vo.push(a,v.scopeNames),n=new di(n,a,v.encodedTokenAttributes);return n}static createRoot(e,i){return new di(null,new vo(null,e),i)}static createRootAndLookUpScopeName(e,i,n){const a=n.getMetadataForScope(e),v=new vo(null,e),_=n.themeProvider.themeMatch(v),s=di.mergeAttributes(i,a,_);return new di(null,v,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return di.equals(this,e)}static equals(e,i){do{if(e===i||!e&&!i)return!0;if(!e||!i||e.scopeName!==i.scopeName||e.tokenAttributes!==i.tokenAttributes)return!1;e=e.parent,i=i.parent}while(!0)}static mergeAttributes(e,i,n){let a=-1,v=0,_=0;return n!==null&&(a=n.fontStyle,v=n.foregroundId,_=n.backgroundId),Rn.set(e,i.languageId,i.tokenType,null,a,v,_)}pushAttributed(e,i){if(e===null)return this;if(e.indexOf(" ")===-1)return di._pushAttributed(this,e,i);const n=e.split(/ /g);let a=this;for(const v of n)a=di._pushAttributed(a,v,i);return a}static _pushAttributed(e,i,n){const a=n.getMetadataForScope(i),v=e.scopePath.push(i),_=n.themeProvider.themeMatch(v),s=di.mergeAttributes(e.tokenAttributes,a,_);return new di(e,v,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){var a;const i=[];let n=this;for(;n&&n!==e;)i.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(((a=n.parent)==null?void 0:a.scopePath)??null)}),n=n.parent;return n===e?i.reverse():void 0}},Yr,Vo=(Yr=class{constructor(e,i,n,a,v,_,s,o){Se(this,"_stackElementBrand");Se(this,"_enterPos");Se(this,"_anchorPos");Se(this,"depth");this.parent=e,this.ruleId=i,this.beginRuleCapturedEOL=v,this.endRule=_,this.nameScopesList=s,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=a}equals(e){return e===null?!1:Yr._equals(this,e)}static _equals(e,i){return e===i?!0:this._structuralEquals(e,i)?zn.equals(e.contentNameScopesList,i.contentNameScopesList):!1}static _structuralEquals(e,i){do{if(e===i||!e&&!i)return!0;if(!e||!i||e.depth!==i.depth||e.ruleId!==i.ruleId||e.endRule!==i.endRule)return!1;e=e.parent,i=i.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Yr._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,i,n,a,v,_,s){return new Yr(this,e,i,n,a,v,_,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,i){var n,a;return this.parent&&(i=this.parent._writeString(e,i)),e[i++]=`(${this.ruleId}, ${(n=this.nameScopesList)==null?void 0:n.toString()}, ${(a=this.contentNameScopesList)==null?void 0:a.toString()})`,i}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Yr(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let i=this;for(;i&&i._enterPos===e._enterPos;){if(i.ruleId===e.ruleId)return!0;i=i.parent}return!1}toStateStackFrame(){var e,i,n;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((i=this.nameScopesList)==null?void 0:i.getExtensionIfDefined(((e=this.parent)==null?void 0:e.nameScopesList)??null))??[],contentNameScopesList:((n=this.contentNameScopesList)==null?void 0:n.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(e,i){const n=zn.fromExtension((e==null?void 0:e.nameScopesList)??null,i.nameScopesList);return new Yr(e,i.ruleId,i.enterPos??-1,i.anchorPos??-1,i.beginRuleCapturedEOL,i.endRule,n,zn.fromExtension(n,i.contentNameScopesList))}},Se(Yr,"NULL",new Yr(null,0,0,0,!1,null,null,null)),Yr),N_=class{constructor(t,e){Se(this,"balancedBracketScopes");Se(this,"unbalancedBracketScopes");Se(this,"allowAny",!1);this.balancedBracketScopes=t.flatMap(i=>i==="*"?(this.allowAny=!0,[]):As(i,Is).map(n=>n.matcher)),this.unbalancedBracketScopes=e.flatMap(i=>As(i,Is).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},j_=class{constructor(t,e,i,n){Se(this,"_emitBinaryTokens");Se(this,"_lineText");Se(this,"_tokens");Se(this,"_binaryTokens");Se(this,"_lastTokenEndIndex");Se(this,"_tokenTypeOverrides");this.balancedBracketSelectors=n,this._emitBinaryTokens=t,this._tokenTypeOverrides=i,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){var n;if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let a=(t==null?void 0:t.tokenAttributes)??0,v=!1;if((n=this.balancedBracketSelectors)!=null&&n.matchesAlways&&(v=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const _=(t==null?void 0:t.getScopeNames())??[];for(const s of this._tokenTypeOverrides)s.matcher(_)&&(a=Rn.set(a,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(v=this.balancedBracketSelectors.match(_))}if(v&&(a=Rn.set(a,0,8,v,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(a),this._lastTokenEndIndex=e;return}const i=(t==null?void 0:t.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:i}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const i=new Uint32Array(this._binaryTokens.length);for(let n=0,a=this._binaryTokens.length;n<a;n++)i[n]=this._binaryTokens[n];return i}},F_=class{constructor(t,e){Se(this,"_grammars",new Map);Se(this,"_rawGrammars",new Map);Se(this,"_injectionGrammars",new Map);Se(this,"_theme");this._onigLib=e,this._theme=t}dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,i,n,a){if(!this._grammars.has(t)){let v=this._rawGrammars.get(t);if(!v)return null;this._grammars.set(t,M_(t,v,e,i,n,a,this,this._onigLib))}return this._grammars.get(t)}},H_=class{constructor(e){Se(this,"_options");Se(this,"_syncRegistry");Se(this,"_ensureGrammarCache");this._options=e,this._syncRegistry=new F_(Rs.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,i){this._syncRegistry.setTheme(Rs.createFromRawTheme(e,i))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,i,n){return this.loadGrammarWithConfiguration(e,i,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,i,n){return this._loadGrammar(e,i,n.embeddedLanguages,n.tokenTypes,new N_(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,i,n,a,v){const _=new __(this._syncRegistry,e);for(;_.Q.length>0;)_.Q.map(s=>this._loadSingleGrammar(s.scopeName)),_.processQueue();return this._grammarForScopeName(e,i,n,a,v)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const i=this._options.loadGrammar(e);if(i){const n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(i,n)}}addGrammar(e,i=[],n=0,a=null){return this._syncRegistry.addGrammar(e,i),this._grammarForScopeName(e.scopeName,n,a)}_grammarForScopeName(e,i=0,n=null,a=null,v=null){return this._syncRegistry.grammarForScopeName(e,i,n,a,v)}},Wo=Vo.NULL;const V_=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class os{constructor(e,i,n){this.normal=i,this.property=e,n&&(this.space=n)}}os.prototype.normal={};os.prototype.property={};os.prototype.space=void 0;function Kc(t,e){const i={},n={};for(const a of t)Object.assign(i,a.property),Object.assign(n,a.normal);return new os(i,n,e)}function Uo(t){return t.toLowerCase()}class Or{constructor(e,i){this.attribute=i,this.property=e}}Or.prototype.attribute="";Or.prototype.booleanish=!1;Or.prototype.boolean=!1;Or.prototype.commaOrSpaceSeparated=!1;Or.prototype.commaSeparated=!1;Or.prototype.defined=!1;Or.prototype.mustUseProperty=!1;Or.prototype.number=!1;Or.prototype.overloadedBoolean=!1;Or.prototype.property="";Or.prototype.spaceSeparated=!1;Or.prototype.space=void 0;let W_=0;const Mt=cn(),sr=cn(),zo=cn(),Ge=cn(),$t=cn(),_n=cn(),jr=cn();function cn(){return 2**++W_}const qo=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:sr,commaOrSpaceSeparated:jr,commaSeparated:_n,number:Ge,overloadedBoolean:zo,spaceSeparated:$t},Symbol.toStringTag,{value:"Module"})),po=Object.keys(qo);class va extends Or{constructor(e,i,n,a){let v=-1;if(super(e,i),tl(this,"space",a),typeof n=="number")for(;++v<po.length;){const _=po[v];tl(this,po[v],(n&qo[_])===qo[_])}}}va.prototype.defined=!0;function tl(t,e,i){i&&(t[e]=i)}function Tn(t){const e={},i={};for(const[n,a]of Object.entries(t.properties)){const v=new va(n,t.transform(t.attributes||{},n),a,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(v.mustUseProperty=!0),e[n]=v,i[Uo(n)]=n,i[Uo(v.attribute)]=n}return new os(e,i,t.space)}const Jc=Tn({properties:{ariaActiveDescendant:null,ariaAtomic:sr,ariaAutoComplete:null,ariaBusy:sr,ariaChecked:sr,ariaColCount:Ge,ariaColIndex:Ge,ariaColSpan:Ge,ariaControls:$t,ariaCurrent:null,ariaDescribedBy:$t,ariaDetails:null,ariaDisabled:sr,ariaDropEffect:$t,ariaErrorMessage:null,ariaExpanded:sr,ariaFlowTo:$t,ariaGrabbed:sr,ariaHasPopup:null,ariaHidden:sr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$t,ariaLevel:Ge,ariaLive:null,ariaModal:sr,ariaMultiLine:sr,ariaMultiSelectable:sr,ariaOrientation:null,ariaOwns:$t,ariaPlaceholder:null,ariaPosInSet:Ge,ariaPressed:sr,ariaReadOnly:sr,ariaRelevant:null,ariaRequired:sr,ariaRoleDescription:$t,ariaRowCount:Ge,ariaRowIndex:Ge,ariaRowSpan:Ge,ariaSelected:sr,ariaSetSize:Ge,ariaSort:null,ariaValueMax:Ge,ariaValueMin:Ge,ariaValueNow:Ge,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Qc(t,e){return e in t?t[e]:e}function Xc(t,e){return Qc(t,e.toLowerCase())}const U_=Tn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_n,acceptCharset:$t,accessKey:$t,action:null,allow:null,allowFullScreen:Mt,allowPaymentRequest:Mt,allowUserMedia:Mt,alt:null,as:null,async:Mt,autoCapitalize:null,autoComplete:$t,autoFocus:Mt,autoPlay:Mt,blocking:$t,capture:null,charSet:null,checked:Mt,cite:null,className:$t,cols:Ge,colSpan:null,content:null,contentEditable:sr,controls:Mt,controlsList:$t,coords:Ge|_n,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mt,defer:Mt,dir:null,dirName:null,disabled:Mt,download:zo,draggable:sr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mt,formTarget:null,headers:$t,height:Ge,hidden:zo,high:Ge,href:null,hrefLang:null,htmlFor:$t,httpEquiv:$t,id:null,imageSizes:null,imageSrcSet:null,inert:Mt,inputMode:null,integrity:null,is:null,isMap:Mt,itemId:null,itemProp:$t,itemRef:$t,itemScope:Mt,itemType:$t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mt,low:Ge,manifest:null,max:null,maxLength:Ge,media:null,method:null,min:null,minLength:Ge,multiple:Mt,muted:Mt,name:null,nonce:null,noModule:Mt,noValidate:Mt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Mt,optimum:Ge,pattern:null,ping:$t,placeholder:null,playsInline:Mt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mt,referrerPolicy:null,rel:$t,required:Mt,reversed:Mt,rows:Ge,rowSpan:Ge,sandbox:$t,scope:null,scoped:Mt,seamless:Mt,selected:Mt,shadowRootClonable:Mt,shadowRootDelegatesFocus:Mt,shadowRootMode:null,shape:null,size:Ge,sizes:null,slot:null,span:Ge,spellCheck:sr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ge,step:null,style:null,tabIndex:Ge,target:null,title:null,translate:null,type:null,typeMustMatch:Mt,useMap:null,value:sr,width:Ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$t,axis:null,background:null,bgColor:null,border:Ge,borderColor:null,bottomMargin:Ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mt,declare:Mt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ge,leftMargin:Ge,link:null,longDesc:null,lowSrc:null,marginHeight:Ge,marginWidth:Ge,noResize:Mt,noHref:Mt,noShade:Mt,noWrap:Mt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ge,rules:null,scheme:null,scrolling:sr,standby:null,summary:null,text:null,topMargin:Ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mt,disableRemotePlayback:Mt,prefix:null,property:null,results:Ge,security:null,unselectable:null},space:"html",transform:Xc}),z_=Tn({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:jr,accentHeight:Ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ge,amplitude:Ge,arabicForm:null,ascent:Ge,attributeName:null,attributeType:null,azimuth:Ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ge,by:null,calcMode:null,capHeight:Ge,className:$t,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ge,diffuseConstant:Ge,direction:null,display:null,dur:null,divisor:Ge,dominantBaseline:null,download:Mt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ge,enableBackground:null,end:null,event:null,exponent:Ge,externalResourcesRequired:null,fill:null,fillOpacity:Ge,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_n,g2:_n,glyphName:_n,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ge,horizOriginX:Ge,horizOriginY:Ge,id:null,ideographic:Ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ge,k:Ge,k1:Ge,k2:Ge,k3:Ge,k4:Ge,kernelMatrix:jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ge,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ge,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ge,overlineThickness:Ge,paintOrder:null,panose1:null,path:null,pathLength:Ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ge,pointsAtY:Ge,pointsAtZ:Ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jr,rev:jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jr,requiredFeatures:jr,requiredFonts:jr,requiredFormats:jr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ge,specularExponent:Ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ge,strikethroughThickness:Ge,string:null,stroke:null,strokeDashArray:jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ge,strokeOpacity:Ge,strokeWidth:null,style:null,surfaceScale:Ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jr,tabIndex:Ge,tableValues:null,target:null,targetX:Ge,targetY:Ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ge,underlineThickness:Ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ge,values:null,vAlphabetic:Ge,vMathematical:Ge,vectorEffect:null,vHanging:Ge,vIdeographic:Ge,version:null,vertAdvY:Ge,vertOriginX:Ge,vertOriginY:Ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Qc}),Yc=Tn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Zc=Tn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Xc}),$c=Tn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),q_=/[A-Z]/g,rl=/-[a-z]/g,G_=/^data[-\w.:]+$/i;function K_(t,e){const i=Uo(e);let n=e,a=Or;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&G_.test(e)){if(e.charAt(4)==="-"){const v=e.slice(5).replace(rl,Q_);n="data"+v.charAt(0).toUpperCase()+v.slice(1)}else{const v=e.slice(4);if(!rl.test(v)){let _=v.replace(q_,J_);_.charAt(0)!=="-"&&(_="-"+_),e="data"+_}}a=va}return new a(n,e)}function J_(t){return"-"+t.toLowerCase()}function Q_(t){return t.charAt(1).toUpperCase()}const X_=Kc([Jc,U_,Yc,Zc,$c],"html"),ed=Kc([Jc,z_,Yc,Zc,$c],"svg"),il={}.hasOwnProperty;function Y_(t,e){const i=e||{};function n(a,...v){let _=n.invalid;const s=n.handlers;if(a&&il.call(a,t)){const o=String(a[t]);_=il.call(s,o)?s[o]:n.unknown}if(_)return _.call(this,a,...v)}return n.handlers=i.handlers||{},n.invalid=i.invalid,n.unknown=i.unknown,n}const Z_=/["&'<>`]/g,$_=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ep=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,tp=/[|\\{}()[\]^$+*?.]/g,nl=new WeakMap;function rp(t,e){if(t=t.replace(e.subset?ip(e.subset):Z_,n),e.subset||e.escapeOnly)return t;return t.replace($_,i).replace(ep,n);function i(a,v,_){return e.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,_.charCodeAt(v+2),e)}function n(a,v,_){return e.format(a.charCodeAt(0),_.charCodeAt(v+1),e)}}function ip(t){let e=nl.get(t);return e||(e=np(t),nl.set(t,e)),e}function np(t){const e=[];let i=-1;for(;++i<t.length;)e.push(t[i].replace(tp,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const sp=/[\dA-Fa-f]/;function op(t,e,i){const n="&#x"+t.toString(16).toUpperCase();return i&&e&&!sp.test(String.fromCharCode(e))?n:n+";"}const ap=/\d/;function lp(t,e,i){const n="&#"+String(t);return i&&e&&!ap.test(String.fromCharCode(e))?n:n+";"}const cp=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],go={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},dp=["cent","copy","divide","gt","lt","not","para","times"],td={}.hasOwnProperty,Go={};let us;for(us in go)td.call(go,us)&&(Go[go[us]]=us);const up=/[^\dA-Za-z]/;function hp(t,e,i,n){const a=String.fromCharCode(t);if(td.call(Go,a)){const v=Go[a],_="&"+v;return i&&cp.includes(v)&&!dp.includes(v)&&(!n||e&&e!==61&&up.test(String.fromCharCode(e)))?_:_+";"}return""}function fp(t,e,i){let n=op(t,e,i.omitOptionalSemicolons),a;if((i.useNamedReferences||i.useShortestReferences)&&(a=hp(t,e,i.omitOptionalSemicolons,i.attribute)),(i.useShortestReferences||!a)&&i.useShortestReferences){const v=lp(t,e,i.omitOptionalSemicolons);v.length<n.length&&(n=v)}return a&&(!i.useShortestReferences||a.length<n.length)?a:n}function pn(t,e){return rp(t,Object.assign({format:fp},e))}const vp=/^>|^->|<!--|-->|--!>|<!-$/g,_p=[">"],pp=["<",">"];function gp(t,e,i,n){return n.settings.bogusComments?"<?"+pn(t.value,Object.assign({},n.settings.characterReferences,{subset:_p}))+">":"<!--"+t.value.replace(vp,a)+"-->";function a(v){return pn(v,Object.assign({},n.settings.characterReferences,{subset:pp}))}}function mp(t,e,i,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function sl(t,e){const i=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,a=i.indexOf(e);for(;a!==-1;)n++,a=i.indexOf(e,a+e.length);return n}function bp(t,e){const i=e||{};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}function yp(t){return t.join(" ").trim()}const xp=/[ \t\n\f\r]/g;function _a(t){return typeof t=="object"?t.type==="text"?ol(t.value):!1:ol(t)}function ol(t){return t.replace(xp,"")===""}const cr=id(1),rd=id(-1),wp=[];function id(t){return e;function e(i,n,a){const v=i?i.children:wp;let _=(n||0)+t,s=v[_];if(!a)for(;s&&_a(s);)_+=t,s=v[_];return s}}const Sp={}.hasOwnProperty;function nd(t){return e;function e(i,n,a){return Sp.call(t,i.tagName)&&t[i.tagName](i,n,a)}}const pa=nd({body:kp,caption:mo,colgroup:mo,dd:Rp,dt:Pp,head:mo,html:Cp,li:Lp,optgroup:Ap,option:Tp,p:Ep,rp:al,rt:al,tbody:Ip,td:ll,tfoot:Mp,th:ll,thead:Dp,tr:Op});function mo(t,e,i){const n=cr(i,e,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&_a(n.value.charAt(0)))}function Cp(t,e,i){const n=cr(i,e);return!n||n.type!=="comment"}function kp(t,e,i){const n=cr(i,e);return!n||n.type!=="comment"}function Ep(t,e,i){const n=cr(i,e);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!i||!(i.type==="element"&&(i.tagName==="a"||i.tagName==="audio"||i.tagName==="del"||i.tagName==="ins"||i.tagName==="map"||i.tagName==="noscript"||i.tagName==="video"))}function Lp(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&n.tagName==="li"}function Pp(t,e,i){const n=cr(i,e);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function Rp(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function al(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function Ap(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&n.tagName==="optgroup"}function Tp(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function Dp(t,e,i){const n=cr(i,e);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function Ip(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function Mp(t,e,i){return!cr(i,e)}function Op(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&n.tagName==="tr"}function ll(t,e,i){const n=cr(i,e);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const Bp=nd({body:Fp,colgroup:Hp,head:jp,html:Np,tbody:Vp});function Np(t){const e=cr(t,-1);return!e||e.type!=="comment"}function jp(t){const e=new Set;for(const n of t.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(e.has(n.tagName))return!1;e.add(n.tagName)}const i=t.children[0];return!i||i.type==="element"}function Fp(t){const e=cr(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&_a(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Hp(t,e,i){const n=rd(i,e),a=cr(t,-1,!0);return i&&n&&n.type==="element"&&n.tagName==="colgroup"&&pa(n,i.children.indexOf(n),i)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function Vp(t,e,i){const n=rd(i,e),a=cr(t,-1);return i&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&pa(n,i.children.indexOf(n),i)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const hs={name:[[`
195
+ \f\r &/=>`.split(""),`
196
+ \f\r "&'/=>\``.split("")],[`\0
197
+ \f\r "&'/<=>`.split(""),`\0
198
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
199
+ \f\r &>`.split(""),`\0
200
+ \f\r "&'<=>\``.split("")],[`\0
201
+ \f\r "&'<=>\``.split(""),`\0
202
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Wp(t,e,i,n){const a=n.schema,v=a.space==="svg"?!1:n.settings.omitOptionalTags;let _=a.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(t.tagName.toLowerCase());const s=[];let o;a.space==="html"&&t.tagName==="svg"&&(n.schema=ed);const h=Up(n,t.properties),g=n.all(a.space==="html"&&t.tagName==="template"?t.content:t);return n.schema=a,g&&(_=!1),(h||!v||!Bp(t,e,i))&&(s.push("<",t.tagName,h?" "+h:""),_&&(a.space==="svg"||n.settings.closeSelfClosing)&&(o=h.charAt(h.length-1),(!n.settings.tightSelfClosing||o==="/"||o&&o!=='"'&&o!=="'")&&s.push(" "),s.push("/")),s.push(">")),s.push(g),!_&&(!v||!pa(t,e,i))&&s.push("</"+t.tagName+">"),s.join("")}function Up(t,e){const i=[];let n=-1,a;if(e){for(a in e)if(e[a]!==null&&e[a]!==void 0){const v=zp(t,a,e[a]);v&&i.push(v)}}for(;++n<i.length;){const v=t.settings.tightAttributes?i[n].charAt(i[n].length-1):void 0;n!==i.length-1&&v!=='"'&&v!=="'"&&(i[n]+=" ")}return i.join("")}function zp(t,e,i){const n=K_(t.schema,e),a=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,v=t.settings.allowDangerousCharacters?0:1;let _=t.quote,s;if(n.overloadedBoolean&&(i===n.attribute||i==="")?i=!0:(n.boolean||n.overloadedBoolean)&&(typeof i!="string"||i===n.attribute||i==="")&&(i=!!i),i==null||i===!1||typeof i=="number"&&Number.isNaN(i))return"";const o=pn(n.attribute,Object.assign({},t.settings.characterReferences,{subset:hs.name[a][v]}));return i===!0||(i=Array.isArray(i)?(n.commaSeparated?bp:yp)(i,{padLeft:!t.settings.tightCommaSeparatedLists}):String(i),t.settings.collapseEmptyAttributes&&!i)?o:(t.settings.preferUnquoted&&(s=pn(i,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:hs.unquoted[a][v]}))),s!==i&&(t.settings.quoteSmart&&sl(i,_)>sl(i,t.alternative)&&(_=t.alternative),s=_+pn(i,Object.assign({},t.settings.characterReferences,{subset:(_==="'"?hs.single:hs.double)[a][v],attribute:!0}))+_),o+(s&&"="+s))}const qp=["<","&"];function sd(t,e,i,n){return i&&i.type==="element"&&(i.tagName==="script"||i.tagName==="style")?t.value:pn(t.value,Object.assign({},n.settings.characterReferences,{subset:qp}))}function Gp(t,e,i,n){return n.settings.allowDangerousHtml?t.value:sd(t,e,i,n)}function Kp(t,e,i,n){return n.all(t)}const Jp=Y_("type",{invalid:Qp,unknown:Xp,handlers:{comment:gp,doctype:mp,element:Wp,raw:Gp,root:Kp,text:sd}});function Qp(t){throw new Error("Expected node, not `"+t+"`")}function Xp(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Yp={},Zp={},$p=[];function eg(t,e){const i=e||Yp,n=i.quote||'"',a=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:tg,all:rg,settings:{omitOptionalTags:i.omitOptionalTags||!1,allowParseErrors:i.allowParseErrors||!1,allowDangerousCharacters:i.allowDangerousCharacters||!1,quoteSmart:i.quoteSmart||!1,preferUnquoted:i.preferUnquoted||!1,tightAttributes:i.tightAttributes||!1,upperDoctype:i.upperDoctype||!1,tightDoctype:i.tightDoctype||!1,bogusComments:i.bogusComments||!1,tightCommaSeparatedLists:i.tightCommaSeparatedLists||!1,tightSelfClosing:i.tightSelfClosing||!1,collapseEmptyAttributes:i.collapseEmptyAttributes||!1,allowDangerousHtml:i.allowDangerousHtml||!1,voids:i.voids||V_,characterReferences:i.characterReferences||Zp,closeSelfClosing:i.closeSelfClosing||!1,closeEmptyElements:i.closeEmptyElements||!1},schema:i.space==="svg"?ed:X_,quote:n,alternative:a}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function tg(t,e,i){return Jp(t,e,i,this)}function rg(t){const e=[],i=t&&t.children||$p;let n=-1;for(;++n<i.length;)e[n]=this.one(i[n],n,t);return e.join("")}function Ms(t,e){const i=typeof t=="string"?{}:{...t.colorReplacements},n=typeof t=="string"?t:t.name;for(const[a,v]of Object.entries((e==null?void 0:e.colorReplacements)||{}))typeof v=="string"?i[a]=v:a===n&&Object.assign(i,v);return i}function Fi(t,e){return t&&((e==null?void 0:e[t==null?void 0:t.toLowerCase()])||t)}function ig(t){return Array.isArray(t)?t:[t]}async function od(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function ga(t){return!t||["plaintext","txt","text","plain"].includes(t)}function ad(t){return t==="ansi"||ga(t)}function ma(t){return t==="none"}function ld(t){return ma(t)}function cd(t,e){var n;if(!e)return t;t.properties||(t.properties={}),(n=t.properties).class||(n.class=[]),typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const i=Array.isArray(e)?e:e.split(/\s+/g);for(const a of i)a&&!t.properties.class.includes(a)&&t.properties.class.push(a);return t}function Ys(t,e=!1){var v;if(t.length===0)return[["",0]];const i=t.split(/(\r?\n)/g);let n=0;const a=[];for(let _=0;_<i.length;_+=2){const s=e?i[_]+(i[_+1]||""):i[_];a.push([s,n]),n+=i[_].length,n+=((v=i[_+1])==null?void 0:v.length)||0}return a}function ng(t){const e=Ys(t,!0).map(([a])=>a);function i(a){if(a===t.length)return{line:e.length-1,character:e[e.length-1].length};let v=a,_=0;for(const s of e){if(v<s.length)break;v-=s.length,_++}return{line:_,character:v}}function n(a,v){let _=0;for(let s=0;s<a;s++)_+=e[s].length;return _+=v,_}return{lines:e,indexToPos:i,posToIndex:n}}const ba="light-dark()",sg=["color","background-color"];function og(t,e){let i=0;const n=[];for(const a of e)a>i&&n.push({...t,content:t.content.slice(i,a),offset:t.offset+i}),i=a;return i<t.content.length&&n.push({...t,content:t.content.slice(i),offset:t.offset+i}),n}function ag(t,e){const i=Array.from(e instanceof Set?e:new Set(e)).sort((n,a)=>n-a);return i.length?t.map(n=>n.flatMap(a=>{const v=i.filter(_=>a.offset<_&&_<a.offset+a.content.length).map(_=>_-a.offset).sort((_,s)=>_-s);return v.length?og(a,v):a})):t}function lg(t,e,i,n,a="css-vars"){const v={content:t.content,explanation:t.explanation,offset:t.offset},_=e.map(g=>Os(t.variants[g])),s=new Set(_.flatMap(g=>Object.keys(g))),o={},h=(g,c)=>{const p=c==="color"?"":c==="background-color"?"-bg":`-${c}`;return i+e[g]+(c==="color"?"":p)};return _.forEach((g,c)=>{for(const p of s){const b=g[p]||"inherit";if(c===0&&n&&sg.includes(p))if(n===ba&&_.length>1){const w=e.findIndex(d=>d==="light"),m=e.findIndex(d=>d==="dark");if(w===-1||m===-1)throw new or('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const u=_[w][p]||"inherit",l=_[m][p]||"inherit";o[p]=`light-dark(${u}, ${l})`,a==="css-vars"&&(o[h(c,p)]=b)}else o[p]=b;else a==="css-vars"&&(o[h(c,p)]=b)}}),v.htmlStyle=o,v}function Os(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&Lr.Italic&&(e["font-style"]="italic"),t.fontStyle&Lr.Bold&&(e["font-weight"]="bold");const i=[];t.fontStyle&Lr.Underline&&i.push("underline"),t.fontStyle&Lr.Strikethrough&&i.push("line-through"),i.length&&(e["text-decoration"]=i.join(" "))}return e}function Ko(t){return typeof t=="string"?t:Object.entries(t).map(([e,i])=>`${e}:${i}`).join(";")}const dd=new WeakMap;function Zs(t,e){dd.set(t,e)}function Xn(t){return dd.get(t)}class Dn{constructor(...e){Se(this,"_stacks",{});Se(this,"lang");if(e.length===2){const[i,n]=e;this.lang=n,this._stacks=i}else{const[i,n,a]=e;this.lang=n,this._stacks={[a]:i}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,i){return new Dn(Object.fromEntries(ig(i).map(n=>[n,Wo])),e)}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return cg(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function cg(t){const e=[],i=new Set;function n(a){var _;if(i.has(a))return;i.add(a);const v=(_=a==null?void 0:a.nameScopesList)==null?void 0:_.scopeName;v&&e.push(v),a.parent&&n(a.parent)}return n(t),e}function dg(t,e){if(!(t instanceof Dn))throw new or("Invalid grammar state");return t.getInternalStack(e)}function ug(){const t=new WeakMap;function e(i){if(!t.has(i.meta)){let n=function(_){if(typeof _=="number"){if(_<0||_>i.source.length)throw new or(`Invalid decoration offset: ${_}. Code length: ${i.source.length}`);return{...a.indexToPos(_),offset:_}}else{const s=a.lines[_.line];if(s===void 0)throw new or(`Invalid decoration position ${JSON.stringify(_)}. Lines length: ${a.lines.length}`);let o=_.character;if(o<0&&(o=s.length+o),o<0||o>s.length)throw new or(`Invalid decoration position ${JSON.stringify(_)}. Line ${_.line} length: ${s.length}`);return{..._,character:o,offset:a.posToIndex(_.line,o)}}};const a=ng(i.source),v=(i.options.decorations||[]).map(_=>({..._,start:n(_.start),end:n(_.end)}));hg(v),t.set(i.meta,{decorations:v,converter:a,source:i.source})}return t.get(i.meta)}return{name:"shiki:decorations",tokens(i){var _;if(!((_=this.options.decorations)!=null&&_.length))return;const a=e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return ag(i,a)},code(i){var g;if(!((g=this.options.decorations)!=null&&g.length))return;const n=e(this),a=Array.from(i.children).filter(c=>c.type==="element"&&c.tagName==="span");if(a.length!==n.converter.lines.length)throw new or(`Number of lines in code element (${a.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function v(c,p,b,w){const m=a[c];let u="",l=-1,d=-1;if(p===0&&(l=0),b===0&&(d=0),b===Number.POSITIVE_INFINITY&&(d=m.children.length),l===-1||d===-1)for(let y=0;y<m.children.length;y++)u+=ud(m.children[y]),l===-1&&u.length===p&&(l=y+1),d===-1&&u.length===b&&(d=y+1);if(l===-1)throw new or(`Failed to find start index for decoration ${JSON.stringify(w.start)}`);if(d===-1)throw new or(`Failed to find end index for decoration ${JSON.stringify(w.end)}`);const f=m.children.slice(l,d);if(!w.alwaysWrap&&f.length===m.children.length)s(m,w,"line");else if(!w.alwaysWrap&&f.length===1&&f[0].type==="element")s(f[0],w,"token");else{const y={type:"element",tagName:"span",properties:{},children:f};s(y,w,"wrapper"),m.children.splice(l,f.length,y)}}function _(c,p){a[c]=s(a[c],p,"line")}function s(c,p,b){var u;const w=p.properties||{},m=p.transform||(l=>l);return c.tagName=p.tagName||"span",c.properties={...c.properties,...w,class:c.properties.class},(u=p.properties)!=null&&u.class&&cd(c,p.properties.class),c=m(c,b)||c,c}const o=[],h=n.decorations.sort((c,p)=>p.start.offset-c.start.offset||c.end.offset-p.end.offset);for(const c of h){const{start:p,end:b}=c;if(p.line===b.line)v(p.line,p.character,b.character,c);else if(p.line<b.line){v(p.line,p.character,Number.POSITIVE_INFINITY,c);for(let w=p.line+1;w<b.line;w++)o.unshift(()=>_(w,c));v(b.line,0,b.character,c)}}o.forEach(c=>c())}}}function hg(t){for(let e=0;e<t.length;e++){const i=t[e];if(i.start.offset>i.end.offset)throw new or(`Invalid decoration range: ${JSON.stringify(i.start)} - ${JSON.stringify(i.end)}`);for(let n=e+1;n<t.length;n++){const a=t[n],v=i.start.offset<=a.start.offset&&a.start.offset<i.end.offset,_=i.start.offset<a.end.offset&&a.end.offset<=i.end.offset,s=a.start.offset<=i.start.offset&&i.start.offset<a.end.offset,o=a.start.offset<i.end.offset&&i.end.offset<=a.end.offset;if(v||_||s||o){if(v&&_||s&&o||s&&i.start.offset===i.end.offset||_&&a.start.offset===a.end.offset)continue;throw new or(`Decorations ${JSON.stringify(i.start)} and ${JSON.stringify(a.start)} intersect.`)}}}}function ud(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(ud).join(""):""}const fg=[ug()];function Bs(t){const e=vg(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...fg]}function vg(t){const e=[],i=[],n=[];for(const a of t)switch(a.enforce){case"pre":e.push(a);break;case"post":i.push(a);break;default:n.push(a)}return{pre:e,post:i,normal:n}}var Gi=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],bo={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function _g(t,e){const i=t.indexOf("\x1B",e);if(i!==-1&&t[i+1]==="["){const n=t.indexOf("m",i);if(n!==-1)return{sequence:t.substring(i+2,n).split(";"),startPosition:i,position:n+1}}return{position:t.length}}function cl(t){const e=t.shift();if(e==="2"){const i=t.splice(0,3).map(n=>Number.parseInt(n));return i.length!==3||i.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:i}}else if(e==="5"){const i=t.shift();if(i)return{type:"table",index:Number(i)}}}function pg(t){const e=[];for(;t.length>0;){const i=t.shift();if(!i)continue;const n=Number.parseInt(i);if(!Number.isNaN(n))if(n===0)e.push({type:"resetAll"});else if(n<=9)bo[n]&&e.push({type:"setDecoration",value:bo[n]});else if(n<=29){const a=bo[n-20];a&&(e.push({type:"resetDecoration",value:a}),a==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)e.push({type:"setForegroundColor",value:{type:"named",name:Gi[n-30]}});else if(n===38){const a=cl(t);a&&e.push({type:"setForegroundColor",value:a})}else if(n===39)e.push({type:"resetForegroundColor"});else if(n<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:Gi[n-40]}});else if(n===48){const a=cl(t);a&&e.push({type:"setBackgroundColor",value:a})}else n===49?e.push({type:"resetBackgroundColor"}):n===53?e.push({type:"setDecoration",value:"overline"}):n===55?e.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?e.push({type:"setForegroundColor",value:{type:"named",name:Gi[n-90+8]}}):n>=100&&n<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:Gi[n-100+8]}})}return e}function gg(){let t=null,e=null,i=new Set;return{parse(n){const a=[];let v=0;do{const _=_g(n,v),s=_.sequence?n.substring(v,_.startPosition):n.substring(v);if(s.length>0&&a.push({value:s,foreground:t,background:e,decorations:new Set(i)}),_.sequence){const o=pg(_.sequence);for(const h of o)h.type==="resetAll"?(t=null,e=null,i.clear()):h.type==="resetForegroundColor"?t=null:h.type==="resetBackgroundColor"?e=null:h.type==="resetDecoration"&&i.delete(h.value);for(const h of o)h.type==="setForegroundColor"?t=h.value:h.type==="setBackgroundColor"?e=h.value:h.type==="setDecoration"&&i.add(h.value)}v=_.position}while(v<n.length);return a}}}var mg={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function bg(t=mg){function e(s){return t[s]}function i(s){return`#${s.map(o=>Math.max(0,Math.min(o,255)).toString(16).padStart(2,"0")).join("")}`}let n;function a(){if(n)return n;n=[];for(let h=0;h<Gi.length;h++)n.push(e(Gi[h]));let s=[0,95,135,175,215,255];for(let h=0;h<6;h++)for(let g=0;g<6;g++)for(let c=0;c<6;c++)n.push(i([s[h],s[g],s[c]]));let o=8;for(let h=0;h<24;h++,o+=10)n.push(i([o,o,o]));return n}function v(s){return a()[s]}function _(s){switch(s.type){case"named":return e(s.name);case"rgb":return i(s.rgb);case"table":return v(s.index)}}return{value:_}}const yg={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function xg(t,e,i){const n=Ms(t,i),a=Ys(e),v=Object.fromEntries(Gi.map(o=>{var c;const h=`terminal.ansi${o[0].toUpperCase()}${o.substring(1)}`,g=(c=t.colors)==null?void 0:c[h];return[o,g||yg[o]]})),_=bg(v),s=gg();return a.map(o=>s.parse(o[0]).map(h=>{let g,c;h.decorations.has("reverse")?(g=h.background?_.value(h.background):t.bg,c=h.foreground?_.value(h.foreground):t.fg):(g=h.foreground?_.value(h.foreground):t.fg,c=h.background?_.value(h.background):void 0),g=Fi(g,n),c=Fi(c,n),h.decorations.has("dim")&&(g=wg(g));let p=Lr.None;return h.decorations.has("bold")&&(p|=Lr.Bold),h.decorations.has("italic")&&(p|=Lr.Italic),h.decorations.has("underline")&&(p|=Lr.Underline),h.decorations.has("strikethrough")&&(p|=Lr.Strikethrough),{content:h.value,offset:o[1],color:g,bgColor:c,fontStyle:p}}))}function wg(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const n=e[1];if(n.length===8){const a=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${a}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const a=n[0],v=n[1],_=n[2],s=n[3],o=Math.round(Number.parseInt(`${s}${s}`,16)/2).toString(16).padStart(2,"0");return`#${a}${a}${v}${v}${_}${_}${o}`}else if(n.length===3){const a=n[0],v=n[1],_=n[2];return`#${a}${a}${v}${v}${_}${_}80`}}}const i=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return i?`var(${i[1]}-dim)`:t}function ya(t,e,i={}){const{theme:n=t.getLoadedThemes()[0]}=i,a=t.resolveLangAlias(i.lang||"text");if(ga(a)||ma(n))return Ys(e).map(o=>[{content:o[0],offset:o[1]}]);const{theme:v,colorMap:_}=t.setTheme(n);if(a==="ansi")return xg(v,e,i);const s=t.getLanguage(i.lang||"text");if(i.grammarState){if(i.grammarState.lang!==s.name)throw new or(`Grammar state language "${i.grammarState.lang}" does not match highlight language "${s.name}"`);if(!i.grammarState.themes.includes(v.name))throw new or(`Grammar state themes "${i.grammarState.themes}" do not contain highlight theme "${v.name}"`)}return Cg(e,s,v,_,i)}function Sg(...t){if(t.length===2)return Xn(t[1]);const[e,i,n={}]=t,{lang:a="text",theme:v=e.getLoadedThemes()[0]}=n;if(ga(a)||ma(v))throw new or("Plain language does not have grammar state");if(a==="ansi")throw new or("ANSI language does not have grammar state");const{theme:_,colorMap:s}=e.setTheme(v),o=e.getLanguage(a);return new Dn(xa(i,o,_,s,n).stateStack,o.name,_.name)}function Cg(t,e,i,n,a){const v=xa(t,e,i,n,a),_=new Dn(v.stateStack,e.name,i.name);return Zs(v.tokens,_),v.tokens}function xa(t,e,i,n,a){const v=Ms(i,a),{tokenizeMaxLineLength:_=0,tokenizeTimeLimit:s=500}=a,o=Ys(t);let h=a.grammarState?dg(a.grammarState,i.name)??Wo:a.grammarContextCode!=null?xa(a.grammarContextCode,e,i,n,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:Wo,g=[];const c=[];for(let p=0,b=o.length;p<b;p++){const[w,m]=o[p];if(w===""){g=[],c.push([]);continue}if(_>0&&w.length>=_){g=[],c.push([{content:w,offset:m,color:"",fontStyle:0}]);continue}let u,l,d;a.includeExplanation&&(u=e.tokenizeLine(w,h,s),l=u.tokens,d=0);const f=e.tokenizeLine2(w,h,s),y=f.tokens.length/2;for(let E=0;E<y;E++){const S=f.tokens[2*E],L=E+1<y?f.tokens[2*E+2]:w.length;if(S===L)continue;const x=f.tokens[2*E+1],P=Fi(n[Rn.getForeground(x)],v),B=Rn.getFontStyle(x),j={content:w.substring(S,L),offset:m+S,color:P,fontStyle:B};if(a.includeExplanation){const V=[];if(a.includeExplanation!=="scopeName")for(const X of i.settings){let W;switch(typeof X.scope){case"string":W=X.scope.split(/,/).map(Q=>Q.trim());break;case"object":W=X.scope;break;default:continue}V.push({settings:X,selectors:W.map(Q=>Q.split(/ /))})}j.explanation=[];let N=0;for(;S+N<L;){const X=l[d],W=w.substring(X.startIndex,X.endIndex);N+=W.length,j.explanation.push({content:W,scopes:a.includeExplanation==="scopeName"?kg(X.scopes):Eg(V,X.scopes)}),d+=1}}g.push(j)}c.push(g),g=[],h=f.ruleStack}return{tokens:c,stateStack:h}}function kg(t){return t.map(e=>({scopeName:e}))}function Eg(t,e){const i=[];for(let n=0,a=e.length;n<a;n++){const v=e[n];i[n]={scopeName:v,themeMatches:Pg(t,v,e.slice(0,n))}}return i}function dl(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Lg(t,e,i){if(!dl(t[t.length-1],e))return!1;let n=t.length-2,a=i.length-1;for(;n>=0&&a>=0;)dl(t[n],i[a])&&(n-=1),a-=1;return n===-1}function Pg(t,e,i){const n=[];for(const{selectors:a,settings:v}of t)for(const _ of a)if(Lg(_,e,i)){n.push(v);break}return n}function hd(t,e,i){const n=Object.entries(i.themes).filter(o=>o[1]).map(o=>({color:o[0],theme:o[1]})),a=n.map(o=>{const h=ya(t,e,{...i,theme:o.theme}),g=Xn(h),c=typeof o.theme=="string"?o.theme:o.theme.name;return{tokens:h,state:g,theme:c}}),v=Rg(...a.map(o=>o.tokens)),_=v[0].map((o,h)=>o.map((g,c)=>{const p={content:g.content,variants:{},offset:g.offset};return"includeExplanation"in i&&i.includeExplanation&&(p.explanation=g.explanation),v.forEach((b,w)=>{const{content:m,explanation:u,offset:l,...d}=b[h][c];p.variants[n[w].color]=d}),p})),s=a[0].state?new Dn(Object.fromEntries(a.map(o=>{var h;return[o.theme,(h=o.state)==null?void 0:h.getInternalStack(o.theme)]})),a[0].state.lang):void 0;return s&&Zs(_,s),_}function Rg(...t){const e=t.map(()=>[]),i=t.length;for(let n=0;n<t[0].length;n++){const a=t.map(o=>o[n]),v=e.map(()=>[]);e.forEach((o,h)=>o.push(v[h]));const _=a.map(()=>0),s=a.map(o=>o[0]);for(;s.every(o=>o);){const o=Math.min(...s.map(h=>h.content.length));for(let h=0;h<i;h++){const g=s[h];g.content.length===o?(v[h].push(g),_[h]+=1,s[h]=a[h][_[h]]):(v[h].push({...g,content:g.content.slice(0,o)}),s[h]={...g,content:g.content.slice(o),offset:g.offset+o})}}}return e}function Ns(t,e,i){let n,a,v,_,s,o;if("themes"in i){const{defaultColor:h="light",cssVariablePrefix:g="--shiki-",colorsRendering:c="css-vars"}=i,p=Object.entries(i.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})).sort((l,d)=>l.color===h?-1:d.color===h?1:0);if(p.length===0)throw new or("`themes` option must not be empty");const b=hd(t,e,i);if(o=Xn(b),h&&ba!==h&&!p.find(l=>l.color===h))throw new or(`\`themes\` option must contain the defaultColor key \`${h}\``);const w=p.map(l=>t.getTheme(l.theme)),m=p.map(l=>l.color);v=b.map(l=>l.map(d=>lg(d,m,g,h,c))),o&&Zs(v,o);const u=p.map(l=>Ms(l.theme,i));a=ul(p,w,u,g,h,"fg",c),n=ul(p,w,u,g,h,"bg",c),_=`shiki-themes ${w.map(l=>l.name).join(" ")}`,s=h?void 0:[a,n].join(";")}else if("theme"in i){const h=Ms(i.theme,i);v=ya(t,e,i);const g=t.getTheme(i.theme);n=Fi(g.bg,h),a=Fi(g.fg,h),_=g.name,o=Xn(v)}else throw new or("Invalid options, either `theme` or `themes` must be provided");return{tokens:v,fg:a,bg:n,themeName:_,rootStyle:s,grammarState:o}}function ul(t,e,i,n,a,v,_){return t.map((s,o)=>{const h=Fi(e[o][v],i[o])||"inherit",g=`${n+s.color}${v==="bg"?"-bg":""}:${h}`;if(o===0&&a){if(a===ba&&t.length>1){const c=t.findIndex(m=>m.color==="light"),p=t.findIndex(m=>m.color==="dark");if(c===-1||p===-1)throw new or('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=Fi(e[c][v],i[c])||"inherit",w=Fi(e[p][v],i[p])||"inherit";return`light-dark(${b}, ${w});${g}`}return h}return _==="css-vars"?g:null}).filter(s=>!!s).join(";")}function js(t,e,i,n={meta:{},options:i,codeToHast:(a,v)=>js(t,a,v),codeToTokens:(a,v)=>Ns(t,a,v)}){var w,m;let a=e;for(const u of Bs(i))a=((w=u.preprocess)==null?void 0:w.call(n,a,i))||a;let{tokens:v,fg:_,bg:s,themeName:o,rootStyle:h,grammarState:g}=Ns(t,a,i);const{mergeWhitespaces:c=!0,mergeSameStyleTokens:p=!1}=i;c===!0?v=Tg(v):c==="never"&&(v=Dg(v)),p&&(v=Ig(v));const b={...n,get source(){return a}};for(const u of Bs(i))v=((m=u.tokens)==null?void 0:m.call(b,v))||v;return Ag(v,{...i,fg:_,bg:s,themeName:o,rootStyle:i.rootStyle===!1?!1:i.rootStyle??h},b,g)}function Ag(t,e,i,n=Xn(t)){var m,u,l,d;const a=Bs(e),v=[],_={type:"root",children:[]},{structure:s="classic",tabindex:o="0"}=e,h={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?h.style=e.rootStyle:h.style=`background-color:${e.bg};color:${e.fg}`),o!==!1&&o!=null&&(h.tabindex=o.toString());for(const[f,y]of Object.entries(e.meta||{}))f.startsWith("_")||(h[f]=y);let g={type:"element",tagName:"pre",properties:h,children:[],data:e.data},c={type:"element",tagName:"code",properties:{},children:v};const p=[],b={...i,structure:s,addClassToHast:cd,get source(){return i.source},get tokens(){return t},get options(){return e},get root(){return _},get pre(){return g},get code(){return c},get lines(){return p}};if(t.forEach((f,y)=>{var L,x;y&&(s==="inline"?_.children.push({type:"element",tagName:"br",properties:{},children:[]}):s==="classic"&&v.push({type:"text",value:`
203
+ `}));let E={type:"element",tagName:"span",properties:{class:"line"},children:[]},S=0;for(const P of f){let B={type:"element",tagName:"span",properties:{...P.htmlAttrs},children:[{type:"text",value:P.content}]};const j=Ko(P.htmlStyle||Os(P));j&&(B.properties.style=j);for(const V of a)B=((L=V==null?void 0:V.span)==null?void 0:L.call(b,B,y+1,S,E,P))||B;s==="inline"?_.children.push(B):s==="classic"&&E.children.push(B),S+=P.content.length}if(s==="classic"){for(const P of a)E=((x=P==null?void 0:P.line)==null?void 0:x.call(b,E,y+1))||E;p.push(E),v.push(E)}else s==="inline"&&p.push(E)}),s==="classic"){for(const f of a)c=((m=f==null?void 0:f.code)==null?void 0:m.call(b,c))||c;g.children.push(c);for(const f of a)g=((u=f==null?void 0:f.pre)==null?void 0:u.call(b,g))||g;_.children.push(g)}else if(s==="inline"){const f=[];let y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const L of _.children)L.type==="element"&&L.tagName==="br"?(f.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(L.type==="element"||L.type==="text")&&y.children.push(L);f.push(y);let S={type:"element",tagName:"code",properties:{},children:f};for(const L of a)S=((l=L==null?void 0:L.code)==null?void 0:l.call(b,S))||S;_.children=[];for(let L=0;L<S.children.length;L++){L>0&&_.children.push({type:"element",tagName:"br",properties:{},children:[]});const x=S.children[L];x.type==="element"&&_.children.push(...x.children)}}let w=_;for(const f of a)w=((d=f==null?void 0:f.root)==null?void 0:d.call(b,w))||w;return n&&Zs(w,n),w}function Tg(t){return t.map(e=>{const i=[];let n="",a;return e.forEach((v,_)=>{const o=!(v.fontStyle&&(v.fontStyle&Lr.Underline||v.fontStyle&Lr.Strikethrough));o&&v.content.match(/^\s+$/)&&e[_+1]?(a===void 0&&(a=v.offset),n+=v.content):n?(o?i.push({...v,offset:a,content:n+v.content}):i.push({content:n,offset:a},v),a=void 0,n=""):i.push(v)}),i})}function Dg(t){return t.map(e=>e.flatMap(i=>{if(i.content.match(/^\s+$/))return i;const n=i.content.match(/^(\s*)(.*?)(\s*)$/);if(!n)return i;const[,a,v,_]=n;if(!a&&!_)return i;const s=[{...i,offset:i.offset+a.length,content:v}];return a&&s.unshift({content:a,offset:i.offset}),_&&s.push({content:_,offset:i.offset+a.length+v.length}),s}))}function Ig(t){return t.map(e=>{const i=[];for(const n of e){if(i.length===0){i.push({...n});continue}const a=i[i.length-1],v=Ko(a.htmlStyle||Os(a)),_=Ko(n.htmlStyle||Os(n)),s=a.fontStyle&&(a.fontStyle&Lr.Underline||a.fontStyle&Lr.Strikethrough),o=n.fontStyle&&(n.fontStyle&Lr.Underline||n.fontStyle&Lr.Strikethrough);!s&&!o&&v===_?a.content+=n.content:i.push({...n})}return i})}const Mg=eg;function Og(t,e,i){var v;const n={meta:{},options:i,codeToHast:(_,s)=>js(t,_,s),codeToTokens:(_,s)=>Ns(t,_,s)};let a=Mg(js(t,e,i,n));for(const _ of Bs(i))a=((v=_.postprocess)==null?void 0:v.call(n,a,i))||a;return a}const hl={light:"#333333",dark:"#bbbbbb"},fl={light:"#fffffe",dark:"#1e1e1e"},vl="__shiki_resolved";function wa(t){var s,o,h,g,c;if(t!=null&&t[vl])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||(e.type="dark"),e.colorReplacements={...e.colorReplacements},e.settings||(e.settings=[]);let{bg:i,fg:n}=e;if(!i||!n){const p=e.settings?e.settings.find(b=>!b.name&&!b.scope):void 0;(s=p==null?void 0:p.settings)!=null&&s.foreground&&(n=p.settings.foreground),(o=p==null?void 0:p.settings)!=null&&o.background&&(i=p.settings.background),!n&&((h=e==null?void 0:e.colors)!=null&&h["editor.foreground"])&&(n=e.colors["editor.foreground"]),!i&&((g=e==null?void 0:e.colors)!=null&&g["editor.background"])&&(i=e.colors["editor.background"]),n||(n=e.type==="light"?hl.light:hl.dark),i||(i=e.type==="light"?fl.light:fl.dark),e.fg=n,e.bg=i}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let a=0;const v=new Map;function _(p){var w;if(v.has(p))return v.get(p);a+=1;const b=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return(w=e.colorReplacements)!=null&&w[`#${b}`]?_(p):(v.set(p,b),b)}e.settings=e.settings.map(p=>{var u,l;const b=((u=p.settings)==null?void 0:u.foreground)&&!p.settings.foreground.startsWith("#"),w=((l=p.settings)==null?void 0:l.background)&&!p.settings.background.startsWith("#");if(!b&&!w)return p;const m={...p,settings:{...p.settings}};if(b){const d=_(p.settings.foreground);e.colorReplacements[d]=p.settings.foreground,m.settings.foreground=d}if(w){const d=_(p.settings.background);e.colorReplacements[d]=p.settings.background,m.settings.background=d}return m});for(const p of Object.keys(e.colors||{}))if((p==="editor.foreground"||p==="editor.background"||p.startsWith("terminal.ansi"))&&!((c=e.colors[p])!=null&&c.startsWith("#"))){const b=_(e.colors[p]);e.colorReplacements[b]=e.colors[p],e.colors[p]=b}return Object.defineProperty(e,vl,{enumerable:!1,writable:!1,value:!0}),e}async function fd(t){return Array.from(new Set((await Promise.all(t.filter(e=>!ad(e)).map(async e=>await od(e).then(i=>Array.isArray(i)?i:[i])))).flat()))}async function vd(t){return(await Promise.all(t.map(async i=>ld(i)?null:wa(await od(i))))).filter(i=>!!i)}let Bg=3;function Ng(t,e=3){e>Bg||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let vn=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function _d(t,e){if(!e)return t;if(e[t]){const i=new Set([t]);for(;e[t];){if(t=e[t],i.has(t))throw new vn(`Circular alias \`${Array.from(i).join(" -> ")} -> ${t}\``);i.add(t)}}return t}class jg extends H_{constructor(i,n,a,v={}){super(i);Se(this,"_resolvedThemes",new Map);Se(this,"_resolvedGrammars",new Map);Se(this,"_langMap",new Map);Se(this,"_langGraph",new Map);Se(this,"_textmateThemeCache",new WeakMap);Se(this,"_loadedThemesCache",null);Se(this,"_loadedLanguagesCache",null);this._resolver=i,this._themes=n,this._langs=a,this._alias=v,this._themes.map(_=>this.loadTheme(_)),this.loadLanguages(this._langs)}getTheme(i){return typeof i=="string"?this._resolvedThemes.get(i):this.loadTheme(i)}loadTheme(i){const n=wa(i);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(i){let n=this._textmateThemeCache.get(i);n||(n=Rs.createFromRawTheme(i),this._textmateThemeCache.set(i,n)),this._syncRegistry.setTheme(n)}getGrammar(i){return i=_d(i,this._alias),this._resolvedGrammars.get(i)}loadLanguage(i){var _,s,o,h;if(this.getGrammar(i.name))return;const n=new Set([...this._langMap.values()].filter(g=>{var c;return(c=g.embeddedLangsLazy)==null?void 0:c.includes(i.name)}));this._resolver.addLanguage(i);const a={balancedBracketSelectors:i.balancedBracketSelectors||["*"],unbalancedBracketSelectors:i.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(i.scopeName,i);const v=this.loadGrammarWithConfiguration(i.scopeName,1,a);if(v.name=i.name,this._resolvedGrammars.set(i.name,v),i.aliases&&i.aliases.forEach(g=>{this._alias[g]=i.name}),this._loadedLanguagesCache=null,n.size)for(const g of n)this._resolvedGrammars.delete(g.name),this._loadedLanguagesCache=null,(s=(_=this._syncRegistry)==null?void 0:_._injectionGrammars)==null||s.delete(g.scopeName),(h=(o=this._syncRegistry)==null?void 0:o._grammars)==null||h.delete(g.scopeName),this.loadLanguage(this._langMap.get(g.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(i){for(const v of i)this.resolveEmbeddedLanguages(v);const n=Array.from(this._langGraph.entries()),a=n.filter(([v,_])=>!_);if(a.length){const v=n.filter(([_,s])=>{if(!s)return!1;const o=s.embeddedLanguages||s.embeddedLangs;return o==null?void 0:o.some(h=>a.map(([g])=>g).includes(h))}).filter(_=>!a.includes(_));throw new vn(`Missing languages ${a.map(([_])=>`\`${_}\``).join(", ")}, required by ${v.map(([_])=>`\`${_}\``).join(", ")}`)}for(const[v,_]of n)this._resolver.addLanguage(_);for(const[v,_]of n)this.loadLanguage(_)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(i){this._langMap.set(i.name,i),this._langGraph.set(i.name,i);const n=i.embeddedLanguages??i.embeddedLangs;if(n)for(const a of n)this._langGraph.set(a,this._langMap.get(a))}}class Fg{constructor(e,i){Se(this,"_langs",new Map);Se(this,"_scopeToLang",new Map);Se(this,"_injections",new Map);Se(this,"_onigLib");this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},i.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(i=>{this._langs.set(i,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(i=>{this._injections.get(i)||this._injections.set(i,[]),this._injections.get(i).push(e.scopeName)})}getInjections(e){const i=e.split(".");let n=[];for(let a=1;a<=i.length;a++){const v=i.slice(0,a).join(".");n=[...n,...this._injections.get(v)||[]]}return n}}let Mn=0;function Hg(t){Mn+=1,t.warnings!==!1&&Mn>=10&&Mn%10===0&&console.warn(`[Shiki] ${Mn} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new vn("`engine` option is required for synchronous mode");const i=(t.langs||[]).flat(1),n=(t.themes||[]).flat(1).map(wa),a=new Fg(t.engine,i),v=new jg(a,n,i,t.langAlias);let _;function s(f){return _d(f,t.langAlias)}function o(f){l();const y=v.getGrammar(typeof f=="string"?f:f.name);if(!y)throw new vn(`Language \`${f}\` not found, you may need to load it first`);return y}function h(f){if(f==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};l();const y=v.getTheme(f);if(!y)throw new vn(`Theme \`${f}\` not found, you may need to load it first`);return y}function g(f){l();const y=h(f);_!==f&&(v.setTheme(y),_=f);const E=v.getColorMap();return{theme:y,colorMap:E}}function c(){return l(),v.getLoadedThemes()}function p(){return l(),v.getLoadedLanguages()}function b(...f){l(),v.loadLanguages(f.flat(1))}async function w(...f){return b(await fd(f))}function m(...f){l();for(const y of f.flat(1))v.loadTheme(y)}async function u(...f){return l(),m(await vd(f))}function l(){if(e)throw new vn("Shiki instance has been disposed")}function d(){e||(e=!0,v.dispose(),Mn-=1)}return{setTheme:g,getTheme:h,getLanguage:o,getLoadedThemes:c,getLoadedLanguages:p,resolveLangAlias:s,loadLanguage:w,loadLanguageSync:b,loadTheme:u,loadThemeSync:m,dispose:d,[Symbol.dispose]:d}}async function Vg(t){t.engine||Ng("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,i,n]=await Promise.all([vd(t.themes||[]),fd(t.langs||[]),t.engine]);return Hg({...t,themes:e,langs:i,engine:n})}async function Wg(t){const e=await Vg(t);return{getLastGrammarState:(...i)=>Sg(e,...i),codeToTokensBase:(i,n)=>ya(e,i,n),codeToTokensWithThemes:(i,n)=>hd(e,i,n),codeToTokens:(i,n)=>Ns(e,i,n),codeToHast:(i,n)=>js(e,i,n),codeToHtml:(i,n)=>Og(e,i,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Ug(t){const e=t.langs,i=t.themes,n=t.engine;async function a(v){function _(c){var p;if(typeof c=="string"){if(c=((p=v.langAlias)==null?void 0:p[c])||c,ad(c))return[];const b=e[c];if(!b)throw new or(`Language \`${c}\` is not included in this bundle. You may want to load it from external source.`);return b}return c}function s(c){if(ld(c))return"none";if(typeof c=="string"){const p=i[c];if(!p)throw new or(`Theme \`${c}\` is not included in this bundle. You may want to load it from external source.`);return p}return c}const o=(v.themes??[]).map(c=>s(c)),h=(v.langs??[]).map(c=>_(c)),g=await Wg({engine:v.engine??n(),...v,themes:o,langs:h});return{...g,loadLanguage(...c){return g.loadLanguage(...c.map(_))},loadTheme(...c){return g.loadTheme(...c.map(s))},getBundledLanguages(){return e},getBundledThemes(){return i}}}return a}const pd=[{id:"abap",name:"ABAP",import:(()=>q(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>q(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>q(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>q(()=>import("./angular-html-CU67Zn6k.js").then(t=>t.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>q(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>q(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>q(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>q(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>q(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>q(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>q(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>q(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>q(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>q(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>q(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>q(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>q(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>q(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>q(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>q(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>q(()=>import("./blade-D4QpJJKB.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>q(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>q(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>q(()=>import("./c3-VCDPK7BO.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>q(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>q(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>q(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>q(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>q(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>q(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>q(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>q(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>q(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>q(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>q(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>q(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>q(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>q(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>q(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>q(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>q(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>q(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>q(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>q(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>q(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>q(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>q(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>q(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>q(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>q(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>q(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>q(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>q(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>q(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>q(()=>import("./erb-CgJxNhIT.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>q(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>q(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>q(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>q(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>q(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>q(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>q(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>q(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>q(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>q(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>q(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>q(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>q(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>q(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>q(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>q(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>q(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>q(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>q(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>q(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>q(()=>import("./go-CxLEBnE3.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>q(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>q(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>q(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>q(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>q(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>q(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>q(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>q(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>q(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>q(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>q(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>q(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>q(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>q(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>q(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>q(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>q(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>q(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>q(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>q(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>q(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>q(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>q(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>q(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>q(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>q(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>q(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>q(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>q(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>q(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>q(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>q(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>q(()=>import("./kusto-DZf3V79B.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>q(()=>import("./latex-DGMBWnxU.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>q(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>q(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>q(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>q(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>q(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>q(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>q(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>q(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>q(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>q(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>q(()=>import("./marko-DZsq8hO1.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>q(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>q(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>q(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>q(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>q(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>q(()=>import("./mojo-B93PlW-d.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>q(()=>import("./moonbit-Ba13S78F.js"),[]))},{id:"move",name:"Move",import:(()=>q(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>q(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>q(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>q(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>q(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>q(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>q(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>q(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>q(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>q(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>q(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>q(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>q(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>q(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>q(()=>import("./php-Dhbhpdrm.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>q(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>q(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>q(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>q(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>q(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>q(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>q(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>q(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>q(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>q(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>q(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>q(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>q(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>q(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>q(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>q(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>q(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>q(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>q(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>q(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>q(()=>import("./razor-Uh8Bk_45.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>q(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>q(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>q(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>q(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>q(()=>import("./ron-BhRPY-oY.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>q(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>q(()=>import("./rst-D5oM4XIm.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>q(()=>import("./ruby-Cw6WdidG.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>q(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>q(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>q(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>q(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>q(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>q(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>q(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>q(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>q(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>q(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>q(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>q(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>q(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>q(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>q(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>q(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>q(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>q(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>q(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>q(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([87,2])))},{id:"svelte",name:"Svelte",import:(()=>q(()=>import("./svelte-zxCyuUbr.js"),__vite__mapDeps([88,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>q(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>q(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>q(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>q(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>q(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>q(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>q(()=>import("./templ-P3uqSqPl.js"),__vite__mapDeps([89,90,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>q(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>q(()=>import("./tex-CvyZ59Mk.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>q(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>q(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([91,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>q(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>q(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>q(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>q(()=>import("./twig-ChbOoGGc.js"),__vite__mapDeps([92,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>q(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>q(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>q(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>q(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>q(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>q(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>q(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>q(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>q(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>q(()=>import("./vue-DN_0RTcg.js"),__vite__mapDeps([93,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>q(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([94,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>q(()=>import("./vue-vine-CQOfvN7w.js"),__vite__mapDeps([95,3,5,67,96,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>q(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>q(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>q(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>q(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>q(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>q(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>q(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>q(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>q(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([97,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>q(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>q(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>q(()=>import("./zig-VOosw3JB.js"),[]))}],zg=Object.fromEntries(pd.map(t=>[t.id,t.import])),qg=Object.fromEntries(pd.flatMap(t=>{var e;return((e=t.aliases)==null?void 0:e.map(i=>[i,t.import]))||[]})),Gg={...zg,...qg},Kg=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>q(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>q(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>q(()=>import("./ayu-dark-CMjwMIkn.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>q(()=>import("./ayu-light-C47S-Tmv.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>q(()=>import("./ayu-mirage-CjoLj4QM.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>q(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>q(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>q(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>q(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>q(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>q(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>q(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>q(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>q(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>q(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>q(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>q(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>q(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>q(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>q(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>q(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>q(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>q(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>q(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>q(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>q(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>q(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>q(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>q(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>q(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>q(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>q(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>q(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>q(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>q(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>q(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>q(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>q(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>q(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>q(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>q(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>q(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>q(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>q(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>q(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>q(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>q(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>q(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>q(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>q(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>q(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>q(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>q(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>q(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>q(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>q(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>q(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>q(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>q(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>q(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>q(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>q(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>q(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>q(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],Jg=Object.fromEntries(Kg.map(t=>[t.id,t.import]));class Sa extends Error{constructor(e){super(e),this.name="ShikiError"}}function Qg(){return 2147483648}function Xg(){return typeof performance<"u"?performance.now():Date.now()}const Yg=(t,e)=>t+(e-t%e)%e;async function Zg(t){let e,i;const n={};function a(b){i=b,n.HEAPU8=new Uint8Array(b),n.HEAPU32=new Uint32Array(b)}function v(b,w,m){n.HEAPU8.copyWithin(b,w,w+m)}function _(b){try{return e.grow(b-i.byteLength+65535>>>16),a(e.buffer),1}catch{}}function s(b){const w=n.HEAPU8.length;b=b>>>0;const m=Qg();if(b>m)return!1;for(let u=1;u<=4;u*=2){let l=w*(1+.2/u);l=Math.min(l,b+100663296);const d=Math.min(m,Yg(Math.max(b,l),65536));if(_(d))return!0}return!1}const o=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,w,m=1024){const u=w+m;let l=w;for(;b[l]&&!(l>=u);)++l;if(l-w>16&&b.buffer&&o)return o.decode(b.subarray(w,l));let d="";for(;w<l;){let f=b[w++];if(!(f&128)){d+=String.fromCharCode(f);continue}const y=b[w++]&63;if((f&224)===192){d+=String.fromCharCode((f&31)<<6|y);continue}const E=b[w++]&63;if((f&240)===224?f=(f&15)<<12|y<<6|E:f=(f&7)<<18|y<<12|E<<6|b[w++]&63,f<65536)d+=String.fromCharCode(f);else{const S=f-65536;d+=String.fromCharCode(55296|S>>10,56320|S&1023)}}return d}function g(b,w){return b?h(n.HEAPU8,b,w):""}const c={emscripten_get_now:Xg,emscripten_memcpy_big:v,emscripten_resize_heap:s,fd_write:()=>0};async function p(){const w=await t({env:c,wasi_snapshot_preview1:c});e=w.memory,a(e.buffer),Object.assign(n,w),n.UTF8ToString=g}return await p(),n}var $g=Object.defineProperty,em=(t,e,i)=>e in t?$g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,ar=(t,e,i)=>em(t,typeof e!="symbol"?e+"":e,i);let _r=null;function tm(t){throw new Sa(t.UTF8ToString(t.getLastOnigError()))}class $s{constructor(e){ar(this,"utf16Length"),ar(this,"utf8Length"),ar(this,"utf16Value"),ar(this,"utf8Value"),ar(this,"utf16OffsetToUtf8"),ar(this,"utf8OffsetToUtf16");const i=e.length,n=$s._utf8ByteLength(e),a=n!==i,v=a?new Uint32Array(i+1):null;a&&(v[i]=n);const _=a?new Uint32Array(n+1):null;a&&(_[n]=i);const s=new Uint8Array(n);let o=0;for(let h=0;h<i;h++){const g=e.charCodeAt(h);let c=g,p=!1;if(g>=55296&&g<=56319&&h+1<i){const b=e.charCodeAt(h+1);b>=56320&&b<=57343&&(c=(g-55296<<10)+65536|b-56320,p=!0)}a&&(v[h]=o,p&&(v[h+1]=o),c<=127?_[o+0]=h:c<=2047?(_[o+0]=h,_[o+1]=h):c<=65535?(_[o+0]=h,_[o+1]=h,_[o+2]=h):(_[o+0]=h,_[o+1]=h,_[o+2]=h,_[o+3]=h)),c<=127?s[o++]=c:c<=2047?(s[o++]=192|(c&1984)>>>6,s[o++]=128|(c&63)>>>0):c<=65535?(s[o++]=224|(c&61440)>>>12,s[o++]=128|(c&4032)>>>6,s[o++]=128|(c&63)>>>0):(s[o++]=240|(c&1835008)>>>18,s[o++]=128|(c&258048)>>>12,s[o++]=128|(c&4032)>>>6,s[o++]=128|(c&63)>>>0),p&&h++}this.utf16Length=i,this.utf8Length=n,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=v,this.utf8OffsetToUtf16=_}static _utf8ByteLength(e){let i=0;for(let n=0,a=e.length;n<a;n++){const v=e.charCodeAt(n);let _=v,s=!1;if(v>=55296&&v<=56319&&n+1<a){const o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(_=(v-55296<<10)+65536|o-56320,s=!0)}_<=127?i+=1:_<=2047?i+=2:_<=65535?i+=3:i+=4,s&&n++}return i}createString(e){const i=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,i),i}}const eo=class ui{constructor(e){if(ar(this,"id",++ui.LAST_ID),ar(this,"_onigBinding"),ar(this,"content"),ar(this,"utf16Length"),ar(this,"utf8Length"),ar(this,"utf16OffsetToUtf8"),ar(this,"utf8OffsetToUtf16"),ar(this,"ptr"),!_r)throw new Sa("Must invoke loadWasm first.");this._onigBinding=_r,this.content=e;const i=new $s(e);this.utf16Length=i.utf16Length,this.utf8Length=i.utf8Length,this.utf16OffsetToUtf8=i.utf16OffsetToUtf8,this.utf8OffsetToUtf16=i.utf8OffsetToUtf16,this.utf8Length<1e4&&!ui._sharedPtrInUse?(ui._sharedPtr||(ui._sharedPtr=_r.omalloc(1e4)),ui._sharedPtrInUse=!0,_r.HEAPU8.set(i.utf8Value,ui._sharedPtr),this.ptr=ui._sharedPtr):this.ptr=i.createString(_r)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===ui._sharedPtr?ui._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};ar(eo,"LAST_ID",0);ar(eo,"_sharedPtr",0);ar(eo,"_sharedPtrInUse",!1);let gd=eo;class rm{constructor(e){if(ar(this,"_onigBinding"),ar(this,"_ptr"),!_r)throw new Sa("Must invoke loadWasm first.");const i=[],n=[];for(let s=0,o=e.length;s<o;s++){const h=new $s(e[s]);i[s]=h.createString(_r),n[s]=h.utf8Length}const a=_r.omalloc(4*e.length);_r.HEAPU32.set(i,a/4);const v=_r.omalloc(4*e.length);_r.HEAPU32.set(n,v/4);const _=_r.createOnigScanner(a,v,e.length);for(let s=0,o=e.length;s<o;s++)_r.ofree(i[s]);_r.ofree(v),_r.ofree(a),_===0&&tm(_r),this._onigBinding=_r,this._ptr=_}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,i,n){let a=0;if(typeof n=="number"&&(a=n),typeof e=="string"){e=new gd(e);const v=this._findNextMatchSync(e,i,!1,a);return e.dispose(),v}return this._findNextMatchSync(e,i,!1,a)}_findNextMatchSync(e,i,n,a){const v=this._onigBinding,_=v.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(i),a);if(_===0)return null;const s=v.HEAPU32;let o=_/4;const h=s[o++],g=s[o++],c=[];for(let p=0;p<g;p++){const b=e.convertUtf8OffsetToUtf16(s[o++]),w=e.convertUtf8OffsetToUtf16(s[o++]);c[p]={start:b,end:w,length:w-b}}return{index:h,captureIndices:c}}}function im(t){return typeof t.instantiator=="function"}function nm(t){return typeof t.default=="function"}function sm(t){return typeof t.data<"u"}function om(t){return typeof Response<"u"&&t instanceof Response}function am(t){var e;return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&((e=Buffer.isBuffer)==null?void 0:e.call(Buffer,t))||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let fs;function lm(t){if(fs)return fs;async function e(){_r=await Zg(async i=>{let n=t;return n=await n,typeof n=="function"&&(n=await n(i)),typeof n=="function"&&(n=await n(i)),im(n)?n=await n.instantiator(i):nm(n)?n=await n.default(i):(sm(n)&&(n=n.data),om(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await cm(n)(i):n=await dm(n)(i):am(n)?n=await yo(n)(i):n instanceof WebAssembly.Module?n=await yo(n)(i):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await yo(n.default)(i))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return fs=e(),fs}function yo(t){return e=>WebAssembly.instantiate(t,e)}function cm(t){return e=>WebAssembly.instantiateStreaming(t,e)}function dm(t){return async e=>{const i=await t.arrayBuffer();return WebAssembly.instantiate(i,e)}}async function um(t){return t&&await lm(t),{createScanner(e){return new rm(e.map(i=>typeof i=="string"?i:i.source))},createString(e){return new gd(e)}}}const hm=Ug({langs:Gg,themes:Jg,engine:()=>um(q(()=>import("./wasm-CG6Dc4jp.js"),[]))});let vs=null,_s=null;const _l=new Set;async function fm(){return vs!==null?vs:_s!==null?_s:(_s=hm({themes:["github-dark"],langs:[]}),vs=await _s,vs)}async function vm(t,e){if(_l.has(e))return!0;try{return await t.loadLanguage(e),_l.add(e),!0}catch{return!1}}const _m={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",cjs:"javascript",mts:"typescript",cts:"typescript",svelte:"svelte",vue:"vue",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",kts:"kotlin",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",hxx:"cpp",cs:"csharp",css:"css",scss:"scss",less:"less",html:"html",htm:"html",xml:"xml",svg:"xml",json:"json",jsonc:"jsonc",yaml:"yaml",yml:"yaml",md:"markdown",mdx:"mdx",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",sql:"sql",toml:"toml",nix:"nix",lua:"lua",swift:"swift",php:"php",r:"r",graphql:"graphql",gql:"graphql",tf:"hcl",hcl:"hcl",proto:"protobuf",zig:"zig",elm:"elm",ex:"elixir",exs:"elixir",erl:"erlang",hs:"haskell",clj:"clojure",dart:"dart",scala:"scala",groovy:"groovy",pl:"perl",vim:"viml",ini:"ini",conf:"ini",cfg:"ini",diff:"diff",patch:"diff",ps1:"powershell",bat:"batch",cmd:"batch"},pm={dockerfile:"dockerfile",makefile:"makefile",cmakelists:"cmake",gemfile:"ruby",rakefile:"ruby",justfile:"just"};function gm(t){const e=(t.split("/").pop()??"").toLowerCase(),i=e.split(".")[0]??e,n=pm[i];if(n!==void 0)return n;const a=e.includes(".")?e.split(".").pop()??"":"";return _m[a]??"text"}function xs(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function mm(t){return t.map(e=>{const i=xs(e.content);return e.color!==void 0?`<span style="color:${e.color}">${i}</span>`:i}).join("")}async function Yn(t,e){const i=gm(e);if(i==="text"||t.length===0)return t.split(`
204
+ `).map(n=>xs(n));try{const n=await fm();return await vm(n,i)?n.codeToTokens(t,{lang:i,theme:"github-dark"}).tokens.map(_=>mm(_)):t.split(`
205
+ `).map(_=>xs(_))}catch{return t.split(`
206
+ `).map(n=>xs(n))}}var bm=I('<div class="flex items-center justify-center flex-1 text-text-secondary text-sm p-8"><p> </p></div>'),ym=I('<div class="flex items-center justify-center flex-1 text-danger-fg text-sm p-8"><p> </p></div>'),xm=I('<div class="diff-view-container w-full h-full flex flex-col svelte-1uewwyd"><div class="flex items-center justify-between px-2 min-h-[32px] bg-bg-secondary border-b border-border-default sticky top-0 z-10"><div class="flex items-center gap-2"><span class="text-xs font-medium text-text-primary truncate max-w-[300px]"> </span> <span class="text-[10px] text-text-secondary"> </span></div> <div class="flex items-center gap-0.5"><button type="button" title="Previous file" aria-label="Previous file"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 1.06L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z"></path></svg></button> <button type="button" title="Next file" aria-label="Next file"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8.22 3.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.19 9H3.75a.75.75 0 0 1 0-1.5h7.44L8.22 4.53a.75.75 0 0 1 0-1.06Z"></path></svg></button></div></div> <!></div>');function wm(t,e){Tt(e,!0);let i=We(e,"onLineSelect",3,void 0),n=We(e,"onCommentSubmit",3,void 0);We(e,"highlightedLines",3,void 0);let a=We(e,"onNavigatePrev",3,void 0),v=We(e,"onNavigateNext",3,void 0),_=K(null),s=K(gt(new Map)),o=K(gt(new Map));St(()=>{const Q=[],ne=[];for(const M of e.file.chunks)for(const z of M.changes)(z.type==="delete"||z.type==="context")&&z.oldLine!==void 0&&Q.push({lineNumber:z.oldLine,content:z.content}),(z.type==="add"||z.type==="context")&&z.newLine!==void 0&&ne.push({lineNumber:z.newLine,content:z.content});const le=Q.map(M=>M.content).join(`
207
+ `),D=ne.map(M=>M.content).join(`
208
+ `),T=e.file.path;Promise.all([Yn(le,T),Yn(D,T)]).then(([M,z])=>{const J=new Map;for(let re=0;re<Q.length;re++){const se=Q[re],G=M[re];se!==void 0&&G!==void 0&&J.set(se.lineNumber,G)}k(s,J,!0);const Z=new Map;for(let re=0;re<ne.length;re++){const se=ne[re],G=z[re];se!==void 0&&G!==void 0&&Z.set(se.lineNumber,G)}k(o,Z,!0)})});function h(Q,ne){i()!==void 0&&i()(ne)}function g(Q,ne){i()!==void 0&&i()(Q)}function c(Q,ne,le){if(le&&r(_)!==null&&r(_).side===Q){const D=Math.min(r(_).startLine,ne),T=Math.max(r(_).endLine,ne);k(_,{side:Q,startLine:D,endLine:T},!0)}else k(_,{side:Q,startLine:ne,endLine:ne},!0)}function p(Q,ne,le){if(le&&r(_)!==null&&r(_).side===ne){const D=Math.min(r(_).startLine,Q),T=Math.max(r(_).endLine,Q);k(_,{side:ne,startLine:D,endLine:T},!0)}else k(_,{side:ne,startLine:Q,endLine:Q},!0)}function b(Q,ne){r(_)!==null&&n()!==void 0&&n()(r(_).startLine,r(_).endLine,r(_).side,e.file.path,Q,ne),k(_,null)}function w(){k(_,null)}const m=ge(()=>{if(r(_)===null)return"";const Q=r(_).startLine===r(_).endLine?`L${r(_).startLine}`:`L${r(_).startLine}-L${r(_).endLine}`;return`Ask AI about ${e.file.path}:${Q} ...`}),u=ge(()=>{if(r(_)===null)return[];const Q=[];for(let ne=r(_).startLine;ne<=r(_).endLine;ne++)Q.push(ne);return Q}),l=ge(()=>r(_)!==null?{side:r(_).side,startLine:r(_).startLine,endLine:r(_).endLine}:void 0),d=ge(()=>r(_)!==null?{type:r(_).side,startLine:r(_).startLine,endLine:r(_).endLine}:void 0);var f=xm(),y=C(f),E=C(y),S=C(E),L=C(S),x=R(S,2),P=C(x),B=R(E,2),j=C(B);j.__click=()=>{var Q;return(Q=a())==null?void 0:Q()};var V=R(j,2);V.__click=()=>{var Q;return(Q=v())==null?void 0:Q()};var N=R(y,2);{var X=Q=>{var ne=bm(),le=C(ne),D=C(le);ee(()=>Y(D,`No changes to display for ${e.file.path??""}`)),A(Q,ne)},W=Q=>{var ne=et(),le=Ae(ne);{var D=M=>{Uv(M,{get chunks(){return e.file.chunks},onLineSelect:h,onCommentOpen:c,onCommentSubmit:b,onCommentCancel:w,get commentLine(){return r(l)},get placeholder(){return r(m)},get rangeLines(){return r(u)},get oldHighlightMap(){return r(s)},get newHighlightMap(){return r(o)},get filePath(){return e.file.path}})},T=M=>{var z=et(),J=Ae(z);{var Z=se=>{Tc(se,{get chunks(){return e.file.chunks},onLineSelect:g,onCommentOpen:p,onCommentSubmit:b,onCommentCancel:w,get commentLine(){return r(d)},get placeholder(){return r(m)},get rangeLines(){return r(u)},get oldHighlightMap(){return r(s)},get newHighlightMap(){return r(o)},get filePath(){return e.file.path}})},re=se=>{var G=ym(),O=C(G),ie=C(O);ee(()=>Y(ie,`Unknown view mode: ${e.mode??""}`)),A(se,G)};H(J,se=>{e.mode==="inline"?se(Z):se(re,!1)},!0)}A(M,z)};H(le,M=>{e.mode==="side-by-side"?M(D):M(T,!1)},!0)}A(Q,ne)};H(N,Q=>{e.file.chunks.length===0?Q(X):Q(W,!1)})}ee(()=>{Y(L,e.file.path),Y(P,`+${e.file.additions??""} -${e.file.deletions??""}`),Pe(j,1,`p-1 rounded transition-colors ${a()!==void 0?"text-text-secondary hover:text-text-primary hover:bg-bg-tertiary cursor-pointer":"text-text-disabled cursor-default"}`),j.disabled=a()===void 0,Pe(V,1,`p-1 rounded transition-colors ${v()!==void 0?"text-text-secondary hover:text-text-primary hover:bg-bg-tertiary cursor-pointer":"text-text-disabled cursor-default"}`),V.disabled=v()===void 0}),A(t,f),Dt()}Ft(["click"]);var Sm=I('<img class="max-w-full max-h-[80vh] object-contain"/>'),Cm=I('<img class="max-w-full max-h-[80vh] object-contain"/>'),km=I('<div class="flex items-center justify-center p-8"><!></div>'),Em=I('<div class="flex items-center justify-center p-8"><video controls class="max-w-full max-h-[80vh]"></video></div>',2),Lm=I('<div class="w-full h-full min-h-[80vh] p-2"><iframe class="w-full h-full min-h-[80vh] border border-border-default rounded"></iframe></div>'),Pm=I('<div class="flex flex-col items-center justify-center py-12 text-text-secondary text-sm gap-2"><div class="text-base font-medium">Binary file</div> <div class="text-xs"> </div> <div class="text-xs text-text-tertiary"> </div></div>'),Rm=I('<div class="flex items-center justify-center py-12 text-text-secondary text-sm">Empty file</div>'),Am=I(`<button type="button" class="absolute left-0 top-1 w-6 h-6 flex items-center justify-center
209
+ rounded bg-accent-emphasis text-white text-xs font-bold
210
+ opacity-0 group-hover/line:opacity-100
211
+ hover:bg-accent-fg transition-opacity z-10 cursor-pointer">+</button>`),Tm=I('<span class="highlighted-line svelte-fshbtj"><!></span>'),Dm=I('<pre class="m-0 p-0 svelte-fshbtj"> </pre>'),Im=I(`<div class="border-t-2 border-b-2 border-accent-emphasis bg-bg-secondary p-3"><textarea class="w-full min-h-[80px] p-2 text-sm font-sans bg-bg-primary border border-border-default rounded resize-y
212
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis"></textarea> <div class="flex items-center gap-2 mt-2"><button type="button" class="px-3 py-1 text-sm bg-success-emphasis text-white rounded hover:brightness-110">Submit</button> <button type="button" class="px-3 py-1 text-sm text-text-secondary hover:text-text-primary">Cancel</button></div></div>`),Mm=I('<div><div class="w-12 flex-shrink-0 px-1 flex items-start justify-end text-text-secondary bg-bg-secondary border-r border-border-default relative"><!> <span class="select-none"> </span></div> <div class="flex-1 px-2 overflow-x-auto"><!></div></div> <!>',1),Om=I('<div class="file-viewer w-full h-full overflow-auto font-mono text-xs leading-5"><div class="flex items-center justify-between px-2 min-h-[32px] bg-bg-secondary border-b border-border-default sticky top-0 z-10"><div class="flex items-center gap-2"><span class="text-xs font-medium text-text-primary truncate max-w-[300px]"> </span></div> <div class="flex items-center gap-0.5"><button type="button" title="Previous file" aria-label="Previous file"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 1.06L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z"></path></svg></button> <button type="button" title="Next file" aria-label="Next file"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8.22 3.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.19 9H3.75a.75.75 0 0 1 0-1.5h7.44L8.22 4.53a.75.75 0 0 1 0-1.06Z"></path></svg></button></div></div> <!></div>');function pl(t,e){Tt(e,!0);let i=We(e,"isBinary",3,void 0),n=We(e,"isImage",3,void 0),a=We(e,"isVideo",3,void 0),v=We(e,"isPdf",3,void 0),_=We(e,"mimeType",3,void 0),s=We(e,"rawFileUrl",3,void 0),o=We(e,"onCommentSubmit",3,void 0),h=We(e,"onNavigatePrev",3,void 0),g=We(e,"onNavigateNext",3,void 0),c=K(null),p=K(""),b=K(gt([]));const w=ge(()=>e.content.split(`
213
+ `));St(()=>{const W=e.content,Q=e.path;Yn(W,Q).then(ne=>{k(b,ne,!0)})});function m(W,Q){if(Q&&r(c)!==null){const ne=Math.min(r(c).startLine,W),le=Math.max(r(c).endLine,W);k(c,{startLine:ne,endLine:le},!0)}else k(c,{startLine:W,endLine:W},!0)}function u(W,Q){r(c)!==null&&o()!==void 0&&o()(r(c).startLine,r(c).endLine,"new",e.path,W,Q),k(c,null),k(p,"")}function l(){k(c,null),k(p,"")}const d=ge(()=>{if(r(c)===null)return"";const W=r(c).startLine===r(c).endLine?`L${r(c).startLine}`:`L${r(c).startLine}-L${r(c).endLine}`;return`Ask AI about ${e.path}:${W} ...`}),f=ge(()=>{if(r(c)===null)return[];const W=[];for(let Q=r(c).startLine;Q<=r(c).endLine;Q++)W.push(Q);return W});var y=Om(),E=C(y),S=C(E),L=C(S),x=C(L),P=R(S,2),B=C(P);B.__click=()=>{var W;return(W=h())==null?void 0:W()};var j=R(B,2);j.__click=()=>{var W;return(W=g())==null?void 0:W()};var V=R(E,2);{var N=W=>{var Q=km(),ne=C(Q);{var le=T=>{var M=Sm();ee(()=>{ze(M,"src",s()),ze(M,"alt",e.path)}),A(T,M)},D=T=>{var M=Cm();ee(()=>{ze(M,"src",`data:${_()??"image/png"??""};base64,${e.content??""}`),ze(M,"alt",e.path)}),A(T,M)};H(ne,T=>{s()!==void 0?T(le):T(D,!1)})}A(W,Q)},X=W=>{var Q=et(),ne=Ae(Q);{var le=T=>{var M=Em(),z=C(M);ee(()=>ze(z,"src",s())),A(T,M)},D=T=>{var M=et(),z=Ae(M);{var J=re=>{var se=Lm(),G=C(se);ee(()=>{ze(G,"src",s()),ze(G,"title",e.path)}),A(re,se)},Z=re=>{var se=et(),G=Ae(se);{var O=F=>{var U=Pm(),$=R(C(U),2),be=C($),xe=R($,2),ae=C(xe);ee(()=>{Y(be,_()??"unknown type"),Y(ae,e.path)}),A(F,U)},ie=F=>{var U=et(),$=Ae(U);{var be=ae=>{var he=Rm();A(ae,he)},xe=ae=>{var he=et(),fe=Ae(he);At(fe,17,()=>r(w),Pr,(Ee,He,Le)=>{const ce=ge(()=>Le+1),Te=ge(()=>r(f).includes(r(ce)));var De=Mm(),pe=Ae(De),Be=C(pe),Qe=C(Be);{var Ne=_e=>{var Oe=Am();Oe.__click=Ke=>{Ke.stopPropagation(),m(r(ce),Ke.shiftKey)},ee(()=>ze(Oe,"aria-label",`Add comment on line ${r(ce)??""}`)),A(_e,Oe)};H(Qe,_e=>{o()!==void 0&&_e(Ne)})}var Me=R(Qe,2),Fe=C(Me),tt=R(Be,2),Ve=C(tt);{var Xe=_e=>{var Oe=Tm(),Ke=C(Oe);Qs(Ke,()=>r(b)[Le]),A(_e,Oe)},Ue=_e=>{var Oe=Dm(),Ke=C(Oe);ee(()=>Y(Ke,r(He))),A(_e,Oe)};H(Ve,_e=>{r(b)[Le]!==void 0?_e(Xe):_e(Ue,!1)})}var Je=R(pe,2);{var ve=_e=>{var Oe=Im(),Ke=C(Oe);Ke.__keydown=ut=>{ut.key==="Enter"&&ut.ctrlKey&&o()!==void 0&&(ut.preventDefault(),u(r(p),!0)),ut.key==="Escape"&&l()};var nt=R(Ke,2),$e=C(nt);$e.__click=()=>u(r(p),!0);var dt=R($e,2);dt.__click=()=>l(),ee(()=>ze(Ke,"placeholder",r(d))),Rr(Ke,()=>r(p),ut=>k(p,ut)),A(_e,Oe)};H(Je,_e=>{r(c)!==null&&r(c).endLine===r(ce)&&_e(ve)})}ee(()=>{Pe(pe,1,`flex group/line ${r(Te)?"bg-accent-muted":""}`),Y(Fe,r(ce))}),A(Ee,De)}),A(ae,he)};H($,ae=>{r(w).length===0?ae(be):ae(xe,!1)},!0)}A(F,U)};H(G,F=>{i()===!0?F(O):F(ie,!1)},!0)}A(re,se)};H(z,re=>{i()===!0&&v()===!0&&s()!==void 0?re(J):re(Z,!1)},!0)}A(T,M)};H(ne,T=>{i()===!0&&a()===!0&&s()!==void 0?T(le):T(D,!1)},!0)}A(W,Q)};H(V,W=>{i()===!0&&n()===!0?W(N):W(X,!1)})}ee(()=>{Y(x,e.path),Pe(B,1,`p-1 rounded transition-colors ${h()!==void 0?"text-text-secondary hover:text-text-primary hover:bg-bg-tertiary cursor-pointer":"text-text-disabled cursor-default"}`),B.disabled=h()===void 0,Pe(j,1,`p-1 rounded transition-colors ${g()!==void 0?"text-text-secondary hover:text-text-primary hover:bg-bg-tertiary cursor-pointer":"text-text-disabled cursor-default"}`),j.disabled=g()===void 0}),A(t,y),Dt()}Ft(["click","keydown"]);var Bm=I('<span class="text-[10px] font-medium text-text-tertiary bg-bg-tertiary px-1 rounded shrink-0" aria-label="Binary file">BIN</span>'),Nm=I("<span> </span>"),jm=I('<button type="button" draggable="true"><svg class="file-icon w-3.5 h-3.5 text-text-tertiary shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg> <span class="file-name text-text-primary text-xs truncate flex-1"> </span> <!> <!></button>');function Fm(t,e){Tt(e,!0);let i=K(null);St(()=>{e.selected&&r(i)!==null&&r(i).scrollIntoView({block:"nearest",behavior:"smooth"})});function n(m){if(m===void 0)return"";switch(m){case"added":return"[+]";case"modified":return"[M]";case"deleted":return"[-]";case"untracked":return"[?]";case"ignored":return"[I]";default:return""}}function a(m){if(m===void 0)return"";switch(m){case"added":return"text-success-fg";case"modified":return"text-attention-fg";case"deleted":return"text-danger-fg";case"untracked":return"text-success-fg";case"ignored":return"text-text-quaternary";default:return""}}function v(m){if(m===void 0)return"";switch(m){case"added":return"status-added";case"modified":return"status-modified";case"deleted":return"status-deleted";case"untracked":return"status-untracked";case"ignored":return"status-ignored";default:return""}}const _=ge(()=>1+e.depth*1.5+1);var s=jm();let o;s.__click=function(...m){var u;(u=e.onSelect)==null||u.apply(this,m)};var h=R(C(s),2),g=C(h),c=R(h,2);{var p=m=>{var u=Bm();A(m,u)};H(c,m=>{e.node.isBinary===!0&&m(p)})}var b=R(c,2);{var w=m=>{var u=Nm(),l=C(u);ee((d,f)=>{Pe(u,1,`status-badge text-xs font-medium shrink-0 ${d??""}`,"svelte-1ukt5k3"),ze(u,"aria-label",`${e.node.status??""} file`),Y(l,f)},[()=>a(e.node.status),()=>n(e.node.status)]),A(m,u)};H(b,m=>{e.node.status!==void 0&&m(w)})}er(s,m=>k(i,m),()=>r(i)),ee(m=>{o=Pe(s,1,`file-node group/filenode w-full text-left px-4 py-1 focus:outline-none transition-colors min-h-[28px] flex items-center gap-1.5 ${m??""}`,"svelte-1ukt5k3",o,{"bg-accent-subtle":e.selected&&!e.node.status,"border-l-4":e.selected,"border-accent-emphasis":e.selected}),nr(s,`padding-left: ${r(_)??""}rem`),ze(s,"aria-label",`Select file ${e.node.name??""}`),ze(s,"aria-current",e.selected?"true":void 0),Y(g,e.node.name)},[()=>v(e.node.status)]),Qt("dragstart",s,m=>{var u,l;(u=m.dataTransfer)==null||u.setData("application/x-qraftbox-path",e.node.path),(l=m.dataTransfer)==null||l.setData("text/plain",e.node.path)}),A(t,s),Dt()}Ft(["click"]);var Hm=I('<span class="text-[10px] font-medium text-text-quaternary shrink-0" aria-label="Ignored by git">[I]</span>'),Vm=I('<span class="changed-indicator text-xs text-accent-fg shrink-0" aria-label="Contains changed files">•</span>'),Wm=I('<div class="flex items-center gap-1.5 py-1 text-xs text-text-tertiary"><svg class="animate-spin w-3 h-3" viewBox="0 0 24 24" fill="none" aria-hidden="true"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="3" opacity="0.25"></circle><path d="M4 12a8 8 0 018-8" stroke="currentColor" stroke-width="3" stroke-linecap="round"></path></svg> <span>Loading...</span></div>'),Um=I('<div role="treeitem"><button type="button" class="directory-button w-full text-left px-4 py-1 hover:bg-bg-tertiary focus:bg-bg-tertiary focus:outline-none transition-colors min-h-[28px] flex items-center gap-1.5 svelte-1d6le8d" draggable="true"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg> <svg class="folder-icon w-3.5 h-3.5 text-text-tertiary shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg> <span class="directory-name text-text-primary text-xs truncate flex-1"> </span> <!></button> <!></div>'),zm=I('<span class="text-success-fg"> </span>'),qm=I('<span class="text-attention-fg"> </span>'),Gm=I('<span class="text-danger-fg"> </span>'),Km=I('<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M2 1.75C2 .784 2.784 0 3.75 0h5.586c.464 0 .909.184 1.237.513l2.914 2.914c.329.328.513.773.513 1.237v9.586A1.75 1.75 0 0112.25 16h-8.5A1.75 1.75 0 012 14.25V1.75zm1.75-.25a.25.25 0 00-.25.25v12.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V4.664a.25.25 0 00-.073-.177l-2.914-2.914a.25.25 0 00-.177-.073H3.75zM8 7.25a.75.75 0 01.75.75v1.25H10a.75.75 0 010 1.5H8.75V12a.75.75 0 01-1.5 0v-1.25H6a.75.75 0 010-1.5h1.25V8A.75.75 0 018 7.25zM6 4.25a.75.75 0 01.75-.75h2.5a.75.75 0 010 1.5h-2.5a.75.75 0 01-.75-.75z"></path></svg> <span class="mode-toggle-label svelte-1d6le8d"><!></span>',1),Jm=I('<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M2 2.75A.75.75 0 012.75 2h10.5a.75.75 0 010 1.5H2.75A.75.75 0 012 2.75zm0 5A.75.75 0 012.75 7h10.5a.75.75 0 010 1.5H2.75A.75.75 0 012 7.75zM2.75 12h10.5a.75.75 0 010 1.5H2.75a.75.75 0 010-1.5z"></path></svg> <span class="mode-toggle-label svelte-1d6le8d">All</span>',1),Qm=I('<div class="status-filter-dropdown svelte-1d6le8d"><button type="button"><span class="status-filter-option-check svelte-1d6le8d"><!></span> <span class="status-filter-option-label svelte-1d6le8d">All</span> <span class="status-filter-option-count svelte-1d6le8d"> </span></button> <button type="button"><span class="status-filter-option-check svelte-1d6le8d"><!></span> <span class="status-filter-option-label text-success-fg svelte-1d6le8d">Added (+)</span> <span class="status-filter-option-count svelte-1d6le8d"> </span></button> <button type="button"><span class="status-filter-option-check svelte-1d6le8d"><!></span> <span class="status-filter-option-label text-attention-fg svelte-1d6le8d">Modified (M)</span> <span class="status-filter-option-count svelte-1d6le8d"> </span></button> <button type="button"><span class="status-filter-option-check svelte-1d6le8d"><!></span> <span class="status-filter-option-label text-danger-fg svelte-1d6le8d">Deleted (-)</span> <span class="status-filter-option-count svelte-1d6le8d"> </span></button></div>'),Xm=I(`<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 w-4 h-4 flex items-center justify-center
214
+ text-text-tertiary hover:text-text-primary rounded" aria-label="Clear filter"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>`),Ym=I('<span class="text-[10px] text-text-tertiary whitespace-nowrap"> </span>'),Zm=I('<div class="empty-state flex flex-col items-center justify-center h-full p-8 text-center"><svg class="w-16 h-16 text-text-tertiary mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"></path></svg> <p class="text-text-secondary text-sm">No files to display</p></div>'),$m=I('<button type="button" class="w-5 h-5 flex items-center justify-center rounded transition-colors text-text-tertiary hover:text-text-primary shrink-0" title="Reload file tree" aria-label="Reload file tree"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 2.5a5.487 5.487 0 00-4.131 1.869l1.204 1.204A.25.25 0 014.896 6H1.25A.25.25 0 011 5.75V2.104a.25.25 0 01.427-.177l1.38 1.38A7.001 7.001 0 0114.95 7.16a.75.75 0 11-1.49.178A5.501 5.501 0 008 2.5zM1.705 8.005a.75.75 0 01.834.656 5.501 5.501 0 009.592 2.97l-1.204-1.204a.25.25 0 01.177-.427h3.646a.25.25 0 01.25.25v3.646a.25.25 0 01-.427.177l-1.38-1.38A7.001 7.001 0 011.05 8.84a.75.75 0 01.656-.834z"></path></svg></button>'),e0=I('<span class="text-[11px] text-attention-fg font-medium truncate min-w-0"> </span>'),t0=I('<button type="button" title="Narrow panel" aria-label="Narrow file tree panel"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M9.78 4.22a.75.75 0 010 1.06L7.56 7.5h6.69a.75.75 0 010 1.5H7.56l2.22 2.22a.75.75 0 11-1.06 1.06l-3.5-3.5a.75.75 0 010-1.06l3.5-3.5a.75.75 0 011.06 0zM2.75 3a.75.75 0 01.75.75v8.5a.75.75 0 01-1.5 0v-8.5A.75.75 0 012.75 3z"></path></svg></button>'),r0=I('<button type="button" title="Widen panel" aria-label="Widen file tree panel"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M6.22 4.22a.75.75 0 011.06 0l3.5 3.5a.75.75 0 010 1.06l-3.5 3.5a.75.75 0 01-1.06-1.06L8.44 9H1.75a.75.75 0 010-1.5h6.69L6.22 5.28a.75.75 0 010-1.06zM13.25 3a.75.75 0 01.75.75v8.5a.75.75 0 01-1.5 0v-8.5a.75.75 0 01.75-.75z"></path></svg></button>'),i0=rr('<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 2c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 010 1.798c-.45.678-1.367 1.932-2.637 3.023C11.67 13.008 9.981 14 8 14c-1.981 0-3.671-.992-4.933-2.078C1.797 10.831.88 9.577.43 8.899a1.62 1.62 0 010-1.798c.45-.678 1.367-1.932 2.637-3.023C4.33 2.992 6.019 2 8 2zM1.679 7.932a.12.12 0 000 .136c.411.622 1.241 1.75 2.366 2.717C5.176 11.758 6.527 12.5 8 12.5c1.473 0 2.825-.742 3.955-1.715 1.124-.967 1.954-2.096 2.366-2.717a.12.12 0 000-.136c-.412-.621-1.242-1.75-2.366-2.717C10.824 4.242 9.473 3.5 8 3.5c-1.473 0-2.824.742-3.955 1.715-1.124.967-1.954 2.096-2.366 2.717zM8 10a2 2 0 11-.001-3.999A2 2 0 018 10z"></path></svg>'),n0=rr('<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M.143 2.31a.75.75 0 011.047-.167l14 10a.75.75 0 11-.88 1.214l-2.248-1.606C11.346 12.076 10.259 12.5 9 12.5c-1.981 0-3.671-.992-4.933-2.078C2.797 9.331 1.88 8.077 1.43 7.399a1.62 1.62 0 010-1.798c.353-.533 1.063-1.46 2.025-2.347L.31 1.357A.75.75 0 01.143 2.31zm4.653 3.324c-.676.58-1.236 1.206-1.617 1.684a.12.12 0 000 .136c.412.621 1.242 1.75 2.366 2.717C6.676 11.258 8.027 12 9.5 12c.74 0 1.463-.214 2.145-.554L4.796 5.634zM16.57 7.399c-.45.678-1.367 1.932-2.637 3.023l-1.142-.816c1.03-.89 1.784-1.917 2.166-2.488a.12.12 0 000-.136c-.412-.621-1.242-1.75-2.366-2.717C11.46 3.242 10.11 2.5 8.636 2.5c-.96 0-1.886.28-2.748.747L4.667 2.37C5.734 1.712 6.887 1 8.636 1c1.981 0 3.671.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.62 1.62 0 010 1.798z"></path></svg>'),s0=I('<button type="button"><!></button>'),o0=rr('<line x1="12" y1="11" x2="12" y2="17"></line><line x1="9" y1="14" x2="15" y2="14"></line>',1),a0=I('<button type="button"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path><!></svg></button>'),l0=I(`<div class="file-tree flex flex-col h-full bg-bg-secondary svelte-1d6le8d" role="tree"><div class="px-2 py-1.5 border-b border-border-default flex items-center gap-1.5"><div class="status-filter-container relative flex-shrink-0 svelte-1d6le8d"><div class="flex items-center"><button type="button"><!></button> <button type="button" aria-label="Filter by status"><svg width="10" height="10" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"></path></svg></button></div> <!></div> <div class="relative flex-1"><svg class="absolute left-2 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-tertiary pointer-events-none" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg> <input type="text" class="w-full pl-7 pr-7 py-1 text-xs bg-bg-primary text-text-primary border border-border-default rounded
215
+ placeholder:text-text-tertiary focus:outline-none focus:ring-1 focus:ring-accent-emphasis focus:border-accent-emphasis" placeholder="Filter files..."/> <!></div> <!></div> <div class="file-tree-content flex-1 overflow-y-auto"><!></div> <div class="shrink-0 h-6 border-t border-border-default flex items-center px-2 bg-bg-tertiary gap-1 min-w-0 overflow-hidden"><!> <!> <div class="ml-auto flex items-center gap-0.5 shrink-0"><!> <!> <!> <!> <span class="w-px h-3 bg-border-default mx-0.5"></span> <button type="button" class="w-5 h-5 flex items-center justify-center text-text-tertiary hover:text-text-primary rounded transition-colors" title="Expand all" aria-label="Expand all directories"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M5.22 3.22a.75.75 0 011.06 0L8 4.94l1.72-1.72a.75.75 0 111.06 1.06l-2.25 2.25a.75.75 0 01-1.06 0L5.22 4.28a.75.75 0 010-1.06zm0 5a.75.75 0 011.06 0L8 9.94l1.72-1.72a.75.75 0 111.06 1.06l-2.25 2.25a.75.75 0 01-1.06 0L5.22 9.28a.75.75 0 010-1.06z"></path></svg></button> <button type="button" class="w-5 h-5 flex items-center justify-center text-text-tertiary hover:text-text-primary rounded transition-colors" title="Collapse all" aria-label="Collapse all directories"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M10.78 12.78a.75.75 0 01-1.06 0L8 11.06l-1.72 1.72a.75.75 0 01-1.06-1.06l2.25-2.25a.75.75 0 011.06 0l2.25 2.25a.75.75 0 010 1.06zm0-5a.75.75 0 01-1.06 0L8 6.06 6.28 7.78a.75.75 0 01-1.06-1.06l2.25-2.25a.75.75 0 011.06 0l2.25 2.25a.75.75 0 010 1.06z"></path></svg></button></div></div></div>`);function c0(t,e){Tt(e,!0);const i=(te,oe=ws,me=ws)=>{var Ie=et(),we=Ae(Ie);{var Re=Ye=>{var rt=Um();let ht;var _t=C(rt);_t.__click=()=>x(oe().path);var ct=C(_t);let kt;var It=R(ct,4),Ze=C(It),at=R(It,2);{var ft=it=>{var Et=Hm();A(it,Et)},mt=it=>{var Et=et(),Pt=Ae(Et);{var qt=Wt=>{var Lt=Vm();A(Wt,Lt)};H(Pt,Wt=>{D(oe())&&Wt(qt)},!0)}A(it,Et)};H(at,it=>{oe().status==="ignored"?it(ft):it(mt,!1)})}var xt=R(_t,2);{var pt=it=>{var Et=et(),Pt=Ae(Et);{var qt=Lt=>{var ue=et(),Ct=Ae(ue);At(Ct,17,()=>oe().children,Ht=>Ht.path,(Ht,Gt)=>{i(Ht,()=>r(Gt),()=>me()+1)}),A(Lt,ue)},Wt=Lt=>{var ue=et(),Ct=Ae(ue);{var Ht=Gt=>{var Nt=Wm();ee(()=>nr(Nt,`padding-left: ${1+(me()+1)*1.5}rem`)),A(Gt,Nt)};H(Ct,Gt=>{r(y).has(oe().path)&&Gt(Ht)},!0)}A(Lt,ue)};H(Pt,Lt=>{oe().children!==void 0?Lt(qt):Lt(Wt,!1)})}A(it,Et)};H(xt,it=>{X(oe().path)&&it(pt)})}ee((it,Et)=>{ht=Pe(rt,1,"directory-node",null,ht,{"opacity-50":oe().status==="ignored"}),ze(rt,"aria-expanded",it),nr(_t,`padding-left: ${1+me()*1.5}rem`),ze(_t,"aria-label",`Toggle directory ${oe().name??""}`),kt=Pe(ct,0,"chevron w-3 h-3 text-text-tertiary shrink-0 transition-transform svelte-1d6le8d",null,kt,Et),Y(Ze,oe().name)},[()=>X(oe().path),()=>({"rotate-90":X(oe().path)})]),Qt("dragstart",_t,it=>{var Et,Pt;(Et=it.dataTransfer)==null||Et.setData("application/x-qraftbox-path",oe().path),(Pt=it.dataTransfer)==null||Pt.setData("text/plain",oe().path)}),A(Ye,rt)},je=Ye=>{{let rt=ge(()=>e.selectedPath===oe().path);Fm(Ye,{get node(){return oe()},get depth(){return me()},get selected(){return r(rt)},onSelect:()=>e.onFileSelect(oe().path)})}};H(we,Ye=>{oe().isDirectory?Ye(Re):Ye(je,!1)})}A(te,Ie)},n=We(e,"changedCount",3,void 0),a=We(e,"contextId",3,null),v=We(e,"showIgnored",3,!1),_=We(e,"showAllFiles",3,!1),s=We(e,"onShowIgnoredChange",3,void 0),o=We(e,"onShowAllFilesChange",3,void 0),h=We(e,"onNarrow",3,void 0),g=We(e,"onWiden",3,void 0),c=We(e,"canNarrow",3,!0),p=We(e,"canWiden",3,!0),b=We(e,"onDirectoryExpand",3,void 0),w=We(e,"onLoadFullTree",3,void 0),m=We(e,"onReload",3,void 0);let u=K(gt(new Set)),l=K(""),d=K(null),f=K(!1),y=K(gt(new Set)),E=K(0);async function S(){if(!(a()===null||a()===void 0))try{const te=await fetch(`/api/ctx/${a()}/status`);if(te.ok){const oe=await te.json();k(E,oe.staged.length+oe.modified.length+oe.untracked.length+oe.conflicts.length)}}catch{}}let L=e.mode;St(()=>{e.mode!==L&&(e.mode==="all"&&k(d,null),L=e.mode)}),St(()=>{S();const te=setInterval(()=>{S()},3e4);return()=>{clearInterval(te)}});function x(te){const oe=new Set(r(u));if(oe.has(te))oe.delete(te),k(u,oe,!0);else if(oe.add(te),k(u,oe,!0),b()!==void 0){const me=P(e.tree,te);if(me!==null&&me.isDirectory&&me.children===void 0){const Ie=new Set(r(y));Ie.add(te),k(y,Ie,!0),b()(te).finally(()=>{const we=new Set(r(y));we.delete(te),k(y,we,!0)})}}}function P(te,oe){if(te.path===oe)return te;if(!te.isDirectory||te.children===void 0)return null;for(const me of te.children){const Ie=P(me,oe);if(Ie!==null)return Ie}return null}function B(te){if(te.isDirectory){if(te.children===void 0)return!0;for(const oe of te.children)if(B(oe))return!0}return!1}function j(te){const oe=[];if(te.isDirectory&&te.children){te.path!==""&&oe.push(te.path);for(const me of te.children)oe.push(...j(me))}return oe}async function V(){let te;w()!==void 0&&B(e.tree)&&(te=await w()());const oe=te??r(M)??e.tree;k(u,new Set(j(oe)),!0)}function N(){k(u,new Set,!0)}function X(te){return r(l)!==""?r(ne).has(te):r(u).has(te)}function W(te){if(r(l)==="")return!0;const oe=r(l).toLowerCase();return te.name.toLowerCase().includes(oe)}function Q(te,oe){const me=new Set;if(te.isDirectory&&te.children){if(W(te)){for(const Ie of oe)me.add(Ie);me.add(te.path)}for(const Ie of te.children){const we=Q(Ie,[...oe,te.path]);for(const Re of we)me.add(Re)}me.size>0&&me.add(te.path)}else if(W(te)){for(const Ie of oe)me.add(Ie);me.add(te.path)}return me}const ne=ge(()=>r(l)===""?new Set:Q(e.tree,[]));St(()=>{r(l)!==""&&B(e.tree)&&w()!==void 0&&w()()});function le(te,oe=!1){if(te.isDirectory){if(te.children===void 0||te.children.length===0)return e.mode==="diff"||r(l)!==""||r(d)!==null?null:te;const me=r(l)!==""&&W(te),Ie=oe||me,we=te.children.map(Re=>le(Re,Ie)).filter(Re=>Re!==null);return we.length===0?null:{...te,children:we}}else return e.mode==="diff"&&(te.status===void 0||te.status==="ignored")||r(d)!==null&&te.status!==r(d)||!oe&&r(l)!==""&&!W(te)?null:te}function D(te){if(!te.isDirectory)return!1;if(te.children===void 0)return te.status!==void 0;for(const oe of te.children)if(oe.status!==void 0||oe.isDirectory&&D(oe))return!0;return!1}function T(te){let oe=0,me=0;function Ie(we){if(we.isDirectory&&we.children)for(const Re of we.children)Ie(Re);else me++,we.status!==void 0&&oe++}return Ie(te),{changed:oe,total:me}}const M=ge(()=>le(e.tree)),z=ge(()=>{if(r(l)==="")return 0;function te(oe){let me=0;if(W(oe)&&(me=1),oe.isDirectory&&oe.children)for(const Ie of oe.children)me+=te(Ie);return me}return te(e.tree)}),J=ge(()=>T(e.tree)),Z=ge(()=>{let te=0,oe=0,me=0;function Ie(we){if(we.isDirectory&&we.children)for(const Re of we.children)Ie(Re);else we.status==="added"?te++:we.status==="modified"?oe++:we.status==="deleted"&&me++}return Ie(e.tree),{added:te,modified:oe,deleted:me}});let re=null,se=!1;St(()=>{const te=e.selectedPath;if(te===re||(re=te,te===null))return;if(!se){se=!0;return}const oe=te.split("/");if(oe.length<=1)return;const me=new Set(r(u));let Ie=!1;for(let we=1;we<oe.length;we++){const Re=oe.slice(0,we).join("/");me.has(Re)||(me.add(Re),Ie=!0)}Ie&&k(u,me,!0)}),St(()=>{if(!r(f))return;function te(oe){oe.target.closest(".status-filter-container")||k(f,!1)}return document.addEventListener("click",te),()=>{document.removeEventListener("click",te)}});var G=l0(),O=C(G),ie=C(O),F=C(ie),U=C(F);let $;U.__click=()=>e.onModeChange(e.mode==="diff"?"all":"diff");var be=C(U);{var xe=te=>{var oe=Km(),me=R(Ae(oe),2),Ie=C(me);{var we=je=>{var Ye=zm(),rt=C(Ye);ee(()=>Y(rt,`+${r(Z).added??""}`)),A(je,Ye)},Re=je=>{var Ye=et(),rt=Ae(Ye);{var ht=ct=>{var kt=qm(),It=C(kt);ee(()=>Y(It,`M${r(Z).modified??""}`)),A(ct,kt)},_t=ct=>{var kt=et(),It=Ae(kt);{var Ze=ft=>{var mt=Gm(),xt=C(mt);ee(()=>Y(xt,`-${r(Z).deleted??""}`)),A(ft,mt)},at=ft=>{var mt=Xt();ee(()=>Y(mt,n()??r(J).changed)),A(ft,mt)};H(It,ft=>{r(d)==="deleted"?ft(Ze):ft(at,!1)},!0)}A(ct,kt)};H(rt,ct=>{r(d)==="modified"?ct(ht):ct(_t,!1)},!0)}A(je,Ye)};H(Ie,je=>{r(d)==="added"?je(we):je(Re,!1)})}A(te,oe)},ae=te=>{var oe=Jm();A(te,oe)};H(be,te=>{e.mode==="diff"?te(xe):te(ae,!1)})}var he=R(U,2);let fe;he.__click=()=>k(f,!r(f));var Ee=R(F,2);{var He=te=>{var oe=Qm(),me=C(oe);let Ie;me.__click=()=>{k(d,null),k(f,!1)};var we=C(me),Re=C(we);{var je=Nt=>{var Ot=Xt("✓");A(Nt,Ot)};H(Re,Nt=>{r(d)===null&&Nt(je)})}var Ye=R(we,4),rt=C(Ye),ht=R(me,2);let _t;ht.__click=()=>{k(d,"added"),k(f,!1)};var ct=C(ht),kt=C(ct);{var It=Nt=>{var Ot=Xt("✓");A(Nt,Ot)};H(kt,Nt=>{r(d)==="added"&&Nt(It)})}var Ze=R(ct,4),at=C(Ze),ft=R(ht,2);let mt;ft.__click=()=>{k(d,"modified"),k(f,!1)};var xt=C(ft),pt=C(xt);{var it=Nt=>{var Ot=Xt("✓");A(Nt,Ot)};H(pt,Nt=>{r(d)==="modified"&&Nt(it)})}var Et=R(xt,4),Pt=C(Et),qt=R(ft,2);let Wt;qt.__click=()=>{k(d,"deleted"),k(f,!1)};var Lt=C(qt),ue=C(Lt);{var Ct=Nt=>{var Ot=Xt("✓");A(Nt,Ot)};H(ue,Nt=>{r(d)==="deleted"&&Nt(Ct)})}var Ht=R(Lt,4),Gt=C(Ht);ee(()=>{Ie=Pe(me,1,"status-filter-option svelte-1d6le8d",null,Ie,{"status-filter-option--active":r(d)===null}),Y(rt,r(J).changed),_t=Pe(ht,1,"status-filter-option svelte-1d6le8d",null,_t,{"status-filter-option--active":r(d)==="added"}),Y(at,r(Z).added),mt=Pe(ft,1,"status-filter-option svelte-1d6le8d",null,mt,{"status-filter-option--active":r(d)==="modified"}),Y(Pt,r(Z).modified),Wt=Pe(qt,1,"status-filter-option svelte-1d6le8d",null,Wt,{"status-filter-option--active":r(d)==="deleted"}),Y(Gt,r(Z).deleted)}),A(te,oe)};H(Ee,te=>{r(f)&&te(He)})}var Le=R(ie,2),ce=R(C(Le),2);ce.__keydown=te=>{te.key==="Escape"&&k(l,"")};var Te=R(ce,2);{var De=te=>{var oe=Xm();oe.__click=()=>{k(l,"")},A(te,oe)};H(Te,te=>{r(l)!==""&&te(De)})}var pe=R(Le,2);{var Be=te=>{var oe=Ym(),me=C(oe);ee(()=>Y(me,r(z))),A(te,oe)};H(pe,te=>{r(l)!==""&&te(Be)})}var Qe=R(O,2),Ne=C(Qe);{var Me=te=>{var oe=Zm();A(te,oe)},Fe=te=>{var oe=et(),me=Ae(oe);At(me,17,()=>r(M).children??[],Ie=>Ie.path,(Ie,we)=>{i(Ie,()=>r(we),()=>0)}),A(te,oe)};H(Ne,te=>{r(M)===null?te(Me):te(Fe,!1)})}var tt=R(Qe,2),Ve=C(tt);{var Xe=te=>{var oe=$m();oe.__click=function(...me){var Ie;(Ie=m())==null||Ie.apply(this,me)},A(te,oe)};H(Ve,te=>{m()&&te(Xe)})}var Ue=R(Ve,2);{var Je=te=>{var oe=e0(),me=C(oe);ee(()=>Y(me,`${r(E)??""} uncommitted`)),A(te,oe)};H(Ue,te=>{r(E)>0&&te(Je)})}var ve=R(Ue,2),_e=C(ve);{var Oe=te=>{var oe=t0();oe.__click=function(...me){var Ie;(Ie=h())==null||Ie.apply(this,me)},ee(()=>{Pe(oe,1,`w-5 h-5 flex items-center justify-center rounded transition-colors ${c()?"text-text-tertiary hover:text-text-primary cursor-pointer":"text-text-quaternary cursor-default"}`),oe.disabled=!c()}),A(te,oe)};H(_e,te=>{h()&&te(Oe)})}var Ke=R(_e,2);{var nt=te=>{var oe=r0();oe.__click=function(...me){var Ie;(Ie=g())==null||Ie.apply(this,me)},ee(()=>{Pe(oe,1,`w-5 h-5 flex items-center justify-center rounded transition-colors ${p()?"text-text-tertiary hover:text-text-primary cursor-pointer":"text-text-quaternary cursor-default"}`),oe.disabled=!p()}),A(te,oe)};H(Ke,te=>{g()&&te(nt)})}var $e=R(Ke,2);{var dt=te=>{var oe=s0();oe.__click=()=>{var Re;return(Re=s())==null?void 0:Re(!v())};var me=C(oe);{var Ie=Re=>{var je=i0();A(Re,je)},we=Re=>{var je=n0();A(Re,je)};H(me,Re=>{v()?Re(Ie):Re(we,!1)})}ee(()=>{Pe(oe,1,`w-5 h-5 flex items-center justify-center rounded transition-colors ${v()?"text-text-primary":"text-text-tertiary hover:text-text-primary"}`),ze(oe,"title",v()?"Hide ignored files":"Show ignored files"),ze(oe,"aria-label",v()?"Hide ignored files":"Show ignored files"),ze(oe,"aria-pressed",v())}),A(te,oe)};H($e,te=>{s()&&te(dt)})}var ut=R($e,2);{var bt=te=>{var oe=a0();oe.__click=()=>{var Re;return(Re=o())==null?void 0:Re(!_())};var me=C(oe),Ie=R(C(me));{var we=Re=>{var je=o0();A(Re,je)};H(Ie,Re=>{_()&&Re(we)})}ee(()=>{Pe(oe,1,`w-5 h-5 flex items-center justify-center rounded transition-colors ${_()?"text-text-primary":"text-text-tertiary hover:text-text-primary"}`),ze(oe,"title",_()?"Show git-managed files only":"Show all files (including non-git)"),ze(oe,"aria-label",_()?"Show git-managed files only":"Show all files (including non-git)"),ze(oe,"aria-pressed",_())}),A(te,oe)};H(ut,te=>{o()&&te(bt)})}var lt=R(ut,4);lt.__click=V;var ye=R(lt,2);ye.__click=N,ee(()=>{$=Pe(U,1,"mode-toggle-btn svelte-1d6le8d",null,$,{"mode-toggle-btn--diff":e.mode==="diff","mode-toggle-btn--filtered":r(d)!==null}),ze(U,"aria-label",e.mode==="diff"?`Diff only (${n()??r(J).changed} changed) - click for all`:"All files - click for diff only"),ze(U,"title",e.mode==="diff"?`Diff (${n()??r(J).changed})`:"All"),fe=Pe(he,1,"status-filter-arrow svelte-1d6le8d",null,fe,{"status-filter-arrow--open":r(f),"status-filter-arrow--filtered":r(d)!==null}),ze(he,"aria-expanded",r(f))}),Rr(ce,()=>r(l),te=>k(l,te)),A(t,G),Dt()}Ft(["click","keydown"]);var d0=I(`<span class="px-1.5 py-0.5 text-[10px] font-medium
216
+ bg-attention-emphasis/20 text-attention-fg rounded">Changed</span>`),u0=I('<span class="text-xs text-text-tertiary truncate block"> </span>'),h0=I('<button type="button" role="option"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg> <div class="flex-1 min-w-0"><div class="flex items-center gap-2"><span class="text-sm font-medium text-text-primary truncate"> </span> <!></div> <!></div></button>'),f0=I(`<div class="file-autocomplete relative z-[120] w-full max-w-md
217
+ bg-bg-primary border border-border-default rounded-lg shadow-lg
218
+ max-h-80 overflow-y-auto" role="listbox" aria-label="File suggestions"><!> <div class="px-3 py-2 text-xs text-text-tertiary bg-bg-tertiary border-t border-border-default"><span class="opacity-70">Tip: Use</span> <code class="px-1 py-0.5 bg-bg-secondary rounded">@file.ts:L10-L20</code> <span class="opacity-70">for line ranges</span></div></div>`);function v0(t,e){Tt(e,!0);const i=We(e,"contextId",3,null);let n=K(0),a=K(gt([])),v=0;function _(l){const d=l.match(/:L(\d+)(?:-L?(\d+))?$/);if(d!==null){const f=parseInt(d[1]??"1",10),y=d[2]!==void 0?parseInt(d[2],10):f;return{path:l.slice(0,d.index),lineRange:{start:f,end:y}}}return{path:l}}function s(l,d){if(d.length===0)return 1;const f=l.toLowerCase(),y=d.toLowerCase();if(f===y)return 100;if(f.includes(y))return 50+f.lastIndexOf(y)/f.length*40;let E=0,S=0,L=-1;for(let x=0;x<f.length&&S<y.length;x++)f[x]===y[S]&&(E+=1,L===x-1&&(E+=2),(x===0||f[x-1]==="/"||f[x-1]===".")&&(E+=3),L=x,S++);return S<y.length?0:E}function o(l){const d=l.split("/");return d[d.length-1]??l}function h(l){const d=l.split("/");return d.length<=1?"":d.slice(0,-1).join("/")}const g=ge(()=>{const{path:l}=_(e.query),d=i()!==null&&l.length>0&&r(a).length>0,f=d?r(a).map(S=>S.path):e.allFiles,y=new Set(e.changedFiles),E=[];for(const S of d?[]:e.changedFiles){const L=s(S,l);(L>0||l.length===0)&&E.push({path:S,score:L,isChanged:!0})}for(const S of f)if(!y.has(S)){const L=s(S,l);(L>0||l.length===0)&&E.push({path:S,score:L,isChanged:!1})}return E.sort((S,L)=>l.length===0&&S.isChanged!==L.isChanged?S.isChanged?-1:1:L.score-S.score),E.slice(0,10)});St(()=>{const{path:l}=_(e.query);if(!(e.visible&&i()!==null&&l.trim().length>0)){k(a,[],!0);return}const f=++v;(async()=>{try{const y=await Sh(i(),l,60);f===v&&k(a,y,!0)}catch{f===v&&k(a,[],!0)}})()}),St(()=>{r(g).length>0&&k(n,0)});function c(l){if(!(!e.visible||r(g).length===0))switch(l.key){case"ArrowDown":l.preventDefault(),k(n,(r(n)+1)%r(g).length);break;case"ArrowUp":l.preventDefault(),k(n,r(n)===0?r(g).length-1:r(n)-1,!0);break;case"Enter":l.preventDefault(),p(r(n));break;case"Escape":l.preventDefault(),e.onClose();break;case"Tab":l.preventDefault(),p(r(n));break}}function p(l){const d=r(g)[l];if(d===void 0)return;const{lineRange:f}=_(e.query);e.onSelect(d.path,f)}function b(l){p(l)}var w=et();Qt("keydown",ai,c);var m=Ae(w);{var u=l=>{var d=f0(),f=C(d);At(f,19,()=>r(g),y=>y.path,(y,E,S)=>{var L=h0();L.__click=()=>b(r(S));var x=C(L),P=R(x,2),B=C(P),j=C(B),V=C(j),N=R(j,2);{var X=ne=>{var le=d0();A(ne,le)};H(N,ne=>{r(E).isChanged&&ne(X)})}var W=R(B,2);{var Q=ne=>{var le=u0(),D=C(le);ee(T=>Y(D,T),[()=>h(r(E).path)]),A(ne,le)};H(W,ne=>{h(r(E).path)!==""&&ne(Q)})}ee(ne=>{Pe(L,1,`w-full px-3 py-3 min-h-[48px] text-left flex items-center gap-3
219
+ ${r(S)===r(n)?"bg-accent-muted border-l-2 border-l-accent-fg":"hover:bg-bg-hover"}
220
+ border-b border-border-default last:border-b-0
221
+ focus:outline-none`),ze(L,"aria-selected",r(S)===r(n)),Pe(x,0,`flex-shrink-0 ${r(E).isChanged?"text-attention-fg":"text-text-tertiary"}`),Y(V,ne)},[()=>o(r(E).path)]),A(y,L)}),A(l,d)};H(m,l=>{e.visible&&r(g).length>0&&l(u)})}A(t,w),Dt()}Ft(["click"]);const _0=/<(local-command-caveat|command-name|local-command-stdout|command-message|command-args|system-reminder)[^>]*>[\s\S]*?<\/\1>/g,p0=/<\/?qraftbox-system-prompt[^>]*>/g;function Ur(t){return t.replace(_0,"").replace(p0,"").replace(/\n{3,}/g,`
222
+
223
+ `).trim()}var g0=I('<div class="flex items-center justify-center py-8"><svg class="animate-spin h-5 w-5 text-accent-fg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></div>'),m0=I('<div class="p-4 text-center text-danger-fg text-sm"><p class="font-medium">Error loading sessions</p> <p class="text-xs text-text-tertiary mt-1"> </p></div>'),b0=I("<p> </p>"),y0=I("<p>No sessions found</p>"),x0=I('<div class="p-8 text-center text-text-tertiary text-sm"><!></div>'),w0=I("<span> </span> <span>&bull;</span>",1),S0=I('<span>&bull;</span> <span class="truncate"> </span>',1),C0=I(`<div class="flex items-center gap-2 px-3 py-2 hover:bg-bg-hover border-b border-border-default/50 last:border-b-0"><button type="button" class="shrink-0 px-2 py-0.5 text-[10px] font-medium rounded
224
+ bg-accent-muted/60 hover:bg-accent-muted text-accent-fg
225
+ border border-accent-emphasis/30 hover:border-accent-emphasis/60
226
+ transition-colors" title="Resume this session">Resume</button> <span> </span> <div class="flex-1 min-w-0"><p class="text-xs text-text-primary truncate"> </p> <div class="flex items-center gap-2 mt-0.5 text-[10px] text-text-tertiary"><!> <span> </span> <!></div></div></div>`),k0=I(`<div class="p-3 border-b border-border-default shrink-0"><div class="relative"><div class="absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none text-text-tertiary" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg></div> <input type="text" placeholder="Search sessions..." class="w-full pl-8 pr-3 py-1.5 text-sm rounded
227
+ bg-bg-secondary border border-border-default
228
+ text-text-primary placeholder-text-tertiary
229
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis" aria-label="Search sessions" autocomplete="off" spellcheck="false"/></div></div> <div class="flex-1 overflow-y-auto"><!></div>`,1);function md(t,e){Tt(e,!0);let i=K(""),n=K(null),a=K(""),v=K(gt([])),_=K(!1),s=K(null);async function o(E){if(e.contextId===null){k(s,"Context ID not available");return}k(_,!0),k(s,null);try{const S=new URLSearchParams({offset:"0",limit:"50",sortBy:"modified",sortOrder:"desc"});e.projectPath.length>0&&S.set("workingDirectoryPrefix",e.projectPath),E.length>0&&S.set("search",E);const L=await fetch(`/api/ctx/${e.contextId}/claude-sessions/sessions?${S.toString()}`);if(!L.ok){const P=await L.text();throw new Error(`Failed to fetch sessions: ${P}`)}const x=await L.json();k(v,x.sessions,!0)}catch(S){k(s,S instanceof Error?S.message:"Unknown error",!0),k(v,[],!0)}finally{k(_,!1)}}function h(E){const S=E.target;k(i,S.value,!0),r(n)!==null&&clearTimeout(r(n)),k(n,window.setTimeout(()=>{k(a,r(i),!0),o(r(i)),k(n,null)},300),!0)}function g(E){e.onResumeSession(E)}function c(E,S=80){const L=Ur(E).replaceAll(`
230
+ `," ");return L.length<=S?L:L.slice(0,S)+"..."}function p(E){const S=new Date(E),x=new Date().getTime()-S.getTime(),P=Math.floor(x/6e4),B=Math.floor(x/36e5),j=Math.floor(x/864e5);return P<1?"just now":P<60?`${P}m ago`:B<24?`${B}h ago`:j===1?"yesterday":`${j}d ago`}St(()=>{o("")});var b=k0(),w=Ae(b),m=C(w),u=R(C(m),2);u.__input=h;var l=R(w,2),d=C(l);{var f=E=>{var S=g0();A(E,S)},y=E=>{var S=et(),L=Ae(S);{var x=B=>{var j=m0(),V=R(C(j),2),N=C(V);ee(()=>Y(N,r(s))),A(B,j)},P=B=>{var j=et(),V=Ae(j);{var N=W=>{var Q=x0(),ne=C(Q);{var le=T=>{var M=b0(),z=C(M);ee(()=>Y(z,`No sessions found for "${r(a)??""}"`)),A(T,M)},D=T=>{var M=y0();A(T,M)};H(ne,T=>{r(a).length>0?T(le):T(D,!1)})}A(W,Q)},X=W=>{var Q=et(),ne=Ae(Q);At(ne,17,()=>r(v),le=>le.qraftAiSessionId,(le,D)=>{var T=C0(),M=C(T);M.__click=()=>g(r(D).qraftAiSessionId);var z=R(M,2),J=C(z),Z=R(z,2),re=C(Z),se=C(re),G=R(re,2),O=C(G);{var ie=xe=>{var ae=w0(),he=Ae(ae),fe=C(he);ee(()=>Y(fe,`${r(D).messageCount??""} msgs`)),A(xe,ae)};H(O,xe=>{r(D).messageCount>0&&xe(ie)})}var F=R(O,2),U=C(F),$=R(F,2);{var be=xe=>{var ae=S0(),he=R(Ae(ae),2),fe=C(he);ee(()=>Y(fe,r(D).model)),A(xe,ae)};H($,xe=>{r(D).model!==void 0&&xe(be)})}ee((xe,ae)=>{Pe(z,1,`shrink-0 px-1.5 py-0.5 text-[9px] font-medium rounded
231
+ ${r(D).source==="qraftbox"?"bg-accent-muted text-accent-fg":"bg-bg-tertiary text-text-tertiary"}`),Y(J,r(D).source==="qraftbox"?"QraftBox":"CLI"),Y(se,xe),Y(U,ae)},[()=>c(r(D).firstPrompt||r(D).summary),()=>p(r(D).modified)]),A(le,T)}),A(W,Q)};H(V,W=>{r(v).length===0?W(N):W(X,!1)},!0)}A(B,j)};H(L,B=>{r(s)!==null?B(x):B(P,!1)},!0)}A(E,S)};H(d,E=>{r(_)?E(f):E(y,!1)})}ee(()=>Xs(u,r(i))),A(t,b),Dt()}Ft(["input","click"]);var E0=I(`<button type="button" class="h-6 w-6 flex items-center justify-center
232
+ hover:bg-bg-hover rounded transition-colors duration-150
233
+ text-text-tertiary hover:text-text-primary
234
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis" title="New Session" aria-label="Create new session"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg></button>`),L0=I('<div class="z-[120] bg-bg-primary border border-border-default rounded-lg shadow-lg flex flex-col" role="dialog" aria-label="Session search"><!></div>'),P0=I('<span class="text-xs text-text-tertiary overflow-hidden text-ellipsis whitespace-nowrap max-w-xs" style="direction: rtl; text-align: left;"> </span>'),R0=rr('<line x1="4" y1="4" x2="20" y2="20"></line>'),A0=I("<option> </option>"),T0=I('<select class="rounded border border-border-default bg-bg-primary px-2 py-1 text-xs text-text-primary max-w-[180px]" aria-label="AI model profile"></select>'),D0=I('<span class="text-xs text-text-tertiary whitespace-nowrap"> </span>'),I0=I('<div class="mt-2 text-xs text-accent-fg">Drop files to attach to this prompt</div>'),M0=I('<span class="inline-flex items-center justify-center text-accent-fg" title="Attached file"><svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21.44 11.05 12.25 20.24a6 6 0 1 1-8.49-8.49l8.48-8.49a4 4 0 0 1 5.66 5.66l-8.49 8.48a2 2 0 1 1-2.83-2.83l7.78-7.78"></path></svg></span>'),O0=I('<span class="text-accent-fg"> </span>'),B0=I(`<span class="inline-flex items-center gap-1 px-2 py-1
235
+ bg-accent-muted text-accent-fg text-xs rounded"><span class="truncate max-w-[140px]"> </span> <!> <!> <button type="button" class="ml-1 hover:text-danger-fg" aria-label="Remove reference"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></span>`),N0=I('<div class="flex flex-wrap gap-2 mt-2"></div>'),j0=I('<div class="mt-2 text-xs text-danger-fg"> </div>'),F0=I('<button type="button"><span class="block truncate"> </span></button>'),H0=I('<div class="overflow-y-auto flex-1"></div>'),V0=I(`<div class="bg-bg-secondary border border-border-default rounded-lg shadow-lg z-50
236
+ flex flex-col"><button type="button">Save Draft</button> <!></div>`),W0=I('<button type="button" aria-label="More submit options" aria-haspopup="true"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"></polyline></svg></button>'),U0=I(`<div class="absolute bottom-full right-0 mb-1 w-48
237
+ bg-bg-secondary border border-border-default rounded-lg shadow-lg z-50"><button type="button" class="w-full px-3 py-2 text-left text-sm text-text-primary
238
+ hover:bg-bg-tertiary rounded-lg transition-colors duration-150
239
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis">Submit & Run Now</button></div>`),z0=I(`<div role="region" aria-label="AI Prompt Panel"><input type="file" class="hidden" multiple aria-label="Attach files to AI prompt"/> <div class="min-h-12 px-4 py-2 flex flex-wrap items-center justify-between gap-y-1 border-b border-border-default"><div class="flex items-center gap-3"><!> <button type="button" data-ai-search-button="" title="Search Sessions" aria-label="Search and browse sessions"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg></button> <!> <!> <button type="button" class="h-6 px-2 flex items-center gap-1
240
+ hover:bg-bg-hover rounded transition-colors duration-150
241
+ text-text-tertiary hover:text-text-primary
242
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9"></path><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"></path><!></svg> <span class="text-xs"> </span></button></div> <div class="flex items-center gap-2 sm:gap-3"><!> <button type="button" class="shrink-0 h-7 w-7 flex items-center justify-center text-text-secondary border border-border-default rounded
243
+ hover:bg-bg-hover transition-colors duration-150
244
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis" title="Attach files" aria-label="Attach files"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21.44 11.05 12.25 20.24a6 6 0 1 1-8.49-8.49l8.48-8.49a4 4 0 0 1 5.66 5.66l-8.49 8.48a2 2 0 1 1-2.83-2.83l7.78-7.78"></path></svg></button> <!></div></div> <div><div><div class="flex-1 relative flex flex-col min-w-0 min-h-0"><textarea placeholder="Ask AI about your code... (Use @ to reference files)" aria-label="AI prompt"></textarea> <div class="absolute z-[130] left-0 right-0 bottom-full mb-1 pointer-events-auto"><!></div> <!> <!> <!></div> <div><div class="draft-button-container relative"><button type="button" aria-label="Draft options" aria-haspopup="true"> </button> <!></div> <div class="split-button-container relative flex-1 flex flex-col"><div><button type="button">Submit</button> <!></div> <!></div></div></div></div></div>`);function q0(t,e){Tt(e,!0);const i=We(e,"isFirstMessage",3,!0),n=We(e,"modelProfiles",19,()=>[]),a=We(e,"selectedModelProfileId",3,void 0),v=We(e,"onSelectModelProfile",3,void 0);let _=K(""),s=K(!1),o=K(gt([])),h=K(!1),g=K(""),c=K(gt(ha()));const p="qraftbox-ai-prompt-drafts",b=50,w=8,m=100*1024*1024,u="upload/",l=new Set(["txt","md","markdown","json","yaml","yml","toml","xml","csv","tsv","ini","conf","log","js","jsx","ts","tsx","mjs","cjs","py","rb","go","rs","java","kt","swift","php","c","h","cc","cpp","hpp","cs","sh","bash","zsh","fish","sql","css","scss","less","html","htm","svelte","vue","graphql","gql","env"]);let d=K(!1),f=K(gt([])),y=K(!1),E=K(null),S=K(null),L=K(""),x=K(!1),P=K(null),B=K(null),j=K(!1),V=K(null),N=K("");function X(){const de=navigator.userAgent;return(/iPhone|iPod/i.test(de)||/Macintosh/i.test(de)&&"maxTouchPoints"in navigator&&navigator.maxTouchPoints>1)&&window.innerWidth<=430}St(()=>{const de=()=>{k(x,X(),!0)};return de(),window.addEventListener("resize",de),window.addEventListener("orientationchange",de),()=>{window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de)}});const W=ge(()=>r(x)?"flex flex-col gap-2 w-24":"flex flex-col gap-3 w-32"),Q=ge(()=>r(x)?"w-full min-h-[32px] text-xs":"w-full min-h-[36px] text-sm"),ne=ge(()=>r(x)?"flex-1 min-h-[36px] text-xs":"flex-1 min-h-[44px] text-sm"),le=ge(()=>r(x)?"px-1.5 min-h-[36px]":"px-2 min-h-[44px]");function D(){try{const de=localStorage.getItem(p);de!==null?k(f,JSON.parse(de),!0):k(f,[],!0)}catch{k(f,[],!0)}}function T(){localStorage.setItem(p,JSON.stringify(r(f)))}D();let M=null;const z=ge(()=>e.queueStatus.runningCount>0&&e.queueStatus.queuedCount>0?`${e.queueStatus.runningCount} running, ${e.queueStatus.queuedCount} queued`:e.queueStatus.runningCount>0?`${e.queueStatus.runningCount} running`:e.queueStatus.queuedCount>0?`${e.queueStatus.queuedCount} queued`:"");function J(de){const Ce=document.activeElement,st=(Ce==null?void 0:Ce.tagName)==="INPUT"||(Ce==null?void 0:Ce.tagName)==="TEXTAREA";if(de.key==="Escape"&&r(s)){de.preventDefault(),k(s,!1);return}if(de.key==="Escape"&&r(d)){de.preventDefault(),k(d,!1);return}if(de.key==="Escape"&&r(y)){de.preventDefault(),ie();return}st||de.key==="a"&&!de.ctrlKey&&!de.metaKey&&!de.altKey&&(de.preventDefault(),M==null||M.focus())}function Z(de){const Ce=de.target;r(s)&&!Ce.closest(".split-button-container")&&k(s,!1),r(d)&&!Ce.closest(".draft-button-container")&&k(d,!1),r(y)&&r(E)!==null&&!r(E).contains(Ce)&&Ce.closest("[data-ai-search-button]")===null&&ie()}function re(){if(r(S)===null){k(L,"");return}const de=r(S).getBoundingClientRect(),Ce=420,st=400,qe=Math.max(8,de.top-st-8),ot=Math.min(de.left,window.innerWidth-Ce-8);k(L,`position:fixed;top:${qe}px;left:${Math.max(8,ot)}px;width:${Ce}px;max-height:${st}px;`)}function se(){if(r(V)===null){k(N,"");return}const de=r(V).getBoundingClientRect(),Ce=256,st=288,qe=window.innerHeight-de.top+4,ot=Math.min(de.right-Ce,window.innerWidth-Ce-8);k(N,`position:fixed;bottom:${qe}px;left:${Math.max(8,ot)}px;width:${Ce}px;max-height:${st}px;`)}function G(){k(y,!r(y)),r(y)&&re()}function O(){const de=!r(c);k(c,de),Oh(de)}function ie(){k(y,!1)}function F(){ie(),k(s,!1),k(d,!1),k(h,!1)}function U(de){e.onResumeSession!==void 0&&(e.onResumeSession(de),ie())}function $(de){const Ce=de.target;k(_,Ce.value,!0);const st=Ce.selectionStart,ot=r(_).slice(0,st).match(/@([\w./-]*)$/);ot!==null?(k(h,!0),k(g,ot[1]??"",!0)):(k(h,!1),k(g,""))}function be(de,Ce){const st={path:de};Ce!==void 0?k(o,[...r(o),{...st,startLine:Ce.start,endLine:Ce.end}],!0):k(o,[...r(o),st],!0);const qe=r(_).length,wt=r(_).slice(0,qe).lastIndexOf("@");if(wt!==-1){const yt=Ce!==void 0?`:L${Ce.start}-L${Ce.end}`:"";k(_,r(_).slice(0,wt)+`@${de}${yt} `)}k(h,!1),k(g,"")}function xe(de){k(o,r(o).filter(Ce=>Ce.path!==de),!0)}function ae(de){return de.path.startsWith(u)}function he(de){return ae(de)?de.path.slice(u.length):`@${de.path}`}function fe(de){const Ce=new Set(r(o).map(ot=>ot.path));let st=`${u}${de}`,qe=2;for(;Ce.has(st);)st=`${u}${de} (${qe})`,qe+=1;return st}async function Ee(de){if(de.length===0)return;k(B,null);const Ce=r(o).filter(ae).length,st=Math.max(0,w-Ce);if(st<=0){k(B,`You can attach up to ${w} files.`);return}const qe=de.slice(0,st),ot=[],wt=[];for(const yt of qe){if(yt.size>m){wt.push(yt.name);continue}if(De(yt.type)||yt.type.length===0&&ce(yt.name)){const Kt=await yt.text();ot.push({path:fe(yt.name),content:Kt,fileName:yt.name,mimeType:yt.type.length>0?yt.type:"text/plain",encoding:"utf8",attachmentKind:"text"});continue}const Vt=new Uint8Array(await yt.arrayBuffer());ot.push({path:fe(yt.name),content:pe(Vt),fileName:yt.name,mimeType:yt.type.length>0?yt.type:Te(yt.name)??"application/octet-stream",encoding:"base64",attachmentKind:yt.type.startsWith("image/")?"image":"binary"})}if(ot.length>0&&k(o,[...r(o),...ot],!0),wt.length>0){k(B,`Some files were skipped (max ${Math.floor(m/(1024*1024))} MB each): ${wt.join(", ")}`);return}de.length>st&&k(B,`Only ${st} file${st!==1?"s":""} attached.`)}function He(){var de;k(B,null),(de=r(P))==null||de.click()}function Le(de){const Ce=de.target;Ce.files!==null&&Ee(Array.from(Ce.files)),Ce.value=""}function ce(de){const Ce=de.trim().toLowerCase(),st=Ce.lastIndexOf(".");if(st<=0||st===Ce.length-1)return!1;const qe=Ce.slice(st+1);return l.has(qe)}function Te(de){const Ce=de.toLowerCase();if(Ce.endsWith(".png"))return"image/png";if(Ce.endsWith(".jpg")||Ce.endsWith(".jpeg"))return"image/jpeg";if(Ce.endsWith(".gif"))return"image/gif";if(Ce.endsWith(".webp"))return"image/webp";if(Ce.endsWith(".svg"))return"image/svg+xml";if(Ce.endsWith(".pdf"))return"application/pdf"}function De(de){return de.length===0?!1:de.startsWith("text/")?!0:de==="application/json"||de==="application/xml"||de==="application/javascript"||de==="application/typescript"||de==="application/x-sh"||de==="application/x-httpd-php"}function pe(de){let Ce="";for(let qe=0;qe<de.length;qe+=32768){const ot=de.subarray(qe,qe+32768);Ce+=String.fromCharCode(...ot)}return btoa(Ce)}function Be(){k(h,!1),k(g,"")}function Qe(de){(de.ctrlKey||de.metaKey)&&de.key==="Enter"&&(de.preventDefault(),Ne()),de.key==="Escape"&&!r(h)&&(de.preventDefault(),M==null||M.blur(),F())}function Ne(){r(_).trim().length!==0&&(e.onSubmit(r(_),!1,r(o),a()),k(_,""),k(o,[],!0),k(s,!1))}function Me(){r(_).trim().length!==0&&(e.onSubmit(r(_),!0,r(o),a()),k(_,""),k(o,[],!0),k(s,!1))}function Fe(de){return`${de.name} (${de.vendor}/${de.model})`}function tt(){k(s,!r(s))}function Ve(){if(r(_).trim().length===0)return;const de={id:crypto.randomUUID(),prompt:r(_),fileRefs:[...r(o)],savedAt:new Date().toISOString()};k(f,[de,...r(f)],!0),T(),k(d,!1)}function Xe(de){const Ce=r(f).find(st=>st.id===de);Ce!==void 0&&(k(_,Ce.prompt,!0),k(o,Ce.fileRefs,!0),k(f,r(f).filter(st=>st.id!==de),!0),T(),k(d,!1))}function Ue(){k(d,!r(d)),r(d)&&se()}function Je(de){const Ce=de.prompt.replaceAll(`
245
+ `," ");return Ce.length<=b?Ce:Ce.slice(0,b)+"..."}function ve(de){var qe,ot;const Ce=((qe=de.dataTransfer)==null?void 0:qe.types.includes("application/x-qraftbox-path"))===!0,st=((ot=de.dataTransfer)==null?void 0:ot.types.includes("Files"))===!0;(Ce||st)&&(de.preventDefault(),de.dataTransfer!==null&&(de.dataTransfer.dropEffect="copy"),k(j,st))}function _e(de){var Ce;((Ce=de.dataTransfer)==null?void 0:Ce.types.includes("Files"))===!0&&(k(j,!0),de.preventDefault())}function Oe(de){de.currentTarget===de.target&&k(j,!1)}function Ke(de){var Yt,hr;k(j,!1);const Ce=(Yt=de.dataTransfer)==null?void 0:Yt.files;if(Ce!==void 0&&Ce.length>0){de.preventDefault(),Ee(Array.from(Ce));return}const st=((hr=de.dataTransfer)==null?void 0:hr.getData("application/x-qraftbox-path"))??"";if(st==="")return;de.preventDefault();const qe=`@${st}`,wt=de.target.selectionStart??r(_).length,yt=r(_).slice(0,wt),Rt=r(_).slice(wt);let Vt="",Kt="";yt.length>0&&!yt.endsWith(" ")&&!yt.endsWith(`
246
+ `)&&(Vt=" "),Rt.length>0&&!Rt.startsWith(" ")&&!Rt.startsWith(`
247
+ `)&&(Kt=" "),k(_,yt+Vt+qe+Kt+Rt)}function nt(de){M=de}var $e=z0();Qt("keydown",ai,J),Qt("click",ai,Z);var dt=C($e);dt.__change=Le,er(dt,de=>k(P,de),()=>r(P));var ut=R(dt,2),bt=C(ut),lt=C(bt);{var ye=de=>{var Ce=E0();Ce.__click=function(...st){var qe;(qe=e.onNewSession)==null||qe.apply(this,st)},A(de,Ce)};H(lt,de=>{e.onNewSession!==void 0&&de(ye)})}var te=R(lt,2);te.__click=G,er(te,de=>k(S,de),()=>r(S));var oe=R(te,2);{var me=de=>{var Ce=L0(),st=C(Ce);md(st,{get contextId(){return e.contextId},get projectPath(){return e.projectPath},onResumeSession:U,onClose:ie}),er(Ce,qe=>k(E,qe),()=>r(E)),ee(()=>nr(Ce,r(L))),A(de,Ce)};H(oe,de=>{r(y)&&de(me)})}var Ie=R(oe,2);{var we=de=>{var Ce=P0(),st=C(Ce);ee(()=>{ze(Ce,"title",e.projectPath),Y(st,`‎${e.projectPath??""}`)}),A(de,Ce)};H(Ie,de=>{e.projectPath&&de(we)})}var Re=R(Ie,2);Re.__click=O;var je=C(Re),Ye=R(C(je),2);{var rt=de=>{var Ce=R0();A(de,Ce)};H(Ye,de=>{r(c)||de(rt)})}var ht=R(je,2),_t=C(ht),ct=R(bt,2),kt=C(ct);{var It=de=>{var Ce=T0();Ce.__change=qe=>{var wt;const ot=qe.target;(wt=v())==null||wt(ot.value)},At(Ce,21,n,qe=>qe.id,(qe,ot)=>{var wt=A0(),yt=C(wt),Rt={};ee(Vt=>{Y(yt,Vt),Rt!==(Rt=r(ot).id)&&(wt.value=(wt.__value=r(ot).id)??"")},[()=>Fe(r(ot))]),A(qe,wt)});var st;xc(Ce),ee(()=>{st!==(st=a())&&(Ce.value=(Ce.__value=a())??"",da(Ce,a()))}),A(de,Ce)};H(kt,de=>{n().length>0&&de(It)})}var Ze=R(kt,2);Ze.__click=He;var at=R(Ze,2);{var ft=de=>{var Ce=D0(),st=C(Ce);ee(()=>Y(st,r(z))),A(de,Ce)};H(at,de=>{r(z)&&de(ft)})}var mt=R(ut,2),xt=C(mt),pt=C(xt),it=C(pt);it.__input=$,it.__keydown=Qe,er(it,de=>M=de,()=>M),Ks(()=>Rr(it,()=>r(_),de=>k(_,de))),th(it,de=>nt==null?void 0:nt(de));var Et=R(it,2),Pt=C(Et);v0(Pt,{get contextId(){return e.contextId},get query(){return r(g)},get changedFiles(){return e.changedFiles},get allFiles(){return e.allFiles},get visible(){return r(h)},onSelect:be,onClose:Be});var qt=R(Et,2);{var Wt=de=>{var Ce=I0();A(de,Ce)};H(qt,de=>{r(j)&&de(Wt)})}var Lt=R(qt,2);{var ue=de=>{var Ce=N0();At(Ce,21,()=>r(o),st=>st.path,(st,qe)=>{var ot=B0(),wt=C(ot),yt=C(wt),Rt=R(wt,2);{var Vt=Zt=>{var tr=M0();A(Zt,tr)};H(Rt,Zt=>{ae(r(qe))&&Zt(Vt)})}var Kt=R(Rt,2);{var Yt=Zt=>{var tr=O0(),fr=C(tr);ee(()=>Y(fr,`:L${r(qe).startLine??""}${r(qe).endLine!==r(qe).startLine?`-L${r(qe).endLine}`:""}`)),A(Zt,tr)};H(Kt,Zt=>{r(qe).startLine!==void 0&&Zt(Yt)})}var hr=R(Kt,2);hr.__click=()=>xe(r(qe).path),ee(Zt=>Y(yt,Zt),[()=>he(r(qe))]),A(st,ot)}),A(de,Ce)};H(Lt,de=>{r(o).length>0&&de(ue)})}var Ct=R(Lt,2);{var Ht=de=>{var Ce=j0(),st=C(Ce);ee(()=>Y(st,r(B))),A(de,Ce)};H(Ct,de=>{r(B)!==null&&de(Ht)})}var Gt=R(pt,2),Nt=C(Gt),Ot=C(Nt);Ot.__click=Ue;var ir=C(Ot);er(Ot,de=>k(V,de),()=>r(V));var Br=R(Ot,2);{var dr=de=>{var Ce=V0(),st=C(Ce);st.__click=Ve;var qe=R(st,2);{var ot=wt=>{var yt=H0();At(yt,23,()=>r(f),Rt=>Rt.id,(Rt,Vt,Kt)=>{var Yt=F0();Yt.__click=()=>Xe(r(Vt).id);var hr=C(Yt),Zt=C(hr);ee(tr=>{Pe(Yt,1,`w-full px-3 py-2 text-left text-sm text-text-primary
248
+ hover:bg-bg-tertiary
249
+ transition-colors duration-150
250
+ ${r(Kt)===r(f).length-1?"rounded-b-lg":""}`),Y(Zt,tr)},[()=>Je(r(Vt))]),A(Rt,Yt)}),A(wt,yt)};H(qe,wt=>{r(f).length>0&&wt(ot)})}ee(wt=>{nr(Ce,r(N)),st.disabled=wt,Pe(st,1,`shrink-0 w-full px-3 py-2 text-left text-sm text-text-primary
251
+ hover:bg-bg-tertiary
252
+ border-b border-border-default
253
+ disabled:opacity-50 disabled:cursor-not-allowed
254
+ transition-colors duration-150
255
+ ${r(f).length===0?"rounded-lg":"rounded-t-lg"}`)},[()=>r(_).trim().length===0]),A(de,Ce)};H(Br,de=>{r(d)&&de(dr)})}var ur=R(Nt,2),Sr=C(ur),Cr=C(Sr);Cr.__click=Ne;var ti=R(Cr,2);{var ci=de=>{var Ce=W0();Ce.__click=tt,ee(st=>{Ce.disabled=st,Pe(Ce,1,`${r(le)??""}
256
+ bg-success-emphasis hover:brightness-110
257
+ text-white rounded-r
258
+ border-l border-white/20
259
+ disabled:opacity-50 disabled:cursor-not-allowed
260
+ transition-all duration-150
261
+ focus:outline-none focus:ring-2 focus:ring-success-emphasis`),ze(Ce,"aria-expanded",r(s))},[()=>r(_).trim().length===0]),A(de,Ce)};H(ti,de=>{i()&&de(ci)})}var qr=R(Sr,2);{var Nr=de=>{var Ce=et(),st=Ae(Ce);{var qe=ot=>{var wt=U0(),yt=C(wt);yt.__click=Me,A(ot,wt)};H(st,ot=>{r(s)&&ot(qe)})}A(de,Ce)};H(qr,de=>{i()&&de(Nr)})}ee(de=>{Pe($e,1,`ai-prompt-panel bg-bg-secondary border-t border-border-default
262
+ ${r(x)?"shrink-0":"flex-1 min-h-0"} flex flex-col`),Pe(te,1,`h-6 w-6 flex items-center justify-center
263
+ hover:bg-bg-hover rounded transition-colors duration-150
264
+ text-text-tertiary hover:text-text-primary
265
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis
266
+ ${r(y)?"bg-bg-hover text-text-primary":""}`),ze(te,"aria-expanded",r(y)),ze(Re,"title",r(c)?"AI completion notifications: on":"AI completion notifications: off"),ze(Re,"aria-label",r(c)?"Disable AI completion notifications":"Enable AI completion notifications"),Y(_t,r(c)?"Notify on":"Notify off"),Pe(mt,1,`${r(x)?"shrink-0":"flex-1 min-h-0"} p-4 flex flex-col overflow-visible`),Pe(xt,1,`${r(x)?"shrink-0":"flex-1 min-h-0"} flex gap-3`),Pe(it,1,`${r(x)?"h-20":"flex-1"} w-full px-3 py-2
267
+ bg-bg-primary text-text-primary text-sm
268
+ border border-border-default rounded
269
+ placeholder:text-text-tertiary
270
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis focus:border-accent-emphasis
271
+ ${r(j)?"ring-2 ring-accent-emphasis border-accent-emphasis":""}
272
+ resize-none`),Pe(Gt,1,Pi(r(W))),Pe(Ot,1,`${r(Q)??""}
273
+ bg-bg-tertiary hover:bg-bg-hover
274
+ text-text-secondary font-medium rounded
275
+ border border-border-default
276
+ transition-all duration-150
277
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis`),ze(Ot,"aria-expanded",r(d)),Y(ir,`Draft${r(f).length>0?` (${r(f).length})`:""}`),Pe(Sr,1,Pi(r(x)?"flex min-h-[36px]":"flex min-h-[44px]")),Cr.disabled=de,Pe(Cr,1,`${r(ne)??""}
278
+ bg-success-emphasis hover:brightness-110
279
+ text-white font-medium
280
+ ${i()?"rounded-l":"rounded"}
281
+ disabled:opacity-50 disabled:cursor-not-allowed
282
+ transition-all duration-150
283
+ focus:outline-none focus:ring-2 focus:ring-success-emphasis`)},[()=>r(_).trim().length===0]),Qt("dragenter",it,_e),Qt("dragleave",it,Oe),Qt("dragover",it,ve),Qt("drop",it,Ke),A(t,$e),Dt()}Ft(["change","click","input","keydown"]);var G0=I('<div class="flex items-center gap-0.5"><button type="button" class="w-6 h-6 flex items-center justify-center rounded hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary disabled:opacity-30 disabled:cursor-not-allowed transition-colors" aria-label="Previous message" title="Previous message"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></button> <button type="button" class="w-6 h-6 flex items-center justify-center rounded hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary disabled:opacity-30 disabled:cursor-not-allowed transition-colors" aria-label="Next message" title="Next message"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></button> <button type="button" class="w-6 h-6 flex items-center justify-center rounded hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary disabled:opacity-30 disabled:cursor-not-allowed transition-colors" aria-label="Jump to first message" title="Jump to first message"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="11 17 6 12 11 7"></polyline><polyline points="18 17 13 12 18 7"></polyline></svg></button> <button type="button" class="w-6 h-6 flex items-center justify-center rounded hover:bg-bg-tertiary text-text-tertiary hover:text-text-primary disabled:opacity-30 disabled:cursor-not-allowed transition-colors" aria-label="Jump to last message" title="Jump to last message"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="13 17 18 12 13 7"></polyline><polyline points="6 17 11 12 6 7"></polyline></svg></button></div>'),K0=I('<div class="flex items-center justify-center gap-2 mb-3"><div class="flex bg-bg-tertiary rounded-md p-0.5"><button type="button">Chat</button> <button type="button">Carousel</button></div> <!></div>'),J0=I('<div class="flex items-center justify-center py-12"><div class="flex items-center gap-2 text-text-tertiary"><svg class="animate-spin h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="text-sm">Loading transcript...</span></div></div>'),Q0=I('<div class="flex items-center justify-center py-12"><div class="max-w-md p-4 bg-danger-muted border border-danger-emphasis rounded-lg"><h3 class="text-sm font-semibold text-danger-fg mb-2">Error loading transcript</h3> <p class="text-sm text-text-secondary"> </p></div></div>'),X0=I('<div class="flex items-center justify-center py-12"><p class="text-sm text-text-tertiary">No user or assistant messages found</p></div>'),Y0=rr('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-success-fg" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>'),Z0=rr('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>'),$0=I('<button type="button" class="mt-2 text-xs text-accent-fg hover:underline"> </button>'),e1=I(`<div><div class="px-3 py-1.5 flex items-center justify-between"><span> </span> <div class="flex items-center gap-2"><span class="text-xs text-text-tertiary"> </span> <button type="button" class="p-0.5 hover:bg-bg-hover rounded transition-colors
284
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis" aria-label="Copy message to clipboard" title="Copy to clipboard"><!></button></div></div> <div class="px-3 py-2"><div class="text-xs font-mono whitespace-pre-wrap break-words text-text-primary"><!></div> <!></div></div>`),t1=I('<div class="border-l-4 border-accent-emphasis bg-bg-secondary rounded-r"><div class="px-3 py-1.5 flex items-center justify-between"><span class="text-xs font-semibold px-2 py-0.5 rounded bg-accent-muted text-accent-fg">user (pending)</span></div> <div class="px-3 py-2"><div class="text-xs font-mono whitespace-pre-wrap break-words text-text-primary"> </div></div></div>'),r1=I('<div class="border-l-4 border-success-emphasis bg-bg-secondary rounded-r"><div class="px-3 py-1.5 flex items-center justify-between"><span class="text-xs font-semibold px-2 py-0.5 rounded bg-success-muted text-success-fg">assistant (live)</span></div> <div class="px-3 py-2"><div class="text-xs font-mono whitespace-pre-wrap break-words text-text-primary"> </div></div></div>'),i1=I("<div><!> <!> <!></div>"),n1=rr('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-success-fg" aria-hidden="true"><polyline points="20 6 9 17 4 12"></polyline></svg>'),s1=rr('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>'),o1=I(`<button type="button"><div><div class="flex items-center justify-between mb-3"><span> </span> <div class="flex items-center gap-2"><span class="text-xs text-text-tertiary"> </span> <div role="button" tabindex="0" class="p-0.5 hover:bg-bg-hover rounded transition-colors cursor-pointer
285
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis" aria-label="Copy message to clipboard" title="Copy to clipboard"><!></div></div></div> <div class="max-h-[300px] overflow-y-auto text-xs font-mono whitespace-pre-wrap break-words text-text-primary"> </div></div></button>`),a1=I(`<div class="relative min-h-[200px]"><button type="button" class="absolute left-1 top-1/2 -translate-y-1/2 z-10
286
+ w-8 h-8 flex items-center justify-center rounded-full
287
+ bg-bg-tertiary/80 hover:bg-bg-hover text-text-secondary hover:text-text-primary
288
+ disabled:opacity-30 disabled:cursor-not-allowed
289
+ transition-all shadow-sm" aria-label="Previous message"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></button> <button type="button" class="absolute right-1 top-1/2 -translate-y-1/2 z-10
290
+ w-8 h-8 flex items-center justify-center rounded-full
291
+ bg-bg-tertiary/80 hover:bg-bg-hover text-text-secondary hover:text-text-primary
292
+ disabled:opacity-30 disabled:cursor-not-allowed
293
+ transition-all shadow-sm" aria-label="Next message"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></button> <div class="overflow-hidden select-none"><div class="flex gap-3 transition-transform duration-300 ease-in-out"></div></div> <div class="text-xs text-text-tertiary text-center mt-2"> </div></div>`),l1=I("<div><!> <!></div>");function bd(t,e){Tt(e,!0);const i=We(e,"maxMessages",3,void 0),n=We(e,"autoRefreshMs",3,0),a=We(e,"followLatest",3,!1),v=We(e,"optimisticUserMessage",3,void 0),_=We(e,"optimisticAssistantMessage",3,void 0),s="qraftbox:session-transcript-view-mode";function o(){try{const ce=localStorage.getItem(s);if(ce==="chat"||ce==="carousel")return ce}catch{}return"chat"}let h=K(gt({status:"idle"})),g=K(gt(o())),c=K(0),p=K(gt(new Set)),b=K(null),w=K(null);async function m(ce,Te){try{await navigator.clipboard.writeText(ce),k(w,Te,!0),setTimeout(()=>{k(w,null)},1500)}catch{}}const u=ge(()=>r(h).status==="success"?r(h).data.filter(ce=>!(ce.type!=="user"&&ce.type!=="assistant"||V(ce).trim().length===0)):[]),l=ge(()=>i()!==void 0&&r(u).length>i()?r(u).slice(-i()):r(u)),d=ge(()=>i()!==void 0);function f(ce){return Ur(ce).replace(/\s+/g," ").trim()}const y=ge(()=>f(v()??"")),E=ge(()=>f(_()??"")),S=ge(()=>{const ce=new Set;for(const Te of r(l)){const De=f(V(Te));De.length>0&&ce.add(De)}return ce}),L=ge(()=>r(y).length>0&&!r(S).has(r(y))),x=ge(()=>r(E).length>0&&!r(S).has(r(E))),P=ge(()=>(r(L)?1:0)+(r(x)?1:0)),B=ge(()=>(v()??"").length>0||(_()??"").length>0);async function j(ce){const Te=(ce==null?void 0:ce.silent)===!0;Te||k(h,{status:"loading"},!0);try{const De=await fetch(`/api/ctx/${e.contextId}/claude-sessions/sessions/${e.sessionId}/transcript?limit=1000`);if(!De.ok){const Be=await De.json();if(Te&&r(h).status==="success"||Te&&r(h).status==="error")return;k(h,{status:"error",error:Be.error??"Failed to fetch transcript"},!0);return}const pe=await De.json();k(h,{status:"success",data:pe.events,total:pe.total},!0)}catch(De){if(Te&&(r(h).status==="success"||r(h).status==="error"))return;k(h,{status:"error",error:De instanceof Error?De.message:"Unknown error occurred"},!0)}}St(()=>{try{localStorage.setItem(s,r(g))}catch{}}),St(()=>{j()}),St(()=>{if(n()<=0)return;const ce=setInterval(()=>{j({silent:!0})},n());return()=>clearInterval(ce)}),St(()=>{r(g)==="carousel"&&r(l).length>0&&k(c,r(l).length-1)}),St(()=>{if(r(g)==="chat"&&r(h).status==="success"&&r(b)!==null){r(P);const ce=r(b);a()&&requestAnimationFrame(()=>{ce.scrollTop=ce.scrollHeight})}});function V(ce){return Ur(N(ce))}function N(ce){const Te=ce.raw;if(ce.type==="user"||ce.type==="assistant"){const De=Te.message;if(De!==void 0){const pe=De.content;if(typeof pe=="string")return pe;if(Array.isArray(pe))return X(pe)}}if(ce.type==="tool_use"){const De=typeof Te.name=="string"?Te.name:"unknown",pe=Te.input;return`Tool: ${De}
294
+ ${pe!==void 0?JSON.stringify(pe,null,2):""}`}if(ce.type==="tool_result"){const De=Te.content;if(typeof De=="string")return De;if(De!==void 0)return JSON.stringify(De,null,2)}if(ce.type==="summary"){const De=Te.summary;if(typeof De=="string")return De}return ce.content!==void 0&&ce.content!==null?typeof ce.content=="string"?ce.content:JSON.stringify(ce.content,null,2):""}function X(ce){const Te=[];for(const De of ce)if(typeof De=="string")Te.push(De);else if(typeof De=="object"&&De!==null&&"type"in De){const pe=De;if(pe.type==="text"&&typeof pe.text=="string")Te.push(pe.text);else if(pe.type==="tool_use"){const Be=typeof pe.name=="string"?pe.name:"unknown";Te.push(`[Tool: ${Be}]`)}else if(pe.type==="tool_result"){const Be=pe.content;typeof Be=="string"&&Te.push(Be)}}return Te.join(`
295
+
296
+ `)}function W(ce){switch(ce){case"user":return"border-accent-emphasis";case"assistant":return"border-success-emphasis";default:return"border-border-muted"}}function Q(ce){switch(ce){case"user":return"bg-accent-muted text-accent-fg";case"assistant":return"bg-success-muted text-success-fg";default:return"bg-bg-tertiary text-text-tertiary"}}function ne(ce){if(ce===void 0)return"";try{return new Date(ce).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return ce}}function le(ce,Te){return ce.uuid??`${ce.type}-${Te}`}function D(ce){return ce.length>500||ce.split(`
297
+ `).length>15}function T(ce){const Te=new Set(r(p));Te.has(ce)?Te.delete(ce):Te.add(ce),k(p,Te,!0)}function M(){r(c)>0&&k(c,r(c)-1)}function z(){r(c)<r(l).length-1&&k(c,r(c)+1)}function J(ce){k(c,ce,!0)}function Z(){r(g)==="carousel"?k(c,0):r(b)!==null&&(r(b).scrollTop=0)}function re(){r(g)==="carousel"?k(c,r(l).length-1):r(b)!==null&&(r(b).scrollTop=r(b).scrollHeight)}let se=K(null),G=K(!1);const O=50;function ie(ce){const Te=ce.touches[0];Te!==void 0&&k(se,Te.clientX,!0)}function F(ce){if(r(se)===null)return;const Te=ce.changedTouches[0];if(Te===void 0)return;const De=r(se)-Te.clientX;De>O?z():De<-O&&M(),k(se,null)}function U(ce){ce.pointerType!=="touch"&&(k(se,ce.clientX,!0),k(G,!0))}function $(ce){r(G)&&ce.preventDefault()}function be(ce){if(!r(G)||r(se)===null)return;const Te=r(se)-ce.clientX;Te>O?z():Te<-O&&M(),k(se,null),k(G,!1)}function xe(ce){r(g)==="carousel"&&(ce.key==="ArrowLeft"?(ce.preventDefault(),M()):ce.key==="ArrowRight"?(ce.preventDefault(),z()):ce.key==="Home"?(ce.preventDefault(),Z()):ce.key==="End"&&(ce.preventDefault(),re()))}var ae=l1();Qt("keydown",ai,xe);var he=C(ae);{var fe=ce=>{var Te=K0(),De=C(Te),pe=C(De);pe.__click=()=>k(g,"chat");var Be=R(pe,2);Be.__click=()=>k(g,"carousel");var Qe=R(De,2);{var Ne=Me=>{var Fe=G0(),tt=C(Fe);tt.__click=M;var Ve=R(tt,2);Ve.__click=z;var Xe=R(Ve,2);Xe.__click=Z;var Ue=R(Xe,2);Ue.__click=re,ee(()=>{tt.disabled=r(c)===0,Ve.disabled=r(c)>=r(l).length-1,Xe.disabled=r(c)===0,Ue.disabled=r(c)>=r(l).length-1}),A(Me,Fe)};H(Qe,Me=>{r(l).length>0&&Me(Ne)})}ee(()=>{Pe(pe,1,`px-3 py-1 text-xs font-medium rounded transition-all ${r(g)==="chat"?"bg-bg-primary text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`),ze(pe,"aria-pressed",r(g)==="chat"),Pe(Be,1,`px-3 py-1 text-xs font-medium rounded transition-all ${r(g)==="carousel"?"bg-bg-primary text-text-primary shadow-sm":"text-text-secondary hover:text-text-primary"}`),ze(Be,"aria-pressed",r(g)==="carousel")}),A(ce,Te)};H(he,ce=>{r(d)||ce(fe)})}var Ee=R(he,2);{var He=ce=>{var Te=J0();A(ce,Te)},Le=ce=>{var Te=et(),De=Ae(Te);{var pe=Qe=>{var Ne=Q0(),Me=C(Ne),Fe=R(C(Me),2),tt=C(Fe);ee(()=>Y(tt,r(h).error)),A(Qe,Ne)},Be=Qe=>{var Ne=et(),Me=Ae(Ne);{var Fe=tt=>{var Ve=et(),Xe=Ae(Ve);{var Ue=ve=>{var _e=X0();A(ve,_e)},Je=ve=>{var _e=et(),Oe=Ae(_e);{var Ke=$e=>{var dt=i1(),ut=C(dt);At(ut,19,()=>r(l),(oe,me)=>le(oe,me),(oe,me,Ie)=>{const we=ge(()=>le(r(me),r(Ie))),Re=ge(()=>V(r(me))),je=ge(()=>D(r(Re))),Ye=ge(()=>r(p).has(r(we)));var rt=e1(),ht=C(rt),_t=C(ht),ct=C(_t),kt=R(_t,2),It=C(kt),Ze=C(It),at=R(It,2);at.__click=ue=>{ue.stopPropagation(),m(r(Re),r(we))};var ft=C(at);{var mt=ue=>{var Ct=Y0();A(ue,Ct)},xt=ue=>{var Ct=Z0();A(ue,Ct)};H(ft,ue=>{r(w)===r(we)?ue(mt):ue(xt,!1)})}var pt=R(ht,2),it=C(pt),Et=C(it);{var Pt=ue=>{var Ct=Xt();ee(Ht=>Y(Ct,`${Ht??""}...`),[()=>r(Re).slice(0,500)]),A(ue,Ct)},qt=ue=>{var Ct=Xt();ee(()=>Y(Ct,r(Re))),A(ue,Ct)};H(Et,ue=>{r(je)&&!r(Ye)?ue(Pt):ue(qt,!1)})}var Wt=R(it,2);{var Lt=ue=>{var Ct=$0();Ct.__click=()=>T(r(we));var Ht=C(Ct);ee(()=>Y(Ht,r(Ye)?"Show less":"Show more")),A(ue,Ct)};H(Wt,ue=>{r(je)&&ue(Lt)})}ee((ue,Ct,Ht)=>{Pe(rt,1,`border-l-4 ${ue??""} bg-bg-secondary rounded-r`),Pe(_t,1,`text-xs font-semibold px-2 py-0.5 rounded ${Ct??""}`),Y(ct,r(me).type),Y(Ze,Ht)},[()=>W(r(me).type),()=>Q(r(me).type),()=>ne(r(me).timestamp)]),A(oe,rt)});var bt=R(ut,2);{var lt=oe=>{var me=t1(),Ie=R(C(me),2),we=C(Ie),Re=C(we);ee(je=>Y(Re,je),[()=>Ur(v()??"")]),A(oe,me)};H(bt,oe=>{r(L)&&oe(lt)})}var ye=R(bt,2);{var te=oe=>{var me=r1(),Ie=R(C(me),2),we=C(Ie),Re=C(we);ee(je=>Y(Re,je),[()=>Ur(_()??"")]),A(oe,me)};H(ye,oe=>{r(x)&&oe(te)})}er(dt,oe=>k(b,oe),()=>r(b)),ee(()=>Pe(dt,1,`${r(d)?"max-h-[120px]":"max-h-[600px]"} overflow-y-auto space-y-1.5`)),A($e,dt)},nt=$e=>{var dt=et(),ut=Ae(dt);{var bt=lt=>{var ye=a1(),te=C(ye);te.__click=M;var oe=R(te,2);oe.__click=z;var me=R(oe,2);me.__touchstart=ie,me.__touchend=F,me.__pointerdown=U,me.__pointermove=$,me.__pointerup=be;var Ie=C(me);At(Ie,23,()=>r(l),(je,Ye)=>le(je,Ye),(je,Ye,rt)=>{const ht=ge(()=>V(r(Ye))),_t=ge(()=>r(rt)===r(c));var ct=o1();ct.__click=()=>J(r(rt));var kt=C(ct),It=C(kt),Ze=C(It),at=C(Ze),ft=R(Ze,2),mt=C(ft),xt=C(mt),pt=R(mt,2);pt.__click=Lt=>{Lt.stopPropagation(),m(r(ht),le(r(Ye),r(rt)))},pt.__keydown=Lt=>{(Lt.key==="Enter"||Lt.key===" ")&&(Lt.preventDefault(),Lt.stopPropagation(),m(r(ht),le(r(Ye),r(rt))))};var it=C(pt);{var Et=Lt=>{var ue=n1();A(Lt,ue)},Pt=Lt=>{var ue=s1();A(Lt,ue)};H(it,Lt=>{r(w)===le(r(Ye),r(rt))?Lt(Et):Lt(Pt,!1)})}var qt=R(It,2),Wt=C(qt);ee((Lt,ue)=>{Pe(ct,1,`w-[45%] shrink-0 text-left transition-all duration-300
298
+ ${r(_t)?"opacity-100 scale-100":"opacity-40 scale-95"}`),ze(ct,"aria-label",`Message ${r(rt)+1}: ${r(Ye).type??""}`),Pe(kt,1,`rounded-lg border bg-bg-secondary p-4 shadow-sm h-full
299
+ ${r(_t)?"border-accent-emphasis/40":"border-border-default"}`),Pe(Ze,1,`text-xs font-semibold px-2 py-0.5 rounded ${Lt??""}`),Y(at,r(Ye).type),Y(xt,ue),Y(Wt,r(ht))},[()=>Q(r(Ye).type),()=>ne(r(Ye).timestamp)]),A(je,ct)});var we=R(me,2),Re=C(we);ee(()=>{te.disabled=r(c)===0,oe.disabled=r(c)===r(l).length-1,nr(Ie,`transform: translateX(calc(27.5% - ${r(c)*45}% - ${r(c)*12}px))`),Y(Re,`${r(c)+1} / ${r(l).length??""}`)}),Qt("pointerleave",me,be),A(lt,ye)};H(ut,lt=>{r(g)==="carousel"&&lt(bt)},!0)}A($e,dt)};H(Oe,$e=>{r(g)==="chat"||r(l).length===0&&r(B)?$e(Ke):$e(nt,!1)},!0)}A(ve,_e)};H(Xe,ve=>{r(l).length===0&&!r(B)?ve(Ue):ve(Je,!1)})}A(tt,Ve)};H(Me,tt=>{(r(h).status==="success"||r(B))&&tt(Fe)},!0)}A(Qe,Ne)};H(De,Qe=>{r(h).status==="error"&&!r(B)?Qe(pe):Qe(Be,!1)},!0)}A(ce,Te)};H(Ee,ce=>{r(h).status==="loading"&&!r(B)?ce(He):ce(Le,!1)})}ee(()=>Pe(ae,1,`session-transcript-inline ${r(d)?"px-4 py-1.5":"px-4 py-3"}`)),A(t,ae),Dt()}Ft(["click","touchstart","touchend","pointerdown","pointermove","pointerup","keydown"]);var c1=I('<button type="button" class="shrink-0 p-0.5 rounded hover:bg-danger-subtle text-text-tertiary hover:text-danger-fg transition-colors svelte-1l48mn0" title="Cancel queued prompt" aria-label="Cancel queued prompt"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1l48mn0"><line x1="18" y1="6" x2="6" y2="18" class="svelte-1l48mn0"></line><line x1="6" y1="6" x2="18" y2="18" class="svelte-1l48mn0"></line></svg></button>'),d1=I('<div><span class="text-text-tertiary shrink-0 w-4 text-right font-mono svelte-1l48mn0"> </span> <span class="text-text-secondary truncate flex-1 min-w-0 svelte-1l48mn0"> </span> <!></div>'),u1=I('<div class="border-b border-border-default bg-bg-primary svelte-1l48mn0"></div>'),h1=I(`<button type="button" class="w-full flex items-center gap-2 px-4 py-1.5
300
+ hover:bg-bg-hover transition-colors text-left
301
+ border-b border-border-default svelte-1l48mn0"><svg viewBox="0 0 16 16" fill="currentColor"><path d="M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z" class="svelte-1l48mn0"></path></svg> <span class="w-2 h-2 rounded-full bg-attention-emphasis shrink-0 svelte-1l48mn0"></span> <span class="text-xs text-text-secondary svelte-1l48mn0"> </span></button> <!>`,1),f1=I('<svg class="animate-spin h-3.5 w-3.5 text-accent-fg shrink-0 svelte-1l48mn0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25 svelte-1l48mn0" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75 svelte-1l48mn0" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold bg-accent-muted text-accent-fg svelte-1l48mn0">Running</span>',1),v1=I('<svg class="h-3.5 w-3.5 text-success-fg shrink-0 svelte-1l48mn0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12" class="svelte-1l48mn0"></polyline></svg> <span> </span>',1),_1=I('<svg class="animate-spin h-3.5 w-3.5 text-text-tertiary shrink-0 svelte-1l48mn0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25 svelte-1l48mn0" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75 svelte-1l48mn0" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold bg-bg-tertiary text-text-secondary svelte-1l48mn0">Loading</span>',1),p1=I('<svg class="animate-spin h-3.5 w-3.5 text-accent-fg shrink-0 svelte-1l48mn0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25 svelte-1l48mn0" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75 svelte-1l48mn0" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold bg-accent-muted text-accent-fg svelte-1l48mn0">Running</span>',1),g1=I('<span class="shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold bg-bg-tertiary text-text-secondary svelte-1l48mn0">CLI</span>'),m1=I('<span class="text-[10px] text-text-tertiary shrink-0 animate-pulse svelte-1l48mn0"> </span>'),b1=I(`<!> <span class="text-xs font-mono text-text-tertiary tabular-nums shrink-0 svelte-1l48mn0"> </span> <button type="button" class="shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded
302
+ bg-danger-emphasis/10 text-danger-fg hover:bg-danger-emphasis/20
303
+ border border-danger-emphasis/30 transition-colors svelte-1l48mn0">Cancel</button>`,1),y1=I('<span class="text-[10px] text-text-tertiary shrink-0 svelte-1l48mn0"> </span>'),x1=I('<span class="text-[10px] text-text-tertiary shrink-0 animate-pulse svelte-1l48mn0"> </span>'),w1=I(`<!> <span class="text-xs font-mono text-text-tertiary tabular-nums shrink-0 svelte-1l48mn0"> </span> <button type="button" class="shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded
304
+ bg-danger-emphasis/10 text-danger-fg hover:bg-danger-emphasis/20
305
+ border border-danger-emphasis/30 transition-colors svelte-1l48mn0">Cancel</button>`,1),S1=I('<span class="text-[10px] text-text-tertiary shrink-0 svelte-1l48mn0"> </span> <span class="text-[10px] text-text-tertiary shrink-0 svelte-1l48mn0"> </span>',1),C1=I('<div class="px-4 py-1.5 flex items-center gap-1.5 text-[10px] text-text-tertiary border-b border-border-default/50 svelte-1l48mn0"><svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="svelte-1l48mn0"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" class="svelte-1l48mn0"></path><polyline points="14 2 14 8 20 8" class="svelte-1l48mn0"></polyline></svg> <span class="truncate svelte-1l48mn0"> </span></div>'),k1=I('<span class="text-text-tertiary text-xs svelte-1l48mn0">|</span> <svg class="animate-spin h-3 w-3 text-text-tertiary svelte-1l48mn0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25 svelte-1l48mn0" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75 svelte-1l48mn0" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="text-xs text-text-tertiary svelte-1l48mn0">Loading summary...</span>',1),E1=I('<span class="text-text-tertiary text-xs svelte-1l48mn0">|</span>'),L1=I('<span class="inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono bg-bg-tertiary text-text-secondary svelte-1l48mn0"> <span class="text-text-tertiary svelte-1l48mn0"> </span></span>'),P1=I('<span class="text-[10px] text-text-tertiary svelte-1l48mn0"> </span>'),R1=I('<span class="text-text-tertiary text-xs mx-1 svelte-1l48mn0">|</span>'),A1=I('<button type="button" class="text-[11px] text-text-secondary hover:text-accent-fg transition-colors svelte-1l48mn0"> </button>'),T1=I('<span class="text-text-tertiary text-xs svelte-1l48mn0">|</span>'),D1=I('<!> <button type="button" class="text-[11px] text-text-secondary hover:text-accent-fg transition-colors svelte-1l48mn0"> </button>',1),I1=I("<!> <!> <!> <!> <!> <!>",1),M1=I('<span class="svelte-1l48mn0"> </span>'),O1=I('<span class="svelte-1l48mn0"> </span>'),B1=I('<div class="flex items-center gap-3 mt-1.5 text-[10px] font-mono text-text-tertiary svelte-1l48mn0"><span class="svelte-1l48mn0"> </span> <span class="svelte-1l48mn0"> </span> <!> <!></div>'),N1=I('<div class="flex items-center gap-2 py-0.5 text-[11px] svelte-1l48mn0"><span> </span> <span class="text-text-secondary font-mono truncate svelte-1l48mn0"> </span></div>'),j1=I('<div class="mt-2 space-y-0.5 svelte-1l48mn0"></div>'),F1=I('<div class="flex items-center gap-2 py-0.5 text-[11px] svelte-1l48mn0"><span></span> <span class="text-text-primary truncate svelte-1l48mn0"> </span> <span class="text-text-tertiary shrink-0 svelte-1l48mn0"> </span></div>'),H1=I('<div class="mt-2 space-y-0.5 svelte-1l48mn0"></div>'),V1=I(`<div class="px-4 py-2 bg-bg-tertiary/30 border-b border-border-default svelte-1l48mn0"><div class="flex items-center gap-2 flex-wrap svelte-1l48mn0"><button type="button" class="shrink-0 px-2.5 py-0.5 text-xs font-medium rounded
306
+ bg-bg-tertiary hover:bg-bg-hover text-text-primary
307
+ border border-border-default svelte-1l48mn0">Resume</button> <!></div> <!> <!> <!></div>`),W1=I(`<div class="w-full flex items-center gap-2 px-4 py-2
308
+ text-left select-none
309
+ sticky top-0 z-10 bg-bg-secondary svelte-1l48mn0"><!> <span class="flex-1 text-xs text-text-primary truncate svelte-1l48mn0"> </span> <!></div> <div class="border-t border-border-default/50 bg-bg-primary svelte-1l48mn0"><!> <!> <!></div>`,1),U1=I("<!> <!>",1),z1=rr('<svg class="animate-spin svelte-1l48mn0" xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10" class="opacity-25 svelte-1l48mn0"></circle><path class="opacity-75 svelte-1l48mn0" d="M22 12a10 10 0 0 1-10 10"></path></svg>'),q1=rr('<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="svelte-1l48mn0"><path d="M12 5v14" class="svelte-1l48mn0"></path><path d="m19 12-7 7-7-7" class="svelte-1l48mn0"></path></svg>'),G1=I('<div class="z-[120] bg-bg-primary border border-border-default rounded-lg shadow-lg flex flex-col svelte-1l48mn0" role="dialog" aria-label="Session search"><!></div>'),K1=I(`<div class="w-full flex items-center gap-2 px-4 py-1.5 text-left select-none relative svelte-1l48mn0"><span class="text-xs text-text-tertiary svelte-1l48mn0">No current session</span> <button type="button" class="h-6 w-6 flex items-center justify-center
310
+ hover:bg-bg-hover rounded transition-colors duration-150
311
+ text-text-tertiary hover:text-text-primary
312
+ disabled:opacity-60 disabled:cursor-not-allowed
313
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis svelte-1l48mn0" title="Load latest session" aria-label="Load latest session"><!></button> <div class="relative svelte-1l48mn0"><button type="button" data-ai-search-button="" title="Search Sessions" aria-label="Search and browse sessions"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="svelte-1l48mn0"><circle cx="11" cy="11" r="8" class="svelte-1l48mn0"></circle><path d="m21 21-4.35-4.35" class="svelte-1l48mn0"></path></svg></button> <!></div></div>`),J1=I('<div role="region" aria-label="Current session status"><!></div>');function Q1(t,e){Tt(e,!0);const i=We(e,"resumeSessionId",3,null);let n=K(null),a=K(!1),v=K(!1),_=K(null),s=K(!1),o=K(!1),h=K(!1),g=0,c=K(!1),p=K(null),b=K(null),w=K(""),m=K(!1);const u=ge(()=>i()??e.currentClientSessionId),l=ge(()=>e.running.find(U=>U.clientSessionId===e.currentClientSessionId)??null),d=ge(()=>e.recentlyCompleted.find(U=>U.clientSessionId===e.currentClientSessionId)??null),f=ge(()=>r(l)!==null),y=ge(()=>r(l)===null||r(u).length===0?!1:r(l).clientSessionId===r(u)),E=ge(()=>r(u).length===0?[]:e.pendingPrompts.filter(F=>F.qraft_ai_session_id===r(u))),S=ge(()=>{var F;if(r(E).length!==0)return(F=r(E)[r(E).length-1])==null?void 0:F.message}),L=ge(()=>e.pendingPrompts.length>0?e.pendingPrompts.map(F=>({id:F.id,text:F.message,source:"prompt"})):e.queued.map(F=>({id:F.id,text:F.prompt,source:"session"}))),x=ge(()=>r(L).length),P=ge(()=>r(f)||r(x)>0||r(d)!==null||r(a)||r(n)!==null),B=ge(()=>r(a)?"loading":r(n)!==null?"cli":r(f)?"running":r(d)!==null?"completed":"none"),j=ge(()=>r(n)!==null?Ur(r(n).firstPrompt||r(n).summary):r(l)!==null&&r(l)!==void 0?Ur(r(l).prompt):r(d)!==null?Ur(r(d).prompt):"");let V=K(0);St(()=>{if(r(l)===null||r(l)===void 0||r(l).startedAt===void 0){k(V,0);return}const F=new Date(r(l).startedAt).getTime(),U=()=>{k(V,Math.floor((Date.now()-F)/1e3),!0)};U();const $=setInterval(U,1e3);return()=>clearInterval($)});const N=ge(()=>{const F=Math.floor(r(V)/60),U=r(V)%60;return`${F}:${U.toString().padStart(2,"0")}`});function X(F,U=100){const $=Ur(F).replaceAll(`
314
+ `," ");return $.length<=U?$:$.slice(0,U)+"..."}function W(F){const U=new Date(F),be=new Date().getTime()-U.getTime(),xe=Math.floor(be/6e4),ae=Math.floor(be/36e5),he=Math.floor(be/864e5);return xe<1?"just now":xe<60?`${xe}m ago`:ae<24?`${ae}h ago`:he===1?"yesterday":`${he}d ago`}function Q(F){return F>=1e6?`${(F/1e6).toFixed(1)}M`:F>=1e3?`${(F/1e3).toFixed(1)}k`:F.toString()}function ne(F){const U=F.split("/");return U.length<=2?F:".../"+U.slice(-2).join("/")}function le(F){switch(F){case"completed":return"bg-success-emphasis";case"in_progress":return"bg-attention-emphasis";default:return"bg-border-default"}}async function D(F){if(e.contextId===null)return;const U=++g;k(a,!0);try{const $=await fetch(`/api/ctx/${e.contextId}/claude-sessions/sessions/${F}`);if(U!==g)return;if(!$.ok){k(n,null),k(_,null);return}const be=await $.json();k(n,be,!0),k(_,null)}catch{U===g&&(k(n,null),k(_,null))}finally{U===g&&k(a,!1)}}async function T(F){if(!(e.contextId===null||r(_)!==null||r(s))){k(s,!0);try{const U=await fetch(`/api/ctx/${e.contextId}/claude-sessions/sessions/${F}/summary`);U.ok&&k(_,await U.json(),!0)}catch{}finally{k(s,!1)}}}function M(){if(r(b)===null){k(w,"");return}const F=r(b).getBoundingClientRect(),U=420,$=400,be=Math.max(8,F.top-$-8),xe=Math.min(F.left,window.innerWidth-U-8);k(w,`position:fixed;top:${be}px;left:${Math.max(8,xe)}px;width:${U}px;max-height:${$}px;`)}function z(){k(c,!r(c)),r(c)&&M()}function J(){k(c,!1)}function Z(F){e.onResumeSession(F),J()}async function re(){var F;if(!(e.contextId===null||r(m))){k(m,!0);try{const U=new URLSearchParams({offset:"0",limit:"1",sortBy:"modified",sortOrder:"desc"});e.projectPath.length>0&&U.set("workingDirectoryPrefix",e.projectPath);const $=await fetch(`/api/ctx/${e.contextId}/claude-sessions/sessions?${U.toString()}`);if(!$.ok)return;const xe=(F=(await $.json()).sessions[0])==null?void 0:F.qraftAiSessionId;xe!==void 0&&e.onResumeSession(xe)}catch{}finally{k(m,!1)}}}St(()=>{r(B)==="cli"&&r(n)!==null&&e.contextId!==null&&T(r(n).qraftAiSessionId)}),St(()=>{e.contextId!==null&&(r(u).length>0?(k(n,null),k(_,null),D(r(u))):(g+=1,k(n,null),k(_,null),k(a,!1)))});var se=J1(),G=C(se);{var O=F=>{var U=U1(),$=Ae(U);{var be=he=>{var fe=h1(),Ee=Ae(fe);Ee.__click=()=>k(v,!r(v));var He=C(Ee),Le=R(He,4),ce=C(Le),Te=R(Ee,2);{var De=pe=>{var Be=u1();At(Be,23,()=>r(L),Qe=>Qe.id,(Qe,Ne,Me)=>{var Fe=d1(),tt=C(Fe),Ve=C(tt),Xe=R(tt,2),Ue=C(Xe),Je=R(Xe,2);{var ve=_e=>{var Oe=c1();Oe.__click=Ke=>{Ke.stopPropagation(),e.onCancelQueuedPrompt(r(Ne).id)},A(_e,Oe)};H(Je,_e=>{e.onCancelQueuedPrompt!==void 0&&_e(ve)})}ee(_e=>{Pe(Fe,1,`flex items-center gap-2 px-6 py-1.5 text-xs
315
+ ${r(Me)<r(L).length-1?"border-b border-border-default/50":""}`,"svelte-1l48mn0"),Y(Ve,`${r(Me)+1}.`),Y(Ue,_e)},[()=>X(r(Ne).text,120)]),A(Qe,Fe)}),A(pe,Be)};H(Te,pe=>{r(v)&&pe(De)})}ee(()=>{Pe(He,0,`w-3 h-3 text-text-tertiary transition-transform shrink-0
316
+ ${r(v)?"rotate-90":""}`,"svelte-1l48mn0"),Y(ce,`${r(x)??""} queued prompt${r(x)!==1?"s":""}`)}),A(he,fe)};H($,he=>{r(x)>0&&he(be)})}var xe=R($,2);{var ae=he=>{var fe=W1(),Ee=Ae(fe),He=C(Ee);{var Le=Je=>{var ve=f1();A(Je,ve)},ce=Je=>{var ve=et(),_e=Ae(ve);{var Oe=nt=>{var $e=v1(),dt=R(Ae($e),2),ut=C(dt);ee(()=>{var bt,lt;Pe(dt,1,`shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold
317
+ ${((bt=r(d))==null?void 0:bt.state)==="failed"?"bg-danger-subtle text-danger-fg":"bg-success-muted text-success-fg"}`,"svelte-1l48mn0"),Y(ut,((lt=r(d))==null?void 0:lt.state)==="failed"?"Failed":"Done")}),A(nt,$e)},Ke=nt=>{var $e=et(),dt=Ae($e);{var ut=lt=>{var ye=_1();A(lt,ye)},bt=lt=>{var ye=et(),te=Ae(ye);{var oe=Ie=>{var we=p1();A(Ie,we)},me=Ie=>{var we=g1();A(Ie,we)};H(te,Ie=>{r(y)?Ie(oe):Ie(me,!1)},!0)}A(lt,ye)};H(dt,lt=>{r(B)==="loading"?lt(ut):lt(bt,!1)},!0)}A(nt,$e)};H(_e,nt=>{r(B)==="completed"?nt(Oe):nt(Ke,!1)},!0)}A(Je,ve)};H(He,Je=>{r(B)==="running"?Je(Le):Je(ce,!1)})}var Te=R(He,2),De=C(Te),pe=R(Te,2);{var Be=Je=>{var ve=b1(),_e=Ae(ve);{var Oe=dt=>{var ut=m1(),bt=C(ut);ee(()=>Y(bt,r(l).currentActivity)),A(dt,ut)};H(_e,dt=>{r(l).currentActivity&&dt(Oe)})}var Ke=R(_e,2),nt=C(Ke),$e=R(Ke,2);$e.__click=dt=>{dt.stopPropagation(),e.onCancelSession(r(l).id)},ee(()=>Y(nt,r(N))),A(Je,ve)},Qe=Je=>{var ve=et(),_e=Ae(ve);{var Oe=nt=>{var $e=y1(),dt=C($e);ee(ut=>Y(dt,ut),[()=>r(d).completedAt!==void 0?W(r(d).completedAt):""]),A(nt,$e)},Ke=nt=>{var $e=et(),dt=Ae($e);{var ut=bt=>{var lt=et(),ye=Ae(lt);{var te=me=>{var Ie=w1(),we=Ae(Ie);{var Re=ht=>{var _t=x1(),ct=C(_t);ee(()=>Y(ct,r(l).currentActivity)),A(ht,_t)};H(we,ht=>{r(l).currentActivity&&ht(Re)})}var je=R(we,2),Ye=C(je),rt=R(je,2);rt.__click=ht=>{ht.stopPropagation(),e.onCancelSession(r(l).id)},ee(()=>Y(Ye,r(N))),A(me,Ie)},oe=me=>{var Ie=S1(),we=Ae(Ie),Re=C(we),je=R(we,2),Ye=C(je);ee(rt=>{Y(Re,`${r(n).messageCount??""} msgs`),Y(Ye,rt)},[()=>W(r(n).modified)]),A(me,Ie)};H(ye,me=>{r(y)&&r(l)!==null&&r(l)!==void 0?me(te):me(oe,!1)})}A(bt,lt)};H(dt,bt=>{r(n)!==null&&bt(ut)},!0)}A(nt,$e)};H(_e,nt=>{r(B)==="completed"&&r(d)!==null?nt(Oe):nt(Ke,!1)},!0)}A(Je,ve)};H(pe,Je=>{r(B)==="running"&&r(l)!==null&&r(l)!==void 0?Je(Be):Je(Qe,!1)})}var Ne=R(Ee,2),Me=C(Ne);{var Fe=Je=>{var ve=C1(),_e=R(C(ve),2),Oe=C(_e);ee(()=>Y(Oe,r(l).context.primaryFile.path)),A(Je,ve)};H(Me,Je=>{r(f)&&r(l)!==null&&r(l)!==void 0&&r(l).context.primaryFile!==void 0&&Je(Fe)})}var tt=R(Me,2);{var Ve=Je=>{var ve=V1(),_e=C(ve),Oe=C(_e);Oe.__click=oe=>{oe.stopPropagation(),e.onResumeSession(r(n).qraftAiSessionId)};var Ke=R(Oe,2);{var nt=oe=>{var me=k1();A(oe,me)},$e=oe=>{var me=et(),Ie=Ae(me);{var we=Re=>{var je=I1(),Ye=Ae(je);{var rt=xt=>{var pt=E1();A(xt,pt)};H(Ye,xt=>{(r(_).toolUsage.length>0||r(_).filesModified.length>0||r(_).tasks.length>0)&&xt(rt)})}var ht=R(Ye,2);At(ht,17,()=>r(_).toolUsage.slice(0,6),Pr,(xt,pt)=>{var it=L1(),Et=C(it),Pt=R(Et),qt=C(Pt);ee(()=>{Y(Et,r(pt).name),Y(qt,`:${r(pt).count??""}`)}),A(xt,it)});var _t=R(ht,2);{var ct=xt=>{var pt=P1(),it=C(pt);ee(()=>Y(it,`+${r(_).toolUsage.length-6} more`)),A(xt,pt)};H(_t,xt=>{r(_).toolUsage.length>6&&xt(ct)})}var kt=R(_t,2);{var It=xt=>{var pt=R1();A(xt,pt)};H(kt,xt=>{(r(_).filesModified.length>0||r(_).tasks.length>0)&&xt(It)})}var Ze=R(kt,2);{var at=xt=>{var pt=A1();pt.__click=()=>k(h,!r(h));var it=C(pt);ee(()=>Y(it,`${r(_).filesModified.length??""} file${r(_).filesModified.length!==1?"s":""}`)),A(xt,pt)};H(Ze,xt=>{r(_).filesModified.length>0&&xt(at)})}var ft=R(Ze,2);{var mt=xt=>{var pt=D1(),it=Ae(pt);{var Et=Wt=>{var Lt=T1();A(Wt,Lt)};H(it,Wt=>{r(_).filesModified.length>0&&Wt(Et)})}var Pt=R(it,2);Pt.__click=()=>k(o,!r(o));var qt=C(Pt);ee(()=>Y(qt,`${r(_).tasks.length??""} task${r(_).tasks.length!==1?"s":""}`)),A(xt,pt)};H(ft,xt=>{r(_).tasks.length>0&&xt(mt)})}A(Re,je)};H(Ie,Re=>{r(_)!==null&&Re(we)},!0)}A(oe,me)};H(Ke,oe=>{r(s)?oe(nt):oe($e,!1)})}var dt=R(_e,2);{var ut=oe=>{var me=B1(),Ie=C(me),we=C(Ie),Re=R(Ie,2),je=C(Re),Ye=R(Re,2);{var rt=ct=>{var kt=M1(),It=C(kt);ee(Ze=>Y(It,`cache-w:${Ze??""}`),[()=>Q(r(_).usage.cacheCreationTokens)]),A(ct,kt)};H(Ye,ct=>{r(_).usage.cacheCreationTokens>0&&ct(rt)})}var ht=R(Ye,2);{var _t=ct=>{var kt=O1(),It=C(kt);ee(Ze=>Y(It,`cache-r:${Ze??""}`),[()=>Q(r(_).usage.cacheReadTokens)]),A(ct,kt)};H(ht,ct=>{r(_).usage.cacheReadTokens>0&&ct(_t)})}ee((ct,kt)=>{Y(we,`in:${ct??""}`),Y(je,`out:${kt??""}`)},[()=>Q(r(_).usage.inputTokens),()=>Q(r(_).usage.outputTokens)]),A(oe,me)};H(dt,oe=>{var me;((me=r(_))==null?void 0:me.usage)!==void 0&&(r(_).usage.inputTokens>0||r(_).usage.outputTokens>0)&&oe(ut)})}var bt=R(dt,2);{var lt=oe=>{var me=j1();At(me,21,()=>r(_).filesModified,Pr,(Ie,we)=>{var Re=N1(),je=C(Re),Ye=C(je),rt=R(je,2),ht=C(rt);ee(_t=>{Pe(je,1,`shrink-0 px-1 rounded text-[9px] font-bold ${r(we).tool==="Edit"?"bg-attention-muted text-attention-fg":"bg-success-muted text-success-fg"}`,"svelte-1l48mn0"),Y(Ye,r(we).tool==="Edit"?"M":"A"),ze(rt,"title",r(we).path),Y(ht,_t)},[()=>ne(r(we).path)]),A(Ie,Re)}),A(oe,me)};H(bt,oe=>{r(h)&&r(_)!==null&&r(_).filesModified.length>0&&oe(lt)})}var ye=R(bt,2);{var te=oe=>{var me=H1();At(me,21,()=>r(_).tasks,Pr,(Ie,we)=>{var Re=F1(),je=C(Re),Ye=R(je,2),rt=C(Ye),ht=R(Ye,2),_t=C(ht);ee(ct=>{Pe(je,1,`shrink-0 w-2 h-2 rounded-full ${ct??""}`,"svelte-1l48mn0"),Y(rt,r(we).subject),Y(_t,r(we).status)},[()=>le(r(we).status)]),A(Ie,Re)}),A(oe,me)};H(ye,oe=>{r(o)&&r(_)!==null&&r(_).tasks.length>0&&oe(te)})}A(Je,ve)};H(tt,Je=>{r(n)!==null&&e.contextId!==null&&!r(f)&&Je(Ve)})}var Xe=R(tt,2);{var Ue=Je=>{{let ve=ge(()=>r(f)||r(y)?1500:0),_e=ge(()=>r(f)||r(y)),Oe=ge(()=>r(f)||r(y)?r(S)??(r(l)!==null&&r(l)!==void 0?r(l).prompt:void 0):void 0),Ke=ge(()=>(r(f)||r(y))&&r(l)!==null&&r(l)!==void 0?r(l).lastAssistantMessage:void 0);bd(Je,{get sessionId(){return r(u)},get contextId(){return e.contextId},get autoRefreshMs(){return r(ve)},get followLatest(){return r(_e)},get optimisticUserMessage(){return r(Oe)},get optimisticAssistantMessage(){return r(Ke)}})}};H(Xe,Je=>{e.contextId!==null&&r(u).length>0&&Je(Ue)})}ee(Je=>Y(De,Je),[()=>r(B)==="loading"?"Loading session...":X(r(j))]),A(he,fe)};H(xe,he=>{r(B)!=="none"&&he(ae)})}A(F,U)},ie=F=>{var U=K1(),$=R(C(U),2);$.__click=()=>void re();var be=C($);{var xe=Le=>{var ce=z1();A(Le,ce)},ae=Le=>{var ce=q1();A(Le,ce)};H(be,Le=>{r(m)?Le(xe):Le(ae,!1)})}var he=R($,2),fe=C(he);fe.__click=z,er(fe,Le=>k(b,Le),()=>r(b));var Ee=R(fe,2);{var He=Le=>{var ce=G1(),Te=C(ce);md(Te,{get contextId(){return e.contextId},get projectPath(){return e.projectPath},onResumeSession:Z,onClose:J}),er(ce,De=>k(p,De),()=>r(p)),ee(()=>nr(ce,r(w))),A(Le,ce)};H(Ee,Le=>{r(c)&&Le(He)})}ee(()=>{$.disabled=r(m),Pe(fe,1,`h-6 w-6 flex items-center justify-center
318
+ hover:bg-bg-hover rounded transition-colors duration-150
319
+ text-text-tertiary hover:text-text-primary
320
+ focus:outline-none focus:ring-2 focus:ring-inset focus:ring-accent-emphasis
321
+ ${r(c)?"bg-bg-hover text-text-primary":""}`,"svelte-1l48mn0"),ze(fe,"aria-expanded",r(c))}),A(F,U)};H(G,F=>{r(P)?F(O):F(ie,!1)})}ee(()=>Pe(se,1,`current-session-panel border-t border-border-default bg-bg-secondary overflow-y-auto
322
+ flex-1 min-h-0
323
+ ${r(f)?"session-running-glow":""}`,"svelte-1l48mn0")),A(t,se),Dt()}Ft(["click"]);function X1(t){const e=[];let i=[],n;for(const a of t.chunks)for(const v of a.changes)if(v.type==="delete")i.push(v),n===void 0&&v.oldLine!==void 0&&(n=v.oldLine);else{const _=gl(i,n),s=v.type==="add"?"added":"unchanged";v.newLine!==void 0&&e.push({lineNumber:v.newLine,content:v.content,changeType:s,deletedBefore:_}),i=[],n=void 0}if(i.length>0){const a=gl(i,n);if(a!==void 0){const v=e[e.length-1],_=v!==void 0?v.lineNumber+1:1;e.push({lineNumber:_,content:"",changeType:"unchanged",deletedBefore:a})}}return e}function gl(t,e){if(t.length===0||e===void 0)return;const i=t.map(a=>a.content),n=e+t.length-1;return{id:`deleted-${e}-${n}`,lines:i,originalStart:e,originalEnd:n}}function ml(){return{expandedBlocks:new Set}}function Y1(){let t=ml();return{get expandedBlocks(){return Object.freeze(new Set(t.expandedBlocks))},toggleBlock(e){const i=new Set(t.expandedBlocks);i.has(e)?i.delete(e):i.add(e),t={expandedBlocks:i}},expandBlock(e){if(!t.expandedBlocks.has(e)){const i=new Set(t.expandedBlocks);i.add(e),t={expandedBlocks:i}}},collapseBlock(e){if(t.expandedBlocks.has(e)){const i=new Set(t.expandedBlocks);i.delete(e),t={expandedBlocks:i}}},expandAll(e){const i=new Set(t.expandedBlocks);for(const n of e)i.add(n);t={expandedBlocks:i}},collapseAll(){t={expandedBlocks:new Set}},isExpanded(e){return t.expandedBlocks.has(e)},reset(){t=ml()}}}var Z1=I(`<button type="button" class="comment-trigger absolute left-0 top-1 w-6 h-6 flex items-center justify-center
324
+ rounded bg-accent-emphasis text-white text-xs font-bold
325
+ opacity-0 group-hover/gutter:opacity-100
326
+ hover:bg-accent-fg transition-opacity z-10 cursor-pointer svelte-2vdjal">+</button>`),$1=I('<span class="highlighted-line svelte-2vdjal"><!></span>'),eb=I('<pre class="m-0 p-0 svelte-2vdjal"> </pre>'),tb=I('<div role="option" tabindex="0"><div class="w-16 flex-shrink-0 px-2 flex items-start justify-end text-text-secondary border-r border-border-default relative group/gutter"><!> <span> </span></div> <div><span class="font-bold"> </span></div> <div class="flex-1 px-2 overflow-x-auto"><!></div></div>');function rb(t,e){Tt(e,!0);const i=We(e,"highlighted",3,void 0),n=We(e,"selected",3,!1),a=We(e,"onSelect",3,void 0),v=We(e,"onLongPress",3,void 0),_=We(e,"onCommentClick",3,void 0);let s=K(void 0);function o(){switch(e.line.changeType){case"added":return"bg-diff-add-bg";case"modified":return"bg-attention-muted";case"unchanged":return"bg-transparent";default:const N=e.line.changeType;throw new Error(`Unhandled change type: ${N}`)}}function h(){switch(e.line.changeType){case"added":return"+";case"modified":return"~";case"unchanged":return" ";default:const N=e.line.changeType;throw new Error(`Unhandled change type: ${N}`)}}function g(){switch(e.line.changeType){case"added":return"text-success-fg";case"modified":return"text-attention-fg";case"unchanged":return"text-text-secondary";default:const N=e.line.changeType;throw new Error(`Unhandled change type: ${N}`)}}function c(){a()!==void 0&&a()()}function p(){v()!==void 0&&k(s,setTimeout(()=>{v()!==void 0&&v()()},500),!0)}function b(){r(s)!==void 0&&(clearTimeout(r(s)),k(s,void 0))}function w(){r(s)!==void 0&&(clearTimeout(r(s)),k(s,void 0))}function m(N){(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),c())}var u=tb();u.__click=c,u.__keydown=m,u.__pointerdown=p,u.__pointerup=b;var l=C(u),d=C(l);{var f=N=>{var X=Z1();X.__click=W=>{var Q;W.stopPropagation(),(Q=_())==null||Q(W.shiftKey)},ee(()=>ze(X,"aria-label",`Add comment on line ${e.line.lineNumber??""}`)),A(N,X)};H(d,N=>{_()!==void 0&&N(f)})}var y=R(d,2),E=C(y),S=R(l,2),L=C(S),x=C(L),P=R(S,2),B=C(P);{var j=N=>{var X=$1(),W=C(X);Qs(W,i),A(N,X)},V=N=>{var X=eb(),W=C(X);ee(()=>Y(W,e.line.content)),A(N,X)};H(B,N=>{i()!==void 0?N(j):N(V,!1)})}ee((N,X,W)=>{Pe(u,1,`current-state-line-row flex font-mono text-xs leading-5 cursor-pointer select-none ${N??""} ${n()?"ring-2 ring-accent-emphasis ring-inset":""}`,"svelte-2vdjal"),ze(u,"aria-label",`Line ${e.line.lineNumber??""}: ${e.line.content??""}`),ze(u,"aria-selected",n()),Y(E,e.line.lineNumber),Pe(S,1,`w-8 flex-shrink-0 flex items-start justify-center ${X??""} border-r border-border-default`,"svelte-2vdjal"),Y(x,W)},[o,g,h]),Qt("pointerleave",u,w),A(t,u),Dt()}Ft(["click","keydown","pointerdown","pointerup"]);var ib=I(`<div class="deleted-marker relative min-h-[28px] flex items-center cursor-pointer
327
+ group transition-all duration-150 svelte-6d0us2" role="button" tabindex="0" aria-expanded="false"><div class="w-16 flex-shrink-0 px-2 flex items-center justify-end text-text-tertiary border-r border-border-default"><span class="text-xs opacity-60"> </span></div> <div class="w-8 flex-shrink-0 flex items-center justify-center text-danger-fg border-r border-border-default"><span class="font-bold text-xs">-</span></div> <div class="flex-1 relative py-[13px]"><div></div> <div class="absolute left-3 top-1/2 -translate-y-1/2 px-2 py-1
328
+ bg-danger-subtle text-danger-fg text-xs rounded
329
+ opacity-0 group-hover:opacity-100 group-focus:opacity-100
330
+ transition-opacity duration-150 pointer-events-none
331
+ whitespace-nowrap"> </div></div></div>`);function nb(t,e){Tt(e,!0);const i=We(e,"onPreview",3,void 0);let n=K(void 0),a=K(!1),v=K(!1);const _=ge(()=>e.block.lines.length===1?"1 deleted line":`${e.block.lines.length} deleted lines`),s=ge(()=>e.block.originalStart===e.block.originalEnd?`line ${e.block.originalStart}`:`lines ${e.block.originalStart}-${e.block.originalEnd}`);function o(){e.onExpand()}function h(){k(v,!0),i()!==void 0&&k(n,setTimeout(()=>{i()!==void 0&&i()()},500),!0)}function g(){k(v,!1),r(n)!==void 0&&(clearTimeout(r(n)),k(n,void 0))}function c(){k(v,!1),k(a,!1),r(n)!==void 0&&(clearTimeout(r(n)),k(n,void 0))}function p(){k(a,!0)}function b(S){(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),e.onExpand())}var w=ib();w.__click=o,w.__pointerdown=h,w.__pointerup=g,w.__keydown=b;var m=C(w),u=C(m),l=C(u),d=R(m,4),f=C(d),y=R(f,2),E=C(y);ee(()=>{ze(w,"aria-label",`Expand ${r(_)??""} (original ${r(s)??""})`),ze(w,"data-block-id",e.block.id),Y(l,e.block.originalStart),Pe(f,1,`absolute left-0 right-0 top-1/2 -translate-y-1/2 h-[2px] bg-danger-emphasis
332
+ ${r(a)||r(v)?"h-[4px]":""}`),Y(E,`${r(_)??""} - tap to expand`)}),Qt("pointerleave",w,c),Qt("pointerenter",w,p),A(t,w),Dt()}Ft(["click","pointerdown","pointerup","keydown"]);var sb=I('<span class="highlighted-line svelte-ou6g74"><!></span>'),ob=I('<pre class="m-0 p-0 svelte-ou6g74"> </pre>'),ab=I('<div class="flex font-mono text-xs leading-5 bg-danger-subtle border-b border-danger-emphasis last:border-b-0"><div class="w-16 flex-shrink-0 px-2 flex items-start justify-end text-danger-fg/60 border-r border-danger-emphasis"><span> </span></div> <div class="w-8 flex-shrink-0 flex items-start justify-center text-danger-fg border-r border-danger-emphasis"><span class="font-bold">-</span></div> <div class="flex-1 px-2 text-danger-fg overflow-x-auto"><!></div></div>'),lb=I(`<div class="expanded-deleted-block border-l-4 border-danger-emphasis bg-danger-subtle overflow-hidden svelte-ou6g74" role="region"><div class="flex items-center justify-between px-3 py-1 min-h-[28px] bg-danger-subtle border-b border-danger-emphasis"><div class="flex items-center gap-2 text-sm"><span class="text-danger-fg font-medium"> </span> <span class="text-danger-fg/60 text-xs"> </span></div> <button type="button" class="px-3 py-1.5 min-h-[32px] text-xs font-medium rounded
333
+ bg-danger-subtle text-danger-fg border border-danger-emphasis
334
+ hover:bg-danger-emphasis active:bg-danger-emphasis
335
+ focus:outline-none focus:ring-2 focus:ring-danger-emphasis focus:ring-offset-2 focus:ring-offset-danger-subtle
336
+ transition-colors duration-150" aria-label="Collapse deleted content"><span class="flex items-center gap-1.5"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="17 11 12 6 7 11"></polyline><polyline points="17 18 12 13 7 18"></polyline></svg> Collapse</span></button></div> <div class="deleted-lines"></div></div>`);function cb(t,e){Tt(e,!0);const i=We(e,"highlightedLines",3,void 0),n=ge(()=>e.block.lines.length===1?"1 deleted line":`${e.block.lines.length} deleted lines`);function a(u){return e.block.originalStart+u}function v(){e.onCollapse()}function _(u){u.key==="Escape"&&(u.preventDefault(),e.onCollapse())}var s=lb();s.__keydown=_;var o=C(s),h=C(o),g=C(h),c=C(g),p=R(g,2),b=C(p),w=R(h,2);w.__click=v;var m=R(o,2);At(m,21,()=>e.block.lines,Pr,(u,l,d)=>{var f=ab(),y=C(f),E=C(y),S=C(E),L=R(y,4),x=C(L);{var P=j=>{var V=sb(),N=C(V);Qs(N,()=>i()[d]),A(j,V)},B=j=>{var V=ob(),N=C(V);ee(()=>Y(N,r(l))),A(j,V)};H(x,j=>{i()!==void 0&&i()[d]!==void 0?j(P):j(B,!1)})}ee(j=>Y(S,j),[()=>a(d)]),A(u,f)}),ee(()=>{ze(s,"aria-label",`Expanded deleted content: ${r(n)??""}`),ze(s,"data-block-id",e.block.id),Y(c,r(n)),Y(b,`(original lines ${e.block.originalStart??""}-${e.block.originalEnd??""})`)}),A(t,s),Dt()}Ft(["keydown","click"]);var db=I('<div class="flex items-center justify-center h-full text-text-secondary"><span>No content to display</span></div>'),ub=I(`<div class="border-t-2 border-b-2 border-accent-emphasis bg-bg-secondary p-3"><textarea class="w-full min-h-[80px] p-2 text-sm font-sans bg-bg-primary border border-border-default rounded resize-y
337
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis" placeholder="Ask AI about this code..."></textarea> <div class="flex items-center justify-between mt-2"><div class="text-xs text-text-tertiary font-mono"> </div> <div class="flex items-center gap-2"><button type="button" class="px-3 py-1 text-sm text-text-secondary hover:text-text-primary">Cancel</button> <!></div></div></div>`),hb=I("<div><!></div> <!>",1),fb=I("<!> <!>",1),vb=I('<div class="lines-container svelte-wgyctu"></div>'),_b=I('<div class="current-state-view flex flex-col h-full bg-bg-primary svelte-wgyctu" role="region"><div class="flex items-center justify-between px-2 min-h-[32px] bg-bg-secondary border-b border-border-default sticky top-0 z-10"><div class="flex items-center gap-2"><span class="text-xs font-medium text-text-primary truncate max-w-[300px]"> </span> <span class="text-[10px] text-text-secondary"> </span></div> <div class="flex items-center gap-0.5"><button type="button" title="Previous file" aria-label="Previous file"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M7.78 12.53a.75.75 0 0 1-1.06 0L2.47 8.28a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 1.06L4.81 7h7.44a.75.75 0 0 1 0 1.5H4.81l2.97 2.97a.75.75 0 0 1 0 1.06Z"></path></svg></button> <button type="button" title="Next file" aria-label="Next file"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M8.22 3.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.19 9H3.75a.75.75 0 0 1 0-1.5h7.44L8.22 4.53a.75.75 0 0 1 0-1.06Z"></path></svg></button></div></div> <div class="flex-1 overflow-auto"><!></div></div>');function pb(t,e){Tt(e,!0);const i=We(e,"onLineSelect",3,void 0),n=We(e,"onCommentSubmit",3,void 0),a=We(e,"onNavigatePrev",3,void 0),v=We(e,"onNavigateNext",3,void 0),_=Y1(),s=ge(()=>X1(e.file));let o=K(gt(new Map)),h=K(gt(new Map));St(()=>{const T=r(s),M=e.file.path,J=T.map(re=>re.content).join(`
338
+ `);Yn(J,M).then(re=>{const se=new Map;for(let G=0;G<T.length;G++){const O=T[G],ie=re[G];O!==void 0&&ie!==void 0&&se.set(O.lineNumber,ie)}k(o,se,!0)});const Z=[];for(const re of T)re.deletedBefore!==void 0&&Z.push(re.deletedBefore);Z.length>0&&Promise.all(Z.map(re=>Yn(re.lines.join(`
339
+ `),M).then(se=>[re.id,se]))).then(re=>{const se=new Map;for(const[G,O]of re)se.set(G,O);k(h,se,!0)})});let g=K(void 0),c=K(null),p=K("");const b=ge(()=>{if(r(c)===null)return[];const T=[];for(let M=r(c).startLine;M<=r(c).endLine;M++)T.push(M);return T}),w=ge(()=>{if(r(c)===null)return"";const T=r(c).startLine===r(c).endLine?`L${r(c).startLine}`:`L${r(c).startLine}-L${r(c).endLine}`;return`${e.file.path}:${T}`});function m(T,M){if(M&&r(c)!==null){const z=Math.min(r(c).startLine,T),J=Math.max(r(c).endLine,T);k(c,{startLine:z,endLine:J},!0)}else k(c,{startLine:T,endLine:T},!0)}function u(T,M){r(c)!==null&&n()!==void 0&&n()(r(c).startLine,r(c).endLine,"new",e.file.path,T,M),k(c,null),k(p,"")}function l(){k(c,null),k(p,"")}function d(T){k(g,T,!0),i()!==void 0&&i()(T)}function f(T){_.toggleBlock(T)}function y(T){return _.isExpanded(T)}function E(T){if(!(T.target instanceof HTMLInputElement||T.target instanceof HTMLTextAreaElement)){if(T.key==="j"&&r(g)!==void 0){const z=r(s).find(J=>J.lineNumber>r(g));z!==void 0&&d(z.lineNumber)}else if(T.key==="k"&&r(g)!==void 0){const z=r(s).filter(J=>J.lineNumber<r(g));if(z.length>0){const J=z[z.length-1];J!==void 0&&d(J.lineNumber)}}}}St(()=>{e.file.path,_.reset()});var S=_b();Qt("keydown",ai,E);var L=C(S),x=C(L),P=C(x),B=C(P),j=R(P,2),V=C(j),N=R(x,2),X=C(N);X.__click=()=>{var T;return(T=a())==null?void 0:T()};var W=R(X,2);W.__click=()=>{var T;return(T=v())==null?void 0:T()};var Q=R(L,2),ne=C(Q);{var le=T=>{var M=db();A(T,M)},D=T=>{var M=vb();At(M,21,()=>r(s),z=>z.lineNumber,(z,J)=>{var Z=fb(),re=Ae(Z);{var se=ie=>{var F=et(),U=Ae(F);{var $=xe=>{{let ae=ge(()=>r(h).get(r(J).deletedBefore.id));cb(xe,{get block(){return r(J).deletedBefore},get highlightedLines(){return r(ae)},onCollapse:()=>f(r(J).deletedBefore.id)})}},be=xe=>{nb(xe,{get block(){return r(J).deletedBefore},onExpand:()=>f(r(J).deletedBefore.id)})};H(U,xe=>{y(r(J).deletedBefore.id)?xe($):xe(be,!1)})}A(ie,F)};H(re,ie=>{r(J).deletedBefore!==void 0&&ie(se)})}var G=R(re,2);{var O=ie=>{var F=hb(),U=Ae(F),$=C(U);{let ae=ge(()=>r(o).get(r(J).lineNumber)),he=ge(()=>r(g)===r(J).lineNumber),fe=ge(()=>n()!==void 0?Ee=>m(r(J).lineNumber,Ee):void 0);rb($,{get line(){return r(J)},get highlighted(){return r(ae)},get selected(){return r(he)},onSelect:()=>d(r(J).lineNumber),get onCommentClick(){return r(fe)}})}var be=R(U,2);{var xe=ae=>{var he=ub(),fe=C(he);fe.__keydown=pe=>{pe.key==="Enter"&&pe.ctrlKey&&(pe.preventDefault(),u(r(p),!0)),pe.key==="Escape"&&l()};var Ee=R(fe,2),He=C(Ee),Le=C(He),ce=R(He,2),Te=C(ce);Te.__click=()=>l();var De=R(Te,2);{let pe=ge(()=>r(p).trim().length===0);Ps(De,{get disabled(){return r(pe)},onPrimaryClick:()=>u(r(p),!1),onSecondaryClick:()=>u(r(p),!0)})}ee(()=>Y(Le,r(w))),Rr(fe,()=>r(p),pe=>k(p,pe)),A(ae,he)};H(be,ae=>{r(c)!==null&&r(J).lineNumber===r(c).endLine&&ae(xe)})}ee(ae=>Pe(U,1,ae),[()=>Pi(r(b).includes(r(J).lineNumber)?"bg-accent-muted":"")]),A(ie,F)};H(G,ie=>{(r(J).content!==""||r(J).changeType!=="unchanged")&&ie(O)})}A(z,Z)}),A(T,M)};H(ne,T=>{r(s).length===0?T(le):T(D,!1)})}ee(()=>{ze(S,"aria-label",`Current state view for ${e.file.path??""}`),Y(B,e.file.path),Y(V,`+${e.file.additions??""} -${e.file.deletions??""}`),Pe(X,1,`p-1 rounded transition-colors ${a()!==void 0?"text-text-secondary hover:text-text-primary hover:bg-bg-tertiary cursor-pointer":"text-text-disabled cursor-default"}`),X.disabled=a()===void 0,Pe(W,1,`p-1 rounded transition-colors ${v()!==void 0?"text-text-secondary hover:text-text-primary hover:bg-bg-tertiary cursor-pointer":"text-text-disabled cursor-default"}`),W.disabled=v()===void 0}),A(t,S),Dt()}Ft(["click","keydown"]);var gb=I('<div class="p-4 text-sm text-text-secondary">Loading files...</div>'),mb=I('<div class="p-4 text-sm text-danger-fg"> </div>'),bb=I('<div class="p-4 text-sm text-text-secondary">Loading all files...</div>'),yb=I('<aside class="h-full border-r border-border-default bg-bg-secondary overflow-auto"><!></aside>'),xb=I('<div class="p-8 text-center text-text-secondary">Loading diff...</div>'),wb=I('<div class="p-8 text-center text-danger-fg"> </div>'),Sb=I('<div class="px-2 pb-2"><!></div>'),Cb=I('<div class="px-2 pb-2"><!></div>'),kb=I('<div class="p-8 text-center text-text-secondary">Loading file...</div>'),Eb=I('<div class="p-8 text-center text-text-secondary">Loading file...</div>'),Lb=I('<div class="p-8 text-center text-text-secondary">Select a file to view</div>'),Pb=I('<button type="button" title="Side by Side"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="2" width="6" height="12" rx="1" stroke="currentColor" stroke-width="1.5"></rect><rect x="9" y="2" width="6" height="12" rx="1" stroke="currentColor" stroke-width="1.5"></rect></svg></button>'),Rb=I(`<div class="relative flex flex-1 min-h-0 overflow-hidden"><div><!> <button type="button"><span> </span></button></div> <div class="flex flex-col flex-1 min-w-0 min-h-0 transition-transform duration-200 ease-out"><main class="flex-1 min-h-0 overflow-auto bg-bg-primary"><!></main> <div><div class="shrink-0 h-8 border-t border-border-default flex items-center px-4 bg-bg-secondary text-xs text-text-secondary gap-4"><span> </span> <span class="text-success-fg"> </span> <span class="text-danger-fg"> </span> <div class="flex items-center border border-border-default rounded-md overflow-hidden ml-auto"><button type="button" title="Full File"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M3 2.5A1.5 1.5 0 014.5 1h5.586a1 1 0 01.707.293l2.414 2.414a1 1 0 01.293.707V13.5A1.5 1.5 0 0112 15H4.5A1.5 1.5 0 013 13.5v-11z" stroke="currentColor" stroke-width="1.5"></path><line x1="5.5" y1="6" x2="11" y2="6" stroke="currentColor" stroke-width="1.2"></line><line x1="5.5" y1="8.5" x2="11" y2="8.5" stroke="currentColor" stroke-width="1.2"></line><line x1="5.5" y1="11" x2="9" y2="11" stroke="currentColor" stroke-width="1.2"></line></svg></button> <!> <button type="button"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="2" width="14" height="12" rx="1" stroke="currentColor" stroke-width="1.5"></rect><line x1="4" y1="5.5" x2="12" y2="5.5" stroke="currentColor" stroke-width="1.2"></line><line x1="4" y1="8" x2="12" y2="8" stroke="currentColor" stroke-width="1.2"></line><line x1="4" y1="10.5" x2="10" y2="10.5" stroke="currentColor" stroke-width="1.2"></line></svg></button> <button type="button" title="Current"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M3 2.5A1.5 1.5 0 014.5 1h5.586a1 1 0 01.707.293l2.414 2.414a1 1 0 01.293.707V13.5A1.5 1.5 0 0112 15H4.5A1.5 1.5 0 013 13.5v-11z" stroke="currentColor" stroke-width="1.5"></path></svg></button></div></div> <div class="shrink-0 flex items-center border-t border-border-default bg-bg-secondary"><button type="button" class="shrink-0 w-7 h-5 flex items-center justify-center
340
+ text-text-secondary hover:text-text-primary hover:bg-bg-tertiary active:bg-bg-tertiary
341
+ transition-colors cursor-pointer"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" class="transition-transform duration-150"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <div class="flex-1 h-5 cursor-row-resize flex items-center justify-center
342
+ group hover:bg-accent-muted/40 transition-colors" role="separator" aria-orientation="horizontal" aria-label="Resize AI panel"><div class="w-8 h-0.5 rounded-full bg-border-default group-hover:bg-accent-emphasis transition-colors"></div></div></div> <div class="shrink-0 flex flex-col min-h-0 overflow-hidden"><div><!></div> <div class="shrink-0 flex items-center border-t border-border-default bg-bg-secondary"><button type="button" class="shrink-0 w-7 h-5 flex items-center justify-center
343
+ text-text-secondary hover:text-text-primary hover:bg-bg-tertiary active:bg-bg-tertiary
344
+ transition-colors cursor-pointer"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" class="transition-transform duration-150"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <div class="flex-1 h-5 cursor-row-resize flex items-center justify-center
345
+ group hover:bg-accent-muted/40 transition-colors" role="separator" aria-orientation="horizontal" aria-label="Resize AI prompt panel"><div class="w-8 h-0.5 rounded-full bg-border-default group-hover:bg-accent-emphasis transition-colors"></div></div></div> <div class="shrink-0 overflow-visible min-h-0 flex flex-col"><!></div></div></div></div></div>`);function Ab(t,e){Tt(e,!0);const i="qraftbox-ai-panel-height",n=120,a=400,v=48,_="qraftbox-ai-prompt-height",s=100,o=200,h=60;function g(){try{const ye=localStorage.getItem(i);if(ye!==null){const te=parseInt(ye,10);if(!isNaN(te)&&te>=n)return te}}catch{}return a}function c(){try{const ye=localStorage.getItem(_);if(ye!==null){const te=parseInt(ye,10);if(!isNaN(te)&&te>=s)return te}}catch{}return o}let p=K(gt(g())),b=K(gt(c())),w=K(!1),m=K(!1),u=K(null),l=K(null),d=K(0),f=K(0),y=K(0),E=K(!1),S=K(!1);function L(){const ye=navigator.userAgent;return(/iPhone|iPod/i.test(ye)||/Macintosh/i.test(ye)&&"maxTouchPoints"in navigator&&navigator.maxTouchPoints>1)&&window.innerWidth<=430}function x(){return window.innerWidth<=480}function P(){const ye=navigator.userAgent;return/iPhone|iPod|Android/i.test(ye)}function B(){const ye=navigator.userAgent,te=/Safari/i.test(ye)&&!/CriOS|FxiOS|EdgiOS|OPiOS/i.test(ye);return L()&&te}St(()=>{const ye=()=>{k(E,L(),!0),k(S,x(),!0)};return ye(),window.addEventListener("resize",ye),window.addEventListener("orientationchange",ye),()=>{window.removeEventListener("resize",ye),window.removeEventListener("orientationchange",ye)}}),St(()=>{r(E)&&e.selectedHasDiff&&e.effectiveViewMode==="side-by-side"&&e.onSetViewMode("inline")}),St(()=>{if(!r(S)||r(l)===null){k(d,0);return}const ye=()=>{var oe;k(d,((oe=r(l))==null?void 0:oe.offsetHeight)??0,!0)};ye();const te=new ResizeObserver(ye);return te.observe(r(l)),window.addEventListener("resize",ye),window.addEventListener("orientationchange",ye),()=>{te.disconnect(),window.removeEventListener("resize",ye),window.removeEventListener("orientationchange",ye)}}),St(()=>{if(!r(S)){k(f,0),k(y,0);return}const ye=window.visualViewport,te=()=>{const oe=ye===void 0?0:Math.max(0,window.innerHeight-(ye.height+ye.offsetTop)),me=ye!==void 0&&ye.height<window.innerHeight*.8;if(k(f,me?Math.round(oe):0,!0),!P()||!B()){k(y,0);return}if(window.matchMedia("(display-mode: standalone)").matches||navigator.standalone===!0||me){k(y,0);return}k(y,oe>0?0:52,!0)};return te(),window.addEventListener("resize",te),window.addEventListener("orientationchange",te),ye==null||ye.addEventListener("resize",te),ye==null||ye.addEventListener("scroll",te),()=>{window.removeEventListener("resize",te),window.removeEventListener("orientationchange",te),ye==null||ye.removeEventListener("resize",te),ye==null||ye.removeEventListener("scroll",te)}});function j(ye){var je;ye.preventDefault();const te=ye.clientY,oe=r(p),Ie=(((je=r(u))==null?void 0:je.clientHeight)??800)-v;document.body.style.cursor="row-resize",document.body.style.userSelect="none";function we(Ye){const rt=te-Ye.clientY;k(p,Math.min(Ie,Math.max(n,oe+rt)),!0)}function Re(){document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem(i,String(r(p))),window.removeEventListener("mousemove",we),window.removeEventListener("mouseup",Re)}window.addEventListener("mousemove",we),window.addEventListener("mouseup",Re)}function V(ye){ye.preventDefault();const te=ye.clientY,oe=r(b),me=r(p)-h;document.body.style.cursor="row-resize",document.body.style.userSelect="none";function Ie(Re){const je=te-Re.clientY;k(b,Math.min(me,Math.max(s,oe+je)),!0)}function we(){document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem(_,String(r(b))),window.removeEventListener("mousemove",Ie),window.removeEventListener("mouseup",we)}window.addEventListener("mousemove",Ie),window.addEventListener("mouseup",we)}let N=K(gt([])),X=K(void 0);async function W(){try{const ye=await Lc();k(N,[...ye.profiles],!0),k(X,ye.operationBindings.aiDefaultProfileId??void 0,!0)}catch{k(N,[],!0),k(X,void 0)}}St(()=>{W()});function Q(ye,te,oe,me,Ie,we){e.onSubmitPrompt(Ie,we,{primaryFile:{path:me,startLine:ye,endLine:te,content:""},references:[],diffSummary:void 0,resumeSessionId:e.currentQraftAiSessionId,modelProfileId:r(X)})}function ne(ye){e.onFileSelect(ye),(x()||P())&&!e.sidebarCollapsed&&e.onCollapseSidebar()}const le=ge(()=>{const ye=[];function te(oe){if(!oe.isDirectory){ye.push(oe.path);return}if(oe.children!==void 0)for(const me of oe.children)te(me)}return te(e.fileTree),ye});var D=Rb(),T=C(D),M=C(T);{var z=ye=>{var te=yb();let oe;var me=C(te);{var Ie=Re=>{var je=gb();A(Re,je)},we=Re=>{var je=et(),Ye=Ae(je);{var rt=_t=>{var ct=mb(),kt=C(ct);ee(()=>Y(kt,e.error)),A(_t,ct)},ht=_t=>{var ct=et(),kt=Ae(ct);{var It=at=>{var ft=bb();A(at,ft)},Ze=at=>{c0(at,{get tree(){return e.fileTree},get mode(){return e.fileTreeMode},get selectedPath(){return e.selectedPath},onFileSelect:ne,get changedCount(){return e.diffFiles.length},get contextId(){return e.contextId},get showIgnored(){return e.showIgnored},get showAllFiles(){return e.showAllFiles},get onModeChange(){return e.onFileTreeModeChange},get onShowIgnoredChange(){return e.onShowIgnoredChange},get onShowAllFilesChange(){return e.onShowAllFilesChange},get onDirectoryExpand(){return e.onDirectoryExpand},get onLoadFullTree(){return e.onLoadFullTree},get onNarrow(){return e.onNarrowSidebar},get onWiden(){return e.onWidenSidebar},get canNarrow(){return e.canNarrow},get canWiden(){return e.canWiden},get onReload(){return e.onReloadFileTree}})};H(kt,at=>{e.allFilesLoading&&e.fileTreeMode==="all"?at(It):at(Ze,!1)},!0)}A(_t,ct)};H(Ye,_t=>{e.error!==null?_t(rt):_t(ht,!1)},!0)}A(Re,je)};H(me,Re=>{e.loading?Re(Ie):Re(we,!1)})}ee(()=>oe=nr(te,"",oe,{width:`${e.sidebarWidth??""}px`})),A(ye,te)};H(M,ye=>{e.sidebarCollapsed||ye(z)})}var J=R(M,2);J.__click=function(...ye){var te;(te=e.onToggleSidebar)==null||te.apply(this,ye)};var Z=C(J),re=C(Z),se=R(T,2);let G;var O=C(se);let ie;var F=C(O);{var U=ye=>{var te=xb();A(ye,te)},$=ye=>{var te=et(),oe=Ae(te);{var me=we=>{var Re=wb(),je=C(Re);ee(()=>Y(je,e.error)),A(we,Re)},Ie=we=>{var Re=et(),je=Ae(Re);{var Ye=ht=>{var _t=Sb(),ct=C(_t);pb(ct,{get file(){return e.selectedFile},onCommentSubmit:Q,get onNavigatePrev(){return e.navigatePrev},get onNavigateNext(){return e.navigateNext}}),A(ht,_t)},rt=ht=>{var _t=et(),ct=Ae(_t);{var kt=Ze=>{var at=Cb(),ft=C(at);{let mt=ge(()=>e.effectiveViewMode==="side-by-side"?"side-by-side":"inline");wm(ft,{get file(){return e.selectedFile},get mode(){return r(mt)},onCommentSubmit:Q,get onNavigatePrev(){return e.navigatePrev},get onNavigateNext(){return e.navigateNext}})}A(Ze,at)},It=Ze=>{var at=et(),ft=Ae(at);{var mt=pt=>{var it=kb();A(pt,it)},xt=pt=>{var it=et(),Et=Ae(it);{var Pt=Wt=>{{let Lt=ge(()=>e.fileContent.ctxId!==void 0?Ua(e.fileContent.ctxId,e.fileContent.path):void 0);pl(Wt,{get path(){return e.fileContent.path},get content(){return e.fileContent.content},get language(){return e.fileContent.language},get isBinary(){return e.fileContent.isBinary},get isImage(){return e.fileContent.isImage},get isVideo(){return e.fileContent.isVideo},get isPdf(){return e.fileContent.isPdf},get mimeType(){return e.fileContent.mimeType},get rawFileUrl(){return r(Lt)},get onNavigatePrev(){return e.navigatePrev},get onNavigateNext(){return e.navigateNext},onCommentSubmit:Q})}},qt=Wt=>{var Lt=et(),ue=Ae(Lt);{var Ct=Gt=>{var Nt=Eb();A(Gt,Nt)},Ht=Gt=>{var Nt=et(),Ot=Ae(Nt);{var ir=dr=>{{let ur=ge(()=>e.fileContent.ctxId!==void 0?Ua(e.fileContent.ctxId,e.fileContent.path):void 0);pl(dr,{get path(){return e.fileContent.path},get content(){return e.fileContent.content},get language(){return e.fileContent.language},get isBinary(){return e.fileContent.isBinary},get isImage(){return e.fileContent.isImage},get isVideo(){return e.fileContent.isVideo},get isPdf(){return e.fileContent.isPdf},get mimeType(){return e.fileContent.mimeType},get rawFileUrl(){return r(ur)},get onNavigatePrev(){return e.navigatePrev},get onNavigateNext(){return e.navigateNext},onCommentSubmit:Q})}},Br=dr=>{var ur=Lb();A(dr,ur)};H(Ot,dr=>{e.fileContent!==null?dr(ir):dr(Br,!1)},!0)}A(Gt,Nt)};H(ue,Gt=>{e.fileContentLoading?Gt(Ct):Gt(Ht,!1)},!0)}A(Wt,Lt)};H(Et,Wt=>{e.effectiveViewMode==="full-file"&&e.fileContent!==null?Wt(Pt):Wt(qt,!1)},!0)}A(pt,it)};H(ft,pt=>{e.effectiveViewMode==="full-file"&&e.fileContentLoading?pt(mt):pt(xt,!1)},!0)}A(Ze,at)};H(ct,Ze=>{e.selectedFile!==null&&(e.effectiveViewMode==="side-by-side"||e.effectiveViewMode==="inline")?Ze(kt):Ze(It,!1)},!0)}A(ht,_t)};H(je,ht=>{e.selectedFile!==null&&e.effectiveViewMode==="current-state"?ht(Ye):ht(rt,!1)},!0)}A(we,Re)};H(oe,we=>{e.error!==null?we(me):we(Ie,!1)},!0)}A(ye,te)};H(F,ye=>{e.loading?ye(U):ye($,!1)})}var be=R(O,2);let xe;var ae=C(be),he=C(ae),fe=C(he),Ee=R(he,2),He=C(Ee),Le=R(Ee,2),ce=C(Le),Te=R(Le,2),De=C(Te);De.__click=()=>e.onSetViewMode("full-file");var pe=R(De,2);{var Be=ye=>{var te=Pb();te.__click=()=>{e.selectedHasDiff&&e.onSetViewMode("side-by-side")},ee(()=>{Pe(te,1,`p-1 border-l border-border-default transition-colors
346
+ ${e.selectedHasDiff?e.effectiveViewMode==="side-by-side"?"bg-bg-emphasis text-text-on-emphasis":"text-text-secondary hover:bg-bg-hover":"text-text-disabled cursor-not-allowed opacity-40"}`),te.disabled=!e.selectedHasDiff}),A(ye,te)};H(pe,ye=>{r(E)||ye(Be)})}var Qe=R(pe,2);Qe.__click=()=>{e.selectedHasDiff&&e.onSetViewMode("inline")};var Ne=R(Qe,2);Ne.__click=()=>{e.selectedHasDiff&&e.onSetViewMode("current-state")};var Me=R(ae,2),Fe=C(Me);Fe.__click=()=>{k(m,!r(m))};var tt=C(Fe);let Ve;var Xe=R(Fe,2);Xe.__mousedown=j;var Ue=R(Me,2);let Je;var ve=C(Ue),_e=C(ve);Q1(_e,{get contextId(){return e.contextId},get currentClientSessionId(){return e.currentQraftAiSessionId},get running(){return e.runningSessions},get queued(){return e.queuedSessions},get recentlyCompleted(){return e.recentlyCompletedSessions},get pendingPrompts(){return e.pendingPrompts},get resumeSessionId(){return e.resumeDisplaySessionId},get onCancelSession(){return e.onCancelActiveSession},get onCancelQueuedPrompt(){return e.onCancelQueuedPrompt},get onResumeSession(){return e.onResumeCliSession},get projectPath(){return e.projectPath}});var Oe=R(ve,2),Ke=C(Oe);Ke.__click=()=>{k(w,!r(w))};var nt=C(Ke);let $e;var dt=R(Ke,2);dt.__mousedown=V;var ut=R(Oe,2);let bt;var lt=C(ut);q0(lt,{get contextId(){return e.contextId},get projectPath(){return e.projectPath},get queueStatus(){return e.queueStatus},get isFirstMessage(){return e.isFirstMessage},get changedFiles(){return e.changedFilePaths},get allFiles(){return r(le)},get modelProfiles(){return r(N)},get selectedModelProfileId(){return r(X)},onSelectModelProfile:ye=>{k(X,ye,!0)},onSubmit:(ye,te,oe,me)=>{e.onSubmitPrompt(ye,te,{primaryFile:void 0,references:oe,diffSummary:void 0,resumeSessionId:e.currentQraftAiSessionId,modelProfileId:me??r(X)})},get onNewSession(){return e.onNewSession},get onResumeSession(){return e.onResumeCliSession}}),er(be,ye=>k(l,ye),()=>r(l)),er(se,ye=>k(u,ye),()=>r(u)),ee(()=>{Pe(T,1,`relative ${r(S)?"absolute left-0 top-0 bottom-0 z-30":"flex shrink-0"}`),Pe(J,1,`absolute top-12 z-20 flex items-center justify-center
347
+ ${r(S)?"w-6 h-10":"w-4 h-7"}
348
+ ${r(S)?e.sidebarCollapsed?"-left-0.5":"-right-6":"-right-4"}
349
+ bg-bg-secondary border border-l-0 border-border-default
350
+ rounded-r text-text-secondary hover:text-text-primary hover:bg-bg-tertiary
351
+ transition-colors cursor-pointer`),ze(J,"aria-label",e.sidebarCollapsed?"Show Sidebar":"Hide Sidebar"),ze(J,"title",e.sidebarCollapsed?"Show Sidebar (b)":"Hide Sidebar (b)"),Pe(Z,1,`${r(S)?"text-[12px]":"text-[9px]"} leading-none`),Y(re,e.sidebarCollapsed?"▶":"◀"),G=nr(se,"",G,{transform:r(S)&&!e.sidebarCollapsed?`translateX(${e.sidebarWidth}px)`:void 0}),ie=nr(O,"",ie,{"padding-bottom":r(S)?`${r(d)}px`:void 0}),Pe(be,1,Pi(r(S)?"fixed left-0 right-0 bottom-0 z-40 bg-bg-secondary flex flex-col":"shrink-0 flex flex-col min-h-0")),xe=nr(be,"",xe,{bottom:r(S)?`${r(f)}px`:void 0,"max-height":r(S)?"70dvh":void 0,"padding-bottom":r(S)?`calc(env(safe-area-inset-bottom, 0px) + ${r(y)}px)`:void 0}),Y(fe,`${e.stats.totalFiles??""} file${e.stats.totalFiles!==1?"s":""} changed`),Y(He,`+${e.stats.additions??""}`),Y(ce,`-${e.stats.deletions??""}`),Pe(De,1,`p-1 transition-colors
352
+ ${e.effectiveViewMode==="full-file"?"bg-bg-emphasis text-text-on-emphasis":"text-text-secondary hover:bg-bg-hover"}`),Pe(Qe,1,`p-1 border-l border-border-default transition-colors
353
+ ${e.selectedHasDiff?e.effectiveViewMode==="inline"?"bg-bg-emphasis text-text-on-emphasis":"text-text-secondary hover:bg-bg-hover":"text-text-disabled cursor-not-allowed opacity-40"}`),Qe.disabled=!e.selectedHasDiff,ze(Qe,"title",r(E)?"Stack":"Inline"),Pe(Ne,1,`p-1 border-l border-border-default transition-colors
354
+ ${e.selectedHasDiff?e.effectiveViewMode==="current-state"?"bg-bg-emphasis text-text-on-emphasis":"text-text-secondary hover:bg-bg-hover":"text-text-disabled cursor-not-allowed opacity-40"}`),Ne.disabled=!e.selectedHasDiff,ze(Fe,"aria-label",r(m)?"Expand session panel":"Collapse session panel"),ze(Fe,"title",r(m)?"Expand session panel":"Collapse session panel"),Ve=nr(tt,"",Ve,{transform:r(m)?"rotate(180deg)":"rotate(0deg)"}),Je=nr(Ue,"",Je,{height:r(S)||r(m)?"auto":`${r(p)}px`}),Pe(ve,1,Pi(r(m)?"shrink-0 h-0 overflow-hidden":"flex-1 min-h-0 overflow-auto")),ze(Ke,"aria-label",r(w)?"Expand AI prompt":"Collapse AI prompt"),ze(Ke,"title",r(w)?"Expand AI prompt":"Collapse AI prompt"),$e=nr(nt,"",$e,{transform:r(w)?"rotate(180deg)":"rotate(0deg)"}),bt=nr(ut,"",bt,{height:r(w)?"0px":r(S)?"auto":`${r(b)}px`})}),A(t,D),Dt()}Ft(["click","mousedown"]);var Tb=rr('<svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Opening picker...',1),Db=rr('<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> ',1),Ib=I('<div class="p-3 rounded-lg border border-danger-muted bg-danger-subtle text-danger-fg text-sm" role="alert"> </div>'),Mb=I('<div class="flex items-center border-b border-border-default last:border-b-0 hover:bg-bg-tertiary transition-colors"><button type="button" class="flex-1 text-left px-4 py-2.5 text-sm flex items-center gap-3 min-w-0"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> <div class="flex-1 min-w-0"><span class="text-text-primary font-medium"> </span> <span class="text-xs text-text-tertiary ml-2 truncate"> </span></div></button> <button type="button" class="shrink-0 p-2 mr-2 rounded text-text-tertiary hover:text-danger-fg hover:bg-danger-subtle transition-colors" title="Remove from recent projects"><svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor"><path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path></svg></button></div>'),Ob=I('<div class="w-full max-w-md"><h3 class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-2 px-4">Recent Projects</h3> <div class="border border-border-default rounded-lg bg-bg-secondary overflow-hidden"></div></div>'),Bb=I(`<div class="flex flex-col items-center justify-center h-full gap-6 text-text-secondary"><svg width="48" height="48" viewBox="0 0 16 16" fill="currentColor" class="text-text-tertiary"><path d="M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"></path></svg> <p class="text-lg">No project open</p> <p class="text-sm text-text-tertiary">Open a project directory to get started.</p> <div class="w-full max-w-md flex flex-col gap-3"><button type="button" class="w-full flex items-center justify-center gap-2 px-4 py-3 rounded-lg text-sm font-medium
355
+ bg-accent-emphasis hover:brightness-110 text-white
356
+ disabled:opacity-50 disabled:cursor-not-allowed
357
+ transition-all"><!></button> <div class="flex items-center gap-2"><div class="h-px flex-1 bg-border-default"></div> <span class="text-xs text-text-tertiary">or enter path</span> <div class="h-px flex-1 bg-border-default"></div></div> <form class="flex items-center gap-2"><input type="text" class="flex-1 px-3 py-2 text-sm rounded-lg border border-border-default
358
+ bg-bg-secondary text-text-primary font-mono
359
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
360
+ placeholder:text-text-tertiary" placeholder="/path/to/project"/> <button type="submit" class="px-4 py-2 rounded-lg text-sm font-medium
361
+ bg-bg-tertiary hover:bg-border-default text-text-primary
362
+ border border-border-default
363
+ disabled:opacity-50 disabled:cursor-not-allowed
364
+ transition-colors"><!></button></form> <!></div> <!></div>`);function Nb(t,e){Tt(e,!0);var i=Bb(),n=R(C(i),6),a=C(n);a.__click=()=>void e.onPickDirectory();var v=C(a);{var _=d=>{var f=Tb();A(d,f)},s=d=>{var f=Db(),y=R(Ae(f),1,!0);ee(()=>Y(y,e.chooseDirectoryLabel)),A(d,f)};H(v,d=>{e.pickingDirectory?d(_):d(s,!1)})}var o=R(a,4),h=C(o);h.__input=d=>e.onNewProjectPathChange(d.currentTarget.value);var g=R(h,2),c=C(g);{var p=d=>{var f=Xt("Opening...");A(d,f)},b=d=>{var f=Xt("Open");A(d,f)};H(c,d=>{e.newProjectLoading?d(p):d(b,!1)})}var w=R(o,2);{var m=d=>{var f=Ib(),y=C(f);ee(()=>Y(y,e.newProjectError)),A(d,f)};H(w,d=>{e.newProjectError!==null&&d(m)})}var u=R(n,2);{var l=d=>{var f=Ob(),y=R(C(f),2);At(y,21,()=>e.availableRecentProjects,E=>E.path,(E,S)=>{var L=Mb(),x=C(L);x.__click=()=>void e.onOpenRecentProject(r(S).path);var P=C(x),B=R(P,2),j=C(B),V=C(j),N=R(j,2),X=C(N),W=R(x,2);W.__click=()=>void e.onRemoveRecentProject(r(S).path),ee(()=>{ze(x,"title",r(S).path),Pe(P,0,`shrink-0 ${r(S).isGitRepo?"text-accent-fg":"text-text-tertiary"}`),Y(V,r(S).name),Y(X,r(S).path)}),A(E,L)}),A(d,f)};H(u,d=>{e.availableRecentProjects.length>0&&d(l)})}ee(d=>{a.disabled=e.pickingDirectory||e.newProjectLoading,Xs(h,e.newProjectPath),g.disabled=d},[()=>e.newProjectPath.trim().length===0||e.newProjectLoading]),Qt("submit",o,d=>{d.preventDefault();const f=e.newProjectPath.trim();f.length>0&&e.onOpenProject(f)}),A(t,i),Dt()}Ft(["click","input"]);function bl(){return{running:[],queued:[],completed:[],selectedSessionId:null,viewMode:"chat",loading:!1,error:null}}function jb(){let t=bl();function e(v){t={...t,...v}}function i(v){for(const _ of t.running)if(_.id===v)return _;for(const _ of t.queued)if(_.id===v)return _;for(const _ of t.completed)if(_.id===v)return _;return null}function n(v,_){const s=t.running.findIndex(g=>g.id===v);if(s!==-1){const g={...t.running[s],..._},c=[...t.running];c[s]=g,e({running:c});return}const o=t.queued.findIndex(g=>g.id===v);if(o!==-1){const g={...t.queued[o],..._},c=[...t.queued];c[o]=g,e({queued:c});return}const h=t.completed.findIndex(g=>g.id===v);if(h!==-1){const g={...t.completed[h],..._},c=[...t.completed];c[h]=g,e({completed:c})}}function a(v,_){const s=i(v);if(s===null)return;const o=t.running.filter(p=>p.id!==v),h=t.queued.filter(p=>p.id!==v),g=t.completed.filter(p=>p.id!==v),c={...s,state:_};switch(_){case"running":e({running:[...o,c],queued:h,completed:g});break;case"queued":e({running:o,queued:[...h,c],completed:g});break;case"completed":case"failed":case"cancelled":e({running:o,queued:h,completed:[c,...g]});break}}return{get running(){return t.running},get queued(){return t.queued},get completed(){return t.completed},get selectedSessionId(){return t.selectedSessionId},get viewMode(){return t.viewMode},get loading(){return t.loading},get error(){return t.error},async loadQueue(){e({loading:!0,error:null});try{const v=await fetch("/api/ai/sessions");if(!v.ok)throw new Error(`Failed to load sessions: ${v.statusText}`);const s=(await v.json()).sessions.map(c=>({...c,state:c.state,context:c.context,turns:[]})),o=[],h=[],g=[];for(const c of s)switch(c.state){case"running":o.push(c);break;case"queued":h.push(c);break;case"completed":case"failed":case"cancelled":g.push(c);break}e({running:o,queued:h,completed:g,loading:!1})}catch(v){const _=v instanceof Error?v.message:"Failed to load queue";e({error:_,loading:!1})}},selectSession(v){e({selectedSessionId:v})},async cancelSession(v){try{const _=await fetch(`/api/ai/sessions/${v}/cancel`,{method:"POST"});if(!_.ok)throw new Error(`Failed to cancel session: ${_.statusText}`);a(v,"cancelled")}catch(_){const s=_ instanceof Error?_.message:"Failed to cancel session";throw e({error:s}),_}},async runNow(v){try{a(v,"running")}catch(_){const s=_ instanceof Error?_.message:"Failed to run session";throw e({error:s}),_}},async removeFromQueue(v){try{const _=t.queued.filter(s=>s.id!==v);e({queued:_})}catch(_){const s=_ instanceof Error?_.message:"Failed to remove session";throw e({error:s}),_}},async reorderQueue(v,_){const s=t.queued.find(g=>g.id===v);if(s===void 0)return;const o=t.queued.filter(g=>g.id!==v),h=Math.max(0,Math.min(_,o.length));o.splice(h,0,s),e({queued:o})},async clearCompleted(){try{e({completed:[]})}catch(v){const _=v instanceof Error?v.message:"Failed to clear completed";throw e({error:_}),v}},setViewMode(v){e({viewMode:v})},getSession(v){return i(v)},handleEvent(v){const{type:_,sessionId:s,data:o}=v;switch(_){case"session_started":a(s,"running");break;case"completed":a(s,"completed");break;case"error":case"failed":a(s,"failed");break;case"cancelled":a(s,"cancelled");break;case"thinking":n(s,{currentActivity:"Thinking..."});break;case"tool_use":o&&typeof o=="object"&&"toolName"in o&&n(s,{currentActivity:`Using ${o.toolName}...`});break;case"message":n(s,{currentActivity:void 0});break}},reset(){t=bl()}}}function yl(){return{sessions:[],total:0,projects:[],selectedSessionId:null,filters:{},pagination:{offset:0,limit:50},isLoading:!1,error:null}}let vr=null;function Fb(){let t=yl();const e=new Set;async function i(s){if(!(typeof s.json=="function"))return s.statusText;const h=await s.json().catch(()=>({error:s.statusText}));return typeof h=="object"&&h!==null&&"error"in h&&typeof h.error=="string"&&h.error.length>0?h.error:s.statusText}async function n(){var s,o;try{const h=await fetch("/api/workspace");if(!h.ok)return!1;const c=(s=(await h.json()).workspace)==null?void 0:s.tabs,p=(o=c==null?void 0:c[0])==null?void 0:o.id;if(typeof p=="string"&&p.length>0)return vr=p,!0}catch{}return!1}function a(){e.forEach(s=>s())}function v(s){t={...t,...s},a()}function _(){var o,h;const s=new URLSearchParams;return t.filters.workingDirectoryPrefix!==void 0&&s.set("workingDirectoryPrefix",t.filters.workingDirectoryPrefix),t.filters.source!==void 0&&s.set("source",t.filters.source),t.filters.branch!==void 0&&s.set("branch",t.filters.branch),t.filters.searchQuery!==void 0&&s.set("search",t.filters.searchQuery),((o=t.filters.dateRange)==null?void 0:o.from)!==void 0&&s.set("dateFrom",t.filters.dateRange.from),((h=t.filters.dateRange)==null?void 0:h.to)!==void 0&&s.set("dateTo",t.filters.dateRange.to),s.set("offset",String(t.pagination.offset)),s.set("limit",String(t.pagination.limit)),s.set("sortBy","modified"),s.set("sortOrder","desc"),s}return{get sessions(){return t.sessions},get total(){return t.total},get projects(){return t.projects},get selectedSessionId(){return t.selectedSessionId},get filters(){return t.filters},get pagination(){return t.pagination},get isLoading(){return t.isLoading},get error(){return t.error},setContextId(s){vr=s},subscribe(s){return e.add(s),()=>{e.delete(s)}},async fetchProjects(){if(vr===null){v({error:"Context ID not set",isLoading:!1});return}v({isLoading:!0,error:null});try{let s=await fetch(`/api/ctx/${vr}/claude-sessions/projects`);if(!s.ok){const h=await i(s);s.status===404&&h.includes("Context not found")&&await n()&&vr!==null&&(s=await fetch(`/api/ctx/${vr}/claude-sessions/projects`))}if(!s.ok){const h=await i(s);throw new Error(`Failed to load projects: ${h}`)}const o=await s.json();v({projects:o,isLoading:!1})}catch(s){const o=s instanceof Error?s.message:"Failed to load projects";v({error:o,isLoading:!1})}},async fetchSessions(s){s!==void 0&&v({filters:{...t.filters,...s},pagination:{...t.pagination,offset:0}}),v({isLoading:!0,error:null});try{if(vr===null){v({error:"Context ID not set",isLoading:!1});return}const o=_();let h=await fetch(`/api/ctx/${vr}/claude-sessions/sessions?${o.toString()}`);if(!h.ok){const c=await i(h);h.status===404&&c.includes("Context not found")&&await n()&&vr!==null&&(h=await fetch(`/api/ctx/${vr}/claude-sessions/sessions?${o.toString()}`))}if(!h.ok){const c=await i(h);throw new Error(`Failed to load sessions: ${c}`)}const g=await h.json();v({sessions:g.sessions,total:g.total,pagination:{offset:g.offset,limit:g.limit},isLoading:!1})}catch(o){const h=o instanceof Error?o.message:"Failed to load sessions";v({error:h,isLoading:!1})}},selectSession(s){v({selectedSessionId:s})},setFilters(s){const o={...t.filters};s.workingDirectoryPrefix!==void 0&&(o.workingDirectoryPrefix=s.workingDirectoryPrefix),s.source!==void 0&&(o.source=s.source),s.branch!==void 0&&(o.branch=s.branch),s.searchQuery!==void 0&&(o.searchQuery=s.searchQuery),s.dateRange!==void 0&&(o.dateRange=s.dateRange),v({filters:o,pagination:{...t.pagination,offset:0}}),this.fetchSessions()},setInitialFilters(s){const o={...t.filters};s.workingDirectoryPrefix!==void 0&&(o.workingDirectoryPrefix=s.workingDirectoryPrefix),s.source!==void 0&&(o.source=s.source),s.branch!==void 0&&(o.branch=s.branch),s.searchQuery!==void 0&&(o.searchQuery=s.searchQuery),s.dateRange!==void 0&&(o.dateRange=s.dateRange),v({filters:o,pagination:{...t.pagination,offset:0}})},clearFilters(){v({filters:{},pagination:{...t.pagination,offset:0}}),this.fetchSessions()},clearError(){v({error:null})},async loadMore(){const s=t.pagination.offset+t.pagination.limit;v({pagination:{...t.pagination,offset:s},isLoading:!0,error:null});try{if(vr===null){v({error:"Context ID not set",isLoading:!1});return}const o=_();let h=await fetch(`/api/ctx/${vr}/claude-sessions/sessions?${o.toString()}`);if(!h.ok){const c=await i(h);h.status===404&&c.includes("Context not found")&&await n()&&vr!==null&&(h=await fetch(`/api/ctx/${vr}/claude-sessions/sessions?${o.toString()}`))}if(!h.ok){const c=await i(h);throw new Error(`Failed to load sessions: ${c}`)}const g=await h.json();v({sessions:[...t.sessions,...g.sessions],total:g.total,pagination:{offset:g.offset,limit:g.limit},isLoading:!1})}catch(o){const h=o instanceof Error?o.message:"Failed to load more sessions";v({error:h,isLoading:!1})}},async resumeSession(s,o){v({isLoading:!0,error:null});try{if(vr===null)throw new Error("Context ID not set");let h=await fetch(`/api/ctx/${vr}/claude-sessions/sessions/${s}/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:o})});if(!h.ok){const c=await i(h);h.status===404&&c.includes("Context not found")&&await n()&&vr!==null&&(h=await fetch(`/api/ctx/${vr}/claude-sessions/sessions/${s}/resume`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:o})}))}if(!h.ok){const c=await i(h);throw new Error(`Failed to resume session: ${c}`)}const g=await h.json();return v({isLoading:!1}),g}catch(h){const g=h instanceof Error?h.message:"Failed to resume session";throw v({error:g,isLoading:!1}),h}},reset(){t=yl(),a()}}}const Dr=Fb();var Hb=I('<span class="text-[10px] text-text-tertiary animate-pulse truncate"> </span>'),Vb=I('<div class="flex items-center gap-1.5 mt-0.5 text-[10px] text-text-tertiary"><svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg> <span class="truncate"> <!></span></div>'),Wb=I(`<div class="running-session animate-session-glow border border-accent-emphasis/50
365
+ rounded-lg overflow-hidden bg-accent-muted/30" role="article" aria-label="Running session"><div class="flex items-center gap-2 px-3 py-1.5"><svg class="animate-spin-smooth h-3.5 w-3.5 text-accent-fg shrink-0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg> <span class="text-xs font-medium text-accent-fg shrink-0">Running</span> <!> <span class="flex-1"></span> <span class="text-xs font-mono text-text-tertiary tabular-nums shrink-0" aria-label="Elapsed time"> </span> <button type="button" class="shrink-0 px-1.5 py-0.5 text-[10px] font-medium rounded
366
+ bg-danger-emphasis/10 text-danger-fg hover:bg-danger-emphasis/20
367
+ border border-danger-emphasis/30 transition-colors" aria-label="Cancel session" title="Cancel">Cancel</button></div> <button type="button" class="w-full px-3 py-1.5 text-left border-t border-accent-emphasis/20
368
+ hover:bg-accent-emphasis/5 transition-colors
369
+ focus:outline-none focus:ring-1 focus:ring-inset focus:ring-accent-emphasis"><p class="text-xs text-text-primary truncate"> </p> <!></button></div>`);function Ub(t,e){Tt(e,!0);let i=K(0);St(()=>{if(e.session.startedAt===void 0){k(i,0);return}const l=new Date(e.session.startedAt).getTime(),d=()=>{k(i,Math.floor((Date.now()-l)/1e3),!0)};d();const f=setInterval(d,1e3);return()=>clearInterval(f)});const n=ge(()=>{const l=Math.floor(r(i)/60),d=r(i)%60;return`${l}:${d.toString().padStart(2,"0")}`});function a(l,d=80){return l.length<=d?l:l.slice(0,d)+"..."}var v=Wb(),_=C(v),s=R(C(_),4);{var o=l=>{var d=Hb(),f=C(d);ee(()=>Y(f,e.session.currentActivity)),A(l,d)};H(s,l=>{e.session.currentActivity&&l(o)})}var h=R(s,4),g=C(h),c=R(h,2);c.__click=l=>{l.stopPropagation(),e.onCancel()};var p=R(_,2);p.__click=function(...l){var d;(d=e.onSelect)==null||d.apply(this,l)};var b=C(p),w=C(b),m=R(b,2);{var u=l=>{var d=Vb(),f=R(C(d),2),y=C(f),E=R(y);{var S=x=>{var P=Xt();ee(()=>Y(P,`:L${e.session.context.primaryFile.startLine??""}-${e.session.context.primaryFile.endLine??""}`)),A(x,P)},L=x=>{var P=Xt();ee(()=>Y(P,`:L${e.session.context.primaryFile.startLine??""}`)),A(x,P)};H(E,x=>{e.session.context.primaryFile.startLine!==e.session.context.primaryFile.endLine?x(S):x(L,!1)})}ee(()=>Y(y,`${e.session.context.primaryFile.path??""} `)),A(l,d)};H(m,l=>{e.session.context.primaryFile!==void 0&&l(u)})}ee(l=>{Y(g,r(n)),Y(w,l)},[()=>a(e.session.prompt)]),A(t,v),Dt()}Ft(["click"]);var zb=rr('<svg class="animate-spin-smooth h-4 w-4 text-accent-fg shrink-0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg>'),qb=I('<span aria-hidden="true"></span>'),Gb=I('<span class="text-xs text-text-tertiary animate-pulse"> </span>'),Kb=I('<div class="flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline></svg> <span class="text-xs text-text-tertiary truncate"> </span></div>'),Jb=I(`<button type="button" class="p-2 min-w-[36px] min-h-[36px]
370
+ bg-danger-emphasis/20 text-danger-fg hover:bg-danger-emphasis/30
371
+ rounded transition-colors
372
+ focus:outline-none focus:ring-2 focus:ring-danger-emphasis" aria-label="Cancel session" title="Cancel"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg></button>`),Qb=I(`<button type="button" class="p-2 min-w-[36px] min-h-[36px]
373
+ bg-success-emphasis/20 text-success-fg hover:bg-success-emphasis/30
374
+ rounded transition-colors
375
+ focus:outline-none focus:ring-2 focus:ring-success-emphasis" aria-label="Run now" title="Run Now"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg></button>`),Xb=I(`<button type="button" class="p-2 min-w-[36px] min-h-[36px]
376
+ bg-attention-emphasis/20 text-attention-fg hover:bg-attention-emphasis/30
377
+ rounded transition-colors
378
+ focus:outline-none focus:ring-2 focus:ring-attention-emphasis" aria-label="Cancel" title="Cancel"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>`),Yb=I("<!> <!>",1),Zb=I(`<button type="button" class="p-2 min-w-[36px] min-h-[36px]
379
+ bg-bg-tertiary text-text-tertiary hover:text-danger-fg hover:bg-danger-emphasis/20
380
+ rounded transition-colors
381
+ focus:outline-none focus:ring-2 focus:ring-danger-emphasis" aria-label="Remove" title="Remove"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg></button>`),$b=I(`<div role="article"><div class="w-full p-4 min-h-[80px] text-left cursor-pointer select-text"><div class="flex items-start justify-between gap-3 mb-2"><div class="flex items-center gap-2 flex-shrink-0"><!> <span class="text-xs font-medium text-text-secondary"> </span> <!></div> <span class="text-xs text-text-tertiary flex-shrink-0"> </span></div> <p class="text-sm text-text-primary mb-2 line-clamp-2 svelte-ri5kqm"> </p> <!></div> <div class="absolute bottom-2 right-2 flex items-center gap-1
382
+ opacity-0 group-hover:opacity-100 group-focus-within:opacity-100
383
+ transition-opacity duration-150"><!> <!> <!></div></div>`);function ey(t,e){Tt(e,!0);const i=We(e,"onCancel",3,void 0),n=We(e,"onRunNow",3,void 0),a=We(e,"onRemove",3,void 0);function v(T){switch(T){case"running":return"bg-accent-emphasis";case"queued":return"bg-attention-emphasis";case"completed":return"bg-success-emphasis";case"failed":return"bg-danger-emphasis";case"cancelled":return"bg-bg-emphasis";default:return"bg-bg-emphasis"}}function _(T){switch(T){case"running":return"Running";case"queued":return"Queued";case"completed":return"Completed";case"failed":return"Failed";case"cancelled":return"Cancelled";default:return"Unknown"}}function s(T){const M=new Date(T),J=new Date().getTime()-M.getTime(),Z=Math.floor(J/1e3),re=Math.floor(Z/60),se=Math.floor(re/60),G=Math.floor(se/24);return Z<60?"just now":re<60?`${re}m ago`:se<24?`${se}h ago`:`${G}d ago`}function o(T,M=100){return T.length<=M?T:T.slice(0,M)+"..."}const h=ge(()=>{if(e.session.context.primaryFile!==void 0){const T=e.session.context.primaryFile,M=T.startLine===T.endLine?`L${T.startLine}`:`L${T.startLine}-${T.endLine}`;return`${T.path}:${M}`}if(e.session.context.references.length>0){const T=e.session.context.references[0],M=e.session.context.references.length>1?` +${e.session.context.references.length-1}`:"";return`${T.path}${M}`}return null});function g(){const T=window.getSelection();T!==null&&T.toString().length>0||e.onSelect()}function c(T,M){T.stopPropagation(),M!==void 0&&M()}var p=$b(),b=C(p);b.__click=g;var w=C(b),m=C(w),u=C(m);{var l=T=>{var M=zb();A(T,M)},d=T=>{var M=qb();ee(z=>Pe(M,1,`inline-block w-2 h-2 rounded-full ${z??""}`,"svelte-ri5kqm"),[()=>v(e.session.state)]),A(T,M)};H(u,T=>{e.variant==="running"?T(l):T(d,!1)})}var f=R(u,2),y=C(f),E=R(f,2);{var S=T=>{var M=Gb(),z=C(M);ee(()=>Y(z,e.session.currentActivity)),A(T,M)};H(E,T=>{e.variant==="running"&&e.session.currentActivity&&T(S)})}var L=R(m,2),x=C(L),P=R(w,2),B=C(P),j=R(P,2);{var V=T=>{var M=Kb(),z=R(C(M),2),J=C(z);ee(()=>Y(J,r(h))),A(T,M)};H(j,T=>{r(h)!==null&&T(V)})}var N=R(b,2),X=C(N);{var W=T=>{var M=Jb();M.__click=z=>c(z,i()),A(T,M)};H(X,T=>{e.variant==="running"&&i()!==void 0&&T(W)})}var Q=R(X,2);{var ne=T=>{var M=Yb(),z=Ae(M);{var J=se=>{var G=Qb();G.__click=O=>c(O,n()),A(se,G)};H(z,se=>{n()!==void 0&&se(J)})}var Z=R(z,2);{var re=se=>{var G=Xb();G.__click=O=>c(O,i()),A(se,G)};H(Z,se=>{i()!==void 0&&se(re)})}A(T,M)};H(Q,T=>{e.variant==="queued"&&T(ne)})}var le=R(Q,2);{var D=T=>{var M=Zb();M.__click=z=>c(z,a()),A(T,M)};H(le,T=>{e.variant==="completed"&&a()!==void 0&&T(D)})}ee((T,M,z,J)=>{Pe(p,1,`session-card group relative border
384
+ rounded-lg overflow-hidden
385
+ ${e.variant==="running"?"animate-session-glow border-accent-emphasis/50":"bg-bg-secondary border-border-default hover:border-accent-emphasis/50 hover:bg-bg-hover"}
386
+ transition-colors duration-150`),ze(p,"aria-label",T),Y(y,M),Y(x,z),Y(B,J)},[()=>`Session: ${o(e.session.prompt,50)}`,()=>_(e.session.state),()=>s(e.session.createdAt),()=>o(e.session.prompt)]),A(t,p),Dt()}Ft(["click"]);var ty=I('<div class="py-6"></div>'),ry=I('<section aria-labelledby="running-heading"><h2 id="running-heading" class="text-sm font-semibold text-text-secondary mb-3 flex items-center gap-2"><svg class="animate-spin-smooth h-4 w-4 text-accent-fg shrink-0" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg> </h2> <div class="space-y-3"></div></section>'),iy=I('<section aria-labelledby="queued-heading"><h2 id="queued-heading" class="text-sm font-semibold text-text-secondary mb-3 flex items-center gap-2"><span class="inline-block w-2 h-2 rounded-full bg-attention-emphasis"></span> </h2> <div class="space-y-3"></div></section>'),ny=I("<!> <!>",1),sy=I('<div class="active-sessions-panel space-y-6"><!></div>');function oy(t,e){Tt(e,!0);const i=ge(()=>e.running.length===0&&e.queued.length===0);var n=sy(),a=C(n);{var v=s=>{var o=ty();A(s,o)},_=s=>{var o=ny(),h=Ae(o);{var g=b=>{var w=ry(),m=C(w),u=R(C(m)),l=R(m,2);At(l,21,()=>e.running,d=>d.id,(d,f)=>{Ub(d,{get session(){return r(f)},onCancel:()=>e.onCancelSession(r(f).id),onSelect:()=>e.onSelectSession(r(f))})}),ee(()=>Y(u,` RUNNING (${e.running.length??""})`)),A(b,w)};H(h,b=>{e.running.length>0&&b(g)})}var c=R(h,2);{var p=b=>{var w=iy(),m=C(w),u=R(C(m)),l=R(m,2);At(l,23,()=>e.queued,d=>d.id,(d,f,y)=>{{let E=ge(()=>r(y)===0?()=>e.onRunNow(r(f).id):void 0);ey(d,{get session(){return r(f)},variant:"queued",onSelect:()=>e.onSelectSession(r(f)),onCancel:()=>e.onCancelSession(r(f).id),get onRunNow(){return r(E)},onRemove:()=>e.onRemoveFromQueue(r(f).id)})}}),ee(()=>Y(u,` QUEUED (${e.queued.length??""})`)),A(b,w)};H(c,b=>{e.queued.length>0&&b(p)})}A(s,o)};H(a,s=>{r(i)?s(v):s(_,!1)})}A(t,n),Dt()}var ay=I(`<button type="button" class="absolute right-1 top-1/2 -translate-y-1/2
387
+ p-1 rounded
388
+ text-text-tertiary hover:text-text-primary hover:bg-bg-hover
389
+ transition-colors duration-150
390
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis" aria-label="Clear search" title="Clear search (Esc)"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button>`),ly=I(`<div><div class="absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none
391
+ text-text-tertiary" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg></div> <input type="text" class="w-full pl-7 pr-7 py-1 text-sm rounded-md
392
+ bg-bg-secondary border border-bg-border
393
+ text-text-primary placeholder-text-tertiary
394
+ focus:outline-none focus:ring-1 focus:ring-accent-emphasis focus:border-transparent
395
+ transition-all duration-200" aria-label="Search" autocomplete="off" spellcheck="false"/> <!></div>`);function yd(t,e){Tt(e,!0);const i=We(e,"placeholder",3,"Search sessions..."),n=We(e,"debounceMs",3,300);let a=K(gt(e.value)),v=K(null),_=K(!1);St(()=>{k(a,e.value,!0)});function s(w){const m=w.target;k(a,m.value,!0),r(v)!==null&&clearTimeout(r(v)),k(v,window.setTimeout(()=>{e.onSearch(r(a)),k(v,null)},n()),!0)}function o(){k(a,""),e.onSearch(""),r(v)!==null&&(clearTimeout(r(v)),k(v,null))}function h(w){w.key==="Escape"&&(w.preventDefault(),o())}var g=ly(),c=R(C(g),2);c.__input=s,c.__keydown=h;var p=R(c,2);{var b=w=>{var m=ay();m.__click=o,A(w,m)};H(p,w=>{r(a).length>0&&w(b)})}ee(()=>{Pe(g,1,`search-input relative ml-auto ${r(_)?"w-56":"w-36"} transition-all duration-200`),Xs(c,r(a)),ze(c,"placeholder",i())}),Qt("focus",c,()=>k(_,!0)),Qt("blur",c,()=>k(_,!1)),A(t,g),Dt()}Ft(["input","keydown","click"]);var cy=I(`<div class="error-banner mx-6 mt-4 p-4 rounded-lg border border-danger-emphasis/30
396
+ bg-danger-emphasis/10 text-danger-fg" role="alert"><div class="flex items-start gap-3"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0 mt-0.5" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> <div class="flex-1"><p class="font-medium">Error Loading Sessions</p> <p class="text-sm mt-1"> </p></div> <button type="button" class="p-1 rounded hover:bg-danger-emphasis/20 transition-colors" aria-label="Dismiss error"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></div>`),dy=I('<div class="loading-state flex flex-col items-center justify-center h-64" role="status" aria-live="polite"><svg class="animate-spin h-8 w-8 text-accent-fg mb-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <p class="text-text-secondary">Loading sessions...</p></div>'),uy=I('<div class="empty-state flex flex-col items-center justify-center h-64" role="status"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary mb-4" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg> <p class="text-text-secondary text-lg mb-2">No sessions found</p> <p class="text-text-tertiary text-sm"><!></p></div>'),hy=I('<span class="text-xs text-text-tertiary shrink-0"> </span>'),fy=I('<div class="flex items-center gap-2 px-4 py-2 bg-bg-tertiary/30 border-b border-border-default"><button type="button" class="shrink-0 px-2.5 py-0.5 text-xs font-medium rounded bg-bg-tertiary hover:bg-bg-hover text-text-primary border border-border-default">Resume</button> <span class="text-text-tertiary text-xs">|</span> <svg class="animate-spin h-3 w-3 text-text-tertiary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="text-xs text-text-tertiary">Loading summary...</span> <span class="text-text-tertiary text-xs">|</span> <span class="text-[10px] font-mono text-text-tertiary"> </span> <button type="button" class="px-1.5 py-0.5 text-[10px] rounded border border-border-default text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors" title="Copy session ID"> </button></div>'),vy=I('<span class="text-text-tertiary text-xs">|</span>'),_y=I('<span class="inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono bg-bg-tertiary text-text-secondary"> <span class="text-text-tertiary"> </span></span>'),py=I('<span class="text-[10px] text-text-tertiary"> </span>'),gy=I('<span class="text-text-tertiary text-xs mx-1">|</span>'),my=I('<button type="button" class="text-[11px] text-text-secondary hover:text-accent-fg transition-colors"> </button>'),by=I('<span class="text-text-tertiary text-xs">|</span>'),yy=I('<!> <button type="button" class="text-[11px] text-text-secondary hover:text-accent-fg transition-colors"> </button>',1),xy=I("<span> </span>"),wy=I("<span> </span>"),Sy=I('<div class="flex items-center gap-3 mt-1.5 text-[10px] font-mono text-text-tertiary"><span> </span> <span> </span> <!> <!></div>'),Cy=I('<div class="flex items-center gap-2 py-0.5 text-[11px]"><span> </span> <span class="text-text-secondary font-mono truncate"> </span></div>'),ky=I('<div class="mt-2 space-y-0.5"></div>'),Ey=I('<div class="flex items-center gap-2 py-0.5 text-[11px]"><span></span> <span class="text-text-primary truncate"> </span> <span class="text-text-tertiary shrink-0"> </span></div>'),Ly=I('<div class="mt-2 space-y-0.5"></div>'),Py=I('<div class="px-4 py-2 bg-bg-tertiary/30 border-b border-border-default"><div class="flex items-center gap-2 flex-wrap"><button type="button" class="shrink-0 px-2.5 py-0.5 text-xs font-medium rounded bg-bg-tertiary hover:bg-bg-hover text-text-primary border border-border-default">Resume</button> <!> <!> <!> <!> <!> <!></div> <!> <div class="flex items-center gap-2 mt-1 text-[10px] font-mono text-text-tertiary"><span> </span> <button type="button" class="px-1.5 py-0.5 text-[10px] rounded border border-border-default text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors" title="Copy session ID"> </button></div> <!> <!></div>'),Ry=I('<div class="flex items-center gap-2 px-4 py-2 bg-bg-tertiary/30 border-b border-border-default"><button type="button" class="shrink-0 px-2.5 py-0.5 text-xs font-medium rounded bg-bg-tertiary hover:bg-bg-hover text-text-primary border border-border-default">Resume</button> <span class="text-[10px] font-mono text-text-tertiary"> </span> <button type="button" class="px-1.5 py-0.5 text-[10px] rounded border border-border-default text-text-secondary hover:text-text-primary hover:bg-bg-hover transition-colors" title="Copy session ID"> </button></div>'),Ay=I('<div class="border-l-4 border-success-emphasis bg-bg-secondary rounded-r"><div class="px-3 py-1.5"><span class="text-[10px] font-semibold px-1.5 py-0.5 rounded bg-success-muted text-success-fg">assistant</span></div> <div class="px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words text-text-primary max-h-[300px] overflow-y-auto"> </div></div>'),Ty=I('<div class="text-xs text-success-fg py-2">Session completed.</div>'),Dy=I('<div class="px-4 py-3"><div class="border-l-4 border-accent-emphasis bg-bg-secondary rounded-r mb-2"><div class="px-3 py-1.5"><span class="text-[10px] font-semibold px-1.5 py-0.5 rounded bg-accent-muted text-accent-fg">user</span></div> <div class="px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words text-text-primary"> </div></div> <!></div>'),Iy=I('<div class="border-x border-b border-accent-emphasis/40 rounded-b-lg overflow-hidden"><!> <!></div>'),My=I(`<div class="contents"><div role="button"><svg viewBox="0 0 16 16" fill="currentColor"><path d="M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"></path></svg> <button type="button" class="shrink-0 px-2 py-0.5 text-[10px] font-medium rounded
397
+ bg-accent-muted/60 hover:bg-accent-muted text-accent-fg
398
+ border border-accent-emphasis/30 hover:border-accent-emphasis/60
399
+ transition-colors" title="Resume this session">Resume</button> <span> </span> <span class="flex-1 text-sm text-text-primary truncate"> </span> <!> <span class="text-xs text-text-tertiary shrink-0"> </span></div> <!></div>`),Oy=I('<section aria-labelledby="history-today-heading"><h2 id="history-today-heading" class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3">Today</h2> <div></div></section>'),By=I('<section aria-labelledby="history-yesterday-heading"><h2 id="history-yesterday-heading" class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3">Yesterday</h2> <div></div></section>'),Ny=I('<section aria-labelledby="history-older-heading"><h2 id="history-older-heading" class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-3">Older</h2> <div></div></section>'),jy=I('<span class="flex items-center gap-2"><svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Loading...</span>'),Fy=I(`<div class="pagination mt-6 flex justify-center"><button type="button" class="px-6 py-3 rounded-lg text-sm font-medium
400
+ bg-bg-secondary hover:bg-bg-hover text-text-primary
401
+ border border-bg-border hover:border-accent-emphasis/30
402
+ disabled:opacity-50 disabled:cursor-not-allowed
403
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
404
+ transition-all duration-150" aria-label="Load more sessions"><!></button></div>`),Hy=I('<div class="session-list space-y-6" role="list"><!> <!> <!></div> <!>',1),Vy=I('<div class="history-sessions-panel flex flex-col h-full" role="region" aria-label="Session history"><div class="flex items-center gap-3 px-6 py-3 border-b border-bg-border bg-bg-secondary"><div class="text-sm text-text-tertiary shrink-0"><!></div> <div class="flex-1"></div> <!></div> <!> <div class="content-area flex-1 overflow-y-auto px-6 pb-4"><!></div></div>');function Wy(t,e){Tt(e,!0);let i=K(gt(new Set)),n=K(gt(new Map)),a=K(gt(new Set)),v=K(gt(new Set)),_=K(gt(new Set)),s=K(null),o=K(gt([])),h=K(0),g=K(!1),c=K(null),p=K(gt({}));function b(){k(o,Dr.sessions,!0),k(h,Dr.total,!0),k(g,Dr.isLoading,!0),k(c,Dr.error,!0),k(p,Dr.filters,!0)}function w(U){const $=new Date(U),be=new Date,xe=new Date(be.getFullYear(),be.getMonth(),be.getDate()),ae=new Date(xe.getTime()-1440*60*1e3);return $>=xe?"today":$>=ae?"yesterday":"older"}const m=ge(()=>{const U={today:[],yesterday:[],older:[]};for(const $ of r(o)){const be=w($.modified);U[be].push($)}return U}),u=ge(()=>r(o).length>0),l=ge(()=>r(o).length<r(h)),d=ge(()=>r(o).length);function f(U){Dr.setFilters({searchQuery:U||void 0}),setTimeout(b,100)}async function y(){k(g,!0),await Dr.loadMore(),b()}function E(){Dr.clearError(),b()}function S(U){return U.qraftAiSessionId}function L(U){const $=new Set(r(i));$.has(U)?$.delete(U):($.add(U),x(U)&&P(U)),k(i,$,!0)}function x(U){const $=r(o).find(be=>be.qraftAiSessionId===U);return $!==void 0&&$.fullPath.length>0}async function P(U){if(!(r(n).has(U)||r(a).has(U))){k(a,new Set([...r(a),U]),!0);try{const $=await fetch(`/api/ctx/${e.contextId}/claude-sessions/sessions/${U}/summary`);if($.ok){const be=await $.json(),xe=new Map(r(n));xe.set(U,be),k(n,xe,!0)}}catch{}finally{const $=new Set(r(a));$.delete(U),k(a,$,!0)}}}function B(U){const $=new Set(r(v));$.has(U)?$.delete(U):$.add(U),k(v,$,!0)}function j(U){const $=new Set(r(_));$.has(U)?$.delete(U):$.add(U),k(_,$,!0)}function V(U){const $=U.split("/");return $.length<=2?U:".../"+$.slice(-2).join("/")}function N(U){const $=new Date(U),xe=new Date().getTime()-$.getTime(),ae=Math.floor(xe/6e4),he=Math.floor(xe/36e5),fe=Math.floor(xe/864e5);return ae<1?"just now":ae<60?`${ae} min${ae>1?"s":""} ago`:he<24?`${he}h ago`:fe===1?"yesterday":fe<7?`${fe}d ago`:`${Math.floor(fe/7)}w ago`}function X(U){switch(U){case"completed":return"bg-success-emphasis";case"in_progress":return"bg-attention-emphasis";default:return"bg-border-default"}}function W(U){return U>=1e6?`${(U/1e6).toFixed(1)}M`:U>=1e3?`${(U/1e3).toFixed(1)}k`:U.toString()}function Q(U){return U.length<=16?U:`${U.slice(0,8)}...${U.slice(-4)}`}async function ne(U){try{await navigator.clipboard.writeText(U),k(s,U,!0),setTimeout(()=>{r(s)===U&&k(s,null)},1500)}catch{}}function le(U){const $=window.getSelection();$!==null&&$.toString().length>0||L(U)}St(()=>{const U=Dr.subscribe(()=>b());return b(),()=>{U()}});var D=Vy(),T=C(D),M=C(T),z=C(M);{var J=U=>{var $=Xt();ee(()=>Y($,`${r(d)??""} session${r(d)!==1?"s":""}`)),A(U,$)};H(z,U=>{r(d)>0&&U(J)})}var Z=R(M,4);{let U=ge(()=>r(p).searchQuery??"");yd(Z,{get value(){return r(U)},onSearch:f})}var re=R(T,2);{var se=U=>{var $=cy(),be=C($),xe=R(C(be),2),ae=R(C(xe),2),he=C(ae),fe=R(xe,2);fe.__click=E,ee(()=>Y(he,r(c))),A(U,$)};H(re,U=>{r(c)&&U(se)})}var G=R(re,2),O=C(G);{var ie=U=>{var $=dy();A(U,$)},F=U=>{var $=et(),be=Ae($);{var xe=he=>{var fe=uy(),Ee=R(C(fe),4),He=C(Ee);{var Le=Te=>{var De=Xt("Try adjusting your search query.");A(Te,De)},ce=Te=>{var De=Xt("No sessions found for this project.");A(Te,De)};H(He,Te=>{r(p).searchQuery?Te(Le):Te(ce,!1)})}A(he,fe)},ae=he=>{var fe=Hy(),Ee=Ae(fe);{const Ne=(Me,Fe=ws,tt=ws)=>{const Ve=ge(()=>Fe().qraftAiSessionId),Xe=ge(()=>r(i).has(r(Ve))),Ue=ge(()=>r(n).get(r(Ve))),Je=ge(()=>r(a).has(r(Ve))),ve=ge(()=>r(Ue)!==void 0&&(r(Ue).toolUsage.length>0||r(Ue).filesModified.length>0||r(Ue).tasks.length>0)),_e=ge(()=>Fe().source==="qraftbox"),Oe=ge(()=>Ur(Fe().firstPrompt));var Ke=My(),nt=C(Ke);nt.__click=()=>le(r(Ve)),nt.__keydown=je=>{(je.key==="Enter"||je.key===" ")&&(je.preventDefault(),L(r(Ve)))},ze(nt,"tabindex",0);var $e=C(nt),dt=R($e,2);dt.__click=je=>{je.stopPropagation(),e.onResumeSession(r(Ve))};var ut=R(dt,2),bt=C(ut),lt=R(ut,2),ye=C(lt),te=R(lt,2);{var oe=je=>{var Ye=hy(),rt=C(Ye);ee(()=>Y(rt,`${Fe().messageCount??""} msgs`)),A(je,Ye)};H(te,je=>{Fe().messageCount>0&&je(oe)})}var me=R(te,2),Ie=C(me),we=R(nt,2);{var Re=je=>{var Ye=Iy(),rt=C(Ye);{var ht=Ze=>{var at=fy(),ft=C(at);ft.__click=()=>e.onResumeSession(r(Ve));var mt=R(ft,10),xt=C(mt),pt=R(mt,2);pt.__click=()=>ne(r(Ve));var it=C(pt);ee(Et=>{ze(mt,"title",r(Ve)),Y(xt,`sid:${Et??""}`),Y(it,r(s)===r(Ve)?"Copied":"Copy")},[()=>Q(r(Ve))]),A(Ze,at)},_t=Ze=>{var at=et(),ft=Ae(at);{var mt=pt=>{var it=Py(),Et=C(it),Pt=C(Et);Pt.__click=()=>e.onResumeSession(r(Ve));var qt=R(Pt,2);{var Wt=qe=>{var ot=vy();A(qe,ot)};H(qt,qe=>{r(ve)&&qe(Wt)})}var Lt=R(qt,2);At(Lt,17,()=>r(Ue).toolUsage.slice(0,6),Pr,(qe,ot)=>{var wt=_y(),yt=C(wt),Rt=R(yt),Vt=C(Rt);ee(()=>{Y(yt,r(ot).name),Y(Vt,`:${r(ot).count??""}`)}),A(qe,wt)});var ue=R(Lt,2);{var Ct=qe=>{var ot=py(),wt=C(ot);ee(()=>Y(wt,`+${r(Ue).toolUsage.length-6} more`)),A(qe,ot)};H(ue,qe=>{r(Ue).toolUsage.length>6&&qe(Ct)})}var Ht=R(ue,2);{var Gt=qe=>{var ot=gy();A(qe,ot)};H(Ht,qe=>{(r(Ue).filesModified.length>0||r(Ue).tasks.length>0)&&qe(Gt)})}var Nt=R(Ht,2);{var Ot=qe=>{var ot=my();ot.__click=()=>j(r(Ve));var wt=C(ot);ee(()=>Y(wt,`${r(Ue).filesModified.length??""} file${r(Ue).filesModified.length!==1?"s":""}`)),A(qe,ot)};H(Nt,qe=>{r(Ue).filesModified.length>0&&qe(Ot)})}var ir=R(Nt,2);{var Br=qe=>{var ot=yy(),wt=Ae(ot);{var yt=Kt=>{var Yt=by();A(Kt,Yt)};H(wt,Kt=>{r(Ue).filesModified.length>0&&Kt(yt)})}var Rt=R(wt,2);Rt.__click=()=>B(r(Ve));var Vt=C(Rt);ee(()=>Y(Vt,`${r(Ue).tasks.length??""} task${r(Ue).tasks.length!==1?"s":""}`)),A(qe,ot)};H(ir,qe=>{r(Ue).tasks.length>0&&qe(Br)})}var dr=R(Et,2);{var ur=qe=>{var ot=Sy(),wt=C(ot),yt=C(wt),Rt=R(wt,2),Vt=C(Rt),Kt=R(Rt,2);{var Yt=tr=>{var fr=xy(),ri=C(fr);ee(bi=>Y(ri,`cache-w:${bi??""}`),[()=>W(r(Ue).usage.cacheCreationTokens)]),A(tr,fr)};H(Kt,tr=>{r(Ue).usage.cacheCreationTokens>0&&tr(Yt)})}var hr=R(Kt,2);{var Zt=tr=>{var fr=wy(),ri=C(fr);ee(bi=>Y(ri,`cache-r:${bi??""}`),[()=>W(r(Ue).usage.cacheReadTokens)]),A(tr,fr)};H(hr,tr=>{r(Ue).usage.cacheReadTokens>0&&tr(Zt)})}ee((tr,fr)=>{Y(yt,`in:${tr??""}`),Y(Vt,`out:${fr??""}`)},[()=>W(r(Ue).usage.inputTokens),()=>W(r(Ue).usage.outputTokens)]),A(qe,ot)};H(dr,qe=>{r(Ue).usage!==void 0&&(r(Ue).usage.inputTokens>0||r(Ue).usage.outputTokens>0)&&qe(ur)})}var Sr=R(dr,2),Cr=C(Sr),ti=C(Cr),ci=R(Cr,2);ci.__click=()=>ne(r(Ve));var qr=C(ci),Nr=R(Sr,2);{var de=qe=>{var ot=ky();At(ot,21,()=>r(Ue).filesModified,Pr,(wt,yt)=>{var Rt=Cy(),Vt=C(Rt),Kt=C(Vt),Yt=R(Vt,2),hr=C(Yt);ee(Zt=>{Pe(Vt,1,`shrink-0 px-1 rounded text-[9px] font-bold ${r(yt).tool==="Edit"?"bg-attention-muted text-attention-fg":"bg-success-muted text-success-fg"}`),Y(Kt,r(yt).tool==="Edit"?"M":"A"),ze(Yt,"title",r(yt).path),Y(hr,Zt)},[()=>V(r(yt).path)]),A(wt,Rt)}),A(qe,ot)};H(Nr,qe=>{r(_).has(r(Ve))&&r(Ue).filesModified.length>0&&qe(de)})}var Ce=R(Nr,2);{var st=qe=>{var ot=Ly();At(ot,21,()=>r(Ue).tasks,Pr,(wt,yt)=>{var Rt=Ey(),Vt=C(Rt),Kt=R(Vt,2),Yt=C(Kt),hr=R(Kt,2),Zt=C(hr);ee(tr=>{Pe(Vt,1,`shrink-0 w-2 h-2 rounded-full ${tr??""}`),Y(Yt,r(yt).subject),Y(Zt,r(yt).status)},[()=>X(r(yt).status)]),A(wt,Rt)}),A(qe,ot)};H(Ce,qe=>{r(v).has(r(Ve))&&r(Ue).tasks.length>0&&qe(st)})}ee(qe=>{ze(Cr,"title",r(Ve)),Y(ti,`sid:${qe??""}`),Y(qr,r(s)===r(Ve)?"Copied":"Copy")},[()=>Q(r(Ve))]),A(pt,it)},xt=pt=>{var it=Ry(),Et=C(it);Et.__click=()=>e.onResumeSession(r(Ve));var Pt=R(Et,2),qt=C(Pt),Wt=R(Pt,2);Wt.__click=()=>ne(r(Ve));var Lt=C(Wt);ee(ue=>{ze(Pt,"title",r(Ve)),Y(qt,`sid:${ue??""}`),Y(Lt,r(s)===r(Ve)?"Copied":"Copy")},[()=>Q(r(Ve))]),A(pt,it)};H(ft,pt=>{r(Ue)!==void 0?pt(mt):pt(xt,!1)},!0)}A(Ze,at)};H(rt,Ze=>{r(Je)?Ze(ht):Ze(_t,!1)})}var ct=R(rt,2);{var kt=Ze=>{bd(Ze,{get sessionId(){return r(Ve)},get contextId(){return e.contextId}})},It=Ze=>{var at=Dy(),ft=C(at),mt=R(C(ft),2),xt=C(mt),pt=R(ft,2);{var it=Pt=>{var qt=Ay(),Wt=R(C(qt),2),Lt=C(Wt);ee(ue=>Y(Lt,ue),[()=>Ur(Fe().summary)]),A(Pt,qt)},Et=Pt=>{var qt=Ty();A(Pt,qt)};H(pt,Pt=>{Fe().summary.length>0?Pt(it):Pt(Et,!1)})}ee(Pt=>Y(xt,Pt),[()=>Ur(Fe().firstPrompt)]),A(Ze,at)};H(ct,Ze=>{Fe().fullPath.length>0?Ze(kt):Ze(It,!1)})}A(je,Ye)};H(we,je=>{r(Xe)&&je(Re)})}ee((je,Ye)=>{Pe(nt,1,`sticky top-0 z-10 w-full flex items-center gap-2 px-4 py-3 bg-bg-primary hover:bg-bg-secondary transition-colors text-left border shadow-sm cursor-pointer select-text ${tt()?"":"mt-3"} ${r(Xe)?"rounded-t-lg border-accent-emphasis/40":"rounded-lg border-border-default"}`),Pe($e,0,`w-4 h-4 text-text-tertiary transition-transform shrink-0 ${r(Xe)?"rotate-90":""}`),Pe(ut,1,`shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold ${r(_e)?"bg-accent-muted text-accent-fg":"bg-bg-tertiary text-text-secondary"}`),Y(bt,r(_e)?"QraftBox":"CLI"),Y(ye,je),Y(Ie,Ye)},[()=>r(Oe)||Ur(Fe().summary||Fe().firstPrompt),()=>N(Fe().modified)]),A(Me,Ke)};var He=C(Ee);{var Le=Me=>{var Fe=Oy(),tt=R(C(Fe),2);At(tt,23,()=>r(m).today,Ve=>S(Ve),(Ve,Xe,Ue)=>{Ne(Ve,()=>r(Xe),()=>r(Ue)===0)}),A(Me,Fe)};H(He,Me=>{r(m).today.length>0&&Me(Le)})}var ce=R(He,2);{var Te=Me=>{var Fe=By(),tt=R(C(Fe),2);At(tt,23,()=>r(m).yesterday,Ve=>S(Ve),(Ve,Xe,Ue)=>{Ne(Ve,()=>r(Xe),()=>r(Ue)===0)}),A(Me,Fe)};H(ce,Me=>{r(m).yesterday.length>0&&Me(Te)})}var De=R(ce,2);{var pe=Me=>{var Fe=Ny(),tt=R(C(Fe),2);At(tt,23,()=>r(m).older,Ve=>S(Ve),(Ve,Xe,Ue)=>{Ne(Ve,()=>r(Xe),()=>r(Ue)===0)}),A(Me,Fe)};H(De,Me=>{r(m).older.length>0&&Me(pe)})}}var Be=R(Ee,2);{var Qe=Ne=>{var Me=Fy(),Fe=C(Me);Fe.__click=y;var tt=C(Fe);{var Ve=Ue=>{var Je=jy();A(Ue,Je)},Xe=Ue=>{var Je=Xt("Load More");A(Ue,Je)};H(tt,Ue=>{r(g)?Ue(Ve):Ue(Xe,!1)})}ee(()=>Fe.disabled=r(g)),A(Ne,Me)};H(Be,Ne=>{r(l)&&Ne(Qe)})}A(he,fe)};H(be,he=>{r(u)?he(ae,!1):he(xe)},!0)}A(U,$)};H(O,U=>{r(g)&&!r(u)?U(ie):U(F,!1)})}A(t,D),Dt()}Ft(["click","keydown"]);var Uy=I(`<button type="button" class="px-3 py-1 text-xs font-medium rounded-md
405
+ bg-attention-emphasis/20 text-attention-fg hover:bg-attention-emphasis/30
406
+ border border-attention-emphasis/30
407
+ transition-colors duration-150
408
+ focus:outline-none focus:ring-2 focus:ring-attention-emphasis" aria-label="Cancel all pending prompts">Cancel All</button>`),zy=I('<span class="shrink-0 text-[10px] font-medium text-attention-fg">(recovered)</span>'),qy=I(`<div class="flex items-center gap-2 px-3 py-1.5 rounded-md
409
+ bg-bg-secondary border border-border-default
410
+ hover:border-accent-emphasis/50 hover:bg-bg-hover
411
+ transition-colors duration-150" role="article"><span class="shrink-0 w-1.5 h-1.5 rounded-full bg-accent-emphasis" aria-hidden="true"></span> <!> <span class="flex-1 text-xs text-text-primary truncate min-w-0"> </span> <span class="shrink-0 text-[10px] text-text-tertiary"> </span> <button type="button" class="shrink-0 px-2 py-0.5 text-[10px] font-medium rounded
412
+ bg-accent-muted/60 hover:bg-accent-muted text-accent-fg
413
+ border border-accent-emphasis/30 hover:border-accent-emphasis/60
414
+ transition-colors" title="Resume this prompt">Resume</button> <button type="button" class="shrink-0 px-2 py-0.5 text-[10px] font-medium rounded
415
+ bg-attention-muted/60 hover:bg-attention-muted text-attention-fg
416
+ border border-attention-emphasis/30 hover:border-attention-emphasis/60
417
+ transition-colors" title="Cancel this prompt">Cancel</button> <button type="button" class="shrink-0 px-1.5 py-0.5 text-[10px] rounded
418
+ text-text-tertiary hover:text-danger-fg hover:bg-danger-emphasis/20
419
+ transition-colors" title="Delete this prompt"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div>`),Gy=I(`<button type="button" class="mt-2 w-full py-1.5 text-xs font-medium text-text-secondary
420
+ hover:text-text-primary hover:bg-bg-hover rounded-md
421
+ transition-colors duration-150"> </button>`),Ky=I('<section aria-labelledby="pending-heading" class="mb-6"><div class="flex items-center justify-between mb-2"><h2 id="pending-heading" class="text-sm font-semibold text-text-secondary flex items-center gap-2"><span class="inline-block w-2 h-2 rounded-full bg-accent-emphasis"></span> </h2> <!></div> <div class="space-y-1"></div> <!></section>');function Jy(t,e){Tt(e,!0);const i=10,n=ge(()=>e.prompts.length===0);let a=K(i);const v=ge(()=>e.prompts.slice(0,r(a))),_=ge(()=>r(a)<e.prompts.length);function s(){k(a,r(a)+i)}function o(p){const b=new Date(p),m=new Date().getTime()-b.getTime(),u=Math.floor(m/6e4),l=Math.floor(m/36e5),d=Math.floor(m/864e5);return u<1?"just now":u<60?`${u}m ago`:l<24?`${l}h ago`:d===1?"yesterday":`${d}d ago`}var h=et(),g=Ae(h);{var c=p=>{var b=Ky(),w=C(b),m=C(w),u=R(C(m)),l=R(m,2);{var d=S=>{var L=Uy();L.__click=function(...x){var P;(P=e.onCancelAll)==null||P.apply(this,x)},A(S,L)};H(l,S=>{e.prompts.length>1&&S(d)})}var f=R(w,2);At(f,21,()=>r(v),S=>S.id,(S,L)=>{var x=qy(),P=R(C(x),2);{var B=le=>{var D=zy();A(le,D)};H(P,le=>{r(L).error!==null&&le(B)})}var j=R(P,2),V=C(j),N=R(j,2),X=C(N),W=R(N,2);W.__click=le=>{le.stopPropagation(),e.onResume(r(L).id)};var Q=R(W,2);Q.__click=le=>{le.stopPropagation(),e.onCancel(r(L).id)};var ne=R(Q,2);ne.__click=le=>{le.stopPropagation(),e.onDelete(r(L).id)},ee(le=>{ze(x,"aria-label",`Pending prompt: ${r(L).description||r(L).prompt}`),Y(V,r(L).description||r(L).prompt),Y(X,le)},[()=>o(r(L).createdAt)]),A(S,x)});var y=R(f,2);{var E=S=>{var L=Gy();L.__click=s;var x=C(L);ee(()=>Y(x,`Load More (${e.prompts.length-r(a)} remaining)`)),A(S,L)};H(y,S=>{r(_)&&S(E)})}ee(()=>Y(u,` PENDING (${e.prompts.length??""})`)),A(p,b)};H(g,p=>{r(n)||p(c)})}A(t,h),Dt()}Ft(["click"]);var Qy=I('<div class="px-4 py-4 border-b border-border-default"><!> <!></div>'),Xy=I('<div class="flex flex-col h-full bg-bg-primary" role="main" aria-label="Sessions"><div class="flex-1 overflow-y-auto"><!> <!></div></div>');function Yy(t,e){Tt(e,!0);const i=We(e,"onResumeToChanges",3,void 0),n=jb();let a=K(gt([])),v=K(gt([])),_=K(gt([]));function s(){k(a,[...n.running],!0),k(v,[...n.queued],!0)}async function o(){try{const x=await fetch("/api/prompts?status=pending");if(!x.ok)return;const P=await x.json();k(_,P.prompts,!0)}catch{}}St(()=>{Dr.reset(),e.contextId.length>0&&Dr.setContextId(e.contextId),e.projectPath.length>0&&Dr.setInitialFilters({workingDirectoryPrefix:e.projectPath}),Dr.fetchSessions()}),St(()=>{let x=!1,P=null;const B=async()=>{await n.loadQueue(),await o(),x||s()};return B(),P=setInterval(()=>{B()},3e3),()=>{x=!0,P!==null&&clearInterval(P)}});const h=ge(()=>r(a).length>0||r(v).length>0||r(_).length>0);function g(x){n.selectSession(x.id)}async function c(x){try{await n.cancelSession(x),s()}catch(P){console.error("Failed to cancel session:",P)}}async function p(x){try{await n.runNow(x),s()}catch(P){console.error("Failed to run session:",P)}}async function b(x){try{await n.removeFromQueue(x),s()}catch(P){console.error("Failed to remove session:",P)}}async function w(x){try{await Dr.resumeSession(x),i()!==void 0&&i()(x)}catch(P){console.error("Failed to resume session:",P)}}async function m(x){try{(await fetch(`/api/prompts/${x}/dispatch`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({immediate:!0})})).ok&&(await o(),await n.loadQueue(),s())}catch(P){console.error("Failed to resume prompt:",P)}}async function u(x){try{(await fetch(`/api/prompts/${x}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"cancelled"})})).ok&&await o()}catch(P){console.error("Failed to cancel prompt:",P)}}async function l(){try{await Promise.all(r(_).map(x=>fetch(`/api/prompts/${x.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:"cancelled"})}))),await o()}catch(x){console.error("Failed to cancel all pending prompts:",x)}}async function d(x){try{(await fetch(`/api/prompts/${x}`,{method:"DELETE"})).ok&&await o()}catch(P){console.error("Failed to delete prompt:",P)}}var f=Xy(),y=C(f),E=C(y);{var S=x=>{var P=Qy(),B=C(P);Jy(B,{get prompts(){return r(_)},onResume:V=>void m(V),onCancel:V=>void u(V),onCancelAll:()=>void l(),onDelete:V=>void d(V)});var j=R(B,2);{let V=ge(()=>[...r(a)]),N=ge(()=>[...r(v)]);oy(j,{get running(){return r(V)},get queued(){return r(N)},onSelectSession:g,onCancelSession:X=>void c(X),onRunNow:X=>void p(X),onRemoveFromQueue:X=>void b(X)})}A(x,P)};H(E,x=>{r(h)&&x(S)})}var L=R(E,2);Wy(L,{get contextId(){return e.contextId},onResumeSession:w,onSelectSession:()=>{}}),A(t,f),Dt()}var Zy=I(" <!>",1),$y=I(`<div class="flex flex-col items-center justify-center h-64" role="status"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary mb-4" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="4.93" y1="4.93" x2="19.07" y2="19.07"></line></svg> <p class="text-text-secondary text-lg mb-2">Not a Git Repository</p> <p class="text-text-tertiary text-sm">The current directory is not managed by git. Commit history is not
422
+ available.</p></div>`),ex=I('<div class="loading-state flex flex-col items-center justify-center h-64" role="status" aria-live="polite"><svg class="animate-spin h-8 w-8 text-accent-fg mb-4 svelte-cti980" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <p class="text-text-secondary">Loading commits...</p></div>'),tx=I('<div class="flex flex-col items-center justify-center h-64"><div class="p-4 rounded-lg border border-danger-emphasis/30 bg-danger-emphasis/10 text-danger-fg max-w-md"><div class="flex items-start gap-3"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0 mt-0.5" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> <div class="flex-1"><p class="font-medium">Error Loading Commits</p> <p class="text-sm mt-1"> </p></div></div> <div class="mt-3 flex justify-end"><button type="button" class="px-4 py-2 text-sm bg-bg-tertiary text-text-primary border border-border-default rounded hover:bg-bg-hover transition-colors">Retry</button></div></div></div>'),rx=I('<div class="empty-state flex flex-col items-center justify-center h-64" role="status"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary mb-4" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> <p class="text-text-secondary text-lg mb-2"> </p> <p class="text-text-tertiary text-sm"><!></p></div>'),ix=I('<div class="flex items-center gap-2 px-4 py-3 text-sm text-text-secondary"><div class="w-4 h-4 border-2 border-border-default border-t-accent-emphasis rounded-full animate-spin svelte-cti980"></div> Loading detail...</div>'),nx=I('<div class="px-4 py-3 text-sm text-danger-fg"> </div>'),sx=I('<div class="text-sm text-text-primary whitespace-pre-wrap bg-bg-primary p-3 rounded border border-border-default"> </div>'),ox=I('<div class="text-sm text-text-primary"> </div>'),ax=I('<span class="text-success-fg"> </span>'),lx=I('<span class="text-danger-fg"> </span>'),cx=I('<div class="flex items-center gap-2 p-3 text-text-secondary"><div class="w-3 h-3 border-2 border-border-default border-t-accent-emphasis rounded-full animate-spin svelte-cti980"></div> Loading diff...</div>'),dx=I('<div class="p-3 text-danger-fg"> </div>'),ux=I(`<div class="p-3 text-text-secondary">No diff available (binary file or empty
423
+ change)</div>`),hx=I('<div class="border-t border-border-default bg-bg-primary overflow-x-auto text-xs"><!></div>'),fx=I('<div><button type="button" class="w-full flex items-center gap-2 px-3 py-2 text-xs hover:bg-bg-tertiary transition-colors cursor-pointer"><span class="text-text-secondary shrink-0"> </span> <span> </span> <span class="font-mono text-text-primary truncate text-left"> </span> <div class="flex items-center gap-2 ml-auto shrink-0"><!> <!></div></button> <!></div>'),vx=I('<div class="space-y-1"><div class="text-xs font-medium text-text-secondary uppercase tracking-wide">Changed Files</div> <div class="bg-bg-primary rounded border border-border-default divide-y divide-border-default"></div></div>'),_x=I('<div class="px-4 pb-4 space-y-3"><div class="pt-3 text-xs text-text-secondary"><span class="font-mono select-all"> </span></div> <!> <div class="flex items-center gap-4 text-xs"><span class="text-text-secondary"> </span> <span class="text-success-fg"> </span> <span class="text-danger-fg"> </span></div> <!></div>'),px=I('<div class="border-x border-b border-accent-emphasis/40 rounded-b-lg overflow-hidden"><!></div>'),gx=I('<div class="contents"><button type="button"><svg viewBox="0 0 16 16" fill="currentColor"><path d="M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"></path></svg> <span class="shrink-0 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono bg-bg-tertiary text-accent-fg"> </span> <span class="flex-1 text-sm truncate text-text-primary"> </span> <span class="text-xs text-text-tertiary shrink-0"> </span> <span class="text-xs text-text-tertiary shrink-0"> </span></button> <!></div>'),mx=I('<div class="mt-4 p-4 rounded-lg border border-danger-emphasis/30 bg-danger-emphasis/10 text-danger-fg text-sm"> </div>'),bx=I('<span class="flex items-center gap-2"><svg class="animate-spin h-4 w-4 svelte-cti980" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Loading...</span>'),yx=I(`<div class="pagination mt-6 flex justify-center"><button type="button" class="px-6 py-3 rounded-lg text-sm font-medium
424
+ bg-bg-secondary hover:bg-bg-hover text-text-primary
425
+ border border-bg-border hover:border-accent-emphasis/30
426
+ disabled:opacity-50 disabled:cursor-not-allowed
427
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
428
+ transition-all duration-150" aria-label="Load more commits"><!></button></div>`),xx=I("<!> <!> <!>",1),wx=I('<div class="flex flex-col h-full bg-bg-primary text-text-primary"><div class="flex items-center gap-3 px-6 py-3 border-b border-bg-border bg-bg-secondary"><div class="text-sm text-text-tertiary shrink-0"><!></div> <div class="flex-1"></div> <!></div> <div class="content-area flex-1 overflow-y-auto px-6 pb-4"><!></div></div>');function Sx(t,e){Tt(e,!0);const i=We(e,"isGitRepo",3,!0);let n=K(gt([])),a=K(!0),v=K(!1),_=K(null),s=K(!1),o=K(0);const h=50;let g=K(""),c=K(null),p=K(null),b=K(!1),w=K(null),m=K(null),u=K(gt([])),l=K(!1),d=K(null),f=K(gt(new Map));function y(Z){k(g,Z,!0),k(o,0),k(n,[],!0),E(!1)}async function E(Z){k(Z?v:a,!0),k(_,null);try{const re=new URLSearchParams;re.set("limit",h.toString()),re.set("offset",Z?r(o).toString():"0"),r(g).trim().length>0&&re.set("search",r(g).trim());const se=await fetch(`/api/ctx/${e.contextId}/commits?${re.toString()}`);if(!se.ok){const O=await se.json().catch(()=>null);throw new Error((O==null?void 0:O.error)??`Failed to load commits (${se.status})`)}const G=await se.json();Z?k(n,[...r(n),...G.commits],!0):k(n,[...G.commits],!0),k(s,G.pagination.hasMore,!0),k(o,G.pagination.offset+G.pagination.limit)}catch(re){k(_,re instanceof Error?re.message:"Failed to load commits",!0)}finally{k(a,!1),k(v,!1)}}function S(){r(v)||!r(s)||E(!0)}function L(){k(o,0),k(n,[],!0),E(!1)}async function x(Z){if(r(c)===Z){k(c,null),k(p,null),k(w,null),k(m,null),k(u,[],!0);return}k(c,Z,!0),k(p,null),k(w,null),k(m,null),k(u,[],!0),k(b,!0);try{const re=await fetch(`/api/ctx/${e.contextId}/commits/${Z}`);if(!re.ok){const se=await re.json().catch(()=>null);throw new Error((se==null?void 0:se.error)??`Failed to load commit detail (${re.status})`)}k(p,await re.json(),!0)}catch(re){k(w,re instanceof Error?re.message:"Failed to load commit detail",!0)}finally{k(b,!1)}}async function P(Z){if(r(m)===Z){k(m,null),k(u,[],!0),k(d,null);return}if(k(m,Z,!0),k(u,[],!0),k(d,null),r(c)===null)return;const re=r(f).get(r(c));if(re!==void 0){const se=re.find(G=>G.path===Z);k(u,(se==null?void 0:se.chunks)??[],!0);return}k(l,!0);try{const se=await fetch(`/api/ctx/${e.contextId}/commits/${r(c)}/diff`);if(!se.ok)throw new Error(`Failed to load diff (${se.status})`);const G=await se.json(),O=new Map(r(f));O.set(r(c),G.files),k(f,O,!0);const ie=G.files.find(F=>F.path===Z);k(u,(ie==null?void 0:ie.chunks)??[],!0)}catch(se){k(d,se instanceof Error?se.message:"Failed to load file diff",!0)}finally{k(l,!1)}}function B(Z){const re=new Date(Z),G=new Date().getTime()-re.getTime(),O=Math.floor(G/(1e3*60*60*24));if(O===0){const ie=Math.floor(G/36e5);if(ie===0){const F=Math.floor(G/6e4);return F<=1?"just now":`${F} min ago`}return ie===1?"1 hour ago":`${ie} hours ago`}if(O===1)return"yesterday";if(O<7)return`${O} days ago`;if(O<30){const ie=Math.floor(O/7);return ie===1?"1 week ago":`${ie} weeks ago`}return re.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function j(Z){return Z.split(`
429
+ `)[0]??Z}function V(Z){switch(Z){case"A":return"Added";case"M":return"Modified";case"D":return"Deleted";case"R":return"Renamed";case"C":return"Copied";default:return Z}}function N(Z){switch(Z){case"A":return"text-success-fg";case"D":return"text-danger-fg";case"M":return"text-attention-fg";case"R":return"text-accent-fg";case"C":return"text-accent-fg";default:return"text-text-secondary"}}St(()=>{i()&&E(!1)});var X=wx(),W=C(X),Q=C(W),ne=C(Q);{var le=Z=>{var re=Zy(),se=Ae(re),G=R(se);{var O=ie=>{var F=Xt("(more available)");A(ie,F)};H(G,ie=>{r(s)&&ie(O)})}ee(()=>Y(se,`${r(n).length??""} commit${r(n).length!==1?"s":""} `)),A(Z,re)};H(ne,Z=>{r(n).length>0&&Z(le)})}var D=R(Q,4);yd(D,{get value(){return r(g)},onSearch:y,placeholder:"Search commits..."});var T=R(W,2),M=C(T);{var z=Z=>{var re=$y();A(Z,re)},J=Z=>{var re=et(),se=Ae(re);{var G=ie=>{var F=ex();A(ie,F)},O=ie=>{var F=et(),U=Ae(F);{var $=xe=>{var ae=tx(),he=C(ae),fe=C(he),Ee=R(C(fe),2),He=R(C(Ee),2),Le=C(He),ce=R(fe,2),Te=C(ce);Te.__click=L,ee(()=>Y(Le,r(_))),A(xe,ae)},be=xe=>{var ae=et(),he=Ae(ae);{var fe=He=>{var Le=rx(),ce=R(C(Le),2),Te=C(ce),De=R(ce,2),pe=C(De);{var Be=Ne=>{var Me=Xt("Try adjusting your search query.");A(Ne,Me)},Qe=Ne=>{var Me=Xt("No commits found for this repository.");A(Ne,Me)};H(pe,Ne=>{r(g).trim().length>0?Ne(Be):Ne(Qe,!1)})}ee(Ne=>Y(Te,Ne),[()=>r(g).trim().length>0?"No commits match your search":"No commits found"]),A(He,Le)},Ee=He=>{var Le=xx(),ce=Ae(Le);At(ce,19,()=>r(n),Qe=>Qe.hash,(Qe,Ne,Me)=>{const Fe=ge(()=>r(c)===r(Ne).hash);var tt=gx(),Ve=C(tt);Ve.__click=()=>void x(r(Ne).hash);var Xe=C(Ve),Ue=R(Xe,2),Je=C(Ue),ve=R(Ue,2),_e=C(ve),Oe=R(ve,2),Ke=C(Oe),nt=R(Oe,2),$e=C(nt),dt=R(Ve,2);{var ut=bt=>{var lt=px(),ye=C(lt);{var te=me=>{var Ie=ix();A(me,Ie)},oe=me=>{var Ie=et(),we=Ae(Ie);{var Re=Ye=>{var rt=nx(),ht=C(rt);ee(()=>Y(ht,r(w))),A(Ye,rt)},je=Ye=>{var rt=et(),ht=Ae(rt);{var _t=ct=>{var kt=_x(),It=C(kt),Ze=C(It),at=C(Ze),ft=R(It,2);{var mt=Ht=>{var Gt=sx(),Nt=C(Gt);ee(Ot=>Y(Nt,`${r(p).message??""}${Ot??""}`),[()=>r(p).body.trim().length>0?`
430
+
431
+ `+r(p).body:""]),A(Ht,Gt)},xt=Ht=>{var Gt=ox(),Nt=C(Gt);ee(()=>Y(Nt,r(p).message)),A(Ht,Gt)};H(ft,Ht=>{r(p).body.trim().length>0?Ht(mt):Ht(xt,!1)})}var pt=R(ft,2),it=C(pt),Et=C(it),Pt=R(it,2),qt=C(Pt),Wt=R(Pt,2),Lt=C(Wt),ue=R(pt,2);{var Ct=Ht=>{var Gt=vx(),Nt=R(C(Gt),2);At(Nt,21,()=>r(p).files,Ot=>Ot.path,(Ot,ir)=>{const Br=ge(()=>r(m)===r(ir).path);var dr=fx(),ur=C(dr);ur.__click=()=>void P(r(ir).path);var Sr=C(ur),Cr=C(Sr),ti=R(Sr,2),ci=C(ti),qr=R(ti,2),Nr=C(qr),de=R(qr,2),Ce=C(de);{var st=Rt=>{var Vt=ax(),Kt=C(Vt);ee(()=>Y(Kt,`+${r(ir).additions??""}`)),A(Rt,Vt)};H(Ce,Rt=>{r(ir).additions>0&&Rt(st)})}var qe=R(Ce,2);{var ot=Rt=>{var Vt=lx(),Kt=C(Vt);ee(()=>Y(Kt,`-${r(ir).deletions??""}`)),A(Rt,Vt)};H(qe,Rt=>{r(ir).deletions>0&&Rt(ot)})}var wt=R(ur,2);{var yt=Rt=>{var Vt=hx(),Kt=C(Vt);{var Yt=Zt=>{var tr=cx();A(Zt,tr)},hr=Zt=>{var tr=et(),fr=Ae(tr);{var ri=Di=>{var yi=dx(),dn=C(yi);ee(()=>Y(dn,r(d))),A(Di,yi)},bi=Di=>{var yi=et(),dn=Ae(yi);{var to=un=>{var Sd=ux();A(un,Sd)},wd=un=>{Tc(un,{get chunks(){return r(u)}})};H(dn,un=>{r(u).length===0?un(to):un(wd,!1)},!0)}A(Di,yi)};H(fr,Di=>{r(d)!==null?Di(ri):Di(bi,!1)},!0)}A(Zt,tr)};H(Kt,Zt=>{r(l)?Zt(Yt):Zt(hr,!1)})}A(Rt,Vt)};H(wt,Rt=>{r(Br)&&Rt(yt)})}ee((Rt,Vt)=>{ze(ur,"aria-expanded",r(Br)),Y(Cr,r(Br)?"v":">"),Pe(ti,1,`font-medium ${Rt??""}`,"svelte-cti980"),Y(ci,Vt),Y(Nr,r(ir).path)},[()=>N(r(ir).status),()=>V(r(ir).status)]),A(Ot,dr)}),A(Ht,Gt)};H(ue,Ht=>{r(p).files.length>0&&Ht(Ct)})}ee(()=>{Y(at,r(p).hash),Y(Et,`${r(p).stats.filesChanged??""} file${r(p).stats.filesChanged!==1?"s":""} changed`),Y(qt,`+${r(p).stats.additions??""}`),Y(Lt,`-${r(p).stats.deletions??""}`)}),A(ct,kt)};H(ht,ct=>{r(p)!==null&&ct(_t)},!0)}A(Ye,rt)};H(we,Ye=>{r(w)!==null?Ye(Re):Ye(je,!1)},!0)}A(me,Ie)};H(ye,me=>{r(b)?me(te):me(oe,!1)})}A(bt,lt)};H(dt,bt=>{r(Fe)&&bt(ut)})}ee((bt,lt,ye)=>{ze(Ve,"aria-expanded",r(Fe)),Pe(Ve,1,`sticky top-0 z-10 w-full flex items-center gap-3 px-4 py-3 bg-bg-primary hover:bg-bg-secondary transition-colors text-left border shadow-sm ${r(Me)===0?"":"mt-3"} ${r(Fe)?"rounded-t-lg border-accent-emphasis/40":"rounded-lg border-border-default"}`),Pe(Xe,0,`w-4 h-4 text-text-tertiary transition-transform ${r(Fe)?"rotate-90":""}`),Y(Je,bt),Y(_e,lt),Y(Ke,r(Ne).author.name),Y($e,ye)},[()=>r(Ne).shortHash||r(Ne).hash.slice(0,7),()=>j(r(Ne).message),()=>B(r(Ne).date)]),A(Qe,tt)});var Te=R(ce,2);{var De=Qe=>{var Ne=mx(),Me=C(Ne);ee(()=>Y(Me,r(_))),A(Qe,Ne)};H(Te,Qe=>{r(_)!==null&&r(n).length>0&&Qe(De)})}var pe=R(Te,2);{var Be=Qe=>{var Ne=yx(),Me=C(Ne);Me.__click=S;var Fe=C(Me);{var tt=Xe=>{var Ue=bx();A(Xe,Ue)},Ve=Xe=>{var Ue=Xt("Load More");A(Xe,Ue)};H(Fe,Xe=>{r(v)?Xe(tt):Xe(Ve,!1)})}ee(()=>Me.disabled=r(v)),A(Qe,Ne)};H(pe,Qe=>{r(s)&&Qe(Be)})}A(He,Le)};H(he,He=>{r(n).length===0?He(fe):He(Ee,!1)},!0)}A(xe,ae)};H(U,xe=>{r(_)!==null&&r(n).length===0?xe($):xe(be,!1)},!0)}A(ie,F)};H(se,ie=>{r(a)?ie(G):ie(O,!1)},!0)}A(Z,re)};H(M,Z=>{i()?Z(J,!1):Z(z)})}A(t,X),Dt()}Ft(["click"]);var xo={exports:{}},xl;function Cx(){return xl||(xl=1,(function(t,e){(function(i,n){t.exports=n()})(globalThis,(()=>(()=>{var i={4567:function(_,s,o){var h=this&&this.__decorate||function(d,f,y,E){var S,L=arguments.length,x=L<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,f,y,E);else for(var P=d.length-1;P>=0;P--)(S=d[P])&&(x=(L<3?S(x):L>3?S(f,y,x):S(f,y))||x);return L>3&&x&&Object.defineProperty(f,y,x),x},g=this&&this.__param||function(d,f){return function(y,E){f(y,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const c=o(9042),p=o(9924),b=o(844),w=o(4725),m=o(2585),u=o(3656);let l=s.AccessibilityManager=class extends b.Disposable{constructor(d,f,y,E){super(),this._terminal=d,this._coreBrowserService=y,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let S=0;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);if(this._topBoundaryFocusListener=S=>this._handleBoundaryFocus(S,0),this._bottomBoundaryFocusListener=S=>this._handleBoundaryFocus(S,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((S=>this._handleResize(S.rows)))),this.register(this._terminal.onRender((S=>this._refreshRows(S.start,S.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((S=>this._handleChar(S)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
432
+ `)))),this.register(this._terminal.onA11yTab((S=>this._handleTab(S)))),this.register(this._terminal.onKey((S=>this._handleKey(S.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,u.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let f=0;f<d;f++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
433
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,f){this._liveRegionDebouncer.refresh(d,f,this._terminal.rows)}_renderRows(d,f){const y=this._terminal.buffer,E=y.lines.length.toString();for(let S=d;S<=f;S++){const L=y.lines.get(y.ydisp+S),x=[],P=(L==null?void 0:L.translateToString(!0,void 0,void 0,x))||"",B=(y.ydisp+S+1).toString(),j=this._rowElements[S];j&&(P.length===0?(j.innerText=" ",this._rowColumns.set(j,[0,1])):(j.textContent=P,this._rowColumns.set(j,x)),j.setAttribute("aria-posinset",B),j.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,f){const y=d.target,E=this._rowElements[f===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(f===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==E)return;let S,L;if(f===0?(S=y,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(S=this._rowElements.shift(),L=y,this._rowContainer.removeChild(S)),S.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),f===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(f===0?-1:1),this._rowElements[f===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var P;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let f={node:d.anchorNode,offset:d.anchorOffset},y={node:d.focusNode,offset:d.focusOffset};if((f.node.compareDocumentPosition(y.node)&Node.DOCUMENT_POSITION_PRECEDING||f.node===y.node&&f.offset>y.offset)&&([f,y]=[y,f]),f.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(f={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(f.node))return;const E=this._rowElements.slice(-1)[0];if(y.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(y={node:E,offset:((P=E.textContent)==null?void 0:P.length)??0}),!this._rowContainer.contains(y.node))return;const S=({node:B,offset:j})=>{const V=B instanceof Text?B.parentNode:B;let N=parseInt(V==null?void 0:V.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const X=this._rowColumns.get(V);if(!X)return console.warn("columns is null. Race condition?"),null;let W=j<X.length?X[j]:X.slice(-1)[0]+1;return W>=this._terminal.cols&&(++N,W=0),{row:N,column:W}},L=S(f),x=S(y);if(L&&x){if(L.row>x.row||L.row===x.row&&L.column>=x.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(x.row-L.row)*this._terminal.cols-L.column+x.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let f=this._rowContainer.children.length;f<this._terminal.rows;f++)this._rowElements[f]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[f]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=l=h([g(1,m.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],l)},3614:(_,s)=>{function o(p){return p.replace(/\r?\n/g,"\r")}function h(p,b){return b?"\x1B[200~"+p+"\x1B[201~":p}function g(p,b,w,m){p=h(p=o(p),w.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),b.value=""}function c(p,b,w){const m=w.getBoundingClientRect(),u=p.clientX-m.left-10,l=p.clientY-m.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${u}px`,b.style.top=`${l}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=h,s.copyHandler=function(p,b){p.clipboardData&&p.clipboardData.setData("text/plain",b.selectionText),p.preventDefault()},s.handlePasteEvent=function(p,b,w,m){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),b,w,m)},s.paste=g,s.moveTextAreaUnderMouseCursor=c,s.rightClickHandler=function(p,b,w,m,u){c(p,b,w),u&&m.rightClickSelect(p),b.value=m.selectionText,b.select()}},7239:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const h=o(1505);s.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(g,c,p){this._css.set(g,c,p)}getCss(g,c){return this._css.get(g,c)}setColor(g,c,p){this._color.set(g,c,p)}getColor(g,c){return this._color.get(g,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,h,g,c){o.addEventListener(h,g,c);let p=!1;return{dispose:()=>{p||(p=!0,o.removeEventListener(h,g,c))}}}},3551:function(_,s,o){var h=this&&this.__decorate||function(l,d,f,y){var E,S=arguments.length,L=S<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(l,d,f,y);else for(var x=l.length-1;x>=0;x--)(E=l[x])&&(L=(S<3?E(L):S>3?E(d,f,L):E(d,f))||L);return S>3&&L&&Object.defineProperty(d,f,L),L},g=this&&this.__param||function(l,d){return function(f,y){d(f,y,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const c=o(3656),p=o(8460),b=o(844),w=o(2585),m=o(4725);let u=s.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(l,d,f,y,E){super(),this._element=l,this._mouseService=d,this._renderService=f,this._bufferService=y,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var S;this._lastMouseEvent=void 0,(S=this._activeProviderReplies)==null||S.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,c.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){this._lastMouseEvent=l;const d=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const f=l.composedPath();for(let y=0;y<f.length;y++){const E=f[y];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(l){if(this._activeLine!==l.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(l,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,l)||(this._clearCurrentLink(),this._askForLink(l,!0))}_askForLink(l,d){var y,E;this._activeProviderReplies&&d||((y=this._activeProviderReplies)==null||y.forEach((S=>{S==null||S.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=l.y);let f=!1;for(const[S,L]of this._linkProviderService.linkProviders.entries())d?(E=this._activeProviderReplies)!=null&&E.get(S)&&(f=this._checkLinkProviderResult(S,l,f)):L.provideLinks(l.y,(x=>{var B,j;if(this._isMouseOut)return;const P=x==null?void 0:x.map((V=>({link:V})));(B=this._activeProviderReplies)==null||B.set(S,P),f=this._checkLinkProviderResult(S,l,f),((j=this._activeProviderReplies)==null?void 0:j.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)}))}_removeIntersectingLinks(l,d){const f=new Set;for(let y=0;y<d.size;y++){const E=d.get(y);if(E)for(let S=0;S<E.length;S++){const L=E[S],x=L.link.range.start.y<l?0:L.link.range.start.x,P=L.link.range.end.y>l?this._bufferService.cols:L.link.range.end.x;for(let B=x;B<=P;B++){if(f.has(B)){E.splice(S--,1);break}f.add(B)}}}}_checkLinkProviderResult(l,d,f){var S;if(!this._activeProviderReplies)return f;const y=this._activeProviderReplies.get(l);let E=!1;for(let L=0;L<l;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(E=!0);if(!E&&y){const L=y.find((x=>this._linkAtPosition(x.link,d)));L&&(f=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!f)for(let L=0;L<this._activeProviderReplies.size;L++){const x=(S=this._activeProviderReplies.get(L))==null?void 0:S.find((P=>this._linkAtPosition(P.link,d)));if(x){f=!0,this._handleNewLink(x);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._currentLink)return;const d=this._positionFromMouseEvent(l,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,d){this._currentLink&&this._lastMouseEvent&&(!l||!d||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(l.link,d)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var f,y;return(y=(f=this._currentLink)==null?void 0:f.state)==null?void 0:y.decorations.pointerCursor},set:f=>{var y;(y=this._currentLink)!=null&&y.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",f))}},underline:{get:()=>{var f,y;return(y=(f=this._currentLink)==null?void 0:f.state)==null?void 0:y.decorations.underline},set:f=>{var y,E,S;(y=this._currentLink)!=null&&y.state&&((S=(E=this._currentLink)==null?void 0:E.state)==null?void 0:S.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,f))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((f=>{if(!this._currentLink)return;const y=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(y,E),this._lastMouseEvent)){const S=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);S&&this._askForLink(S,!1)}}))))}_linkHover(l,d,f){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(f,d.text)}_fireUnderlineEvent(l,d){const f=l.range,y=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-y-1,f.end.x,f.end.y-y-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(l,d,f){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(f,d.text)}_linkAtPosition(l,d){const f=l.range.start.y*this._bufferService.cols+l.range.start.x,y=l.range.end.y*this._bufferService.cols+l.range.end.x,E=d.y*this._bufferService.cols+d.x;return f<=E&&E<=y}_positionFromMouseEvent(l,d,f){const y=f.getCoords(l,d,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,d,f,y,E){return{x1:l,y1:d,x2:f,y2:y,cols:this._bufferService.cols,fg:E}}};s.Linkifier=u=h([g(1,m.IMouseService),g(2,m.IRenderService),g(3,w.IBufferService),g(4,m.ILinkProviderService)],u)},9042:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(_,s,o){var h=this&&this.__decorate||function(m,u,l,d){var f,y=arguments.length,E=y<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,u,l,d);else for(var S=m.length-1;S>=0;S--)(f=m[S])&&(E=(y<3?f(E):y>3?f(u,l,E):f(u,l))||E);return y>3&&E&&Object.defineProperty(u,l,E),E},g=this&&this.__param||function(m,u){return function(l,d){u(l,d,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const c=o(511),p=o(2585);let b=s.OscLinkProvider=class{constructor(m,u,l){this._bufferService=m,this._optionsService=u,this._oscLinkService=l}provideLinks(m,u){var P;const l=this._bufferService.buffer.lines.get(m-1);if(!l)return void u(void 0);const d=[],f=this._optionsService.rawOptions.linkHandler,y=new c.CellData,E=l.getTrimmedLength();let S=-1,L=-1,x=!1;for(let B=0;B<E;B++)if(L!==-1||l.hasContent(B)){if(l.loadCell(B,y),y.hasExtendedAttrs()&&y.extended.urlId){if(L===-1){L=B,S=y.extended.urlId;continue}x=y.extended.urlId!==S}else L!==-1&&(x=!0);if(x||L!==-1&&B===E-1){const j=(P=this._oscLinkService.getLinkData(S))==null?void 0:P.uri;if(j){const V={start:{x:L+1,y:m},end:{x:B+(x||B!==E-1?0:1),y:m}};let N=!1;if(!(f!=null&&f.allowNonHttpProtocols))try{const X=new URL(j);["http:","https:"].includes(X.protocol)||(N=!0)}catch{N=!0}N||d.push({text:j,range:V,activate:(X,W)=>f?f.activate(X,W,V):w(0,W),hover:(X,W)=>{var Q;return(Q=f==null?void 0:f.hover)==null?void 0:Q.call(f,X,W,V)},leave:(X,W)=>{var Q;return(Q=f==null?void 0:f.leave)==null?void 0:Q.call(f,X,W,V)}})}x=!1,y.hasExtendedAttrs()&&y.extended.urlId?(L=B,S=y.extended.urlId):(L=-1,S=-1)}}u(d)}};function w(m,u){if(confirm(`Do you want to navigate to ${u}?
434
+
435
+ WARNING: This link could potentially be dangerous`)){const l=window.open();if(l){try{l.opener=null}catch{}l.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=b=h([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],b)},6193:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,h){this._renderCallback=o,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(o,h,g){this._rowCount=g,o=o!==void 0?o:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const h=o(3614),g=o(3656),c=o(3551),p=o(9042),b=o(3730),w=o(1680),m=o(3107),u=o(5744),l=o(2950),d=o(1296),f=o(428),y=o(4269),E=o(5114),S=o(8934),L=o(3230),x=o(9312),P=o(4725),B=o(6731),j=o(8055),V=o(8969),N=o(8460),X=o(844),W=o(6114),Q=o(8437),ne=o(2584),le=o(7399),D=o(5941),T=o(9074),M=o(2585),z=o(5435),J=o(4567),Z=o(779);class re extends V.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(G={}){super(G),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(T.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(P.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((O,ie)=>this.refresh(O,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((O=>this._reportWindowsOptions(O)))),this.register(this._inputHandler.onColor((O=>this._handleColorEvent(O)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((O=>this._afterResize(O.cols,O.rows)))),this.register((0,X.toDisposable)((()=>{var O,ie;this._customKeyEventHandler=void 0,(ie=(O=this.element)==null?void 0:O.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const O of G){let ie,F="";switch(O.index){case 256:ie="foreground",F="10";break;case 257:ie="background",F="11";break;case 258:ie="cursor",F="12";break;default:ie="ansi",F="4;"+O.index}switch(O.type){case 0:const U=j.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[O.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${ne.C0.ESC}]${F};${(0,D.toRgbString)(U)}${ne.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors(($=>$.ansi[O.index]=j.channels.toColor(...O.color)));else{const $=ie;this._themeService.modifyColors((be=>be[$]=j.channels.toColor(...O.color)))}break;case 2:this._themeService.restoreColor(O.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(G){G?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var G;return(G=this.textarea)==null?void 0:G.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ne.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const G=this.buffer.ybase+this.buffer.y,O=this.buffer.lines.get(G);if(!O)return;const ie=Math.min(this.buffer.x,this.cols-1),F=this._renderService.dimensions.css.cell.height,U=O.getWidth(ie),$=this._renderService.dimensions.css.cell.width*U,be=this.buffer.y*this._renderService.dimensions.css.cell.height,xe=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=xe+"px",this.textarea.style.top=be+"px",this.textarea.style.width=$+"px",this.textarea.style.height=F+"px",this.textarea.style.lineHeight=F+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(O=>{this.hasSelection()&&(0,h.copyHandler)(O,this._selectionService)})));const G=O=>(0,h.handlePasteEvent)(O,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,g.addDisposableDomListener)(this.element,"paste",G)),W.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(O=>{O.button===2&&(0,h.rightClickHandler)(O,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(O=>{(0,h.rightClickHandler)(O,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(O=>{O.button===1&&(0,h.moveTextAreaUnderMouseCursor)(O,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var ie;if(!G)throw new Error("Terminal requires a parent element.");if(G.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=G.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),G.appendChild(this.element);const O=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),O.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(F=>this.updateCursorStyle(F)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),O.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(E.CoreBrowserService,this.textarea,G.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(P.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(F=>this._handleTextAreaFocus(F)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(y.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((F=>this._onRender.fire(F)))),this.onResize((F=>this._renderService.resize(F.cols,F.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(l.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(S.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(c.Linkifier,this.screenElement)),this.element.appendChild(O);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((F=>this.scrollLines(F.amount,F.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(x.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(P.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((F=>this.scrollLines(F.amount,F.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((F=>this._renderService.handleSelectionChanged(F.start,F.end,F.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((F=>{this.textarea.value=F,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((F=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(F=>this._selectionService.handleMouseDown(F)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(J.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(F=>this._handleScreenReaderModeOptionChange(F)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(F=>{!this._overviewRulerRenderer&&F&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,O=this.element;function ie($){const be=G._mouseService.getMouseReportCoords($,G.screenElement);if(!be)return!1;let xe,ae;switch($.overrideType||$.type){case"mousemove":ae=32,$.buttons===void 0?(xe=3,$.button!==void 0&&(xe=$.button<3?$.button:3)):xe=1&$.buttons?0:4&$.buttons?1:2&$.buttons?2:3;break;case"mouseup":ae=0,xe=$.button<3?$.button:3;break;case"mousedown":ae=1,xe=$.button<3?$.button:3;break;case"wheel":if(G._customWheelEventHandler&&G._customWheelEventHandler($)===!1||G.viewport.getLinesScrolled($)===0)return!1;ae=$.deltaY<0?0:1,xe=4;break;default:return!1}return!(ae===void 0||xe===void 0||xe>4)&&G.coreMouseService.triggerMouseEvent({col:be.col,row:be.row,x:be.x,y:be.y,button:xe,action:ae,ctrl:$.ctrlKey,alt:$.altKey,shift:$.shiftKey})}const F={mouseup:null,wheel:null,mousedrag:null,mousemove:null},U={mouseup:$=>(ie($),$.buttons||(this._document.removeEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.removeEventListener("mousemove",F.mousedrag)),this.cancel($)),wheel:$=>(ie($),this.cancel($,!0)),mousedrag:$=>{$.buttons&&ie($)},mousemove:$=>{$.buttons||ie($)}};this.register(this.coreMouseService.onProtocolChange(($=>{$?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents($)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&$?F.mousemove||(O.addEventListener("mousemove",U.mousemove),F.mousemove=U.mousemove):(O.removeEventListener("mousemove",F.mousemove),F.mousemove=null),16&$?F.wheel||(O.addEventListener("wheel",U.wheel,{passive:!1}),F.wheel=U.wheel):(O.removeEventListener("wheel",F.wheel),F.wheel=null),2&$?F.mouseup||(F.mouseup=U.mouseup):(this._document.removeEventListener("mouseup",F.mouseup),F.mouseup=null),4&$?F.mousedrag||(F.mousedrag=U.mousedrag):(this._document.removeEventListener("mousemove",F.mousedrag),F.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(O,"mousedown",($=>{if($.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection($))return ie($),F.mouseup&&this._document.addEventListener("mouseup",F.mouseup),F.mousedrag&&this._document.addEventListener("mousemove",F.mousedrag),this.cancel($)}))),this.register((0,g.addDisposableDomListener)(O,"wheel",($=>{if(!F.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler($)===!1)return!1;if(!this.buffer.hasScrollback){const be=this.viewport.getLinesScrolled($);if(be===0)return;const xe=ne.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+($.deltaY<0?"A":"B");let ae="";for(let he=0;he<Math.abs(be);he++)ae+=xe;return this.coreService.triggerDataEvent(ae,!0),this.cancel($,!0)}return this.viewport.handleWheel($)?this.cancel($):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(O,"touchstart",($=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart($),this.cancel($)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(O,"touchmove",($=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove($)?void 0:this.cancel($)}),{passive:!1}))}refresh(G,O){var ie;(ie=this._renderService)==null||ie.refreshRows(G,O)}updateCursorStyle(G){var O;(O=this._selectionService)!=null&&O.shouldColumnSelect(G)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(G,O,ie=0){var F;ie===1?(super.scrollLines(G,O,ie),this.refresh(0,this.rows-1)):(F=this.viewport)==null||F.scrollLines(G)}paste(G){(0,h.paste)(G,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(G){this._customKeyEventHandler=G}attachCustomWheelEventHandler(G){this._customWheelEventHandler=G}registerLinkProvider(G){return this._linkProviderService.registerLinkProvider(G)}registerCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const O=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),O}deregisterCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(G)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(G){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)}registerDecoration(G){return this._decorationService.registerDecoration(G)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(G,O,ie){this._selectionService.setSelection(G,O,ie)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var G;(G=this._selectionService)==null||G.clearSelection()}selectAll(){var G;(G=this._selectionService)==null||G.selectAll()}selectLines(G,O){var ie;(ie=this._selectionService)==null||ie.selectLines(G,O)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const O=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!O&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;O||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,le.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),ie.type===3||ie.type===2){const F=this.rows-1;return this.scrollLines(ie.type===2?-F:F),this.cancel(G,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(ie.cancel&&this.cancel(G,!0),!ie.key||!!(G.key&&!G.ctrlKey&&!G.altKey&&!G.metaKey&&G.key.length===1&&G.key.charCodeAt(0)>=65&&G.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==ne.C0.ETX&&ie.key!==ne.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,O){const ie=G.isMac&&!this.options.macOptionIsMeta&&O.altKey&&!O.ctrlKey&&!O.metaKey||G.isWindows&&O.altKey&&O.ctrlKey&&!O.metaKey||G.isWindows&&O.getModifierState("AltGraph");return O.type==="keypress"?ie:ie&&(!O.keyCode||O.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(O){return O.keyCode===16||O.keyCode===17||O.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let O;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)O=G.charCode;else if(G.which===null||G.which===void 0)O=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;O=G.which}return!(!O||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(O=String.fromCharCode(O),this._onKey.fire({key:O,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(O,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(G){if(G.data&&G.inputType==="insertText"&&(!G.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const O=G.data;return this.coreService.triggerDataEvent(O,!0),this.cancel(G),!0}return!1}resize(G,O){G!==this.cols||O!==this.rows?super.resize(G,O):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,O){var ie,F;(ie=this._charSizeService)==null||ie.measure(),(F=this.viewport)==null||F.syncScrollArea(!0)}clear(){var G;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let O=1;O<this.rows;O++)this.buffer.lines.push(this.buffer.getBlankLine(Q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(G=this.viewport)==null||G.reset(),this.refresh(0,this.rows-1)}}reset(){var O,ie;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(O=this._selectionService)==null||O.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var G;(G=this._renderService)==null||G.clearTextureAtlas()}_reportFocus(){var G;(G=this.element)!=null&&G.classList.contains("focus")?this.coreService.triggerDataEvent(ne.C0.ESC+"[I"):this.coreService.triggerDataEvent(ne.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const O=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.C0.ESC}[4;${ie};${O}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const F=this._renderService.dimensions.css.cell.width.toFixed(0),U=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ne.C0.ESC}[6;${U};${F}t`)}}cancel(G,O){if(this.options.cancelEvents||O)return G.preventDefault(),G.stopPropagation(),!1}}s.Terminal=re},9924:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,h=1e3){this._renderCallback=o,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,h,g){this._rowCount=g,o=o!==void 0?o:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const c=Date.now();if(c-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=c,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=c-this._lastRefreshMs,b=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,h)}}},1680:function(_,s,o){var h=this&&this.__decorate||function(l,d,f,y){var E,S=arguments.length,L=S<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(l,d,f,y);else for(var x=l.length-1;x>=0;x--)(E=l[x])&&(L=(S<3?E(L):S>3?E(d,f,L):E(d,f))||L);return S>3&&L&&Object.defineProperty(d,f,L),L},g=this&&this.__param||function(l,d){return function(f,y){d(f,y,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const c=o(3656),p=o(4725),b=o(8460),w=o(844),m=o(2585);let u=s.Viewport=class extends w.Disposable{constructor(l,d,f,y,E,S,L,x){super(),this._viewportElement=l,this._scrollArea=d,this._bufferService=f,this._optionsService=y,this._charSizeService=E,this._renderService=S,this._coreBrowserService=L,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((P=>this._renderDimensions=P))),this._handleThemeChange(x.colors),this.register(x.onChangeColors((P=>this._handleThemeChange(P)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(l){this._viewportElement.style.backgroundColor=l.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(l){if(l)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const l=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==l&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=l),this._refreshAnimationFrame=null}syncScrollArea(l=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(l);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(l)}_handleScroll(l){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const l=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(l*(this._smoothScrollState.target-this._smoothScrollState.origin)),l<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(l,d){const f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&f<this._lastRecordedBufferHeight)||(l.cancelable&&l.preventDefault(),!1)}handleWheel(l){const d=this._getPixelsScrolled(l);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(l,d))}scrollLines(l){if(l!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=l*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!1})}_getPixelsScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let d=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(l,d){var x;let f,y="";const E=[],S=d??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let P=l;P<S;P++){const B=L.get(P);if(!B)continue;const j=(x=L.get(P+1))==null?void 0:x.isWrapped;if(y+=B.translateToString(!j),!j||P===L.length-1){const V=document.createElement("div");V.textContent=y,E.push(V),y.length>0&&(f=V),y=""}}return{bufferElements:E,cursorElement:f}}getLinesScrolled(l){if(l.deltaY===0||l.shiftKey)return 0;let d=this._applyScrollModifier(l.deltaY,l);return l.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):l.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(l,d){const f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&d.altKey||f==="ctrl"&&d.ctrlKey||f==="shift"&&d.shiftKey?l*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:l*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(l){this._lastTouchY=l.touches[0].pageY}handleTouchMove(l){const d=this._lastTouchY-l.touches[0].pageY;return this._lastTouchY=l.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(l,d))}};s.Viewport=u=h([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],u)},3107:function(_,s,o){var h=this&&this.__decorate||function(m,u,l,d){var f,y=arguments.length,E=y<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,u,l,d);else for(var S=m.length-1;S>=0;S--)(f=m[S])&&(E=(y<3?f(E):y>3?f(u,l,E):f(u,l))||E);return y>3&&E&&Object.defineProperty(u,l,E),E},g=this&&this.__param||function(m,u){return function(l,d){u(l,d,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const c=o(4725),p=o(844),b=o(2585);let w=s.BufferDecorationRenderer=class extends p.Disposable{constructor(m,u,l,d,f){super(),this._screenElement=m,this._bufferService=u,this._coreBrowserService=l,this._decorationService=d,this._renderService=f,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((y=>this._removeDecoration(y)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var d;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((d=m==null?void 0:m.options)==null?void 0:d.layer)==="top"),u.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const l=m.options.x??0;return l&&l>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(m,u),u}_refreshStyle(m){const u=m.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let l=this._decorationElements.get(m);l||(l=this._createElement(m),m.element=l,this._decorationElements.set(m,l),this._container.appendChild(l),m.onDispose((()=>{this._decorationElements.delete(m),l.remove()}))),l.style.top=u*this._renderService.dimensions.css.cell.height+"px",l.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(l)}}_refreshXPosition(m,u=m.element){if(!u)return;const l=m.options.x??0;(m.options.anchor||"left")==="right"?u.style.right=l?l*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=l?l*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var u;(u=this._decorationElements.get(m))==null||u.remove(),this._decorationElements.delete(m),m.dispose()}};s.BufferDecorationRenderer=w=h([g(1,b.IBufferService),g(2,c.ICoreBrowserService),g(3,b.IDecorationService),g(4,c.IRenderService)],w)},5871:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const h of this._zones)if(h.color===o.options.overviewRulerOptions.color&&h.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,o.marker.line))return;if(this._lineAdjacentToZone(h,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(h,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,h){return h>=o.startBufferLine&&h<=o.endBufferLine}_lineAdjacentToZone(o,h,g){return h>=o.startBufferLine-this._linePadding[g||"full"]&&h<=o.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(o,h){o.startBufferLine=Math.min(o.startBufferLine,h),o.endBufferLine=Math.max(o.endBufferLine,h)}}},5744:function(_,s,o){var h=this&&this.__decorate||function(f,y,E,S){var L,x=arguments.length,P=x<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(f,y,E,S);else for(var B=f.length-1;B>=0;B--)(L=f[B])&&(P=(x<3?L(P):x>3?L(y,E,P):L(y,E))||P);return x>3&&P&&Object.defineProperty(y,E,P),P},g=this&&this.__param||function(f,y){return function(E,S){y(E,S,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const c=o(5871),p=o(4725),b=o(844),w=o(2585),m={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0};let d=s.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,y,E,S,L,x,P){var j;super(),this._viewportElement=f,this._screenElement=y,this._bufferService=E,this._decorationService=S,this._renderService=L,this._optionsService=x,this._coreBrowserService=P,this._colorZoneStore=new c.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(j=this._viewportElement.parentElement)==null||j.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var V;(V=this._canvas)==null||V.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const f=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=f,u.center=y,u.right=f,this._refreshDrawHeightConstants(),l.full=0,l.left=0,l.center=u.left,l.right=u.left+u.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const f=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);m.left=y,m.center=y,m.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const f=this._colorZoneStore.zones;for(const y of f)y.position!=="full"&&this._renderColorZone(y);for(const y of f)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(l[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-m[f.position||"full"]/2),u[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[f.position||"full"]))}_queueRefresh(f,y){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};s.OverviewRulerRenderer=d=h([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,p.IRenderService),g(5,w.IOptionsService),g(6,p.ICoreBrowserService)],d)},2950:function(_,s,o){var h=this&&this.__decorate||function(m,u,l,d){var f,y=arguments.length,E=y<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,l):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(m,u,l,d);else for(var S=m.length-1;S>=0;S--)(f=m[S])&&(E=(y<3?f(E):y>3?f(u,l,E):f(u,l))||E);return y>3&&E&&Object.defineProperty(u,l,E),E},g=this&&this.__param||function(m,u){return function(l,d){u(l,d,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const c=o(4725),p=o(2585),b=o(2584);let w=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,u,l,d,f,y){this._textarea=m,this._compositionView=u,this._bufferService=l,this._optionsService=d,this._coreService=f,this._renderService=y,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let l;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,l=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),l.length>0&&this._coreService.triggerDataEvent(l,!0)}}),0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const u=this._textarea.value,l=u.replace(m,"");this._dataAlreadySent=l,u.length>m.length?this._coreService.triggerDataEvent(l,!0):u.length<m.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):u.length===m.length&&u!==m&&this._coreService.triggerDataEvent(u,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),l=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=l+"px",this._compositionView.style.lineHeight=l+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(y.width,1)+"px",this._textarea.style.height=Math.max(y.height,1)+"px",this._textarea.style.lineHeight=y.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};s.CompositionHelper=w=h([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,c.IRenderService)],w)},9806:(_,s)=>{function o(h,g,c){const p=c.getBoundingClientRect(),b=h.getComputedStyle(c),w=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[g.clientX-p.left-w,g.clientY-p.top-m]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(h,g,c,p,b,w,m,u,l){if(!w)return;const d=o(h,g,c);return d?(d[0]=Math.ceil((d[0]+(l?m/2:0))/m),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),p+(l?1:0)),d[1]=Math.min(Math.max(d[1],1),b),d):void 0}},9504:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const h=o(2584);function g(u,l,d,f){const y=u-c(u,d),E=l-c(l,d),S=Math.abs(y-E)-(function(L,x,P){let B=0;const j=L-c(L,P),V=x-c(x,P);for(let N=0;N<Math.abs(j-V);N++){const X=p(L,x)==="A"?-1:1,W=P.buffer.lines.get(j+X*N);W!=null&&W.isWrapped&&B++}return B})(u,l,d);return m(S,w(p(u,l),f))}function c(u,l){let d=0,f=l.buffer.lines.get(u),y=f==null?void 0:f.isWrapped;for(;y&&u>=0&&u<l.rows;)d++,f=l.buffer.lines.get(--u),y=f==null?void 0:f.isWrapped;return d}function p(u,l){return u>l?"A":"B"}function b(u,l,d,f,y,E){let S=u,L=l,x="";for(;S!==d||L!==f;)S+=y?1:-1,y&&S>E.cols-1?(x+=E.buffer.translateBufferLineToString(L,!1,u,S),S=0,u=0,L++):!y&&S<0&&(x+=E.buffer.translateBufferLineToString(L,!1,0,u+1),S=E.cols-1,u=S,L--);return x+E.buffer.translateBufferLineToString(L,!1,u,S)}function w(u,l){const d=l?"O":"[";return h.C0.ESC+d+u}function m(u,l){u=Math.floor(u);let d="";for(let f=0;f<u;f++)d+=l;return d}s.moveToCellSequence=function(u,l,d,f){const y=d.buffer.x,E=d.buffer.y;if(!d.buffer.hasScrollback)return(function(x,P,B,j,V,N){return g(P,j,V,N).length===0?"":m(b(x,P,x,P-c(P,V),!1,V).length,w("D",N))})(y,E,0,l,d,f)+g(E,l,d,f)+(function(x,P,B,j,V,N){let X;X=g(P,j,V,N).length>0?j-c(j,V):P;const W=j,Q=(function(ne,le,D,T,M,z){let J;return J=g(D,T,M,z).length>0?T-c(T,M):le,ne<D&&J<=T||ne>=D&&J<T?"C":"D"})(x,P,B,j,V,N);return m(b(x,X,B,W,Q==="C",V).length,w(Q,N))})(y,E,u,l,d,f);let S;if(E===l)return S=y>u?"D":"C",m(Math.abs(y-u),w(S,f));S=E>l?"D":"C";const L=Math.abs(E-l);return m((function(x,P){return P.cols-x})(E>l?u:y,d)+(L-1)*d.cols+1+((E>l?y:u)-1),w(S,f))}},1296:function(_,s,o){var h=this&&this.__decorate||function(N,X,W,Q){var ne,le=arguments.length,D=le<3?X:Q===null?Q=Object.getOwnPropertyDescriptor(X,W):Q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(N,X,W,Q);else for(var T=N.length-1;T>=0;T--)(ne=N[T])&&(D=(le<3?ne(D):le>3?ne(X,W,D):ne(X,W))||D);return le>3&&D&&Object.defineProperty(X,W,D),D},g=this&&this.__param||function(N,X){return function(W,Q){X(W,Q,N)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const c=o(3787),p=o(2550),b=o(2223),w=o(6171),m=o(6052),u=o(4725),l=o(8055),d=o(8460),f=o(844),y=o(2585),E="xterm-dom-renderer-owner-",S="xterm-rows",L="xterm-fg-",x="xterm-bg-",P="xterm-focus",B="xterm-selection";let j=1,V=s.DomRenderer=class extends f.Disposable{constructor(N,X,W,Q,ne,le,D,T,M,z,J,Z,re){super(),this._terminal=N,this._document=X,this._element=W,this._screenElement=Q,this._viewportElement=ne,this._helperContainer=le,this._linkifier2=D,this._charSizeService=M,this._optionsService=z,this._bufferService=J,this._coreBrowserService=Z,this._themeService=re,this._terminalClass=j++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(S),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=T.createInstance(c.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${S} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${S} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${S} .xterm-dim { color: ${l.color.multiplyOpacity(N.foreground,.5).css};}`,X+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,Q=`blink_bar_${this._terminalClass}`,ne=`blink_block_${this._terminalClass}`;X+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${Q} { 50% { box-shadow: none; }}`,X+=`@keyframes ${ne} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,X+=`${this._terminalSelector} .${S}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${S}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${S}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ne} 1s step-end infinite;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${S} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[le,D]of N.ansi.entries())X+=`${this._terminalSelector} .${L}${le} { color: ${D.css}; }${this._terminalSelector} .${L}${le}.xterm-dim { color: ${l.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${x}${le} { background-color: ${D.css}; }`;X+=`${this._terminalSelector} .${L}${b.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(N.background).css}; }${this._terminalSelector} .${L}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${x}${b.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,X){for(let W=this._rowElements.length;W<=X;W++){const Q=this._document.createElement("div");this._rowContainer.appendChild(Q),this._rowElements.push(Q)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,X){this._refreshRowElements(N,X),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(P),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(P),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,X,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,X,W),this.renderRows(0,this._bufferService.rows-1),!N||!X)return;this._selectionRenderModel.update(this._terminal,N,X,W);const Q=this._selectionRenderModel.viewportStartRow,ne=this._selectionRenderModel.viewportEndRow,le=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(le>=this._bufferService.rows||D<0)return;const T=this._document.createDocumentFragment();if(W){const M=N[0]>X[0];T.appendChild(this._createSelectionElement(le,M?X[0]:N[0],M?N[0]:X[0],D-le+1))}else{const M=Q===le?N[0]:0,z=le===ne?X[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(le,M,z));const J=D-le-1;if(T.appendChild(this._createSelectionElement(le+1,0,this._bufferService.cols,J)),le!==D){const Z=ne===D?X[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(D,0,Z))}}this._selectionContainer.appendChild(T)}_createSelectionElement(N,X,W,Q=1){const ne=this._document.createElement("div"),le=X*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(W-X);return le+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-le),ne.style.height=Q*this.dimensions.css.cell.height+"px",ne.style.top=N*this.dimensions.css.cell.height+"px",ne.style.left=`${le}px`,ne.style.width=`${D}px`,ne}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const N of this._rowElements)N.replaceChildren()}renderRows(N,X){const W=this._bufferService.buffer,Q=W.ybase+W.y,ne=Math.min(W.x,this._bufferService.cols-1),le=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=N;M<=X;M++){const z=M+W.ydisp,J=this._rowElements[M],Z=W.lines.get(z);if(!J||!Z)break;J.replaceChildren(...this._rowFactory.createRow(Z,z,z===Q,D,T,ne,le,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,X,W,Q,ne,le){W<0&&(N=0),Q<0&&(X=0);const D=this._bufferService.rows-1;W=Math.max(Math.min(W,D),0),Q=Math.max(Math.min(Q,D),0),ne=Math.min(ne,this._bufferService.cols);const T=this._bufferService.buffer,M=T.ybase+T.y,z=Math.min(T.x,ne-1),J=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=W;se<=Q;++se){const G=se+T.ydisp,O=this._rowElements[se],ie=T.lines.get(G);if(!O||!ie)break;O.replaceChildren(...this._rowFactory.createRow(ie,G,G===M,Z,re,z,J,this.dimensions.css.cell.width,this._widthCache,le?se===W?N:0:-1,le?(se===Q?X:ne)-1:-1))}}};s.DomRenderer=V=h([g(7,y.IInstantiationService),g(8,u.ICharSizeService),g(9,y.IOptionsService),g(10,y.IBufferService),g(11,u.ICoreBrowserService),g(12,u.IThemeService)],V)},3787:function(_,s,o){var h=this&&this.__decorate||function(S,L,x,P){var B,j=arguments.length,V=j<3?L:P===null?P=Object.getOwnPropertyDescriptor(L,x):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(S,L,x,P);else for(var N=S.length-1;N>=0;N--)(B=S[N])&&(V=(j<3?B(V):j>3?B(L,x,V):B(L,x))||V);return j>3&&V&&Object.defineProperty(L,x,V),V},g=this&&this.__param||function(S,L){return function(x,P){L(x,P,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const c=o(2223),p=o(643),b=o(511),w=o(2585),m=o(8055),u=o(4725),l=o(4269),d=o(6171),f=o(3734);let y=s.DomRendererRowFactory=class{constructor(S,L,x,P,B,j,V){this._document=S,this._characterJoinerService=L,this._optionsService=x,this._coreBrowserService=P,this._coreService=B,this._decorationService=j,this._themeService=V,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(S,L,x){this._selectionStart=S,this._selectionEnd=L,this._columnSelectMode=x}createRow(S,L,x,P,B,j,V,N,X,W,Q){const ne=[],le=this._characterJoinerService.getJoinedCharacters(L),D=this._themeService.colors;let T,M=S.getNoBgTrimmedLength();x&&M<j+1&&(M=j+1);let z=0,J="",Z=0,re=0,se=0,G=!1,O=0,ie=!1,F=0;const U=[],$=W!==-1&&Q!==-1;for(let be=0;be<M;be++){S.loadCell(be,this._workCell);let xe=this._workCell.getWidth();if(xe===0)continue;let ae=!1,he=be,fe=this._workCell;if(le.length>0&&be===le[0][0]){ae=!0;const Xe=le.shift();fe=new l.JoinedCellData(this._workCell,S.translateToString(!0,Xe[0],Xe[1]),Xe[1]-Xe[0]),he=Xe[1]-1,xe=fe.getWidth()}const Ee=this._isCellInSelection(be,L),He=x&&be===j,Le=$&&be>=W&&be<=Q;let ce=!1;this._decorationService.forEachDecorationAtCell(be,L,void 0,(Xe=>{ce=!0}));let Te=fe.getChars()||p.WHITESPACE_CELL_CHAR;if(Te===" "&&(fe.isUnderline()||fe.isOverline())&&(Te=" "),F=xe*N-X.get(Te,fe.isBold(),fe.isItalic()),T){if(z&&(Ee&&ie||!Ee&&!ie&&fe.bg===Z)&&(Ee&&ie&&D.selectionForeground||fe.fg===re)&&fe.extended.ext===se&&Le===G&&F===O&&!He&&!ae&&!ce){fe.isInvisible()?J+=p.WHITESPACE_CELL_CHAR:J+=Te,z++;continue}z&&(T.textContent=J),T=this._document.createElement("span"),z=0,J=""}else T=this._document.createElement("span");if(Z=fe.bg,re=fe.fg,se=fe.extended.ext,G=Le,O=F,ie=Ee,ae&&j>=be&&j<=he&&(j=be),!this._coreService.isCursorHidden&&He&&this._coreService.isCursorInitialized){if(U.push("xterm-cursor"),this._coreBrowserService.isFocused)V&&U.push("xterm-cursor-blink"),U.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":U.push("xterm-cursor-outline");break;case"block":U.push("xterm-cursor-block");break;case"bar":U.push("xterm-cursor-bar");break;case"underline":U.push("xterm-cursor-underline")}}if(fe.isBold()&&U.push("xterm-bold"),fe.isItalic()&&U.push("xterm-italic"),fe.isDim()&&U.push("xterm-dim"),J=fe.isInvisible()?p.WHITESPACE_CELL_CHAR:fe.getChars()||p.WHITESPACE_CELL_CHAR,fe.isUnderline()&&(U.push(`xterm-underline-${fe.extended.underlineStyle}`),J===" "&&(J=" "),!fe.isUnderlineColorDefault()))if(fe.isUnderlineColorRGB())T.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(fe.getUnderlineColor()).join(",")})`;else{let Xe=fe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&fe.isBold()&&Xe<8&&(Xe+=8),T.style.textDecorationColor=D.ansi[Xe].css}fe.isOverline()&&(U.push("xterm-overline"),J===" "&&(J=" ")),fe.isStrikethrough()&&U.push("xterm-strikethrough"),Le&&(T.style.textDecoration="underline");let De=fe.getFgColor(),pe=fe.getFgColorMode(),Be=fe.getBgColor(),Qe=fe.getBgColorMode();const Ne=!!fe.isInverse();if(Ne){const Xe=De;De=Be,Be=Xe;const Ue=pe;pe=Qe,Qe=Ue}let Me,Fe,tt,Ve=!1;switch(this._decorationService.forEachDecorationAtCell(be,L,void 0,(Xe=>{Xe.options.layer!=="top"&&Ve||(Xe.backgroundColorRGB&&(Qe=50331648,Be=Xe.backgroundColorRGB.rgba>>8&16777215,Me=Xe.backgroundColorRGB),Xe.foregroundColorRGB&&(pe=50331648,De=Xe.foregroundColorRGB.rgba>>8&16777215,Fe=Xe.foregroundColorRGB),Ve=Xe.options.layer==="top")})),!Ve&&Ee&&(Me=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Be=Me.rgba>>8&16777215,Qe=50331648,Ve=!0,D.selectionForeground&&(pe=50331648,De=D.selectionForeground.rgba>>8&16777215,Fe=D.selectionForeground)),Ve&&U.push("xterm-decoration-top"),Qe){case 16777216:case 33554432:tt=D.ansi[Be],U.push(`xterm-bg-${Be}`);break;case 50331648:tt=m.channels.toColor(Be>>16,Be>>8&255,255&Be),this._addStyle(T,`background-color:#${E((Be>>>0).toString(16),"0",6)}`);break;default:Ne?(tt=D.foreground,U.push(`xterm-bg-${c.INVERTED_DEFAULT_COLOR}`)):tt=D.background}switch(Me||fe.isDim()&&(Me=m.color.multiplyOpacity(tt,.5)),pe){case 16777216:case 33554432:fe.isBold()&&De<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(De+=8),this._applyMinimumContrast(T,tt,D.ansi[De],fe,Me,void 0)||U.push(`xterm-fg-${De}`);break;case 50331648:const Xe=m.channels.toColor(De>>16&255,De>>8&255,255&De);this._applyMinimumContrast(T,tt,Xe,fe,Me,Fe)||this._addStyle(T,`color:#${E(De.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(T,tt,D.foreground,fe,Me,Fe)||Ne&&U.push(`xterm-fg-${c.INVERTED_DEFAULT_COLOR}`)}U.length&&(T.className=U.join(" "),U.length=0),He||ae||ce?T.textContent=J:z++,F!==this.defaultSpacing&&(T.style.letterSpacing=`${F}px`),ne.push(T),be=he}return T&&z&&(T.textContent=J),ne}_applyMinimumContrast(S,L,x,P,B,j){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(P.getCode()))return!1;const V=this._getContrastCache(P);let N;if(B||j||(N=V.getColor(L.rgba,x.rgba)),N===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);N=m.color.ensureContrastRatio(B||L,j||x,X),V.setColor((B||L).rgba,(j||x).rgba,N??null)}return!!N&&(this._addStyle(S,`color:${N.css}`),!0)}_getContrastCache(S){return S.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(S,L){S.setAttribute("style",`${S.getAttribute("style")||""}${L};`)}_isCellInSelection(S,L){const x=this._selectionStart,P=this._selectionEnd;return!(!x||!P)&&(this._columnSelectMode?x[0]<=P[0]?S>=x[0]&&L>=x[1]&&S<P[0]&&L<=P[1]:S<x[0]&&L>=x[1]&&S>=P[0]&&L<=P[1]:L>x[1]&&L<P[1]||x[1]===P[1]&&L===x[1]&&S>=x[0]&&S<P[0]||x[1]<P[1]&&L===P[1]&&S<P[0]||x[1]<P[1]&&L===x[1]&&S>=x[0])}};function E(S,L,x){for(;S.length<x;)S=L+S;return S}s.DomRendererRowFactory=y=h([g(1,u.ICharacterJoinerService),g(2,w.IOptionsService),g(3,u.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,u.IThemeService)],y)},2550:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=o.createElement("span");g.classList.add("xterm-char-measure-element");const c=o.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold";const p=o.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const b=o.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[g,c,p,b],this._container.appendChild(g),this._container.appendChild(c),this._container.appendChild(p),this._container.appendChild(b),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,h,g,c){o===this._font&&h===this._fontSize&&g===this._weight&&c===this._weightBold||(this._font=o,this._fontSize=h,this._weight=g,this._weightBold=c,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${c}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${c}`,this.clear())}get(o,h,g){let c=0;if(!h&&!g&&o.length===1&&(c=o.charCodeAt(0))<256){if(this._flat[c]!==-9999)return this._flat[c];const w=this._measure(o,0);return w>0&&(this._flat[c]=w),w}let p=o;h&&(p+="B"),g&&(p+="I");let b=this._holey.get(p);if(b===void 0){let w=0;h&&(w|=1),g&&(w|=2),b=this._measure(o,w),b>0&&this._holey.set(p,b)}return b}_measure(o,h){const g=this._measureElements[h];return g.textContent=o.repeat(32),g.offsetWidth/32}}},2223:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const h=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(_,s)=>{function o(g){return 57508<=g&&g<=57558}function h(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},s.isEmoji=h,s.allowRescaling=function(g,c,p,b){return c===1&&p>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!h(g)&&!o(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},s.treatGlyphAsBackgroundColor=function(g){return o(g)||(function(c){return 9472<=c&&c<=9631})(g)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(g,c,p=0){return(g-(2*Math.round(c)-p))%(2*Math.round(c))}},6052:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,c,p,b=!1){if(this.selectionStart=c,this.selectionEnd=p,!c||!p||c[0]===p[0]&&c[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,m=c[1]-w,u=p[1]-w,l=Math.max(m,0),d=Math.min(u,g.rows-1);l>=g.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=m,this.viewportEndRow=u,this.viewportCappedStartRow=l,this.viewportCappedEndRow=d,this.startCol=c[0],this.endCol=p[0])}isCellSelected(g,c,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&p>=this.viewportCappedStartRow&&c<this.endCol&&p<=this.viewportCappedEndRow:c<this.startCol&&p>=this.viewportCappedStartRow&&c>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&c>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,h=this.selectionEnd;return!(!o||!h)&&(o[1]>h[1]||o[1]===h[1]&&o[0]>h[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,s,o){var h=this&&this.__decorate||function(d,f,y,E){var S,L=arguments.length,x=L<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,f,y,E);else for(var P=d.length-1;P>=0;P--)(S=d[P])&&(x=(L<3?S(x):L>3?S(f,y,x):S(f,y))||x);return L>3&&x&&Object.defineProperty(f,y,x),x},g=this&&this.__param||function(d,f){return function(y,E){f(y,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const c=o(2585),p=o(8460),b=o(844);let w=s.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,f,y){super(),this._optionsService=y,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new l(this._optionsService))}catch{this._measureStrategy=this.register(new u(d,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};s.CharSizeService=w=h([g(2,c.IOptionsService)],w);class m extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,y){f!==void 0&&f>0&&y!==void 0&&y>0&&(this._result.width=f,this._result.height=y)}}class u extends m{constructor(f,y,E){super(),this._document=f,this._parentElement=y,this._optionsService=E,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class l extends m{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const y=this._ctx.measureText("W");if(!("width"in y&&"fontBoundingBoxAscent"in y&&"fontBoundingBoxDescent"in y))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(_,s,o){var h=this&&this.__decorate||function(l,d,f,y){var E,S=arguments.length,L=S<3?d:y===null?y=Object.getOwnPropertyDescriptor(d,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(l,d,f,y);else for(var x=l.length-1;x>=0;x--)(E=l[x])&&(L=(S<3?E(L):S>3?E(d,f,L):E(d,f))||L);return S>3&&L&&Object.defineProperty(d,f,L),L},g=this&&this.__param||function(l,d){return function(f,y){d(f,y,l)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const c=o(3734),p=o(643),b=o(511),w=o(2585);class m extends c.AttributeData{constructor(d,f,y){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=f,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=m;let u=s.CharacterJoinerService=class xd{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(d){const f={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(f),f.id}deregister(d){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===d)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const f=this._bufferService.buffer.lines.get(d);if(!f||f.length===0)return[];const y=[],E=f.translateToString(!0);let S=0,L=0,x=0,P=f.getFg(0),B=f.getBg(0);for(let j=0;j<f.getTrimmedLength();j++)if(f.loadCell(j,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==P||this._workCell.bg!==B){if(j-S>1){const V=this._getJoinedRanges(E,x,L,f,S);for(let N=0;N<V.length;N++)y.push(V[N])}S=j,x=L,P=this._workCell.fg,B=this._workCell.bg}L+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-S>1){const j=this._getJoinedRanges(E,x,L,f,S);for(let V=0;V<j.length;V++)y.push(j[V])}return y}_getJoinedRanges(d,f,y,E,S){const L=d.substring(f,y);let x=[];try{x=this._characterJoiners[0].handler(L)}catch(P){console.error(P)}for(let P=1;P<this._characterJoiners.length;P++)try{const B=this._characterJoiners[P].handler(L);for(let j=0;j<B.length;j++)xd._mergeRanges(x,B[j])}catch(B){console.error(B)}return this._stringRangesToCellRanges(x,E,S),x}_stringRangesToCellRanges(d,f,y){let E=0,S=!1,L=0,x=d[E];if(x){for(let P=y;P<this._bufferService.cols;P++){const B=f.getWidth(P),j=f.getString(P).length||p.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!S&&x[0]<=L&&(x[0]=P,S=!0),x[1]<=L){if(x[1]=P,x=d[++E],!x)break;x[0]<=L?(x[0]=P,S=!0):S=!1}L+=j}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(d,f){let y=!1;for(let E=0;E<d.length;E++){const S=d[E];if(y){if(f[1]<=S[0])return d[E-1][1]=f[1],d;if(f[1]<=S[1])return d[E-1][1]=Math.max(f[1],S[1]),d.splice(E,1),d;d.splice(E,1),E--}else{if(f[1]<=S[0])return d.splice(E,0,f),d;if(f[1]<=S[1])return S[0]=Math.min(f[0],S[0]),d;f[0]<S[1]&&(S[0]=Math.min(f[0],S[0]),y=!0)}}return y?d[d.length-1][1]=f[1]:d.push(f),d}};s.CharacterJoinerService=u=h([g(0,w.IBufferService)],u)},5114:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const h=o(844),g=o(8460),c=o(3656);class p extends h.Disposable{constructor(m,u,l){super(),this._textarea=m,this._window=u,this.mainDocument=l,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(m){this._window!==m&&(this._window=m,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}s.CoreBrowserService=p;class b extends h.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,c.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||m.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const h=o(844);class g extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const b=this.linkProviders.indexOf(p);b!==-1&&this.linkProviders.splice(b,1)}}}}s.LinkProviderService=g},8934:function(_,s,o){var h=this&&this.__decorate||function(w,m,u,l){var d,f=arguments.length,y=f<3?m:l===null?l=Object.getOwnPropertyDescriptor(m,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(w,m,u,l);else for(var E=w.length-1;E>=0;E--)(d=w[E])&&(y=(f<3?d(y):f>3?d(m,u,y):d(m,u))||y);return f>3&&y&&Object.defineProperty(m,u,y),y},g=this&&this.__param||function(w,m){return function(u,l){m(u,l,w)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const c=o(4725),p=o(9806);let b=s.MouseService=class{constructor(w,m){this._renderService=w,this._charSizeService=m}getCoords(w,m,u,l,d){return(0,p.getCoords)(window,w,m,u,l,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(w,m){const u=(0,p.getCoordsRelativeToElement)(window,w,m);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};s.MouseService=b=h([g(0,c.IRenderService),g(1,c.ICharSizeService)],b)},3230:function(_,s,o){var h=this&&this.__decorate||function(d,f,y,E){var S,L=arguments.length,x=L<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,f,y,E);else for(var P=d.length-1;P>=0;P--)(S=d[P])&&(x=(L<3?S(x):L>3?S(f,y,x):S(f,y))||x);return L>3&&x&&Object.defineProperty(f,y,x),x},g=this&&this.__param||function(d,f){return function(y,E){f(y,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const c=o(6193),p=o(4725),b=o(8460),w=o(844),m=o(7226),u=o(2585);let l=s.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,f,y,E,S,L,x,P){super(),this._rowCount=d,this._charSizeService=E,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c.RenderDebouncer(((B,j)=>this._renderRows(B,j)),x),this.register(this._renderDebouncer),this.register(x.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(y.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(S.onDecorationRegistered((()=>this._fullRefresh()))),this.register(S.onDecorationRemoved((()=>this._fullRefresh()))),this.register(y.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(y.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(P.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(x.window,f),this.register(x.onWindowChange((B=>this._registerIntersectionObserver(B,f))))}_registerIntersectionObserver(d,f){if("IntersectionObserver"in d){const y=new d.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});y.observe(f),this._observerDisposable.value=(0,w.toDisposable)((()=>y.disconnect()))}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(d,f,y=!1){this._isPaused?this._needsFullRefresh=!0:(y||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,f,this._rowCount))}_renderRows(d,f){this._renderer.value&&(d=Math.min(d,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(d,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:f}),this._onRender.fire({start:d,end:f}),this._isNextRenderRedrawOnly=!0)}resize(d,f){this._rowCount=f,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw((f=>this.refreshRows(f.start,f.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,f;this._renderer.value&&((f=(d=this._renderer.value).clearTextureAtlas)==null||f.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var y;return(y=this._renderer.value)==null?void 0:y.handleResize(d,f)})):this._renderer.value.handleResize(d,f),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,f,y){var E;this._selectionState.start=d,this._selectionState.end=f,this._selectionState.columnSelectMode=y,(E=this._renderer.value)==null||E.handleSelectionChanged(d,f,y)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};s.RenderService=l=h([g(2,u.IOptionsService),g(3,p.ICharSizeService),g(4,u.IDecorationService),g(5,u.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],l)},9312:function(_,s,o){var h=this&&this.__decorate||function(x,P,B,j){var V,N=arguments.length,X=N<3?P:j===null?j=Object.getOwnPropertyDescriptor(P,B):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(x,P,B,j);else for(var W=x.length-1;W>=0;W--)(V=x[W])&&(X=(N<3?V(X):N>3?V(P,B,X):V(P,B))||X);return N>3&&X&&Object.defineProperty(P,B,X),X},g=this&&this.__param||function(x,P){return function(B,j){P(B,j,x)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const c=o(9806),p=o(9504),b=o(456),w=o(4725),m=o(8460),u=o(844),l=o(6114),d=o(4841),f=o(511),y=o(2585),E=" ",S=new RegExp(E,"g");let L=s.SelectionService=class extends u.Disposable{constructor(x,P,B,j,V,N,X,W,Q){super(),this._element=x,this._screenElement=P,this._linkifier=B,this._bufferService=j,this._coreService=V,this._mouseService=N,this._optionsService=X,this._renderService=W,this._coreBrowserService=Q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ne=>this._handleMouseMove(ne),this._mouseUpListener=ne=>this._handleMouseUp(ne),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ne=>this._handleTrim(ne))),this.register(this._bufferService.buffers.onBufferActivate((ne=>this._handleBufferActivate(ne)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!x||!P||x[0]===P[0]&&x[1]===P[1])}get selectionText(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!x||!P)return"";const B=this._bufferService.buffer,j=[];if(this._activeSelectionMode===3){if(x[0]===P[0])return"";const V=x[0]<P[0]?x[0]:P[0],N=x[0]<P[0]?P[0]:x[0];for(let X=x[1];X<=P[1];X++){const W=B.translateBufferLineToString(X,!0,V,N);j.push(W)}}else{const V=x[1]===P[1]?P[0]:void 0;j.push(B.translateBufferLineToString(x[1],!0,x[0],V));for(let N=x[1]+1;N<=P[1]-1;N++){const X=B.lines.get(N),W=B.translateBufferLineToString(N,!0);X!=null&&X.isWrapped?j[j.length-1]+=W:j.push(W)}if(x[1]!==P[1]){const N=B.lines.get(P[1]),X=B.translateBufferLineToString(P[1],!0,0,P[0]);N&&N.isWrapped?j[j.length-1]+=X:j.push(X)}}return j.map((V=>V.replace(S," "))).join(l.isWindows?`\r
436
+ `:`
437
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),l.isLinux&&x&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(x){const P=this._getMouseBufferCoords(x),B=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!!(B&&j&&P)&&this._areCoordsInSelection(P,B,j)}isCellInSelection(x,P){const B=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!B||!j)&&this._areCoordsInSelection([x,P],B,j)}_areCoordsInSelection(x,P,B){return x[1]>P[1]&&x[1]<B[1]||P[1]===B[1]&&x[1]===P[1]&&x[0]>=P[0]&&x[0]<B[0]||P[1]<B[1]&&x[1]===B[1]&&x[0]<B[0]||P[1]<B[1]&&x[1]===P[1]&&x[0]>=P[0]}_selectWordAtCursor(x,P){var V,N;const B=(N=(V=this._linkifier.currentLink)==null?void 0:V.link)==null?void 0:N.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const j=this._getMouseBufferCoords(x);return!!j&&(this._selectWordAt(j,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,P){this._model.clearSelection(),x=Math.max(x,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const P=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(x){let P=(0,c.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=B?0:(P>B&&(P-=B),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(x){return l.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const P=this._getMouseBufferCoords(x);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(x){return x.altKey&&!(l.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(x),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const j=B.lines.get(this._model.selectionEnd[1]);j&&j.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const P=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const j=(0,p.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(j,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,B=!(!x||!P||x[0]===P[0]&&x[1]===P[1]);B?x&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,P,B)):this._oldHasSelection&&this._fireOnSelectionChange(x,P,B)}_fireOnSelectionChange(x,P,B){this._oldSelectionStart=x,this._oldSelectionEnd=P,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim((P=>this._handleTrim(P)))}_convertViewportColToCharacterIndex(x,P){let B=P;for(let j=0;P>=j;j++){const V=x.loadCell(j,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:V>1&&P!==j&&(B+=V-1)}return B}setSelection(x,P,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,P],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,P,B=!0,j=!0){if(x[0]>=this._bufferService.cols)return;const V=this._bufferService.buffer,N=V.lines.get(x[1]);if(!N)return;const X=V.translateBufferLineToString(x[1],!1);let W=this._convertViewportColToCharacterIndex(N,x[0]),Q=W;const ne=x[0]-W;let le=0,D=0,T=0,M=0;if(X.charAt(W)===" "){for(;W>0&&X.charAt(W-1)===" ";)W--;for(;Q<X.length&&X.charAt(Q+1)===" ";)Q++}else{let Z=x[0],re=x[0];N.getWidth(Z)===0&&(le++,Z--),N.getWidth(re)===2&&(D++,re++);const se=N.getString(re).length;for(se>1&&(M+=se-1,Q+=se-1);Z>0&&W>0&&!this._isCharWordSeparator(N.loadCell(Z-1,this._workCell));){N.loadCell(Z-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(le++,Z--):G>1&&(T+=G-1,W-=G-1),W--,Z--}for(;re<N.length&&Q+1<X.length&&!this._isCharWordSeparator(N.loadCell(re+1,this._workCell));){N.loadCell(re+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,re++):G>1&&(M+=G-1,Q+=G-1),Q++,re++}}Q++;let z=W+ne-le+T,J=Math.min(this._bufferService.cols,Q-W+le+D-T-M);if(P||X.slice(W,Q).trim()!==""){if(B&&z===0&&N.getCodePoint(0)!==32){const Z=V.lines.get(x[1]-1);if(Z&&N.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(re){const se=this._bufferService.cols-re.start;z-=se,J+=se}}}if(j&&z+J===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const Z=V.lines.get(x[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const re=this._getWordAt([0,x[1]+1],!1,!1,!0);re&&(J+=re.length)}}return{start:z,length:J}}}_selectWordAt(x,P){const B=this._getWordAt(x,P);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[B.start,x[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(x){const P=this._getWordAt(x,!0);if(P){let B=x[1];for(;P.start<0;)P.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,B]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const P=this._bufferService.buffer.getWrappedRangeForLine(x),B={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(B,this._bufferService.cols)}};s.SelectionService=L=h([g(3,y.IBufferService),g(4,y.ICoreService),g(5,w.IMouseService),g(6,y.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],L)},4725:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const h=o(8343);s.ICharSizeService=(0,h.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),s.IMouseService=(0,h.createDecorator)("MouseService"),s.IRenderService=(0,h.createDecorator)("RenderService"),s.ISelectionService=(0,h.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,h.createDecorator)("ThemeService"),s.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(_,s,o){var h=this&&this.__decorate||function(L,x,P,B){var j,V=arguments.length,N=V<3?x:B===null?B=Object.getOwnPropertyDescriptor(x,P):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(L,x,P,B);else for(var X=L.length-1;X>=0;X--)(j=L[X])&&(N=(V<3?j(N):V>3?j(x,P,N):j(x,P))||N);return V>3&&N&&Object.defineProperty(x,P,N),N},g=this&&this.__param||function(L,x){return function(P,B){x(P,B,L)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const c=o(7239),p=o(8055),b=o(8460),w=o(844),m=o(2585),u=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),d=p.css.toColor("#ffffff"),f=p.css.toColor("#000000"),y={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let P=0;P<216;P++){const B=x[P/36%6|0],j=x[P/6%6|0],V=x[P%6];L.push({css:p.channels.toCss(B,j,V),rgba:p.channels.toRgba(B,j,V)})}for(let P=0;P<24;P++){const B=8+10*P;L.push({css:p.channels.toCss(B,B,B),rgba:p.channels.toRgba(B,B,B)})}return L})());let E=s.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new c.ColorContrastCache,this._halfContrastCache=new c.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:l,cursor:d,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:p.color.blend(l,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:p.color.blend(l,y),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(L={}){const x=this._colors;if(x.foreground=S(L.foreground,u),x.background=S(L.background,l),x.cursor=S(L.cursor,d),x.cursorAccent=S(L.cursorAccent,f),x.selectionBackgroundTransparent=S(L.selectionBackground,y),x.selectionBackgroundOpaque=p.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=S(L.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=p.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=L.selectionForeground?S(L.selectionForeground,p.NULL_COLOR):void 0,x.selectionForeground===p.NULL_COLOR&&(x.selectionForeground=void 0),p.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=p.color.opacity(x.selectionBackgroundTransparent,.3)),p.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=p.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=s.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=S(L.black,s.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=S(L.red,s.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=S(L.green,s.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=S(L.yellow,s.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=S(L.blue,s.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=S(L.magenta,s.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=S(L.cyan,s.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=S(L.white,s.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=S(L.brightBlack,s.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=S(L.brightRed,s.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=S(L.brightGreen,s.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=S(L.brightYellow,s.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=S(L.brightBlue,s.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=S(L.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=S(L.brightCyan,s.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=S(L.brightWhite,s.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const P=Math.min(x.ansi.length-16,L.extendedAnsi.length);for(let B=0;B<P;B++)x.ansi[B+16]=S(L.extendedAnsi[B],s.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[L]=this._restoreColors.ansi[L]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(L){L(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function S(L,x){if(L!==void 0)try{return p.css.toColor(L)}catch{}return x}s.ThemeService=E=h([g(0,m.IOptionsService)],E)},6349:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const h=o(8460),g=o(844);class c extends g.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const w=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)w[m]=this._array[this._getCyclicIndex(m)];this._array=w,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let w=this._length;w<b;w++)this._array[w]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,w){this._array[this._getCyclicIndex(b)]=w}push(b){this._array[this._getCyclicIndex(this._length)]=b,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(b,w,...m){if(w){for(let u=b;u<this._length-w;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+w)];this._length-=w,this.onDeleteEmitter.fire({index:b,amount:w})}for(let u=this._length-1;u>=b;u--)this._array[this._getCyclicIndex(u+m.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<m.length;u++)this._array[this._getCyclicIndex(b+u)]=m[u];if(m.length&&this.onInsertEmitter.fire({index:b,amount:m.length}),this._length+m.length>this._maxLength){const u=this._length+m.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=m.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,w,m){if(!(w<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let l=w-1;l>=0;l--)this.set(b+l+m,this.get(b+l));const u=b+w+m-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<w;u++)this.set(b+u+m,this.get(b+u))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}s.CircularList=c},1439:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(h,g=5){if(typeof h!="object")return h;const c=Array.isArray(h)?[]:{};for(const p in h)c[p]=g<=1?h[p]:h[p]&&o(h[p],g-1);return c}},8055:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,h=0,g=0,c=0;var p,b,w,m,u;function l(f){const y=f.toString(16);return y.length<2?"0"+y:y}function d(f,y){return f<y?(y+.05)/(f+.05):(f+.05)/(y+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},(function(f){f.toCss=function(y,E,S,L){return L!==void 0?`#${l(y)}${l(E)}${l(S)}${l(L)}`:`#${l(y)}${l(E)}${l(S)}`},f.toRgba=function(y,E,S,L=255){return(y<<24|E<<16|S<<8|L)>>>0},f.toColor=function(y,E,S,L){return{css:f.toCss(y,E,S,L),rgba:f.toRgba(y,E,S,L)}}})(p||(s.channels=p={})),(function(f){function y(E,S){return c=Math.round(255*S),[o,h,g]=u.toChannels(E.rgba),{css:p.toCss(o,h,g,c),rgba:p.toRgba(o,h,g,c)}}f.blend=function(E,S){if(c=(255&S.rgba)/255,c===1)return{css:S.css,rgba:S.rgba};const L=S.rgba>>24&255,x=S.rgba>>16&255,P=S.rgba>>8&255,B=E.rgba>>24&255,j=E.rgba>>16&255,V=E.rgba>>8&255;return o=B+Math.round((L-B)*c),h=j+Math.round((x-j)*c),g=V+Math.round((P-V)*c),{css:p.toCss(o,h,g),rgba:p.toRgba(o,h,g)}},f.isOpaque=function(E){return(255&E.rgba)==255},f.ensureContrastRatio=function(E,S,L){const x=u.ensureContrastRatio(E.rgba,S.rgba,L);if(x)return p.toColor(x>>24&255,x>>16&255,x>>8&255)},f.opaque=function(E){const S=(255|E.rgba)>>>0;return[o,h,g]=u.toChannels(S),{css:p.toCss(o,h,g),rgba:S}},f.opacity=y,f.multiplyOpacity=function(E,S){return c=255&E.rgba,y(E,c*S/255)},f.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(b||(s.color=b={})),(function(f){let y,E;try{const S=document.createElement("canvas");S.width=1,S.height=1;const L=S.getContext("2d",{willReadFrequently:!0});L&&(y=L,y.globalCompositeOperation="copy",E=y.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return o=parseInt(S.slice(1,2).repeat(2),16),h=parseInt(S.slice(2,3).repeat(2),16),g=parseInt(S.slice(3,4).repeat(2),16),p.toColor(o,h,g);case 5:return o=parseInt(S.slice(1,2).repeat(2),16),h=parseInt(S.slice(2,3).repeat(2),16),g=parseInt(S.slice(3,4).repeat(2),16),c=parseInt(S.slice(4,5).repeat(2),16),p.toColor(o,h,g,c);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const L=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return o=parseInt(L[1]),h=parseInt(L[2]),g=parseInt(L[3]),c=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),p.toColor(o,h,g,c);if(!y||!E)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=E,y.fillStyle=S,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[o,h,g,c]=y.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(o,h,g,c),css:S}}})(w||(s.css=w={})),(function(f){function y(E,S,L){const x=E/255,P=S/255,B=L/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}f.relativeLuminance=function(E){return y(E>>16&255,E>>8&255,255&E)},f.relativeLuminance2=y})(m||(s.rgb=m={})),(function(f){function y(S,L,x){const P=S>>24&255,B=S>>16&255,j=S>>8&255;let V=L>>24&255,N=L>>16&255,X=L>>8&255,W=d(m.relativeLuminance2(V,N,X),m.relativeLuminance2(P,B,j));for(;W<x&&(V>0||N>0||X>0);)V-=Math.max(0,Math.ceil(.1*V)),N-=Math.max(0,Math.ceil(.1*N)),X-=Math.max(0,Math.ceil(.1*X)),W=d(m.relativeLuminance2(V,N,X),m.relativeLuminance2(P,B,j));return(V<<24|N<<16|X<<8|255)>>>0}function E(S,L,x){const P=S>>24&255,B=S>>16&255,j=S>>8&255;let V=L>>24&255,N=L>>16&255,X=L>>8&255,W=d(m.relativeLuminance2(V,N,X),m.relativeLuminance2(P,B,j));for(;W<x&&(V<255||N<255||X<255);)V=Math.min(255,V+Math.ceil(.1*(255-V))),N=Math.min(255,N+Math.ceil(.1*(255-N))),X=Math.min(255,X+Math.ceil(.1*(255-X))),W=d(m.relativeLuminance2(V,N,X),m.relativeLuminance2(P,B,j));return(V<<24|N<<16|X<<8|255)>>>0}f.blend=function(S,L){if(c=(255&L)/255,c===1)return L;const x=L>>24&255,P=L>>16&255,B=L>>8&255,j=S>>24&255,V=S>>16&255,N=S>>8&255;return o=j+Math.round((x-j)*c),h=V+Math.round((P-V)*c),g=N+Math.round((B-N)*c),p.toRgba(o,h,g)},f.ensureContrastRatio=function(S,L,x){const P=m.relativeLuminance(S>>8),B=m.relativeLuminance(L>>8);if(d(P,B)<x){if(B<P){const N=y(S,L,x),X=d(P,m.relativeLuminance(N>>8));if(X<x){const W=E(S,L,x);return X>d(P,m.relativeLuminance(W>>8))?N:W}return N}const j=E(S,L,x),V=d(P,m.relativeLuminance(j>>8));if(V<x){const N=y(S,L,x);return V>d(P,m.relativeLuminance(N>>8))?j:N}return j}},f.reduceLuminance=y,f.increaseLuminance=E,f.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]}})(u||(s.rgba=u={})),s.toPaddedHex=l,s.contrastRatio=d},8969:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const h=o(844),g=o(2585),c=o(4348),p=o(7866),b=o(744),w=o(7302),m=o(6975),u=o(8460),l=o(1753),d=o(1480),f=o(7994),y=o(9282),E=o(5435),S=o(5981),L=o(2660);let x=!1;class P extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((j=>{var V;(V=this._onScrollApi)==null||V.fire(j.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(j){for(const V in j)this.optionsService.options[V]=j[V]}constructor(j){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new c.InstantiationService,this.optionsService=this.register(new w.OptionsService(j)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(l.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((V=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((V=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new S.WriteBuffer(((V,N)=>this._inputHandler.parse(V,N)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(j,V){this._writeBuffer.write(j,V)}writeSync(j,V){this._logService.logLevel<=g.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync(j,V)}input(j,V=!0){this.coreService.triggerDataEvent(j,V)}resize(j,V){isNaN(j)||isNaN(V)||(j=Math.max(j,b.MINIMUM_COLS),V=Math.max(V,b.MINIMUM_ROWS),this._bufferService.resize(j,V))}scroll(j,V=!1){this._bufferService.scroll(j,V)}scrollLines(j,V,N){this._bufferService.scrollLines(j,V,N)}scrollPages(j){this.scrollLines(j*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(j){const V=j-this._bufferService.buffer.ydisp;V!==0&&this.scrollLines(V)}registerEscHandler(j,V){return this._inputHandler.registerEscHandler(j,V)}registerDcsHandler(j,V){return this._inputHandler.registerDcsHandler(j,V)}registerCsiHandler(j,V){return this._inputHandler.registerCsiHandler(j,V)}registerOscHandler(j,V){return this._inputHandler.registerOscHandler(j,V)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let j=!1;const V=this.optionsService.rawOptions.windowsPty;V&&V.buildNumber!==void 0&&V.buildNumber!==void 0?j=V.backend==="conpty"&&V.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(j=!0),j?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const j=[];j.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),j.push(this.registerCsiHandler({final:"H"},(()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const V of j)V.dispose()}))}}}s.CoreTerminal=P},8460:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===o)return void this._listeners.splice(h,1)}}})),this._event}fire(o,h){const g=[];for(let c=0;c<this._listeners.length;c++)g.push(this._listeners[c]);for(let c=0;c<g.length;c++)g[c].call(void 0,o,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,h){return o((g=>h.fire(g)))},s.runAndSubscribe=function(o,h){return h(void 0),o((g=>h(g)))}},5435:function(_,s,o){var h=this&&this.__decorate||function(le,D,T,M){var z,J=arguments.length,Z=J<3?D:M===null?M=Object.getOwnPropertyDescriptor(D,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(le,D,T,M);else for(var re=le.length-1;re>=0;re--)(z=le[re])&&(Z=(J<3?z(Z):J>3?z(D,T,Z):z(D,T))||Z);return J>3&&Z&&Object.defineProperty(D,T,Z),Z},g=this&&this.__param||function(le,D){return function(T,M){D(T,M,le)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const c=o(2584),p=o(7116),b=o(2015),w=o(844),m=o(482),u=o(8437),l=o(8460),d=o(643),f=o(511),y=o(3734),E=o(2585),S=o(1480),L=o(6242),x=o(6351),P=o(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},j=131072;function V(le,D){if(le>24)return D.setWinLines||!1;switch(le){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var N;(function(le){le[le.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",le[le.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(s.WindowsOptionsReportType=N={}));let X=0;class W extends w.Disposable{getAttrData(){return this._curAttrData}constructor(D,T,M,z,J,Z,re,se,G=new b.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=T,this._coreService=M,this._logService=z,this._optionsService=J,this._oscLinkService=Z,this._coreMouseService=re,this._unicodeService=se,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new f.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new l.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new l.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new l.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new l.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new l.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new l.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new l.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new l.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new l.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new l.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new l.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new Q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._parser.setCsiHandlerFallback(((O,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(O),params:ie.toArray()})})),this._parser.setEscHandlerFallback((O=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(O)})})),this._parser.setExecuteHandlerFallback((O=>{this._logService.debug("Unknown EXECUTE code: ",{code:O})})),this._parser.setOscHandlerFallback(((O,ie,F)=>{this._logService.debug("Unknown OSC code: ",{identifier:O,action:ie,data:F})})),this._parser.setDcsHandlerFallback(((O,ie,F)=>{ie==="HOOK"&&(F=F.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(O),action:ie,payload:F})})),this._parser.setPrintHandler(((O,ie,F)=>this.print(O,ie,F))),this._parser.registerCsiHandler({final:"@"},(O=>this.insertChars(O))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(O=>this.scrollLeft(O))),this._parser.registerCsiHandler({final:"A"},(O=>this.cursorUp(O))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(O=>this.scrollRight(O))),this._parser.registerCsiHandler({final:"B"},(O=>this.cursorDown(O))),this._parser.registerCsiHandler({final:"C"},(O=>this.cursorForward(O))),this._parser.registerCsiHandler({final:"D"},(O=>this.cursorBackward(O))),this._parser.registerCsiHandler({final:"E"},(O=>this.cursorNextLine(O))),this._parser.registerCsiHandler({final:"F"},(O=>this.cursorPrecedingLine(O))),this._parser.registerCsiHandler({final:"G"},(O=>this.cursorCharAbsolute(O))),this._parser.registerCsiHandler({final:"H"},(O=>this.cursorPosition(O))),this._parser.registerCsiHandler({final:"I"},(O=>this.cursorForwardTab(O))),this._parser.registerCsiHandler({final:"J"},(O=>this.eraseInDisplay(O,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(O=>this.eraseInDisplay(O,!0))),this._parser.registerCsiHandler({final:"K"},(O=>this.eraseInLine(O,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(O=>this.eraseInLine(O,!0))),this._parser.registerCsiHandler({final:"L"},(O=>this.insertLines(O))),this._parser.registerCsiHandler({final:"M"},(O=>this.deleteLines(O))),this._parser.registerCsiHandler({final:"P"},(O=>this.deleteChars(O))),this._parser.registerCsiHandler({final:"S"},(O=>this.scrollUp(O))),this._parser.registerCsiHandler({final:"T"},(O=>this.scrollDown(O))),this._parser.registerCsiHandler({final:"X"},(O=>this.eraseChars(O))),this._parser.registerCsiHandler({final:"Z"},(O=>this.cursorBackwardTab(O))),this._parser.registerCsiHandler({final:"`"},(O=>this.charPosAbsolute(O))),this._parser.registerCsiHandler({final:"a"},(O=>this.hPositionRelative(O))),this._parser.registerCsiHandler({final:"b"},(O=>this.repeatPrecedingCharacter(O))),this._parser.registerCsiHandler({final:"c"},(O=>this.sendDeviceAttributesPrimary(O))),this._parser.registerCsiHandler({prefix:">",final:"c"},(O=>this.sendDeviceAttributesSecondary(O))),this._parser.registerCsiHandler({final:"d"},(O=>this.linePosAbsolute(O))),this._parser.registerCsiHandler({final:"e"},(O=>this.vPositionRelative(O))),this._parser.registerCsiHandler({final:"f"},(O=>this.hVPosition(O))),this._parser.registerCsiHandler({final:"g"},(O=>this.tabClear(O))),this._parser.registerCsiHandler({final:"h"},(O=>this.setMode(O))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(O=>this.setModePrivate(O))),this._parser.registerCsiHandler({final:"l"},(O=>this.resetMode(O))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(O=>this.resetModePrivate(O))),this._parser.registerCsiHandler({final:"m"},(O=>this.charAttributes(O))),this._parser.registerCsiHandler({final:"n"},(O=>this.deviceStatus(O))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(O=>this.deviceStatusPrivate(O))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(O=>this.softReset(O))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(O=>this.setCursorStyle(O))),this._parser.registerCsiHandler({final:"r"},(O=>this.setScrollRegion(O))),this._parser.registerCsiHandler({final:"s"},(O=>this.saveCursor(O))),this._parser.registerCsiHandler({final:"t"},(O=>this.windowOptions(O))),this._parser.registerCsiHandler({final:"u"},(O=>this.restoreCursor(O))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(O=>this.insertColumns(O))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(O=>this.deleteColumns(O))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(O=>this.selectProtected(O))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(O=>this.requestMode(O,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(O=>this.requestMode(O,!1))),this._parser.setExecuteHandler(c.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(c.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(c.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(c.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(c.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(c.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(c.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(c.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(c.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(c.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new L.OscHandler((O=>(this.setTitle(O),this.setIconName(O),!0)))),this._parser.registerOscHandler(1,new L.OscHandler((O=>this.setIconName(O)))),this._parser.registerOscHandler(2,new L.OscHandler((O=>this.setTitle(O)))),this._parser.registerOscHandler(4,new L.OscHandler((O=>this.setOrReportIndexedColor(O)))),this._parser.registerOscHandler(8,new L.OscHandler((O=>this.setHyperlink(O)))),this._parser.registerOscHandler(10,new L.OscHandler((O=>this.setOrReportFgColor(O)))),this._parser.registerOscHandler(11,new L.OscHandler((O=>this.setOrReportBgColor(O)))),this._parser.registerOscHandler(12,new L.OscHandler((O=>this.setOrReportCursorColor(O)))),this._parser.registerOscHandler(104,new L.OscHandler((O=>this.restoreIndexedColor(O)))),this._parser.registerOscHandler(110,new L.OscHandler((O=>this.restoreFgColor(O)))),this._parser.registerOscHandler(111,new L.OscHandler((O=>this.restoreBgColor(O)))),this._parser.registerOscHandler(112,new L.OscHandler((O=>this.restoreCursorColor(O)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const O in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:O},(()=>this.selectCharset("("+O))),this._parser.registerEscHandler({intermediates:")",final:O},(()=>this.selectCharset(")"+O))),this._parser.registerEscHandler({intermediates:"*",final:O},(()=>this.selectCharset("*"+O))),this._parser.registerEscHandler({intermediates:"+",final:O},(()=>this.selectCharset("+"+O))),this._parser.registerEscHandler({intermediates:"-",final:O},(()=>this.selectCharset("-"+O))),this._parser.registerEscHandler({intermediates:".",final:O},(()=>this.selectCharset("."+O))),this._parser.registerEscHandler({intermediates:"/",final:O},(()=>this.selectCharset("/"+O)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((O=>(this._logService.error("Parsing error: ",O),O))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler(((O,ie)=>this.requestStatusString(O,ie))))}_preserveStack(D,T,M,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=M,this._parseStack.position=z}_logSlowResolvingAsync(D){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([D,new Promise(((T,M)=>setTimeout((()=>M("#SLOW_TIMEOUT")),5e3)))]).catch((T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,T){let M,z=this._activeBuffer.x,J=this._activeBuffer.y,Z=0;const re=this._parseStack.paused;if(re){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(M),M;z=this._parseStack.cursorStartX,J=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>j&&(Z=this._parseStack.position+j)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(O=>String.fromCharCode(O))).join("")}"`),typeof D=="string"?D.split("").map((O=>O.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<j&&(this._parseBuffer=new Uint32Array(Math.min(D.length,j))),re||this._dirtyRowTracker.clearRange(),D.length>j)for(let O=Z;O<D.length;O+=j){const ie=O+j<D.length?O+j:D.length,F=typeof D=="string"?this._stringDecoder.decode(D.substring(O,ie),this._parseBuffer):this._utf8Decoder.decode(D.subarray(O,ie),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,F))return this._preserveStack(z,J,F,O),this._logSlowResolvingAsync(M),M}else if(!re){const O=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,O))return this._preserveStack(z,J,O,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===z&&this._activeBuffer.y===J||this._onCursorMove.fire();const se=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),G=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);G<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(G,this._bufferService.rows-1),Math.min(se,this._bufferService.rows-1))}print(D,T,M){let z,J;const Z=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,se=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,O=this._coreService.modes.insertMode,ie=this._curAttrData;let F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-T>0&&F.getWidth(this._activeBuffer.x-1)===2&&F.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let U=this._parser.precedingJoinState;for(let $=T;$<M;++$){if(z=D[$],z<127&&Z){const he=Z[String.fromCharCode(z)];he&&(z=he.charCodeAt(0))}const be=this._unicodeService.charProperties(z,U);J=S.UnicodeService.extractWidth(be);const xe=S.UnicodeService.extractShouldJoin(be),ae=xe?S.UnicodeService.extractWidth(U):0;if(U=be,re&&this._onA11yChar.fire((0,m.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+J-ae>se){if(G){const he=F;let fe=this._activeBuffer.x-ae;for(this._activeBuffer.x=ae,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ae>0&&F instanceof u.BufferLine&&F.copyCellsFrom(he,fe,0,ae,!1);fe<se;)he.setCellFromCodepoint(fe++,0,1,ie)}else if(this._activeBuffer.x=se-1,J===2)continue}if(xe&&this._activeBuffer.x){const he=F.getWidth(this._activeBuffer.x-1)?1:2;F.addCodepointToCell(this._activeBuffer.x-he,z,J);for(let fe=J-ae;--fe>=0;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(O&&(F.insertCells(this._activeBuffer.x,J-ae,this._activeBuffer.getNullCell(ie)),F.getWidth(se-1)===2&&F.setCellFromCodepoint(se-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,ie)),F.setCellFromCodepoint(this._activeBuffer.x++,z,J,ie),J>0)for(;--J;)F.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=U,this._activeBuffer.x<se&&M-T>0&&F.getWidth(this._activeBuffer.x)===0&&!F.hasContent(this._activeBuffer.x)&&F.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,T){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,T):this._parser.registerCsiHandler(D,(M=>!V(M.params[0],this._optionsService.rawOptions.windowOptions)||T(M)))}registerDcsHandler(D,T){return this._parser.registerDcsHandler(D,new x.DcsHandler(T))}registerEscHandler(D,T){return this._parser.registerEscHandler(D,T)}registerOscHandler(D,T){return this._parser.registerOscHandler(D,new L.OscHandler(T))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var D;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(D,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=D,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+T)}cursorUp(D){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const T=D.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=D.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=D.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const T=D.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,T,M,z=!1,J=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);Z.replaceCells(T,M,this._activeBuffer.getNullCell(this._eraseAttrData()),J),z&&(Z.isWrapped=!1)}_resetBufferLine(D,T=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),M.isWrapped=!1)}eraseInDisplay(D,T=!1){let M;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);M<this._bufferService.rows;M++)this._resetBufferLine(M,T);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,T);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(D,T=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let T=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,J=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;T--;)this._activeBuffer.lines.splice(J-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let T=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;T--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let T=D.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(D){let T=D.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=D.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);z.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=D.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);z.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=D.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);z.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=D.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);z.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const T=this._parser.precedingJoinState;if(!T)return!0;const M=D.params[0]||1,z=S.UnicodeService.extractWidth(T),J=this._activeBuffer.x-z,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(J),re=new Uint32Array(Z.length*M);let se=0;for(let O=0;O<Z.length;){const ie=Z.codePointAt(O)||0;re[se++]=ie,O+=ie>65535?2:1}let G=se;for(let O=1;O<M;++O)re.copyWithin(G,0,se),G+=se;return this.print(re,0,G),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(c.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(c.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(c.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(c.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(c.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let T=0;T<D.length;T++)switch(D.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let T=0;T<D.length;T++)switch(D.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(D){for(let T=0;T<D.length;T++)switch(D.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let T=0;T<D.length;T++)switch(D.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),D.params[T]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(D,T){const M=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:J}=this._coreMouseService,Z=this._coreService,{buffers:re,cols:se}=this._bufferService,{active:G,alt:O}=re,ie=this._optionsService.rawOptions,F=xe=>xe?1:2,U=D.params[0];return $=U,be=T?U===2?4:U===4?F(Z.modes.insertMode):U===12?3:U===20?F(ie.convertEol):0:U===1?F(M.applicationCursorKeys):U===3?ie.windowOptions.setWinLines?se===80?2:se===132?1:0:0:U===6?F(M.origin):U===7?F(M.wraparound):U===8?3:U===9?F(z==="X10"):U===12?F(ie.cursorBlink):U===25?F(!Z.isCursorHidden):U===45?F(M.reverseWraparound):U===66?F(M.applicationKeypad):U===67?4:U===1e3?F(z==="VT200"):U===1002?F(z==="DRAG"):U===1003?F(z==="ANY"):U===1004?F(M.sendFocus):U===1005?4:U===1006?F(J==="SGR"):U===1015?4:U===1016?F(J==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?F(G===O):U===2004?F(M.bracketedPasteMode):0,Z.triggerDataEvent(`${c.C0.ESC}[${T?"":"?"}${$};${be}$y`),!0;var $,be}_updateAttrColor(D,T,M,z,J){return T===2?(D|=50331648,D&=-16777216,D|=y.AttributeData.fromColorRGB([M,z,J])):T===5&&(D&=-50331904,D|=33554432|255&M),D}_extractColor(D,T,M){const z=[0,0,-1,0,0,0];let J=0,Z=0;do{if(z[Z+J]=D.params[T+Z],D.hasSubParams(T+Z)){const re=D.getSubParams(T+Z);let se=0;do z[1]===5&&(J=1),z[Z+se+1+J]=re[se];while(++se<re.length&&se+Z+1+J<z.length);break}if(z[1]===5&&Z+J>=2||z[1]===2&&Z+J>=5)break;z[1]&&(J=1)}while(++Z+T<D.length&&Z+J<z.length);for(let re=2;re<z.length;++re)z[re]===-1&&(z[re]=0);switch(z[0]){case 38:M.fg=this._updateAttrColor(M.fg,z[1],z[3],z[4],z[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,z[1],z[3],z[4],z[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,z[1],z[3],z[4],z[5])}return Z}_processUnderline(D,T){T.extended=T.extended.clone(),(!~D||D>5)&&(D=1),T.extended.underlineStyle=D,T.fg|=268435456,D===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(D){D.fg=u.DEFAULT_ATTR_DATA.fg,D.bg=u.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=D.length;let M;const z=this._curAttrData;for(let J=0;J<T;J++)M=D.params[J],M>=30&&M<=37?(z.fg&=-50331904,z.fg|=16777216|M-30):M>=40&&M<=47?(z.bg&=-50331904,z.bg|=16777216|M-40):M>=90&&M<=97?(z.fg&=-50331904,z.fg|=16777224|M-90):M>=100&&M<=107?(z.bg&=-50331904,z.bg|=16777224|M-100):M===0?this._processSGR0(z):M===1?z.fg|=134217728:M===3?z.bg|=67108864:M===4?(z.fg|=268435456,this._processUnderline(D.hasSubParams(J)?D.getSubParams(J)[0]:1,z)):M===5?z.fg|=536870912:M===7?z.fg|=67108864:M===8?z.fg|=1073741824:M===9?z.fg|=2147483648:M===2?z.bg|=134217728:M===21?this._processUnderline(2,z):M===22?(z.fg&=-134217729,z.bg&=-134217729):M===23?z.bg&=-67108865:M===24?(z.fg&=-268435457,this._processUnderline(0,z)):M===25?z.fg&=-536870913:M===27?z.fg&=-67108865:M===28?z.fg&=-1073741825:M===29?z.fg&=2147483647:M===39?(z.fg&=-67108864,z.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):M===49?(z.bg&=-67108864,z.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?J+=this._extractColor(D,J,z):M===53?z.bg|=1073741824:M===55?z.bg&=-1073741825:M===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):M===100?(z.fg&=-67108864,z.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${c.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[${T};${M}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const T=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[?${T};${M}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(D){const T=D.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const M=T%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(D){const T=D.params[0]||1;let M;return(D.length<2||(M=D.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(D){if(!V(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${c.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(D){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const T=[],M=D.split(";");for(;M.length>1;){const z=M.shift(),J=M.shift();if(/^\d+$/.exec(z)){const Z=parseInt(z);if(ne(Z))if(J==="?")T.push({type:0,index:Z});else{const re=(0,P.parseColor)(J);re&&T.push({type:1,index:Z,color:re})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(D){const T=D.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(D,T){this._getCurrentLinkId()&&this._finishHyperlink();const M=D.split(":");let z;const J=M.findIndex((Z=>Z.startsWith("id=")));return J!==-1&&(z=M[J].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,T){const M=D.split(";");for(let z=0;z<M.length&&!(T>=this._specialColors.length);++z,++T)if(M[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const J=(0,P.parseColor)(M[z]);J&&this._onColor.fire([{type:1,index:this._specialColors[T],color:J}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const T=[],M=D.split(";");for(let z=0;z<M.length;++z)if(/^\d+$/.exec(M[z])){const J=parseInt(M[z]);ne(J)&&T.push({type:2,index:J})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(B[D[0]],p.CHARSETS[D[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new f.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const M=this._activeBuffer.ybase+this._activeBuffer.y+T,z=this._activeBuffer.lines.get(M);z&&(z.fill(D),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,T){const M=this._bufferService.buffer,z=this._optionsService.rawOptions;return(J=>(this._coreService.triggerDataEvent(`${c.C0.ESC}${J}${c.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,T){this._dirtyRowTracker.markRangeDirty(D,T)}}s.InputHandler=W;let Q=class{constructor(le){this._bufferService=le,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(le){le<this.start?this.start=le:le>this.end&&(this.end=le)}markRangeDirty(le,D){le>D&&(X=le,le=D,D=X),le<this.start&&(this.start=le),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ne(le){return 0<=le&&le<256}Q=h([g(0,E.IBufferService)],Q)},844:(_,s)=>{function o(h){for(const g of h)g.dispose();h.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const g=this._disposables.indexOf(h);g!==-1&&this._disposables.splice(g,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var g;this._isDisposed||h===this._value||((g=this._value)==null||g.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},s.toDisposable=function(h){return{dispose:h}},s.disposeArray=o,s.getDisposeArrayDisposable=function(h){return{dispose:()=>o(h)}}},1505:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(g,c,p){this._data[g]||(this._data[g]={}),this._data[g][c]=p}get(g,c){return this._data[g]?this._data[g][c]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(h,g,c,p,b){this._data.get(h,g)||this._data.set(h,g,new o),this._data.get(h,g).set(c,p,b)}get(h,g,c,p){var b;return(b=this._data.get(h,g))==null?void 0:b.get(c,p)}clear(){this._data.clear()}}},6114:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,h=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const g=o.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),s.isIpad=h==="iPad",s.isIphone=h==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),s.isLinux=h.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(o=this._search(this._getKey(h)),this._array.splice(o,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const g=this._getKey(h);if(g===void 0||(o=this._search(g),o===-1)||this._getKey(this._array[o])!==g)return!1;do if(this._array[o]===h)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===g);return!1}*getKeyIterator(h){if(this._array.length!==0&&(o=this._search(h),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===h))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===h)}forEachByKey(h,g){if(this._array.length!==0&&(o=this._search(h),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===h))do g(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===h)}values(){return[...this._array].values()}_search(h){let g=0,c=this._array.length-1;for(;c>=g;){let p=g+c>>1;const b=this._getKey(this._array[p]);if(b>h)c=p-1;else{if(!(b<h)){for(;p>0&&this._getKey(this._array[p-1])===h;)p--;return p}g=p+1}}return g}}},7226:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const h=o(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(b){this._idleCallback=void 0;let w=0,m=0,u=b.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),m=Math.max(w,m),l=b.timeRemaining(),1.5*m>l)return u-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-w))}ms`),void this._start();u=l}this.clear()}}class c extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}s.PriorityTaskQueue=c,s.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:c,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const h=o(643);s.updateWindowsModeWrappedState=function(g){const c=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=c==null?void 0:c.get(g.cols-1),b=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);b&&p&&(b.isWrapped=p[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&p[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new o;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,p=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=p}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=h},9092:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const h=o(6349),g=o(7226),c=o(3734),p=o(8437),b=o(4634),w=o(511),m=o(643),u=o(4863),l=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(d,f,y){this._hasScrollback=d,this._optionsService=f,this._bufferService=y,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=l.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new c.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new c.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,f){return new p.BufferLine(this._bufferService.cols,this.getNullCell(d),f)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const f=d+this._optionsService.rawOptions.scrollback;return f>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:f}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=p.DEFAULT_ATTR_DATA);let f=this._rows;for(;f--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,f){const y=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=0;const S=this._getCorrectBufferLength(f);if(S>this.lines.maxLength&&(this.lines.maxLength=S),this.lines.length>0){if(this._cols<d)for(let x=0;x<this.lines.length;x++)E+=+this.lines.get(x).resize(d,y);let L=0;if(this._rows<f)for(let x=this._rows;x<f;x++)this.lines.length<f+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(d,y)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(d,y)));else for(let x=this._rows;x>f;x--)this.lines.length>f+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(S<this.lines.maxLength){const x=this.lines.length-S;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=S}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,f-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=f-1,this._isReflowEnabled&&(this._reflow(d,f),this._cols>d))for(let L=0;L<this.lines.length;L++)E+=+this.lines.get(L).resize(d,y);this._cols=d,this._rows=f,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let f=0;for(;this._memoryCleanupPosition<this.lines.length;)if(f+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),f>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,f){this._cols!==d&&(d>this._cols?this._reflowLarger(d,f):this._reflowSmaller(d,f))}_reflowLarger(d,f){const y=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(y.length>0){const E=(0,b.reflowLargerCreateNewLayout)(this.lines,y);(0,b.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(d,f,E.countRemoved)}}_reflowLargerAdjustViewport(d,f,y){const E=this.getNullCell(p.DEFAULT_ATTR_DATA);let S=y;for(;S-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<f&&this.lines.push(new p.BufferLine(d,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(d,f){const y=this.getNullCell(p.DEFAULT_ATTR_DATA),E=[];let S=0;for(let L=this.lines.length-1;L>=0;L--){let x=this.lines.get(L);if(!x||!x.isWrapped&&x.getTrimmedLength()<=d)continue;const P=[x];for(;x.isWrapped&&L>0;)x=this.lines.get(--L),P.unshift(x);const B=this.ybase+this.y;if(B>=L&&B<L+P.length)continue;const j=P[P.length-1].getTrimmedLength(),V=(0,b.reflowSmallerGetNewLineLengths)(P,this._cols,d),N=V.length-P.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const W=[];for(let M=0;M<N;M++){const z=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);W.push(z)}W.length>0&&(E.push({start:L+P.length+S,newLines:W}),S+=W.length),P.push(...W);let Q=V.length-1,ne=V[Q];ne===0&&(Q--,ne=V[Q]);let le=P.length-N-1,D=j;for(;le>=0;){const M=Math.min(D,ne);if(P[Q]===void 0)break;if(P[Q].copyCellsFrom(P[le],D-M,ne-M,M,!0),ne-=M,ne===0&&(Q--,ne=V[Q]),D-=M,D===0){le--;const z=Math.max(le,0);D=(0,b.getWrappedLineTrimmedLength)(P,z,this._cols)}}for(let M=0;M<P.length;M++)V[M]<d&&P[M].setCell(V[M],y);let T=N-X;for(;T-- >0;)this.ybase===0?this.y<f-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+S)-f&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+f-1)}if(E.length>0){const L=[],x=[];for(let Q=0;Q<this.lines.length;Q++)x.push(this.lines.get(Q));const P=this.lines.length;let B=P-1,j=0,V=E[j];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+S);let N=0;for(let Q=Math.min(this.lines.maxLength-1,P+S-1);Q>=0;Q--)if(V&&V.start>B+N){for(let ne=V.newLines.length-1;ne>=0;ne--)this.lines.set(Q--,V.newLines[ne]);Q++,L.push({index:B+1,amount:V.newLines.length}),N+=V.newLines.length,V=E[++j]}else this.lines.set(Q,x[B--]);let X=0;for(let Q=L.length-1;Q>=0;Q--)L[Q].index+=X,this.lines.onInsertEmitter.fire(L[Q]),X+=L[Q].amount;const W=Math.max(0,P+S-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(d,f,y=0,E){const S=this.lines.get(d);return S?S.translateToString(f,y,E):""}getWrappedRangeForLine(d){let f=d,y=d;for(;f>0&&this.lines.get(f).isWrapped;)f--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:f,last:y}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].line===d&&(this.markers[f].dispose(),this.markers.splice(f--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const f=new u.Marker(d);return this.markers.push(f),f.register(this.lines.onTrim((y=>{f.line-=y,f.line<0&&f.dispose()}))),f.register(this.lines.onInsert((y=>{f.line>=y.index&&(f.line+=y.amount)}))),f.register(this.lines.onDelete((y=>{f.line>=y.index&&f.line<y.index+y.amount&&f.dispose(),f.line>y.index&&(f.line-=y.amount)}))),f.register(f.onDispose((()=>this._removeMarker(f)))),f}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const h=o(3734),g=o(511),c=o(643),p=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let b=0;class w{constructor(u,l,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const f=l||g.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]);for(let y=0;y<u;++y)this.setCell(y,f);this.length=u}get(u){const l=this._data[3*u+0],d=2097151&l;return[this._data[3*u+1],2097152&l?this._combined[u]:d?(0,p.stringFromCodePoint)(d):"",l>>22,2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):d]}set(u,l){this._data[3*u+1]=l[c.CHAR_DATA_ATTR_INDEX],l[c.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=l[1],this._data[3*u+0]=2097152|u|l[c.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=l[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[c.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&l}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const l=this._data[3*u+0];return 2097152&l?this._combined[u]:2097151&l?(0,p.stringFromCodePoint)(2097151&l):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,l){return b=3*u,l.content=this._data[b+0],l.fg=this._data[b+1],l.bg=this._data[b+2],2097152&l.content&&(l.combinedData=this._combined[u]),268435456&l.bg&&(l.extended=this._extendedAttrs[u]),l}setCell(u,l){2097152&l.content&&(this._combined[u]=l.combinedData),268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=l.content,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}setCellFromCodepoint(u,l,d,f){268435456&f.bg&&(this._extendedAttrs[u]=f.extended),this._data[3*u+0]=l|d<<22,this._data[3*u+1]=f.fg,this._data[3*u+2]=f.bg}addCodepointToCell(u,l,d){let f=this._data[3*u+0];2097152&f?this._combined[u]+=(0,p.stringFromCodePoint)(l):2097151&f?(this._combined[u]=(0,p.stringFromCodePoint)(2097151&f)+(0,p.stringFromCodePoint)(l),f&=-2097152,f|=2097152):f=l|4194304,d&&(f&=-12582913,f|=d<<22),this._data[3*u+0]=f}insertCells(u,l,d){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,d),l<this.length-u){const f=new g.CellData;for(let y=this.length-u-l-1;y>=0;--y)this.setCell(u+l+y,this.loadCell(u+y,f));for(let y=0;y<l;++y)this.setCell(u+y,d)}else for(let f=u;f<this.length;++f)this.setCell(f,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(u,l,d){if(u%=this.length,l<this.length-u){const f=new g.CellData;for(let y=0;y<this.length-u-l;++y)this.setCell(u+y,this.loadCell(u+l+y,f));for(let y=this.length-l;y<this.length;++y)this.setCell(y,d)}else for(let f=u;f<this.length;++f)this.setCell(f,d);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,d),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,d)}replaceCells(u,l,d,f=!1){if(f)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,d),l<this.length&&this.getWidth(l-1)===2&&!this.isProtected(l)&&this.setCellFromCodepoint(l,0,1,d);u<l&&u<this.length;)this.isProtected(u)||this.setCell(u,d),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,d),l<this.length&&this.getWidth(l-1)===2&&this.setCellFromCodepoint(l,0,1,d);u<l&&u<this.length;)this.setCell(u++,d)}resize(u,l){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const f=new Uint32Array(d);f.set(this._data),this._data=f}for(let f=this.length;f<u;++f)this.setCell(f,l)}else{this._data=this._data.subarray(0,d);const f=Object.keys(this._combined);for(let E=0;E<f.length;E++){const S=parseInt(f[E],10);S>=u&&delete this._combined[S]}const y=Object.keys(this._extendedAttrs);for(let E=0;E<y.length;E++){const S=parseInt(y[E],10);S>=u&&delete this._extendedAttrs[S]}}return this.length=u,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,l=!1){if(l)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,u);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const l in u._combined)this._combined[l]=u._combined[l];this._extendedAttrs={};for(const l in u._extendedAttrs)this._extendedAttrs[l]=u._extendedAttrs[l];this.isWrapped=u.isWrapped}clone(){const u=new w(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const l in this._combined)u._combined[l]=this._combined[l];for(const l in this._extendedAttrs)u._extendedAttrs[l]=this._extendedAttrs[l];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,l,d,f,y){const E=u._data;if(y)for(let L=f-1;L>=0;L--){for(let x=0;x<3;x++)this._data[3*(d+L)+x]=E[3*(l+L)+x];268435456&E[3*(l+L)+2]&&(this._extendedAttrs[d+L]=u._extendedAttrs[l+L])}else for(let L=0;L<f;L++){for(let x=0;x<3;x++)this._data[3*(d+L)+x]=E[3*(l+L)+x];268435456&E[3*(l+L)+2]&&(this._extendedAttrs[d+L]=u._extendedAttrs[l+L])}const S=Object.keys(u._combined);for(let L=0;L<S.length;L++){const x=parseInt(S[L],10);x>=l&&(this._combined[x-l+d]=u._combined[x])}}translateToString(u,l,d,f){l=l??0,d=d??this.length,u&&(d=Math.min(d,this.getTrimmedLength())),f&&(f.length=0);let y="";for(;l<d;){const E=this._data[3*l+0],S=2097151&E,L=2097152&E?this._combined[l]:S?(0,p.stringFromCodePoint)(S):c.WHITESPACE_CELL_CHAR;if(y+=L,f)for(let x=0;x<L.length;++x)f.push(l);l+=E>>22||1}return f&&f.push(l),y}}s.BufferLine=w},4841:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,h){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return h*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(_,s)=>{function o(h,g,c){if(g===h.length-1)return h[g].getTrimmedLength();const p=!h[g].hasContent(c-1)&&h[g].getWidth(c-1)===1,b=h[g+1].getWidth(0)===2;return p&&b?c-1:c}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(h,g,c,p,b){const w=[];for(let m=0;m<h.length-1;m++){let u=m,l=h.get(++u);if(!l.isWrapped)continue;const d=[h.get(m)];for(;u<h.length&&l.isWrapped;)d.push(l),l=h.get(++u);if(p>=m&&p<u){m+=d.length-1;continue}let f=0,y=o(d,f,g),E=1,S=0;for(;E<d.length;){const x=o(d,E,g),P=x-S,B=c-y,j=Math.min(P,B);d[f].copyCellsFrom(d[E],S,y,j,!1),y+=j,y===c&&(f++,y=0),S+=j,S===x&&(E++,S=0),y===0&&f!==0&&d[f-1].getWidth(c-1)===2&&(d[f].copyCellsFrom(d[f-1],c-1,y++,1,!1),d[f-1].setCell(c-1,b))}d[f].replaceCells(y,c,b);let L=0;for(let x=d.length-1;x>0&&(x>f||d[x].getTrimmedLength()===0);x--)L++;L>0&&(w.push(m+d.length-L),w.push(L)),m+=d.length-1}return w},s.reflowLargerCreateNewLayout=function(h,g){const c=[];let p=0,b=g[p],w=0;for(let m=0;m<h.length;m++)if(b===m){const u=g[++p];h.onDeleteEmitter.fire({index:m-w,amount:u}),m+=u-1,w+=u,b=g[++p]}else c.push(m);return{layout:c,countRemoved:w}},s.reflowLargerApplyNewLayout=function(h,g){const c=[];for(let p=0;p<g.length;p++)c.push(h.get(g[p]));for(let p=0;p<c.length;p++)h.set(p,c[p]);h.length=g.length},s.reflowSmallerGetNewLineLengths=function(h,g,c){const p=[],b=h.map(((l,d)=>o(h,d,g))).reduce(((l,d)=>l+d));let w=0,m=0,u=0;for(;u<b;){if(b-u<c){p.push(b-u);break}w+=c;const l=o(h,m,g);w>l&&(w-=l,m++);const d=h[m].getWidth(w-1)===2;d&&w--;const f=d?c-1:c;p.push(f),u+=f}return p},s.getWrappedLineTrimmedLength=o},5295:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const h=o(8460),g=o(844),c=o(9092);class p extends g.Disposable{constructor(w,m){super(),this._optionsService=w,this._bufferService=m,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new c.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new c.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,m){this._normal.resize(w,m),this._alt.resize(w,m),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}s.BufferSet=p},511:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const h=o(482),g=o(643),c=o(3734);class p extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const m=new p;return m.setFromCharData(w),m}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const u=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const l=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=l&&l<=57343?this.content=1024*(u-55296)+l-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const h=o(8460),g=o(844);class c{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=c._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}s.Marker=c,c._nextId=1},7116:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,s)=>{var o,h,g;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,(function(c){c.NUL="\0",c.SOH="",c.STX="",c.ETX="",c.EOT="",c.ENQ="",c.ACK="",c.BEL="\x07",c.BS="\b",c.HT=" ",c.LF=`
438
+ `,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""})(o||(s.C0=o={})),(function(c){c.PAD="€",c.HOP="",c.BPH="‚",c.NBH="ƒ",c.IND="„",c.NEL="…",c.SSA="†",c.ESA="‡",c.HTS="ˆ",c.HTJ="‰",c.VTS="Š",c.PLD="‹",c.PLU="Œ",c.RI="",c.SS2="Ž",c.SS3="",c.DCS="",c.PU1="‘",c.PU2="’",c.STS="“",c.CCH="”",c.MW="•",c.SPA="–",c.EPA="—",c.SOS="˜",c.SGCI="™",c.SCI="š",c.CSI="›",c.ST="œ",c.OSC="",c.PM="ž",c.APC="Ÿ"})(h||(s.C1=h={})),(function(c){c.ST=`${o.ESC}\\`})(g||(s.C1_ESCAPED=g={}))},7399:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const h=o(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(c,p,b,w){const m={type:0,cancel:!1,key:void 0},u=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?m.key=p?h.C0.ESC+"OA":h.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?m.key=p?h.C0.ESC+"OD":h.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?m.key=p?h.C0.ESC+"OC":h.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(m.key=p?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:m.key=c.ctrlKey?"\b":h.C0.DEL,c.altKey&&(m.key=h.C0.ESC+m.key);break;case 9:if(c.shiftKey){m.key=h.C0.ESC+"[Z";break}m.key=h.C0.HT,m.cancel=!0;break;case 13:m.key=c.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,m.cancel=!0;break;case 27:m.key=h.C0.ESC,c.altKey&&(m.key=h.C0.ESC+h.C0.ESC),m.cancel=!0;break;case 37:if(c.metaKey)break;u?(m.key=h.C0.ESC+"[1;"+(u+1)+"D",m.key===h.C0.ESC+"[1;3D"&&(m.key=h.C0.ESC+(b?"b":"[1;5D"))):m.key=p?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(c.metaKey)break;u?(m.key=h.C0.ESC+"[1;"+(u+1)+"C",m.key===h.C0.ESC+"[1;3C"&&(m.key=h.C0.ESC+(b?"f":"[1;5C"))):m.key=p?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(c.metaKey)break;u?(m.key=h.C0.ESC+"[1;"+(u+1)+"A",b||m.key!==h.C0.ESC+"[1;3A"||(m.key=h.C0.ESC+"[1;5A")):m.key=p?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(c.metaKey)break;u?(m.key=h.C0.ESC+"[1;"+(u+1)+"B",b||m.key!==h.C0.ESC+"[1;3B"||(m.key=h.C0.ESC+"[1;5B")):m.key=p?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(m.key=h.C0.ESC+"[2~");break;case 46:m.key=u?h.C0.ESC+"[3;"+(u+1)+"~":h.C0.ESC+"[3~";break;case 36:m.key=u?h.C0.ESC+"[1;"+(u+1)+"H":p?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:m.key=u?h.C0.ESC+"[1;"+(u+1)+"F":p?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:c.shiftKey?m.type=2:c.ctrlKey?m.key=h.C0.ESC+"[5;"+(u+1)+"~":m.key=h.C0.ESC+"[5~";break;case 34:c.shiftKey?m.type=3:c.ctrlKey?m.key=h.C0.ESC+"[6;"+(u+1)+"~":m.key=h.C0.ESC+"[6~";break;case 112:m.key=u?h.C0.ESC+"[1;"+(u+1)+"P":h.C0.ESC+"OP";break;case 113:m.key=u?h.C0.ESC+"[1;"+(u+1)+"Q":h.C0.ESC+"OQ";break;case 114:m.key=u?h.C0.ESC+"[1;"+(u+1)+"R":h.C0.ESC+"OR";break;case 115:m.key=u?h.C0.ESC+"[1;"+(u+1)+"S":h.C0.ESC+"OS";break;case 116:m.key=u?h.C0.ESC+"[15;"+(u+1)+"~":h.C0.ESC+"[15~";break;case 117:m.key=u?h.C0.ESC+"[17;"+(u+1)+"~":h.C0.ESC+"[17~";break;case 118:m.key=u?h.C0.ESC+"[18;"+(u+1)+"~":h.C0.ESC+"[18~";break;case 119:m.key=u?h.C0.ESC+"[19;"+(u+1)+"~":h.C0.ESC+"[19~";break;case 120:m.key=u?h.C0.ESC+"[20;"+(u+1)+"~":h.C0.ESC+"[20~";break;case 121:m.key=u?h.C0.ESC+"[21;"+(u+1)+"~":h.C0.ESC+"[21~";break;case 122:m.key=u?h.C0.ESC+"[23;"+(u+1)+"~":h.C0.ESC+"[23~";break;case 123:m.key=u?h.C0.ESC+"[24;"+(u+1)+"~":h.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(b&&!w||!c.altKey||c.metaKey)!b||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?m.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(m.key=h.C0.US),c.key==="@"&&(m.key=h.C0.NUL)):c.keyCode===65&&(m.type=1);else{const l=g[c.keyCode],d=l==null?void 0:l[c.shiftKey?1:0];if(d)m.key=h.C0.ESC+d;else if(c.keyCode>=65&&c.keyCode<=90){const f=c.ctrlKey?c.keyCode-64:c.keyCode+32;let y=String.fromCharCode(f);c.shiftKey&&(y=y.toUpperCase()),m.key=h.C0.ESC+y}else if(c.keyCode===32)m.key=h.C0.ESC+(c.ctrlKey?h.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let f=c.code.slice(3,4);c.shiftKey||(f=f.toLowerCase()),m.key=h.C0.ESC+f,m.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?m.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?m.key=h.C0.NUL:c.keyCode>=51&&c.keyCode<=55?m.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?m.key=h.C0.DEL:c.keyCode===219?m.key=h.C0.ESC:c.keyCode===220?m.key=h.C0.FS:c.keyCode===221&&(m.key=h.C0.GS)}return m}},482:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,h=0,g=o.length){let c="";for(let p=h;p<g;++p){let b=o[p];b>65535?(b-=65536,c+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):c+=String.fromCharCode(b)}return c},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,h){const g=o.length;if(!g)return 0;let c=0,p=0;if(this._interim){const b=o.charCodeAt(p++);56320<=b&&b<=57343?h[c++]=1024*(this._interim-55296)+b-56320+65536:(h[c++]=this._interim,h[c++]=b),this._interim=0}for(let b=p;b<g;++b){const w=o.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=g)return this._interim=w,c;const m=o.charCodeAt(b);56320<=m&&m<=57343?h[c++]=1024*(w-55296)+m-56320+65536:(h[c++]=w,h[c++]=m)}else w!==65279&&(h[c++]=w)}return c}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,h){const g=o.length;if(!g)return 0;let c,p,b,w,m=0,u=0,l=0;if(this.interim[0]){let y=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let S,L=0;for(;(S=63&this.interim[++L])&&L<4;)E<<=6,E|=S;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=x-L;for(;l<P;){if(l>=g)return 0;if(S=o[l++],(192&S)!=128){l--,y=!0;break}this.interim[L++]=S,E<<=6,E|=63&S}y||(x===2?E<128?l--:h[m++]=E:x===3?E<2048||E>=55296&&E<=57343||E===65279||(h[m++]=E):E<65536||E>1114111||(h[m++]=E)),this.interim.fill(0)}const d=g-4;let f=l;for(;f<g;){for(;!(!(f<d)||128&(c=o[f])||128&(p=o[f+1])||128&(b=o[f+2])||128&(w=o[f+3]));)h[m++]=c,h[m++]=p,h[m++]=b,h[m++]=w,f+=4;if(c=o[f++],c<128)h[m++]=c;else if((224&c)==192){if(f>=g)return this.interim[0]=c,m;if(p=o[f++],(192&p)!=128){f--;continue}if(u=(31&c)<<6|63&p,u<128){f--;continue}h[m++]=u}else if((240&c)==224){if(f>=g)return this.interim[0]=c,m;if(p=o[f++],(192&p)!=128){f--;continue}if(f>=g)return this.interim[0]=c,this.interim[1]=p,m;if(b=o[f++],(192&b)!=128){f--;continue}if(u=(15&c)<<12|(63&p)<<6|63&b,u<2048||u>=55296&&u<=57343||u===65279)continue;h[m++]=u}else if((248&c)==240){if(f>=g)return this.interim[0]=c,m;if(p=o[f++],(192&p)!=128){f--;continue}if(f>=g)return this.interim[0]=c,this.interim[1]=p,m;if(b=o[f++],(192&b)!=128){f--;continue}if(f>=g)return this.interim[0]=c,this.interim[1]=p,this.interim[2]=b,m;if(w=o[f++],(192&w)!=128){f--;continue}if(u=(7&c)<<18|(63&p)<<12|(63&b)<<6|63&w,u<65536||u>1114111)continue;h[m++]=u}}return m}}},225:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const h=o(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let b=0;b<g.length;++b)p.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?p[b]:(function(w,m){let u,l=0,d=m.length-1;if(w<m[0][0]||w>m[d][1])return!1;for(;d>=l;)if(u=l+d>>1,w>m[u][1])l=u+1;else{if(!(w<m[u][0]))return!0;d=u-1}return!1})(b,c)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let m=this.wcwidth(b),u=m===0&&w!==0;if(u){const l=h.UnicodeService.extractWidth(w);l===0?u=!1:l>m&&(m=l)}return h.UnicodeService.createPropertyValue(0,m,u)}}},5981:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const h=o(8460),g=o(844);class c extends g.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w)}_innerWrite(b=0,w=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,w);if(l){const f=y=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,y))):this._innerWrite(m,y);return void l.catch((y=>(queueMicrotask((()=>{throw y})),Promise.resolve(!1)))).then(f)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-m>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=c},5941:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function g(c,p){const b=c.toString(16),w=b.length<2?"0"+b:b;switch(p){case 4:return b[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}s.parseColor=function(c){if(!c)return;let p=c.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const b=o.exec(p);if(b){const w=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/w*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/w*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),h.exec(p)&&[3,6,9,12].includes(p.length))){const b=p.length/3,w=[0,0,0];for(let m=0;m<3;++m){const u=parseInt(p.slice(b*m,b*m+b),16);w[m]=b===1?u<<4:b===2?u:b===3?u>>4:u>>8}return w}},s.toRgbString=function(c,p=16){const[b,w,m]=c;return`rgb:${g(b,p)}/${g(w,p)}/${g(m,p)}`}},5770:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const h=o(482),g=o(8742),c=o(5770),p=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,m){this._handlers[w]===void 0&&(this._handlers[w]=[]);const u=this._handlers[w];return u.push(m),{dispose:()=>{const l=u.indexOf(m);l!==-1&&u.splice(l,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,m){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(w,m,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(w,m,u);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(w,m,u))}unhook(w,m=!0){if(this._active.length){let u=!1,l=this._active.length-1,d=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=m,d=this._stack.fallThrough,this._stack.paused=!1),!d&&u===!1){for(;l>=0&&(u=this._active[l].unhook(w),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const b=new g.Params;b.addParam(0),s.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=b,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():b,this._data="",this._hitLimit=!1}put(w,m,u){this._hitLimit||(this._data+=(0,h.utf32ToString)(w,m,u),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let m=!1;if(this._hitLimit)m=!1;else if(w&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((u=>(this._params=b,this._data="",this._hitLimit=!1,u)));return this._params=b,this._data="",this._hitLimit=!1,m}}},2015:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const h=o(844),g=o(8742),c=o(6242),p=o(6351);class b{constructor(l){this.table=new Uint8Array(l)}setDefault(l,d){this.table.fill(l<<4|d)}add(l,d,f,y){this.table[d<<8|l]=f<<4|y}addMany(l,d,f,y){for(let E=0;E<l.length;E++)this.table[d<<8|l[E]]=f<<4|y}}s.TransitionTable=b;const w=160;s.VT500_TRANSITION_TABLE=(function(){const u=new b(4095),l=Array.apply(null,Array(256)).map(((L,x)=>x)),d=(L,x)=>l.slice(L,x),f=d(32,127),y=d(0,24);y.push(25),y.push.apply(y,d(28,32));const E=d(0,14);let S;for(S in u.setDefault(1,0),u.addMany(f,0,2,0),E)u.addMany([24,26,153,154],S,3,0),u.addMany(d(128,144),S,3,0),u.addMany(d(144,152),S,3,0),u.add(156,S,0,0),u.add(27,S,11,1),u.add(157,S,4,8),u.addMany([152,158,159],S,0,7),u.add(155,S,11,3),u.add(144,S,11,9);return u.addMany(y,0,3,0),u.addMany(y,1,3,1),u.add(127,1,0,1),u.addMany(y,8,0,8),u.addMany(y,3,3,3),u.add(127,3,0,3),u.addMany(y,4,3,4),u.add(127,4,0,4),u.addMany(y,6,3,6),u.addMany(y,5,3,5),u.add(127,5,0,5),u.addMany(y,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(f,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(d(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(f,7,0,7),u.addMany(y,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(d(64,127),3,7,0),u.addMany(d(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(d(48,60),4,8,4),u.addMany(d(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(d(32,64),6,0,6),u.add(127,6,0,6),u.addMany(d(64,127),6,0,0),u.addMany(d(32,48),3,9,5),u.addMany(d(32,48),5,9,5),u.addMany(d(48,64),5,0,6),u.addMany(d(64,127),5,7,0),u.addMany(d(32,48),4,9,5),u.addMany(d(32,48),1,9,2),u.addMany(d(32,48),2,9,2),u.addMany(d(48,127),2,10,0),u.addMany(d(48,80),1,10,0),u.addMany(d(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(d(96,127),1,10,0),u.add(80,1,11,9),u.addMany(y,9,0,9),u.add(127,9,0,9),u.addMany(d(28,32),9,0,9),u.addMany(d(32,48),9,9,12),u.addMany(d(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(y,11,0,11),u.addMany(d(32,128),11,0,11),u.addMany(d(28,32),11,0,11),u.addMany(y,10,0,10),u.add(127,10,0,10),u.addMany(d(28,32),10,0,10),u.addMany(d(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(d(32,48),10,9,12),u.addMany(y,12,0,12),u.add(127,12,0,12),u.addMany(d(28,32),12,0,12),u.addMany(d(32,48),12,9,12),u.addMany(d(48,64),12,0,11),u.addMany(d(64,127),12,12,13),u.addMany(d(64,127),10,12,13),u.addMany(d(64,127),9,12,13),u.addMany(y,13,13,13),u.addMany(f,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(w,0,2,0),u.add(w,8,5,8),u.add(w,6,0,6),u.add(w,11,0,11),u.add(w,13,13,13),u})();class m extends h.Disposable{constructor(l=s.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,f,y)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,f)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(l,d=[64,126]){let f=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=l.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<l.intermediates.length;++E){const S=l.intermediates.charCodeAt(E);if(32>S||S>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=S}}if(l.final.length!==1)throw new Error("final must be a single byte");const y=l.final.charCodeAt(0);if(d[0]>y||y>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return f<<=8,f|=y,f}identToString(l){const d=[];for(;l;)d.push(String.fromCharCode(255&l)),l>>=8;return d.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,d){const f=this._identifier(l,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);const y=this._escHandlers[f];return y.push(d),{dispose:()=>{const E=y.indexOf(d);E!==-1&&y.splice(E,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,d){this._executeHandlers[l.charCodeAt(0)]=d}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,d){const f=this._identifier(l);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);const y=this._csiHandlers[f];return y.push(d),{dispose:()=>{const E=y.indexOf(d);E!==-1&&y.splice(E,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,d){return this._dcsParser.registerHandler(this._identifier(l),d)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,d){return this._oscParser.registerHandler(l,d)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(l,d,f,y,E){this._parseStack.state=l,this._parseStack.handlers=d,this._parseStack.handlerPos=f,this._parseStack.transition=y,this._parseStack.chunkPos=E}parse(l,d,f){let y,E=0,S=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&P>-1){for(;P>=0&&(y=x[P](this._params),y!==!0);P--)if(y instanceof Promise)return this._parseStack.handlerPos=P,y}this._parseStack.handlers=[];break;case 4:if(f===!1&&P>-1){for(;P>=0&&(y=x[P](),y!==!0);P--)if(y instanceof Promise)return this._parseStack.handlerPos=P,y}this._parseStack.handlers=[];break;case 6:if(E=l[this._parseStack.chunkPos],y=this._dcsParser.unhook(E!==24&&E!==26,f),y)return y;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=l[this._parseStack.chunkPos],y=this._oscParser.end(E!==24&&E!==26,f),y)return y;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let x=L;x<d;++x){switch(E=l[x],S=this._transitions.table[this.currentState<<8|(E<160?E:w)],S>>4){case 2:for(let N=x+1;;++N){if(N>=d||(E=l[N])<32||E>126&&E<w){this._printHandler(l,x,N),x=N-1;break}if(++N>=d||(E=l[N])<32||E>126&&E<w){this._printHandler(l,x,N),x=N-1;break}if(++N>=d||(E=l[N])<32||E>126&&E<w){this._printHandler(l,x,N),x=N-1;break}if(++N>=d||(E=l[N])<32||E>126&&E<w){this._printHandler(l,x,N),x=N-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const P=this._csiHandlers[this._collect<<8|E];let B=P?P.length-1:-1;for(;B>=0&&(y=P[B](this._params),y!==!0);B--)if(y instanceof Promise)return this._preserveStack(3,P,B,S,x),y;B<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++x<d&&(E=l[x])>47&&E<60);x--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const j=this._escHandlers[this._collect<<8|E];let V=j?j.length-1:-1;for(;V>=0&&(y=j[V](),y!==!0);V--)if(y instanceof Promise)return this._preserveStack(4,j,V,S,x),y;V<0&&this._escHandlerFb(this._collect<<8|E),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|E,this._params);break;case 13:for(let N=x+1;;++N)if(N>=d||(E=l[N])===24||E===26||E===27||E>127&&E<w){this._dcsParser.put(l,x,N),x=N-1;break}break;case 14:if(y=this._dcsParser.unhook(E!==24&&E!==26),y)return this._preserveStack(6,[],0,S,x),y;E===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let N=x+1;;N++)if(N>=d||(E=l[N])<32||E>127&&E<w){this._oscParser.put(l,x,N),x=N-1;break}break;case 6:if(y=this._oscParser.end(E!==24&&E!==26),y)return this._preserveStack(5,[],0,S,x),y;E===27&&(S|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&S}}}s.EscapeSequenceParser=m},6242:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const h=o(5770),g=o(482),c=[];s.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,b){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(b),{dispose:()=>{const m=w.indexOf(b);m!==-1&&w.splice(m,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,b,w){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(p,b,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,b,w))}start(){this.reset(),this._state=1}put(p,b,w){if(this._state!==3){if(this._state===1)for(;b<w;){const m=p[b++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&w-b>0&&this._put(p,b,w)}}end(p,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,m=this._active.length-1,u=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,w=b,u=this._stack.fallThrough,this._stack.paused=!1),!u&&w===!1){for(;m>=0&&(w=this._active[m].end(p),w!==!0);m--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,w;m--}for(;m>=0;m--)if(w=this._active[m].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=c,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,b,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,b,w),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let b=!1;if(this._hitLimit)b=!1;else if(p&&(b=this._handler(this._data),b instanceof Promise))return b.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,b}}},8742:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const o=2147483647;class h{static fromArray(c){const p=new h;if(!c.length)return p;for(let b=Array.isArray(c[0])?1:0;b<c.length;++b){const w=c[b];if(Array.isArray(w))for(let m=0;m<w.length;++m)p.addSubParam(w[m]);else p.addParam(w)}return p}constructor(c=32,p=32){if(this.maxLength=c,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new h(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let p=0;p<this.length;++p){c.push(this.params[p]);const b=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-b>0&&c.push(Array.prototype.slice.call(this._subParams,b,w))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>o?o:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>o?o:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const p=this._subParamsIdx[c]>>8,b=255&this._subParamsIdx[c];return b-p>0?this._subParams.subarray(p,b):null}getSubParamsAll(){const c={};for(let p=0;p<this.length;++p){const b=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-b>0&&(c[p]=this._subParams.slice(b,w))}return c}addDigit(c){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,w=b[p-1];b[p-1]=~w?Math.min(10*w+c,o):c}}s.Params=h},5741:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,h){const g={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(g),h.dispose=()=>this._wrappedAddonDispose(g),h.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let h=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===o){h=g;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(h,1)}}},8771:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const h=o(3785),g=o(511);s.BufferApiView=class{constructor(c,p){this._buffer=c,this.type=p}init(c){return this._buffer=c,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(c){const p=this._buffer.lines.get(c);if(p)return new h.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const h=o(511);s.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,c){if(!(g<0||g>=this._line.length))return c?(this._line.loadCell(g,c),c):this._line.loadCell(g,new h.CellData)}translateToString(g,c,p){return this._line.translateToString(g,c,p)}}},8285:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const h=o(8771),g=o(8460),c=o(844);class p extends c.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=p},7975:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,h){return this._core.registerCsiHandler(o,(g=>h(g.toArray())))}addCsiHandler(o,h){return this.registerCsiHandler(o,h)}registerDcsHandler(o,h){return this._core.registerDcsHandler(o,((g,c)=>h(g,c.toArray())))}addDcsHandler(o,h){return this.registerDcsHandler(o,h)}registerEscHandler(o,h){return this._core.registerEscHandler(o,h)}addEscHandler(o,h){return this.registerEscHandler(o,h)}registerOscHandler(o,h){return this._core.registerOscHandler(o,h)}addOscHandler(o,h){return this.registerOscHandler(o,h)}}},7090:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(_,s,o){var h=this&&this.__decorate||function(u,l,d,f){var y,E=arguments.length,S=E<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,d):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,l,d,f);else for(var L=u.length-1;L>=0;L--)(y=u[L])&&(S=(E<3?y(S):E>3?y(l,d,S):y(l,d))||S);return E>3&&S&&Object.defineProperty(l,d,S),S},g=this&&this.__param||function(u,l){return function(d,f){l(d,f,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const c=o(8460),p=o(844),b=o(5295),w=o(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let m=s.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const d=this.buffer;let f;f=this._cachedBlankLine,f&&f.length===this.cols&&f.getFg(0)===u.fg&&f.getBg(0)===u.bg||(f=d.getBlankLine(u,l),this._cachedBlankLine=f),f.isWrapped=l;const y=d.ybase+d.scrollTop,E=d.ybase+d.scrollBottom;if(d.scrollTop===0){const S=d.lines.isFull;E===d.lines.length-1?S?d.lines.recycle().copyFrom(f):d.lines.push(f.clone()):d.lines.splice(E+1,0,f.clone()),S?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const S=E-y+1;d.lines.shiftElements(y+1,S-1,-1),d.lines.set(E,f.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(u,l,d){const f=this.buffer;if(u<0){if(f.ydisp===0)return;this.isUserScrolling=!0}else u+f.ydisp>=f.ybase&&(this.isUserScrolling=!1);const y=f.ydisp;f.ydisp=Math.max(Math.min(f.ydisp+u,f.ybase),0),y!==f.ydisp&&(l||this._onScroll.fire(f.ydisp))}};s.BufferService=m=h([g(0,w.IOptionsService)],m)},7994:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,h){this._charsets[o]=h,this.glevel===o&&(this.charset=h)}}},1753:function(_,s,o){var h=this&&this.__decorate||function(f,y,E,S){var L,x=arguments.length,P=x<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(f,y,E,S);else for(var B=f.length-1;B>=0;B--)(L=f[B])&&(P=(x<3?L(P):x>3?L(y,E,P):L(y,E))||P);return x>3&&P&&Object.defineProperty(y,E,P),P},g=this&&this.__param||function(f,y){return function(E,S){y(E,S,f)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const c=o(2585),p=o(8460),b=o(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:f=>f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)},VT200:{events:19,restrict:f=>f.action!==32},DRAG:{events:23,restrict:f=>f.action!==32||f.button!==3},ANY:{events:31,restrict:f=>!0}};function m(f,y){let E=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(E|=64,E|=f.action):(E|=3&f.button,4&f.button&&(E|=64),8&f.button&&(E|=128),f.action===32?E|=32:f.action!==0||y||(E|=3)),E}const u=String.fromCharCode,l={DEFAULT:f=>{const y=[m(f,!1)+32,f.col+32,f.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${u(y[0])}${u(y[1])}${u(y[2])}`},SGR:f=>{const y=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${m(f,!0)};${f.col};${f.row}${y}`},SGR_PIXELS:f=>{const y=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${m(f,!0)};${f.x};${f.y}${y}`}};let d=s.CoreMouseService=class extends b.Disposable{constructor(f,y){super(),this._bufferService=f,this._coreService=y,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(w))this.addProtocol(E,w[E]);for(const E of Object.keys(l))this.addEncoding(E,l[E]);this.reset()}addProtocol(f,y){this._protocols[f]=y}addEncoding(f,y){this._encodings[f]=y}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(f){if(!this._protocols[f])throw new Error(`unknown protocol "${f}"`);this._activeProtocol=f,this._onProtocolChange.fire(this._protocols[f].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(f){if(!this._encodings[f])throw new Error(`unknown encoding "${f}"`);this._activeEncoding=f}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(f){if(f.col<0||f.col>=this._bufferService.cols||f.row<0||f.row>=this._bufferService.rows||f.button===4&&f.action===32||f.button===3&&f.action!==32||f.button!==4&&(f.action===2||f.action===3)||(f.col++,f.row++,f.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,f,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(f))return!1;const y=this._encodings[this._activeEncoding](f);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!0)),this._lastEvent=f,!0}explainEvents(f){return{down:!!(1&f),up:!!(2&f),drag:!!(4&f),move:!!(8&f),wheel:!!(16&f)}}_equalEvents(f,y,E){if(E){if(f.x!==y.x||f.y!==y.y)return!1}else if(f.col!==y.col||f.row!==y.row)return!1;return f.button===y.button&&f.action===y.action&&f.ctrl===y.ctrl&&f.alt===y.alt&&f.shift===y.shift}};s.CoreMouseService=d=h([g(0,c.IBufferService),g(1,c.ICoreService)],d)},6975:function(_,s,o){var h=this&&this.__decorate||function(d,f,y,E){var S,L=arguments.length,x=L<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(d,f,y,E);else for(var P=d.length-1;P>=0;P--)(S=d[P])&&(x=(L<3?S(x):L>3?S(f,y,x):S(f,y))||x);return L>3&&x&&Object.defineProperty(f,y,x),x},g=this&&this.__param||function(d,f){return function(y,E){f(y,E,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const c=o(1439),p=o(8460),b=o(844),w=o(2585),m=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=s.CoreService=class extends b.Disposable{constructor(d,f,y){super(),this._bufferService=d,this._logService=f,this._optionsService=y,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,c.clone)(m),this.decPrivateModes=(0,c.clone)(u)}reset(){this.modes=(0,c.clone)(m),this.decPrivateModes=(0,c.clone)(u)}triggerDataEvent(d,f=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;f&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),f&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((f=>f.charCodeAt(0))))),this._onBinary.fire(d))}};s.CoreService=l=h([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],l)},9074:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const h=o(8055),g=o(8460),c=o(844),p=o(6106);let b=0,w=0;class m extends c.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((d=>d==null?void 0:d.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,c.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const f=new u(d);if(f){const y=f.marker.onDispose((()=>f.dispose()));f.onDispose((()=>{f&&(this._decorations.delete(f)&&this._onDecorationRemoved.fire(f),y.dispose())})),this._decorations.insert(f),this._onDecorationRegistered.fire(f)}return f}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,f,y){let E=0,S=0;for(const L of this._decorations.getKeyIterator(f))E=L.options.x??0,S=E+(L.options.width??1),d>=E&&d<S&&(!y||(L.options.layer??"bottom")===y)&&(yield L)}forEachDecorationAtCell(d,f,y,E){this._decorations.forEachByKey(f,(S=>{b=S.options.x??0,w=b+(S.options.width??1),d>=b&&d<w&&(!y||(S.options.layer??"bottom")===y)&&E(S)}))}}s.DecorationService=m;class u extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const h=o(2585),g=o(8343);class c{constructor(...b){this._entries=new Map;for(const[w,m]of b)this.set(w,m)}set(b,w){const m=this._entries.get(b);return this._entries.set(b,w),m}forEach(b){for(const[w,m]of this._entries.entries())b(w,m)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}s.ServiceCollection=c,s.InstantiationService=class{constructor(){this._services=new c,this._services.set(h.IInstantiationService,this)}setService(p,b){this._services.set(p,b)}getService(p){return this._services.get(p)}createInstance(p,...b){const w=(0,g.getServiceDependencies)(p).sort(((l,d)=>l.index-d.index)),m=[];for(const l of w){const d=this._services.get(l.id);if(!d)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${l.id}.`);m.push(d)}const u=w.length>0?w[0].index:b.length;if(b.length!==u)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${u+1} conflicts with ${b.length} static arguments`);return new p(...b,...m)}}},7866:function(_,s,o){var h=this&&this.__decorate||function(u,l,d,f){var y,E=arguments.length,S=E<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,d):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(u,l,d,f);else for(var L=u.length-1;L>=0;L--)(y=u[L])&&(S=(E<3?y(S):E>3?y(l,d,S):y(l,d))||S);return E>3&&S&&Object.defineProperty(l,d,S),S},g=this&&this.__param||function(u,l){return function(d,f){l(d,f,u)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const c=o(844),p=o(2585),b={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,m=s.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,d){this._evalLazyOptionalParams(d),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...d)}trace(u,...l){var d;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,u,l)}debug(u,...l){var d;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,u,l)}info(u,...l){var d;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,u,l)}warn(u,...l){var d;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,u,l)}error(u,...l){var d;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,u,l)}};s.LogService=m=h([g(0,p.IOptionsService)],m),s.setTraceLogger=function(u){w=u},s.traceCall=function(u,l,d){if(typeof d.value!="function")throw new Error("not supported");const f=d.value;d.value=function(...y){if(w.logLevel!==p.LogLevelEnum.TRACE)return f.apply(this,y);w.trace(`GlyphRenderer#${f.name}(${y.map((S=>JSON.stringify(S))).join(", ")})`);const E=f.apply(this,y);return w.trace(`GlyphRenderer#${f.name} return`,E),E}}},7302:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const h=o(8460),g=o(844),c=o(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:c.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends g.Disposable{constructor(m){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...s.DEFAULT_OPTIONS};for(const l in m)if(l in u)try{const d=m[l];u[l]=this._sanitizeAndValidateOption(l,d)}catch(d){console.error(d)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,u){return this.onOptionChange((l=>{l===m&&u(this.rawOptions[m])}))}onMultipleOptionChange(m,u){return this.onOptionChange((l=>{m.indexOf(l)!==-1&&u()}))}_setupOptions(){const m=l=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(l,d)=>{if(!(l in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);d=this._sanitizeAndValidateOption(l,d),this.rawOptions[l]!==d&&(this.rawOptions[l]=d,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const d={get:m.bind(this,l),set:u.bind(this,l)};Object.defineProperty(this.options,l,d)}}_sanitizeAndValidateOption(m,u){switch(m){case"cursorStyle":if(u||(u=s.DEFAULT_OPTIONS[m]),!(function(l){return l==="block"||l==="underline"||l==="bar"})(u))throw new Error(`"${u}" is not a valid value for ${m}`);break;case"wordSeparator":u||(u=s.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=p.includes(u)?u:s.DEFAULT_OPTIONS[m];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${m} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${m} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}s.OptionsService=b},2660:function(_,s,o){var h=this&&this.__decorate||function(b,w,m,u){var l,d=arguments.length,f=d<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,m):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(b,w,m,u);else for(var y=b.length-1;y>=0;y--)(l=b[y])&&(f=(d<3?l(f):d>3?l(w,m,f):l(w,m))||f);return d>3&&f&&Object.defineProperty(w,m,f),f},g=this&&this.__param||function(b,w){return function(m,u){w(m,u,b)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const c=o(2585);let p=s.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const w=this._bufferService.buffer;if(b.id===void 0){const y=w.addMarker(w.ybase+w.y),E={data:b,id:this._nextId++,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(E,y))),this._dataByLinkId.set(E.id,E),E.id}const m=b,u=this._getEntryIdKey(m),l=this._entriesWithId.get(u);if(l)return this.addLineToLink(l.id,w.ybase+w.y),l.id;const d=w.addMarker(w.ybase+w.y),f={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(f,d))),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(b,w){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((u=>u.line!==w))){const u=this._bufferService.buffer.addMarker(w);m.lines.push(u),u.onDispose((()=>this._removeMarkerFromLink(m,u)))}}getLinkData(b){var w;return(w=this._dataByLinkId.get(b))==null?void 0:w.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,w){const m=b.lines.indexOf(w);m!==-1&&(b.lines.splice(m,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};s.OscLinkService=p=h([g(0,c.IBufferService)],p)},8343:(_,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",h="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(g){return g[h]||[]},s.createDecorator=function(g){if(s.serviceRegistry.has(g))return s.serviceRegistry.get(g);const c=function(p,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,u,l){u[o]===u?u[h].push({id:m,index:l}):(u[h]=[{id:m,index:l}],u[o]=u)})(c,p,w)};return c.toString=()=>g,s.serviceRegistry.set(g,c),c}},2585:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const h=o(8343);var g;s.IBufferService=(0,h.createDecorator)("BufferService"),s.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),s.ICoreService=(0,h.createDecorator)("CoreService"),s.ICharsetService=(0,h.createDecorator)("CharsetService"),s.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(g||(s.LogLevelEnum=g={})),s.ILogService=(0,h.createDecorator)("LogService"),s.IOptionsService=(0,h.createDecorator)("OptionsService"),s.IOscLinkService=(0,h.createDecorator)("OscLinkService"),s.IUnicodeService=(0,h.createDecorator)("UnicodeService"),s.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(_,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const h=o(8460),g=o(225);class c{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,m=!1){return(16777215&b)<<3|(3&w)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,m=0;const u=b.length;for(let l=0;l<u;++l){let d=b.charCodeAt(l);if(55296<=d&&d<=56319){if(++l>=u)return w+this.wcwidth(d);const E=b.charCodeAt(l);56320<=E&&E<=57343?d=1024*(d-55296)+E-56320+65536:w+=this.wcwidth(E)}const f=this.charProperties(d,m);let y=c.extractWidth(f);c.extractShouldJoin(f)&&(y-=c.extractWidth(m)),w+=y,m=f}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}s.UnicodeService=c}},n={};function a(_){var s=n[_];if(s!==void 0)return s.exports;var o=n[_]={exports:{}};return i[_].call(o.exports,o,o.exports,a),o.exports}var v={};return(()=>{var _=v;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const s=a(9042),o=a(3236),h=a(844),g=a(5741),c=a(8285),p=a(7975),b=a(7090),w=["cols","rows"];class m extends h.Disposable{constructor(l){super(),this._core=this.register(new o.Terminal(l)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const d=y=>this._core.options[y],f=(y,E)=>{this._checkReadonlyOptions(y),this._core.options[y]=E};for(const y in this._core.options){const E={get:d.bind(this,y),set:f.bind(this,y)};Object.defineProperty(this._publicOptions,y,E)}}_checkReadonlyOptions(l){if(w.includes(l))throw new Error(`Option "${l}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const d in l)this._publicOptions[d]=l[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,d=!0){this._core.input(l,d)}resize(l,d){this._verifyIntegers(l,d),this._core.resize(l,d)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,d,f){this._verifyIntegers(l,d,f),this._core.select(l,d,f)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,d){this._verifyIntegers(l,d),this._core.selectLines(l,d)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,d){this._core.write(l,d)}writeln(l,d){this._core.write(l),this._core.write(`\r
439
+ `,d)}paste(l){this._core.paste(l)}refresh(l,d){this._verifyIntegers(l,d),this._core.refresh(l,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return s}_verifyIntegers(...l){for(const d of l)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const d of l)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}_.Terminal=m})(),v})()))})(xo)),xo.exports}var kx=Cx(),wo={exports:{}},wl;function Ex(){return wl||(wl=1,(function(t,e){(function(i,n){t.exports=n()})(self,(()=>(()=>{var i={};return(()=>{var n=i;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const v=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(v._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,v=a._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,s=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(s.getPropertyValue("height")),h=Math.max(0,parseInt(s.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),c=o-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=h-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(p/v.css.cell.width)),rows:Math.max(1,Math.floor(c/v.css.cell.height))}}}})(),i})()))})(wo)),wo.exports}var Lx=Ex(),Px=I('<p class="mt-3 text-sm text-danger-fg"> </p>'),Rx=I(`<div class="h-full w-full flex items-center justify-center"><div class="text-center"><button type="button" class="px-4 py-2 text-sm font-medium rounded-md
440
+ bg-accent-emphasis text-white hover:opacity-90 transition-opacity">connect</button> <!></div></div>`),Ax=I('<p class="mt-2 text-xs text-text-tertiary"> </p>'),Tx=I(`<div class="h-full w-full flex flex-col gap-2"><div class="flex justify-end gap-2 flex-wrap"><button type="button" class="px-2 py-1.5 text-xs font-medium rounded-md border border-border-default
441
+ bg-bg-secondary text-text-primary hover:bg-bg-tertiary transition-colors" aria-label="Increase terminal height" title="Increase terminal height"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg></button> <button type="button" class="px-2 py-1.5 text-xs font-medium rounded-md border border-border-default
442
+ bg-bg-secondary text-text-primary hover:bg-bg-tertiary transition-colors" aria-label="Decrease terminal height" title="Decrease terminal height"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3 8h10" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path></svg></button> <button type="button" class="px-2 py-1.5 text-xs font-medium rounded-md border border-border-default
443
+ bg-bg-secondary text-text-primary hover:bg-bg-tertiary transition-colors" aria-label="Reset terminal height" title="Reset terminal height"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3 8a5 5 0 1 0 1.5-3.6M3 3v3h3" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <button type="button" class="px-3 py-1.5 text-xs font-medium rounded-md border border-border-default
444
+ bg-bg-secondary text-text-primary hover:bg-bg-tertiary transition-colors
445
+ disabled:opacity-50 disabled:cursor-not-allowed" aria-label="Disconnect terminal" title="Disconnect terminal"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M6 4.5A4.5 4.5 0 1 0 10 12" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M10 3.5h3v3M13 3.5l-4 4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg></button></div> <div class="shrink-0 min-h-0 w-full rounded-md border border-border-default overflow-hidden bg-slate-900" role="button" tabindex="0"><div class="terminal-host h-full w-full svelte-10032sa"></div></div> <div class="h-5 cursor-row-resize flex items-center justify-center
446
+ group hover:bg-accent-muted/40 transition-colors rounded-sm" role="separator" aria-orientation="horizontal" aria-label="Resize terminal height"><div class="w-8 h-0.5 rounded-full bg-border-default group-hover:bg-accent-emphasis transition-colors"></div></div></div> <!>`,1),Dx=I('<main class="terminal-screen flex-1 min-h-0 bg-bg-primary"><div class="h-full w-full p-2 sm:p-6"><!></div></main>');function Ix(t,e){Tt(e,!0);let i=K(void 0),n=K(null),a=K(null),v=K(null),_=K(!1),s=K(!1),o=K(null),h=K(null),g=K(gt(e.contextId)),c=K(!1),p=K(void 0),b=K(void 0),w=K(void 0),m=K(void 0),u=K(null),l=K(!1),d=K(!1),f=0,y=0;function E(){return window.innerWidth<=768}function S(F,U){return U!==void 0&&U.length>0?U:`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${F}`}function L(){le(),r(v)!==null&&(r(v).onopen=null,r(v).onmessage=null,r(v).onerror=null,r(v).onclose=null,(r(v).readyState===WebSocket.OPEN||r(v).readyState===WebSocket.CONNECTING)&&r(v).close(),k(v,null)),r(n)!==null&&(r(n).dispose(),k(n,null)),k(a,null),k(_,!1),k(s,!1),k(h,null)}function x(){if(r(n)!==null||r(i)===void 0)return;const F=new kx.Terminal({convertEol:!1,cursorBlink:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:13,scrollback:5e3,theme:{background:"#0f172a",foreground:"#e2e8f0",cursor:"#93c5fd"}}),U=new Lx.FitAddon;F.loadAddon(U),F.open(r(i)),U.fit(),F.onData($=>{r(v)!==null&&r(v).readyState===WebSocket.OPEN&&r(v).send(JSON.stringify({type:"input",data:$}))}),k(n,F,!0),k(a,U,!0)}function P(){var F;(F=r(n))==null||F.focus()}function B(F){r(v)===null||r(v).readyState!==WebSocket.OPEN||r(v).send(JSON.stringify({type:"resize",rows:F.rows,cols:F.cols}))}function j(){if(r(a)===null||r(n)===null)return;r(a).fit();const F=r(a).proposeDimensions();F!==void 0&&B(F)}function V(){var Ee,He,Le;const F=r(l)?160:220;if(r(p)===void 0)return Math.max(F,Math.floor(window.innerHeight*.8));const U=((Ee=r(b))==null?void 0:Ee.offsetHeight)??0,$=((He=r(w))==null?void 0:He.offsetHeight)??0,be=Number.parseFloat(window.getComputedStyle(r(p)).rowGap),xe=Number.isFinite(be)?be:0,ae=U+$+xe*2,he=r(m)!==void 0?r(m).offsetHeight+8:0,fe=(((Le=r(p).parentElement)==null?void 0:Le.clientHeight)??window.innerHeight)-he;return Math.max(F,fe-ae)}function N(F){const U=r(l)?160:220;return Math.max(U,Math.min(V(),F))}function X(){if(r(u)!==null)return;const F=r(l)?.96:.75;k(u,N(Math.floor(V()*F)),!0)}function W(F){X(),r(u)!==null&&(k(u,N(r(u)+F),!0),requestAnimationFrame(()=>{j()}))}function Q(F){F.preventDefault(),X(),r(u)!==null&&(k(d,!0),f=F.clientY,y=r(u),document.body.style.cursor="row-resize",document.body.style.userSelect="none",window.addEventListener("mousemove",ne),window.addEventListener("mouseup",D))}function ne(F){if(!r(d))return;const U=F.clientY-f;k(u,N(y+U),!0),requestAnimationFrame(()=>{j()})}function le(){k(d,!1),document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",D)}function D(){le()}function T(){k(u,null),X(),requestAnimationFrame(()=>{j()})}function M(F){if(r(n)!==null){if(F.type==="output"){r(n).write(F.data);return}if(F.type==="exit"){r(n).writeln(`\r
447
+ \r
448
+ [terminal exited with code ${F.code}]`),k(s,!1),k(h,null);return}F.type==="error"&&(r(n).writeln(`\r
449
+ [error] ${F.message}`),k(o,F.message,!0))}}async function z(){if(!(r(_)||r(s))){k(_,!0),k(o,null);try{const F=await fetch(`/api/ctx/${e.contextId}/terminal/connect`,{method:"POST"});if(!F.ok){const be=await F.json();throw new Error(be.error??`Failed to connect terminal (${F.status})`)}const U=await F.json();if(k(h,U.sessionId,!0),await _c(),x(),r(n)===null)throw new Error("Terminal UI could not be initialized");r(n).reset(),r(n).writeln(`[connected to ${e.contextId} in ${new Date().toLocaleTimeString()}]`);const $=new WebSocket(S(U.websocketPath,U.websocketUrl));$.onopen=()=>{k(_,!1),k(s,!0),j(),P()},$.onmessage=be=>{try{const xe=JSON.parse(be.data);M(xe)}catch{}},$.onerror=()=>{k(o,"Terminal WebSocket error")},$.onclose=()=>{k(_,!1),k(s,!1),k(h,null)},k(v,$,!0)}catch(F){k(_,!1),k(s,!1),k(h,null),k(o,F instanceof Error?F.message:"Terminal connection failed",!0)}}}async function J(){if(!(r(_)||r(s)||r(c))){k(c,!0);try{const F=await fetch(`/api/ctx/${e.contextId}/terminal/status`);if(!F.ok)return;(await F.json()).hasSession&&await z()}catch{}finally{k(c,!1)}}}function Z(){r(_)||(async()=>{try{await fetch(`/api/ctx/${e.contextId}/terminal/disconnect`,{method:"POST"})}catch{}finally{L(),k(o,null)}})()}St(()=>{e.contextId!==r(g)&&(k(g,e.contextId,!0),L(),k(o,null),J())}),bc(()=>{const F=()=>{k(l,E(),!0)};return F(),window.addEventListener("resize",F),J(),()=>{window.removeEventListener("resize",F)}}),St(()=>{if(r(s)&&r(a)!==null){X();const F=()=>{r(u)!==null&&k(u,N(r(u)),!0),j()};return window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}}}),Yu(()=>{le(),L()});var re=Dx(),se=C(re),G=C(se);{var O=F=>{var U=Rx(),$=C(U),be=C($);be.__click=()=>void z();var xe=R(be,2);{var ae=he=>{var fe=Px(),Ee=C(fe);ee(()=>Y(Ee,r(o))),A(he,fe)};H(xe,he=>{r(o)!==null&&he(ae)})}A(F,U)},ie=F=>{var U=Tx(),$=Ae(U),be=C($),xe=C(be);xe.__click=()=>{W(120)};var ae=R(xe,2);ae.__click=()=>{W(-120)};var he=R(ae,2);he.__click=T;var fe=R(he,2);fe.__click=Z,er(be,De=>k(b,De),()=>r(b));var Ee=R(be,2);Ee.__click=P,Ee.__keydown=P;var He=C(Ee);er(He,De=>k(i,De),()=>r(i));var Le=R(Ee,2);Le.__mousedown=Q,er(Le,De=>k(w,De),()=>r(w)),er($,De=>k(p,De),()=>r(p));var ce=R($,2);{var Te=De=>{var pe=Ax(),Be=C(pe);er(pe,Qe=>k(m,Qe),()=>r(m)),ee(()=>Y(Be,`session: ${r(h)??""}`)),A(De,pe)};H(ce,De=>{r(h)!==null&&De(Te)})}ee(De=>{fe.disabled=r(_),nr(Ee,De)},[()=>`height: ${r(u)??(r(l)?Math.floor(window.innerHeight*.55):480)}px;`]),A(F,U)};H(G,F=>{!r(s)&&!r(_)?F(O):F(ie,!1)})}A(t,re),Dt()}Ft(["click","keydown","mousedown"]);var Mx=rr('<svg class="animate-spin h-4 w-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Reloading...',1),Ox=rr('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="23 4 23 10 17 10"></polyline><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"></path></svg> Reload Plugins',1),Bx=I(`<div class="flex items-center justify-between px-4 py-2 border-b border-border-default bg-bg-secondary"><div class="text-sm text-text-secondary"><span class="font-medium text-text-primary"> </span> <span class="text-text-tertiary ml-1"> </span></div> <button type="button" class="px-3 py-1.5 text-sm font-medium
450
+ bg-bg-secondary hover:bg-bg-hover text-text-primary
451
+ border border-border-default hover:border-accent-muted
452
+ disabled:opacity-50 disabled:cursor-not-allowed
453
+ rounded-lg transition-colors
454
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis
455
+ flex items-center gap-2" aria-label="Reload plugin tools from disk"><!></button></div>`),Nx=I('<div class="mx-4 mt-3 p-3 rounded-lg border border-success-muted bg-success-subtle text-success-fg text-sm" role="status"> </div>'),jx=I('<div class="mx-4 mt-3 p-3 rounded-lg border border-danger-muted bg-danger-subtle text-danger-fg text-sm" role="alert"><div class="flex items-start gap-2"><span class="flex-1"> </span> <button type="button" class="p-1 rounded hover:bg-danger-subtle transition-colors shrink-0" aria-label="Dismiss error"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div></div>'),Fx=I('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><svg class="animate-spin h-6 w-6 text-accent-fg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="ml-2 text-sm text-text-secondary">Loading tools...</span></div>'),Hx=I(`<div class="flex flex-col items-center justify-center py-12 text-center"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="text-danger-fg mb-4" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> <p class="text-text-secondary mb-2"> </p> <button type="button" class="px-4 py-2 text-sm font-medium
456
+ bg-bg-secondary hover:bg-bg-hover text-text-primary
457
+ border border-border-default rounded-lg
458
+ transition-colors
459
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis">Retry</button></div>`),Vx=I('<div class="flex flex-col items-center justify-center py-12 text-center"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="text-text-tertiary mb-4" aria-hidden="true"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path></svg> <p class="text-text-secondary mb-1">No tools registered</p> <p class="text-sm text-text-tertiary">Tools will appear here once registered.</p></div>'),Wx=I(`<span class="px-2 py-0.5 text-xs rounded-full
460
+ bg-neutral-muted text-text-secondary">builtin</span>`),Ux=I(`<span class="px-2 py-0.5 text-xs rounded-full
461
+ bg-accent-muted text-accent-fg">plugin</span>`),zx=I('<span class="text-sm text-text-tertiary truncate flex-1 ml-2"> </span>'),qx=I('<div><h3 class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-1">Description</h3> <p class="text-sm text-text-secondary"> </p></div>'),Gx=I('<span class="text-text-tertiary"> </span>'),Kx=I('<span class="text-xs text-danger-fg">required</span>'),Jx=I('<span class="text-text-secondary"> </span>'),Qx=I('<div class="flex items-start gap-2 text-sm"><span class="font-mono text-text-primary shrink-0"> </span> <span class="text-text-tertiary"> </span> <!> <!></div>'),Xx=I('<div><h3 class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-1">Parameters</h3> <div class="space-y-1"></div></div>'),Yx=I('<div class="px-4 pb-4 pt-0 border-t border-border-default mx-4 mt-0"><div class="pt-3 space-y-3"><!> <div><h3 class="text-xs font-semibold text-text-tertiary uppercase tracking-wider mb-1">Source</h3> <p class="text-sm text-text-secondary"> <!></p></div> <!></div></div>'),Zx=I(`<div class="tool-card rounded-lg border border-border-default bg-bg-secondary
462
+ hover:border-accent-muted transition-colors" role="listitem"><button type="button" class="w-full px-4 py-3 flex items-center gap-3 text-left
463
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis focus:ring-inset
464
+ rounded-lg"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 18 15 12 9 6"></polyline></svg> <span class="font-mono text-sm text-text-primary"> </span> <!> <!></button> <!></div>`),$x=I('<div class="space-y-2" role="list"></div>'),ew=I('<div class="tools-screen flex flex-col h-full bg-bg-primary" role="main" aria-label="Tools management"><!> <!> <!> <div class="flex-1 overflow-y-auto px-4 py-4"><!></div></div>');function tw(t,e){Tt(e,!0);let i=K(gt([])),n=K(gt({total:0,builtin:0,plugin:0})),a=K(!0),v=K(null),_=K(null),s=K(!1),o=K(null),h=K(null);const g=ge(()=>[...r(i)].sort((P,B)=>P.source!==B.source?P.source==="builtin"?-1:1:P.name.localeCompare(B.name)));async function c(){try{k(a,!0),k(v,null);const P=await fetch("/api/tools");if(!P.ok)throw new Error(`Failed to fetch tools: ${P.status}`);const B=await P.json();k(i,[...B.tools],!0),k(n,{...B.counts},!0)}catch(P){k(v,P instanceof Error?P.message:"Failed to load tools",!0),console.error("Failed to fetch tools:",P)}finally{k(a,!1)}}async function p(){try{k(s,!0),k(h,null),k(o,null);const P=await fetch("/api/tools/reload",{method:"POST"});if(!P.ok)throw new Error(`Reload failed: ${P.status}`);const B=await P.json();if(B.success)k(o,`Plugins reloaded (${B.toolCount} tools)`);else{const j=B.errors.map(V=>V.message).join("; ");k(h,`Reload completed with errors: ${j}`)}await c(),r(o)!==null&&setTimeout(()=>{k(o,null)},3e3)}catch(P){k(h,P instanceof Error?P.message:"Failed to reload plugins",!0),console.error("Failed to reload plugins:",P)}finally{k(s,!1)}}function b(P){k(_,r(_)===P?null:P,!0)}St(()=>{c()});var w=ew(),m=C(w);{var u=P=>{var B=Bx(),j=C(B),V=C(j),N=C(V),X=R(V),W=R(X),Q=C(W),ne=R(j,2);ne.__click=()=>void p();var le=C(ne);{var D=M=>{var z=Mx();A(M,z)},T=M=>{var z=Ox();A(M,z)};H(le,M=>{r(s)?M(D):M(T,!1)})}ee(()=>{Y(N,r(n).total),Y(X,` tool${r(n).total!==1?"s":""} `),Y(Q,`(${r(n).builtin??""} builtin, ${r(n).plugin??""} plugin)`),ne.disabled=r(s)}),A(P,B)};H(m,P=>{!r(a)&&r(v)===null&&P(u)})}var l=R(m,2);{var d=P=>{var B=Nx(),j=C(B);ee(()=>Y(j,r(o))),A(P,B)};H(l,P=>{r(o)!==null&&P(d)})}var f=R(l,2);{var y=P=>{var B=jx(),j=C(B),V=C(j),N=C(V),X=R(V,2);X.__click=()=>{k(h,null)},ee(()=>Y(N,r(h))),A(P,B)};H(f,P=>{r(h)!==null&&P(y)})}var E=R(f,2),S=C(E);{var L=P=>{var B=Fx();A(P,B)},x=P=>{var B=et(),j=Ae(B);{var V=X=>{var W=Hx(),Q=R(C(W),2),ne=C(Q),le=R(Q,2);le.__click=()=>void c(),ee(()=>Y(ne,r(v))),A(X,W)},N=X=>{var W=et(),Q=Ae(W);{var ne=D=>{var T=Vx();A(D,T)},le=D=>{var T=$x();At(T,21,()=>r(g),M=>M.name,(M,z)=>{var J=Zx(),Z=C(J);Z.__click=()=>b(r(z).name);var re=C(Z),se=R(re,2),G=C(se),O=R(se,2);{var ie=ae=>{var he=Wx();A(ae,he)},F=ae=>{var he=Ux();A(ae,he)};H(O,ae=>{r(z).source==="builtin"?ae(ie):ae(F,!1)})}var U=R(O,2);{var $=ae=>{var he=zx(),fe=C(he);ee(()=>Y(fe,r(z).description)),A(ae,he)};H(U,ae=>{r(z).description&&ae($)})}var be=R(Z,2);{var xe=ae=>{var he=Yx(),fe=C(he),Ee=C(fe);{var He=Ne=>{var Me=qx(),Fe=R(C(Me),2),tt=C(Fe);ee(()=>Y(tt,r(z).description)),A(Ne,Me)};H(Ee,Ne=>{r(z).description&&Ne(He)})}var Le=R(Ee,2),ce=R(C(Le),2),Te=C(ce),De=R(Te);{var pe=Ne=>{var Me=Gx(),Fe=C(Me);ee(()=>Y(Fe,`(${r(z).pluginName??""})`)),A(Ne,Me)};H(De,Ne=>{r(z).pluginName!==void 0&&Ne(pe)})}var Be=R(Le,2);{var Qe=Ne=>{var Me=Xx(),Fe=R(C(Me),2);At(Fe,21,()=>Object.entries(r(z).inputSchema.properties),Pr,(tt,Ve)=>{var Xe=ge(()=>Tl(r(Ve),2));let Ue=()=>r(Xe)[0],Je=()=>r(Xe)[1];var ve=Qx(),_e=C(ve),Oe=C(_e),Ke=R(_e,2),nt=C(Ke),$e=R(Ke,2);{var dt=lt=>{var ye=Kx();A(lt,ye)};H($e,lt=>{var ye;(ye=r(z).inputSchema.required)!=null&&ye.includes(Ue())&&lt(dt)})}var ut=R($e,2);{var bt=lt=>{var ye=Jx(),te=C(ye);ee(()=>Y(te,`- ${Je().description??""}`)),A(lt,ye)};H(ut,lt=>{Je().description!==void 0&&lt(bt)})}ee(()=>{Y(Oe,Ue()),Y(nt,`(${Je().type??""})`)}),A(tt,ve)}),A(Ne,Me)};H(Be,Ne=>{var Me;((Me=r(z).inputSchema)==null?void 0:Me.properties)!==void 0&&Ne(Qe)})}ee(()=>Y(Te,`${r(z).source??""} `)),A(ae,he)};H(be,ae=>{r(_)===r(z).name&&ae(xe)})}ee(()=>{ze(Z,"aria-expanded",r(_)===r(z).name),Pe(re,0,`shrink-0 text-text-tertiary transition-transform
465
+ ${r(_)===r(z).name?"rotate-90":""}`),Y(G,r(z).name)}),A(M,J)}),A(D,T)};H(Q,D=>{r(g).length===0?D(ne):D(le,!1)},!0)}A(X,W)};H(j,X=>{r(v)!==null?X(V):X(N,!1)},!0)}A(P,B)};H(S,P=>{r(a)?P(L):P(x,!1)})}A(t,w),Dt()}Ft(["click"]);var rw=I('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><svg class="animate-spin h-6 w-6 text-accent-fg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" aria-hidden="true"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> <span class="ml-2 text-sm text-text-secondary">Loading system information...</span></div>'),iw=I(`<div class="flex flex-col items-center justify-center py-12 text-center"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="text-danger-fg mb-4" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="12"></line><line x1="12" y1="16" x2="12.01" y2="16"></line></svg> <p class="text-text-secondary mb-2"> </p> <button type="button" class="px-4 py-2 text-sm font-medium
466
+ bg-bg-secondary hover:bg-bg-hover text-text-primary
467
+ border border-border-default rounded-lg
468
+ transition-colors
469
+ focus:outline-none focus:ring-2 focus:ring-accent-emphasis">Retry</button></div>`),nw=I('<p class="text-sm text-success-fg font-mono"> </p>'),sw=I('<p class="text-sm text-danger-fg"> </p>'),ow=I('<p class="text-sm text-text-tertiary">Version information not available</p>'),aw=I('<p class="text-sm text-success-fg font-mono"> </p>'),lw=I('<p class="text-sm text-danger-fg"> </p>'),cw=I('<p class="text-sm text-text-tertiary">Version information not available</p>'),dw=I('<div class="flex items-center justify-between"><span class="text-sm text-text-secondary">First Session</span> <span class="text-sm text-text-primary font-mono"> </span></div>'),uw=I('<div class="flex items-center justify-between"><span class="text-sm text-text-secondary">Last Computed</span> <span class="text-sm text-text-primary font-mono"> </span></div>'),hw=I('<div class="space-y-1"><div class="text-sm font-medium text-text-primary"> </div> <div class="grid grid-cols-2 gap-2 text-xs"><div class="flex justify-between"><span class="text-text-secondary">Input:</span> <span class="text-text-primary font-mono tabular-nums"> </span></div> <div class="flex justify-between"><span class="text-text-secondary">Output:</span> <span class="text-text-primary font-mono tabular-nums"> </span></div> <div class="flex justify-between"><span class="text-text-secondary">Cache Read:</span> <span class="text-text-primary font-mono tabular-nums"> </span></div> <div class="flex justify-between"><span class="text-text-secondary">Cache Write:</span> <span class="text-text-primary font-mono tabular-nums"> </span></div></div></div>'),fw=I('<div class="mb-4 pb-4 border-b border-border-default"><h4 class="text-sm font-semibold text-text-primary mb-2">Model Usage</h4> <div class="space-y-3"></div></div>'),vw=I('<tr class="border-b border-border-default/50"><td class="py-2 pr-4 text-text-primary font-mono"> </td><td class="py-2 px-2 text-right text-text-primary font-mono tabular-nums"> </td><td class="py-2 px-2 text-right text-text-primary font-mono tabular-nums"> </td><td class="py-2 px-2 text-right text-text-primary font-mono tabular-nums"> </td><td class="py-2 pl-2 text-right text-text-primary font-mono tabular-nums"> </td></tr>'),_w=I('<div><h4 class="text-sm font-semibold text-text-primary mb-2">Recent Activity (Last 14 Days)</h4> <div class="overflow-x-auto"><table class="w-full text-xs"><thead><tr class="border-b border-border-default"><th class="text-left py-2 pr-4 text-text-secondary font-medium">Date</th><th class="text-right py-2 px-2 text-text-secondary font-medium">Messages</th><th class="text-right py-2 px-2 text-text-secondary font-medium">Sessions</th><th class="text-right py-2 px-2 text-text-secondary font-medium">Tool Calls</th><th class="text-right py-2 pl-2 text-text-secondary font-medium">Tokens</th></tr></thead><tbody></tbody></table></div></div>'),pw=I('<div class="rounded-lg border border-border-default bg-bg-secondary p-4"><div class="flex-1"><h3 class="text-sm font-semibold text-text-primary mb-3">Claude Code Usage</h3> <div class="space-y-2 mb-4 pb-4 border-b border-border-default"><div class="flex items-center justify-between"><span class="text-sm text-text-secondary">Total Sessions</span> <span class="text-sm text-text-primary font-mono tabular-nums"> </span></div> <div class="flex items-center justify-between"><span class="text-sm text-text-secondary">Total Messages</span> <span class="text-sm text-text-primary font-mono tabular-nums"> </span></div> <div class="flex items-center justify-between"><span class="text-sm text-text-secondary">Total Tokens (14 Days)</span> <span class="text-sm text-text-primary font-mono tabular-nums"> </span></div> <!> <!></div> <!> <!></div></div>'),gw=I('<div class="space-y-4 max-w-2xl"><div class="rounded-lg border border-border-default bg-bg-secondary p-4"><div class="flex items-start gap-3"><div class="flex-1"><h3 class="text-sm font-semibold text-text-primary mb-1">Git</h3> <!></div></div></div> <div class="rounded-lg border border-border-default bg-bg-secondary p-4"><div class="flex items-start gap-3"><div class="flex-1"><h3 class="text-sm font-semibold text-text-primary mb-1">Claude Code</h3> <!></div></div></div> <div class="rounded-lg border border-border-default bg-bg-secondary p-4"><div class="flex-1"><h3 class="text-sm font-semibold text-text-primary mb-3">Models</h3> <div class="space-y-2"><div class="flex items-center justify-between"><span class="text-sm text-text-secondary">Prompt Model</span> <span class="text-sm text-text-primary font-mono"> </span></div> <div class="flex items-center justify-between"><span class="text-sm text-text-secondary">Assistant Model</span> <span class="text-sm text-text-primary font-mono"> </span></div></div></div></div> <!></div>'),mw=I('<div class="system-info-screen flex flex-col h-full bg-bg-primary" role="main" aria-label="System information"><div class="px-4 py-3 border-b border-border-default bg-bg-secondary"><h2 class="text-lg font-semibold text-text-primary">System Information</h2></div> <div class="flex-1 overflow-y-auto px-4 py-4"><!></div></div>');function bw(t,e){Tt(e,!0);let i=K(null),n=K(!0),a=K(null);function v(l){return l>=1e9?`${(l/1e9).toFixed(1)}B`:l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:l.toString()}function _(l){try{const d=l.split("-");return d.length===3?new Date(Number(d[0]),Number(d[1])-1,Number(d[2])).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):new Date(l).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return l}}function s(l){return l.includes("opus-4-6")?"Opus 4.6":l.includes("opus-4-5")?"Opus 4.5":l.includes("sonnet-4-5")?"Sonnet 4.5":l.includes("haiku")?"Haiku":l}function o(l){return[...l].sort((d,f)=>f.date.localeCompare(d.date))}function h(l){return l.tokensByModel===void 0?0:Object.values(l.tokensByModel).reduce((d,f)=>d+f,0)}function g(l){return l.reduce((d,f)=>d+h(f),0)}async function c(){try{k(n,!0),k(a,null);const l=await fetch("/api/system-info");if(!l.ok)throw new Error(`Failed to fetch system info: ${l.status}`);const d=await l.json();k(i,d,!0)}catch(l){k(a,l instanceof Error?l.message:"Failed to load system info",!0),console.error("Failed to fetch system info:",l)}finally{k(n,!1)}}St(()=>{c()});var p=mw(),b=R(C(p),2),w=C(b);{var m=l=>{var d=rw();A(l,d)},u=l=>{var d=et(),f=Ae(d);{var y=S=>{var L=iw(),x=R(C(L),2),P=C(x),B=R(x,2);B.__click=()=>void c(),ee(()=>Y(P,r(a))),A(S,L)},E=S=>{var L=et(),x=Ae(L);{var P=B=>{var j=gw(),V=C(j),N=C(V),X=C(N),W=R(C(X),2);{var Q=ae=>{var he=nw(),fe=C(he);ee(()=>Y(fe,r(i).git.version)),A(ae,he)},ne=ae=>{var he=et(),fe=Ae(he);{var Ee=Le=>{var ce=sw(),Te=C(ce);ee(()=>Y(Te,r(i).git.error)),A(Le,ce)},He=Le=>{var ce=ow();A(Le,ce)};H(fe,Le=>{r(i).git.error!==null?Le(Ee):Le(He,!1)},!0)}A(ae,he)};H(W,ae=>{r(i).git.version!==null?ae(Q):ae(ne,!1)})}var le=R(V,2),D=C(le),T=C(D),M=R(C(T),2);{var z=ae=>{var he=aw(),fe=C(he);ee(()=>Y(fe,r(i).claudeCode.version)),A(ae,he)},J=ae=>{var he=et(),fe=Ae(he);{var Ee=Le=>{var ce=lw(),Te=C(ce);ee(()=>Y(Te,r(i).claudeCode.error)),A(Le,ce)},He=Le=>{var ce=cw();A(Le,ce)};H(fe,Le=>{r(i).claudeCode.error!==null?Le(Ee):Le(He,!1)},!0)}A(ae,he)};H(M,ae=>{r(i).claudeCode.version!==null?ae(z):ae(J,!1)})}var Z=R(le,2),re=C(Z),se=R(C(re),2),G=C(se),O=R(C(G),2),ie=C(O),F=R(G,2),U=R(C(F),2),$=C(U),be=R(Z,2);{var xe=ae=>{var he=pw(),fe=C(he),Ee=R(C(fe),2),He=C(Ee),Le=R(C(He),2),ce=C(Le),Te=R(He,2),De=R(C(Te),2),pe=C(De),Be=R(Te,2),Qe=R(C(Be),2),Ne=C(Qe),Me=R(Be,2);{var Fe=_e=>{var Oe=dw(),Ke=R(C(Oe),2),nt=C(Ke);ee($e=>Y(nt,$e),[()=>_(r(i).claudeCodeUsage.firstSessionDate)]),A(_e,Oe)};H(Me,_e=>{r(i).claudeCodeUsage.firstSessionDate!==null&&_e(Fe)})}var tt=R(Me,2);{var Ve=_e=>{var Oe=uw(),Ke=R(C(Oe),2),nt=C(Ke);ee($e=>Y(nt,$e),[()=>_(r(i).claudeCodeUsage.lastComputedDate)]),A(_e,Oe)};H(tt,_e=>{r(i).claudeCodeUsage.lastComputedDate!==null&&_e(Ve)})}var Xe=R(Ee,2);{var Ue=_e=>{var Oe=fw(),Ke=R(C(Oe),2);At(Ke,21,()=>Object.entries(r(i).claudeCodeUsage.modelUsage),Pr,(nt,$e)=>{var dt=ge(()=>Tl(r($e),2));let ut=()=>r(dt)[0],bt=()=>r(dt)[1];var lt=hw(),ye=C(lt),te=C(ye),oe=R(ye,2),me=C(oe),Ie=R(C(me),2),we=C(Ie),Re=R(me,2),je=R(C(Re),2),Ye=C(je),rt=R(Re,2),ht=R(C(rt),2),_t=C(ht),ct=R(rt,2),kt=R(C(ct),2),It=C(kt);ee((Ze,at,ft,mt,xt)=>{Y(te,Ze),Y(we,at),Y(Ye,ft),Y(_t,mt),Y(It,xt)},[()=>s(ut()),()=>v(bt().inputTokens),()=>v(bt().outputTokens),()=>v(bt().cacheReadInputTokens),()=>v(bt().cacheCreationInputTokens)]),A(nt,lt)}),A(_e,Oe)};H(Xe,_e=>{Object.keys(r(i).claudeCodeUsage.modelUsage).length>0&&_e(Ue)})}var Je=R(Xe,2);{var ve=_e=>{var Oe=_w(),Ke=R(C(Oe),2),nt=C(Ke),$e=R(C(nt));At($e,21,()=>o(r(i).claudeCodeUsage.recentDailyActivity),Pr,(dt,ut)=>{var bt=vw(),lt=C(bt),ye=C(lt),te=R(lt),oe=C(te),me=R(te),Ie=C(me),we=R(me),Re=C(we),je=R(we),Ye=C(je);ee((rt,ht)=>{Y(ye,rt),Y(oe,r(ut).messageCount??0),Y(Ie,r(ut).sessionCount??0),Y(Re,r(ut).toolCallCount??0),Y(Ye,ht)},[()=>_(r(ut).date),()=>v(h(r(ut)))]),A(dt,bt)}),A(_e,Oe)};H(Je,_e=>{r(i).claudeCodeUsage.recentDailyActivity.length>0&&_e(ve)})}ee((_e,Oe,Ke)=>{Y(ce,_e),Y(pe,Oe),Y(Ne,Ke)},[()=>v(r(i).claudeCodeUsage.totalSessions),()=>v(r(i).claudeCodeUsage.totalMessages),()=>v(g(r(i).claudeCodeUsage.recentDailyActivity))]),A(ae,he)};H(be,ae=>{r(i).claudeCodeUsage!==null&&ae(xe)})}ee(()=>{Y(ie,r(i).models.promptModel),Y($,r(i).models.assistantModel)}),A(B,j)};H(x,B=>{r(i)!==null&&B(P)},!0)}A(S,L)};H(f,S=>{r(a)!==null?S(y):S(E,!1)},!0)}A(l,d)};H(w,l=>{r(n)?l(m):l(u,!1)})}A(t,p),Dt()}Ft(["click"]);var yw=I('<p class="text-sm text-text-secondary">Loading model config...</p>'),xw=I('<div class="rounded border border-danger-emphasis bg-danger-subtle text-danger-fg px-3 py-2 text-sm"> </div>'),ww=I("<option> </option>"),Sw=I("<option> </option>"),Cw=I("<option> </option>"),kw=I('<p class="text-sm text-text-secondary">No profiles registered.</p>'),Ew=I('<div class="rounded border border-border-default bg-bg-primary px-3 py-2"><div class="flex items-start justify-between gap-2"><div><p class="text-sm font-medium text-text-primary"> </p> <p class="text-xs text-text-secondary"> </p> <p class="text-xs text-text-tertiary font-mono break-all"> </p></div> <button type="button" class="px-2 py-1 rounded text-xs bg-danger-subtle text-danger-fg disabled:opacity-50">Delete</button></div></div>'),Lw=I('<!> <section class="rounded-lg border border-border-default bg-bg-secondary p-4 space-y-3"><h3 class="text-sm font-semibold text-text-primary">Operation Mappings</h3> <label class="block text-sm"><span class="text-text-secondary">Git Commit</span> <select class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm"></select></label> <label class="block text-sm"><span class="text-text-secondary">Git PR (create/update)</span> <select class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm"></select></label> <label class="block text-sm"><span class="text-text-secondary">AI Ask default</span> <select class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm"></select></label> <button type="button" class="px-3 py-1.5 rounded bg-accent-emphasis text-white text-sm disabled:opacity-50">Save operation mappings</button></section> <section class="rounded-lg border border-border-default bg-bg-secondary p-4 space-y-3"><h3 class="text-sm font-semibold text-text-primary">Add Profile</h3> <label class="block text-sm"><span class="text-text-secondary">Name</span> <input class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm" placeholder="e.g. Fast OpenAI"/></label> <label class="block text-sm"><span class="text-text-secondary">Vendor</span> <select class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm"><option>anthropics</option><option>openai</option></select></label> <label class="block text-sm"><span class="text-text-secondary">Model</span> <input class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm" placeholder="claude-opus-4-6 / codex5.3"/></label> <label class="block text-sm"><span class="text-text-secondary">Arguments (one token per line)</span> <textarea rows="4" class="mt-1 w-full rounded border border-border-default bg-bg-primary px-2 py-1.5 text-sm font-mono" placeholder="--permission-mode bypassPermissions"></textarea></label> <button type="button" class="px-3 py-1.5 rounded bg-success-emphasis text-white text-sm disabled:opacity-50">Register profile</button></section> <section class="rounded-lg border border-border-default bg-bg-secondary p-4 space-y-2"><h3 class="text-sm font-semibold text-text-primary">Registered Profiles</h3> <!></section>',1),Pw=I('<div class="h-full flex flex-col bg-bg-primary" role="main" aria-label="Model config"><div class="px-4 py-3 border-b border-border-default bg-bg-secondary"><h2 class="text-lg font-semibold text-text-primary">Model Config</h2></div> <div class="flex-1 overflow-y-auto px-4 py-4 space-y-4"><!></div></div>');function Rw(t,e){Tt(e,!0);let i=K(!0),n=K(!1),a=K(null),v=K(gt([])),_=K(gt({gitCommitProfileId:null,gitPrProfileId:null,aiDefaultProfileId:null})),s=K(""),o=K("anthropics"),h=K("claude-opus-4-6"),g=K(`--permission-mode
470
+ bypassPermissions`);async function c(){try{k(i,!0),k(a,null);const L=await Lc();k(v,[...L.profiles],!0),k(_,L.operationBindings,!0)}catch(L){k(a,L instanceof Error?L.message:"Failed to load model config",!0)}finally{k(i,!1)}}function p(L){return L.split(/\r?\n/).map(x=>x.trim()).filter(x=>x.length>0)}function b(L){k(o,L,!0),k(h,L==="anthropics"?"claude-opus-4-6":"codex5.3",!0)}async function w(){const L=r(s).trim(),x=r(h).trim();if(L.length===0||x.length===0){k(a,"Name and model are required");return}try{k(n,!0),k(a,null),await kh({name:L,vendor:r(o),model:x,arguments:p(r(g))}),k(s,""),await c()}catch(P){k(a,P instanceof Error?P.message:"Failed to create profile",!0)}finally{k(n,!1)}}async function m(L){try{k(n,!0),k(a,null),await Eh(L),await c()}catch(x){k(a,x instanceof Error?x.message:"Failed to delete profile",!0)}finally{k(n,!1)}}async function u(){try{k(n,!0),k(a,null),k(_,await Lh(r(_)),!0),await c()}catch(L){k(a,L instanceof Error?L.message:"Failed to update operation mappings",!0)}finally{k(n,!1)}}function l(L){return`${L.name} (${L.vendor} / ${L.model})`}St(()=>{c()});var d=Pw(),f=R(C(d),2),y=C(f);{var E=L=>{var x=yw();A(L,x)},S=L=>{var x=Lw(),P=Ae(x);{var B=ae=>{var he=xw(),fe=C(he);ee(()=>Y(fe,r(a))),A(ae,he)};H(P,ae=>{r(a)!==null&&ae(B)})}var j=R(P,2),V=R(C(j),2),N=R(C(V),2);At(N,21,()=>r(v),ae=>ae.id,(ae,he)=>{var fe=ww(),Ee=C(fe),He={};ee(Le=>{Y(Ee,Le),He!==(He=r(he).id)&&(fe.value=(fe.__value=r(he).id)??"")},[()=>l(r(he))]),A(ae,fe)});var X=R(V,2),W=R(C(X),2);At(W,21,()=>r(v),ae=>ae.id,(ae,he)=>{var fe=Sw(),Ee=C(fe),He={};ee(Le=>{Y(Ee,Le),He!==(He=r(he).id)&&(fe.value=(fe.__value=r(he).id)??"")},[()=>l(r(he))]),A(ae,fe)});var Q=R(X,2),ne=R(C(Q),2);At(ne,21,()=>r(v),ae=>ae.id,(ae,he)=>{var fe=Cw(),Ee=C(fe),He={};ee(Le=>{Y(Ee,Le),He!==(He=r(he).id)&&(fe.value=(fe.__value=r(he).id)??"")},[()=>l(r(he))]),A(ae,fe)});var le=R(Q,2);le.__click=()=>void u();var D=R(j,2),T=R(C(D),2),M=R(C(T),2),z=R(T,2),J=R(C(z),2);J.__change=ae=>b(ae.currentTarget.value);var Z=C(J);Z.value=Z.__value="anthropics";var re=R(Z);re.value=re.__value="openai";var se=R(z,2),G=R(C(se),2),O=R(se,2),ie=R(C(O),2),F=R(O,2);F.__click=()=>void w();var U=R(D,2),$=R(C(U),2);{var be=ae=>{var he=kw();A(ae,he)},xe=ae=>{var he=et(),fe=Ae(he);At(fe,17,()=>r(v),Ee=>Ee.id,(Ee,He)=>{var Le=Ew(),ce=C(Le),Te=C(ce),De=C(Te),pe=C(De),Be=R(De,2),Qe=C(Be),Ne=R(Be,2),Me=C(Ne),Fe=R(Te,2);Fe.__click=()=>void m(r(He).id),ee(tt=>{Y(pe,r(He).name),Y(Qe,`${r(He).vendor??""} / ${r(He).model??""}`),Y(Me,tt),Fe.disabled=r(n)},[()=>r(He).arguments.join(" ")]),A(Ee,Le)}),A(ae,he)};H($,ae=>{r(v).length===0?ae(be):ae(xe,!1)})}ee(()=>{le.disabled=r(n)||r(v).length===0,F.disabled=r(n)}),Nn(N,()=>r(_).gitCommitProfileId,ae=>r(_).gitCommitProfileId=ae),Nn(W,()=>r(_).gitPrProfileId,ae=>r(_).gitPrProfileId=ae),Nn(ne,()=>r(_).aiDefaultProfileId,ae=>r(_).aiDefaultProfileId=ae),Rr(M,()=>r(s),ae=>k(s,ae)),Nn(J,()=>r(o),ae=>k(o,ae)),Rr(G,()=>r(h),ae=>k(h,ae)),Rr(ie,()=>r(g),ae=>k(g,ae)),A(L,x)};H(y,L=>{r(i)?L(E):L(S,!1)})}A(t,d),Dt()}Ft(["click","change"]);var Aw=I('Merge into <span class="font-mono text-accent-fg"> </span>',1),Tw=I('<div class="px-4 py-3 text-sm bg-success-subtle text-success-fg border-b border-border-default flex items-center gap-2"><svg class="w-4 h-4 shrink-0" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg> </div>'),Dw=I('<div class="px-4 py-2 text-xs bg-danger-subtle text-danger-fg border-b border-border-default"> </div>'),Iw=I('<div class="px-4 py-8 text-sm text-text-secondary text-center">Loading status...</div>'),Mw=I('Merge <span class="font-mono text-text-secondary"> </span> into <span class="font-mono text-text-secondary"> </span>',1),Ow=I('<div class="flex-1 overflow-hidden"><!></div> <div class="flex items-center justify-between px-4 py-3 border-t border-border-default"><div class="text-xs text-text-tertiary"><!></div> <div class="flex items-center gap-2"><button type="button" class="px-3 py-1.5 text-sm rounded border border-border-default text-text-secondary hover:bg-bg-tertiary transition-colors">Cancel</button> <button type="button"><!></button></div></div>',1),Bw=I('<div class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center" role="presentation"><div class="w-96 max-h-[80vh] bg-bg-primary border border-border-default rounded-lg shadow-xl flex flex-col" role="dialog" aria-label="Merge branch"><div class="flex items-center justify-between px-4 py-3 border-b border-border-default"><h2 class="text-sm font-semibold text-text-primary"><!></h2> <button type="button" class="p-1 rounded text-text-secondary hover:text-text-primary hover:bg-bg-tertiary transition-colors" aria-label="Close"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg></button></div> <!> <!> <!></div></div>');function Nw(t,e){Tt(e,!0);let i=K(""),n=K(!1),a=K(!0),v=K(null),_=K(!1),s=K(null),o=K(null),h=K(void 0);const g=ge(()=>r(v)!==null&&r(v)!==r(i)&&!r(n)&&!r(_));async function c(){k(a,!0);try{const W=await fetch(`/api/ctx/${e.contextId}/status`);if(W.ok){const Q=await W.json();k(i,Q.branch,!0),k(n,!Q.clean)}}catch{}finally{k(a,!1)}}function p(W){W.name!==r(i)&&(k(v,W.name,!0),k(s,null))}async function b(){if(!(!r(g)||r(v)===null)){k(_,!0),k(s,null);try{const Q=await(await fetch(`/api/ctx/${e.contextId}/branches/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:r(v)})})).json();Q.success?(k(o,`Merged ${Q.mergedBranch} into ${Q.currentBranch}`),setTimeout(()=>{e.onClose(),window.location.reload()},1200)):k(s,Q.error??"Merge failed",!0)}catch{k(s,"Merge failed")}finally{k(_,!1)}}}function w(W){W.key==="Escape"&&e.onClose()}let m=K(!1);St(()=>{c()}),St(()=>{!r(a)&&r(h)!==void 0&&!r(m)&&(k(m,!0),r(h).initialize())});var u=Bw();u.__click=W=>{W.target===W.currentTarget&&e.onClose()},u.__keydown=w;var l=C(u);l.__click=W=>W.stopPropagation(),l.__keydown=w;var d=C(l),f=C(d),y=C(f);{var E=W=>{var Q=Aw(),ne=R(Ae(Q)),le=C(ne);ee(()=>Y(le,r(i))),A(W,Q)},S=W=>{var Q=Xt("Merge Branch");A(W,Q)};H(y,W=>{r(i).length>0?W(E):W(S,!1)})}var L=R(f,2);L.__click=function(...W){var Q;(Q=e.onClose)==null||Q.apply(this,W)};var x=R(d,2);{var P=W=>{var Q=Tw(),ne=R(C(Q));ee(()=>Y(ne,` ${r(o)??""}`)),A(W,Q)};H(x,W=>{r(o)!==null&&W(P)})}var B=R(x,2);{var j=W=>{var Q=Dw(),ne=C(Q);ee(()=>Y(ne,r(s))),A(W,Q)};H(B,W=>{r(s)!==null&&W(j)})}var V=R(B,2);{var N=W=>{var Q=Iw();A(W,Q)},X=W=>{var Q=Ow(),ne=Ae(Q),le=C(ne);{let F=ge(()=>r(n)?"Uncommitted changes -- merge disabled":void 0),U=ge(()=>r(v)??void 0);er(Ac(le,{get contextId(){return e.contextId},get currentBranch(){return r(i)},headerText:"Select branch to merge",filterPlaceholder:"Filter branches...",get warningMessage(){return r(F)},onSelect:p,disableCurrentBranch:!0,get selectedBranch(){return r(U)}}),$=>k(h,$,!0),()=>r(h))}var D=R(ne,2),T=C(D),M=C(T);{var z=F=>{var U=Mw(),$=R(Ae(U)),be=C($),xe=R($,2),ae=C(xe);ee(()=>{Y(be,r(v)),Y(ae,r(i))}),A(F,U)},J=F=>{var U=Xt("Select a branch to merge");A(F,U)};H(M,F=>{r(v)!==null?F(z):F(J,!1)})}var Z=R(T,2),re=C(Z);re.__click=function(...F){var U;(U=e.onClose)==null||U.apply(this,F)};var se=R(re,2);se.__click=()=>void b();var G=C(se);{var O=F=>{var U=Xt("Merging...");A(F,U)},ie=F=>{var U=Xt("Merge");A(F,U)};H(G,F=>{r(_)?F(O):F(ie,!1)})}ee(()=>{Pe(se,1,`px-3 py-1.5 text-sm rounded font-semibold transition-colors
471
+ ${r(g)?"bg-success-emphasis text-text-on-emphasis hover:bg-success-emphasis/90":"bg-bg-tertiary text-text-placeholder cursor-not-allowed"}`),se.disabled=!r(g)}),A(W,Q)};H(V,W=>{r(a)?W(N):W(X,!1)})}A(t,u),Dt()}Ft(["click","keydown"]);var jw=I('<main class="flex-1 overflow-hidden"><!></main>'),Fw=I('<main class="flex-1 overflow-hidden"><!></main>'),Hw=I('<main class="flex-1 overflow-hidden"><!></main>'),Vw=I('<main class="flex-1 overflow-hidden"><!></main>'),Ww=I('<main class="flex-1 overflow-hidden"><!></main>'),Uw=I('<main class="flex-1 overflow-hidden"><!></main>'),zw=I('<main class="flex-1 overflow-hidden"><!></main>'),qw=I('<div class="flex flex-col h-[100dvh] bg-bg-primary text-text-primary"><!> <div class="flex flex-1 min-h-0 overflow-hidden"><!></div> <!> <!></div>');function Gw(t,e){Tt(e,!0);function i(){if(typeof window>"u")return!1;const ue=/iPhone|iPod|Android/i.test(navigator.userAgent),Ct=window.innerWidth<=480;return ue||Ct}function n(){if(typeof window>"u")return!1;const ue=navigator.userAgent,Ct=/iPhone|iPad|iPod/i.test(ue),Ht=/Android/i.test(ue),Gt=window.innerWidth<=768;return(Ct||Ht)&&Gt}let a=K(null),v=K(gt([])),_=K(null),s=K("full-file"),o=K("all"),h=K(gt(i()));const g=160,c=480,p=64;let w=K(gt(Hh({storageKey:"qraftbox-sidebar-width",min:g,max:c,fallback:256}))),m=K(!0),u=K(null),l=K(""),d=K(gt([])),f=K(gt(dh(window.location.hash))),y=K(gt([])),E=K(""),S=K(null),L=K(!1),x=K(!1),P=K(!1),B=K(!1),j=K(gt({runningCount:0,queuedCount:0,runningSessionIds:[],totalCount:0})),V=K(gt([])),N=K(gt([])),X=K(gt([])),W=null,Q=K(null),ne=K(gt(Sc())),le=K(!1),D=K(gt([]));const T=ge(()=>r(y).filter(ue=>!r(d).some(Ct=>Ct.path===ue.path))),M=ge(()=>n()?"Browse Host Directories...":"Choose on Host..."),z=ge(()=>r(y).map(ue=>({path:ue.path,name:ue.name,isGitRepo:ue.isGitRepo,lastOpened:Date.now()}))),J=ge(()=>{var ue;return r(a)!==null?((ue=r(d).find(Ct=>Ct.id===r(a)))==null?void 0:ue.isGitRepo)??!1:!1}),Z=ge(()=>r(_)!==null?r(v).find(ue=>ue.path===r(_))??null:r(v)[0]??null),re=ge(()=>r(Z)!==null?r(v).findIndex(ue=>ue.path===r(Z).path):-1),se=ge(()=>r(re)>0?()=>{const ue=r(v)[r(re)-1];ue!==void 0&&k(_,ue.path,!0)}:void 0),G=ge(()=>r(re)>=0&&r(re)<r(v).length-1?()=>{const ue=r(v)[r(re)+1];ue!==void 0&&k(_,ue.path,!0)}:void 0),O=ge(()=>uh(r(v)));let ie=K(null),F=K(!1),U=!1,$=K(!1),be=K(!1);const xe=ge(()=>new Map(r(v).map(ue=>[ue.path,ue.status==="renamed"?"modified":ue.status]))),ae=Vh({getContextId:()=>r(a),getAllFilesTree:()=>r(ie),setAllFilesTree:ue=>k(ie,ue,!0),getAllFilesTreeStale:()=>U,setAllFilesTreeStale:ue=>U=ue,setAllFilesLoading:ue=>k(F,ue,!0),getDiffStatusMap:()=>r(xe),setFileContent:ue=>k(Be,ue,!0),setFileContentLoading:ue=>k(Qe,ue,!0),getShowIgnored:()=>r($),getShowAllFiles:()=>r(be)}),{fetchAllFiles:he,refreshAllFiles:fe,handleDirectoryExpand:Ee,handleLoadFullTree:He,fetchFileContent:Le,getEffectiveViewMode:ce}=ae,Te=ge(()=>r(o)==="diff"?r(O):r(ie)!==null?ua(r(ie),r(xe)):r(O)),De=ge(()=>r(_)!==null&&r(v).some(ue=>ue.path===r(_))),pe=ge(()=>ce(r(De),r(s)));let Be=K(null),Qe=K(!1);const Ne=ge(()=>({totalFiles:r(v).length,additions:r(v).reduce((ue,Ct)=>ue+Ct.additions,0),deletions:r(v).reduce((ue,Ct)=>ue+Ct.deletions,0)}));let Me=async()=>{},Fe=async()=>{};const tt=Ih({getContextId:()=>r(a),setContextId:ue=>k(a,ue,!0),getProjectPath:()=>r(l),setProjectPath:ue=>k(l,ue,!0),getWorkspaceTabs:()=>r(d),setWorkspaceTabs:ue=>k(d,ue,!0),getCurrentScreen:()=>r(f),setCurrentScreen:ue=>k(f,ue,!0),setError:ue=>k(u,ue,!0),getRecentProjects:()=>r(y),setRecentProjects:ue=>k(y,ue,!0),setNewProjectPath:ue=>k(E,ue,!0),setNewProjectError:ue=>k(S,ue,!0),setNewProjectLoading:ue=>k(L,ue,!0),setPickingDirectory:ue=>k(x,ue,!0),setDirectoryPickerOpen:ue=>k(P,ue,!0),isMobileDirectoryPickerClient:()=>n(),setLoading:ue=>k(m,ue,!0),getFileTreeMode:()=>r(o),setFileTreeMode:ue=>k(o,ue,!0),setShowAllFiles:ue=>k(be,ue,!0),setDiffFiles:ue=>k(v,ue,!0),setSelectedPath:ue=>k(_,ue,!0),setAllFilesTree:ue=>k(ie,ue,!0),setAllFilesTreeStale:ue=>U=ue,setFileContent:ue=>k(Be,ue,!0),fetchAllFiles:he,fetchPromptQueue:()=>Me(),fetchActiveSessions:()=>Fe()}),{init:Ve,switchProject:Xe,closeProjectTab:Ue,fetchRecentProjects:Je,openProjectByPath:ve,openRecentProject:_e,removeRecentProject:Oe,pickDirectory:Ke,fetchDiff:nt,navigateToScreen:$e,handleHashChange:dt}=tt;function ut(ue){k(_,ue,!0)}function bt(ue){k(s,ue,!0)}function lt(){k(h,!r(h))}function ye(){k(h,!0)}function te(){k(w,Math.max(g,r(w)-p),!0),qa("qraftbox-sidebar-width",r(w))}function oe(){k(w,Math.min(c,r(w)+p),!0),qa("qraftbox-sidebar-width",r(w))}const me=Fh({getContextId:()=>r(a),getProjectPath:()=>r(l),getQraftAiSessionId:()=>r(ne),setQraftAiSessionId:ue=>k(ne,ue,!0),getRunningSessions:()=>r(V),setRunningSessions:ue=>k(V,ue,!0),getQueuedSessions:()=>r(N),setQueuedSessions:ue=>k(N,ue,!0),getRecentlyCompletedSessions:()=>r(X),setRecentlyCompletedSessions:ue=>k(X,ue,!0),getServerPromptQueue:()=>r(D),setServerPromptQueue:ue=>k(D,ue,!0),setQueueStatus:ue=>k(j,ue,!0),setResumeDisplaySessionId:ue=>k(Q,ue,!0),setSessionMessageSubmitted:ue=>k(le,ue,!0),navigateToScreen:$e}),{submitPrompt:Ie,fetchPromptQueue:we,fetchActiveSessions:Re,handleCancelActiveSession:je,handleCancelQueuedPrompt:Ye,handleResumeToChanges:rt,handleResumeCliSession:ht,handleNewSession:_t,hasActiveSessionWork:ct}=me;Me=we,Fe=Re;const kt=fh({getRunningSessions:()=>r(V),setRunningSessions:ue=>{k(V,ue,!0)},fetchActiveSessions:Re,fetchPromptQueue:we});function It(){ct()&&W===null?W=setInterval(()=>{we(),Re()},2e3):!ct()&&W!==null&&(clearInterval(W),W=null)}St(()=>{r(V).length,r(N).length,r(D).length,r(X).length,It()}),St(()=>{r(V).map(ue=>ue.id).join(","),kt.sync()});const Ze=ge(()=>r(v).map(ue=>ue.path));function at(ue){const Ct=ue.target instanceof HTMLInputElement||ue.target instanceof HTMLTextAreaElement;if(Ct&&ue.key==="Escape"){ue.target.blur();return}Ct||ue.key==="b"&&!ue.ctrlKey&&!ue.metaKey&&(ue.preventDefault(),lt())}const ft=Mh({getContextId:()=>r(a),getProjectPath:()=>r(l),getSelectedPath:()=>r(_),getFileTreeMode:()=>r(o),markAllFilesTreeStale:()=>{U=!0},fetchDiff:nt,refreshAllFiles:fe,fetchFileContent:Le,setPromptQueue:ue=>{k(D,ue,!0)},setQueueStatus:ue=>{k(j,ue,!0)},fetchActiveSessions:Re});St(()=>(Ve(),ft.connect(),window.addEventListener("keydown",at),window.addEventListener("hashchange",dt),()=>{window.removeEventListener("keydown",at),window.removeEventListener("hashchange",dt),ft.disconnect(),W!==null&&(clearInterval(W),W=null),kt.closeAll()})),St(()=>{r(_)!==null&&r(a)!==null&&(r(pe)==="full-file"||!r(De)&&r(o)==="all")?Le(r(a),r(_)):k(Be,null)}),St(()=>{r(f)==="files"&&i()&&k(h,!0)});var mt=qw(),xt=C(mt);{let ue=ge(()=>r(v).length>0);uv(xt,{get currentScreen(){return r(f)},get workspaceTabs(){return r(d)},get contextId(){return r(a)},get projectPath(){return r(l)},get activeTabIsGitRepo(){return r(J)},get hasChanges(){return r(ue)},get availableRecentProjects(){return r(T)},get newProjectPath(){return r(E)},get newProjectError(){return r(S)},get newProjectLoading(){return r(L)},get pickingDirectory(){return r(x)},get onNavigateToScreen(){return $e},get onSwitchProject(){return Xe},get onCloseProjectTab(){return Ue},get onFetchRecentProjects(){return Je},onNewProjectPathChange:Ct=>{k(E,Ct,!0),k(S,null)},get onOpenProjectByPath(){return ve},get onOpenRecentProject(){return _e},get onRemoveRecentProject(){return Oe},get onPickDirectory(){return Ke},get onWorktreeSwitch(){return Ve},onPushSuccess:async()=>{r(a)!==null&&await nt(r(a))}})}var pt=R(xt,2),it=C(pt);{var Et=ue=>{{let Ct=ge(()=>r(w)>g),Ht=ge(()=>r(w)<c),Gt=ge(()=>r(D).filter(Ot=>Ot.status==="queued")),Nt=ge(()=>!r(le));Ab(ue,{get activeTabIsGitRepo(){return r(J)},get loading(){return r(m)},get error(){return r(u)},get sidebarCollapsed(){return r(h)},get sidebarWidth(){return r(w)},get allFilesLoading(){return r(F)},get fileTree(){return r(Te)},get fileTreeMode(){return r(o)},get selectedPath(){return r(_)},get diffFiles(){return r(v)},get contextId(){return r(a)},get selectedFile(){return r(Z)},get effectiveViewMode(){return r(pe)},get selectedHasDiff(){return r(De)},get fileContentLoading(){return r(Qe)},get fileContent(){return r(Be)},get stats(){return r(Ne)},get navigatePrev(){return r(se)},get navigateNext(){return r(G)},get canNarrow(){return r(Ct)},get canWiden(){return r(Ht)},get queueStatus(){return r(j)},get changedFilePaths(){return r(Ze)},get projectPath(){return r(l)},get runningSessions(){return r(V)},get queuedSessions(){return r(N)},get recentlyCompletedSessions(){return r(X)},get pendingPrompts(){return r(Gt)},get resumeDisplaySessionId(){return r(Q)},get currentQraftAiSessionId(){return r(ne)},get isFirstMessage(){return r(Nt)},onToggleSidebar:lt,onFileSelect:ut,onFileTreeModeChange:Ot=>{k(o,Ot,!0),Ot==="all"&&r(a)!==null&&he(r(a))},get showIgnored(){return r($)},onShowIgnoredChange:Ot=>{k($,Ot,!0),k(ie,null),U=!0,r(a)!==null&&r(o)==="all"&&he(r(a))},get showAllFiles(){return r(be)},onShowAllFilesChange:Ot=>{k(be,Ot,!0),k(ie,null),U=!0,r(a)!==null&&r(o)==="all"&&he(r(a))},onReloadFileTree:()=>{r(a)!==null&&(nt(r(a)),r(o)==="all"&&(k(ie,null),U=!0,he(r(a))))},get onDirectoryExpand(){return Ee},get onLoadFullTree(){return He},onCollapseSidebar:ye,onNarrowSidebar:te,onWidenSidebar:oe,onSetViewMode:bt,get onSubmitPrompt(){return Ie},get onNewSession(){return _t},get onResumeCliSession(){return ht},get onCancelActiveSession(){return je},get onCancelQueuedPrompt(){return Ye}})}},Pt=ue=>{var Ct=et(),Ht=Ae(Ct);{var Gt=Ot=>{var ir=jw(),Br=C(ir);{var dr=ur=>{Sx(ur,{get contextId(){return r(a)},get isGitRepo(){return r(J)}})};H(Br,ur=>{r(a)!==null&&ur(dr)})}A(Ot,ir)},Nt=Ot=>{var ir=et(),Br=Ae(ir);{var dr=Sr=>{var Cr=Fw(),ti=C(Cr);{var ci=qr=>{Yy(qr,{get contextId(){return r(a)},get projectPath(){return r(l)},get onResumeToChanges(){return rt}})};H(ti,qr=>{r(a)!==null&&qr(ci)})}A(Sr,Cr)},ur=Sr=>{var Cr=et(),ti=Ae(Cr);{var ci=Nr=>{var de=Hw(),Ce=C(de);{var st=qe=>{Ix(qe,{get contextId(){return r(a)}})};H(Ce,qe=>{r(a)!==null&&qe(st)})}A(Nr,de)},qr=Nr=>{var de=et(),Ce=Ae(de);{var st=ot=>{var wt=Vw(),yt=C(wt);Nb(yt,{get pickingDirectory(){return r(x)},get newProjectLoading(){return r(L)},get newProjectPath(){return r(E)},get newProjectError(){return r(S)},get chooseDirectoryLabel(){return r(M)},get availableRecentProjects(){return r(T)},get onPickDirectory(){return Ke},onNewProjectPathChange:Rt=>{k(E,Rt,!0)},get onOpenProject(){return ve},get onOpenRecentProject(){return _e},get onRemoveRecentProject(){return Oe}}),A(ot,wt)},qe=ot=>{var wt=et(),yt=Ae(wt);{var Rt=Kt=>{var Yt=Ww(),hr=C(Yt);tw(hr,{}),A(Kt,Yt)},Vt=Kt=>{var Yt=et(),hr=Ae(Yt);{var Zt=fr=>{var ri=Uw(),bi=C(ri);bw(bi,{}),A(fr,ri)},tr=fr=>{var ri=et(),bi=Ae(ri);{var Di=yi=>{var dn=zw(),to=C(dn);Rw(to,{}),A(yi,dn)};H(bi,yi=>{r(f)==="model-config"&&yi(Di)},!0)}A(fr,ri)};H(hr,fr=>{r(f)==="system-info"?fr(Zt):fr(tr,!1)},!0)}A(Kt,Yt)};H(yt,Kt=>{r(f)==="tools"?Kt(Rt):Kt(Vt,!1)},!0)}A(ot,wt)};H(Ce,ot=>{r(f)==="project"?ot(st):ot(qe,!1)},!0)}A(Nr,de)};H(ti,Nr=>{r(f)==="terminal"?Nr(ci):Nr(qr,!1)},!0)}A(Sr,Cr)};H(Br,Sr=>{r(f)==="sessions"?Sr(dr):Sr(ur,!1)},!0)}A(Ot,ir)};H(Ht,Ot=>{r(f)==="commits"?Ot(Gt):Ot(Nt,!1)},!0)}A(ue,Ct)};H(it,ue=>{r(f)==="files"?ue(Et):ue(Pt,!1)})}var qt=R(pt,2);{var Wt=ue=>{Nw(ue,{get contextId(){return r(a)},onClose:()=>{k(B,!1)}})};H(qt,ue=>{r(B)&&r(a)!==null&&ue(Wt)})}var Lt=R(qt,2);Rv(Lt,{get isOpen(){return r(P)},get recentDirectories(){return r(z)},onClose:()=>{k(P,!1)},onSelect:ue=>{k(P,!1),ve(ue)}}),A(t,mt),Dt()}const Sl=document.getElementById("app");Sl!==null&&Ku(Gw,{target:Sl});