cyberneurova-cli 0.18.6

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 (390) hide show
  1. package/README.md +89 -0
  2. package/dist/main.mjs +2862 -0
  3. package/dist-web/assets/CodeBlockNode-B8Y2oNuu.js +22 -0
  4. package/dist-web/assets/CodeBlockShell.vue_vue_type_style_index_0_lang-Do0uyO8K.js +1 -0
  5. package/dist-web/assets/Tooltip-zyXUfva2.js +1 -0
  6. package/dist-web/assets/__vite-optional-peer-dep_stream-monaco_markstream-vue-BIHI7g3E.js +1 -0
  7. package/dist-web/assets/abap-BdImnpbu.js +1 -0
  8. package/dist-web/assets/actionscript-3-CoDkCxhg.js +1 -0
  9. package/dist-web/assets/ada-bCR0ucgS.js +1 -0
  10. package/dist-web/assets/andromeeda-C4gqWexZ.js +1 -0
  11. package/dist-web/assets/angular-html-DA-rfuFy.js +1 -0
  12. package/dist-web/assets/angular-ts-BrjP3tb8.js +1 -0
  13. package/dist-web/assets/apache-Pmp26Uib.js +1 -0
  14. package/dist-web/assets/apex-Dqspr-GT.js +1 -0
  15. package/dist-web/assets/apl-CORt7UWP.js +1 -0
  16. package/dist-web/assets/applescript-Co6uUVPk.js +1 -0
  17. package/dist-web/assets/ara-BRHolxvo.js +1 -0
  18. package/dist-web/assets/arc-BJUAsyr2.js +1 -0
  19. package/dist-web/assets/architectureDiagram-3BPJPVTR-DU1iQytb.js +36 -0
  20. package/dist-web/assets/asciidoc-Ve4PFQV2.js +1 -0
  21. package/dist-web/assets/asm-D_Q5rh1f.js +1 -0
  22. package/dist-web/assets/astro-HNnZUWAn.js +1 -0
  23. package/dist-web/assets/aurora-x-D-2ljcwZ.js +1 -0
  24. package/dist-web/assets/awk-DMzUqQB5.js +1 -0
  25. package/dist-web/assets/ayu-dark-DYE7WIF3.js +1 -0
  26. package/dist-web/assets/ayu-light-BA47KaF1.js +1 -0
  27. package/dist-web/assets/ayu-mirage-32ctXXKs.js +1 -0
  28. package/dist-web/assets/ballerina-BFfxhgS-.js +1 -0
  29. package/dist-web/assets/bat-BkioyH1T.js +1 -0
  30. package/dist-web/assets/beancount-k_qm7-4y.js +1 -0
  31. package/dist-web/assets/berry-uYugtg8r.js +1 -0
  32. package/dist-web/assets/bibtex-CHM0blh-.js +1 -0
  33. package/dist-web/assets/bicep-Bmn6On1c.js +1 -0
  34. package/dist-web/assets/bird2-BIv1doCn.js +1 -0
  35. package/dist-web/assets/blade-2xfisSek.js +1 -0
  36. package/dist-web/assets/blockDiagram-GPEHLZMM-CVQfmEx5.js +132 -0
  37. package/dist-web/assets/bsl-BO_Y6i37.js +1 -0
  38. package/dist-web/assets/c-BIGW1oBm.js +1 -0
  39. package/dist-web/assets/c3-MRO5bC_T.js +1 -0
  40. package/dist-web/assets/c4Diagram-AAUBKEIU-DQgOyZ83.js +10 -0
  41. package/dist-web/assets/cadence-Bv_4Rxtq.js +1 -0
  42. package/dist-web/assets/cairo-KRGpt6FW.js +1 -0
  43. package/dist-web/assets/catppuccin-frappe-DFWUc33u.js +1 -0
  44. package/dist-web/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
  45. package/dist-web/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
  46. package/dist-web/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
  47. package/dist-web/assets/channel-BkijXht1.js +1 -0
  48. package/dist-web/assets/chunk-2J33WTMH-Cf0K4OgM.js +1 -0
  49. package/dist-web/assets/chunk-4BX2VUAB-CfWW8OFA.js +1 -0
  50. package/dist-web/assets/chunk-55IACEB6-OMwu7QSn.js +1 -0
  51. package/dist-web/assets/chunk-727SXJPM-o-CXnTJH.js +206 -0
  52. package/dist-web/assets/chunk-AQP2D5EJ-Dkgu36A1.js +231 -0
  53. package/dist-web/assets/chunk-FMBD7UC4-BZRPNeGi.js +15 -0
  54. package/dist-web/assets/chunk-ND2GUHAM-B3mNSowR.js +1 -0
  55. package/dist-web/assets/chunk-QZHKN3VN-CpiKdzGR.js +1 -0
  56. package/dist-web/assets/clarity-D53aC0YG.js +1 -0
  57. package/dist-web/assets/classDiagram-4FO5ZUOK-D18f9T4M.js +1 -0
  58. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-D18f9T4M.js +1 -0
  59. package/dist-web/assets/clojure-P80f7IUj.js +1 -0
  60. package/dist-web/assets/cmake-D1j8_8rp.js +1 -0
  61. package/dist-web/assets/cobol-nBiQ_Alo.js +1 -0
  62. package/dist-web/assets/codeowners-Bp6g37R7.js +1 -0
  63. package/dist-web/assets/codeql-DsOJ9woJ.js +1 -0
  64. package/dist-web/assets/coffee-Ch7k5sss.js +1 -0
  65. package/dist-web/assets/common-lisp-Cg-RD9OK.js +1 -0
  66. package/dist-web/assets/coq-DkFqJrB1.js +1 -0
  67. package/dist-web/assets/cose-bilkent-S5V4N54A-B_-Th8am.js +1 -0
  68. package/dist-web/assets/cpp-UfJy6YNI.js +1 -0
  69. package/dist-web/assets/crystal-DGywbUpC.js +1 -0
  70. package/dist-web/assets/csharp-DSvCPggb.js +1 -0
  71. package/dist-web/assets/css-CLj8gQPS.js +1 -0
  72. package/dist-web/assets/csv-fuZLfV_i.js +1 -0
  73. package/dist-web/assets/cue-D82EKSYY.js +1 -0
  74. package/dist-web/assets/cypher-COkxafJQ.js +1 -0
  75. package/dist-web/assets/cytoscape.esm-nFXppDBa.js +331 -0
  76. package/dist-web/assets/d-85-TOEBH.js +1 -0
  77. package/dist-web/assets/d2_markstream-vue-yoD6TSFD.js +1 -0
  78. package/dist-web/assets/dagre-BM42HDAG-DVCnqMPO.js +4 -0
  79. package/dist-web/assets/dark-plus-C3mMm8J8.js +1 -0
  80. package/dist-web/assets/dart-bE4Kk8sk.js +1 -0
  81. package/dist-web/assets/dax-CEL-wOlO.js +1 -0
  82. package/dist-web/assets/defaultLocale-DX6XiGOO.js +1 -0
  83. package/dist-web/assets/desktop-BmXAJ9_W.js +1 -0
  84. package/dist-web/assets/diagram-2AECGRRQ-4GkP_Z8-.js +43 -0
  85. package/dist-web/assets/diagram-5GNKFQAL-B_rHqrH7.js +10 -0
  86. package/dist-web/assets/diagram-KO2AKTUF-C7a3J0ZX.js +3 -0
  87. package/dist-web/assets/diagram-LMA3HP47-CmAa6w7x.js +24 -0
  88. package/dist-web/assets/diagram-OG6HWLK6-FwNOxgd8.js +24 -0
  89. package/dist-web/assets/diff-D97Zzqfu.js +1 -0
  90. package/dist-web/assets/docker-BcOcwvcX.js +1 -0
  91. package/dist-web/assets/dotenv-Da5cRb03.js +1 -0
  92. package/dist-web/assets/dracula-BzJJZx-M.js +1 -0
  93. package/dist-web/assets/dracula-soft-BXkSAIEj.js +1 -0
  94. package/dist-web/assets/dream-maker-BtqSS_iP.js +1 -0
  95. package/dist-web/assets/edge-FbVlp4U3.js +1 -0
  96. package/dist-web/assets/elixir-CkH2-t6x.js +1 -0
  97. package/dist-web/assets/elm-DbKCFpqz.js +1 -0
  98. package/dist-web/assets/emacs-lisp-CXvaQtF9.js +1 -0
  99. package/dist-web/assets/erDiagram-TEJ5UH35-RfzqDcrr.js +85 -0
  100. package/dist-web/assets/erb-Dm6A9KJ5.js +1 -0
  101. package/dist-web/assets/erlang-DsQrWhSR.js +1 -0
  102. package/dist-web/assets/everforest-dark-BgDCqdQA.js +1 -0
  103. package/dist-web/assets/everforest-light-C8M2exoo.js +1 -0
  104. package/dist-web/assets/extended-p72mFE2C.js +1 -0
  105. package/dist-web/assets/fennel-BYunw83y.js +1 -0
  106. package/dist-web/assets/fish-BvzEVeQv.js +1 -0
  107. package/dist-web/assets/floating-ui.dom-CDU05fwN.js +1 -0
  108. package/dist-web/assets/flowDiagram-I6XJVG4X-Bvqxq_92.js +162 -0
  109. package/dist-web/assets/fluent-C4IJs8-o.js +1 -0
  110. package/dist-web/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
  111. package/dist-web/assets/fortran-free-form-BxgE0vQu.js +1 -0
  112. package/dist-web/assets/fsharp-CXgrBDvD.js +1 -0
  113. package/dist-web/assets/ganttDiagram-6RSMTGT7-BAcM7EWL.js +292 -0
  114. package/dist-web/assets/gdresource-BOOCDP_w.js +1 -0
  115. package/dist-web/assets/gdscript-C5YyOfLZ.js +1 -0
  116. package/dist-web/assets/gdshader-DkwncUOv.js +1 -0
  117. package/dist-web/assets/genie-D0YGMca9.js +1 -0
  118. package/dist-web/assets/gherkin-DyxjwDmM.js +1 -0
  119. package/dist-web/assets/git-commit-F4YmCXRG.js +1 -0
  120. package/dist-web/assets/git-rebase-r7XF79zn.js +1 -0
  121. package/dist-web/assets/gitGraphDiagram-PVQCEYII-CNxYPnL_.js +106 -0
  122. package/dist-web/assets/github-dark-DHJKELXO.js +1 -0
  123. package/dist-web/assets/github-dark-default-Cuk6v7N8.js +1 -0
  124. package/dist-web/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  125. package/dist-web/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  126. package/dist-web/assets/github-light-DAi9KRSo.js +1 -0
  127. package/dist-web/assets/github-light-default-D7oLnXFd.js +1 -0
  128. package/dist-web/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  129. package/dist-web/assets/gleam-BspZqrRM.js +1 -0
  130. package/dist-web/assets/glimmer-js-ByusRIyA.js +1 -0
  131. package/dist-web/assets/glimmer-ts-BfAWNZQY.js +1 -0
  132. package/dist-web/assets/glsl-DplSGwfg.js +1 -0
  133. package/dist-web/assets/gn-n2N0HUVH.js +1 -0
  134. package/dist-web/assets/gnuplot-DdkO51Og.js +1 -0
  135. package/dist-web/assets/go-C27-OAKa.js +1 -0
  136. package/dist-web/assets/graph--OzhPTMs.js +1 -0
  137. package/dist-web/assets/graphql-ChdNCCLP.js +1 -0
  138. package/dist-web/assets/groovy-gcz8RCvz.js +1 -0
  139. package/dist-web/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  140. package/dist-web/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  141. package/dist-web/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  142. package/dist-web/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  143. package/dist-web/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  144. package/dist-web/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  145. package/dist-web/assets/hack-DbPARsA_.js +1 -0
  146. package/dist-web/assets/haml-D5jkg6IW.js +1 -0
  147. package/dist-web/assets/handlebars-BpdQsYii.js +1 -0
  148. package/dist-web/assets/haskell-Df6bDoY_.js +1 -0
  149. package/dist-web/assets/haxe-CzTSHFRz.js +1 -0
  150. package/dist-web/assets/hcl-BWvSN4gD.js +1 -0
  151. package/dist-web/assets/hjson-D5-asLiD.js +1 -0
  152. package/dist-web/assets/hlsl-D3lLCCz7.js +1 -0
  153. package/dist-web/assets/horizon-BUw7H-hv.js +1 -0
  154. package/dist-web/assets/horizon-bright-CUuTKBJd.js +1 -0
  155. package/dist-web/assets/houston-DnULxvSX.js +1 -0
  156. package/dist-web/assets/html-derivative-DlHx6ybY.js +1 -0
  157. package/dist-web/assets/html-pp8916En.js +1 -0
  158. package/dist-web/assets/http-jrhK8wxY.js +1 -0
  159. package/dist-web/assets/hurl-irOxFIW8.js +1 -0
  160. package/dist-web/assets/hxml-Bvhsp5Yf.js +1 -0
  161. package/dist-web/assets/hy-DFXneXwc.js +1 -0
  162. package/dist-web/assets/imba-DGztddWO.js +1 -0
  163. package/dist-web/assets/index-BRZoK2Bt.js +268 -0
  164. package/dist-web/assets/index-CF_oa1Iu.js +9 -0
  165. package/dist-web/assets/index-CxRV4At0.js +153 -0
  166. package/dist-web/assets/index-Dln8eGab.css +1 -0
  167. package/dist-web/assets/index10-B0aiPYId.js +2 -0
  168. package/dist-web/assets/index11-C6AzIe5E.js +9 -0
  169. package/dist-web/assets/index5-dYV8YnTO.js +1 -0
  170. package/dist-web/assets/index6-B9V50-1S.js +1 -0
  171. package/dist-web/assets/index7-CiLYTYTe.js +1 -0
  172. package/dist-web/assets/index8-D_Ol5awT.js +2 -0
  173. package/dist-web/assets/infoDiagram-5YYISTIA-CDGwFFDK.js +2 -0
  174. package/dist-web/assets/ini-BEwlwnbL.js +1 -0
  175. package/dist-web/assets/init-Gi6I4Gst.js +1 -0
  176. package/dist-web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  177. package/dist-web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  178. package/dist-web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  179. package/dist-web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  180. package/dist-web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  181. package/dist-web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  182. package/dist-web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  183. package/dist-web/assets/ishikawaDiagram-YF4QCWOH-BSFxyXEn.js +70 -0
  184. package/dist-web/assets/java-CylS5w8V.js +1 -0
  185. package/dist-web/assets/javascript-wDzz0qaB.js +1 -0
  186. package/dist-web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  187. package/dist-web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  188. package/dist-web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  189. package/dist-web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  190. package/dist-web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  191. package/dist-web/assets/jinja-f2NsQr07.js +1 -0
  192. package/dist-web/assets/jison-wvAkD_A8.js +1 -0
  193. package/dist-web/assets/journeyDiagram-JHISSGLW-C11cX7et.js +139 -0
  194. package/dist-web/assets/json-Cp-IABpG.js +1 -0
  195. package/dist-web/assets/json5-C9tS-k6U.js +1 -0
  196. package/dist-web/assets/jsonc-Des-eS-w.js +1 -0
  197. package/dist-web/assets/jsonl-DcaNXYhu.js +1 -0
  198. package/dist-web/assets/jsonnet-DFQXde-d.js +1 -0
  199. package/dist-web/assets/jssm-C2t-YnRu.js +1 -0
  200. package/dist-web/assets/jsx-g9-lgVsj.js +1 -0
  201. package/dist-web/assets/julia-D7OTSIA_.js +1 -0
  202. package/dist-web/assets/just-CUsbIsdP.js +1 -0
  203. package/dist-web/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  204. package/dist-web/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  205. package/dist-web/assets/kanagawa-wave-DWedfzmr.js +1 -0
  206. package/dist-web/assets/kanban-definition-UN3LZRKU-7Jl1FST7.js +89 -0
  207. package/dist-web/assets/katex-HP8lGamR.js +257 -0
  208. package/dist-web/assets/kdl-DV7GczEv.js +1 -0
  209. package/dist-web/assets/kotlin-BdnUsdx6.js +1 -0
  210. package/dist-web/assets/kusto-wEQ09or8.js +1 -0
  211. package/dist-web/assets/laserwave-DUszq2jm.js +1 -0
  212. package/dist-web/assets/latex-CaSxy8MP.js +1 -0
  213. package/dist-web/assets/layout-SsrduOYp.js +1 -0
  214. package/dist-web/assets/lean-BZvkOJ9d.js +1 -0
  215. package/dist-web/assets/less-B1dDrJ26.js +1 -0
  216. package/dist-web/assets/light-plus-B7mTdjB0.js +1 -0
  217. package/dist-web/assets/linear-BmdB-kpR.js +1 -0
  218. package/dist-web/assets/liquid-C0sCDyMI.js +1 -0
  219. package/dist-web/assets/llvm-DjAJT7YJ.js +1 -0
  220. package/dist-web/assets/log-2UxHyX5q.js +1 -0
  221. package/dist-web/assets/logo-BtOb2qkB.js +1 -0
  222. package/dist-web/assets/lua-BaeVxFsk.js +1 -0
  223. package/dist-web/assets/luau-KW6xsasC.js +1 -0
  224. package/dist-web/assets/make-CHLpvVh8.js +1 -0
  225. package/dist-web/assets/markdown-Cvjx9yec.js +1 -0
  226. package/dist-web/assets/marko-DjSrsDqO.js +1 -0
  227. package/dist-web/assets/material-theme-D5KoaKCx.js +1 -0
  228. package/dist-web/assets/material-theme-darker-BfHTSMKl.js +1 -0
  229. package/dist-web/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  230. package/dist-web/assets/material-theme-ocean-CyktbL80.js +1 -0
  231. package/dist-web/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  232. package/dist-web/assets/matlab-D7o27uSR.js +1 -0
  233. package/dist-web/assets/mdc-DTYItulj.js +1 -0
  234. package/dist-web/assets/mdx-Cmh6b_Ma.js +1 -0
  235. package/dist-web/assets/mermaid-mWjccvbQ.js +1 -0
  236. package/dist-web/assets/mermaid.core-BjXzUp8P.js +309 -0
  237. package/dist-web/assets/mhchem-KEf2LMH_.js +1 -0
  238. package/dist-web/assets/min-dark-CafNBF8u.js +1 -0
  239. package/dist-web/assets/min-light-CTRr51gU.js +1 -0
  240. package/dist-web/assets/mindmap-definition-RKZ34NQL-LyjwnBUv.js +96 -0
  241. package/dist-web/assets/mipsasm-CKIfxQSi.js +1 -0
  242. package/dist-web/assets/mojo-rZm6bMo-.js +1 -0
  243. package/dist-web/assets/monokai-D4h5O-jR.js +1 -0
  244. package/dist-web/assets/moonbit-_H4v1dQx.js +1 -0
  245. package/dist-web/assets/move-IF9eRakj.js +1 -0
  246. package/dist-web/assets/narrat-DRg8JJMk.js +1 -0
  247. package/dist-web/assets/nextflow-C-mBbutL.js +1 -0
  248. package/dist-web/assets/nextflow-groovy-vE_lwT2v.js +1 -0
  249. package/dist-web/assets/nginx-BpAMiNFr.js +1 -0
  250. package/dist-web/assets/night-owl-C39BiMTA.js +1 -0
  251. package/dist-web/assets/night-owl-light-CMTm3GFP.js +1 -0
  252. package/dist-web/assets/nim-BIad80T-.js +1 -0
  253. package/dist-web/assets/nix-CwoSXNpI.js +1 -0
  254. package/dist-web/assets/nord-Ddv68eIx.js +1 -0
  255. package/dist-web/assets/nushell-Cz2AlsmD.js +1 -0
  256. package/dist-web/assets/objective-c-DXmwc3jG.js +1 -0
  257. package/dist-web/assets/objective-cpp-CLxacb5B.js +1 -0
  258. package/dist-web/assets/ocaml-C0hk2d4L.js +1 -0
  259. package/dist-web/assets/odin-BBf5iR-q.js +1 -0
  260. package/dist-web/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  261. package/dist-web/assets/one-light-C3Wv6jpd.js +1 -0
  262. package/dist-web/assets/openscad-C4EeE6gA.js +1 -0
  263. package/dist-web/assets/ordinal-Cboi1Yqb.js +1 -0
  264. package/dist-web/assets/pascal-D93ZcfNL.js +1 -0
  265. package/dist-web/assets/perl-B9cMNwum.js +1 -0
  266. package/dist-web/assets/php-Csjmro_R.js +1 -0
  267. package/dist-web/assets/pieDiagram-4H26LBE5-DyAS4l4B.js +30 -0
  268. package/dist-web/assets/pkl-u5AG7uiY.js +1 -0
  269. package/dist-web/assets/plastic-3e1v2bzS.js +1 -0
  270. package/dist-web/assets/plsql-ChMvpjG-.js +1 -0
  271. package/dist-web/assets/po-BTJTHyun.js +1 -0
  272. package/dist-web/assets/poimandres-CS3Unz2-.js +1 -0
  273. package/dist-web/assets/polar-C0HS_06l.js +1 -0
  274. package/dist-web/assets/postcss-CXtECtnM.js +1 -0
  275. package/dist-web/assets/powerquery-CEu0bR-o.js +1 -0
  276. package/dist-web/assets/powershell-Dpen1YoG.js +1 -0
  277. package/dist-web/assets/prisma-Dd19v3D-.js +1 -0
  278. package/dist-web/assets/prolog-CbFg5uaA.js +1 -0
  279. package/dist-web/assets/proto-C7zT0LnQ.js +1 -0
  280. package/dist-web/assets/pug-DKIMFp6K.js +1 -0
  281. package/dist-web/assets/puppet-BMWR74SV.js +1 -0
  282. package/dist-web/assets/purescript-CklMAg4u.js +1 -0
  283. package/dist-web/assets/python-B6aJPvgy.js +1 -0
  284. package/dist-web/assets/qml-3beO22l8.js +1 -0
  285. package/dist-web/assets/qmldir-C8lEn-DE.js +1 -0
  286. package/dist-web/assets/qss-IeuSbFQv.js +1 -0
  287. package/dist-web/assets/quadrantDiagram-W4KKPZXB-C_Y8Mcwc.js +7 -0
  288. package/dist-web/assets/r-Dspwwk_N.js +1 -0
  289. package/dist-web/assets/racket-BqYA7rlc.js +1 -0
  290. package/dist-web/assets/raku-DXvB9xmW.js +1 -0
  291. package/dist-web/assets/razor-BjBPvh-w.js +1 -0
  292. package/dist-web/assets/red-bN70gL4F.js +1 -0
  293. package/dist-web/assets/reg-C-SQnVFl.js +1 -0
  294. package/dist-web/assets/regexp-CDVJQ6XC.js +1 -0
  295. package/dist-web/assets/rel-C3B-1QV4.js +1 -0
  296. package/dist-web/assets/requirementDiagram-4Y6WPE33-Bo4bU8o3.js +84 -0
  297. package/dist-web/assets/riscv-BM1_JUlF.js +1 -0
  298. package/dist-web/assets/ron-D8l8udqQ.js +1 -0
  299. package/dist-web/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
  300. package/dist-web/assets/rose-pine-moon-D4_iv3hh.js +1 -0
  301. package/dist-web/assets/rose-pine-qdsjHGoJ.js +1 -0
  302. package/dist-web/assets/rosmsg-BJDFO7_C.js +1 -0
  303. package/dist-web/assets/rst-CpCqk9r5.js +1 -0
  304. package/dist-web/assets/ruby-DyJCeAvU.js +1 -0
  305. package/dist-web/assets/rust-B1yitclQ.js +1 -0
  306. package/dist-web/assets/safeRaf-DGuzXxDK.js +1 -0
  307. package/dist-web/assets/sankeyDiagram-5OEKKPKP-D9ngtT72.js +40 -0
  308. package/dist-web/assets/sas-DEy46yEz.js +1 -0
  309. package/dist-web/assets/sass-Cj5Yp3dK.js +1 -0
  310. package/dist-web/assets/scala-C151Ov-r.js +1 -0
  311. package/dist-web/assets/scheme-C98Dy4si.js +1 -0
  312. package/dist-web/assets/scss-D5BDwBP9.js +1 -0
  313. package/dist-web/assets/sdbl-DVxCFoDh.js +1 -0
  314. package/dist-web/assets/sequenceDiagram-3UESZ5HK-CAlXKi6Y.js +162 -0
  315. package/dist-web/assets/shaderlab-Dg9Lc6iA.js +1 -0
  316. package/dist-web/assets/shellscript-Yzrsuije.js +1 -0
  317. package/dist-web/assets/shellsession-BADoaaVG.js +1 -0
  318. package/dist-web/assets/slack-dark-BthQWCQV.js +1 -0
  319. package/dist-web/assets/slack-ochin-DqwNpetd.js +1 -0
  320. package/dist-web/assets/smalltalk-BERRCDM3.js +1 -0
  321. package/dist-web/assets/snazzy-light-Bw305WKR.js +1 -0
  322. package/dist-web/assets/solarized-dark-DXbdFlpD.js +1 -0
  323. package/dist-web/assets/solarized-light-L9t79GZl.js +1 -0
  324. package/dist-web/assets/solidity-rGO070M0.js +1 -0
  325. package/dist-web/assets/soy-8wufbnw4.js +1 -0
  326. package/dist-web/assets/sparql-rVzFXLq3.js +1 -0
  327. package/dist-web/assets/splunk-BtCnVYZw.js +1 -0
  328. package/dist-web/assets/sql-CRqJ_cUM.js +1 -0
  329. package/dist-web/assets/ssh-config-_ykCGR6B.js +1 -0
  330. package/dist-web/assets/stata-DI20mbqo.js +1 -0
  331. package/dist-web/assets/stateDiagram-AJRCARHV-DWrju2e4.js +1 -0
  332. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-DK0UKOjw.js +1 -0
  333. package/dist-web/assets/stylus-BEDo0Tqx.js +1 -0
  334. package/dist-web/assets/surrealql-Bq5Q-fJD.js +1 -0
  335. package/dist-web/assets/svelte-Cy7k_4gC.js +1 -0
  336. package/dist-web/assets/swift-D82vCrfD.js +1 -0
  337. package/dist-web/assets/synthwave-84-CbfX1IO0.js +1 -0
  338. package/dist-web/assets/system-verilog-CnnmHF94.js +1 -0
  339. package/dist-web/assets/systemd-4A_iFExJ.js +1 -0
  340. package/dist-web/assets/talonscript-CkByrt1z.js +1 -0
  341. package/dist-web/assets/tasl-QIJgUcNo.js +1 -0
  342. package/dist-web/assets/tcl-dwOrl1Do.js +1 -0
  343. package/dist-web/assets/templ-DhtptRzy.js +1 -0
  344. package/dist-web/assets/terraform-BETggiCN.js +1 -0
  345. package/dist-web/assets/tex-idrVyKtj.js +1 -0
  346. package/dist-web/assets/timeline-definition-PNZ67QCA-Fb6GavQ2.js +120 -0
  347. package/dist-web/assets/tokyo-night-hegEt444.js +1 -0
  348. package/dist-web/assets/toml-vGWfd6FD.js +1 -0
  349. package/dist-web/assets/ts-tags-D351s5mN.js +1 -0
  350. package/dist-web/assets/tsv-B_m7g4N7.js +1 -0
  351. package/dist-web/assets/tsx-COt5Ahok.js +1 -0
  352. package/dist-web/assets/turtle-BsS91CYL.js +1 -0
  353. package/dist-web/assets/twig-CW1WmMYd.js +1 -0
  354. package/dist-web/assets/typescript-BPQ3VLAy.js +1 -0
  355. package/dist-web/assets/typespec-CAFt9gP4.js +1 -0
  356. package/dist-web/assets/typst-DHCkPAjA.js +1 -0
  357. package/dist-web/assets/v-BcVCzyr7.js +1 -0
  358. package/dist-web/assets/vala-CsfeWuGM.js +1 -0
  359. package/dist-web/assets/vb-D17OF-Vu.js +1 -0
  360. package/dist-web/assets/vennDiagram-CIIHVFJN-PhAEb_0s.js +34 -0
  361. package/dist-web/assets/verilog-BQ8w6xss.js +1 -0
  362. package/dist-web/assets/vesper-DRje8inN.js +1 -0
  363. package/dist-web/assets/vhdl-CeAyd5Ju.js +1 -0
  364. package/dist-web/assets/viml-CJc9bBzg.js +1 -0
  365. package/dist-web/assets/vitesse-black-Bkuqu6BP.js +1 -0
  366. package/dist-web/assets/vitesse-dark-D0r3Knsf.js +1 -0
  367. package/dist-web/assets/vitesse-light-CVO1_9PV.js +1 -0
  368. package/dist-web/assets/vue-D2xRrEX4.js +1 -0
  369. package/dist-web/assets/vue-html-AaS7Mt5G.js +1 -0
  370. package/dist-web/assets/vue-vine-BoDAl6tE.js +1 -0
  371. package/dist-web/assets/vue.runtime.esm-bundler-DbtxAc5S.js +5 -0
  372. package/dist-web/assets/vyper-CDx5xZoG.js +1 -0
  373. package/dist-web/assets/wardley-L42UT6IY-Dsg2hLh7.js +173 -0
  374. package/dist-web/assets/wardleyDiagram-YWT4CUSO-DZTM8SAm.js +78 -0
  375. package/dist-web/assets/wasm-CG6Dc4jp.js +1 -0
  376. package/dist-web/assets/wasm-MzD3tlZU.js +1 -0
  377. package/dist-web/assets/wenyan-BV7otONQ.js +1 -0
  378. package/dist-web/assets/wgsl-Dx-B1_4e.js +1 -0
  379. package/dist-web/assets/wikitext-BhOHFoWU.js +1 -0
  380. package/dist-web/assets/wit-5i3qLPDT.js +1 -0
  381. package/dist-web/assets/wolfram-lXgVvXCa.js +1 -0
  382. package/dist-web/assets/xml-sdJ4AIDG.js +1 -0
  383. package/dist-web/assets/xsl-CtQFsRM5.js +1 -0
  384. package/dist-web/assets/xychartDiagram-2RQKCTM6-D5-UgsuI.js +7 -0
  385. package/dist-web/assets/yaml-Buea-lGh.js +1 -0
  386. package/dist-web/assets/zenscript-DVFEvuxE.js +1 -0
  387. package/dist-web/assets/zig-VOosw3JB.js +1 -0
  388. package/dist-web/favicon.ico +0 -0
  389. package/dist-web/index.html +35 -0
  390. package/package.json +108 -0
@@ -0,0 +1,268 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-KEf2LMH_.js","assets/katex-HP8lGamR.js","assets/CodeBlockNode-B8Y2oNuu.js","assets/safeRaf-DGuzXxDK.js","assets/CodeBlockShell.vue_vue_type_style_index_0_lang-Do0uyO8K.js","assets/index8-D_Ol5awT.js","assets/index11-C6AzIe5E.js"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();/**
3
+ * @vue/shared v3.5.35
4
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
+ * @license MIT
6
+ **/function jf(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Tt={},zl=[],So=()=>{},Qw=()=>!1,eu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),zf=e=>e.startsWith("onUpdate:"),Gt=Object.assign,w1=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},EM=Object.prototype.hasOwnProperty,Bt=(e,t)=>EM.call(e,t),it=Array.isArray,Vl=e=>ma(e)==="[object Map]",ll=e=>ma(e)==="[object Set]",fy=e=>ma(e)==="[object Date]",IM=e=>ma(e)==="[object RegExp]",gt=e=>typeof e=="function",Zt=e=>typeof e=="string",eo=e=>typeof e=="symbol",Ft=e=>e!==null&&typeof e=="object",S1=e=>(Ft(e)||gt(e))&&gt(e.then)&&gt(e.catch),Jw=Object.prototype.toString,ma=e=>Jw.call(e),$M=e=>ma(e).slice(8,-1),Vf=e=>ma(e)==="[object Object]",Kf=e=>Zt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Jr=jf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gf=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},NM=/-\w/g,In=Gf(e=>e.replace(NM,t=>t.slice(1).toUpperCase())),LM=/\B([A-Z])/g,As=Gf(e=>e.replace(LM,"-$1").toLowerCase()),Yf=Gf(e=>e.charAt(0).toUpperCase()+e.slice(1)),bd=Gf(e=>e?`on${Yf(e)}`:""),Un=(e,t)=>!Object.is(e,t),Kl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},e2=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Xf=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Fd=e=>{const t=Zt(e)?Number(e):NaN;return isNaN(t)?e:t};let hy;const Zf=()=>hy||(hy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),OM="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",RM=jf(OM);function $t(e){if(it(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Zt(s)?FM(s):$t(s);if(o)for(const i in o)t[i]=o[i]}return t}else if(Zt(e)||Ft(e))return e}const PM=/;(?![^(]*\))/g,DM=/:([^]+)/,BM=/\/\*[^]*?\*\//g;function FM(e){const t={};return e.replace(BM,"").split(PM).forEach(n=>{if(n){const s=n.split(DM);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Ee(e){let t="";if(Zt(e))t=e;else if(it(e))for(let n=0;n<e.length;n++){const s=Ee(e[n]);s&&(t+=s+" ")}else if(Ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function dde(e){if(!e)return null;let{class:t,style:n}=e;return t&&!Zt(t)&&(e.class=Ee(t)),n&&(e.style=$t(n)),e}const HM="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",WM=jf(HM);function t2(e){return!!e||e===""}function UM(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=xi(e[s],t[s]);return n}function xi(e,t){if(e===t)return!0;let n=fy(e),s=fy(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=eo(e),s=eo(t),n||s)return e===t;if(n=it(e),s=it(t),n||s)return n&&s?UM(e,t):!1;if(n=Ft(e),s=Ft(t),n||s){if(!n||!s)return!1;const o=Object.keys(e).length,i=Object.keys(t).length;if(o!==i)return!1;for(const r in e){const l=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(l&&!a||!l&&a||!xi(e[r],t[r]))return!1}}return String(e)===String(t)}function Qf(e,t){return e.findIndex(n=>xi(n,t))}const n2=e=>!!(e&&e.__v_isRef===!0),N=e=>Zt(e)?e:e==null?"":it(e)||Ft(e)&&(e.toString===Jw||!gt(e.toString))?n2(e)?N(e.value):JSON.stringify(e,s2,2):String(e),s2=(e,t)=>n2(t)?s2(e,t.value):Vl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],i)=>(n[qp(s,i)+" =>"]=o,n),{})}:ll(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>qp(n))}:eo(t)?qp(t):Ft(t)&&!it(t)&&!Vf(t)?String(t):t,qp=(e,t="")=>{var n;return eo(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function qM(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/**
7
+ * @vue/reactivity v3.5.35
8
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
+ * @license MIT
10
+ **/let En;class o2{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&En&&(En.active?(this.parent=En,this.index=(En.scopes||(En.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=En;try{return En=this,t()}finally{En=n}}}on(){++this._on===1&&(this.prevScope=En,En=this)}off(){if(this._on>0&&--this._on===0){if(En===this)En=this.prevScope;else{let t=En;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function jM(e){return new o2(e)}function C1(){return En}function x1(e,t=!1){En&&En.cleanups.push(e)}let nn;const jp=new WeakSet;class Hd{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,En&&(En.active?En.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,jp.has(this)&&(jp.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||r2(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,py(this),l2(this);const t=nn,n=Oo;nn=this,Oo=!0;try{return this.fn()}finally{a2(this),nn=t,Oo=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)A1(t);this.deps=this.depsTail=void 0,py(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?jp.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){eg(this)&&this.run()}get dirty(){return eg(this)}}let i2=0,hc,pc;function r2(e,t=!1){if(e.flags|=8,t){e.next=pc,pc=e;return}e.next=hc,hc=e}function T1(){i2++}function M1(){if(--i2>0)return;if(pc){let t=pc;for(pc=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;hc;){let t=hc;for(hc=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function l2(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function a2(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),A1(s),zM(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function eg(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(c2(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function c2(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===$c)||(e.globalVersion=$c,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!eg(e))))return;e.flags|=2;const t=e.dep,n=nn,s=Oo;nn=e,Oo=!0;try{l2(e);const o=e.fn(e._value);(t.version===0||Un(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{nn=n,Oo=s,a2(e),e.flags&=-3}}function A1(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)A1(i,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function zM(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function fde(e,t){e.effect instanceof Hd&&(e=e.effect.fn);const n=new Hd(e);t&&Gt(n,t);try{n.run()}catch(o){throw n.stop(),o}const s=n.run.bind(n);return s.effect=n,s}function hde(e){e.effect.stop()}let Oo=!0;const u2=[];function Ti(){u2.push(Oo),Oo=!1}function Mi(){const e=u2.pop();Oo=e===void 0?!0:e}function py(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=nn;nn=void 0;try{t()}finally{nn=n}}}let $c=0;class VM{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Jf{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!nn||!Oo||nn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==nn)n=this.activeLink=new VM(nn,this),nn.deps?(n.prevDep=nn.depsTail,nn.depsTail.nextDep=n,nn.depsTail=n):nn.deps=nn.depsTail=n,d2(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=nn.depsTail,n.nextDep=void 0,nn.depsTail.nextDep=n,nn.depsTail=n,nn.deps===n&&(nn.deps=s)}return n}trigger(t){this.version++,$c++,this.notify(t)}notify(t){T1();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{M1()}}}function d2(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)d2(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Wd=new WeakMap,el=Symbol(""),tg=Symbol(""),Nc=Symbol("");function ns(e,t,n){if(Oo&&nn){let s=Wd.get(e);s||Wd.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Jf),o.map=s,o.key=n),o.track()}}function vi(e,t,n,s,o,i){const r=Wd.get(e);if(!r){$c++;return}const l=a=>{a&&a.trigger()};if(T1(),t==="clear")r.forEach(l);else{const a=it(e),c=a&&Kf(n);if(a&&n==="length"){const u=Number(s);r.forEach((d,p)=>{(p==="length"||p===Nc||!eo(p)&&p>=u)&&l(d)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),c&&l(r.get(Nc)),t){case"add":a?c&&l(r.get("length")):(l(r.get(el)),Vl(e)&&l(r.get(tg)));break;case"delete":a||(l(r.get(el)),Vl(e)&&l(r.get(tg)));break;case"set":Vl(e)&&l(r.get(el));break}}M1()}function KM(e,t){const n=Wd.get(e);return n&&n.get(t)}function Al(e){const t=It(e);return t===e?t:(ns(t,"iterate",Nc),Gs(e)?t:t.map(Ro))}function eh(e){return ns(e=It(e),"iterate",Nc),e}function Xo(e,t){return Ai(e)?aa(or(e)?Ro(t):t):Ro(t)}const GM={__proto__:null,[Symbol.iterator](){return zp(this,Symbol.iterator,e=>Xo(this,e))},concat(...e){return Al(this).concat(...e.map(t=>it(t)?Al(t):t))},entries(){return zp(this,"entries",e=>(e[1]=Xo(this,e[1]),e))},every(e,t){return fi(this,"every",e,t,void 0,arguments)},filter(e,t){return fi(this,"filter",e,t,n=>n.map(s=>Xo(this,s)),arguments)},find(e,t){return fi(this,"find",e,t,n=>Xo(this,n),arguments)},findIndex(e,t){return fi(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return fi(this,"findLast",e,t,n=>Xo(this,n),arguments)},findLastIndex(e,t){return fi(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return fi(this,"forEach",e,t,void 0,arguments)},includes(...e){return Vp(this,"includes",e)},indexOf(...e){return Vp(this,"indexOf",e)},join(e){return Al(this).join(e)},lastIndexOf(...e){return Vp(this,"lastIndexOf",e)},map(e,t){return fi(this,"map",e,t,void 0,arguments)},pop(){return Va(this,"pop")},push(...e){return Va(this,"push",e)},reduce(e,...t){return my(this,"reduce",e,t)},reduceRight(e,...t){return my(this,"reduceRight",e,t)},shift(){return Va(this,"shift")},some(e,t){return fi(this,"some",e,t,void 0,arguments)},splice(...e){return Va(this,"splice",e)},toReversed(){return Al(this).toReversed()},toSorted(e){return Al(this).toSorted(e)},toSpliced(...e){return Al(this).toSpliced(...e)},unshift(...e){return Va(this,"unshift",e)},values(){return zp(this,"values",e=>Xo(this,e))}};function zp(e,t,n){const s=eh(e),o=s[t]();return s!==e&&!Gs(e)&&(o._next=o.next,o.next=()=>{const i=o._next();return i.done||(i.value=n(i.value)),i}),o}const YM=Array.prototype;function fi(e,t,n,s,o,i){const r=eh(e),l=r!==e&&!Gs(e),a=r[t];if(a!==YM[t]){const d=a.apply(e,i);return l?Ro(d):d}let c=n;r!==e&&(l?c=function(d,p){return n.call(this,Xo(e,d),p,e)}:n.length>2&&(c=function(d,p){return n.call(this,d,p,e)}));const u=a.call(r,c,s);return l&&o?o(u):u}function my(e,t,n,s){const o=eh(e),i=o!==e&&!Gs(e);let r=n,l=!1;o!==e&&(i?(l=s.length===0,r=function(c,u,d){return l&&(l=!1,c=Xo(e,c)),n.call(this,c,Xo(e,u),d,e)}):n.length>3&&(r=function(c,u,d){return n.call(this,c,u,d,e)}));const a=o[t](r,...s);return l?Xo(e,a):a}function Vp(e,t,n){const s=It(e);ns(s,"iterate",Nc);const o=s[t](...n);return(o===-1||o===!1)&&sh(n[0])?(n[0]=It(n[0]),s[t](...n)):o}function Va(e,t,n=[]){Ti(),T1();const s=It(e)[t].apply(e,n);return M1(),Mi(),s}const XM=jf("__proto__,__v_isRef,__isVue"),f2=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(eo));function ZM(e){eo(e)||(e=String(e));const t=It(this);return ns(t,"has",e),t.hasOwnProperty(e)}class h2{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return i;if(n==="__v_raw")return s===(o?i?k2:y2:i?v2:g2).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=it(t);if(!o){let a;if(r&&(a=GM[n]))return a;if(n==="hasOwnProperty")return ZM}const l=Reflect.get(t,n,Cn(t)?t:s);if((eo(n)?f2.has(n):XM(n))||(o||ns(t,"get",n),i))return l;if(Cn(l)){const a=r&&Kf(n)?l:l.value;return o&&Ft(a)?Ud(a):a}return Ft(l)?o?Ud(l):Vs(l):l}}class p2 extends h2{constructor(t=!1){super(!1,t)}set(t,n,s,o){let i=t[n];const r=it(t)&&Kf(n);if(!this._isShallow){const c=Ai(i);if(!Gs(s)&&!Ai(s)&&(i=It(i),s=It(s)),!r&&Cn(i)&&!Cn(s))return c||(i.value=s),!0}const l=r?Number(n)<t.length:Bt(t,n),a=Reflect.set(t,n,s,Cn(t)?t:o);return t===It(o)&&(l?Un(s,i)&&vi(t,"set",n,s):vi(t,"add",n,s)),a}deleteProperty(t,n){const s=Bt(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&vi(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!eo(n)||!f2.has(n))&&ns(t,"has",n),s}ownKeys(t){return ns(t,"iterate",it(t)?"length":el),Reflect.ownKeys(t)}}class m2 extends h2{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const QM=new p2,JM=new m2,eA=new p2(!0),tA=new m2(!0),ng=e=>e,Wu=e=>Reflect.getPrototypeOf(e);function nA(e,t,n){return function(...s){const o=this.__v_raw,i=It(o),r=Vl(i),l=e==="entries"||e===Symbol.iterator&&r,a=e==="keys"&&r,c=o[e](...s),u=n?ng:t?aa:Ro;return!t&&ns(i,"iterate",a?tg:el),Gt(Object.create(c),{next(){const{value:d,done:p}=c.next();return p?{value:d,done:p}:{value:l?[u(d[0]),u(d[1])]:u(d),done:p}}})}}function Uu(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function sA(e,t){const n={get(o){const i=this.__v_raw,r=It(i),l=It(o);e||(Un(o,l)&&ns(r,"get",o),ns(r,"get",l));const{has:a}=Wu(r),c=t?ng:e?aa:Ro;if(a.call(r,o))return c(i.get(o));if(a.call(r,l))return c(i.get(l));i!==r&&i.get(o)},get size(){const o=this.__v_raw;return!e&&ns(It(o),"iterate",el),o.size},has(o){const i=this.__v_raw,r=It(i),l=It(o);return e||(Un(o,l)&&ns(r,"has",o),ns(r,"has",l)),o===l?i.has(o):i.has(o)||i.has(l)},forEach(o,i){const r=this,l=r.__v_raw,a=It(l),c=t?ng:e?aa:Ro;return!e&&ns(a,"iterate",el),l.forEach((u,d)=>o.call(i,c(u),c(d),r))}};return Gt(n,e?{add:Uu("add"),set:Uu("set"),delete:Uu("delete"),clear:Uu("clear")}:{add(o){const i=It(this),r=Wu(i),l=It(o),a=!t&&!Gs(o)&&!Ai(o)?l:o;return r.has.call(i,a)||Un(o,a)&&r.has.call(i,o)||Un(l,a)&&r.has.call(i,l)||(i.add(a),vi(i,"add",a,a)),this},set(o,i){!t&&!Gs(i)&&!Ai(i)&&(i=It(i));const r=It(this),{has:l,get:a}=Wu(r);let c=l.call(r,o);c||(o=It(o),c=l.call(r,o));const u=a.call(r,o);return r.set(o,i),c?Un(i,u)&&vi(r,"set",o,i):vi(r,"add",o,i),this},delete(o){const i=It(this),{has:r,get:l}=Wu(i);let a=r.call(i,o);a||(o=It(o),a=r.call(i,o)),l&&l.call(i,o);const c=i.delete(o);return a&&vi(i,"delete",o,void 0),c},clear(){const o=It(this),i=o.size!==0,r=o.clear();return i&&vi(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=nA(o,e,t)}),n}function th(e,t){const n=sA(e,t);return(s,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(Bt(n,o)&&o in s?n:s,o,i)}const oA={get:th(!1,!1)},iA={get:th(!1,!0)},rA={get:th(!0,!1)},lA={get:th(!0,!0)},g2=new WeakMap,v2=new WeakMap,y2=new WeakMap,k2=new WeakMap;function aA(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Vs(e){return Ai(e)?e:nh(e,!1,QM,oA,g2)}function cA(e){return nh(e,!1,eA,iA,v2)}function Ud(e){return nh(e,!0,JM,rA,y2)}function pde(e){return nh(e,!0,tA,lA,k2)}function nh(e,t,n,s,o){if(!Ft(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const i=o.get(e);if(i)return i;const r=aA($M(e));if(r===0)return e;const l=new Proxy(e,r===2?s:n);return o.set(e,l),l}function or(e){return Ai(e)?or(e.__v_raw):!!(e&&e.__v_isReactive)}function Ai(e){return!!(e&&e.__v_isReadonly)}function Gs(e){return!!(e&&e.__v_isShallow)}function sh(e){return e?!!e.__v_raw:!1}function It(e){const t=e&&e.__v_raw;return t?It(t):e}function tr(e){return!Bt(e,"__v_skip")&&Object.isExtensible(e)&&e2(e,"__v_skip",!0),e}const Ro=e=>Ft(e)?Vs(e):e,aa=e=>Ft(e)?Ud(e):e;function Cn(e){return e?e.__v_isRef===!0:!1}function te(e){return b2(e,!1)}function al(e){return b2(e,!0)}function b2(e,t){return Cn(e)?e:new uA(e,t)}class uA{constructor(t,n){this.dep=new Jf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:It(t),this._value=n?t:Ro(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||Gs(t)||Ai(t);t=s?t:It(t),Un(t,n)&&(this._rawValue=t,this._value=s?t:Ro(t),this.dep.trigger())}}function mde(e){e.dep&&e.dep.trigger()}function M(e){return Cn(e)?e.value:e}function gde(e){return gt(e)?e():M(e)}const dA={get:(e,t,n)=>t==="__v_raw"?e:M(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Cn(o)&&!Cn(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function _2(e){return or(e)?e:new Proxy(e,dA)}class fA{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Jf,{get:s,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=s,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function hA(e){return new fA(e)}function vde(e){const t=it(e)?new Array(e.length):{};for(const n in e)t[n]=w2(e,n);return t}class pA{constructor(t,n,s){this._object=t,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._key=eo(n)?n:String(n),this._raw=It(t);let o=!0,i=t;if(!it(t)||eo(this._key)||!Kf(this._key))do o=!sh(i)||Gs(i);while(o&&(i=i.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=M(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Cn(this._raw[this._key])){const n=this._object[this._key];if(Cn(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return KM(this._raw,this._key)}}class mA{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function yde(e,t,n){return Cn(e)?e:gt(e)?new mA(e):Ft(e)&&arguments.length>1?w2(e,t,n):te(e)}function w2(e,t,n){return new pA(e,t,n)}class gA{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Jf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$c-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&nn!==this)return r2(this,!0),!0}get value(){const t=this.dep.track();return c2(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function vA(e,t,n=!1){let s,o;return gt(e)?s=e:(s=e.get,o=e.set),new gA(s,o,n)}const kde={GET:"get",HAS:"has",ITERATE:"iterate"},bde={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},qu={},qd=new WeakMap;let Xi;function _de(){return Xi}function yA(e,t=!1,n=Xi){if(n){let s=qd.get(n);s||qd.set(n,s=[]),s.push(e)}}function kA(e,t,n=Tt){const{immediate:s,deep:o,once:i,scheduler:r,augmentJob:l,call:a}=n,c=y=>o?y:Gs(y)||o===!1||o===0?yi(y,1):yi(y);let u,d,p,m,f=!1,v=!1;if(Cn(e)?(d=()=>e.value,f=Gs(e)):or(e)?(d=()=>c(e),f=!0):it(e)?(v=!0,f=e.some(y=>or(y)||Gs(y)),d=()=>e.map(y=>{if(Cn(y))return y.value;if(or(y))return c(y);if(gt(y))return a?a(y,2):y()})):gt(e)?t?d=a?()=>a(e,2):e:d=()=>{if(p){Ti();try{p()}finally{Mi()}}const y=Xi;Xi=u;try{return a?a(e,3,[m]):e(m)}finally{Xi=y}}:d=So,t&&o){const y=d,k=o===!0?1/0:o;d=()=>yi(y(),k)}const w=C1(),_=()=>{u.stop(),w&&w.active&&w1(w.effects,u)};if(i&&t){const y=t;t=(...k)=>{y(...k),_()}}let b=v?new Array(e.length).fill(qu):qu;const g=y=>{if(!(!(u.flags&1)||!u.dirty&&!y))if(t){const k=u.run();if(o||f||(v?k.some(($,E)=>Un($,b[E])):Un(k,b))){p&&p();const $=Xi;Xi=u;try{const E=[k,b===qu?void 0:v&&b[0]===qu?[]:b,m];b=k,a?a(t,3,E):t(...E)}finally{Xi=$}}}else u.run()};return l&&l(g),u=new Hd(d),u.scheduler=r?()=>r(g,!1):g,m=y=>yA(y,!1,u),p=u.onStop=()=>{const y=qd.get(u);if(y){if(a)a(y,4);else for(const k of y)k();qd.delete(u)}},t?s?g(!0):b=u.run():r?r(g.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function yi(e,t=1/0,n){if(t<=0||!Ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Cn(e))yi(e.value,t,n);else if(it(e))for(let s=0;s<e.length;s++)yi(e[s],t,n);else if(ll(e)||Vl(e))e.forEach(s=>{yi(s,t,n)});else if(Vf(e)){for(const s in e)yi(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&yi(e[s],t,n)}return e}/**
11
+ * @vue/runtime-core v3.5.35
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/const S2=[];function bA(e){S2.push(e)}function _A(){S2.pop()}function wde(e,t){}const Sde={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},wA={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function tu(e,t,n,s){try{return s?e(...s):e()}catch(o){ga(o,t,n)}}function To(e,t,n,s){if(gt(e)){const o=tu(e,t,n,s);return o&&S1(o)&&o.catch(i=>{ga(i,t,n)}),o}if(it(e)){const o=[];for(let i=0;i<e.length;i++)o.push(To(e[i],t,n,s));return o}}function ga(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||Tt;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,a,c)===!1)return}l=l.parent}if(i){Ti(),tu(i,null,10,[e,a,c]),Mi();return}}SA(e,n,o,s,r)}function SA(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const ps=[];let Ko=-1;const Gl=[];let Zi=null,Dl=0;const C2=Promise.resolve();let jd=null;function ft(e){const t=jd||C2;return e?t.then(this?e.bind(this):e):t}function CA(e){let t=Ko+1,n=ps.length;for(;t<n;){const s=t+n>>>1,o=ps[s],i=Lc(o);i<e||i===e&&o.flags&2?t=s+1:n=s}return t}function E1(e){if(!(e.flags&1)){const t=Lc(e),n=ps[ps.length-1];!n||!(e.flags&2)&&t>=Lc(n)?ps.push(e):ps.splice(CA(t),0,e),e.flags|=1,x2()}}function x2(){jd||(jd=C2.then(T2))}function zd(e){it(e)?Gl.push(...e):Zi&&e.id===-1?Zi.splice(Dl+1,0,e):e.flags&1||(Gl.push(e),e.flags|=1),x2()}function gy(e,t,n=Ko+1){for(;n<ps.length;n++){const s=ps[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;ps.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Vd(e){if(Gl.length){const t=[...new Set(Gl)].sort((n,s)=>Lc(n)-Lc(s));if(Gl.length=0,Zi){Zi.push(...t);return}for(Zi=t,Dl=0;Dl<Zi.length;Dl++){const n=Zi[Dl];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Zi=null,Dl=0}}const Lc=e=>e.id==null?e.flags&2?-1:1/0:e.id;function T2(e){try{for(Ko=0;Ko<ps.length;Ko++){const t=ps[Ko];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),tu(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ko<ps.length;Ko++){const t=ps[Ko];t&&(t.flags&=-2)}Ko=-1,ps.length=0,Vd(),jd=null,(ps.length||Gl.length)&&T2()}}let Bl,ju=[];function M2(e,t){var n,s;Bl=e,Bl?(Bl.enabled=!0,ju.forEach(({event:o,args:i})=>Bl.emit(o,...i)),ju=[]):typeof window<"u"&&window.HTMLElement&&!((s=(n=window.navigator)==null?void 0:n.userAgent)!=null&&s.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{M2(i,t)}),setTimeout(()=>{Bl||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ju=[])},3e3)):ju=[]}let zn=null,oh=null;function Oc(e){const t=zn;return zn=e,oh=e&&e.type.__scopeId||null,t}function Cde(e){oh=e}function xde(){oh=null}const Tde=e=>vn;function vn(e,t=zn,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Zd(-1);const i=Oc(t);let r;try{r=e(...o)}finally{Oc(i),s._d&&Zd(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function Et(e,t){if(zn===null)return e;const n=iu(zn),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[i,r,l,a=Tt]=t[o];i&&(gt(i)&&(i={mounted:i,updated:i}),i.deep&&yi(r),s.push({dir:i,instance:n,value:r,oldValue:void 0,arg:l,modifiers:a}))}return e}function Yo(e,t,n,s){const o=e.dirs,i=t&&t.dirs;for(let r=0;r<o.length;r++){const l=o[r];i&&(l.oldValue=i[r].value);let a=l.dir[s];a&&(Ti(),To(a,n,8,[e.el,l,e,t]),Mi())}}function ln(e,t){if(qn){let n=qn.provides;const s=qn.parent&&qn.parent.provides;s===n&&(n=qn.provides=Object.create(s)),n[e]=t}}function Nt(e,t,n=!1){const s=rs();if(s||tl){let o=tl?tl._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&gt(t)?t.call(s&&s.proxy):t}}function Mde(){return!!(rs()||tl)}const xA=Symbol.for("v-scx"),TA=()=>Nt(xA);function MA(e,t){return nu(e,null,t)}function Ade(e,t){return nu(e,null,{flush:"post"})}function AA(e,t){return nu(e,null,{flush:"sync"})}function Ve(e,t,n){return nu(e,t,n)}function nu(e,t,n=Tt){const{immediate:s,deep:o,flush:i,once:r}=n,l=Gt({},n),a=t&&s||!t&&i!=="post";let c;if(il){if(i==="sync"){const m=TA();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!a){const m=()=>{};return m.stop=So,m.resume=So,m.pause=So,m}}const u=qn;l.call=(m,f,v)=>To(m,u,f,v);let d=!1;i==="post"?l.scheduler=m=>{_n(m,u&&u.suspense)}:i!=="sync"&&(d=!0,l.scheduler=(m,f)=>{f?m():E1(m)}),l.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const p=kA(e,t,l);return il&&(c?c.push(p):a&&p()),p}function EA(e,t,n){const s=this.proxy,o=Zt(e)?e.includes(".")?A2(s,e):()=>s[e]:e.bind(s,s);let i;gt(t)?i=t:(i=t.handler,n=t);const r=va(this),l=nu(o,i.bind(s),n);return r(),l}function A2(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Gi=new WeakMap,E2=Symbol("_vte"),I2=e=>e.__isTeleport,Vr=e=>e&&(e.disabled||e.disabled===""),IA=e=>e&&(e.defer||e.defer===""),vy=e=>typeof SVGElement<"u"&&e instanceof SVGElement,yy=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,sg=(e,t)=>{const n=e&&e.to;return Zt(n)?t?t(n):null:n},$A={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,i,r,l,a,c){const{mc:u,pc:d,pbc:p,o:{insert:m,querySelector:f,createText:v,createComment:w,parentNode:_}}=c,b=Vr(t.props);let{dynamicChildren:g}=t;const y=(E,S,T)=>{E.shapeFlag&16&&u(E.children,S,T,o,i,r,l,a)},k=(E=t)=>{const S=Vr(E.props),T=E.target=sg(E.props,f),I=og(T,E,v,m);T&&(r!=="svg"&&vy(T)?r="svg":r!=="mathml"&&yy(T)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(T),S||(y(E,T,I),sc(E,!1)))},$=E=>{const S=()=>{if(Gi.get(E)===S){if(Gi.delete(E),Vr(E.props)){const T=_(E.el)||n;y(E,T,E.anchor),sc(E,!0)}k(E)}};Gi.set(E,S),_n(S,i)};if(e==null){const E=t.el=v(""),S=t.anchor=v("");if(m(E,n,s),m(S,n,s),IA(t.props)||i&&i.pendingBranch){$(t);return}b&&(y(t,n,S),sc(t,!0)),k()}else{t.el=e.el;const E=t.anchor=e.anchor,S=Gi.get(e);if(S){S.flags|=8,Gi.delete(e),$(t);return}t.targetStart=e.targetStart;const T=t.target=e.target,I=t.targetAnchor=e.targetAnchor,L=Vr(e.props),R=L?n:T,O=L?E:I;if(r==="svg"||vy(T)?r="svg":(r==="mathml"||yy(T))&&(r="mathml"),g?(p(e.dynamicChildren,g,R,o,i,r,l),F1(e,t,!0)):a||d(e,t,R,O,o,i,r,l,!1),b)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):zu(t,n,E,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const F=t.target=sg(t.props,f);F&&zu(t,F,null,c,0)}else L&&zu(t,T,I,c,1);sc(t,b)}},remove(e,t,n,{um:s,o:{remove:o}},i){const{shapeFlag:r,children:l,anchor:a,targetStart:c,targetAnchor:u,target:d,props:p}=e,m=i||!Vr(p),f=Gi.get(e);if(f&&(f.flags|=8,Gi.delete(e)),d&&(o(c),o(u)),i&&o(a),!f&&r&16)for(let v=0;v<l.length;v++){const w=l[v];s(w,t,n,m,!!w.dynamicChildren)}},move:zu,hydrate:NA};function zu(e,t,n,{o:{insert:s},m:o},i=2){i===0&&s(e.targetAnchor,t,n);const{el:r,anchor:l,shapeFlag:a,children:c,props:u}=e,d=i===2;if(d&&s(r,t,n),!Gi.has(e)&&(!d||Vr(u))&&a&16)for(let p=0;p<c.length;p++)o(c[p],t,n,2);d&&s(l,t,n)}function NA(e,t,n,s,o,i,{o:{nextSibling:r,parentNode:l,querySelector:a,insert:c,createText:u}},d){function p(w,_){let b=_;for(;b;){if(b&&b.nodeType===8){if(b.data==="teleport start anchor")t.targetStart=b;else if(b.data==="teleport anchor"){t.targetAnchor=b,w._lpa=t.targetAnchor&&r(t.targetAnchor);break}}b=r(b)}}function m(w,_){_.anchor=d(r(w),_,l(w),n,s,o,i)}const f=t.target=sg(t.props,a),v=Vr(t.props);if(f){const w=f._lpa||f.firstChild;t.shapeFlag&16&&(v?(m(e,t),p(f,w),t.targetAnchor||og(f,t,u,c,l(e)===f?e:null)):(t.anchor=r(e),p(f,w),t.targetAnchor||og(f,t,u,c),d(w&&r(w),t,f,n,s,o,i))),sc(t,v)}else v&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=r(e));return t.anchor&&r(t.anchor)}const Ede=$A;function sc(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function og(e,t,n,s,o=null){const i=t.targetStart=n(""),r=t.targetAnchor=n("");return i[E2]=r,e&&(s(i,e,o),s(r,e,o)),r}const go=Symbol("_leaveCb"),Ka=Symbol("_enterCb");function $2(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Jt(()=>{e.isMounted=!0}),to(()=>{e.isUnmounting=!0}),e}const uo=[Function,Array],N2={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:uo,onEnter:uo,onAfterEnter:uo,onEnterCancelled:uo,onBeforeLeave:uo,onLeave:uo,onAfterLeave:uo,onLeaveCancelled:uo,onBeforeAppear:uo,onAppear:uo,onAfterAppear:uo,onAppearCancelled:uo},L2=e=>{const t=e.subTree;return t.component?L2(t.component):t},LA={name:"BaseTransition",props:N2,setup(e,{slots:t}){const n=rs(),s=$2();return()=>{const o=t.default&&I1(t.default(),!0),i=o&&o.length?O2(o):n.subTree?re():void 0;if(!i)return;const r=It(e),{mode:l}=r;if(s.isLeaving)return Kp(i);const a=ky(i);if(!a)return Kp(i);let c=Rc(a,r,s,n,d=>c=d);a.type!==wn&&cr(a,c);let u=n.subTree&&ky(n.subTree);if(u&&u.type!==wn&&!$o(u,a)&&L2(n).type!==wn){let d=Rc(u,r,s,n);if(cr(u,d),l==="out-in"&&a.type!==wn)return s.isLeaving=!0,d.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Kp(i);l==="in-out"&&a.type!==wn?d.delayLeave=(p,m,f)=>{const v=R2(s,u);v[String(u.key)]=u,p[go]=()=>{m(),p[go]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function O2(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==wn){t=n;break}}return t}const OA=LA;function R2(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Rc(e,t,n,s,o){const{appear:i,mode:r,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:v,onBeforeAppear:w,onAppear:_,onAfterAppear:b,onAppearCancelled:g}=t,y=String(e.key),k=R2(n,e),$=(T,I)=>{T&&To(T,s,9,I)},E=(T,I)=>{const L=I[1];$(T,I),it(T)?T.every(R=>R.length<=1)&&L():T.length<=1&&L()},S={mode:r,persisted:l,beforeEnter(T){let I=a;if(!n.isMounted)if(i)I=w||a;else return;T[go]&&T[go](!0);const L=k[y];L&&$o(e,L)&&L.el[go]&&L.el[go](),$(I,[T])},enter(T){if(k[y]===e)return;let I=c,L=u,R=d;if(!n.isMounted)if(i)I=_||c,L=b||u,R=g||d;else return;let O=!1;T[Ka]=P=>{O||(O=!0,P?$(R,[T]):$(L,[T]),S.delayedLeave&&S.delayedLeave(),T[Ka]=void 0)};const F=T[Ka].bind(null,!1);I?E(I,[T,F]):F()},leave(T,I){const L=String(e.key);if(T[Ka]&&T[Ka](!0),n.isUnmounting)return I();$(p,[T]);let R=!1;T[go]=F=>{R||(R=!0,I(),F?$(v,[T]):$(f,[T]),T[go]=void 0,k[L]===e&&delete k[L])};const O=T[go].bind(null,!1);k[L]=e,m?E(m,[T,O]):O()},clone(T){const I=Rc(T,t,n,s,o);return o&&o(I),I}};return S}function Kp(e){if(su(e))return e=Ei(e),e.children=null,e}function ky(e){if(!su(e))return I2(e.type)&&e.children?O2(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&gt(n.default))return n.default()}}function cr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,cr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function I1(e,t=!1,n){let s=[],o=0;for(let i=0;i<e.length;i++){let r=e[i];const l=n==null?r.key:String(n)+String(r.key!=null?r.key:i);r.type===Ie?(r.patchFlag&128&&o++,s=s.concat(I1(r.children,t,l))):(t||r.type!==wn)&&s.push(l!=null?Ei(r,{key:l}):r)}if(o>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}function Ze(e,t){return gt(e)?Gt({name:e.name},t,{setup:e}):e}function Ide(){const e=rs();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function $1(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function $de(e){const t=rs(),n=al(null);if(t){const o=t.refs===Tt?t.refs={}:t.refs;Object.defineProperty(o,e,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function by(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Kd=new WeakMap;function Yl(e,t,n,s,o=!1){if(it(e)){e.forEach((v,w)=>Yl(v,t&&(it(t)?t[w]:t),n,s,o));return}if(wi(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Yl(e,t,n,s.component.subTree);return}const i=s.shapeFlag&4?iu(s.component):s.el,r=o?null:i,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Tt?l.refs={}:l.refs,d=l.setupState,p=It(d),m=d===Tt?Qw:v=>by(u,v)?!1:Bt(p,v),f=(v,w)=>!(w&&by(u,w));if(c!=null&&c!==a){if(_y(t),Zt(c))u[c]=null,m(c)&&(d[c]=null);else if(Cn(c)){const v=t;f(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(gt(a))tu(a,l,12,[r,u]);else{const v=Zt(a),w=Cn(a);if(v||w){const _=()=>{if(e.f){const b=v?m(a)?d[a]:u[a]:f()||!e.k?a.value:u[e.k];if(o)it(b)&&w1(b,i);else if(it(b))b.includes(i)||b.push(i);else if(v)u[a]=[i],m(a)&&(d[a]=u[a]);else{const g=[i];f(a,e.k)&&(a.value=g),e.k&&(u[e.k]=g)}}else v?(u[a]=r,m(a)&&(d[a]=r)):w&&(f(a,e.k)&&(a.value=r),e.k&&(u[e.k]=r))};if(r){const b=()=>{_(),Kd.delete(e)};b.id=-1,Kd.set(e,b),_n(b,n)}else _y(e),_()}}}function _y(e){const t=Kd.get(e);t&&(t.flags|=8,Kd.delete(e))}let wy=!1;const El=()=>{wy||(console.error("Hydration completed but contains mismatches."),wy=!0)},RA=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",PA=e=>e.namespaceURI.includes("MathML"),Vu=e=>{if(e.nodeType===1){if(RA(e))return"svg";if(PA(e))return"mathml"}},Wl=e=>e.nodeType===8;function DA(e){const{mt:t,p:n,o:{patchProp:s,createText:o,nextSibling:i,parentNode:r,remove:l,insert:a,createComment:c}}=e,u=(g,y)=>{if(!y.hasChildNodes()){n(null,g,y),Vd(),y._vnode=g;return}d(y.firstChild,g,null,null,null),Vd(),y._vnode=g},d=(g,y,k,$,E,S=!1)=>{S=S||!!y.dynamicChildren;const T=Wl(g)&&g.data==="[",I=()=>v(g,y,k,$,E,T),{type:L,ref:R,shapeFlag:O,patchFlag:F}=y;let P=g.nodeType;y.el=g,F===-2&&(S=!1,y.dynamicChildren=null);let q=null;switch(L){case ir:P!==3?y.children===""?(a(y.el=o(""),r(g),g),q=g):q=I():(g.data!==y.children&&(El(),g.data=y.children),q=i(g));break;case wn:b(g)?(q=i(g),_(y.el=g.content.firstChild,g,k)):P!==8||T?q=I():q=i(g);break;case Ql:if(T&&(g=i(g),P=g.nodeType),P===1||P===3){q=g;const K=!y.children.length;for(let G=0;G<y.staticCount;G++)K&&(y.children+=q.nodeType===1?q.outerHTML:q.data),G===y.staticCount-1&&(y.anchor=q),q=i(q);return T?i(q):q}else I();break;case Ie:T?q=f(g,y,k,$,E,S):q=I();break;default:if(O&1)(P!==1||y.type.toLowerCase()!==g.tagName.toLowerCase())&&!b(g)?q=I():q=p(g,y,k,$,E,S);else if(O&6){y.slotScopeIds=E;const K=r(g);if(T?q=w(g):Wl(g)&&g.data==="teleport start"?q=w(g,g.data,"teleport end"):q=i(g),t(y,K,null,k,$,Vu(K),S),wi(y)&&!y.type.__asyncResolved){let G;T?(G=mt(Ie),G.anchor=q?q.previousSibling:K.lastChild):G=g.nodeType===3?ht(""):mt("div"),G.el=g,y.component.subTree=G}}else O&64?P!==8?q=I():q=y.type.hydrate(g,y,k,$,E,S,e,m):O&128&&(q=y.type.hydrate(g,y,k,$,Vu(r(g)),E,S,e,d))}return R!=null&&Yl(R,null,$,y),q},p=(g,y,k,$,E,S)=>{S=S||!!y.dynamicChildren;const{type:T,props:I,patchFlag:L,shapeFlag:R,dirs:O,transition:F}=y,P=T==="input"||T==="option";if(P||L!==-1){O&&Yo(y,null,k,"created");let q=!1;if(b(g)){q=eS(null,F)&&k&&k.vnode.props&&k.vnode.props.appear;const G=g.content.firstChild;if(q){const oe=G.getAttribute("class");oe&&(G.$cls=oe),F.beforeEnter(G)}_(G,g,k),y.el=g=G}if(R&16&&!(I&&(I.innerHTML||I.textContent))){let G=m(g.firstChild,y,g,k,$,E,S);for(G&&!Ku(g,1)&&El();G;){const oe=G;G=G.nextSibling,l(oe)}}else if(R&8){let G=y.children;G[0]===`
15
+ `&&(g.tagName==="PRE"||g.tagName==="TEXTAREA")&&(G=G.slice(1));const{textContent:oe}=g;oe!==G&&oe!==G.replace(/\r\n|\r/g,`
16
+ `)&&(Ku(g,0)||El(),g.textContent=y.children)}if(I){if(P||!S||L&48){const G=g.tagName.includes("-");for(const oe in I)(P&&(oe.endsWith("value")||oe==="indeterminate")||eu(oe)&&!Jr(oe)||oe[0]==="."||G&&!Jr(oe))&&s(g,oe,null,I[oe],void 0,k)}else if(I.onClick)s(g,"onClick",null,I.onClick,void 0,k);else if(L&4&&or(I.style))for(const G in I.style)I.style[G]}let K;(K=I&&I.onVnodeBeforeMount)&&Ts(K,k,y),O&&Yo(y,null,k,"beforeMount"),((K=I&&I.onVnodeMounted)||O||q)&&oS(()=>{K&&Ts(K,k,y),q&&F.enter(g),O&&Yo(y,null,k,"mounted")},$)}return g.nextSibling},m=(g,y,k,$,E,S,T)=>{T=T||!!y.dynamicChildren;const I=y.children,L=I.length;let R=!1;for(let O=0;O<L;O++){const F=T?I[O]:I[O]=Ms(I[O]),P=F.type===ir;g?(P&&!T&&O+1<L&&Ms(I[O+1]).type===ir&&(a(o(g.data.slice(F.children.length)),k,i(g)),g.data=F.children),g=d(g,F,$,E,S,T)):P&&!F.children?a(F.el=o(""),k):(R||(R=!0,Ku(k,1)||El()),n(null,F,k,null,$,E,Vu(k),S))}return g},f=(g,y,k,$,E,S)=>{const{slotScopeIds:T}=y;T&&(E=E?E.concat(T):T);const I=r(g),L=m(i(g),y,I,k,$,E,S);return L&&Wl(L)&&L.data==="]"?i(y.anchor=L):(El(),a(y.anchor=c("]"),I,L),L)},v=(g,y,k,$,E,S)=>{if(Ku(g.parentElement,1)||El(),y.el=null,S){const L=w(g);for(;;){const R=i(g);if(R&&R!==L)l(R);else break}}const T=i(g),I=r(g);return l(g),n(null,y,I,T,k,$,Vu(I),E),k&&(k.vnode.el=y.el,lh(k,y.el)),T},w=(g,y="[",k="]")=>{let $=0;for(;g;)if(g=i(g),g&&Wl(g)&&(g.data===y&&$++,g.data===k)){if($===0)return i(g);$--}return g},_=(g,y,k)=>{const $=y.parentNode;$&&$.replaceChild(g,y);let E=k;for(;E;)E.vnode.el===y&&(E.vnode.el=E.subTree.el=g),E=E.parent},b=g=>g.nodeType===1&&g.tagName==="TEMPLATE";return[u,d]}const Sy="data-allow-mismatch",BA={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function Ku(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Sy);)e=e.parentElement;const n=e&&e.getAttribute(Sy);if(n==null)return!1;if(n==="")return!0;{const s=n.split(",");return t===0&&s.includes("children")?!0:s.includes(BA[t])}}const FA=Zf().requestIdleCallback||(e=>setTimeout(e,1)),HA=Zf().cancelIdleCallback||(e=>clearTimeout(e)),Nde=(e=1e4)=>t=>{const n=FA(t,{timeout:e});return()=>HA(n)};function WA(e){const{top:t,left:n,bottom:s,right:o}=e.getBoundingClientRect(),{innerHeight:i,innerWidth:r}=window;return(t>0&&t<i||s>0&&s<i)&&(n>0&&n<r||o>0&&o<r)}const Lde=e=>(t,n)=>{const s=new IntersectionObserver(o=>{for(const i of o)if(i.isIntersecting){s.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(WA(o))return t(),s.disconnect(),!1;s.observe(o)}}),()=>s.disconnect()},Ode=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Rde=(e=[])=>(t,n)=>{Zt(e)&&(e=[e]);let s=!1;const o=r=>{s||(s=!0,i(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},i=()=>{n(r=>{for(const l of e)r.removeEventListener(l,o)})};return n(r=>{for(const l of e)r.addEventListener(l,o,{once:!0})}),i};function UA(e,t){if(Wl(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(Wl(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const wi=e=>!!e.type.__asyncLoader;function Zo(e){gt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:o=200,hydrate:i,timeout:r,suspensible:l=!0,onError:a}=e;let c=null,u,d=0;const p=()=>(d++,c=null,m()),m=()=>{let f;return c||(f=c=t().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),a)return new Promise((w,_)=>{a(v,()=>w(p()),()=>_(v),d+1)});throw v}).then(v=>f!==c&&c?c:(v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),u=v,v)))};return Ze({name:"AsyncComponentWrapper",__asyncLoader:m,__asyncHydrate(f,v,w){let _=!1;(v.bu||(v.bu=[])).push(()=>_=!0);const b=()=>{_||w()},g=i?()=>{const y=i(b,k=>UA(f,k));y&&(v.bum||(v.bum=[])).push(y)}:b;u?g():m().then(()=>!v.isUnmounted&&g())},get __asyncResolved(){return u},setup(){const f=qn;if($1(f),u)return()=>Gu(u,f);const v=g=>{c=null,ga(g,f,13,!s)};if(l&&f.suspense||il)return m().then(g=>()=>Gu(g,f)).catch(g=>(v(g),()=>s?mt(s,{error:g}):null));const w=te(!1),_=te(),b=te(!!o);return o&&setTimeout(()=>{b.value=!1},o),r!=null&&setTimeout(()=>{if(!w.value&&!_.value){const g=new Error(`Async component timed out after ${r}ms.`);v(g),_.value=g}},r),m().then(()=>{w.value=!0,f.parent&&su(f.parent.vnode)&&f.parent.update()}).catch(g=>{v(g),_.value=g}),()=>{if(w.value&&u)return Gu(u,f);if(_.value&&s)return mt(s,{error:_.value});if(n&&!b.value)return Gu(n,f)}}})}function Gu(e,t){const{ref:n,props:s,children:o,ce:i}=t.vnode,r=mt(e,s,o);return r.ref=n,r.ce=i,delete t.vnode.ce,r}const su=e=>e.type.__isKeepAlive,qA={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=rs(),s=n.ctx;if(!s.renderer)return()=>{const b=t.default&&t.default();return b&&b.length===1?b[0]:b};const o=new Map,i=new Set;let r=null;const l=n.suspense,{renderer:{p:a,m:c,um:u,o:{createElement:d}}}=s,p=d("div");s.activate=(b,g,y,k,$)=>{const E=b.component;c(b,g,y,0,l),a(E.vnode,b,g,y,E,l,k,b.slotScopeIds,$),_n(()=>{E.isDeactivated=!1,E.a&&Kl(E.a);const S=b.props&&b.props.onVnodeMounted;S&&Ts(S,E.parent,b)},l)},s.deactivate=b=>{const g=b.component;Yd(g.m),Yd(g.a),c(b,p,null,1,l),_n(()=>{g.da&&Kl(g.da);const y=b.props&&b.props.onVnodeUnmounted;y&&Ts(y,g.parent,b),g.isDeactivated=!0},l)};function m(b){Gp(b),u(b,n,l,!0)}function f(b){o.forEach((g,y)=>{const k=hg(wi(g)?g.type.__asyncResolved||{}:g.type);k&&!b(k)&&v(y)})}function v(b){const g=o.get(b);g&&(!r||!$o(g,r))?m(g):r&&Gp(r),o.delete(b),i.delete(b)}Ve(()=>[e.include,e.exclude],([b,g])=>{b&&f(y=>oc(b,y)),g&&f(y=>!oc(g,y))},{flush:"post",deep:!0});let w=null;const _=()=>{w!=null&&(Xd(n.subTree.type)?_n(()=>{o.set(w,Yu(n.subTree))},n.subTree.suspense):o.set(w,Yu(n.subTree)))};return Jt(_),N1(_),to(()=>{o.forEach(b=>{const{subTree:g,suspense:y}=n,k=Yu(g);if(b.type===k.type&&b.key===k.key){Gp(k);const $=k.component.da;$&&_n($,y);return}m(b)})}),()=>{if(w=null,!t.default)return r=null;const b=t.default(),g=b[0];if(b.length>1)return r=null,b;if(!ur(g)||!(g.shapeFlag&4)&&!(g.shapeFlag&128))return r=null,g;let y=Yu(g);if(y.type===wn)return r=null,y;const k=y.type,$=hg(wi(y)?y.type.__asyncResolved||{}:k),{include:E,exclude:S,max:T}=e;if(E&&(!$||!oc(E,$))||S&&$&&oc(S,$))return y.shapeFlag&=-257,r=y,g;const I=y.key==null?k:y.key,L=o.get(I);return y.el&&(y=Ei(y),g.shapeFlag&128&&(g.ssContent=y)),w=I,L?(y.el=L.el,y.component=L.component,y.transition&&cr(y,y.transition),y.shapeFlag|=512,i.delete(I),i.add(I)):(i.add(I),T&&i.size>parseInt(T,10)&&v(i.values().next().value)),y.shapeFlag|=256,r=y,Xd(g.type)?g:y}}},Pde=qA;function oc(e,t){return it(e)?e.some(n=>oc(n,t)):Zt(e)?e.split(",").includes(t):IM(e)?(e.lastIndex=0,e.test(t)):!1}function jA(e,t){P2(e,"a",t)}function zA(e,t){P2(e,"da",t)}function P2(e,t,n=qn){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(ih(t,s,n),n){let o=n.parent;for(;o&&o.parent;)su(o.parent.vnode)&&VA(s,t,n,o),o=o.parent}}function VA(e,t,n,s){const o=ih(t,e,s,!0);qt(()=>{w1(s[t],o)},n)}function Gp(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Yu(e){return e.shapeFlag&128?e.ssContent:e}function ih(e,t,n=qn,s=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{Ti();const l=va(n),a=To(t,n,e,r);return l(),Mi(),a});return s?o.unshift(i):o.push(i),i}}const $i=e=>(t,n=qn)=>{(!il||e==="sp")&&ih(e,(...s)=>t(...s),n)},KA=$i("bm"),Jt=$i("m"),D2=$i("bu"),N1=$i("u"),to=$i("bum"),qt=$i("um"),GA=$i("sp"),YA=$i("rtg"),XA=$i("rtc");function ZA(e,t=qn){ih("ec",e,t)}const L1="components",QA="directives";function JA(e,t){return O1(L1,e,!0,t)||e}const B2=Symbol.for("v-ndc");function ss(e){return Zt(e)?O1(L1,e,!1)||e:e||B2}function Dde(e){return O1(QA,e)}function O1(e,t,n=!0,s=!1){const o=zn||qn;if(o){const i=o.type;if(e===L1){const l=hg(i,!1);if(l&&(l===t||l===In(t)||l===Yf(In(t))))return i}const r=Cy(o[e]||i[e],t)||Cy(o.appContext[e],t);return!r&&s?i:r}}function Cy(e,t){return e&&(e[t]||e[In(t)]||e[Yf(In(t))])}function Xe(e,t,n,s){let o;const i=n&&n[s],r=it(e);if(r||Zt(e)){const l=r&&or(e);let a=!1,c=!1;l&&(a=!Gs(e),c=Ai(e),e=eh(e)),o=new Array(e.length);for(let u=0,d=e.length;u<d;u++)o[u]=t(a?c?aa(Ro(e[u])):Ro(e[u]):e[u],u,void 0,i&&i[u])}else if(typeof e=="number"){o=new Array(e);for(let l=0;l<e;l++)o[l]=t(l+1,l,void 0,i&&i[l])}else if(Ft(e))if(e[Symbol.iterator])o=Array.from(e,(l,a)=>t(l,a,void 0,i&&i[a]));else{const l=Object.keys(e);o=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];o[a]=t(e[u],u,a,i&&i[a])}}else o=[];return n&&(n[s]=o),o}function Bde(e,t){for(let n=0;n<t.length;n++){const s=t[n];if(it(s))for(let o=0;o<s.length;o++)e[s[o].name]=s[o].fn;else s&&(e[s.name]=s.key?(...o)=>{const i=s.fn(...o);return i&&(i.key=s.key),i}:s.fn)}return e}function Xl(e,t,n={},s,o){if(zn.ce||zn.parent&&wi(zn.parent)&&zn.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),je(Ie,null,[mt("slot",n,s&&s())],c?-2:64)}let i=e[t];i&&i._c&&(i._d=!1),C();const r=i&&R1(i(n)),l=n.key||r&&r.key,a=je(Ie,{key:(l&&!eo(l)?l:`_${t}`)+(!r&&s?"_fb":"")},r||(s?s():[]),r&&e._===1?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function R1(e){return e.some(t=>ur(t)?!(t.type===wn||t.type===Ie&&!R1(t.children)):!0)?e:null}function Fde(e,t){const n={};for(const s in e)n[t&&/[A-Z]/.test(s)?`on:${s}`:bd(s)]=e[s];return n}const ig=e=>e?cS(e)?iu(e):ig(e.parent):null,mc=Gt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ig(e.parent),$root:e=>ig(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>P1(e),$forceUpdate:e=>e.f||(e.f=()=>{E1(e.update)}),$nextTick:e=>e.n||(e.n=ft.bind(e.proxy)),$watch:e=>EA.bind(e)}),Yp=(e,t)=>e!==Tt&&!e.__isScriptSetup&&Bt(e,t),rg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:i,accessCache:r,type:l,appContext:a}=e;if(t[0]!=="$"){const p=r[t];if(p!==void 0)switch(p){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(Yp(s,t))return r[t]=1,s[t];if(o!==Tt&&Bt(o,t))return r[t]=2,o[t];if(Bt(i,t))return r[t]=3,i[t];if(n!==Tt&&Bt(n,t))return r[t]=4,n[t];lg&&(r[t]=0)}}const c=mc[t];let u,d;if(c)return t==="$attrs"&&ns(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Tt&&Bt(n,t))return r[t]=4,n[t];if(d=a.config.globalProperties,Bt(d,t))return d[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:i}=e;return Yp(o,t)?(o[t]=n,!0):s!==Tt&&Bt(s,t)?(s[t]=n,!0):Bt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:i,type:r}},l){let a;return!!(n[l]||e!==Tt&&l[0]!=="$"&&Bt(e,l)||Yp(t,l)||Bt(i,l)||Bt(s,l)||Bt(mc,l)||Bt(o.config.globalProperties,l)||(a=r.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Bt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},e4=Gt({},rg,{get(e,t){if(t!==Symbol.unscopables)return rg.get(e,t,e)},has(e,t){return t[0]!=="_"&&!RM(t)}});function Hde(){return null}function Wde(){return null}function Ude(e){}function qde(e){}function jde(){return null}function zde(){}function Vde(e,t){return null}function Kde(){return F2().slots}function ou(){return F2().attrs}function F2(e){const t=rs();return t.setupContext||(t.setupContext=fS(t))}function Pc(e){return it(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Gde(e,t){const n=Pc(e);for(const s in t){if(s.startsWith("__skip"))continue;let o=n[s];o?it(o)||gt(o)?o=n[s]={type:o,default:t[s]}:o.default=t[s]:o===null&&(o=n[s]={default:t[s]}),o&&t[`__skip_${s}`]&&(o.skipFactory=!0)}return n}function Yde(e,t){return!e||!t?e||t:it(e)&&it(t)?e.concat(t):Gt({},Pc(e),Pc(t))}function Xde(e,t){const n={};for(const s in e)t.includes(s)||Object.defineProperty(n,s,{enumerable:!0,get:()=>e[s]});return n}function Zde(e){const t=rs(),n=il;let s=e();Bc(),n&&Jl(!1);const o=()=>{va(t),n&&Jl(!0)},i=()=>{rs()!==t&&t.scope.off(),Bc(),n&&Jl(!1)};return S1(s)&&(s=s.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(i)),r})),[s,()=>{o(),Promise.resolve().then(i)}]}let lg=!0;function t4(e){const t=P1(e),n=e.proxy,s=e.ctx;lg=!1,t.beforeCreate&&xy(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:r,watch:l,provide:a,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:m,updated:f,activated:v,deactivated:w,beforeDestroy:_,beforeUnmount:b,destroyed:g,unmounted:y,render:k,renderTracked:$,renderTriggered:E,errorCaptured:S,serverPrefetch:T,expose:I,inheritAttrs:L,components:R,directives:O,filters:F}=t;if(c&&n4(c,s,null),r)for(const K in r){const G=r[K];gt(G)&&(s[K]=G.bind(n))}if(o){const K=o.call(n,n);Ft(K)&&(e.data=Vs(K))}if(lg=!0,i)for(const K in i){const G=i[K],oe=gt(G)?G.bind(n,n):gt(G.get)?G.get.bind(n,n):So,J=!gt(G)&&gt(G.set)?G.set.bind(n):So,he=j({get:oe,set:J});Object.defineProperty(s,K,{enumerable:!0,configurable:!0,get:()=>he.value,set:Ne=>he.value=Ne})}if(l)for(const K in l)H2(l[K],s,n,K);if(a){const K=gt(a)?a.call(n):a;Reflect.ownKeys(K).forEach(G=>{ln(G,K[G])})}u&&xy(u,e,"c");function q(K,G){it(G)?G.forEach(oe=>K(oe.bind(n))):G&&K(G.bind(n))}if(q(KA,d),q(Jt,p),q(D2,m),q(N1,f),q(jA,v),q(zA,w),q(ZA,S),q(XA,$),q(YA,E),q(to,b),q(qt,y),q(GA,T),it(I))if(I.length){const K=e.exposed||(e.exposed={});I.forEach(G=>{Object.defineProperty(K,G,{get:()=>n[G],set:oe=>n[G]=oe,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===So&&(e.render=k),L!=null&&(e.inheritAttrs=L),R&&(e.components=R),O&&(e.directives=O),T&&$1(e)}function n4(e,t,n=So){it(e)&&(e=ag(e));for(const s in e){const o=e[s];let i;Ft(o)?"default"in o?i=Nt(o.from||s,o.default,!0):i=Nt(o.from||s):i=Nt(o),Cn(i)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>i.value,set:r=>i.value=r}):t[s]=i}}function xy(e,t,n){To(it(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function H2(e,t,n,s){let o=s.includes(".")?A2(n,s):()=>n[s];if(Zt(e)){const i=t[e];gt(i)&&Ve(o,i)}else if(gt(e))Ve(o,e.bind(n));else if(Ft(e))if(it(e))e.forEach(i=>H2(i,t,n,s));else{const i=gt(e.handler)?e.handler.bind(n):t[e.handler];gt(i)&&Ve(o,i,e)}}function P1(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:r}}=e.appContext,l=i.get(t);let a;return l?a=l:!o.length&&!n&&!s?a=t:(a={},o.length&&o.forEach(c=>Gd(a,c,r,!0)),Gd(a,t,r)),Ft(t)&&i.set(t,a),a}function Gd(e,t,n,s=!1){const{mixins:o,extends:i}=t;i&&Gd(e,i,n,!0),o&&o.forEach(r=>Gd(e,r,n,!0));for(const r in t)if(!(s&&r==="expose")){const l=s4[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const s4={data:Ty,props:My,emits:My,methods:ic,computed:ic,beforeCreate:hs,created:hs,beforeMount:hs,mounted:hs,beforeUpdate:hs,updated:hs,beforeDestroy:hs,beforeUnmount:hs,destroyed:hs,unmounted:hs,activated:hs,deactivated:hs,errorCaptured:hs,serverPrefetch:hs,components:ic,directives:ic,watch:i4,provide:Ty,inject:o4};function Ty(e,t){return t?e?function(){return Gt(gt(e)?e.call(this,this):e,gt(t)?t.call(this,this):t)}:t:e}function o4(e,t){return ic(ag(e),ag(t))}function ag(e){if(it(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hs(e,t){return e?[...new Set([].concat(e,t))]:t}function ic(e,t){return e?Gt(Object.create(null),e,t):t}function My(e,t){return e?it(e)&&it(t)?[...new Set([...e,...t])]:Gt(Object.create(null),Pc(e),Pc(t??{})):t}function i4(e,t){if(!e)return t;if(!t)return e;const n=Gt(Object.create(null),e);for(const s in t)n[s]=hs(e[s],t[s]);return n}function W2(){return{app:null,config:{isNativeTag:Qw,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let r4=0;function l4(e,t){return function(s,o=null){gt(s)||(s=Gt({},s)),o!=null&&!Ft(o)&&(o=null);const i=W2(),r=new WeakSet,l=[];let a=!1;const c=i.app={_uid:r4++,_component:s,_props:o,_container:null,_context:i,_instance:null,version:D4,get config(){return i.config},set config(u){},use(u,...d){return r.has(u)||(u&&gt(u.install)?(r.add(u),u.install(c,...d)):gt(u)&&(r.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,p){if(!a){const m=c._ceVNode||mt(s,o);return m.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),d&&t?t(m,u):e(m,u,p),a=!0,c._container=u,u.__vue_app__=c,iu(m.component)}},onUnmount(u){l.push(u)},unmount(){a&&(To(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=tl;tl=c;try{return u()}finally{tl=d}}};return c}}let tl=null;function Qde(e,t,n=Tt){const s=rs(),o=In(t),i=As(t),r=U2(e,o),l=hA((a,c)=>{let u,d=Tt,p;return AA(()=>{const m=e[o];Un(u,m)&&(u=m,c())}),{get(){return a(),n.get?n.get(u):u},set(m){const f=n.set?n.set(m):m;if(!Un(f,u)&&!(d!==Tt&&Un(m,d)))return;const v=s.vnode.props;v&&(t in v||o in v||i in v)&&(`onUpdate:${t}`in v||`onUpdate:${o}`in v||`onUpdate:${i}`in v)||(u=m,c()),s.emit(`update:${t}`,f),Un(m,f)&&Un(m,d)&&!Un(f,p)&&c(),d=m,p=f}}});return l[Symbol.iterator]=()=>{let a=0;return{next(){return a<2?{value:a++?r||Tt:l,done:!1}:{done:!0}}}},l}const U2=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${In(t)}Modifiers`]||e[`${As(t)}Modifiers`];function a4(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Tt;let o=n;const i=t.startsWith("update:"),r=i&&U2(s,t.slice(7));r&&(r.trim&&(o=n.map(u=>Zt(u)?u.trim():u)),r.number&&(o=n.map(Xf)));let l,a=s[l=bd(t)]||s[l=bd(In(t))];!a&&i&&(a=s[l=bd(As(t))]),a&&To(a,e,6,o);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,To(c,e,6,o)}}const c4=new WeakMap;function q2(e,t,n=!1){const s=n?c4:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const i=e.emits;let r={},l=!1;if(!gt(e)){const a=c=>{const u=q2(c,t,!0);u&&(l=!0,Gt(r,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!i&&!l?(Ft(e)&&s.set(e,null),null):(it(i)?i.forEach(a=>r[a]=null):Gt(r,i),Ft(e)&&s.set(e,r),r)}function rh(e,t){return!e||!eu(t)?!1:(t=t.slice(2).replace(/Once$/,""),Bt(e,t[0].toLowerCase()+t.slice(1))||Bt(e,As(t))||Bt(e,t))}function _d(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[i],slots:r,attrs:l,emit:a,render:c,renderCache:u,props:d,data:p,setupState:m,ctx:f,inheritAttrs:v}=e,w=Oc(e);let _,b;try{if(n.shapeFlag&4){const y=o||s,k=y;_=Ms(c.call(k,y,u,d,m,p,f)),b=l}else{const y=t;_=Ms(y.length>1?y(d,{attrs:l,slots:r,emit:a}):y(d,null)),b=t.props?l:d4(l)}}catch(y){gc.length=0,ga(y,e,1),_=mt(wn)}let g=_;if(b&&v!==!1){const y=Object.keys(b),{shapeFlag:k}=g;y.length&&k&7&&(i&&y.some(zf)&&(b=f4(b,i)),g=Ei(g,b,!1,!0))}return n.dirs&&(g=Ei(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&cr(g,n.transition),_=g,Oc(w),_}function u4(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(ur(o)){if(o.type!==wn||o.children==="v-if"){if(n)return;n=o}}else return}return n}const d4=e=>{let t;for(const n in e)(n==="class"||n==="style"||eu(n))&&((t||(t={}))[n]=e[n]);return t},f4=(e,t)=>{const n={};for(const s in e)(!zf(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function h4(e,t,n){const{props:s,children:o,component:i}=e,{props:r,children:l,patchFlag:a}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?Ay(s,r,c):!!r;if(a&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const p=u[d];if(j2(r,s,p)&&!rh(c,p))return!0}}}else return(o||l)&&(!l||!l.$stable)?!0:s===r?!1:s?r?Ay(s,r,c):!0:!!r;return!1}function Ay(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const i=s[o];if(j2(t,e,i)&&!rh(n,i))return!0}return!1}function j2(e,t,n){const s=e[n],o=t[n];return n==="style"&&Ft(s)&&Ft(o)?!xi(s,o):s!==o}function lh({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const z2={},V2=()=>Object.create(z2),K2=e=>Object.getPrototypeOf(e)===z2;function p4(e,t,n,s=!1){const o={},i=V2();e.propsDefaults=Object.create(null),G2(e,t,o,i);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=s?o:cA(o):e.type.props?e.props=o:e.props=i,e.attrs=i}function m4(e,t,n,s){const{props:o,attrs:i,vnode:{patchFlag:r}}=e,l=It(o),[a]=e.propsOptions;let c=!1;if((s||r>0)&&!(r&16)){if(r&8){const u=e.vnode.dynamicProps;for(let d=0;d<u.length;d++){let p=u[d];if(rh(e.emitsOptions,p))continue;const m=t[p];if(a)if(Bt(i,p))m!==i[p]&&(i[p]=m,c=!0);else{const f=In(p);o[f]=cg(a,l,f,m,e,!1)}else m!==i[p]&&(i[p]=m,c=!0)}}}else{G2(e,t,o,i)&&(c=!0);let u;for(const d in l)(!t||!Bt(t,d)&&((u=As(d))===d||!Bt(t,u)))&&(a?n&&(n[d]!==void 0||n[u]!==void 0)&&(o[d]=cg(a,l,d,void 0,e,!0)):delete o[d]);if(i!==l)for(const d in i)(!t||!Bt(t,d))&&(delete i[d],c=!0)}c&&vi(e.attrs,"set","")}function G2(e,t,n,s){const[o,i]=e.propsOptions;let r=!1,l;if(t)for(let a in t){if(Jr(a))continue;const c=t[a];let u;o&&Bt(o,u=In(a))?!i||!i.includes(u)?n[u]=c:(l||(l={}))[u]=c:rh(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,r=!0)}if(i){const a=It(n),c=l||Tt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=cg(o,a,d,c[d],e,!Bt(c,d))}}return r}function cg(e,t,n,s,o,i){const r=e[n];if(r!=null){const l=Bt(r,"default");if(l&&s===void 0){const a=r.default;if(r.type!==Function&&!r.skipFactory&&gt(a)){const{propsDefaults:c}=o;if(n in c)s=c[n];else{const u=va(o);s=c[n]=a.call(null,t),u()}}else s=a;o.ce&&o.ce._setProp(n,s)}r[0]&&(i&&!l?s=!1:r[1]&&(s===""||s===As(n))&&(s=!0))}return s}const g4=new WeakMap;function Y2(e,t,n=!1){const s=n?g4:t.propsCache,o=s.get(e);if(o)return o;const i=e.props,r={},l=[];let a=!1;if(!gt(e)){const u=d=>{a=!0;const[p,m]=Y2(d,t,!0);Gt(r,p),m&&l.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!i&&!a)return Ft(e)&&s.set(e,zl),zl;if(it(i))for(let u=0;u<i.length;u++){const d=In(i[u]);Ey(d)&&(r[d]=Tt)}else if(i)for(const u in i){const d=In(u);if(Ey(d)){const p=i[u],m=r[d]=it(p)||gt(p)?{type:p}:Gt({},p),f=m.type;let v=!1,w=!0;if(it(f))for(let _=0;_<f.length;++_){const b=f[_],g=gt(b)&&b.name;if(g==="Boolean"){v=!0;break}else g==="String"&&(w=!1)}else v=gt(f)&&f.name==="Boolean";m[0]=v,m[1]=w,(v||Bt(m,"default"))&&l.push(d)}}const c=[r,l];return Ft(e)&&s.set(e,c),c}function Ey(e){return e[0]!=="$"&&!Jr(e)}const D1=e=>e==="_"||e==="_ctx"||e==="$stable",B1=e=>it(e)?e.map(Ms):[Ms(e)],v4=(e,t,n)=>{if(t._n)return t;const s=vn((...o)=>B1(t(...o)),n);return s._c=!1,s},X2=(e,t,n)=>{const s=e._ctx;for(const o in e){if(D1(o))continue;const i=e[o];if(gt(i))t[o]=v4(o,i,s);else if(i!=null){const r=B1(i);t[o]=()=>r}}},Z2=(e,t)=>{const n=B1(t);e.slots.default=()=>n},Q2=(e,t,n)=>{for(const s in t)(n||!D1(s))&&(e[s]=t[s])},y4=(e,t,n)=>{const s=e.slots=V2();if(e.vnode.shapeFlag&32){const o=t._;o?(Q2(s,t,n),n&&e2(s,"_",o,!0)):X2(t,s)}else t&&Z2(e,t)},k4=(e,t,n)=>{const{vnode:s,slots:o}=e;let i=!0,r=Tt;if(s.shapeFlag&32){const l=t._;l?n&&l===1?i=!1:Q2(o,t,n):(i=!t.$stable,X2(t,o)),r=t}else t&&(Z2(e,t),r={default:1});if(i)for(const l in o)!D1(l)&&r[l]==null&&delete o[l]},_n=oS;function b4(e){return J2(e)}function _4(e){return J2(e,DA)}function J2(e,t){const n=Zf();n.__VUE__=!0;const{insert:s,remove:o,patchProp:i,createElement:r,createText:l,createComment:a,setText:c,setElementText:u,parentNode:d,nextSibling:p,setScopeId:m=So,insertStaticContent:f}=e,v=(D,Z,ne,se=null,ae=null,H=null,U=void 0,Q=null,ce=!!Z.dynamicChildren)=>{if(D===Z)return;D&&!$o(D,Z)&&(se=ke(D),Ne(D,ae,H,!0),D=null),Z.patchFlag===-2&&(ce=!1,Z.dynamicChildren=null);const{type:pe,ref:xe,shapeFlag:ie}=Z;switch(pe){case ir:w(D,Z,ne,se);break;case wn:_(D,Z,ne,se);break;case Ql:D==null&&b(Z,ne,se,U);break;case Ie:R(D,Z,ne,se,ae,H,U,Q,ce);break;default:ie&1?k(D,Z,ne,se,ae,H,U,Q,ce):ie&6?O(D,Z,ne,se,ae,H,U,Q,ce):(ie&64||ie&128)&&pe.process(D,Z,ne,se,ae,H,U,Q,ce,z)}xe!=null&&ae?Yl(xe,D&&D.ref,H,Z||D,!Z):xe==null&&D&&D.ref!=null&&Yl(D.ref,null,H,D,!0)},w=(D,Z,ne,se)=>{if(D==null)s(Z.el=l(Z.children),ne,se);else{const ae=Z.el=D.el;Z.children!==D.children&&c(ae,Z.children)}},_=(D,Z,ne,se)=>{D==null?s(Z.el=a(Z.children||""),ne,se):Z.el=D.el},b=(D,Z,ne,se)=>{[D.el,D.anchor]=f(D.children,Z,ne,se,D.el,D.anchor)},g=({el:D,anchor:Z},ne,se)=>{let ae;for(;D&&D!==Z;)ae=p(D),s(D,ne,se),D=ae;s(Z,ne,se)},y=({el:D,anchor:Z})=>{let ne;for(;D&&D!==Z;)ne=p(D),o(D),D=ne;o(Z)},k=(D,Z,ne,se,ae,H,U,Q,ce)=>{if(Z.type==="svg"?U="svg":Z.type==="math"&&(U="mathml"),D==null)$(Z,ne,se,ae,H,U,Q,ce);else{const pe=D.el&&D.el._isVueCE?D.el:null;try{pe&&pe._beginPatch(),T(D,Z,ae,H,U,Q,ce)}finally{pe&&pe._endPatch()}}},$=(D,Z,ne,se,ae,H,U,Q)=>{let ce,pe;const{props:xe,shapeFlag:ie,transition:be,dirs:ze}=D;if(ce=D.el=r(D.type,H,xe&&xe.is,xe),ie&8?u(ce,D.children):ie&16&&S(D.children,ce,null,se,ae,Xp(D,H),U,Q),ze&&Yo(D,null,se,"created"),E(ce,D,D.scopeId,U,se),xe){for(const rt in xe)rt!=="value"&&!Jr(rt)&&i(ce,rt,null,xe[rt],H,se);"value"in xe&&i(ce,"value",null,xe.value,H),(pe=xe.onVnodeBeforeMount)&&Ts(pe,se,D)}ze&&Yo(D,null,se,"beforeMount");const Je=eS(ae,be);Je&&be.beforeEnter(ce),s(ce,Z,ne),((pe=xe&&xe.onVnodeMounted)||Je||ze)&&_n(()=>{try{pe&&Ts(pe,se,D),Je&&be.enter(ce),ze&&Yo(D,null,se,"mounted")}finally{}},ae)},E=(D,Z,ne,se,ae)=>{if(ne&&m(D,ne),se)for(let H=0;H<se.length;H++)m(D,se[H]);if(ae){let H=ae.subTree;if(Z===H||Xd(H.type)&&(H.ssContent===Z||H.ssFallback===Z)){const U=ae.vnode;E(D,U,U.scopeId,U.slotScopeIds,ae.parent)}}},S=(D,Z,ne,se,ae,H,U,Q,ce=0)=>{for(let pe=ce;pe<D.length;pe++){const xe=D[pe]=Q?gi(D[pe]):Ms(D[pe]);v(null,xe,Z,ne,se,ae,H,U,Q)}},T=(D,Z,ne,se,ae,H,U)=>{const Q=Z.el=D.el;let{patchFlag:ce,dynamicChildren:pe,dirs:xe}=Z;ce|=D.patchFlag&16;const ie=D.props||Tt,be=Z.props||Tt;let ze;if(ne&&Br(ne,!1),(ze=be.onVnodeBeforeUpdate)&&Ts(ze,ne,Z,D),xe&&Yo(Z,D,ne,"beforeUpdate"),ne&&Br(ne,!0),(ie.innerHTML&&be.innerHTML==null||ie.textContent&&be.textContent==null)&&u(Q,""),pe?I(D.dynamicChildren,pe,Q,ne,se,Xp(Z,ae),H):U||G(D,Z,Q,null,ne,se,Xp(Z,ae),H,!1),ce>0){if(ce&16)L(Q,ie,be,ne,ae);else if(ce&2&&ie.class!==be.class&&i(Q,"class",null,be.class,ae),ce&4&&i(Q,"style",ie.style,be.style,ae),ce&8){const Je=Z.dynamicProps;for(let rt=0;rt<Je.length;rt++){const Ge=Je[rt],ut=ie[Ge],xt=be[Ge];(xt!==ut||Ge==="value")&&i(Q,Ge,ut,xt,ae,ne)}}ce&1&&D.children!==Z.children&&u(Q,Z.children)}else!U&&pe==null&&L(Q,ie,be,ne,ae);((ze=be.onVnodeUpdated)||xe)&&_n(()=>{ze&&Ts(ze,ne,Z,D),xe&&Yo(Z,D,ne,"updated")},se)},I=(D,Z,ne,se,ae,H,U)=>{for(let Q=0;Q<Z.length;Q++){const ce=D[Q],pe=Z[Q],xe=ce.el&&(ce.type===Ie||!$o(ce,pe)||ce.shapeFlag&198)?d(ce.el):ne;v(ce,pe,xe,null,se,ae,H,U,!0)}},L=(D,Z,ne,se,ae)=>{if(Z!==ne){if(Z!==Tt)for(const H in Z)!Jr(H)&&!(H in ne)&&i(D,H,Z[H],null,ae,se);for(const H in ne){if(Jr(H))continue;const U=ne[H],Q=Z[H];U!==Q&&H!=="value"&&i(D,H,Q,U,ae,se)}"value"in ne&&i(D,"value",Z.value,ne.value,ae)}},R=(D,Z,ne,se,ae,H,U,Q,ce)=>{const pe=Z.el=D?D.el:l(""),xe=Z.anchor=D?D.anchor:l("");let{patchFlag:ie,dynamicChildren:be,slotScopeIds:ze}=Z;ze&&(Q=Q?Q.concat(ze):ze),D==null?(s(pe,ne,se),s(xe,ne,se),S(Z.children||[],ne,xe,ae,H,U,Q,ce)):ie>0&&ie&64&&be&&D.dynamicChildren&&D.dynamicChildren.length===be.length?(I(D.dynamicChildren,be,ne,ae,H,U,Q),(Z.key!=null||ae&&Z===ae.subTree)&&F1(D,Z,!0)):G(D,Z,ne,xe,ae,H,U,Q,ce)},O=(D,Z,ne,se,ae,H,U,Q,ce)=>{Z.slotScopeIds=Q,D==null?Z.shapeFlag&512?ae.ctx.activate(Z,ne,se,U,ce):F(Z,ne,se,ae,H,U,ce):P(D,Z,ce)},F=(D,Z,ne,se,ae,H,U)=>{const Q=D.component=aS(D,se,ae);if(su(D)&&(Q.ctx.renderer=z),uS(Q,!1,U),Q.asyncDep){if(ae&&ae.registerDep(Q,q,U),!D.el){const ce=Q.subTree=mt(wn);_(null,ce,Z,ne),D.placeholder=ce.el}}else q(Q,D,Z,ne,ae,H,U)},P=(D,Z,ne)=>{const se=Z.component=D.component;if(h4(D,Z,ne))if(se.asyncDep&&!se.asyncResolved){K(se,Z,ne);return}else se.next=Z,se.update();else Z.el=D.el,se.vnode=Z},q=(D,Z,ne,se,ae,H,U)=>{const Q=()=>{if(D.isMounted){let{next:ie,bu:be,u:ze,parent:Je,vnode:rt}=D;{const Pt=tS(D);if(Pt){ie&&(ie.el=rt.el,K(D,ie,U)),Pt.asyncDep.then(()=>{_n(()=>{D.isUnmounted||pe()},ae)});return}}let Ge=ie,ut;Br(D,!1),ie?(ie.el=rt.el,K(D,ie,U)):ie=rt,be&&Kl(be),(ut=ie.props&&ie.props.onVnodeBeforeUpdate)&&Ts(ut,Je,ie,rt),Br(D,!0);const xt=_d(D),Ht=D.subTree;D.subTree=xt,v(Ht,xt,d(Ht.el),ke(Ht),D,ae,H),ie.el=xt.el,Ge===null&&lh(D,xt.el),ze&&_n(ze,ae),(ut=ie.props&&ie.props.onVnodeUpdated)&&_n(()=>Ts(ut,Je,ie,rt),ae)}else{let ie;const{el:be,props:ze}=Z,{bm:Je,m:rt,parent:Ge,root:ut,type:xt}=D,Ht=wi(Z);if(Br(D,!1),Je&&Kl(Je),!Ht&&(ie=ze&&ze.onVnodeBeforeMount)&&Ts(ie,Ge,Z),Br(D,!0),be&&fe){const Pt=()=>{D.subTree=_d(D),fe(be,D.subTree,D,ae,null)};Ht&&xt.__asyncHydrate?xt.__asyncHydrate(be,D,Pt):Pt()}else{ut.ce&&ut.ce._hasShadowRoot()&&ut.ce._injectChildStyle(xt,D.parent?D.parent.type:void 0);const Pt=D.subTree=_d(D);v(null,Pt,ne,se,D,ae,H),Z.el=Pt.el}if(rt&&_n(rt,ae),!Ht&&(ie=ze&&ze.onVnodeMounted)){const Pt=Z;_n(()=>Ts(ie,Ge,Pt),ae)}(Z.shapeFlag&256||Ge&&wi(Ge.vnode)&&Ge.vnode.shapeFlag&256)&&D.a&&_n(D.a,ae),D.isMounted=!0,Z=ne=se=null}};D.scope.on();const ce=D.effect=new Hd(Q);D.scope.off();const pe=D.update=ce.run.bind(ce),xe=D.job=ce.runIfDirty.bind(ce);xe.i=D,xe.id=D.uid,ce.scheduler=()=>E1(xe),Br(D,!0),pe()},K=(D,Z,ne)=>{Z.component=D;const se=D.vnode.props;D.vnode=Z,D.next=null,m4(D,Z.props,se,ne),k4(D,Z.children,ne),Ti(),gy(D),Mi()},G=(D,Z,ne,se,ae,H,U,Q,ce=!1)=>{const pe=D&&D.children,xe=D?D.shapeFlag:0,ie=Z.children,{patchFlag:be,shapeFlag:ze}=Z;if(be>0){if(be&128){J(pe,ie,ne,se,ae,H,U,Q,ce);return}else if(be&256){oe(pe,ie,ne,se,ae,H,U,Q,ce);return}}ze&8?(xe&16&&me(pe,ae,H),ie!==pe&&u(ne,ie)):xe&16?ze&16?J(pe,ie,ne,se,ae,H,U,Q,ce):me(pe,ae,H,!0):(xe&8&&u(ne,""),ze&16&&S(ie,ne,se,ae,H,U,Q,ce))},oe=(D,Z,ne,se,ae,H,U,Q,ce)=>{D=D||zl,Z=Z||zl;const pe=D.length,xe=Z.length,ie=Math.min(pe,xe);let be;for(be=0;be<ie;be++){const ze=Z[be]=ce?gi(Z[be]):Ms(Z[be]);v(D[be],ze,ne,null,ae,H,U,Q,ce)}pe>xe?me(D,ae,H,!0,!1,ie):S(Z,ne,se,ae,H,U,Q,ce,ie)},J=(D,Z,ne,se,ae,H,U,Q,ce)=>{let pe=0;const xe=Z.length;let ie=D.length-1,be=xe-1;for(;pe<=ie&&pe<=be;){const ze=D[pe],Je=Z[pe]=ce?gi(Z[pe]):Ms(Z[pe]);if($o(ze,Je))v(ze,Je,ne,null,ae,H,U,Q,ce);else break;pe++}for(;pe<=ie&&pe<=be;){const ze=D[ie],Je=Z[be]=ce?gi(Z[be]):Ms(Z[be]);if($o(ze,Je))v(ze,Je,ne,null,ae,H,U,Q,ce);else break;ie--,be--}if(pe>ie){if(pe<=be){const ze=be+1,Je=ze<xe?Z[ze].el:se;for(;pe<=be;)v(null,Z[pe]=ce?gi(Z[pe]):Ms(Z[pe]),ne,Je,ae,H,U,Q,ce),pe++}}else if(pe>be)for(;pe<=ie;)Ne(D[pe],ae,H,!0),pe++;else{const ze=pe,Je=pe,rt=new Map;for(pe=Je;pe<=be;pe++){const Ke=Z[pe]=ce?gi(Z[pe]):Ms(Z[pe]);Ke.key!=null&&rt.set(Ke.key,pe)}let Ge,ut=0;const xt=be-Je+1;let Ht=!1,Pt=0;const Vn=new Array(xt);for(pe=0;pe<xt;pe++)Vn[pe]=0;for(pe=ze;pe<=ie;pe++){const Ke=D[pe];if(ut>=xt){Ne(Ke,ae,H,!0);continue}let zt;if(Ke.key!=null)zt=rt.get(Ke.key);else for(Ge=Je;Ge<=be;Ge++)if(Vn[Ge-Je]===0&&$o(Ke,Z[Ge])){zt=Ge;break}zt===void 0?Ne(Ke,ae,H,!0):(Vn[zt-Je]=pe+1,zt>=Pt?Pt=zt:Ht=!0,v(Ke,Z[zt],ne,null,ae,H,U,Q,ce),ut++)}const _s=Ht?w4(Vn):zl;for(Ge=_s.length-1,pe=xt-1;pe>=0;pe--){const Ke=Je+pe,zt=Z[Ke],Kn=Z[Ke+1],Ps=Ke+1<xe?Kn.el||nS(Kn):se;Vn[pe]===0?v(null,zt,ne,Ps,ae,H,U,Q,ce):Ht&&(Ge<0||pe!==_s[Ge]?he(zt,ne,Ps,2):Ge--)}}},he=(D,Z,ne,se,ae=null)=>{const{el:H,type:U,transition:Q,children:ce,shapeFlag:pe}=D;if(pe&6){he(D.component.subTree,Z,ne,se);return}if(pe&128){D.suspense.move(Z,ne,se);return}if(pe&64){U.move(D,Z,ne,z);return}if(U===Ie){s(H,Z,ne);for(let ie=0;ie<ce.length;ie++)he(ce[ie],Z,ne,se);s(D.anchor,Z,ne);return}if(U===Ql){g(D,Z,ne);return}if(se!==2&&pe&1&&Q)if(se===0)Q.persisted&&!H[go]?s(H,Z,ne):(Q.beforeEnter(H),s(H,Z,ne),_n(()=>Q.enter(H),ae));else{const{leave:ie,delayLeave:be,afterLeave:ze}=Q,Je=()=>{D.ctx.isUnmounted?o(H):s(H,Z,ne)},rt=()=>{const Ge=H._isLeaving||!!H[go];H._isLeaving&&H[go](!0),Q.persisted&&!Ge?Je():ie(H,()=>{Je(),ze&&ze()})};be?be(H,Je,rt):rt()}else s(H,Z,ne)},Ne=(D,Z,ne,se=!1,ae=!1)=>{const{type:H,props:U,ref:Q,children:ce,dynamicChildren:pe,shapeFlag:xe,patchFlag:ie,dirs:be,cacheIndex:ze,memo:Je}=D;if(ie===-2&&(ae=!1),Q!=null&&(Ti(),Yl(Q,null,ne,D,!0),Mi()),ze!=null&&(Z.renderCache[ze]=void 0),xe&256){Z.ctx.deactivate(D);return}const rt=xe&1&&be,Ge=!wi(D);let ut;if(Ge&&(ut=U&&U.onVnodeBeforeUnmount)&&Ts(ut,Z,D),xe&6)$e(D.component,ne,se);else{if(xe&128){D.suspense.unmount(ne,se);return}rt&&Yo(D,null,Z,"beforeUnmount"),xe&64?D.type.remove(D,Z,ne,z,se):pe&&!pe.hasOnce&&(H!==Ie||ie>0&&ie&64)?me(pe,Z,ne,!1,!0):(H===Ie&&ie&384||!ae&&xe&16)&&me(ce,Z,ne),se&&Fe(D)}const xt=Je!=null&&ze==null;(Ge&&(ut=U&&U.onVnodeUnmounted)||rt||xt)&&_n(()=>{ut&&Ts(ut,Z,D),rt&&Yo(D,null,Z,"unmounted"),xt&&(D.el=null)},ne)},Fe=D=>{const{type:Z,el:ne,anchor:se,transition:ae}=D;if(Z===Ie){We(ne,se);return}if(Z===Ql){y(D);return}const H=()=>{o(ne),ae&&!ae.persisted&&ae.afterLeave&&ae.afterLeave()};if(D.shapeFlag&1&&ae&&!ae.persisted){const{leave:U,delayLeave:Q}=ae,ce=()=>U(ne,H);Q?Q(D.el,H,ce):ce()}else H()},We=(D,Z)=>{let ne;for(;D!==Z;)ne=p(D),o(D),D=ne;o(Z)},$e=(D,Z,ne)=>{const{bum:se,scope:ae,job:H,subTree:U,um:Q,m:ce,a:pe}=D;Yd(ce),Yd(pe),se&&Kl(se),ae.stop(),H&&(H.flags|=8,Ne(U,D,Z,ne)),Q&&_n(Q,Z),_n(()=>{D.isUnmounted=!0},Z)},me=(D,Z,ne,se=!1,ae=!1,H=0)=>{for(let U=H;U<D.length;U++)Ne(D[U],Z,ne,se,ae)},ke=D=>{if(D.shapeFlag&6)return ke(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const Z=p(D.anchor||D.el),ne=Z&&Z[E2];return ne?p(ne):Z};let _e=!1;const ue=(D,Z,ne)=>{let se;D==null?Z._vnode&&(Ne(Z._vnode,null,null,!0),se=Z._vnode.component):v(Z._vnode||null,D,Z,null,null,null,ne),Z._vnode=D,_e||(_e=!0,gy(se),Vd(),_e=!1)},z={p:v,um:Ne,m:he,r:Fe,mt:F,mc:S,pc:G,pbc:I,n:ke,o:e};let X,fe;return t&&([X,fe]=t(z)),{render:ue,hydrate:X,createApp:l4(ue,X)}}function Xp({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Br({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function eS(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function F1(e,t,n=!1){const s=e.children,o=t.children;if(it(s)&&it(o))for(let i=0;i<s.length;i++){const r=s[i];let l=o[i];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=o[i]=gi(o[i]),l.el=r.el),!n&&l.patchFlag!==-2&&F1(r,l)),l.type===ir&&(l.patchFlag===-1&&(l=o[i]=gi(l)),l.el=r.el),l.type===wn&&!l.el&&(l.el=r.el)}}function w4(e){const t=e.slice(),n=[0];let s,o,i,r,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(o=n[n.length-1],e[o]<c){t[s]=o,n.push(s);continue}for(i=0,r=n.length-1;i<r;)l=i+r>>1,e[n[l]]<c?i=l+1:r=l;c<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}for(i=n.length,r=n[i-1];i-- >0;)n[i]=r,r=t[r];return n}function tS(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:tS(t)}function Yd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function nS(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?nS(t.subTree):null}const Xd=e=>e.__isSuspense;let ug=0;const S4={name:"Suspense",__isSuspense:!0,process(e,t,n,s,o,i,r,l,a,c){if(e==null)C4(t,n,s,o,i,r,l,a,c);else{if(i&&i.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}x4(e,t,n,s,o,r,l,a,c)}},hydrate:T4,normalize:M4},Jde=S4;function Dc(e,t){const n=e.props&&e.props[t];gt(n)&&n()}function C4(e,t,n,s,o,i,r,l,a){const{p:c,o:{createElement:u}}=a,d=u("div"),p=e.suspense=sS(e,o,s,t,d,n,i,r,l,a);c(null,p.pendingBranch=e.ssContent,d,null,s,p,i,r),p.deps>0?(Dc(e,"onPending"),Dc(e,"onFallback"),c(null,e.ssFallback,t,n,s,null,i,r),Zl(p,e.ssFallback)):p.resolve(!1,!0)}function x4(e,t,n,s,o,i,r,l,{p:a,um:c,o:{createElement:u}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const p=t.ssContent,m=t.ssFallback,{activeBranch:f,pendingBranch:v,isInFallback:w,isHydrating:_}=d;if(v)d.pendingBranch=p,$o(v,p)?(a(v,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():w&&(_||(a(f,m,n,s,o,null,i,r,l),Zl(d,m)))):(d.pendingId=ug++,_?(d.isHydrating=!1,d.activeBranch=v):c(v,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u("div"),w?(a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0?d.resolve():(a(f,m,n,s,o,null,i,r,l),Zl(d,m))):f&&$o(f,p)?(a(f,p,n,s,o,d,i,r,l),d.resolve(!0)):(a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0&&d.resolve()));else if(f&&$o(f,p))a(f,p,n,s,o,d,i,r,l),Zl(d,p);else if(Dc(t,"onPending"),d.pendingBranch=p,p.shapeFlag&512?d.pendingId=p.component.suspenseId:d.pendingId=ug++,a(null,p,d.hiddenContainer,null,o,d,i,r,l),d.deps<=0)d.resolve();else{const{timeout:b,pendingId:g}=d;b>0?setTimeout(()=>{d.pendingId===g&&d.fallback(m)},b):b===0&&d.fallback(m)}}function sS(e,t,n,s,o,i,r,l,a,c,u=!1){const{p:d,m:p,um:m,n:f,o:{parentNode:v,remove:w}}=c;let _;const b=A4(e);b&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);const g=e.props?Fd(e.props.timeout):void 0,y=i,k={vnode:e,parent:t,parentComponent:n,namespace:r,container:s,hiddenContainer:o,deps:0,pendingId:ug++,timeout:typeof g=="number"?g:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve($=!1,E=!1){const{vnode:S,activeBranch:T,pendingBranch:I,pendingId:L,effects:R,parentComponent:O,container:F,isInFallback:P}=k;let q=!1;if(k.isHydrating)k.isHydrating=!1;else if(!$){q=T&&I.transition&&I.transition.mode==="out-in";let oe=!1;q&&(T.transition.afterLeave=()=>{L===k.pendingId&&(p(I,F,i===y&&!oe?f(T):i,0),zd(R),P&&S.ssFallback&&(S.ssFallback.el=null))}),T&&!k.isFallbackMountPending&&(v(T.el)===F&&(i=f(T),oe=!0),m(T,O,k,!0),!q&&P&&S.ssFallback&&_n(()=>S.ssFallback.el=null,k)),q||p(I,F,i,0)}k.isFallbackMountPending=!1,Zl(k,I),k.pendingBranch=null,k.isInFallback=!1;let K=k.parent,G=!1;for(;K;){if(K.pendingBranch){K.effects.push(...R),G=!0;break}K=K.parent}!G&&!q&&zd(R),k.effects=[],b&&t&&t.pendingBranch&&_===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),Dc(S,"onResolve")},fallback($){if(!k.pendingBranch)return;const{vnode:E,activeBranch:S,parentComponent:T,container:I,namespace:L}=k;Dc(E,"onFallback");const R=f(S),O=()=>{k.isFallbackMountPending=!1,k.isInFallback&&(d(null,$,I,R,T,null,L,l,a),Zl(k,$))},F=$.transition&&$.transition.mode==="out-in";F&&(k.isFallbackMountPending=!0,S.transition.afterLeave=O),k.isInFallback=!0,m(S,T,null,!0),F||O()},move($,E,S){k.activeBranch&&p(k.activeBranch,$,E,S),k.container=$},next(){return k.activeBranch&&f(k.activeBranch)},registerDep($,E,S){const T=!!k.pendingBranch;T&&k.deps++;const I=$.vnode.el;$.asyncDep.catch(L=>{ga(L,$,0)}).then(L=>{if($.isUnmounted||k.isUnmounted||k.pendingId!==$.suspenseId)return;Bc(),$.asyncResolved=!0;const{vnode:R}=$;dg($,L,!1),I&&(R.el=I);const O=!I&&$.subTree.el;E($,R,v(I||$.subTree.el),I?null:f($.subTree),k,r,S),O&&(R.placeholder=null,w(O)),lh($,R.el),T&&--k.deps===0&&k.resolve()})},unmount($,E){k.isUnmounted=!0,k.activeBranch&&m(k.activeBranch,n,$,E),k.pendingBranch&&m(k.pendingBranch,n,$,E)}};return k}function T4(e,t,n,s,o,i,r,l,a){const c=t.suspense=sS(t,s,n,e.parentNode,document.createElement("div"),null,o,i,r,l,!0),u=a(e,c.pendingBranch=t.ssContent,n,c,i,r);return c.deps===0&&c.resolve(!1,!0),u}function M4(e){const{shapeFlag:t,children:n}=e,s=t&32;e.ssContent=Iy(s?n.default:n),e.ssFallback=s?Iy(n.fallback):mt(wn)}function Iy(e){let t;if(gt(e)){const n=ol&&e._c;n&&(e._d=!1,C()),e=e(),n&&(e._d=!0,t=os,iS())}return it(e)&&(e=u4(e)),e=Ms(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function oS(e,t){t&&t.pendingBranch?it(e)?t.effects.push(...e):t.effects.push(e):zd(e)}function Zl(e,t){e.activeBranch=t;const{vnode:n,parentComponent:s}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,s&&s.subTree===n&&(s.vnode.el=o,lh(s,o))}function A4(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Ie=Symbol.for("v-fgt"),ir=Symbol.for("v-txt"),wn=Symbol.for("v-cmt"),Ql=Symbol.for("v-stc"),gc=[];let os=null;function C(e=!1){gc.push(os=e?null:[])}function iS(){gc.pop(),os=gc[gc.length-1]||null}let ol=1;function Zd(e,t=!1){ol+=e,e<0&&os&&t&&(os.hasOnce=!0)}function rS(e){return e.dynamicChildren=ol>0?os||zl:null,iS(),ol>0&&os&&os.push(e),e}function A(e,t,n,s,o,i){return rS(h(e,t,n,s,o,i,!0))}function je(e,t,n,s,o){return rS(mt(e,t,n,s,o,!0))}function ur(e){return e?e.__v_isVNode===!0:!1}function $o(e,t){return e.type===t.type&&e.key===t.key}function efe(e){}const lS=({key:e})=>e??null,wd=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Zt(e)||Cn(e)||gt(e)?{i:zn,r:e,k:t,f:!!n}:e:null);function h(e,t=null,n=null,s=0,o=null,i=e===Ie?0:1,r=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&lS(t),ref:t&&wd(t),scopeId:oh,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:zn};return l?(H1(a,n),i&128&&e.normalize(a)):n&&(a.shapeFlag|=Zt(n)?8:16),ol>0&&!r&&os&&(a.patchFlag>0||i&6)&&a.patchFlag!==32&&os.push(a),a}const mt=E4;function E4(e,t=null,n=null,s=0,o=null,i=!1){if((!e||e===B2)&&(e=wn),ur(e)){const l=Ei(e,t,!0);return n&&H1(l,n),ol>0&&!i&&os&&(l.shapeFlag&6?os[os.indexOf(e)]=l:os.push(l)),l.patchFlag=-2,l}if(R4(e)&&(e=e.__vccOpts),t){t=I4(t);let{class:l,style:a}=t;l&&!Zt(l)&&(t.class=Ee(l)),Ft(a)&&(sh(a)&&!it(a)&&(a=Gt({},a)),t.style=$t(a))}const r=Zt(e)?1:Xd(e)?128:I2(e)?64:Ft(e)?4:gt(e)?2:0;return h(e,t,n,s,o,r,i,!0)}function I4(e){return e?sh(e)||K2(e)?Gt({},e):e:null}function Ei(e,t,n=!1,s=!1){const{props:o,ref:i,patchFlag:r,children:l,transition:a}=e,c=t?Kt(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&lS(c),ref:t&&t.ref?n&&i?it(i)?i.concat(wd(t)):[i,wd(t)]:wd(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ie?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ei(e.ssContent),ssFallback:e.ssFallback&&Ei(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&cr(u,a.clone(u)),u}function ht(e=" ",t=0){return mt(ir,null,e,t)}function dr(e,t){const n=mt(Ql,null,e);return n.staticCount=t,n}function re(e="",t=!1){return t?(C(),je(wn,null,e)):mt(wn,null,e)}function Ms(e){return e==null||typeof e=="boolean"?mt(wn):it(e)?mt(Ie,null,e.slice()):ur(e)?gi(e):mt(ir,null,String(e))}function gi(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ei(e)}function H1(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(it(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),H1(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!K2(t)?t._ctx=zn:o===3&&zn&&(zn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else gt(t)?(t={default:t,_ctx:zn},n=32):(t=String(t),s&64?(n=16,t=[ht(t)]):n=8);e.children=t,e.shapeFlag|=n}function Kt(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=Ee([t.class,s.class]));else if(o==="style")t.style=$t([t.style,s.style]);else if(eu(o)){const i=t[o],r=s[o];r&&i!==r&&!(it(i)&&i.includes(r))?t[o]=i?[].concat(i,r):r:r==null&&i==null&&!zf(o)&&(t[o]=r)}else o!==""&&(t[o]=s[o])}return t}function Ts(e,t,n,s=null){To(e,t,7,[n,s])}const $4=W2();let N4=0;function aS(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||$4,i={uid:N4++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new o2(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Y2(s,o),emitsOptions:q2(s,o),emit:null,emitted:null,propsDefaults:Tt,inheritAttrs:s.inheritAttrs,ctx:Tt,data:Tt,props:Tt,attrs:Tt,slots:Tt,refs:Tt,setupState:Tt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=a4.bind(null,i),e.ce&&e.ce(i),i}let qn=null;const rs=()=>qn||zn;let Qd,Jl;{const e=Zf(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),i=>{o.length>1?o.forEach(r=>r(i)):o[0](i)}};Qd=t("__VUE_INSTANCE_SETTERS__",n=>qn=n),Jl=t("__VUE_SSR_SETTERS__",n=>il=n)}const va=e=>{const t=qn;return Qd(e),e.scope.on(),()=>{e.scope.off(),Qd(t)}},Bc=()=>{qn&&qn.scope.off(),Qd(null)};function cS(e){return e.vnode.shapeFlag&4}let il=!1;function uS(e,t=!1,n=!1){t&&Jl(t);const{props:s,children:o}=e.vnode,i=cS(e);p4(e,s,i,t),y4(e,o,n||t);const r=i?L4(e,t):void 0;return t&&Jl(!1),r}function L4(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rg);const{setup:s}=n;if(s){Ti();const o=e.setupContext=s.length>1?fS(e):null,i=va(e),r=tu(s,e,0,[e.props,o]),l=S1(r);if(Mi(),i(),(l||e.sp)&&!wi(e)&&$1(e),l){if(r.then(Bc,Bc),t)return r.then(a=>{dg(e,a,t)}).catch(a=>{ga(a,e,0)});e.asyncDep=r}else dg(e,r,t)}else dS(e,t)}function dg(e,t,n){gt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ft(t)&&(e.setupState=_2(t)),dS(e,n)}let Jd,fg;function tfe(e){Jd=e,fg=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,e4))}}const nfe=()=>!Jd;function dS(e,t,n){const s=e.type;if(!e.render){if(!t&&Jd&&!s.render){const o=s.template||P1(e).template;if(o){const{isCustomElement:i,compilerOptions:r}=e.appContext.config,{delimiters:l,compilerOptions:a}=s,c=Gt(Gt({isCustomElement:i,delimiters:l},r),a);s.render=Jd(o,c)}}e.render=s.render||So,fg&&fg(e)}{const o=va(e);Ti();try{t4(e)}finally{Mi(),o()}}}const O4={get(e,t){return ns(e,"get",""),e[t]}};function fS(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,O4),slots:e.slots,emit:e.emit,expose:t}}function iu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_2(tr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in mc)return mc[n](e)},has(t,n){return n in t||n in mc}})):e.proxy}function hg(e,t=!0){return gt(e)?e.displayName||e.name:e.name||t&&e.__name}function R4(e){return gt(e)&&"__vccOpts"in e}const j=(e,t)=>vA(e,t,il);function Ut(e,t,n){try{Zd(-1);const s=arguments.length;return s===2?Ft(t)&&!it(t)?ur(t)?mt(e,null,[t]):mt(e,t):mt(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&ur(n)&&(n=[n]),mt(e,t,n))}finally{Zd(1)}}function sfe(){}function ofe(e,t,n,s){const o=n[s];if(o&&P4(o,e))return o;const i=t();return i.memo=e.slice(),i.cacheIndex=s,n[s]=i}function P4(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let s=0;s<n.length;s++)if(Un(n[s],t[s]))return!1;return ol>0&&os&&os.push(e),!0}const D4="3.5.35",ife=So,rfe=wA,lfe=Bl,afe=M2,B4={createComponentInstance:aS,setupComponent:uS,renderComponentRoot:_d,setCurrentRenderingInstance:Oc,isVNode:ur,normalizeVNode:Ms,getComponentPublicInstance:iu,ensureValidVNode:R1,pushWarningContext:bA,popWarningContext:_A},cfe=B4,ufe=null,dfe=null,ffe=null;/**
17
+ * @vue/runtime-dom v3.5.35
18
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
19
+ * @license MIT
20
+ **/let pg;const $y=typeof window<"u"&&window.trustedTypes;if($y)try{pg=$y.createPolicy("vue",{createHTML:e=>e})}catch{}const hS=pg?e=>pg.createHTML(e):e=>e,F4="http://www.w3.org/2000/svg",H4="http://www.w3.org/1998/Math/MathML",pi=typeof document<"u"?document:null,Ny=pi&&pi.createElement("template"),W4={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?pi.createElementNS(F4,e):t==="mathml"?pi.createElementNS(H4,e):n?pi.createElement(e,{is:n}):pi.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>pi.createTextNode(e),createComment:e=>pi.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>pi.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,i){const r=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===i||!(o=o.nextSibling)););else{Ny.innerHTML=hS(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=Ny.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ui="transition",Ga="animation",ca=Symbol("_vtc"),pS={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},mS=Gt({},N2,pS),U4=e=>(e.displayName="Transition",e.props=mS,e),Si=U4((e,{slots:t})=>Ut(OA,gS(e),t)),Fr=(e,t=[])=>{it(e)?e.forEach(n=>n(...t)):e&&e(...t)},Ly=e=>e?it(e)?e.some(t=>t.length>1):e.length>1:!1;function gS(e){const t={};for(const R in e)R in pS||(t[R]=e[R]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:i=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=i,appearActiveClass:c=r,appearToClass:u=l,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,f=q4(o),v=f&&f[0],w=f&&f[1],{onBeforeEnter:_,onEnter:b,onEnterCancelled:g,onLeave:y,onLeaveCancelled:k,onBeforeAppear:$=_,onAppear:E=b,onAppearCancelled:S=g}=t,T=(R,O,F,P)=>{R._enterCancelled=P,Yi(R,O?u:l),Yi(R,O?c:r),F&&F()},I=(R,O)=>{R._isLeaving=!1,Yi(R,d),Yi(R,m),Yi(R,p),O&&O()},L=R=>(O,F)=>{const P=R?E:b,q=()=>T(O,R,F);Fr(P,[O,q]),Oy(()=>{Yi(O,R?a:i),Vo(O,R?u:l),Ly(P)||Ry(O,s,v,q)})};return Gt(t,{onBeforeEnter(R){Fr(_,[R]),Vo(R,i),Vo(R,r)},onBeforeAppear(R){Fr($,[R]),Vo(R,a),Vo(R,c)},onEnter:L(!1),onAppear:L(!0),onLeave(R,O){R._isLeaving=!0;const F=()=>I(R,O);Vo(R,d),R._enterCancelled?(Vo(R,p),mg(R)):(mg(R),Vo(R,p)),Oy(()=>{R._isLeaving&&(Yi(R,d),Vo(R,m),Ly(y)||Ry(R,s,w,F))}),Fr(y,[R,F])},onEnterCancelled(R){T(R,!1,void 0,!0),Fr(g,[R])},onAppearCancelled(R){T(R,!0,void 0,!0),Fr(S,[R])},onLeaveCancelled(R){I(R),Fr(k,[R])}})}function q4(e){if(e==null)return null;if(Ft(e))return[Zp(e.enter),Zp(e.leave)];{const t=Zp(e);return[t,t]}}function Zp(e){return Fd(e)}function Vo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[ca]||(e[ca]=new Set)).add(t)}function Yi(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[ca];n&&(n.delete(t),n.size||(e[ca]=void 0))}function Oy(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let j4=0;function Ry(e,t,n,s){const o=e._endId=++j4,i=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(i,n);const{type:r,timeout:l,propCount:a}=vS(e,t);if(!r)return s();const c=r+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++u>=a&&d()};setTimeout(()=>{u<a&&d()},l+1),e.addEventListener(c,p)}function vS(e,t){const n=window.getComputedStyle(e),s=f=>(n[f]||"").split(", "),o=s(`${Ui}Delay`),i=s(`${Ui}Duration`),r=Py(o,i),l=s(`${Ga}Delay`),a=s(`${Ga}Duration`),c=Py(l,a);let u=null,d=0,p=0;t===Ui?r>0&&(u=Ui,d=r,p=i.length):t===Ga?c>0&&(u=Ga,d=c,p=a.length):(d=Math.max(r,c),u=d>0?r>c?Ui:Ga:null,p=u?u===Ui?i.length:a.length:0);const m=u===Ui&&/\b(?:transform|all)(?:,|$)/.test(s(`${Ui}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:m}}function Py(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>Dy(n)+Dy(e[s])))}function Dy(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function mg(e){return(e?e.ownerDocument:document).body.offsetHeight}function z4(e,t,n){const s=e[ca];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const ef=Symbol("_vod"),yS=Symbol("_vsh"),No={name:"show",beforeMount(e,{value:t},{transition:n}){e[ef]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ya(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Ya(e,!0),s.enter(e)):s.leave(e,()=>{Ya(e,!1)}):Ya(e,t))},beforeUnmount(e,{value:t}){Ya(e,t)}};function Ya(e,t){e.style.display=t?e[ef]:"none",e[yS]=!t}function V4(){No.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const kS=Symbol("");function hfe(e){const t=rs();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(i=>tf(i,o))},s=()=>{const o=e(t.proxy);t.ce?tf(t.ce,o):gg(t.subTree,o),n(o)};D2(()=>{zd(s)}),Jt(()=>{Ve(s,So,{flush:"post"});const o=new MutationObserver(s);o.observe(t.subTree.el.parentNode,{childList:!0}),qt(()=>o.disconnect())})}function gg(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{gg(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)tf(e.el,t);else if(e.type===Ie)e.children.forEach(n=>gg(n,t));else if(e.type===Ql){let{el:n,anchor:s}=e;for(;n&&(tf(n,t),n!==s);)n=n.nextSibling}}function tf(e,t){if(e.nodeType===1){const n=e.style;let s="";for(const o in t){const i=qM(t[o]);n.setProperty(`--${o}`,i),s+=`--${o}: ${i};`}n[kS]=s}}const K4=/(?:^|;)\s*display\s*:/;function G4(e,t,n){const s=e.style,o=Zt(n);let i=!1;if(n&&!o){if(t)if(Zt(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&rc(s,l,"")}else for(const r in t)n[r]==null&&rc(s,r,"");for(const r in n){r==="display"&&(i=!0);const l=n[r];l!=null?X4(e,r,!Zt(t)&&t?t[r]:void 0,l)||rc(s,r,l):rc(s,r,"")}}else if(o){if(t!==n){const r=s[kS];r&&(n+=";"+r),s.cssText=n,i=K4.test(n)}}else t&&e.removeAttribute("style");ef in e&&(e[ef]=i?s.display:"",e[yS]&&(s.display="none"))}const By=/\s*!important$/;function rc(e,t,n){if(it(n))n.forEach(s=>rc(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=Y4(e,t);By.test(n)?e.setProperty(As(s),n.replace(By,""),"important"):e[s]=n}}const Fy=["Webkit","Moz","ms"],Qp={};function Y4(e,t){const n=Qp[t];if(n)return n;let s=In(t);if(s!=="filter"&&s in e)return Qp[t]=s;s=Yf(s);for(let o=0;o<Fy.length;o++){const i=Fy[o]+s;if(i in e)return Qp[t]=i}return t}function X4(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Zt(s)&&n===s}const Hy="http://www.w3.org/1999/xlink";function Wy(e,t,n,s,o,i=WM(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Hy,t.slice(6,t.length)):e.setAttributeNS(Hy,t,n):n==null||i&&!t2(n)?e.removeAttribute(t):e.setAttribute(t,i?"":eo(n)?String(n):n)}function Uy(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?hS(n):n);return}const i=e.tagName;if(t==="value"&&i!=="PROGRESS"&&!i.includes("-")){const l=i==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=t2(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(o||t)}function ki(e,t,n,s){e.addEventListener(t,n,s)}function Z4(e,t,n,s){e.removeEventListener(t,n,s)}const qy=Symbol("_vei");function Q4(e,t,n,s,o=null){const i=e[qy]||(e[qy]={}),r=i[t];if(s&&r)r.value=s;else{const[l,a]=J4(t);if(s){const c=i[t]=nE(s,o);ki(e,l,c,a)}else r&&(Z4(e,l,r,a),i[t]=void 0)}}const jy=/(?:Once|Passive|Capture)$/;function J4(e){let t;if(jy.test(e)){t={};let s;for(;s=e.match(jy);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):As(e.slice(2)),t]}let Jp=0;const eE=Promise.resolve(),tE=()=>Jp||(eE.then(()=>Jp=0),Jp=Date.now());function nE(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(it(o)){const i=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{i.call(s),s._stopped=!0};const r=o.slice(),l=[s];for(let a=0;a<r.length&&!s._stopped;a++){const c=r[a];c&&To(c,t,5,l)}}else To(o,t,5,[s])};return n.value=e,n.attached=tE(),n}const zy=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,sE=(e,t,n,s,o,i)=>{const r=o==="svg";t==="class"?z4(e,s,r):t==="style"?G4(e,n,s):eu(t)?zf(t)||Q4(e,t,n,s,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):oE(e,t,s,r))?(Uy(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Wy(e,t,s,r,i,t!=="value")):e._isVueCE&&(iE(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Zt(s)))?Uy(e,In(t),s,i,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Wy(e,t,s,r))};function oE(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&zy(t)&&gt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return zy(t)&&Zt(n)?!1:t in e}function iE(e,t){const n=e._def.props;if(!n)return!1;const s=In(t);return Array.isArray(n)?n.some(o=>In(o)===s):Object.keys(n).some(o=>In(o)===s)}const Vy={};function rE(e,t,n){let s=Ze(e,t);Vf(s)&&(s=Gt({},s,t));class o extends W1{constructor(r){super(s,r,n)}}return o.def=s,o}const pfe=((e,t)=>rE(e,t,wE)),lE=typeof HTMLElement<"u"?HTMLElement:class{};class W1 extends lE{constructor(t,n={},s=rf){super(),this._def=t,this._props=n,this._createApp=s,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&s!==rf?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Gt({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof W1){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,ft(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let s=0;s<this.attributes.length;s++)this._setAttr(this.attributes[s].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const t=(s,o=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:r}=s;let l;if(i&&!it(i))for(const a in i){const c=i[a];(c===Number||c&&c.type===Number)&&(a in this._props&&(this._props[a]=Fd(this._props[a])),(l||(l=Object.create(null)))[In(a)]=!0)}this._numberProps=l,this._resolveProps(s),this.shadowRoot&&this._applyStyles(r),this._mount(s)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(s=>{s.configureApp=this._def.configureApp,t(this._def=s,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const s in n)Bt(this,s)||Object.defineProperty(this,s,{get:()=>M(n[s])})}_resolveProps(t){const{props:n}=t,s=it(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&s.includes(o)&&this._setProp(o,this[o]);for(const o of s.map(In))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(i){this._setProp(o,i,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let s=n?this.getAttribute(t):Vy;const o=In(t);n&&this._numberProps&&this._numberProps[o]&&(s=Fd(s)),this._setProp(o,s,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,s=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===Vy?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),s)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(As(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(As(t),n+""):n||this.removeAttribute(As(t)),i&&i.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),_E(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=mt(this._def,Gt(t,this._props));return this._instance||(n.ce=s=>{this._instance=s,s.ce=this,s.isCE=!0;const o=(i,r)=>{this.dispatchEvent(new CustomEvent(i,Vf(r[0])?Gt({detail:r},r[0]):{detail:r}))};s.emit=(i,...r)=>{o(i,r),As(i)!==i&&o(As(i),r)},this._setParent()}),n}_applyStyles(t,n,s){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,i=this.shadowRoot,r=s?this._getStyleAnchor(s)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let l=null;for(let a=t.length-1;a>=0;a--){const c=document.createElement("style");o&&c.setAttribute("nonce",o),c.textContent=t[a],i.insertBefore(c,l||r),l=c,a===0&&(s||this._styleAnchors.set(this._def,c),n&&this._styleAnchors.set(n,c))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n<t.childNodes.length;n++){const s=t.childNodes[n];if(!(s instanceof HTMLStyleElement))return s}return null}_parseSlots(){const t=this._slots={};let n;for(;n=this.firstChild;){const s=n.nodeType===1&&n.getAttribute("slot")||"default";(t[s]||(t[s]=[])).push(n),this.removeChild(n)}}_renderSlots(){const t=this._getSlots(),n=this._instance.type.__scopeId;for(let s=0;s<t.length;s++){const o=t[s],i=o.getAttribute("name")||"default",r=this._slots[i],l=o.parentNode;if(r)for(const a of r){if(n&&a.nodeType===1){const c=n+"-s",u=document.createTreeWalker(a,1);a.setAttribute(c,"");let d;for(;d=u.nextNode();)d.setAttribute(c,"")}l.insertBefore(a,o)}else for(;o.firstChild;)l.insertBefore(o.firstChild,o);l.removeChild(o)}}_getSlots(){const t=[this];this._teleportTargets&&t.push(...this._teleportTargets);const n=new Set;for(const s of t){const o=s.querySelectorAll("slot");for(let i=0;i<o.length;i++)n.add(o[i])}return Array.from(n)}_injectChildStyle(t,n){this._applyStyles(t.styles,t,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(t){}}function aE(e){const t=rs(),n=t&&t.ce;return n||null}function mfe(){const e=aE();return e&&e.shadowRoot}function gfe(e="$style"){{const t=rs();if(!t)return Tt;const n=t.type.__cssModules;if(!n)return Tt;const s=n[e];return s||Tt}}const bS=new WeakMap,_S=new WeakMap,nf=Symbol("_moveCb"),Ky=Symbol("_enterCb"),cE=e=>(delete e.props.mode,e),uE=cE({name:"TransitionGroup",props:Gt({},mS,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=rs(),s=$2();let o,i;return N1(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!pE(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(dE),o.forEach(fE);const l=o.filter(hE);mg(n.vnode.el),l.forEach(a=>{const c=a.el,u=c.style;Vo(c,r),u.transform=u.webkitTransform=u.transitionDuration="";const d=c[nf]=p=>{p&&p.target!==c||(!p||p.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",d),c[nf]=null,Yi(c,r))};c.addEventListener("transitionend",d)}),o=[]}),()=>{const r=It(e),l=gS(r);let a=r.tag||Ie;if(o=[],i)for(let c=0;c<i.length;c++){const u=i[c];u.el&&u.el instanceof Element&&(o.push(u),cr(u,Rc(u,l,s,n)),bS.set(u,wS(u.el)))}i=t.default?I1(t.default()):[];for(let c=0;c<i.length;c++){const u=i[c];u.key!=null&&cr(u,Rc(u,l,s,n))}return mt(a,null,i)}}}),vfe=uE;function dE(e){const t=e.el;t[nf]&&t[nf](),t[Ky]&&t[Ky]()}function fE(e){_S.set(e,wS(e.el))}function hE(e){const t=bS.get(e),n=_S.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const i=e.el,r=i.style,l=i.getBoundingClientRect();let a=1,c=1;return i.offsetWidth&&(a=l.width/i.offsetWidth),i.offsetHeight&&(c=l.height/i.offsetHeight),(!Number.isFinite(a)||a===0)&&(a=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(a-1)<.01&&(a=1),Math.abs(c-1)<.01&&(c=1),r.transform=r.webkitTransform=`translate(${s/a}px,${o/c}px)`,r.transitionDuration="0s",e}}function wS(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function pE(e,t,n){const s=e.cloneNode(),o=e[ca];o&&o.forEach(l=>{l.split(/\s+/).forEach(a=>a&&s.classList.remove(a))}),n.split(/\s+/).forEach(l=>l&&s.classList.add(l)),s.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(s);const{hasTransform:r}=vS(s);return i.removeChild(s),r}const fr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return it(t)?n=>Kl(t,n):t};function mE(e){e.target.composing=!0}function Gy(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Co=Symbol("_assign");function Yy(e,t,n){return t&&(e=e.trim()),n&&(e=Xf(e)),e}const yn={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e[Co]=fr(o);const i=s||o.props&&o.props.type==="number";ki(e,t?"change":"input",r=>{r.target.composing||e[Co](Yy(e.value,n,i))}),(n||i)&&ki(e,"change",()=>{e.value=Yy(e.value,n,i)}),t||(ki(e,"compositionstart",mE),ki(e,"compositionend",Gy),ki(e,"change",Gy))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:i}},r){if(e[Co]=fr(r),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?Xf(e.value):e.value,a=t??"";if(l===a)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===a)||(e.value=a)}},sf={deep:!0,created(e,t,n){e[Co]=fr(n),ki(e,"change",()=>{const s=e._modelValue,o=ua(e),i=e.checked,r=e[Co];if(it(s)){const l=Qf(s,o),a=l!==-1;if(i&&!a)r(s.concat(o));else if(!i&&a){const c=[...s];c.splice(l,1),r(c)}}else if(ll(s)){const l=new Set(s);i?l.add(o):l.delete(o),r(l)}else r(CS(e,i))})},mounted:Xy,beforeUpdate(e,t,n){e[Co]=fr(n),Xy(e,t,n)}};function Xy(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(it(t))o=Qf(t,s.props.value)>-1;else if(ll(t))o=t.has(s.props.value);else{if(t===n)return;o=xi(t,CS(e,!0))}e.checked!==o&&(e.checked=o)}const SS={created(e,{value:t},n){e.checked=xi(t,n.props.value),e[Co]=fr(n),ki(e,"change",()=>{e[Co](ua(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Co]=fr(s),t!==n&&(e.checked=xi(t,s.props.value))}},of={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const o=ll(t);ki(e,"change",()=>{const i=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Xf(ua(r)):ua(r));e[Co](e.multiple?o?new Set(i):i:i[0]),e._assigning=!0,ft(()=>{e._assigning=!1})}),e[Co]=fr(s)},mounted(e,{value:t}){Zy(e,t)},beforeUpdate(e,t,n){e[Co]=fr(n)},updated(e,{value:t}){e._assigning||Zy(e,t)}};function Zy(e,t){const n=e.multiple,s=it(t);if(!(n&&!s&&!ll(t))){for(let o=0,i=e.options.length;o<i;o++){const r=e.options[o],l=ua(r);if(n)if(s){const a=typeof l;a==="string"||a==="number"?r.selected=t.some(c=>String(c)===String(l)):r.selected=Qf(t,l)>-1}else r.selected=t.has(l);else if(xi(ua(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ua(e){return"_value"in e?e._value:e.value}function CS(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const gE={created(e,t,n){Xu(e,t,n,null,"created")},mounted(e,t,n){Xu(e,t,n,null,"mounted")},beforeUpdate(e,t,n,s){Xu(e,t,n,s,"beforeUpdate")},updated(e,t,n,s){Xu(e,t,n,s,"updated")}};function xS(e,t){switch(e){case"SELECT":return of;case"TEXTAREA":return yn;default:switch(t){case"checkbox":return sf;case"radio":return SS;default:return yn}}}function Xu(e,t,n,s,o){const r=xS(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,s)}function vE(){yn.getSSRProps=({value:e})=>({value:e}),SS.getSSRProps=({value:e},t)=>{if(t.props&&xi(t.props.value,e))return{checked:!0}},sf.getSSRProps=({value:e},t)=>{if(it(e)){if(t.props&&Qf(e,t.props.value)>-1)return{checked:!0}}else if(ll(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},gE.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=xS(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const yE=["ctrl","shift","alt","meta"],kE={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>yE.some(n=>e[`${n}Key`]&&!t.includes(n))},Ye=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...i)=>{for(let r=0;r<t.length;r++){const l=kE[t[r]];if(l&&l(o,t))return}return e(o,...i)}))},bE={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},_o=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const i=As(o.key);if(t.some(r=>r===i||bE[r]===i))return e(o)}))},TS=Gt({patchProp:sE},W4);let vc,Qy=!1;function MS(){return vc||(vc=b4(TS))}function AS(){return vc=Qy?vc:_4(TS),Qy=!0,vc}const _E=((...e)=>{MS().render(...e)}),yfe=((...e)=>{AS().hydrate(...e)}),rf=((...e)=>{const t=MS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=IS(s);if(!o)return;const i=t._component;!gt(i)&&!i.render&&!i.template&&(i.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,ES(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),wE=((...e)=>{const t=AS().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=IS(s);if(o)return n(o,!0,ES(o))},t});function ES(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function IS(e){return Zt(e)?document.querySelector(e):e}let Jy=!1;const kfe=()=>{Jy||(Jy=!0,vE(),V4())};/*!
21
+ * shared v11.4.5
22
+ * (c) 2026 kazuya kawaguchi
23
+ * Released under the MIT License.
24
+ */function SE(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const lf=typeof window<"u",yr=(e,t=!1)=>t?Symbol.for(e):Symbol(e),CE=(e,t,n)=>xE({l:e,k:t,s:n}),xE=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Sn=e=>typeof e=="number"&&isFinite(e),$S=e=>q1(e)==="[object Date]",da=e=>q1(e)==="[object RegExp]",ah=e=>At(e)&&Object.keys(e).length===0,xn=Object.assign,TE=Object.create,Xt=(e=null)=>TE(e);let ek;const Xr=()=>ek||(ek=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Xt());function tk(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/\//g,"&#x2F;").replace(/=/g,"&#x3D;")}function ME(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const AE=/^\s*javascript\s*(?::|&#0*58;?|&#x0*3a;?|&colon;?)/i,EE=/^(?:href|src|action|formaction)$/i;function U1(e){return AE.test(e)}function IE(e){const t=/url\s*\(/gi;let n="",s=0,o;for(;(o=t.exec(e))!==null;){const i=o.index,r=t.lastIndex-1;let l=r+1,a=1,c=null;for(;l<e.length;l++){const p=e[l];if(c){p===c&&(c=null);continue}if(p==='"'||p==="'")c=p;else if(p==="(")a++;else if(p===")"&&(a--,a===0))break}if(a!==0)break;const u=e.slice(r+1,l).trim(),d=u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1).trim():u;n+=e.slice(s,i),n+=U1(d)?"url(about:blank)":e.slice(i,l+1),s=l+1}return n+e.slice(s)}function nk(e,t){if(EE.test(e)&&U1(t))return"about:blank";const n=e.toLowerCase()==="style"?IE(t):t;return ME(n)}function $E(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,s,o)=>`${s}="${nk(s,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,s,o)=>`${s}='${nk(s,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1&#111;n$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,s,o)=>U1(o)?`${s}about:blank`:n),e}const NE=Object.prototype.hasOwnProperty;function wo(e,t){return NE.call(e,t)}const gn=Array.isArray,an=e=>typeof e=="function",st=e=>typeof e=="string",Ot=e=>typeof e=="boolean",Rt=e=>e!==null&&typeof e=="object",LE=e=>Rt(e)&&an(e.then)&&an(e.catch),NS=Object.prototype.toString,q1=e=>NS.call(e),At=e=>q1(e)==="[object Object]",OE=e=>e==null?"":gn(e)||At(e)&&e.toString===NS?JSON.stringify(e,null,2):String(e);function j1(e,t=""){return e.reduce((n,s,o)=>o===0?n+s:n+t+s,"")}const Zu=e=>!Rt(e)||gn(e);function Sd(e,t){if(Zu(e)||Zu(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:s,des:o}=n.pop();Object.keys(s).forEach(i=>{i!=="__proto__"&&(Rt(s[i])&&!Rt(o[i])&&(o[i]=Array.isArray(s[i])?[]:Xt()),Zu(o[i])||Zu(s[i])?o[i]=s[i]:n.push({src:s[i],des:o[i]}))})}}/*!
25
+ * message-compiler v11.4.5
26
+ * (c) 2026 kazuya kawaguchi
27
+ * Released under the MIT License.
28
+ */function RE(e,t,n){return{line:e,column:t,offset:n}}function vg(e,t,n){return{start:e,end:t}}const Wt={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},PE=17;function ch(e,t,n={}){const{domain:s,messages:o,args:i}=n,r=e,l=new SyntaxError(String(r));return l.code=e,t&&(l.location=t),l.domain=s,l}function DE(e){throw e}const jo=" ",BE="\r",Jn=`
29
+ `,FE="\u2028",HE="\u2029";function WE(e){const t=e;let n=0,s=1,o=1,i=0;const r=E=>t[E]===BE&&t[E+1]===Jn,l=E=>t[E]===Jn,a=E=>t[E]===HE,c=E=>t[E]===FE,u=E=>r(E)||l(E)||a(E)||c(E),d=()=>n,p=()=>s,m=()=>o,f=()=>i,v=E=>r(E)||a(E)||c(E)?Jn:t[E],w=()=>v(n),_=()=>v(n+i);function b(){return i=0,u(n)&&(s++,o=0),r(n)&&n++,n++,o++,t[n]}function g(){return r(n+i)&&i++,i++,t[n+i]}function y(){n=0,s=1,o=1,i=0}function k(E=0){i=E}function $(){const E=n+i;for(;E!==n;)b();i=0}return{index:d,line:p,column:m,peekOffset:f,charAt:v,currentChar:w,currentPeek:_,next:b,peek:g,reset:y,resetPeek:k,skipToPeek:$}}const hi=void 0,UE=".",sk="'",qE="tokenizer";function jE(e,t={}){const n=t.location!==!1,s=WE(e),o=()=>s.index(),i=()=>RE(s.line(),s.column(),s.index()),r=i(),l=o(),a={currentType:13,offset:l,startLoc:r,endLoc:r,lastType:13,lastOffset:l,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},c=()=>a,{onError:u}=t;function d(H,U,Q,...ce){const pe=c();if(U.column+=Q,U.offset+=Q,u){const xe=n?vg(pe.startLoc,U):null,ie=ch(H,xe,{domain:qE,args:ce});u(ie)}}function p(H,U,Q){H.endLoc=i(),H.currentType=U;const ce={type:U};return n&&(ce.loc=vg(H.startLoc,H.endLoc)),Q!=null&&(ce.value=Q),ce}const m=H=>p(H,13);function f(H,U){return H.currentChar()===U?(H.next(),U):(d(Wt.EXPECTED_TOKEN,i(),0,U),"")}function v(H){let U="";for(;H.currentPeek()===jo||H.currentPeek()===Jn;)U+=H.currentPeek(),H.peek();return U}function w(H){const U=v(H);return H.skipToPeek(),U}function _(H){if(H===hi)return!1;const U=H.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U===95}function b(H){if(H===hi)return!1;const U=H.charCodeAt(0);return U>=48&&U<=57}function g(H,U){const{currentType:Q}=U;if(Q!==2)return!1;v(H);const ce=_(H.currentPeek());return H.resetPeek(),ce}function y(H,U){const{currentType:Q}=U;if(Q!==2)return!1;v(H);const ce=H.currentPeek()==="-"?H.peek():H.currentPeek(),pe=b(ce);return H.resetPeek(),pe}function k(H,U){const{currentType:Q}=U;if(Q!==2)return!1;v(H);const ce=H.currentPeek()===sk;return H.resetPeek(),ce}function $(H,U){const{currentType:Q}=U;if(Q!==7)return!1;v(H);const ce=H.currentPeek()===".";return H.resetPeek(),ce}function E(H,U){const{currentType:Q}=U;if(Q!==8)return!1;v(H);const ce=_(H.currentPeek());return H.resetPeek(),ce}function S(H,U){const{currentType:Q}=U;if(!(Q===7||Q===11))return!1;v(H);const ce=H.currentPeek()===":";return H.resetPeek(),ce}function T(H,U){const{currentType:Q}=U;if(Q!==9)return!1;const ce=()=>{const xe=H.currentPeek();return xe==="{"?_(H.peek()):xe==="@"||xe==="|"||xe===":"||xe==="."||xe===jo||!xe?!1:xe===Jn?(H.peek(),ce()):L(H,!1)},pe=ce();return H.resetPeek(),pe}function I(H){v(H);const U=H.currentPeek()==="|";return H.resetPeek(),U}function L(H,U=!0){const Q=(pe=!1,xe="")=>{const ie=H.currentPeek();return ie==="{"||ie==="@"||!ie?pe:ie==="|"?!(xe===jo||xe===Jn):ie===jo?(H.peek(),Q(!0,jo)):ie===Jn?(H.peek(),Q(!0,Jn)):!0},ce=Q();return U&&H.resetPeek(),ce}function R(H,U){const Q=H.currentChar();return Q===hi?hi:U(Q)?(H.next(),Q):null}function O(H){const U=H.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===95||U===36}function F(H){return R(H,O)}function P(H){const U=H.charCodeAt(0);return U>=97&&U<=122||U>=65&&U<=90||U>=48&&U<=57||U===95||U===36||U===45}function q(H){return R(H,P)}function K(H){const U=H.charCodeAt(0);return U>=48&&U<=57}function G(H){return R(H,K)}function oe(H){const U=H.charCodeAt(0);return U>=48&&U<=57||U>=65&&U<=70||U>=97&&U<=102}function J(H){return R(H,oe)}function he(H){let U="",Q="";for(;U=G(H);)Q+=U;return Q}function Ne(H){let U="";for(;;){const Q=H.currentChar();if(Q==="\\"){const ce=H.peek();ce==="{"||ce==="}"||ce==="@"||ce==="|"||ce==="\\"?(U+=Q+ce,H.next(),H.next()):(H.resetPeek(),U+=Q,H.next())}else{if(Q==="{"||Q==="}"||Q==="@"||Q==="|"||!Q)break;if(Q===jo||Q===Jn)if(L(H))U+=Q,H.next();else{if(I(H))break;U+=Q,H.next()}else U+=Q,H.next()}}return U}function Fe(H){w(H);let U="",Q="";for(;U=q(H);)Q+=U;const ce=H.currentChar();if(ce&&ce!=="}"&&ce!==hi&&ce!==jo&&ce!==Jn&&ce!==" "){const pe=z(H);return d(Wt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,Q+pe),Q+pe}return H.currentChar()===hi&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),Q}function We(H){w(H);let U="";return H.currentChar()==="-"?(H.next(),U+=`-${he(H)}`):U+=he(H),H.currentChar()===hi&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),U}function $e(H){return H!==sk&&H!==Jn}function me(H){w(H),f(H,"'");let U="",Q="";for(;U=R(H,$e);)U==="\\"?Q+=ke(H):Q+=U;const ce=H.currentChar();return ce===Jn||ce===hi?(d(Wt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),ce===Jn&&(H.next(),f(H,"'")),Q):(f(H,"'"),Q)}function ke(H){const U=H.currentChar();switch(U){case"\\":case"'":return H.next(),`\\${U}`;case"u":return _e(H,U,4);case"U":return _e(H,U,6);default:return d(Wt.UNKNOWN_ESCAPE_SEQUENCE,i(),0,U),""}}function _e(H,U,Q){f(H,U);let ce="";for(let pe=0;pe<Q;pe++){const xe=J(H);if(!xe){d(Wt.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${U}${ce}${H.currentChar()}`);break}ce+=xe}return`\\${U}${ce}`}function ue(H){return H!=="{"&&H!=="}"&&H!==jo&&H!==Jn}function z(H){w(H);let U="",Q="";for(;U=R(H,ue);)Q+=U;return Q}function X(H){let U="",Q="";for(;U=F(H);)Q+=U;return Q}function fe(H){const U=Q=>{const ce=H.currentChar();return ce==="{"||ce==="@"||ce==="|"||ce==="("||ce===")"||!ce||ce===jo?Q:(Q+=ce,H.next(),U(Q))};return U("")}function D(H){w(H);const U=f(H,"|");return w(H),U}function Z(H,U){let Q=null;switch(H.currentChar()){case"{":return U.braceNest>=1&&d(Wt.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),H.next(),Q=p(U,2,"{"),w(H),U.braceNest++,Q;case"}":return U.braceNest>0&&U.currentType===2&&d(Wt.EMPTY_PLACEHOLDER,i(),0),H.next(),Q=p(U,3,"}"),U.braceNest--,U.braceNest>0&&w(H),U.inLinked&&U.braceNest===0&&(U.inLinked=!1),Q;case"@":return U.braceNest>0&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),Q=ne(H,U)||m(U),U.braceNest=0,Q;default:{let pe=!0,xe=!0,ie=!0;if(I(H))return U.braceNest>0&&d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),Q=p(U,1,D(H)),U.braceNest=0,U.inLinked=!1,Q;if(U.braceNest>0&&(U.currentType===4||U.currentType===5||U.currentType===6))return d(Wt.UNTERMINATED_CLOSING_BRACE,i(),0),U.braceNest=0,se(H,U);if(pe=g(H,U))return Q=p(U,4,Fe(H)),w(H),Q;if(xe=y(H,U))return Q=p(U,5,We(H)),w(H),Q;if(ie=k(H,U))return Q=p(U,6,me(H)),w(H),Q;if(!pe&&!xe&&!ie)return Q=p(U,12,z(H)),d(Wt.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,Q.value),w(H),Q;break}}return Q}function ne(H,U){const{currentType:Q}=U;let ce=null;const pe=H.currentChar();switch((Q===7||Q===8||Q===11||Q===9)&&(pe===Jn||pe===jo)&&d(Wt.INVALID_LINKED_FORMAT,i(),0),pe){case"@":return H.next(),ce=p(U,7,"@"),U.inLinked=!0,ce;case".":return w(H),H.next(),p(U,8,".");case":":return w(H),H.next(),p(U,9,":");default:return I(H)?(ce=p(U,1,D(H)),U.braceNest=0,U.inLinked=!1,ce):$(H,U)||S(H,U)?(w(H),ne(H,U)):E(H,U)?(w(H),p(U,11,X(H))):T(H,U)?(w(H),pe==="{"?Z(H,U)||ce:p(U,10,fe(H))):(Q===7&&d(Wt.INVALID_LINKED_FORMAT,i(),0),U.braceNest=0,U.inLinked=!1,se(H,U))}}function se(H,U){let Q={type:13};if(U.braceNest>0)return Z(H,U)||m(U);if(U.inLinked)return ne(H,U)||m(U);switch(H.currentChar()){case"{":return Z(H,U)||m(U);case"}":return d(Wt.UNBALANCED_CLOSING_BRACE,i(),0),H.next(),p(U,3,"}");case"@":return ne(H,U)||m(U);default:{if(I(H))return Q=p(U,1,D(H)),U.braceNest=0,U.inLinked=!1,Q;if(L(H))return p(U,0,Ne(H));break}}return Q}function ae(){const{currentType:H,offset:U,startLoc:Q,endLoc:ce}=a;return a.lastType=H,a.lastOffset=U,a.lastStartLoc=Q,a.lastEndLoc=ce,a.offset=o(),a.startLoc=i(),s.currentChar()===hi?p(a,13):se(s,a)}return{nextToken:ae,currentOffset:o,currentPosition:i,context:c}}const zE="parser",VE=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,KE=/\\([\\@{}|])/g;function GE(e,t){return t}function YE(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const s=parseInt(t||n,16);return s<=55295||s>=57344?String.fromCodePoint(s):"�"}}}function XE(e={}){const t=e.location!==!1,{onError:n}=e;function s(_,b,g,y,...k){const $=_.currentPosition();if($.offset+=y,$.column+=y,n){const E=t?vg(g,$):null,S=ch(b,E,{domain:zE,args:k});n(S)}}function o(_,b,g){const y={type:_};return t&&(y.start=b,y.end=b,y.loc={start:g,end:g}),y}function i(_,b,g,y){t&&(_.end=b,_.loc&&(_.loc.end=g))}function r(_,b){const g=_.context(),y=o(3,g.offset,g.startLoc);return y.value=b.replace(KE,GE),i(y,_.currentOffset(),_.currentPosition()),y}function l(_,b){const g=_.context(),{lastOffset:y,lastStartLoc:k}=g,$=o(5,y,k);return $.index=parseInt(b,10),_.nextToken(),i($,_.currentOffset(),_.currentPosition()),$}function a(_,b){const g=_.context(),{lastOffset:y,lastStartLoc:k}=g,$=o(4,y,k);return $.key=b,_.nextToken(),i($,_.currentOffset(),_.currentPosition()),$}function c(_,b){const g=_.context(),{lastOffset:y,lastStartLoc:k}=g,$=o(9,y,k);return $.value=b.replace(VE,YE),_.nextToken(),i($,_.currentOffset(),_.currentPosition()),$}function u(_){const b=_.nextToken(),g=_.context(),{lastOffset:y,lastStartLoc:k}=g,$=o(8,y,k);return b.type!==11?(s(_,Wt.UNEXPECTED_EMPTY_LINKED_MODIFIER,g.lastStartLoc,0),$.value="",i($,y,k),{nextConsumeToken:b,node:$}):(b.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,zo(b)),$.value=b.value||"",i($,_.currentOffset(),_.currentPosition()),{node:$})}function d(_,b){const g=_.context(),y=o(7,g.offset,g.startLoc);return y.value=b,i(y,_.currentOffset(),_.currentPosition()),y}function p(_){const b=_.context(),g=o(6,b.offset,b.startLoc);let y=_.nextToken();if(y.type===8){const k=u(_);g.modifier=k.node,y=k.nextConsumeToken||_.nextToken()}switch(y.type!==9&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(y)),y=_.nextToken(),y.type===2&&(y=_.nextToken()),y.type){case 10:y.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(y)),g.key=d(_,y.value||"");break;case 4:y.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(y)),g.key=a(_,y.value||"");break;case 5:y.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(y)),g.key=l(_,y.value||"");break;case 6:y.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(y)),g.key=c(_,y.value||"");break;default:{s(_,Wt.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const k=_.context(),$=o(7,k.offset,k.startLoc);return $.value="",i($,k.offset,k.startLoc),g.key=$,i(g,k.offset,k.startLoc),{nextConsumeToken:y,node:g}}}return i(g,_.currentOffset(),_.currentPosition()),{node:g}}function m(_){const b=_.context(),g=b.currentType===1?_.currentOffset():b.offset,y=b.currentType===1?b.endLoc:b.startLoc,k=o(2,g,y);k.items=[];let $=null;do{const T=$||_.nextToken();switch($=null,T.type){case 0:T.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(T)),k.items.push(r(_,T.value||""));break;case 5:T.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(T)),k.items.push(l(_,T.value||""));break;case 4:T.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(T)),k.items.push(a(_,T.value||""));break;case 6:T.value==null&&s(_,Wt.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,zo(T)),k.items.push(c(_,T.value||""));break;case 7:{const I=p(_);k.items.push(I.node),$=I.nextConsumeToken||null;break}}}while(b.currentType!==13&&b.currentType!==1);const E=b.currentType===1?b.lastOffset:_.currentOffset(),S=b.currentType===1?b.lastEndLoc:_.currentPosition();return i(k,E,S),k}function f(_,b,g,y){const k=_.context();let $=y.items.length===0;const E=o(1,b,g);E.cases=[],E.cases.push(y);do{const S=m(_);$||($=S.items.length===0),E.cases.push(S)}while(k.currentType!==13);return $&&s(_,Wt.MUST_HAVE_MESSAGES_IN_PLURAL,g,0),i(E,_.currentOffset(),_.currentPosition()),E}function v(_){const b=_.context(),{offset:g,startLoc:y}=b,k=m(_);return b.currentType===13?k:f(_,g,y,k)}function w(_){const b=jE(_,xn({},e)),g=b.context(),y=o(0,g.offset,g.startLoc);return t&&y.loc&&(y.loc.source=_),y.body=v(b),e.onCacheKey&&(y.cacheKey=e.onCacheKey(_)),g.currentType!==13&&s(b,Wt.UNEXPECTED_LEXICAL_ANALYSIS,g.lastStartLoc,0,_[g.offset]||""),i(y,b.currentOffset(),b.currentPosition()),y}return{parse:w}}function zo(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function ZE(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function ok(e,t){for(let n=0;n<e.length;n++)z1(e[n],t)}function z1(e,t){switch(e.type){case 1:ok(e.cases,t),t.helper("plural");break;case 2:ok(e.items,t);break;case 6:{z1(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function QE(e,t={}){const n=ZE(e);n.helper("normalize"),e.body&&z1(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function JE(e){const t=e.body;return t.type===2?ik(t):t.cases.forEach(n=>ik(n)),e}function ik(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(!(s.type===3||s.type===9)||s.value==null)break;t.push(s.value)}if(t.length===e.items.length){e.static=j1(t);for(let n=0;n<e.items.length;n++){const s=e.items[n];(s.type===3||s.type===9)&&delete s.value}}}}function Fl(e){switch(e.t=e.type,e.type){case 0:{const t=e;Fl(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let s=0;s<n.length;s++)Fl(n[s]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let s=0;s<n.length;s++)Fl(n[s]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Fl(t.key),t.k=t.key,delete t.key,t.modifier&&(Fl(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function eI(e,t){const{filename:n,breakLineCode:s,needIndent:o}=t,i=t.location!==!1,r={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:s,needIndent:o,indentLevel:0};i&&e.loc&&(r.source=e.loc.source);const l=()=>r;function a(v,w){r.code+=v}function c(v,w=!0){const _=w?s:"";a(o?_+" ".repeat(v):_)}function u(v=!0){const w=++r.indentLevel;v&&c(w)}function d(v=!0){const w=--r.indentLevel;v&&c(w)}function p(){c(r.indentLevel)}return{context:l,push:a,indent:u,deindent:d,newline:p,helper:v=>`_${v}`,needIndent:()=>r.needIndent}}function tI(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),fa(e,t.key),t.modifier?(e.push(", "),fa(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function nI(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const o=t.items.length;for(let i=0;i<o&&(fa(e,t.items[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}function sI(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const o=t.cases.length;for(let i=0;i<o&&(fa(e,t.cases[i]),i!==o-1);i++)e.push(", ");e.deindent(s()),e.push("])")}}function oI(e,t){t.body?fa(e,t.body):e.push("null")}function fa(e,t){const{helper:n}=e;switch(t.type){case 0:oI(e,t);break;case 1:sI(e,t);break;case 2:nI(e,t);break;case 6:tI(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const iI=(e,t={})=>{const n=st(t.mode)?t.mode:"normal",s=st(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
30
+ `,i=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],l=eI(e,{filename:s,breakLineCode:o,needIndent:i});l.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(i),r.length>0&&(l.push(`const { ${j1(r.map(u=>`${u}: _${u}`),", ")} } = ctx`),l.newline()),l.push("return "),fa(l,e),l.deindent(i),l.push("}"),delete e.helpers;const{code:a,map:c}=l.context();return{ast:e,code:a,map:c?c.toJSON():void 0}};function rI(e,t={}){const n=xn({},t),s=!!n.jit,o=!!n.minify,i=n.optimize==null?!0:n.optimize,l=XE(n).parse(e);return s?(i&&JE(l),o&&Fl(l),{ast:l,code:""}):(QE(l,n),iI(l,n))}/*!
31
+ * core-base v11.4.5
32
+ * (c) 2026 kazuya kawaguchi
33
+ * Released under the MIT License.
34
+ */function lI(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Xr().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Xr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Jo(e){return Rt(e)&&V1(e)===0&&(wo(e,"b")||wo(e,"body"))}const LS=["b","body"];function aI(e){return kr(e,LS)}const OS=["c","cases"];function cI(e){return kr(e,OS,[])}const RS=["s","static"];function uI(e){return kr(e,RS)}const PS=["i","items"];function dI(e){return kr(e,PS,[])}const DS=["t","type"];function V1(e){return kr(e,DS)}const BS=["v","value"];function Qu(e,t){const n=kr(e,BS);if(n!=null)return n;throw Fc(t)}const FS=["m","modifier"];function fI(e){return kr(e,FS)}const HS=["k","key"];function hI(e){const t=kr(e,HS);if(t)return t;throw Fc(6)}function kr(e,t,n){for(let s=0;s<t.length;s++){const o=t[s];if(wo(e,o)&&e[o]!=null)return e[o]}return n}const WS=[...LS,...OS,...RS,...PS,...HS,...FS,...BS,...DS];function Fc(e){return new Error(`unhandled node type: ${e}`)}function em(e){return n=>pI(n,e)}function pI(e,t){const n=aI(t);if(n==null)throw Fc(0);if(V1(n)===1){const i=cI(n);return e.plural(i.reduce((r,l)=>[...r,rk(e,l)],[]))}else return rk(e,n)}function rk(e,t){const n=uI(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const s=dI(t).reduce((o,i)=>[...o,yg(e,i)],[]);return e.normalize(s)}}function yg(e,t){const n=V1(t);switch(n){case 3:return Qu(t,n);case 9:return Qu(t,n);case 4:{const s=t;if(wo(s,"k")&&s.k)return e.interpolate(e.named(s.k));if(wo(s,"key")&&s.key)return e.interpolate(e.named(s.key));throw Fc(n)}case 5:{const s=t;if(wo(s,"i")&&Sn(s.i))return e.interpolate(e.list(s.i));if(wo(s,"index")&&Sn(s.index))return e.interpolate(e.list(s.index));throw Fc(n)}case 6:{const s=t,o=fI(s),i=hI(s);return e.linked(yg(e,i),o?yg(e,o):void 0,e.type)}case 7:return Qu(t,n);case 8:return Qu(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const mI=e=>e;let Ju=Xt();function gI(e,t={}){let n=!1;const s=t.onError||DE;return t.onError=o=>{n=!0,s(o)},{...rI(e,t),detectError:n}}function vI(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&st(e)){Ot(t.warnHtmlMessage)&&t.warnHtmlMessage;const s=(t.onCacheKey||mI)(e),o=Ju[s];if(o)return o;const{ast:i,detectError:r}=gI(e,{...t,location:!1,jit:!0}),l=em(i);return r?l:Ju[s]=l}else{const n=e.cacheKey;if(n){const s=Ju[n];return s||(Ju[n]=em(e))}else return em(e)}}let Hc=null;function yI(e){Hc=e}function kI(e,t,n){Hc&&Hc.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const bI=_I("function:translate");function _I(e){return t=>Hc&&Hc.emit(e,t)}const bi={INVALID_ARGUMENT:PE,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},wI=24;function _i(e){return ch(e,null,void 0)}function K1(e,t){return t.locale!=null?lk(t.locale):lk(e.locale)}let tm;function lk(e){if(st(e))return e;if(an(e)){if(e.resolvedOnce&&tm!=null)return tm;if(e.constructor.name==="Function"){const t=e();if(LE(t))throw _i(bi.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return tm=t}else throw _i(bi.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw _i(bi.NOT_SUPPORT_LOCALE_TYPE)}function SI(e,t,n){return[...new Set([n,...gn(t)?t:Rt(t)?Object.keys(t):st(t)?[t]:[n]])]}function kg(e,t,n){const s=st(n)?n:Wc,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let i=o.__localeChainCache.get(s);if(!i){i=[];let r=[n];for(;gn(r);)r=ak(i,r,t);const l=gn(t)||!At(t)?t:t.default?t.default:null;r=st(l)?[l]:l,gn(r)&&ak(i,r,!1),o.__localeChainCache.set(s,i)}return i}function ak(e,t,n){let s=!0;for(let o=0;o<t.length&&Ot(s);o++){const i=t[o];st(i)&&(s=CI(e,t[o],n))}return s}function CI(e,t,n){let s;const o=t.split("-");do{const i=o.join("-");s=xI(e,i,n),o.splice(-1,1)}while(o.length&&s===!0);return s}function xI(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s=t[t.length-1]!=="!";const o=t.replace(/!/g,"");e.push(o),(gn(n)||At(n))&&n[o]&&(s=n[o])}return s}const br=[];br[0]={w:[0],i:[3,0],"[":[4],o:[7]};br[1]={w:[1],".":[2],"[":[4],o:[7]};br[2]={w:[2],i:[3,0],0:[3,0]};br[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};br[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};br[5]={"'":[4,0],o:8,l:[5,0]};br[6]={'"':[4,0],o:8,l:[6,0]};const TI=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function MI(e){return TI.test(e)}function AI(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function EI(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function II(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:MI(t)?AI(t):"*"+t}function $I(e){const t=[];let n=-1,s=0,o=0,i,r,l,a,c,u,d;const p=[];p[0]=()=>{r===void 0?r=l:r+=l},p[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),o++},p[3]=()=>{if(o>0)o--,s=4,p[0]();else{if(o=0,r===void 0||(r=II(r),r===!1))return!1;p[1]()}};function m(){const f=e[n+1];if(s===5&&f==="'"||s===6&&f==='"')return n++,l="\\"+f,p[0](),!0}for(;s!==null;)if(n++,i=e[n],!(i==="\\"&&m())){if(a=EI(i),d=br[s],c=d[a]||d.l||8,c===8||(s=c[0],c[1]!==void 0&&(u=p[c[1]],u&&(l=i,u()===!1))))return;if(s===7)return t}}const ck=new Map;function NI(e,t){return Rt(e)?e[t]:null}function LI(e,t){if(!Rt(e))return null;let n=ck.get(t);if(n||(n=$I(t),n&&ck.set(t,n)),!n)return null;const s=n.length;let o=e,i=0;for(;i<s;){const r=n[i];if(WS.includes(r)&&Jo(o)||!Rt(o)||!wo(o,r))return null;const l=o[r];if(l===void 0||an(o))return null;o=l,i++}return o}const OI="11.4.5",uh=-1,Wc="en-US",af="",uk=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function RI(){return{upper:(e,t)=>t==="text"&&st(e)?e.toUpperCase():t==="vnode"&&Rt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&st(e)?e.toLowerCase():t==="vnode"&&Rt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&st(e)?uk(e):t==="vnode"&&Rt(e)&&"__v_isVNode"in e?uk(e.children):e}}let US;function PI(e){US=e}let qS;function DI(e){qS=e}let jS;function BI(e){jS=e}let zS=null;const FI=e=>{zS=e},HI=()=>zS;let VS=null;const dk=e=>{VS=e},WI=()=>VS;let fk=0;function UI(e={}){const t=an(e.onWarn)?e.onWarn:SE,n=st(e.version)?e.version:OI,s=st(e.locale)||an(e.locale)?e.locale:Wc,o=an(s)?Wc:s,i=gn(e.fallbackLocale)||At(e.fallbackLocale)||st(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=At(e.messages)?e.messages:nm(o),l=At(e.datetimeFormats)?e.datetimeFormats:nm(o),a=At(e.numberFormats)?e.numberFormats:nm(o),c=xn(Xt(),e.modifiers,RI()),u=e.pluralRules||Xt(),d=an(e.missing)?e.missing:null,p=Ot(e.missingWarn)||da(e.missingWarn)?e.missingWarn:!0,m=Ot(e.fallbackWarn)||da(e.fallbackWarn)?e.fallbackWarn:!0,f=!!e.fallbackFormat,v=!!e.unresolving,w=an(e.postTranslation)?e.postTranslation:null,_=At(e.processor)?e.processor:null,b=Ot(e.warnHtmlMessage)?e.warnHtmlMessage:!0,g=!!e.escapeParameter,y=an(e.messageCompiler)?e.messageCompiler:US,k=an(e.messageResolver)?e.messageResolver:qS||NI,$=an(e.localeFallbacker)?e.localeFallbacker:jS||SI,E=Rt(e.fallbackContext)?e.fallbackContext:void 0,S=e,T=Rt(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,I=Rt(S.__numberFormatters)?S.__numberFormatters:new Map,L=Rt(S.__meta)?S.__meta:{};fk++;const R={version:n,cid:fk,locale:s,fallbackLocale:i,messages:r,modifiers:c,pluralRules:u,missing:d,missingWarn:p,fallbackWarn:m,fallbackFormat:f,unresolving:v,postTranslation:w,processor:_,warnHtmlMessage:b,escapeParameter:g,messageCompiler:y,messageResolver:k,localeFallbacker:$,fallbackContext:E,onWarn:t,__meta:L};return R.datetimeFormats=l,R.numberFormats=a,R.__datetimeFormatters=T,R.__numberFormatters=I,__INTLIFY_PROD_DEVTOOLS__&&kI(R,n,L),R}const nm=e=>({[e]:Xt()});function G1(e,t,n,s,o){const{missing:i,onWarn:r}=e;if(i!==null){const l=i(e,n,t,o);return st(l)?l:t}else return t}function Xa(e,t,n){const s=e;s.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function qI(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function jI(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let s=n+1;s<t.length;s++)if(qI(e,t[s]))return!0;return!1}function hk(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__datetimeFormatters:l}=e;if(!st(t[0])&&!$S(t[0])&&!Sn(t[0]))return af;const[a,c,u,d]=bg(...t),p=Ot(u.missingWarn)?u.missingWarn:e.missingWarn;Ot(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=K1(e,u),v=r(e,o,f);if(!st(a)||a===""){const $=new Intl.DateTimeFormat(f.replace(/!/g,""),d);return m?$.formatToParts(c):$.format(c)}let w={},_,b=null;const g="datetime format";for(let $=0;$<v.length&&(_=v[$],w=n[_]||{},b=w[a],!At(b));$++)G1(e,a,_,p,g);if(!At(b)||!st(_))return s?uh:a;let y=`${_}__${a}`;ah(d)||(y=`${y}__${JSON.stringify(d)}`);let k=l.get(y);return k||(k=new Intl.DateTimeFormat(_,xn({},b,d)),l.set(y,k)),m?k.formatToParts(c):k.format(c)}const KS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function bg(...e){const[t,n,s,o]=e,i=Xt();let r=Xt(),l;if(st(t)){const a=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!a)throw _i(bi.INVALID_ISO_DATE_ARGUMENT);const c=a[3]?a[3].trim().startsWith("T")?`${a[1].trim()}${a[3].trim()}`:`${a[1].trim()}T${a[3].trim()}`:a[1].trim();l=new Date(c);try{l.toISOString()}catch{throw _i(bi.INVALID_ISO_DATE_ARGUMENT)}}else if($S(t)){if(isNaN(t.getTime()))throw _i(bi.INVALID_DATE_ARGUMENT);l=t}else if(Sn(t))l=t;else throw _i(bi.INVALID_ARGUMENT);return st(n)?i.key=n:At(n)&&Object.keys(n).forEach(a=>{KS.includes(a)?r[a]=n[a]:i[a]=n[a]}),st(s)?i.locale=s:At(s)&&(r=s),At(o)&&(r=o),[i.key||"",l,i,r]}function pk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__datetimeFormatters.has(i)&&s.__datetimeFormatters.delete(i)}}function mk(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:o,onWarn:i,localeFallbacker:r}=e,{__numberFormatters:l}=e;if(!Sn(t[0]))return af;const[a,c,u,d]=_g(...t),p=Ot(u.missingWarn)?u.missingWarn:e.missingWarn;Ot(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,f=K1(e,u),v=r(e,o,f);if(!st(a)||a===""){const $=new Intl.NumberFormat(f.replace(/!/g,""),d);return m?$.formatToParts(c):$.format(c)}let w={},_,b=null;const g="number format";for(let $=0;$<v.length&&(_=v[$],w=n[_]||{},b=w[a],!At(b));$++)G1(e,a,_,p,g);if(!At(b)||!st(_))return s?uh:a;let y=`${_}__${a}`;ah(d)||(y=`${y}__${JSON.stringify(d)}`);let k=l.get(y);return k||(k=new Intl.NumberFormat(_,xn({},b,d)),l.set(y,k)),m?k.formatToParts(c):k.format(c)}const GS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function _g(...e){const[t,n,s,o]=e,i=Xt();let r=Xt();if(!Sn(t))throw _i(bi.INVALID_ARGUMENT);const l=t;return st(n)?i.key=n:At(n)&&Object.keys(n).forEach(a=>{GS.includes(a)?r[a]=n[a]:i[a]=n[a]}),st(s)?i.locale=s:At(s)&&(r=s),At(o)&&(r=o),[i.key||"",l,i,r]}function gk(e,t,n){const s=e;for(const o in n){const i=`${t}__${o}`;s.__numberFormatters.has(i)&&s.__numberFormatters.delete(i)}}const zI=e=>e,VI=e=>"",KI="text",GI=e=>e.length===0?"":j1(e),YI=OE;function sm(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function XI(e){const t=Sn(e.pluralIndex)?e.pluralIndex:-1;return Sn(e.named?.count)?e.named.count:Sn(e.named?.n)?e.named.n:t}function ZI(e={}){const t=e.locale,n=XI(e),s=st(t)&&an(e.pluralRules?.[t])?e.pluralRules[t]:sm,o=s===sm?void 0:sm,i=_=>_[s(n,_.length,o)],r=e.list||[],l=_=>r[_],a=e.named||Xt();Sn(e.pluralIndex)&&(a.count||=e.pluralIndex,a.n||=e.pluralIndex);const c=_=>a[_];function u(_,b){const g=an(e.messages)?e.messages(_,!!b):Rt(e.messages)?e.messages[_]:!1;return g||(e.parent?e.parent.message(_):VI)}const d=_=>e.modifiers?e.modifiers[_]:zI,p=an(e.processor?.normalize)?e.processor.normalize:GI,m=an(e.processor?.interpolate)?e.processor.interpolate:YI,f=st(e.processor?.type)?e.processor.type:KI,w={list:l,named:c,plural:i,linked:(_,...b)=>{const[g,y]=b;let k="text",$="";b.length===1?Rt(g)?($=g.modifier||$,k=g.type||k):st(g)&&($=g||$):b.length===2&&(st(g)&&($=g||$),st(y)&&(k=y||k));const E=u(_,!0)(w),S=E===""||E===void 0?_:E,T=k==="vnode"&&gn(S)&&$?S[0]:S;return $?d($)(T,k):T},message:u,type:f,interpolate:m,normalize:p,values:xn(Xt(),r,a)};return w}const vk=()=>"",yo=e=>an(e);function yk(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:o,messageCompiler:i,fallbackLocale:r,messages:l}=e,[a,c]=wg(...t),u=Ot(c.missingWarn)?c.missingWarn:e.missingWarn,d=Ot(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=Ot(c.escapeParameter)?c.escapeParameter:e.escapeParameter,m=!!c.resolvedMessage,f=st(c.default)||Ot(c.default)?Ot(c.default)?i?a:()=>a:c.default:n?i?a:()=>a:null,v=n||f!=null&&(st(f)||an(f)),w=K1(e,c);p&&QI(c);let[_,b,g]=m?[a,w,l[w]||Xt()]:YS(e,a,w,r,d,u),y=_,k=a;if(!m&&!(st(y)||Jo(y)||yo(y))&&v&&(y=f,k=y),!m&&(!(st(y)||Jo(y)||yo(y))||!st(b)))return o?uh:a;let $=!1;const E=()=>{$=!0},S=yo(y)?y:XS(e,a,b,y,k,E);if($)return y;const T=t6(e,b,g,c),I=ZI(T),L=JI(e,S,I);let R=s?s(L,a):L;if(p&&st(R)&&(R=$E(R)),__INTLIFY_PROD_DEVTOOLS__){const O={timestamp:Date.now(),key:st(a)?a:yo(y)?y.key:"",locale:b||(yo(y)?y.locale:""),format:st(y)?y:yo(y)?y.source:"",message:R};O.meta=xn({},e.__meta,HI()||{}),bI(O)}return R}function QI(e){gn(e.list)?e.list=e.list.map(t=>st(t)?tk(t):t):Rt(e.named)&&Object.keys(e.named).forEach(t=>{st(e.named[t])&&(e.named[t]=tk(e.named[t]))})}function YS(e,t,n,s,o,i){const{messages:r,onWarn:l,messageResolver:a,localeFallbacker:c}=e,u=c(e,s,n);let d=Xt(),p,m=null;const f="translate";for(let v=0;v<u.length&&(p=u[v],d=r[p]||Xt(),(m=a(d,t))===null&&(m=d[t]),!(st(m)||Jo(m)||yo(m)));v++)if(!jI(p,u)){const w=G1(e,t,p,i,f);w!==t&&(m=w)}return[m,p,d]}function XS(e,t,n,s,o,i){const{messageCompiler:r,warnHtmlMessage:l}=e;if(yo(s)){const c=s;return c.locale=c.locale||n,c.key=c.key||t,c}if(r==null){const c=(()=>s);return c.locale=n,c.key=t,c}const a=r(s,e6(e,n,o,s,l,i));return a.locale=n,a.key=t,a.source=s,a}function JI(e,t,n){return t(n)}function wg(...e){const[t,n,s]=e,o=Xt();if(!st(t)&&!Sn(t)&&!yo(t)&&!Jo(t))throw _i(bi.INVALID_ARGUMENT);const i=Sn(t)?String(t):(yo(t),t);return Sn(n)?o.plural=n:st(n)?o.default=n:At(n)&&!ah(n)?o.named=n:gn(n)&&(o.list=n),Sn(s)?o.plural=s:st(s)?o.default=s:At(s)&&xn(o,s),[i,o]}function e6(e,t,n,s,o,i){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw i&&i(r),r},onCacheKey:r=>CE(t,n,r)}}function t6(e,t,n,s){const{modifiers:o,pluralRules:i,messageResolver:r,fallbackLocale:l,fallbackWarn:a,missingWarn:c,fallbackContext:u}=e,p={locale:t,modifiers:o,pluralRules:i,messages:(m,f)=>{let v=r(n,m);if(v==null&&(u||f)){const[w,,_]=YS(u||e,m,t,l,a,c);v=w??r(_,m)}if(st(v)||Jo(v)){let w=!1;const b=XS(e,m,t,v,m,()=>{w=!0});return w?vk:b}else return yo(v)?v:vk}};return e.processor&&(p.processor=e.processor),s.list&&(p.list=s.list),s.named&&(p.named=s.named),Sn(s.plural)&&(p.pluralIndex=s.plural),p}lI();/*!
35
+ * vue-i18n v11.4.5
36
+ * (c) 2026 kazuya kawaguchi
37
+ * Released under the MIT License.
38
+ */const n6="11.4.5";function s6(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Xr().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Xr().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Xr().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Xr().__INTLIFY_PROD_DEVTOOLS__=!1)}const ms={UNEXPECTED_RETURN_TYPE:wI,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Es(e,...t){return ch(e,null,void 0)}const Sg=yr("__translateVNode"),Cg=yr("__datetimeParts"),xg=yr("__numberParts"),ZS=yr("__setPluralRules"),QS=yr("__injectWithOption"),Ul=yr("__dispose");function Uc(e){if(!Rt(e)||Jo(e))return e;for(const t in e)if(wo(e,t))if(!t.includes("."))Rt(e[t])&&Uc(e[t]);else{const n=t.split("."),s=n.length-1;let o=e,i=!1;for(let r=0;r<s;r++){if(n[r]==="__proto__")throw new Error(`unsafe key: ${n[r]}`);if(n[r]in o||(o[n[r]]=Xt()),!Rt(o[n[r]])){i=!0;break}o=o[n[r]]}if(i||(Jo(o)?WS.includes(n[s])||delete e[t]:(o[n[s]]=e[t],delete e[t])),!Jo(o)){const r=o[n[s]];Rt(r)&&Uc(r)}}return e}function Y1(e,t){const{messages:n,__i18n:s,messageResolver:o,flatJson:i}=t,r=At(n)?n:gn(s)?Xt():{[e]:Xt()};if(gn(s)&&s.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:a,resource:c}=l;a?(r[a]=r[a]||Xt(),Sd(c,r[a])):Sd(c,r)}else st(l)&&Sd(JSON.parse(l),r)}),o==null&&i)for(const l in r)wo(r,l)&&Uc(r[l]);return r}function JS(e){return e.type}function eC(e,t,n){let s=Rt(t.messages)?t.messages:Xt();"__i18nGlobal"in n&&(s=Y1(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const o=Object.keys(s);o.length&&o.forEach(i=>{e.mergeLocaleMessage(i,s[i])});{if(Rt(t.datetimeFormats)){const i=Object.keys(t.datetimeFormats);i.length&&i.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Rt(t.numberFormats)){const i=Object.keys(t.numberFormats);i.length&&i.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function kk(e){return mt(ir,null,e,0)}function qc(){return rs()}const bk="__INTLIFY_META__",_k=()=>[],o6=()=>!1;let wk=0;function Sk(e){return((t,n,s,o)=>e(n,s,qc()||void 0,o))}const i6=()=>{const e=qc();let t=null;return e&&(t=JS(e)[bk])?{[bk]:t}:null};function cf(e={}){const{__root:t,__injectWithOption:n}=e,s=t===void 0,o=e.flatJson,i=lf?te:al;let r=Ot(e.inheritLocale)?e.inheritLocale:!0;const l=i(t&&r?t.locale.value:st(e.locale)?e.locale:Wc),a=i(t&&r?t.fallbackLocale.value:st(e.fallbackLocale)||gn(e.fallbackLocale)||At(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:l.value),c=i(Y1(l.value,e)),u=i(At(e.datetimeFormats)?e.datetimeFormats:{[l.value]:{}}),d=i(At(e.numberFormats)?e.numberFormats:{[l.value]:{}});let p=t?t.missingWarn:Ot(e.missingWarn)||da(e.missingWarn)?e.missingWarn:!0,m=t?t.fallbackWarn:Ot(e.fallbackWarn)||da(e.fallbackWarn)?e.fallbackWarn:!0,f=t?t.fallbackRoot:Ot(e.fallbackRoot)?e.fallbackRoot:!0,v=!!e.fallbackFormat,w=an(e.missing)?e.missing:null,_=an(e.missing)?Sk(e.missing):null,b=an(e.postTranslation)?e.postTranslation:null,g=t?t.warnHtmlMessage:Ot(e.warnHtmlMessage)?e.warnHtmlMessage:!0,y=!!e.escapeParameter;const k=t?t.modifiers:At(e.modifiers)?e.modifiers:{};let $=e.pluralRules||t&&t.pluralRules,E;E=(()=>{s&&dk(null);const ie={version:n6,locale:l.value,fallbackLocale:a.value,messages:c.value,modifiers:k,pluralRules:$,missing:_===null?void 0:_,missingWarn:p,fallbackWarn:m,fallbackFormat:v,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:g,escapeParameter:y,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};ie.datetimeFormats=u.value,ie.numberFormats=d.value,ie.__datetimeFormatters=At(E)?E.__datetimeFormatters:void 0,ie.__numberFormatters=At(E)?E.__numberFormatters:void 0;const be=UI(ie);return s&&dk(be),be})(),Xa(E,l.value,a.value);function T(){return[l.value,a.value,c.value,u.value,d.value]}const I=j({get:()=>l.value,set:ie=>{E.locale=ie,l.value=ie}}),L=j({get:()=>a.value,set:ie=>{E.fallbackLocale=ie,a.value=ie,Xa(E,l.value,ie)}}),R=j(()=>c.value),O=j(()=>u.value),F=j(()=>d.value);function P(){return an(b)?b:null}function q(ie){b=ie,E.postTranslation=ie}function K(){return w}function G(ie){ie!==null&&(_=Sk(ie)),w=ie,E.missing=_}const oe=(ie,be,ze,Je,rt,Ge)=>{T();let ut;try{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=t?WI():void 0),ut=ie(E)}finally{__INTLIFY_PROD_DEVTOOLS__,s||(E.fallbackContext=void 0)}if(ze!=="translate exists"&&Sn(ut)&&ut===uh||ze==="translate exists"&&!ut){const[xt,Ht]=be();return t&&f?Je(t):rt(xt)}else{if(Ge(ut))return ut;throw Es(ms.UNEXPECTED_RETURN_TYPE)}};function J(...ie){return oe(be=>Reflect.apply(yk,null,[be,...ie]),()=>wg(...ie),"translate",be=>Reflect.apply(be.t,be,[...ie]),be=>be,be=>st(be))}function he(...ie){const[be,ze,Je]=ie;if(Je&&!Rt(Je))throw Es(ms.INVALID_ARGUMENT);return J(be,ze,xn({resolvedMessage:!0},Je||{}))}function Ne(...ie){return oe(be=>Reflect.apply(hk,null,[be,...ie]),()=>bg(...ie),"datetime format",be=>Reflect.apply(be.d,be,[...ie]),()=>af,be=>st(be)||gn(be))}function Fe(...ie){return oe(be=>Reflect.apply(mk,null,[be,...ie]),()=>_g(...ie),"number format",be=>Reflect.apply(be.n,be,[...ie]),()=>af,be=>st(be)||gn(be))}function We(ie){return ie.map(be=>st(be)||Sn(be)||Ot(be)?kk(String(be)):be)}const me={normalize:We,interpolate:ie=>ie,type:"vnode"};function ke(...ie){return oe(be=>{let ze;const Je=be;try{Je.processor=me,ze=Reflect.apply(yk,null,[Je,...ie])}finally{Je.processor=null}return ze},()=>wg(...ie),"translate",be=>be[Sg](...ie),be=>[kk(be)],be=>gn(be))}function _e(...ie){return oe(be=>Reflect.apply(mk,null,[be,...ie]),()=>_g(...ie),"number format",be=>be[xg](...ie),_k,be=>st(be)||gn(be))}function ue(...ie){return oe(be=>Reflect.apply(hk,null,[be,...ie]),()=>bg(...ie),"datetime format",be=>be[Cg](...ie),_k,be=>st(be)||gn(be))}function z(ie){$=ie,E.pluralRules=$}function X(ie,be){return oe(()=>{if(!ie)return!1;const ze=st(be)?be:l.value,Je=st(be)?[ze]:kg(E,a.value,ze);for(let rt=0;rt<Je.length;rt++){const Ge=Z(Je[rt]);let ut=E.messageResolver(Ge,ie);if(ut===null&&(ut=Ge[ie]),Jo(ut)||yo(ut)||st(ut))return!0}return!1},()=>[ie],"translate exists",ze=>Reflect.apply(ze.te,ze,[ie,be]),o6,ze=>Ot(ze))}function fe(ie){let be=null;const ze=kg(E,a.value,l.value);for(let Je=0;Je<ze.length;Je++){const rt=c.value[ze[Je]]||{},Ge=E.messageResolver(rt,ie);if(Ge!=null){be=Ge;break}}return be}function D(ie){const be=fe(ie);return be??(t?t.tm(ie)||{}:{})}function Z(ie){return c.value[ie]||{}}function ne(ie,be){if(o){const ze={[ie]:be};for(const Je in ze)wo(ze,Je)&&Uc(ze[Je]);be=ze[ie]}c.value[ie]=be,E.messages=c.value}function se(ie,be){c.value[ie]=c.value[ie]||{};const ze={[ie]:be};if(o)for(const Je in ze)wo(ze,Je)&&Uc(ze[Je]);be=ze[ie],Sd(be,c.value[ie]),E.messages=c.value}function ae(ie){return u.value[ie]||{}}function H(ie,be){u.value[ie]=be,E.datetimeFormats=u.value,pk(E,ie,be)}function U(ie,be){u.value[ie]=xn(u.value[ie]||{},be),E.datetimeFormats=u.value,pk(E,ie,be)}function Q(ie){return d.value[ie]||{}}function ce(ie,be){d.value[ie]=be,E.numberFormats=d.value,gk(E,ie,be)}function pe(ie,be){d.value[ie]=xn(d.value[ie]||{},be),E.numberFormats=d.value,gk(E,ie,be)}wk++,t&&lf&&(Ve(t.locale,ie=>{r&&(l.value=ie,E.locale=ie,Xa(E,l.value,a.value))}),Ve(t.fallbackLocale,ie=>{r&&(a.value=ie,E.fallbackLocale=ie,Xa(E,l.value,a.value))}));const xe={id:wk,locale:I,fallbackLocale:L,get inheritLocale(){return r},set inheritLocale(ie){r=ie,ie&&t&&(l.value=t.locale.value,a.value=t.fallbackLocale.value,Xa(E,l.value,a.value))},get availableLocales(){return Object.keys(c.value).sort()},messages:R,get modifiers(){return k},get pluralRules(){return $||{}},get isGlobal(){return s},get missingWarn(){return p},set missingWarn(ie){p=ie,E.missingWarn=p},get fallbackWarn(){return m},set fallbackWarn(ie){m=ie,E.fallbackWarn=m},get fallbackRoot(){return f},set fallbackRoot(ie){f=ie},get fallbackFormat(){return v},set fallbackFormat(ie){v=ie,E.fallbackFormat=v},get warnHtmlMessage(){return g},set warnHtmlMessage(ie){g=ie,E.warnHtmlMessage=ie},get escapeParameter(){return y},set escapeParameter(ie){y=ie,E.escapeParameter=ie},t:J,getLocaleMessage:Z,setLocaleMessage:ne,mergeLocaleMessage:se,getPostTranslationHandler:P,setPostTranslationHandler:q,getMissingHandler:K,setMissingHandler:G,[ZS]:z};return xe.datetimeFormats=O,xe.numberFormats=F,xe.rt=he,xe.te=X,xe.tm=D,xe.d=Ne,xe.n=Fe,xe.getDateTimeFormat=ae,xe.setDateTimeFormat=H,xe.mergeDateTimeFormat=U,xe.getNumberFormat=Q,xe.setNumberFormat=ce,xe.mergeNumberFormat=pe,xe[QS]=n,xe[Sg]=ke,xe[Cg]=ue,xe[xg]=_e,xe}function r6(e){const t=st(e.locale)?e.locale:Wc,n=st(e.fallbackLocale)||gn(e.fallbackLocale)||At(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,s=an(e.missing)?e.missing:void 0,o=Ot(e.silentTranslationWarn)||da(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,i=Ot(e.silentFallbackWarn)||da(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ot(e.fallbackRoot)?e.fallbackRoot:!0,l=!!e.formatFallbackMessages,a=At(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=an(e.postTranslation)?e.postTranslation:void 0,d=st(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,p=!!e.escapeParameterHtml,m=Ot(e.sync)?e.sync:!0;let f=e.messages;if(At(e.sharedMessages)){const k=e.sharedMessages;f=Object.keys(k).reduce((E,S)=>{const T=E[S]||(E[S]={});return xn(T,k[S]),E},f||{})}const{__i18n:v,__root:w,__injectWithOption:_}=e,b=e.datetimeFormats,g=e.numberFormats,y=e.flatJson;return{locale:t,fallbackLocale:n,messages:f,flatJson:y,datetimeFormats:b,numberFormats:g,missing:s,missingWarn:o,fallbackWarn:i,fallbackRoot:r,fallbackFormat:l,modifiers:a,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:m,__i18n:v,__root:w,__injectWithOption:_}}function Tg(e={}){const t=cf(r6(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Ot(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ot(o)?!o:o},get silentFallbackWarn(){return Ot(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ot(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,i){return t.te(o,i)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,i){t.setLocaleMessage(o,i)},mergeLocaleMessage(o,i){t.mergeLocaleMessage(o,i)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,i){t.setDateTimeFormat(o,i)},mergeDateTimeFormat(o,i){t.mergeDateTimeFormat(o,i)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,i){t.setNumberFormat(o,i)},mergeNumberFormat(o,i){t.mergeNumberFormat(o,i)}};return s.__extender=n,s}function l6(e,t,n){return{beforeCreate(){const s=qc();if(!s)throw Es(ms.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const i=o.i18n;if(o.__i18n&&(i.__i18n=o.__i18n),i.__root=t,this===this.$root)this.$i18n=Ck(e,i);else{i.__injectWithOption=!0,i.__extender=n.__vueI18nExtend,this.$i18n=Tg(i);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Ck(e,o);else{this.$i18n=Tg({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const i=this.$i18n;i.__extender&&(i.__disposer=i.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&eC(t,o,o),this.$t=(...i)=>this.$i18n.t(...i),this.$rt=(...i)=>this.$i18n.rt(...i),this.$te=(i,r)=>this.$i18n.te(i,r),this.$d=(...i)=>this.$i18n.d(...i),this.$n=(...i)=>this.$i18n.n(...i),this.$tm=i=>this.$i18n.tm(i),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const s=qc();if(!s)throw Es(ms.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(s),delete this.$i18n}}}function Ck(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[ZS](t.pluralizationRules||e.pluralizationRules);const n=Y1(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(s=>e.mergeLocaleMessage(s,n[s])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(s=>e.mergeDateTimeFormat(s,t.datetimeFormats[s])),t.numberFormats&&Object.keys(t.numberFormats).forEach(s=>e.mergeNumberFormat(s,t.numberFormats[s])),e}const X1={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function a6({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((s,o)=>[...s,...o.type===Ie?o.children:[o]],[]):t.reduce((n,s)=>{const o=e[s];return o&&(n[s]=o()),n},Xt())}function tC(){return Ie}const c6=Ze({name:"i18n-t",props:xn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Sn(e)||!isNaN(e)}},X1),setup(e,t){const{slots:n,attrs:s}=t,o=e.i18n||wt({useScope:e.scope,__useComponent:!0});return()=>{const i=()=>{const a=Object.keys(n).filter(d=>d[0]!=="_"),c=Xt();e.locale&&(c.locale=e.locale),e.plural!==void 0&&(c.plural=st(e.plural)?+e.plural:e.plural);const u=a6(t,a);return o[Sg](e.keypath,u,c)},r=xn(Xt(),s),l=st(e.tag)||Rt(e.tag)?e.tag:tC();return Rt(l)?Ut(l,r,{default:i}):Ut(l,r,i())}}}),xk=c6;function u6(e){return gn(e)&&!st(e[0])}function nC(e,t,n,s){const{slots:o,attrs:i}=t;return()=>{const r=()=>{const c={part:!0};let u=Xt();e.locale&&(c.locale=e.locale),st(e.format)?c.key=e.format:Rt(e.format)&&(st(e.format.key)&&(c.key=e.format.key),u=Object.keys(e.format).reduce((m,f)=>n.includes(f)?xn(Xt(),m,{[f]:e.format[f]}):m,Xt()));const d=s(e.value,c,u);let p=[c.key];return gn(d)?p=d.map((m,f)=>{const v=o[m.type],w=v?v({[m.type]:m.value,index:f,parts:d}):[m.value];return u6(w)&&(w[0].key=`${m.type}-${f}`),w}):st(d)&&(p=[d]),p},l=xn(Xt(),i),a=st(e.tag)||Rt(e.tag)?e.tag:tC();return Rt(a)?Ut(a,l,{default:r}):Ut(a,l,r())}}const d6=Ze({name:"i18n-n",props:xn({value:{type:Number,required:!0},format:{type:[String,Object]}},X1),setup(e,t){const n=e.i18n||wt({useScope:e.scope,__useComponent:!0});return nC(e,t,GS,(...s)=>n[xg](...s))}}),Tk=d6;function f6(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return s!=null?s.__composer:e.global.__composer}}function h6(e){const t=r=>{const{instance:l,value:a}=r;if(!l||!l.$)throw Es(ms.UNEXPECTED_ERROR);const c=f6(e,l.$),u=Mk(a);return[Reflect.apply(c.t,c,[...Ak(u)]),c]};return{created:(r,l)=>{const[a,c]=t(l);lf&&(r.__i18nWatcher=Ve(c.locale,()=>{l.instance&&l.instance.$forceUpdate()})),r.__composer=c,r.textContent=a},unmounted:r=>{lf&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:l})=>{if(r.__composer){const a=r.__composer,c=Mk(l);r.textContent=Reflect.apply(a.t,a,[...Ak(c)])}},getSSRProps:r=>{const[l]=t(r);return{textContent:l}}}}function Mk(e){if(st(e))return{path:e};if(At(e)){if(!("path"in e))throw Es(ms.REQUIRED_VALUE,"path");return e}else throw Es(ms.INVALID_VALUE)}function Ak(e){const{path:t,locale:n,args:s,choice:o,plural:i}=e,r={},l=s||{};return st(n)&&(r.locale=n),Sn(o)&&(r.plural=o),Sn(i)&&(r.plural=i),[t,l,r]}function p6(e,t,...n){const s=At(n[0])?n[0]:{};(Ot(s.globalInstall)?s.globalInstall:!0)&&([xk.name,"I18nT"].forEach(i=>e.component(i,xk)),[Tk.name,"I18nN"].forEach(i=>e.component(i,Tk)),[$k.name,"I18nD"].forEach(i=>e.component(i,$k))),e.directive("t",h6(t))}const m6=yr("global-vue-i18n");function g6(e={}){const t=__VUE_I18N_LEGACY_API__&&Ot(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ot(e.globalInjection)?e.globalInjection:!0,s=new Map,[o,i]=v6(e,t),r=yr("");function l(d){return s.get(d)||null}function a(d,p){s.set(d,p)}function c(d){s.delete(d)}const u={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...p){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,u),At(p[0])){const v=p[0];u.__composerExtend=v.__composerExtend,u.__vueI18nExtend=v.__vueI18nExtend}let m=null;!t&&n&&(m=C6(d,u.global)),__VUE_I18N_FULL_INSTALL__&&p6(d,u,...p),__VUE_I18N_LEGACY_API__&&t&&d.mixin(l6(i,i.__composer,u));const f=d.unmount;d.unmount=()=>{m&&m(),u.dispose(),f()}},get global(){return i},dispose(){o.stop()},__instances:s,__getInstance:l,__setInstance:a,__deleteInstance:c};return u}function wt(e={}){const t=qc();if(t==null)throw Es(ms.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Es(ms.NOT_INSTALLED);const n=y6(t),s=b6(n),o=JS(t),i=k6(e,o);if(i==="global")return eC(s,e,o),s;if(i==="parent"){let a=Ek(n,t,e.__useComponent);return a==null&&(a=s),a}if(i==="isolated"){if(n.mode!=="composition")throw Es(ms.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const a=n,c=xn({},e),u=Ek(n,t);c.__root=u||s;const d=cf(c);return a.__composerExtend&&(d[Ul]=a.__composerExtend(d)),C1()&&x1(()=>{const m=d[Ul];m&&(m(),delete d[Ul])}),d}const r=n;let l=r.__getInstance(t);if(l==null){const a=xn({},e);"__i18n"in o&&(a.__i18n=o.__i18n),s&&(a.__root=s),l=cf(a),r.__composerExtend&&(l[Ul]=r.__composerExtend(l)),w6(r,t,l),r.__setInstance(t,l)}return l}function v6(e,t){const n=jM(),s=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Tg(e)):n.run(()=>cf(e));if(s==null)throw Es(ms.UNEXPECTED_ERROR);return[n,s]}function y6(e){const t=Nt(e.isCE?m6:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Es(e.isCE?ms.NOT_INSTALLED_WITH_PROVIDE:ms.UNEXPECTED_ERROR);return t}function k6(e,t){return ah(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function b6(e){return e.mode==="composition"?e.global:e.global.__composer}function Ek(e,t,n=!1){let s=null;const o=t.root;let i=_6(t,n);for(;i!=null;){const r=e;if(e.mode==="composition")s=r.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const l=r.__getInstance(i);l!=null&&(s=l.__composer,n&&s&&!s[QS]&&(s=null))}if(s!=null||o===i)break;i=i.parent}return s}function _6(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function w6(e,t,n){Jt(()=>{},t),qt(()=>{const s=n;e.__deleteInstance(t);const o=s[Ul];o&&(o(),delete s[Ul])},t)}const S6=["locale","fallbackLocale","availableLocales"],Ik=["t","rt","d","n","tm","te"];function C6(e,t){const n=Object.create(null);return S6.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i)throw Es(ms.UNEXPECTED_ERROR);const r=Cn(i.value)?{get(){return i.value.value},set(l){i.value.value=l}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,Ik.forEach(o=>{const i=Object.getOwnPropertyDescriptor(t,o);if(!i||!i.value)throw Es(ms.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,i)}),()=>{delete e.config.globalProperties.$i18n,Ik.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const x6=Ze({name:"i18n-d",props:xn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},X1),setup(e,t){const n=e.i18n||wt({useScope:e.scope,__useComponent:!0});return nC(e,t,KS,(...s)=>n[Cg](...s))}}),$k=x6;s6();PI(vI);DI(LI);BI(kg);if(__INTLIFY_PROD_DEVTOOLS__){const e=Xr();e.__INTLIFY__=!0,yI(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const T6={class:"row"},M6={class:"lead","aria-hidden":"true"},A6={key:0,class:"run-ico",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none"},E6={key:1,class:"unread-dot"},I6={class:"archive-label"},$6={class:"left"},N6=["onKeydown"],L6={class:"ts"},O6=["title"],R6={class:"tag-text"},P6=["title"],D6={class:"tag-text"},B6=["title"],F6={class:"tag-text"},H6=["title"],W6=Ze({__name:"SessionRow",props:{session:{},active:{type:Boolean},approvalCount:{default:0},questionCount:{default:0},unread:{type:Boolean,default:!1}},emits:["select","rename","archive","fork"],setup(e,{expose:t,emit:n}){const{t:s}=wt(),o=e,i=n,r=te(!1),l=te(null),a=te(null);function c(T){const I=T.target;a.value?.contains(I)||l.value?.contains(I)||d()}function u(T){T.stopPropagation(),r.value?d():(r.value=!0,setTimeout(()=>document.addEventListener("mousedown",c),0))}function d(){r.value=!1,document.removeEventListener("mousedown",c)}qt(()=>document.removeEventListener("mousedown",c));const p=te(!1),m=te(""),f=te(null);async function v(){d(),p.value=!0,m.value=o.session.title,await ft();try{f.value?.focus(),f.value?.select()}catch{}}function w(){const T=m.value.trim();T&&i("rename",o.session.id,T),p.value=!1}function _(){p.value=!1}const b=te(!1);function g(){navigator.clipboard.writeText(o.session.id).then(()=>{b.value=!0,setTimeout(()=>{b.value=!1},1200)}).catch(()=>{})}function y(){d(),i("fork",o.session.id)}const k=te(!1);function $(){d(),k.value=!0}function E(){i("archive",o.session.id),k.value=!1}function S(){k.value=!1}return t({closeMenu:d,cancelArchive:S}),(T,I)=>(C(),A("div",{class:Ee(["se",{on:e.active}]),onClick:I[5]||(I[5]=L=>i("select",e.session.id))},[h("div",T6,[h("span",M6,[e.session.busy?(C(),A("svg",A6,[...I[6]||(I[6]=[h("circle",{class:"run-track",cx:"8",cy:"8",r:"6","stroke-width":"2"},null,-1),h("path",{class:"run-arc",d:"M8 2 A6 6 0 1 1 2 8","stroke-width":"2","stroke-linecap":"round"},null,-1)])])):e.unread?(C(),A("span",E6)):re("",!0)]),k.value?(C(),A("div",{key:0,class:"archive-confirm",onClick:I[0]||(I[0]=Ye(()=>{},["stop"]))},[h("span",I6,N(M(s)("sidebar.archiveConfirm")),1),h("button",{class:"btn-confirm",onClick:Ye(E,["stop"])},N(M(s)("sidebar.confirm")),1),h("button",{class:"btn-cancel",onClick:Ye(S,["stop"])},N(M(s)("sidebar.cancel")),1)])):(C(),A(Ie,{key:1},[h("div",$6,[p.value?Et((C(),A("input",{key:0,ref_key:"renameInputRef",ref:f,"onUpdate:modelValue":I[1]||(I[1]=L=>m.value=L),class:"rename-input",onClick:I[2]||(I[2]=Ye(()=>{},["stop"])),onKeydown:[_o(Ye(w,["stop"]),["enter"]),_o(Ye(_,["stop"]),["esc"])],onBlur:w},null,40,N6)),[[yn,m.value]]):(C(),A("span",{key:1,class:"t",onDblclick:Ye(v,["stop"])},N(e.session.title),33))]),h("span",L6,N(e.session.time),1),!p.value&&(e.questionCount>0||e.session.status==="awaitingQuestion")?(C(),A("span",{key:0,class:"tag tag-ask",title:M(s)("workspace.awaitingAnswerTitle")},[h("span",R6,N(M(s)("workspace.awaitingAnswer")),1)],8,O6)):re("",!0),!p.value&&(e.approvalCount>0||e.session.status==="awaitingApproval")?(C(),A("span",{key:1,class:"tag tag-approve",title:M(s)("workspace.awaitingPermissionTitle")},[h("span",D6,N(M(s)("workspace.awaitingPermission")),1)],8,P6)):re("",!0),!p.value&&e.session.status==="aborted"?(C(),A("span",{key:2,class:"tag tag-aborted",title:M(s)("workspace.abortedTitle")},[h("span",F6,N(M(s)("workspace.aborted")),1)],8,B6)):re("",!0),p.value?re("",!0):(C(),A("button",{key:3,ref_key:"kebabRef",ref:l,class:Ee(["kebab",{open:r.value}]),title:M(s)("sidebar.options"),onClick:I[3]||(I[3]=Ye(L=>u(L),["stop"]))},[...I[7]||(I[7]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,H6))],64))]),r.value?(C(),A("div",{key:0,ref_key:"menuRef",ref:a,class:"menu",onClick:I[4]||(I[4]=Ye(()=>{},["stop"]))},[h("button",{class:"menu-item copy-id",onClick:Ye(g,["stop"])},N(b.value?"已复制 ✓":"复制 Session ID ⧉"),1),I[8]||(I[8]=h("div",{class:"menu-divider"},null,-1)),h("button",{class:"menu-item",onClick:Ye(v,["stop"])},N(M(s)("sidebar.rename")),1),h("button",{class:"menu-item",onClick:Ye(y,["stop"])},N(M(s)("sidebar.fork")),1),h("button",{class:"menu-item archive",onClick:Ye($,["stop"])},N(M(s)("sidebar.archive")),1)],512)):re("",!0)],2))}}),yt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Nk=yt(W6,[["__scopeId","data-v-7d81d6f3"]]),U6={class:"side"},q6={class:"ch"},j6={class:"ch-brand"},z6=["title","aria-label"],V6=["title","aria-label"],K6={class:"search"},G6=["placeholder","aria-label","onKeydown"],Y6=["title","aria-label"],X6={class:"btn-wrap"},Z6={key:0,class:"sessions"},Q6={key:1,class:"empty"},J6={key:1,class:"sessions"},e$={key:0,class:"empty"},t$=["onClick","onContextmenu"],n$={class:"gh-top"},s$={class:"gh-folder",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},o$={key:0,class:"gh-name"},i$=["title","aria-label","aria-expanded","onClick"],r$=["title","aria-label","onClick"],l$=["title"],a$={class:"group-sessions"},c$=["onClick"],u$={key:1,class:"group-empty"},om=10,d$=Ze({__name:"Sidebar",props:{activeWorkspace:{default:null},activeWorkspaceId:{default:null},sessions:{},groups:{},activeId:{},attentionBySession:{default:()=>({})},pendingBySession:{default:()=>({})},unreadBySession:{default:()=>({})},colWidth:{default:220}},emits:["select","create","createInWorkspace","selectWorkspace","selectWorkspaces","addWorkspace","rename","archive","fork","renameWorkspace","deleteWorkspace","openSettings","collapse"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=te(""),r=j(()=>i.value.trim()),l=j(()=>r.value.length>0),a=j(()=>{const H=r.value.toLowerCase();return H?s.sessions.filter(U=>{const Q=(U.title??"").toLowerCase(),ce=(U.lastPrompt??"").toLowerCase();return Q.includes(H)||ce.includes(H)}):[]});function c(){i.value=""}function u(H){c(),y(H)}const d=te(new Set);function p(H){return d.value.has(H)}function m(H){const U=new Set(d.value);if(U.has(H)){U.delete(H);const Q=new Set(f.value);Q.delete(H),f.value=Q}else U.add(H);d.value=U}const f=te(new Set);function v(H){return f.value.has(H)}function w(H){const U=new Set(f.value);U.has(H)?U.delete(H):U.add(H),f.value=U}function _(H,U,Q){if(U||H.length<=om)return H;const ce=H.slice(0,om);if(Q&&!ce.some(pe=>pe.id===Q)){const pe=H.find(xe=>xe.id===Q);pe&&(ce[om-1]=pe)}return ce}const b=te(new Set);function g(H,U){if(U.shiftKey){U.stopPropagation();const Q=new Set(b.value);Q.has(H)?Q.delete(H):Q.add(H),b.value=Q,o("selectWorkspaces",Array.from(Q));return}b.value=new Set,o("selectWorkspaces",[]),m(H)}function y(H){b.value=new Set,o("selectWorkspaces",[]),o("select",H)}const k=te(null),$=te(""),E=te(null);function S(H,U){k.value=H,$.value=U,ft().then(()=>E.value?.focus())}function T(){const H=k.value,U=$.value.trim();H&&U&&o("renameWorkspace",H,U),k.value=null}function I(){k.value=null}const L=te(!1),R=te(null),O=te({}),F=te(null);function P(H){F.value&&!F.value.contains(H.target)&&K()}function q(H,U){if(U.shiftKey){U.stopPropagation();const Q=new Set(b.value);Q.has(H.id)?Q.delete(H.id):Q.add(H.id),b.value=Q,o("selectWorkspaces",Array.from(Q));return}U.preventDefault(),U.stopPropagation(),R.value=H,O.value={top:`${U.clientY}px`,left:`${U.clientX}px`},L.value=!0,document.addEventListener("mousedown",P,!0)}function K(){L.value=!1,document.removeEventListener("mousedown",P,!0),R.value=null,Fe()}function G(){R.value&&navigator.clipboard.writeText(R.value.root),K()}function oe(){R.value&&S(R.value.id,R.value.name),K()}function J(){const H=R.value;H&&We(H.id)&&(o("deleteWorkspace",H.id),K())}const he=te(null);let Ne;function Fe(){clearTimeout(Ne),he.value=null}function We(H){return he.value===H?(Fe(),!0):(clearTimeout(Ne),he.value=H,Ne=setTimeout(()=>{he.value=null},2500),!1)}const $e=te(null),me=te(null),ke=te({}),_e=te(null);function ue(H){const U=H.target;U.closest(".gh-more")||U.closest(".ws-menu")||X()}async function z(H,U){if($e.value===H.id){X();return}const Q=U.currentTarget;me.value=H,$e.value=H.id,document.addEventListener("mousedown",ue),document.addEventListener("scroll",X,!0),window.addEventListener("resize",X),await ft();const ce=_e.value,pe=Q.getBoundingClientRect(),xe=4,ie=8,be=ce?.offsetHeight??0,ze=ce?.offsetWidth??0;let Je=pe.bottom+xe;Je+be>window.innerHeight-ie&&(Je=Math.max(ie,pe.top-be-xe));let rt=pe.right-ze;rt<ie&&(rt=ie),ke.value={top:`${Math.round(Je)}px`,left:`${Math.round(rt)}px`}}function X(){$e.value=null,me.value=null,Fe(),document.removeEventListener("mousedown",ue),document.removeEventListener("scroll",X,!0),window.removeEventListener("resize",X)}function fe(H){navigator.clipboard.writeText(H.root),X()}function D(H){S(H.id,H.name),X()}function Z(H){We(H.id)&&(o("deleteWorkspace",H.id),X())}to(()=>{document.removeEventListener("mousedown",P,!0),document.removeEventListener("mousedown",ue),document.removeEventListener("scroll",X,!0),window.removeEventListener("resize",X),clearTimeout(Ne)});const ne=te(null);let se;function ae(){const H=ne.value;H&&(H.classList.remove("blink-now"),H.getBoundingClientRect(),H.classList.add("blink-now"),clearTimeout(se),se=setTimeout(()=>H.classList.remove("blink-now"),300))}return(H,U)=>(C(),A("aside",U6,[h("div",{class:"col",style:$t({width:e.colWidth+"px"})},[h("div",q6,[h("div",j6,[(C(),A("svg",{ref_key:"logoRef",ref:ne,class:"ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"CyberNeurova Code",onClick:ae},[...U[20]||(U[20]=[dr('<defs data-v-d2d862bb><mask id="neurovaEyes" maskUnits="userSpaceOnUse" data-v-d2d862bb><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-d2d862bb></rect><g class="ch-eyes" fill="#000" data-v-d2d862bb><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-d2d862bb></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-d2d862bb></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#neurovaEyes)" data-v-d2d862bb></rect>',2)])],512)),U[21]||(U[21]=h("span",{class:"ch-name"},"CyberNeurova Code",-1))]),h("button",{type:"button",class:"collapse-btn",title:M(n)("sidebar.collapseSidebar"),"aria-label":M(n)("sidebar.collapseSidebar"),onClick:U[0]||(U[0]=Ye(Q=>o("collapse"),["stop"]))},[...U[22]||(U[22]=[dr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-d2d862bb><path d="M11 6h9" data-v-d2d862bb></path><path d="M11 12h9" data-v-d2d862bb></path><path d="M11 18h9" data-v-d2d862bb></path><path d="M7 9l-3 3 3 3" data-v-d2d862bb></path></svg>',1)])],8,z6),h("button",{type:"button",class:"settings-btn",title:M(n)("settings.title"),"aria-label":M(n)("settings.title"),onClick:U[1]||(U[1]=Ye(Q=>o("openSettings"),["stop"]))},[...U[23]||(U[23]=[h("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"12",cy:"12",r:"3"}),h("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l-.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 15 4.6a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09A1.65 1.65 0 0 0 19.4 15z"})],-1)])],8,V6)]),h("div",K6,[U[25]||(U[25]=h("svg",{class:"search-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"7",cy:"7",r:"5"}),h("path",{d:"M11 11l3 3"})],-1)),Et(h("input",{"onUpdate:modelValue":U[2]||(U[2]=Q=>i.value=Q),class:"search-input",type:"text",placeholder:M(n)("sidebar.searchPlaceholder"),"aria-label":M(n)("sidebar.searchPlaceholder"),onKeydown:_o(Ye(c,["stop"]),["esc"])},null,40,G6),[[yn,i.value]]),l.value?(C(),A("button",{key:0,type:"button",class:"search-clear",title:M(n)("sidebar.searchClear"),"aria-label":M(n)("sidebar.searchClear"),onClick:Ye(c,["stop"])},[...U[24]||(U[24]=[h("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Y6)):re("",!0)]),h("div",X6,[h("button",{class:"btn-new-chat",onClick:U[3]||(U[3]=Ye(Q=>o("create"),["stop"]))},[U[26]||(U[26]=h("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),h("span",null,N(M(n)("sidebar.newChat")),1)]),re("",!0)]),l.value?(C(),A("div",Z6,[a.value.length>0?(C(!0),A(Ie,{key:0},Xe(a.value,Q=>(C(),je(Nk,{key:Q.id,session:Q,active:Q.id===e.activeId,"approval-count":e.pendingBySession[Q.id]?.approvals??0,"question-count":e.pendingBySession[Q.id]?.questions??0,unread:e.unreadBySession[Q.id]??!1,onSelect:U[5]||(U[5]=ce=>u(ce)),onRename:U[6]||(U[6]=(ce,pe)=>o("rename",ce,pe)),onArchive:U[7]||(U[7]=ce=>o("archive",ce)),onFork:U[8]||(U[8]=ce=>o("fork",ce))},null,8,["session","active","approval-count","question-count","unread"]))),128)):(C(),A("div",Q6,N(M(n)("sidebar.searchNoResults")),1))])):(C(),A("div",J6,[e.groups.length===0?(C(),A("div",e$,N(M(n)("workspace.noWorkspace")),1)):(C(!0),A(Ie,{key:1},Xe(e.groups,Q=>(C(),A("div",{key:Q.workspace.id,class:"group"},[h("div",{class:Ee(["gh",{on:Q.workspace.id===e.activeWorkspaceId,sel:b.value.has(Q.workspace.id)}]),onClick:Ye(ce=>g(Q.workspace.id,ce),["stop"]),onContextmenu:ce=>q(Q.workspace,ce)},[h("div",n$,[(C(),A("svg",s$,[p(Q.workspace.id)?(C(),A(Ie,{key:0},[U[28]||(U[28]=h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),U[29]||(U[29]=h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),A(Ie,{key:1},[U[30]||(U[30]=h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),U[31]||(U[31]=h("path",{d:"M1 5.5h12"},null,-1))],64))])),k.value!==Q.workspace.id?(C(),A("span",o$,N(Q.workspace.name),1)):Et((C(),A("input",{key:1,ref_for:!0,ref_key:"renameInputRef",ref:E,"onUpdate:modelValue":U[9]||(U[9]=ce=>$.value=ce),class:"gh-rename",type:"text",onKeydown:[_o(T,["enter"]),_o(I,["esc"])],onBlur:I,onClick:U[10]||(U[10]=Ye(()=>{},["stop"]))},null,544)),[[yn,$.value]]),h("button",{type:"button",class:Ee(["gh-more",{open:$e.value===Q.workspace.id}]),title:M(n)("sidebar.options"),"aria-label":M(n)("sidebar.options"),"aria-haspopup":"menu","aria-expanded":$e.value===Q.workspace.id,onClick:Ye(ce=>z(Q.workspace,ce),["stop"])},[...U[32]||(U[32]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],10,i$),h("button",{type:"button",class:"gh-add",title:M(n)("workspace.newInGroup"),"aria-label":M(n)("workspace.newInGroup"),onClick:Ye(ce=>o("createInWorkspace",Q.workspace.id),["stop"])},[...U[33]||(U[33]=[h("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,r$)]),h("div",{class:"gh-path",title:Q.workspace.root},N(Q.workspace.shortPath||Q.workspace.root),9,l$)],42,t$),Et(h("div",a$,[(C(!0),A(Ie,null,Xe(_(Q.sessions,v(Q.workspace.id),e.activeId),ce=>(C(),je(Nk,{key:ce.id,session:ce,active:ce.id===e.activeId,"approval-count":e.pendingBySession[ce.id]?.approvals??0,"question-count":e.pendingBySession[ce.id]?.questions??0,unread:e.unreadBySession[ce.id]??!1,onSelect:U[11]||(U[11]=pe=>y(pe)),onRename:U[12]||(U[12]=(pe,xe)=>o("rename",pe,xe)),onArchive:U[13]||(U[13]=pe=>o("archive",pe)),onFork:U[14]||(U[14]=pe=>o("fork",pe))},null,8,["session","active","approval-count","question-count","unread"]))),128)),!v(Q.workspace.id)&&_(Q.sessions,!1,e.activeId).length<Q.sessions.length?(C(),A("button",{key:0,class:"show-more",onClick:Ye(ce=>w(Q.workspace.id),["stop"])},N(M(n)("sidebar.showMore",{count:Q.sessions.length-_(Q.sessions,!1,e.activeId).length})),9,c$)):re("",!0),Q.sessions.length===0?(C(),A("div",u$,N(M(n)("sidebar.noSessions")),1)):re("",!0)],512),[[No,!p(Q.workspace.id)]])]))),128))]))],4),L.value?(C(),A("div",{key:0,ref_key:"ghMenuRef",ref:F,class:"gh-menu",style:$t(O.value),onClick:U[15]||(U[15]=Ye(()=>{},["stop"]))},[h("button",{type:"button",class:"ghm-item",onClick:G},N(M(n)("sidebar.copyPath")),1),h("button",{type:"button",class:"ghm-item",onClick:oe},N(M(n)("sidebar.rename")),1),h("button",{type:"button",class:"ghm-item del",onClick:J},N(R.value&&he.value===R.value.id?M(n)("sidebar.confirm"):M(n)("sidebar.removeWorkspace")),1)],4)):re("",!0),$e.value!==null&&me.value?(C(),A("div",{key:1,ref_key:"wsMenuRef",ref:_e,class:"ws-menu",style:$t(ke.value),onClick:U[19]||(U[19]=Ye(()=>{},["stop"]))},[h("button",{class:"ws-menu-item",onClick:U[16]||(U[16]=Ye(Q=>fe(me.value),["stop"]))},N(M(n)("sidebar.copyPath")),1),U[34]||(U[34]=h("div",{class:"ws-menu-divider"},null,-1)),h("button",{class:"ws-menu-item",onClick:U[17]||(U[17]=Ye(Q=>D(me.value),["stop"]))},N(M(n)("sidebar.rename")),1),U[35]||(U[35]=h("div",{class:"ws-menu-divider"},null,-1)),h("button",{class:"ws-menu-item del",onClick:U[18]||(U[18]=Ye(Q=>Z(me.value),["stop"]))},N(he.value===me.value.id?M(n)("sidebar.confirm"):M(n)("sidebar.removeWorkspace")),1)],4)):re("",!0)]))}}),f$=yt(d$,[["__scopeId","data-v-d2d862bb"]]);function h$(e){try{const t=localStorage.getItem(e);if(t===null)return null;const n=Number(t);return Number.isFinite(n)?n:null}catch{return null}}function p$(e,t){try{localStorage.setItem(e,String(t))}catch{}}function m$(e){const{storageKey:t,defaultWidth:n,min:s,max:o,reverse:i=!1}=e;function r(_){return Number.isFinite(_)?Math.min(o,Math.max(s,Math.round(_))):n}const l=te(r(h$(t)??n)),a=te(!1);function c(_){const b=r(_);l.value=b,p$(t,b)}let u=0,d=0,p=null,m=-1;function f(_){if(!a.value)return;const b=_.clientX-u;c(d+(i?-b:b))}function v(){if(a.value){if(a.value=!1,typeof document<"u"&&(document.body.style.userSelect="",document.body.style.cursor=""),p){try{p.releasePointerCapture(m)}catch{}p.removeEventListener("pointermove",f),p.removeEventListener("pointerup",v),p.removeEventListener("pointercancel",v)}p=null,m=-1}}function w(_){_.preventDefault(),a.value=!0,u=_.clientX,d=l.value,p=_.currentTarget,m=_.pointerId,typeof document<"u"&&(document.body.style.userSelect="none",document.body.style.cursor="col-resize");try{p.setPointerCapture(m)}catch{}p.addEventListener("pointermove",f),p.addEventListener("pointerup",v),p.addEventListener("pointercancel",v)}return to(v),{width:l,dragging:a,clamp:r,setWidth:c,onPointerDown:w}}const g$=["aria-label"],v$=Ze({__name:"ResizeHandle",props:{storageKey:{},defaultWidth:{},min:{},max:{},reverse:{type:Boolean},ariaLabel:{}},emits:["update:width","update:dragging"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),{width:i,dragging:r,onPointerDown:l}=m$({storageKey:n.storageKey,defaultWidth:n.defaultWidth,min:n.min,max:n.max,reverse:n.reverse});return s("update:width",i.value),Ve(i,a=>s("update:width",a)),Ve(r,a=>s("update:dragging",a)),(a,c)=>(C(),A("div",{class:Ee(["rh",{dragging:M(r)}]),role:"separator","aria-orientation":"vertical","aria-label":e.ariaLabel??M(o)("layout.resizeHandleAria"),onPointerdown:c[0]||(c[0]=(...u)=>M(l)&&M(l)(...u))},[...c[1]||(c[1]=[h("span",{class:"rh-bar","aria-hidden":"true"},null,-1)])],42,g$))}}),Lk=yt(v$,[["__scopeId","data-v-a95be841"]]),y$={preview:"Preview"},k$={authBannerMessage:"Not signed in · Sign in to CyberNeurova to start a conversation",authBannerLogin:"Sign in",authPageTitle:"Sign in to CyberNeurova",authPageMessage:"Connect your CyberNeurova account before starting or continuing conversations.",authPageLogin:"Sign in",connecting:"Connecting…",comingSoon:"Coming soon…"},b$={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"New Session",newChat:"New Chat",newWorkspace:"New Workspace",emptyState:"No sessions yet · click New Session to start",archiveConfirm:"Archive session?",confirm:"Confirm",cancel:"Cancel",options:"Options",rename:"Rename",copyPath:"Copy path",archive:"Archive",fork:"Fork session",delete:"Delete",removeWorkspace:"Remove workspace",brand:"CyberNeurova",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",language:"Language",daemon:"Daemon",noSessions:"No conversations yet",showMore:"Show more ({count})",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions",searchClear:"Clear search",searchNoResults:"No matching sessions"},_$={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",gitTag:"git",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Stopped",abortedTitle:"This session was interrupted before finishing"},w$={jumpToLatestAria:"Jump to latest message",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",summaryTitle:"Compaction summary",manuallyAborted:"Manually stopped",activatedSkill:"Activated skill: {name}",undo:"Undo",undoTooltip:"Undoing the conversation will not roll back code changes",undoConfirm:"Undo last message?",confirm:"Confirm",cancel:"Cancel",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…"},S$={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",modelTooltip:"Click to switch model",permissionManual:"Manual",permissionAuto:"Auto",permissionYolo:"YOLO",permissionTooltip:"Click to cycle permission mode",permissionManualDesc:"Ask for approval on every tool action",permissionAutoDesc:"Fully autonomous — agent decides everything without asking",permissionYoloDesc:"Auto-approve tool actions, but agent may still ask questions",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",modesLabel:"Mode",modesTooltip:"Mode: Plan / Goal / Swarm",goalLabel:"Goal",swarmLabel:"Swarm",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",modeNotSupported:"Not supported",thinkingLabel:"thinking",thinkingTooltip:"Toggle thinking mode",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",swarmOn:"on",swarmOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},C$={placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",editQueued:"Edit (load back into the input)",queuedImageOnly:"image ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",remove:"Remove",removeNamed:"Remove {name}",uploading:"Uploading",uploadFailed:"Upload failed",attachImage:"Attach image",previewAttachment:"Preview {name}",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",steerNow:"Steer now ⌃S",steerTitle:"Inject into the running turn without waiting (Ctrl+S / ⌘S)",emptyConversationTitle:"CyberNeurova",emptyConversation:"No messages yet — type below to start the conversation",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking"},x$={title:"Sign in to CyberNeurova",close:"Close (Esc)",starting:"Starting authorization flow…",lead:"Click the button below to authorize in a new browser tab.",authorizeInBrowser:"Authorize in browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",waitingAuth:"Waiting for authorization",waitingAutoClose:"Waiting for authorization, signs in automatically…",success:"Authorized",successHint:"Loading, will close automatically…",expiredTitle:"Authorization code expired",expiredHint:"Please restart the authorization flow",retry:"Retry",closeBtn:"Close",errorTitle:"The current daemon does not support login yet",errorHint:"Please upgrade cyberneurova-cli and try again"},T$={dialogLabel:"Manage providers",title:"Provider management",close:"Close (Esc)",loading:"Loading providers…",unavailable:"The daemon does not support provider management yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",modelCount:"{count} models",confirmDelete:"Confirm delete?",confirm:"Confirm",cancel:"Cancel",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginCyberNeurova:"Sign in to CyberNeurova",loginAnthropic:"Sign in to Anthropic",enterApiKey:"Enter API Key",fieldType:"Type",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"Default model",baseUrlPlaceholder:"https://… (optional)",optional:"Optional",apiKeyRequired:"API Key cannot be empty",add:"Add",escClose:"Esc to close"},M$={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",loading:"Loading models…",unavailable:"The daemon does not support model listing yet",contextSuffix:"{size}k ctx",emptyNoModels:"The daemon offers no selectable models",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",footerHint:"↑↓ Navigate · Enter Select · Esc Close"},A$={title:"New session",close:"Close (Esc)",cwdLabel:"Working directory",cwdPlaceholder:"Absolute path of the working directory, e.g. /Users/you/project",recentLabel:"Recent directories",titleFieldLabel:"Title",titleFieldPlaceholder:"Optional, named automatically if left blank",create:"Create",cancel:"Cancel",footerHint:"Enter to create · Esc to close"},E$={title:"Sessions",close:"Close",searchPlaceholder:"Search sessions by title…",noWorkspace:"No workspace",emptyNone:"No sessions yet",emptyNoMatch:"No matching sessions",footerHint:"↑↓ to navigate · Enter to switch · Esc to close",justNow:"just now"},I$={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",required:"APPROVAL REQUIRED",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Esc to cancel)",feedbackHint:"Enter to submit · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"+Feedback"},$$={title:"Question",step:"Q{current}/{total}",prev:"‹ Prev",next:"Next ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand"},N$={tag:"tasks",summary:"{run} running · {done} done",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Sub Agent",dockTodos:"Todos",dockQueue:"Queue",running:"running",closePanel:"Close panel",timingRunning:"Running · {time}",timingDone:"Done · {sec}s",todoTag:"todos",emptyTasks:"No background tasks running",emptyBash:"No bash tasks running",emptySubagent:"No sub agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",collapse:"Collapse",expand:"Expand"},L$={panelTitle:"Thinking",close:"Close"},O$={title:"Changes",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} changes",empty:"No git changes / not provided by daemon",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",list:"List",tree:"Tree",close:"Close"},R$={},P$={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",search:"Search",prevMatch:"Previous match",nextMatch:"Next match",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Binary file · {mime} · {size} bytes · preview unavailable",unknownType:"unknown type",copyCode:"Copy code",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",loadFailed:"Unable to read this file"}},D$={searching:"Searching…",noMatch:"No matches"},B$={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",details:{cause:"Cause",code:"Error code",contentType:"Content type",details:"Server details",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",status:"HTTP status",timeout:"Timeout"},daemonApiTitle:"CyberNeurova daemon returned an error",daemonNetworkMessage:"Web did not receive a response from the local service. Check that CyberNeurova daemon is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to CyberNeurova daemon",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sessionSnapshotMessage:"Web could not load the current conversation. Check that CyberNeurova daemon is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},F$={help:{desc:"Show the list of available commands"},new:{desc:"Create a new session"},sessions:{desc:"Browse & switch sessions"},clear:{desc:"Clear and start a new session"},model:{desc:"Switch model"},provider:{desc:"Manage providers (add / remove / refresh)"},login:{desc:"Sign in to CyberNeurova in the browser"},permission:{desc:"Switch approval mode (manual / auto / yolo)"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm <task> runs a task in swarm"},goal:{desc:"Create/control a goal: /goal <objective>, /goal pause|resume|cancel"},btw:{desc:"Side chat: /btw <question> asks a forked side session"},yolo:{desc:"Auto-approve everything (yolo mode)"},auto:{desc:"Auto-approve safe edits/reads"},thinking:{desc:"Set the thinking level"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},undoNotImplemented:"/undo isn't supported by the daemon yet",status:{desc:"View session status"},undo:{desc:"Undo the last message"}},H$={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Plan",task:"Task"},chip:{lines:"{count} lines",results:"{count} results",edited:"edited",created:"created",todos:"{count} items"}},W$={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},U$={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Session settings",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"confirm every tool",permAutoSub:"auto-approve edits",permYoloSub:"auto-approve all",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},q$={label:"Theme",modern:"Explore",cyberneurova:"Native",colorSchemeLabel:"Appearance",light:"Light",dark:"Dark",system:"System"},j$={preview:"预览"},z$={authBannerMessage:"未登录 · 需要登录 CyberNeurova 才能开始对话",authBannerLogin:"登录",authPageTitle:"登录 CyberNeurova",authPageMessage:"先连接 CyberNeurova 账号,然后再开始或继续对话。",authPageLogin:"登录",connecting:"连接中…",comingSoon:"敬请期待"},V$={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",newSession:"新建会话",newChat:"新建对话",newWorkspace:"新建工作区",emptyState:"还没有会话 · 点击 新建会话 开始",archiveConfirm:"归档会话?",confirm:"确认",cancel:"取消",options:"选项",rename:"重命名",copyPath:"复制路径",archive:"归档",fork:"分叉会话",delete:"删除",removeWorkspace:"移除工作区",brand:"CyberNeurova",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",language:"语言",daemon:"后台",noSessions:"暂无对话",showMore:"展开更多 ({count})",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话",searchClear:"清除搜索",searchNoResults:"没有匹配的会话"},K$={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",gitTag:"git",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"已中断",abortedTitle:"此会话在完成前被中断"},G$={jumpToLatestAria:"跳到最新消息",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",summaryTitle:"压缩摘要",manuallyAborted:"您已手动终止",activatedSkill:"已激活技能: {name}",undo:"撤销",undoTooltip:"撤销对话不会回滚代码",undoConfirm:"确定撤销?",confirm:"确定",cancel:"取消",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…"},Y$={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",modelTooltip:"点击切换模型",permissionManual:"逐条确认",permissionAuto:"完全自主",permissionYolo:"自动通过",permissionTooltip:"点击循环切换审批模式",permissionManualDesc:"每个工具操作都需要你手动确认",permissionAutoDesc:"完全自主运行,agent 自己做决定,不再询问",permissionYoloDesc:"自动批准工具操作,但遇到关键问题仍会询问",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",modesLabel:"模式",modesTooltip:"模式:计划 / 目标 / Swarm",goalLabel:"目标",swarmLabel:"Swarm",modeOff:"未启用",goalPlaceholder:"让 Agent 完成什么目标?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",swarmOn:"开",swarmOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},X$={placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",editQueued:"编辑(载入到输入框)",queuedImageOnly:"图片 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",remove:"移除",removeNamed:"移除 {name}",uploading:"上传中",uploadFailed:"上传失败",attachImage:"附加图片",previewAttachment:"预览 {name}",interrupt:"中断",interruptTitle:"中断当前操作",steerNow:"立即插入 ⌃S",steerTitle:"不等当前回合结束,把消息直接插进正在运行的任务(Ctrl+S / ⌘S)",emptyConversationTitle:"CyberNeurova",emptyConversation:"还没有消息 —— 在下方输入开始对话",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · thinking"},Z$={title:"登录 CyberNeurova",close:"关闭 (Esc)",starting:"正在启动授权流程…",lead:"点击下方按钮,在新标签页中完成授权。",authorizeInBrowser:"在浏览器中授权",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",waitingAuth:"等待授权",waitingAutoClose:"等待授权,完成后自动登录…",success:"已授权",successHint:"正在加载,稍后自动关闭…",expiredTitle:"授权码已过期",expiredHint:"请重新开始授权流程",retry:"重试",closeBtn:"关闭",errorTitle:"当前 daemon 暂不支持登录",errorHint:"请升级 cyberneurova-cli 后重试"},Q$={dialogLabel:"管理提供商",title:"提供商管理",close:"关闭 (Esc)",loading:"加载提供商中…",unavailable:"daemon 暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",modelCount:"{count} 个模型",confirmDelete:"确认删除?",confirm:"确认",cancel:"取消",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginCyberNeurova:"登录 CyberNeurova",loginAnthropic:"登录 Anthropic",enterApiKey:"填写 API Key",fieldType:"类型",fieldApiKey:"API Key",fieldBaseUrl:"Base URL",fieldDefaultModel:"默认模型",baseUrlPlaceholder:"https://… (可选)",optional:"可选",apiKeyRequired:"API Key 不能为空",add:"添加",escClose:"Esc 关闭"},J$={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",loading:"加载模型中…",unavailable:"daemon 暂不支持模型列表",contextSuffix:"{size}k ctx",emptyNoModels:"daemon 未提供可选模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",footerHint:"↑↓ 导航 · Enter 选择 · Esc 关闭"},eN={title:"新建会话",close:"关闭 (Esc)",cwdLabel:"工作目录",cwdPlaceholder:"工作目录绝对路径,如 /Users/you/project",recentLabel:"最近目录",titleFieldLabel:"标题",titleFieldPlaceholder:"可选,留空则自动命名",create:"新建",cancel:"取消",footerHint:"Enter 新建 · Esc 关闭"},tN={title:"会话",close:"关闭",searchPlaceholder:"按标题搜索会话…",noWorkspace:"无工作区",emptyNone:"暂无会话",emptyNoMatch:"没有匹配的会话",footerHint:"↑↓ 切换 · Enter 进入 · Esc 关闭",justNow:"刚刚"},nN={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",required:"APPROVAL REQUIRED",danger:"危险: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Esc 取消)",feedbackHint:"Enter 提交 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"+反馈"},sN={title:"提问",step:"Q{current}/{total}",prev:"‹ 上一",next:"下一 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开"},oN={tag:"tasks",summary:"{run} 运行中 · {done} 完成",stop:"stop",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"子 Agent",dockTodos:"待办",dockQueue:"队列",running:"运行中",closePanel:"关闭面板",timingRunning:"运行中 · {time}",timingDone:"完成 · {sec}s",todoTag:"待办",emptyTasks:"暂无后台任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无子 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",collapse:"折叠",expand:"展开"},iN={panelTitle:"思考过程",close:"关闭"},rN={title:"改动",branch:"branch",aheadTitle:"ahead of remote",behindTitle:"behind remote",changeCount:"{count} 改动",empty:"无 git 改动 / daemon 未提供",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",list:"列表",tree:"树形",close:"关闭"},lN={},aN={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",search:"搜索",prevMatch:"上一个匹配",nextMatch:"下一个匹配",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"二进制文件 · {mime} · {size} 字节 · 暂不预览",unknownType:"未知类型",copyCode:"复制代码",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",loadFailed:"无法读取这个文件"}},cN={searching:"搜索中…",noMatch:"无匹配"},uN={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",details:{cause:"底层原因",code:"错误码",contentType:"响应类型",details:"服务端详情",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",status:"HTTP 状态",timeout:"超时设置"},daemonApiTitle:"CyberNeurova daemon 返回错误",daemonNetworkMessage:"Web 没有拿到本地服务的响应。请确认 CyberNeurova daemon 仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 CyberNeurova daemon",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 CyberNeurova daemon 仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},dN={help:{desc:"显示可用命令列表"},new:{desc:"创建新会话"},sessions:{desc:"浏览/切换会话"},clear:{desc:"清空并新建会话"},model:{desc:"切换模型"},provider:{desc:"管理提供商 (添加/删除/刷新)"},login:{desc:"在浏览器中登录 CyberNeurova"},permission:{desc:"切换审批模式 (manual/auto/yolo)"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause|resume|cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},yolo:{desc:"自动批准一切 (yolo 模式)"},auto:{desc:"自动批准安全的读写"},thinking:{desc:"设置思考强度"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},undoNotImplemented:"daemon 尚未支持 /undo",status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},fN={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"计划",task:"任务"},chip:{lines:"{count} 行",results:"{count} 结果",edited:"已编辑",created:"已创建",todos:"{count} 项"}},hN={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},pN={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"会话设置",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"每个工具都确认",permAutoSub:"自动批准编辑",permYoloSub:"全部自动批准",planModeSub:"Plan mode",swarmModeSub:"Swarm mode"},mN={label:"主题",modern:"探索",cyberneurova:"原生",colorSchemeLabel:"外观",light:"浅色",dark:"深色",system:"跟随系统"},gN={title:"Welcome to CyberNeurova Web",subtitle:"Pick a few preferences — you can change them anytime in Settings.",languageLabel:"Language",themeLabel:"Theme",modernDesc:"Bubbles, conversational, softer.",neurovaDesc:"Native look: calm, flat.",start:"Get started",skip:"Skip",reopen:"Preferences / onboarding"},vN={title:"欢迎来使用 CyberNeurova Web",subtitle:"来选择一些你的偏好 —— 之后也可以在设置里随时修改。",languageLabel:"语言",themeLabel:"主题",modernDesc:"气泡、对话感、更柔和。",neurovaDesc:"原生风格:安静、扁平。",start:"开始使用",skip:"跳过",reopen:"偏好 / 引导"},yN={title:"Settings",tabs:{general:"General",agent:"Agent",advanced:"Advanced",experimental:"Experimental"},appearance:"Appearance",notifications:"Notifications",notifyOnComplete:"Notify when a turn completes",notifyDenied:"Blocked in browser settings",notifyBody:"Finished a turn",account:"Account",uiFontSize:"Font size",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",permission:{manual:"Manual",auto:"Auto",yolo:"YOLO"},defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",mergeSkills:"Merge all available skills",mergeSkillsHint:"Show project, plugin, and user skills together",telemetry:"Telemetry",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",advanced:"Advanced",build:"Build",serverVersion:"Server version",exportLog:"Troubleshooting log",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",beta:"Experimental",betaToc:"Proportional conversation outline",betaTocHint:" Larger bubbles, viewport indicator, and hover tooltip"},kN={title:"设置",tabs:{general:"通用",agent:"Agent",advanced:"高级",experimental:"实验性"},appearance:"外观",notifications:"通知",notifyOnComplete:"会话完成时通知",notifyDenied:"已在浏览器设置中被阻止",notifyBody:"已完成一轮",account:"账户",uiFontSize:"字体大小",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",permission:{manual:"手动",auto:"自动",yolo:"全自动"},defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启 thinking",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入 plan mode",mergeSkills:"合并所有可用 Skills",mergeSkillsHint:"让项目、插件和用户 Skills 一起出现在可用列表中",telemetry:"遥测",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",advanced:"高级",build:"构建",serverVersion:"服务端版本",exportLog:"故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",beta:"实验性",betaToc:"对话目录增强",betaTocHint:"更大的气泡、视口指示器和悬停提示"},bN={openInEditor:"Open in editor",openInEditorShort:"Open",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",options:"Options",copySessionId:"Copy Session ID",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",confirmArchive:"Confirm archive?"},_N={openInEditor:"在编辑器中打开",openInEditorShort:"打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"detached",openPr:"打开 Pull Request",options:"选项",copySessionId:"复制 Session ID",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",confirmArchive:"确认归档?"},wN={title:"Side chat",subtitle:"forked from this session",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},SN={title:"侧边聊天",subtitle:"从当前会话 fork",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},CN={en:{common:y$,app:k$,sidebar:b$,workspace:_$,conversation:w$,status:S$,composer:C$,login:x$,providers:T$,model:M$,newSession:A$,sessions:E$,approval:I$,question:$$,tasks:N$,thinking:L$,diff:O$,fileTree:R$,filePreview:P$,mention:D$,warnings:B$,commands:F$,tools:H$,layout:W$,mobile:U$,theme:q$,onboarding:gN,settings:yN,header:bN,sideChat:wN},zh:{common:j$,app:z$,sidebar:V$,workspace:K$,conversation:G$,status:Y$,composer:X$,login:Z$,providers:Q$,model:J$,newSession:eN,sessions:tN,approval:nN,question:sN,tasks:oN,thinking:iN,diff:rN,fileTree:lN,filePreview:aN,mention:cN,warnings:uN,commands:dN,tools:fN,layout:hN,mobile:pN,theme:mN,onboarding:vN,settings:kN,header:_N,sideChat:SN}},sC="cyberneurova-locale",oC=[{code:"en",label:"English"},{code:"zh",label:"中文"}];function xN(){const e=globalThis.localStorage?.getItem(sC);return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}const bn=g6({legacy:!1,locale:xN(),fallbackLocale:"en",messages:CN});function iC(e){bn.global.locale.value=e,globalThis.localStorage?.setItem(sC,e)}const ea=bn.global.t,TN={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task"},MN={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search"};function ru(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return MN[t]??t}function Ok(e){const t=TN[ru(e)];return t?ea(t):e}const AN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="2.5" y="1.5" width="9" height="13" rx="1"/><line x1="5" y1="5" x2="9" y2="5"/><line x1="5" y1="7.5" x2="11" y2="7.5"/><line x1="5" y1="10" x2="10" y2="10"/></svg>',EN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5"/><polyline points="4,6 6.5,8 4,10"/><line x1="8" y1="10" x2="12" y2="10"/></svg>',Rk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M10.5 2.5l3 3-8 8H2.5v-3l8-8z"/><line x1="8.5" y1="4.5" x2="11.5" y2="7.5"/></svg>',IN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M3 12V4.5L8 2l5 2.5V12H3z"/><line x1="6" y1="7" x2="10" y2="7"/><line x1="8" y1="5" x2="8" y2="9"/></svg>',Pk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="6.5" cy="6.5" r="4"/><line x1="9.5" y1="9.5" x2="13.5" y2="13.5"/></svg>',$N='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5C3.5 2.5 3.5 5 3.5 6.5S2.5 8 2.5 8s1 0 1 1.5S3.5 13.5 5 13.5"/><path d="M11 2.5c1.5 0 1.5 2.5 1.5 4S13.5 8 13.5 8s-1 0-1 1.5.5 4-1.5 4"/><line x1="8" y1="6" x2="8" y2="10"/><line x1="6.3" y1="6.8" x2="9.7" y2="9.2"/><line x1="9.7" y1="6.8" x2="6.3" y2="9.2"/></svg>',NN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',LN='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 2c-2 2-3 3.6-3 6s1 4 3 6"/><path d="M8 2c2 2 3 3.6 3 6s-1 4-3 6"/><line x1="2" y1="8" x2="14" y2="8"/></svg>',Dk='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" xmlns="http://www.w3.org/2000/svg"><polyline points="2,4.5 3.5,6 5.5,3"/><polyline points="2,11 3.5,12.5 5.5,9.5"/><line x1="8" y1="4.5" x2="14" y2="4.5"/><line x1="8" y1="11" x2="14" y2="11"/></svg>',ON='<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8.5 1L3 9h4l-1.5 6 5.5-8h-4l1.5-6z"/></svg>',RN="";function PN(e){switch(ru(e)){case"read":return AN;case"bash":return EN;case"edit":return Rk;case"multi_edit":return Rk;case"write":return IN;case"grep":return Pk;case"search":return Pk;case"glob":return $N;case"ls":return NN;case"web_fetch":return LN;case"todo":return Dk;case"task":return Dk;default:return(e??"").trim().toLowerCase().includes("skill")?ON:RN}}const rC=80;function DN(e,t=rC){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function BN(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function FN(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Dt(e){return typeof e=="string"&&e.length>0?e:void 0}function Hr(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function HN(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function im(e){return Dt(e.path)??Dt(e.file_path)??Dt(e.filePath)??Dt(e.filename)}const WN=64;function Bk(e,t,n=!1){const s=(o,i=rC)=>n?o.trim():DN(o,i);try{const o=FN(t);if(!n&&BN(t,o))return"";const i=()=>s(t.replace(/^·\s*/,""));if(!o)return i();switch(ru(e)){case"read":{const r=im(o);if(!r)return i();const l=Hr(o.offset)??Hr(o.line_start)??Hr(o.start_line),a=Hr(o.limit)??Hr(o.length),c=Hr(o.line_end)??Hr(o.end_line)??(l!==void 0&&a!==void 0?l+a:void 0);return s(l!==void 0&&c!==void 0?`${r}:${l}-${c}`:l!==void 0?`${r}:${l}`:r)}case"write":{const r=im(o);return r?s(`${r} ${ea("tools.chip.created")}`):i()}case"edit":case"multi_edit":{const r=im(o);return r?s(r):i()}case"bash":{const r=Dt(o.command)??Dt(o.cmd)??Dt(o.script);return r?s(r,WN):i()}case"grep":case"search":{const r=Dt(o.pattern)??Dt(o.query)??Dt(o.regex),l=Dt(o.path)??Dt(o.glob)??Dt(o.include);return r&&l?s(`${r} in ${l}`):r?s(r):i()}case"glob":{const r=Dt(o.pattern)??Dt(o.glob)??Dt(o.query),l=Dt(o.path)??Dt(o.cwd);return r&&l?s(`${r} in ${l}`):r?s(r):Dt(o.path)?s(Dt(o.path)):i()}case"ls":{const r=Dt(o.path)??Dt(o.dir)??Dt(o.directory)??Dt(o.cwd);return r?s(r):i()}case"web_fetch":{const r=Dt(o.url)??Dt(o.uri);return r?s(HN(r)):i()}case"todo":case"task":{const r=Dt(o.description)??Dt(o.title)??Dt(o.prompt)??Dt(o.name)??Dt(o.subagent_type);if(r)return s(r);const l=Array.isArray(o.todos)?o.todos:Array.isArray(o.items)?o.items:void 0;return l?s(ea("tools.chip.todos",{count:l.length})):i()}default:return i()}}catch{return t}}function UN(e){try{switch(ru(e.name)){case"bash":return e.timing?e.timing:"";case"read":{if(e.output&&e.output.length>0){const t=e.output.length;return ea("tools.chip.lines",{count:t})}return""}case"edit":case"multi_edit":case"write":{if(e.output){for(const n of e.output){const s=n.match(/\+(\d+).*[-−](\d+)/);if(s)return`+${s[1]} −${s[2]}`}const t=e.output.find(n=>/\d+/.test(n));if(t){const n=t.match(/\+(\d+)/),s=t.match(/[-−](\d+)/);if(n||s)return`${n?`+${n[1]}`:""} ${s?`−${s[1]}`:""}`.trim()}if(e.status!=="error")return ea("tools.chip.edited")}return""}case"grep":case"search":return e.output&&e.output.length>0?ea("tools.chip.results",{count:e.output.length}):"";default:return""}}catch{return""}}const qN=["title"],jN=["title"],zN=["src","alt"],VN=["src"],KN=["src"],GN={class:"car",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},YN=["points"],XN=["innerHTML"],ZN={class:"a"},QN=["title"],JN={class:"rt"},e5={key:0,class:"chip"},t5={key:1,class:"spin",role:"status","aria-label":"running"},n5={key:3,class:"tm"},s5={key:0,class:"bb"},o5={key:0,class:"bb-summary"},i5={key:1,class:"bb-empty"},r5=Ze({__name:"ToolCall",props:{tool:{},mobile:{type:Boolean,default:!1},stackPosition:{default:"single"}},emits:["openMedia"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>n.tool.status==="running"&&/^bash$/i.test(n.tool.name)),i=j(()=>!!n.tool.output&&n.tool.output.length>0),r=j(()=>i.value||o.value),l=te(n.tool.defaultExpanded===!0&&r.value);function a(){r.value&&(l.value=!l.value)}Ve(()=>[n.tool.defaultExpanded,n.tool.output?.length,n.tool.status,n.tool.name],()=>{n.tool.defaultExpanded===!0&&r.value&&(l.value=!0)});const c=()=>n.tool.status==="error"?"✕":"✓",u=()=>Ok(n.tool.name),d=()=>PN(n.tool.name),p=()=>Bk(n.tool.name,n.tool.arg),m=()=>Bk(n.tool.name,n.tool.arg,!0),f=()=>UN({name:n.tool.name,arg:n.tool.arg,output:n.tool.output,timing:n.tool.timing,status:n.tool.status}),v=()=>n.tool.status==="error",w=j(()=>n.tool.status==="ok"?n.tool.media:void 0);function _(k){return k.split(/[\\/]+/).pop()||k}function b(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/1024/1024).toFixed(1)} MB`}const g=j(()=>{const k=w.value;if(!k)return"";const $=[k.path?_(k.path):Ok(n.tool.name)];return k.mimeType&&$.push(k.mimeType),k.bytes!==void 0&&$.push(b(k.bytes)),k.dimensions&&$.push(k.dimensions),$.join(" · ")});function y(){const k=w.value;k?.kind==="image"&&s("openMedia",k)}return(k,$)=>w.value?(C(),A("div",{key:0,class:Ee(["media-tool",{mob:e.mobile}])},[h("div",{class:"media-title",title:w.value.path||g.value},N(g.value),9,qN),w.value.kind==="image"?(C(),A("button",{key:0,type:"button",class:"media-image-button",title:w.value.path||g.value,onClick:y},[h("img",{class:"media-image",src:w.value.url,alt:w.value.path?_(w.value.path):g.value,loading:"lazy"},null,8,zN)],8,jN)):w.value.kind==="video"?(C(),A("video",{key:1,class:"media-video",src:w.value.url,controls:"",preload:"metadata"},null,8,VN)):(C(),A("audio",{key:2,class:"media-audio",src:w.value.url,controls:""},null,8,KN))],2)):(C(),A("div",{key:1,class:Ee(["box",{open:l.value,err:v(),mob:e.mobile,stacked:e.stackPosition!=="single","stack-first":e.stackPosition==="first","stack-middle":e.stackPosition==="middle","stack-last":e.stackPosition==="last"}])},[h("div",{class:"bh",onClick:a},[(C(),A("svg",GN,[h("polyline",{points:l.value?"4,6 8,10 12,6":"6,4 10,8 6,12"},null,8,YN)])),d()?(C(),A("span",{key:0,class:"gl",innerHTML:d(),"aria-hidden":"true"},null,8,XN)):re("",!0),h("span",ZN,N(u()),1),l.value?re("",!0):(C(),A("span",{key:1,class:"p",title:p()},N(p()),9,QN)),h("span",JN,[f()?(C(),A("span",e5,N(f()),1)):re("",!0),e.tool.status==="running"?(C(),A("span",t5)):(C(),A("span",{key:2,class:Ee(e.tool.status==="ok"?"ok":"er")},N(c()),3)),e.tool.timing&&e.tool.name!=="bash"?(C(),A("span",n5,N(e.tool.timing),1)):re("",!0)])]),l.value?(C(),A("div",s5,[m()?(C(),A("div",o5,N(m()),1)):re("",!0),i.value?re("",!0):(C(),A("div",i5,"Waiting for output…")),(C(!0),A(Ie,null,Xe(e.tool.output??[],(E,S)=>(C(),A("div",{key:S},N(E),1))),128))])):re("",!0)],2))}}),ed=yt(r5,[["__scopeId","data-v-90451e12"]]);var l5=Object.create,Z1=Object.defineProperty,a5=Object.getOwnPropertyDescriptor,lC=Object.getOwnPropertyNames,c5=Object.getPrototypeOf,u5=Object.prototype.hasOwnProperty,aC=(e,t)=>function(){return t||(0,e[lC(e)[0]])((t={exports:{}}).exports,t),t.exports},cC=e=>{let t={};for(var n in e)Z1(t,n,{get:e[n],enumerable:!0});return t},d5=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=lC(t),i=0,r=o.length,l;i<r;i++)l=o[i],!u5.call(e,l)&&l!==n&&Z1(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(s=a5(t,l))||s.enumerable});return e},uC=(e,t,n)=>(n=e!=null?l5(c5(e)):{},d5(Z1(n,"default",{value:e,enumerable:!0}),e));function f5(e,t,n,s){const o=Number(e[t].meta.id+1).toString();let i="";return typeof s.docId=="string"&&(i=`-${s.docId}-`),i+o}function h5(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function p5(e,t,n,s,o){const i=o.rules.footnote_anchor_name(e,t,n,s,o),r=o.rules.footnote_caption(e,t,n,s,o);let l=i;return e[t].meta.subId>0&&(l+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${i}" id="fnref${l}">${r}</a></sup>`}function m5(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
39
+ `:`<hr class="footnotes-sep">
40
+ `)+`<section class="footnotes">
41
+ <ol class="footnotes-list">
42
+ `}function g5(){return`</ol>
43
+ </section>
44
+ `}function v5(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),`<li id="fn${i}" class="footnote-item">`}function y5(){return`</li>
45
+ `}function k5(e,t,n,s,o){let i=o.rules.footnote_anchor_name(e,t,n,s,o);return e[t].meta.subId>0&&(i+=`:${e[t].meta.subId}`),` <a href="#fnref${i}" class="footnote-backref">↩︎</a>`}function b5(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=p5,e.renderer.rules.footnote_block_open=m5,e.renderer.rules.footnote_block_close=g5,e.renderer.rules.footnote_open=v5,e.renderer.rules.footnote_close=y5,e.renderer.rules.footnote_anchor=k5,e.renderer.rules.footnote_caption=h5,e.renderer.rules.footnote_anchor_name=f5;function s(l,a,c,u){const d=l.bMarks[a]+l.tShift[a],p=l.eMarks[a];if(d+4>p||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let m;for(m=d+2;m<p;m++){if(l.src.charCodeAt(m)===32)return!1;if(l.src.charCodeAt(m)===93)break}if(m===d+2||m+1>=p||l.src.charCodeAt(++m)!==58)return!1;if(u)return!0;m++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const f=l.src.slice(d+2,m-2);l.env.footnotes.refs[`:${f}`]=-1;const v=new l.Token("footnote_reference_open","",1);v.meta={label:f},v.level=l.level++,l.tokens.push(v);const w=l.bMarks[a],_=l.tShift[a],b=l.sCount[a],g=l.parentType,y=m,k=l.sCount[a]+m-(l.bMarks[a]+l.tShift[a]);let $=k;for(;m<p;){const S=l.src.charCodeAt(m);if(n(S))S===9?$+=4-$%4:$++;else break;m++}l.tShift[a]=m-y,l.sCount[a]=$-k,l.bMarks[a]=y,l.blkIndent+=4,l.parentType="footnote",l.sCount[a]<l.blkIndent&&(l.sCount[a]+=l.blkIndent),l.md.block.tokenize(l,a,c,!0),l.parentType=g,l.blkIndent-=4,l.tShift[a]=_,l.sCount[a]=b,l.bMarks[a]=w;const E=new l.Token("footnote_reference_close","",-1);return E.level=--l.level,l.tokens.push(E),!0}function o(l,a){const c=l.posMax,u=l.pos;if(u+2>=c||l.src.charCodeAt(u)!==94||l.src.charCodeAt(u+1)!==91)return!1;const d=u+2,p=t(l,u+1);if(p<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const m=l.env.footnotes.list.length,f=[];l.md.inline.parse(l.src.slice(d,p),l.md,l.env,f);const v=l.push("footnote_ref","",0);v.meta={id:m},l.env.footnotes.list[m]={content:l.src.slice(d,p),tokens:f}}return l.pos=p+1,l.posMax=c,!0}function i(l,a){const c=l.posMax,u=l.pos;if(u+3>c||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(u)!==91||l.src.charCodeAt(u+1)!==94)return!1;let d;for(d=u+2;d<c;d++){if(l.src.charCodeAt(d)===32||l.src.charCodeAt(d)===10)return!1;if(l.src.charCodeAt(d)===93)break}if(d===u+2||d>=c)return!1;d++;const p=l.src.slice(u+2,d-1);if(typeof l.env.footnotes.refs[`:${p}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let m;l.env.footnotes.refs[`:${p}`]<0?(m=l.env.footnotes.list.length,l.env.footnotes.list[m]={label:p,count:0},l.env.footnotes.refs[`:${p}`]=m):m=l.env.footnotes.refs[`:${p}`];const f=l.env.footnotes.list[m].count;l.env.footnotes.list[m].count++;const v=l.push("footnote_ref","",0);v.meta={id:m,subId:f,label:p}}return l.pos=d,l.posMax=c,!0}function r(l){let a,c,u,d=!1;const p={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(f){return f.type==="footnote_reference_open"?(d=!0,c=[],u=f.meta.label,!1):f.type==="footnote_reference_close"?(d=!1,p[":"+u]=c,!1):(d&&c.push(f),!d)}),!l.env.footnotes.list))return;const m=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let f=0,v=m.length;f<v;f++){const w=new l.Token("footnote_open","",1);if(w.meta={id:f,label:m[f].label},l.tokens.push(w),m[f].tokens){a=[];const g=new l.Token("paragraph_open","p",1);g.block=!0,a.push(g);const y=new l.Token("inline","",0);y.children=m[f].tokens,y.content=m[f].content,a.push(y);const k=new l.Token("paragraph_close","p",-1);k.block=!0,a.push(k)}else m[f].label&&(a=p[`:${m[f].label}`]);a&&(l.tokens=l.tokens.concat(a));let _;l.tokens[l.tokens.length-1].type==="paragraph_close"?_=l.tokens.pop():_=null;const b=m[f].count>0?m[f].count:1;for(let g=0;g<b;g++){const y=new l.Token("footnote_anchor","",0);y.meta={id:f,subId:g,label:m[f].label},l.tokens.push(y)}_&&l.tokens.push(_),l.tokens.push(new l.Token("footnote_close","",-1))}l.tokens.push(new l.Token("footnote_block_close","",-1))}e.block.ruler.before("reference","footnote_def",s,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnote_inline",o),e.inline.ruler.after("footnote_inline","footnote_ref",i),e.core.ruler.after("inline","footnote_tail",r)}function _5(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==43)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){let i;const r=[],l=o.length;for(let a=0;a<l;a++){const c=o[a];if(c.marker!==43||c.end===-1)continue;const u=o[c.end];i=s.tokens[c.token],i.type="ins_open",i.tag="ins",i.nesting=1,i.markup="++",i.content="",i=s.tokens[u.token],i.type="ins_close",i.tag="ins",i.nesting=-1,i.markup="++",i.content="",s.tokens[u.token-1].type==="text"&&s.tokens[u.token-1].content==="+"&&r.push(u.token-1)}for(;r.length;){const a=r.pop();let c=a+1;for(;c<s.tokens.length&&s.tokens[c].type==="ins_close";)c++;c--,a!==c&&(i=s.tokens[c],s.tokens[c]=s.tokens[a],s.tokens[a]=i)}}e.inline.ruler.before("emphasis","ins",t),e.inline.ruler2.before("emphasis","ins",function(s){const o=s.tokens_meta,i=(s.tokens_meta||[]).length;n(s,s.delimiters);for(let r=0;r<i;r++)o[r]&&o[r].delimiters&&n(s,o[r].delimiters)})}function w5(e){function t(s,o){const i=s.pos,r=s.src.charCodeAt(i);if(o||r!==61)return!1;const l=s.scanDelims(s.pos,!0);let a=l.length;const c=String.fromCharCode(r);if(a<2)return!1;if(a%2){const u=s.push("text","",0);u.content=c,a--}for(let u=0;u<a;u+=2){const d=s.push("text","",0);d.content=c+c,!(!l.can_open&&!l.can_close)&&s.delimiters.push({marker:r,length:0,jump:u/2,token:s.tokens.length-1,end:-1,open:l.can_open,close:l.can_close})}return s.pos+=l.length,!0}function n(s,o){const i=[],r=o.length;for(let l=0;l<r;l++){const a=o[l];if(a.marker!==61||a.end===-1)continue;const c=o[a.end],u=s.tokens[a.token];u.type="mark_open",u.tag="mark",u.nesting=1,u.markup="==",u.content="";const d=s.tokens[c.token];d.type="mark_close",d.tag="mark",d.nesting=-1,d.markup="==",d.content="",s.tokens[c.token-1].type==="text"&&s.tokens[c.token-1].content==="="&&i.push(c.token-1)}for(;i.length;){const l=i.pop();let a=l+1;for(;a<s.tokens.length&&s.tokens[a].type==="mark_close";)a++;if(a--,l!==a){const c=s.tokens[a];s.tokens[a]=s.tokens[l],s.tokens[l]=c}}}e.inline.ruler.before("emphasis","mark",t),e.inline.ruler2.before("emphasis","mark",function(s){let o;const i=s.tokens_meta,r=(s.tokens_meta||[]).length;for(n(s,s.delimiters),o=0;o<r;o++)i[o]&&i[o].delimiters&&n(s,i[o].delimiters)})}const S5=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function C5(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==126||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===126){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sub_open","sub",1);r.markup="~";const l=e.push("text","",0);l.content=i.replace(S5,"$1");const a=e.push("sub_close","sub",-1);return a.markup="~",e.pos=e.posMax+1,e.posMax=n,!0}function x5(e){e.inline.ruler.after("emphasis","sub",C5)}const T5=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function M5(e,t){const n=e.posMax,s=e.pos;if(e.src.charCodeAt(s)!==94||t||s+2>=n)return!1;e.pos=s+1;let o=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){o=!0;break}e.md.inline.skipToken(e)}if(!o||s+1===e.pos)return e.pos=s,!1;const i=e.src.slice(s+1,e.pos);if(i.match(/(^|[^\\])(\\\\)*\s/))return e.pos=s,!1;e.posMax=e.pos,e.pos=s+1;const r=e.push("sup_open","sup",1);r.markup="^";const l=e.push("text","",0);l.content=i.replace(T5,"$1");const a=e.push("sup_close","sup",-1);return a.markup="^",e.pos=e.posMax+1,e.posMax=n,!0}function A5(e){e.inline.ruler.after("emphasis","sup",M5)}var E5=aC({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(v,w){w=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},w),v.core.ruler.after("inline","github-task-lists",function(_){for(var b=_.tokens,g=0,y=2;y<b.length;y++)o(b,y)&&(i(b[y],g,w,_.Token),g+=1,n(b[y-2],"class",w.liClass),n(b[s(b,y-2)],"class",w.ulClass))})};function n(v,w,_){var b=v.attrIndex(w),g=[w,_];b<0?v.attrPush(g):v.attrs[b]=g}function s(v,w){for(var _=v[w].level-1,b=w-1;b>=0;b--)if(v[b].level===_)return b;return-1}function o(v,w){return d(v[w])&&p(v[w-1])&&m(v[w-2])&&f(v[w])}function i(v,w,_,b){var g=_.idPrefix+w;v.children[0].content=v.children[0].content.slice(3),v.children.unshift(l(g,b)),v.children.push(a(b)),v.children.unshift(r(v,g,_,b)),_.divWrap&&(v.children.unshift(c(_,b)),v.children.push(u(b)))}function r(v,w,_,b){var g=new b("checkbox_input","input",0);return g.attrs=[["type","checkbox"],["id",w]],/^\[[xX]\][ \u00A0]/.test(v.content)===!0&&g.attrs.push(["checked","true"]),_.disabled===!0&&g.attrs.push(["disabled","true"]),g}function l(v,w){var _=new w("label_open","label",1);return _.attrs=[["for",v]],_}function a(v){return new v("label_close","label",-1)}function c(v,w){var _=new w("checkbox_open","div",0);return _.attrs=[["class",v.divClass]],_}function u(v){return new v("checkbox_close","div",-1)}function d(v){return v.type==="inline"}function p(v){return v.type==="paragraph_open"}function m(v){return v.type==="list_item_open"}function f(v){return/^\[[xX \u00A0]\][ \u00A0]/.test(v.content)}})}),I5=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),$5=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),rm;const N5=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),L5=(rm=String.fromCodePoint)!==null&&rm!==void 0?rm:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function O5(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=N5.get(e))!==null&&t!==void 0?t:e}var Rn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Rn||(Rn={}));const R5=32;var nr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(nr||(nr={}));function Mg(e){return e>=Rn.ZERO&&e<=Rn.NINE}function P5(e){return e>=Rn.UPPER_A&&e<=Rn.UPPER_F||e>=Rn.LOWER_A&&e<=Rn.LOWER_F}function D5(e){return e>=Rn.UPPER_A&&e<=Rn.UPPER_Z||e>=Rn.LOWER_A&&e<=Rn.LOWER_Z||Mg(e)}function B5(e){return e===Rn.EQUALS||D5(e)}var On;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(On||(On={}));var Ji;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ji||(Ji={}));var F5=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=On.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ji.Strict}startEntity(e){this.decodeMode=e,this.state=On.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case On.EntityStart:return e.charCodeAt(t)===Rn.NUM?(this.state=On.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=On.NamedEntity,this.stateNamedEntity(e,t));case On.NumericStart:return this.stateNumericStart(e,t);case On.NumericDecimal:return this.stateNumericDecimal(e,t);case On.NumericHex:return this.stateNumericHex(e,t);case On.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|R5)===Rn.LOWER_X?(this.state=On.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=On.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,s){if(t!==n){const o=n-t;this.result=this.result*Math.pow(s,o)+parseInt(e.substr(t,o),s),this.consumed+=o}}stateNumericHex(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Mg(s)||P5(s))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){const n=t;for(;t<e.length;){const s=e.charCodeAt(t);if(Mg(s))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Rn.SEMI)this.consumed+=1;else if(this.decodeMode===Ji.Strict)return 0;return this.emitCodePoint(O5(this.result),this.consumed),this.errors&&(e!==Rn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:n}=this;let s=n[this.treeIndex],o=(s&nr.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const i=e.charCodeAt(t);if(this.treeIndex=H5(n,s,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Ji.Attribute&&(o===0||B5(i))?0:this.emitNotTerminatedNamedEntity();if(s=n[this.treeIndex],o=(s&nr.VALUE_LENGTH)>>14,o!==0){if(i===Rn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Ji.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:n}=this,s=(n[t]&nr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:s}=this;return this.emitCodePoint(t===1?s[e]&~nr.VALUE_LENGTH:s[e+1],n),t===3&&this.emitCodePoint(s[e+2],n),n}end(){var e;switch(this.state){case On.NamedEntity:return this.result!==0&&(this.decodeMode!==Ji.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case On.NumericDecimal:return this.emitNumericEntity(0,2);case On.NumericHex:return this.emitNumericEntity(0,3);case On.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case On.EntityStart:return 0}}};function dC(e){let t="";const n=new F5(e,s=>t+=L5(s));return function(o,i){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(i);const c=n.write(o,l+1);if(c<0){r=l+n.end();break}r=l+c,l=c===0?r+1:r}const a=t+o.slice(r);return t="",a}}function H5(e,t,n,s){const o=(t&nr.BRANCH_LENGTH)>>7,i=t&nr.JUMP_TABLE;if(o===0)return i!==0&&s===i?n:-1;if(i){const a=s-i;return a<0||a>=o?-1:e[n+a]-1}let r=n,l=r+o-1;for(;r<=l;){const a=r+l>>>1,c=e[a];if(c<s)r=a+1;else if(c>s)l=a-1;else return e[a+o]}return-1}const W5=dC(I5);dC($5);function Q1(e,t=Ji.Legacy){return W5(e,t)}var U5=uC(E5());const Fk={};function q5(e){let t=Fk[e];if(t)return t;t=Fk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);t.push(s)}for(let n=0;n<e.length;n++){const s=e.charCodeAt(n);t[s]="%"+("0"+s.toString(16).toUpperCase()).slice(-2)}return t}function dh(e,t){typeof t!="string"&&(t=dh.defaultChars);const n=q5(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(s){let o="";for(let i=0,r=s.length;i<r;i+=3){const l=parseInt(s.slice(i+1,i+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&i+3<r){const a=parseInt(s.slice(i+4,i+6),16);if((a&192)===128){const c=l<<6&1984|a&63;c<128?o+="��":o+=String.fromCharCode(c),i+=3;continue}}if((l&240)===224&&i+6<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16);if((a&192)===128&&(c&192)===128){const u=l<<12&61440|a<<6&4032|c&63;u<2048||u>=55296&&u<=57343?o+="���":o+=String.fromCharCode(u),i+=6;continue}}if((l&248)===240&&i+9<r){const a=parseInt(s.slice(i+4,i+6),16),c=parseInt(s.slice(i+7,i+9),16),u=parseInt(s.slice(i+10,i+12),16);if((a&192)===128&&(c&192)===128&&(u&192)===128){let d=l<<18&1835008|a<<12&258048|c<<6&4032|u&63;d<65536||d>1114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}o+="�"}return o})}dh.defaultChars=";/?:@&=+$,#";dh.componentChars="";var Ag=dh;const Hk={};function j5(e){let t=Hk[e];if(t)return t;t=Hk[e]=[];for(let n=0;n<128;n++){const s=String.fromCharCode(n);/^[0-9a-z]$/i.test(s)?t.push(s):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function fh(e,t,n){typeof t!="string"&&(n=t,t=fh.defaultChars),typeof n>"u"&&(n=!0);const s=j5(t);let o="";for(let i=0,r=e.length;i<r;i++){const l=e.charCodeAt(i);if(n&&l===37&&i+2<r&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){o+=e.slice(i,i+3),i+=2;continue}if(l<128){o+=s[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&i+1<r){const a=e.charCodeAt(i+1);if(a>=56320&&a<=57343){o+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[i])}return o}fh.defaultChars=";/?:@&=+$,-_.!~*'()#";fh.componentChars="-_.!~*'()";var fC=fh;function J1(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function uf(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const z5=/^([a-z0-9.+-]+:)/i,V5=/:[0-9]*$/,K5=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,G5=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
46
+ `," "]),Y5=["'"].concat(G5),Wk=["%","/","?",";","#"].concat(Y5),Uk=["/","?","#"],X5=255,qk=/^[+a-z0-9A-Z_-]{0,63}$/,Z5=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,jk={javascript:!0,"javascript:":!0},zk={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Q5(e,t){if(e&&e instanceof uf)return e;const n=new uf;return n.parse(e,t),n}uf.prototype.parse=function(e,t){let n,s,o,i=e;if(i=i.trim(),!t&&e.split("#").length===1){const c=K5.exec(i);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let r=z5.exec(i);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,i=i.substr(r.length)),(t||r||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=i.substr(0,2)==="//",o&&!(r&&jk[r])&&(i=i.substr(2),this.slashes=!0)),!jk[r]&&(o||r&&!zk[r])){let c=-1;for(let f=0;f<Uk.length;f++)s=i.indexOf(Uk[f]),s!==-1&&(c===-1||s<c)&&(c=s);let u,d;c===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",c),d!==-1&&(u=i.slice(0,d),i=i.slice(d+1),this.auth=u),c=-1;for(let f=0;f<Wk.length;f++)s=i.indexOf(Wk[f]),s!==-1&&(c===-1||s<c)&&(c=s);c===-1&&(c=i.length),i[c-1]===":"&&c--;const p=i.slice(0,c);i=i.slice(c),this.parseHost(p),this.hostname=this.hostname||"";const m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){const f=this.hostname.split(/\./);for(let v=0,w=f.length;v<w;v++){const _=f[v];if(_&&!_.match(qk)){let b="";for(let g=0,y=_.length;g<y;g++)_.charCodeAt(g)>127?b+="x":b+=_[g];if(!b.match(qk)){const g=f.slice(0,v),y=f.slice(v+1),k=_.match(Z5);k&&(g.push(k[1]),y.unshift(k[2])),y.length&&(i=y.join(".")+i),this.hostname=g.join(".");break}}}}this.hostname.length>X5&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=i.indexOf("#");l!==-1&&(this.hash=i.substr(l),i=i.slice(0,l));const a=i.indexOf("?");return a!==-1&&(this.search=i.substr(a),i=i.slice(0,a)),i&&(this.pathname=i),zk[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};uf.prototype.parseHost=function(e){let t=V5.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var ev=Q5,hC=cC({decode:()=>Ag,encode:()=>fC,format:()=>J1,parse:()=>ev}),pC=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,mC=/[\0-\x1F\x7F-\x9F]/,J5=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,gC=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,e8=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,vC=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,t8=cC({Any:()=>pC,Cc:()=>mC,Cf:()=>J5,P:()=>gC,S:()=>e8,Z:()=>vC}),n8=Object.defineProperty,yC=e=>{let t={};for(var n in e)n8(t,n,{get:e[n],enumerable:!0});return t},s8=yC({arrayReplaceAt:()=>u8,assign:()=>a8,countLines:()=>mn,escapeHtml:()=>k8,escapeRE:()=>_8,fromCodePoint:()=>zc,has:()=>l8,isMdAsciiPunct:()=>hf,isPunctChar:()=>ff,isPunctCode:()=>Eg,isSpace:()=>c8,isString:()=>i8,isValidEntityCode:()=>ph,isWhiteSpace:()=>jc,lib:()=>w8,mdurl:()=>hC,normalizeReference:()=>hh,ucmicro:()=>df,unescapeAll:()=>Vc,unescapeMd:()=>p8});const df=t8;function o8(e){return Object.prototype.toString.call(e)}function i8(e){return o8(e)==="[object String]"}const r8=Object.prototype.hasOwnProperty;function l8(e,t){return r8.call(e,t)}function a8(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(s=>{e[s]=n[s]})}}),e}function c8(e){return e===9||e===32}function jc(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ff(e){return df.P.test(e)||df.S.test(e)}const Vk=new Map;function Eg(e){if(hf(e))return!0;const t=Vk.get(e);if(t!==void 0)return t;const n=ff(String.fromCharCode(e));return Vk.set(e,n),n}function hf(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function hh(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function u8(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function ph(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function zc(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const kC=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,d8=new RegExp(`${kC.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),f8=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function h8(e,t){if(t.charCodeAt(0)===35&&f8.test(t)){const s=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return ph(s)?zc(s):e}const n=Q1(e);return n!==e?n:e}function p8(e){return e.includes("\\")?e.replace(kC,"$1"):e}function Vc(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(d8,(t,n,s)=>n||h8(t,s))}const m8=/[&<>"]/,g8=/[&<>"]/g,v8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function y8(e){return v8[e]}function k8(e){return m8.test(e)?e.replace(g8,y8):e}const b8=/[.?*+^$[\]\\(){}|-]/g;function _8(e){return e.replace(b8,"\\$&")}const w8={mdurl:hC,ucmicro:df};function mn(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
47
+ `,n+1))!==-1;)t++;return t}const S8=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,C8=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,x8=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,tv=["references","footnotes","abbreviations","abbr","abbrs"],nv=Symbol.for("markdown-it-ts.global-state"),sv=Object.prototype.hasOwnProperty;function Kk(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Lo(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function rr(e){if(Array.isArray(e))return e.map(t=>rr(t));if(Lo(e)){const t={};for(const n of Object.keys(e))t[n]=rr(e[n]);return t}return e}function pf(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Lo(e)?Object.keys(e):[]}function Ig(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ig(e[n],t[n]))return!1;return!0}if(Lo(e)||Lo(t)){if(!Lo(e)||!Lo(t))return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const o of n)if(!sv.call(t,o)||!Ig(e[o],t[o]))return!1;return!0}return Object.is(e,t)}function bC(e,t){if(Array.isArray(e))return e[Number(t)];if(Lo(e))return e[t]}function T8(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=rr(t[n]);return e}if(Lo(e)&&Lo(t)){for(const n of Object.keys(e))sv.call(t,n)||delete e[n];for(const n of Object.keys(t))e[n]=rr(t[n]);return e}return rr(t)}function M8(e,t,n){const s=n.ownedKeys??[],o=e[t];if(Lo(o)||Array.isArray(o)){const i=new Set(pf(n.value));for(const r of s)n.existed&&i.has(r)?o[r]=rr(bC(n.value,r)):delete o[r];!n.existed&&pf(o).length===0&&delete e[t];return}n.existed?e[t]=rr(n.value):delete e[t]}function ov(e){const t=e[nv];return Kk(t)?{reason:t,snapshot:{}}:t&&typeof t=="object"&&Kk(t.reason)&&t.snapshot&&typeof t.snapshot=="object"?t:null}function A8(e,t){Object.defineProperty(e,nv,{value:t,enumerable:!1,configurable:!0,writable:!0})}function es(e){return e?S8.test(e)?"footnote-definition":C8.test(e)?"abbreviation-definition":x8.test(e)?"reference-definition":null:null}function lu(e){return ov(e)?.reason??null}function ta(e,t,n){if(lu(e)&&Ii(e),!t)return n();iv(e,t);try{const s=n();return rv(e),s}catch(s){throw Ii(e),s}}function iv(e,t){try{Ii(e);const n={};for(const s of tv)n[s]=sv.call(e,s)?{existed:!0,value:rr(e[s])}:{existed:!1};A8(e,{reason:t,snapshot:n})}catch{}}function rv(e){const t=ov(e);if(t)for(const n of tv){const s=t.snapshot[n];if(!s)continue;s.ownedKeys=[];const o=e[n];if(!Lo(o)&&!Array.isArray(o))continue;const i=new Set(pf(s.existed?s.value:void 0));s.ownedKeys=pf(o).filter(r=>i.has(r)?!Ig(o[r],bC(s.value,r)):!0)}}function Ii(e){const t=ov(e);if(t){for(const n of tv){const s=t.snapshot[n];if(!s){delete e[n];continue}if(s.ownedKeys){M8(e,n,s);continue}s.existed?e[n]=T8(e[n],s.value):delete e[n]}delete e[nv]}}const $g=Symbol.for("markdown-it-ts.diagnostics");function mh(e,t){if(e)try{const n=e[$g];if(n&&typeof n=="object")return n;if(!t)return;const s={};return Object.defineProperty(e,$g,{value:s,enumerable:!1,configurable:!0,writable:!0}),s}catch{return}}function mi(e){return mh(e,!1)}function E8(e){if(e)try{delete e[$g]}catch{}}function zs(e){E8(e)}function Wn(e,t){const n=mh(e,!0);n&&(n.strategy=t)}function lm(e,t){const n=mh(e,!0);n&&(n.chunk=t)}function _C(e,t){const n=mh(e,!0);n&&(n.unbounded=t)}function I8(e){const t={};e=e||{},t.src_Any=pC.source,t.src_Cc=mC.source,t.src_Z=vC.source,t.src_P=gC.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Ng(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function gh(e){return Object.prototype.toString.call(e)}function $8(e){return gh(e)==="[object String]"}function N8(e){return gh(e)==="[object Object]"}function L8(e){return gh(e)==="[object RegExp]"}function Gk(e){return gh(e)==="[object Function]"}function O8(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const wC={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function R8(e){return Object.keys(e||{}).reduce(function(t,n){return t||wC.hasOwnProperty(n)},!1)}const P8={"http:":{validate:function(e,t,n){const s=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(s)?s.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const s=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(s)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:s.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const s=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(s)?s.match(n.re.mailto)[0].length:0}}},D8="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",B8="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function F8(e){e.__index__=-1,e.__text_cache__=""}function H8(e){return function(t,n){const s=t.slice(n);return e.test(s)?s.match(e)[0].length:0}}function Yk(){return function(e,t){t.normalize(e)}}function mf(e){const t=e.re=I8(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(D8),n.push(t.src_xn),t.src_tlds=n.join("|");function s(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");const o=[];e.__compiled__={};function i(l,a){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+a)}Object.keys(e.__schemas__).forEach(function(l){const a=e.__schemas__[l];if(a===null)return;const c={validate:null,link:null};if(e.__compiled__[l]=c,N8(a)){L8(a.validate)?c.validate=H8(a.validate):Gk(a.validate)?c.validate=a.validate:i(l,a),Gk(a.normalize)?c.normalize=a.normalize:a.normalize?i(l,a):c.normalize=Yk();return}if($8(a)){o.push(l);return}i(l,a)}),o.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:Yk()};const r=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(O8).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),F8(e)}function W8(e,t){const n=e.__index__,s=e.__last_index__,o=e.__text_cache__.slice(n,s);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=s+t,this.raw=o,this.text=o,this.url=o}function Lg(e,t){const n=new W8(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function no(e,t){if(!(this instanceof no))return new no(e,t);t||R8(e)&&(t=e,e={}),this.__opts__=Ng({},wC,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Ng({},P8,e),this.__compiled__={},this.__tlds__=B8,this.__tlds_replaced__=!1,this.re={},mf(this)}no.prototype.add=function(t,n){return this.__schemas__[t]=n,mf(this),this};no.prototype.set=function(t){return this.__opts__=Ng(this.__opts__,t),this};no.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,s,o,i,r,l,a,c,u;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],a.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(s=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(r=s.index+s[1].length,(this.__index__<0||r<this.__index__)&&(this.__schema__="",this.__index__=r,this.__last_index__=s.index+s[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(r=o.index+o[1].length,l=o.index+o[0].length,(this.__index__<0||r<this.__index__||r===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=l))),this.__index__>=0};no.prototype.pretest=function(t){return this.re.pretest.test(t)};no.prototype.testSchemaAt=function(t,n,s){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,s,this):0};no.prototype.match=function(t){const n=[];let s=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Lg(this,s)),s=this.__last_index__);let o=s?t.slice(s):t;for(;this.test(o);)n.push(Lg(this,s)),o=o.slice(this.__last_index__),s+=this.__last_index__;return n.length?n:null};no.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const s=this.testSchemaAt(t,n[2],n[0].length);return s?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s,Lg(this,0)):null};no.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(s,o,i){return s!==i[o-1]}).reverse(),mf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,mf(this),this)};no.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};no.prototype.onCompile=function(){};var SC=no,U8=aC({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,p=/[^\0-\x7F]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=35,w=Math.floor,_=String.fromCharCode;function b(P){throw new RangeError(f[P])}function g(P,q){const K=[];let G=P.length;for(;G--;)K[G]=q(P[G]);return K}function y(P,q){const K=P.split("@");let G="";K.length>1&&(G=K[0]+"@",P=K[1]),P=P.replace(m,".");const oe=g(P.split("."),q).join(".");return G+oe}function k(P){const q=[];let K=0;const G=P.length;for(;K<G;){const oe=P.charCodeAt(K++);if(oe>=55296&&oe<=56319&&K<G){const J=P.charCodeAt(K++);(J&64512)==56320?q.push(((oe&1023)<<10)+(J&1023)+65536):(q.push(oe),K--)}else q.push(oe)}return q}const $=P=>String.fromCodePoint(...P),E=function(P){return P>=48&&P<58?26+(P-48):P>=65&&P<91?P-65:P>=97&&P<123?P-97:36},S=function(P,q){return P+22+75*(P<26)-((q!=0)<<5)},T=function(P,q,K){let G=0;for(P=K?w(P/700):P>>1,P+=w(P/q);P>v*26>>1;G+=36)P=w(P/v);return w(G+(v+1)*P/(P+38))},I=function(P){const q=[],K=P.length;let G=0,oe=128,J=72,he=P.lastIndexOf("-");he<0&&(he=0);for(let Ne=0;Ne<he;++Ne)P.charCodeAt(Ne)>=128&&b("not-basic"),q.push(P.charCodeAt(Ne));for(let Ne=he>0?he+1:0;Ne<K;){const Fe=G;for(let $e=1,me=36;;me+=36){Ne>=K&&b("invalid-input");const ke=E(P.charCodeAt(Ne++));ke>=36&&b("invalid-input"),ke>w((2147483647-G)/$e)&&b("overflow"),G+=ke*$e;const _e=me<=J?1:me>=J+26?26:me-J;if(ke<_e)break;const ue=36-_e;$e>w(2147483647/ue)&&b("overflow"),$e*=ue}const We=q.length+1;J=T(G-Fe,We,Fe==0),w(G/We)>2147483647-oe&&b("overflow"),oe+=w(G/We),G%=We,q.splice(G++,0,oe)}return String.fromCodePoint(...q)},L=function(P){const q=[];P=k(P);const K=P.length;let G=128,oe=0,J=72;for(const Fe of P)Fe<128&&q.push(_(Fe));const he=q.length;let Ne=he;for(he&&q.push("-");Ne<K;){let Fe=2147483647;for(const $e of P)$e>=G&&$e<Fe&&(Fe=$e);const We=Ne+1;Fe-G>w((2147483647-oe)/We)&&b("overflow"),oe+=(Fe-G)*We,G=Fe;for(const $e of P)if($e<G&&++oe>2147483647&&b("overflow"),$e===G){let me=oe;for(let ke=36;;ke+=36){const _e=ke<=J?1:ke>=J+26?26:ke-J;if(me<_e)break;const ue=me-_e,z=36-_e;q.push(_(S(_e+ue%z,0))),me=w(ue/z)}q.push(_(S(me,0))),J=T(oe,We,Ne===he),oe=0,++Ne}++oe,++G}return q.join("")},F={version:"2.3.1",ucs2:{decode:k,encode:$},decode:I,encode:L,toASCII:function(P){return y(P,function(q){return p.test(q)?"xn--"+L(q):q})},toUnicode:function(P){return y(P,function(q){return d.test(q)?I(q.slice(4).toLowerCase()):q})}};t.exports=F})}),CC=uC(U8()),jn=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){const n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s}attrGet(e){const t=this.attrIndex(e);let n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}};function lv(e,t,n){let s,o=t;const i={ok:!1,pos:0,str:""};if(e.charCodeAt(o)===60){for(o++;o<n;){if(s=e.charCodeAt(o),s===10||s===60)return i;if(s===62)return i.pos=o+1,i.str=Vc(e.slice(t+1,o)),i.ok=!0,i;if(s===92&&o+1<n){o+=2;continue}o++}return i}let r=0;for(;o<n&&(s=e.charCodeAt(o),!(s===32||s<32||s===127));){if(s===92&&o+1<n){if(e.charCodeAt(o+1)===32)break;o+=2;continue}if(s===40&&(r++,r>32))return i;if(s===41){if(r===0)break;r--}o++}return t===o||r!==0||(i.str=Vc(e.slice(t,o)),i.pos=o,i.ok=!0),i}var xC=lv;const Cd=-2;function q8(e,t,n){let s=t+1;for(;s<n;){const o=e.charCodeAt(s);if(o===93)return s;if(o===92){s+=2;continue}if(o===96||o===60||o===33&&s+1<n&&e.charCodeAt(s+1)===91||o===91)return Cd;s++}return-1}function av(e,t,n){let s=1,o=!1,i,r;const l=e.src,a=e.posMax,c=e.pos,u=e.__mdtsLinkLabelNoCloseFrom;if(typeof u=="number"&&t+1>=u)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.__mdtsLinkLabelNoCloseFrom=t+1,-1;const p=q8(l,t,a);if(p!==Cd)return p;for(e.pos=t+1;e.pos<a;){if(i=l.charCodeAt(e.pos),i===93&&(s--,s===0)){o=!0;break}if(r=e.pos,e.md.inline.skipToken(e),i===91){if(r===e.pos-1)s++;else if(n)return e.pos=c,-1}}let m=-1;return o&&(m=e.pos),e.pos=c,m}var gf=av;function cv(e,t,n,s){let o,i=t;const r={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(s)r.str=s.str,r.marker=s.marker;else{if(i>=n)return r;let l=e.charCodeAt(i);if(l!==34&&l!==39&&l!==40)return r;t++,i++,l===40&&(l=41),r.marker=l}for(;i<n;){if(o=e.charCodeAt(i),o===r.marker)return r.pos=i+1,r.str+=Vc(e.slice(t,i)),r.ok=!0,r;if(o===40&&r.marker===41)return r;o===92&&i+1<n&&i++,i++}return r.can_continue=!0,r.str+=Vc(e.slice(t,i)),r}var TC=cv;function vh(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function uv(e,t){e.attrs||(e.attrs=[]),e.attrs.push(t)}function j8(e,t,n){const s=vh(e,t),o=[t,n];s<0?uv(e,o):e.attrs[s]=o}function z8(e,t){const n=vh(e,t);return n>=0?e.attrs[n][1]:null}function V8(e,t,n){const s=vh(e,t);s<0?uv(e,[t,n]):e.attrs[s][1]=`${e.attrs[s][1]} ${n}`}var K8=yC({attrGet:()=>z8,attrIndex:()=>vh,attrJoin:()=>V8,attrPush:()=>uv,attrSet:()=>j8,parseLinkDestination:()=>lv,parseLinkLabel:()=>av,parseLinkTitle:()=>cv});function G8(e){return e.includes("\r")||e.includes("\0")}function MC(e){return typeof e=="string"?e:e.toString()}function Y8(e){if(e.inlineMode){const t=new jn("inline","",0);t.content=MC(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const X8=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Z8=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Q8(e,t){let n=e.pos;const s=e.src;if(s.charCodeAt(n)!==60)return!1;const o=n,i=e.posMax;for(;;){if(++n>=i)return!1;const l=s.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=s.slice(o+1,n);if(Z8.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}if(X8.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=r.length+2,!0}return!1}var J8=Q8;function eL(e,t){const n=e.src;let s=e.pos;if(n.charCodeAt(s)!==96)return!1;const o=s;s++;const i=e.posMax;for(;s<i&&n.charCodeAt(s)===96;)s++;const r=n.slice(o,s),l=r.length;if(e.backticksScanned&&(e.backticks[l]||0)<=o)return t||(e.pending+=r),e.pos+=l,!0;let a=s,c;for(;(c=n.indexOf("`",a))!==-1;){for(a=c+1;a<i&&n.charCodeAt(a)===96;)a++;const u=a-c;if(u===l){if(!t){const d=e.push("code_inline","code",0);d.markup=r;let p=n.slice(s,c);p.includes(`
48
+ `)&&(p=p.replace(/\n/g," ")),p.length>2&&p.charCodeAt(0)===32&&p.charCodeAt(p.length-1)===32&&(p=p.slice(1,-1)),d.content=p}return e.pos=a,!0}e.backticks[u]=c}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var tL=eL;function Xk(e){const t={},n=e.length;if(!n)return;let s=0,o=-2;const i=[];for(let r=0;r<n;r++){const l=e[r];if(i.push(0),(e[s].marker!==l.marker||o!==l.token-1)&&(s=r),o=l.token,l.length=l.length||0,!l.close)continue;Object.prototype.hasOwnProperty.call(t,l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[l.marker][(l.open?3:0)+l.length%3];let c=s-i[s]-1,u=c;for(;c>a;c-=i[c]+1){const d=e[c];if(d.marker===l.marker&&d.open&&d.end<0){let p=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(p=!0),!p){const m=c>0&&!e[c-1].open?i[c-1]+1:0;i[r]=r-c+m,i[c]=m,l.open=!1,d.end=r,d.close=!1,u=-1,o=-2;break}}}u!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=u)}}function nL(e){const t=e.tokens_meta,n=e.tokens_meta.length;Xk(e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Xk(t[s].delimiters)}var sL=nL;function oL(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==95&&s!==42)return!1;const o=e.scanDelims(e.pos,s===42);if(!o||o.length===0)return!1;for(let i=0;i<o.length;i++){const r=e.push("text","",0);r.content=String.fromCharCode(s),e.delimiters.push({marker:s,length:o.length,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return e.pos+=o.length,!0}function Zk(e,t){const n=t.length;for(let s=n-1;s>=0;s--){const o=t[s];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const i=t[o.end],r=s>0&&t[s-1].end===o.end+1&&t[s-1].marker===o.marker&&t[s-1].token===o.token-1&&t[o.end+1].token===i.token+1,l=String.fromCharCode(o.marker),a=e.tokens[o.token];a.type=r?"strong_open":"em_open",a.tag=r?"strong":"em",a.nesting=1,a.markup=r?l+l:l,a.content="";const c=e.tokens[i.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?l+l:l,c.content="",r&&(e.tokens[t[s-1].token].content="",e.tokens[t[o.end+1].token].content="",s--)}}function iL(e){const t=e.tokens_meta,n=e.tokens_meta.length;Zk(e,e.delimiters);for(let s=0;s<n;s++)t[s]&&t[s].delimiters&&Zk(e,t[s].delimiters)}const Qk={tokenize:oL,postProcess:iL};function AC(e){return Q1(e)}function dv(e){return e>=48&&e<=57}function rL(e){const t=e|32;return dv(e)||t>=97&&t<=102}function EC(e){const t=e|32;return t>=97&&t<=122}function lL(e){return EC(e)||dv(e)}function aL(e,t,n){let s=t+2;if(s>=n)return null;let o=!1,i=7,r=s;for((e.charCodeAt(s)|32)===120&&(o=!0,i=6,s++,r=s);s<n&&s-r<i;){const l=e.charCodeAt(s);if(!(o?rL(l):dv(l)))break;s++}return s===r||s>=n||e.charCodeAt(s)!==59?null:e.slice(t,s+1)}function cL(e,t,n){let s=t+1;if(s>=n||!EC(e.charCodeAt(s)))return null;for(s++;s<n&&s-t-1<32&&lL(e.charCodeAt(s));)s++;if(s-t-1<2||s>=n||e.charCodeAt(s)!==59)return null;const o=e.slice(t,s+1);return AC(o)!==o?o:null}function uL(e,t){const n=e.pos,s=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=s)return!1;if(e.src.charCodeAt(n+1)===35){const o=aL(e.src,n,s);if(o){if(!t){const i=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=ph(i)?zc(i):zc(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=cL(e.src,n,s);if(o){const i=AC(o);if(!t){const r=e.push("text_special","",0);r.content=i,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var dL=uL;const IC=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),Og=new Array(128),$C=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);Og[e]=`\\${t}`,$C[e]=IC[e]?t:Og[e]}function Jk(e,t,n){e.pending&&e.pushPending();const s=new jn("text_special","",0);s.level=e.level,s.content=t,s.markup=n,s.info="escape",e.pendingLevel=e.level,e.tokens.push(s),e.tokens_meta.push(null)}function fL(e,t){let n=e.pos;const s=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=s))return!1;let i=o.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<s&&(i=o.charCodeAt(n),!(i!==9&&i!==32));)n++;return e.pos=n,!0}if(i<128)return t?(e.pos=n+1,!0):(Jk(e,$C[i],Og[i]),e.pos=n+1,!0);if(t){if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(i>=55296&&i<=56319&&n+1<s){const a=o.charCodeAt(n+1);a>=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return Jk(e,i<256&&IC[i]?r:l,l),e.pos=n+1,!0}var hL=fL;function pL(e){let t,n,s=0;const o=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++){const r=o[t];r&&(r.nesting&&r.nesting<0&&s--,r.level=s,r.nesting&&r.nesting>0&&s++,r.type==="text"&&t+1<i&&o[t+1]?.type==="text"?o[t+1].content=r.content+o[t+1].content:(t!==n&&(o[n]=r),n++))}t!==n&&(o.length=n)}var mL=pL;const NC=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,LC="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",gL=new RegExp(`^(?:${NC}|${LC}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),vL=new RegExp(`^(?:${NC}|${LC})`);function OC(e){return e===32||e===9||e===10||e===12||e===13}function yL(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||OC(t)}function kL(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t<e.length;t++){const n=e.charCodeAt(t);if(n===62)return!0;if(!OC(n))return!1}return!1}function bL(e){const t=e|32;return t>=97&&t<=122}function _L(e,t){if(!e.md.options.html)return!1;const n=e.posMax,s=e.pos,o=e.src;if(o.charCodeAt(s)!==60||s+2>=n)return!1;const i=o.charCodeAt(s+1);if(i!==33&&i!==63&&i!==47&&!bL(i))return!1;const r=o.slice(s).match(gL);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,yL(l)&&e.linkLevel++,kL(l)&&e.linkLevel--}return e.pos+=l.length,!0}var wL=_L;function SL(e,t){let n,s,o,i,r,l,a,c,u="";const d=e.pos,p=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,f=gf(e,e.pos+1,!1);if(f<0)return!1;if(i=f+1,i<p&&e.src.charCodeAt(i)===40){for(i++;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(i>=p)return!1;if(l=xC(e.src,i,e.posMax),l.ok){for(u=e.md.normalizeLink(l.str),e.md.validateLink(u)?i=l.pos:u="",c=i;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);if(l=TC(e.src,i,e.posMax),i<p&&c!==i&&l.ok)for(a=l.str,i=l.pos;i<p&&(n=e.src.charCodeAt(i),!(n!==32&&n!==10));i++);else a=""}if(i>=p||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<p&&e.src.charCodeAt(i)===91?(c=i+1,i=gf(e,i),i>=0?o=e.src.slice(c,i++):i=f+1):i=f+1,o||(o=e.src.slice(m,f)),r=e.env.references[hh(o)],!r)return e.pos=d,!1;u=r.href,a=r.title}if(!t){s=e.src.slice(m,f);const v=[];e.md.inline.parse(s,e.md,e.env,v);const w=e.push("image","img",0);w.attrs=[["src",u],["alt",""]],w.children=v,w.content=s,a&&w.attrs.push(["title",a])}return e.pos=i,e.posMax=p,!0}var CL=SL;function xL(e,t){let n,s,o,i,r="",l="",a=e.pos,c=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,d=e.posMax,p=e.pos+1,m=gf(e,e.pos,!0);if(m<0)return!1;let f=m+1;if(f<d&&e.src.charCodeAt(f)===40){for(c=!1,f++;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(f>=d)return!1;if(o=xC(e.src,f,e.posMax),o.ok){for(r=e.md.normalizeLink(o.str),e.md.validateLink(r)?f=o.pos:r="",a=f;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);if(o=TC(e.src,f,e.posMax),f<d&&a!==f&&o.ok)for(l=o.str,f=o.pos;f<d&&(n=e.src.charCodeAt(f),!(n!==32&&n!==10));f++);}(f>=d||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references>"u")return!1;if(f<d&&e.src.charCodeAt(f)===91?(a=f+1,f=gf(e,f),f>=0?s=e.src.slice(a,f++):f=m+1):f=m+1,s||(s=e.src.slice(p,m)),i=e.env.references[hh(s)],!i)return e.pos=u,!1;r=i.href,l=i.title}if(!t){e.pos=p,e.posMax=m;const v=e.push("link_open","a",1),w=[["href",r]];v.attrs=w,l&&w.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=d,!0}var TL=xL;function RC(e){const t=e|32;return t>=97&&t<=122}function ML(e){return e>=48&&e<=57}function AL(e){return RC(e)||ML(e)||e===43||e===45||e===46}function EL(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&AL(e.charCodeAt(t));)t--;return t++,t>=e.length||!RC(e.charCodeAt(t))?null:e.slice(t)}function IL(e,t,n){let s=t;for(;s<n;){const o=e.charCodeAt(s);if(o<=32||o===127||o===60)break;s++}return e.slice(t,s)}function $L(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,s=e.posMax;if(n+3>s||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=EL(e.pending);if(!o)return!1;const i=IL(e.src,n-o.length,s),r=e.md.linkify.matchAtStart(i);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const u=e.push("link_open","a",1);u.attrs=[["href",c]],u.markup="linkify",u.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-o.length,!0}function NL(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const s=e.pending.length-1,o=e.posMax;if(!t)if(s>=0&&e.pending.charCodeAt(s)===32)if(s>=1&&e.pending.charCodeAt(s-1)===32){let i=s-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n<o;){const i=e.src.charCodeAt(n);if(i!==9&&i!==32)break;n++}return e.pos=n,!0}var LL=NL;function OL(e,t){const n=e.pos,s=e.src.charCodeAt(n);if(t||s!==126)return!1;const o=e.scanDelims(e.pos,!0);if(!o)return!1;let i=o.length;const r=String.fromCharCode(s);if(i<2)return!1;let l;i%2&&(l=e.push("text","",0),l.content=r,i--);for(let a=0;a<i;a+=2)l=e.push("text","",0),l.content=r+r,e.delimiters.push({marker:s,length:0,token:e.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return e.pos+=o.length,!0}function eb(e,t){let n;const s=[],o=t.length;for(let i=0;i<o;i++){const r=t[i];if(r.marker!==126||r.end===-1)continue;const l=t[r.end];n=e.tokens[r.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&s.push(l.token-1)}for(;s.length;){const i=s.pop();let r=i+1;for(;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,i!==r&&(n=e.tokens[r],e.tokens[r]=e.tokens[i],e.tokens[i]=n)}}function RL(e){const t=e.delimiters;eb(e,t);const n=e.tokens_meta;if(n)for(let s=0;s<n.length;s++)n[s]&&n[s].delimiters&&eb(e,n[s].delimiters)}const tb={tokenize:OL,postProcess:RL};function nb(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function PL(e,t){const n=e.src,s=e.pos,o=e.posMax;if(s>=o||nb(n.charCodeAt(s)))return!1;let i=s+1;for(;i<o&&!nb(n.charCodeAt(i));)i++;return t||(e.pending+=i===s+1?n.charAt(s):n.slice(s,i)),e.pos=i,!0}var DL=PL;function fv(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function BL(e){if(e.length===0)return 0;const t=e.slice().sort((s,o)=>s-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function FL(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function PC(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,s={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:fv(),records:Object.create(null)};return t.__mdtsRuleProfile=s,s}function na(e,t,n,s,o,i){const r=PC(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=FL(t,n));a.calls++,a.inclusiveMs+=s,s>a.maxMs&&(a.maxMs=s),a.samples.push(s),i?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=fv()}function HL(e){const t=PC(e);if(!t)return null;const n=Object.keys(t.records);for(let s=0;s<n.length;s++){const o=t.records[n[s]];o.medianMs=BL(o.samples)}return t.completedAt=fv(),t}var sb=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){const s=this.rules.findIndex(o=>o.name===e);s>=0&&this.rules.splice(s,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const s=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(s<0)return;const o=this.rules[s];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(s<0)throw new Error(`Parser rule not found: ${e}`);this.rules[s].fn=t,n?.alt!==void 0&&(this.rules[s].alt=n.alt),this.invalidateCache()}before(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,s){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this.rules.findIndex(r=>r.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:s?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const s of this.rules)if(s.enabled&&s.alt)for(const o of s.alt)e.add(o);const t=new Map,n=new Map;for(const s of e){const o=[],i=[];for(const r of this.rules)r.enabled&&(s!==""&&!r.alt?.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t.set(s,o),n.set(s,i)}this.cache=t,this.namedCache=n}},DC=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;maxNesting;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s,this.tokens_meta=new Array(s.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.maxNesting=t.options.maxNesting}pushPending(){const e=new jn("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new jn(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const s=new jn(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s}scanDelims(e,t){const{src:n,posMax:s}=this,o=n.charCodeAt(e);let i=e;for(;i<s&&n.charCodeAt(i)===o;)i++;const r=i-e,l=e>0?n.charCodeAt(e-1):32,a=i<s?n.charCodeAt(i):32,c=jc(l),u=jc(a),d=Eg(l),p=Eg(a),m=!u&&(!p||c||d),f=!c&&(!d||u||p);return{can_open:m&&(t||!f||d),can_close:f&&(t||!m||p),length:r}}};DC.prototype.Token=jn;function WL(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function BC(e){for(let t=0;t<e.length;t++)if(WL(e.charCodeAt(t)))return!1;return!0}var UL=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new sb,this.ruler2=new sb,this.ruler.push("text",DL),this.ruler.push("linkify",$L),this.ruler.push("newline",LL),this.ruler.push("escape",hL),this.ruler.push("backticks",tL),this.ruler.push("strikethrough",tb.tokenize),this.ruler.push("emphasis",Qk.tokenize),this.ruler.push("link",TL),this.ruler.push("image",CL),this.ruler.push("autolink",J8),this.ruler.push("html_inline",wL),this.ruler.push("entity",dL),this.ruler2.push("balance_pairs",sL),this.ruler2.push("strikethrough",tb.postProcess),this.ruler2.push("emphasis",Qk.postProcess),this.ruler2.push("fragments_join",mL),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),s=n.length,o=e.cache,i=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(i!==void 0){e.pos=i;return}let l=!1;if(e.level<e.maxNesting){if(r){const a=this.ruler.getNamedRules("");for(let c=0;c<s;c++){e.level++;const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l=a[c].fn(e,!0);const d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(na(e.env,"inline",a[c].name,d-u,!!l,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else for(let a=0;a<s;a++)if(e.level++,l=n[a](e,!0),e.level--,l){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,s=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting){for(let l=0;l<n;l++)if(r=t[l](e,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos<s;){const i=e.pos;let r=!1;if(e.level<e.maxNesting)for(let l=0;l<n;l++){const a=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();r=o[l].fn(e,!1);const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(na(e.env,"inline",o[l].name,c-a,!!r,!1),r){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=s)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,s){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&BC(e)){const a=new jn("text","",0);a.content=e,s.push(a);return}const o=new DC(e,t,n,s);this.tokenize(o);const i=this.getRules2(),r=i.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a<r;a++)i[a](o,!1);return}const l=this.ruler2.getNamedRules("");for(let a=0;a<r;a++){const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();l[a].fn(o,!1);const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();na(o.env,"inline2",l[a].name,u-c,!0,!1)}}parse(e,t,n,s){this.parseSource(e,t,n,s)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(""),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function qL(e){const t=e.tokens,n=!!e.md?.inline?.isDefaultRuleset?.();for(let s=0,o=t.length;s<o;s++){const i=t[s];if(i.type==="inline"&&e.md){if(i.children||(i.children=[]),n&&i.content.length>0&&BC(i.content)){const r=new jn("text","",0);r.content=i.content,i.children.push(r);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}const jL=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,zL=/[0-9a-z]/i;function VL(e){return/^<a[>\s]/i.test(e)}function KL(e){return/^<\/a\s*>/i.test(e)}function GL(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){const s=t.raw[n-1],o=t.raw[n];if(!jL.test(s)||!zL.test(o))continue;const i=t.raw.slice(n),r=e.match(i)?.[0];if(!(!r||r.index!==0||r.lastIndex!==i.length))return{...r,index:t.index+n,lastIndex:t.index+n+r.lastIndex}}return t}function YL(e){const t=e.tokens;if(e.md?.options?.linkify)for(let n=0;n<t.length;n++){const s=t[n];if(s.type!=="inline"||!e.md.linkify.pretest(s.content))continue;let o=s.children;o||(o=[],s.children=o);let i=0;for(let r=o.length-1;r>=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(VL(l.content)&&i>0&&i--,KL(l.content)&&i++),i>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let c=(e.md.linkify.match(a)||[]).map(m=>GL(e.md.linkify,m));if(c.length===0)continue;const u=[];let d=l.level,p=0;c.length>0&&c[0].index===0&&r>0&&o[r-1].type==="text_special"&&(c=c.slice(1));for(let m=0;m<c.length;m++){const f=c[m],v=e.md.normalizeLink(f.url);if(!e.md.validateLink(v))continue;let w=f.text;f.schema?f.schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText(`mailto:${w}`).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText(`http://${w}`).replace(/^http:\/\//,"");const _=f.index;if(_>p){const k=new jn("text","",0);k.content=a.slice(p,_),k.level=d,u.push(k)}const b=new jn("link_open","a",1);b.attrs=[["href",v]],b.level=d++,b.markup="linkify",b.info="auto",u.push(b);const g=new jn("text","",0);g.content=w,g.level=d,u.push(g);const y=new jn("link_close","a",-1);y.level=--d,y.markup="linkify",y.info="auto",u.push(y),p=f.lastIndex}if(p!==0){if(p<a.length){const m=new jn("text","",0);m.content=a.slice(p),m.level=d,u.push(m)}o.splice(r,1,...u)}}}}const XL=/\r\n?|\n/g,ZL=/\0/g;function QL(e){if(!e||typeof e.src!="string")return;const t=e.src,n=t.includes("\r"),s=t.includes("\0");if(!n&&!s)return;let o=t;n&&(o=o.replace(XL,`
49
+ `)),s&&(o=o.replace(ZL,"�")),e.src=o}const FC=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,JL=/\((?:c|tm|r)\)/i,eO=/\((c|tm|r)\)/gi,tO={c:"©",r:"®",tm:"™"};function nO(e,t){return tO[t.toLowerCase()]}function sO(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&(s.content=s.content.replace(eO,nO)),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function oO(e){let t=0;for(let n=e.length-1;n>=0;n--){const s=e[n];s.type==="text"&&!t&&FC.test(s.content)&&(s.content=s.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),s.type==="link_open"&&s.info==="auto"&&t--,s.type==="link_close"&&s.info==="auto"&&t++}}function iO(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");JL.test(s)&&sO(n.children||[]),FC.test(s)&&oO(n.children||[])}}var rO=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(s=>s.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(s=>s.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const s=this.rules.findIndex(i=>i.name===e);if(s<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(i=>i.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(s+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;for(const i of n){const r=this.rules.findIndex(l=>l.name===i);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${i}`);continue}s.push(i),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this.rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const lO=/['"]/,ob=/['"]/g,ib="’";function td(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function aO(e,t){let n;const s=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let i=0;i<e.length;i++){const r=e[i],l=e[i].level;for(n=s.length-1;n>=0&&!(s[n].level<=l);n--);if(s.length=n+1,r.type!=="text")continue;let a=r.content,c=0,u=a.length;e:for(;c<u;){ob.lastIndex=c;const d=ob.exec(a);if(!d)break;let p=!0,m=!0;c=d.index+1;const f=d[0]==="'";let v=32;if(d.index-1>=0)v=a.charCodeAt(d.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){v=e[n].content.charCodeAt(e[n].content.length-1);break}let w=32;if(c<u)w=a.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){w=e[n].content.charCodeAt(0);break}const _=hf(v)||ff(String.fromCharCode(v)),b=hf(w)||ff(String.fromCharCode(w)),g=jc(v),y=jc(w);if(y?p=!1:b&&(g||_||(p=!1)),g?m=!1:_&&(y||b||(m=!1)),w===34&&d[0]==='"'&&v>=48&&v<=57&&(m=p=!1),p&&m&&(p=_,m=b),!p&&!m){f&&(r.content=td(r.content,d.index,ib));continue}if(m)for(n=s.length-1;n>=0;n--){let k=s[n];if(s[n].level<l)break;if(k.single===f&&s[n].level===l){k=s[n];let $,E;f?($=o[2]||"‘",E=o[3]||"’"):($=o[0]||"“",E=o[1]||"”"),r.content=td(r.content,d.index,E),e[k.token].content=td(e[k.token].content,k.pos,$),c+=E.length-1,k.token===i&&(c+=$.length-1),a=r.content,u=a.length,s.length=n;continue e}}p?s.push({token:i,pos:d.index,single:f,level:l}):m&&f&&(r.content=td(r.content,d.index,ib))}}}function cO(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const s=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!lO.test(s)||!n.children||aO(n.children,e)}}function uO(e){const t=e.tokens||[],n=t.length;for(let s=0;s<n;s++){const o=t[s];if(o.type!=="inline"||!Array.isArray(o.children))continue;const i=o.children,r=i.length;for(let c=0;c<r;c++)i[c].type==="text_special"&&(i[c].type="text");let l=0,a=0;for(;a<r;a++)i[a].type==="text"&&a+1<r&&i[a+1].type==="text"?i[a+1].content=i[a].content+i[a+1].content:(a!==l&&(i[l]=i[a]),l++);a!==l&&(i.length=l)}}const dO=/^(?:vbscript|javascript|file|data):/,fO=/^data:image\/(?:gif|png|jpeg|webp);/,HC=["http:","https:","mailto:"];function WC(e){const t=e.trim().toLowerCase();return dO.test(t)?fO.test(t):!0}function UC(e){const t=ev(e,!0);if(t.hostname&&(!t.protocol||HC.includes(t.protocol)))try{t.hostname=CC.default.toASCII(t.hostname)}catch{}return fC(J1(t))}function qC(e){const t=ev(e,!0);if(t.hostname&&(!t.protocol||HC.includes(t.protocol)))try{t.hostname=CC.default.toUnicode(t.hostname)}catch{}return Ag(J1(t),`${Ag.defaultChars}%`)}function hO(e){switch(e){case 9:case 32:return!0}return!1}function pO(e,t,n,s){const o=e.src,i=e.bMarks,r=e.eMarks,l=e.tShift,a=e.sCount,c=e.bsCount;let u=i[t]+l[t],d=r[t];const p=e.lineMax;if(a[t]-e.blkIndent>=4||o.charCodeAt(u)!==62)return!1;if(s)return!0;const m=[],f=[],v=[],w=[],_=e.md.block.ruler.getRulesForState(e,"blockquote"),b=e.parentType;e.parentType="blockquote";let g=!1,y;for(y=t;y<n;y++){const T=a[y]<e.blkIndent;if(u=i[y]+l[y],d=r[y],u>=d)break;if(o.charCodeAt(u++)===62&&!T){let L=a[y]+1,R,O;o.charCodeAt(u)===32?(u++,L++,O=!1,R=!0):o.charCodeAt(u)===9?(R=!0,(c[y]+L)%4===3?(u++,L++,O=!1):O=!0):R=!1;let F=L;for(m.push(i[y]),i[y]=u;u<d;){const P=o.charCodeAt(u);if(hO(P))P===9?F+=4-(F+c[y]+(O?1:0))%4:F++;else break;u++}g=u>=d,f.push(c[y]),c[y]=a[y]+1+(R?1:0),v.push(a[y]),a[y]=F-L,w.push(l[y]),l[y]=u-i[y];continue}if(g)break;let I=!1;for(let L=0,R=_.length;L<R;L++)if(_[L](e,y,n,!0)){I=!0;break}if(I){e.lineMax=y,e.blkIndent!==0&&(m.push(i[y]),f.push(c[y]),w.push(l[y]),v.push(a[y]),a[y]-=e.blkIndent);break}m.push(i[y]),f.push(c[y]),w.push(l[y]),v.push(a[y]),a[y]=-1}const k=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const E=[t,0];$.map=E,e.md.block.tokenize(e,t,y);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=p,e.parentType=b,E[1]=e.line;for(let T=0;T<w.length;T++)i[T+t]=m[T],l[T+t]=w[T],a[T+t]=v[T],c[T+t]=f[T];return e.blkIndent=k,!0}function mO(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let s=t+1,o=s;for(;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}e.line=o;const i=e.push("code_block","code",0);return i.content=`${e.getLines(t,o,4+e.blkIndent,!1)}
50
+ `,i.map=[t,e.line],!0}function gO(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>i)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const c=e.src.slice(l,o),u=e.src.slice(o,i);if(r===96&&u.includes(String.fromCharCode(r)))return!1;if(s)return!0;let d=t,p=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],o<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(o)===r&&!(e.sCount[d]-e.blkIndent>=4)&&(o=e.skipChars(o,r),!(o-l<a)&&(o=e.skipSpaces(o),!(o<i)))){p=!0;break}a=e.sCount[t],e.line=d+(p?1:0);const m=e.push("fence","code",0);return m.info=u,m.content=e.getLines(t+1,d,a,!0),m.markup=c,m.map=[t,e.line],!0}const rb=["","h1","h2","h3","h4","h5","h6"],lb=["","#","##","###","####","#####","######"];function ab(e){switch(e){case 9:case 32:return!0}return!1}function vO(e,t,n,s){const o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks;let a=i[t]+r[t],c=l[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=o.charCodeAt(a);if(u!==35||a>=c)return!1;let d=1;for(u=o.charCodeAt(++a);u===35&&a<c&&d<=6;)d++,u=o.charCodeAt(++a);if(d>6||a<c&&!ab(u))return!1;if(s)return!0;c=e.skipSpacesBack(c,a);const p=e.skipCharsBack(c,35,a);p>a&&ab(o.charCodeAt(p-1))&&(c=p),e.line=t+1;const m=e.push("heading_open",rb[d],1);m.markup=lb[d],m.map=[t,e.line];const f=e.push("inline","",0);f.content=o.slice(a,c).trim(),f.map=[t,e.line],f.children=[];const v=e.push("heading_close",rb[d],-1);return v.markup=lb[d],!0}function yO(e){switch(e){case 9:case 32:return!0}return!1}function kO(e,t,n,s){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;i<o;){const c=e.src.charCodeAt(i++);if(c!==r&&!yO(c))return!1;c===r&&l++}if(l<3)return!1;if(s)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=new Array(l+1).join(String.fromCharCode(r)),!0}const Il=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp(`^</?(${["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"].join("|")})(?=(\\s|/?>|$))`,"i"),/^$/,!0],[new RegExp(`${vL.source}\\s*$`),/^$/,!1]];function bO(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,i),l=0;for(;l<Il.length&&!Il[l][0].test(r);l++);if(l===Il.length)return!1;if(s)return Il[l][2];let a=t+1;if(!Il[l][1].test(r)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(o=e.bMarks[a]+e.tShift[a],i=e.eMarks[a],r=e.src.slice(o,i),Il[l][1].test(r)){r.length!==0&&a++;break}}e.line=a;const c=e.push("html_block","",0);return c.map=[t,a],c.content=e.getLines(t,a,e.blkIndent,!0),!0}function _O(e,t,n){for(let s=t;s<n;s++)if(e.charCodeAt(s)===124)return!0;return!1}function jC(e){const t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function zC(e,t,n){if(t>=n)return!1;const s=e.charCodeAt(t);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:_O(e,t,n)}const cb=["","h1","h2"];function wO(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,i=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,c=e.blkIndent,u=jC(e);if(a[t]-c>=4)return!1;const d=e.parentType;e.parentType="paragraph";let p=0,m,f=t+1;for(;f<n;f++){const y=i[f]+r[f],k=l[f];if(y>=k)break;if(a[f]-c>3)continue;if(a[f]>=c&&(m=o.charCodeAt(y),m===45||m===61)){let E=y+1,S=E;for(;E<k&&o.charCodeAt(E)===m;)E++;for(S=E;E<k;){const T=o.charCodeAt(E);if(T!==9&&T!==32)break;E++}if(E>=k){p=m===61?1:2;break}if(S-y>1)continue}if(a[f]<0||u&&!zC(o,y,k))continue;let $=!1;for(let E=0,S=s.length;E<S;E++)if(s[E](e,f,n,!0)){$=!0;break}if($)break}if(!p)return!1;let v;if(f===t+1){const y=i[t]+r[t];let k=l[t];for(;k>y;){const $=o.charCodeAt(k-1);if($!==9&&$!==32)break;k--}v=o.slice(y,k)}else v=e.getLines(t,f,c,!1).trim();e.line=f+1;const w=m===61?"=":"-",_=e.push("heading_open",cb[p],1);_.markup=w,_.map=[t,e.line];const b=e.push("inline","",0);b.content=v,b.map=[t,e.line-1],b.children=[];const g=e.push("heading_close",cb[p],-1);return g.markup=w,e.parentType=d,!0}function VC(e){switch(e){case 9:case 32:return!0}return!1}function ub(e,t){const n=e.eMarks,s=e.bMarks,o=e.tShift,i=e.src,r=n[t];let l=s[t]+o[t];const a=i.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l<r&&!VC(i.charCodeAt(l))?-1:l}function db(e,t){const n=e.bMarks,s=e.tShift,o=e.eMarks,i=e.src,r=n[t]+s[t],l=o[t];let a=r;if(a+1>=l)return-1;let c=i.charCodeAt(a++);if(c<48||c>57)return-1;for(;;){if(a>=l)return-1;if(c=i.charCodeAt(a++),c>=48&&c<=57){if(a-r>=10)return-1;continue}if(c===41||c===46)break;return-1}return a<l&&(c=i.charCodeAt(a),!VC(c))?-1:a}function SO(e,t,n){const s=e.bMarks,o=e.tShift,i=e.src,r=s[t]+o[t];let l=0;for(let a=r;a<n-1;a++)l=l*10+i.charCodeAt(a)-48;return l}const CO=["0","1","2","3","4","5","6","7","8","9"];function xO(e,t){const n=e.level+2,s=e.tokens;for(let o=t+2,i=s.length-2;o<i;o++){const r=s[o];if(r.level===n){if(r.type==="paragraph_open"){r.hidden=!0,s[o+2].hidden=!0,o+=2;continue}if(r.nesting===1){let l=1;for(;l>0&&++o<i;)l+=s[o].nesting}}}}function TO(e,t,n,s){let o,i,r=0,l=t,a=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;s&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let u,d,p;const m=e.src,f=e.bMarks,v=e.tShift,w=e.eMarks,_=e.sCount,b=e.bsCount,g=f[l]+v[l];if(g>=w[l])return!1;const y=m.charCodeAt(g);if(y>=48&&y<=57){if(p=db(e,l),p<0||(u=!0,r=g,d=SO(e,l,p),c&&d!==1))return!1}else if(y===42||y===45||y===43){if(p=ub(e,l),p<0)return!1;u=!1}else return!1;if(c&&e.skipSpaces(p)>=w[l])return!1;if(s)return!0;const k=m.charCodeAt(p-1),$=String.fromCharCode(k);if(u){const R=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(R.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=$;let S=!1;const T=e.tokens.length-1,I=e.md.block.ruler.getRulesForState(e,"list"),L=e.parentType;for(e.parentType="list";l<n;){i=p,o=w[l];const R=_[l]+p-(f[l]+v[l]);let O=R;for(;i<o;){const We=m.charCodeAt(i);if(We===9)O+=4-(O+b[l])%4;else if(We===32)O++;else break;i++}const F=i;let P;F>=o?P=1:P=O-R,P>4&&(P=1);const q=R+P,K=e.push("list_item_open","li",1);K.markup=$;const G=[l,0];K.map=G,u&&(K.info=p-r-1===1?CO[m.charCodeAt(r)-48]:m.slice(r,p-1));const oe=e.tight,J=e.tShift[l],he=e.sCount[l],Ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=q,e.tight=!0,e.tShift[l]=F-f[l],e.sCount[l]=O,F>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Ne,e.tShift[l]=J,e.sCount[l]=he,e.tight=oe,e.push("list_item_close","li",-1).markup=$,l=e.line,G[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let Fe=!1;for(let We=0,$e=I.length;We<$e;We++)if(I[We](e,l,n,!0)){Fe=!0;break}if(Fe)break;if(u){if(p=db(e,l),p<0)break;r=f[l]+v[l]}else if(p=ub(e,l),p<0)break;if(k!==m.charCodeAt(p-1))break}return u?e.push("ordered_list_close","ol",-1).markup=$:e.push("bullet_list_close","ul",-1).markup=$,E[1]=l,e.line=l,e.parentType=L,a&&xO(e,T),!0}function fb(e){return e===9||e===32}function MO(e,t,n){const s=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.parentType,i=e.src,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount,u=e.blkIndent,d=jC(e);let p=t+1;for(e.parentType="paragraph";p<n&&!e.isEmpty(p);p++){if(c[p]-u>3||c[p]<0)continue;if(o==="list"&&c[p]>=u){const g=r[p]+l[p],y=a[p];if(g<y){const k=i.charCodeAt(g);if(k===42||k===45||k===43){if(g+1>=y||fb(i.charCodeAt(g+1)))break}else if(k>=48&&k<=57&&g+1<y){let $=g+1;for(;;){if($>=y){$=-1;break}const E=i.charCodeAt($++);if(E>=48&&E<=57){if($-g>=10){$=-1;break}continue}if((E===41||E===46)&&($>=y||fb(i.charCodeAt($))))break;$=-1;break}if($>=0)break}}}const w=r[p]+l[p],_=a[p];if(d&&!zC(i,w,_))continue;let b=!1;for(let g=0,y=s.length;g<y;g++)if(s[g](e,p,n,!0)){b=!0;break}if(b)break}const m=e.getLines(t,p,u,!1).trim();e.line=p;const f=e.push("paragraph_open","p",1);f.map=[t,e.line];const v=e.push("inline","",0);return v.content=m,v.map=[t,e.line],v.children=[],e.push("paragraph_close","p",-1),e.parentType=o,!0}function nd(e){switch(e){case 9:case 32:return!0}return!1}function AO(e,t,n,s){let o=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],r=t+1;const l=e.md.block.ruler.getRulesForState(e,"reference");if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(o)!==91)return!1;function a(g){const y=e.lineMax;if(g>=y||e.isEmpty(g))return null;let k=!1;if(e.sCount[g]-e.blkIndent>3&&(k=!0),e.sCount[g]<0&&(k=!0),!k){const S=e.parentType;e.parentType="reference";let T=!1;for(let I=0,L=l.length;I<L;I++)if(l[I](e,g,y,!0)){T=!0;break}if(e.parentType=S,T)return null}const $=e.bMarks[g]+e.tShift[g],E=e.eMarks[g];return e.src.slice($,E+1)}let c=e.src.slice(o,i+1);i=c.length;let u=-1;for(o=1;o<i;o++){const g=c.charCodeAt(o);if(g===91)return!1;if(g===93){u=o;break}else if(g===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(g===92&&(o++,o<i&&c.charCodeAt(o)===10)){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}}if(u<0||c.charCodeAt(u+1)!==58)return!1;for(o=u+2;o<i;o++){const g=c.charCodeAt(o);if(g===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!nd(g))break}const d=e.md.helpers.parseLinkDestination(c,o,i);if(!d.ok)return!1;const p=e.md.normalizeLink(d.str);if(!e.md.validateLink(p))return!1;o=d.pos;const m=o,f=r,v=o;for(;o<i;o++){const g=c.charCodeAt(o);if(g===10){const y=a(r);y!==null&&(c+=y,i=c.length,r++)}else if(!nd(g))break}let w=e.md.helpers.parseLinkTitle(c,o,i);for(;w.can_continue;){const g=a(r);if(g===null)break;c+=g,o=i,i=c.length,r++,w=e.md.helpers.parseLinkTitle(c,o,i,w)}let _;for(o<i&&v!==o&&w.ok?(_=w.str,o=w.pos):(_="",o=m,r=f);o<i&&nd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10&&_)for(_="",o=m,r=f;o<i&&nd(c.charCodeAt(o));)o++;if(o<i&&c.charCodeAt(o)!==10)return!1;const b=hh(c.slice(1,u));return b?(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:_,href:p}),e.line=r),!0):!1}function am(e){switch(e){case 9:case 32:return!0}return!1}const EO=65536;function cm(e,t){const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return e.src.slice(n,s)}function IO(e,t){for(let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];n<s;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function hb(e){const t=[],n=e.length;let s=0,o=e.charCodeAt(s),i=!1,r=0,l="";for(;s<n;)o===124&&(i?(l+=e.substring(r,s-1),r=s):(t.push(l+e.substring(r,s)),l="",r=s+1)),i=o===92,s++,o=e.charCodeAt(s);return t.push(l+e.substring(r)),t}function $O(e,t,n,s){if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let i=e.bMarks[o]+e.tShift[o];if(i>=e.eMarks[o])return!1;const r=e.src.charCodeAt(i++);if(r!==124&&r!==45&&r!==58||i>=e.eMarks[o])return!1;const l=e.src.charCodeAt(i++);if(l!==124&&l!==45&&l!==58&&!am(l)||r===45&&am(l)||!IO(e,t))return!1;for(;i<e.eMarks[o];){const y=e.src.charCodeAt(i);if(y!==124&&y!==45&&y!==58&&!am(y))return!1;i++}let a=cm(e,t+1),c=a.split("|");const u=[];for(let y=0;y<c.length;y++){const k=c[y].trim();if(!k){if(y===0||y===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(k))return!1;k.charCodeAt(k.length-1)===58?u.push(k.charCodeAt(0)===58?"center":"right"):k.charCodeAt(0)===58?u.push("left"):u.push("")}if(a=cm(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;c=hb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const d=c.length;if(d===0||d!==u.length)return!1;if(s)return!0;const p=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRulesForState(e,"blockquote"),f=e.push("table_open","table",1),v=[t,0];f.map=v;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const _=e.push("tr_open","tr",1);_.map=[t,t+1];for(let y=0;y<c.length;y++){const k=e.push("th_open","th",1);u[y]&&(k.attrs=[["style",`text-align:${u[y]}`]]);const $=e.push("inline","",0);$.content=c[y].trim(),$.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,g=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let y=!1;for(let $=0,E=m.length;$<E;$++)if(m[$](e,o,n,!0)){y=!0;break}if(y||(a=cm(e,o).trim(),!a)||e.sCount[o]-e.blkIndent>=4||(c=hb(a),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),g+=d-c.length,g>EO))break;if(o===t+2){const $=e.push("tbody_open","tbody",1);$.map=b=[t+2,0]}const k=e.push("tr_open","tr",1);k.map=[o,o+1];for(let $=0;$<d;$++){const E=e.push("td_open","td",1);u[$]&&(E.attrs=[["style",`text-align:${u[$]}`]]);const S=e.push("inline","",0);S.content=c[$]?c[$].trim():"",S.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=o),e.push("table_close","table",-1),v[1]=o,e.parentType=p,e.line=o,!0}var NO=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}after(e,t,n,s){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const i=this._rules.findIndex(r=>r.name===t);i>=0&&this._rules.splice(i,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:s,fn:o})=>(i,r,l,a)=>{const c=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),u=o(i,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return na(i?.env,"block",s,d-c,u,!!a),u}):this.getRules(t)}at(e,t,n){const s=this._rules.findIndex(o=>o.name===e);if(s===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[s].fn=t,n?.alt&&(this._rules[s].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),s}disable(e,t){const n=Array.isArray(e)?e:[e],s=[];let o=!1;return n.forEach(i=>{const r=this._rules.findIndex(l=>l.name===i);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${i}`)}s.push(i),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),s}enableOnly(e){const t=new Set(e);let n=!1;for(const s of this._rules){const o=t.has(s.name);s.enabled!==o&&(s.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const s of this._rules)if(s.enabled)for(const o of s.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const s of e){const o=[],i=[];for(const r of this._rules)r.enabled&&(s!==""&&!r.alt.includes(s)||(o.push(r.fn),i.push({name:r.name,fn:r.fn})));t[s]=o,n[s]=i}this.cache=t,this.namedCache=n}};function pb(e){switch(e){case 9:case 32:return!0}return!1}var KC=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,s){this.src=e,this.md=t,this.env=n,this.tokens=s;const o=this.src;let i=0,r=0,l=0,a=!1;for(let c=0,u=o.length;c<u;c++){const d=o.charCodeAt(c);if(!a)if(pb(d)){i++,d===9?r+=4-r%4:r++;continue}else a=!0;(d===10||c===u-1)&&(d!==10&&c++,this.bMarks.push(l),this.eMarks.push(c),this.tShift.push(i),this.sCount.push(r),this.bsCount.push(0),a=!1,i=0,r=0,l=c+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){if(n===0){const o=new jn(e,t,0);return o.block=!0,o.level=this.level,this.tokens.push(o),o}const s=new jn(e,t,n);return s.block=!0,n<0&&this.level--,s.level=this.level,n>0&&this.level++,this.tokens.push(s),s}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,s=this.eMarks;for(let o=this.lineMax;e<o&&!(t[e]+n[e]<s[e]);e++);return e}skipSpaces(e){const t=this.src;for(let n=t.length;e<n;e++){const s=t.charCodeAt(e);if(s!==9&&s!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;const n=this.src;for(;e>t;){const s=n.charCodeAt(--e);if(s!==9&&s!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let s=n.length;e<s&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;const s=this.src;for(;e>n;)if(t!==s.charCodeAt(--e))return e+1;return e}getLines(e,t,n,s){if(e>=t)return"";if(e+1===t){const u=e,d=this.bMarks[u];let p=d;const m=s?this.eMarks[u]+1:this.eMarks[u];let f=0;const v=this.src,w=this.bsCount,_=this.tShift;for(;p<m&&f<n;){const b=v.charCodeAt(p);if(b===9||b===32)b===9?f+=4-(f+w[u])%4:f++;else if(p-d<_[u])f++;else break;p++}return f>n?new Array(f-n+1).join(" ")+v.slice(p,m):v.slice(p,m)}const o=new Array(t-e),i=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,c=this.tShift;for(let u=0,d=e;d<t;d++,u++){let p=0;const m=r[d];let f=m,v;for(d+1<t||s?v=l[d]+1:v=l[d];f<v&&p<n;){const w=i.charCodeAt(f);if(pb(w))w===9?p+=4-(p+a[d])%4:p++;else if(f-m<c[d])p++;else break;f++}p>n?o[u]=new Array(p-n+1).join(" ")+i.slice(f,v):o[u]=i.slice(f,v)}return o.join("")}};KC.prototype.Token=jn;const sd=[["table",$O,["paragraph","reference"]],["code",mO],["fence",gO,["paragraph","reference","blockquote","list"]],["blockquote",pO,["paragraph","reference","blockquote","list"]],["hr",kO,["paragraph","reference","blockquote","list"]],["list",TO,["paragraph","reference","blockquote"]],["reference",AO],["html_block",bO,["paragraph","reference","blockquote"]],["heading",vO,["paragraph","reference","blockquote"]],["lheading",wO],["paragraph",MO]];var LO=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new NO;for(let e=0;e<sd.length;e++)this.ruler.push(sd[e][0],sd[e][1],{alt:(sd[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){const s=this.getRules(),o=s.length,i=e.md.options.maxNesting,r=e.bMarks,l=e.tShift,a=e.eMarks,c=e.sCount;let u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let v=0;v<o;v++)if(f=s[v](e,u,n,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}return}const p=this.ruler.getNamedRules("");for(;u<n;){for(;u<n&&r[u]+l[u]>=a[u];)u++;if(e.line=u,u>=n||c[u]<e.blkIndent)break;if(e.level>=i){e.line=n;break}const m=e.line;let f=!1;for(let v=0;v<o;v++){const w=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();f=p[v].fn(e,u,n,!1);const _=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();if(na(e.env,"block",p[v].name,_-w,f,!1),f){if(m>=e.line)throw new Error("block rule didn't increment state.line");break}}if(!f)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),u=e.line,u<n&&r[u]+l[u]>=a[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,s){if(!e||e.length===0)return;const o=new KC(e,t,n,s);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},GC=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};GC.prototype.Token=jn;const mb=[["normalize",QL],["block",Y8],["inline",qL],["linkify",YL],["replacements",iO],["smartquotes",cO],["text_join",uO]],OO={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},RO={parseLinkLabel:av,parseLinkDestination:lv,parseLinkTitle:cv};function PO(){return{...OO}}function DO(){return{...RO}}var BO=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new LO,this.inline=new UL,this.ruler=new rO;for(let e=0;e<mb.length;e++){const[t,n]=mb[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:PO(),helpers:DO(),normalizeLink:UC,normalizeLinkText:qC,validateLink:WC,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||(this.linkifyInstance=new SC),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new GC(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(""),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(""),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e){if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const n=this.getCoreRules();for(let s=0;s<n.length;s++)n[s](e);return}const t=this.getCoreNamedRules();for(let n=0;n<t.length;n++){const s=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();t[n].fn(e);const o=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();na(e.env,"core",t[n].name,o-s,!0,!1)}HL(e.env)}parseSource(e,t={},n){if(typeof e!="string"&&G8(e))return this.parse(MC(e),t,n);const s=this.createState(e,t,n);return this.process(s),this.lastState=s,s}parse(e,t={},n){if(typeof e!="string")throw new TypeError("Input data should be a String");return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}};const FO={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function vf(e,t,n={},s){zs(n);const o={...FO,...s||{}},i=es(t);if(o.fallbackOnGlobalState!==!1&&i)return lm(n,{count:1,fallback:!0,fallbackReason:i,globalStateDetected:i,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ta(n,i,()=>e.core.parse(t,n,e).tokens);let r=xd(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=qO(r,o.maxChunks)),Td(t,r))return lm(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),ta(n,i,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return lm(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:i||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!i}),ta(n,i,()=>{for(let c=0;c<r.length;c++){const u=r[c],d=t.slice(u.start,u.end),p=e.core.parse(d,n,e).tokens;l!==0&&p.length&&WO(p,l),UO(a,p),l+=u.lineCount}return a})}function xd(e,t,n=!0){const s=[];let o=0,i=0,r=0,l=0,a=0,c=0,u=null;function d(p){p<=r||(s.push({start:r,end:p,lineCount:l}),r=p,o=0,i=0,l=0)}for(let p=0;p<e.length;){let m=e.indexOf(`
51
+ `,p),f=m;m===-1?(m=e.length,f=e.length):f=m+1;const v=jO(e,p,m);if(t.fenceAware){let b=p;for(;b<m;){const y=e.charCodeAt(b);if(y===32||y===9)b++;else break}const g=e[b];if(g==="`"||g==="~"){let y=b;for(;y<m&&e[y]===g;)y++;const k=y-b;k>=3&&(u?u.marker===g&&k>=u.length&&(u=null):u={marker:g,length:k})}}const w=f-p;o+=w,i+=1,l+=1,v?(a=0,c=0):(a+=1,c+=w);const _=v;if((o>=t.maxChunkChars||i>=t.maxChunkLines)&&!u)if(_)d(f);else{const b=Math.max(10,Math.floor(t.maxChunkLines*.5)),g=Math.max(t.maxChunkChars,8e3);(a>=b||c>=g)&&d(f)}p=f}return n&&d(e.length),s}function Td(e,t,n={rangesCoverWholeSource:!0}){const s=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;o<s;o++)if(!HO(e,t[o].end))return!0;return!1}function HO(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let s=n+1;s<t-1;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function WO(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function UO(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function qO(e,t){if(e.length<=t)return e;const n=[];let s=0;for(let o=0;o<t;o++){const i=t-o,r=e.length-s,l=Math.ceil(r/i),a=e.slice(s,s+l);let c=0;for(let u=0;u<a.length;u++)c+=a[u].lineCount;n.push({start:a[0].start,end:a[a.length-1].end,lineCount:c}),s+=l}return n}function jO(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}const YC=4e6,XC=8e4,zO=1e4,VO=200,KO=1e4,GO=200;function ZC(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function YO(e,t){if(t===0)return;const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);for(;n.length;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}function qi(e){return e.length===0?0:mn(e)+(e.charCodeAt(e.length-1)===10?0:1)}function XO(e,t,n){for(let s=t;s<n;s++){const o=e.charCodeAt(s);if(o!==32&&o!==9&&o!==13)return!1}return!0}function ZO(e,t){if(!t||e.length===0)return!1;let n=null;for(let s=0;s<e.length;){let o=e.indexOf(`
52
+ `,s);o===-1&&(o=e.length);let i=s;for(;i<o;){const l=e.charCodeAt(i);if(l===32||l===9)i++;else break}const r=e[i];if(r==="`"||r==="~"){let l=i;for(;l<o&&e[l]===r;)l++;const a=l-i;a>=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}s=o===e.length?e.length:o+1}return n!==null}function QO(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return XO(e,n+1,e.length-1)?!ZO(e,t):!1}function JO(e,t,n,s={}){const o=s.mode??"full",i=s.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(s.maxChunkChars!==void 0||s.maxChunkLines!==void 0||s.autoTune===!1){const r=s.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??KO:e.options.fullChunkSizeChars??zO),l=s.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??GO:e.options.fullChunkSizeLines??VO);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:i}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:i}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:i}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:i}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:i}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:i}}var au=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=qi(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;const s=xd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!1);if(!s.length)return this.updateEnvDiagnostics(e,t,n),null;if(Td(this.pending,s,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;const o=this.commitRanges(s,e);return this.pending=this.pending.slice(o),this.updateEnvDiagnostics(e,t,qi(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;const t=this.resolveWindow();if(!QO(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,qi(this.pending)),null;const n=xd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,qi(this.pending)),null;const s=Td(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:qi(this.pending)}]:n;return this.commitRanges(s,e),this.pending="",this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,"");const s=this.resolveWindow();return this.updateEnvDiagnostics(e,s,0),this.tokens}const t=this.resolveWindow(),n=xd(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware},!0);if(n.length){const s=Td(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:qi(this.pending)}]:n;this.commitRanges(s,e),this.pending=""}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending="",this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??"full",fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:qi(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){const e=this.committedChars+this.pending.length,t=this.committedLines+qi(this.pending);return JO(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(lu(e)&&Ii(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;const n=es(t);n&&(iv(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let s=0;s<e.length;s++){const o=e[s],i=this.pending.slice(o.start,o.end),r=this.md.core.parse(i,t,this.md).tokens,l=this.committedChars,a=this.committedLines;a!==0&&r.length&&YO(r,a),this.options.retainTokens!==!1&&ZC(this.tokens,r),this.committedChars+=i.length,this.committedLines+=o.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(r,{chunkIndex:this.parsedChunks,chunkChars:i.length,chunkLines:o.lineCount,tokenCount:r.length,startOffset:l,endOffset:this.committedChars,startLine:a,endLine:this.committedLines}),n=o.end}return this.markedGlobalStateReason&&rv(t),n}catch(s){throw this.markedGlobalStateReason&&(Ii(t),this.globalStateEnv=null,this.markedGlobalStateReason=null),s}}updateEnvDiagnostics(e,t,n){_C(e,{mode:this.options.mode??"full",maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function eR(e,t,n={},s={}){zs(n);const o=new au(e,{mode:"full",...s});for(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}async function tR(e,t,n={},s={}){zs(n);const o=new au(e,{mode:"full",...s});for await(const i of t)o.feed(i),o.flushAvailable(n);return o.flushForce(n)}function nR(e,t,n,s={},o={}){zs(s);const i=new au(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}async function sR(e,t,n,s={},o={}){zs(s);const i=new au(e,{mode:"full",...o,retainTokens:!1,onChunkTokens:n});for await(const r of t)i.feed(r),i.flushAvailable(s);return i.flushForce(s),i.stats()}function QC(e,t,n){if(e.options.autoUnbounded===!1)return!1;const s=e.options.autoUnboundedThresholdChars??YC,o=e.options.autoUnboundedThresholdLines??XC;return t>=s||n>=o}function JC(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??YC))return"yes";const s=e.options.autoUnboundedThresholdLines??XC;return n!==void 0?n>=s?"yes":"no":t+1<s?"no":"need-lines"}function yc(e,t,n={},s={}){zs(n);const o=es(t);if(lu(n)&&Ii(n),s.fallbackOnGlobalState!==!1&&o)return _C(n,{mode:"full",fallback:!0,fallbackReason:o,committedChars:t.length,committedLines:mn(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:o}),ta(n,o,()=>e.core.parse(t,n,e).tokens);const i=[],r=new au(e,{mode:"full",...s,retainTokens:!1,onChunkTokens(l){ZC(i,l)}});if(o&&iv(n,o),r.feed(t),r.flushForce(n),o&&(rv(n),s.fallbackOnGlobalState===!1)){const l=mi(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return i}const sa=(e,t,n)=>e<t?t:e>n?n:e;function ex(e){return e.experimental?{...e,...e.experimental}:e}const gb=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],vb=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function tx(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function oR(e,t=Math.max(0,e/40|0),n={}){const s=ex(n),o=s.fullChunkFenceAware??!0,i=s.fullChunkTargetChunks??8,r=s.fullChunkAdaptive!==!1;for(let l=0;l<gb.length;l++){const a=gb[l];if(e<=a.max){if(a.strategy!=="adaptive")return tx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:sa(Math.ceil(e/i),8e3,64e3),maxChunkLines:sa(Math.ceil(t/i),150,700),maxChunks:sa(Math.ceil(e/64e3),i,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.fullChunkSizeChars??1e4,maxChunkLines:s.fullChunkSizeLines??200,fenceAware:o,maxChunks:s.fullChunkMaxChunks}}function yb(e,t=Math.max(0,e/40|0),n={}){const s=ex(n),o=s.streamChunkFenceAware??!0,i=s.streamChunkTargetChunks??8,r=s.streamChunkAdaptive!==!1;for(let l=0;l<vb.length;l++){const a=vb[l];if(e<=a.max){if(a.strategy!=="adaptive")return tx(o,a);break}}return e>5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:sa(Math.ceil(e/i),8e3,64e3),maxChunkLines:sa(Math.ceil(t/i),150,700),maxChunks:sa(Math.ceil(e/64e3),i,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:s.streamChunkSizeChars??1e4,maxChunkLines:s.streamChunkSizeLines??200,maxChunks:s.streamChunkMaxChunks,fenceAware:o}}var iR={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},rR={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},lR={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};const aR=/[&<>"]/,kb=/[&<>"]/g,cR=/&/g,uR=/[<>"]/g,dR={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function um(e){return dR[e]||e}function on(e){if(e.length===0)return"";if(e.length<32)return aR.test(e)?e.replace(kb,um):e;const t=e.includes("&"),n=e.includes("<"),s=e.includes(">"),o=e.includes('"');return!t&&!n&&!s&&!o?e:t&&!n&&!s&&!o?e.replace(cR,"&amp;"):t?e.replace(kb,um):e.replace(uR,um)}const fR=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),hR=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function nx(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(fR,(t,n,s)=>{if(n)return n;if(hR.test(s)){const i=s[1].toLowerCase()==="x"?Number.parseInt(s.slice(2),16):Number.parseInt(s.slice(1),10);return ph(i)?zc(i):"�"}const o=Q1(t);return o!==t?o:t})}function yh(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Md(e,t){if(yh(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const bb=e=>yh(e)?e:Promise.resolve(e);function kc(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return on(e)}}function hr(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${kc(t[0])}="${on(t[1])}"`;for(let s=1;s<e.length;s++){const o=e[s];n+=` ${kc(o[0])}="${on(o[1])}"`}return n}function sx(e){if(!e)return{langName:"",langAttrs:""};let t=0;for(;t<e.length;){const s=e.charCodeAt(t);if(s===32||s===9||s===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:""};let n=t;for(;n<e.length;){const s=e.charCodeAt(n);if(s!==32&&s!==9&&s!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):""}}function bc(e,t,n,s,o){if(t.indexOf("<pre")===0)return`${t}
53
+ `;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${on(`${o.langPrefix??"language-"}${s}`)}">${t}</code></pre>
54
+ `;const i=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${s}`;return i<0?r.push(["class",l]):(r[i]=r[i].slice(),r[i][1]+=` ${l}`),`<pre><code${hr(r)}>${t}</code></pre>
55
+ `}return`<pre><code${hr(e.attrs)}>${t}</code></pre>
56
+ `}function yf(e){return!e.attrs||e.attrs.length===0?`<code>${on(e.content)}</code>`:`<code${hr(e.attrs)}>${on(e.content)}</code>`}function Rg(e){const t=on(e.content);return e.attrs?`<pre${hr(e.attrs)}><code>${t}</code></pre>
57
+ `:`<pre><code>${t}</code></pre>
58
+ `}function pR(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}<p>`;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}<td>`;case"th_open":return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}<td style="${on(n[0][1])}">`;if(e.type==="th_open")return`${t}<th style="${on(n[0][1])}">`}return null}function _b(e){const t=e.attrs;return!t||t.length===0?"<a>":t.length===1?`<a ${kc(t[0][0])}="${on(t[0][1])}">`:t.length===2?`<a ${kc(t[0][0])}="${on(t[0][1])}" ${kc(t[1][0])}="${on(t[1][1])}">`:`<a${hr(t)}>`}function mR(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function wb(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function kf(e,t){if(e.hidden)return"";const n=e.attrs,s=e.nesting,o=e.tag;if(!n||n.length===0)return s===0?t?`<${o} />`:`<${o}>`:s===-1?`</${o}>`:`<${o}>`;let i=(s===-1?"</":"<")+o+hr(n);return s===0&&t&&(i+=" /"),`${i}>`}const gR={langPrefix:"language-",xhtmlOut:!1,breaks:!1},od=Object.prototype.hasOwnProperty,Qt={code_inline(e,t){return yf(e[t])},code_block(e,t){return Rg(e[t])},fence(e,t,n,s,o){const i=e[t],r=i.info?nx(i.info).trim():"",{langName:l,langAttrs:a}=sx(r),c=n.highlight,u=on(i.content);if(!c)return bc(i,u,r,l,n);const d=c(i.content,l,a);return yh(d)?d.then(p=>bc(i,p||u,r,l,n)):bc(i,d||u,r,l,n)},image(e,t,n,s,o){const i=e[t],r=o.renderInlineAsText(i.children||[],n,s),l=i.attrIndex("alt");return l>=0&&i.attrs?i.attrs[l][1]=r:i.attrs?i.attrs.push(["alt",r]):i.attrs=[["alt",r]],kf(i,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
59
+ `:`<br>
60
+ `},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
61
+ `:`<br>
62
+ `:`
63
+ `},text(e,t){return on(e[t].content)},text_special(e,t){return on(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Sb(e,t,n){const s=e.info?nx(e.info).trim():"",{langName:o,langAttrs:i}=sx(s),r=t.highlight,l=on(e.content);if(!r)return bc(e,l,s,o,t);const a=r(e.content,o,i);if(yh(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return bc(e,a||l,s,o,t)}function id(e,t,n,s,o,i,r){const l=e[0];switch(l.type){case"text":if(o.text===Qt.text)return l.content.length===0?"":on(l.content);break;case"text_special":if(o.text_special===Qt.text_special)return l.content.length===0?"":on(l.content);break;case"softbreak":if(o.softbreak===Qt.softbreak)return r;break;case"hardbreak":if(o.hardbreak===Qt.hardbreak)return i;break;case"html_inline":if(o.html_inline===Qt.html_inline)return l.content;break;case"code_inline":if(o.code_inline===Qt.code_inline)return yf(l);break}const a=o[l.type];if(!a)return kf(l,t.xhtmlOut===!0);const c=a(e,0,t,n,s);return typeof c=="string"?c:Md(c,l.type)}var vR=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Qt}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const s=this.mergeOptions(t),o=n??{},i=this.rules,r=s.xhtmlOut===!0;let l,a,c,u,d,p,m="",f="",v=!1,w="";for(let _=0;_<e.length;_++){const b=e[_],g=b.type,y=_>0&&e[_-1].hidden?`
64
+ `:"";if(g==="list_item_open"&&(!b.attrs||b.attrs.length===0)&&_+3<e.length){const E=e[_+1],S=e[_+2],T=e[_+3];if(E.type==="paragraph_open"&&E.hidden&&S.type==="inline"&&T.type==="paragraph_close"&&T.hidden){w+=`${y}<li>${this.renderInlineTokens(S.children||[],s,o)}`,_+=3;continue}}if(_+2<e.length){const E=e[_+1],S=e[_+2];if(E.type==="inline"&&S.nesting===-1&&S.tag===b.tag&&!S.hidden){const T=pR(b,y);if(T!==null){w+=`${T+this.renderInlineTokens(E.children||[],s,o)}</${b.tag}>
65
+ `,_+=2;continue}}}if(g==="inline"){const E=b.children||[];if(E.length===1){v||(l=i.text,a=i.text_special,c=i.softbreak,u=i.hardbreak,d=i.html_inline,p=i.code_inline,m=s.xhtmlOut?`<br />
66
+ `:`<br>
67
+ `,f=s.breaks?m:`
68
+ `,v=!0);const S=E[0];switch(S.type){case"text":if(l===Qt.text){w+=on(S.content);continue}break;case"text_special":if(a===Qt.text_special){w+=on(S.content);continue}break;case"softbreak":if(c===Qt.softbreak){w+=f;continue}break;case"hardbreak":if(u===Qt.hardbreak){w+=m;continue}break;case"html_inline":if(d===Qt.html_inline){w+=S.content;continue}break;case"code_inline":if(p===Qt.code_inline){w+=yf(S);continue}break}}w+=this.renderInlineTokens(E,s,o);continue}const k=i[g];if(!k){const E=b.attrs;if(!b.hidden){if(!E||E.length===0)switch(g){case"hr":w+=r?`<hr />
69
+ `:`<hr>
70
+ `;continue;case"heading_open":w+=`<${b.tag}>`;continue;case"heading_close":w+=`</${b.tag}>
71
+ `;continue;case"paragraph_open":w+=`${y}<p>`;continue;case"paragraph_close":w+=`</p>
72
+ `;continue;case"list_item_open":{const S=e[_+1];w+=y+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"<li>":`<li>
73
+ `);continue}case"list_item_close":w+=`</li>
74
+ `;continue;case"bullet_list_open":w+=`${y}<ul>
75
+ `;continue;case"bullet_list_close":w+=`</ul>
76
+ `;continue;case"blockquote_open":w+=y+(e[_+1]&&e[_+1].nesting===-1&&e[_+1].tag==="blockquote"?"<blockquote>":`<blockquote>
77
+ `);continue;case"blockquote_close":w+=`</blockquote>
78
+ `;continue;case"ordered_list_open":w+=`${y}<ol>
79
+ `;continue;case"ordered_list_close":w+=`</ol>
80
+ `;continue;case"table_open":w+=`${y}<table>
81
+ `;continue;case"table_close":w+=`</table>
82
+ `;continue;case"thead_open":w+=`${y}<thead>
83
+ `;continue;case"thead_close":w+=`</thead>
84
+ `;continue;case"tbody_open":w+=`${y}<tbody>
85
+ `;continue;case"tbody_close":w+=`</tbody>
86
+ `;continue;case"tr_open":w+=`${y}<tr>
87
+ `;continue;case"tr_close":w+=`</tr>
88
+ `;continue;case"td_open":w+=`${y}<td>`;continue;case"td_close":w+=`</td>
89
+ `;continue;case"th_open":w+=`${y}<th>`;continue;case"th_close":w+=`</th>
90
+ `;continue}else if(E.length===1){const S=E[0];if(g==="ordered_list_open"&&S[0]==="start"){w+=`${y}<ol start="${on(S[1])}">
91
+ `;continue}if(g==="td_open"&&S[0]==="style"){w+=`${y}<td style="${on(S[1])}">`;continue}if(g==="th_open"&&S[0]==="style"){w+=`${y}<th style="${on(S[1])}">`;continue}}}w+=this.renderToken(e,_,s);continue}if(g==="code_block"&&k===Qt.code_block){w+=Rg(b);continue}if(g==="fence"&&k===Qt.fence){w+=Sb(b,s);continue}if(g==="html_block"&&k===Qt.html_block){w+=b.content;continue}const $=k(e,_,s,o,this);typeof $=="string"?w+=$:w+=Md($,b.type)}return w}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const s=this.mergeOptions(t),o=n??{},i=this.rules;let r="";for(let l=0;l<e.length;l++){const a=e[l];if(a.type==="inline"){r+=await this.renderInlineTokensAsync(a.children||[],s,o);continue}const c=i[a.type];c?r+=await bb(c(e,l,s,o,this)):r+=this.renderToken(e,l,s)}return r}renderInline(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokens(e,s,o)}async renderInlineAsync(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineTokensAsync(e,s,o)}renderInlineAsText(e,t,n){const s=this.mergeOptions(t),o=n??{};return this.renderInlineAsTextInternal(e,s,o)}renderAttrs(e){return hr(e.attrs)}renderToken(e,t,n){const s=e[t];if(s.hidden)return"";const o=s.block,i=s.nesting,r=s.tag,l=s.attrs;let a=!1;if(o&&(a=!0,i===1&&t+1<e.length)){const p=e[t+1];(p.type==="inline"||p.hidden||p.nesting===-1&&p.tag===r)&&(a=!1)}const c=o&&i!==-1&&t>0&&e[t-1].hidden?`
92
+ `:"",u=a?`>
93
+ `:">";if(!l||l.length===0)return i===0?n.xhtmlOut?`${c}<${r} /${u}`:`${c}<${r}${u}`:i===-1?`${c}</${r}${u}`:`${c}<${r}${u}`;let d=c+(i===-1?"</":"<")+r+hr(l);return i===0&&n.xhtmlOut&&(d+=" /"),d+u}mergeOptions(e){const t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null;const s=()=>(n||(n={...t}),n);if(od.call(e,"highlight")&&e.highlight!==t.highlight&&(s().highlight=e.highlight),od.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(s().langPrefix=o)}if(od.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(s().xhtmlOut=o)}if(od.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(s().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...gR,...this.baseOptions})}renderSingleToken(e,t,n,s){const o=this.rules,i=t.type;if(i==="code_block"&&o.code_block===Qt.code_block)return Rg(t);if(i==="html_block"&&o.html_block===Qt.html_block)return t.content;const r=this.mergeOptions(n),l=s??{};if(i==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[i];if(!a)return t.block?this.renderToken(e,0,r):kf(t,r.xhtmlOut===!0);if(i==="fence"&&a===Qt.fence)return Sb(t,r);const c=a(e,0,r,l,this);return typeof c=="string"?c:Md(c,i)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const s=this.rules,o=s.text,i=s.text_special,r=s.softbreak,l=s.hardbreak,a=s.html_inline,c=s.code_inline,u=s.link_open,d=s.link_close,p=s.em_open,m=s.em_close,f=s.strong_open,v=s.strong_close,w=t.xhtmlOut===!0,_=w?`<br />
94
+ `:`<br>
95
+ `,b=t.breaks?_:`
96
+ `;if(e.length===1)return id(e,t,n,this,s,_,b);let g="";for(let y=0;y<e.length;y++){const k=e[y];if(k.type==="link_open"&&!u&&!d&&y+2<e.length){const S=e[y+1];if(e[y+2].type==="link_close"&&mR(S)){const T=`${_b(k)+id([S],t,n,this,s,_,b)}</a>`;if(r===Qt.softbreak&&y+3<e.length&&e[y+3].type==="softbreak"){g+=T+b,y+=3;continue}g+=T,y+=2;continue}}if(k.type==="link_open"&&!u&&!d&&y+1<e.length&&e[y+1].type==="link_close"){g+=`${_b(k)}</a>`,y+=1;continue}if(k.type==="em_open"&&!p&&!m&&y+2<e.length){const S=e[y+1];if(e[y+2].type==="em_close"&&wb(S)){g+=`<em>${id([S],t,n,this,s,_,b)}</em>`,y+=2;continue}}if(k.type==="strong_open"&&!f&&!v&&y+2<e.length){const S=e[y+1];if(e[y+2].type==="strong_close"&&wb(S)){g+=`<strong>${id([S],t,n,this,s,_,b)}</strong>`,y+=2;continue}}switch(k.type){case"text":if(o===Qt.text){const S=k.content.length===0?"":on(k.content);if(a===Qt.html_inline&&y+1<e.length&&e[y+1].type==="html_inline"){for(g+=S+e[++y].content;y+1<e.length&&e[y+1].type==="html_inline";)g+=e[++y].content;continue}g+=S;continue}break;case"text_special":if(i===Qt.text_special){k.content.length!==0&&(g+=on(k.content));continue}break;case"softbreak":if(r===Qt.softbreak){g+=b;continue}break;case"hardbreak":if(l===Qt.hardbreak){g+=_;continue}break;case"html_inline":if(a===Qt.html_inline){for(g+=k.content;y+1<e.length&&e[y+1].type==="html_inline";)g+=e[++y].content;continue}break;case"code_inline":if(c===Qt.code_inline){g+=yf(k);continue}break}const $=s[k.type];if(!$){g+=k.block?this.renderToken(e,y,t):kf(k,w);continue}const E=$(e,y,t,n,this);typeof E=="string"?g+=E:g+=Md(E,k.type)}return g}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return"";const s=this.rules;let o="";for(let i=0;i<e.length;i++){const r=s[e[i].type];r?o+=await bb(r(e,i,t,n,this)):o+=this.renderToken(e,i,t)}return o}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return"";let s="";for(let o=0;o<e.length;o++){const i=e[o];switch(i.type){case"text":case"text_special":s+=i.content;break;case"image":s+=this.renderInlineAsTextInternal(i.children||[],t,n);break;case"html_inline":case"html_block":s+=i.content;break;case"softbreak":case"hardbreak":s+=`
97
+ `;break}}return s}},yR=vR;const kR=[];function Cb(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}}var bR=class{core;cache=null;stats=Cb();MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode="reset"}resetStats(){const{resets:e}=this.stats;this.stats=Cb(),this.stats.resets=e}parse(e,t,n){const s=t,o=this.cache;if(zs(s??o?.env),!o||s&&s!==o.env){const R=s??{},O=!!n.__explicitStreamChunkFallbackSetting,F=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,P=!!n.options?.streamChunkedFallback,q=!O&&F,K=P||q,G=n.options?.streamChunkAdaptive!==!1,oe=n.options?.streamChunkTargetChunks??8,J=n.options?.streamChunkSizeChars,he=n.options?.streamChunkSizeLines,Ne=n.options?.streamChunkMaxChunks,Fe=!!n.__explicitStreamChunkConfig,We=n.options?.autoTuneChunks!==!1,$e=n.options?.streamChunkFenceAware??!0,me=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,ke=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES;let _e,ue=e.length>=me;if(!ue&&ke!==void 0&&(_e=mn(e),ue=_e>=ke),ue){const X=this.parseFullDocument(e,R,n,_e,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Wn(R,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!mi(R)?.unbounded}),X.tokens}else if(K){const X=(H,U,Q)=>H<U?U:H>Q?Q:H;_e===void 0&&(_e=mn(e));const fe=We&&!Fe?yb(e.length,_e,n.options):null,D=fe?.maxChunkChars??(G?X(Math.ceil(e.length/oe),8e3,64e3):J??1e4),Z=fe?.maxChunkLines??(G?X(Math.ceil(_e/oe),150,700):he??200),ne=fe?.maxChunks??(G?X(Math.ceil(e.length/64e3),oe,32):Ne),se=e.length>0&&e.charCodeAt(e.length-1)===10,ae=q&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&fe?.strategy!=="plain";if((P||ae)&&(e.length>=D*2||_e>=Z*2)&&se){const H=vf(n,e,R,{maxChunkChars:D,maxChunkLines:Z,fenceAware:fe?.fenceAware??$e,maxChunks:ne});return this.cache={src:e,tokens:H,env:R,lineCount:_e,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,_e),this.recordChunkedParseResult(R,P?"explicit-initial-large-doc":"default-initial-large-doc"),H}}const z=this.parseFullDocument(e,R,n,_e);return _e=z.lineCount,this.cache={src:e,tokens:z.tokens,env:R,lineCount:_e,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,_e),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Wn(R,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!mi(R)?.unbounded}),z.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",Wn(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;let i=o.globalStateReason;i===void 0&&(i=es(o.src),o.globalStateReason=i);const r=es(e),l=i||r;if(l){const R=s??o.env;Ii(R);const O=this.parseFullDocument(e,R,n),F=O.tokens,P=O.lineCount;return this.cache={src:e,tokens:F,env:R,lineCount:P,lastSegment:void 0,globalStateReason:r},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Wn(R,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!mi(R)?.unbounded}),F}const a=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length<a&&e.length<a*1.5&&!e.startsWith(o.src)){const R=s??o.env,O=this.parseFullDocument(e,R,n),F=O.tokens,P=O.lineCount;return this.cache={src:e,tokens:F,env:R,lineCount:P,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Wn(R,{area:"stream",path:"stream-full",reason:"small-non-append",unbounded:!!mi(R)?.unbounded}),F}const c=this.getAppendedSegment(o.src,e);if(c&&!this.shouldPreferTailReparseForAppend(o)){let G=function($e){const me=$e.length;let ke=0;for(;ke<=me;){let _e=$e.indexOf(`
98
+ `,ke);_e===-1&&(_e=me);const ue=_e<me;let z=ke,X=0;for(;z<_e;){const fe=$e.charCodeAt(z);if(fe===32){if(X++,z++,X>=4)return!0;continue}if(fe===9){if(X+=4-X%4,z++,X>=4)return!0;continue}break}if(z<_e){const fe=$e.charCodeAt(z);switch(fe){case 35:{let D=z;for(;D<_e&&$e.charCodeAt(D)===35;)D++;const Z=D-z;if(Z>0&&Z<=6){if(D<_e){const ne=$e.charCodeAt(D);if(ne===32||ne===9||ne===13)return!0}else if(D===_e&&ue)return!0}break}case 62:{const D=z+1;if(D<_e){const Z=$e.charCodeAt(D);if(Z===32||Z===9||Z===13)return!0}else if(D===_e&&ue)return!0;break}case 45:case 42:case 43:{const D=z+1;if(D<_e){const Z=$e.charCodeAt(D);if(Z===32||Z===9||Z===13)return!0}else if(D===_e&&ue)return!0;break}case 96:case 126:{let D=z;for(;D<_e&&$e.charCodeAt(D)===fe;)D++;if(D-z>=3)return!0;break}default:if(fe>=48&&fe<=57){let D=z+1;for(;D<_e;){const Z=$e.charCodeAt(D);if(Z<48||Z>57)break;D++}if(D<_e&&$e.charCodeAt(D)===46){const Z=D+1;if(Z<_e){const ne=$e.charCodeAt(Z);if(ne===32||ne===9||ne===13)return!0}else if(Z===_e&&ue)return!0}}break}}if(_e===me)break;ke=_e+1}return!1};const R=o.lineCount??mn(o.src);let O=3;c.length>5e3?O=8:c.length>1e3?O=6:c.length>200&&(O=4),O=Math.min(O,R);let F=null;const P=n.options?.streamContextParseStrategy??"chars",q=n.options?.streamContextParseMinChars??200,K=n.options?.streamContextParseMinLines??2;let oe=null;const J=()=>(oe===null&&(oe=mn(c)),oe),he=this.canDirectlyParseAppend(o),Ne=he&&this.shouldUseUnboundedAppend(e,o,c);let Fe=!1;if(!he)switch(P){case"lines":Fe=J()>=K;break;case"constructs":if(c.length>=q){Fe=!0;break}if(G(c)){Fe=!0;break}Fe=J()>=K;break;case"chars":default:Fe=c.length>=q}if(O>0&&Fe){const $e=this.getTailLines(o.src,O)+c;try{const me=this.core.parse($e,o.env,n).tokens,ke=me.findIndex(_e=>_e.map&&typeof _e.map[1]=="number"&&_e.map[1]>O);if(ke!==-1){const _e=me.slice(ke),ue=R-O;ue!==0&&this.shiftTokenLines(_e,ue),F={tokens:_e}}}catch{F=null}}else F=null;if(!F){const $e=R;if(Ne)F={tokens:yc(n,c,o.env,{mode:"stream"})},$e>0&&this.shiftTokenLines(F.tokens,$e);else{const me=this.core.parse(c,o.env,n);$e>0&&this.shiftTokenLines(me.tokens,$e),F=me}}if(o.tokens.length>0&&F.tokens.length>0){const $e=o.tokens[o.tokens.length-1],me=F.tokens[0];try{$e.type==="inline"&&me.type==="inline"&&(me.children&&me.children.length>0&&($e.children||($e.children=[]),this.appendTokens($e.children,me.children)),$e.content=($e.content||"")+(me.content||""),F.tokens.shift())}catch{}}const We=o.tokens.length;if(F.tokens.length>0){let _e=function(fe,D){if(!fe&&!D)return!0;if(!fe||!D||fe.length!==D.length)return!1;for(let Z=0;Z<fe.length;Z++)if(fe[Z][0]!==D[Z][0]||fe[Z][1]!==D[Z][1])return!1;return!0},ue=function(fe,D){if(!fe&&!D)return!0;if(!fe||!D||fe.length!==D.length)return!1;for(let Z=0;Z<fe.length;Z++)if(!z(fe[Z],D[Z]))return!1;return!0},z=function(fe,D){if(!fe||!D||fe.type!==D.type)return!1;const Z=fe.map,ne=D.map;return!!Z!=!!ne||Z&&ne&&(Z[0]!==ne[0]||Z[1]!==ne[1])||fe.tag!==D.tag||fe.nesting!==D.nesting||fe.markup!==D.markup||fe.info!==D.info||fe.block!==D.block||fe.hidden!==D.hidden||!_e(fe.attrs,D.attrs)||!ue(fe.children,D.children)?!1:(fe.type==="inline",(fe.content||"")===(D.content||""))};const $e=o.tokens,me=F.tokens,ke=Math.min($e.length,me.length);let X=0;for(let fe=ke;fe>0;fe--){let D=!0;for(let Z=0;Z<fe;Z++){const ne=$e[$e.length-fe+Z],se=me[Z];if(!z(ne,se)){D=!1;break}}if(D){X=fe;break}}X>0&&me.splice(0,X),me.length>0&&this.appendTokens(o.tokens,me)}if(o.src=e,o.globalStateReason=es(e),o.lineCount=R+(oe??mn(c)),o.tokens.length>We){const $e=this.getLastSegment(o.tokens.slice(We),e);$e?o.lastSegment={tokenStart:We+$e.tokenStart,tokenEnd:We+$e.tokenEnd,lineStart:$e.lineStart,lineEnd:$e.lineEnd,srcOffset:$e.srcOffset}:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,Ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",Wn(o.env,{area:"stream",path:Ne?"stream-unbounded-append":"stream-append",reason:Ne?"large-delta":"safe-append",unbounded:Ne}),o.tokens}const u=s??o.env,d=this.tryTailSegmentReparse(e,o,u,n);if(d)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",Wn(u,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),d;const p=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,f=!!n.options?.streamChunkedFallback,v=!p&&!c&&m,w=f||v,_=n.options?.streamChunkAdaptive!==!1,b=n.options?.streamChunkTargetChunks??8,g=n.options?.streamChunkSizeChars,y=n.options?.streamChunkSizeLines,k=n.options?.streamChunkMaxChunks,$=!!n.__explicitStreamChunkConfig,E=n.options?.autoTuneChunks!==!1,S=n.options?.streamChunkFenceAware??!0;let T=c&&o.lineCount!==void 0?o.lineCount+mn(c):void 0;if(w){T===void 0&&(T=mn(e));const R=(oe,J,he)=>oe<J?J:oe>he?he:oe,O=E&&!$?yb(e.length,T,n.options):null,F=O?.maxChunkChars??(_?R(Math.ceil(e.length/b),8e3,64e3):g??1e4),P=O?.maxChunkLines??(_?R(Math.ceil(T/b),150,700):y??200),q=O?.maxChunks??(_?R(Math.ceil(e.length/64e3),b,32):k),K=e.length>0&&e.charCodeAt(e.length-1)===10,G=v&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&O?.strategy!=="plain";if((f||G)&&(e.length>=F*2||T>=P*2)&&K){const oe=vf(n,e,u,{maxChunkChars:F,maxChunkLines:P,fenceAware:O?.fenceAware??S,maxChunks:q});return this.cache={src:e,tokens:oe,env:u,lineCount:T,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,T),this.recordChunkedParseResult(u,f?"explicit-fallback-large-doc":"default-fallback-large-doc"),oe}}const I=this.parseFullDocument(e,u,n,T),L=I.tokens;return T=I.lineCount,this.cache={src:e,tokens:L,env:u,lineCount:T,lastSegment:void 0,globalStateReason:es(e)},this.updateCacheLineCount(this.cache,T),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",Wn(u,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!mi(u)?.unbounded}),L}recordChunkedParseResult(e,t){const n=mi(e)?.chunk,s=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,s){this.stats.fullParses+=1,this.stats.lastMode="full",Wn(e,{area:"stream",path:"stream-full",reason:`global-state:${s}`,unbounded:!!mi(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",Wn(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,s,o=!0){const i=es(e);lu(t)&&Ii(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?JC(n,e.length,s):"no";if(r==="yes"){const a=yc(n,e,t);return Wn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:s??(o?mn(e):0)}}let l=s;if(r==="need-lines"&&(l=mn(e),QC(n,e.length,l))){const a=yc(n,e,t);return Wn(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?mn(e):0),{tokens:ta(t,i,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS?!0:mn(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t){if(!t.startsWith(e)||!e.endsWith(`
99
+ `))return null;const n=t.slice(e.length);if(!n)return null;const s=n.length;if(n.charCodeAt(s-1)!==10)return null;let o=0,i=-1;for(let l=0;l<s&&!(n.charCodeAt(l)===10&&(i===-1&&(i=l),o++,o>=2));l++);if(o<2)return null;const r=(i===-1?n:n.slice(0,i)).trim();if(r.length===0)return null;if(/^[-=]+$/.test(r)){const l=e.slice(0,-1),a=l.lastIndexOf(`
100
+ `);if(l.slice(a+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(n)?null:n}tryTailSegmentReparse(e,t,n,s){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const i=t.src.slice(0,o.srcOffset);if(!e.startsWith(i))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const c=this.tryContainerTailAppendMerge(e,t,n,s,o,a);if(c)return c}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const c=this.core.parse(l,n,s),u=this.getLastSegment(c.tokens,l);return o.lineStart>0&&this.shiftTokenLines(c.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=es(e),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,c.tokens),t.lineCount=mn(e),u?t.lastSegment={tokenStart:o.tokenStart+u.tokenStart,tokenEnd:o.tokenStart+u.tokenEnd,lineStart:o.lineStart+u.lineStart,lineEnd:o.lineStart+u.lineEnd,srcOffset:o.srcOffset+u.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let s=e.length-1;s>=0;s--)if(e.charCodeAt(s)===10&&(n--,n===0))return e.slice(s+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,s=e.slice(n),o=s.length;let i=null,r=0;for(;r<=o;){let l=s.indexOf(`
101
+ `,r);l===-1&&(l=o);let a=r;for(;a<l;){const c=s.charCodeAt(a);if(c===32||c===9)a++;else break}if(a<l){const c=s.charCodeAt(a);if(c===96||c===126){let u=a;for(;u<l&&s.charCodeAt(u)===c;)u++;const d=u-a;d>=3&&(i?i.marker===c&&d>=i.length&&(i=null):i={marker:c,length:d})}}if(l===o)break;r=l+1}return i!==null}peek(){return this.cache?.tokens??kR}getStats(){return{...this.stats}}appendTokens(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}updateCacheLineCount(e,t){e.lineCount=t??mn(e.src),e.lastSegment=void 0}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t){if(e.length===0)return null;let n=Number.POSITIVE_INFINITY,s=-1,o=0;for(let i=e.length-1;i>=0;i--){const r=e[i];if(r.map&&(r.map[0]<n&&(n=r.map[0]),r.map[1]>s&&(s=r.map[1])),r.nesting<0){o+=-r.nesting;continue}if(r.nesting>0){if(o-=r.nesting,r.level===0&&o<=0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}continue}if(r.level===0&&o===0){const l=Number.isFinite(n)?n:r.map?.[0]??0,a=s>=l?s:r.map?.[1]??l;return{tokenStart:i,tokenEnd:e.length,lineStart:l,lineEnd:a,srcOffset:this.getLineStartOffset(t,l)}}}return null}getLineStartOffset(e,t){if(t<=0)return 0;let n=t,s=-1;for(;n>0;){if(s=e.indexOf(`
102
+ `,s+1),s===-1)return e.length;n--}return s+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,s,o,i){if(!i||this.mayContainReferenceDefinition(i))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,s,o,i,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,s,o,i,r);default:return null}}tryListTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_LIST_LINES_FOR_MERGE&&a<this.MIN_LIST_CHARS_FOR_MERGE)return null;const c=r.type==="bullet_list_open"?"bullet_list_close":"ordered_list_close";let u;try{u=this.core.parse(i,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(u,r.type,c,r.markup))return null;const d=u.slice(1,-1);if(d.length===0)return null;const p=t.lineCount??mn(t.src);p>0&&this.shiftTokenLines(d,p);const m=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),f=this.getListParagraphMode(u,0,u.length,0);return(m==="loose"||f==="loose"||this.endsWithBlankLine(t.src)||(u[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=es(e),t.lineCount=mn(e),r.map&&(r.map[1]=this.getDocLineCount(e)),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:this.getDocLineCount(e),srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,s,o,i,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(i))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l<this.MIN_TABLE_LINES_FOR_MERGE&&a<this.MIN_TABLE_CHARS_FOR_MERGE)return null;const c=this.getTableHeaderContext(t.src.slice(o.srcOffset));if(!c)return null;const u=`${c}${i}`;let d;try{d=this.core.parse(u,n,s).tokens}catch{return null}if(!this.isSingleTopLevelContainer(d,"table_open","table_close")||(d[0]?.map?.[1]??-1)!==this.getDocLineCount(u))return null;const p=this.getTableBodySection(d,0,d.length,0),m=this.getTableBodySection(t.tokens,o.tokenStart,t.tokens.length,r.level);if(!p||!m||p.tbodyOpenIndex<0||p.tbodyCloseIndex<0)return null;const f=m.tbodyOpenIndex>=0?d.slice(p.tbodyOpenIndex+1,p.tbodyCloseIndex):d.slice(p.tbodyOpenIndex,p.tbodyCloseIndex+1);if(f.length===0)return null;const v=o.lineEnd-2;v!==0&&this.shiftTokenLines(f,v);const w=m.tbodyCloseIndex>=0?m.tbodyCloseIndex:m.tableCloseIndex;t.tokens.splice(w,0,...f),t.src=e,t.env=n,t.globalStateReason=es(e),t.lineCount=mn(e);const _=this.getDocLineCount(e);if(r.map&&(r.map[1]=_),m.tbodyOpenIndex>=0){const b=t.tokens[m.tbodyOpenIndex];b?.map&&(b.map[1]=_)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:_,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(`
103
+ `);if(t<0)return null;const n=e.indexOf(`
104
+ `,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,s){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===s){o=l;break}}if(o<0)return null;let i=-1,r=-1;for(let l=t+1;l<o;l++){const a=e[l];if(a.type==="tbody_open"&&a.level===s+1){i=l;break}}if(i>=0){for(let l=o-1;l>i;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===s+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:i,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,s){if(e.length<2)return!1;const o=e[0],i=e[e.length-1];if(o.type!==t||i.type!==n||o.level!==0||i.level!==0||s!==void 0&&o.markup!==s)return!1;let r=0;for(let l=0;l<e.length;l++){const a=e[l];if(a.level===0&&l>0&&l<e.length-1&&r===0)return!1;(a.nesting>0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,s){let o=!1,i=!1;const r=s+2;for(let l=t;l<n;l++){const a=e[l];if(!(a.type!=="paragraph_open"||a.level!==r)&&(a.hidden?o=!0:i=!0,o&&i))return"loose"}return i?"loose":o?"tight":"none"}setListParagraphVisibility(e,t,n,s,o){const i=s+2;for(let r=t;r<n;r++){const l=e[r];(l.type==="paragraph_open"||l.type==="paragraph_close")&&l.level===i&&(l.hidden=o)}}shouldPreferTailReparseForAppend(e){const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"bullet_list_open":case"ordered_list_open":case"blockquote_open":case"table_open":return!0;case"paragraph_open":case"code_block":case"html_block":return!this.endsWithBlankLine(e.src);default:return!1}}endsWithBlankLine(e){const t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){const s=e.charCodeAt(n);if(s===32||s===9){n--;continue}return s===10}return!0}getDocLineCount(e){const t=mn(e);return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;const n=[...e];for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let o=s.children.length-1;o>=0;o--)n.push(s.children[o])}}};const xb={default:rR,zero:lR,commonmark:iR};function _R(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function wR(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function Tb(e){return e.experimental?{...e,...e.experimental}:e}function po(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function Mb(e,t,n){for(let s=0;s<n.length;s++){const o=n[s];if(po(t,o)||po(e,o))return!0}return!1}function Ab(e,t,n){return po(t,n)||po(e,n)}function Eb(e,t){const n=mi(e)?.chunk;if(n?.fallback){Wn(e,{area:"parse",path:"plain",reason:`global-state:${n.fallbackReason||"unknown"}`});return}Wn(e,{area:"parse",path:"full-chunk",chunked:!0,reason:t})}function SR(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},s="default",o;!t&&typeof e!="string"?(o=e,s="default"):typeof e=="string"&&(s=e,o=t);const i=xb[s];if(!i)throw new Error(`Wrong \`markdown-it\` preset "${s}", check name`);if(i?.options&&(n={...n,...i.options}),o&&(n={...n,...o}),n=Tb(n),typeof n.quotes=="string"){const k=n.quotes;k.length>=4?n.quotes=[k[0],k[1],k[2],k[3]]:n.quotes=["“","”","‘","’"]}let r=Mb(i?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=Mb(i?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=Ab(i?.options,o,"fullChunkedFallback"),c=Ab(i?.options,o,"streamChunkedFallback"),u=!1,d=null;const p=new BO;let m=null;const f=()=>(m||(m=new yR(n)),m);let v=null;const w=()=>(v||(v=new bR(p)),v);let _=null;const b=()=>(_||(_=new SC),_),g=k=>!u&&!!d&&!wR(k,d),y={core:p,block:p.block,inline:p.inline,get linkify(){const k=b();return Object.defineProperty(this,"linkify",{value:k,writable:!0,configurable:!0}),k},get renderer(){const k=f();return Object.defineProperty(this,"renderer",{value:k,writable:!0,configurable:!0}),k},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:c,__canUseImplicitLargeInputStrategy(){return g(this)},set(k){const $=Tb(k);return this.options={...this.options,...$},(po(k,"fullChunkSizeChars")||po(k,"fullChunkSizeLines")||po(k,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(po(k,"streamChunkSizeChars")||po(k,"streamChunkSizeLines")||po(k,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),po(k,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),po(k,"streamChunkedFallback")&&(c=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set($),typeof $.stream=="boolean"&&(this.stream.enabled=$.stream,v&&(v.reset(),v.resetStats())),this},configure(k){const $=typeof k=="string"?xb[k]:k;if(!$)throw new Error("Wrong `markdown-it` preset, can't be empty");if($.options&&this.set($.options),$.components){const E=$.components;E.core?.rules&&this.core.ruler.enableOnly(E.core.rules),E.block?.rules&&this.block.ruler.enableOnly(E.block.rules),E.inline?.rules&&this.inline.ruler.enableOnly(E.inline.rules),E.inline2?.rules&&this.inline.ruler2.enableOnly(E.inline2.rules)}return this},enable(k,$){const E=Array.isArray(k)?k:[k],S=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const I of S){if(!I)continue;const L=I.enable(E,!0);for(let R=0;R<L.length;R++)T.add(L[R])}if(!$){const I=E.filter(L=>!T.has(L));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},disable(k,$){const E=Array.isArray(k)?k:[k],S=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],T=new Set;for(const I of S){if(!I)continue;const L=I.disable(E,!0);for(let R=0;R<L.length;R++)T.add(L[R])}if(!$){const I=E.filter(L=>!T.has(L));if(I.length)throw new Error(`Rules manager: invalid rule name ${I.join(", ")}`)}return this},use(k,...$){const E=typeof k=="function"?k:k&&typeof k.default=="function"?k.default:void 0;if(!E)throw new TypeError("MarkdownIt.use: plugin must be a function");const S=[this,...$],T=k;return u=!0,E.apply(T,S),this},render(k,$={}){const E=this.parse(k,$);return f().render(E,this.options,$)},async renderAsync(k,$={}){const E=this.parse(k,$);return f().renderAsync(E,this.options,$)},renderIterable(k,$={}){const E=this.parseIterable(k,$);return f().render(E,this.options,$)},async renderAsyncIterable(k,$={}){const E=await this.parseAsyncIterable(k,$);return f().renderAsync(E,this.options,$)},renderInline(k,$={}){const E=this.parseInline(k,$);return f().render(E,this.options,$)},validateLink:WC,normalizeLink:UC,normalizeLinkText:qC,utils:s8,helpers:{...K8},parse(k,$={}){if(typeof k!="string")throw new TypeError("Input data should be a String");zs($);let E;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&g(this)){const T=JC(this,k.length);if(T==="yes"){const I=yc(this,k,$);return Wn($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),I}T==="need-lines"&&(E=mn(k))}if(!this.stream.enabled){const T=k.length,I=E??mn(k),L=this.options.autoTuneChunks!==!1,R=r,O=!a&&g(this),F=!!this.options.fullChunkedFallback,P=O&&T>=2e5,q=L&&!R?oR(T,I,this.options):null;if((F||P)&&(F?T>=(this.options.fullChunkThresholdChars??2e4)||I>=(this.options.fullChunkThresholdLines??400):P)){if(q&&q.strategy!=="plain"){const K=vf(this,k,$,{maxChunkChars:q.maxChunkChars,maxChunkLines:q.maxChunkLines,fenceAware:q.fenceAware,maxChunks:q.maxChunks});return Eb($,F?"explicit-full-chunk":"default-large-string"),K}if(F){const K=(me,ke,_e)=>me<ke?ke:me>_e?_e:me,G=this.options.fullChunkAdaptive!==!1,oe=this.options.fullChunkTargetChunks??8,J=K(Math.ceil(T/oe),8e3,64e3),he=K(Math.ceil(I/oe),150,700),Ne=G?J:this.options.fullChunkSizeChars??1e4,Fe=G?he:this.options.fullChunkSizeLines??200,We=G?K(Math.ceil(T/64e3),oe,32):this.options.fullChunkMaxChunks,$e=vf(this,k,$,{maxChunkChars:Ne,maxChunkLines:Fe,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:We});return Eb($,"explicit-full-chunk"),$e}}if(E!==void 0&&g(this)&&QC(this,T,I)){const K=yc(this,k,$);return Wn($,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const S=es(k);return Wn($,{area:"parse",path:"plain",reason:"default-plain"}),ta($,S,()=>p.parse(k,$,this).tokens)},parseIterable(k,$={}){return zs($),eR(this,k,$)},parseAsyncIterable(k,$={}){return zs($),tR(this,k,$)},parseIterableToSink(k,$,E={}){return zs(E),nR(this,k,$,E)},parseAsyncIterableToSink(k,$,E={}){return zs(E),sR(this,k,$,E)},parseInline(k,$={}){if(typeof k!="string")throw new TypeError("Input data should be a String");zs($),lu($)&&Ii($);const E=p.createState(k,$,this);return E.inlineMode=!0,p.process(E),E.tokens}};if(y.stream={enabled:!!n.stream,parse(k,$){return y.stream.enabled?w().parse(k,$,y):y.parse(k,$??{})},reset(){w().reset()},peek(){return v?v.peek():[]},stats(){return v?v.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){v&&v.resetStats()}},i?.components){const k=i.components;k.core?.rules&&y.core.ruler.enableOnly(k.core.rules),k.block?.rules&&y.block.ruler.enableOnly(k.block.rules),k.inline?.rules&&y.inline.ruler.enableOnly(k.inline.rules),k.inline2?.rules&&y.inline.ruler2.enableOnly(k.inline2.rules)}return d=_R(y),y}var CR=SR;function xR(e,t,n){function s(p){return p.trim().split(" ",2)[0]===t}function o(p,m,f,v,w){return p[m].nesting===1&&p[m].attrJoin("class",t),w.renderToken(p,m,f,v,w)}n=n||{};const i=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,c=n.validate||s,u=n.render||o;function d(p,m,f,v){let w,_=!1,b=p.bMarks[m]+p.tShift[m],g=p.eMarks[m];if(l!==p.src.charCodeAt(b))return!1;for(w=b+1;w<=g&&r[(w-b)%a]===p.src[w];w++);const y=Math.floor((w-b)/a);if(y<i)return!1;w-=(w-b)%a;const k=p.src.slice(b,w),$=p.src.slice(w,g);if(!c($,k))return!1;if(v)return!0;let E=m;for(;E++,!(E>=f||(b=p.bMarks[E]+p.tShift[E],g=p.eMarks[E],b<g&&p.sCount[E]<p.blkIndent));)if(l===p.src.charCodeAt(b)&&!(p.sCount[E]-p.blkIndent>=4)){for(w=b+1;w<=g&&r[(w-b)%a]===p.src[w];w++);if(!(Math.floor((w-b)/a)<y)&&(w-=(w-b)%a,w=p.skipSpaces(w),!(w<g))){_=!0;break}}const S=p.parentType,T=p.lineMax;p.parentType="container",p.lineMax=E;const I=p.push("container_"+t+"_open","div",1);I.markup=k,I.block=!0,I.info=$,I.map=[m,E],p.md.block.tokenize(p,m+1,E);const L=p.push("container_"+t+"_close","div",-1);return L.markup=p.src.slice(b,w),L.block=!0,p.parentType=S,p.lineMax=T,p.line=E+(_?1:0),!0}e.block.ruler.before("fence","container_"+t,d,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules["container_"+t+"_open"]=u,e.renderer.rules["container_"+t+"_close"]=u}function TR(e){const t=String(e??"").trim();if(!t.startsWith("{")||!t.endsWith("}"))return null;const n=t.slice(1,-1).trim();if(!n)return{};if(n.includes("{")||n.includes("[")||n.includes("]"))return null;const s=[];let o="",i=!1,r=!1;for(let a=0;a<n.length;a++){const c=n[a];if(c==="\\"){o+=c,a+1<n.length&&(o+=n[a+1],a++);continue}if(!r&&c==="'"){i=!i,o+=c;continue}if(!i&&c==='"'){r=!r,o+=c;continue}if(!i&&!r&&c===","){s.push(o.trim()),o="";continue}o+=c}o.trim()&&s.push(o.trim());const l={};for(const a of s){if(!a)continue;let c=!1,u=!1,d=-1;for(let w=0;w<a.length;w++){const _=a[w];if(_==="\\"){w++;continue}if(!u&&_==="'"){c=!c;continue}if(!c&&_==='"'){u=!u;continue}if(!c&&!u&&_===":"){d=w;break}}if(d===-1)return null;const p=a.slice(0,d).trim(),m=a.slice(d+1).trim();if(!p)return null;let f=p;if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))try{f=JSON.parse(f.replace(/^'/,'"').replace(/'$/,'"'))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(f))return null;let v;if(!m)v="";else if(m.startsWith('"')&&m.endsWith('"')||m.startsWith("'")&&m.endsWith("'"))try{v=JSON.parse(m.replace(/^'/,'"').replace(/'$/,'"'))}catch{v=m}else/^-?\d+(?:\.\d+)?$/.test(m)?v=Number(m):m==="true"||m==="false"?v=m==="true":m==="null"?v=null:v=m;l[f]=v}return l}function MR(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(xR,t,{render(n,s){return n[s].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
105
+ `}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,s,o)=>{const i=t,r=i.bMarks[n]+i.tShift[n],l=i.eMarks[n],a=i.src.slice(r,l),c=a.match(/^:::\s*([^\s{]+)/);if(!c)return!1;const u=c[1];if(!u.trim())return!1;const d=a.slice(c[0].length).trim();let p,m;const f=d.indexOf("{"),v=f>=0?d.slice(f).trimStart():void 0;if(f===-1)p=d||void 0;else{if(p=d.slice(0,f).trim()||void 0,v?.startsWith("{")){let k=0,$=-1;for(let E=0;E<v.length;E++)if(v[E]==="{"?k++:v[E]==="}"&&k--,k===0){$=E+1;break}$>0&&(m=v.slice(0,$))}m||(p=d||void 0)}if(o)return!0;const w=!!i.env.__markstreamFinal;let _=n+1,b=!1;for(;_<=s;){const k=i.bMarks[_]+i.tShift[_],$=i.eMarks[_];if(i.src.slice(k,$).trim()===":::"){b=!0;break}_++}b||(_=s);const g=i.push("vmr_container_open","div",1);if(g.attrSet("class",`vmr-container vmr-container-${u}`),g.meta={...g.meta??{},unclosed:!b&&!w},p&&g.attrSet("data-args",p),m)try{const k=JSON.parse(m);for(const[$,E]of Object.entries(k)){const S=E!=null&&typeof E=="object";g.attrSet(`data-${$}`,S?JSON.stringify(E):String(E))}}catch{const k=TR(m);if(k)for(const[$,E]of Object.entries(k)){const S=E!=null&&typeof E=="object";g.attrSet(`data-${$}`,S?JSON.stringify(E):String(E))}else g.attrSet("data-attrs",m)}const y=[];for(let k=n+1;k<_;k++){const $=i.bMarks[k]+i.tShift[k],E=i.eMarks[k];y.push(i.src.slice($,E))}if(y.some(k=>k.trim().length>0)){let k=y.join(`
106
+ `);k.endsWith(`
107
+ `)||(k+=`
108
+ `),k.endsWith(`
109
+
110
+ `)||(k+=`
111
+ `);const $=i.tokens[i.tokens.length-1];$&&($.raw=k);const E=[];i.md.block.parse(k,i.md,i.env,E),i.tokens.push(...E)}return b&&i.push("vmr_container_close","div",-1),i.line=b?_+1:_,!0},{alt:["paragraph","reference","blockquote","list"]})}const ox=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],AR=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],ix=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],ER=["svg","g","path"],IR=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],$R=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","srcdoc","ping"],NR=["action","data","href","src","srcset","poster","xlink:href","formaction"],LR=["script"],OR=["pre","script","style","textarea","title"],cl=new Set(ox),RR=new Set(ix),Kc=new Set([...ox,...AR,...ix,...ER]),rx=new Set([...Kc,...IR]),PR=new Set($R),DR=new Set(NR),cu=new Set(LR),lx=new Set(OR);function ax(e){let t="";for(const n of e){const s=n.charCodeAt(0);s<=31||s>=127&&s<=159||/\s/u.test(n)||(t+=n)}return t}const BR={amp:"&",bsol:"\\",colon:":",newline:`
112
+ `,sol:"/",tab:" "};function cx(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,s,o)=>{const i=n??s;if(i){const r=Number.parseInt(i,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return BR[String(o??"").toLowerCase()]??t})}const rd=new Set(["http","https","mailto","tel"]),Za=new Set(["http","https"]);function ux(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}function FR(e,t){return t==="href"||t==="xlink:href"?rd:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Za:rd}function oa(e,t={}){const n=ax(cx(e)).toLowerCase(),s=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return s==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const i=ux(n);return i?!FR(s,o).has(i):!1}function HR(e){const t=cx(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=ux(ax(t).toLowerCase());return n==="http"||n==="https"}function WR(e,t={}){const n=String(e??"").trim();return n?oa(n,t)?"":n:""}function Ib(e){return WR(e,{tagName:"img",attrName:"src"})}function Ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dn(e){let t=!1,n=!1;for(let s=0;s<e.length;s++){const o=e[s];if(o==="\\"){s++;continue}if(!n&&o==="'"){t=!t;continue}if(!t&&o==='"'){n=!n;continue}if(!t&&!n&&o===">")return s}return-1}function kh(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=s[2]||s[3]||s[4]||"";t.push([o,i])}return t}const UR=/^[a-z][a-z0-9_-]*$/;function $b(e){return UR.test(String(e??"").trim().toLowerCase())}function Mo(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return $b(t)?t.toLowerCase():"";let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]==="/")for(n++;n<t.length&&/\s/.test(t[n]);)n++;const s=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;const o=t.slice(s,n).toLowerCase(),i=t[n]??"";return i&&!/[\s/>]/.test(i)?"":$b(o)?o:""}function ya(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const s of e){const o=Mo(s);!o||t.has(o)||(t.add(o),n.push(o))}return n}function qR(...e){const t=new Set,n=[];for(const s of e)for(const o of ya(s))t.has(o)||(t.add(o),n.push(o));return n}function jR(e){const t=ya(e);return{key:t.join(","),tags:t}}function dx(e){return Mo(e)}function zR(e,t){const n=String(e??""),s=Mo(t);if(!s)return!1;const o=Ys(s),i=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return i?i[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function fx(e,t){const n=Mo(t);return!!n&&!Kc.has(n)&&!zR(e,n)}function VR(e,t){const n=String(e??""),s=Mo(t);if(!s)return n;const o=Ys(s),i=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(i,"").replace(r,"")}const hx=cl,KR=Kc,px=new Set(RR);px.delete("details");const GR=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,YR=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,Pg=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,XR=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function bf(e){return(e.match(Pg)?.[1]??"").toLowerCase()}function hv(e){return/^\s*<\s*\//.test(e)}function pv(e,t){return hx.has(t)||/\/\s*>\s*$/.test(e)}function ZR(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s];if(!o||o.type!=="html_inline")continue;const i=String(o.content??""),r=bf(i);if(r===t){if(hv(i)){if(n===0)return s;n--;continue}pv(i,r)||n++}}return-1}function QR(e,t){let n=0;for(const s of e){if(!s||s.type!=="html_inline")continue;const o=String(s.content??""),i=bf(o);if(i===t){if(hv(o)){n>0&&n--;continue}pv(o,i)||n++}}return n}function Nb(e,t,n=0){const s=new RegExp(String.raw`<\s*(\/?)\s*${Ys(t)}(?=[\s>/])[^>]*>`,"gi");s.lastIndex=Math.max(0,n);let o=0,i;for(;(i=s.exec(e))!==null;){const r=i[0]??"",l=!!i[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:i.index,end:i.index+r.length};o--;continue}a||o++}return null}function JR(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Ys(t)}(?=[\s>/])[^>]*>`,"gi");let s=0,o;for(;(o=n.exec(e))!==null;){const i=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(i);if(r){s>0&&s--;continue}l||s++}return s}function _f(e){const t=e;return String(t.raw??t.content??t.markup??"")}function eP(e){const t=e;return t.meta||(t.meta={}),t.meta}function dm(e,t,n){const s=eP(e);s.markstreamCustomHtmlRaw=t,s.markstreamCustomHtmlInner=n}function tP(e,t){if(!t.size)return;const n=Array.from(t,m=>new RegExp(String.raw`<\s*${Ys(m)}(?=[\s>/])`,"i")),s=[];let o=!1;const i=m=>m?n.some(f=>f.test(m)):!1,r=m=>{if(!(!m||!s.length))for(const f of s)f.raw+=m,f.inner+=m},l=()=>{!s.length||!o||(r(`
113
+ `),o=!1)},a=m=>{r(m)},c=m=>{for(let v=0;v<s.length;v++)s[v].raw+=m,v<s.length-1&&(s[v].inner+=m);const f=s.pop();dm(f.token,f.raw,f.inner)},u=m=>{const f=s[s.length-1]?.tag;if(!f)return null;const v=new RegExp(String.raw`^\s*<\s*\/\s*${Ys(f)}\s*>`,"i");return m.match(v)?.[0]??null},d=m=>!!u(m),p=(m,f,v)=>{const w=v??(m.type==="html_inline"?bf(f):"");if(!(w&&t.has(w))){r(f);return}const _=hv(f),b=!_&&pv(f,w);if(_){if(!s.length||s[s.length-1].tag!==w){r(f);return}c(f);return}if(r(f),b){dm(m,f,"");return}s.push({tag:w,token:m,raw:f,inner:""})};for(const m of e){if(m.type==="inline"&&Array.isArray(m.children)){const f=String(m.content??"");if(d(f)?o=!1:l(),!s.length&&!i(f)){o=!1;continue}let v=0,w=!0;for(const _ of m.children){const b=_f(_),g=_.type==="html_inline"?bf(b):"",y=g&&t.has(g);let k=b;if(w&&f&&b&&(s.length||y)){const $=f.indexOf(b,v);if($!==-1)a(f.slice(v,$)),k=f.slice($,$+b.length),v=$+b.length;else{if(s.length&&!y)continue;w=!1}}p(_,k,g)}w&&f&&v<f.length&&s.length&&a(f.slice(v)),o=s.length>0;continue}if(s.length&&typeof m.content=="string"){const f=_f(m),v=m.type==="html_block"?u(f):null;if(v){c(`${o?`
114
+ `:""}${v}`),o=s.length>0;continue}if(!m.content)continue;l(),r(m.content),o=!0}}for(const m of s)dm(m.token,m.raw,m.inner)}function nP(e){return/^\s*<\s*[!?]/.test(e)}function sP(e){const t=new Set(KR);if(e&&Array.isArray(e))for(const n of e){const s=String(n??"").trim();if(!s)continue;const o=s.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function Lb(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function oP(e,t){let n=null;for(const i of e.matchAll(GR)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Lb(l,t)&&dn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!1})}for(const i of e.matchAll(YR)){const r=i.index??-1;if(r<0)continue;const l=(i[1]??"").toLowerCase();Lb(l,t)&&dn(e.slice(r))===-1&&(!n||r<n.index)&&(n={index:r,tag:l,closing:!0})}const s=/<\/\s*$/.exec(e);if(s&&typeof s.index=="number"){const i=s.index;!e.slice(i).includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!0})}const o=/<\s*$/.exec(e);if(o&&typeof o.index=="number"){const i=o.index,r=e.slice(i);!r.startsWith("</")&&!r.includes(">")&&(!n||i<n.index)&&(n={index:i,tag:"",closing:!1})}return n}function iP(e,t){const n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:"text",content:t,raw:t})}function rP(e,t){if(!e.length)return{children:e};const n=[];let s=null,o=null;function i(a,c){a&&(c?n.push(iP(c,a)):n.push({type:"text",content:a,raw:a}))}function r(a,c){let u=0;for(;u<a.length;){const d=a.indexOf("<",u);if(d===-1){i(a.slice(u),c);break}i(a.slice(u,d),c);const p=a.slice(d),m=p.match(Pg);if(!m){i("<",c),u=d+1;continue}const f=dn(p);if(f===-1){i("<",c),u=d+1;continue}const v=p.slice(0,f+1),w=(m[1]??"").toLowerCase();t.has(w)?n.push({type:"html_inline",tag:"",content:v,raw:v}):i(v,c),u=d+v.length}}function l(a,c){if(!a)return;const u=oP(a,t);if(!u){r(a,c);return}const d=a.slice(0,u.index);d&&r(d,c),s={tag:u.tag,buffer:a.slice(u.index),closing:u.closing},o=s.buffer}for(const a of e){if(s){s.buffer+=_f(a),o=s.buffer;const c=dn(s.buffer);if(c===-1)continue;const u=s.buffer.slice(0,c+1),d=s.buffer.slice(c+1);n.push({type:"html_inline",tag:"",content:u,raw:u}),s=null,o=null,d&&l(d);continue}if(a.type==="html_inline"){const c=_f(a),u=(c.match(Pg)?.[1]??"").toLowerCase();if(u&&t.has(u)&&dn(c)===-1){s={tag:u,buffer:c,closing:/^<\s*\//.test(c)},o=s.buffer;continue}}if(a.type==="text"){const c=String(a.content??"");if(!c.includes("<")){n.push(a);continue}l(c,a);continue}n.push(a)}return{children:n,pendingBuffer:o??void 0}}const lP=["a","span","strong","em","b","i","u"];function aP(e,t={}){const n=new Set;if(t.customHtmlTags?.length)for(const p of t.customHtmlTags){const m=Mo(p);m&&n.add(m)}const s=p=>{const m=p,f=new Set(n),v=Array.isArray(m.env?.__markstreamCustomHtmlTags)?m.env.__markstreamCustomHtmlTags:[];for(const g of v){const y=Mo(String(g??""));y&&f.add(y)}const w=sP(Array.from(f)),_=new Set(lP);for(const g of f)_.add(g);return{autoCloseInlineTagSet:_,commonHtmlTags:w,customTagSet:f,shouldMergeHtmlBlockTag:g=>f.has(g)||!w.has(g)||px.has(g)}},o=p=>{if(p.type==="html_block")return String(p.content??"");if(p.type!=="inline"||!Array.isArray(p.children)||p.children.length!==1)return"";const m=p.children[0];return m?.type!=="html_block"?"":String(p.content??m.content??"")},i=(p,m)=>{p.type="html_block",p.content=m,p.raw=m,p.children=[]},r=p=>p.replace(/^(?:\r?\n)+/,""),l=p=>/^(?: {4}|\t)/.test(p),a=p=>p.replace(/^(?: {4}|\t)/gm,""),c=(p,m)=>{const f=r(p);if(!/\S/.test(f))return[];if(l(f))return[{type:"code_block",content:a(f),raw:f}];const v=f.replace(/^[\t ]+/,"");if(!v)return[];if(v.startsWith("<"))return[{type:"html_block",content:v}];const w={type:"inline",tag:"",nesting:0,content:v,children:[{type:"text",content:v,raw:v}]};return m==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},w,{type:"paragraph_close",tag:"p",nesting:-1}]:m==="text"?[{type:"text",content:v,raw:v}]:[w]},u=(p,m,f)=>p[m-1]?.type==="paragraph_open"&&p[m+1]?.type==="paragraph_close"?"inline":f,d=(p,m)=>{const f=r(m);return!/\S/.test(f)||p.type!=="inline"||!Array.isArray(p.children)?!1:(p.content=`${String(p.content??"")}${f}`,p.children.push({type:"text",content:f,raw:f}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",p=>{const m=p.tokens??[],{commonHtmlTags:f,customTagSet:v}=s(p);for(const w of m){const _=w;if(_.type!=="inline"||!Array.isArray(_.children))continue;const b=String(_.content??""),g=_.children.length?_.children:b.includes("<")?[{type:"text",content:b,raw:b}]:null;if(g)try{const y=rP(g,f);if(_.children=y.children,y.pendingBuffer){const k=b.lastIndexOf(y.pendingBuffer);if(k!==-1){const $=b.slice(0,k);_.content=$,typeof _.raw=="string"&&(_.raw=$)}}}catch(y){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",y)}}tP(m,v)}),e.core.ruler.push("fix_html_inline_tokens",p=>{const m=p.tokens??[],{autoCloseInlineTagSet:f,customTagSet:v,shouldMergeHtmlBlockTag:w}=s(p),_=[];for(let b=0;b<m.length;b++){const g=m[b];if(_.length>0){const[k,$]=_[_.length-1];if(b!==$){if(g.type==="paragraph_open"||g.type==="paragraph_close"){m.splice(b,1),b--;continue}const E=String(g.content??g.raw??"");if(E){const S=m[$],T=`${String(S.content||"")}
115
+ ${E}`,I=dn(T),L=I===-1?null:Nb(T,k,I+1);if(L){const R=T.slice(0,L.end),O=T.slice(L.end);S.content=R,S.loading=!1,m.splice(b,1),_.pop();const F=d(S,O)?[]:c(O,u(m,b,"paragraph"));F.length&&m.splice(b,0,...F),b--;continue}S.content=T,S.loading!==!1&&(S.loading=!0)}m.splice(b,1),b--;continue}}const y=o(g);if(y){if(nP(y))continue;const k=(y.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),$=/^\s*<\s*\//.test(y);if(!k||!w(k))continue;if(i(g,y),!$)k&&!new RegExp(`^\\s*<\\s*${k}\\b[^>]*\\/\\s*>`,"i").test(y)&&JR(y,k)>0&&_.push([k,b]);else if(_.length>0&&k&&_[_.length-1][0]===k){const[,E]=_[_.length-1],S=m[E];S.content=`${String(S.content||"")}
116
+ ${y}`,S.loading=!1,_.pop(),m.splice(b,1),b--}continue}else if(_.length>0){if(g.type==="paragraph_open"||g.type==="paragraph_close"){m.splice(b,1),b--;continue}const k=g.content||"",$=new RegExp(`<\\s*\\/\\s*${_[_.length-1][0]}\\s*>`,"i").test(k);if(k){const[,E]=_[_.length-1],S=m[E];S.content=`${S.content||""}
117
+ ${k}`,S.loading!==!1&&(S.loading=!$)}$&&_.pop(),m.splice(b,1),b--}else continue}if(v.size>0){const b=new Map,g=new Map,y=E=>{let S=b.get(E);return S||(S=new RegExp(`<\\s*${E}\\b`,"i"),b.set(E,S)),S},k=E=>{let S=g.get(E);return S||(S=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),g.set(E,S)),S},$=[];for(let E=0;E<m.length;E++){const S=m[E],T=String(S.content??"");if($.length>0){const L=$[$.length-1],R=m[L.index],O=S.type==="html_block"?k(L.tag).exec(T):null;if(O){const q=O.index+O[0].length,K=T.slice(0,q),G=T.slice(q);R.content=`${String(R.content??"")}
118
+ ${K}`,Array.isArray(R.children)&&R.children.push({type:"html_inline",content:`</${L.tag}>`,raw:`</${L.tag}>`}),$.pop();const oe=d(R,G)?[]:c(G,u(m,E,"paragraph"));oe.length?m.splice(E,1,...oe):(m.splice(E,1),E--);continue}if(S.type!=="inline")continue;const F=Array.isArray(S.children)?S.children:[],P=ZR(F,L.tag);if(P!==-1){const q=F.slice(0,P+1),K=F.slice(P+1),G=q.map(oe=>String(oe?.content??oe?.raw??"")).join("");if(R.content=`${String(R.content??"")}
119
+ ${G}`,Array.isArray(R.children)&&R.children.push(...q),K.length){const oe=K.map(J=>String(J.content??J.raw??"")).join("");if(oe.trim()){const J=oe.replace(/^\s+/,"");if(d(R,oe))m.splice(E,1),E--;else if(J.startsWith("<"))m.splice(E,1,{type:"html_block",content:J});else{const he=c(oe,u(m,E,"paragraph"));m.splice(E,1,...he)}}else m.splice(E,1),E--}else m.splice(E,1),E--;$.pop();continue}R.content=`${String(R.content??"")}
120
+ ${T}`,Array.isArray(R.children)&&R.children.push(...F),m.splice(E,1),E--;continue}if(S.type!=="inline")continue;const I=Array.isArray(S.children)?S.children:[];for(const L of v)if((I.length?QR(I,L):y(L).test(T)&&!k(L).test(T)?1:0)>0){$.push({tag:L,index:E});break}}}{let b=0;for(let g=0;g<m.length;g++){const y=m[g];if(y.type==="paragraph_open"){b++;continue}y.type==="paragraph_close"&&(b>0?b--:(m.splice(g,1),g--))}}for(let b=0;b<m.length;b++){const g=m[b];if(g.type==="html_block"){const S=(g.content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){g.loading=!1;continue}if(v.has(S)){const P=String(g.content??""),q=dn(P),K=q===-1?null:Nb(P,S,q+1);g.loading=K?!1:g.loading!==void 0?g.loading:!0;const G=K?.start??-1,oe=K?K.end-K.start:0;if(G!==-1){const J=P.slice(0,G+oe);let he="";q!==-1&&q<G&&(he=P.slice(q+1,G)),g.children=[{type:S,content:he,raw:J,attrs:[],tag:S,loading:!1}],g.content=J,g.raw=J;const Ne=c(P.slice(G+oe)||"","text");Ne.length&&m.splice(b+1,0,...Ne)}else g.children=[{type:S,content:"",raw:P,attrs:[],tag:S,loading:!0}];continue}if(["br","hr","img","input","link","meta","div","p","ul","li"].includes(S))continue;g.type="inline";const T=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let I;for(;(I=T.exec(g.content||""))!==null;)I[1],I[2]||I[3]||I[4];const L=String(g.content??""),R=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(L),O=R?R.index:-1,F=R?R[0].length:0;if(O!==-1){const P=L.slice(0,O+F),q=(L.slice(O+F)||"").replace(/^\s+/,"");g.children=[{type:"html_block",content:P,tag:S,loading:!1}],g.content=P,g.raw=P,q&&m.splice(b+1,0,q.startsWith("<")?{type:"html_block",content:q}:{type:"text",content:q,raw:q})}else g.children=[{type:"html_block",content:g.content,tag:S,loading:!0}];continue}if(!g||g.type!=="inline")continue;if(g.children.length===2&&g.children[0].type==="html_inline"){const S=(g.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),T=g.children[1],I=String(T?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(T?.type==="html_inline"&&I===S)continue;f.has(S)?(g.children[0].loading=!0,g.children[0].tag=S,g.children.push({type:"html_inline",tag:S,loading:!0,content:`</${S}>`})):g.children=[{type:"html_block",loading:!0,tag:S,content:String(g.children[0]?.content??"")+String(g.children[1]?.content??"")}];continue}else if(g.children.length===3&&g.children[0].type==="html_inline"&&g.children[2].type==="html_inline"){const S=(g.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(f.has(S))continue;g.children=[{type:"html_block",loading:!1,tag:S,content:g.children.map(T=>T.content).join("")}];continue}if(!g.content?.startsWith("<")||g.children?.length!==1)continue;const y=String(g.content),k=g,$=k.children[0];if($?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(y)&&(k.children.length=0);continue}const E=String($.content??y).match(XR)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(y)||hx.has(E)){k.children=[{type:"html_inline",content:y}];continue}k.children.length=0}}})}function cP(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function uP(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const s=n.tokens??[];for(let o=0;o<s.length;o++){const i=s[o];if(i.type!=="code_block")continue;const r=String(i.content??"").trim();if(!r)continue;const l=r.split(/\r?\n/).filter(a=>a.trim().length>0);if(l.length===1&&!cP(l[0]??"")){const a=l[0]??"",c=i.level??0;s.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:c},{type:"inline",tag:"",nesting:0,level:c,content:a,children:[{type:"text",content:a,level:c+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:c}),o+=2}}})}const mx=/\.([a-z0-9]{1,15})$/i,dP=/[_()[\]{}<>]/u,fP=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,hP=/[?#@]/u,pP=/[\\/]/u,mP=/^[\p{L}\p{N}./\\-]+$/u,gP=/^[A-Za-z0-9-]{1,63}$/u,vP=/^xn--[a-z0-9-]{2,59}$/i,yP=/^(?:[A-Z]{1,6}|\d{1,8})$/u,kP=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,bP=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,_P=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,wP=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,SP=new Set(["ai","md","py","rs","sh","zip"]),gx=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),CP=new Set([...gx,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),xP=new Set(["com","dev","io","page","site"]),TP=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),MP=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]);function Gc(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function fm(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Gc(n)?n:void 0}function Ob(e,t){if(!Gc(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function Rb(e){const t=uu(e);return Gc(t)?t:void 0}function AP(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function Pb(e,t){if(!Gc(t))return;const n=String(e??"").trim().split(/\s+/u).map(AP).filter(Boolean);if(n.length===0)return;const s={};return t?.filename&&n.every(o=>wf(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(s.filename=!0),t?.explicitFilename&&s.filename&&(s.explicitFilename=!0),t?.marketTicker&&n.every(o=>wf(o,{marketTicker:!0}))&&(s.marketTicker=!0),Gc(s)?s:void 0}function _r(e,t=!1){let n;return{options(s){return t||s==null?Ob(e,n):Ob(e,fm(Rb(s),Pb(s,n)))},remember(s){const o=Rb(s);n=t?fm(n,o):fm(o,Pb(s,n))},reset(){n=void 0}}}function Db(e){return gP.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function EP(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return Db(n)||vP.test(n)?t.every(Db):!1}function vx(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function IP(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function $P(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function yx(e,t,n){const s=IP(t);return vx(e)&&$P(s)&&String(n??"").toLowerCase().includes(s.toLowerCase())}function uu(e){const t=String(e??"");return{explicitFilename:bP.test(t),filename:_P.test(t),marketTicker:wP.test(t)}}function NP(e){return EP(e.split(/[\\/]/)[0]??"")}function LP(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function OP(e){if(dP.test(e)||!mP.test(e))return!0;if(pP.test(e))return!NP(e);const t=e.replace(mx,"");return vx(t)?!0:t.split(".").filter(Boolean).some(LP)}function RP(e,t,n){if(!(n?CP:gx).has(t))return!1;const s=e.slice(0,-(t.length+1));return s===""?e.startsWith("."):(n?kP:yP).test(s)}function wf(e,t={}){if(!e||fP.test(e)||hP.test(e))return!1;const n=e.match(mx);if(!n)return!1;const s=String(n[1]??"").toLowerCase();return RP(e,s,t.marketTicker===!0)?!0:MP.has(s)?!SP.has(s)||t.filename?!0:OP(e):!!(t.explicitFilename&&xP.has(s)||t.filename&&TP.has(s))}const Bb=["!"];function xs(e){return{type:"text",content:e,raw:e}}function Wr(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function Ur(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function ji(e,t,n){let s="";if(t.includes('"')){const o=t.split('"');t=o[0].trim(),s=o[1].trim()}return{type:"link",loading:n,href:t,title:s,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`}}function PP(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(xs(t))}}function Fb(e,t){let n=-1;for(const s of t){const o=e.indexOf(s);o!==-1&&(n===-1||o<n)&&(n=o)}return n}function DP(e){const t=e.attrs?.find(n=>n?.[0]==="href")?.[1];return typeof t=="string"?t:""}function BP(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(s=>s?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function FP(e,t,n){let s="";for(let o=t+1;o<n;o++){const i=e[o];if(i?.type!=="text"||typeof i.content!="string")return null;s+=i.content}return s||null}function HP(e){e.core.ruler.after("inline","fix_link_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=WP(o.children,typeof o.content=="string"?o.content:void 0)}catch(i){console.error("[applyFixLinkTokens] failed to fix inline children",i)}}})}function WP(e,t){if(e.length<3||e.some(s=>s.type==="code_inline"))return e;const n=uu(t);for(let s=0;s<=e.length-1;s++){s<0&&(s=0);const o=e[s];if(!o)break;if(o.type==="link_open"&&(o.markup==="linkify"||o.markup==="autolink")){let i=-1;for(let r=s+1;r<e.length;r++)if(e[r]?.type==="link_close"){i=r;break}if(i!==-1){const r=FP(e,s,i),l=DP(o);if(o.markup==="linkify"&&r&&!yx(r,l,t)&&wf(r,n)){e.splice(s,i-s+1,xs(r));continue}const a=Fb(l,Bb);for(let c=s+1;c<i;c++){const u=e[c];if(u?.type!=="text"||typeof u.content!="string")continue;const d=Fb(u.content,Bb);if(d===-1)continue;const p=u.content[d],m=u.content.slice(0,d);let f=u.content.slice(d);for(let _=c+1;_<i;_++){const b=e[_];b?.type==="text"&&typeof b.content=="string"&&(f+=b.content)}u.content=m,u.raw=m;const v=i-(c+1);v>0&&(e.splice(c+1,v),i=c+1);let w=l;if(a!==-1)w=l.slice(0,a);else if(f){const _=encodeURI(f);if(_&&l.endsWith(_))w=l.slice(0,l.length-_.length);else{const b=p?encodeURI(p):"",g=b?l.indexOf(b):-1;g!==-1&&(w=l.slice(0,g))}}w!==l&&BP(o,w),f&&e.splice(i+1,0,xs(f));break}}}if(o?.type==="em_open"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("*")){const i=e[s-1].content?.replace(/(\*+)$/,"")||"";e[s-1].content=i,o.type="strong_open",o.tag="strong",o.markup="**";for(let r=s+1;r<e.length;r++)if(e[r]?.type==="em_close"){e[r].type="strong_close",e[r].tag="strong",e[r].markup="**";break}}else if(o?.type==="text"&&o.content?.endsWith("(")&&e[s+1]?.type==="link_open"){const i=o.content.match(/\[([^\]]+)\]/);if(i){let r=o.content.slice(0,i.index);const l=r.match(/(\*+)$/),a=[];if(l){r=r.slice(0,l.index),r&&a.push(xs(r));const c=i[1],u=l[1].length;Wr(a,u);let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(ji(c,d,!e[s+4]?.content?.startsWith(")"))),Ur(a,u),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)\**/,"");p&&a.push(xs(p)),e.splice(s,5,...a)}else e.splice(s,4,...a)}else{r&&a.push(xs(r));let c=i[1];const u=c.match(/^\*+/);if(u){const p=u[0].length;c=c.replace(/^\*+/,"").replace(/\*+$/,"");let m=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(m+=e[s+4]?.content||"",e[s+4].content=""),Wr(a,p),a.push(ji(c,m,!e[s+4]?.content?.startsWith(")"))),Ur(a,p),e[s+4]?.type==="text"){const f=e[s+4].content?.replace(/^\)/,"");f&&a.push(xs(f)),e.splice(s,5,...a)}else e.splice(s,4,...a);s===0?s=a.length-1:s-=a.length+1;continue}let d=e[s+2]?.content||"";if(e[s+4]?.type==="text"&&!e[s+4].content?.startsWith(")")&&(d+=e[s+4]?.content||"",e[s+4].content=""),a.push(ji(c,d,!e[s+4]?.content?.startsWith(")"))),e[s+4]?.type==="text"){const p=e[s+4].content?.replace(/^\)/,"");p&&a.push(xs(p)),e.splice(s,5,...a)}else e.splice(s,4,...a)}s-=a.length+1;continue}}else if(o.type==="link_open"&&o.markup==="linkify"&&e[s-1]?.type==="text"&&e[s-1].content?.endsWith("(")){if(e[s-2]?.type==="link_close"){const i=[],r=e[s-3].content||"";let l=o.attrs?.find(a=>a[0]==="href")?.[1]||"";if(e[s+3]?.type==="text"){const a=(e[s+3]?.content??"").indexOf(")"),c=a===-1;a===-1&&(l+=e[s+3]?.content?.slice(0,a)||"",e[s+3].content=""),i.push(ji(r,l,c));const u=e[s+3].content?.replace(/^\)\**/,"");u&&i.push(xs(u)),e.splice(s-4,8,...i)}else i.push({type:"link",loading:!0,href:l,title:"",text:r,children:[{type:"text",content:l,raw:l}],raw:`[${r}](${l})`}),e.splice(s-4,7,...i);continue}else if(e[s-1].content==="]("&&e[s-3]?.type==="text"&&e[s-3].content?.endsWith(")"))if(e[s-2]?.type==="strong_open"){const[i,r]=e[s-3].content?.split("[**")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else if(e[s-2]?.type==="em_open"){const[i,r]=e[s-3].content?.split("[*")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}else{const[i,r]=e[s-3].content?.split("[")||[];e[s+1].content=r||"",e[s-3].content=i||"",e[s-1].content=""}}if(o.type==="link_close"&&o.nesting===-1&&e[s-2]?.type==="link_open"&&e[s+1]?.type==="text"&&e[s-1]?.type==="text"){const i=e[s-1].content||"",r=e[s-2].attrs||[],l=r.find(f=>f[0]==="href")?.[1]||"",a=r.find(f=>f[0]==="title")?.[1]||"";let c=3,u=2;const d=(e[s-3]?.content||"").match(/^(\*+)$/),p=[];if(d){u+=1;const f=d[1].length;Wr(p,f)}if(o.markup!=="linkify"&&e[s+1].type==="text"&&e[s+1]?.content?.startsWith("](")){c+=1;for(let f=s+1;f<e.length;f++){const v=d?d[1].length:e[s-3].markup.length,w=e[f];if(v===1&&w.type==="em_close")break;if(v===2&&w.type==="strong_close")break;if(v===3&&(w.type==="em_close"||w.type==="strong_close"))break;c+=1}}const m={type:"link",loading:!1,href:l,title:a,text:i,children:[{type:"text",content:i,raw:i}],raw:`[${i}](${l})`};if(p.push(m),d){const f=d[1].length;Ur(p,f)}e.splice(s-u,c,...p),s-=p.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].markup?.includes("*")&&e[s-4]?.type==="text"&&e[s-4].content?.endsWith("[")){const i=e[s-1].markup.length,r=[],l=e[s-4].content.slice(0,e[s-4].content.length-i);l&&r.push(xs(l)),Wr(r,i);const a=e[s-2].content||"";let c=o.content.slice(2),u=!0;if(e[s+1]?.type==="text"){const d=(e[s+1]?.content??"").indexOf(")");u=d===-1,d===-1&&(c+=e[s+1]?.content?.slice(0,d)||"",e[s+1].content="")}if(r.push(ji(a,c,u)),Ur(r,i),e[s+1]?.type==="text"){const d=e[s+1].content?.replace(/^\)\**/,"");d&&r.push(xs(d)),e.splice(s-4,8,...r)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...r):e.splice(s-4,7,...r);s-=r.length+1;continue}else if(o.content?.startsWith("](")&&e[s-1].type==="strong_close"&&e[s-4]?.type==="text"&&e[s-4]?.content?.includes("**[")){const i=[],r=e[s-4].content.split("**[")[0];r&&i.push(xs(r)),Wr(i,2);const l=e[s-2].content||"";let a=o.content.slice(2),c=!0;if(e[s+1]?.type==="text"){const u=(e[s+1]?.content??"").indexOf(")");c=u===-1,u===-1&&(a+=e[s+1]?.content?.slice(0,u)||"",e[s+1].content="")}if(i.push(ji(l,a,c)),Ur(i,2),e[s+1]?.type==="text"){const u=e[s+1].content?.replace(/^\)\**/,"");u&&i.push(xs(u)),e.splice(s-4,8,...i)}else e[s+1]?.type==="link_open"?e.splice(s-4,10,...i):e.splice(s-4,7,...i);s-=i.length+1;continue}else if(o.type==="strong_close"&&e[s+1]?.type==="text"&&e[s+1].content?.includes("](")&&e[s-1].type==="text"&&/\[.*$/.test(e[s-1].content||"")){const i=[],[r,l]=e[s-1].content?.split("[")||["",""];r&&i.push(xs(r)),Wr(i,2);let[a,c]=e[s+1].content.split("](");a=l+a;let u=4;if(e[s+2]?.type==="link_open"){const p=e[s+2].attrs?.find(m=>m[0]==="href")?.[1];e[s+5]?.type==="text"&&e[s+5].content==="."?(c=(p||c)+e[s+5].content,e[s+5].content=""):c=p||c,u+=3}let d=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,"")),e[s+2]?.type==="text"){const p=(e[s+2]?.content??"").indexOf(")");d=p===-1,p===-1&&(c+=e[s+2]?.content?.slice(0,p)||"",e[s+2].content="")}i.push(ji(a,c,d)),Ur(i,2),e.splice(s-2,u,...i)}if(o.type==="text"&&/\*+\[[^\]]*$/.test(o.content||"")&&e[s+1]?.type==="strong_open"&&e[s+2]?.type==="text"&&e[s+2].content==="]("&&e[s+3]?.type==="link_open"&&e[s+5]?.type==="link_close"&&e[s+6]?.type==="text"&&e[s+6].content===")"&&e[s+7]?.type==="strong_close"){const i=(o.content||"").match(/^(\*+)\[(.*)$/);if(i){const r=(i[2]||"")+i[1];let l=e[s+3]?.attrs?.find(c=>c[0]==="href")?.[1]||"";!l&&e[s+4]?.type==="text"&&(l=e[s+4].content||"");const a=[];Wr(a,2),a.push(ji(r,l,!1)),Ur(a,2),e.splice(s,9,...a),s-=a.length-1;continue}}}for(let s=0;s<e.length-1;s++){const o=e[s],i=e[s+1];if(o?.type!=="link"||i?.type!=="text"||typeof i.content!="string"||!i.content.startsWith("!"))continue;const r=String(o.href??"");if(String(o.text??"")!==r||!r.endsWith("=")&&!r.endsWith("#"))continue;PP(o,"!");const l=i.content.slice(1);l?(i.content=l,i.raw=l):e.splice(s+1,1)}return e}function UP(e){e.core.ruler.after("inline","fix_list_item_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=qP(o.children)}catch(i){console.error("[applyFixListItem] failed to fix inline children",i)}}})}function qP(e){const t=e[e.length-1],n=String(t?.content??"");return t?.type==="text"&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag==="br"&&e.splice(e.length-1,1),e}function jP(e){e.core.ruler.after("inline","fix_strong_tokens",t=>{const n=t.tokens??[];for(let s=0;s<n.length;s++){const o=n[s];if(o&&o.type==="inline"&&Array.isArray(o.children))try{o.children=zP(o.children)}catch(i){console.error("[applyFixStrongTokens] failed to fix inline children",i)}}})}function zP(e){let t=0;const n=new Set,s=new Set;let o=0;for(let u=0;u<e.length;u++){const d=e[u],p=d.type;if(p==="strong_open"){t++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const v=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const _=e[w];m==="__"&&(v?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,n.add(t))}else if(p==="strong_close")n.has(t)&&d.markup==="__"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),t--,t<0&&(t=0);else if(p==="em_open"){o++;const m=String(d.markup??"");let f=u-1;for(;f>=0&&e[f].type==="text"&&e[f].content==="";)f--;const v=e[f];let w=u+1;for(;w<e.length&&e[w].type==="text"&&e[w].content==="";)w++;const _=e[w];m==="_"&&(v?.content?.endsWith("_")||_?.content?.startsWith("_")||_?.markup?.includes("_"))&&(d.type="text",d.tag="",d.content=m,d.raw=m,d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null,s.add(o))}else p==="em_close"&&(s.has(o)&&d.markup==="_"&&(d.type="text",d.content=d.markup,d.raw=String(d.markup??""),d.tag="",d.markup="",d.attrs=null,d.map=null,d.info="",d.meta=null),o--,o<0&&(o=0))}if(e.length<5)return e;const i=e.length-4,r=e[i];let l=[...e];const a=e[i+1],c=String(r.content??"");if(r.type==="link_open"&&e[i-1]?.type==="em_open"&&e[i-2]?.type==="text"&&e[i-2].content?.endsWith("*")){const u=String(e[i-2].content??"").slice(0,-1),d=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},e[i],e[i+1],e[i+2],{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}];u&&d.unshift({type:"text",content:u,raw:u}),l.splice(i-2,6,...d)}else if(r.type==="text"&&c.endsWith("*")&&a.type==="em_open"){const u=e[i+2],d=u?.type==="text"?4:3,p=[{type:"strong_open",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""},{type:"text",content:u?.type==="text"?String(u.content??""):"",raw:u?.type==="text"?String(u.content??""):""},{type:"strong_close",tag:"strong",attrs:null,map:null,children:null,content:"",markup:"**",info:"",meta:null,raw:""}],m=c.slice(0,-1);m&&p.unshift({type:"text",content:m,raw:m}),l.splice(i,d,...p)}return l=VP(l),l}function VP(e){if(e.length<7)return e;const t=[];for(let n=0;n<e.length;n++){const s=e[n],o=e[n+1],i=e[n+2],r=e[n+3],l=e[n+4],a=e[n+5],c=e[n+6];if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"&&c?.type==="text"){const u=String(c.content??""),d=u.indexOf("**");if(d!==-1){const p=u.slice(0,d),m=u.slice(d+2);t.push(s),t.push(o),t.push(l),p&&t.push({...c,type:"text",content:p,raw:p}),t.push(a),m&&t.push({...c,type:"text",content:m,raw:m}),n+=6;continue}}if(s?.type==="strong_open"&&o?.type==="text"&&i?.type==="strong_close"&&r?.type==="strong_open"&&l?.type==="math_inline"&&a?.type==="strong_close"){const u=KP(e,n+6);if(u){t.push(s),t.push(o),t.push(l);for(let d=n+6;d<u.index;d++)t.push(e[d]);u.beforeClose&&t.push({...e[u.index],type:"text",content:u.beforeClose,raw:u.beforeClose}),t.push(a),u.afterClose&&t.push({...e[u.index],type:"text",content:u.afterClose,raw:u.afterClose}),n=u.index;continue}}t.push(s)}return t}function KP(e,t){for(let n=t;n<e.length;n++){const s=e[n];if(s?.type==="strong_open")return null;if(s?.type!=="text")continue;const o=String(s.content??""),i=o.indexOf("**");if(i!==-1)return{index:n,beforeClose:o.slice(0,i),afterClose:o.slice(i+2)}}return null}function GP(e){e.core.ruler.after("block","fix_table_tokens",t=>{const n=t;try{const s=e7(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(s)&&(n.tokens=s)}catch(s){console.error("[applyFixTableTokens] failed to fix table tokens",s)}})}function Hb(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function Wb(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function Ub(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function kx(e,t){if(!e.startsWith("|")||e.includes(`
121
+ `)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(s=>s.trim().length>0)?n:null}function hm(e){return kx(e)!==null}function bx(e){return/^:?-+:?$/.test(e.trim())}function YP(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(bx)}function XP(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function ZP(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(bx)&&XP(n)}function QP(e){return e==="|"||e==="|:"}function JP(e){const t=kx(e);return t!==null&&t.every(n=>!n.includes(":"))}function e7(e,t=!1,n=""){const s=[...e];if(e.length<3)return s;const o=e.length-2,i=e[o];if(i.type==="inline"){const r=String(i.content??""),l=r.split(`
122
+ `)[0]??"",[a="",c="",...u]=r.split(`
123
+ `),d=!t&&!r.includes(`
124
+ `)&&/\r?\n$/.test(n)&&hm(r);if(!t&&(r.includes(`
125
+ `)&&u.length===0&&hm(a)&&ZP(c)||d)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Ub(f)),m=[...Hb(),...p,...Wb()];s.splice(o-1,3,...m)}else if(r.includes(`
126
+ `)&&u.length===0&&hm(a)&&YP(c)){const p=l.slice(1,-1).split("|").map(f=>f.trim()).flatMap(f=>Ub(f)),m=[...Hb(),...p,...Wb()];s.splice(o-1,3,...m)}else r.includes(`
127
+ `)&&u.length===0&&JP(a)&&QP(c)&&(i.content=r.slice(0,-2),i.children.splice(2,1))}return s}function t7(e,t,n,s){const o=e.length;if(n==="$$"&&s==="$$"){let c=t;for(;c<o-1;){if(e[c]==="$"&&e[c+1]==="$"){let u=c-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0)return c}c++}return-1}const i=n[n.length-1],r=s;let l=0,a=t;for(;a<o;){if(e.slice(a,a+r.length)===r){let u=a-1,d=0;for(;u>=0&&e[u]==="\\";)d++,u--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const c=e[a];if(c==="\\"){a+=2;continue}c===i?l++:c===r[r.length-1]&&l>0&&l--,a++}return-1}var n7=t7;const s7=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],Sf=s7.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),o7=/\\[a-z]+/i,_x="(?:\\\\|\\u0008)",i7=new RegExp(String.raw`${_x}(?:${Sf})\s*\{[^}]+\}`,"i"),r7=new RegExp(String.raw`(?:${_x})?(?:${Sf})\s*\{`,"i"),l7=/\\(?:text|frac|left|right|times)/,a7=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,c7=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,u7=/[A-Z]+\s*\([^)]+\)/i,d7=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,f7=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,h7=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,p7={"\b":"\\b","\v":"\\v","\f":"\\f"};function m7(e){let t="";for(const n of e)t+=p7[n]??n;return t}function lc(e){if(!e)return!1;const t=m7(e),n=t.trim();if(h7.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const s=o7.test(t),o=i7.test(t),i=r7.test(t),r=l7.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=a7.test(t)&&!c7.test(t),c=u7.test(t),u=d7.test(n),d=f7.test(t),p=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),m=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return s||o||i||r||l||a||c||u||d||p||m}const wx=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],g7=["cdot","mathbf{","partial","mu_{"],Sx=wx.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Cx="[ \r\b\f\v]",v7=new RegExp(`([^\\\\])(${g7.map(e=>e).join("|")})+`,"g"),y7=/span\{([^}]+)\}/,k7=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,b7=/(^|[^\\])\\\r?\n/g,_7=/(^|[^\\])\\$/g,w7=new RegExp(`(${Cx})|(${Sx})\\b`,"g"),qb=new Map,jb=new Map;function S7(e){if(!e)return w7;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),s=qb.get(n);if(s)return s;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,i=new RegExp(`(${Cx})|(${o})\\b`,"g");return qb.set(n,i),i}function C7(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const s=e?"__default__":n.join(""),o=jb.get(s);if(o)return o;const i=e?[Sf,Sx].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),Sf].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${i})\\s*\\{`,"g");return jb.set(s,r),r}const zb={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function Vb(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Kb(e){const t=/(^|[^\\])(__|\*\*)/g;let n,s=null;for(;(n=t.exec(e))!==null;)s={marker:n[2],index:n.index+(n[1]?.length??0)};return s}function zi(e,t){const n=t?.commands??wx,s=t?.escapeExclamation??!0,o=t?.commands==null,i=S7(o?void 0:n);let r=e.replace(i,(c,u,d,p,m)=>{if(u!==void 0&&zb[u]!==void 0)return`\\${zb[u]}`;if(d&&n.includes(d)){const f=m&&typeof p=="number"?m[p-1]:void 0;return f==="\\"||f&&/\w/.test(f)?c:`\\${d}`}return c});s&&(r=r.replace(/(^|[^\\])!/g,"$1\\!"));let l=r;const a=C7(o,o?void 0:n);return l=l.replace(a,(c,u,d)=>`${u}\\${d}{`),l=l.replace(y7,"span\\{$1\\}").replace(k7,"\\operatorname{span}\\{$1\\}"),l=l.replace(b7,`$1\\\\
128
+ `),l=l.replace(_7,"$1\\\\"),l=l.replace(v7,"$1\\$2"),l}function Gb(e){const t=e.trim();return!(!lc(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function x7(e){const t=[];let n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}const s=n;let o=1;for(;s+o<e.length&&e[s+o]==="`";)o++;let i=s+o,r=-1;for(;i<e.length;){if(e[i]!=="`"){i++;continue}let l=1;for(;i+l<e.length&&e[i+l]==="`";)l++;if(l===o){r=i;break}i+=l}if(r!==-1){t.push([s,r+o]),n=r+o;continue}n=s+o}return t}function Yb(e,t){for(const n of e)if(t>=n[0]&&t<n[1])return n;return null}function T7(e,t=!1){const n=[];let s=0;for(;s<e.length-1;){if(e[s]==="!"&&e[s+1]==="["){const o=s;let i=s+2,r=1;for(;i<e.length&&r>0;){if(e[i]==="\\"&&i+1<e.length){i+=2;continue}e[i]==="["?r++:e[i]==="]"&&r--,i++}if(r===0&&i<e.length&&e[i]==="("){let l=i+1,a=1;for(;l<e.length&&a>0;){if(e[l]==="\\"&&l+1<e.length){l+=2;continue}e[l]==="("?a++:e[l]===")"&&a--,l++}if(a===0){n.push([o,l]),s=l;continue}if(t){n.push([o,e.length]),s=e.length;continue}}}s++}return n}function xx(e,t){let n=t-1,s=0;for(;n>=0&&e[n]==="\\";)s++,n--;return s%2===1}function Dg(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("$",n);if(s===-1)return-1;if(xx(e,s)){n=s+1;continue}return s}return-1}function pm(e,t){let n=t;for(;n<e.length;){const s=Dg(e,n);if(s===-1)return-1;if(s>0&&e[s-1]==="$"||s+1<e.length&&e[s+1]==="$"){n=s+1;continue}return s}return-1}function mm(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function M7(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const s=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(s)?!1:s===""||/^[)\s,.!?;:]/.test(s)}function gm(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function A7(e,t){const n=(i,r)=>{const l=i,a=!!t?.strictDelimiters,c=!l?.env?.__markstreamFinal,u=(_,b)=>{let g=b;for(;g<_.length&&(_[g]===" "||_[g]===" ");)g++;if(g===b||!(_[g]===`
129
+ `||_[g]==="\r"&&_[g+1]===`
130
+ `))return b;const y=_.slice(b,g),k=l.push("text","",0);return k.content=y,g};if(/^\*[^*]+/.test(l.src))return!1;const d=[["$$","$$"],["$","$"],["\\(","\\)"]],p=String(l.pending??""),m=Math.max(0,l.pos-p.length);let f=m,v=m;const w=m;for(const[_,b]of d){const g=l.src,y=x7(g),k=T7(g,c);let $=!1;_==="$$"&&f!==w&&(f=w);let E=-1,S=-1,T=0;const I=L=>{if((L==="undefined"||L==null)&&(L=""),L==="\\"){l.pos=l.pos+L.length,f=l.pos;return}if(L==="\\)"||L==="\\("){const F=l.push("text_special","",0);F.content=L==="\\)"?")":"(",F.markup=L,l.pos=l.pos+L.length,f=l.pos;return}if(!L)return;if(_==="$$"&&L.includes("$")){let F=0;for(;F<L.length;){const P=Dg(L,F);if(P===-1){const $e=L.slice(F);if($e){const me=l.push("text","",0);me.content=$e,l.pos=l.pos+$e.length,f=l.pos}break}if(P>0&&L[P-1]==="$"||P+1<L.length&&L[P+1]==="$"){const $e=L.slice(F,P+1);if($e){const me=l.push("text","",0);me.content=$e,l.pos=l.pos+$e.length,f=l.pos}F=P+1;continue}const q=L.slice(F,P);if(q){const $e=l.push("text","",0);$e.content=q,l.pos=l.pos+q.length,f=l.pos}const K=pm(L,P+1);if(K===-1){const $e=L.slice(P),me=l.push("text","",0);me.content=$e,l.pos=l.pos+$e.length,f=l.pos;break}const G=L.slice(P+1,K),oe=G.includes("`"),J=!G||!G.trim(),he=L[K+1],Ne=mm(G,he),Fe=gm(G);if(!oe&&!J&&!Ne&&!Fe){const $e=l.push("math_inline","math",0);$e.content=zi(G,t),$e.markup="$",$e.raw=`$${G}$`,$e.loading=!1,l.pos=l.pos+(K-P+1),f=l.pos,F=K+1;continue}const We=l.push("text","",0);We.content="$",l.pos=l.pos+1,f=l.pos,F=P+1}return}const R=L.indexOf("![");if(R!==-1){if(R>0){const q=L.slice(0,R),K=l.push("text","",0);K.content=q,l.pos=l.pos+q.length,f=l.pos}const F=L.slice(R).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(F){const[,q,K]=F,G=K.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),oe=G?G[1]:K,J=G&&G[2]?G[2]:null,he=l.push("image","img",0);he.attrs=[["src",oe],["alt",q]],J&&he.attrs.push(["title",J]),he.content=q,he.children=[{type:"text",content:q,tag:""}],l.pos=l.pos+F[0].length,f=l.pos;const Ne=L.slice(R+F[0].length);Ne&&I(Ne);return}const P=l.push("text","",0);P.content=L,l.pos=l.pos+L.length,f=l.pos;return}const O=l.push("text","",0);O.content=L,l.pos=l.pos+L.length,f=l.pos};for(;!(f>=g.length);){const L=g.indexOf(_,f);if(L===-1)break;if(xx(g,L)){f=L+Math.max(1,_.length);continue}const R=Yb(y,L);if(R){f=R[1];continue}const O=Yb(k,L);if(O){f=O[1];continue}if(L===E&&f===S){if(T++,T>2){f=L+Math.max(1,_.length);continue}}else T=0,E=L,S=f;if(_==="("&&L>0){let Ne=L-1;for(;Ne>=0&&g[Ne]===" ";)Ne--;if(Ne>=0&&g[Ne]==="]"){f=L+_.length;continue}}if(_==="$"&&L>0&&g[L-1]==="$"){f=L+1;continue}if(_==="$"&&L<g.length-1&&g[L+1]==="$"){f=L+2;continue}const F=_==="$"?pm(g,L+_.length):n7(g,L+_.length,_,b);if(F===-1){const Ne=g.slice(L+_.length);if(Ne.includes(_)){f=g.indexOf(_,L+_.length);continue}if(F===-1){const Fe=_==="$"&&M7(Ne);if(c&&!a&&!Fe&&lc(Ne)&&!Ne.includes("`")){if(f=L+_.length,$=!0,!r){l.pending="";const We=v?g.slice(v,f):g.slice(0,f),$e=Vb(We)%2===1;if(v)I(g.slice(v,f));else{let me=g.slice(0,f);me.endsWith(_)&&(me=me.slice(0,me.length-_.length)),I(me)}if($e){const me=Kb(We)?.marker??"**",ke=l.push("strong_open","",0);ke.markup=me;const _e=l.push("math_inline","math",0);_e.content=zi(Ne,t),_e.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",_e.raw=`${_}${Ne}${b}`,_e.loading=!0,ke.content=Ne,l.push("strong_close","",0)}else{const me=l.push("math_inline","math",0);me.content=zi(Ne,t),me.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",me.raw=`${_}${Ne}${b}`,me.loading=!0}l.pos=g.length}f=g.length,v=f}break}}const P=g.slice(L+_.length,F),q=P.includes("`"),K=!P||!P.trim(),G=_==="$",oe=g[F+b.length],J=G&&mm(P,oe),he=G&&gm(P);if(a?q||K||J||he:q||K||J||he||!G&&!lc(P)){f=F+b.length;const Ne=g.slice(l.pos,f);l.pending||(I(Ne),v=f);continue}if($=!0,!r){const Ne=g.slice(l.pos-(l.pending??"").length,L);let Fe=g.slice(0,f)?g.slice(v,L):Ne;const We=Vb(Fe)%2===1;L!==l.pos&&We&&(Fe=l.pending+g.slice(l.pos,L));const $e=We?Kb(Fe):null,me=$e?.marker??"**";if(l.pending!==Fe)if(l.pending="",We)if($e){const ke=Fe.slice($e.index+me.length);I(Fe.slice(0,$e.index));const _e=l.push("strong_open","",0);_e.markup=me;const ue=l.push("text","",0);ue.content=ke,l.push("strong_close","",0)}else I(Fe);else I(Fe);if(We){const ke=l.push("strong_open","",0);ke.markup=me;const _e=l.push("math_inline","math",0);_e.content=zi(P,t),_e.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",_e.raw=`${_}${P}${b}`,_e.loading=!1;const ue=g.slice(F+b.length).startsWith(me);return ue&&l.push("strong_close","",0),l.pos=u(g,F+b.length),f=l.pos,v=f,ue||l.push("strong_close","",0),!0}else{const ke=l.push("math_inline","math",0);ke.content=zi(P,t),ke.markup=_==="$$"?"$$":_==="\\("?"\\(\\)":_==="$"?"$":"()",ke.raw=`${_}${P}${b}`,ke.loading=!1}}return f=u(g,F+b.length),v=f,l.pos=f,!0}if($){if(r)l.pos=f;else{if(_==="$$"&&f<g.length&&g.slice(f).includes("$")){let L=f;for(;!(L>=g.length);){const R=Dg(g,L);if(R===-1)break;if(R+1<g.length&&g[R+1]==="$"){L=R+2;continue}if(R>0&&g[R-1]==="$"){L=R+1;continue}const O=pm(g,R+1);if(O===-1)break;const F=g.slice(R+1,O),P=F.includes("`"),q=!F||!F.trim(),K=g[O+1],G=mm(F,K),oe=gm(F);if(!P&&!q&&!G&&!oe){const J=g.slice(f,R);J&&I(J);const he=l.push("math_inline","math",0);he.content=zi(F,t),he.markup="$",he.raw=`$${F}$`,he.loading=!1,f=O+1,L=O+1}else I("$"),L=R+1}L<g.length&&I(g.slice(L))}else f<g.length&&I(g.slice(f));l.pos=g.length}return!0}}return!1},s=(i,r,l,a)=>{const c=i,u=!c?.env?.__markstreamFinal,d=t?.strictDelimiters,p=d?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[r]+c.tShift[r];let f=c.src.slice(m,c.eMarks[r]).trim(),v=!1,w="",_="",b=!1;for(const[P,q]of p)if(f.startsWith(P))if(P.includes("["))if(t?.strictDelimiters){if(f.replace("\\","")==="["){if(r+1<l){v=!0,w=P,_=q;break}continue}}else if(f.replace("\\","")==="["){if(r+1<l){v=!0,w=P,_=q;break}continue}else{const K=c.tokens[c.tokens.length-1];if(K&&K.type==="list_item_open"&&K.mark==="-"&&f.slice(P.length,f.indexOf("]")).trim()==="x")continue;if(f.replace("\\","").startsWith("[")&&!f.includes("](")){const G=f.indexOf("]");if(f.slice(G).trim()!=="]")continue;const oe=f.slice(P.length,G);if(P==="["?Gb(oe):lc(oe)){v=!0,w=P,_=q;break}continue}}else{v=!0,w=P,_=q;break}else if(P==="$$"&&f.endsWith(P)&&!f.slice(0,f.length-P.length).trim().includes(P)&&r+1<l){c.push("text","",0).content=f.slice(0,f.length-P.length);const K=c.bMarks[r+1]+c.tShift[r+1];f=c.src.slice(K,c.eMarks[r+1]).trim(),b=!0,v=!0,w=P,_=q;break}if(!v)return!1;if(a)return!0;const g=f.indexOf(w),y=g+w.length,k=!d&&w==="["?f.indexOf("\\]",y):-1,$=k>=0?"\\]":_,E=k>=0?k:f.indexOf(_,y);if(E>w.length){const P=f.slice(g+w.length,E),q=c.push("math_block","math",0);return q.content=zi(P),q.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",q.map=[r,r+1],q.raw=`${w}${P}${$}`,q.block=!0,q.loading=!1,c.line=r+1,!0}let S=r,T="",I=!1;const L=f===w?"":f.slice(w.length),R=!d&&w==="\\["?"]":"";if(L.includes(_)){const P=L.indexOf(_);T=L.slice(0,P),I=!0,S=r}else for(L&&!b&&(T=L),S=r+1;S<l;S++){const P=c.bMarks[S]+c.tShift[S],q=c.eMarks[S],K=c.src.slice(P,q),G=K.trim();if(!d&&w==="["&&G==="\\]"){_="\\]",I=!0;break}if(R&&K.trim()===R){_=R,I=!0;break}if(G===_){I=!0;break}else if(!d&&w==="["&&K.includes("\\]")){I=!0;const oe=K.indexOf("\\]");_="\\]",T+=(T?`
131
+ `:"")+K.slice(0,oe);break}else if(K.includes(_)){I=!0;const oe=K.indexOf(_);T+=(T?`
132
+ `:"")+K.slice(0,oe);break}T+=(T?`
133
+ `:"")+K}if((!u||d)&&!I)return!1;const O=/^\s*!\[/.test(T);if(!(w==="$$"?!O:w==="["?Gb(T):lc(T)))return!1;const F=c.push("math_block","math",0);return F.content=zi(T),F.markup=w==="$$"?"$$":w==="["?"[]":"\\[\\]",F.raw=`${w}${T}${T.startsWith(`
134
+ `)?`
135
+ `:""}${_}`,F.map=[r,S+1],F.block=!0,F.loading=!I,c.line=S+1,!0},o=(i,r,l,a)=>{const c=i,u=c.bMarks[r]+c.tShift[r],d=c.src.slice(u,c.eMarks[r]).trim();return!d.startsWith("$$")&&!d.startsWith("\\[")?!1:s(i,r,l,a)};e.inline.ruler.before("escape","math",n),e.block.ruler.before("lheading","explicit_math_block",o,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",s,{alt:["paragraph","reference","blockquote","list"]})}function E7(e){const t=e.renderer.rules.image||function(n,s,o,i,r){const l=n,a=r;return a.renderToken?a.renderToken(l,s,o):""};e.renderer.rules.image=(n,s,o,i,r)=>{const l=n;return l[s].attrSet?.("loading","lazy"),t(l,s,o,i,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,s)=>{const o=n[s],i=String(o.info??"").trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:""}"><code>${e.utils.escapeHtml(String(o.content??""))}</code></pre>`})}function I7(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},s=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=new CR({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:s,...n}});return(e.enableMath??!0)&&A7(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&MR(o),e.enableFixIndentedCodeBlock!==!1&&uP(o),HP(o),jP(o),UP(o),GP(o),E7(o),aP(o,{customHtmlTags:e.customHtmlTags}),o}function nl(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>nl(n))),t}function $7(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function N7(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,s=n===""||n==="true";return{type:"checkbox_input",checked:s,raw:s?"[x]":"[ ]"}}function L7(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function ld(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="em_close";){const l=e[i];o+=String(e[i].content??l.text??""),r.push(e[i]),i++}return s.push(...fn(r,void 0,void 0,n)),{node:{type:"emphasis",children:s,raw:`*${o}*`},nextIndex:i<e.length?i+1:e.length}}const Xb=/\r?\n[ \t]*`+\s*$/,Tx=["diff ","index ","--- ","+++ ","@@ "],O7=/\r?\n/;function R7(e){const t=String(e??"");return t?Tx.some(n=>n.startsWith(t)||t.startsWith(n)):!1}function Zb(e,t,n,s){n.length>0&&e.push(...n),s.length>0&&t.push(...s),n.length=0,s.length=0}function P7(e,t){const n=[],s=[],o=[],i=[],r=e.split(O7),l=/\r?\n$/.test(e),a=r.some(m=>m.startsWith("diff ")||m.startsWith("--- ")||m.startsWith("+++ ")||m.startsWith("@@ ")),c=m=>{const f=m;if(!Tx.some(v=>f.startsWith(v)))if(f.startsWith("-")){const v=f.slice(1);o.push(!a&&v.startsWith(" ")?` ${v}`:v)}else if(f.startsWith("+")){const v=f.slice(1);i.push(!a&&v.startsWith(" ")?` ${v}`:v)}else{Zb(n,s,o,i);const v=a&&f.startsWith(" ")?f.slice(1):f;n.push(v),s.push(v)}},u=l?Math.max(0,r.length-1):r.length;for(let m=0;m<u;m++){const f=r[m]??"";!t&&!l&&m===u-1&&R7(f)||c(f)}(t||o.length>0||i.length>0)&&Zb(n,s,o,i);const d=n.join(`
136
+ `),p=s.join(`
137
+ `);return{original:t&&l&&d?`${d}
138
+ `:d,updated:t&&l&&p?`${p}
139
+ `:p}}function mv(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},s=typeof n.closed=="boolean"?n.closed:void 0,o=s===!0||s!==!1&&t,i=String(e.info??""),r=i.startsWith("diff"),l=r?(()=>{const c=i,u=c.indexOf(" ");return u===-1?"":String(c.slice(u+1)??"")})():i;let a=String(e.content??"");if(Xb.test(a)&&(a=a.replace(Xb,"")),r){const{original:c,updated:u}=P7(a,o===!0);return{type:"code_block",language:l,code:String(u??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t,originalCode:c,updatedCode:u}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:s===!0?!1:s===!1?!0:!t}}function D7(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function B7(){return{type:"hardbreak",raw:`\\
140
+ `}}function F7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="mark_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...fn(r,void 0,void 0,n)),{node:{type:"highlight",children:s,raw:`==${o}==`},nextIndex:i<e.length?i+1:e.length}}let vm=null;const ym=new WeakMap;function Qb(){return vm||(vm={customTagSet:null,allowedTagSet:_h()}),vm}function Mx(e){const t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():""}function Ax(e){return/^<\s*\//.test(e)}function Ex(e,t){return/\/\s*>\s*$/.test(t)||cl.has(e)}function H7(e){if(!e||e.length===0)return Qb();const t=ym.get(e);if(t)return t;const n=e.map(Mo).filter(Boolean);if(!n.length){const o=Qb();return ym.set(e,o),o}const s={customTagSet:new Set(n),allowedTagSet:_h({customHtmlTags:e})};return ym.set(e,s),s}function Ix(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function W7(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,s=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof s=="string"?{raw:n,inner:s}:null}function Cf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function U7(e,t,n){const s=e.slice();return Cf(s,"href")||s.push(["href",t]),n!=null&&!Cf(s,"title")&&s.push(["title",n]),s}function Bg(e){return e.map(Ix).join("")}function Ad(e){const t=[],n=s=>{const o=String(s??"");if(!o)return;const i=t[t.length-1];if(i?.type==="text"){i.content=`${i.content}${o}`,i.raw=`${i.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const s of e)if(s){if(s.type==="reference"||s.type==="footnote_reference"){n(String(s.raw??""));continue}if("children"in s&&Array.isArray(s.children)){t.push({...s,children:Ad(s.children)});continue}t.push(s)}return t}function q7(e,t,n){let s=0;for(let o=t;o<e.length;o++){const i=e[o];if(i.type!=="html_inline")continue;const r=String(i.content??""),l=Mx(r),a=Ax(r),c=Ex(l,r);if(!a&&!c&&l===n){s++;continue}if(a&&l===n){if(s===0)return o;s--}}return-1}function km(e,t,n){const s=[e[t]];let o=[],i=t+1,r=!1;const l=n?q7(e,t+1,n):-1;return l!==-1?(o=e.slice(t+1,l),s.push(...o,e[l]),i=l+1,r=!0):(o=e.slice(t+1),o.length&&s.push(...o),i=e.length),{closed:r,html:Bg(s),innerTokens:o,nextIndex:i}}function j7(e,t,n,s,o,i,r){const l=String(e.content??""),a=Mx(l),{customTagSet:c,allowedTagSet:u}=H7(r?.customHtmlTags);if(!a)return[{type:"inline_code",code:l,raw:l},n+1];if(!u.has(a)&&!km(t,n,a).closed){const k=Ix(e);return[{type:"text",content:k,raw:k},n+1]}if(a==="br")return[{type:"hardbreak",raw:l},n+1];const d=Ax(l),p=Ex(a,l);if(d)return[{type:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];if(a==="a"){const k=km(t,n,a),$=kh(l),E=k.innerTokens,S=String(Cf($,"href")??""),T=Cf($,"title"),I=T==null?null:String(T),L=U7($,S,I),R=Ad(E.length?s(E,o,i,r):[]),O=E.length?Bg(E):S||"";return!R.length&&O&&R.push({type:"text",content:O,raw:O}),[{type:"link",href:S,title:I,text:O,attrs:L,children:R,loading:!k.closed,raw:k.html||l},k.nextIndex]}if(p)return[{type:c?.has(a)?a:"html_inline",tag:a,content:l,children:[],raw:l,loading:!1},n+1];const m=km(t,n,a);if(a==="p"||a==="div")return[{type:"paragraph",children:Ad(m.innerTokens.length?s(m.innerTokens,o,i,r):[]),raw:m.html},m.nextIndex];const f=Ad(m.innerTokens.length?s(m.innerTokens,o,i,r):[]);let v=m.html||l,w=!m.closed,_=!1;if(!m.closed){const k=`</${a}>`;v.toLowerCase().includes(k.toLowerCase())||(v+=k),_=!0,w=!0}const b=[],g=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=g.exec(l))!==null;){const k=y[1],$=y[2]||y[3]||y[4]||"";b.push([k,$])}if(c?.has(a)){const k=W7(e);return[{type:a,tag:a,attrs:b,content:k?k.inner:m.innerTokens.length?Bg(m.innerTokens):"",children:m.innerTokens.length?s(m.innerTokens,o,i,r):[],raw:k?.raw??v,loading:e.loading||w,autoClosed:_},m.nextIndex]}return[{type:"html_inline",tag:a,attrs:b,content:v,children:f,raw:v,loading:w,autoClosed:_},m.nextIndex]}function $x(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>$x(t)).join(""):String(e.content??"")}function z7(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>$x(t)).join("")}function Jb(e,t=!1){let n=e.attrs??[],s=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const p=d.attrs;if(Array.isArray(p)&&p.length>0){n=p,s=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),i=n.find(d=>d[0]==="alt")?.[1],r=z7(s??e);let l="";r?l=r:i!=null&&String(i).length>0?l=String(i):s?.content!=null&&String(s.content).length>0?l=String(s.content):Array.isArray(s?.children)&&s.children[0]?.content?l=String(s.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,c=a===null?null:String(a),u=String(e.content??"");return{type:"image",src:o,alt:l,title:c,raw:u,loading:t}}function V7(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function K7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="ins_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...fn(r,void 0,void 0,n)),{node:{type:"insert",children:s,raw:`++${String(o)}++`},nextIndex:i<e.length?i+1:e.length}}function G7(e){const t=[];if(!Array.isArray(e))return t;for(const n of e){const s=n?.[0];s&&t.push([String(s),String(n?.[1]??"")])}return t}function xf(e,t){const n=t.toLowerCase();for(let s=e.length-1;s>=0;s--){const[o,i]=e[s];if(String(o).toLowerCase()===n)return i}}function Y7(e,t,n){const s=e.slice();return xf(s,"href")||s.push(["href",t]),n!=null&&!xf(s,"title")&&s.push(["title",n]),s}function ad(e,t,n){const s=e[t],o=G7(s.attrs),i=String(xf(o,"href")??""),r=xf(o,"title"),l=r==null?null:String(r),a=Y7(o,i,l);let c=t+1;const u=[];let d=!0;for(;c<e.length&&e[c].type!=="link_close";)u.push(e[c]),c++;e[c]?.type==="link_close"&&(d=!1);let p=u;const m=u[u.length-1];if(n?.__insideStrong&&m?.type==="text"&&String(m.content??"").endsWith("**")&&!u.some(w=>w.type==="strong_open")){const w=String(m.content??""),_=String(m.raw??w),b=nl(m);b.content=w.slice(0,-2),b.raw=_.replace(/\*\*$/,""),p=u.slice(),p[p.length-1]=b}const f=fn(p,void 0,void 0,n),v=f.map(w=>{const _=w;return"content"in w?String(_.content??""):String(_.raw??"")}).join("");return{node:{type:"link",href:i,title:l,text:v,children:f,raw:`[${v}](${i}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:c<e.length?c+1:e.length}}function e_(e){const t=e.content??"",n=e.raw==="$$"?`$${t}$`:e.raw||"";return{type:"math_inline",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function X7(e){return{type:"reference",id:String(e.content??""),raw:String(e.markup??`[${e.content??""}]`)}}function t_(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="s_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...fn(r,void 0,void 0,n)),{node:{type:"strikethrough",children:s,raw:`~~${o}~~`},nextIndex:i<e.length?i+1:e.length}}const Z7=/\\([\\()[\]`$|*_\-!])/g;function Q7(e,t){if(!e)return;const n=String(e);if(n&&(n===t||n.replace(Z7,"$1")===t))return n}function Qa(e,t,n,s){const o=[];let i="",r=t+1;const l=[];let a=1;for(;r<e.length;){if(e[r].type==="strong_close"){if(a===1)break;a--}e[r].type==="strong_open"&&a++,i+=String(e[r].content??""),l.push(e[r]),r++}const c={...s,__insideStrong:!0};return o.push(...fn(l,Q7(n,i),void 0,c)),{node:{type:"strong",children:o,raw:`**${String(i)}**`},nextIndex:r<e.length?r+1:e.length}}function J7(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sub_close";)o+=String(e[i].content??""),r.push(e[i]),i++;s.push(...fn(r,void 0,void 0,n));const l=String(e[t].content??""),a=o||l;return{node:{type:"subscript",children:s.length>0?s:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:i<e.length?i+1:e.length}}function e9(e,t,n){const s=[];let o="",i=t+1;const r=[];for(;i<e.length&&e[i].type!=="sup_close";)o+=String(e[i].content??""),r.push(e[i]),i++;return s.push(...fn(r,void 0,void 0,n)),{node:{type:"superscript",children:s.length>0?s:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:i<e.length?i+1:e.length}}function t9(e){const t=String(e.content??"");return{type:"text",content:t,raw:t}}const n9=/[^~]*~{2,}[^~]+/,s9=/\*\*/,o9=/[[_*^~]/,i9=/\\([\\()[\]`$|*_\-!])/g,gv=new Set(["\\","(",")","[","]","`","$","|","*","_","-","!"]),r9=/\s/u,l9=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,a9=/\p{P}/u,c9=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,u9=/:\/\//;function d9(e){let t=0,n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="*"){n+=2;continue}e[n]==="*"&&t++,n++}return t}function Nx(e,t=0){if(!e)return-1;let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&gv.has(i)){if(i==="*"&&n>=t){n++,s++;continue}n++,s++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function pr(e){return!!e&&r9.test(e)}function mr(e){return!!e&&(l9.test(e)||a9.test(e))}function f9(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!s||pr(s)?!1:!(mr(s)&&n&&!pr(n)&&!mr(n))}function h9(e,t){const n=t>0?e[t-1]:void 0,s=e[t+1];return!n||pr(n)?!1:!(mr(n)&&s&&!pr(s)&&!mr(s))}function p9(e,t,n=0){let s=n,o=!1;for(;s<t.length;){const i=e?Nx(e,s):t.indexOf("*",s);if(i===-1)break;if(h9(t,i))return{index:i,sawInvalidClose:o};o=!0,s=i+1}return{index:-1,sawInvalidClose:o}}function m9(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!s||pr(s)?!1:!(mr(s)&&n&&!pr(n)&&!mr(n))}function g9(e,t){const n=t>0?e[t-1]:void 0,s=e[t+2];return!n||pr(n)?!1:!(mr(n)&&s&&!pr(s)&&!mr(s))}function v9(e,t=0){let n=t,s=!1;for(;n<e.length;){const o=e.indexOf("**",n);if(o===-1)break;if(g9(e,o))return{index:o,sawInvalidClose:s};s=!0,n=o+2}return{index:-1,sawInvalidClose:s}}function y9(e){let t="",n=0;for(;n<e.length;){if(e[n]!=="\\"){t+=e[n],n++;continue}let s=0;for(;n+s<e.length&&e[n+s]==="\\";)s++;const o=e[n+s];if(t+="\\".repeat(Math.floor(s/2)),s%2===1){if(o&&gv.has(o)){t+=o,n+=s+1;continue}t+="\\"}n+=s}return t}function k9(e,t){let n=0;for(let s=0;s<e.length;s++){const o=e[s],i=e[s+1];if(o==="\\"&&i&&gv.has(i)){if(n===t)return s+1;n++,s++;continue}if(n===t)return s;n++}return-1}function b9(e,t,n){const s=k9(e,t);if(s===-1||e[s]!==n)return!1;let o=0;for(let i=s-1;i>=0&&e[i]==="\\";i--)o++;return o%2===1}const _9=/[\p{L}\p{N}]/u,w9=/^[\p{L}\p{N}]+$/u;function Fg(e){return e?_9.test(e):!1}function Lx(e){return e?w9.test(e):!1}function _c(e,t){let n=t;for(;n<e.length&&e[n]==="*";)n++;const s=t>0?e[t-1]:void 0,o=n<e.length?e[n]:void 0;return{len:n-t,prev:s,next:o,intraword:Fg(s)&&Fg(o)}}function S9(e){const t=[];for(let n=0;n<e.length;){if(e[n]!=="*"){n++;continue}const s=_c(e,n),o=n+s.len;s.len>=2&&s.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n<t.length-1;n++){const s=t[n],o=t[n+1];if(!Lx(e.slice(s.end,o.start)))return o.end}return-1}function C9(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function x9(e,t){let n=t;for(;n<e.length;){const s=e.indexOf("***",n);if(s===-1)return-1;const o=_c(e,s);if(o.len>=3)return s;n=s+o.len}return-1}function T9(e){return e?c9.test(e)||u9.test(e):!1}function M9(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function fn(e,t,n,s){if(!e||e.length===0)return[];const o=s?.__linkifyDemotionContext,i=uu(t),r={filename:o?.filename||i.filename,explicitFilename:o?.explicitFilename||i.explicitFilename,marketTicker:o?.marketTicker||i.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(s={...s,__linkifyDemotionContext:r});const l=s,a=[];let c=null,u=0;const d=s?.requireClosingStrong,p=e;function m(){return e===p&&(e=e.slice()),e}function f(){c=null}function v(z,X){const fe=e.length===1?t:String(X.content??""),D=[],Z=S9(z);if(Z!==-1){k(z.slice(0,Z),z.slice(0,Z));const se=z.slice(Z);return se&&(I({type:"text",content:se,raw:se}),u--),u++,!0}if(n9.test(z)){const se=z.indexOf("~~");se!==-1&&D.push({type:"strikethrough",index:se})}if(s9.test(z)){const se=z.indexOf("**");se!==-1&&D.push({type:"strong",index:se})}if(/[^*]*\*[^*]+/.test(z)){const se=fe?Nx(fe,0):z.indexOf("*");if(fe&&se===-1)return!1;se!==-1&&D.push({type:"emphasis",index:se})}D.sort((se,ae)=>se.index!==ae.index?se.index-ae.index:se.type===ae.type?0:se.type==="strong"?-1:ae.type==="strong"?1:0);const ne=D[0];if(!ne)return!1;if(ne.type==="strikethrough"){const se=ne.index,ae=se>-1?z.slice(0,se):"";if(ae&&k(ae,ae),se===-1)return u++,!0;const H=z.indexOf("~~",se+2),U=H===-1?z.slice(se+2):z.slice(se+2,H),Q=H===-1?"":z.slice(H+2),{node:ce}=t_([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:U,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,s);return f(),y(ce),Q&&(I({type:"text",content:Q,raw:Q}),u--),u++,!0}if(ne.type==="strong"){const se=ne.index,ae=se>-1?z.slice(0,se):"";if(ae&&k(ae,ae),se===-1)return u++,!0;if(t&&se===0){let xe=!1,ie=0;for(;ie<z.length&&z[ie]==="*";)ie++;if(t.startsWith("\\*")&&(xe=!0),xe){let be=0,ze=0;for(;ze<t.length&&be<ie;)if(t[ze]==="\\"&&ze+1<t.length&&t[ze+1]==="*")be+=1,ze+=2;else{if(t[ze]==="*")break;ze++}if(be>=2)return k(z,z),u++,!0}}if(t&&(z.match(/\*/g)||[]).length>d9(t))return k(z.slice(ae.length),z.slice(ae.length)),u++,!0;const H=_c(z,se);if(H.len>=3){const xe=x9(z,se+H.len);if(xe!==-1){const ie=z.slice(se+H.len,xe);if(C9(ie)){const{node:be}=Qa([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ie,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);f(),y(be);const ze=z.slice(xe+3);return ze&&(I({type:"text",content:ze,raw:ze}),u--),u++,!0}}}if(!m9(z,se)){const xe=z.slice(se,se+H.len);k(xe,xe);const ie=z.slice(se+H.len);return ie&&(I({type:"text",content:ie,raw:ie}),u--),u++,!0}const U=v9(z,se+2);let Q="",ce="";if(U.index!==-1){Q=z.slice(se+2,U.index),ce=z.slice(U.index+2);const xe=U.index,ie=_c(z,xe);if(H.intraword&&ie.intraword&&!Lx(Q)||!Q&&H.len>=4&&H.intraword)return k(z.slice(ae.length),z.slice(ae.length)),u++,!0}else{if(d||U.sawInvalidClose||H.intraword)return k(z.slice(ae.length),z.slice(ae.length)),u++,!0;Q=z.slice(se+2),ce=""}if(!Q&&/^\*+$/.test(ce))return k(z,z),u++,!0;const{node:pe}=Qa([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:Q,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,s);return f(),y(pe),ce&&(I({type:"text",content:ce,raw:ce}),u--),u++,!0}if(ne.type==="emphasis"){let se=ne.index;se===-1&&(se=0);const ae=z.slice(0,se);if(ae&&k(ae,ae),!f9(z,se)){k(z[se],z[se]);const xe=z.slice(se+1);return xe&&(I({type:"text",content:xe,raw:xe}),u--),u++,!0}const H=_c(z,se),U=p9(fe,z,se+1),Q=U.index,ce=e[u+1];if(s?.final&&ce?.type==="em_open"&&Q!==-1&&z.slice(se+1,Q).trim()!==z.slice(se+1,Q)||Q===-1&&(U.sawInvalidClose||s?.final||H.intraword||!Fg(z[se+1])))return k(z.slice(se),z.slice(se)),u++,!0;const{node:pe}=ld([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Q>-1?z.slice(se+1,Q):z.slice(se+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,s);if(f(),y(pe),Q!==-1&&Q<z.length-1){const xe=z.slice(Q+1);xe&&(I({type:"text",content:xe,raw:xe}),u--)}return u++,!0}return!1}function w(z,X){if(!z.includes("`"))return!1;const D=(ce=>{for(let pe=0;pe<ce.length;pe++){if(ce[pe]!=="`")continue;let xe=0;for(let ie=pe-1;ie>=0&&ce[ie]==="\\";ie--)xe++;if(xe%2===0)return pe}return-1})(z);if(D===-1)return!1;let Z=1;for(let ce=D+1;ce<z.length&&z[ce]==="`";ce++)Z++;const ne="`".repeat(Z),se=D+Z,ae=z.indexOf(ne,se);if(ae===-1){if(Z===1){const pe=z.slice(0,D),xe=z.slice(D+1);return pe&&(v(pe,X)?u--:k(pe,pe)),b({type:"inline_code",code:xe,raw:String(xe)}),u++,!0}let ce=z;for(let pe=u+1;pe<e.length;pe++)ce+=String((e[pe].content??"")+(e[pe].markup??""));return u=e.length-1,k(ce,ce),u++,!0}f();const H=z.slice(0,D),U=z.slice(D+Z,ae),Q=z.slice(ae+Z);return H&&(v(H,X)?u--:k(H,H)),b({type:"inline_code",code:U,raw:String(U??"")}),Q&&(I({type:"text",content:Q,raw:Q}),u--),u++,!0}function _(z){const X=l?.__markdownIt;if(!X||e.length<=1||!e.some(ne=>ne?.type==="math_inline")||!o9.test(z))return null;const fe=X.parseInline(z,{__markstreamFinal:!!s?.final});if(!Array.isArray(fe)||fe.length===0)return null;const D=(fe.find(ne=>ne?.type==="inline")?.children??[]).filter(ne=>!(ne?.type==="text"&&String(ne.content??"")===""));if(!D.length||!D.some(ne=>ne?.type!=="text")||D.length===1&&D[0]?.type==="text"&&String(D[0].content??"")===z)return null;const Z=fn(D,z,n,s);return Z.length?Z:null}function b(z){f(),a.push(z)}function g(z){f();const X=nl(z);a.push(X)}function y(z){b(z)}function k(z,X){c?(c.content+=z,c.raw+=X??z):(c={type:"text",content:String(z??""),raw:String(X??z??"")},a.push(c))}function $(z,X){if(!z)return;const fe=fn([{...X,type:"text",content:z,raw:z}],z,n,s);if(fe.length===1&&fe[0]?.type==="text"){const D=fe[0];k(String(D.content??""),String(D.raw??D.content??""));return}for(const D of fe)y(D)}function E(z,X){return String(z.markup??"").startsWith(X)}function S(z){return z.endsWith("](")?e[u+1]?.type==="link_open"&&e[u+1]?.markup==="linkify"&&e[u+2]?.type==="text"&&e[u+3]?.type==="link_close"&&e[u+4]?.type==="text"&&String(e[u+4]?.content??"").startsWith(")"):!1}function T(z,X){let fe=z;const D=String(X.content??"");return fe.endsWith("\\")&&!E(X,"\\\\")&&!D.endsWith("\\\\")&&(fe=fe.slice(0,-1)),fe.endsWith("(")&&!E(X,"\\(")&&!D.endsWith("\\(")&&(fe=fe.slice(0,-1)),/\*+$/.test(fe)&&!E(X,"\\*")&&!D.endsWith("\\*")&&(fe=fe.replace(/\*+$/,"")),fe}for(;u<e.length;){const z=e[u];I(z)}function I(z){switch(z.type){case"text":R(z);break;case"softbreak":c?(c.content+=`
141
+ `,c.raw+=`
142
+ `):(c={type:"text",content:`
143
+ `,raw:`
144
+ `},a.push(c)),u++;break;case"code_inline":y(V7(z)),u++;break;case"html_inline":{const[X,fe]=j7(z,e,u,fn,t,n,s);y(X),u=fe;break}case"link_open":O(z);break;case"image":Fe(z)||(f(),y(Jb(z)),u++);break;case"strong_open":{f();const{node:X,nextIndex:fe}=Qa(e,u,z.content,s);y(X),u=fe;break}case"em_open":{f();const{node:X,nextIndex:fe}=ld(e,u,s);y(X),u=fe;break}case"s_open":{f();const{node:X,nextIndex:fe}=t_(e,u,s);y(X),u=fe;break}case"mark_open":{f();const{node:X,nextIndex:fe}=F7(e,u,s);y(X),u=fe;break}case"ins_open":{f();const{node:X,nextIndex:fe}=K7(e,u,s);y(X),u=fe;break}case"sub_open":{f();const{node:X,nextIndex:fe}=J7(e,u,s);y(X),u=fe;break}case"sup_open":{f();const{node:X,nextIndex:fe}=e9(e,u,s);y(X),u=fe;break}case"sub":f(),y({type:"subscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`~${String(z.content??"")}~`}),u++;break;case"sup":f(),y({type:"superscript",children:[{type:"text",content:String(z.content??""),raw:String(z.content??"")}],raw:`^${String(z.content??"")}^`}),u++;break;case"emoji":{f();const X=e[u-1];X?.type==="text"&&/\|:-+/.test(String(X.content??""))?k("",""):y(L7(z)),u++;break}case"checkbox":f(),y($7(z)),u++;break;case"checkbox_input":f(),y(N7(z)),u++;break;case"footnote_ref":f(),y(D7(z)),u++;break;case"footnote_anchor":{f();const X=z.meta??{};b({type:"footnote_anchor",id:String(X.label??z.content??""),raw:String(z.content??"")}),u++;break}case"hardbreak":f(),y(B7()),u++;break;case"fence":f(),y(mv(e[u])),u++;break;case"math_inline":f(),!z.content&&z.markup==="$"&&e[u+1]?.type==="text"&&e[u+2]?.type==="math_inline"?(y(e_({...z,content:e[u+1].content})),u+=2):y(e_(z)),u++;break;case"reference":P(z);break;case"text_special":k(String(z.content??""),String(z.content??"")),u++;break;default:{const X=z;if(z.type==="link"&&X.href!=null&&s?.validateLink&&!s.validateLink(String(X.href))){f();const fe=String(X.text??"");k(fe,fe),u++}else We(z)||K(z)||oe(z)||q(z)||g(z),u++;break}}}function L(z,X,fe,D){const Z=t9({...X,content:z});if(c){c.content+=T(Z.content,X),c.raw+=Z.raw;return}const ne=fe?.tag==="br"&&e[u-2]?.content==="[";D||(Z.content=T(Z.content,X)),c=Z,c.center=ne,a.push(c)}function R(z){const X=String(z.content??""),fe=e.length===1&&X.includes("\\")&&typeof t=="string"?String(t):"";let D=fe?y9(fe):X.replace(i9,"$1");if(z.content==="<"||D==="1"&&e[u-1]?.tag==="br"){u++;return}const Z=D.indexOf("$");Z!==-1&&Z===D.lastIndexOf("$")&&D.endsWith("$")&&(D=D.slice(0,-1)),D.endsWith("undefined")&&!t?.endsWith("undefined")&&(D=D.slice(0,-9));let ne=a.length,se="";for(let Q=a.length-1;Q>=0;Q--){const ce=a[Q];if(ce.type!=="text")break;ne=Q,se=String(ce.content??"")+se}ne<a.length&&(D.startsWith(se)?(c=null,a.length=ne):c=a[a.length-1]);const ae=e[u+1];if((D==="`"||D==="|"||D==="$")&&!E(z,`\\${D}`)||/^\*+$/.test(D)&&!E(z,"\\*")){u++;return}if(!ae&&/[^\]]\s*\(\s*$/.test(D)&&(D=D.replace(/\(\s*$/,"")),!D){u++;return}if(Ne(D)||$e(D))return;if(!(D.includes("*")||D.includes("_")||D.includes("~")||D.includes("`")||D.includes("[")||D.includes("!")||D.includes("$")||D.includes("|")||D.includes("("))){L(D,z,e[u-1],ae),u++;return}if(ue(D))return;const H=e[u-1];if(D==="["&&!ae?.markup?.includes("*")&&!E(z,"\\[")||D==="]"&&!H?.markup?.includes("*")&&!E(z,"\\]")){u++;return}if(w(X,z)||_e(D)||(e[u+1]?.type!=="link_open"||S(D))&&ke(D,z))return;const U=_(X);if(U){f();for(const Q of U)y(Q);u++;return}v(D,z)||(L(D,z,H,ae),u++)}function O(z){if(F(z))return;if(me()){const{node:ae,nextIndex:H}=ad(e,u,s),U=String(ae.text||ae.href||"");k(U,U),u=H;return}f();const{node:X,nextIndex:fe}=ad(e,u,s);u=fe;const D=X.text||X.href||"";if(z.markup==="linkify"&&!yx(D,X.href,t)&&wf(D,l?.__linkifyDemotionContext)){k(D,D);return}const Z=X.children.length===1&&X.children[0]?.type==="text";if(X.loading&&t&&X.text===X.href&&Z){const ae=M9(t,X.href);ae&&(X.text=ae,X.children=[{type:"text",content:ae,raw:ae}],X.raw=`[${ae}](${X.href}${X.title?` "${X.title}"`:""})`)}if(s?.validateLink&&!s.validateLink(X.href)){k(X.text,X.text);return}const ne=z.attrs?.find(([ae])=>ae==="href")?.[1],se=String(ne??"");if(t&&se){const ae=t.indexOf("](");if(ae!==-1){const H=t.indexOf(")",ae+2);H===-1?X.loading=!0:X.loading&&t.slice(ae+2,H).includes(se)&&(X.loading=!1)}}q(X)||b(X)}function F(z){if(z.markup!=="linkify")return!1;const{node:X,nextIndex:fe}=ad(e,u,s);return G(X,fe)?(u=fe,!0):!1}function P(z){f(),y(X7(z)),u++}function q(z){if(z.type!=="link")return!1;const X=a[a.length-1];if(!X||X.type!=="text")return!1;const fe=String(X.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!fe)return!1;const D=z,Z=String(D.href??""),ne=String(D.text??""),se=String(fe[2]??""),ae=Z.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!Z||!(ne===Z||ne===ae||T9(ne)))return!1;const H=String(fe[1]??"");return H?(X.content=H,X.raw=H):a.pop(),b({...z,text:se,children:[{type:"text",content:se,raw:se}],raw:`[${se}](${Z}${D.title?` "${D.title}"`:""})`}),!0}function K(z){if(z.type!=="link")return!1;const X=z,fe=String(X.href??"");return fe?G({href:fe,title:X.title==null||X.title===""?null:String(X.title),loading:!!X.loading},u+1):!1}function G(z,X){const fe=a[a.length-1];if(fe?.type!=="image"||fe.src||!fe.loading||!String(fe.raw??"").endsWith("]("))return!1;const D=e[X],Z=String(D?.content??"");if(D?.type!=="text"||!Z.startsWith(")"))return!1;a.pop(),c=null;const ne=String(fe.alt??"");b({type:"image",src:z.href,alt:ne,title:z.title,raw:`![${ne}](${z.href}${z.title?` "${z.title}"`:""})`,loading:!!z.loading});const se=Z.slice(1),ae=nl(D);return ae.content=se,ae.raw=se,m()[X]=ae,!0}function oe(z){if(z.type!=="link")return!1;const X=a[a.length-1],fe=e[u-1];if(!X||X.type!=="text"||fe?.type!=="text")return!1;const D=String(X.content??""),Z=String(fe.content??"");if(!D.endsWith("!")||!Z.endsWith("!")||E(fe,"\\!"))return!1;const ne=D.slice(0,-1);ne?(X.content=ne,X.raw=ne,c=X):(a.pop(),c=null);const se=z,ae=String(se.text??se.children?.map(Q=>String(Q?.content??Q?.raw??"")).join("")??""),H=String(se.href??""),U=se.title==null||se.title===""?null:String(se.title);return b({type:"image",src:H,alt:ae,title:U,raw:`![${ae}](${H}${U?` "${U}"`:""})`,loading:!!se.loading}),!0}function J(z,X="",fe=null){const D=String(z.alt??z.raw??"");return{type:"link",href:X,title:fe,text:D,children:[z],raw:`[${D}](${X}${fe?` "${fe}"`:""})`,loading:!0}}function he(z){const X=z.startsWith("![")?z:`![${z}`,fe=X.slice(2),D=fe.indexOf("](");return{type:"image",src:"",alt:D===-1?fe.replace(/\]$/,""):fe.slice(0,D),title:null,raw:X,loading:!0}}function Ne(z){const X=z.indexOf("[![");if(X===-1||typeof t=="string"&&e.length===1&&b9(t,X,"["))return!1;const fe=z.slice(0,X);return fe&&k(fe,fe),b(J(he(z.slice(X+1)))),u++,!0}function Fe(z){if(s?.final)return!1;const X=e[u-1];if(X?.type!=="text"||!String(X.content??"").endsWith("[")||E(X,"\\["))return!1;const fe=a[a.length-1];if(fe?.type==="text"&&fe.content.endsWith("[")){const D=fe.content.slice(0,-1);D?(fe.content=D,fe.raw=D,c=fe):(a.pop(),c=null)}return b(J(Jb(z))),u++,!0}function We(z){if(z.type!=="link")return!1;const X=z,fe=String(X.raw??""),D=String(X.text??"");if(!fe.startsWith("[![")&&!D.startsWith("!["))return!1;const Z=X.title==null||X.title===""?null:String(X.title);return b(J({type:"image",src:String(X.href??""),alt:D.replace(/^!\[/,"").replace(/\]$/,""),title:Z,raw:fe.startsWith("[![")?fe.slice(1):fe,loading:!0})),!0}function $e(z){if(!z.startsWith("]("))return!1;const X=e[u-2];if(X?.type==="text"&&String(X.content??"").endsWith("[")&&E(X,"\\["))return!1;const fe=a[a.length-1];if(fe?.type!=="image"&&fe?.type!=="link")return!1;const D=fe,Z=fe?.type==="link"&&Array.isArray(D.children)&&D.children.length===1&&D.children[0]?.type==="image"?a.pop():null,ne=Z?Z.children[0]:a.pop();if(!ne||ne.type!=="image")return!1;const se=e[u+1];let ae=String(Z?.href??""),H=Z?.title==null?null:String(Z.title),U=!0;if(se?.type==="link_open"){const{node:ce,nextIndex:pe}=ad(e,u+1,s);ae=ce.href,H=ce.title,U=!0,u=pe}else{if(ae=z.slice(2),ae.includes('"')){const ce=ae.split('"');ae=String(ce[0]??"").trim(),H=ce[1]==null?null:String(ce[1]).trim()}u++}const Q=J(ne,ae,H);return Q.loading=U,b(Q),!0}function me(){const z=e[u-3];return e[u-2]?.type==="image"&&e[u-1]?.type==="text"&&String(e[u-1].content??"")==="]("&&z?.type==="text"&&String(z.content??"").endsWith("[")&&E(z,"\\[")}function ke(z,X){const fe=z.indexOf("[");if(fe===-1)return!1;let D=z.slice(0,fe);const Z=z.indexOf("](",fe);if(Z!==-1){const ne=e[u+2];let se=z.slice(fe+1,Z);if(se.includes("[")){const xe=se.indexOf("[");D+=z.slice(0,fe+xe+1);const ie=fe+xe+1;se=z.slice(ie+1,Z)}const ae=e[u+1];if(z.endsWith("](")&&ae?.type==="link_open"&&ne){const xe=e[u+4];let ie=4,be=!0;if(xe?.type==="text"){const Je=String(xe.content??"");if(Je.startsWith(")")){be=!1;const rt=Je.slice(1);if(rt){const Ge=nl(xe);Ge.content=rt,Ge.raw=rt,m()[u+4]=Ge}else ie++}else Je==="."&&ie++}$(D,X);const ze=String(ne.content??"");return s?.validateLink&&!s.validateLink(ze)?k(se,se):b({type:"link",href:ze,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:be}),u+=ie,!0}const H=z.indexOf(")",Z),U=H!==-1?z.slice(Z+2,H):"",Q=H===-1;let ce=D.match(/\*+$/);if(ce&&(D=D.replace(/\*+$/,"")),$(D,X),ce||(ce=se.match(/^\*+/)),!d&&ce){const xe=ce[0].length;se=se.replace(/^\*+/,"").replace(/\*+$/,"");const ie=[];if(xe===1?ie.push({type:"em_open",tag:"em",nesting:1}):xe===2?ie.push({type:"strong_open",tag:"strong",nesting:1}):xe===3&&(ie.push({type:"strong_open",tag:"strong",nesting:1}),ie.push({type:"em_open",tag:"em",nesting:1})),ie.push({type:"link",href:U,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:Q}),xe===1){ie.push({type:"em_close",tag:"em",nesting:-1});const{node:be}=ld(ie,0,s);y(be)}else if(xe===2){ie.push({type:"strong_close",tag:"strong",nesting:-1});const{node:be}=Qa(ie,0,void 0,s);y(be)}else if(xe===3){ie.push({type:"em_close",tag:"em",nesting:-1}),ie.push({type:"strong_close",tag:"strong",nesting:-1});const{node:be}=Qa(ie,0,void 0,s);y(be)}else{const{node:be}=ld(ie,0,s);y(be)}}else s?.validateLink&&!s.validateLink(U)?k(se,se):b({type:"link",href:U,title:null,text:se,children:[{type:"text",content:se,raw:se}],loading:Q});const pe=H!==-1?z.slice(H+1):"";return pe&&(I({type:"text",content:pe,raw:pe}),u--),u++,!0}return!1}function _e(z){const X=z.indexOf("![");if(X===-1)return!1;const fe=z.slice(0,X);return fe&&!c?c={type:"text",content:fe,raw:fe}:fe&&c&&(c.content+=fe),c&&(a.push(c),c=null),b(he(z.slice(X))),u++,!0}function ue(z){if(!(z?.startsWith("[")&&n?.type==="list_item_open"))return!1;const X=z.slice(1).match(/[^\s\]]/);if(X===null)return u++,!0;if(X&&/x/i.test(X[0])){const fe=X[0]==="x"||X[0]==="X";return b({type:"checkbox_input",checked:fe,raw:fe?"[x]":"[ ]"}),u++,!0}return!1}return a}function A9(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??""),r=i.replace(/[ \t\r\n]+$/g,"");if(r===i)break;if(r){o.content=r;break}s.pop();continue}break}}function E9(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const s=e.children;if(!(!Array.isArray(s)||s.length===0))for(;s.length;){const o=s[s.length-1];if(!o){s.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){s.pop();continue}if(o.type==="text"){const i=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(i)){s.pop();continue}const r=i.replace(/[ \t\r\n\d.)]+$/g,"");r!==i&&(r?o.content=r:s.pop())}break}}function I9(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function ka(e,t,n){const s=e[t],o=[],i=_r(n,!0);let r=t+1;for(;r<e.length&&e[r].type!=="bullet_list_close"&&e[r].type!=="ordered_list_close";)if(e[r].type==="list_item_open"){const l=[];let a=r+1;for(;a<e.length&&e[a].type!=="list_item_close";)if(e[a].type==="paragraph_open"){const c=e[a+1],u=I9(c)?nl(c):c,d=e[a-1];u!==c&&(E9(u),A9(u));const p=String(u.content??"");l.push({type:"paragraph",children:fn(u.children||[],p,d,i.options()),raw:p}),i.remember(p),a+=3}else if(e[a].type==="blockquote_open"){const[c,u]=ba(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=ka(e,a,i.options());l.push(c),i.remember(c.raw),a=u}else{const c=yv(e,a,i.options(),vv);c?(l.push(c[0]),i.remember(c[0].raw),a=c[1]):a+=1}o.push({type:"list_item",children:l,raw:l.map(c=>c.raw).join("")}),r=a+1}else r+=1;return[{type:"list",ordered:s.type==="ordered_list_open",start:(()=>{if(s.attrs&&s.attrs.length){const l=s.attrs.find(a=>a[0]==="start");if(l){const a=Number(l[1]);return Number.isFinite(a)&&a!==0?a:1}}})(),items:o,raw:o.map(l=>l.raw).join(`
145
+ `)},r+1]}function $9(e,t,n,s){const o=String(n[1]??"note"),i=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=_r(s,!0);let a=t+1;for(;a<e.length&&e[a].type!=="container_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];if(c){const u={type:"paragraph",children:fn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")};r.push(u),l.remember(u.raw)}a+=3}else if(e[a].type==="bullet_list_open"||e[a].type==="ordered_list_open"){const[c,u]=ka(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else if(e[a].type==="blockquote_open"){const[c,u]=ba(e,a,l.options());r.push(c),l.remember(c.raw),a=u}else{const c=bh(e,a,l.options());c?(r.push(c[0]),l.remember(c[0].raw),a=c[1]):a++}return[{type:"admonition",kind:o,title:i,children:r,raw:`:::${o} ${i}
146
+ ${r.map(c=>c.raw).join(`
147
+ `)}
148
+ :::`},a+1]}const N9=new Set(["warning","info","note","tip","danger","caution"]);function L9(e){let t=0;for(;t<e.length&&t<3&&e[t]===":";)t++;if(t===0||e[t]===":")return null;const n=e.slice(t).trimStart();if(!n)return null;const s=n.search(/\s/),o=(s===-1?n:n.slice(0,s)).toLowerCase();return N9.has(o)?{kind:o,title:s===-1?"":n.slice(s).trim()}:null}function O9(e,t,n){const s=e[t];let o="note",i="";const r=s.type.match(/^container_(\w+)_open$/);if(r){o=r[1];const d=String(s.info??"").trim();if(d&&!d.startsWith(":::")&&d.toLowerCase().startsWith(o)){const p=d.slice(o.length).trim();p&&(i=p)}}else{const d=L9(String(s.info??"").trim());d&&(o=d.kind,i=d.title)}i||(i=o.charAt(0).toUpperCase()+o.slice(1));const l=[],a=_r(n,!0);let c=t+1;const u=new RegExp(`^container_${o}_close$`);for(;c<e.length&&e[c].type!=="container_close"&&!u.test(e[c].type);)if(e[c].type==="paragraph_open"){const d=e[c+1];if(d){const p=d.children||[];let m=-1;for(let v=p.length-1;v>=0;v--){const w=p[v];if(w.type==="text"&&/:+/.test(w.content)){m=v;break}}const f={type:"paragraph",children:fn((m!==-1?p.slice(0,m):p)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[d,p]=ka(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else if(e[c].type==="blockquote_open"){const[d,p]=ba(e,c,a.options());l.push(d),a.remember(d.raw),c=p}else{const d=bh(e,c,a.options());d?(l.push(d[0]),a.remember(d[0].raw),c=d[1]):c++}return[{type:"admonition",kind:o,title:i,children:l,raw:`:::${o} ${i}
149
+ ${l.map(d=>d.raw).join(`
150
+ `)}
151
+ :::`},c+1]}const R9=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function P9(e,t,n){const s=e[t];if(s.type!=="container_open")return null;const o=R9.exec(String(s.info??""));return o?$9(e,t,o,n):null}const vv={parseContainer:(e,t,n)=>O9(e,t,n),matchAdmonition:P9};function ba(e,t,n){const s=[],o=_r(n,!0);let i=t+1;for(;i<e.length&&e[i].type!=="blockquote_close";)switch(e[i].type){case"paragraph_open":{const r=e[i+1],l={type:"paragraph",children:fn(r.children||[],String(r.content??""),void 0,o.options()),raw:String(r.content??"")};s.push(l),o.remember(l.raw),i+=3;break}case"bullet_list_open":case"ordered_list_open":{const[r,l]=ka(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}case"blockquote_open":{const[r,l]=ba(e,i,o.options());s.push(r),o.remember(r.raw),i=l;break}default:{const r=yv(e,i,o.options(),vv);r?(s.push(r[0]),o.remember(r[0].raw),i=r[1]):i++;break}}return[{type:"blockquote",children:s,raw:s.map(r=>r.raw).join(`
152
+ `)},i+1]}function D9(e){if(e.info?.startsWith("diff"))return mv(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let s=t;n?.[1]&&(s=t.replace(/<antArtifact[^>]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:s,raw:s,loading:!o}}function B9(e,t,n){const s=[];let o=t+1,i=[],r=[];const l=_r(n,!0);for(;o<e.length&&e[o].type!=="dl_close";)if(e[o].type==="dt_open"){const a=e[o+1];i=fn(a.children||[],void 0,void 0,l.options()),l.remember(i.map(c=>c.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a<e.length&&e[a].type!=="dd_close";)if(e[a].type==="paragraph_open"){const c=e[a+1];r.push({type:"paragraph",children:fn(c.children||[],String(c.content??""),void 0,l.options()),raw:String(c.content??"")}),l.remember(String(c.content??"")),a+=3}else a++;i.length>0&&(s.push({type:"definition_item",term:i,definition:r,raw:`${i.map(c=>c.raw).join("")}: ${r.map(c=>c.raw).join(`
153
+ `)}`}),i=[]),o=a+1}else o++;return[{type:"definition_list",items:s,raw:s.map(a=>a.raw).join(`
154
+ `)},o+1]}function F9(e,t,n){const s=e[t].meta??{},o=String(s?.label??"0"),i=[],r=_r(n,!0);let l=t+1;for(;l<e.length&&e[l].type!=="footnote_close";)if(e[l].type==="paragraph_open"){const a=e[l+1],c=a.children?[...a.children]:[];e[l+2].type==="footnote_anchor"&&c.push(e[l+2]);const u={type:"paragraph",children:fn(c,String(a.content??""),void 0,r.options()),raw:String(a.content??"")};i.push(u),r.remember(u.raw),l+=3}else l++;return[{type:"footnote",id:o,children:i,raw:`[^${o}]: ${i.map(a=>a.raw).join(`
155
+ `)}`},l+1]}function H9(e,t,n){const s=e[t],o=s.attrs,i=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(u=>Array.isArray(u)&&u.length>=1&&u[0]).map(([u,d])=>[String(u),d==null||d===""?!0:String(d)])):void 0,r=String(s.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],c=String(a.content??"");return{type:"heading",level:l,text:c,...i?{attrs:i}:{},children:fn(a.children||[],c,void 0,n),raw:c}}function W9(e,t,n){const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)return-1;const c=e.slice(a);if(i.test(c)){const u=dn(c);if(u===-1)return-1;if(r===0)return a+u+1;r--,l=a+u+1;continue}if(o.test(c)){const u=dn(c);if(u===-1)return-1;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return-1}function Ox(e){const t=String(e.content??"");if(/^\s*<!--/.test(t)||/^\s*<!/.test(t)||/^\s*<\?/.test(t))return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const n=(t.match(/^\s*<([A-Z][\w:-]*)/i)?.[1]||"").toLowerCase();if(!n)return{type:"html_block",content:t,raw:t,tag:"",loading:!1};const s=dn(t),o=s===-1?t:t.slice(0,s+1),i=s!==-1&&/\/\s*>$/.test(o),r=cl.has(n),l=kh(o),a=(s===-1?-1:W9(t,n,s+1))!==-1,c=!(r||i||a);return{type:"html_block",content:c?`${t.replace(/<[^>]*$/,"")}
156
+ </${n}>`:t,raw:t,tag:n,attrs:l.length?l:void 0,loading:c}}function U9(e){const t=String(e.content??""),n=e.raw==="$$"?`$$${t}$$`:String(e.raw??"");return{type:"math_block",content:t,loading:!!e.loading,raw:n,markup:e.markup}}function q9(e){if(!e)return"left";for(const t of e){if(!t)continue;const[n,s]=t;if(!s)continue;const o=String(s).trim().toLowerCase();if(n==="style"){const i=/text-align\s*:\s*(left|right|center)/i.exec(o);if(i)return i[1].toLowerCase()}}return"left"}function Rx(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function Px(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Rx(n)?n:void 0}function j9(e,t,n){const s=Px(uu(t),n);if(!Rx(s))return e;const o=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:o?.filename||s?.filename,explicitFilename:o?.explicitFilename||s?.explicitFilename,marketTicker:o?.marketTicker||s?.marketTicker}}}function z9(e,t,n){let s=t+1,o=null;const i=[];let r=!1;for(;s<e.length&&e[s].type!=="table_close";)if(e[s].type==="thead_open")r=!0,s++;else if(e[s].type==="thead_close")r=!1,s++;else if(e[s].type==="tbody_open"||e[s].type==="tbody_close")s++;else if(e[s].type==="tr_open"){const a=[];let c=s+1,u;for(;c<e.length&&e[c].type!=="tr_close";)if(e[c].type==="th_open"||e[c].type==="td_open"){const p=e[c].type==="th_open",m=e[c+1],f=String(m.content??""),v=q9(e[c].attrs),w=a.length,_=!p&&!r,b=_?o?.cells[w]?.raw:void 0;a.push({type:"table_cell",header:p||r,children:fn(m.children||[],f,void 0,j9(n,b,_?u:void 0)),raw:f,align:v}),_&&(u=Px(u,uu(f))),c+=3}else c++;const d={type:"table_row",cells:a,raw:a.map(p=>p.raw).join("|")};r?o=d:i.push(d),s=c+1}else s++;o||(o={type:"table_row",cells:[],raw:""});const l=e[t].loading===!0;return[{type:"table",header:o,rows:i,loading:l&&!n?.final&&i.length===0,raw:[o,...i].map(a=>a.raw).join(`
157
+ `)},s+1]}function V9(){return{type:"thematic_break",raw:"---"}}let bm=null;const _m=new WeakMap;function n_(){return bm||(bm={allowedTagSet:_h(),customTagSet:null}),bm}function K9(e){if(!e||e.length===0)return n_();const t=_m.get(e);if(t)return t;const n=e.map(Mo).filter(Boolean);if(!n.length){const o=n_();return _m.set(e,o),o}const s={allowedTagSet:_h({customHtmlTags:e}),customTagSet:new Set(n)};return _m.set(e,s),s}function G9(e,t,n){const s=e[t],o=s.attrs;let i="";const r={};if(o){for(const[m,f]of o)if(m==="class"){const v=f.match(/(?:\s|^)vmr-container-(\S+)/);v&&(i=v[1])}else if(m.startsWith("data-")){const v=m.slice(5);try{r[v]=JSON.parse(f)}catch{r[v]=f}}}const l=[],a=_r(n,!0);let c=t+1;for(;c<e.length&&e[c].type!=="vmr_container_close";)if(e[c].type==="paragraph_open"){const m=e[c+1];if(m){const f={type:"paragraph",children:fn(m.children||[],void 0,void 0,a.options()),raw:String(m.content??"")};l.push(f),a.remember(f.raw)}c+=3}else if(e[c].type==="bullet_list_open"||e[c].type==="ordered_list_open"){const[m,f]=ka(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else if(e[c].type==="blockquote_open"){const[m,f]=ba(e,c,a.options());l.push(m),a.remember(m.raw),c=f}else{const m=bh(e,c,a.options());m?(l.push(m[0]),a.remember(m[0].raw),c=m[1]):c++}const u=c<e.length&&e[c].type==="vmr_container_close",d=u||!!n?.final;let p=`::: ${i}`;return Object.keys(r).length>0&&(p+=` ${JSON.stringify(r)}`),p+=`
158
+ `,l.length>0&&(p+=s.raw??l.map(m=>m.raw).join(`
159
+ `),p+=`
160
+ `),p+=":::",[{type:"vmr_container",name:i,loading:!d,attrs:Object.keys(r).length>0?r:void 0,children:l,raw:p},u?c+1:c]}function Y9(e){return e.replace(/^\r?\n/,"").replace(/\r?\n$/,"")}function X9(e,t){if(!e||!t)return e;const n=new RegExp(String.raw`[\t ]*<\s*\/\s*${t}[^>]*$`,"i");return e.replace(n,"")}function Z9(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${Ys(s)}(?=\s|>|/)`,"i"),i=new RegExp(String.raw`^<\s*\/\s*${Ys(s)}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l<e.length;){const a=e.indexOf("<",l);if(a===-1)break;const c=e.slice(a);if(i.test(c)){const u=dn(c);if(u===-1)return null;if(r===0)return{start:a,end:a+u+1};r--,l=a+u+1;continue}if(o.test(c)){const u=dn(c);if(u===-1)return null;const d=c.slice(0,u+1);/\/\s*>$/.test(d)||r++,l=a+u+1;continue}l=a+1}return null}function Q9(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${s}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n||0);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=e.slice(r),a=dn(l);if(a===-1)return null;const c=r+a;if(/\/\s*>\s*$/.test(l.slice(0,a+1))){const f=c+1;return{raw:e.slice(r,f),end:f}}let u=1,d=c+1;const p=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*${s}(?=\s|>|/)`,"i").test(v)},m=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${s}(?=\s|>)`,"i").test(v)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),end:e.length};if(m(f)){const v=e.indexOf(">",f);if(v===-1)return null;if(u--,u===0){const w=v+1;return{raw:e.slice(r,w),end:w}}d=v+1;continue}if(p(f)){const v=dn(e.slice(f));if(v===-1)return null;u++,d=f+v+1;continue}d=f+1}return{raw:e.slice(r),end:e.length}}function Hg(e){return Number.isFinite(e)&&e>0?e:0}function J9(e,t){const n=Hg(t);if(!e||n<=0)return 0;let s=0;for(let o=0;o<e.length;o++)if(e[o]===`
161
+ `&&(s++,s===n))return o+1;return e.length}function bh(e,t,n){const s=e[t];switch(s.type){case"heading_open":return[H9(e,t,n),t+3];case"code_block":return[D9(s),t+1];case"fence":return[mv(s),t+1];case"math_block":return[U9(s),t+1];case"html_block":{const o=Ox(s),i=o.tag?K9(n?.customHtmlTags):null;if(o.tag&&o.loading&&i&&!i.allowedTagSet.has(o.tag)){const r=String(s.content??"").replace(/\n+$/,"");return[{type:"paragraph",children:r?[{type:"text",content:r,raw:r}]:[],raw:r},t+1]}if(o.tag&&i?.customTagSet?.has(o.tag)){const r=o.tag,l=String(n?.__sourceMarkdown??""),a=Number(n?.__customHtmlBlockCursor??0),c=Array.isArray(s.map)?J9(l,Number(s.map?.[0]??0)):0,u=Q9(l,r,Math.max(Hg(a),Hg(c)));u&&n&&(n.__customHtmlBlockCursor=u.end);const d=String(u?.raw??o.raw??""),p=dn(d),m=p!==-1?d.slice(0,p+1):d,f=p!==-1&&/\/\s*>\s*$/.test(m),v=p===-1?null:Z9(d,r,p+1),w=v?.start??-1;let _="";p!==-1&&(w!==-1&&p<w?_=d.slice(p+1,w):_=d.slice(p+1)),w===-1&&(_=X9(_,r));const b=[],g=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let y;for(;(y=g.exec(m))!==null;){const $=y[1];if(!$||$.toLowerCase()===r)continue;const E=y[2]||y[3]||y[4]||"";b.push([$,E])}const k=!n?.final&&!f&&v==null;return[{type:r,tag:r,content:Y9(_),raw:String(u?.raw??o.raw??d),loading:k,attrs:b.length?b:void 0},t+1]}return[o,t+1]}case"table_open":{const[o,i]=z9(e,t,n);return[o,i]}case"dl_open":{const[o,i]=B9(e,t,n);return[o,i]}case"footnote_open":{const[o,i]=F9(e,t,n);return[o,i]}case"hr":return[V9(),t+1]}return null}function yv(e,t,n,s){const o=bh(e,t,n);if(o)return o;switch(e[t].type){case"container_warning_open":case"container_info_open":case"container_note_open":case"container_tip_open":case"container_danger_open":case"container_caution_open":case"container_error_open":if(s?.parseContainer)return s.parseContainer(e,t,n);break;case"container_open":if(s?.matchAdmonition){const i=s.matchAdmonition(e,t,n);if(i)return i}break;case"vmr_container_open":return G9(e,t,n)}return null}function eD(){return{type:"hardbreak",raw:`\\
162
+ `}}function tD(e,t,n){const s=e[t+1],o=String(s.content??"");return{type:"paragraph",children:fn(s.children||[],o,void 0,n),raw:o}}const s_=new WeakMap;function ha(){return typeof performance<"u"?performance.now():Date.now()}function kv(e,t,n){e&&(e[t]=(e[t]??0)+n)}function Dx(e){return e.__timing}function wm(e,t,n){return t&&kv(t,"parseMarkdownToStructureTotalMs",ha()-n),e}function o_(e,t,n){if(!n)return d_(e,t);const s=ha(),o=d_(e,t);return kv(n,"processTokensMs",ha()-s),o}function nD(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;const n=ya(t);return n.length?new Set(n):null}function sD(e,t){const n=e;let s=s_.get(n);s||(s=new Map,s_.set(n,s));const o=t.__markstreamFinal===!0?"final":"streaming";let i=s.get(o);i||(i={},s.set(o,i));for(const r of Object.keys(i))Object.prototype.hasOwnProperty.call(t,r)||delete i[r];return Object.assign(i,t),i}function oD(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function cd(e,t,n){for(const s of Reflect.ownKeys(e)){const o=Object.getOwnPropertyDescriptor(e,s);if(!o||!("value"in o))continue;const i=Object.getOwnPropertyDescriptor(t,s);i&&(!("value"in i)||i.writable===!1)||(t[s]=Kr(o.value,n))}}function Kr(e,t=new WeakMap){if(!e||typeof e!="object")return e;const n=e,s=t.get(n);if(s)return s;if(Array.isArray(e)){const r=[];t.set(n,r);for(const l of e)r.push(Kr(l,t));return r}if(e instanceof Map){const r=new Map;t.set(n,r);for(const[l,a]of e)r.set(Kr(l,t),Kr(a,t));return r}if(e instanceof Set){const r=new Set;t.set(n,r);for(const l of e)r.add(Kr(l,t));return r}if(e instanceof Date){const r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){const r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<"u"&&e instanceof URL){const r=new URL(e.href);return t.set(n,r),cd(n,r,t),r}if(typeof URLSearchParams<"u"&&e instanceof URLSearchParams){const r=new URLSearchParams(e.toString());return t.set(n,r),cd(n,r,t),r}if(e instanceof Error){let r;const l=e.constructor;try{r=new l(e.message)}catch{r=new Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),cd(n,r,t),r}if(typeof Promise<"u"&&e instanceof Promise||typeof Node<"u"&&e instanceof Node)return t.set(n,e),e;if(!oD(e)){const r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),cd(n,r,t),r}const o={};t.set(n,o);const i=e;for(const r of Object.keys(i))o[r]=Kr(i[r],t);return o}function Bx(e,t=!0){if(!t)return nl(e);const n=Object.create(Object.getPrototypeOf(e)),s=new WeakMap;for(const o of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,o);if(!i)continue;if(!("value"in i)){Object.defineProperty(n,o,i);continue}const r=i.value;let l=r;o==="attrs"&&Array.isArray(r)?l=r.map(a=>[...a]):o==="map"&&Array.isArray(r)?l=[...r]:o==="children"&&Array.isArray(r)?l=r.map(a=>Bx(a,t)):t&&r&&typeof r=="object"&&(l=Kr(r,s)),Object.defineProperty(n,o,{...i,value:l})}return n}function i_(e,t=!0){return e.map(n=>Bx(n,t))}function Fx(e,t){const n=t,s=e.stream,o=t.streamParse??"auto";return n.__disableStreamParse!==!0&&(o===!0||o==="auto"&&t.final!==!0)&&s?.enabled===!0&&typeof s.parse=="function"}function iD(e,t){const n=t,s=t.streamParse??"auto",o=e.stream;return t.final===!0&&s==="auto"&&n.__disableStreamParse!==!0&&o?.enabled===!0&&typeof o.reset=="function"}function rD(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function r_(e,t,n,s){if(s.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=s.customHtmlTags),!Fx(e,s))return e.parse(t,n);const o=e.stream.parse(t,sD(e,n));if(!rD(s))return o;const i=Dx(s);if(!i)return i_(o,!0);const r=ha(),l=i_(o,!0);return kv(i,"tokenCloneMs",ha()-r),l}function _h(e){const t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return Kc;const n=new Set(Kc);for(const s of ya(t))s&&n.add(s);return n}function lD(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:e.type==="hardbreak"?"<br>":""}function l_(e){return{type:"paragraph",children:e,raw:e.map(lD).join("")}}function a_(e,t){if(e.type!=="paragraph")return null;const n=e.children,s=Array.isArray(n)?n:[];if(s.length===0)return null;const o=nD(t);if(!o?.size)return null;let i=-1;for(let u=0;u<s.length;u++){const d=s[u];if(!o.has(String(d?.type??"").toLowerCase()))continue;const p=s.slice(0,u);if(String(d.content??"").trim()&&p.some(m=>m?.type==="hardbreak")){i=u;break}}if(i===-1)return null;const r=s.slice(0,i),l=s[i];if(!l)return null;const a=[];r.length&&a.push(l_(r)),a.push(l);const c=s.slice(i+1);return c.length&&a.push(l_(c)),a}function aD(e){const t=e.trim();if(!t)return null;const n=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i.test(t),s=/<\/html>\s*$/i.test(t);return!n||!s?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function wc(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function cD(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Ys(t)}\s*>\s*$`,"i").test(n)}function bv(e,t,n){if(!e||!t)return null;const s=t.toLowerCase(),o=new RegExp(String.raw`<\s*${Ys(s)}(?=\s|>|/)`,"gi");o.lastIndex=Math.max(0,n);const i=o.exec(e);if(!i||i.index==null)return null;const r=i.index,l=dn(e.slice(r));if(l===-1)return null;const a=r+l,c=e.slice(r,a+1);if(cl.has(s)||/\/\s*>$/.test(c))return{raw:c,start:r,end:a+1,closed:!0};let u=1,d=a+1;const p=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*${Ys(s)}(?=\s|>|/)`,"i").test(v)},m=f=>{const v=e.slice(f);return new RegExp(String.raw`^<\s*\/\s*${Ys(s)}(?=\s|>)`,"i").test(v)};for(;d<e.length;){const f=e.indexOf("<",d);if(f===-1)return{raw:e.slice(r),start:r,end:e.length,closed:!1};if(m(f)){const v=dn(e.slice(f));if(v===-1)return null;u--;const w=f+v+1;if(u===0)return{raw:e.slice(r,w),start:r,end:w,closed:!0};d=w;continue}if(p(f)){const v=dn(e.slice(f));if(v===-1)return null;const w=e.slice(f,f+v+1);/\/\s*>$/.test(w)||u++,d=f+v+1;continue}d=f+1}return{raw:e.slice(r),start:r,end:e.length,closed:!1}}function uD(e,t){if(!t)return 0;let n=0,s=0;for(;n<e.length&&s<t.length;){if(e[n]===t[s]){n++,s++;continue}if(e[n]==="\r"||e[n]===`
163
+ `){n++;continue}return-1}return s===t.length?n:-1}function dD(e,t,n){return n?e:`${e.replace(/<[^>]*$/,"")}
164
+ </${t}>`}function c_(e){return e.replace(/\r\n/g,`
165
+ `).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function fD(e,t,n){return n?e.includes(n,t)?!0:c_(e.slice(Math.max(0,t))).includes(c_(n)):!1}function hD(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===" "||e[n]===" ");)n++;return e[n]==="\r"?(n++,e[n]===`
166
+ `&&n++,n):e[n]===`
167
+ `?n+1:t}function u_(e){if(e.type!=="html_block"||String(e.tag??"").toLowerCase()!=="details")return!1;const t=String(e.raw??e.content??"");return/^\s*<details\b/i.test(t)}function pD(e){if(e.type!=="html_block")return!1;const t=String(e.raw??e.content??"");return/^\s*<\/details\b/i.test(t)}function _v(e,t){const n=new RegExp(String.raw`<\s*\/\s*${Ys(t)}(?=\s|>)`,"gi");let s=-1,o;for(;(o=n.exec(e))!==null;)s=o.index;return s}function Hx(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const mD=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),gD=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function vD(e){return/\n\s*\n/.test(e)||gD.test(e)}function yD(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(s=>mD.has(String(s?.type??"").toLowerCase()))||t.some(s=>{if(s?.type!=="html_block")return!1;const o=s;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!vD(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function kD(e,t,n,s){return e.map(o=>{if(o?.type!=="html_block")return o;const i=o,r=String(i.tag??"").toLowerCase();if(!r||r==="details"||lx.has(r)||Array.isArray(i.children))return o;const l=String(o.raw??i.content??"");if(!l)return o;const a=dn(l);if(a===-1)return o;const c=_v(l,r),u=c!==-1&&c>=a+1?l.slice(a+1,c):l.slice(a+1);if(!u.trim())return o;const d=Sc(u,t,Hx(n,s));return yD(u,d)?{...o,children:d}:o})}function Sc(e,t,n){return e.trim()?Ux(e,t,{...n,__disableStreamParse:!0}):[]}function bD(e,t,n){const s=Sc(e,t,n),o=s[0];return s.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:s}function _D(e,t,n){const s=Ox({content:e}),o=dn(e),i=_v(e,"summary");if(o!==-1&&i!==-1&&i>=o+1){const r=bD(e.slice(o+1,i),t,n);r.length>0&&(s.children=r)}return s.raw=e,s}function wD(e,t,n){const s=dn(e);if(s===-1)return[];const o=e.slice(s+1);if(!o.trim())return[];const i=bv(o,"summary",0);if(!i)return Sc(o,t,n);const r=o.slice(0,i.start),l=o.slice(i.end);return[...Sc(r,t,n),_D(i.raw,t,n),...Sc(l,t,n)]}function Wx(e,t,n,s,o,i=0){const r=[];let l=i;for(let a=0;a<e.length;a++){const c=e[a],u=wc(c);let d=-1;if(u&&(d=t.indexOf(u,l),d!==-1&&(l=d+u.length)),!u_(c)){r.push(c);continue}const p=String(c.raw??wc(c)??""),m=d!==-1?d:t.indexOf(p,Math.max(0,l-p.length));if(m===-1){r.push(c);continue}let f=1,v=-1;for(let oe=a+1;oe<e.length;oe++){const J=e[oe];if(u_(J)){f++;continue}if(pD(J)&&(f--,f===0)){v=oe;break}}const w=bv(t,"details",m),_=v===-1&&w?.closed===!0,b=_?(()=>{const oe=_v(p,"details");return oe!==-1?p.slice(0,oe):p})():p,[g]=Wx(_?[]:v===-1?e.slice(a+1):e.slice(a+1,v),t,n,s,o,m+p.length),y=wD(b,n,Hx(s,o)),k=v===-1?"</details>":String(e[v].raw??wc(e[v])??"</details>"),$=_||v!==-1&&w?.closed===!0,E=k.replace(/[\t\r\n ]+$/,""),S=$?(()=>{const oe=(w?.raw??"").lastIndexOf(E);return oe===-1?t.length:m+oe})():t.length,T=dn(p),I=_&&T!==-1?m+T+1:m+p.length,L=t.slice(I,S===-1?t.length:S),R=n.parse(L,{__markstreamFinal:o}),O=n.renderer.render(R,n.options,{__markstreamFinal:o}),F=S+E.length,P=$?Math.max(S+k.length,hD(t,F)):t.length,q=$?t.slice(S,P):k,K=$?t.slice(m,P):t.slice(m),G=_&&T!==-1?p.slice(0,T+1):p;if(r.push({...c,tag:"details",attrs:kh(p.slice(0,T+1)),raw:K,content:`${G}${O}${q}`,children:[...y,...g],loading:!o&&!$}),l=$?P:t.length,v===-1&&!_)break;v!==-1&&(a=v)}return[r,l]}function SD(e,t,n){if(!n)return e;const s=e.slice();let o=0;for(let i=0;i<s.length;i++){const r=s[i],l=wc(r),a=l?n.indexOf(l,o):-1;if(r?.type!=="html_block"){a!==-1&&(o=a+l.length);continue}const c=String(r.tag??"").toLowerCase();if(!c)continue;if(c==="details"){a!==-1&&(o=a+l.length);continue}const u=bv(n,c,a!==-1?a:o);if(!u)continue;o=u.end;const d=String(r.content??l),p=String(r.raw??d),m=dD(u.raw,c,u.closed),f=!t&&!u.closed,v=d!==m||p!==u.raw||!!r.loading!==f,w=dn(u.raw),_=w===-1?"":u.raw.slice(0,w+1),b=_?kh(_):[];if(r.content=m,r.raw=u.raw,r.loading=f,r.attrs=b.length?b:void 0,!v)continue;let g=uD(u.raw,p);g===-1&&(g=0);const y=i+1;for(;y<s.length;){if(u.closed&&cD(s[y],c)){s.splice(y,1);continue}const k=wc(s[y]);if(!k)break;const $=u.raw.indexOf(k,g);if($===-1){if(fD(n,u.end,k))break;s.splice(y,1);continue}g=$+k.length,s.splice(y,1)}}return s}function CD(e){const t=l=>l===" "||l===" "||l===`
168
+ `||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a<l.length&&t(l[a])||l[a]==="/"&&(a++,a<l.length&&t(l[a])))return!1;const c=v=>{const w=v.charCodeAt(0);return w>=65&&w<=90||w>=97&&w<=122},u=v=>{const w=v.charCodeAt(0);return w>=48&&w<=57},d=v=>v==="!"||c(v),p=v=>c(v)||u(v)||v===":"||v==="-",m=v=>c(v)||u(v)||v==="_"||v==="."||v===":"||v==="-",f=m;if(a>=l.length||!d(l[a]))return!1;for(a++;a<l.length&&p(l[a]);)a++;for(;a<l.length;){for(;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;if(l[a]==="/"){for(a++;a<l.length&&t(l[a]);)a++;return a>=l.length}if(!m(l[a]))return!1;for(a++;a<l.length&&f(l[a]);)a++;for(;a<l.length&&t(l[a]);)a++;if(a<l.length&&l[a]==="="){for(a++;a<l.length&&t(l[a]);)a++;if(a>=l.length)return!0;const v=l[a];if(v==='"'||v==="'"){for(a++;a<l.length&&l[a]!==v;)a++;if(a>=l.length)return!0;a++}else{for(;a<l.length;){const w=l[a];if(t(w)||w==="<"||w===">"||w==='"'||w==="'"||w==="`")break;a++}if(a>=l.length)return!0}}}return!0},s=(l,a)=>{let c=!1,u="",d=0;const p=b=>b===" "||b===" ",m=b=>{let g=0;for(;g<b.length&&p(b[g]);)g++;const y=b[g];if(y!=="`"&&y!=="~")return null;let k=g;for(;k<b.length&&b[k]===y;)k++;const $=k-g;return $<3?null:{markerChar:y,markerLen:$,rest:b.slice(k)}},f=b=>{let g=0;for(;g<b.length&&p(b[g]);)g++;let y=!1;for(;g<b.length&&b[g]===">";)for(y=!0,g++;g<b.length&&p(b[g]);)g++;return y?b.slice(g):null},v=b=>{const g=m(b);if(g)return g;const y=f(b);return y==null?null:m(y)};let w=0;const _=l.split(/\r?\n/);for(const b of _){const g=w,y=w+b.length;if(a<g)break;const k=v(b);if(k){const $=k.markerChar,E=k.markerLen;c?$===u&&E>=d&&/^\s*$/.test(k.rest)&&(c=!1,u="",d=0):(c=!0,u=$,d=E)}if(a<=y)break;w=y+1}return c},o=String(e??""),i=o.lastIndexOf("<");if(i===-1||s(o,i))return o;if(i>0){const l=o[i-1],a=l===" "||l===" "||l===`
169
+ `||l==="\r",c=o[i-2];if(!a&&!((l==="n"||l==="r")&&c==="\\"))return o}const r=o.slice(i);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===`
170
+ `||r[1]==="\r")||!n(r)?o:o.slice(0,i)}function xD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const s=f=>f===" "||f===" ",o=f=>{const v=f.charCodeAt(0);return v>=65&&v<=90||v>=97&&v<=122||v>=48&&v<=57||f==="_"||f==="-"||f===":"},i=f=>{if(!f)return!1;if(f[0]===" ")return!0;let v=0;for(let w=0;w<f.length;w++){const _=f[w];if(_===" "){if(v++,v>=4)return!0;continue}if(_===" ")return!0;break}return!1},r=f=>{let v=!1,w=!1;for(let _=0;_<f.length;_++){const b=f[_];if(b==="\\"){_++;continue}if(!w&&b==="'"){v=!v;continue}if(!v&&b==='"'){w=!w;continue}if(!v&&!w&&b===">")return _}return-1},l=f=>{let v=0;for(;v<f.length&&s(f[v]);)v++;const w=f[v];if(w!=="`"&&w!=="~")return null;let _=v;for(;_<f.length&&f[_]===w;)_++;const b=_-v;return b<3?null:{markerChar:w,markerLen:b,rest:f.slice(_)}},a=(f,v)=>{if(i(f))return-1;const w=f.replace(/^[ \t]+/,"");if(!w||w.startsWith(">")||w.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(w))return-1;let _=!1,b=0;for(;b<f.length;){const g=f[b];if(g!=="<"){s(g)||(_=!0),b++;continue}const y=r(f.slice(b));if(y===-1){_=!0,b++;continue}const k=f.slice(b,b+y+1);let $=1;for(;$<k.length&&s(k[$]);)$++;if($>=k.length){_=!0,b++;continue}const E=k[$];if(E==="!"||E==="?"){_=!0,b+=y+1;continue}if(E==="/"){_=!0,b+=y+1;continue}const S=$;for(;$<k.length&&o(k[$]);)$++;if($===S){_=!0,b++;continue}const T=k.slice(S,$).toLowerCase(),I=k[$];if(I&&I!==" "&&I!==" "&&I!==">"&&I!=="/"){_=!0,b++;continue}const L=new RegExp(String.raw`<\s*\/\s*${T}\s*>`,"i"),R=/\/\s*>$/.test(k),O=L.test(f.slice(b+y+1)),F=L.test(e.slice(v+b+y+1)),P=/[\r\n]/.test(e.slice(v+b+y+1));if(_&&n.has(T)&&!R&&!O&&(F||P))return b;_=!0,b+=y+1}return-1};let c=!1,u="",d=0,p="",m=0;for(;m<e.length;){const f=e.indexOf(`
171
+ `,m),v=f!==-1,w=v&&f>m&&e[f-1]==="\r",_=v?w?f-1:f:e.length,b=e.slice(m,_),g=v?w?`\r
172
+ `:`
173
+ `:"",y=l(b);let k=b;if(!c&&!y){const $=a(b,m);if($!==-1){const E=g||`
174
+ `;k=`${b.slice(0,$).replace(/[ \t]+$/,"")}${E}${E}${b.slice($).replace(/^[ \t]+/,"")}`}}p+=k,p+=g,y&&(c?y.markerChar===u&&y.markerLen>=d&&/^\s*$/.test(y.rest)&&(c=!1,u="",d=0):(c=!0,u=y.markerChar,d=y.markerLen)),m=v?f+1:e.length}return p}function TD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const s=d=>d===" "||d===" ",o=d=>{const p=d.charCodeAt(0);return p>=65&&p<=90||p>=97&&p<=122||p>=48&&p<=57||d==="_"||d==="-"},i=d=>{let p=0;for(;p<d.length&&s(d[p]);)p++;return d.slice(p)},r=d=>{let p=!1,m=!1;for(let f=0;f<d.length;f++){const v=d[f];if(v==="\\"){f++;continue}if(!m&&v==="'"){p=!p;continue}if(!p&&v==='"'){m=!m;continue}if(!p&&!m&&v===">")return f}return-1},l=(d,p,m)=>{const f=m.toLowerCase();let v=d.indexOf("<",p);for(;v!==-1;){let w=v+1;for(;w<d.length&&s(d[w]);)w++;if(w>=d.length||d[w]!=="/"){v=d.indexOf("<",v+1);continue}for(w++;w<d.length&&s(d[w]);)w++;if(w+f.length>d.length){v=d.indexOf("<",v+1);continue}let _=!0;for(let g=0;g<f.length;g++){const y=d[w+g];if((y>="A"&&y<="Z"?String.fromCharCode(y.charCodeAt(0)+32):y)!==f[g]){_=!1;break}}if(!_){v=d.indexOf("<",v+1);continue}let b=w+f.length;if(b<d.length&&o(d[b])){v=d.indexOf("<",v+1);continue}for(;b<d.length&&s(d[b]);)b++;if(b<d.length&&d[b]===">")return!0;v=d.indexOf("<",v+1)}return!1},a=d=>{let p=0;for(;p<d.length&&s(d[p]);)p++;if(p>=d.length||d[p]!=="<")return d;for(p++;p<d.length&&s(d[p]);)p++;if(p>=d.length||d[p]==="/")return d;const m=p;for(;p<d.length&&o(d[p]);)p++;if(p===m)return d;const f=d.slice(m,p).toLowerCase();if(!n.has(f))return d;const v=r(d.slice(p));if(v===-1)return d;const w=p+v;if(l(d,w+1,f))return d;const _=i(d.slice(w+1));return _?`${d.slice(0,w+1)}
175
+ ${_}`:d};let c="",u=0;for(;u<e.length;){const d=e.indexOf(`
176
+ `,u);if(d===-1){c+=a(e.slice(u));break}const p=d>u&&e[d-1]==="\r",m=p?d-1:d,f=e.slice(u,m);c+=a(f),c+=p?`\r
177
+ `:`
178
+ `,u=d+1}return c}function MD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(p=>String(p??"").toLowerCase()));if(!n.size)return e;const s=p=>p===" "||p===" ",o=p=>{let m=0,f=!1,v=0;for(;m<p.length;){for(;m<p.length&&s(p[m]);)m++;if(m>=p.length||p[m]!==">")break;for(f=!0,m++;m<p.length&&s(p[m]);)m++;v=m}return f?{prefix:p.slice(0,v),content:p.slice(v)}:null},i=p=>{let m=0;for(;m<p.length&&s(p[m]);)m++;const f=p[m];if(f!=="`"&&f!=="~")return null;let v=m;for(;v<p.length&&p[v]===f;)v++;const w=v-m;return w<3?null:{markerChar:f,markerLen:w,rest:p.slice(v)}},r=Array.from(n).map(p=>new RegExp(String.raw`(<\s*\/\s*${p}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",c=0,u="",d=0;for(;d<e.length;){const p=e.indexOf(`
179
+ `,d),m=p!==-1,f=m&&p>d&&e[p-1]==="\r",v=m?f?p-1:p:e.length,w=e.slice(d,v),_=m?f?`\r
180
+ `:`
181
+ `:"",b=o(w),g=b?.prefix??"",y=b?.content??w,k=i(y);k&&(l?k.markerChar===a&&k.markerLen>=c&&/^\s*$/.test(k.rest)&&(l=!1,a="",c=0):(l=!0,a=k.markerChar,c=k.markerLen));let $=y;if(!l&&$.includes("</"))for(const E of r)$=$.replace(E,(S,T,I,L)=>{if(L.replace(/^[\t ]+/,"").startsWith("|"))return S;const R=L.slice(0,I).replace(/^[\t ]+/,"");if(R.length>0){const O=T.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",F=R.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!F||O!==F)return S}return`${T}
182
+
183
+ `});if(g){const E=g+$.split(`
184
+ `).join(`
185
+ ${g}`);u+=E}else u+=$;u+=_,d=m?p+1:e.length}return u}function AD(e,t){if(!e||!t.length)return e;const n=new Set(t.map(R=>String(R??"").toLowerCase()));if(!n.size)return e;const s=R=>R===" "||R===" ",o=R=>{if(!R)return!1;if(R[0]===" ")return!0;let O=0;for(let F=0;F<R.length;F++){const P=R[F];if(P===" "){if(O++,O>=4)return!0;continue}if(P===" ")return!0;break}return!1},i=R=>{const O=R.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||R==="_"||R==="-"||R===":"},r=R=>{let O=0;for(;O<R.length&&s(R[O]);)O++;return R.slice(O)},l=R=>{let O=0,F=!1,P=0;for(;O<R.length;){for(;O<R.length&&s(R[O]);)O++;if(O>=R.length||R[O]!==">")break;for(F=!0,O++;O<R.length&&s(R[O]);)O++;P=O}if(!F)return null;const q=R.slice(0,P);return{prefix:q,key:q.replace(/[ \t]+$/,""),content:R.slice(P)}},a=R=>r(R).startsWith("<"),c=R=>{for(let O=0;O<R.length;O++){const F=R[O];if(F!==" "&&F!==" ")return!1}return!0},u=R=>{if(o(R))return"";const O=r(R);if(!O.startsWith("<"))return"";let F=1;for(;F<O.length&&s(O[F]);)F++;if(F>=O.length||O[F]==="/"||O[F]==="!"||O[F]==="?")return"";const P=F;for(;F<O.length&&i(O[F]);)F++;if(F===P)return"";const q=O.slice(P,F).toLowerCase();if(!n.has(q))return"";const K=O[F];return K&&K!==" "&&K!==" "&&K!==">"&&K!=="/"?"":q},d=R=>{if(o(R))return null;const O=r(R);if(!O.startsWith("<"))return null;let F=1;for(;F<O.length&&s(O[F]);)F++;if(F>=O.length)return null;const P=O[F]==="/";if(P)for(F++;F<O.length&&s(O[F]);)F++;const q=O[F];if(!q||q==="!"||q==="?")return null;const K=F;for(;F<O.length&&i(O[F]);)F++;if(F===K)return null;const G=O.slice(K,F).toLowerCase();if(!n.has(G))return null;const oe=O[F];if(oe&&oe!==" "&&oe!==" "&&oe!==">"&&oe!=="/")return null;if(P)return{type:"close",name:G};if(/\/\s*>\s*$/.test(O))return{type:"open",name:G,complete:!0};const J=O.indexOf(">",F);if(J!==-1){const he=O.slice(J+1);if(new RegExp(`<\\s*\\/\\s*${G}\\s*>`,"i").test(he))return{type:"open",name:G,complete:!0}}return{type:"open",name:G,complete:!1}},p=R=>{if(o(R))return null;const O=r(R).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const F=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(F?.[1])return F[1].toLowerCase();const P=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!P?.[1]||!P[2])return null;const q=P[1].toLowerCase();return q===P[2].toLowerCase()?q:null};let m=!1,f="",v=0;const w=R=>{let O=0;for(;O<R.length&&s(R[O]);)O++;const F=R[O];if(F!=="`"&&F!=="~")return null;let P=O;for(;P<R.length&&R[P]===F;)P++;const q=P-O;return q<3?null:{markerChar:F,markerLen:q,rest:R.slice(P)}},_=R=>w(R),b=R=>{const O=r(R);return O?o(R)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},g=(R,O,F)=>{let P=R,q=0;for(;P<e.length;){const K=e.indexOf(`
186
+ `,P),G=K!==-1,oe=G&&K>P&&e[K-1]==="\r",J=G?oe?K-1:K:e.length,he=e.slice(P,J),Ne=l(he),Fe=Ne?.key??"";if(q>0&&O&&Fe!==O)break;const We=Ne?.content??he,$e=d(We);if($e?.name===F){if($e.type==="open")$e.complete||q++;else if(q>0&&(q--,q===0))return!1}else if(q>0&&(c(We)||b(We)))return!0;if(G)P=K+1;else break}return!1};let y="",k=0,$=!0,E=!1,S=!1,T=`
187
+ `;const I=[];let L="";for(;k<e.length;){const R=e.indexOf(`
188
+ `,k),O=R!==-1,F=O&&R>k&&e[R-1]==="\r",P=O?F?R-1:R:e.length,q=e.slice(k,P),K=O?F?`\r
189
+ `:`
190
+ `:"",G=l(q),oe=G?.key??"",J=G?.content??q,he=_(J);he&&(m?he.markerChar===f&&he.markerLen>=v&&/^\s*$/.test(he.rest)&&(m=!1,f="",v=0):(m=!0,f=he.markerChar,v=he.markerLen));const Ne=I.length>0;if(!m&&!Ne){const We=u(J),$e=!!We&&!$&&E&&S&&g(k,oe,We);We&&!$&&(!E||$e)&&(oe&&L&&oe===L?y+=`${oe}${T}`:oe||(y+=T))}if(y+=q,y+=K,K&&(T=K),!m){const We=d(J);if(We){if(We.type==="open")We.complete||I.push(We.name);else for(let $e=I.length-1;$e>=0;$e--)if(I[$e]===We.name){I.length=$e;break}}}const Fe=c(J);$=Fe,E=!Fe&&a(J),S=!Fe&&!!p(J),L=oe,k=O?R+1:e.length}return y}function Ux(e,t,n={}){const s=Dx(n),o=s?ha():0,i=!!n.final;let r=(e??"").toString().replace(/([^\\])\r(ight|ho)/g,"$1\\r$2").replace(/([^\\])\n(abla|eq|ot|exists)/g,"$1\\n$2");if(iD(t,n)&&t.stream.reset(),i||(r.endsWith("- *")&&(r=r.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,w=>w.startsWith(`
191
+ `)?`
192
+ `:""):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,w=>w.startsWith(`
193
+ `)?`
194
+ `:""):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,w=>w.startsWith(`
195
+ `)?`
196
+ `:""):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
197
+ `):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,w=>w.startsWith(`
198
+ `)?`
199
+ `:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(w,_,b)=>`${_}${b.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,w=>w.startsWith(`
200
+ `)?`
201
+ `:""):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
202
+ `))),n.customHtmlTags?.length&&r.includes("<")){const w=ya(n.customHtmlTags);if(w.length&&(r=xD(r,w),r=TD(r,w),r=AD(r,w),r=MD(r,w),r.includes("</")))for(const _ of w){const b=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${_}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");r=r.replace(b,"$1$2$2")}}i||(r=CD(r));const l=aD(r);if(l){const w=n.preTransformTokens,_=n.postTransformTokens;if(Fx(t,n)||typeof w=="function"||typeof _=="function"){const b=r_(t,r,{__markstreamFinal:i},n),g=typeof w=="function"&&w(b)||b;typeof _=="function"&&_(g)}return wm(l,s,o)}const a=r_(t,r,{__markstreamFinal:i},n);if(!a||!Array.isArray(a))return wm([],s,o);const c=n.preTransformTokens,u=n.postTransformTokens;let d=a;c&&typeof c=="function"&&(d=c(d)||d);const p=t,m=n.validateLink??p.options?.validateLink??(typeof p.validateLink=="function"?p.validateLink:void 0),f={...n,validateLink:m,__markdownIt:t,__sourceMarkdown:r,__customHtmlBlockCursor:0};let v=o_(d,f,s);if(u&&typeof u=="function"){const w=u(d);if(Array.isArray(w)){const _=w[0],b=_?.type;_&&typeof b=="string"?v=o_(w,void 0,s):v=w}}if(v=SD(v,i,r),v=Wx(v,r,t,n,i)[0],v=kD(v,t,n,i),i){const w=new WeakSet,_=b=>{if(!b||typeof b!="object"||w.has(b))return;if(w.add(b),Array.isArray(b)){for(const y of b)_(y);return}const g=b;g.type==="html_block"&&g.loading===!0&&(g.loading=!1);for(const y of Object.values(g))_(y)};_(v)}return n.debug&&console.log("Parsed Markdown Tree Structure:",v),wm(v,s,o)}function d_(e,t){if(!e||!Array.isArray(e))return[];const n=[],s=_r(t);let o=0;for(;o<e.length;){const i=yv(e,o,s.options(),vv);if(i){n.push(i[0]),s.remember(i[0].raw),o=i[1];continue}const r=e[o];switch(r.type){case"paragraph_open":{const l=String(e[o+1]?.content??""),a=tD(e,o,s.options(l)),c=a_(a,t);c?n.push(...c):n.push(a),s.remember(a.raw),o+=3;break}case"bullet_list_open":case"ordered_list_open":{const[l,a]=ka(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"blockquote_open":{const[l,a]=ba(e,o,s.options());n.push(l),s.remember(l.raw),o=a;break}case"footnote_anchor":{const l=r.meta??{},a=String(l.label??r.content??"");n.push({type:"footnote_anchor",id:a,raw:String(r.content??"")}),s.remember(String(r.content??"")),o++;break}case"hardbreak":n.push(eD()),s.reset(),o++;break;case"text":{const l=String(r.content??"");n.push({type:"paragraph",raw:l,children:l?[{type:"text",content:l,raw:l}]:[]}),s.remember(l),o++;break}case"inline":{const l=String(r.content??""),a=fn(r.children||[],l,void 0,s.options(l));if(a.length!==0)if(a.every(c=>c.type==="html_block"))n.push(...a);else{const c={type:"paragraph",raw:l,children:a},u=a_(c,t);u?n.push(...u):n.push(c)}s.remember(l)}o+=1;break;default:o+=1;break}}return n}const ED=new Set([...cu,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),ID=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","s","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]),f_=/<([a-z][a-z0-9-]*)\b[^>]*>/gi;function h_(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $D(e){return typeof e=="string"?e:e==null?"":String(e)}function qx(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function er(e){return $D(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function jx(e){return er(e).replace(/`/g,"&#96;")}function wh(e){return String(e??"").trim().toLowerCase()}function wv(e,t="safe"){const n=wh(e);return n?t==="escape"?!0:t==="trusted"?cu.has(n):!ID.has(n):!1}function zx(e,t="safe"){const n=wh(e);return n?t==="escape"?!0:t==="trusted"?cu.has(n):ED.has(n):!1}function p_(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,s])=>s===""?` ${n}`:` ${n}="${jx(s)}"`).join("")}function ND(e,t){const n=e.split(",").map(s=>s.trim()).filter(Boolean);return n.length===0?!1:n.some(s=>{const o=s.split(/\s+/,1)[0]??"";return!o||oa(o,{tagName:t,attrName:"srcset"})})}function Vx(e,t,n,s){return PR.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?ND(t,s):!!(DR.has(e)&&t&&oa(t,{tagName:s,attrName:e}))}function Gr(e,t){const n=t.toLowerCase();return Object.keys(e).find(s=>s.toLowerCase()===n)}function Kx(e,t,n,s=!1){if(t!=="safe"||wh(n)!=="a")return e;const o=Gr(e,"href");if(s&&(!o||!e[o])){const a=Gr(e,"target"),c=Gr(e,"rel");return a&&delete e[a],c&&delete e[c],e}const i=Gr(e,"target");if((i?String(e[i]).trim():"").toLowerCase()!=="_blank")return e;const r=Gr(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function m_(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!qx(r)||Vx(l,i,t,n)||(s[r]=i)}return Kx(s,t,n,!!Gr(e,"href"))}function Gx(e,t){const n=e.toLowerCase();return rx.has(n)?!1:h_(t,n)||h_(t,e)}function Sv(e,t="safe",n){const s={};for(const[o,i]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!qx(r)||Vx(l,i,t,n)||(s[r]=i)}return Kx(s,t,n,!!Gr(e,"href"))}function Tf(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,s]of e)n&&(t[String(n)]=s==null?"":String(s));return t}function Wg(e,t="safe",n){const s=Sv(Tf(e),t,n),o=Object.entries(s).map(([i,r])=>[i,r]);return o.length>0?o:void 0}function LD(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const s=Number(e);if(e!==""&&!Number.isNaN(s))return s}return e}function OD(e){const t={};for(const[n,s]of Object.entries(e))t[n]=LD(s,n);return t}function g_(e){return e.trim().length>0}function RD(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const a=e.indexOf("-->",n);if(a!==-1){n=a+3;continue}break}const s=e.indexOf("<",n);if(s===-1){if(n<e.length){const a=e.slice(n);g_(a)&&t.push({type:"text",content:a})}break}if(s>n){const a=e.slice(n,s);g_(a)&&t.push({type:"text",content:a})}if(e.startsWith("![CDATA[",s+1)){const a=e.indexOf("]]>",s);if(a!==-1){t.push({type:"text",content:e.slice(s,a+3)}),n=a+3;continue}break}if(e.startsWith("!",s+1)){const a=e.indexOf(">",s);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim(),r=i.startsWith("/"),l=i.endsWith("/");if(r){const a=i.slice(1).trim();t.push({type:"tag_close",tagName:a})}else{const a=i.indexOf(" ");let c,u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=p.exec(u))!==null;){const f=m[1],v=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=v)}}t.push({type:l||cl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d})}n=o+1}return t}function PD(e){const t=[];let n=0;for(;n<e.length;){if(e.startsWith("<!--",n)){const p=e.indexOf("-->",n);if(p!==-1){n=p+3;continue}break}const s=e.indexOf("<",n);if(s===-1){n<e.length&&t.push({type:"text",content:e.slice(n)});break}if(s>n&&t.push({type:"text",content:e.slice(n,s)}),e.startsWith("![CDATA[",s+1)){const p=e.indexOf("]]>",s);if(p!==-1){t.push({type:"text",content:e.slice(s,p+3)}),n=p+3;continue}break}if(e.startsWith("!",s+1)){const p=e.indexOf(">",s);if(p!==-1){n=p+1;continue}break}const o=e.indexOf(">",s);if(o===-1)break;const i=e.slice(s+1,o).trim();if(!i){n=o+1;continue}const r=i.startsWith("/"),l=i.endsWith("/");if(r){const p=i.slice(1).trim();t.push({type:"tag_close",tagName:p}),n=o+1;continue}const a=i.indexOf(" ");let c="",u="";a===-1?c=l?i.slice(0,-1).trim():i.trim():(c=i.slice(0,a).trim(),u=i.slice(a+1));const d={};if(u){const p=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let m;for(;(m=p.exec(u))!==null;){const f=m[1],v=m[2]??m[3]??m[4]??"";f&&!f.endsWith("/")&&(d[f]=v)}}t.push({type:l||cl.has(c.toLowerCase())?"self_closing":"tag_open",tagName:c,attrs:d}),n=o+1}return t}function DD(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`&lt;/${er(t)}&gt;`;const n=Object.entries(e.attrs??{}).map(([s,o])=>o===""?` ${er(s)}`:` ${er(s)}="${jx(o)}"`).join("");return e.type==="self_closing"?`&lt;${er(t)}${n} /&gt;`:`&lt;${er(t)}${n}&gt;`}function BD(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;f_.lastIndex=0;let n;for(;(n=f_.exec(e))!==null;)if(Gx(n[1],t))return!0;return!1}function ia(e,t="safe"){if(!e)return"";if(t==="escape")return er(e);const n=PD(e),s=[],o=[],i=[];for(const r of n){if(r.type==="text"){i.length===0&&o.push(er(r.content??""));continue}const l=wh(r.tagName);if(!l)continue;if(zx(l,t)){r.type==="tag_open"?i.push(l):r.type==="tag_close"&&i[i.length-1]===l&&i.pop();continue}if(i.length>0)continue;if(t==="safe"&&wv(l,t)){o.push(DD(r));continue}if(r.type==="self_closing"){o.push(`<${l}${p_(m_(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${p_(m_(r.attrs??{},t,l))}>`),cl.has(l)||s.push(l);continue}const a=s.lastIndexOf(l);if(a===-1)continue;for(;s.length>a+1;){const u=s.pop();u&&o.push(`</${u}>`)}const c=s.pop();c&&o.push(`</${c}>`)}for(;s.length>0;){const r=s.pop();r&&o.push(`</${r}>`)}return o.join("")}const FD=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],v_="http://www.w3.org/2000/svg",HD=new Set(["script","style","iframe","object","embed","link","meta"]),WD=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),UD=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),qD=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),jD=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function zD(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function VD(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function KD(e){const t=e.nodeName.toLowerCase();return t==="use"?zD(e):t==="image"?VD(e):t==="text"||t==="tspan"?!!e.textContent?.trim():jD.has(t)}function GD(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function YD(e,t,n){const s=e.toLowerCase(),o=t.toLowerCase(),i=String(n??"").trim();return i?(s==="use"||s==="marker"||s==="clippath"||s==="mask")&&(o==="href"||o==="xlink:href")?i.startsWith("#")?i:"":s==="a"&&(o==="href"||o==="xlink:href")?oa(i,{tagName:"a",attrName:"href"})?"":i:s==="image"&&(o==="href"||o==="xlink:href"||o==="src")?oa(i,{tagName:"img",attrName:"src"})?"":i:o==="href"||o==="xlink:href"?i.startsWith("#")?i:"":oa(i,{tagName:s,attrName:o})?"":i:""}function XD(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??"");)n++;const s=e[n];if(s==='"'||s==="'"){const i=n+1,r=e.indexOf(s,i);if(r===-1)return{next:e.length,url:""};for(n=r+1;n<e.length&&/\s/.test(e[n]??"");)n++;return{next:n<e.length&&e[n]===")"?n+1:n,url:e.slice(i,r)}}const o=n;for(;n<e.length&&e[n]!==")";)n++;return{next:n<e.length?n+1:n,url:e.slice(o,n)}}function Yx(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(t,n)=>{const s=n.trim();if(/^[0-9a-f]+$/i.test(s)){const o=Number.parseInt(s,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function Xx(e){const t=Yx(e),n=t.toLowerCase();let s=0;for(;s<n.length;){const o=n.indexOf("url(",s);if(o===-1)return!1;const i=XD(t,o);if(s=Math.max(i.next,o+4),!i.url.trim().startsWith("#"))return!0}return!1}function y_(e){const t=Yx(e);return FD.some(n=>n.test(t))||Xx(t)}function ZD(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function ud(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function Zx(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,s=n.tagName.toLowerCase();if(!HD.has(s)){if(s==="br"){t.push(`
203
+ `);return}for(const o of Array.from(n.childNodes))Zx(o,t)}}function QD(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];Zx(t,n);const s=n.join("").split(/\r?\n/).map(u=>u.trim()).filter(Boolean);if(!s.length){t.remove();continue}const o=ud(t.getAttribute("width")),i=ud(t.getAttribute("height")),r=ud(t.getAttribute("x")),l=ud(t.getAttribute("y")),a=e.ownerDocument.createElementNS(v_,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+i/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const c=t.querySelector(".nodeLabel");if(c?.getAttribute("class")&&a.setAttribute("class",c.getAttribute("class")),s.length===1)a.textContent=s[0];else{const u=-.6*(s.length-1);for(const[d,p]of s.entries()){const m=e.ownerDocument.createElementNS(v_,"tspan");m.setAttribute("x",String(r+o/2)),m.setAttribute("dy",d===0?`${u}em`:"1.2em"),m.textContent=p,a.appendChild(m)}}t.parentNode?.replaceChild(a,t)}}function JD(e){QD(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const s=n.tagName.toLowerCase();if(!WD.has(s)){n.remove();continue}if(s==="style"&&y_(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const i of o){const r=i.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(i.name);continue}if(r==="style"&&i.value&&y_(i.value)){n.removeAttribute(i.name);continue}if(r==="srcdoc"){n.removeAttribute(i.name);continue}if(UD.has(r)&&i.value){const l=YD(s,r,i.value);if(!l){n.removeAttribute(i.name);continue}l!==i.value&&n.setAttribute(i.name,l);continue}if(qD.has(r)&&i.value&&Xx(i.value)){n.removeAttribute(i.name);continue}if(i.value){const l=GD(i.value);l!==i.value&&n.setAttribute(i.name,l)}}ZD(n)}}function bfe(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return JD(n),eB(n)?null:n}catch{return null}}function eB(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const i=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(i)||!Number.isFinite(r)||i<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let s=!1;for(const o of n){KD(o)&&(s=!0);for(const i of Array.from(o.attributes))if(/\bNaN\b/i.test(i.value)||i.name==="style"&&/max-width:\s*0(?:px)?/i.test(i.value))return!0}return!s}const k_=[];function Sm(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function tB(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function nB(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function b_(e=`editor-${Date.now()}`,t={}){const n=I7(t),s={"common.copy":"Copy"};let o;if(typeof t.i18n=="function")o=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const p=t.i18n;o=m=>p[m]??s[m]??m}else o=p=>s[p]??p;if(Array.isArray(t.plugin))for(const p of t.plugin){const m=p;if(Array.isArray(m)){const[f,...v]=m;typeof f=="function"&&n.use(f,...v)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const p of t.apply)try{p(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(k_.length)for(const p of k_)if(Array.isArray(p)){const[m,...f]=p;typeof m=="function"&&n.use(m,...f)}else typeof p=="function"&&n.use(p);n.use(x5),n.use(A5),n.use(w5);const i=U5,r=i.default??i;n.use(r),n.use(_5),n.use(b5),n.core.ruler.after("block","mark_fence_closed",p=>{const m=p,f=m.src,v=!!m.env?.__markstreamFinal,w=f.split(/\r?\n/);for(const _ of m.tokens){if(_.type!=="fence"||!_.map||!_.markup)continue;const b=_.map[0],g=_.map[1],y=_.markup,k=y[0],$=y.length,E=w[Math.max(0,g-1)]??"";let S=0;for(;S<E.length&&(E[S]===" "||E[S]===" ");)S++;let T=0;for(;S+T<E.length&&E[S+T]===k;)T++;let I=S+T;for(;I<E.length&&(E[I]===" "||E[I]===" ");)I++;const L=v?!0:g>b+1&&T>=$&&I===E.length,R=_;R.meta=R.meta??{},R.meta.unclosed=!L,R.meta.closed=!!L}});const l=(p,m)=>{const f=p,v=f.pos;if(f.src[v]!=="~")return!1;const w=f.src[v-1],_=f.src[v+1];if(/\d/.test(w)&&/\d/.test(_)){if(!m){const b=f.push("text","",0);b.content="~"}return f.pos+=1,!0}return!1};n.inline.ruler.before("sub","wave",l),n.renderer.rules.fence=(p,m)=>{const f=p[m],v=String(f.info??"").trim(),w=String(f.content??""),_=btoa(unescape(encodeURIComponent(w))),b=tB(v),g=Sm(b),y=nB(`editor-${e}-${m}-${b}`),k=Sm(o("common.copy"));return`<div class="code-block" data-code="${_}" data-lang="${g}" id="${y}">
204
+ <div class="code-header">
205
+ <span class="code-lang">${Sm(b.toUpperCase())}</span>
206
+ <button class="copy-button" data-code="${_}">${k}</button>
207
+ </div>
208
+ <div class="code-editor"></div>
209
+ </div>`};const a=/^\[(\d+)\]/,c=/^\[([^\]\n]+)\]/,u=p=>{if(!p.startsWith("["))return!1;const m=c.exec(p);if(!m)return p!=="["&&!/^\[\d+$/.test(p);const f=String(m[1]??"");return p.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(f)},d=(p,m)=>{const f=p;if(f.src[f.pos]!=="[")return!1;const v=a.exec(f.src.slice(f.pos));if(!v)return!1;const w=f.src.slice(Math.max(0,f.pos-120),f.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(w))return!1;const _=f.src.slice(f.pos+v[0].length);if(_.startsWith("](")||_.startsWith("(")||u(_))return!1;if(!m){const b=v[1],g=f.push("reference","span",0);g.content=b,g.markup=v[0],g.raw=v[0]}return f.pos+=v[0].length,!0};return n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(p,m)=>{const v=String(p[m].content??"");return`<span class="reference-link" data-reference-id="${v}" role="button" tabindex="0" title="Click to view reference">${v}</span>`},n}const sB="modulepreload",oB=function(e){return"/"+e},__={},Ks=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(c=>{if(c=oB(c),c in __)return;__[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const p=document.createElement("link");if(p.rel=u?"stylesheet":sB,u||(p.as="script"),p.crossOrigin="",p.href=c,a&&p.setAttribute("nonce",a),document.head.appendChild(p),u)return new Promise((m,f)=>{p.addEventListener("load",m),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function iB({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function Qx({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:s,streamRenderVersionChanged:o=!1}){const i=`${n.settledContent}${n.streamedDelta}`;return s?n.streamedDelta&&i===e?o?{settledContent:i,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:iB({nextContent:e,previousContent:t??i,typewriterEnabled:s}):{settledContent:e,streamedDelta:"",appended:!1}}function $l(e,t,n=1){const s=Number(e);return Number.isFinite(s)?Math.max(n,s):t}function w_(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var rB=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const p=this.source.length>0,m=this.pendingChars<=0;if(this.source+=d,m){const f=S_();this.startedAt=p&&this.hasStarted?f-this.normalizedStartDelayMs:f,this.lastTick=f,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=S_();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAt<this.normalizedStartDelayMs){this.rafId=requestAnimationFrame(this.tick);return}const p=1e3/Math.max(1,this.maxCommitFps),m=Math.min(100,Math.max(0,d-this.lastTick));if(m<p){this.rafId=requestAnimationFrame(this.tick);return}this.lastTick=d;const f=this.pendingChars,v=f>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,w=uB(f/Math.max(.001,v/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(w-this.currentCps)*.2,this.charBudget+=this.currentCps*(m/1e3),this.charBudget<1){this.ensureLoop();return}const _=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),b=cB(this.source.slice(this.visible.length),_,this.segmenter);b.text&&(this.visible+=b.text,this.charBudget=Math.max(0,this.charBudget-b.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:s=1e3,targetLatencyMs:o=900,catchUpLatencyMs:i=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:c=80,flushOnFinish:u=!1}=e;this.minCharsPerSecond=$l(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,$l(s,1e3,1)),this.normalizedTargetLatencyMs=$l(o,900,1),this.normalizedCatchUpLatencyMs=$l(i,350,1),this.normalizedCatchUpThreshold=w_(r,600),this.normalizedStartDelayMs=w_(a,80),this.maxCommitFps=Math.trunc($l(l,30,1)),this.maxCharsPerCommit=Math.trunc($l(c,80,1)),this.flushOnFinish=u,this.segmenter=aB(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function lB(e={},t){const n=new rB(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function aB(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function cB(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const i=Array.from(e).slice(0,t);return{text:i.join(""),graphemeCount:i.length}}let s="",o=0;for(const i of n.segment(e)){if(o>=t)break;s+=i.segment,o++}return{text:s,graphemeCount:o}}function S_(){return typeof performance<"u"?performance.now():Date.now()}function uB(e,t,n){return Math.min(n,Math.max(t,e))}var dB=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const Ug=Symbol.for("markstream-vue:node-lifecycle"),qg=new Map;let C_="material";const ql=new Map,x_=new Map;let jg=null;function fB(e){qg.set(e.id,e)}function hB(e){return dB(this,null,function*(){var t,n,s;if(ql.has(e.id))return(t=ql.get(e.id))!=null?t:null;let o=x_.get(e.id);return o||(o=((s=(n=e.loadExtended)==null?void 0:n.call(e))!=null?s:Promise.resolve(null)).then(i=>(ql.set(e.id,i),jg?.(),i)).catch(()=>(ql.set(e.id,null),null)),x_.set(e.id,o)),o})}const T_='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',M_='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',pB={id:"material",core:{"":M_,plain:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>',text:M_,javascript:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>',jsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',tsx:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>',html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>',css:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>',scss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>',json:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>',python:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>',ruby:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>',go:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>',java:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>',kotlin:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>',c:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>',cpp:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>',cs:T_,csharp:T_,php:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>',shell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',powershell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>',yaml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>',markdown:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>',xml:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>',rust:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>',vue:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>',mermaid:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>'},fallback:'<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>',loadExtended:()=>Ks(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},mB=al(0);jg=()=>{mB.value++},fB(pB);const gB={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain","c++":"cpp","c#":"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin"};function Jx(e){var t;const n=(function(s){if(!s)return"";const o=s.trim();if(!o)return"";const[i]=o.split(/\s+/),[r]=i.split(":");return r.toLowerCase()})(e);return(t=gB[n])!=null?t:n}function _fe(e){const t=Jx(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";default:return t}}function wfe(e){return(function(s){const o=qg.get(C_);if(!o)return;const i=o.core[s];if(i)return i;const r=ql.get(o.id);if(r){const l=r[s];if(l)return l}o.loadExtended&&!ql.has(o.id)&&hB(o)})(Jx(e))||((n=(t=qg.get(C_))==null?void 0:t.fallback)!=null?n:"");var t,n}const Sfe={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};let eT=!1;function Cfe(){return eT}function xfe(){eT=!0}var Sh=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});let ko=null,Cm=!1,Cv=tT;function Ch(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function xv(){try{const e=globalThis;return Ch(e?.katex)}catch{return null}}function tT(){return Sh(null,null,function*(){const e=xv();if(e)return e;const t=yield Ks(()=>import("./katex-HP8lGamR.js"),[]);try{yield Ks(()=>import("./mhchem-KEf2LMH_.js"),__vite__mapDeps([0,1]))}catch{}return Ch(t)})}function nT(){return typeof Cv=="function"}function Tfe(){var e;const t=Cv;if(!t||t===tT)return null;if(ko)return ko;const n=xv();if(n)return ko=n,ko;try{const s=t();return s&&typeof s?.then!="function"?(ko=(e=Ch(s))!=null?e:s,ko):null}catch{return null}}function Tv(){return Sh(this,null,function*(){var e;const t=xv();if(t)return ko=t,ko;if(ko)return ko;if(Cm)return null;const n=Cv;if(!n)return Cm=!0,null;try{const s=yield n();if(s)return ko=(e=Ch(s))!=null?e:s,ko}catch{}return Cm=!0,null})}function sT(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Nl=null;const oT=new Map,ac=new Map;let iT=5;const Zr=new Set;function vB(){if(oT.size<iT&&Zr.size){const e=Array.from(Zr);Zr.clear();for(const t of e)try{t()}catch{}}}function yB(e,t=!0,n=2e3,s){return Sh(this,null,function*(){performance.now();const o=sT(e);if(!nT()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Nl)return Promise.reject(Nl);const i=`${t?"d":"i"}:${o}`,r=ac.get(i);return r?Promise.resolve(r):(Nl=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Nl.name="WorkerInitError",Nl.code="WORKER_INIT_ERROR",Promise.reject(Nl))})}function Mfe(e,t=!0,n){const s=`${t?"d":"i"}:${sT(e)}`;if(ac.set(s,n),ac.size>200){const o=ac.keys().next().value;ac.delete(o)}}const kB="WORKER_BUSY";function bB(e=2e3,t){return oT.size<iT?Promise.resolve():new Promise((n,s)=>{let o,i=!1;const r=()=>{i||(i=!0,o&&globalThis.clearTimeout(o),Zr.delete(r),n())};if(Zr.add(r),o=globalThis.setTimeout(()=>{if(i)return;i=!0,Zr.delete(r);const l=new Error("Wait for worker slot timed out");l.name="WorkerBusyTimeout",l.code="WORKER_BUSY_TIMEOUT",s(l)},e),queueMicrotask(()=>vB()),t){const l=()=>{if(i)return;i=!0,o&&globalThis.clearTimeout(o),Zr.delete(r);const a=new Error("Aborted");a.name="AbortError",s(a)};t.aborted?l():t.addEventListener("abort",l,{once:!0})}})}const Ja={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Afe(e){return Sh(this,arguments,function*(t,n=!0,s={}){var o,i,r,l;if(!nT()){const v=new Error("KaTeX rendering disabled");throw v.name="KaTeXDisabled",v.code="KATEX_DISABLED",v}const a=(o=s.timeout)!=null?o:Ja.timeout,c=(i=s.waitTimeout)!=null?i:Ja.waitTimeout,u=(r=s.backoffMs)!=null?r:Ja.backoffMs,d=(l=s.maxRetries)!=null?l:Ja.maxRetries,p=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ja.maxRetries,m=s.signal;let f=0;for(;;){if(m?.aborted){const v=new Error("Aborted");throw v.name="AbortError",v}try{return yield yB(t,n,a,m)}catch(v){if(v?.code!==kB||f>=p)throw v;if(f++,yield bB(c,m).catch(()=>{}),m?.aborted){const w=new Error("Aborted");throw w.name="AbortError",w}u>0&&(yield new Promise(w=>globalThis.setTimeout(w,u*f)))}}})}var _B=Object.defineProperty,wB=Object.defineProperties,SB=Object.getOwnPropertyDescriptors,A_=Object.getOwnPropertySymbols,CB=Object.prototype.hasOwnProperty,xB=Object.prototype.propertyIsEnumerable,E_=(e,t,n)=>t in e?_B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nt=(e,t)=>{for(var n in t||(t={}))CB.call(t,n)&&E_(e,n,t[n]);if(A_)for(var n of A_(t))xB.call(t,n)&&E_(e,n,t[n]);return e},Ct=(e,t)=>wB(e,SB(t)),un=(e,t,n)=>new Promise((s,o)=>{var i=a=>{try{l(n.next(a))}catch(c){o(c)}},r=a=>{try{l(n.throw(a))}catch(c){o(c)}},l=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,r);l((n=n.apply(e,t)).next())});const TB="__global__",xm="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",zg=(()=>{const e=globalThis;if(e[xm])return e[xm];const t={scopedCustomComponents:{},revision:al(0)};return e[xm]=t,t})(),I_=zg.revision,MB=Symbol("markstreamCustomComponents"),AB=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function du(e){return AB.has(String(e).trim().toLowerCase())}function EB(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function Tm(e={}){const t={};for(const[n,s]of Object.entries(e))if(s!=null){t[n]=s;for(const o of new Set([Mo(n),Mo(EB(n))]))!o||du(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=s)}return t}function Tn(e){const t=Nt(MB,null);return j(()=>{var n;return I_.value,(function(s,o={}){return I_.value,nt(nt(nt({},Tm(zg.scopedCustomComponents[TB]||{})),Tm(o)),Tm((function(i){return i&&zg.scopedCustomComponents[i]||{}})(s)))})(e?.(),(n=t?.value)!=null?n:{})})}const IB=["aria-label"],$B={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},NB={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},jt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},Xs=jt(Ze({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(C(),A("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(C(),A("svg",NB,[...n[1]||(n[1]=[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),h("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(C(),A("svg",$B,[...n[0]||(n[0]=[h("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,IB))}),[["__scopeId","data-v-be21ab83"]]);Xs.install=e=>{e.component(Xs.__name,Xs)};const LB={class:"emoji-node"},Is=jt(Ze({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(C(),A("span",LB,N(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Is.install=e=>{e.component(Is.__name,Is)};const OB=["id"],RB=["title"],Zs=jt(Ze({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const s=document.querySelector(t);s?s.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(s,o)=>(C(),A("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[h("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+N(e.node.id)+"]",9,RB)],8,OB))}}),[["__scopeId","data-v-c1463a29"]]);Zs.install=e=>{e.component(Zs.__name,Zs)};const rT=(()=>{try{return!1}catch{}return!1})();function Mm(e){rT&&console.warn(e)}function $_(e,t="safe",n){return Sv(e,t,n)}function lT(e){return OD(e)}function Am(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function Mv(e,t="safe"){const n=String(e.tag||e.type||"").trim(),s=Wg((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),Am(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),Am(r.value)]):Object.entries(o).map(([r,l])=>[r,Am(l)]):null,t,n);var o;if(!s)return;const i=lT(Tf(s));return Object.keys(i).length>0?i:void 0}function N_(e,t,n=!1){const s=Object.entries(t??{}),o=s.length>0?s.map(([i,r])=>r===""?` ${i}`:` ${i}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function ec(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function Em(e,t,n,s,o,i,r=!1){const l=(function(d,p){return Gx(d,p)})(e,s);if(cu.has(e.toLowerCase())||!l&&zx(e,i))return null;if(!l&&wv(e,i))return r?[N_(e,t,!0)]:[N_(e,t),...n,`</${e}>`];const a=Sv(t,i,e),c=a.key,u=c!=null&&c!==""?c:o;if(l){const d=s[e]||s[e.toLowerCase()],p=lT(a);return Ut(d,Ct(nt({},p),{key:u}),n.length>0?n:void 0)}return Ut(e,Ct(nt({},a),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function aT(e,t){return BD(e,t)}function Mf(e,t,n="safe"){if(!e)return[];try{return(function(i,r,l="safe"){let a=0;const c=[],u=[];for(const d of i)if(d.type==="text")(c.length>0?c[c.length-1].children:u).push(d.content);else if(d.type==="self_closing"){const p=Em(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);ec(c.length>0?c[c.length-1].children:u,p)}else if(d.type==="tag_open")c.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const p=d.tagName.toLowerCase();let m=-1;for(let f=c.length-1;f>=0;f--)if(c[f].tagName.toLowerCase()===p){m=f;break}if(m!==-1)for(;c.length>m;){const f=c.pop(),v=Em(f.tagName,f.attrs||{},f.children,r,f.autoKey,l);c.length>0?ec(c[c.length-1].children,v):ec(u,v),f.tagName.toLowerCase()!==p&&c.length>m&&Mm(`Auto-closing unclosed tag: <${f.tagName}>`)}else Mm(`Ignoring closing tag with no matching opening tag: </${d.tagName}>`)}for(;c.length>0;){const d=c.pop(),p=Em(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);c.length>0?ec(c[c.length-1].children,p):ec(u,p),Mm(`Auto-closing unclosed tag: <${d.tagName}>`)}return u})(RD(e),t,n)}catch(o){return s=o,rT&&console.error("Failed to parse HTML to VNodes:",s),null}var s}const PB=["innerHTML"],Qs=jt(Ze({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Nt("markstreamHtmlPolicy",void 0),s=j(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=Tn(()=>t.customId),i=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=j(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(s.value==="escape")return{mode:"html",content:ia(l,s.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const c=Mf(l,o.value,s.value);if(c!==null)return{mode:"dynamic",nodes:c}}if(!aT(l,o.value))return{mode:"html",content:ia(l,s.value)};const a=Mf(l,o.value,s.value);return a===null?{mode:"html",content:ia(l,s.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(C(),A("span",{key:0,class:Ee(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[mt(M(i),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(C(),A("span",{key:1,class:Ee(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},N(r.value.content),3)):(C(),A("span",{key:2,class:Ee(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,PB))}}),[["__scopeId","data-v-d17f12b0"]]);Qs.install=e=>{e.component(Qs.__name,Qs)};const DB={class:"inline-code"},BB={key:0},is=jt(Ze({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=ou(),s=Nt("markstreamFade",void 0),o=Nt("markstreamTextStreamState",void 0),i=Nt("markstreamStreamVersion",void 0),r=j(()=>{const b=n.fade;return b===""||b===!0||b==="true"||b!==!1&&b!=="false"&&void 0}),l=j(()=>typeof r.value=="boolean"?r.value:typeof s?.value!="boolean"||s.value),a=j(()=>{var b;return String((b=t.node.code)!=null?b:"")}),c=j(()=>!l.value),u=j(()=>{var b;const g=(b=n["index-key"])!=null?b:n.indexKey;return g==null||g===""?"":String(g)}),d=te(t.node.code),p=te("");let m=i?.value;const f=te(0);function v(){return d.value+p.value}function w(){p.value&&(d.value=v(),p.value="")}Ve([()=>t.node.code,u,l,()=>i?.value],([b,g,y,k])=>{const $=String(b??""),E=u.value,S=k!==m;m=k;const T=Qx({nextContent:$,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:d.value,streamedDelta:p.value},typewriterEnabled:l.value,streamRenderVersionChanged:S});d.value=T.settledContent,p.value=T.streamedDelta,T.appended&&(f.value+=1),E&&o?.set(E,$)},{immediate:!0}),Ve(l,b=>{var g;b||(g=v(),d.value=g,p.value="")});const _=j(()=>f.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(b,g)=>(C(),A("code",DB,[c.value?(C(),A(Ie,{key:0},[ht(N(a.value),1)],64)):(C(),A(Ie,{key:1},[d.value?(C(),A("span",BB,N(d.value),1)):re("",!0),p.value?(C(),A("span",{key:1,class:Ee(["inline-code-stream-delta",[_.value]]),onAnimationend:w},N(p.value),35)):re("",!0)],64))]))}}),[["__scopeId","data-v-1b73ee4e"]]);is.install=e=>{e.component(is.__name,is)};const Vg=te(!1),L_=te(""),O_=te("top"),Cc=te(null),xc=te(null),Kg=te(null),Gg=te(null),R_=te(null);let Ed=null,Id=null,Yg=0;function cT(){Ed&&(clearTimeout(Ed),Ed=null),Id&&(clearTimeout(Id),Id=null)}let dd=!1,fd=null,P_=!1;function FB(e,t,n="top",s=!1,o,i){if(!e)return;const r=++Yg;cT();const l=()=>un(null,null,function*(){var a,c;if(yield(function(){return un(this,null,function*(){if(!dd&&!P_&&typeof document<"u"){fd!=null||(fd=un(null,null,function*(){const[{createApp:u,h:d},{default:p}]=yield Promise.all([Ks(()=>import("./vue.runtime.esm-bundler-DbtxAc5S.js"),[]),Ks(()=>import("./Tooltip-zyXUfva2.js"),[])]),m=document.createElement("div");m.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(m),u({setup:()=>()=>{var f;return d(p,{visible:Vg.value,"anchor-el":Cc.value,content:L_.value,placement:O_.value,id:xc.value,originX:Kg.value,originY:Gg.value,isDark:(f=R_.value)!=null?f:void 0})}}).mount(m),dd=!0}));try{yield fd}catch(u){dd=!1,fd=null,P_=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",u)}}})})(),dd&&r===Yg){xc.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Cc.value=e,L_.value=t,O_.value=n,Kg.value=(a=o?.x)!=null?a:null,Gg.value=(c=o?.y)!=null?c:null,R_.value=typeof i=="boolean"?i:null,Vg.value=!0;try{e.setAttribute("aria-describedby",xc.value)}catch{}}});s?l():Ed=setTimeout(l,80)}function HB(e=!1){Yg+=1,cT();const t=()=>{if(Cc.value&&xc.value)try{Cc.value.removeAttribute("aria-describedby")}catch{}Vg.value=!1,Cc.value=null,xc.value=null,Kg.value=null,Gg.value=null};e?t():Id=setTimeout(t,120)}const Xg={"common.copy":"Copy","common.copied":"Copied","common.decrease":"Decrease","common.reset":"Reset","common.increase":"Increase","common.expand":"Expand","common.collapse":"Collapse","common.preview":"Preview","common.source":"Source","common.export":"Export","common.open":"Open","common.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},Zg=e=>{var t;return(t=Xg[e])!=null?t:(function(n){return(n.split(".").pop()||n).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,s=>s.toUpperCase()).trim()})(e)};function D_(e){return{t(t){if(e.te&&Xg[t]&&!e.te(t))return Zg(t);const n=e.t(t);return n===t&&Xg[t]?Zg(t):n}}}function WB(){const e=(function(){var t,n;try{const s=rs(),o=s?.proxy,i=o?.$t;if(typeof i=="function"){const a=o?.$te;return{t:i.bind(o),te:typeof a=="function"?a.bind(o):void 0}}const r=(n=(t=s?.appContext)==null?void 0:t.config)==null?void 0:n.globalProperties,l=r?.$t;if(typeof l=="function"){const a=r?.$te;return{t:l.bind(r),te:typeof a=="function"?a.bind(r):void 0}}}catch{}return null})();if(e)return D_(e);try{const t=globalThis.$vueI18nUse||null;if(t&&typeof t=="function")try{const n=t();if(n&&typeof n.t=="function")return D_({t:n.t.bind(n),te:typeof n.te=="function"?n.te.bind(n):void 0})}catch{}}catch{}return{t:Zg}}function UB(e,t){var n,s;const o=(s=(n=e.indexKey)!=null?n:t["index-key"])!=null?s:t.indexKey;return o==null||o===""?"":String(o)}const qB=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],jB={key:1,class:"image-placeholder"},zB={key:1,class:"image-node__raw-text"},VB={key:0,class:"image-shimmer-overlay"},KB={key:1,class:"image-node__raw-text"},GB={key:2,class:"image-error"},lr=jt(Ze({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,s=t,o=te(!1),i=te(!1),r=te(""),l=te("primary"),a=te(null),c=ou(),u=Nt(Ug,null);let d="",p=null;const m=j(()=>Ib(n.node.src)),f=j(()=>Ib(n.fallbackSrc)),v=j(()=>r.value),w=j(()=>!n.lazy),_=j(()=>!n.node.loading&&l.value!=="failed"&&r.value.length>0),b=j(()=>l.value==="failed"),g=j(()=>!w.value&&!o.value&&!i.value&&l.value!=="failed"&&r.value.length>0),y=j(()=>UB(n,c));function k(F=y.value){F&&a.value&&u?.reportHeight(F,a.value.offsetHeight)}function $(F=y.value){F&&ft(()=>{k(F)})}function E(){p&&(clearTimeout(p),p=null)}function S(){const F=y.value;F&&d!==F&&(d&&u?.markSettled(d),E(),d=F,u?.markPending(F),typeof window<"u"&&(p=window.setTimeout(()=>{d===F&&($(F),T())},8e3)))}function T(){return un(this,null,function*(){const F=d;F&&(E(),d="",yield ft(),k(F),u?.markSettled(F))})}function I(){if(l.value==="primary"&&f.value&&f.value!==r.value)return l.value="fallback",r.value=f.value,o.value=!1,i.value=!1,void $();l.value="failed",i.value=!0,s("error",r.value),$()}function L(){o.value=!0,i.value=!1,s("load",v.value),$()}function R(F){F.preventDefault(),o.value&&!i.value&&s("click",[F,v.value])}const{t:O}=WB();return Ve([m,f,()=>n.node.loading],()=>(o.value=!1,i.value=!1,n.node.loading||m.value?(r.value=m.value,void(l.value="primary")):f.value?(r.value=f.value,void(l.value="fallback")):(r.value="",l.value="failed",void(i.value=!0))),{immediate:!0}),Ve([_,o,i,v,()=>n.lazy],([F,P,q,K,G])=>F&&K&&!q?P?(T(),void $()):G?(S(),void $()):void(P||q||S()):(T(),void $()),{flush:"post",immediate:!0}),to(()=>{(function(){const F=d;F&&(E(),d="",u?.markSettled(F))})()}),(F,P)=>{var q,K,G,oe,J;return C(),A("span",{ref_key:"rootRef",ref:a,class:"image-node-container"},[_.value?(C(),A("img",{key:0,src:v.value,alt:String((K=(q=n.node.alt)!=null?q:n.node.title)!=null?K:""),title:String((oe=(G=n.node.title)!=null?G:n.node.alt)!=null?oe:""),class:Ee(["image-node__img",{"is-loading":!w.value&&!o.value,"is-loaded":w.value||o.value,"cursor-pointer":o.value}]),loading:n.lazy?"lazy":void 0,fetchpriority:w.value?"high":void 0,decoding:w.value?"sync":"async",tabindex:o.value?0:-1,"aria-label":(J=n.node.alt)!=null?J:M(O)("image.preview"),onError:I,onLoad:L,onClick:R},null,42,qB)):re("",!0),e.node.loading&&!i.value?(C(),A("span",jB,[n.usePlaceholder?Xl(F.$slots,"placeholder",{key:0,node:n.node,displaySrc:v.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[P[0]||(P[0]=h("span",{class:"image-shimmer"},null,-1))],!0):(C(),A("span",zB,N(e.node.raw),1))])):re("",!0),mt(Si,{name:"shimmer-fade"},{default:vn(()=>[g.value&&!e.node.loading?(C(),A("span",VB,[n.usePlaceholder?Xl(F.$slots,"placeholder",{key:0,node:n.node,displaySrc:v.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[P[1]||(P[1]=h("span",{class:"image-shimmer"},null,-1))],!0):(C(),A("span",KB,N(e.node.raw),1))])):re("",!0)]),_:3}),b.value?(C(),A("span",GB,[Xl(F.$slots,"error",{node:n.node,displaySrc:v.value,imageLoaded:o.value,hasError:i.value,fallbackSrc:n.fallbackSrc,lazy:n.lazy},()=>[P[2]||(P[2]=h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[h("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),h("span",null,N(M(O)("image.loadError")),1)],!0)])):re("",!0)],512)}}}),[["__scopeId","data-v-373b57e2"]]);lr.install=e=>{e.component(lr.__name,lr)};const YB={key:2},ti=Ze({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Tn(()=>t.customId),s=Nt("markstreamHtmlPolicy",void 0),o=Nt("markstreamNestedRendererProps",void 0),i=j(()=>{var f;return(f=s?.value)!=null?f:"safe"}),r=j(()=>{var f,v;const w=(f=o?.value)!=null?f:{};return Ct(nt({},w),{customId:(v=t.customId)!=null?v:w.customId,htmlPolicy:i.value})}),l=Zo({loader:()=>Promise.resolve().then(()=>Ov),suspensible:!1}),a=j(()=>t.components[String(t.node.type)]),c=j(()=>!!(a.value&&n.value[t.node.type]&&!du(String(t.node.type)))),u=j(()=>c.value?Mv(t.node,i.value):void 0),d=j(()=>Array.isArray(t.node.children)&&t.node.children.length>0),p=j(()=>{var f;return String((f=t.node.content)!=null?f:"")}),m=j(()=>{var f,v;return String((v=(f=t.node.content)!=null?f:t.node.raw)!=null?v:"")});return(f,v)=>a.value&&c.value?(C(),je(ss(a.value),Kt({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:vn(()=>[d.value?(C(),je(M(l),Kt({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):p.value?(C(),je(M(l),Kt({key:1},r.value,{content:p.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(C(),je(ss(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(C(),A("span",YB,N(m.value),1)):re("",!0)}}),XB=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],ZB={key:0,translate:"no",class:"markstream-pre__diff-code"},QB={class:"markstream-pre__diff-number","aria-hidden":"true"},JB={class:"markstream-pre__diff-content"},eF={class:"markstream-pre__diff-content-inner"},tF={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},nF=["textContent"],vo=Ze({__name:"PreCodeNode",props:{node:{},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},reservedHeightPx:{}},setup(e){const t=e,n=j(()=>{var S,T,I;const L=String((T=(S=t.node)==null?void 0:S.language)!=null?T:"");return String((I=String(L).split(/\s+/g)[0])!=null?I:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),s=j(()=>`language-${n.value}`),o=j(()=>{var S,T;return String((T=(S=t.node)==null?void 0:S.code)!=null?T:"").split(/\r\n|\n|\r/)}),i=j(()=>Array.from({length:Math.max(1,o.value.length)},(S,T)=>T+1)),r=j(()=>{var S;return t.showLineNumbers===!0&&((S=t.node)==null?void 0:S.diff)===!0}),l=j(()=>r.value&&t.diffInline===!0),a=j(()=>{const S=Number(t.reservedHeightPx);if(!Number.isFinite(S)||S<=0)return;const T=`${Math.ceil(S)}px`;return{height:T,minHeight:T,maxHeight:T,overflow:"auto"}});function c(S,T="context"){const I=(function(L){return String(L??"").trim().length===0})(S);return{code:S,kind:I&&T!=="hunk"?"context":T,empty:I}}function u(S){return String(S??"").split(/\r\n|\n|\r/)}function d(S){return S.startsWith("-")&&!S.startsWith("---")}function p(S){return S.startsWith("+")&&!S.startsWith("+++")}const m=j(()=>{var S,T,I,L,R,O;const F=o.value.some(K=>d(K)||p(K));if(l.value)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:F?(function(G){const oe=[];let J=1,he=1;for(const[Ne,Fe]of G.entries())if(Fe.startsWith("@@"))oe.push(Ct(nt({},c(Fe,"hunk")),{key:`inline-hunk-${Ne}`,number:""}));else if(d(Fe))oe.push(Ct(nt({},c(Fe.slice(1),"removed")),{key:`inline-removed-${Ne}`,number:J++}));else if(p(Fe))oe.push(Ct(nt({},c(Fe.slice(1),"added")),{key:`inline-added-${Ne}`,number:he++}));else{const We=Fe.startsWith(" ")?Fe.slice(1):Fe;oe.push(Ct(nt({},c(We)),{key:`inline-context-${Ne}`,number:he})),J++,he++}return oe})(o.value):(function(G,oe){const J=u(G),he=u(oe),Ne=[];let Fe=0,We=J.length-1,$e=he.length-1;for(;Fe<=We&&Fe<=$e&&J[Fe]===he[Fe];)Ne.push(Ct(nt({},c(he[Fe])),{key:`inline-prefix-${Fe}`,number:Fe+1})),Fe++;const me=[];for(;We>=Fe&&$e>=Fe&&J[We]===he[$e];)me.unshift(Ct(nt({},c(he[$e])),{key:`inline-suffix-${$e}`,number:$e+1})),We--,$e--;for(let ke=Fe;ke<=We;ke++)Ne.push(Ct(nt({},c(J[ke],"removed")),{key:`inline-removed-source-${ke}`,number:ke+1}));for(let ke=Fe;ke<=$e;ke++)Ne.push(Ct(nt({},c(he[ke],"added")),{key:`inline-added-source-${ke}`,number:ke+1}));return Ne.concat(me)})((S=t.node)==null?void 0:S.originalCode,(T=t.node)==null?void 0:T.updatedCode)}];if(!F&&(((I=t.node)==null?void 0:I.originalCode)!=null||((L=t.node)==null?void 0:L.updatedCode)!=null))return[{key:"original",className:"markstream-pre__diff-pane--original",lines:u((R=t.node)==null?void 0:R.originalCode).map((K,G)=>Ct(nt({},c(K,"removed")),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u((O=t.node)==null?void 0:O.updatedCode).map((K,G)=>Ct(nt({},c(K,"added")),{key:`modified-${G}`,number:G+1}))}];const P=[],q=[];for(const K of o.value)if(K.startsWith("@@"))P.push(c(K,"hunk")),q.push(c(K,"hunk"));else if(K.startsWith("-")&&!K.startsWith("---"))P.push(c(K.slice(1),"removed"));else if(K.startsWith("+")&&!K.startsWith("+++"))q.push(c(K.slice(1),"added"));else{const G=K.startsWith(" ")?K.slice(1):K;P.push(c(G)),q.push(c(G))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:P.map((K,G)=>Ct(nt({},K),{key:`original-${G}`,number:G+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:q.map((K,G)=>Ct(nt({},K),{key:`modified-${G}`,number:G+1}))}]}),f=j(()=>{const S=n.value;return S?`Code block: ${S}`:"Code block"}),v=te(null),w=te([]);let _=null,b=null;function g(S){const T=Number.parseFloat(String(S??""));return Number.isFinite(T)&&T>0?T:0}function y(S,T){var I;if(!S)return T;const L=S.querySelector(".markstream-pre__diff-content"),R=L?.getBoundingClientRect(),O=(I=R?.height)!=null?I:0;return Math.max(T,Math.ceil(O))}function k(){typeof window<"u"&&(_!=null&&window.cancelAnimationFrame(_),_=window.requestAnimationFrame(()=>{(function(){var S,T;_=null;const I=v.value;if(!I||!r.value)return void(w.value.length&&(w.value=[]));const L=(function(G){const oe=window.getComputedStyle(G),J=g(oe.getPropertyValue("--markstream-pre-diff-line-height"));if(J>0)return J;const he=g(oe.lineHeight);return he>0?he:18})(I),R=Array.from(I.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),O=Array.from(I.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),F=Math.max(R.length,O.length),P=[];for(let G=0;G<F;G++){const oe=y((S=R[G])!=null?S:null,L),J=y((T=O[G])!=null?T:null,L),he=Math.max(L,oe,J);P.push({rowHeight:he,originalHeight:oe,modifiedHeight:J})}var q,K;q=w.value,K=P,q.length===K.length&&q.every((G,oe)=>{const J=K[oe];return J&&Math.abs(G.rowHeight-J.rowHeight)<=.5&&Math.abs(G.originalHeight-J.originalHeight)<=.5&&Math.abs(G.modifiedHeight-J.modifiedHeight)<=.5})||(w.value=P)})()}))}function $(S){b?.disconnect(),b=null,S&&r.value&&typeof ResizeObserver<"u"&&(b=new ResizeObserver(()=>{k()}),b.observe(S))}function E(S,T){const I=w.value[S];if(!I)return;const L=T==="original"?I.originalHeight:I.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(I.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(L)}px`}}return Ve(v,S=>{$(S),ft(()=>k())},{flush:"post"}),Ve([r,m],()=>{$(v.value),ft(()=>k())},{flush:"post",immediate:!0}),to(()=>{_!=null&&(window.cancelAnimationFrame(_),_=null),b?.disconnect(),b=null}),(S,T)=>(C(),A("pre",{ref_key:"preRef",ref:v,style:$t(a.value),class:Ee([s.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":r.value,"markstream-pre--diff-inline":l.value}]),"aria-busy":e.node.loading===!0,"aria-label":f.value,"data-language":n.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[r.value?(C(),A("code",ZB,[(C(!0),A(Ie,null,Xe(m.value,I=>(C(),A("span",{key:I.key,class:Ee(["markstream-pre__diff-pane",I.className])},[(C(!0),A(Ie,null,Xe(I.lines,(L,R)=>(C(),A("span",{key:L.key,class:Ee(["markstream-pre__diff-line",[`markstream-pre__diff-line--${L.kind}`,{"markstream-pre__diff-line--empty":L.empty}]]),style:$t(E(R,I.key))},[T[0]||(T[0]=h("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),h("span",QB,N(L.number),1),h("span",JB,[h("span",eF,N(L.code),1)])],6))),128))],2))),128))])):(C(),A(Ie,{key:1},[t.showLineNumbers?(C(),A("span",tF,[(C(!0),A(Ie,null,Xe(i.value,I=>(C(),A("span",{key:I,class:"markstream-pre__line-number"},N(I),1))),128))])):re("",!0),h("code",{translate:"no",class:"markstream-pre__code",textContent:N(e.node.code)},null,8,nF)],64))],14,XB))}});vo.install=e=>{e.component(vo.__name,vo)};const Im=al(!1);let B_=null;const sF={key:0},kn=jt(Ze({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=(B_||(B_=Tv().then(_=>{Im.value=!!_}).catch(()=>{Im.value=!1})),Ud(Im)),s=ou(),o=Nt("markstreamFade",void 0),i=Nt("markstreamTextStreamState",void 0),r=Nt("markstreamStreamVersion",void 0),l=j(()=>{const _=s.fade;return _===""||_===!0||_==="true"||_!==!1&&_!=="false"&&void 0}),a=j(()=>typeof l.value=="boolean"?l.value:typeof o?.value!="boolean"||o.value),c=j(()=>{var _;const b=(_=s["index-key"])!=null?_:s.indexKey;return b==null||b===""?"":String(b)}),u=te(t.node.content),d=te("");let p=r?.value;const m=te(0);function f(){return u.value+d.value}function v(){d.value&&(u.value=f(),d.value="")}Ve([()=>t.node.content,c,a,()=>r?.value],([_,b,g,y])=>{const k=String(_??""),$=c.value,E=y!==p;p=y;const S=Qx({nextContent:k,persistedContent:$?i?.get($):void 0,currentState:{settledContent:u.value,streamedDelta:d.value},typewriterEnabled:a.value,streamRenderVersionChanged:E});u.value=S.settledContent,d.value=S.streamedDelta,S.appended&&(m.value+=1),$&&i?.set($,k)},{immediate:!0}),Ve(a,_=>{var b;_||(b=f(),u.value=b,d.value="")});const w=j(()=>m.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(_,b)=>(C(),A("span",{class:Ee([[M(n)&&e.node.center?"text-node-center":""],"text-node"])},[u.value?(C(),A("span",sF,N(u.value),1)):re("",!0),d.value?(C(),A("span",{key:1,class:Ee(["text-node-stream-delta",[w.value]]),onAnimationend:v},N(d.value),35)):re("",!0)],2))}}),[["__scopeId","data-v-aae85f13"]]);kn.install=e=>{e.component(kn.__name,kn)};const uT=Ze({name:"CodeBlockNodeLoading",inheritAttrs:!1,setup(e,{attrs:t}){const n=t;return()=>{var s;return Ut(vo,Ct(nt({},t),{node:n.node,showLineNumbers:!0,reservedHeightPx:(s=n.estimatedHeightPx)!=null?s:n.estimatedContentHeightPx,class:["code-pre-fallback",t.class],"data-markstream-code-loading":"1"}))}}}),$m=Zo({loader:()=>un(null,null,function*(){try{return(yield Ks(()=>import("./CodeBlockNode-B8Y2oNuu.js"),__vite__mapDeps([2,3,4]))).default}catch(e){return console.warn('[markstream-vue] Optional peer dependencies for CodeBlockNode are missing. Falling back to preformatted code rendering (no Monaco). To enable full code block features, please install "stream-monaco".',e),vo}}),loadingComponent:uT,delay:0,suspensible:!1}),Po=Zo(()=>un(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,s,o,i;return Ut(kn,Ct(nt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))};try{if(yield Tv())return(yield Ks(()=>import("./index6-B9V50-1S.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,s,o,i;return Ut(kn,Ct(nt({},t),{node:{type:"text",content:(s=t.node.raw)!=null?s:`$${(n=t.node.content)!=null?n:""}$`,raw:(i=t.node.raw)!=null?i:`$${(o=t.node.content)!=null?o:""}$`}}))}})),dT=Zo(()=>un(null,null,function*(){try{if(yield Tv())return(yield Ks(()=>import("./index5-dYV8YnTO.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,s,o;return Ut(kn,Ct(nt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(s=e.node.content)!=null?s:""}$$`}}))}})),gs=jt(Ze({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(C(),A("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=s=>t.$emit("click",s,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=s=>t.$emit("mouseEnter",s,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=s=>t.$emit("mouseLeave",s,e.node.id,e.messageId,e.threadId))},N(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);gs.install=e=>{e.component(gs.__name,gs)};const oF={class:"superscript-node"},$s=jt(Ze({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,strong:vs,emphasis:bs,footnote_reference:Zs,strikethrough:ys,highlight:Js,insert:Ls,subscript:Ns,emoji:Is,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("sup",oF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"superscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);$s.install=e=>{e.component($s.__name,$s)};const iF={class:"subscript-node"},Ns=jt(Ze({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,strong:vs,emphasis:bs,footnote_reference:Zs,strikethrough:ys,highlight:Js,insert:Ls,superscript:$s,emoji:Is,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("sub",iF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"subscript"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Ns.install=e=>{e.component(Ns.__name,Ns)};const rF={class:"strong-node"},vs=jt(Ze({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,emphasis:bs,strikethrough:ys,highlight:Js,insert:Ls,subscript:Ns,superscript:$s,emoji:Is,footnote_reference:Zs,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("strong",rF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"strong"}-${l}`,components:s.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);vs.install=e=>{e.component(vs.__name,vs)};const lF={class:"strikethrough-node"},ys=jt(Ze({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,strong:vs,emphasis:bs,highlight:Js,insert:Ls,subscript:Ns,superscript:$s,emoji:Is,footnote_reference:Zs,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("del",lF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"strikethrough"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);ys.install=e=>{e.component(ys.__name,ys)};const aF=["href","title","aria-label","aria-hidden","target","rel"],cF=["aria-hidden"],uF={class:"link-text-wrapper relative inline-flex"},dF={class:"leading-[normal] link-text"},ks=jt(Ze({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=Nt("markstreamShowTooltips",void 0),s=j(()=>{const _=n?.value;return typeof _=="boolean"?_:t.showTooltip}),o=j(()=>{var _,b,g,y,k;const $=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(_=t.animationOpacity)!=null?_:.35,S=Math.max(.12,Math.min(.5*E,E)),T={"--underline-height":`${(b=t.underlineHeight)!=null?b:2}px`,"--underline-bottom":$,"--underline-opacity":String(E),"--underline-rest-opacity":String(S),"--underline-duration":`${(g=t.animationDuration)!=null?g:1.6}s`,"--underline-timing":(y=t.animationTiming)!=null?y:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(k=t.animationIteration)!=null?k:"infinite"};return t.color&&(T["--link-color"]=t.color),T}),i=Tn(()=>t.customId),r=j(()=>nt({text:kn,strong:vs,strikethrough:ys,emphasis:bs,image:lr,html_inline:Qs,inline_code:is},i.value)),l=ou(),a=j(()=>{var _,b;const g=(_=t.node)==null?void 0:_.attrs;if(!g||typeof g!="object")return{};const y={};if(Array.isArray(g))for(const k of g)Array.isArray(k)&&k[0]&&(y[String(k[0])]=String((b=k[1])!=null?b:""));else for(const[k,$]of Object.entries(g))k&&$!=null&&$!==!1&&(y[k]=$===!0?"":String($));return $_(y,"safe","a")}),c=j(()=>nt(nt({},l),a.value)),u=j(()=>{var _,b;return $_({href:String((b=(_=t.node)==null?void 0:_.href)!=null?b:"")},"safe","a").href}),d=j(()=>{if(!u.value)return;const _=c.value.target;return(typeof _=="string"?_.trim():String(_??"").trim())||(HR(u.value)?"_blank":void 0)}),p=j(()=>{var _;return String((_=d.value)!=null?_:"").trim().toLowerCase()==="_blank"}),m=j(()=>{if(!u.value)return;const _=c.value.rel,b=new Set((typeof _=="string"?_:String(_??"")).split(/\s+/).filter(Boolean)),g=new Set(Array.from(b).filter(y=>y.toLowerCase()!=="opener"));return p.value&&(g.add("noopener"),g.add("noreferrer")),g.size>0?Array.from(g).join(" "):void 0}),f=j(()=>{const _=nt({},c.value);return delete _.title,delete _.href,delete _.target,delete _.rel,_});function v(){s.value&&HB()}const w=j(()=>{var _,b;const g=(_=t.node)==null?void 0:_.title;return typeof g=="string"&&g.trim().length>0?g:String((b=u.value)!=null?b:"")});return(_,b)=>{var g,y;return e.node.loading?(C(),A("span",Kt({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},M(l),{style:o.value}),[h("span",uF,[h("span",dF,[mt(M(kn),{class:"leading-[normal] link-text",node:{type:"text",content:String((g=e.node.text)!=null?g:""),raw:String((y=e.node.text)!=null?y:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),b[1]||(b[1]=h("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,cF)):(C(),A("a",Kt({key:0,class:"link-node",href:u.value,title:s.value?"":w.value,"aria-label":`Link: ${w.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:m.value},f.value,{style:o.value,onMouseenter:b[0]||(b[0]=k=>(function($){var E,S,T,I;if(!s.value)return;const L=$,R=L?.clientX!=null&&L?.clientY!=null?{x:L.clientX,y:L.clientY}:void 0,O=((E=t.node)==null?void 0:E.title)||((S=u.value)!=null&&S.includes("xn--")&&((I=(T=t.node)==null?void 0:T.text)!=null&&I.includes("://"))?t.node.text:u.value)||"";FB($.currentTarget,O,"top",!1,R)})(k)),onMouseleave:v}),[(C(!0),A(Ie,null,Xe(e.node.children,(k,$)=>(C(),je(M(ti),{key:`${e.indexKey||"emphasis"}-${$}`,components:r.value,node:k,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${$}`},null,8,["components","node","custom-id","index-key"]))),128))],16,aF))}}}),[["__scopeId","data-v-367e6ca4"]]);ks.install=e=>{e.component(ks.__name,ks)};const fF={class:"insert-node"},Ls=jt(Ze({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,strong:vs,emphasis:bs,strikethrough:ys,highlight:Js,subscript:Ns,superscript:$s,emoji:Is,footnote_reference:Zs,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("ins",fF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"insert"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);Ls.install=e=>{e.component(Ls.__name,Ls)};const hF={class:"highlight-node"},Js=jt(Ze({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,strong:vs,emphasis:bs,strikethrough:ys,insert:Ls,subscript:Ns,superscript:$s,emoji:Is,footnote_reference:Zs,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("mark",hF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"highlight"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);Js.install=e=>{e.component(Js.__name,Js)};const pF={class:"emphasis-node"},bs=jt(Ze({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>nt({text:kn,inline_code:is,link:ks,html_inline:Qs,strong:vs,strikethrough:ys,highlight:Js,insert:Ls,subscript:Ns,superscript:$s,emoji:Is,footnote_reference:Zs,math_inline:Po,reference:gs},n.value));return(o,i)=>(C(),A("em",pF,[(C(!0),A(Ie,null,Xe(e.node.children,(r,l)=>(C(),je(M(ti),{key:`${e.indexKey||"emphasis"}-${l}`,components:s.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);bs.install=e=>{e.component(bs.__name,bs)};const mF={class:"hard-break"},ar=jt(Ze({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(C(),A("br",mF))}),[["__scopeId","data-v-50c58f70"]]);ar.install=e=>{e.component(ar.__name,ar)};const Yc=Ze({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=tr({checkbox:Xs,checkbox_input:Xs,emoji:Is,emphasis:bs,hardbreak:ar,highlight:Js,inline_code:is,insert:Ls,link:ks,reference:gs,strikethrough:ys,strong:vs,subscript:Ns,superscript:$s,text:kn}),s=Tn(()=>t.customId),o=j(()=>{const i=s.value;return Object.keys(i).length>0?nt(nt({},n),i):n});return(i,r)=>(C(!0),A(Ie,null,Xe(e.nodes,(l,a)=>(C(),je(M(ti),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function Qg(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(Qg)}function Af(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Qg))return e;if(!t||e.length!==1)return null;const s=e[0];if(s?.type!=="paragraph"||!Array.isArray(s.children))return null;const o=s.children;return(n||o.length>0)&&o.every(Qg)?o:null}function pa(e){var t,n;if(!e?.length)return null;let s="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;s+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return s}const gF=["cite"],vF={key:0,dir:"auto",class:"paragraph-node"},yF=["custom-id"],$d=jt(Ze({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Tn(()=>t.customId),s=j(()=>!!n.value.paragraph),o=j(()=>!!n.value.text),i=j(()=>Af(t.node.children,!s.value)),r=j(()=>t.fade!==!1||o.value?null:pa(i.value));return ln("markstreamShowTooltips",j(()=>t.showTooltips)),ln("markstreamFade",j(()=>t.fade)),(l,a)=>(C(),A("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[i.value?(C(),A("p",vF,[r.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(r.value),9,yF)):(C(),je(M(Yc),{key:1,nodes:i.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(C(),je(M(Os),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=c=>l.$emit("copy",c))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,gF))}}),[["__scopeId","data-v-abfecebc"]]);$d.install=e=>{e.component($d.__name,$d)};const kF={class:"definition-list"},bF={class:"definition-term"},_F={class:"definition-desc"},Nd=jt(Ze({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(C(),A("dl",kF,[(C(!0),A(Ie,null,Xe(t.node.items,(o,i)=>(C(),A(Ie,{key:i},[h("dt",bF,[mt(M(Os),{"index-key":`definition-term-${t.indexKey}-${i}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),h("dd",_F,[mt(M(Os),{"index-key":`definition-desc-${t.indexKey}-${i}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[1]||(s[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Nd.install=e=>{e.component(Nd.__name,Nd)};const wF=["href","title"],Tc=jt(Ze({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(s){var o;if(s.preventDefault(),typeof document>"u")return;const i=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(i);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(s,o)=>(C(),A("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,wF))}}),[["__scopeId","data-v-e1eb37b6"]]);Tc.install=e=>{e.component(Tc.__name,Tc)};const SF=["id"],CF={class:"flex-1"},Ld=Ze({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,s)=>(C(),A("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[h("div",CF,[mt(M(Os),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:s[0]||(s[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,SF))}});Ld.install=e=>{e.component(Ld.__name,Ld)};const xF=["custom-id"],Jg=jt(Ze({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tn(()=>t.customId),s=Nt("markstreamFade",void 0),o=j(()=>s?.value!==!1||n.value.text?null:pa(t.node.children)),i=j(()=>nt({text:kn,inline_code:is,link:ks,image:lr,strong:vs,emphasis:bs,strikethrough:ys,highlight:Js,insert:Ls,subscript:Ns,superscript:$s,emoji:Is,checkbox:Xs,checkbox_input:Xs,footnote_reference:Zs,hardbreak:ar,math_inline:Po,reference:gs},n.value));return(r,l)=>(C(),je(ss(`h${e.node.level}`),Kt({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:vn(()=>[o.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(o.value),9,xF)):(C(!0),A(Ie,{key:1},Xe(e.node.children,(a,c)=>(C(),je(M(ti),{key:c,components:i.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${c}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Ef=Jg;Ef.install=e=>{e.component(Jg.__name,Jg)};const TF={key:0,dir:"auto",class:"paragraph-node"},MF=["custom-id"],AF={dir:"auto",class:"paragraph-node"},EF=["custom-id"],ra=jt(Ze({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{}},emits:["copy"],setup(e){const t=e,n=j(()=>{var m;return(m=t.node)!=null?m:t.item}),s=Tn(()=>t.customId),o=j(()=>!!s.value.paragraph),i=j(()=>!!s.value.text),r=j(()=>{var m;return Af((m=n.value)==null?void 0:m.children,!o.value)}),l=j(()=>{var m;if(o.value)return null;const f=(m=n.value)==null?void 0:m.children;if(!Array.isArray(f)||f.length<2)return null;const v=f[0];if(v?.type!=="paragraph"||!Array.isArray(v.children))return null;const w=f.slice(1);if(!w.every(b=>b?.type==="list"))return null;const _=Af([v]);return _?{paragraphChildren:_,nestedLists:w}:null});function a(){return t.fade===!1&&!i.value}const c=j(()=>a()?pa(r.value):null),u=j(()=>{var m;return a()?pa((m=l.value)==null?void 0:m.paragraphChildren):null}),d=Object.freeze({}),p=j(()=>{const{value:m}=t;return typeof m=="number"&&Number.isFinite(m)?{value:m}:d});return ln("markstreamShowTooltips",j(()=>t.showTooltips)),ln("markstreamFade",j(()=>t.fade)),(m,f)=>{var v,w;return C(),A("li",Kt({class:"list-item",dir:"auto"},p.value),[r.value?(C(),A("p",TF,[c.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(c.value),9,MF)):(C(),je(M(Yc),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(C(),A(Ie,{key:1},[h("p",AF,[u.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(u.value),9,EF)):(C(),je(M(Yc),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(C(!0),A(Ie,null,Xe(l.value.nestedLists,(_,b)=>(C(),je(M(Os),{key:b,nodes:[_],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${b}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:f[0]||(f[0]=g=>m.$emit("copy",g))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade"]))),128))],64)):(C(),je(M(Os),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(w=(v=n.value)==null?void 0:v.children)!=null?w:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"batch-rendering":!1,onCopy:f[1]||(f[1]=_=>m.$emit("copy",_))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],16)}}}),[["__scopeId","data-v-356f1243"]]);ra.install=e=>{e.component(ra.__name,ra)};const la=jt(Ze({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=Tn(()=>e.customId),n=j(()=>t.value.list_item||ra);return(s,o)=>(C(),je(ss(e.node.ordered?"ol":"ul"),{class:Ee(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:vn(()=>[(C(!0),A(Ie,null,Xe(e.node.items,(i,r)=>{var l;return C(),je(ss(n.value),Kt({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:i,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>s.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-7c789f94"]]);la.install=e=>{e.component(la.__name,la)};const fT=Symbol("ViewportPriority");function IF(e,t){var n,s;const o=typeof window<"u"&&typeof document<"u",i=typeof t=="boolean"?te(t):t,r=o?(n=window.requestIdleCallback)!=null?n:_=>window.setTimeout(()=>_({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(s=window.cancelIdleCallback)!=null?s:_=>window.clearTimeout(_):null;let a=null,c=null;const u=new Map,d=new Set;let p=null;function m(){if(!u.size){try{a?.disconnect()}catch{}a=null,c=null,d.size||(function(){if(p!=null){try{l?.(p)}catch{}p=null}})()}}function f(_){const b=u.get(_);if(b){if(!b.visible.value){b.visible.value=!0;try{b.resolve()}catch{}}try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),m()}}function v(){r&&p==null&&d.size&&(p=r(()=>{p=null;const _=d.values().next().value;_&&(d.delete(_),f(_),d.size&&v())},{timeout:1200}))}const w=(_,b)=>{const g=te(!1);let y,k=!1;const $=new Promise(T=>{y=()=>{k||(k=!0,T())}}),E=()=>{try{a?.unobserve(_)}catch{}u.delete(_),d.delete(_),m()};if(!o||!i.value)return g.value=!0,y(),{isVisible:g,whenVisible:$,destroy:E};const S=(function(T,I){if(!o)return a;if(typeof IntersectionObserver>"u")return null;const L=(function(F,P){var q,K,G;return{root:(q=e?.(F??null))!=null?q:null,rootMargin:(K=P?.rootMargin)!=null?K:"300px",threshold:(G=P?.threshold)!=null?G:0}})(T,I);if(a&&(O=L,(R=c)&&R.root===O.root&&R.rootMargin===O.rootMargin&&R.threshold===O.threshold))return a;var R,O;if(a)try{a.disconnect()}catch{}a=new IntersectionObserver(F=>{for(const P of F)(P.isIntersecting||P.intersectionRatio>0)&&f(P.target)},{root:L.root,rootMargin:L.rootMargin,threshold:L.threshold}),c=L;for(const F of u.keys())a.observe(F);return a})(_,b);return S?(u.set(_,{resolve:y,visible:g}),S.observe(_),d.add(_),v(),{isVisible:g,whenVisible:$,destroy:E}):(g.value=!0,y(),{isVisible:g,whenVisible:$,destroy:E})};return ln(fT,w),w}function $F(){var e,t;const n=Nt(fT,void 0);if(n)return n;const s=new WeakMap;let o=null;const i=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:p=>window.setTimeout(()=>p({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:p=>window.clearTimeout(p):null,c=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},u=p=>{const m=s.get(p);if(m){if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()}},d=()=>{l&&r==null&&i.size&&(r=l(()=>{r=null;const p=i.values().next().value;p&&(i.delete(p),u(p),i.size&&d())},{timeout:1200}))};return p=>{const m=te(!1);let f,v=!1;const w=new Promise(g=>{f=()=>{v||(v=!0,g())}}),_=()=>{try{o?.unobserve(p)}catch{}s.delete(p),i.delete(p),i.size||c()},b=o||(typeof window>"u"||typeof IntersectionObserver>"u"?null:(o=new IntersectionObserver(g=>{for(const y of g)(y.isIntersecting||y.intersectionRatio>0)&&u(y.target)},{root:null,rootMargin:"300px",threshold:0}),o));return b?(s.set(p,{resolve:f,visible:m}),b.observe(p),i.add(p),d(),{isVisible:m,whenVisible:w,destroy:_}):(m.value=!0,f(),{isVisible:m,whenVisible:w,destroy:_})}}const NF={key:2,class:"html-block-node__raw"},LF=["innerHTML"],OF={key:1,class:"html-block-node__placeholder"},Mc=jt(Ze({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=Nt("markstreamHtmlPolicy",void 0),s=Nt("markstreamNestedRendererProps",void 0),o=j(()=>{var $,E;return(E=($=t.htmlPolicy)!=null?$:n?.value)!=null?E:"safe"}),i=j(()=>{var $,E;const S=($=s?.value)!=null?$:{};return Ct(nt({},S),{customId:(E=t.customId)!=null?E:S.customId,htmlPolicy:o.value})}),r=Zo({loader:()=>Promise.resolve().then(()=>Ov),suspensible:!1}),l=j(()=>{const $=Wg(t.node.attrs,o.value);if(!$)return;const E=Tf($);return Object.keys(E).length>0?E:void 0}),a=j(()=>{const $=String(t.node.tag||"").trim(),E=Wg(t.node.attrs,o.value,$);if(!E)return;const S=Tf(E);return Object.keys(S).length>0?S:void 0}),c=Tn(()=>t.customId),u=Ze({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=te(null),p=te(typeof window>"u"),m=te(t.node.content),f=j(()=>Array.isArray(t.node.children)?t.node.children:[]),v=j(()=>String(t.node.tag||"div")),w=j(()=>{const $=v.value.trim().toLowerCase();return lx.has($)||wv($,o.value)}),_=j(()=>f.value.length>0&&!!t.node.tag&&!w.value),b=j(()=>{var $,E,S;if(_.value)return{mode:"structured"};if(!p.value)return{mode:"html",content:($=m.value)!=null?$:""};const T=(E=m.value)!=null?E:t.node.content;if(!T)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:ia(T,o.value)};if(t.node.loading){const L=Mf(T,c.value,o.value);return L===null?{mode:"text",content:(S=t.node.raw)!=null?S:T}:{mode:"dynamic",nodes:L}}if(!aT(T,c.value))return{mode:"html",content:ia(T,o.value)};const I=Mf(T,c.value,o.value);return I===null?{mode:"html",content:ia(T,o.value)}:{mode:"dynamic",nodes:I}}),g=$F(),y=te(null),k=!!t.node.loading;return typeof window<"u"?(Ve(d,$=>{var E,S;if((S=(E=y.value)==null?void 0:E.destroy)==null||S.call(E),y.value=null,!k)return p.value=!0,void(m.value=t.node.content);if(!$)return void(p.value=!1);const T=g($,{rootMargin:"400px"});y.value=T,p.value=T.isVisible.value,T.whenVisible.then(()=>{p.value=!0})},{immediate:!0}),Ve(()=>t.node.content,$=>{k&&!p.value||(m.value=$)})):p.value=!0,to(()=>{var $,E;(E=($=y.value)==null?void 0:$.destroy)==null||E.call($),y.value=null}),($,E)=>(C(),je(ss(_.value?v.value:"div"),Kt({ref_key:"htmlRef",ref:d,class:"html-block-node"},_.value?a.value:void 0),{default:vn(()=>[p.value?(C(),A(Ie,{key:0},[b.value.mode==="structured"?(C(),je(M(r),Kt({key:0},i.value,{nodes:f.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):b.value.mode==="dynamic"?(C(),je(M(u),{key:1,nodes:b.value.nodes},null,8,["nodes"])):b.value.mode==="text"?(C(),A("pre",NF,N(b.value.content),1)):(C(),A("div",Kt({key:3},l.value,{innerHTML:b.value.content}),null,16,LF))],64)):(C(),A("div",OF,[Xl($.$slots,"placeholder",{node:e.node},()=>[E[0]||(E[0]=h("span",{class:"html-block-node__placeholder-bar"},null,-1)),E[1]||(E[1]=h("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),E[2]||(E[2]=h("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16))}}),[["__scopeId","data-v-f1744dfb"]]);Mc.install=e=>{e.component(Mc.__name,Mc)};const RF={dir:"auto",class:"paragraph-node"},PF=["custom-id"],sl=jt(Ze({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Tn(()=>t.customId),s=Nt("markstreamHtmlPolicy",void 0),o=Nt("markstreamFade",void 0),i=Nt("markstreamParseOptions",void 0),r=Nt("markstreamCustomMarkdownIt",void 0),l=Nt("markstreamNestedRendererProps",void 0),a=j(()=>{var S;return(S=s?.value)!=null?S:"safe"}),c=j(()=>{var S;return(S=t.parseOptions)!=null?S:i?.value}),u=j(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=j(()=>{var S,T;return(T=t.customHtmlTags)!=null?T:(S=l?.value)==null?void 0:S.customHtmlTags}),p=j(()=>{var S,T;const I=(S=l?.value)!=null?S:{};return Ct(nt({},I),{customId:(T=t.customId)!=null?T:I.customId,customHtmlTags:d.value,parseOptions:c.value,customMarkdownIt:u.value,htmlPolicy:a.value})}),m=Zo({loader:()=>Promise.resolve().then(()=>Ov),suspensible:!1});function f(S){var T;return S.type==="text"&&String((T=S.content)!=null?T:"").trim()===""}const v=j(()=>t.node.children.filter(S=>!f(S))),w=j(()=>v.value.length>0&&v.value.every(S=>S.type==="image"||(function(T){var I;const L=(function(R){return R.type==="link"&&Array.isArray(R.children)?R.children.filter(O=>!f(O)):[]})(T);return L.length===1&&((I=L[0])==null?void 0:I.type)==="image"})(S))),_=j(()=>new Set(ya(d.value))),b=j(()=>{if(!w.value||v.value.length<=1)return t.node.children;const S=[];for(let T=0;T<t.node.children.length;T++){const I=t.node.children[T];if(!f(I)){S.push(I);continue}const L=S.length>0,R=t.node.children.slice(T+1).some(O=>!f(O));L&&R&&S.push(Ct(nt({},I),{content:" ",raw:" "}))}return S}),g=j(()=>o?.value===!1&&!n.value.text),y=j(()=>g.value?pa(b.value):null);function k(S,T){return{node:S,"index-key":`${t.indexKey}-${T}`,"custom-id":t.customId,"custom-html-tags":d.value}}const $=j(()=>nt({inline_code:is,image:lr,link:ks,hardbreak:ar,emphasis:bs,strong:vs,strikethrough:ys,highlight:Js,insert:Ls,subscript:Ns,superscript:$s,html_inline:Qs,html_block:Mc,emoji:Is,checkbox:Xs,math_inline:Po,checkbox_input:Xs,reference:gs,footnote_anchor:Tc,footnote_reference:Zs,text:kn},n.value)),E=j(()=>b.value.map((S,T)=>{var I;const L=(function(R){var O,F,P,q;if(R.type==="html_block"||R.type==="html_inline"){const K=String((O=R.tag)!=null?O:"").trim().toLowerCase()||dx(R.content);if(K&&!_.value.has(K)&&fx((F=R.content)!=null?F:R.raw,K)){const G=String((q=(P=R.content)!=null?P:R.raw)!=null?q:"");return{child:{type:"text",content:G,raw:G},component:kn,isCustomComponent:!1}}}return{child:R,component:$.value[R.type],isCustomComponent:!!(n.value[R.type]&&!du(String(R.type)))}})(S);return Ct(nt({},L),{index:T,key:`${t.indexKey||"paragraph"}-${T}`,customAttrs:L.isCustomComponent?Mv(L.child,a.value):void 0,hasSlotChildren:Array.isArray(L.child.children)&&L.child.children.length>0,slotContent:String((I=L.child.content)!=null?I:""),originalChild:S})}));return(S,T)=>(C(),A("p",RF,[y.value!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(y.value),9,PF)):(C(!0),A(Ie,{key:1},Xe(E.value,I=>{return C(),A(Ie,{key:I.key},[w.value&&f(I.originalChild)?(C(),A(Ie,{key:0},[ht(N((L=I.originalChild,String((R=L.content)!=null?R:""))),1)],64)):I.isCustomComponent?(C(),je(ss(I.component),Kt({key:1,ref_for:!0},I.customAttrs,{node:I.child,loading:I.child.loading,"index-key":I.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":p.value.isDark}),{default:vn(()=>[I.hasSlotChildren?(C(),je(M(m),Kt({key:0,ref_for:!0},p.value,{nodes:I.child.children,"index-key":I.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):I.slotContent?(C(),je(M(m),Kt({key:1,ref_for:!0},p.value,{content:I.slotContent,final:!I.child.loading,"index-key":`${I.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(C(),je(ss(I.component),Kt({key:2,ref_for:!0},k(I.child,I.index)),null,16))],64);var L,R}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);sl.install=e=>{e.component(sl.__name,sl)};const DF={class:"table-node-wrapper"},BF=["aria-busy"],FF={key:0},HF=["custom-id"],WF=["aria-label","onPointerdown"],UF=["custom-id"],qF={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Ac=jt(Ze({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=j(()=>{var _;return(_=t.node.loading)!=null&&_}),s=j(()=>{var _;return(_=t.node.rows)!=null?_:[]}),o=te(null),i=te([]);let r=null;const l=j(()=>t.node.header.cells.length),a=j(()=>i.value.some(_=>Number.isFinite(_)&&_>0)),c=j(()=>a.value?i.value.map(_=>_>0?{width:`${_}px`}:void 0):[]);ln("markstreamShowTooltips",j(()=>t.showTooltips)),ln("markstreamFade",j(()=>t.fade));const u=Tn(()=>t.customId),d=j(()=>!!u.value.text),p=j(()=>!!u.value.paragraph),m=new WeakMap;function f(_){const b=t.fade===!1&&!d.value,g=!p.value,y=m.get(_);if(y?.children===_.children&&y.textFastPath===b&&y.paragraphFastPath===g)return y.info;const k=Af(_.children,g,!0),$={simpleChildren:k,plainText:k&&b?pa(k):null};return m.set(_,{children:_.children,textFastPath:b,paragraphFastPath:g,info:$}),$}function v(_){if(!r)return;_.preventDefault();const b=r.startWidth+r.nextStartWidth,g=Math.min(48,Math.floor(b/2)),y=Math.max(g,Math.min(b-g,Math.round(r.startWidth+_.clientX-r.startX))),k=[...r.widths];k[r.index]=y,k[r.index+1]=b-y,i.value=k}function w(){r&&(window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",w),window.removeEventListener("pointercancel",w),r=null)}return Ve(l,()=>{w(),i.value=[]}),to(w),(_,b)=>(C(),A("div",DF,[h("table",{ref_key:"tableRef",ref:o,class:Ee(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(C(),A("colgroup",FF,[(C(!0),A(Ie,null,Xe(e.node.header.cells,(g,y)=>(C(),A("col",{key:y,style:$t(c.value[y])},null,4))),128))])):re("",!0),h("thead",null,[h("tr",null,[(C(!0),A(Ie,null,Xe(e.node.header.cells,(g,y)=>(C(),A("th",{key:y,dir:"auto",class:Ee([g.align==="right"?"text-right":g.align==="center"?"text-center":"text-left"])},[f(g).plainText!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(f(g).plainText),9,HF)):f(g).simpleChildren?(C(),je(M(Yc),{key:1,nodes:f(g).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${y}`},null,8,["nodes","custom-id","index-key"])):(C(),je(M(Os),{key:2,nodes:g.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[0]||(b[0]=k=>_.$emit("copy",k))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),y<e.node.header.cells.length-1?(C(),A("button",{key:3,type:"button",class:"table-node__resize-handle","aria-label":`Resize columns ${y+1} and ${y+2}`,onPointerdown:k=>(function($,E){if(E.button!==0)return;const S=(function(){var L;const R=(L=o.value)==null?void 0:L.querySelectorAll("thead th");return Array.from(R??[],O=>Math.round(O.getBoundingClientRect().width))})(),T=S[$],I=S[$+1];T&&I&&(E.preventDefault(),r={index:$,startX:E.clientX,startWidth:T,nextStartWidth:I,widths:S},i.value=S,window.addEventListener("pointermove",v),window.addEventListener("pointerup",w),window.addEventListener("pointercancel",w))})(y,k)},null,40,WF)):re("",!0)],2))),128))])]),h("tbody",null,[(C(!0),A(Ie,null,Xe(s.value,(g,y)=>(C(),A("tr",{key:y},[(C(!0),A(Ie,null,Xe(g.cells,(k,$)=>(C(),A("td",{key:$,class:Ee([k.align==="right"?"text-right":k.align==="center"?"text-center":"text-left"]),dir:"auto"},[f(k).plainText!==null?(C(),A("span",{key:0,class:"text-node","custom-id":t.customId},N(f(k).plainText),9,UF)):f(k).simpleChildren?(C(),je(M(Yc),{key:1,nodes:f(k).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${y}-${$}`},null,8,["nodes","custom-id","index-key"])):(C(),je(M(Os),{key:2,nodes:k.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:b[1]||(b[1]=E=>_.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,BF),mt(Si,{name:"table-node-fade"},{default:vn(()=>[n.value?(C(),A("div",qF,[Xl(_.$slots,"loading",{isLoading:n.value},()=>[b[2]||(b[2]=h("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),b[3]||(b[3]=h("span",{class:"sr-only"},"Loading",-1))],!0)])):re("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Ac.install=e=>{e.component(Ac.__name,Ac)};const jF={class:"hr-node"},Od=jt({},[["render",function(e,t){return C(),A("hr",jF)}],["__scopeId","data-v-39b2349c"]]);Od.install=e=>{e.component(Od.__name,Od)};const zF={class:"unknown-node"},e1=Ze({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(C(),A("div",zF,N(e.node.raw),1))}),Rd=jt(Ze({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=j(()=>`vmr-container vmr-container-${t.node.name}`),s=Tn(()=>t.customId),o=j(()=>nt({text:kn,paragraph:sl,heading:Ef,inline_code:is,link:ks,image:lr,strong:vs,emphasis:bs,strikethrough:ys,insert:Ls,subscript:Ns,superscript:$s,checkbox:Xs,checkbox_input:Xs,hardbreak:ar,math_inline:Po,reference:gs,list:la,math_block:dT,table:Ac},s.value));return(i,r)=>(C(),A("div",Kt({class:n.value},e.node.attrs),[(C(!0),A(Ie,null,Xe(e.node.children,(l,a)=>{return C(),je(ss((c=l.type,o.value[c]||e1)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var c}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);Rd.install=e=>{e.component(Rd.__name,Rd)};const VF=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],F_=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function KF(e){if(e<=255)return VF[e];let t=0,n=F_.length-1;for(;t<=n;){const s=t+n>>1,o=F_[s];if(e<o[0])n=s-1;else{if(!(e>o[1]))return o[2];t=s+1}}return"L"}const GF=/[ \t\n\r\f]+/g,YF=/[\t\n\r\f]| {2,}|^ | $/;let Nm=null;const XF=new RegExp("\\p{Script=Arabic}","u"),xh=new RegExp("\\p{M}","u"),hT=new RegExp("\\p{Nd}","u");function H_(e){return XF.test(e)}function W_(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Ci(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){const s=e.charCodeAt(t+1);if(s>=56320&&s<=57343){if(W_(s-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(W_(n))return!0}}return!1}const ZF=new Set([" "," ","⁠","\uFEFF"]);function QF(e){return Ci(e)}function t1(e){return!(function(t){const n=If(t);return n!==null&&(Av.has(n)||rl.has(n))})(e)&&!(function(t){const n=If(t);return n!==null&&ZF.has(n)})(e)}const Av=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),Th=new Set(['"',"(","[","{","“","‘","«","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),Ev=new Set(["'","’"]),rl=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),JF=new Set([":",".","،","؛"]),eH=new Set(["၏"]),tH=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function nH(e){if(Iv(e))return!0;let t=!1;for(const n of e)if(rl.has(n))t=!0;else if(!t||!xh.test(n))return!1;return t}function sH(e){for(const t of e)if(!Av.has(t)&&!rl.has(t))return!1;return e.length>0}function oH(e){if(Iv(e))return!0;for(const t of e)if(!Th.has(t)&&!Ev.has(t)&&!xh.test(t))return!1;return e.length>0}function Iv(e){let t=!1;for(const n of e)if(n!=="\\"&&!xh.test(n)){if(!(Th.has(n)||rl.has(n)||Ev.has(n)))return!1;t=!0}return t}function pT(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const s=e.charCodeAt(n);if(s<56320||s>57343)return n;const o=n-1;if(o<0)return n;const i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function If(e){if(e.length===0)return null;const t=pT(e,e.length);return e.slice(t)}function iH(e){const t=Array.from(e);let n=t.length;for(;n>0;){const s=t[n-1];if(xh.test(s))n--;else{if(!Th.has(s)&&!Ev.has(s))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function rH(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function U_(e,t,n,s){const o=t[s],i=e[s];if(o==null)return i;const r=n[s];if(i.length===r)return i;const l=o.repeat(r);return e[s]=l,l}function q_(e,t){return e&&t!==null&&JF.has(t)}function lH(e){const t=If(e);return t!==null&&eH.has(t)}function aH(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function n1(e){let t=e.length;for(;t>0;){const n=pT(e,t),s=e.slice(n,t);if(tH.has(s))return!0;if(!rl.has(s))return!1;t=n}return!1}function cH(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
210
+ `)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const uH=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function mo(e){return e.length===1?e[0]:e.join("")}function dH(e,t){const n=[];for(let s=e.length-1;s>=0;s--)n.push(e[s]);return n.push(t),mo(n)}function fH(e,t,n,s){if(!uH.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let i=null,r=[],l=n,a=!1,c=0;for(const u of e){const d=cH(u,s),p=d==="text"&&t;i===null||d!==i||p!==a?(i!==null&&o.push({text:mo(r),isWordLike:a,kind:i,start:l}),i=d,r=[u],l=n+c,a=p,c+=u.length):(r.push(u),c+=u.length)}return i!==null&&o.push({text:mo(r),isWordLike:a,kind:i,start:l}),o}function Lm(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const hH=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function pH(e,t){const n=e.texts[t];return!!n.startsWith("www.")||hH.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function mH(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}const gH=new Set([":","-","/","×",",",".","+","–","—"]),j_=/^[A-Za-z0-9_]+[,:;]*$/,z_=/[,:;]+$/;function V_(e){for(const t of e)if(hT.test(t))return!0;return!1}function Pd(e){if(e.length===0)return!1;for(const t of e)if(!hT.test(t)&&!gH.has(t))return!1;return!0}function K_(e,t,n){var s,o,i;const r=(Nm===null&&(Nm=new Intl.Segmenter(void 0,{granularity:"word"})),Nm);let l=0;const a=[],c=[],u=[],d=[],p=[],m=[],f=[],v=[],w=[],_=[],b=[],g=[];for(const S of r.segment(e))for(const T of fH(S.segment,(s=S.isWordLike)!=null&&s,S.index,n)){let I=function(){m[G]!==null&&(c[G]=[U_(a,m,f,G)],m[G]=null),c[G].push(T.text),u[G]=u[G]||T.isWordLike,v[G]=v[G]||O,w[G]=w[G]||F,_[G]=q,b[G]=K,g[G]=q_(w[G],P)};const L=T.kind==="text",R=rH(T.text,T.isWordLike,T.kind),O=Ci(T.text),F=H_(T.text),P=If(T.text),q=n1(T.text),K=lH(T.text),G=l-1;t.carryCJKAfterClosingQuote&&L&&l>0&&d[G]==="text"&&O&&v[G]&&_[G]||L&&l>0&&d[G]==="text"&&sH(T.text)&&v[G]||L&&l>0&&d[G]==="text"&&b[G]?I():L&&l>0&&d[G]==="text"&&T.isWordLike&&F&&g[G]?(I(),u[G]=!0):R!==null&&l>0&&d[G]==="text"&&m[G]===R?f[G]=((o=f[G])!=null?o:1)+1:L&&!T.isWordLike&&l>0&&d[G]==="text"&&(nH(T.text)||T.text==="-"&&u[G])?I():(a[l]=T.text,c[l]=[T.text],u[l]=T.isWordLike,d[l]=T.kind,p[l]=T.start,m[l]=R,f[l]=R===null?0:1,v[l]=O,w[l]=F,_[l]=q,b[l]=K,g[l]=q_(F,P),l++)}for(let S=0;S<l;S++)m[S]===null?a[S]=mo(c[S]):a[S]=U_(a,m,f,S);for(let S=1;S<l;S++)d[S]==="text"&&!u[S]&&Iv(a[S])&&d[S-1]==="text"&&(a[S-1]+=a[S],u[S-1]=u[S-1]||u[S],a[S]="");const y=Array.from({length:l},()=>null);let k=-1;for(let S=l-1;S>=0;S--){const T=a[S];if(T.length!==0){if(d[S]==="text"&&!u[S]&&oH(T)&&k>=0&&d[k]==="text"){const I=(i=y[k])!=null?i:[];I.push(T),y[k]=I,p[k]=p[S],a[S]="";continue}k=S}}for(let S=0;S<l;S++){const T=y[S];T!=null&&(a[S]=dH(T,a[S]))}let $=0;for(let S=0;S<l;S++){const T=a[S];T.length!==0&&($!==S&&(a[$]=T,u[$]=u[S],d[$]=d[S],p[$]=p[S]),$++)}a.length=$,u.length=$,d.length=$,p.length=$;const E=(function(S){const T=S.texts.slice(),I=S.isWordLike.slice(),L=S.kinds.slice(),R=S.starts.slice();for(let O=0;O<T.length-1;O++){if(L[O]!=="text"||L[O+1]!=="text"||!Ci(T[O])||!Ci(T[O+1]))continue;const F=iH(T[O]);F!==null&&(T[O]=F.head,T[O+1]=F.tail+T[O+1],R[O+1]=R[O]+F.head.length)}return{len:T.length,texts:T,isWordLike:I,kinds:L,starts:R}})((function(S){const T=[],I=[],L=[],R=[];for(let O=0;O<S.len;O++){const F=S.texts[O],P=S.kinds[O],q=S.isWordLike[O];if(P==="text"&&q&&j_.test(F)){const K=[F];let G=z_.test(F),oe=O+1;for(;G&&oe<S.len&&S.kinds[oe]==="text"&&S.isWordLike[oe]&&j_.test(S.texts[oe]);){const J=S.texts[oe];K.push(J),G=z_.test(J),oe++}T.push(mo(K)),I.push(!0),L.push("text"),R.push(S.starts[O]),O=oe-1;continue}T.push(F),I.push(q),L.push(P),R.push(S.starts[O])}return{len:T.length,texts:T,isWordLike:I,kinds:L,starts:R}})((function(S){const T=[],I=[],L=[],R=[];for(let O=0;O<S.len;O++){const F=S.texts[O];if(S.kinds[O]==="text"&&F.includes("-")){const P=F.split("-");let q=P.length>1;for(let K=0;K<P.length;K++){const G=P[K];if(!q)break;G.length!==0&&V_(G)&&Pd(G)||(q=!1)}if(q){let K=0;for(let G=0;G<P.length;G++){const oe=P[G],J=G<P.length-1?`${oe}-`:oe;T.push(J),I.push(!0),L.push("text"),R.push(S.starts[O]+K),K+=J.length}continue}}T.push(F),I.push(S.isWordLike[O]),L.push(S.kinds[O]),R.push(S.starts[O])}return{len:T.length,texts:T,isWordLike:I,kinds:L,starts:R}})((function(S){const T=[],I=[],L=[],R=[];for(let O=0;O<S.len;O++){const F=S.texts[O],P=S.kinds[O];if(P==="text"&&Pd(F)&&V_(F)){const q=[F];let K=O+1;for(;K<S.len&&S.kinds[K]==="text"&&Pd(S.texts[K]);)q.push(S.texts[K]),K++;T.push(mo(q)),I.push(!0),L.push("text"),R.push(S.starts[O]),O=K-1;continue}T.push(F),I.push(S.isWordLike[O]),L.push(P),R.push(S.starts[O])}return{len:T.length,texts:T,isWordLike:I,kinds:L,starts:R}})((function(S){const T=[],I=[],L=[],R=[];for(let O=0;O<S.len;O++){const F=S.texts[O];if(T.push(F),I.push(S.isWordLike[O]),L.push(S.kinds[O]),R.push(S.starts[O]),!mH(F))continue;const P=O+1;if(P>=S.len||Lm(S.kinds[P]))continue;const q=[],K=S.starts[P];let G=P;for(;G<S.len&&!Lm(S.kinds[G]);)q.push(S.texts[G]),G++;q.length>0&&(T.push(mo(q)),I.push(!0),L.push("text"),R.push(K),O=G-1)}return{len:T.length,texts:T,isWordLike:I,kinds:L,starts:R}})((function(S){const T=S.texts.slice(),I=S.isWordLike.slice(),L=S.kinds.slice(),R=S.starts.slice();for(let F=0;F<S.len;F++){if(L[F]!=="text"||!pH(S,F))continue;const P=[T[F]];let q=F+1;for(;q<S.len&&!Lm(L[q]);){P.push(T[q]),I[F]=!0;const K=T[q].includes("?");if(L[q]="text",T[q]="",q++,K)break}T[F]=mo(P)}let O=0;for(let F=0;F<T.length;F++){const P=T[F];P.length!==0&&(O!==F&&(T[O]=P,I[O]=I[F],L[O]=L[F],R[O]=R[F]),O++)}return T.length=O,I.length=O,L.length=O,R.length=O,{len:O,texts:T,isWordLike:I,kinds:L,starts:R}})((function(S){const T=[],I=[],L=[],R=[];let O=0;for(;O<S.len;){const F=[S.texts[O]];let P=S.isWordLike[O],q=S.kinds[O],K=S.starts[O];if(q==="glue"){const G=[F[0]],oe=K;for(O++;O<S.len&&S.kinds[O]==="glue";)G.push(S.texts[O]),O++;const J=mo(G);if(!(O<S.len&&S.kinds[O]==="text")){T.push(J),I.push(!1),L.push("glue"),R.push(oe);continue}F[0]=J,F.push(S.texts[O]),P=S.isWordLike[O],q="text",K=oe,O++}else O++;if(q==="text")for(;O<S.len&&S.kinds[O]==="glue";){const G=[];for(;O<S.len&&S.kinds[O]==="glue";)G.push(S.texts[O]),O++;const oe=mo(G);O<S.len&&S.kinds[O]==="text"?(F.push(oe,S.texts[O]),P=P||S.isWordLike[O],O++):F.push(oe)}T.push(mo(F)),I.push(P),L.push(q),R.push(K)}return{len:T.length,texts:T,isWordLike:I,kinds:L,starts:R}})({len:$,texts:a,isWordLike:u,kinds:d,starts:p})))))));for(let S=0;S<E.len-1;S++){const T=aH(E.texts[S]);T!==null&&(E.kinds[S]!=="space"&&E.kinds[S]!=="preserved-space"||E.kinds[S+1]!=="text"||!H_(E.texts[S+1])||(E.texts[S]=T.space,E.isWordLike[S]=!1,E.kinds[S]=E.kinds[S]==="preserved-space"?"preserved-space":"space",E.texts[S+1]=T.marks+E.texts[S+1],E.starts[S+1]=E.starts[S]+T.space.length))}return E}function vH(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}let Ll=null;const G_=new Map;let Ol=null;const yH=new RegExp("\\p{Emoji_Presentation}","u"),kH=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let Om=null;const Y_=new Map;function s1(){if(Ll!==null)return Ll;if(typeof OffscreenCanvas<"u")return Ll=new OffscreenCanvas(1,1).getContext("2d"),Ll;if(typeof document<"u")return Ll=document.createElement("canvas").getContext("2d"),Ll;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Vi(e,t){let n=t.get(e);return n===void 0&&(n={width:s1().measureText(e).width,containsCJK:Ci(e)},t.set(e,n)),n}function Mh(){if(Ol!==null)return Ol;if(typeof navigator>"u")return Ol={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ol;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ol={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},Ol}function mT(){return Om===null&&(Om=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Om}function bH(e){return yH.test(e)||e.includes("️")}function qr(e,t,n){return n===0?t.width:t.width-(function(s,o){return o.emojiCount===void 0&&(o.emojiCount=(function(i){let r=0;const l=mT();for(const a of l.segment(i))bH(a.segment)&&r++;return r})(s)),o.emojiCount})(e,t)*n}function _H(e,t){for(;t<e.widths.length;){const n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function wH(e,t){if(t<=0)return 0;const n=e%t;return Math.abs(n)<=1e-6?t:t-n}function X_(e,t,n){const{widths:s,kinds:o,breakableFitAdvances:i}=e;if(s.length===0)return 0;const r=t+Mh().lineFitEpsilon;let l=0,a=0,c=!1,u=0,d=0,p=-1,m=0;function f(y=u,k=d,$=a){l++,a=0,c=!1,p=-1,m=0}function v(y,k){c=!0,u=y+1,d=0,a=k}function w(y,k,$){c=!0,u=y,d=k+1,a=$}function _(y,k){c?(a+=k,u=y+1,d=0):v(y,k)}function b(y,k){const $=i[y];for(let E=k;E<$.length;E++){const S=$[E];c?a+S>r?(f(),w(y,E,S)):(a+=S,u=y,d=E+1):w(y,E,S)}c&&u===y&&d===$.length&&(u=y+1,d=0)}let g=0;for(;g<s.length&&(c||(g=_H(e,g),!(g>=s.length)));){const y=s[g],k=o[g],$=k==="space"||k==="preserved-space"||k==="tab"||k==="zero-width-break"||k==="soft-hyphen";if(c)if(a+y>r){if($){_(g,y),f(g+1,0,a-y),g++;continue}if(p>=0){if(u>p||u===p&&d>0){f();continue}f(p,0,m);continue}if(y>t&&i[g]!==null){f(),b(g,0),g++;continue}f()}else _(g,y),$&&(p=g+1,m=a-y),g++;else y>t&&i[g]!==null?b(g,0):v(g,y),$&&(p=g+1,m=a-y),g++}return c&&f(),l}let Rm=null;function SH(e,t){const n=[];let s=[],o=0,i=!1,r=!1,l=!1;function a(){s.length!==0&&(n.push({text:s.length===1?s[0]:s.join(""),start:o}),s=[],i=!1,r=!1,l=!1)}function c(d,p,m){s=[d],o=p,i=m,r=n1(d),l=Th.has(d)}function u(d,p){s.push(d),i=i||p;const m=n1(d);r=d.length===1&&rl.has(d)&&r||m,l=!1}for(const d of(Rm===null&&(Rm=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Rm).segment(e)){const p=d.segment,m=Ci(p);s.length!==0?l||Av.has(p)||rl.has(p)||t.carryCJKAfterClosingQuote&&m&&r?u(p,m):i||m?(a(),c(p,d.index,m)):u(p,m):c(p,d.index,m)}return a(),n}function CH(e){if(e.length<=1)return e;const t=[];let n=[e[0].text],s=e[0].start,o=Ci(e[0].text),i=t1(e[0].text);function r(){t.push({text:n.length===1?n[0]:n.join(""),start:s})}for(let l=1;l<e.length;l++){const a=e[l],c=Ci(a.text),u=t1(a.text);o&&i?(n.push(a.text),o=o||c,i=u):(r(),n=[a.text],s=a.start,o=c,i=u)}return r(),t}function xH(e,t,n,s){const o=Mh(),{cache:i,emojiCorrection:r}=(function(E,S){s1().font=E;const T=(function(R){let O=G_.get(R);return O||(O=new Map,G_.set(R,O)),O})(E),I=(function(R){const O=R.match(/(\d+(?:\.\d+)?)\s*px/);return O?parseFloat(O[1]):16})(E),L=S?(function(R,O){let F=Y_.get(R);if(F!==void 0)return F;const P=s1();P.font=R;const q=P.measureText("😀").width;if(F=0,q>O+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=R,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const G=K.getBoundingClientRect().width;document.body.removeChild(K),q-G>.5&&(F=q-G)}return Y_.set(R,F),F})(E,I):0;return{cache:T,fontSize:I,emojiCorrection:L}})(t,(l=e.normalized,kH.test(l)));var l;const a=qr("-",Vi("-",i),r),c=8*qr(" ",Vi(" ",i),r);if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const u=[],d=[],p=[],m=[];let f=e.chunks.length<=1;const v=null,w=[],_=n?[]:null,b=Array.from({length:e.len});function g(E,S,T,I,L,R,O){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(f=!1),u.push(S),d.push(T),p.push(I),m.push(L),w.push(O),_!==null&&_.push(E)}function y(E,S,T,I,L){const R=Vi(E,i),O=qr(E,R,r),F=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:O,P=S==="space"||S==="zero-width-break"?0:O;if(L&&I&&E.length>1){let q="sum-graphemes";Pd(E)?q="pair-context":o.preferPrefixWidthsForBreakableRuns&&(q="segment-prefixes");const K=(function(G,oe,J,he,Ne){if(oe.breakableFitAdvances!==void 0)return oe.breakableFitAdvances;const Fe=mT(),We=[];for(const _e of Fe.segment(G))We.push(_e.segment);if(We.length<=1)return oe.breakableFitAdvances=null,oe.breakableFitAdvances;if(Ne==="sum-graphemes"){const _e=[];for(const ue of We){const z=Vi(ue,J);_e.push(qr(ue,z,he))}return oe.breakableFitAdvances=_e,oe.breakableFitAdvances}if(Ne==="pair-context"||We.length>96){const _e=[];let ue=null,z=0;for(const X of We){const fe=qr(X,Vi(X,J),he);if(ue===null)_e.push(fe);else{const D=ue+X,Z=Vi(D,J);_e.push(qr(D,Z,he)-z)}ue=X,z=fe}return oe.breakableFitAdvances=_e,oe.breakableFitAdvances}const $e=[];let me="",ke=0;for(const _e of We){me+=_e;const ue=qr(me,Vi(me,J),he);$e.push(ue-ke),ke=ue}return oe.breakableFitAdvances=$e,oe.breakableFitAdvances})(E,R,i,r,q);return void g(E,O,F,P,S,T,K)}g(E,O,F,P,S,T,null)}for(let E=0;E<e.len;E++){b[E]=u.length;const S=e.texts[E],T=e.isWordLike[E],I=e.kinds[E],L=e.starts[E];if(I==="soft-hyphen"){g(S,0,a,a,I,L,null);continue}if(I==="hard-break"){g(S,0,0,0,I,L,null);continue}if(I==="tab"){g(S,0,0,0,I,L,null);continue}const R=Vi(S,i);if(I==="text"&&R.containsCJK){const O=SH(S,o),F=s==="keep-all"?CH(O):O;for(let P=0;P<F.length;P++){const q=F[P];y(q.text,"text",L+q.start,T,s==="keep-all"||!Ci(q.text))}continue}y(S,I,L,T,!0)}const k=(function(E,S,T){const I=[];for(let L=0;L<E.length;L++){const R=E[L],O=R.startSegmentIndex<S.length?S[R.startSegmentIndex]:T,F=R.endSegmentIndex<S.length?S[R.endSegmentIndex]:T,P=R.consumedEndSegmentIndex<S.length?S[R.consumedEndSegmentIndex]:T;I.push({startSegmentIndex:O,endSegmentIndex:F,consumedEndSegmentIndex:P})}return I})(e.chunks,b,u.length),$=v===null?null:(function(E,S){const T=(function(L){const R=L.length;if(R===0)return null;const O=new Array(R);let F=!1;for(let J=0;J<R;){const he=L.charCodeAt(J);let Ne=he,Fe=1;if(he>=55296&&he<=56319&&J+1<R){const $e=L.charCodeAt(J+1);$e>=56320&&$e<=57343&&(Ne=$e-56320+(he-55296<<10)+65536,Fe=2)}const We=KF(Ne);We!=="R"&&We!=="AL"&&We!=="AN"||(F=!0);for(let $e=0;$e<Fe;$e++)O[J+$e]=We;J+=Fe}if(!F)return null;let P=0;for(let J=0;J<R;J++){const he=O[J];if(he==="L"){P=0;break}if(he==="R"||he==="AL"){P=1;break}}const q=new Int8Array(R);for(let J=0;J<R;J++)q[J]=P;const K=1&P?"R":"L",G=K;let oe=G;for(let J=0;J<R;J++)O[J]==="NSM"?O[J]=oe:oe=O[J];oe=G;for(let J=0;J<R;J++){const he=O[J];he==="EN"?O[J]=oe==="AL"?"AN":"EN":he!=="R"&&he!=="L"&&he!=="AL"||(oe=he)}for(let J=0;J<R;J++)O[J]==="AL"&&(O[J]="R");for(let J=1;J<R-1;J++)O[J]==="ES"&&O[J-1]==="EN"&&O[J+1]==="EN"&&(O[J]="EN"),O[J]!=="CS"||O[J-1]!=="EN"&&O[J-1]!=="AN"||O[J+1]!==O[J-1]||(O[J]=O[J-1]);for(let J=0;J<R;J++){if(O[J]!=="EN")continue;let he;for(he=J-1;he>=0&&O[he]==="ET";he--)O[he]="EN";for(he=J+1;he<R&&O[he]==="ET";he++)O[he]="EN"}for(let J=0;J<R;J++){const he=O[J];he!=="WS"&&he!=="ES"&&he!=="ET"&&he!=="CS"||(O[J]="ON")}oe=G;for(let J=0;J<R;J++){const he=O[J];he==="EN"?O[J]=oe==="L"?"L":"EN":he!=="R"&&he!=="L"||(oe=he)}for(let J=0;J<R;J++){if(O[J]!=="ON")continue;let he=J+1;for(;he<R&&O[he]==="ON";)he++;const Ne=(J>0?O[J-1]:G)!=="L"?"R":"L";if(Ne===((he<R?O[he]:G)!=="L"?"R":"L"))for(let Fe=J;Fe<he;Fe++)O[Fe]=Ne;J=he-1}for(let J=0;J<R;J++)O[J]==="ON"&&(O[J]=K);for(let J=0;J<R;J++){const he=O[J];1&q[J]?he!=="L"&&he!=="AN"&&he!=="EN"||q[J]++:he==="R"?q[J]++:he!=="AN"&&he!=="EN"||(q[J]+=2)}return q})(E);if(T===null)return null;const I=new Int8Array(S.length);for(let L=0;L<S.length;L++)I[L]=T[S[L]];return I})(e.normalized,v);return _!==null?{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:f,segLevels:$,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k,segments:_}:{widths:u,lineEndFitAdvances:d,lineEndPaintAdvances:p,kinds:m,simpleLineWalkFastPath:f,segLevels:$,breakableFitAdvances:w,discretionaryHyphenWidth:a,tabStopAdvance:c,chunks:k}}function TH(e,t,n){return(function(s,o,i,r){var l;const a=(l=r?.wordBreak)!=null?l:"normal";return xH((function(c,u,d="normal",p="normal"){const m=(function(w){const _=w??"normal";return _==="pre-wrap"?{mode:_,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:_,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}})(d),f=m.mode==="pre-wrap"?(function(w){return/[\r\f]/.test(w)?w.replace(/\r\n/g,`
211
+ `).replace(/[\r\f]/g,`
212
+ `):w.replace(/\r\n/g,`
213
+ `)})(c):(function(w){if(!YF.test(w))return w;let _=w.replace(GF," ");return _.charCodeAt(0)===32&&(_=_.slice(1)),_.length>0&&_.charCodeAt(_.length-1)===32&&(_=_.slice(0,-1)),_})(c);if(f.length===0)return{normalized:f,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const v=p==="keep-all"?(function(w){if(w.len<=1)return w;const _=[],b=[],g=[],y=[];let k=null,$=!1,E=0,S=!1,T=!1;function I(){k!==null&&(_.push(mo(k)),b.push($),g.push("text"),y.push(E),k=null)}for(let L=0;L<w.len;L++){const R=w.texts[L],O=w.kinds[L],F=w.isWordLike[L],P=w.starts[L];if(O==="text"){const q=QF(R),K=t1(R);if(k!==null&&S&&T){k.push(R),$=$||F,S=S||q,T=K;continue}I(),k=[R],$=F,E=P,S=q,T=K;continue}I(),_.push(R),b.push(F),g.push(O),y.push(P)}return I(),{len:_.length,texts:_,isWordLike:b,kinds:g,starts:y}})(K_(f,u,m)):K_(f,u,m);return nt({normalized:f,chunks:vH(v,m)},v)})(s,Mh(),r?.whiteSpace,a),o,!1,a)})(e,t,0,n)}const Pm="__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__",An=(()=>{const e=globalThis;if(e[Pm])return e[Pm];const t={configs:{},controllers:{},revision:al(0),preparedCache:new Map,blockEstimateCache:new Map};return e[Pm]=t,t})();let tc=null;const Z_=An.revision;function Q_(e){var t;return e&&(t=An.configs[e])!=null?t:null}function J_(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function MH(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function Dm(e){var t,n,s;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const i of e){if(!MH(i))return null;i.type==="text"?o+=String((t=i.content)!=null?t:""):i.type==="emoji"?o+=String((s=(n=i.name)!=null?n:i.raw)!=null?s:""):i.type==="hardbreak"&&(o+=`
214
+ `)}return o.length>0?o:null}function Bm(e,t,n){var s,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var i;if(tc!=null)return tc;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return tc=!!((i=r.getContext)!=null&&i.call(r,"2d")),tc}catch{return tc=!1,!1}})())return null;try{const i=Math.round(100*t)/100,r=[(s=n.whiteSpace)!=null?s:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join("\0"),l=An.blockEstimateCache.get(r);if(l)return An.blockEstimateCache.delete(r),An.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",c=(function(m,f,v){const w=`${v}\0${f}\0${m}`,_=An.preparedCache.get(w);if(_)return An.preparedCache.delete(w),An.preparedCache.set(w,_),_.prepared;const b=TH(m,f,{whiteSpace:v});for(An.preparedCache.set(w,{prepared:b});An.preparedCache.size>240;){const g=An.preparedCache.keys().next().value;if(!g)break;An.preparedCache.delete(g)}return b})(e,n.font,a),u=(function(m,f,v){const w=(function(_,b){return _.simpleLineWalkFastPath?X_(_,b):(function(g,y){if(g.simpleLineWalkFastPath)return X_(g,y);const{widths:k,lineEndFitAdvances:$,lineEndPaintAdvances:E,kinds:S,breakableFitAdvances:T,discretionaryHyphenWidth:I,tabStopAdvance:L,chunks:R}=g;if(k.length===0||R.length===0)return 0;const O=Mh(),F=O.lineFitEpsilon,P=y+F;let q=0,K=0,G=!1,oe=0,J=0,he=-1,Ne=0,Fe=0,We=null;function $e(){he=-1,Ne=0,Fe=0,We=null}function me(Z=oe,ne=J,se=K){q++,K=0,G=!1,$e()}function ke(Z,ne){G=!0,oe=Z+1,J=0,K=ne}function _e(Z,ne,se){G=!0,oe=Z,J=ne+1,K=se}function ue(Z,ne){G?(K+=ne,oe=Z+1,J=0):ke(Z,ne)}function z(Z,ne,se,ae){if(!ne)return;const H=Z==="tab"?0:$[se],U=Z==="tab"?ae:E[se];he=se+1,Ne=K-ae+H,Fe=K-ae+U,We=Z}function X(Z,ne){const se=T[Z];for(let ae=ne;ae<se.length;ae++){const H=se[ae];G?K+H>P?(me(),_e(Z,ae,H)):(K+=H,oe=Z,J=ae+1):_e(Z,ae,H)}G&&oe===Z&&J===se.length&&(oe=Z+1,J=0)}function fe(Z){if(We!=="soft-hyphen")return!1;const ne=T[Z];if(ne==null)return!1;const{fitCount:se,fittedWidth:ae}=(function(H,U,Q,ce,pe){let xe=0,ie=U;for(;xe<H.length;){const be=ie+H[xe];if((xe+1<H.length?be+pe:be)>Q+ce)break;ie=be,xe++}return{fitCount:xe,fittedWidth:ie}})(ne,K,y,F,I);return se!==0&&(K=ae,oe=Z,J=se,$e(),se===ne.length?(oe=Z+1,J=0,!0):(me(Z,se,ae+I),X(Z,se),!0))}function D(Z){q++,$e()}for(let Z=0;Z<R.length;Z++){const ne=R[Z];if(ne.startSegmentIndex===ne.endSegmentIndex){D();continue}G=!1,K=0,ne.startSegmentIndex,oe=ne.startSegmentIndex,J=0,$e();let se=ne.startSegmentIndex;for(;se<ne.endSegmentIndex;){const ae=S[se],H=ae==="space"||ae==="preserved-space"||ae==="tab"||ae==="zero-width-break"||ae==="soft-hyphen",U=ae==="tab"?wH(K,L):k[se];if(ae!=="soft-hyphen")if(G){if(K+U>P){const Q=K+(ae==="tab"?0:$[se]),ce=K+(ae==="tab"?U:E[se]);if(We==="soft-hyphen"&&O.preferEarlySoftHyphenBreak&&Ne<=P){me(he,0,Fe);continue}if(We==="soft-hyphen"&&fe(se)){se++;continue}if(H&&Q<=P){ue(se,U),me(se+1,0,ce),se++;continue}if(he>=0&&Ne<=P){if(oe>he||oe===he&&J>0){me();continue}const pe=he;me(pe,0,Fe),se=pe;continue}if(U>y&&T[se]!==null){me(),X(se,0),se++;continue}me();continue}ue(se,U),z(ae,H,se,U),se++}else U>y&&T[se]!==null?X(se,0):ke(se,U),z(ae,H,se,U),se++;else G&&(oe=se+1,J=0,he=se+1,Ne=K+I,Fe=K+I,We=ae),se++}if(G){const ae=he===ne.consumedEndSegmentIndex?Fe:K;me(ne.consumedEndSegmentIndex,0,ae)}}return q})(_,b)})(m,f);return{lineCount:w,height:w*v}})(c,Math.max(24,i-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,u.height),p=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(An.blockEstimateCache.set(r,{height:p,contentHeight:Math.round(d)});An.blockEstimateCache.size>4e3;){const m=An.blockEstimateCache.keys().next().value;if(!m)break;An.blockEstimateCache.delete(m)}return{kind:"simple-text",height:p,contentHeight:Math.round(d)}}catch{return null}}function gT(e,t,n){var s,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const i=Dm(e.children);return i&&n.paragraph?Bm(i,t,n.paragraph):null}if(e.type==="heading"){const i=Number(e.level||0),r=Dm(e.children),l=n.headings[i];return r&&l?Bm(r,t,l):null}if(e.type==="list_item"){const i=Array.isArray(e.children)?e.children:[];if(i.length!==1||((s=i[0])==null?void 0:s.type)!=="paragraph"||!n.listItem)return null;const r=Dm((o=i[0])==null?void 0:o.children);return r?Bm(r,t,n.listItem):null}if(e.type==="list"){const i=Array.isArray(e.items)?e.items:[];if(!i.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of i){const a=gT(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function hd(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function AH(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function Fm(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const s=window.getComputedStyle(t),o=e.offsetHeight,i=J_(s.lineHeight,1.5*J_(s.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:AH(s),lineHeight:i,wrapperOverhead:Math.max(0,o-i),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}function $f(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function EH(e){var t;for(const n of e.split(/\r?\n/)){const s=n.trim();if(!s||s.startsWith("%%"))continue;const o=s.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function vT(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),s=EH(e);return s==="gantt"?220+28*n:s==="sequencediagram"?180+26*n:s==="classdiagram"||s==="statediagram"||s==="erdiagram"?180+24*n:s==="flowchart"||s==="graph"?170+28*n:200+22*n}function yT(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function kT(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function bT(e,t=360,n=500){return kT(e,t,n)}function _T(e,t=360,n=500){return kT(e,t,n)}function ew(e,t,n,s){var o;const i=(function(p){return Math.max(0,Math.ceil(p.scrollHeight||0)-Math.ceil(p.clientHeight||0))})(e),r=(function(p,m){return Number.isFinite(p)?Math.min(Math.max(0,p),m):0})(n,i);if(!s.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,i-r),a=[-l,l];let c=a[0],u=Number.POSITIVE_INFINITY;for(const p of a){e.scrollTop=p;const m=s.getNormalizedScrollTop(e,t,!1),f=Math.abs(m-r);f<u&&(u=f,c=p)}e.scrollTop=c;const d=(o=s.epsilonPx)!=null?o:2;Math.abs(s.getNormalizedScrollTop(e,t,!1)-r)>d&&(e.scrollTop=c)}const wT=Symbol("MarkstreamMathBlockMinHeightCache");function Efe(){return Nt(wT,null)}const IH=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],$H=["tokenCloneMs","processTokensMs","parseMarkdownToStructureTotalMs"],NH=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition"]),ST=["raw","content","code","originalCode","updatedCode"],tw=new WeakMap,nw=new WeakMap;let LH=1;function Io(){return typeof performance<"u"?performance.now():Date.now()}function sw(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function bo(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=tw.get(t);return n||(n=LH++,tw.set(t,n)),String(n)}function ow(e,t,n,s={}){var o,i;const r=s.includeFinal!==!1,l={md:bo(t),customMarkdownIt:bo(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],streamParse:(i=e.streamParse)!=null?i:"auto",validateLink:bo(e.validateLink),preTransformTokens:bo(e.preTransformTokens),postTransformTokens:bo(e.postTransformTokens)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function iw(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(`
215
+ `,t-1)+1;return e.slice(n,t).trim()}function rw(e){const t=CT(e);return t.length>=2&&t.every(n=>{const s=n.trim();return s.length>=1&&s.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function CT(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function xT(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function $v(e){const t=String(e??"");return`${t.length}:${xT(t)}`}function o1(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?$v(r):`${r.length}:${xT(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${bo(e)}`;if(typeof e!="object")return typeof e;const s=e,o=t.get(s);if(o)return`cycle:${o}`;if(n>=6)return`object:${bo(s)}`;const i=bo(s);if(t.set(s,i),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>o1(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(c=>`${c}:${o1(r[c],t,n+1)}`).join(";")}`}return typeof e}function Nf(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function TT(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(s=>Nf(s)?gr(s,t,n+1):TT(s,t,n+1)).join(",")}`:Nf(e)?gr(e,t,n):o1(e,t,n)}function OH(e,t,n){return Object.keys(e).sort().filter(s=>s!=="children"&&!ST.includes(s)).map(s=>{const o=e[s];return typeof o=="string"?`${s}=s:${$v(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${s}=${String(o)}`:typeof o=="function"?`${s}=fn:${bo(o)}`:NH.has(s)&&(Array.isArray(o)||typeof o=="object")?`${s}=${TT(o,t,n+1)}`:o&&typeof o=="object"?`${s}=object:${bo(o)}`:""}).filter(Boolean).join(";")}function RH(e){return ST.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${$v(n)}`:""}).filter(Boolean).join(";")}function gr(e,t=new WeakMap,n=0){const s=nw.get(e);if(s)return s;const o=e,i=t.get(o);if(i)return`node-cycle:${i}`;if(n>=6)return`node:${e.type}:${bo(o)}`;const r=bo(o);t.set(o,r);const l=(function(a,c,u){const d=a,p=Array.isArray(d.children)?d.children:[],m=p.length?p.slice(0,200).map(f=>gr(f,c,u+1)).join("|"):"";return[a.type,RH(d),OH(d,c,u),p.length,m].join(":")})(e,t,n);return nw.set(o,l),l}function MT(e,t){return gr(e)===gr(t)}function Nv(e,t,n){const s=Io(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=Io()-s,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function lw(e,t,n){return Nv(t,n,()=>gr(e))}function AT(e,t,n){return lw(e,n,"stabilizeSignatureMs")===lw(t,n,"stabilizeSignatureMs")}function Hm(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function aw(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function PH(e,t){return e.length===t.length&&e===t}function Lv(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const s=e,o=t,i=Object.keys(s).filter(u=>u!=="type"&&u!=="children").sort(),r=Object.keys(o).filter(u=>u!=="type"&&u!=="children").sort();if(i.length!==r.length)return!1;for(let u=0;u<i.length;u++){const d=i[u];if(d!==r[u])return!1;const p=s[d],m=o[d];if(typeof p!=typeof m)return!1;if(typeof p!="string"){if(typeof p!="number"&&typeof p!="boolean"&&p!=null)return null;if(!Object.is(p,m))return!1}else if(typeof m!="string"||!PH(p,m))return!1}const l=Object.prototype.hasOwnProperty.call(s,"children");if(l!==Object.prototype.hasOwnProperty.call(o,"children"))return!1;if(!l)return!0;const a=s.children,c=o.children;if(!Array.isArray(a)||!Array.isArray(c))return null;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++){const d=a[u],p=c[u];if(!Nf(d)||!Nf(p))return null;const m=Lv(d,p,n+1);if(m==null)return null;if(!m)return!1}return!0}function DH(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;const n=Lv(e,t);return n??MT(e,t)}function BH(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let s=null;return Nv(n,"stabilizeSignatureMs",()=>{s=Lv(e,t)}),s??AT(e,t,n)}function FH(e,t){const n={};for(const s of IH){const o=e[s],i=t?.[s];typeof o=="number"&&(n[s]=o-(typeof i=="number"?i:0))}return n}function HH(e,t){var n;const s=b_(t.instanceMsgId),o=new Map,i=(n=t.smoothStreamingEnabled)!=null?n:j(()=>!1),r=te(t.renderContent.value);let l,a=[],c="",u="",d="",p=0,m=0,f=Io();function v(){l&&(clearTimeout(l),l=void 0)}function w(){v();const T=t.renderContent.value;r.value!==T&&(r.value=T),f=Io()}Ve([t.renderContent,t.effectiveFinal,i],([T,I,L])=>{r.value!==T&&(!L||I||(function(R,O){if(!R&&O||O.length<=80||O.length<R.length||!O.startsWith(R))return!0;const F=O.slice(R.length);return!!F&&(!!rw(iw(O))||!(!F.includes(`
216
+
217
+ `)&&!/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(F))||F.endsWith(`
218
+ `)&&!(function(P){const q=iw(P);if(rw(q))return!1;const K=CT(q);return K.length>=2&&K.some(G=>G.trim())})(O))})(r.value,T)?w():(function(){if(m+=1,l)return;const R=Math.max(0,(function(O){const F=O.parseCoalesceMs;return typeof F=="number"&&Number.isFinite(F)&&F>=0?F:80})(e)-(Io()-f));R<=0?w():l=setTimeout(w,R)})())},{flush:"sync",immediate:!0}),x1(v);const _=j(()=>{var T,I,L,R;return qR(e.customHtmlTags,(T=e.parseOptions)==null?void 0:T.customHtmlTags,(R=(L=(I=t.customComponentsMap)==null?void 0:I.value)!=null?L:{},Object.entries(R).map(([O,F])=>{const P=Mo(O);return F==null||!P||du(P)||rx.has(P)||cu.has(P)?"":P}).filter(Boolean)))}),b=j(()=>{const{key:T,tags:I}=jR(_.value);if(!T)return s;const L=o.get(T);if(L)return L;const R=b_(t.instanceMsgId,{customHtmlTags:I});return o.set(T,R),R}),g=j(()=>{const T=b.value;return e.customMarkdownIt?e.customMarkdownIt(T):T}),y=j(()=>{var T,I;const L=(T=e.parseOptions)!=null?T:{},R=t.effectiveFinal.value,O=_.value,F=R!=null,P=O.length>0;return F||P||L.streamParse==null?nt(nt(Ct(nt({},L),{streamParse:(I=L.streamParse)==null||I}),F?{final:R}:{}),P?{customHtmlTags:O}:{}):L}),k=j(()=>{var T;return new Set(((T=y.value.customHtmlTags)!=null?T:[]).map(I=>String(I).trim().toLowerCase()).filter(Boolean))}),$=j(()=>ow(y.value,g.value,e.customMarkdownIt,{includeFinal:!0})),E=j(()=>ow(y.value,g.value,e.customMarkdownIt,{includeFinal:!1}));Ve([$,E],([T,I],[L,R])=>{L&&(T===L&&I===R||(w(),I!==R&&(a=[],d="")))},{flush:"sync"});const S=j(()=>{var T,I,L,R,O,F,P,q;if((T=e.nodes)!=null&&T.length)return a=[],d="",tr(e.nodes.slice());const K=r.value;if(!K)return a=[],d="",[];const G=t.debugPerformanceEnabled.value,oe=G?Io():0,J=g.value,he=$.value,Ne=E.value;c&&he!==c&&(function(ne){var se,ae;(ae=(se=ne.stream)==null?void 0:se.reset)==null||ae.call(se)})(J),u&&Ne!==u&&(a=[],d="");const Fe=a.length>0&&K.startsWith(d)&&Ne===u,We=G?sw(J):null,$e=G?{}:void 0,me=$e?Ct(nt({},y.value),{__timing:$e}):y.value,ke=Ux(K,J,me),_e=G?Io():0,ue=G?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let z,X=G?Hm(ke.length):void 0,fe=0,D=0;if(Fe){const ne=G?Io():0;if(ue){const se=(function(ae,H,U){if(!H.length)return{nodes:ae,metrics:Hm(ae.length)};const Q=(function(xe,ie,be){const ze=Math.min(xe.length,ie.length);for(let Je=0;Je<ze;Je++)if(!BH(ie[Je],xe[Je],be))return Je;return xe.length===ie.length?-1:ze})(ae,H,U);if(Q<0)return{nodes:H,metrics:{reusedNodeCount:ae.length,dirtyStartIndex:Q,stablePrefixNodeCount:ae.length,dirtyTailNodeCount:0}};const ce=ae.slice();let pe=Q;for(let xe=0;xe<Q;xe++)ce[xe]=H[xe];for(let xe=Q;xe<ae.length;xe++){const ie=H[xe],be=ae[xe];ie&&AT(ie,be,U)&&(ce[xe]=ie,pe+=1)}return{nodes:ce,metrics:{reusedNodeCount:pe,dirtyStartIndex:Q,stablePrefixNodeCount:Q,dirtyTailNodeCount:aw(Q,ae,H)}}})(ke,a,ue);z=se.nodes,X=se.metrics}else{const se=(function(ae,H){if(!H.length)return{nodes:ae,metrics:Hm(ae.length)};const U=(function(pe,xe){const ie=Math.min(pe.length,xe.length);for(let be=0;be<ie;be++)if(!DH(xe[be],pe[be]))return be;return pe.length===xe.length?-1:ie})(ae,H);if(U<0)return{nodes:H,metrics:{reusedNodeCount:ae.length,dirtyStartIndex:U,stablePrefixNodeCount:ae.length,dirtyTailNodeCount:0}};const Q=ae.slice();let ce=U;for(let pe=0;pe<U;pe++)Q[pe]=H[pe];for(let pe=U;pe<ae.length;pe++){const xe=H[pe],ie=ae[pe];xe&&MT(xe,ie)&&(Q[pe]=xe,ce+=1)}return{nodes:Q,metrics:{reusedNodeCount:ce,dirtyStartIndex:U,stablePrefixNodeCount:U,dirtyTailNodeCount:aw(U,ae,H)}}})(ke,a);z=se.nodes,X=se.metrics}fe=G?Io()-ne:0,D=X?.dirtyStartIndex==null||X.dirtyStartIndex<0?z.length:X.dirtyStartIndex}else z=ke;ue?(function(ne,se,ae=0){for(let H=Math.max(0,ae);H<ne.length;H++)Nv(se,"primeSignatureMs",()=>gr(ne[H]))})(z,ue,D):(function(ne,se=0){for(let ae=Math.max(0,se);ae<ne.length;ae++)gr(ne[ae])})(z,D);const Z=G?Io()-_e:0;if(p+=1,d=K,c=he,u=Ne,a=z,G){const ne=sw(J),se=typeof ne?.total=="number"&&ne.total>((I=We?.total)!=null?I:0);t.logPerf(se?"parse(stream)":"parse(sync)",nt(nt(nt({rendererId:t.instanceMsgId,ms:Math.round(Io()-oe),nodes:z.length,contentLength:K.length,parseCommitCount:p,parseCoalescedCount:m,nodeReuseMs:Z,signatureMs:(L=ue?.signatureMs)!=null?L:0,stabilizeSignatureMs:(R=ue?.stabilizeSignatureMs)!=null?R:0,primeSignatureMs:(O=ue?.primeSignatureMs)!=null?O:0,signatureCallCount:(F=ue?.signatureCallCount)!=null?F:0,stabilizeSignatureCallCount:(P=ue?.stabilizeSignatureCallCount)!=null?P:0,primeSignatureCallCount:(q=ue?.primeSignatureCallCount)!=null?q:0,stabilizeMs:fe},X??{}),$e?Object.fromEntries($H.map(ae=>{var H;return[ae,(H=$e[ae])!=null?H:0]})):{}),ne?{streamMode:ne.lastMode,streamDelta:FH(ne,We),streamStats:ne}:{}))}return tr(z)});return{effectiveCustomHtmlTags:_,effectiveCustomHtmlTagsSet:k,mdBase:b,mdInstance:g,mergedParseOptions:y,parsedNodes:S}}function WH(e){const{isClient:t}=e,n=te(new Set),s=new Map,o=new Map,i=new Map;function r(c){if(!t)return;const u=i.get(c);u!=null&&(window.clearTimeout(u),i.delete(c))}function l(){if(t)for(const c of i.values())window.clearTimeout(c);i.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:s,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:i,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(c,u=!0){var d;u&&r(c),(function(p,m){if((v=(f=e.shouldTrackVisibleNodeIndices)==null?void 0:f.call(e))!=null&&!v)return;var f,v;const w=n.value,_=w.has(p);if(m){if(_)return;const g=new Set(w);return g.add(p),void(n.value=g)}if(!_)return;const b=new Set(w);b.delete(p),n.value=b})(c,u),u&&((d=e.onNodeMarkedVisible)==null||d.call(e,c))},resetNodeVisibleState:a,cleanupNodeVisibility:function(c){var u;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[p,m]of o.entries())p<c||(m(),o.delete(p));for(const[p,m]of s.entries())p<c||(m.destroy(),s.delete(p),r(p),(u=e.onNodeVisibilityCleaned)==null||u.call(e,p));for(const p of Array.from(i.keys()))p<c||r(p);if(!n.value.size)return;const d=new Set;for(const p of n.value)p<c&&d.add(p);n.value=d},destroyNodeVisibilityState:function(){a();for(const c of o.values())c();o.clear();for(const c of s.values())c.destroy();s.clear(),l()}}}function UH(e={}){const t=te(""),n=te(""),s=te(!1),o=lB(e),i=()=>{const u=o.getSnapshot();t.value=u.source,n.value=u.visible,s.value=u.done},r=o.subscribe(i);i();const l=j(()=>Math.max(0,t.value.length-n.value.length)),a=j(()=>l.value===0),c=j(()=>s.value&&a.value);return C1()&&x1(()=>{r(),o.destroy()}),{source:t,visible:n,done:s,final:c,caughtUp:a,pendingChars:l,enqueue:u=>o.enqueue(u),finish:u=>o.finish(u),flush:()=>o.flush(),reset:u=>o.reset(u),pause:()=>o.pause(),resume:()=>o.resume()}}const cw=/auto|scroll|overlay/i;function qH(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return cw.test(t)||cw.test(n)}function jH(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const zH=Ze({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=j(()=>{var n,s;return _T((s=$f(e.estimatedPreviewHeightPx))!=null?s:yT(String((n=e.node.code)!=null?n:"")))});return()=>Ut("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Ut("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Ut("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ut("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Ut("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Ut("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Ut("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Ut("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Ut("div",{class:"absolute inset-0"},[Ut("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}),VH=Ze({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=j(()=>{var n,s;return bT((s=$f(e.estimatedPreviewHeightPx))!=null?s:vT(String((n=e.node.code)!=null?n:"")))});return()=>Ut("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Ut("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Ut("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Ut("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Ut("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Ut("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Ut("span",{class:"action-icon block"})])))]):null,Ut("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Ut("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}),KH=["data-custom-id"],GH={class:"m-0 p-0"},YH=["data-probe"],XH=["data-node-index","data-node-type"],ET=jt(Ze(Ct(nt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},htmlPolicy:{},viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:Boolean,default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const s=e,o=n,i={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:320,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:16,renderBatchSize:16,renderBatchDelay:8,renderBatchBudgetMs:4,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}},r=j(()=>{return(x=s.mode)==="chat"||x==="minimal"||x==="docs"?x:"docs";var x}),l=j(()=>s.renderCodeBlocksAsPre===!0?"pre":s.codeRenderer==="pre"||s.codeRenderer==="shiki"||s.codeRenderer==="monaco"?s.codeRenderer:s.renderCodeBlocksAsPre===!1||r.value==="docs"?"monaco":"pre"),a=j(()=>i[r.value]),c=j(()=>{var x;return(x=s.showTooltips)!=null?x:a.value.showTooltips}),u=j(()=>{var x;return(x=s.fade)!=null?x:a.value.fade}),d=j(()=>{var x;return(x=s.batchRendering)!=null?x:a.value.batchRendering}),p=j(()=>{var x;return(x=s.initialRenderBatchSize)!=null?x:a.value.initialRenderBatchSize}),m=j(()=>{var x;return(x=s.renderBatchSize)!=null?x:a.value.renderBatchSize}),f=j(()=>{var x;return(x=s.renderBatchDelay)!=null?x:a.value.renderBatchDelay}),v=j(()=>{var x;return(x=s.renderBatchBudgetMs)!=null?x:a.value.renderBatchBudgetMs}),w=j(()=>{var x;return(x=s.renderBatchIdleTimeoutMs)!=null?x:a.value.renderBatchIdleTimeoutMs}),_=j(()=>{var x;return(x=s.deferNodesUntilVisible)!=null?x:a.value.deferNodesUntilVisible}),b=j(()=>{var x;return(x=s.maxLiveNodes)!=null?x:a.value.maxLiveNodes}),g=j(()=>{var x;return(x=s.liveNodeBuffer)!=null?x:a.value.liveNodeBuffer}),y=j(()=>{var x;return(x=s.nodeVirtual)!=null?x:a.value.nodeVirtual}),k={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return s.parseOptions},get customMarkdownIt(){return s.customMarkdownIt},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return s.customHtmlTags},get mode(){return s.mode},get htmlPolicy(){return s.htmlPolicy},get viewportPriority(){return s.viewportPriority},get codeBlockStream(){return s.codeBlockStream},get codeBlockDarkTheme(){return s.codeBlockDarkTheme},get codeBlockLightTheme(){return s.codeBlockLightTheme},get codeBlockMonacoOptions(){return s.codeBlockMonacoOptions},get codeRenderer(){return s.codeRenderer},get renderCodeBlocksAsPre(){return s.renderCodeBlocksAsPre},get codeBlockMinWidth(){return s.codeBlockMinWidth},get codeBlockMaxWidth(){return s.codeBlockMaxWidth},get codeBlockProps(){return s.codeBlockProps},get mermaidProps(){return s.mermaidProps},get d2Props(){return s.d2Props},get infographicProps(){return s.infographicProps},get showTooltips(){return c.value},get themes(){return s.themes},get isDark(){return s.isDark},get customId(){return s.customId},get indexKey(){return s.indexKey},get typewriter(){return s.typewriter},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return s.smoothStreamingOptions},get parseCoalesceMs(){return s.parseCoalesceMs},get fade(){return u.value},get batchRendering(){return d.value},get initialRenderBatchSize(){return p.value},get renderBatchSize(){return m.value},get renderBatchDelay(){return f.value},get renderBatchBudgetMs(){return v.value},get renderBatchIdleTimeoutMs(){return w.value},get deferNodesUntilVisible(){return _.value},get maxLiveNodes(){return b.value},get liveNodeBuffer(){return g.value},get nodeVirtual(){return y.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function $(x){o("height-change",x)}function E(x){o("virtual-state-change",x)}function S(x){o("anchor-change",x)}const T=te(),I=te(null),L=te(null),R=te(null),O=Vs({1:null,2:null,3:null,4:null,5:null,6:null}),F=te(!1),P=new Map,q=te(0),K=te(0),G=te({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function oe(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.enabled)!==!0)return null;const V=(B=s.virtualScroll)==null?void 0:B.scrollRoot;return J(typeof V=="function"?V():V)}function J(x){return x?typeof HTMLElement<"u"&&x instanceof HTMLElement?x:typeof x=="object"&&"value"in x?J(x.value):typeof x=="object"&&"$el"in x?J(x.$el):null:null}const{isClient:he,renderAsFragment:Ne,debugPerformanceEnabled:Fe,resolvedShowTooltips:We,resolvedHtmlPolicy:$e,inheritedSmoothStreaming:me,ownsTypewriterCursor:ke}=(function(x){const B=typeof window<"u",V=ou(),Y=Nt("markstreamHtmlPolicy",void 0),ee=Nt("markstreamTypewriterCursor",void 0),de=Nt("markstreamSmoothStreaming",void 0),ve=j(()=>x.renderAsFragment===!0),ye=j(()=>!!(x.debugPerformance&&B&&typeof console<"u")),Le=j(()=>{var Re;if(typeof x.showTooltips=="boolean")return x.showTooltips;const Te=(Re=V.showTooltips)!=null?Re:V["show-tooltips"];return Te===""||Te===!0||Te==="true"||Te!==!1&&Te!=="false"&&void 0}),Ce=j(()=>{var Re,Te;return(Te=(Re=x.htmlPolicy)!=null?Re:Y?.value)!=null?Te:"safe"}),De=j(()=>ee?.value!==!0);return{isClient:B,renderAsFragment:ve,debugPerformanceEnabled:ye,resolvedShowTooltips:Le,resolvedHtmlPolicy:Ce,inheritedSmoothStreaming:de,inheritedTypewriterCursor:ee,ownsTypewriterCursor:De}})(k),{resolveViewportRoot:_e,resolveScrollContainer:ue,isReverseFlexScrollRoot:z,getNormalizedScrollTop:X,getOffsetTopWithinRoot:fe}=(function(x,B){function V(){var ye,Le;return(Le=(ye=B.scrollRoot)==null?void 0:ye.call(B))!=null?Le:null}function Y(ye){if(typeof window>"u")return null;const Le=V();if(Le)return Le;const Ce=ye??x.value;if(!Ce)return null;const De=Ce.ownerDocument||document,Re=De.scrollingElement||De.documentElement;let Te=Ce;for(;Te&&Te!==De.body&&Te!==Re;){if(qH(window.getComputedStyle(Te))&&jH(Te))return Te;Te=Te.parentElement}return null}function ee(ye){if(!B.isClient)return!1;try{const Le=window.getComputedStyle(ye);return!!(Le.display||"").toLowerCase().includes("flex")&&(Le.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function de(ye,Le,Ce){var De,Re;if(Ce)return ve(Le);const Te=ye.scrollTop;if(!ee(ye))return Te;const Pe=Te<0?-Te:Te;return Math.max(0,((De=ye.scrollHeight)!=null?De:0)-((Re=ye.clientHeight)!=null?Re:0))-Pe}function ve(ye){var Le,Ce,De,Re,Te;const Pe=Number((Le=ye.scrollingElement)==null?void 0:Le.scrollTop),qe=Number((De=(Ce=ye.documentElement)==null?void 0:Ce.scrollTop)!=null?De:0),Ue=Number((Te=(Re=ye.body)==null?void 0:Re.scrollTop)!=null?Te:0);return Math.max(0,Number.isFinite(Pe)?Pe:0,Number.isFinite(qe)?qe:0,Number.isFinite(Ue)?Ue:0)}return{resolveViewportRoot:Y,resolveScrollContainer:function(ye){var Le,Ce,De,Re;const Te=V();if(Te)return Te;const Pe=Y((Le=ye??x.value)!=null?Le:null);if(Pe)return Pe;const qe=(Re=(De=ye?.ownerDocument)!=null?De:(Ce=x.value)==null?void 0:Ce.ownerDocument)!=null?Re:typeof document<"u"?document:null;return qe?.scrollingElement||qe?.documentElement||null},isReverseFlexScrollRoot:ee,getNormalizedScrollTop:de,getOffsetTopWithinRoot:function(ye,Le){const Ce=Le.ownerDocument||ye.ownerDocument||document;if((function(Pe,qe){return Pe===qe.documentElement||Pe===qe.body||Pe===qe.scrollingElement})(Le,Ce))return ye.getBoundingClientRect().top+ve(Ce);const De=Le.getBoundingClientRect(),Re=ye.getBoundingClientRect(),Te=de(Le,Ce,!1);return Re.top-De.top+Te}}})(T,{isClient:he,scrollRoot:oe});ln("markstreamShowTooltips",We),ln("markstreamHtmlPolicy",$e),ln("markstreamTypewriter",j(()=>s.typewriter!==!1)),ln("markstreamFade",j(()=>k.fade!==!1)),ln("markstreamTypewriterCursor",j(()=>!0)),ln("markstreamTextStreamState",P),ln("markstreamStreamVersion",q),ln("markstreamParseOptions",j(()=>s.parseOptions)),ln("markstreamCustomMarkdownIt",j(()=>s.customMarkdownIt));const{smoothStreamingEnabled:D,renderContent:Z,effectiveFinal:ne}=(function(x,B){const V=UH(x.smoothStreamingOptions),Y=j(()=>{var Ce,De,Re;return x.smoothStreaming!==!1&&!((Ce=x.nodes)!=null&&Ce.length)&&(x.smoothStreaming===!0||!((De=B.inheritedSmoothStreaming)!=null&&De.value))&&(x.smoothStreaming===!0||x.typewriter===!0||((Re=x.maxLiveNodes)!=null?Re:0)<=0)}),ee=te(!B.isClient||x.smoothStreaming===!0);Jt(()=>{ee.value=!0});const de=j(()=>ee.value&&Y.value),ve=j(()=>{var Ce;return de.value?V.visible.value:(Ce=x.content)!=null?Ce:""}),ye=j(()=>{var Ce,De;const Re=(Ce=x.parseOptions)!=null?Ce:{};return(De=x.final)!=null?De:Re.final}),Le=j(()=>{const Ce=ye.value;return de.value&&Ce!=null?!!Ce&&V.caughtUp.value:Ce});return Ve([()=>x.content,()=>x.nodes,de,ye],([Ce,De,Re,Te])=>{if(De?.length)return void V.reset("");const Pe=Ce??"";if(!Re)return V.reset(Pe),void(Te&&V.finish({flush:!0}));const qe=V.source.value;Pe?Pe===qe||(Pe.startsWith(qe)?V.enqueue(Pe.slice(qe.length)):V.reset(Pe)):V.reset(""),Te&&V.finish()},{immediate:!0}),{smoothStream:V,smoothStreamingEligible:Y,smoothStreamingEnabled:de,renderContent:ve,requestedFinal:ye,effectiveFinal:Le}})(k,{isClient:he,inheritedSmoothStreaming:me});ln("markstreamSmoothStreaming",D);const se=te(!1);let ae="",H=!1,U=null;function Q(){he&&U!=null&&(window.clearTimeout(U),U=null)}function ce(){se.value=!1,Q()}function pe(x,B){if(!Fe.value)return;const V=(function(){if(!Fe.value)return null;const Y=Je(xe),ee=Je(ie),de=Math.max(ze,ee);if(Y<=0&&de<=0)return null;const ve={total:Y,maxPerFrame:de,byLabel:(ye=xe,Object.fromEntries(Array.from(ye.entries()).sort((Le,Ce)=>Ce[1]-Le[1]||Le[0].localeCompare(Ce[0]))))};var ye;return xe.clear(),ie.clear(),ze=0,ve})();console.info(`[markstream-vue][perf] ${x}`,V?Ct(nt({},B),{layoutReads:V}):B)}Ve([Z,()=>s.nodes,ne],([x,B,V])=>{const Y=x??"";return B?.length||V===!0?(ce(),ae=Y,void(H=!0)):H?(ae&&Y.length>ae.length&&Y.startsWith(ae)?(se.value=!0,he&&(Q(),U=window.setTimeout(()=>{var ee;U=null,ne.value===!0||(ee=s.nodes)!=null&&ee.length||(wl(),se.value=!1,li())},1200))):(Y.length<ae.length||!Y.startsWith(ae))&&ce(),void(ae=Y)):(ae=Y,void(H=!0))},{flush:"sync",immediate:!0});const xe=new Map,ie=new Map;let be=!1,ze=0;function Je(x){let B=0;for(const V of x.values())B+=V;return B}function rt(){ze=Math.max(ze,Je(ie)),ie.clear(),be=!1}function Ge(x,B){return(function(V){var Y,ee;Fe.value&&(xe.set(V,((Y=xe.get(V))!=null?Y:0)+1),ie.set(V,((ee=ie.get(V))!=null?ee:0)+1),be||(be=!0,he&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(rt):typeof queueMicrotask!="function"?setTimeout(rt,0):queueMicrotask(rt)))})(x),B()}const ut=s.customId?`renderer-${s.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,xt=(function(x){const B=new Map;return{scope:x,cache:B,clear:()=>B.clear()}})(ut),Ht=j(()=>`${ut}:${q.value}`);ln(wT,xt);const Pt=Tn(()=>s.customId),{effectiveCustomHtmlTagsSet:Vn,mergedParseOptions:_s,parsedNodes:Ke}=HH(s,{instanceMsgId:ut,renderContent:Z,effectiveFinal:ne,smoothStreamingEnabled:D,debugPerformanceEnabled:Fe,customComponentsMap:Pt,logPerf:pe});Ve(Ke,()=>{xt.clear(),q.value+=1},{immediate:!0});const zt=j(()=>({customId:s.customId,customHtmlTags:_s.value.customHtmlTags,parseOptions:s.parseOptions,customMarkdownIt:s.customMarkdownIt,htmlPolicy:$e.value,viewportPriority:s.viewportPriority,mode:r.value,codeRenderer:l.value,codeBlockStream:k.codeBlockStream,codeBlockDarkTheme:s.codeBlockDarkTheme,codeBlockLightTheme:s.codeBlockLightTheme,codeBlockMonacoOptions:s.codeBlockMonacoOptions,renderCodeBlocksAsPre:k.renderCodeBlocksAsPre,codeBlockMinWidth:s.codeBlockMinWidth,codeBlockMaxWidth:s.codeBlockMaxWidth,codeBlockProps:s.codeBlockProps,mermaidProps:s.mermaidProps,d2Props:s.d2Props,infographicProps:s.infographicProps,showTooltips:We.value,themes:s.themes,isDark:s.isDark,typewriter:s.typewriter,smoothStreamingOptions:s.smoothStreamingOptions,parseCoalesceMs:s.parseCoalesceMs,fade:k.fade}));ln("markstreamNestedRendererProps",zt);const Kn=j(()=>Ke.value),Ps=j(()=>Ke.value.length),Gn=te(null),Do=te(null),Ds=te(null),Bs=te(null),Fs=s.indexKey!=null&&String(s.indexKey).startsWith("list-item-"),Ni=!Fs&&s.customId?Q_(s.customId):null,ls=j(()=>Ni?(Z_.value,Q_(s.customId)):null),$n=j(()=>{var x;return!!(he&&!Ne.value&&s.customId&&!Fs&&((x=ls.value)!=null&&x.enabled))}),sn=j(()=>{var x;return!!(!Ne.value&&((x=s.virtualScroll)!=null&&x.enabled))}),Hs=te(!1);Jt(()=>{Hs.value=!0});const _t=j(()=>!!(he&&sn.value));ln("markstreamHostScrollManaged",_t);const Pn=j(()=>!!(Hs.value&&_t.value)),Yt=j(()=>$n.value||_t.value),so=j(()=>$n.value||Pn.value),oo=j(()=>{var x;return Yt.value&&((x=ls.value)==null?void 0:x.textEstimation)!==!1}),Ws=j(()=>{var x;return Yt.value&&((x=ls.value)==null?void 0:x.codeBlockEstimation)!==!1});function Dn(){const x=K.value||Ge("getMeasuredContainerWidth.clientWidth",()=>{var B;return((B=T.value)==null?void 0:B.clientWidth)||0});return Number.isFinite(x)&&x>0?x:0}const ws=j(()=>{const x=Dn();return x>0?Math.max(1,Math.round(x)):640}),as=j(()=>{var x;return Math.max(1,(x=k.maxLiveNodes)!=null?x:320)}),vt=j(()=>{var x;return!Ne.value&&k.nodeVirtual!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&(k.nodeVirtual===!0?Ke.value.length>0:Ke.value.length>as.value)}),Ss=j(()=>vt.value||$n.value||_t.value),Bn=j(()=>s.viewportPriority!==!1&&!F.value),Yn=IF(x=>{var B;return _e((B=x??T.value)!=null?B:null)},Bn),{requestFrame:cn,cancelFrame:hn,hasIdleCallback:Me,isTestEnv:ge}=(function(x){const B=x.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,V=x.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,Y=x.isClient&&typeof window.requestIdleCallback=="function",ee=(function(){var de;if(typeof globalThis>"u"||!("process"in globalThis))return;const ve=(de=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:de.value;return ve?.env})();return{requestFrame:B,cancelFrame:V,hasIdleCallback:Y,isTestEnv:ee?.NODE_ENV==="test"}})({isClient:he}),{resolvedBatchSize:Oe,resolvedInitialBatch:we,batchingEnabled:Ae,incrementalRenderingActive:He,renderedCount:tt,previousRenderContext:pn,adaptiveBatchSize:Vt,previousBatchConfig:Xn}=(function(x,B){var V;const Y=j(()=>{var Re;const Te=Math.trunc((Re=x.renderBatchSize)!=null?Re:80);return Number.isFinite(Te)?Math.max(0,Te):0}),ee=j(()=>{var Re;const Te=Math.trunc((Re=x.initialRenderBatchSize)!=null?Re:Y.value);return Number.isFinite(Te)?Math.max(0,Te):Y.value}),de=j(()=>!B.renderAsFragment.value&&x.batchRendering!==!1&&Y.value>0&&B.isClient&&!B.isTestEnv),ve=te(0),ye=te({key:x.indexKey,total:0}),Le=te(Math.max(1,Y.value||1)),Ce=j(()=>{var Re;return de.value&&((Re=x.maxLiveNodes)!=null?Re:0)<=0}),De=te({batchSize:Y.value,initial:ee.value,delay:(V=x.renderBatchDelay)!=null?V:16,enabled:Ce.value});return{resolvedBatchSize:Y,resolvedInitialBatch:ee,batchingEnabled:de,incrementalRenderingActive:Ce,renderedCount:ve,previousRenderContext:ye,adaptiveBatchSize:Le,previousBatchConfig:De}})(k,{isClient:he,isTestEnv:ge,renderAsFragment:Ne}),en=new Map,Zn=new Map,Bo=new WeakMap;let io=null;const Cr=new WeakMap,cs=new Map,mu=te(0),zh=j(()=>(mu.value,Array.from(en.entries()).sort((x,B)=>x[0]-B[0]))),xr=te(null),us=te(null);let si=null,Sa=0,Tr=null;const{activeRestoreAnchor:oi,getRelativeScrollTopWithinContainer:Ca,setRelativeScrollTopWithinContainer:Vh,resolveAnchorOffset:Be,clearRestoreReconcile:le,scheduleRestoreReconcile:Se,captureRestoreAnchor:Mt,restoreAnchor:xa,getAnchorDrift:gu}=(function(x){const{isClient:B,containerRef:V,parsedNodeCount:Y,requestFrame:ee,cancelFrame:de,resolveScrollContainer:ve,getNormalizedScrollTop:ye,getOffsetTopWithinRoot:Le,isReverseFlexScrollRoot:Ce,estimateIndexForOffset:De,estimateHeightRange:Re,getFallbackNodeHeight:Te,clamp:Pe}=x,qe=te(null);let Ue=null,lt=[];function et(){const at=ve(),kt=V.value;if(!at||!kt)return null;const bt=at.ownerDocument||kt.ownerDocument||document;if(at===bt.documentElement||at===bt.body||at===bt.scrollingElement){const Lt=kt.getBoundingClientRect();return Math.max(0,-Lt.top)}return Math.max(0,ye(at,bt,!1)-Le(kt,at))}function Qe(at){var kt;const bt=ve(),Lt=V.value;if(!bt||!Lt)return;const ds=Math.max(0,at),fs=bt.ownerDocument||Lt.ownerDocument||document,Ao=fs.defaultView||(typeof window<"u"?window:null);if(bt===fs.documentElement||bt===fs.body||bt===fs.scrollingElement){const Bi=ye(bt,fs,!0)+Lt.getBoundingClientRect().top;return void((kt=Ao?.scrollTo)==null||kt.call(Ao,0,Math.max(0,Bi+ds)))}ew(bt,fs,Le(Lt,bt)+ds,{isReverseFlexScrollRoot:Bi=>{var Fi;return(Fi=Ce?.(Bi))!=null&&Fi},getNormalizedScrollTop:ye})}function ct(at){const kt=Y.value,bt=Pe(at.nodeIndex,0,Math.max(0,kt-1));return Re(0,bt)+Math.max(0,at.offsetWithinNodePx)}function dt(){if(Ue!=null&&(de?.(Ue),Ue=null),B)for(const at of lt)window.clearTimeout(at);lt=[]}function pt(at){const kt=ct(at),bt=et();bt!=null&&Math.abs(bt-kt)<=.5||Qe(kt)}return{activeRestoreAnchor:qe,getRelativeScrollTopWithinContainer:et,setRelativeScrollTopWithinContainer:Qe,resolveAnchorOffset:ct,clearRestoreReconcile:dt,applyRestoreAnchor:pt,scheduleRestoreReconcile:function(){qe.value&&B&&Ue==null&&(Ue=ee?ee(()=>{Ue=null,qe.value&&pt(qe.value)}):null,Ue==null&&qe.value&&pt(qe.value))},captureRestoreAnchor:function(){const at=et(),kt=Y.value;if(at==null||kt<=0)return null;const bt=Pe(De(at+1),0,kt-1),Lt=Re(0,bt),ds=Te(bt);return{nodeIndex:bt,offsetWithinNodePx:Pe(at-Lt,0,Math.max(0,ds-1))}},restoreAnchor:function(at){const kt=Y.value;if(qe.value={nodeIndex:Pe(at.nodeIndex,0,Math.max(0,kt-1)),offsetWithinNodePx:Math.max(0,at.offsetWithinNodePx)},dt(),pt(qe.value),B)for(const bt of[0,120,280,480])lt.push(window.setTimeout(()=>{qe.value&&pt(qe.value)},bt))},getAnchorDrift:function(at){const kt=et();return kt==null?null:kt-ct(at)}}})({isClient:he,containerRef:T,parsedNodeCount:Ps,requestFrame:cn,cancelFrame:hn,resolveScrollContainer:()=>xr.value||ue(),getNormalizedScrollTop:X,getOffsetTopWithinRoot:fe,isReverseFlexScrollRoot:z,estimateIndexForOffset:$p,estimateHeightRange:Di,getFallbackNodeHeight:Tu,clamp:Hn}),{nodeHeights:ro,heightStats:lo,heightTreeSize:Ta,heightSumTree:Kh,heightKnownTree:Gh,averageNodeHeight:Fo,resetHeightMeasurements:H3,pruneHeightMeasurements:W3,rebuildHeightTrees:vu,recordNodeHeight:U3,removeNodeHeights:q3,exportHeightCache:j3,importHeightCache:z3,fenwickRangeSum:yu}=(function(x={}){const B=Vs({}),V=Vs({total:0,count:0}),Y=te(0),ee=te([]),de=te([]);function ve(){for(const Te of Object.keys(B))delete B[Number(Te)];V.total=0,V.count=0,Y.value=0,ee.value=[],de.value=[]}function ye(Te,Pe,qe){for(let Ue=Pe+1;Ue<Te.length;Ue+=Ue&-Ue)Te[Ue]+=qe}function Le(Te,Pe){let qe=0;for(let Ue=Pe+1;Ue>0;Ue-=Ue&-Ue)qe+=Te[Ue];return qe}function Ce(Te){Y.value=Te;const Pe=new Array(Te+1).fill(0),qe=new Array(Te+1).fill(0);for(const[Ue,lt]of Object.entries(B)){const et=Number(Ue),Qe=Number(lt);!Number.isFinite(et)||et<0||et>=Te||!Number.isFinite(Qe)||Qe<=0||(ye(Pe,et,Qe),ye(qe,et,1))}ee.value=Pe,de.value=qe}function De(Te){if(!Number.isInteger(Te)||Te<0)return!1;const Pe=B[Te];if(!Number.isFinite(Pe)||Pe<=0)return!1;if(delete B[Te],V.total=Math.max(0,V.total-Pe),V.count=Math.max(0,V.count-1),Y.value>Te){const qe=ee.value,Ue=de.value;qe.length&&Ue.length&&(ye(qe,Te,-Pe),ye(Ue,Te,-1))}return!0}const Re=j(()=>V.count>0?Math.max(12,V.total/V.count):32);return{nodeHeights:B,heightStats:V,heightTreeSize:Y,heightSumTree:ee,heightKnownTree:de,averageNodeHeight:Re,resetHeightMeasurements:ve,pruneHeightMeasurements:function(Te){if(Te<=0)return void ve();let Pe=0,qe=0;for(const[Ue,lt]of Object.entries(B)){const et=Number(Ue),Qe=Number(lt);!Number.isFinite(et)||et<0||et>=Te||!Number.isFinite(Qe)||Qe<=0?delete B[et]:(Pe+=Qe,qe++)}V.total=Pe,V.count=qe},rebuildHeightTrees:Ce,recordNodeHeight:function(Te,Pe,qe={}){(function(Ue,lt,et={}){var Qe;if(!Number.isFinite(lt)||lt<=0)return!1;const ct=B[Ue];if(ct&&(et.allowShrink===!1&&lt<ct||Math.abs(lt-ct)<=1))return!1;if(B[Ue]=lt,ct?V.total+=lt-ct:(V.total+=lt,V.count++),Y.value>Ue){const dt=ee.value,pt=de.value;if(dt.length&&pt.length)if(ct){const at=lt-ct;at!==0&&ye(dt,Ue,at)}else ye(dt,Ue,lt),ye(pt,Ue,1)}et.notify!==!1&&((Qe=x.onHeightRecorded)==null||Qe.call(x))})(Te,Pe,Ct(nt({},qe),{notify:!0}))},removeNodeHeight:function(Te,Pe={}){var qe;const Ue=De(Te);return Ue&&Pe.notify!==!1&&((qe=x.onHeightRecorded)==null||qe.call(x)),Ue},removeNodeHeights:function(Te,Pe={}){var qe;let Ue=0;for(const lt of Te)De(Number(lt))&&Ue++;return Ue>0&&Pe.notify!==!1&&((qe=x.onHeightRecorded)==null||qe.call(x)),Ue},exportHeightCache:function(){return Object.entries(B).map(([Te,Pe])=>({index:Number(Te),height:Number(Pe)})).filter(Te=>Number.isFinite(Te.index)&&Te.index>=0&&Number.isFinite(Te.height)&&Te.height>0).sort((Te,Pe)=>Te.index-Pe.index)},importHeightCache:function(Te,Pe={}){var qe;if(!Array.isArray(Te))return;const Ue=Y.value;let lt=!1;if(Pe.mode!=="merge"){const et=Object.keys(B);if(et.length>0){for(const Qe of et)delete B[Number(Qe)];lt=!0}}for(const et of Te){const Qe=Number(et.index),ct=Number(et.height);if(!Number.isInteger(Qe)||Qe<0||Ue>0&&Qe>=Ue||!Number.isFinite(ct)||ct<=0)continue;const dt=B[Qe];dt&&Math.abs(dt-ct)<=1||(B[Qe]=ct,lt=!0)}lt&&((function(){let et=0,Qe=0;const ct=Y.value;for(const[dt,pt]of Object.entries(B)){const at=Number(dt),kt=Number(pt);!Number.isFinite(at)||at<0||ct>0&&at>=ct||!Number.isFinite(kt)||kt<=0?delete B[at]:(et+=kt,Qe++)}V.total=et,V.count=Qe})(),Ue>0&&Ce(Ue),(qe=x.onHeightRecorded)==null||qe.call(x))},fenwickRangeSum:function(Te,Pe,qe){if(qe<=Pe)return 0;const Ue=Le(Te,qe-1);return Pe<=0?Ue:Ue-Le(Te,Pe-1)}}})({onHeightRecorded:()=>{co(),_t.value&&Ua(),oi.value&&Se(),us.value&&kl(),tn("node-resize")}});function ku(){H3(),cs.clear()}function Zv(x){!Number.isInteger(x)||x<0||x>=Ke.value.length||cs.set(x,$a(x))}function Qv(x,B,V={}){const Y=ro[x];U3(x,B,V);const ee=ro[x];ee&&ee>0?Zv(x):Y&&cs.delete(x)}function Jv(x,B){const V=Ge("getNodeLayoutHeight.slot.offsetHeight",()=>{var Y,ee;return(ee=(Y=en.get(x))==null?void 0:Y.offsetHeight)!=null?ee:0});return V>0?V:Ge("getNodeLayoutHeight.content.offsetHeight",()=>B.offsetHeight)}function e0(x,B={}){z3(x,B),wp()}const Li=j(()=>{var x;return!Ne.value&&k.deferNodesUntilVisible!==!1&&!(((x=k.maxLiveNodes)!=null?x:0)<=0)&&!vt.value&&!(Ke.value.length>900)&&Bn.value}),t0=j(()=>!!Yn&&(Li.value||vt.value)),n0=j(()=>vt.value||_t.value),{liveNodeBufferResolved:Ma,focusIndex:ao,liveRange:Fn,updateLiveRange:Mr}=(function(x,B){const{parsedNodeCount:V,virtualizationEnabled:Y,maxLiveNodesResolved:ee,clamp:de}=B,ve=j(()=>{var Ce;return Math.max(0,(Ce=x.liveNodeBuffer)!=null?Ce:60)}),ye=te(0),Le=Vs({start:0,end:0});return{liveNodeBufferResolved:ve,focusIndex:ye,liveRange:Le,updateLiveRange:function(){const Ce=V.value;if(!Y.value||Ce===0)return Le.start=0,void(Le.end=Ce);const De=Math.min(ee.value,Ce),Re=ve.value,Te=de(ye.value-Re,0,Math.max(0,Ce-De));Le.start=Te,Le.end=Math.min(Ce,Te+De)}}})(k,{parsedNodeCount:Ps,virtualizationEnabled:vt,maxLiveNodesResolved:as,clamp:Hn}),Ho=new Map,Ar=new Map,Oi=new Map,bu=[],ii=new Map,Ri=new Set,s0=te(0);let Yh=!1;const o0=j(()=>(s0.value,Ri.size)),Us=new Map,Wo=new Map,i0=te(0),Xh=j(()=>{i0.value;let x=0;for(const B of Us.values())x+=Math.max(0,B);return x});let qs=null,Zh=!0,r0=[0],l0="";function co(){Zh=!0}const _u=j(()=>{if(!vt.value)return Ke.value.length;const x=Ma.value,B=Math.max(Fn.end+x,we.value),V=Math.min(Ke.value.length,B);return Math.max(tt.value,V)});function wu(){Yh||(Yh=!0,queueMicrotask(()=>{Yh=!1,s0.value+=1}))}function a0(x,B,V="node-resize"){if(!he||typeof window>"u")return null;const Y=window.setTimeout(()=>{Ri.delete(Y)&&wu();try{B()}finally{tn(V)}},Math.max(0,x));return Ri.add(Y),wu(),Y}function Su(x){he&&x!=null&&(Ri.delete(x)&&wu(),window.clearTimeout(x))}function c0(){if(he&&typeof window<"u")for(const x of Ri)window.clearTimeout(x);Ri.size&&(Ri.clear(),wu()),bu.length=0,Oi.clear()}function V3(x){var B,V;return(V=(B=Bs.value)==null?void 0:B[x])!=null?V:null}const{cancelScheduledFocusSync:Qh,scheduleFocusSync:Uo}=(function(x){const{isClient:B,containerRef:V,virtualizationEnabled:Y,requestFrame:ee,cancelFrame:de,syncFocusToScroll:ve}=x;let ye=null;function Le(){var De,Re,Te;return(Te=(Re=(De=V.value)==null?void 0:De.ownerDocument)==null?void 0:Re.defaultView)!=null?Te:typeof window<"u"?window:null}function Ce(){if(!ye)return;const De=Le();ye.viaTimeout?De?De.clearTimeout(ye.id):clearTimeout(ye.id):de?.(ye.id),ye=null}return{cancelScheduledFocusSync:Ce,scheduleFocusSync:function(De={}){if(!Y.value)return;if(!B)return void ve(!0);if(De.immediate)return Ce(),void ve(!0);if(ye)return;const Re=()=>{ye=null,ve()};if(ee)return void(ye={id:ee(Re),viaTimeout:!1});const Te=Le();ye={id:Te?Te.setTimeout(Re,16):setTimeout(Re,16),viaTimeout:!0}}}})({isClient:he,containerRef:T,virtualizationEnabled:vt,requestFrame:cn,cancelFrame:hn,syncFocusToScroll:function(x=!1){var B;if(!vt.value)return;const V=xr.value||ue();if(!V)return;const Y=V.ownerDocument||((B=T.value)==null?void 0:B.ownerDocument)||document,ee=Y?.defaultView||(typeof window<"u"?window:null),de=V===Y?.documentElement||V===Y?.body,ve=Ke.value.length;if(!de&&ve>0&&z(V)){const qe=Ge("syncFocusToScroll.clientHeight",()=>V.clientHeight||0),Ue=Ge("syncFocusToScroll.scrollTop",()=>V.scrollTop),lt=Ue<0?-Ue:Ue,et=(function(ct){var dt,pt;const at=Ke.value;if(!at.length)return 0;if(ct<=0)return Math.max(0,at.length-1);if(Yt.value){const bt=(dt=sp()[at.length])!=null?dt:0;return v0(Math.max(0,bt-ct))}if(Ta.value===at.length){const bt=Di(0,at.length);return $p(Math.max(0,bt-ct))}let kt=ct;for(let bt=at.length-1;bt>=0;bt--){const Lt=(pt=ro[bt])!=null?pt:Fo.value;if(kt<=Lt)return bt;kt-=Lt}return 0})(Math.max(0,lt)+.5*Math.max(0,qe)),Qe=Hn(et,0,Math.max(0,ve-1));return void((x||Math.abs(Qe-ao.value)>1)&&(ao.value=Qe,Mr()))}const ye=de?null:Ge("syncFocusToScroll.root.getBoundingClientRect",()=>V.getBoundingClientRect()),Le=de?0:ye.top,Ce=de?Ge("syncFocusToScroll.viewport.clientHeight",()=>{var qe,Ue;return(Ue=(qe=ee?.innerHeight)!=null?qe:V.clientHeight)!=null?Ue:0}):ye.bottom,De=zh.value;let Re=null,Te=null;for(const[qe,Ue]of De){if(!Ue)continue;const lt=Ge("syncFocusToScroll.slot.getBoundingClientRect",()=>Ue.getBoundingClientRect());lt.bottom<=Le||lt.top>=Ce||(Re==null&&(Re=qe),Te=qe)}if(Re==null||Te==null){const qe=T.value;if(!qe)return;const Ue=de?{top:0}:Ge("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>V.getBoundingClientRect()),lt=Ge("syncFocusToScroll.fallback.scrollTop",()=>X(V,Y,de)),et=de?(()=>{const dt=Ge("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>qe.getBoundingClientRect()),pt=(de?0:Ue.top)-dt.top;return Math.max(0,pt)})():(()=>{const dt=fe(qe,V);return Math.max(0,lt-dt)})(),Qe=de?Ge("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var dt,pt,at,kt;return(kt=(at=(pt=ee?.innerHeight)!=null?pt:(dt=Y?.documentElement)==null?void 0:dt.clientHeight)!=null?at:V.clientHeight)!=null?kt:0}):Ge("syncFocusToScroll.fallback.root.clientHeight",()=>V.clientHeight),ct=$p(et+.5*Math.max(0,Qe));return ao.value=Hn(ct,0,Math.max(0,Ke.value.length-1)),void Mr()}const Pe=Math.round((Re+Te)/2);!x&&Math.abs(Pe-ao.value)<=1||(ao.value=Hn(Pe,0,Math.max(0,Ke.value.length-1)),Mr())}}),{visibleNodeIndices:Jh,nodeVisibilityHandles:fl,nodeVisibilityWatchStops:Cu,nodeVisibilityFallbackTimers:u0,clearVisibilityFallback:xu,markNodeVisible:Pi,cleanupNodeVisibility:K3,destroyNodeVisibilityState:ep}=WH({isClient:he,shouldTrackVisibleNodeIndices:()=>Li.value,shouldCleanupNodeVisibility:()=>vt.value,onNodeMarkedVisible:x=>{vt.value?Uo():ao.value=Hn(x,0,Math.max(0,Ke.value.length-1))},onNodeVisibilityCleaned:x=>{en.delete(x)&&F0()}}),{cleanupScrollListener:d0,setupScrollListener:G3}=(function(x){const{isClient:B,virtualizationEnabled:V,listenerEnabled:Y,scrollRootElement:ee,resolveScrollContainer:de,scheduleFocusSync:ve,onScroll:ye}=x;let Le=null,Ce=null;function De(){Le&&(Le(),Le=null),Ce=null,ee.value=null}function Re(Te){const Pe=x.getScrollTop?x.getScrollTop(Te):Te.scrollTop;return Math.max(0,Number.isFinite(Pe)?Math.abs(Pe):0)}return{cleanupScrollListener:De,setupScrollListener:function(){if(!B)return;if(!((Te=Y?.value)!=null?Te:V.value))return void De();var Te;const Pe=de();if(!Pe)return void De();if(ee.value===Pe&&Le)return;De(),Ce=Re(Pe);const qe=()=>{if(ye?.(),V.value){const Ue=(function(lt){const et=Re(lt),Qe=Ce;Ce=et;const ct=Math.max(480,.75*(lt.clientHeight||0));return Qe==null?et>ct?{immediate:!0}:void 0:Math.abs(et-Qe)>ct?{immediate:!0}:void 0})(Pe);Ue?ve(Ue):ve()}};Pe.addEventListener("scroll",qe,{passive:!0}),ee.value=Pe,Le=()=>{Pe.removeEventListener("scroll",qe)}}}})({isClient:he,virtualizationEnabled:vt,listenerEnabled:n0,scrollRootElement:xr,resolveScrollContainer:ue,scheduleFocusSync:Uo,onScroll:function(){const x=us.value;if(!x)return;const B=Ia();if(!B||(function(Y){if(Pa()>=Sa)return Tr=null,!1;const ee=Tr;if(ee==null)return!0;const de=Math.abs(Y.scrollTop-ee)<=2;return de||(Tr=null),de})(B))return;const V=T0(B);V!=null?(V<-32||Math.abs(Math.max(0,V)-Math.max(0,x.distanceFromBottomPx))>32)&&yl("restore"):yl("restore")},getScrollTop:x=>{var B;const V=x.ownerDocument||((B=T.value)==null?void 0:B.ownerDocument)||document,Y=x===V.documentElement||x===V.body||x===V.scrollingElement;return Ge("scrollListener.getScrollTop",()=>X(x,V,Y))}});function Hn(x,B,V){return Math.min(Math.max(x,B),V)}function tp(x){return x?.firstElementChild}function f0(x,B){var V;return x?(V=x.matches)!=null&&V.call(x,B)?x:x.querySelector(B):null}function h0(){if(!Yt.value)return void(K.value=0);const x=Ge("updateExperimentContainerWidth.clientWidth",()=>{var B,V;return(V=(B=T.value)==null?void 0:B.clientWidth)!=null?V:0});K.value=x>0?x:0}let Aa=null;function np(){Aa?.disconnect(),Aa=null}const p0=Zo({loader:()=>un(null,null,function*(){return(yield Ks(()=>import("./index8-D_Ol5awT.js"),__vite__mapDeps([5,4]))).default}),loadingComponent:uT,delay:0,suspensible:!1});function m0(x){return x===p0}const g0=j(()=>l.value==="pre"?vo:l.value==="shiki"?p0:$m),Er=j(()=>{const x=Ke.value;if(!x.length||!Yt.value)return x.map(()=>null);const B=K.value||Ge("estimatedNodeHeights.clientWidth",()=>{var V;return((V=T.value)==null?void 0:V.clientWidth)||0});return!Number.isFinite(B)||B<=0?x.map(()=>null):x.map((V,Y)=>{const ee=ro[Y],de=typeof ee=="number"&&ee>0;if(oo.value&&!de){const ye=gT(V,B,G.value);if(ye)return ye}if(Ws.value&&V.type==="code_block"){const ye=(function(Le){if(Le.type!=="code_block")return null;const Ce=K0(Le,Lu(Le));return m0(Ce)?"markdown":Ce===vo?"pre":Ce===g0.value||Ce===$m?"monaco":null})(V);if(ye==="monaco"||ye==="markdown"||ye==="pre")return(function(Le,Ce){var De;if(!Le||Le.type!=="code_block")return null;const Re=Ce.rendererKind,Te=Ce.showHeader!==!1,Pe=(function(Qe){var ct,dt,pt,at;return Qe.diff?Math.max(hd(String((ct=Qe.originalCode)!=null?ct:"")),hd(String((dt=Qe.updatedCode)!=null?dt:"")),hd(String((pt=Qe.code)!=null?pt:""))):hd(String((at=Qe.code)!=null?at:""))})(Le),qe=!!Le.diff;let Ue=0,lt=500;if(Re==="monaco"){const Qe=(De=Ce.monacoOptions)!=null?De:{},ct=(function(pt,at){const kt=typeof pt?.fontSize=="number"&&pt.fontSize>0?pt.fontSize:at?13:12;return typeof pt?.lineHeight=="number"&&pt.lineHeight>0?pt.lineHeight:at?30:Math.round(1.5*kt)})(Qe,qe),dt=(function(pt,at){var kt,bt;if(!at)return 0;const Lt=typeof((kt=pt?.padding)==null?void 0:kt.top)=="number"?pt.padding.top:10,ds=typeof((bt=pt?.padding)==null?void 0:bt.bottom)=="number"?pt.padding.bottom:22;return Math.max(0,Lt)+Math.max(0,ds)})(Qe,qe);lt=typeof Qe.MAX_HEIGHT=="number"&&Qe.MAX_HEIGHT>0?Qe.MAX_HEIGHT:500,Ue=Math.round(qe?Pe*ct+dt:Pe*(ct+1.5))}else Re==="markdown"?Ue=Math.round(21*Pe+32):(Ue=Math.round(21*Pe+32),lt=Number.POSITIVE_INFINITY);const et=Math.max(1,Math.min(Ue,lt));return{kind:"code-block",height:Math.round(et+(Te?40:0)),contentHeight:et,rendererKind:Re}})(V,{rendererKind:ye,monacoOptions:s.codeBlockMonacoOptions,showHeader:((ve=s.codeBlockProps)==null?void 0:ve.showHeader)!==!1})}var ve;return null})});function Tu(x){var B;const V=ro[x];if(Number.isFinite(V)&&V>0)return V;const Y=(B=Er.value[x])==null?void 0:B.height;return Number.isFinite(Y)&&Y>0?Y:Math.max(Fo.value,(function(ee){var de,ve,ye,Le,Ce,De,Re,Te,Pe,qe,Ue,lt,et;const Qe=Ke.value[ee];if(!Qe||typeof Qe!="object")return 32;const ct=String((de=Qe.type)!=null?de:""),dt=Dn()||640;switch(ct){case"heading":return 44;case"paragraph":return hl(String((ye=(ve=Qe.raw)!=null?ve:Qe.content)!=null?ye:""),dt,34);case"list":{const pt=Array.isArray(Qe.items)?Qe.items.length:1;return Math.max(48,30*pt+12)}case"list_item":return hl(String((Ce=(Le=Qe.raw)!=null?Le:Qe.content)!=null?Ce:""),dt,34);case"blockquote":return hl(String((Re=(De=Qe.raw)!=null?De:Qe.content)!=null?Re:""),dt,56);case"table":{const pt=Array.isArray(Qe.rows)?Qe.rows.length:Array.isArray(Qe.children)?Qe.children.length:3;return Math.max(120,38*pt+48)}case"code_block":return hl(String((Pe=(Te=Qe.code)!=null?Te:Qe.raw)!=null?Pe:""),dt,96,20);case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return hl(String((Ue=(qe=Qe.raw)!=null?qe:Qe.content)!=null?Ue:""),dt,96);case"thematic_break":return 24;default:return hl(String((et=(lt=Qe.raw)!=null?lt:Qe.content)!=null?et:""),dt,40)}})(x))}function hl(x,B,V,Y=22){const ee=String(x??"");if(!ee)return V;const de=Math.max(18,Math.floor(Math.max(320,B)/8)),ve=ee.split(/\r?\n/).length,ye=Math.ceil(ee.length/de),Le=Math.max(1,ve,ye);return Math.max(V,Math.ceil(Le*Y+12))}function Ea(x){const B=Number(x);return!Number.isFinite(B)||B<=0?-1:Math.round(B/32)}function sp(){var x,B;const V=Ke.value.length,Y=Ea(K.value||Ge("getFallbackHeightPrefix.clientWidth",()=>{var ye;return((ye=T.value)==null?void 0:ye.clientWidth)||0})),ee=((x=s.virtualScroll)==null?void 0:x.measurementKey)==null?"":String(s.virtualScroll.measurementKey),de=[V,lo.count,Math.round(lo.total),Math.round(100*Fo.value),ee,Y,Yt.value?1:0,Z_.value,q.value].join(":");if(!Zh&&l0===de)return r0;const ve=new Array(V+1);ve[0]=0;for(let ye=0;ye<V;ye++)ve[ye+1]=ve[ye]+(Yt.value?Tu(ye):(B=ro[ye])!=null?B:Fo.value);return r0=ve,l0=de,Zh=!1,ve}function v0(x){var B,V;const Y=Ke.value.length;if(Y<=0||x<=0)return 0;const ee=sp();if(x>=((B=ee[Y])!=null?B:0))return Y-1;let de=0,ve=Y-1,ye=Y-1;for(;de<=ve;){const Le=de+ve>>1;((V=ee[Le+1])!=null?V:0)>=x?(ye=Le,ve=Le-1):de=Le+1}return ye}function Di(x,B){var V,Y;if(x>=B)return 0;if(Yt.value)return(function(ve,ye){var Le,Ce;const De=Ke.value.length,Re=Hn(Math.trunc(ve),0,De),Te=Hn(Math.trunc(ye),Re,De);if(Re>=Te)return 0;const Pe=sp();return((Le=Pe[Te])!=null?Le:0)-((Ce=Pe[Re])!=null?Ce:0)})(x,B);if(Ta.value!==Ke.value.length){let ve=0;for(let ye=x;ye<B;ye++)ve+=(V=ro[ye])!=null?V:Fo.value;return ve}const ee=Kh.value,de=Gh.value;if(!ee.length||!de.length){let ve=0;for(let ye=x;ye<B;ye++)ve+=(Y=ro[ye])!=null?Y:Fo.value;return ve}return yu(ee,x,B)+(B-x-yu(de,x,B))*Fo.value}Ve(()=>Ke.value.length,x=>{co(),x<=0?ku():(x<Ta.value&&W3(x),x!==Ta.value&&vu(x))},{immediate:!0});const Y3=j(()=>{if(!vt.value)return Ke.value.map((Y,ee)=>({node:Y,index:ee}));const x=Ke.value.length,B=Hn(Fn.start,0,x),V=Hn(Fn.end,B,x);return Ke.value.slice(B,V).map((Y,ee)=>({node:Y,index:B+ee}))}),op=j(()=>vt.value?Di(0,Math.min(Fn.start,Ke.value.length)):0),ip=j(()=>{if(!vt.value)return 0;const x=Ke.value.length;return Di(Math.min(Fn.end,x),x)});function y0(){if(!Yt.value)return 0;let x=0;const B=Er.value;for(let V=0;V<B.length;V++){if(!B[V])continue;const Y=ro[V];Number.isFinite(Y)&&Y>0||x++}return x}function k0(){const x=Ke.value.length;return{totalNodes:x,measuredCount:lo.count,estimatedCount:y0(),averageNodeHeight:Fo.value,topSpacerHeight:op.value,bottomSpacerHeight:ip.value,estimatedTotalHeight:Di(0,x),width:Ir()}}function X3(){const x=Ke.value,B=k0();return Ct(nt({},B),{probe:{paragraphReady:!!G.value.paragraph,listItemReady:!!G.value.listItem,listWrapperOverhead:G.value.listWrapperOverhead,headingReadyLevels:Object.entries(G.value.headings).filter(([,V])=>!!V).map(([V])=>Number(V))},nodes:x.map((V,Y)=>{var ee,de,ve,ye,Le,Ce,De,Re,Te;return{index:Y,type:V.type,estimateKind:(de=(ee=Er.value[Y])==null?void 0:ee.kind)!=null?de:null,rendererKind:(ye=(ve=Er.value[Y])==null?void 0:ve.rendererKind)!=null?ye:null,estimatedHeight:(Ce=(Le=Er.value[Y])==null?void 0:Le.height)!=null?Ce:null,estimatedContentHeight:(Re=(De=Er.value[Y])==null?void 0:De.contentHeight)!=null?Re:null,measuredHeight:(Te=ro[Y])!=null?Te:null}})})}function rp(){return s.indexKey!=null?String(s.indexKey):sn.value?`virtual-${rn()}`:"markdown-renderer"}function b0(x){const B=String(x),V=`${rp()}-`;if(!B.startsWith(V))return null;const Y=B.slice(V.length).match(/^(\d+)(?:$|-)/);if(!Y)return null;const ee=Number(Y[1]);return!Number.isInteger(ee)||ee<0||ee>=Ke.value.length?null:ee}function rn(){var x,B,V;const Y=(x=s.virtualScroll)==null?void 0:x.sessionKey;return String(Y!=null&&Y!==""?Y:(V=(B=s.indexKey)!=null?B:s.customId)!=null?V:ut)}function Mn(){var x;const B=(x=s.virtualScroll)==null?void 0:x.threadKey;return B==null||B===""?void 0:String(B)}function lp(x){var B;return(x??"")===((B=Mn())!=null?B:"")}function Z3(){var x;const B=(x=s.virtualScroll)==null?void 0:x.measurementKey;return B==null?"":String(B)}function Q3(){const x=l.value,B=x==="monaco"?s.codeBlockMonacoOptions:void 0,V=s.codeBlockProps;return[s.isDark?"dark":"light",x==="monaco"?"code-rich":x==="pre"?"code-pre":"code-shiki",k.codeBlockStream===!1?"code-static":"code-stream",Nn(s.codeBlockMinWidth),Nn(s.codeBlockMaxWidth),Nn(B?.fontSize),Nn(B?.lineHeight),Nn(B?.fontFamily),Nn(B?.tabSize),Nn(B?.MAX_HEIGHT),Nn(B?.wordWrap),Nn(B?.wrappingIndent),Nn(B?.padding),Nn(V?.showHeader),Nn(V?.showCopyButton),Nn(V?.showExpandButton),Nn(V?.showPreviewButton),Nn(V?.showCollapseButton),Nn(V?.showFontSizeButtons)].join("\0")}function ri(){return[Z3(),Q3()].join("\0")}function Ir(){return Dn()}const Mu=j(()=>Ea(Ir())),js=j(()=>[ri(),Mu.value].join("\0")),J3=j(()=>{var x;return sn.value?["virtual",(x=Mn())!=null?x:"",rn(),js.value].join("\0"):s.indexKey});function pl(){i0.value+=1}function ap(x){return!(!x||!Number.isInteger(x.index)||x.index<0||x.index>=Ke.value.length||x.sessionKey!==rn()||x.threadKey!==Mn()||x.layoutEpochKey!==js.value)}function _0(x){const B=String(x),V=Wo.get(B);return V?ap(V)?V.index:null:b0(B)}function w0(x="async-node"){(Us.size||Wo.size)&&(Us.clear(),Wo.clear(),pl(),tn(x))}const ml=Nt(Ug,null),cp={reportHeight(x,B){if(!_t.value)return;const V=_0(x);if(V==null)return;const Y=Ho.get(V);if(!Y)return;const ee=Number(B),de=Jv(V,Y);Qv(V,Number.isFinite(ee)&&ee>0?Math.max(ee,de||0):de)},markPending(x){if(!_t.value)return;const B=b0(x);B!=null&&(function(V,Y){var ee;const de=Wo.get(V);if(de&&ap(de))return Us.set(V,Math.max(0,(ee=Us.get(V))!=null?ee:0)+1),pl(),void tn("async-node");Us.set(V,1),Wo.set(V,(function(ve){return{index:ve,sessionKey:rn(),threadKey:Mn(),layoutEpochKey:js.value}})(Y)),pl(),tn("async-node")})(String(x),B)},markSettled(x){if(!_t.value)return;const B=String(x),V=_0(x);(V!=null||(function(Y){return Us.has(String(Y))})(B))&&(function(Y){var ee;const de=(ee=Us.get(Y))!=null?ee:0;return!(de<=0||(de<=1?(Us.delete(Y),Wo.delete(Y)):Us.set(Y,de-1),pl(),de===1&&tn("async-node"),0))})(B)&&V!=null&&li()}};function eM(){let x=0;for(const B of Ho.values())x+=Ge("getVisibleDomHeight.offsetHeight",()=>{var V;return(V=B?.offsetHeight)!=null?V:0});return Math.ceil(Math.max(0,x))}ln(Ug,{reportHeight(x,B){cp.reportHeight(x,B),ml?.reportHeight(x,B)},markPending(x){cp.markPending(x),ml?.markPending(x)},markSettled(x){cp.markSettled(x),ml?.markSettled(x)}});let up,dp=null,gl=null;function Au(x){return x!==!1&&x!=null&&x!==""}function S0(){return vt.value?(function(){if(!vt.value)return!0;const x=Ke.value.length,B=Hn(Fn.start,0,x),V=Hn(Fn.end,B,x);if(B>=V)return!0;for(let Y=B;Y<V;Y++)if(!en.has(Y)||Np(Y)&&!Ho.has(Y))return!1;return!0})():tt.value>=_u.value}function fp(){return ne.value===!0&&!se.value&&Xh.value===0&&Ri.size===0&&ii.size===0&&qs==null&&S0()}function C0(){var x,B;if(((x=s.virtualScroll)==null?void 0:x.settleMode)!=="manual"||dp===rn()&&up===Mn())return!0;const V=(B=s.virtualScroll)==null?void 0:B.settledToken;return!!Au(V)&&gl===qa(V)}function hp(){return fp()&&C0()}function tM(x,B){return B.totalNodes<=0?x==="final"?"final":"estimate":B.measuredCount>=B.totalNodes?x==="final"?"final":"measured":B.measuredCount>0||B.estimatedCount>0?"mixed":"estimate"}function $r(x="manual",B){const V=k0(),Y=(function(ee){return ee||(ne.value!==!0?Ke.value.length>0?"streaming":"estimating":!S0()||ii.size>0||qs!=null?"measuring":hp()?"settled":"settling")})(B);return{sessionKey:rn(),threadKey:Mn(),phase:Y,nodeCount:V.totalNodes,liveRange:{start:Fn.start,end:Fn.end},renderedCount:tt.value,measuredCount:V.measuredCount,estimatedCount:V.estimatedCount,averageNodeHeight:V.averageNodeHeight,topSpacerHeight:V.topSpacerHeight,bottomSpacerHeight:V.bottomSpacerHeight,visibleDomHeight:eM(),totalHeight:x0(),width:V.width,final:ne.value===!0,stable:hp(),confidence:tM(Y,V),reason:x}}function Ia(){const x=xr.value||ue(),B=T.value;if(!x||!B)return null;const V=x.ownerDocument||B.ownerDocument||document,Y=x===V.documentElement||x===V.body||x===V.scrollingElement,ee=Ge("getScrollBox.scrollTop",()=>X(x,V,Y)),de=Ge("getScrollBox.scrollHeight",()=>{var ye,Le,Ce,De,Re;return Y?Math.max((Le=(ye=V.documentElement)==null?void 0:ye.scrollHeight)!=null?Le:0,(De=(Ce=V.body)==null?void 0:Ce.scrollHeight)!=null?De:0,(Re=x.scrollHeight)!=null?Re:0):x.scrollHeight}),ve=Ge("getScrollBox.clientHeight",()=>{var ye;return Y?((ye=V.documentElement)==null?void 0:ye.clientHeight)||x.clientHeight||0:x.clientHeight});return{root:x,doc:V,isViewportRoot:Y,scrollTop:ee,scrollHeight:de,clientHeight:ve}}function x0(){const x=Ke.value.length,B=Math.max(0,Di(0,x)),V=Ge("getRendererLogicalHeight.offsetHeight",()=>{var ee,de;return(de=(ee=T.value)==null?void 0:ee.offsetHeight)!=null?de:0}),Y=Math.max(0,V>0?V:Ge("getRendererLogicalHeight.scrollHeight",()=>{var ee,de;return(de=(ee=T.value)==null?void 0:ee.scrollHeight)!=null?de:0}));return x<=0?Math.ceil(V):vt.value?B>0?Math.max(1,Math.ceil(B),(function(){let ee=op.value+ip.value;for(const de of en.values())de&&(ee+=Math.max(0,Ge("getVirtualizedDomLogicalHeight.offsetHeight",()=>de.offsetHeight||0)));return Math.ceil(Math.max(0,ee))})(),(function(ee,de){return ee<=0||de<=0?0:de<=ee+Math.max(512,.05*ee)?Math.ceil(de):0})(B,Y)):Math.max(1,Math.ceil(Y)):_t.value?B>0||lo.count>0||y0()>0?(He.value&&tt.value,Math.max(1,Math.ceil(Y),Math.ceil(B))):Math.ceil(Y):Math.max(1,Math.ceil(Y),Math.ceil(B))}function T0(x){const B=T.value;if(!B)return null;const V=Ge("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>B.getBoundingClientRect());return(function(ee){return ee.isViewportRoot?ee.clientHeight:Ge("getViewportBottomInRoot.getBoundingClientRect",()=>ee.root.getBoundingClientRect().bottom)})(x)-V.bottom}function nM(x={}){const B=x.requireViewport!==!1,V=(function(de=64){const ve=Ia(),ye=T.value;if(!ve||!ye)return!1;const Le=(function(De){if(De.isViewportRoot)return{top:0,bottom:De.clientHeight};const Re=Ge("getVirtualViewportRect.getBoundingClientRect",()=>De.root.getBoundingClientRect());return{top:Re.top,bottom:Re.bottom}})(ve),Ce=Ge("isRendererNearVirtualViewport.getBoundingClientRect",()=>ye.getBoundingClientRect());return Ce.bottom>=Le.top-de&&Ce.top<=Le.bottom+de})();if(B&&!V)return null;const Y=(function(){const de=Ia(),ve=T.value;if(!de||!ve||Math.max(0,de.scrollHeight-de.scrollTop-de.clientHeight)>64)return null;const ye=T0(de);return ye==null?null:ye>=-8&&ye<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,ye)}:null})();if(Y)return{anchor:Y,captured:!0};const ee=Mt();if(ee)return{anchor:{type:"node",nodeIndex:ee.nodeIndex,offsetWithinNodePx:ee.offsetWithinNodePx},captured:V};if(x.allowFallback===!0){const de=(function(){const ve=Ke.value.length;return ve<=0?null:{type:"node",nodeIndex:Hn(ao.value,0,Math.max(0,ve-1)),offsetWithinNodePx:0}})();return de?{anchor:de,captured:!1}:null}return null}function pp(x){let B=2166136261;for(let V=0;V<x.length;V++)B^=x.charCodeAt(V),B=Math.imul(B,16777619);return(B>>>0).toString(36)}function sM(x,B){let V=x;for(let Y=0;Y<B.length;Y++)V^=B.charCodeAt(Y),V=Math.imul(V,16777619);return V^=31,V=Math.imul(V,16777619),V}const oM=new Set(["children","items","header","rows","cells","attrs","data","term","definition"]);function Eu(x,B=new WeakSet,V=0){if(x==null||typeof x=="number"||typeof x=="boolean")return String(x);if(typeof x=="string")return`s:${(function(Y){const ee=Y.length>8192?`${Y.slice(0,8192)}...${Y.length}`:Y;return`${Y.length}:${pp(ee)}`})(x)}`;if(typeof x=="function")return"fn";if(typeof x!="object")return typeof x;if(B.has(x))return"cycle";if(V>=6)return"max-depth";B.add(x);try{if(Array.isArray(x)){if(x.length<=160){const Ce=[];for(let De=0;De<x.length;De++)Ce.push(Eu(x[De],B,V+1));return`a:${x.length}:${Ce.join(",")}`}const de=[],ve=[],ye=Math.max(0,x.length-32);let Le=2166136261;for(let Ce=0;Ce<x.length;Ce++){const De=Eu(x[Ce],B,V+1);Le=sM(Le,De),Ce<32&&de.push(De),Ce>=ye&&ve.push(De)}return[`a:${x.length}`,`h=${de.join(",")}`,`t=${ve.join(",")}`,`all=${(Le>>>0).toString(36)}`].join(":")}const Y=x,ee=Object.keys(Y).filter(de=>{const ve=Y[de];return de!=="parent"&&de!=="el"&&de!=="component"&&(ve==null||typeof ve=="string"||typeof ve=="number"||typeof ve=="boolean"||oM.has(de))}).sort();return`o:${ee.length}:${ee.map(de=>`${de}=${Eu(Y[de],B,V+1)}`).join(";")}`}finally{B.delete(x)}}let M0=-1,mp="";function $a(x){const B=Ke.value[x];return B?pp(Eu(B)):""}function gp(){const x=q.value;if(M0===x)return mp;let B=2166136261;for(let V=0;V<Ke.value.length;V++){const Y=$a(V);for(let ee=0;ee<Y.length;ee++)B^=Y.charCodeAt(ee),B=Math.imul(B,16777619)}return mp=(B>>>0).toString(36),M0=x,mp}function vl(x,B={}){var V;const Y=B.includeHeightCache===!0,ee=(V=B.includeContentHash)!=null?V:Y,de=Y?(function(ye){const Le=(function(){var Ue,lt;const et=Number((lt=(Ue=s.virtualScroll)==null?void 0:Ue.heightCacheLimit)!=null?lt:5e3);return!Number.isFinite(et)||et<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(et))})();if(!Number.isFinite(Le)||ye.length<=Le)return ye;const Ce=new Map,De=Ue=>{!Ue||Ce.size>=Le||Ce.set(Ue.index,Ue)},Re=Ke.value.length,Te=Hn(Fn.start-2*Ma.value,0,Re),Pe=Hn(Fn.end+2*Ma.value,Te,Re);for(const Ue of ye)Ue.index>=Te&&Ue.index<Pe&&De(Ue);const qe=Math.max(1,Math.ceil(ye.length/Le));for(let Ue=0;Ue<ye.length&&Ce.size<Le;Ue+=qe)De(ye[Ue]);for(let Ue=ye.length-1;Ue>=0&&Ce.size<Le;Ue-=qe)De(ye[Ue]);return Array.from(Ce.values()).sort((Ue,lt)=>Ue.index-lt.index).slice(0,Le)})(j3().map(ye=>{var Le;const Ce=Ke.value[ye.index];return Ce?Ct(nt({},ye),{nodeType:String((Le=Ce.type)!=null?Le:""),signature:$a(ye.index)}):null}).filter(ye=>!!ye)):[],ve=nM({allowFallback:B.allowAnchorFallback===!0,requireViewport:B.requireViewport});return ve||de.length||B.includeEmptyState===!0?Ct(nt({sessionKey:x.sessionKey,threadKey:x.threadKey},ve?{anchor:ve.anchor,anchorCaptured:ve.captured}:{anchorCaptured:!1}),{metrics:x,width:x.width,contentHash:ee?gp():void 0,measurementKey:ri()||void 0,heightCache:de.length?de:void 0}):null}function vp(x){var B,V;const Y=Ia();if(!Y)return;const ee=(function(ye){const Le=T.value;if(!Le)return null;const Ce=fe(Le,ye.root),De=Ke.value.length,Re=Ge("getRendererBottomOffsetWithinRoot.offsetHeight",()=>Le.offsetHeight||0),Te=Math.max(0,Re>0?Re:De>0?Ge("getRendererBottomOffsetWithinRoot.scrollHeight",()=>Le.scrollHeight||0):0),Pe=x0();return Ce+Math.max(Te,Pe)})(Y);if(ee==null)return;const de=Math.max(0,x.distanceFromBottomPx),ve=Math.max(0,ee-Y.clientHeight-de);(function(ye){Sa=Pa()+120,Tr=ye})(ve),Y.isViewportRoot?(V=(B=Y.doc.defaultView)==null?void 0:B.scrollTo)==null||V.call(B,0,ve):ew(Y.root,Y.doc,ve,{isReverseFlexScrollRoot:z,getNormalizedScrollTop:X})}const yp=[];function A0(){if(he)for(si!=null&&(hn?.(si),si=null);yp.length;){const x=yp.pop();x!=null&&window.clearTimeout(x)}}function yl(x){const B=!!us.value;us.value=null,Sa=0,Tr=null,A0(),B&&x&&tn(x)}function kl(){if(!us.value||!he||si!=null)return;const x=()=>{si=null;const B=us.value;B&&vp(B)};si=cn?cn(x):null,si==null&&x()}function E0(x,B={}){const V=Ke.value.length;return V<=0?[]:x.filter(Y=>!(!Number.isInteger(Y.index)||Y.index<0||Y.index>=V)&&!(!Number.isFinite(Y.height)||Y.height<=0)&&!(B.requireSignature&&!Y.signature)&&!(B.requireCompatibilityMetadata&&!Y.nodeType&&!Y.signature)&&(function(ee){var de;const ve=Ke.value[ee.index];return!(!ve||ee.nodeType&&ee.nodeType!==String((de=ve.type)!=null?de:"")||ee.signature&&ee.signature!==$a(ee.index))})(Y))}function I0(x){const B=Ea(Ir()),V=Ea(x);return B!==-1&&V!==-1&&B===V}function kp(x){var B;const V=Number(x?.width);if(Number.isFinite(V)&&V>0)return V;const Y=Number((B=x?.metrics)==null?void 0:B.width);return Number.isFinite(Y)&&Y>0?Y:null}function $0(x){var B;return x.sessionKey===rn()&&!!lp(x.threadKey)&&((B=x.measurementKey)!=null?B:"")===ri()&&!!I0(kp(x))&&!!(function(V){const Y=V.heightCache;return!!Y?.length&&(N0(V)?Y.some(ee=>!!(ee.nodeType||ee.signature)):Y.some(ee=>!!ee.signature))})(x)}function N0(x){return!!(x.contentHash&&x.contentHash===gp())}function iM(x){return!N0(x)}let Nr=null,Lr=null,Iu=null,Na=null,La=null;function bp(x){var B;const V=x.map(ee=>{var de,ve;return[ee.index,Math.round(10*ee.height),(de=ee.nodeType)!=null?de:"",(ve=ee.signature)!=null?ve:""].join("")}).join(""),Y=Ea(Ir());return[(B=Mn())!=null?B:"",rn(),ri(),Ke.value.length,Y,x.length,pp(V)].join(":")}function L0(x=(B=>(B=s.virtualScroll)==null?void 0:B.heightCache)()){if(!_t.value||!x?.length||Ke.value.length<=0||!I0((B=s.virtualScroll)==null?void 0:B.heightCacheWidth))return!1;var B;const V=E0(x,{requireSignature:!0});if(!V.length)return!1;const Y=bp(V);return Y===Nr?(Lr="standalone",!0):(e0(V,{mode:"merge"}),co(),Nr=Y,Lr="standalone",Ba(),tn("restore"),!0)}function _p(x,B={}){var V,Y,ee;if(!_t.value||!x||x.sessionKey!==rn()||!lp(x.threadKey)||Ke.value.length<=0)return!1;const de=!!((V=x.heightCache)!=null&&V.length)&&!$u(),ve=!x.anchor||x.anchorCaptured===!1&&B.allowUncapturedAnchor!==!0?null:x.anchor,ye=B.restoreAnchor===!0&&!!ve&&!$u()&&Number(kp(x))>0;let Le=!1;if((Y=x.heightCache)!=null&&Y.length&&$0(x)){const De=E0(x.heightCache,{requireCompatibilityMetadata:!x.contentHash,requireSignature:iM(x)});De.length&&(e0(De,{mode:"merge"}),co(),Nr=bp(De),Lr="restore",Ba(),Le=!0)}if(de||ye)return!1;if(!B.restoreAnchor||!ve)return Le&&tn("restore"),!0;const Ce=(function(De,Re){var Te;const Pe=De.anchor,qe=Pe?Pe.type==="bottom"?`bottom:${Math.round(Pe.distanceFromBottomPx)}`:`node:${Pe.nodeIndex}:${Math.round(Pe.offsetWithinNodePx)}`:"none";return[(Te=Mn())!=null?Te:"",rn(),ri(),Mu.value,Re,qe].join(":")})(x,(ee=B.restoreToken)!=null?ee:"imperative");return Iu===Ce?(Le&&tn("restore"),!0):(Iu=Ce,(function(De){const Re=()=>{if(De.type==="node")return yl(),void xa({nodeIndex:De.nodeIndex,offsetWithinNodePx:De.offsetWithinNodePx});if(le(),oi.value=null,us.value=De,A0(),vp(De),he)for(const Te of[0,120,280,480])yp.push(window.setTimeout(()=>{const Pe=us.value;Pe&&vp(Pe)},Te))};(function(Te){if(!vt.value)return!1;const Pe=Ke.value.length;return!(Pe<=0||(ao.value=Te.type==="node"?Hn(Te.nodeIndex,0,Pe-1):Pe-1,Mr(),0))})(De)?ft(Re):Re()})(ve),tn("restore"),!0)}function $u(){const x=Ir();return Number.isFinite(x)&&x>0}function O0(x){var B;return x.sessionKey===rn()&&!!lp(x.threadKey)&&(Ke.value.length<=0||!(!((B=x.heightCache)!=null&&B.length)||$u())||!(!(x.anchor&&Number(kp(x))>0)||$u()))}function wp(){cs.clear();for(const x of Object.keys(ro)){const B=Number(x);Number.isInteger(B)&&B>=0&&B<Ke.value.length&&Zv(B)}}function Oa(){qs!=null&&(hn?.(qs),qs=null),Lp()}function R0(){return!he||ge?Promise.resolve():new Promise(x=>{let B=!1,V=null;const Y=()=>{B||(B=!0,V!=null&&window.clearTimeout(V),x())};if(cn)return cn(Y),void(V=window.setTimeout(Y,50));V=window.setTimeout(Y,0)})}function Sp(x,B=Mn(),V=js.value){return rn()===x&&Mn()===B&&js.value===V}function Cp(){return un(this,arguments,function*(x={}){var B,V,Y,ee,de;const ve=rn(),ye=Mn(),Le=js.value,Ce=(B=x.frames)!=null?B:2,De=(V=x.timeoutMs)!=null?V:120,Re=(Y=x.reason)!=null?Y:"manual",Te=x.expectedSettledTokenKey,Pe=x.flushPendingTimers===!0,qe=$r(Re),Ue=()=>Ct(nt({},qe),{phase:qe.final?"settling":qe.phase,stable:!1,confidence:qe.confidence==="final"?"mixed":qe.confidence,reason:Re}),lt=()=>Sp(ve,ye,Le)&&(Te==null||Da()===Te);for(let dt=0;dt<Ce;dt++){if(yield ft(),!lt()||(yield R0(),!lt()))return Ue();li(),Oa()}if(yield(function(dt){return!he||dt<=0?Promise.resolve():new Promise(pt=>window.setTimeout(pt,dt))})(De),!lt()||(Pe&&c0(),li(),Oa(),!lt()))return Ue();const et=fp();et&&(dp=ve,up=ye,((ee=s.virtualScroll)==null?void 0:ee.settleMode)==="manual"&&Te!=null&&Au((de=s.virtualScroll)==null?void 0:de.settledToken)&&Da()===Te&&(gl=qa(s.virtualScroll.settledToken)));const Qe=lt()&&et&&C0(),ct=$r(Re,Qe?"final":void 0);return Ep(ct,!0),ct})}let xp="content",Or=null,Rr=null,Tp=0,Ra=null,bl=null,Mp=null,Ap=null;function Pa(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function P0(x){var B,V;const Y=Ra;if(!Y)return!0;const ee=(V=(B=s.virtualScroll)==null?void 0:B.heightDiffThresholdPx)!=null?V:1;return Math.abs(x.totalHeight-Y.totalHeight)>ee||x.sessionKey!==Y.sessionKey||x.phase!==Y.phase||x.stable!==Y.stable||x.final!==Y.final||x.threadKey!==Y.threadKey||x.nodeCount!==Y.nodeCount||x.measuredCount!==Y.measuredCount||x.width!==Y.width}function Nn(x){if(x==null)return"";if(typeof x=="string"||typeof x=="number"||typeof x=="boolean")return String(x);try{return JSON.stringify(x)}catch{return String(x)}}function Da(x=(B=>(B=s.virtualScroll)==null?void 0:B.settledToken)()){return Nn(x)}function D0(x,B){var V,Y;return[x,B.sessionKey,(V=B.threadKey)!=null?V:"",ri(),gp(),Nn((Y=s.virtualScroll)==null?void 0:Y.settledToken),Math.round(B.totalHeight),Math.round(B.width)].join("\0")}function Ba(){Mp=null,Ap=null,bl=null}function rM(x){const B=x.heightCache;return B?.length?bp(B):""}function Fa(x){var B,V,Y;const ee=x.metrics,de=x.anchor?(ve=x.anchor).type==="bottom"?`bottom:${Math.round(ve.distanceFromBottomPx)}`:`node:${ve.nodeIndex}:${Math.round(ve.offsetWithinNodePx)}`:"none";var ve;return[x.sessionKey,(B=x.threadKey)!=null?B:"",(V=x.measurementKey)!=null?V:ri(),(Y=x.contentHash)!=null?Y:"",rM(x),de,x.anchorCaptured?1:0,ee.liveRange.start,ee.liveRange.end,ee.renderedCount,ee.nodeCount,Math.round(ee.totalHeight),Math.round(ee.width),ee.phase,ee.stable?1:0].join("\0")}function Ep(x,B=!1){if(!_t.value||(function(ve=!1){return!ve&&sn.value&&!Pn.value})(B))return;const V=B||P0(x),Y=(function(ve,ye=!1){return ye||ve.stable||ve.phase==="final"?{state:vl(ve,{includeHeightCache:!0})}:{state:vl(ve)}})(x,B),ee=Y.state,de=!!(ee&&(V||(function(ve,ye=!1){return!!ye||Fa(ve)!==bl})(ee,B)));if(V&&($(x),Ra=x,Tp=Pa()),ee&&de&&(E(ee),ee.anchor&&S(ee.anchor),bl=Fa(ee)),x.stable){const ve=D0("settled",x);if(ve!==Mp){Mp=ve;const ye=vl(x,{includeHeightCache:!0});ye&&(E(ye),bl=Fa(ye)),(function(Le){o("render-settled",Le)})(x)}}if(x.phase==="final"){const ve=D0("final",x);if(ve!==Ap){Ap=ve;const ye=vl(x,{includeHeightCache:!0});ye&&(E(ye),bl=Fa(ye)),(function(Le){o("render-final",Le)})(x)}}}function Ip(){Or!=null&&(hn?.(Or),Or=null),Rr!=null&&he&&(window.clearTimeout(Rr),Rr=null)}function B0(){Or=null,Rr=null,(function(x){if(ii.size>0||qs!=null)return!0;switch(x){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(xp)&&(li(),Oa()),Ep($r(xp))}function tn(x){var B,V;if(!_t.value||(xp=x,Or!=null||Rr!=null))return;const Y=Math.max(0,(V=(B=s.virtualScroll)==null?void 0:B.emitIntervalMs)!=null?V:32),ee=Math.max(0,Y-(Pa()-Tp)),de=()=>{Rr=null,Or=cn?cn(B0):null,Or==null&&B0()};he&&ee>0?Rr=window.setTimeout(de,ee):de()}function $p(x){var B;if(x<=0)return 0;const V=Ke.value;if(Yt.value)return v0(x);if(Ta.value===V.length&&Kh.value.length&&Gh.value.length){const ee=Fo.value,de=Kh.value,ve=Gh.value,ye=Re=>Re<=0?0:yu(de,0,Re)+(Re-yu(ve,0,Re))*ee;let Le=0,Ce=V.length-1,De=V.length-1;for(;Le<=Ce;){const Re=Le+Ce>>1;ye(Re+1)>=x?(De=Re,Ce=Re-1):Le=Re+1}return De}let Y=x;for(let ee=0;ee<V.length;ee++){const de=(B=ro[ee])!=null?B:Fo.value;if(Y<=de)return ee;Y-=de}return Math.max(0,V.length-1)}function F0(){mu.value+=1}function Np(x){return!(He.value&&x>=tt.value)&&(!Li.value||x<we.value||Jh.value.has(x))}function _l(x){const B=Cu.get(x);B&&(B(),Cu.delete(x));const V=fl.get(x);V&&(V.destroy(),fl.delete(x)),xu(x)}function H0(x,B){let V=!1;if(B){const de=en.get(x);en.set(x,B),de!==B&&(V=!0)}else en.delete(x)&&(V=!0);if(V&&F0(),B||xu(x),!t0.value||!Yn||!vt.value&&Li.value&&!F.value&&fl.size>=640&&(F.value||(F.value=!0,ep()),!t0.value||!Yn))return _l(x),void(B&&Pi(x,!0));if(x<we.value&&!vt.value||Jh.value.has(x))return _l(x),void Pi(x,!0);if(!B)return void _l(x);_l(x);const Y=Yn(B,{rootMargin:"400px"});if(!Y)return;fl.set(x,Y),Pi(x,Y.isVisible.value),Li.value&&(function(de){if(!he||!Li.value)return;xu(de);const ve=de%17*23,ye=window.setTimeout(()=>{if(u0.delete(de),!Li.value||Jh.value.has(de))return;const Le=en.get(de);if(!Le)return;const Ce=ue(Le),De=Le.ownerDocument||document,Re=De.defaultView||window,Te=!Ce||Ce===De.documentElement||Ce===De.body,Pe=!Te&&Ce?Ge("nodeVisibilityFallback.root.getBoundingClientRect",()=>Ce.getBoundingClientRect()):null,qe=Te?0:Pe.top,Ue=Te?Ge("nodeVisibilityFallback.clientHeight",()=>{var et,Qe;return(Qe=(et=Re.innerHeight)!=null?et:Ce?.clientHeight)!=null?Qe:0}):Pe.bottom,lt=Ge("nodeVisibilityFallback.node.getBoundingClientRect",()=>Le.getBoundingClientRect());lt.bottom>=qe-500&&lt.top<=Ue+500&&Pi(de,!0)},1800+ve);u0.set(de,ye)})(x);let ee=null;ee=Ve(()=>Y.isVisible.value,de=>{if(de){xu(x),Pi(x,!0),ee?.(),Cu.delete(x),fl.get(x)===Y&&fl.delete(x);try{Y.destroy()}catch{}}},{immediate:!0}),Cu.set(x,ee),vt.value&&Uo()}function Lp(){qs=null;for(const[x,B]of ii)ii.delete(x),Ho.get(x)===B.el&&Ar.get(x)===B.version&&Qv(x,B.height,{allowShrink:B.allowShrink})}function wl(){qs!=null&&(hn?.(qs),qs=null),ii.clear()}function Nu(x,B){(function(V,Y,ee){var de;if(!Number.isFinite(ee)||ee<=0||Ho.get(V)!==Y)return;const ve=Ar.get(V);if(ve==null)return;const ye=Ke.value[V],Le=se.value&&ne.value!==!0&&!((de=s.nodes)!=null&&de.length)&&V>=Ke.value.length-2,Ce=!(ye?.loading===!0||Le),De=ii.get(V),Re=De?De.allowShrink&&Ce:Ce,Te=De&&!Re?Math.max(De.height,ee):ee;ii.set(V,{height:Te,allowShrink:Re,version:ve,el:Y}),qs==null&&(qs=cn?cn(Lp):null,qs==null&&Lp())})(x,B,Jv(x,B))}function li(){for(const[x,B]of Ho)B&&Nu(x,B)}function W0(){io?.disconnect(),io=null,Zn.clear()}function Op(){for(;bu.length;)Su(bu.pop())}Ve(Pn,x=>{x&&tn("content")},{flush:"post"}),t({getVirtualMetrics:$r,captureVirtualState:function(x={}){var B;return vl($r("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:x.allowFallbackAnchor===!0,requireViewport:x.requireViewport===!0,includeEmptyState:(B=x.includeEmptyState)==null||B})},restoreVirtualState:function(x,B={}){const V=B.restoreAnchor===!0,Y=B.restoreToken==null?"imperative":String(B.restoreToken);Na=x,La={restoreAnchor:V,restoreToken:Y,allowUncapturedAnchor:B.allowUncapturedAnchor===!0},!_p(x,{restoreAnchor:V,restoreToken:Y,allowUncapturedAnchor:B.allowUncapturedAnchor===!0})&&O0(x)||(Na=null,La=null)},forceMeasure:function(x="manual"){return un(this,null,function*(){yield ft(),yield R0(),li(),Oa(),yield ft();const B=$r(x);return Ep(B,!0),B})},settle:Cp,scrollToNode:function(x,B="start"){yl(),le();const V=Ke.value.length;if(V<=0)return;const Y=Hn(x,0,V-1),ee=()=>{var de;const ve=Be({nodeIndex:Y,offsetWithinNodePx:0}),ye=Tu(Y),Le=Ia(),Ce=(de=Le?.clientHeight)!=null?de:0,De=Ca();let Re=ve;if(B==="center")Re=ve-Ce/2+ye/2;else if(B==="end")Re=ve-Ce+ye;else if(B==="nearest"&&De!=null){if(ve>=De&&ve+ye<=De+Ce)return;Re=ve<De?ve:ve-Ce+ye}Vh(Math.max(0,Re)),Uo({immediate:!0}),vt.value&&(ao.value=Y,Mr())};if(vt.value)return ao.value=Y,Mr(),void ft(ee);ee()}}),Ve(()=>Ss.value,x=>{if(!x){W0();for(const B of Oi.values())for(const V of B)Su(V);Oi.clear(),Ar.clear(),Op(),wl()}},{immediate:!0}),Ve(ne,x=>{x&&(function(){if(he&&ne.value&&Ho.size){Op();for(const B of[80,240,640]){const V=a0(B,()=>{for(const[Y,ee]of Ho)ee&&Nu(Y,ee)},"final");V!=null&&bu.push(V)}}})(),tn(x?"final":"content")}),Ve([()=>Ke.value.length,()=>tt.value],()=>{us.value&&kl(),tn("content")},{flush:"post",immediate:!0}),Ve([()=>Fn.start,()=>Fn.end],()=>{tn("batch")},{flush:"post"});const{cleanupBatchScheduler:lM}=(function(x){const{props:B,isClient:V,isTestEnv:Y,parsedNodesIdentity:ee,parsedNodeCount:de,desiredRenderedCount:ve,datasetKey:ye,batchingEnabled:Le,incrementalRenderingActive:Ce,resolvedBatchSize:De,resolvedInitialBatch:Re,renderedCount:Te,adaptiveBatchSize:Pe,previousRenderContext:qe,previousBatchConfig:Ue,requestFrame:lt,cancelFrame:et,hasIdleCallback:Qe,cleanupNodeVisibility:ct,onDatasetKeyChanged:dt,onDatasetChanged:pt}=x;let at=null,kt=null,bt=!1,Lt=null,ds=null,fs=0,Ao=!1,Bi=!1;const Fi=new Set,Dr=new Set;function ey(){if(V){at!=null&&(et?.(at),at=null),kt!=null&&(window.clearTimeout(kt),kt=null),ds!=null&&typeof window.cancelIdleCallback=="function"&&(window.cancelIdleCallback(ds),ds=null),fs+=1;for(const Qn of Fi)et?.(Qn);Fi.clear();for(const Qn of Dr)window.clearTimeout(Qn);Dr.clear(),bt=!1,Lt=null,Ao=!1,Bi=!1}}function Fu(){return typeof performance<"u"?performance.now():Date.now()}function ty(Qn){(function(ai){var Hi;if(!Ce.value)return;const ci=Math.max(2,(Hi=B.renderBatchBudgetMs)!=null?Hi:6),ui=Math.max(1,De.value||1),Eo=Math.max(1,Math.floor(ui/4));ai>1.2*ci?Pe.value=Math.max(Eo,Math.floor(.7*Pe.value)):ai<.5*ci&&Pe.value<ui&&(Pe.value=Math.min(ui,Math.ceil(1.2*Pe.value)))})(Qn),Ao=!1;const Cs=Bi||Te.value<ve.value;Bi=!1,Cs&&oy()}function ny(Qn,Cs={}){var ai,Hi;if(!Ce.value)return;const ci=ve.value;if(Te.value>=ci)return;const ui=Math.max(1,Qn),Eo=()=>{const xl=Fu();let Tl=0;at=null,kt=null,ds=null,bt=!1;const Ml=Lt??ui;Lt=null;const Wp=Fu();Te.value=Math.min(ci,Te.value+Ml),ct(Te.value),Tl=Fu()-Wp,(function(Up,iy){if(!V)return void ty(iy);Ao=!0;const ry=++fs;ft().then(()=>{var ly;if(ry!==fs)return;const MM=Fu(),AM=Math.max(iy,MM-Up),ay=()=>{ry===fs&&ty(AM)};if(lt){let uy=!1,di=null;const dy=()=>{uy||(uy=!0,ay())},Hu=lt(()=>{Fi.delete(Hu),di!=null&&(window.clearTimeout(di),Dr.delete(di),di=null),dy()});return Fi.add(Hu),di=window.setTimeout(()=>{di!=null&&Dr.delete(di),di=null,et?.(Hu),Fi.delete(Hu),dy()},Math.max(32,(ly=B.renderBatchIdleTimeoutMs)!=null?ly:120)),void Dr.add(di)}const cy=window.setTimeout(()=>{Dr.delete(cy),ay()},0);Dr.add(cy)})})(xl,Tl)};if(!V||Cs.immediate)return void Eo();const Wi=Math.max(0,(ai=B.renderBatchDelay)!=null?ai:16);if(Lt=Lt!=null?Math.max(Lt,ui):ui,!bt){if(bt=!0,!Y&&Qe&&window.requestIdleCallback){const xl=Math.max(0,(Hi=B.renderBatchIdleTimeoutMs)!=null?Hi:120);return void(ds=window.requestIdleCallback(()=>Eo(),{timeout:xl}))}lt&&!Y?at=lt(()=>{Wi!==0?kt=window.setTimeout(()=>Eo(),Wi):Eo()}):kt=window.setTimeout(()=>Eo(),Wi)}}function sy(Qn,Cs={}){Ao?Bi=!0:Qn==null?oy():ny(Qn,Cs)}function oy(){Ce.value&&ny(Le.value?Math.max(1,Math.round(Pe.value)):Math.max(1,De.value))}return Ve([ee,de,ye,Ce,De,Re,()=>B.renderBatchDelay],()=>{var Qn;const Cs=de.value,ai=qe.value,Hi=ye.value,ci=!Object.is(Hi,ai.key),ui=Cs!==ai.total,Eo=ci||ui;qe.value={key:Hi,total:Cs};const Wi=Ue.value,xl=(Qn=B.renderBatchDelay)!=null?Qn:16,Tl=Wi.batchSize!==De.value||Wi.initial!==Re.value||Wi.delay!==xl||Wi.enabled!==Ce.value;Ue.value={batchSize:De.value,initial:Re.value,delay:xl,enabled:Ce.value},ci&&dt(Cs),(Eo||Tl||!Ce.value)&&ey(),(Eo||Tl)&&(Pe.value=Math.max(1,De.value||1)),Eo&&pt();const Ml=ve.value;if(!Cs)return Te.value=0,void ct(0);if(!Ce.value)return Te.value=Ml,void ct(Te.value);const Wp=ci||ai.total===0;Te.value=Wp||Tl?Math.min(Ml,Re.value):Math.min(Te.value,Ml);const Up=Math.max(1,Re.value||De.value||Cs);Te.value<Ml?sy(Up,{immediate:!V}):ct(Te.value)},{immediate:!0}),Ve(ve,(Qn,Cs)=>{Ce.value&&(typeof Cs=="number"&&Qn<=Cs||Qn>Te.value&&sy())}),{cleanupBatchScheduler:ey}})({props:k,isClient:he,isTestEnv:ge,parsedNodesIdentity:Kn,parsedNodeCount:Ps,desiredRenderedCount:_u,datasetKey:J3,batchingEnabled:Ae,incrementalRenderingActive:He,resolvedBatchSize:Oe,resolvedInitialBatch:we,renderedCount:tt,adaptiveBatchSize:Vt,previousRenderContext:pn,previousBatchConfig:Xn,requestFrame:cn,cancelFrame:hn,hasIdleCallback:Me,cleanupNodeVisibility:K3,onDatasetKeyChanged:x=>{wl(),ku(),co(),Ba(),x>0&&vu(x)},onDatasetChanged:()=>{vt.value&&Uo({immediate:!0})}});Ve([n0,vt,()=>T.value,()=>oe()],([x,B])=>{if(!x)return d0(),void Qh();G3(),B?Uo({immediate:!0}):Qh()},{flush:"post",immediate:!0}),Ve([()=>Ke.value.length,()=>vt.value],x=>un(null,[x],function*([B,V]){V&&B&&he&&(yield ft(),Uo({immediate:!0}))}),{flush:"post"}),Ve(Yt,x=>{x&&(function(){var B;if(Gn.value&&Do.value&&Ds.value&&((B=Bs.value)!=null&&B[1]))return;const V=tr({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),Y=tr({type:"list_item",children:[V],raw:"- Probe paragraph text"}),ee=tr({type:"list",ordered:!1,items:[Y],raw:"- Probe paragraph text"});Gn.value=V,Do.value=Y,Ds.value=ee;const de={1:null,2:null,3:null,4:null,5:null,6:null};for(let ve=1;ve<=6;ve++)de[ve]=tr({type:"heading",level:ve,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(ve)} Probe heading`});Bs.value=de})()},{immediate:!0}),Ve([()=>T.value,Yt],()=>{if(!Yt.value)return np(),void(K.value=0);h0(),np(),Yt.value&&T.value&&typeof ResizeObserver<"u"&&(Aa=new ResizeObserver(()=>{h0(),oi.value&&Se(),us.value&&kl(),tn("resize")}),Aa.observe(T.value))},{immediate:!0}),Ve([Yt,ws,js],()=>un(null,null,function*(){if(!Yt.value)return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void co();yield ft(),(function(){if(!Yt.value||typeof window>"u")return G.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void co();const x={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},B=f0(tp(I.value),".paragraph-node");x.paragraph=Fm(I.value,B,"pre-wrap");const V=tp(L.value),Y=V?.querySelector(".paragraph-node");x.listItem=Fm(L.value,Y,"pre-wrap");const ee=Ge("readSimpleTextProbeProfile.list.offsetHeight",()=>{var ve,ye;return(ye=(ve=R.value)==null?void 0:ve.offsetHeight)!=null?ye:0}),de=Ge("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var ve,ye;return(ye=(ve=L.value)==null?void 0:ve.offsetHeight)!=null?ye:0});x.listWrapperOverhead=Math.max(0,ee-de);for(let ve=1;ve<=6;ve++){const ye=f0(tp(O[ve]),`h${ve}`);x.headings[ve]=Fm(O[ve],ye,"pre-wrap")}G.value=x,co()})()}),{flush:"post",immediate:!0}),Ve(()=>Ke.value.length,()=>{vt.value&&Uo({immediate:!0})}),Ve([Yt,K],()=>{co(),vt.value&&Uo({immediate:!0}),oi.value&&Se(),us.value&&kl(),tn("resize")},{immediate:!1}),Ve(()=>Li.value,x=>{if(x)for(const[B,V]of en)H0(B,V);else{ep();for(const[B,V]of en)V&&Pi(B,!0)}},{immediate:!1}),Ve([()=>s.viewportPriority,()=>Ke.value.length],([x,B])=>{x!==!1?F.value&&B<=200&&(F.value=!1):F.value=!1}),Ve(()=>tt.value,()=>{vt.value&&Uo({immediate:!0})}),Ve([ao,as,Ma,()=>Ke.value.length,vt],()=>{Mr()},{immediate:!0});let Ha=null,Wa=!1,Sl=null;function Ua(){Ha=null,dp=null,up=void 0,gl=null,Ba()}function Rp(){wl(),ku(),co(),cs.clear();const x=Ke.value.length;x>0&&vu(x),wp()}function Pp(){Ip(),c0(),Ra=null,Nr=null,Lr=null,Iu=null,Na=null,La=null,Wa=!1,Ua(),w0("restore"),le(),yl()}function qa(x){var B;return[(B=Mn())!=null?B:"",rn(),ri(),Mu.value,Da(x),Ke.value.length,Math.round(Di(0,Ke.value.length)),Math.round(Ir()),lo.count,Math.round(lo.total)].join(":")}function U0(){return un(this,null,function*(){var x,B,V,Y;const ee=(x=s.virtualScroll)==null?void 0:x.settledToken,de=Da(ee),ve=rn(),ye=Mn(),Le=js.value;if(_t.value&&((B=s.virtualScroll)==null?void 0:B.settleMode)==="manual"&&Au(ee))if(fp()){if(qa(ee)!==gl&&!Wa){Wa=!0;try{const Ce=yield Cp({reason:"manual",expectedSettledTokenKey:de}),De=Da()===de;Sp(ve,ye,Le)&&Ce.sessionKey===ve&&Ce.threadKey===ye&&De&&Ce.stable&&Ce.phase==="final"&&(gl=qa((V=s.virtualScroll)==null?void 0:V.settledToken))}finally{Wa=!1,yield ft();const Ce=(Y=s.virtualScroll)==null?void 0:Y.settledToken,De=Au(Ce)?qa(Ce):"";Sp(ve,ye,Le)&&De&&gl!==De&&U0()}}}else tn("manual")})}Ve(_t,(x,B)=>{if(x!==B){if(!x)return Pp(),void Ip();Pp(),Rp(),Sl=js.value,tn("content")}},{flush:"post"}),Ve([_t,js],([x,B])=>{x?Sl!=null?Sl!==B&&(Sl=B,(function(V="resize"){wl(),ku(),co(),cs.clear();const Y=Ke.value.length;Y>0&&vu(Y),wp(),Nr=null,Lr=null,Iu=null,Ra=null,Wa=!1,Ua(),L0(),ft(()=>{li(),oi.value&&Se(),us.value&&kl(),tn(V)})})("resize")):Sl=B:Sl=null},{flush:"post",immediate:!0}),Ve([_t,()=>rn(),()=>Mn()],([x])=>{x&&(Pp(),Rp(),w0("content"),tn("content"))}),Ve([_t,()=>rn(),()=>Mn(),js,()=>Ke.value.length],([x])=>{x&&(function(B="async-node"){let V=!1;for(const[Y,ee]of Array.from(Wo.entries()))ap(ee)||(Wo.delete(Y),Us.delete(Y),V=!0);V&&(pl(),tn(B))})("async-node")},{flush:"post"}),Ve([_t,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.sessionKey},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>s.indexKey,()=>q.value],([x])=>{x&&(Ba(),(function(B="content"){if(!_t.value)return;const V=[],Y=Ke.value.length;for(const ee of Array.from(cs.keys())){if(ee>=Y){V.push(ee);continue}const de=$a(ee),ve=cs.get(ee);ve!=null&&ve!==de&&V.push(ee),cs.set(ee,de)}for(const ee of Array.from(cs.keys()))ee>=Y&&cs.delete(ee);V.length&&((function(ee,de={}){const ve=Array.from(ee,Number);q3(ve,de)>0&&(function(Le){for(const Ce of Le)cs.delete(Ce)})(ve)})(V,{notify:!1}),co(),Ua(),oi.value&&Se(),us.value&&kl(),tn(B))})("content"))},{flush:"post",immediate:!0}),Ve([_t,()=>Ke.value.length,()=>rn(),()=>Mn()],([x,B,V,Y],[ee,de,ve,ye])=>{x&&ee&&V===ve&&Y===ye&&B!==de&&Ua()},{flush:"post"}),Ve([_t,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCache},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.heightCacheWidth},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>Ke.value.length,()=>rn(),K],()=>{L0()},{flush:"post",immediate:!0}),Ve([_t,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreAnchor},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey},()=>Ke.value.length,()=>rn(),K],x=>un(null,[x],function*([B,V]){if(!B||!V)return;yield ft();const Y=(function(){var ee;const de=(ee=s.virtualScroll)==null?void 0:ee.restoreAnchor;return de==null||de===!1?null:de===!0?"true":String(de)})();_p(V,{restoreAnchor:Y!=null,restoreToken:Y??void 0})}),{flush:"post",immediate:!0}),Ve([_t,K,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.restoreState},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.measurementKey}],([x])=>{var B;if(!x)return;const V=(B=s.virtualScroll)==null?void 0:B.restoreState;V&&Nr&&Lr==="restore"&&($0(V)||(Rp(),Nr=null,Lr=null,tn("resize")))},{flush:"post"}),Ve([_t,()=>Ke.value.length,()=>rn(),K],x=>un(null,[x],function*([B]){var V;const Y=Na,ee=La;B&&Y&&(yield ft(),!_p(Y,{restoreAnchor:ee?.restoreAnchor===!0,restoreToken:(V=ee?.restoreToken)!=null?V:"imperative",allowUncapturedAnchor:ee?.allowUncapturedAnchor===!0})&&O0(Y)||(Na=null,La=null))}),{flush:"post",immediate:!0}),Ve([_t,ne,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>rn(),()=>Mn(),js,Xh,o0,()=>tt.value,_u,()=>lo.count,()=>lo.total],([x,B,V])=>{if(!x||B!==!0||V==="manual"||!hp())return;const Y=(function(){var ee;const de=Ke.value.length;return[(ee=Mn())!=null?ee:"",rn(),ri(),Mu.value,de,Math.round(Di(0,de)),Math.round(Ir()),lo.count,Math.round(lo.total)].join(":")})();Ha!==Y&&(Ha=Y,Cp({reason:"final"}).then(ee=>{ee.stable||Ha!==Y||(Ha=null)}))},{flush:"post",immediate:!0}),Ve([_t,ne,()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settleMode},()=>{var x;return(x=s.virtualScroll)==null?void 0:x.settledToken},()=>rn(),()=>Mn(),js,Xh,o0,()=>tt.value,_u,()=>Ke.value.length,()=>lo.count,()=>lo.total],()=>{U0()},{flush:"post",immediate:!0}),Ve([()=>Ke.value.length,vt,as,Ma,()=>Fn.start,()=>Fn.end],([x,B,V,Y,ee,de])=>{Fe.value&&pe("virtualization",{nodes:x,virtualization:B,maxLiveNodes:V,buffer:Y,focusIndex:ao.value,scroll:B?(()=>{const ve=xr.value||ue();return ve?{reverse:z(ve),scrollTop:Math.round(ve.scrollTop),scrollTopAbs:Math.round(Math.abs(ve.scrollTop)),scrollHeight:Math.round(ve.scrollHeight),clientHeight:Math.round(ve.clientHeight)}:null})():null,liveRange:{start:ee,end:de},rendered:tt.value})}),Ve([()=>s.customId],([x],B,V)=>{if(!x||Fs)return;const Y=(function(ee,de){return ee?(An.controllers[ee]=de,()=>{An.controllers[ee]===de&&delete An.controllers[ee]}):()=>{}})(x,{captureRestoreAnchor:Mt,restoreAnchor:xa,getAnchorDrift:gu,getReport:X3});V(()=>{Y()})},{immediate:!0}),to(()=>{(function(){if(_t.value)try{li(),Oa();const x=$r("manual");P0(x)&&($(x),Ra=x,Tp=Pa());const B=vl(x,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});B&&(E(B),B.anchor&&S(B.anchor),bl=Fa(B))}catch{}})(),lM(),ep(),Q(),W0();for(const x of Oi.values())for(const B of x)Su(B);Oi.clear(),Ar.clear(),cs.clear(),Op(),wl(),np(),le(),yl(),Ip(),d0(),Qh()});const aM=Zo({loader:()=>un(null,null,function*(){try{return(yield Ks(()=>import("./index11-C6AzIe5E.js"),__vite__mapDeps([6,3]))).default}catch(x){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',x),vo}}),loadingComponent:VH,delay:0}),cM=Zo({loader:()=>un(null,null,function*(){try{return(yield Ks(()=>import("./index10-B0aiPYId.js"),[])).default}catch(x){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',x),vo}}),loadingComponent:zH,delay:0}),uM=Zo(()=>un(null,null,function*(){try{return(yield Ks(()=>import("./index7-CiLYTYTe.js"),[])).default}catch(x){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',x),vo}})),q0={text:kn,paragraph:sl,heading:Ef,code_block:$m,list:la,list_item:ra,blockquote:$d,table:Ac,definition_list:Nd,footnote:Ld,footnote_reference:Zs,footnote_anchor:Tc,admonition:Dd,vmr_container:Rd,hardbreak:ar,link:ks,image:lr,thematic_break:Od,math_inline:Po,math_block:dT,strong:vs,emphasis:bs,strikethrough:ys,highlight:Js,insert:Ls,subscript:Ns,superscript:$s,emoji:Is,checkbox:Xs,checkbox_input:Xs,inline_code:is,html_inline:Qs,reference:gs,html_block:Mc},dM=j(()=>rp()),j0=j(()=>nt(nt({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,monacoOptions:s.codeBlockMonacoOptions,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof We.value=="boolean"?{showTooltips:We.value}:{}),s.codeBlockProps||{}));function z0(x){return typeof x=="boolean"?x:void 0}const fM=j(()=>{const x=s.codeBlockProps||{},B={},V=z0(x.showLineNumbers);V!==void 0&&(B.showLineNumbers=V);const Y=z0(x.diffInline);Y!==void 0&&(B.diffInline=Y);const ee=(function(de){const ve=Number(de);return Number.isFinite(ve)&&ve>0?ve:void 0})(x.reservedHeightPx);return ee!==void 0&&(B.reservedHeightPx=ee),B}),hM=j(()=>{const x=s.codeBlockProps||{};return nt(nt({stream:k.codeBlockStream,darkTheme:s.codeBlockDarkTheme,lightTheme:s.codeBlockLightTheme,themes:s.themes,minWidth:s.codeBlockMinWidth,maxWidth:s.codeBlockMaxWidth},typeof We.value=="boolean"?{showTooltips:We.value}:{}),x)}),pM=j(()=>nt({},s.mermaidProps||{})),mM=j(()=>nt({},s.d2Props||{})),gM=j(()=>nt({},s.infographicProps||{})),ja=j(()=>({typewriter:s.typewriter,fade:k.fade,customHtmlTags:_s.value.customHtmlTags})),vM=j(()=>nt(nt({},ja.value),typeof We.value=="boolean"?{showTooltip:We.value}:{})),yM=j(()=>nt(nt({},ja.value),typeof We.value=="boolean"?{showTooltips:We.value}:{})),kM=j(()=>nt(nt({},ja.value),typeof We.value=="boolean"?{showTooltips:We.value}:{})),bM=j(()=>nt(nt({},ja.value),typeof We.value=="boolean"?{showTooltips:We.value}:{}));function _M(x){return Array.isArray(x.children)&&x.children.length>0}const Dp=j(()=>Y3.value.map(x=>{var B,V,Y,ee,de,ve,ye,Le;let Ce=(function(et){var Qe,ct,dt,pt,at,kt,bt;if(et.type!=="code_block")return et;const Lt=et,ds=[String((Qe=Lt.language)!=null?Qe:""),String((ct=Lt.loading)!=null?ct:""),String((dt=Lt.diff)!=null?dt:""),String((pt=Lt.code)!=null?pt:""),String((at=Lt.originalCode)!=null?at:""),String((kt=Lt.updatedCode)!=null?kt:""),String((bt=Lt.raw)!=null?bt:"")].join("\0"),fs=Cr.get(Lt);if(fs&&fs.signature===ds)return fs.node;const Ao=nt({},Lt);return Cr.set(Lt,{signature:ds,node:Ao}),Ao})(x.node);const De=Lu(Ce);let Re=K0(Ce,De);if((Ce.type==="html_block"||Ce.type==="html_inline")&&Re===q0[Ce.type]){const et=Ce,Qe=String((B=et.tag)!=null?B:"").trim().toLowerCase()||dx(et.content);if(Qe){const ct=Pt.value[Qe];if(Vn.value.has(Qe)&&ct)Re=ct,Ce=Ct(nt({},et),{type:Qe,tag:Qe,content:VR(et.content,Qe)});else if(fx((V=et.content)!=null?V:et.raw,Qe)){const dt=String((ee=(Y=et.content)!=null?Y:et.raw)!=null?ee:"");Ce.type==="html_inline"?(Re=kn,Ce={type:"text",content:dt,raw:dt}):(Re=sl,Ce={type:"paragraph",children:[{type:"text",content:dt,raw:dt}],raw:dt})}}}const Te=V0(Ce,De,Re);let Pe=nt({},(function(et,Qe,ct){const dt=Qe??Lu(et);return ct&&V0(et,dt,ct)?fM.value:et.type==="code_block"&&(function(pt){return!!(pt&&pt===Pt.value.code_block)})(ct)?j0.value:et.type==="code_block"&&m0(ct)?hM.value:dt==="mermaid"?pM.value:dt==="infographic"?gM.value:dt==="d2"||dt==="d2lang"?mM.value:et.type==="link"?vM.value:et.type==="list"?yM.value:et.type==="blockquote"?kM.value:et.type==="table"?bM.value:et.type==="code_block"?j0.value:ja.value})(Ce,De,Re));const qe=Er.value[x.index];Ce.type==="code_block"&&qe?.kind==="code-block"&&(Pe=Ct(nt({},Pe),Te?{reservedHeightPx:(de=qe.height)!=null?de:qe.contentHeight}:{estimatedHeightPx:qe.height,estimatedContentHeightPx:qe.contentHeight})),Te||Ce.type!=="code_block"||De!=="mermaid"||$f(Pe.estimatedPreviewHeightPx)!=null||(Pe=Ct(nt({},Pe),{estimatedPreviewHeightPx:bT(vT(String((ve=Ce.code)!=null?ve:"")))})),Te||Ce.type!=="code_block"||De!=="infographic"||$f(Pe.estimatedPreviewHeightPx)!=null||(Pe=Ct(nt({},Pe),{estimatedPreviewHeightPx:_T(yT(String((ye=Ce.code)!=null?ye:"")))})),Ce.type==="math_block"&&(Pe=Ct(nt({},Pe),{cacheScope:Ht.value}));const Ue=(function(et,Qe){const ct=String(et.type);return!du(ct)&&Pt.value[ct]===Qe})(Ce,Re),lt=Ue?Mv(Ce,$e.value):void 0;return Ct(nt({},x),{node:Ce,component:Re,bindings:Pe,customBindings:nt(nt({},lt??{}),Pe),rendersCustomNode:Ue,hasSlotChildren:_M(Ce),slotContent:String((Le=Ce.content)!=null?Le:""),isCodeBlock:Ce.type==="code_block",indexKey:`${dM.value}-${x.index}`})}));function Lu(x){var B;return x?.type==="code_block"?String((B=x.language)!=null?B:"").trim().toLowerCase():""}function V0(x,B,V){return x.type==="code_block"&&l.value==="pre"&&!(function(Y){return!!(Y&&Pt.value[Y])})(B)&&V===vo}function K0(x,B){if(!x)return e1;const V=Pt.value,Y=V[String(x.type)];if(x.type==="code_block"){const ee=B??Lu(x),de=ee?V[ee]:void 0;return de||(l.value==="pre"?V.code_block||vo:ee==="mermaid"?V.mermaid||aM:ee==="infographic"?V.infographic||cM:ee==="d2"||ee==="d2lang"?V.d2||uM:Y||V.code_block||g0.value)}return Y||q0[String(x.type)]||e1}function Bp(x){o("click",x)}function wM(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseover",x)}function SM(x){var B;(B=x.target)!=null&&B.closest("[data-node-index]")&&o("mouseout",x)}function G0(x){o("mouseover",x)}function Y0(x){o("mouseout",x)}const Pr=te(null),qo=te(!1);let za,Cl=null,Fp=0,Ou=0,Ru=0;const X0=["code_block","admonition","table","math_block","html_block","image","thematic_break"],CM=new Set(X0),Z0=[".typewriter-cursor",".height-estimation-probes",...X0.map(x=>`[data-node-type="${x}"]`),"script","style"].join(",");function Q0(x){if(!x||typeof x!="object")return!1;const B=x.type;return typeof B=="string"&&CM.has(B)}function Pu(x){var B,V;if(!x||typeof x!="object")return 0;const Y=x,ee=(V=(B=Y.raw)!=null?B:Y.content)!=null?V:Y.code;if(typeof ee=="string")return ee.length;const de=Y.children;if(Array.isArray(de))return de.reduce((ye,Le)=>ye+Pu(Le),0);const ve=Y.items;return Array.isArray(ve)?ve.reduce((ye,Le)=>ye+Pu(Le),0):0}function Du(){za&&(clearTimeout(za),za=void 0)}function J0(){Fp+=1,Cl!=null&&(hn?.(Cl),Cl=null)}function Bu(){J0(),Pr.value&&(Pr.value.style.visibility="hidden")}function xM(x){var B;if(x.nodeType!==Node.TEXT_NODE||!((B=x.textContent)!=null?B:"").trim())return!1;const V=x.parentElement;return!!V&&!V.closest(Z0)}function TM(x){let B=x.lastChild;for(;B;){if(xM(B))return B;if(B.nodeType===Node.ELEMENT_NODE){const V=B;if(!V.matches(Z0)&&V.lastChild){B=V.lastChild;continue}}for(;B&&B!==x&&!B.previousSibling;)B=B.parentNode;if(!B||B===x)break;B=B.previousSibling}return null}function Hp(){if(!he||!qo.value||Cl!=null)return;const x=Fp,B=()=>{Cl=null,x===Fp&&(function(){var V,Y;if(!(he&&qo.value&&T.value&&Pr.value))return;const ee=T.value,de=Pr.value;de.style.visibility="hidden";const ve=(function(){const Re=Dp.value;for(let Te=Re.length-1;Te>=0;Te--){const Pe=Re[Te];if(!Pe||Q0(Pe.node)||!Np(Pe.index))continue;const qe=en.get(Pe.index);if(!qe)continue;const Ue=TM(qe);if(Ue)return Ue}return null})();if(!ve)return;let ye=0,Le=0,Ce=20,De=!1;if(ve?.textContent){const Re=ve.textContent.length,Te=document.createRange();Te.setStart(ve,Math.max(0,Re-1)),Te.setEnd(ve,Re);const Pe=typeof Te.getClientRects=="function"?Te.getClientRects():void 0,qe=(Y=Pe?.[Pe.length-1])!=null?Y:(V=ve.parentElement)==null?void 0:V.getBoundingClientRect();if(qe){const Ue=Ge("typewriterCursor.root.getBoundingClientRect",()=>ee.getBoundingClientRect());ye=qe.right-Ue.left+ee.scrollLeft,Le=qe.top-Ue.top+ee.scrollTop,Ce=qe.height||Ce,De=!0}Te.detach()}De&&(de.style.transform=`translate(${Math.max(0,ye)}px, ${Math.max(0,Le)}px)`,de.style.height=`${Ce}px`,de.style.visibility="visible")})()};cn?Cl=cn(B):B()}return Ve([Z,()=>s.content,()=>s.nodes,()=>s.typewriter,ne],()=>un(null,null,function*(){var x,B;if(!he||Ne.value||!ke.value)return;if(ne.value)return qo.value=!1,Du(),void Bu();if((x=s.nodes)!=null&&x.length)return qo.value=!1,Du(),Bu(),Ou=((B=s.content)!=null?B:"").length,void(Ru=Z.value.length);const V=(function(){var ye,Le;return(ye=s.nodes)!=null&&ye.length?s.nodes.reduce((Ce,De)=>Ce+Pu(De),0):((Le=s.content)!=null?Le:"").length})(),Y=(function(){var ye;return(ye=s.nodes)!=null&&ye.length?s.nodes.reduce((Le,Ce)=>Le+Pu(Ce),0):Z.value.length})(),ee=!Q0(Ke.value[Ke.value.length-1]),de=V>Ou,ve=Y>Ru;if(s.typewriter===!1||!ee||!de&&!ve)return s.typewriter!==!1&&ee||(qo.value=!1,Bu()),Ou=V,void(Ru=Y);Ou=V,Ru=Y,qo.value=!0,Pr.value&&(Pr.value.style.visibility="hidden"),Du(),yield ft(),Hp(),za=setTimeout(()=>{za=void 0,qo.value=!1},3e3)}),{flush:"post",immediate:!0}),Ve(qo,x=>un(null,null,function*(){x?(yield ft(),Hp()):Bu()}),{flush:"post"}),Ve([()=>tt.value,()=>Fn.start,()=>Fn.end],()=>un(null,null,function*(){he&&!Ne.value&&ke.value&&qo.value&&(yield ft(),Hp())}),{flush:"post"}),to(()=>{Du(),J0(),xt.clear()}),(x,B)=>{const V=JA("NodeRenderer",!0);return M(Ne)?(C(!0),A(Ie,{key:0},Xe(Dp.value,Y=>(C(),A(Ie,{key:Y.index},[Y.rendersCustomNode?(C(),je(ss(Y.component),Kt({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onClick:Bp,onMouseover:G0,onMouseout:Y0,onCopy:B[0]||(B[0]=ee=>o("copy",ee)),onHandleArtifactClick:B[1]||(B[1]=ee=>o("handleArtifactClick",ee))}),{default:vn(()=>[Y.hasSlotChildren?(C(),je(V,Kt({key:0,ref_for:!0},zt.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),je(V,Kt({key:1,ref_for:!0},zt.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),je(ss(Y.component),Kt({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onClick:Bp,onMouseover:G0,onMouseout:Y0,onCopy:B[2]||(B[2]=ee=>o("copy",ee)),onHandleArtifactClick:B[3]||(B[3]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(C(),A("div",{key:1,ref_key:"containerRef",ref:T,class:Ee(["markstream-vue markdown-renderer",[{dark:s.isDark},{virtualized:vt.value},{"virtual-scroll-coordinated":Pn.value}]]),"data-custom-id":s.customId,onClick:Bp,onMouseover:wM,onMouseout:SM},[so.value||vt.value?(C(),A(Ie,{key:0},[so.value?(C(),A("div",{key:0,class:"height-estimation-probes",style:$t({width:`${ws.value}px`}),"aria-hidden":"true"},[h("div",{ref_key:"paragraphProbeWrapperRef",ref:I,class:"node-content","data-probe":"paragraph"},[mt(M(sl),{node:Gn.value,"index-key":"probe-paragraph"},null,8,["node"])],512),h("div",{ref_key:"listItemProbeWrapperRef",ref:L,class:"node-content","data-probe":"list-item"},[h("ul",GH,[mt(M(ra),{node:Do.value,"index-key":"probe-list-item"},null,8,["node"])])],512),h("div",{ref_key:"listProbeWrapperRef",ref:R,class:"node-content","data-probe":"list"},[mt(M(la),{node:Ds.value,"index-key":"probe-list"},null,8,["node"])],512),(C(),A(Ie,null,Xe(6,Y=>h("div",{key:`probe-heading-${Y}`,ref_for:!0,ref:ee=>(function(de,ve){de<1||de>6||(O[de]=ve)})(Y,ee),class:"node-content","data-probe":`heading-${Y}`},[mt(M(Ef),{node:V3(Y),"index-key":`probe-heading-${Y}`},null,8,["node","index-key"])],8,YH)),64))],4)):re("",!0),vt.value?(C(),A("div",{key:1,class:"node-spacer",style:$t({height:`${op.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],64)):re("",!0),(C(!0),A(Ie,null,Xe(Dp.value,Y=>(C(),A("div",{key:Y.index,ref_for:!0,ref:ee=>H0(Y.index,ee),class:"node-slot","data-node-index":Y.index,"data-node-type":Y.node.type},[Np(Y.index)?(C(),A("div",{key:0,ref_for:!0,ref:ee=>(function(de,ve){var ye;ve||(function(Re){const Te=`${rp()}-${Re}`;let Pe=!1;for(const qe of Array.from(Us.keys())){const Ue=Wo.get(qe);(Ue?.index===Re||qe===Te||qe.startsWith(`${Te}-`))&&(Us.delete(qe),Wo.delete(qe),Pe=!0)}Pe&&(pl(),tn("async-node"))})(de),ii.delete(de),(function(Re){var Te;const Pe=((Te=Ar.get(Re))!=null?Te:0)+1;Ar.set(Re,Pe)})(de);const Le=Oi.get(de);if(Le){for(const Re of Le)Su(Re);Oi.delete(de)}if((function(Re){const Te=Zn.get(Re);Te&&(io?.unobserve(Te),Bo.delete(Te),Zn.delete(Re))})(de),!ve||!Ss.value)return Ho.delete(de),void Ar.delete(de);Ho.set(de,ve);const Ce=()=>{Nu(de,ve)};queueMicrotask(Ce);const De=(io||typeof ResizeObserver>"u"||(io=new ResizeObserver(Re=>{if(Re.length)for(const Te of Re){const Pe=Bo.get(Te.target),qe=Zn.get(Pe??-1);Pe!=null&&qe&&Nu(Pe,qe)}else li()})),io);if(De&&(Zn.set(de,ve),Bo.set(ve,de),De.observe(ve)),typeof window<"u"){const Re=((ye=Ke.value[de])==null?void 0:ye.type)==="code_block"?[16,80,240,800]:ne.value?[80]:[];if(Re.length){const Te=Re.map(Pe=>a0(Pe,Ce,"node-resize")).filter(Pe=>Pe!=null);Te.length&&Oi.set(de,Te)}}})(Y.index,ee),class:"node-content"},[Y.isCodeBlock?Y.rendersCustomNode?(C(),je(ss(Y.component),Kt({key:1,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[8]||(B[8]=ee=>o("copy",ee)),onHandleArtifactClick:B[9]||(B[9]=ee=>o("handleArtifactClick",ee))}),{default:vn(()=>[Y.hasSlotChildren?(C(),je(V,Kt({key:0,ref_for:!0},zt.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),je(V,Kt({key:1,ref_for:!0},zt.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),je(ss(Y.component),Kt({key:2,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[10]||(B[10]=ee=>o("copy",ee)),onHandleArtifactClick:B[11]||(B[11]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(C(),je(Si,{key:0,name:"fade",css:k.fade!==!1,appear:k.fade!==!1},{default:vn(()=>[Y.rendersCustomNode?(C(),je(ss(Y.component),Kt({key:0,ref_for:!0},Y.customBindings,{node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey,"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[4]||(B[4]=ee=>o("copy",ee)),onHandleArtifactClick:B[5]||(B[5]=ee=>o("handleArtifactClick",ee))}),{default:vn(()=>[Y.hasSlotChildren?(C(),je(V,Kt({key:0,ref_for:!0},zt.value,{nodes:Y.node.children,"index-key":Y.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):Y.slotContent?(C(),je(V,Kt({key:1,ref_for:!0},zt.value,{content:Y.slotContent,final:!Y.node.loading,"index-key":`${Y.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):re("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(C(),je(ss(Y.component),Kt({key:1,node:Y.node,loading:Y.node.loading,"index-key":Y.indexKey},{ref_for:!0},Y.bindings,{"custom-id":s.customId,"is-dark":s.isDark,onCopy:B[6]||(B[6]=ee=>o("copy",ee)),onHandleArtifactClick:B[7]||(B[7]=ee=>o("handleArtifactClick",ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(C(),A("div",{key:1,class:"node-placeholder",style:$t({height:`${Tu(Y.index)}px`})},null,4))],8,XH))),128)),qo.value?(C(),A("span",{key:1,ref_key:"typewriterCursorRef",ref:Pr,class:"typewriter-cursor","aria-hidden":"true"},null,512)):re("",!0),vt.value?(C(),A("div",{key:2,class:"node-spacer",style:$t({height:`${ip.value}px`}),"aria-hidden":"true"},null,4)):re("",!0)],42,KH))}}})),[["__scopeId","data-v-661c7a50"]]),Os=ET;Os.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Os.__name,Os.name].filter(n=>!!n));for(const n of t)e.component(n,ET)};const Ov=Object.freeze(Object.defineProperty({__proto__:null,default:Os},Symbol.toStringTag,{value:"Module"})),ZH={key:0,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",class:"admonition-icon"},QH={key:1,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",class:"admonition-icon"},JH={key:2,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",class:"admonition-icon"},eW={key:3,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",class:"admonition-icon"},tW={class:"admonition-title"},nW=["aria-expanded","aria-controls"],sW=["id"],Dd=jt(Ze({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const s=e,o=t,i=j(()=>{if(s.node.title&&s.node.title.trim().length)return s.node.title;const c=s.node.kind||"note";return c.charAt(0).toUpperCase()+c.slice(1)}),r=te(!!s.node.collapsible&&!((n=s.node.open)==null||n));function l(){s.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(c,u)=>(C(),A("div",{class:Ee(["admonition",[`admonition-${s.node.kind}`]])},[h("div",{id:a,class:"admonition-legend"},[s.node.kind==="note"||s.node.kind==="info"?(C(),A("svg",ZH,[...u[1]||(u[1]=[h("circle",{cx:"12",cy:"12",r:"10"},null,-1),h("path",{d:"M12 16v-4"},null,-1),h("path",{d:"M12 8h.01"},null,-1)])])):s.node.kind==="tip"?(C(),A("svg",QH,[...u[2]||(u[2]=[h("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),h("path",{d:"M9 18h6"},null,-1),h("path",{d:"M10 22h4"},null,-1)])])):s.node.kind==="warning"||s.node.kind==="caution"?(C(),A("svg",JH,[...u[3]||(u[3]=[h("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),h("path",{d:"M12 9v4"},null,-1),h("path",{d:"M12 17h.01"},null,-1)])])):s.node.kind==="danger"||s.node.kind==="error"?(C(),A("svg",eW,[...u[4]||(u[4]=[h("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),h("path",{d:"M12 8v4"},null,-1),h("path",{d:"M12 16h.01"},null,-1)])])):re("",!0),h("span",tW,N(i.value),1),s.node.collapsible?(C(),A("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(C(),A("svg",{style:$t({rotate:r.value?"0deg":"90deg"}),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"},[...u[5]||(u[5]=[h("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,nW)):re("",!0)]),Et(h("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[mt(M(Os),{"index-key":`admonition-${e.indexKey}`,nodes:s.node.children,"custom-id":s.customId,typewriter:s.typewriter,fade:s.fade,onCopy:u[0]||(u[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,sW),[[No,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);Dd.install=e=>{e.component(Dd.__name,Dd)};const IT=()=>Ks(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let pd=null,oW=IT;function Ife(){return un(this,null,function*(){if(pd)return pd;const e=oW;if(!e)return null;let t;try{t=yield e()}catch(n){throw e===IT?new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.'):n}return t?(pd=(function(n){var s;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(s=n.default)!=null?s:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),pd):null})}function $fe(){return!1}function Nfe(){return un(this,null,function*(){return null})}const md=te(!1);let uw=!1;function Wm(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function iW(){return!uw&&typeof window<"u"&&typeof document<"u"&&(uw=!0,md.value=Wm(),new MutationObserver(()=>{md.value=Wm()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{md.value=Wm()})),md}const $T=["cjs","css","csv","gif","htm","html","jpeg","jpg","js","json","jsx","log","md","mjs","pdf","png","scss","svg","ts","tsx","txt","vue","webp","xml","yaml","yml"],rW=new Set(["AGENTS.md","CHANGELOG.md","Dockerfile","LICENSE","Makefile","README.md","package.json","pnpm-lock.yaml","pnpm-workspace.yaml","tsconfig.json","vite.config.ts"]),i1=[...$T].sort((e,t)=>t.length-e.length).join("|"),Um=new RegExp([String.raw`(?:^|[\s([{"'`+"`"+String.raw`])`,String.raw`(`,String.raw`(?:~|\.{1,2}|/)?(?:[A-Za-z0-9_.@+()[\]-]+/)+[A-Za-z0-9_.@+()[\]-]+(?:\.(?:${i1}))?`,String.raw`|`,String.raw`[A-Za-z0-9_.@+()[\]-]+\.(?:${i1})`,String.raw`)`,String.raw`(?:#L?(\d+)|:(\d+))?`,String.raw`(?=$|[\s)"'\]}>.,;!?,。;!?)])`].join(""),"gi"),NT=/[),.;!?,。;!?)]+$/;function lW(e){const t=e.toLowerCase();return $T.some(n=>t.endsWith(`.${n}`))}function aW(e){const t=new Map,n=new RegExp(String.raw`\b(?:path|src)=["'](\/[^"']+\.(?:${i1}))["']`,"gi");let s;for(;(s=n.exec(e))!==null;){const o=s[1];if(!o)continue;const i=o.split("/").pop();i&&t.set(i,o)}return t}function cW(e,t={}){const n=e.trim();if(!n||/^[a-z][a-z0-9+.-]*:\/\//i.test(n))return null;const s=n.match(/^(.*?)(?:#L?(\d+)|:(\d+))?$/i);if(!s)return null;let o=(s[1]??"").replace(NT,"");if(!o)return null;const i=o.split("/").pop()??o,r=o.includes("/"),l=rW.has(i),a=lW(i);if(r&&!l&&!a)return null;if(!r&&!l){const d=t.aliases?.get(i);if(!d)return null;o=d}const c=s[2]??s[3],u=c?Number(c):void 0;return{path:o,line:u!==void 0&&Number.isFinite(u)&&u>0?u:void 0}}function uW(e,t={}){const n=[];Um.lastIndex=0;let s;for(;(s=Um.exec(e))!==null;){const o=s[0]??"",i=s[1]??"",r=o.indexOf(i);if(r<0)continue;const l=s[2]??s[3];let a=i+(l?o.slice(r+i.length):"");const c=a.replace(NT,""),u=a.length-c.length;a=c;const d=cW(a,t);if(!d)continue;const p=s.index+r,m=p+a.length;n.push({...d,start:p,end:m,text:a}),u>0&&(Um.lastIndex-=u)}return n}const dW=12e4,fW=6e4,hW=32,pW=3e4,dw=/(^|\n)(`{3,}|~{3,})[^\n]*\n([\s\S]*?)(?:\n)?\2(?=\n|$)/g;function mW(e){let t=0,n=0,s=0;dw.lastIndex=0;let o;for(;(o=dw.exec(e))!==null;){const r=o[3]??"";t+=1,n+=r.length,s=Math.max(s,r.length)}return{codeRenderer:e.length>=dW||n>=fW||t>=hW||s>=pW?"pre":"shiki",codeFenceCount:t,codeChars:n}}const gW={key:1,class:"diff-wrap"},vW={class:"diff-bar"},yW=["title","onClick"],kW={class:"diff-pre"},bW="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",fw="github-light",hw="github-dark",_W=Ze({__name:"Markdown",props:{text:{},openFile:{},streaming:{type:Boolean,default:!1}},setup(e){const{t}=wt(),n=Nt("resolveImage"),s=te(null),o=e,i=j(()=>!o.streaming),r=j(()=>aW(o.text??"")),l=j(()=>o.streaming?{codeRenderer:"shiki",codeFenceCount:0,codeChars:0}:mW(o.text??"")),a=iW(),c=j(()=>!o.streaming),u=Vs(new Map),d=new Set,p=/(!\[[^\]]*\]\()\s*([^)\s]+)([^)]*\))/g,m=/(<img\b[^>]*?\bsrc=")([^"]+)(")/gi;function f(O){return!/^(https?:|data:|blob:)/i.test(O)}function v(O){if(!n)return;const F=[];for(const P of[p,m]){P.lastIndex=0;let q;for(;(q=P.exec(O))!==null;)F.push(q[2]??"")}for(const P of F)!P||!f(P)||u.has(P)||d.has(P)||(d.add(P),n(P).then(q=>{u.set(P,q!==P?q:"")}).catch(()=>{u.set(P,"")}).finally(()=>{d.delete(P)}))}function w(O){if(!n)return O;const F=P=>{if(!f(P))return null;const q=u.get(P);return q===void 0?bW:q===""?null:q};return O.replace(p,(P,q,K,G)=>{const oe=F(K);return oe===null?P:`${q}${oe}${G}`}).replace(m,(P,q,K,G)=>{const oe=F(K);return oe===null?P:`${q}${oe}${G}`})}Ve(()=>o.text,O=>v(O??""),{immediate:!0});function _(){if(!s.value||!o.openFile||o.streaming)return;const O=document.createTreeWalker(s.value,NodeFilter.SHOW_TEXT),F=[];let P=O.nextNode();for(;P;){const q=P,K=q.parentElement;K&&!K.closest("a, pre, .md-file-link")&&q.data.trim().length>0&&F.push(q),P=O.nextNode()}for(const q of F){const K=uW(q.data,{aliases:r.value});if(K.length===0||!q.parentNode)continue;const G=document.createDocumentFragment();let oe=0;for(const J of K){J.start>oe&&G.append(document.createTextNode(q.data.slice(oe,J.start)));const he=document.createElement("button");he.type="button",he.className="md-file-link",he.textContent=J.text,he.title=J.line?`${J.path}:${J.line}`:J.path,he.addEventListener("click",Ne=>{Ne.preventDefault(),Ne.stopPropagation(),o.openFile?.({path:J.path,line:J.line})}),G.append(he),oe=J.end}oe<q.data.length&&G.append(document.createTextNode(q.data.slice(oe))),q.parentNode.replaceChild(G,q)}}function b(O){return!(!O||/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(O))}function g(O){let F=O.length;for(const P of["#","?"]){const q=O.indexOf(P);q!==-1&&q<F&&(F=q)}return O.slice(0,F)}function y(){if(!s.value||!o.openFile||o.streaming)return;const O=s.value.querySelectorAll("a[href]");for(const F of O){if(F.dataset.mdLinkHandled==="true")continue;const P=F.getAttribute("href")??"";b(P)&&(F.dataset.mdLinkHandled="true",F.addEventListener("click",q=>{q.preventDefault(),q.stopPropagation(),o.openFile?.({path:g(P)})}))}}function k(){ft().then(()=>{_(),y()})}Ve(()=>o.text,k),Ve(()=>o.streaming,k);let $=null;Jt(()=>{k(),s.value&&($=new MutationObserver(k),$.observe(s.value,{childList:!0,subtree:!0}))}),qt(()=>{$?.disconnect()});const E={showHeader:!0,showCopyButton:!0,showExpandButton:!1,showPreviewButton:!1,showCollapseButton:!1,showFontSizeButtons:!1,loading:!1},S=/(^|\n)(?:```|~~~)diff\b[^\n]*\n([\s\S]*?)(?:\n)?(?:```|~~~)(?=\n|$)/g,T=j(()=>{const O=w(o.text??""),F=[];let P=0;S.lastIndex=0;let q;for(;(q=S.exec(O))!==null;){const G=q[1]??"",oe=O.slice(P,q.index)+(G||"");oe.trim()&&F.push({kind:"md",text:oe}),F.push({kind:"diff",code:q[2]??""}),P=S.lastIndex}const K=O.slice(P);return(K.trim()||F.length===0)&&F.push({kind:"md",text:K}),F});function I(O){return O.split(`
219
+ `).map(F=>/^\+(?!\+\+)/.test(F)?{cls:"diff-add",text:F}:/^-(?!--)/.test(F)?{cls:"diff-del",text:F}:F.startsWith("@@")?{cls:"diff-hunk",text:F}:{cls:"diff-ctx",text:F})}const L=te(null);function R(O,F){navigator.clipboard.writeText(O).then(()=>{L.value=F,setTimeout(()=>{L.value=null},1400)}).catch(()=>{})}return(O,F)=>(C(),A("div",{ref_key:"mdRef",ref:s,class:"md"},[(C(!0),A(Ie,null,Xe(T.value,(P,q)=>(C(),A(Ie,{key:q},[P.kind==="md"?(C(),je(M(Os),{key:0,content:P.text,mode:"chat","code-renderer":l.value.codeRenderer,"is-dark":M(a),"code-block-light-theme":fw,"code-block-dark-theme":hw,themes:[fw,hw],"code-block-props":E,final:i.value,"smooth-streaming":e.streaming,"batch-rendering":c.value,"defer-nodes-until-visible":!1},null,8,["content","code-renderer","is-dark","themes","final","smooth-streaming","batch-rendering"])):(C(),A("div",gW,[h("div",vW,[F[0]||(F[0]=h("span",{class:"diff-lang"},"diff",-1)),h("button",{class:"diff-copy",title:M(t)("filePreview.copyCode"),onClick:K=>R(P.code,q)},N(L.value===q?"✓":"⧉"),9,yW)]),h("pre",kW,[h("code",null,[(C(!0),A(Ie,null,Xe(I(P.code),(K,G)=>(C(),A("span",{key:G,class:Ee(K.cls)},N(K.text),3))),128))])])]))],64))),128))],512))}}),Lf=yt(_W,[["__scopeId","data-v-47db9fe8"]]),wW={class:"tc-anim"},SW={class:"prev-anim"},CW={class:"prev"},xW=Ze({__name:"ThinkingBlock",props:{text:{},mobile:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1},foldable:{type:Boolean,default:!0}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>n.text.split(/\n{2,}/).filter(c=>c.trim().length>0)),i=j(()=>n.foldable&&o.value.length>1),r=j(()=>n.streaming||!i.value),l=j(()=>o.value.pop()??""),a=te(null);return Jt(()=>{if(!n.streaming)return;const c=a.value;c&&(c.scrollTop=c.scrollHeight)}),Ve(()=>n.text,()=>{const c=a.value;!c||!(c.scrollHeight-c.scrollTop-c.clientHeight<24)||ft(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)})},{immediate:!0}),(c,u)=>(C(),A("div",{class:Ee(["think",{mob:e.mobile}])},[i.value?(C(),A("div",{key:0,class:Ee(["tc-wrap",{"is-collapsed":!r.value}]),onClick:u[0]||(u[0]=d=>s("open"))},[h("div",wW,[h("pre",{ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513)]),h("div",SW,[h("span",CW,N(l.value),1)])],2)):(C(),A("pre",{key:1,ref_key:"bodyEl",ref:a,class:"tc"},N(e.text),513))],2))}}),pw=yt(xW,[["__scopeId","data-v-81eb3b8b"]]),TW={class:"activity-notice",role:"status"},MW={class:"an-moon","aria-hidden":"true"},AW={class:"an-label"},EW=120,IW=Ze({__name:"ActivityNotice",props:{label:{}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"],n=te(0);let s=null;return Jt(()=>{s=setInterval(()=>{n.value=(n.value+1)%t.length},EW)}),qt(()=>{s&&(clearInterval(s),s=null)}),(o,i)=>(C(),A("div",TW,[h("span",MW,N(t[n.value]),1),h("span",AW,N(e.label),1)]))}}),mw=yt(IW,[["__scopeId","data-v-6a9cc3d8"]]),$W=["disabled"],NW={class:"agent-main"},LW={class:"agent-title-row"},OW={class:"agent-name"},RW={key:0,class:"agent-type"},PW={class:"agent-phase"},DW={key:0,class:"agent-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},BW=Ze({__name:"AgentCard",props:{member:{},compact:{type:Boolean}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=j(()=>(n.member.outputLines??[]).map(u=>u.trimEnd()).filter(u=>u.length>0).slice(-8)),i=j(()=>o.value.at(-1)),r=j(()=>n.member.phase==="queued"||n.member.phase==="working"||n.member.phase==="suspended"),l=j(()=>!!(n.member.summary||n.member.suspendedReason||n.member.prompt||o.value.length>0));function a(u){switch(u){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function c(){l.value&&s("open",n.member.id)}return(u,d)=>(C(),A("div",{class:Ee(["agent-card",[`phase-${e.member.phase}`,{compact:e.compact}]])},[h("button",{class:"agent-head",type:"button",disabled:!l.value,onClick:c},[d[1]||(d[1]=h("span",{class:"agent-dot","aria-hidden":"true"},null,-1)),h("span",NW,[h("span",LW,[h("span",OW,N(e.member.name),1),e.member.subagentType?(C(),A("span",RW,N(e.member.subagentType),1)):re("",!0),r.value?(C(),A("span",{key:1,class:Ee(["agent-live",{empty:!i.value}])},N(i.value),3)):re("",!0)])]),h("span",PW,N(a(e.member.phase)),1),l.value?(C(),A("svg",DW,[...d[0]||(d[0]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])])):re("",!0)],8,$W)],2))}}),r1=yt(BW,[["__scopeId","data-v-6c77f9c5"]]),FW={class:"agent-group"},HW={class:"group-count"},WW={key:0,class:"group-live"},UW={key:0,class:"group-body"},qW=Ze({__name:"AgentGroup",props:{members:{}},emits:["open"],setup(e,{emit:t}){const n=e,s=t,o=te(!0),i=j(()=>n.members.filter(l=>l.phase==="completed"||l.phase==="failed").length),r=j(()=>n.members.filter(l=>l.phase==="queued"||l.phase==="working"||l.phase==="suspended").length);return(l,a)=>(C(),A("section",FW,[h("button",{class:"group-head",type:"button",onClick:a[0]||(a[0]=c=>o.value=!o.value)},[a[3]||(a[3]=h("span",{class:"group-title"},"Agents",-1)),h("span",HW,N(i.value)+"/"+N(e.members.length),1),r.value>0?(C(),A("span",WW,N(r.value)+" running",1)):re("",!0),(C(),A("svg",{class:Ee(["group-chevron",{open:o.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...a[2]||(a[2]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),o.value?(C(),A("div",UW,[(C(!0),A(Ie,null,Xe(e.members,c=>(C(),je(r1,{key:c.id,member:c,compact:"",onOpen:a[1]||(a[1]=u=>s("open",u))},null,8,["member"]))),128))])):re("",!0)]))}}),gw=yt(qW,[["__scopeId","data-v-e61bd3c0"]]),jW=["aria-label"],zW=120,VW=60,KW=Ze({__name:"MoonSpinner",props:{fast:{type:Boolean},label:{default:"Working…"}},setup(e){const t=["🌑","🌒","🌓","🌔","🌕","🌖","🌗","🌘"];function n(s){return{"--moon-frame-delay":`${s*zW}ms`,"--moon-frame-fast-delay":`${s*VW}ms`}}return(s,o)=>(C(),A("span",{class:Ee(["moon-spin",{"moon-spin--fast":e.fast}]),"aria-label":e.label,role:"img"},[(C(),A(Ie,null,Xe(t,(i,r)=>h("span",{key:i,class:"moon-frame",style:$t(n(r)),"aria-hidden":"true"},N(i),5)),64))],10,jW))}}),l1=yt(KW,[["__scopeId","data-v-b5f428cb"]]);function GW(e,t="昨天"){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const s=new Date,o=u=>String(u).padStart(2,"0"),i=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===s.getFullYear(),l=n.getMonth()===s.getMonth(),a=n.getDate()===s.getDate();if(r&&l&&a)return i;const c=new Date(s);return c.setDate(s.getDate()-1),n.getFullYear()===c.getFullYear()&&n.getMonth()===c.getMonth()&&n.getDate()===c.getDate()?`${t} ${i}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${i}`}catch{return e}}const YW={key:0,class:"chat"},XW={key:0,class:"chat-loading"},ZW={class:"chat-loading-text"},QW={key:1,class:"chat-empty"},JW={key:1,class:"top-sentinel-text"},eU=["data-turn-id"],tU={key:0,class:"u-imgs"},nU=["src"],sU=["src","alt"],oU={key:1,class:"skill-act"},iU={class:"skill-act-head"},rU={key:0,class:"skill-act-args"},lU={key:2,class:"u-text"},aU={key:0,class:"u-meta"},cU=["data-tooltip","onClick"],uU={class:"u-edit-text"},dU=["onClick"],fU=["onClick"],hU=["data-turn-id"],pU=["onClick"],mU={class:"cd-view"},gU={key:1,class:"cd-label"},vU=["data-turn-id"],yU={key:1,class:"msg"},kU={key:2,class:"tool-stack"},bU={key:0,class:"a-msg-ft"},_U=["title"],wU=["onClick"],SU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},CU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},xU={class:"a-cpbtn-text"},TU={key:4,class:"sending-placeholder"},MU={key:1,class:"term"},AU={key:0,class:"chat-loading"},EU={class:"chat-loading-text"},IU={key:1,class:"chat-empty"},$U={key:1,class:"top-sentinel-text"},NU=["data-turn-id"],LU=["onClick"],OU={class:"cd-view"},RU={key:1,class:"cd-label"},PU=["data-turn-id"],DU={class:"no"},BU={class:"tx"},FU={class:"role-row"},HU=["onClick"],WU={key:0,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},UU={key:1,viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},qU={class:"cpbtn-text"},jU=["title"],zU={key:0,class:"u-text"},VU={key:0,class:"skill-act"},KU={class:"skill-act-head"},GU={key:0,class:"skill-act-args"},YU={key:2,class:"tool-stack"},XU=["data-tooltip","onClick"],ZU={class:"u-edit-text"},QU=["onClick"],JU={key:4,class:"ln sending-line"},eq={class:"tx"},tq=Ze({__name:"ChatPane",props:{turns:{},approvals:{default:()=>[]},bubble:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1},running:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},fastMoon:{type:Boolean,default:!1},sessionLoading:{type:Boolean},compaction:{default:null},hasMoreMessages:{type:Boolean,default:!1},loadingMore:{type:Boolean,default:!1},loadingMoreError:{type:Boolean,default:!1},isFollowing:{type:Boolean,default:!1}},emits:["openFile","openMedia","copyConversationCopied","openThinking","openCompaction","openAgent","editMessage","loadOlderMessages"],setup(e,{expose:t,emit:n}){const{t:s}=wt();qt(()=>{J!==null&&(clearTimeout(J),J=null),L!==null&&(clearTimeout(L),L=null),y!==null&&(clearTimeout(y),y=null)});const o=e,i=j(()=>o.bubble||o.mobile),r=te(null);let l=null;function a(){!r.value||typeof IntersectionObserver>"u"||(l?.disconnect(),l=new IntersectionObserver(ue=>{ue[0]?.isIntersecting&&o.hasMoreMessages&&!o.loadingMore&&!o.loadingMoreError&&!o.sessionLoading&&!o.isFollowing&&d("loadOlderMessages")},{root:null,rootMargin:"200px 0px 0px 0px",threshold:0}),l.observe(r.value))}Jt(a),qt(()=>{l?.disconnect(),l=null}),Ve(()=>[o.hasMoreMessages,o.loadingMore,o.loadingMoreError],()=>{ft().then(a)});const c=j(()=>{if(!o.running||o.turns.length===0)return null;const ue=o.turns.at(-1);return ue.role==="assistant"?ue.id:null}),u=j(()=>o.sending||o.running),d=n,p=j(()=>{for(let ue=o.turns.length-1;ue>=0;ue--)if(o.turns[ue].role==="user")return o.turns[ue].id;return null});function m(ue){return ue.role==="user"&&ue.id===p.value&&!o.running&&!o.sending&&!ue.skillActivation}function f(ue){return ue>=1e6?`${(ue/1e6).toFixed(1)}M`:ue>=1e3?`${(ue/1e3).toFixed(1)}k`:String(ue)}function v(ue){if(ue<1e3)return`${ue}ms`;if(ue<6e4)return`${(ue/1e3).toFixed(1)}s`;const z=Math.floor(ue/6e4),X=(ue%6e4/1e3).toFixed(1);return`${z}m${X}s`}function w(ue){const z=ue.compaction,X=z?.trigger==="auto"?s("conversation.compactedAuto"):s("conversation.compactedPlain");return typeof z?.tokensBefore=="number"&&typeof z?.tokensAfter=="number"?X+s("conversation.compactedTokens",{before:f(z.tokensBefore),after:f(z.tokensAfter)}):X}const _=te(null),b=te(null),g=te(null);let y=null;const k=te(new Set);function $(ue){return k.value.has(ue)}function E(ue){const z=new Set(k.value);z.has(ue)?z.delete(ue):z.add(ue),k.value=z}function S(ue,z){if($(z)){const X=new Date(ue);if(Number.isNaN(X.getTime()))return ue;const fe=D=>String(D).padStart(2,"0");return`${X.getFullYear()}-${fe(X.getMonth()+1)}-${fe(X.getDate())} ${fe(X.getHours())}:${fe(X.getMinutes())}`}return GW(ue,s("conversation.yesterday"))}function T(ue){g.value===null&&(b.value=null,g.value=ue.id,y=setTimeout(()=>{y=null,d("editMessage",ue.text),g.value=null},240))}const I=te(!1);let L=null;function R(ue){return Ne(ue).flatMap(z=>z.kind==="text"&&z.text?[z.text]:[]).join(`
220
+
221
+ `)}function O(ue){const z=[];for(const X of Ne(ue))if(X.kind==="thinking"&&X.thinking)z.push(`> **Thinking**
222
+ > ${X.thinking.split(`
223
+ `).join(`
224
+ > `)}`);else if(X.kind==="text"&&X.text)z.push(X.text);else if(X.kind==="tool"&&X.tool.output&&X.tool.output.length>0){const fe=X.tool.output.join(`
225
+ `);z.push(`\`\`\`
226
+ [${X.tool.name}]
227
+ ${fe}
228
+ \`\`\``)}else X.kind==="agent"?z.push(`**Agent** ${X.member.name} (${X.member.phase})`):X.kind==="agentGroup"&&z.push(`**Agents**
229
+
230
+ ${X.members.map(fe=>`- ${fe.name}: ${fe.phase}`).join(`
231
+ `)}`);return z.join(`
232
+
233
+ `)}function F(){if(o.turns.length===0)return;const ue=[];for(const X of o.turns){if(X.role==="compaction")continue;const fe=X.role==="user"?"User":"Assistant",D=O(X);D.trim()&&ue.push(`**${fe}**
234
+
235
+ ${D}`)}const z=ue.join(`
236
+
237
+ ---
238
+
239
+ `);navigator.clipboard.writeText(z).then(()=>{I.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,I.value=!1},2e3)}).catch(()=>{})}function P(ue){const z=[];for(let X=ue;X>=0;X--){const fe=o.turns[X];if(!fe||fe.role!=="assistant")break;z.unshift(fe)}return z}function q(ue){return P(ue).map(z=>R(z)).filter(Boolean).join(`
240
+
241
+ `)}function K(){for(let ue=o.turns.length-1;ue>=0;ue-=1)if(o.turns[ue]?.role==="assistant")return q(ue);return""}function G(){const ue=K();ue.trim()&&navigator.clipboard.writeText(ue).then(()=>{I.value=!0,d("copyConversationCopied"),L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,I.value=!1},2e3)}).catch(()=>{})}t({copyConversation:F,copyFinalSummary:G});function oe(ue){const z=o.turns[ue];if(!z||z.role!=="assistant")return!1;const X=o.turns[ue+1];return!X||X.role!=="assistant"}let J=null;function he(ue){const z=o.turns[ue];if(!z)return;const X=q(ue);X.trim()&&navigator.clipboard.writeText(X).then(()=>{_.value=z.id,J!==null&&clearTimeout(J),J=setTimeout(()=>{J=null,_.value=null},1400)}).catch(()=>{})}function Ne(ue){if(ue.blocks)return ue.blocks;const z=[];ue.thinking&&z.push({kind:"thinking",thinking:ue.thinking}),ue.text&&z.push({kind:"text",text:ue.text});for(const X of ue.tools??[])z.push({kind:"tool",tool:X});return z}function Fe(ue){return!(ue.tool.status==="ok"&&ue.tool.media)}function We(ue,z){return z<=1?"single":ue===0?"first":ue===z-1?"last":"middle"}function $e(ue){const z=Ne(ue),X=[];let fe=[];const D=()=>{if(fe.length===1){const[Z]=fe;Z&&X.push({kind:"tool",tool:Z.tool,sourceIndex:Z.sourceIndex})}else fe.length>1&&X.push({kind:"tool-stack",tools:fe});fe=[]};return z.forEach((Z,ne)=>{if(Z.kind==="tool"){if(Fe(Z)){fe.push({tool:Z.tool,sourceIndex:ne});return}D(),X.push({kind:"tool",tool:Z.tool,sourceIndex:ne});return}D(),Z.kind==="thinking"?X.push({kind:"thinking",thinking:Z.thinking,sourceIndex:ne}):Z.kind==="text"?X.push({kind:"text",text:Z.text,sourceIndex:ne}):Z.kind==="agent"?X.push({kind:"agent",member:Z.member,sourceIndex:ne}):X.push({kind:"agentGroup",members:Z.members,sourceIndex:ne})}),D(),X}function me(ue,z){return ue.id!==c.value?!1:z.sourceIndex===Ne(ue).length-1}function ke(ue){return ue.tool.id||`tool-${ue.sourceIndex}`}function _e(ue,z){return ue.kind==="tool-stack"?`tool-stack-${ue.tools[0]?.sourceIndex??z}`:ue.kind==="tool"?ke({tool:ue.tool,sourceIndex:ue.sourceIndex}):ue.kind==="agent"?`agent-${ue.member.id}-${ue.sourceIndex}`:ue.kind==="agentGroup"?`agent-group-${ue.members[0]?.id??ue.sourceIndex}`:`${ue.kind}-${ue.sourceIndex}`}return(ue,z)=>i.value?(C(),A("div",YW,[e.sessionLoading?(C(),A("div",XW,[z[10]||(z[10]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),h("span",ZW,N(M(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),A("div",QW)):re("",!0),e.hasMoreMessages||e.loadingMore?(C(),A("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Ee(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),A("span",JW,[z[11]||(z[11]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ht(" "+N(M(s)("conversation.loadingOlder")),1)])):(C(),A("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:z[0]||(z[0]=X=>d("loadOlderMessages"))},N(M(s)("conversation.loadOlder")),1))],2)):re("",!0),(C(!0),A(Ie,null,Xe(e.turns,(X,fe)=>(C(),A(Ie,{key:X.id},[X.role==="user"?(C(),A(Ie,{key:0},[h("div",{class:Ee(["u-bub turn-anchor",{undoing:g.value===X.id}]),"data-turn-id":X.id},[X.images&&X.images.length>0?(C(),A("div",tU,[(C(!0),A(Ie,null,Xe(X.images,(D,Z)=>(C(),A(Ie,{key:Z},[D.kind==="video"?(C(),A("video",{key:0,class:"u-img",src:D.url,controls:"",playsinline:"",preload:"metadata"},null,8,nU)):(C(),A("img",{key:1,class:"u-img",src:D.url,alt:D.alt||"",loading:"lazy"},null,8,sU))],64))),128))])):re("",!0),X.skillActivation?(C(),A("div",oU,[h("div",iU,[z[12]||(z[12]=h("span",{class:"skill-act-arrow"},"▶",-1)),h("span",null,N(M(s)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),A("div",rU,N(X.skillActivation.args),1)):re("",!0)])):(C(),A("div",lU,N(X.text),1))],10,eU),X.createdAt||m(X)?(C(),A("div",aU,[m(X)?(C(),A("div",{key:0,class:Ee(["u-edit-wrap",{undoing:g.value===X.id}])},[b.value!==X.id?(C(),A("button",{key:0,type:"button",class:"u-edit","data-tooltip":M(s)("conversation.undoTooltip"),onClick:D=>b.value=X.id},[h("span",uU,N(M(s)("conversation.undo")),1),z[13]||(z[13]=h("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),h("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1))],8,cU)):(C(),A("div",{key:1,class:"u-edit-confirm",onClick:z[2]||(z[2]=Ye(()=>{},["stop"]))},[h("span",null,N(M(s)("conversation.undoConfirm")),1),h("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ye(D=>T(X),["stop"])},N(M(s)("conversation.confirm")),9,dU),h("button",{type:"button",class:"u-edit-confirm-btn",onClick:z[1]||(z[1]=Ye(D=>b.value=null,["stop"]))},N(M(s)("conversation.cancel")),1)]))],2)):re("",!0),X.createdAt?(C(),A("button",{key:1,type:"button",class:"u-time",onClick:Ye(D=>E(X.id),["stop"])},N(S(X.createdAt,X.id)),9,fU)):re("",!0)])):re("",!0)],64)):X.role==="compaction"?(C(),A("div",{key:1,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[z[14]||(z[14]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),A("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:D=>d("openCompaction",{turnId:X.id})},[h("span",null,N(w(X)),1),h("span",mU,N(M(s)("conversation.viewSummary")),1)],8,pU)):(C(),A("span",gU,N(w(X)),1)),z[15]||(z[15]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,hU)):(C(),A("div",{key:2,class:"a-msg turn-anchor","data-turn-id":X.id},[(C(!0),A(Ie,null,Xe($e(X),(D,Z)=>(C(),A(Ie,{key:_e(D,Z)},[D.kind==="thinking"?(C(),je(pw,{key:0,text:D.thinking,mobile:i.value,streaming:me(X,D),onOpen:ne=>d("openThinking",{turnId:X.id,blockIndex:D.sourceIndex})},null,8,["text","mobile","streaming","onOpen"])):D.kind==="text"&&D.text?(C(),A("div",yU,[mt(Lf,{text:D.text,streaming:me(X,D),"open-file":ne=>d("openFile",ne)},null,8,["text","streaming","open-file"])])):D.kind==="tool-stack"?(C(),A("div",kU,[(C(!0),A(Ie,null,Xe(D.tools,(ne,se)=>(C(),je(ed,{key:ke(ne),tool:ne.tool,mobile:i.value,"stack-position":We(se,D.tools.length),onOpenMedia:z[3]||(z[3]=ae=>d("openMedia",ae))},null,8,["tool","mobile","stack-position"]))),128))])):D.kind==="agent"?(C(),je(r1,{key:3,member:D.member,onOpen:ne=>d("openAgent",{turnId:X.id,blockIndex:D.sourceIndex,memberId:ne})},null,8,["member","onOpen"])):D.kind==="agentGroup"?(C(),je(gw,{key:4,members:D.members,onOpen:ne=>d("openAgent",{turnId:X.id,blockIndex:D.sourceIndex,memberId:ne})},null,8,["members","onOpen"])):D.kind==="tool"?(C(),je(ed,{key:5,tool:D.tool,mobile:i.value,onOpenMedia:z[4]||(z[4]=ne=>d("openMedia",ne))},null,8,["tool","mobile"])):re("",!0)],64))),128)),X.id!==c.value&&oe(fe)&&(q(fe).trim().length>0||X.durationMs!==void 0)?(C(),A("div",bU,[X.durationMs!==void 0?(C(),A("span",{key:0,class:"a-duration",title:`${X.durationMs} ms`},N(v(X.durationMs)),9,_U)):re("",!0),q(fe).trim().length>0?(C(),A("button",{key:1,class:"a-cpbtn",tabindex:"-1",onClick:D=>he(fe)},[_.value!==X.id?(C(),A("svg",SU,[...z[16]||(z[16]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),A("svg",CU,[...z[17]||(z[17]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),h("span",xU,N(M(s)("filePreview.copy")),1)],8,wU)):re("",!0)])):re("",!0)],8,vU))],64))),128)),e.compaction?(C(),je(mw,{key:3,label:M(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(C(),A("div",TU,[mt(l1,{fast:e.fastMoon},null,8,["fast"])])):re("",!0)])):(C(),A("div",MU,[e.sessionLoading?(C(),A("div",AU,[z[18]||(z[18]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),h("span",EU,N(M(s)("conversation.loading")),1)])):e.turns.length===0&&(!e.approvals||e.approvals.length===0)?(C(),A("div",IU)):re("",!0),e.hasMoreMessages||e.loadingMore?(C(),A("div",{key:2,ref_key:"topSentinelRef",ref:r,class:Ee(["top-sentinel",{"top-sentinel-loading":e.loadingMore}])},[e.loadingMore?(C(),A("span",$U,[z[19]||(z[19]=h("span",{class:"dot-pulse","aria-hidden":"true"},null,-1)),ht(" "+N(M(s)("conversation.loadingOlder")),1)])):(C(),A("button",{key:0,type:"button",class:"top-sentinel-btn",onClick:z[5]||(z[5]=X=>d("loadOlderMessages"))},N(M(s)("conversation.loadOlder")),1))],2)):re("",!0),(C(!0),A(Ie,null,Xe(e.turns,(X,fe)=>(C(),A(Ie,{key:X.id},[X.role==="compaction"?(C(),A("div",{key:0,class:"compact-divider turn-anchor","data-turn-id":X.id,role:"separator"},[z[20]||(z[20]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1)),X.text?(C(),A("button",{key:0,type:"button",class:"cd-label cd-btn",onClick:D=>d("openCompaction",{turnId:X.id})},[h("span",null,N(w(X)),1),h("span",OU,N(M(s)("conversation.viewSummary")),1)],8,LU)):(C(),A("span",RU,N(w(X)),1)),z[21]||(z[21]=h("span",{class:"cd-line","aria-hidden":"true"},null,-1))],8,NU)):(C(),A("div",{key:1,class:Ee(["ln turn-anchor",[X.role==="user"?"userline":"ai",{undoing:g.value===X.id}]]),"data-turn-id":X.id},[h("span",DU,N(X.no),1),h("div",BU,[h("div",FU,[X.role==="user"?(C(),A(Ie,{key:0},[z[22]||(z[22]=h("span",{class:"pr"},"user@cyberneurova",-1)),z[23]||(z[23]=h("span",{class:"who"}," $ ",-1))],64)):(C(),A(Ie,{key:1},[z[24]||(z[24]=h("span",{class:"pr"},"cyberneurova",-1)),z[25]||(z[25]=h("span",{class:"who"}," > ",-1))],64)),X.id!==c.value&&oe(fe)&&q(fe).trim().length>0?(C(),A("button",{key:2,class:"cpbtn",onClick:D=>he(fe),tabindex:"-1"},[_.value!==X.id?(C(),A("svg",WU,[...z[26]||(z[26]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])])):(C(),A("svg",UU,[...z[27]||(z[27]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])),h("span",qU,N(M(s)("filePreview.copy")),1)],8,HU)):re("",!0),X.durationMs!==void 0&&X.role==="assistant"?(C(),A("span",{key:3,class:"turn-duration",title:`${X.durationMs} ms`},N(v(X.durationMs)),9,jU)):re("",!0)]),X.role==="user"?(C(),A("div",zU,[X.skillActivation?(C(),A("div",VU,[h("div",KU,[z[28]||(z[28]=h("span",{class:"skill-act-arrow"},"▶",-1)),h("span",null,N(M(s)("conversation.activatedSkill",{name:X.skillActivation.name})),1)]),X.skillActivation.args?(C(),A("div",GU,N(X.skillActivation.args),1)):re("",!0)])):(C(),A(Ie,{key:1},[ht(N(X.text),1)],64))])):(C(!0),A(Ie,{key:1},Xe($e(X),(D,Z)=>(C(),A(Ie,{key:_e(D,Z)},[D.kind==="thinking"?(C(),je(pw,{key:0,text:D.thinking,streaming:me(X,D),onOpen:ne=>d("openThinking",{turnId:X.id,blockIndex:D.sourceIndex})},null,8,["text","streaming","onOpen"])):D.kind==="text"&&D.text?(C(),je(Lf,{key:1,text:D.text,streaming:me(X,D),"open-file":ne=>d("openFile",ne)},null,8,["text","streaming","open-file"])):D.kind==="tool-stack"?(C(),A("div",YU,[(C(!0),A(Ie,null,Xe(D.tools,(ne,se)=>(C(),je(ed,{key:ke(ne),tool:ne.tool,"stack-position":We(se,D.tools.length),onOpenMedia:z[6]||(z[6]=ae=>d("openMedia",ae))},null,8,["tool","stack-position"]))),128))])):D.kind==="agent"?(C(),je(r1,{key:3,member:D.member,onOpen:ne=>d("openAgent",{turnId:X.id,blockIndex:D.sourceIndex,memberId:ne})},null,8,["member","onOpen"])):D.kind==="agentGroup"?(C(),je(gw,{key:4,members:D.members,onOpen:ne=>d("openAgent",{turnId:X.id,blockIndex:D.sourceIndex,memberId:ne})},null,8,["members","onOpen"])):D.kind==="tool"?(C(),je(ed,{key:5,tool:D.tool,onOpenMedia:z[7]||(z[7]=ne=>d("openMedia",ne))},null,8,["tool"])):re("",!0)],64))),128))]),X.role==="user"&&m(X)?(C(),A("div",{key:0,class:Ee(["u-edit-wrap ln-edit-wrap",{undoing:g.value===X.id}])},[b.value!==X.id?(C(),A("button",{key:0,type:"button",class:"u-edit","data-tooltip":M(s)("conversation.undoTooltip"),onClick:D=>b.value=X.id},[z[29]||(z[29]=h("svg",{viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6.5 2.5 3 6l3.5 3.5"}),h("path",{d:"M3 6h6.5a3.8 3.8 0 1 1 0 7.6H7.5"})],-1)),h("span",ZU,N(M(s)("conversation.undo")),1)],8,XU)):(C(),A("div",{key:1,class:"u-edit-confirm",onClick:z[9]||(z[9]=Ye(()=>{},["stop"]))},[h("span",null,N(M(s)("conversation.undoConfirm")),1),h("button",{type:"button",class:"u-edit-confirm-btn confirm",onClick:Ye(D=>T(X),["stop"])},N(M(s)("conversation.confirm")),9,QU),h("button",{type:"button",class:"u-edit-confirm-btn",onClick:z[8]||(z[8]=Ye(D=>b.value=null,["stop"]))},N(M(s)("conversation.cancel")),1)]))],2)):re("",!0)],10,PU))],64))),128)),e.compaction?(C(),je(mw,{key:3,label:M(s)("conversation.compacting")},null,8,["label"])):re("",!0),u.value?(C(),A("div",JU,[z[31]||(z[31]=h("span",{class:"no"},"—",-1)),h("div",eq,[z[30]||(z[30]=h("div",{class:"role-row"},[h("span",{class:"pr"},"cyberneurova"),h("span",{class:"who"}," > ")],-1)),mt(l1,{fast:e.fastMoon,label:"Sending…"},null,8,["fast"])])])):re("",!0)]))}}),LT=yt(tq,[["__scopeId","data-v-06321b40"]]),nq={class:"chat-header"},sq={class:"ch-id"},oq={key:0,class:"ch-ws"},iq={key:1,class:"ch-sep"},rq=["onKeydown"],lq=["title"],aq=["title","aria-label","aria-expanded"],cq=["title"],uq={key:0,class:"ch-pill ch-sync-pill"},dq={key:0,class:"ch-ahead"},fq={key:1,class:"ch-behind"},hq={key:1,class:"ch-pill ch-diff-pill"},pq={key:0,class:"ch-add"},mq={key:1,class:"ch-del"},gq=["title"],vq=Ze({__name:"ChatHeader",props:{sessionId:{},workspaceName:{},workspaceRoot:{},sessionTitle:{},branch:{},ahead:{},behind:{},changesCount:{},gitDiffStats:{},isGitRepo:{type:Boolean},pr:{},copied:{type:Boolean}},emits:["copyAll","copyFinalSummary","openChanges","openPr","renameSession","forkSession","archiveSession"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=j(()=>s.ahead??0),r=j(()=>s.behind??0),l=j(()=>s.gitDiffStats?.totalAdditions??0),a=j(()=>s.gitDiffStats?.totalDeletions??0),c=j(()=>l.value>0||a.value>0),u=te(!1),d=te(null),p=te(null),m=te({});function f(K){const G=K.target;p.value?.contains(G)||d.value?.contains(G)||_()}function v(){_()}async function w(K){if(K.stopPropagation(),u.value){_();return}u.value=!0,document.addEventListener("mousedown",f),document.addEventListener("scroll",v,!0),window.addEventListener("resize",v),await ft();const G=d.value,oe=p.value;if(!G||!oe)return;const J=G.getBoundingClientRect(),he=4,Ne=8,Fe=oe.offsetWidth,We=oe.offsetHeight;let $e=J.bottom+he;$e+We>window.innerHeight-Ne&&($e=Math.max(Ne,J.top-We-he));let me=J.left;me+Fe>window.innerWidth-Ne&&(me=Math.max(Ne,J.right-Fe)),m.value={top:`${Math.round($e)}px`,left:`${Math.round(me)}px`}}function _(){u.value=!1,P(),document.removeEventListener("mousedown",f),document.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}qt(()=>{document.removeEventListener("mousedown",f),document.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)});function b(){o("copyAll"),_()}function g(){o("copyFinalSummary"),_()}const y=te(!1);function k(){s.sessionId&&navigator.clipboard.writeText(s.sessionId).then(()=>{y.value=!0,setTimeout(()=>{y.value=!1},1200)}).catch(()=>{})}const $=te(!1),E=te(""),S=te(null);async function T(){if(_(),!!s.sessionId){$.value=!0,E.value=s.sessionTitle??"",await ft();try{S.value?.focus(),S.value?.select()}catch{}}}function I(){const K=E.value.trim();K&&s.sessionId&&K!==(s.sessionTitle??"").trim()&&o("renameSession",s.sessionId,K),$.value=!1}function L(){$.value=!1}function R(){s.sessionId&&(_(),o("forkSession",s.sessionId))}const O=te(!1);let F;function P(){clearTimeout(F),O.value=!1}function q(){if(s.sessionId){if(O.value){o("archiveSession",s.sessionId),_();return}O.value=!0,F=setTimeout(()=>{O.value=!1},2500)}}return(K,G)=>(C(),A("header",nq,[h("div",sq,[e.workspaceName?(C(),A("span",oq,N(e.workspaceName),1)):re("",!0),e.workspaceName&&e.sessionTitle?(C(),A("span",iq,"/")):re("",!0),$.value?Et((C(),A("input",{key:2,ref_key:"renameInputRef",ref:S,"onUpdate:modelValue":G[0]||(G[0]=oe=>E.value=oe),class:"ch-rename",type:"text",onKeydown:[_o(Ye(I,["stop"]),["enter"]),_o(Ye(L,["stop"]),["esc"])],onBlur:I,onClick:G[1]||(G[1]=Ye(()=>{},["stop"]))},null,40,rq)),[[yn,E.value]]):e.sessionTitle?(C(),A("span",{key:3,class:"ch-ses",title:e.sessionTitle},N(e.sessionTitle),9,lq)):re("",!0)]),h("button",{ref_key:"kebabRef",ref:d,type:"button",class:Ee(["ch-act ch-act-more",{open:u.value}]),title:M(n)("header.options"),"aria-label":M(n)("header.options"),"aria-expanded":u.value,"aria-haspopup":"menu",onClick:G[2]||(G[2]=Ye(oe=>w(oe),["stop"]))},[...G[6]||(G[6]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"3",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"13",cy:"8",r:"1.3"})],-1)])],10,aq),u.value?(C(),A("div",{key:0,ref_key:"menuRef",ref:p,class:"ch-menu",style:$t(m.value),onClick:G[3]||(G[3]=Ye(()=>{},["stop"]))},[h("button",{type:"button",class:"chm-item",onClick:Ye(b,["stop"])},N(e.copied?M(n)("header.copied"):M(n)("header.copyAll")),1),h("button",{type:"button",class:"chm-item",onClick:Ye(g,["stop"])},N(M(n)("header.copyFinalSummary")),1),e.sessionId?(C(),A(Ie,{key:0},[G[7]||(G[7]=h("div",{class:"chm-divider"},null,-1)),h("button",{type:"button",class:"chm-item",onClick:Ye(k,["stop"])},[h("span",null,N(y.value?M(n)("header.copied"):M(n)("header.copySessionId")),1)]),h("button",{type:"button",class:"chm-item",onClick:Ye(T,["stop"])},N(M(n)("header.renameSession")),1),h("button",{type:"button",class:"chm-item",onClick:Ye(R,["stop"])},N(M(n)("header.forkSession")),1),h("button",{type:"button",class:"chm-item del",onClick:Ye(q,["stop"])},N(O.value?M(n)("header.confirmArchive"):M(n)("header.archiveSession")),1)],64)):re("",!0)],4)):re("",!0),G[9]||(G[9]=h("div",{class:"ch-spacer"},null,-1)),e.isGitRepo?(C(),A("button",{key:1,type:"button",class:"ch-git",title:M(n)("header.gitTooltip"),onClick:G[4]||(G[4]=oe=>o("openChanges"))},[h("span",{class:Ee(["ch-branch",{"ch-detached":!e.branch}])},N(e.branch||M(n)("header.detached")),3),i.value>0||r.value>0?(C(),A("span",uq,[i.value>0?(C(),A("span",dq,"↑"+N(i.value),1)):re("",!0),r.value>0?(C(),A("span",fq,"↓"+N(r.value),1)):re("",!0)])):re("",!0),c.value?(C(),A("span",hq,[l.value>0?(C(),A("span",pq,"+"+N(l.value),1)):re("",!0),a.value>0?(C(),A("span",mq,"-"+N(a.value),1)):re("",!0)])):re("",!0)],8,cq)):re("",!0),e.pr?(C(),A("button",{key:2,type:"button",class:Ee(["ch-pill ch-pr",`pr-${e.pr.state}`]),title:M(n)("header.openPr"),onClick:G[5]||(G[5]=oe=>e.pr&&o("openPr",e.pr.url))},[G[8]||(G[8]=dr('<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-20069a42><circle cx="5" cy="6" r="3" data-v-20069a42></circle><path d="M5 9v12" data-v-20069a42></path><circle cx="19" cy="18" r="3" data-v-20069a42></circle><path d="m15 9-3-3 3-3" data-v-20069a42></path><path d="M12 6h5a2 2 0 0 1 2 2v7" data-v-20069a42></path></svg>',1)),h("span",null,"PR #"+N(e.pr.number)+" · "+N(e.pr.state),1)],10,gq)):re("",!0)]))}}),yq=yt(vq,[["__scopeId","data-v-20069a42"]]),kq={key:0,class:"slash-menu",role:"listbox"},bq=["aria-selected","onMouseenter","onMousedown"],_q={class:"slash-name"},wq={class:"slash-desc"},Sq=Ze({__name:"SlashMenu",props:{items:{},activeIndex:{}},emits:["select","hover"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=te([]);return Ve(()=>s.activeIndex,r=>{i.value[r]?.scrollIntoView({block:"nearest"})}),(r,l)=>e.items.length>0?(C(),A("div",kq,[(C(!0),A(Ie,null,Xe(e.items,(a,c)=>(C(),A("div",{ref_for:!0,ref:u=>{u&&(i.value[c]=u)},key:`${a.name}-${c}`,class:Ee(["slash-item",{active:c===s.activeIndex}]),role:"option","aria-selected":c===s.activeIndex,onMouseenter:u=>o("hover",c),onMousedown:Ye(u=>o("select",a),["prevent"])},[h("span",_q,N(a.name),1),h("span",wq,N(a.isSkill?a.desc:M(n)(a.desc)),1)],42,bq))),128))])):re("",!0)}}),Cq=yt(Sq,[["__scopeId","data-v-49355a6d"]]),xq={class:"mention-menu",role:"listbox"},Tq={key:0,class:"mention-state dim"},Mq={key:1,class:"mention-state dim"},Aq=["aria-selected","onMouseenter","onMousedown"],Eq=["innerHTML"],Iq={class:"mention-name"},$q={class:"mention-path"},Nq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 4.5a1 1 0 0 1 1-1h3l1.2 1.4H13a1 1 0 0 1 1 1v6.1a1 1 0 0 1-1 1H2.5a1 1 0 0 1-1-1V4.5z"/></svg>',Lq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><polyline points="5.5,5 2.5,8 5.5,11"/><polyline points="10.5,5 13.5,8 10.5,11"/></svg>',Oq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><line x1="6" y1="8" x2="11" y2="8"/><line x1="6" y1="10.5" x2="11" y2="10.5"/></svg>',Rq='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="3" width="12" height="10" rx="1"/><circle cx="5.5" cy="6.5" r="1.1"/><path d="M3 12l3.5-3.5L9 11l2-2 3 3"/></svg>',vw='<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.3" xmlns="http://www.w3.org/2000/svg"><path d="M4 1.5h5l3 3v10H4z"/><polyline points="9,1.5 9,4.5 12,4.5"/></svg>',Pq=Ze({__name:"MentionMenu",props:{items:{},activeIndex:{},loading:{type:Boolean}},emits:["select","hover"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),i=new Set(["ts","tsx","js","jsx","mjs","cjs","vue","json","py","go","rs","java","kt","c","h","cpp","cc","hpp","cs","rb","php","swift","sh","bash","zsh","css","scss","less","html","htm","xml","sql","yaml","yml","toml","lua","dart","scala","clj","ex","exs"]),r=new Set(["md","markdown","mdx","txt","rst","adoc","pdf","doc","docx"]),l=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]);function a(c){const u=c.path;if(u.endsWith("/"))return Nq;const d=c.name||u.split("/").pop()||u,p=d.lastIndexOf("."),m=p>0?d.slice(p+1).toLowerCase():"";return m?i.has(m)?Lq:r.has(m)?Oq:l.has(m)?Rq:vw:vw}return(c,u)=>(C(),A("div",xq,[n.loading?(C(),A("div",Tq,N(M(o)("mention.searching")),1)):n.items.length===0?(C(),A("div",Mq,N(M(o)("mention.noMatch")),1)):(C(!0),A(Ie,{key:2},Xe(n.items,(d,p)=>(C(),A("div",{key:d.path,class:Ee(["mention-item",{active:p===n.activeIndex}]),role:"option","aria-selected":p===n.activeIndex,onMouseenter:m=>s("hover",p),onMousedown:Ye(m=>s("select",d),["prevent"])},[h("span",{class:"mention-icon",innerHTML:a(d),"aria-hidden":"true"},null,8,Eq),h("span",Iq,N(d.name),1),h("span",$q,N(d.path),1)],42,Aq))),128))]))}}),Dq=yt(Pq,[["__scopeId","data-v-175f8d10"]]),OT=[{name:"/help",desc:"commands.help.desc"},{name:"/new",desc:"commands.new.desc"},{name:"/sessions",desc:"commands.sessions.desc"},{name:"/clear",desc:"commands.clear.desc"},{name:"/model",desc:"commands.model.desc"},{name:"/provider",desc:"commands.provider.desc"},{name:"/login",desc:"commands.login.desc"},{name:"/permission",desc:"commands.permission.desc"},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc",acceptsInput:!0},{name:"/goal",desc:"commands.goal.desc",acceptsInput:!0},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/auto",desc:"commands.auto.desc"},{name:"/yolo",desc:"commands.yolo.desc"},{name:"/thinking",desc:"commands.thinking.desc"},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc"},{name:"/fork",desc:"commands.fork.desc"},{name:"/status",desc:"commands.status.desc"}];function Bq(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}function yw(e=[]){const t=e.map(n=>({name:`/${n.name}`,desc:n.description,isSkill:!0,acceptsInput:!0}));return[...OT,...t]}function Fq(e,t=OT){const n=e.toLowerCase().trim().replace(/^\//,"");return n===""?t:t.map((s,o)=>{const i=s.name.toLowerCase().replace(/^\//,"");let r=0;return i===n?r=3:i.startsWith(n)?r=2:i.includes(n)&&(r=1),{item:s,index:o,score:r}}).filter(({score:s})=>s>0).sort((s,o)=>s.score!==o.score?o.score-s.score:s.index-o.index).map(({item:s})=>s)}function RT(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function PT(e,t){switch(RT(e)){case"always-on":return t==="off"?"high":t;case"unsupported":return"off";case"toggle":return t}}const Hq={key:0,class:"att-strip"},Wq=["title","onClick"],Uq=["src"],qq=["src","alt"],jq={key:2,class:"att-video-badge","aria-hidden":"true"},zq={class:"att-name"},Vq=["aria-label"],Kq=["title"],Gq=["title","onClick"],Yq={class:"att-lightbox-card"},Xq=["title"],Zq=["src"],Qq=["src","alt"],Jq={class:"att-lightbox-name"},ej={class:"composer-card"},tj={class:"cin-wrap"},nj={class:"input-row"},sj=["placeholder"],oj=["aria-label","title"],ij={class:"toolbar-left"},rj=["title"],lj=["title","onKeydown"],aj=["onClick"],cj={class:"pd-check"},uj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},dj={class:"pd-info"},fj={class:"pd-desc"},hj=["title"],pj={class:"mode-label"},mj={key:0,class:"mode-tag"},gj={key:1,class:"mode-tag"},vj={key:2,class:"mode-tag"},yj={class:"mode-row-name"},kj={class:"mode-row-name"},bj={class:"mode-row-name"},_j={key:0,class:"mode-row-actions"},wj={class:"toolbar-right"},Sj=["title"],Cj={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},xj=["stroke-dasharray","stroke-dashoffset"],Tj={class:"ctx-num"},Mj=["title","onKeydown"],Aj={key:0,class:"think-suffix"},Ej={key:0,class:"md-section"},Ij=["onClick"],$j={class:"md-check"},Nj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Lj={class:"md-name"},Oj={class:"md-provider"},Rj={key:1,class:"md-divider"},Pj={key:2,class:"md-section"},Dj=["onClick"],Bj={class:"md-check"},Fj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Hj={class:"md-name"},Wj={key:0,class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},Uj={key:3,class:"md-divider"},qj=["disabled"],jj={class:"md-check"},zj={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Vj={class:"md-name"},Kj={key:0,class:"md-note"},Gj={key:1,class:"md-note"},Yj={class:"md-name"},Xj="cyberneurova-web.draft.",Zj=Ze({__name:"Composer",props:{running:{type:Boolean,default:!1},sessionId:{},queued:{default:()=>[]},searchFiles:{type:Function,default:void 0},uploadImage:{type:Function,default:void 0},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{default:()=>[]},starredIds:{default:()=>[]},skills:{default:()=>[]},hideContext:{type:Boolean}},emits:["submit","steer","command","interrupt","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel"],setup(e,{expose:t,emit:n}){const s=e,o=j(()=>s.goalMode?r("status.goalPlaceholder"):r("composer.placeholder")),i=n,{t:r}=wt();function l(we){return Xj+(we&&we.length>0?we:"__new__")}function a(we){try{return localStorage.getItem(l(we))??""}catch{return""}}function c(we,Ae){try{const He=l(we);Ae?localStorage.setItem(He,Ae):localStorage.removeItem(He)}catch{}}const u=te(a(s.sessionId)),d=te(null);function p(){const we=d.value;we&&we.style.removeProperty("height")}Ve(u,we=>{ft(p),c(s.sessionId,we)}),Ve(()=>s.sessionId,(we,Ae)=>{we!==Ae&&(c(Ae,u.value),u.value=a(we),ft(p))});const m=te([]);let f=-1,v="";function w(we){const Ae=we.trim();f=-1,Ae&&m.value[m.value.length-1]!==Ae&&(m.value=[...m.value,Ae])}function _(){const we=d.value;if(!we)return!1;const Ae=we.selectionStart??0;return we.value.lastIndexOf(`
242
+ `,Ae-1)===-1}function b(we){u.value=we,ft(()=>{const Ae=d.value;if(!Ae)return;p();const He=we.length;Ae.setSelectionRange(He,He)})}function g(){if(m.value.length!==0){if(f===-1)v=u.value,f=m.value.length-1;else if(f>0)f-=1;else return;b(m.value[f])}}function y(){f!==-1&&(f<m.value.length-1?(f+=1,b(m.value[f])):(f=-1,b(v)))}const k=te(!1),$=te([]),E=te(0);function S(){const we=u.value;we.startsWith("/")&&!we.includes(" ")?($.value=Fq(we,yw(s.skills)),E.value=0,k.value=$.value.length>0):k.value=!1}function T(we){if(k.value=!1,we.acceptsInput){u.value=`${we.name} `,ft(()=>{const Ae=d.value;if(!Ae)return;const He=u.value.length;Ae.setSelectionRange(He,He),Ae.focus(),p()});return}u.value="",i("command",we.name)}const I=te(!1),L=te([]),R=te(0),O=te(!1);let F=null;function P(){const we=u.value,Ae=d.value?.selectionStart??we.length;let He=Ae-1;for(;He>=0&&!/\s/.test(we[He]);)He--;He++;const tt=we.slice(He,Ae);return tt.startsWith("@")?{token:tt.slice(1),start:He,end:Ae}:null}function q(){const we=P();if(!we||!s.searchFiles){I.value=!1;return}const Ae=we.token;F!==null&&clearTimeout(F),F=setTimeout(async()=>{O.value=!0,I.value=!0,R.value=0;try{const He=await s.searchFiles(Ae);L.value=He}catch{L.value=[]}finally{O.value=!1}},200)}function K(we){const Ae=P();if(!Ae)return;const He=u.value;u.value=He.slice(0,Ae.start)+we.path+He.slice(Ae.end),I.value=!1,ft(()=>{const tt=d.value;if(!tt)return;const pn=Ae.start+we.path.length;tt.setSelectionRange(pn,pn),tt.focus(),p()})}function G(){f=-1,S(),q()}const oe=te([]),J=te(null),he=te(null),Ne=te(!1);let Fe=0;function We(){return`att_${++Fe}`}function $e(we){try{URL.revokeObjectURL(we.previewUrl)}catch{}}function me(we){return we.startsWith("image/")?"image":we.startsWith("video/")?"video":null}async function ke(we){if(!s.uploadImage)return;const Ae=we.map(He=>({file:He,kind:me(He.type)})).filter(He=>He.kind!==null);if(Ae.length!==0)for(const{file:He,kind:tt}of Ae){const pn=We(),Vt=URL.createObjectURL(He),Xn={localId:pn,name:He.name,kind:tt,previewUrl:Vt,uploading:!0};oe.value=[...oe.value,Xn],s.uploadImage(He,He.name).then(en=>{oe.value=oe.value.map(Zn=>Zn.localId===pn?{...Zn,uploading:!1,fileId:en?.fileId,error:en===null}:Zn)}).catch(()=>{oe.value=oe.value.map(en=>en.localId===pn?{...en,uploading:!1,error:!0}:en)})}}function _e(we){const Ae=oe.value.find(He=>He.localId===we);J.value?.localId===we&&(J.value=null),Ae&&$e(Ae),oe.value=oe.value.filter(He=>He.localId!==we)}function ue(we){J.value=we}function z(){J.value=null}function X(){he.value?.click()}function fe(we){const Ae=we.target,He=Array.from(Ae.files??[]);ke(He),Ae.value=""}function D(we){if(!s.uploadImage)return;const Ae=we.clipboardData;if(!Ae)return;const He=[],tt=new Set,pn=(Vt,Xn)=>{const en=`${Vt.size}:${Vt.type}:${Xn}`;if(tt.has(en))return;tt.add(en);const Zn=Vt.type.split("/")[1]??"png",Bo=Xn.includes(".")?Xn:`paste-${Date.now()}.${Zn}`;He.push(Vt instanceof File?Vt:new File([Vt],Bo,{type:Vt.type}))};for(const Vt of Array.from(Ae.items))if(Vt.kind==="file"&&me(Vt.type)){const Xn=Vt.getAsFile();Xn&&pn(Xn,Xn.name||`paste-${Date.now()}.${Vt.type.split("/")[1]??"png"}`)}for(const Vt of Array.from(Ae.files))me(Vt.type)&&pn(Vt,Vt.name);He.length!==0&&(we.preventDefault(),ke(He))}function Z(we){!s.uploadImage||!Array.from(we.dataTransfer?.items??[]).some(He=>He.kind==="file")||(we.preventDefault(),Ne.value=!0)}function ne(){Ne.value=!1}function se(we){if(Ne.value=!1,!s.uploadImage)return;we.preventDefault();const Ae=Array.from(we.dataTransfer?.files??[]);ke(Ae)}Jt(()=>{document.addEventListener("paste",D),u.value&&ft(p)}),qt(()=>{document.removeEventListener("paste",D),document.removeEventListener("mousedown",Dn);for(const we of oe.value)$e(we);J.value=null,pe()});function ae(we){u.value=we,ft(()=>{const Ae=d.value;if(!Ae)return;Ae.focus();const He=we.length;Ae.setSelectionRange(He,He),p()})}t({loadForEdit:ae});function H(){const we=u.value.trim();if(oe.value.some(tt=>tt.uploading))return;const Ae=oe.value.filter(tt=>!tt.uploading&&!tt.error&&tt.fileId);if(!we&&Ae.length===0)return;if(we){const tt=Bq(we),pn=tt?yw(s.skills).some(Vt=>Vt.name===tt.cmd):!1;if(tt&&pn){u.value="",k.value=!1,i("command",tt.arg?`${tt.cmd} ${tt.arg}`:tt.cmd);return}}const He={text:we,attachments:Ae.map(tt=>({fileId:tt.fileId,kind:tt.kind}))};J.value=null;for(const tt of oe.value)$e(tt);oe.value=[],w(we),u.value="",k.value=!1,I.value=!1,i("submit",He)}function U(){if(!s.running||oe.value.some(tt=>tt.uploading))return;const we=u.value.trim(),Ae=oe.value.filter(tt=>!tt.uploading&&!tt.error&&tt.fileId);if(!we&&Ae.length===0&&s.queued.length===0)return;const He={text:we,attachments:Ae.map(tt=>({fileId:tt.fileId,kind:tt.kind}))};for(const tt of oe.value)$e(tt);oe.value=[],w(we),u.value="",k.value=!1,I.value=!1,i("steer",He)}let Q=!1,ce=null;function pe(){ce!==null&&(clearTimeout(ce),ce=null)}function xe(){pe(),Q=!0}function ie(){pe(),ce=setTimeout(()=>{ce=null,Q=!1},0)}function be(we){return Q||we.isComposing||we.keyCode===229}function ze(we){if(!be(we)){if(we.key==="Escape"){if(Ge.value){we.preventDefault(),Pt();return}if(ut.value){we.preventDefault(),_s();return}}if(k.value){if(we.key==="ArrowDown"){we.preventDefault(),E.value=(E.value+1)%$.value.length;return}if(we.key==="ArrowUp"){we.preventDefault(),E.value=(E.value-1+$.value.length)%$.value.length;return}if(we.key==="Enter"||we.key==="Tab"){we.preventDefault();const Ae=$.value[E.value];Ae&&T(Ae);return}if(we.key==="Escape"){we.preventDefault(),k.value=!1;return}}if(I.value&&!O.value){if(we.key==="ArrowDown"){we.preventDefault(),R.value=(R.value+1)%Math.max(1,L.value.length);return}if(we.key==="ArrowUp"){we.preventDefault(),R.value=(R.value-1+Math.max(1,L.value.length))%Math.max(1,L.value.length);return}if(we.key==="Enter"||we.key==="Tab"){we.preventDefault();const Ae=L.value[R.value];Ae&&K(Ae);return}if(we.key==="Escape"){we.preventDefault(),I.value=!1;return}}if(we.key==="s"&&(we.ctrlKey||we.metaKey)&&!we.shiftKey&&!we.altKey){s.running&&(we.preventDefault(),U());return}if(!k.value&&!I.value&&!we.shiftKey&&!we.altKey&&!we.metaKey&&!we.ctrlKey){const Ae=f!==-1;if(we.key==="ArrowUp"&&m.value.length>0&&(Ae||_())){we.preventDefault(),g();return}if(we.key==="ArrowDown"&&Ae){we.preventDefault(),y();return}}we.key==="Enter"&&!we.shiftKey&&(we.preventDefault(),H())}}const Je=j(()=>s.running?r("composer.interrupt"):r("composer.send")),rt=j(()=>!!s.uploadImage),Ge=te(!1),ut=te(!1),xt=te(null);function Ht(){Ge.value=!Ge.value,Ge.value?(ut.value=!1,document.addEventListener("click",Ke,!0)):document.removeEventListener("click",Ke,!0)}function Pt(){Ge.value=!1,ut.value||document.removeEventListener("click",Ke,!0)}function Vn(){ut.value=!ut.value,ut.value?(Ge.value=!1,document.addEventListener("click",Ke,!0)):document.removeEventListener("click",Ke,!0)}function _s(){ut.value=!1,Ge.value||document.removeEventListener("click",Ke,!0)}function Ke(we){xt.value&&!xt.value.contains(we.target)&&(Pt(),_s())}qt(()=>{document.removeEventListener("click",Ke,!0)});const zt=we=>`${Math.round(we/1e3)}k`,Kn=j(()=>{const we=s.status?.ctxMax??0;return we<=0?0:Math.min(100,Math.max(0,Math.round((s.status?.ctxUsed??0)/we*100)))}),Ps=j(()=>{const we=(s.status?.ctxUsed??0).toLocaleString(),Ae=(s.status?.ctxMax??0).toLocaleString();return r("status.ctxTooltip",{used:we,max:Ae,pct:Kn.value})}),Gn=j(()=>Kn.value>=80),Do=j(()=>{const we=s.status?.modelId??s.status?.model??"";return s.models?.find(Ae=>Ae.id===we||Ae.model===we||Ae.displayName===s.status?.model)}),Ds=j(()=>RT(Do.value)),Bs=j(()=>Ds.value==="toggle"),Fs=j(()=>Ds.value==="always-on"?!0:Ds.value==="unsupported"?!1:(s.thinking??"off")!=="off");function Ni(){Bs.value&&i("setThinking",Fs.value?"off":"high")}const ls=j(()=>s.planMode===!0),$n=j(()=>s.swarmMode===!0),sn=j(()=>s.activationBadges?.goal!==null),Hs=j(()=>sn.value||s.goalMode===!0),_t=te(!1),Pn=te(null),Yt=te(null),so=te({}),oo=j(()=>ls.value||$n.value||Hs.value);function Ws(){_t.value=!1,document.removeEventListener("mousedown",Dn)}function Dn(we){const Ae=we.target;Pn.value?.contains(Ae)||Yt.value?.contains(Ae)||Ws()}function ws(){if(_t.value){Ws();return}const we=Pn.value?.getBoundingClientRect();we&&(so.value={left:`${Math.round(we.left)}px`,bottom:`${Math.round(window.innerHeight-we.top+8)}px`}),_t.value=!0,setTimeout(()=>document.addEventListener("mousedown",Dn),0)}const as=[{mode:"manual",color:"var(--dim)",labelKey:"status.permissionManual",descKey:"status.permissionManualDesc"},{mode:"yolo",color:"var(--warn)",labelKey:"status.permissionYolo",descKey:"status.permissionYoloDesc"},{mode:"auto",color:"var(--err)",labelKey:"status.permissionAuto",descKey:"status.permissionAutoDesc"}];function vt(we){i("setPermission",we),_s()}const Ss=j(()=>as.find(we=>we.mode===s.status?.permission)),Bn=j(()=>Ss.value?r(Ss.value.labelKey):""),Yn=j(()=>Do.value?.provider??""),cn=j(()=>!Yn.value||!s.models?.length?[]:s.models.filter(we=>we.provider===Yn.value)),hn=j(()=>new Set(s.starredIds??[]));function Me(we){return hn.value.has(we)}const ge=j(()=>s.models?.length?s.models.filter(we=>Me(we.id)&&we.provider!==Yn.value):[]);function Oe(we){i("selectModel",we),Pt()}return(we,Ae)=>(C(),A("div",{class:Ee(["composer",{"drag-over":Ne.value}]),onDragover:Z,onDragleave:ne,onDrop:se},[oe.value.length>0?(C(),A("div",Hq,[(C(!0),A(Ie,null,Xe(oe.value,He=>(C(),A("div",{key:He.localId,class:Ee(["att-chip",{"att-error":He.error}])},[h("button",{type:"button",class:"att-preview",title:M(r)("composer.previewAttachment",{name:He.name}),onClick:tt=>ue(He)},[He.kind==="video"?(C(),A("video",{key:0,class:"att-thumb",src:He.previewUrl,muted:"",playsinline:"",preload:"metadata"},null,8,Uq)):(C(),A("img",{key:1,class:"att-thumb",src:He.previewUrl,alt:He.name},null,8,qq)),He.kind==="video"?(C(),A("span",jq,[...Ae[14]||(Ae[14]=[h("svg",{viewBox:"0 0 16 16",width:"9",height:"9",fill:"currentColor"},[h("path",{d:"M5 3.5v9l7-4.5z"})],-1)])])):re("",!0)],8,Wq),h("span",zq,N(He.name),1),He.uploading?(C(),A("span",{key:0,class:"att-spinner","aria-label":M(r)("composer.uploading")},[...Ae[15]||(Ae[15]=[h("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("circle",{cx:"8",cy:"8",r:"6","stroke-opacity":"0.25"}),h("path",{d:"M8 2 A6 6 0 0 1 14 8","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"0.8s",repeatCount:"indefinite"})])],-1)])],8,Vq)):He.error?(C(),A("span",{key:1,class:"att-err-icon",title:M(r)("composer.uploadFailed")},[...Ae[16]||(Ae[16]=[h("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("circle",{cx:"6",cy:"6",r:"5"}),h("line",{x1:"6",y1:"3.5",x2:"6",y2:"6.5"}),h("circle",{cx:"6",cy:"8.5",r:"0.5",fill:"currentColor"})],-1)])],8,Kq)):re("",!0),h("button",{class:"att-rm",title:M(r)("composer.removeNamed",{name:He.name}),onClick:tt=>_e(He.localId)},[...Ae[17]||(Ae[17]=[h("svg",{viewBox:"0 0 12 12",width:"9",height:"9",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,Gq)],2))),128))])):re("",!0),J.value?(C(),A("div",{key:1,class:"att-lightbox",onClick:Ye(z,["self"])},[h("div",Yq,[h("button",{type:"button",class:"att-lightbox-close",title:M(r)("model.close"),onClick:z},"✕",8,Xq),J.value.kind==="video"?(C(),A("video",{key:0,class:"att-lightbox-media",src:J.value.previewUrl,controls:"",playsinline:""},null,8,Zq)):(C(),A("img",{key:1,class:"att-lightbox-media",src:J.value.previewUrl,alt:J.value.name},null,8,Qq)),h("div",Jq,N(J.value.name),1)])])):re("",!0),h("div",ej,[h("div",tj,[k.value?(C(),je(Cq,{key:0,items:$.value,"active-index":E.value,onSelect:T,onHover:Ae[0]||(Ae[0]=He=>E.value=He)},null,8,["items","active-index"])):re("",!0),I.value?(C(),je(Dq,{key:1,items:L.value,"active-index":R.value,loading:O.value,onSelect:K,onHover:Ae[1]||(Ae[1]=He=>R.value=He)},null,8,["items","active-index","loading"])):re("",!0),h("div",nj,[Et(h("textarea",{ref_key:"textareaRef",ref:d,"onUpdate:modelValue":Ae[2]||(Ae[2]=He=>u.value=He),class:"ph",placeholder:o.value,rows:"1",onKeydown:ze,onCompositionstart:xe,onCompositionend:ie,onInput:G},null,40,sj),[[yn,u.value]]),h("button",{class:Ee(["send",{aborting:e.running}]),"aria-label":Je.value,title:e.running?M(r)("composer.interruptTitle"):Je.value,onClick:Ae[3]||(Ae[3]=He=>e.running?i("interrupt"):H())},[(C(),A("svg",{class:Ee(["send-icon",{hidden:e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...Ae[18]||(Ae[18]=[h("path",{d:"M8 3l6 5.5M8 3L2 8.5M8 3v10"},null,-1)])],2)),(C(),A("svg",{class:Ee(["send-icon",{hidden:!e.running}]),viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[...Ae[19]||(Ae[19]=[h("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1.5"},null,-1)])],2))],10,oj)])]),rt.value?(C(),A("input",{key:0,ref_key:"fileInputRef",ref:he,type:"file",accept:"image/*,video/*",multiple:"",class:"file-input-hidden",onChange:fe},null,544)):re("",!0),h("div",{ref_key:"toolbarRef",ref:xt,class:"toolbar"},[h("div",ij,[rt.value?(C(),A("button",{key:0,class:"attach-btn",title:M(r)("composer.attachImage"),type:"button",onClick:X},[...Ae[20]||(Ae[20]=[h("svg",{class:"attach-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round",xmlns:"http://www.w3.org/2000/svg"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,rj)):re("",!0),e.status?(C(),A("span",{key:1,class:Ee(["perm-pill",["perm-"+e.status.permission,{open:ut.value}]]),role:"button",tabindex:"0",title:M(r)("status.permissionTooltip"),onClick:Ye(Vn,["stop"]),onKeydown:[_o(Vn,["enter"]),_o(Ye(Vn,["prevent"]),["space"])]},N(Bn.value),43,lj)):re("",!0),ut.value&&e.status?(C(),A("div",{key:2,class:"perm-dropdown",role:"menu",onClick:Ae[4]||(Ae[4]=Ye(()=>{},["stop"]))},[(C(),A(Ie,null,Xe(as,He=>h("button",{key:He.mode,class:Ee(["pd-row",{"is-current":He.mode===e.status.permission}]),role:"menuitem",onClick:tt=>vt(He.mode)},[h("span",cj,[He.mode===e.status.permission?(C(),A("svg",uj,[...Ae[21]||(Ae[21]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",dj,[h("span",{class:"pd-name",style:$t({color:He.color})},N(M(r)(He.labelKey)),5),h("span",fj,N(M(r)(He.descKey)),1)])],10,aj)),64))])):re("",!0),e.status?(C(),A("div",{key:3,ref_key:"modesRef",ref:Pn,class:"modes"},[h("button",{type:"button",class:Ee(["mode-pill",{on:oo.value}]),title:M(r)("status.modesTooltip"),onClick:Ye(ws,["stop"])},[h("span",pj,N(M(r)("status.modesLabel")),1),ls.value?(C(),A("span",mj,N(M(r)("status.planLabel")),1)):re("",!0),$n.value?(C(),A("span",gj,N(M(r)("status.swarmLabel")),1)):re("",!0),Hs.value?(C(),A("span",vj,N(M(r)("status.goalLabel")),1)):re("",!0)],10,hj),_t.value?(C(),A("div",{key:0,ref_key:"modesMenuRef",ref:Yt,class:"modes-menu",style:$t(so.value)},[h("button",{type:"button",class:Ee(["mode-row",{on:ls.value}]),onClick:Ae[5]||(Ae[5]=He=>i("togglePlan"))},[h("span",yj,N(M(r)("status.planLabel")),1),h("span",{class:Ee(["mode-switch",{on:ls.value}])},[...Ae[22]||(Ae[22]=[h("span",{class:"mode-knob"},null,-1)])],2)],2),h("button",{type:"button",class:Ee(["mode-row",{on:$n.value}]),onClick:Ae[6]||(Ae[6]=He=>i("toggleSwarm"))},[h("span",kj,N(M(r)("status.swarmLabel")),1),h("span",{class:Ee(["mode-switch",{on:$n.value}])},[...Ae[23]||(Ae[23]=[h("span",{class:"mode-knob"},null,-1)])],2)],2),h("div",{class:Ee(["mode-row mode-row-goal",{on:sn.value||s.goalMode}])},[h("button",{type:"button",class:"mode-row-main",onClick:Ae[7]||(Ae[7]=He=>sn.value?i("controlGoal","cancel"):i("toggleGoal"))},[h("span",bj,N(M(r)("status.goalLabel")),1),sn.value?re("",!0):(C(),A("span",{key:0,class:Ee(["mode-switch",{on:s.goalMode}])},[...Ae[24]||(Ae[24]=[h("span",{class:"mode-knob"},null,-1)])],2))]),sn.value?(C(),A("div",_j,[h("button",{type:"button",class:"mode-row-action",onClick:Ae[8]||(Ae[8]=He=>i("controlGoal","pause"))},N(M(r)("status.goalPause")),1),h("button",{type:"button",class:"mode-row-action",onClick:Ae[9]||(Ae[9]=He=>i("controlGoal","resume"))},N(M(r)("status.goalResume")),1)])):re("",!0)],2)],4)):re("",!0)],512)):re("",!0)]),h("div",wj,[Gn.value?(C(),A("button",{key:0,class:"compact-chip",onClick:Ae[10]||(Ae[10]=Ye(He=>i("compact"),["stop"]))},"/compact")):re("",!0),e.status&&!e.hideContext?(C(),A("span",{key:1,class:"ctx-group",title:Ps.value},[(C(),A("svg",Cj,[Ae[25]||(Ae[25]=h("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5"},null,-1)),h("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:"7",fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${2*Math.PI*7}`,"stroke-dashoffset":`${2*Math.PI*7*(1-Kn.value/100)}`},null,8,xj)])),h("span",Tj,N(zt(e.status.ctxUsed))+"/"+N(zt(e.status.ctxMax)),1)],8,Sj)):re("",!0),e.status?(C(),A("span",{key:2,class:Ee(["model-pill",{open:Ge.value}]),role:"button",tabindex:"0",title:M(r)("status.modelTooltip"),onClick:Ye(Ht,["stop"]),onKeydown:[_o(Ht,["enter"]),_o(Ye(Ht,["prevent"]),["space"])]},[h("b",null,N(e.status.model),1),Fs.value?(C(),A("span",Aj,N(M(r)("composer.thinkingSuffix")),1)):re("",!0),Ae[26]||(Ae[26]=h("svg",{class:"cv",viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 6l4 4 4-4"})],-1))],42,Mj)):re("",!0)]),Ge.value&&e.status?(C(),A("div",{key:0,class:"model-dropdown",role:"menu",onClick:Ae[13]||(Ae[13]=Ye(()=>{},["stop"]))},[ge.value.length>0?(C(),A("div",Ej,N(M(r)("status.starredModels")),1)):re("",!0),(C(!0),A(Ie,null,Xe(ge.value,He=>(C(),A("button",{key:He.id,class:Ee(["md-row",{"is-current":He.id===e.status.modelId}]),role:"menuitem",onClick:tt=>Oe(He.id)},[h("span",$j,[He.id===e.status.model||He.model===e.status.model||He.displayName===e.status.model?(C(),A("svg",Nj,[...Ae[27]||(Ae[27]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",Lj,N(He.displayName??He.model),1),h("span",Oj,N(He.provider),1),Ae[28]||(Ae[28]=h("svg",{class:"md-star",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true"},[h("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"})],-1))],10,Ij))),128)),ge.value.length>0?(C(),A("div",Rj)):re("",!0),cn.value.length>0?(C(),A("div",Pj,N(Yn.value),1)):re("",!0),(C(!0),A(Ie,null,Xe(cn.value,He=>(C(),A("button",{key:He.id,class:Ee(["md-row",{"is-current":He.id===e.status.modelId}]),role:"menuitem",onClick:tt=>Oe(He.id)},[h("span",Bj,[He.id===e.status.model||He.model===e.status.model||He.displayName===e.status.model?(C(),A("svg",Fj,[...Ae[29]||(Ae[29]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",Hj,N(He.displayName??He.model),1),Me(He.id)?(C(),A("svg",Wj,[...Ae[30]||(Ae[30]=[h("path",{fill:"currentColor",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):re("",!0)],10,Dj))),128)),cn.value.length>0?(C(),A("div",Uj)):re("",!0),h("button",{class:Ee(["md-row md-row-toggle",{"is-on":Fs.value,"is-disabled":!Bs.value}]),role:"menuitem",disabled:!Bs.value,onClick:Ae[11]||(Ae[11]=He=>Ni())},[h("span",jj,[Fs.value?(C(),A("svg",zj,[...Ae[31]||(Ae[31]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",Vj,N(M(r)("status.thinkingLabel")),1),Ds.value==="always-on"?(C(),A("span",Kj,N(M(r)("status.planOn")),1)):Ds.value==="unsupported"?(C(),A("span",Gj,N(M(r)("status.modeNotSupported")),1)):re("",!0)],10,qj),Ae[32]||(Ae[32]=h("div",{class:"md-divider"},null,-1)),h("button",{class:"md-row md-row-more",role:"menuitem",onClick:Ae[12]||(Ae[12]=He=>{Pt(),i("pickModel")})},[h("span",Yj,N(M(r)("status.moreModels")),1)])])):re("",!0)],512)])],34))}}),DT=yt(Zj,[["__scopeId","data-v-b19132ed"]]),Qj=["id"],Jj={class:"swarm-head"},ez={class:"swarm-count"},tz={class:"swarm-grid"},nz={class:"member-top"},sz={class:"member-name"},oz={class:"member-phase"},iz={class:"member-mid"},rz={class:"member-bar"},lz={key:0,class:"member-type"},az={key:0,class:"member-bottom"},cz=Ze({__name:"SwarmCard",props:{group:{}},setup(e){const t=e,n=j(()=>t.group.members.length),s=j(()=>t.group.counts.completed+t.group.counts.failed);function o(l){switch(l){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}function i(l){switch(l.phase){case"queued":return"......";case"working":return":::...";case"suspended":return"::....";case"completed":return"::::::";case"failed":return"!!...."}}function r(l){return l.outputLines?.map(a=>a.trimEnd()).filter(Boolean).at(-1)}return(l,a)=>(C(),A("section",{class:"swarm-card",id:`swarm-${e.group.id}`},[h("header",Jj,[a[0]||(a[0]=h("div",{class:"swarm-title"},[h("span",{class:"swarm-mark","aria-hidden":"true"}),h("span",null,"Swarm")],-1)),h("div",ez,N(s.value)+"/"+N(n.value),1)]),h("div",tz,[(C(!0),A(Ie,null,Xe(e.group.members,c=>(C(),A("article",{key:c.id,class:Ee(["swarm-member",`phase-${c.phase}`])},[h("div",nz,[h("span",sz,N(c.name),1),h("span",oz,N(o(c.phase)),1)]),h("div",iz,[h("span",rz,N(i(c)),1),c.subagentType?(C(),A("span",lz,N(c.subagentType),1)):re("",!0)]),c.suspendedReason||r(c)||c.summary?(C(),A("div",az,N(c.suspendedReason||r(c)||c.summary),1)):re("",!0)],2))),128))])],8,Qj))}}),uz=yt(cz,[["__scopeId","data-v-b4e1bc20"]]),dz={class:"goal-progress","aria-hidden":"true"},fz={key:0,class:"goal-body"},hz={class:"goal-full"},pz={key:0,class:"goal-criterion"},mz={class:"goal-stats"},gz={key:0},vz={class:"goal-actions"},yz=Ze({__name:"GoalStrip",props:{goal:{},forceExpanded:{}},emits:["controlGoal"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),i=te(!1);Ve(()=>n.forceExpanded,()=>{n.forceExpanded!==void 0&&(i.value=!0)});const r=j(()=>{const a=n.goal.budget.tokenBudget;return!a||a<=0?0:Math.max(0,Math.min(100,Math.round(n.goal.tokensUsed/a*100)))});function l(a){const c=Math.max(0,Math.round(a/1e3)),u=Math.floor(c/60),d=c%60;return u<=0?`${d}s`:u<60?`${u}m ${d}s`:`${Math.floor(u/60)}h ${u%60}m`}return(a,c)=>(C(),A("section",{class:Ee(["goal-strip",{expanded:i.value}])},[h("button",{class:"goal-row",type:"button",onClick:c[0]||(c[0]=u=>i.value=!i.value)},[c[5]||(c[5]=h("span",{class:"goal-kicker"},"Goal",-1)),h("span",{class:Ee(["goal-objective",{"expanded-hidden":i.value}])},N(e.goal.objective),3),h("span",{class:Ee(["goal-status",`status-${e.goal.status}`])},N(e.goal.status),3),h("span",dz,[h("span",{class:"goal-progress-fill",style:$t({width:`${r.value}%`})},null,4)]),(C(),A("svg",{class:Ee(["goal-chevron",{open:i.value}]),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...c[4]||(c[4]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2))]),i.value?(C(),A("div",fz,[h("div",hz,N(e.goal.objective),1),e.goal.completionCriterion?(C(),A("div",pz,[c[6]||(c[6]=h("span",null,"Done when",-1)),h("p",null,N(e.goal.completionCriterion),1)])):re("",!0),h("div",mz,[h("span",null,N(e.goal.turnsUsed)+" turns",1),h("span",null,N(e.goal.tokensUsed.toLocaleString())+" tokens",1),h("span",null,N(l(e.goal.wallClockMs)),1),e.goal.budget.tokenBudget!==null?(C(),A("span",gz,N(r.value)+"% token budget",1)):re("",!0)]),h("div",vz,[e.goal.status!=="paused"?(C(),A("button",{key:0,type:"button",class:"goal-action",onClick:c[1]||(c[1]=Ye(u=>s("controlGoal","pause"),["stop"]))},N(M(o)("status.goalPause")),1)):re("",!0),e.goal.status==="paused"?(C(),A("button",{key:1,type:"button",class:"goal-action primary",onClick:c[2]||(c[2]=Ye(u=>s("controlGoal","resume"),["stop"]))},N(M(o)("status.goalResume")),1)):re("",!0),h("button",{type:"button",class:"goal-action danger",onClick:c[3]||(c[3]=Ye(u=>s("controlGoal","cancel"),["stop"]))},N(M(o)("status.goalCancel")),1)])])):re("",!0)],2))}}),kz=yt(yz,[["__scopeId","data-v-6531319c"]]),bz={class:"qh"},_z={class:"qtitle"},wz={class:"qstep"},Sz=["disabled"],Cz=["disabled"],xz={key:1,class:"qmin-peek"},Tz=["title","aria-label"],Mz={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},Az={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},Ez={key:0,class:"qbody"},Iz={key:0,class:"qheader-chip"},$z={class:"qtext"},Nz={class:"qopts"},Lz=["onClick"],Oz={class:"qopt-key"},Rz={class:"qopt-glyph"},Pz={key:0,class:"chk"},Dz={key:1,class:"rad"},Bz={class:"qopt-text"},Fz={class:"qopt-label"},Hz={key:0,class:"qopt-desc"},Wz={class:"qopt-glyph"},Uz={key:0,class:"chk"},qz={key:1,class:"rad"},jz={class:"qopt-label"},zz=["placeholder"],Vz={key:1,class:"qfooter"},Kz=["disabled"],Gz=Ze({__name:"QuestionCard",props:{question:{}},emits:["answer","dismiss"],setup(e,{emit:t}){const n=e,{t:s}=wt(),o=t,i=te(0),r=te(!1),l=j(()=>n.question.questions[i.value]),a=j(()=>n.question.questions.length);function c(){i.value>0&&i.value--}function u(){i.value<a.value-1&&i.value++}const d=te({});function p(S){return S.recommended===!0?!0:/\b(?:recommended|recommend)\b|推荐/.test(`${S.label} ${S.description??""}`.toLowerCase())}function m(){const S={...d.value};let T=!1;for(const I of n.question.questions){if(S[I.id])continue;const L=I.options.filter(p);L.length!==0&&(S[I.id]=I.multiSelect?{kind:"multi",optionIds:L.map(R=>R.id)}:{kind:"single",optionId:L[0].id},T=!0)}T&&(d.value=S)}Ve(()=>n.question.questionId,()=>{i.value=0,r.value=!1,d.value={},w.value={}}),Ve(()=>n.question,()=>{i.value>=n.question.questions.length&&(i.value=0),m()},{immediate:!0,deep:!0});function f(S,T){const I=d.value[S];if(I&&I.kind==="single"&&I.optionId===T){const L={...d.value};delete L[S],d.value=L}else d.value={...d.value,[S]:{kind:"single",optionId:T}}}function v(S,T){const I=d.value[S],L=I&&(I.kind==="multi"||I.kind==="multiWithOther")?I.kind==="multi"?[...I.optionIds]:[...I.optionIds]:[],R=L.indexOf(T);R>=0?L.splice(R,1):L.push(T);const O=d.value[S],F=O&&O.kind==="multiWithOther"?O.otherText:"";F?d.value={...d.value,[S]:{kind:"multiWithOther",optionIds:L,otherText:F}}:d.value={...d.value,[S]:{kind:"multi",optionIds:L}}}const w=te({});function _(S){const T=n.question.questions.find(L=>L.id===S),I=w.value[S]??"";if(T.multiSelect){const L=d.value[S],R=L&&(L.kind==="multi"||L.kind==="multiWithOther")?L.kind==="multi"?[...L.optionIds]:[...L.optionIds]:[];d.value={...d.value,[S]:{kind:"multiWithOther",optionIds:R,otherText:I}}}else d.value={...d.value,[S]:{kind:"other",text:I}}}function b(S,T){const I=d.value[S];return I?I.kind==="single"?I.optionId===T:I.kind==="multi"||I.kind==="multiWithOther"?I.optionIds.includes(T):!1:!1}function g(S){const T=d.value[S];return!!(T&&(T.kind==="other"||T.kind==="multiWithOther"))}function y(){return n.question.questions.every(S=>{const T=d.value[S.id];return T?T.kind==="multi"?T.optionIds.length>0:T.kind==="multiWithOther"?T.optionIds.length>0||T.otherText.trim().length>0:T.kind==="other"?T.text.trim().length>0:!0:!1})}function k(){if(!y())return;const S={answers:d.value,method:"click"};o("answer",n.question.questionId,S)}function $(){o("dismiss",n.question.questionId)}function E(S){const T=(document.activeElement?.tagName??"").toLowerCase();if(T==="input"||T==="textarea"||r.value&&S.key!=="Escape")return;if(S.key==="Escape"){S.preventDefault(),$();return}if(S.key==="Enter"){S.preventDefault(),k();return}const I=parseInt(S.key,10);if(!isNaN(I)&&I>=1&&I<=9){S.preventDefault();const L=l.value,R=I-1,O=L.options[R];O&&(L.multiSelect?v(L.id,O.id):f(L.id,O.id))}}return Jt(()=>document.addEventListener("keydown",E)),qt(()=>document.removeEventListener("keydown",E)),(S,T)=>(C(),A("div",{class:Ee(["qcard",{minimized:r.value}])},[h("div",bz,[h("span",_z,N(M(s)("question.title")),1),a.value>1&&!r.value?(C(),A(Ie,{key:0},[h("span",wz,N(M(s)("question.step",{current:i.value+1,total:a.value})),1),h("button",{class:"qnav",disabled:i.value===0,onClick:c},N(M(s)("question.prev")),9,Sz),h("button",{class:"qnav",disabled:i.value===a.value-1,onClick:u},N(M(s)("question.next")),9,Cz)],64)):re("",!0),r.value?(C(),A("span",xz,N(l.value.question),1)):re("",!0),h("button",{class:"qmin",title:r.value?M(s)("question.expand"):M(s)("question.minimize"),"aria-label":r.value?M(s)("question.expand"):M(s)("question.minimize"),onClick:T[0]||(T[0]=I=>r.value=!r.value)},[r.value?(C(),A("svg",Mz,[...T[4]||(T[4]=[h("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),A("svg",Az,[...T[5]||(T[5]=[h("path",{d:"M3 8h10"},null,-1)])]))],8,Tz)]),r.value?re("",!0):(C(),A("div",Ez,[l.value.header?(C(),A("div",Iz,N(l.value.header),1)):re("",!0),h("div",$z,N(l.value.question),1),l.value.body?(C(),je(Lf,{key:1,text:l.value.body,class:"qmdbody"},null,8,["text"])):re("",!0),h("div",Nz,[(C(!0),A(Ie,null,Xe(l.value.options,(I,L)=>(C(),A("label",{key:I.id,class:Ee(["qopt",{selected:b(l.value.id,I.id)}]),onClick:Ye(R=>l.value.multiSelect?v(l.value.id,I.id):f(l.value.id,I.id),["prevent"])},[h("span",Oz,N(L+1),1),h("span",Rz,[l.value.multiSelect?(C(),A("span",Pz,N(b(l.value.id,I.id)?"■":"□"),1)):(C(),A("span",Dz,N(b(l.value.id,I.id)?"●":"○"),1))]),h("span",Bz,[h("span",Fz,N(I.label),1),I.description?(C(),A("span",Hz,N(I.description),1)):re("",!0)])],10,Lz))),128)),l.value.allowOther?(C(),A("label",{key:0,class:Ee(["qopt",{selected:g(l.value.id)}]),onClick:Ye(()=>{},["prevent"])},[T[6]||(T[6]=h("span",{class:"qopt-key"},null,-1)),h("span",Wz,[l.value.multiSelect?(C(),A("span",Uz,N(g(l.value.id)?"■":"□"),1)):(C(),A("span",qz,N(g(l.value.id)?"●":"○"),1))]),h("span",jz,N(l.value.otherLabel??M(s)("question.otherDefault")),1),Et(h("input",{"onUpdate:modelValue":T[1]||(T[1]=I=>w.value[l.value.id]=I),class:"other-input",type:"text",placeholder:l.value.otherLabel??M(s)("question.otherDefault"),onInput:T[2]||(T[2]=I=>_(l.value.id)),onFocus:T[3]||(T[3]=I=>_(l.value.id))},null,40,zz),[[yn,w.value[l.value.id]]])],2)):re("",!0)])])),r.value?re("",!0):(C(),A("div",Vz,[h("button",{class:"qbtn pri",disabled:!y(),onClick:k},N(M(s)("question.submit")),9,Kz),h("button",{class:"qbtn",onClick:$},N(M(s)("question.dismiss")),1)]))],2))}}),Yz=yt(Gz,[["__scopeId","data-v-f242cefc"]]),Xz={class:"ah"},Zz={class:"akind"},Qz={class:"apath"},Jz={key:0,class:"abadge"},eV={key:1,class:"aw"},tV=["title","aria-label"],nV={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},sV={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","aria-hidden":"true"},oV={key:0,class:"diff"},iV={class:"dg"},rV={class:"dc"},lV={key:1,class:"body-shell"},aV={class:"shell-cmd"},cV={key:0,class:"shell-cwd"},uV={key:1,class:"shell-danger"},dV={key:2,class:"body-file"},fV={class:"file-bar"},hV={class:"file-lang"},pV={class:"file-content"},mV={class:"file-ln"},gV={class:"file-text"},vV={key:3,class:"body-chip"},yV={class:"chip-label"},kV={class:"chip-value"},bV={key:0,class:"chip-detail"},_V={key:4,class:"body-chip"},wV={key:0,class:"chip-label"},SV={class:"chip-value"},CV={key:5,class:"body-chip"},xV={class:"chip-label"},TV={class:"chip-value"},MV={key:0,class:"chip-detail"},AV={key:6,class:"body-chip"},EV={class:"chip-label"},IV={class:"chip-value"},$V={key:0,class:"chip-detail"},NV={key:7,class:"body-todo"},LV={class:"todo-glyph"},OV={key:8,class:"body-generic"},RV={class:"gen-text"},PV={key:9,class:"feedback-wrap"},DV=["placeholder"],BV={class:"feedback-hint"},FV={class:"abtn"},HV=Ze({__name:"ApprovalCard",props:{block:{},agentName:{}},emits:["decide"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),i=te(!1),r=["shell","diff","file","fileop","url","search","invocation","todo","generic"];function l(){const g=r.includes(n.block.kind)?n.block.kind:"generic";return o(`approval.title.${g}`)}const a=te(!1),c=te(""),u=te(null);function d(){a.value=!0,c.value="",setTimeout(()=>u.value?.focus(),0)}function p(){const g=c.value.trim();s("decide",{decision:"rejected",feedback:g||void 0}),a.value=!1,c.value=""}function m(){a.value=!1,c.value=""}function f(g){g.key==="Enter"&&!g.shiftKey?(g.preventDefault(),p()):g.key==="Escape"&&(g.preventDefault(),m())}function v(){s("decide",{decision:"approved"})}function w(){s("decide",{decision:"approved",scope:"session"})}function _(){s("decide",{decision:"rejected"})}function b(g){const y=(document.activeElement?.tagName??"").toLowerCase();y==="input"||y==="textarea"||i.value||(g.key==="1"?(g.preventDefault(),v()):g.key==="2"?(g.preventDefault(),w()):g.key==="3"?(g.preventDefault(),_()):g.key==="4"&&(g.preventDefault(),d()))}return Jt(()=>document.addEventListener("keydown",b)),qt(()=>document.removeEventListener("keydown",b)),(g,y)=>(C(),A("div",{class:Ee(["appr",{minimized:i.value}])},[h("div",Xz,[h("span",Zz,N(l()),1),h("span",Qz,[e.block.kind==="diff"||e.block.kind==="file"||e.block.kind==="fileop"?(C(),A(Ie,{key:0},[ht(N(e.block.path),1)],64)):e.block.kind==="shell"?(C(),A(Ie,{key:1},[ht(N(e.block.command),1)],64)):e.block.kind==="url"?(C(),A(Ie,{key:2},[ht(N(e.block.url),1)],64)):e.block.kind==="search"?(C(),A(Ie,{key:3},[ht(N(e.block.query),1)],64)):e.block.kind==="invocation"?(C(),A(Ie,{key:4},[ht(N(e.block.name),1)],64)):e.block.kind==="generic"?(C(),A(Ie,{key:5},[ht(N(e.block.summary),1)],64)):re("",!0)]),e.agentName&&!i.value?(C(),A("span",Jz,N(M(o)("approval.subagentBadge",{name:e.agentName})),1)):re("",!0),i.value?re("",!0):(C(),A("span",eV,N(M(o)("approval.required")),1)),h("button",{class:"amin",title:i.value?M(o)("question.expand"):M(o)("question.minimize"),"aria-label":i.value?M(o)("question.expand"):M(o)("question.minimize"),onClick:y[0]||(y[0]=k=>i.value=!i.value)},[i.value?(C(),A("svg",nV,[...y[2]||(y[2]=[h("path",{d:"M3 6l5 5 5-5"},null,-1)])])):(C(),A("svg",sV,[...y[3]||(y[3]=[h("path",{d:"M3 8h10"},null,-1)])]))],8,tV)]),i.value?re("",!0):(C(),A(Ie,{key:0},[e.block.kind==="diff"?(C(),A("div",oV,[(C(!0),A(Ie,null,Xe(e.block.diff,(k,$)=>(C(),A("div",{key:$,class:Ee(["dl",k.kind==="add"?"add":k.kind==="rem"?"del":""])},[h("span",iV,N(k.gutter),1),h("span",rV,N(k.text),1)],2))),128))])):e.block.kind==="shell"?(C(),A("div",lV,[h("div",aV,[y[4]||(y[4]=h("span",{class:"shell-dollar"},"$",-1)),ht(" "+N(e.block.command),1)]),e.block.cwd?(C(),A("div",cV,"cwd: "+N(e.block.cwd),1)):re("",!0),e.block.danger?(C(),A("div",uV,N(M(o)("approval.danger",{detail:e.block.danger})),1)):re("",!0)])):e.block.kind==="file"?(C(),A("div",dV,[h("div",fV,[h("span",hV,N(e.block.language??""),1)]),h("div",pV,[(C(!0),A(Ie,null,Xe(e.block.content.split(`
243
+ `),(k,$)=>(C(),A("div",{key:$,class:"file-line"},[h("span",mV,N($+1),1),h("span",gV,N(k),1)]))),128))])])):e.block.kind==="fileop"?(C(),A("div",vV,[h("span",yV,N(e.block.op),1),h("span",kV,N(e.block.path),1),e.block.detail?(C(),A("span",bV,N(e.block.detail),1)):re("",!0)])):e.block.kind==="url"?(C(),A("div",_V,[e.block.method?(C(),A("span",wV,N(e.block.method),1)):re("",!0),h("span",SV,N(e.block.url),1)])):e.block.kind==="search"?(C(),A("div",CV,[h("span",xV,N(M(o)("approval.searchQueryLabel")),1),h("span",TV,N(e.block.query),1),e.block.scope?(C(),A("span",MV,N(M(o)("approval.searchScope",{scope:e.block.scope})),1)):re("",!0)])):e.block.kind==="invocation"?(C(),A("div",AV,[h("span",EV,N(e.block.kind2),1),h("span",IV,N(e.block.name),1),e.block.description?(C(),A("span",$V,N(e.block.description),1)):re("",!0)])):e.block.kind==="todo"?(C(),A("div",NV,[(C(!0),A(Ie,null,Xe(e.block.items,(k,$)=>(C(),A("div",{key:$,class:"todo-item"},[h("span",LV,N(k.status==="done"||k.status==="completed"?"✓":"○"),1),h("span",{class:Ee(["todo-title",{"todo-done":k.status==="done"||k.status==="completed"}])},N(k.title),3)]))),128))])):(C(),A("div",OV,[h("span",RV,N(e.block.summary),1)])),a.value?(C(),A("div",PV,[Et(h("textarea",{ref_key:"feedbackRef",ref:u,"onUpdate:modelValue":y[1]||(y[1]=k=>c.value=k),class:"feedback-ta",placeholder:M(o)("approval.feedbackPlaceholder"),rows:"2",onKeydown:f},null,40,DV),[[yn,c.value]]),h("div",BV,N(M(o)("approval.feedbackHint")),1)])):re("",!0),h("div",FV,[h("div",{class:"kbtn pri",onClick:v},[ht(N(M(o)("approval.approve")),1),y[5]||(y[5]=h("span",{class:"k"},"[1]",-1))]),h("div",{class:"kbtn",onClick:w},[ht(N(M(o)("approval.approveSession")),1),y[6]||(y[6]=h("span",{class:"k"},"[2]",-1))]),h("div",{class:"kbtn",onClick:_},[ht(N(M(o)("approval.reject")),1),y[7]||(y[7]=h("span",{class:"k"},"[3]",-1))]),h("div",{class:"kbtn",onClick:d},[ht(N(M(o)("approval.feedback")),1),y[8]||(y[8]=h("span",{class:"k"},"[4]",-1))])])],64))],2))}}),WV=yt(HV,[["__scopeId","data-v-b04bf99b"]]),UV={class:"taskspane"},qV={class:"tp-head"},jV={class:"tp-title"},zV={class:"tp-count"},VV={class:"tp-list"},KV={key:0,class:"tp-empty"},GV=["role","onClick"],YV={class:"tp-name"},XV={class:"tp-kind"},ZV={class:"tp-time"},QV=["onClick"],JV={key:0,class:"tp-detail"},eK={key:0,class:"tp-codebox"},tK=["onClick"],nK={class:"tp-pre"},sK={class:"tp-cmd"},oK={key:1,class:"tp-codebox"},iK=["onClick"],rK={class:"tp-pre"},lK=Ze({__name:"TasksPane",props:{tasks:{}},emits:["cancel"],setup(e,{emit:t}){const n=t,{t:s}=wt(),o=Vs(new Set),i=Vs(new Set),r=Vs(new Set);function l(f){return!!(f.output&&f.output.length>0||f.meta)}function a(f){l(f)&&(o.has(f.id)?o.delete(f.id):o.add(f.id))}function c(f){switch(f){case"run":return"●";case"done":return"✓";case"fail":return"✗";default:return"○"}}function u(f){switch(f){case"run":return"s-run";case"done":return"s-done";case"fail":return"s-fail";default:return"s-pending"}}async function d(f,v,w){try{await navigator.clipboard.writeText(f),w.add(v),setTimeout(()=>w.delete(v),1500)}catch{}}async function p(f){f.meta&&await d(f.meta,f.id,i)}async function m(f){const v=f.output?.join(`
244
+ `)??"";v&&await d(v,f.id,r)}return(f,v)=>(C(),A("div",UV,[h("div",qV,[h("span",jV,N(M(s)("tasks.tag")),1),h("span",zV,N(e.tasks.length),1)]),h("div",VV,[e.tasks.length===0?(C(),A("div",KV,N(M(s)("tasks.emptyTasks")),1)):(C(!0),A(Ie,{key:1},Xe(e.tasks,w=>(C(),A("div",{key:w.id,class:Ee(["tp-row",{done:w.state==="done",fail:w.state==="fail",expandable:l(w)}])},[h("div",{class:"tp-main",role:l(w)?"button":void 0,onClick:_=>a(w)},[h("span",{class:Ee(["tp-glyph",u(w.state)])},N(c(w.state)),3),h("span",YV,N(w.name),1),h("span",XV,N(w.kind),1),h("span",ZV,N(w.timing),1),w.state==="run"?(C(),A("button",{key:0,class:"tp-stop",onClick:Ye(_=>n("cancel",w.id),["stop"])},N(M(s)("tasks.stop")),9,QV)):re("",!0),l(w)?(C(),A("svg",{key:1,class:Ee(["tp-chevron",{open:o.has(w.id)}]),viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...v[0]||(v[0]=[h("path",{d:"M6 4l4 4-4 4"},null,-1)])],2)):re("",!0)],8,GV),o.has(w.id)&&l(w)?(C(),A("div",JV,[w.meta?(C(),A("div",eK,[h("button",{class:Ee(["tp-copy",{copied:i.has(w.id)}]),onClick:Ye(_=>p(w),["stop"])},N(i.has(w.id)?"已复制":"复制"),11,tK),h("pre",nK,[h("code",null,[h("span",sK,N(w.meta),1)])])])):re("",!0),w.output&&w.output.length>0?(C(),A("div",oK,[h("button",{class:Ee(["tp-copy",{copied:r.has(w.id)}]),onClick:Ye(_=>m(w),["stop"])},N(r.has(w.id)?"已复制":"复制"),11,iK),h("pre",rK,[h("code",null,[v[1]||(v[1]=ht(`
245
+ `,-1)),(C(!0),A(Ie,null,Xe(w.output,(_,b)=>(C(),A("span",{key:b,class:"tp-line"},N(_),1))),128)),v[2]||(v[2]=ht(`
246
+ `,-1))])])])):re("",!0)])):re("",!0)],2))),128))])]))}}),kw=yt(lK,[["__scopeId","data-v-e6a427f9"]]),aK={class:"tc-title"},cK={key:0,class:"tc-count"},uK={key:0,class:"tc-list"},dK={key:0,class:"tc-empty"},fK={class:"tc-name"},hK=Ze({__name:"TodoCard",props:{todos:{},inline:{type:Boolean}},setup(e){const t=e,{t:n}=wt(),s=te(!1),o=j(()=>!t.inline),i=j(()=>t.inline||!s.value);function r(){o.value&&(s.value=!s.value)}const l=j(()=>t.todos.filter(c=>c.status==="done").length);function a(c){return c==="done"?"done":c==="in_progress"?"in_progress":"pending"}return(c,u)=>(C(),A("div",{class:Ee(["todo-card",{"tab-mode":e.inline}])},[(C(),je(ss(o.value?"button":"div"),{class:Ee(["tc-head",{static:!o.value}]),type:o.value?"button":void 0,onClick:r},{default:vn(()=>[u[1]||(u[1]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.4","aria-hidden":"true"},[h("polyline",{points:"2,4.5 3.5,6 5.5,3"}),h("polyline",{points:"2,11 3.5,12.5 5.5,9.5"}),h("line",{x1:"8",y1:"4.5",x2:"14",y2:"4.5"}),h("line",{x1:"8",y1:"11",x2:"14",y2:"11"})],-1)),h("span",aK,N(M(n)("tasks.todoTag")),1),e.todos.length>0?(C(),A("span",cK,N(l.value)+"/"+N(e.todos.length),1)):re("",!0),o.value&&e.todos.length>0?(C(),A("svg",{key:1,class:Ee(["tc-chev",{open:!s.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...u[0]||(u[0]=[h("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2)):re("",!0)]),_:1},8,["class","type"])),i.value?(C(),A("div",uK,[e.todos.length===0?(C(),A("div",dK,N(M(n)("tasks.emptyTodo")),1)):re("",!0),(C(!0),A(Ie,null,Xe(e.todos,(d,p)=>(C(),A("div",{key:p,class:Ee(["tc-row",`s-${d.status}`])},[h("span",{class:Ee(["tc-glyph",`g-${a(d.status)}`])},null,2),h("span",fK,N(d.title),1)],2))),128))])):re("",!0)],2))}}),pK=yt(hK,[["__scopeId","data-v-20948504"]]),mK={key:0,class:"queue-head"},gK={class:"queue-label"},vK=["title"],yK={class:"queue-list"},kK=["disabled","title","onClick"],bK={key:0,class:"queue-img",viewBox:"0 0 16 16",width:"12",height:"12",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg"},_K=["title","onClick"],wK=Ze({__name:"QueuePane",props:{queued:{},running:{type:Boolean},inline:{type:Boolean}},emits:["steer","unqueue","editQueued"],setup(e,{emit:t}){const n=t,{t:s}=wt();function o(i,r){r.attachmentCount>0||n("editQueued",i)}return(i,r)=>(C(),A("div",{class:Ee(["queue-pane",{"tab-mode":e.inline}])},[e.inline?re("",!0):(C(),A("div",mK,[h("span",gK,N(M(s)("composer.queueLabel"))+" · "+N(e.queued.length),1),e.running?(C(),A("button",{key:0,class:"queue-steer",type:"button",title:M(s)("composer.steerTitle"),onClick:r[0]||(r[0]=l=>n("steer"))},N(M(s)("composer.steerNow")),9,vK)):re("",!0)])),h("div",yK,[(C(!0),A(Ie,null,Xe(e.queued,(l,a)=>(C(),A("div",{key:a,class:"queue-item"},[h("button",{class:"queue-text",type:"button",disabled:l.attachmentCount>0,title:l.attachmentCount>0?M(s)("composer.queuedHasImage",{n:l.attachmentCount}):M(s)("composer.editQueued"),onClick:c=>o(a,l)},[l.attachmentCount>0?(C(),A("svg",bK,[...r[1]||(r[1]=[h("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},null,-1),h("circle",{cx:"5.5",cy:"6.5",r:"1.2"},null,-1),h("path",{d:"M2.5 12l3.5-3.5 2.5 2.5 3-3 2 2"},null,-1)])])):re("",!0),h("span",{class:Ee(["queue-text-inner",{placeholder:!l.text}])},N(l.text||M(s)("composer.queuedImageOnly",{n:l.attachmentCount})),3)],8,kK),h("button",{class:"queue-rm",title:M(s)("composer.remove"),onClick:c=>n("unqueue",a)},[...r[2]||(r[2]=[h("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor","stroke-width":"1.6",xmlns:"http://www.w3.org/2000/svg"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,_K)]))),128))])],2))}}),SK=yt(wK,[["__scopeId","data-v-acad2c66"]]),CK={class:"dock-work-head"},xK={key:0,class:"dock-work-tab static"},TK={key:1,class:"dock-work-tab static"},MK={key:2,class:"dock-work-tab static"},AK={key:3,class:"dock-work-tab static"},EK=["title"],IK={class:"dock-work-body"},$K=["aria-pressed"],NK={class:"dw-count"},LK=["aria-pressed"],OK={class:"dw-count"},RK=["aria-pressed"],PK={class:"dw-count"},DK=["aria-pressed"],BK={class:"dw-count"},FK=Ze({__name:"ChatDock",props:{sessionId:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},activationBadges:{},models:{},starredIds:{},skills:{},goal:{},goalExpandSignal:{},dockPanel:{},bashTasks:{},subagentTasks:{},bashRunning:{},subagentRunning:{},todoDoneCount:{},hasDockWork:{type:Boolean},todos:{},pendingQuestion:{},pendingApproval:{},mobile:{type:Boolean}},emits:["submit","steer","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","openBtw","createGoal","controlGoal","focusGoal","focusSwarm","compact","pickModel","selectModel","answer","dismiss","approval","cancelTask","toggle-dock-panel","close-dock-panel"],setup(e,{expose:t,emit:n}){const s=e,o=n,{t:i}=wt(),r=te(null),l=te(null),a=te(null);function c(p){r.value?.loadForEdit(p)}function u(p){const m=s.queued?.[p]?.text??"";m&&c(m),o("editQueued",p)}function d(p){if(!s.dockPanel)return;const m=p.target;m&&(l.value?.contains(m)||a.value?.contains(m)||o("close-dock-panel"))}return Ve(()=>s.dockPanel,p=>{typeof document>"u"||(document.removeEventListener("mousedown",d,!0),p&&document.addEventListener("mousedown",d,!0))},{immediate:!0}),qt(()=>{typeof document<"u"&&document.removeEventListener("mousedown",d,!0)}),t({loadForEdit:c}),(p,m)=>(C(),A("div",{class:Ee(["chat-dock",[e.mobile?"align-mobile":"align-center"]]),onClick:m[31]||(m[31]=Ye(()=>{},["stop"]))},[mt(Si,{name:"dock-panel"},{default:vn(()=>[e.dockPanel?(C(),A("div",{key:0,ref_key:"workPanelRef",ref:l,class:"dock-work-panel",onClick:m[5]||(m[5]=Ye(()=>{},["stop"]))},[h("div",CK,[e.dockPanel==="bash"?(C(),A("span",xK,N(M(i)("tasks.dockBash"))+" · "+N(e.bashRunning)+" "+N(M(i)("tasks.running")),1)):e.dockPanel==="subagent"?(C(),A("span",TK,N(M(i)("tasks.dockSubagent"))+" · "+N(e.subagentRunning)+" "+N(M(i)("tasks.running")),1)):e.dockPanel==="todos"?(C(),A("span",MK,N(M(i)("tasks.dockTodos"))+" · "+N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1)):e.dockPanel==="queue"?(C(),A("span",AK,N(M(i)("tasks.dockQueue"))+" · "+N(e.queued?.length??0),1)):re("",!0),e.dockPanel==="queue"&&e.running?(C(),A("button",{key:4,type:"button",class:"dock-queue-steer",title:M(i)("composer.steerTitle"),onClick:m[0]||(m[0]=f=>o("steer",{text:"",attachments:[]}))},N(M(i)("composer.steerNow")),9,EK)):re("",!0)]),h("div",IK,[e.dockPanel==="bash"?(C(),je(kw,{key:0,tasks:e.bashTasks,onCancel:m[1]||(m[1]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="subagent"?(C(),je(kw,{key:1,tasks:e.subagentTasks,onCancel:m[2]||(m[2]=f=>o("cancelTask",f))},null,8,["tasks"])):e.dockPanel==="todos"?(C(),je(pK,{key:2,todos:e.todos??[],inline:""},null,8,["todos"])):(C(),je(SK,{key:3,queued:e.queued??[],running:e.running,inline:"",onSteer:m[3]||(m[3]=f=>o("steer",{text:"",attachments:[]})),onUnqueue:m[4]||(m[4]=f=>o("unqueue",f)),onEditQueued:u},null,8,["queued","running"]))])],512)):re("",!0)]),_:1}),e.goal?(C(),je(kz,{key:0,goal:e.goal,"force-expanded":e.goalExpandSignal,onControlGoal:m[6]||(m[6]=f=>o("controlGoal",f))},null,8,["goal","force-expanded"])):re("",!0),e.hasDockWork?(C(),A("div",{key:1,ref_key:"workbarRef",ref:a,class:"dock-workbar"},[e.bashTasks.length>0?(C(),A("button",{key:0,type:"button",class:Ee(["dock-work-chip",{on:e.dockPanel==="bash"}]),"aria-pressed":e.dockPanel==="bash",onClick:m[7]||(m[7]=f=>o("toggle-dock-panel","bash"))},[m[34]||(m[34]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("circle",{cx:"8",cy:"8",r:"5.5"}),h("path",{d:"M8 4.5V8l2.5 1.5"})],-1)),h("span",null,N(M(i)("tasks.dockBash")),1),h("span",NK,[m[32]||(m[32]=ht("(",-1)),h("b",null,N(e.bashTasks.length),1),m[33]||(m[33]=ht(")",-1))])],10,$K)):re("",!0),e.subagentTasks.length>0?(C(),A("button",{key:1,type:"button",class:Ee(["dock-work-chip",{on:e.dockPanel==="subagent"}]),"aria-pressed":e.dockPanel==="subagent",onClick:m[8]||(m[8]=f=>o("toggle-dock-panel","subagent"))},[m[37]||(m[37]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z"})],-1)),h("span",null,N(M(i)("tasks.dockSubagent")),1),h("span",OK,[m[35]||(m[35]=ht("(",-1)),h("b",null,N(e.subagentTasks.length),1),m[36]||(m[36]=ht(")",-1))])],10,LK)):re("",!0),(e.todos?.length??0)>0?(C(),A("button",{key:2,type:"button",class:Ee(["dock-work-chip",{on:e.dockPanel==="todos"}]),"aria-pressed":e.dockPanel==="todos",onClick:m[9]||(m[9]=f=>o("toggle-dock-panel","todos"))},[m[40]||(m[40]=dr('<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true" data-v-51c190c0><path d="M3 4.5l1.5 1.5L7 3.5" data-v-51c190c0></path><path d="M8.5 5h4" data-v-51c190c0></path><path d="M3 11l1.5 1.5L7 10" data-v-51c190c0></path><path d="M8.5 11.5h4" data-v-51c190c0></path></svg>',1)),h("span",null,N(M(i)("tasks.dockTodos")),1),h("span",PK,[m[38]||(m[38]=ht("(",-1)),h("b",null,N(e.todoDoneCount)+"/"+N(e.todos?.length??0),1),m[39]||(m[39]=ht(")",-1))])],10,RK)):re("",!0),(e.queued?.length??0)>0?(C(),A("button",{key:3,type:"button",class:Ee(["dock-work-chip",{on:e.dockPanel==="queue"}]),"aria-pressed":e.dockPanel==="queue",onClick:m[10]||(m[10]=f=>o("toggle-dock-panel","queue"))},[m[43]||(m[43]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[h("path",{d:"M2 4l6 4 6-4"}),h("rect",{x:"2",y:"4",width:"12",height:"8",rx:"1.5"})],-1)),h("span",null,N(M(i)("tasks.dockQueue")),1),h("span",BK,[m[41]||(m[41]=ht("(",-1)),h("b",null,N(e.queued?.length??0),1),m[42]||(m[42]=ht(")",-1))])],10,DK)):re("",!0)],512)):re("",!0),e.pendingQuestion?(C(),je(Yz,{key:e.pendingQuestion.questionId,question:e.pendingQuestion,onAnswer:m[11]||(m[11]=(f,v)=>o("answer",f,v)),onDismiss:m[12]||(m[12]=f=>o("dismiss",f))},null,8,["question"])):e.pendingApproval?(C(),je(WV,{key:e.pendingApproval.approvalId,class:"dock-approval",block:e.pendingApproval.block,"agent-name":e.pendingApproval.agentName,onDecide:m[13]||(m[13]=f=>o("approval",e.pendingApproval.approvalId,f))},null,8,["block","agent-name"])):(C(),je(DT,{key:4,ref_key:"composerRef",ref:r,"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,onSubmit:m[14]||(m[14]=f=>o("submit",f)),onSteer:m[15]||(m[15]=f=>o("steer",f)),onCommand:m[16]||(m[16]=f=>o("command",f)),onInterrupt:m[17]||(m[17]=f=>o("interrupt")),onSetPermission:m[18]||(m[18]=f=>o("setPermission",f)),onSetThinking:m[19]||(m[19]=f=>o("setThinking",f)),onTogglePlan:m[20]||(m[20]=f=>o("togglePlan")),onToggleSwarm:m[21]||(m[21]=f=>o("toggleSwarm")),onToggleGoal:m[22]||(m[22]=f=>o("toggleGoal")),onOpenBtw:m[23]||(m[23]=f=>o("openBtw")),onCreateGoal:m[24]||(m[24]=f=>o("createGoal",f)),onControlGoal:m[25]||(m[25]=f=>o("controlGoal",f)),onFocusGoal:m[26]||(m[26]=f=>o("focusGoal")),onFocusSwarm:m[27]||(m[27]=f=>o("focusSwarm")),onCompact:m[28]||(m[28]=f=>o("compact")),onPickModel:m[29]||(m[29]=f=>o("pickModel")),onSelectModel:m[30]||(m[30]=f=>o("selectModel",f))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]))],2))}}),HK=yt(FK,[["__scopeId","data-v-51c190c0"]]),WK=5;function UK(e,t,n,s=WK){if(n||e.length<=s)return e;const o=e.slice(0,s);if(t&&!o.some(i=>i.id===t)){const i=e.find(r=>r.id===t);i&&(o[s-1]=i)}return o}const qK=["aria-label"],jK={class:"toc-track"},zK=["aria-label","onMouseenter","onClick"],VK={class:"toc-no"},KK={class:"chat-layout"},GK={class:"empty-hint"},YK={class:"empty-hint-title"},XK={class:"empty-hint-text"},ZK={key:0,class:"ws-pick"},QK=["title"],JK={class:"ws-pick-name"},eG={key:1,class:"ws-pick-menu"},tG=["onClick"],nG={class:"ws-pick-item-name"},sG={class:"ws-pick-item-path"},oG={key:0,class:"swarm-stack"},iG=["aria-label"],rG={key:0,class:"abort-toast",role:"status","aria-live":"polite"},lG={class:"abort-toast-text"},gd=10,aG=56,cG=420,bw=80,uG=1e3,dG=3e3,fG=Ze({__name:"ConversationPane",props:{turns:{},sessionId:{},approvals:{},gitInfo:{},tasks:{},todos:{},goal:{},swarms:{},activationBadges:{},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},goalMode:{type:Boolean},questions:{},running:{type:Boolean},queued:{},searchFiles:{type:Function},uploadImage:{type:Function},changes:{},fileReloadKey:{},sending:{type:Boolean},fastMoon:{type:Boolean},mobile:{type:Boolean},modern:{type:Boolean},sessionLoading:{type:Boolean},compaction:{},hasMoreMessages:{type:Boolean},loadingMore:{type:Boolean},loadingMoreError:{type:Boolean},loadOlderMessages:{type:Function},models:{},starredIds:{},skills:{},workspaceName:{},workspaceRoot:{},gitDiffStats:{},workspaces:{},activeWorkspaceId:{},sessionTitle:{},pr:{},betaToc:{type:Boolean}},emits:["submit","steer","approval","cancelTask","answer","dismiss","command","interrupt","unqueue","editQueued","setPermission","setThinking","togglePlan","toggleSwarm","toggleGoal","createGoal","controlGoal","compact","pickModel","selectModel","openFile","openMedia","openThinking","openCompaction","openAgent","openChanges","refreshGitStatus","editMessage","selectWorkspace","addWorkspace","openPr","renameSession","forkSession","archiveSession"],setup(e,{expose:t,emit:n}){const s=e,o=n,i=te(!1),r=te(!1),l=j(()=>s.workspaces?.find(ge=>ge.id===s.activeWorkspaceId)?.name??s.workspaceName??""),a=j(()=>(s.workspaces?.length??0)>0),c=j(()=>UK(s.workspaces??[],s.activeWorkspaceId,r.value)),u=j(()=>(s.workspaces?.length??0)-c.value.length);Ve(i,Me=>{Me||(r.value=!1)});const d=j(()=>s.swarms?.filter(Me=>Me.members.some(ge=>ge.phase!=="completed"&&ge.phase!=="failed"))??[]);function p(Me){i.value=!1,Me!==s.activeWorkspaceId&&o("selectWorkspace",Me)}const{t:m}=wt();try{localStorage.removeItem("cyberneurova-web.content-align")}catch{}const f=te(null),v=te(null),w=te(null),_=te(!1),b=te(0);let g=null;function y(Me){(w.value??v.value)?.loadForEdit(Me)}function k(){_.value=!0,g!==null&&clearTimeout(g),g=setTimeout(()=>{g=null,_.value=!1},2e3)}function $(){b.value++}function E(){ft(()=>{D.value?.querySelector(".swarm-card")?.scrollIntoView({behavior:"smooth",block:"center"})})}const S=j(()=>s.mobile===!0||s.modern===!0),T=j(()=>s.tasks.filter(Me=>Me.kind!=="subagent")),I=j(()=>s.tasks.filter(Me=>Me.kind==="subagent")),L=j(()=>T.value.filter(Me=>Me.state==="run").length),R=j(()=>I.value.filter(Me=>Me.state==="run").length),O=j(()=>(s.todos??[]).filter(Me=>Me.status==="done").length),F=j(()=>s.tasks.length>0||(s.todos?.length??0)>0||(s.queued?.length??0)>0),P=te(null),q=j(()=>s.gitInfo?s.changes?.length??0:0);function K(Me){P.value=P.value===Me?null:Me}function G(){P.value=null}Ve(F,Me=>{Me||G()});function oe(Me){if(Me.role==="compaction")return m("conversation.compactedPlain");if(Me.role==="user"){if(Me.skillActivation)return`/${Me.skillActivation.name}`;const Oe=Me.text.trim().replaceAll(/\s+/g," ");return Oe.length>0?Oe:"user"}const ge=(Me.text||Me.thinking||"").trim().replaceAll(/\s+/g," ");return ge.length>0?ge:(Me.tools?.length??0)>0?`${Me.tools.length} tools`:"cyberneurova"}const J=j(()=>s.turns.map((Me,ge)=>({id:Me.id,role:Me.role,no:Me.no||ge+1,title:oe(Me)})));function he(Me){return Me.role==="compaction"?20:Me.role==="user"?(Me.text?.length??0)+(Me.skillActivation?20:0):(Me.text?.length??0)+(Me.thinking?.length??0)+(Me.tools?.reduce((ge,Oe)=>ge+Oe.name.length+(Oe.arg?.length??0)+(Oe.output?.join("").length??0),0)??0)}const Ne=j(()=>{const Me=J.value,ge=Me.map(we=>{const Ae=s.turns.find(He=>He.id===we.id);return Ae?he(Ae):gd}),Oe=ge.reduce((we,Ae)=>we+Ae,0)||Me.length*gd;return Me.map((we,Ae)=>{const He=ge[Ae]??gd,tt=Oe>0?He/Oe:0,pn=Math.max(gd,Math.min(aG,tt*cG));return{id:we.id,height:Math.round(pn)}})}),Fe=j(()=>Ne.value.reduce((Me,ge)=>Me+ge.height,0)+(J.value.length-1)*4),We=te(null),$e=te(null),me=te({visible:!1,text:"",top:0});function ke(){const Me=D.value;if(!Me)return;const ge=Me.querySelectorAll(".turn-anchor[data-turn-id]");if(ge.length===0)return;const Oe=Me.getBoundingClientRect(),we=Oe.height/2;let Ae=null,He=1/0;ge.forEach(Zn=>{const Bo=Zn.getBoundingClientRect(),io=Bo.top-Oe.top,Cr=Math.abs(io+Bo.height/2-we);Cr<He&&(He=Cr,Ae=Zn.dataset.turnId??null)}),We.value=Ae;const tt=Me.scrollHeight-Me.clientHeight,pn=tt>0?Me.scrollTop/tt:0,Vt=Fe.value,Xn=pn*Vt,en=Me.scrollHeight>0?Me.clientHeight/Me.scrollHeight*Vt:Vt;$e.value={top:Math.max(0,Xn),height:Math.max(8,Math.min(en,Vt-Xn))}}function _e(Me,ge){const Oe=ge.currentTarget;Oe&&(me.value={visible:!0,text:Me,top:Oe.offsetTop})}function ue(){me.value.visible=!1}const z=j(()=>!s.mobile&&!s.sessionLoading&&J.value.length>1),X=j(()=>s.questions&&s.questions.length>0?s.questions[0]:void 0),fe=j(()=>s.approvals&&s.approvals.length>0?s.approvals[0]:void 0),D=te(null),Z=te(null),ne=te(0),se=te(0),ae=j(()=>({"--panes-scrollbar-width":`${ne.value}px`}));function H(Me){return Me instanceof HTMLElement?Me:Me&&"$el"in Me&&Me.$el instanceof HTMLElement?Me.$el:null}function U(){const Me=D.value;ne.value=Me?Math.max(0,Me.offsetWidth-Me.clientWidth):0,se.value=Z.value?.offsetHeight??0}function Q(Me){const ge=H(Me);D.value=ge,ge&&ws()}function ce(Me){const ge=H(Me);Z.value=ge??null,Me&&"loadForEdit"in Me&&typeof Me.loadForEdit=="function"?w.value={loadForEdit:Me.loadForEdit.bind(Me)}:w.value=null,Dn()}const pe=te(!0),xe=te(!1);function ie(){const Me=D.value;return Me?Me.scrollHeight-Me.scrollTop-Me.clientHeight:0}let be=0,ze=0,Je=0,rt=0,Ge=0;function ut(){return Date.now()<ze}function xt(){const Me=D.value;if(!Me)return;const ge=Me.scrollTop;if(performance.now()-Je<100){be=ge;return}const Oe=ie();if(ut()){pe.value=!0,xe.value=!1,be=ge;return}ge<be-1&&Oe>1?pe.value=!1:Oe<=bw&&ge>be+1&&(pe.value=!0,xe.value=!1),be=ge,ke()}function Ht(Me=!1){const ge=D.value;ge&&(Me&&typeof ge.scrollTo=="function"?(Je=performance.now(),ge.scrollTo({top:ge.scrollHeight,behavior:"smooth"})):ge.scrollTop=ge.scrollHeight,be=ge.scrollTop,pe.value=!0,xe.value=!1)}function Pt(Me,ge){const Oe=Me.querySelectorAll(".turn-anchor");for(const we of Oe)if(we.offsetTop>=ge){const Ae=we.dataset.turnId;if(Ae)return{id:Ae,top:we.offsetTop}}return null}async function Vn(){if(!s.sessionId||!s.loadOlderMessages||s.loadingMore||!s.hasMoreMessages)return;const Me=s.sessionId,ge=D.value,Oe=ge?.scrollTop??0,we=ge?.scrollHeight??0,Ae=ge?Pt(ge,Oe):null;so.value=!0;try{await s.loadOlderMessages(Me),await ft()}finally{so.value=!1}if(s.sessionId!==Me)return;const He=D.value;if(!He)return;let tt=0;if(Ae){const pn=He.querySelector(`.turn-anchor[data-turn-id="${_s(Ae.id)}"]`);pn&&(tt=pn.offsetTop-Ae.top)}tt===0&&(tt=He.scrollHeight-we),He.scrollTop=Oe+tt}function _s(Me){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(Me):Me.replaceAll(/["\\]/g,"\\$&")}function Ke(Me){const ge=D.value;if(!ge)return;const Oe=ge.querySelector(`.turn-anchor[data-turn-id="${_s(Me)}"]`);Oe&&(pe.value=!1,xe.value=ie()>bw,Oe.scrollIntoView({behavior:"smooth",block:"center"}))}function zt(){const Me=D.value;if(!Me)return"none";const ge=Me.firstElementChild,Oe=ge instanceof HTMLElement?ge.offsetHeight:0,we=Z.value?.offsetHeight??0;return`${Me.scrollHeight}:${Me.clientHeight}:${Oe}:${we}`}function Kn(Me){return typeof requestAnimationFrame=="function"?requestAnimationFrame(Me):setTimeout(Me,16)}function Ps(Me){typeof cancelAnimationFrame=="function"?cancelAnimationFrame(Me):clearTimeout(Me)}function Gn(Me=36){if(!pe.value&&!ut())return;const ge=++Ge;let Oe="",we=0,Ae=0;rt&&(Ps(rt),rt=0);const He=()=>{if(rt=0,ge!==Ge||!pe.value&&!ut())return;Ht(!1);const tt=zt();we=tt===Oe?we+1:0,Oe=tt,Ae++,we<3&&Ae<Me&&(rt=Kn(He))};rt=Kn(He)}function Do(Me,ge){return Me!==void 0&&Me.length>0&&ge.length>=Me.length&&Me.firstId!==ge.firstId&&Me.lastId===ge.lastId&&Me.lastTextLen===ge.lastTextLen&&Me.lastThinkingLen===ge.lastThinkingLen&&Me.lastToolsLen===ge.lastToolsLen&&Me.approvalIds===ge.approvalIds}const Ds=j(()=>{const Me=(s.approvals??[]).map(He=>He.approvalId).join(","),ge=s.turns,Oe=ge.at(-1),we=Oe?.thinking?.length??0,Ae=Oe?.tools?.reduce((He,tt)=>He+tt.name.length+(tt.arg?.length??0)+(tt.output?.join("").length??0),0)??0;return{length:ge.length,firstId:ge[0]?.id??"",lastId:Oe?.id??"",lastTextLen:Oe?.text.length??0,lastThinkingLen:we,lastToolsLen:Ae,approvalIds:Me}});Ve(Ds,async(Me,ge)=>{if(so.value&&Do(ge,Me)){ke();return}await ft(),pe.value||ut()?Ht(!1):xe.value=!0,ke()}),Ve(Z,()=>{Dn()}),Ve(()=>s.mobile,async()=>{await ft(),U()}),Ve(()=>s.fileReloadKey,async()=>{pe.value=!0,be=0,await ft(),Gn(),ke()}),Ve(()=>s.sessionLoading,async(Me,ge)=>{Me||!ge||(pe.value=!0,await ft(),Gn(),ke())}),Ve(()=>s.running,async(Me,ge)=>{Me||!ge||!pe.value&&!ut()||(await ft(),Gn(48),ke())});function Bs(){pe.value=!0,xe.value=!1,ze=Date.now()+uG,ft(()=>{Ht(!1),Gn(16)})}function Fs(Me){Bs(),o("submit",Me)}function Ni(Me,ge){Bs(),o("answer",Me,ge)}function ls(Me,ge){!Me||!ge||o("approval",Me,ge)}let $n=null,sn=null,Hs=null,_t=null,Pn=0,Yt=!1;const so=te(!1);function oo(Me){if(so.value||(Yt=Yt||Me,Pn))return;Pn=(typeof requestAnimationFrame=="function"?requestAnimationFrame:Oe=>setTimeout(Oe,16))(()=>{Pn=0;const Oe=Yt;Yt=!1,pe.value||ut()?Ht(!1):Oe&&(xe.value=!0)})}function Ws(){if(!sn)return;const Me=D.value?.firstElementChild??null;Me!==Hs&&(Hs&&sn.unobserve(Hs),Hs=Me,Me&&sn.observe(Me))}function Dn(){if(!sn)return;const Me=Z.value;Me!==_t&&(_t&&sn.unobserve(_t),_t=Me,Me&&sn.observe(Me))}function ws(){const Me=D.value;U(),$n&&($n.disconnect(),Me&&$n.observe(Me,{childList:!0,subtree:!0,characterData:!0})),sn&&(sn.disconnect(),Hs=null,_t=null,Me&&sn.observe(Me),Ws(),Dn())}function as(){Ws(),oo(!0)}function vt(){typeof document>"u"||document.visibilityState==="visible"&&pe.value&&Gn()}const Ss=te(!1);let Bn=null;function Yn(){Ss.value=!0,Bn!==null&&clearTimeout(Bn),Bn=setTimeout(()=>{Ss.value=!1},dG)}function cn(){Yn(),o("interrupt")}function hn(Me){Me.key==="Escape"&&(s.running||s.sending)&&(Me.preventDefault(),cn())}return Jt(()=>{ft(()=>{typeof MutationObserver=="function"&&($n=new MutationObserver(as)),typeof ResizeObserver=="function"&&(sn=new ResizeObserver(()=>{U(),oo(!1)})),ws(),Gn(48),ke(),typeof document<"u"&&(document.addEventListener("visibilitychange",vt),document.addEventListener("keydown",hn))})}),qt(()=>{$n&&$n.disconnect(),sn&&sn.disconnect(),Pn&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(Pn),rt&&Ps(rt),Bn!==null&&clearTimeout(Bn),g!==null&&(clearTimeout(g),g=null),typeof document<"u"&&(document.removeEventListener("visibilitychange",vt),document.removeEventListener("keydown",hn))}),t({loadComposerForEdit:y}),(Me,ge)=>(C(),A("section",{class:Ee(["con",{mobile:e.mobile}])},[!e.mobile&&!(e.turns.length===0&&!e.sessionLoading)?(C(),je(yq,{key:0,"session-id":e.sessionId,"workspace-name":e.workspaceName,"workspace-root":e.workspaceRoot,"session-title":e.sessionTitle,branch:e.gitInfo?.branch,ahead:e.gitInfo?.ahead,behind:e.gitInfo?.behind,"changes-count":q.value,"git-diff-stats":e.gitDiffStats,"is-git-repo":!!e.gitInfo,pr:e.pr,copied:_.value,onOpenChanges:ge[0]||(ge[0]=Oe=>o("openChanges")),onCopyAll:ge[1]||(ge[1]=Oe=>f.value?.copyConversation()),onCopyFinalSummary:ge[2]||(ge[2]=Oe=>f.value?.copyFinalSummary()),onOpenPr:ge[3]||(ge[3]=Oe=>e.pr&&o("openPr",e.pr.url)),onRenameSession:ge[4]||(ge[4]=(Oe,we)=>o("renameSession",Oe,we)),onForkSession:ge[5]||(ge[5]=Oe=>o("forkSession",Oe)),onArchiveSession:ge[6]||(ge[6]=Oe=>o("archiveSession",Oe))},null,8,["session-id","workspace-name","workspace-root","session-title","branch","ahead","behind","changes-count","git-diff-stats","is-git-repo","pr","copied"])):re("",!0),z.value&&e.betaToc?(C(),A("nav",{key:1,class:"conversation-toc","aria-label":M(m)("conversation.toc")},[h("div",jK,[(C(!0),A(Ie,null,Xe(J.value,(Oe,we)=>(C(),A("button",{key:Oe.id,type:"button",class:Ee(["toc-bubble",[Oe.role,{active:We.value===Oe.id}]]),style:$t({height:Ne.value[we]?.height+"px"}),"aria-label":`#${Oe.no} ${Oe.title}`,onMouseenter:Ae=>_e(Oe.title,Ae),onMouseleave:ue,onClick:Ae=>Ke(Oe.id)},[h("span",VK,N(Oe.no),1)],46,zK))),128)),$e.value?(C(),A("div",{key:0,class:"toc-viewport",style:$t({top:$e.value.top+"px",height:$e.value.height+"px"})},null,4)):re("",!0)]),mt(Si,{name:"toc-tip"},{default:vn(()=>[Et(h("div",{class:"toc-tooltip",style:$t({top:me.value.top+"px"})},N(me.value.text),5),[[No,me.value.visible]])]),_:1})],8,qK)):re("",!0),h("div",KK,[h("div",{ref:Q,class:"panes chat-scroll",onScrollPassive:xt},[h("div",{class:Ee(["content-wrap",[e.mobile?"align-mobile":"align-center"]])},[e.turns.length===0&&!e.sessionLoading?(C(),A(Ie,{key:0},[ge[58]||(ge[58]=h("div",{class:"empty-spacer"},null,-1)),h("div",GK,[h("span",YK,N(M(m)("composer.emptyConversationTitle")),1),h("span",XK,N(M(m)("composer.emptyConversation")),1),a.value?(C(),A("div",ZK,[h("button",{type:"button",class:"ws-pick-btn",title:M(m)("conversation.switchWorkspace"),onClick:ge[7]||(ge[7]=Ye(Oe=>i.value=!i.value,["stop"]))},[ge[54]||(ge[54]=h("svg",{viewBox:"0 0 14 14",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"})],-1)),h("span",JK,N(l.value),1),(C(),A("svg",{class:Ee(["ws-pick-chev",{open:i.value}]),viewBox:"0 0 16 16",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...ge[53]||(ge[53]=[h("polyline",{points:"4,6 8,10 12,6"},null,-1)])],2))],8,QK),i.value?(C(),A("div",{key:0,class:"ws-pick-backdrop",onClick:ge[8]||(ge[8]=Oe=>i.value=!1)})):re("",!0),i.value?(C(),A("div",eG,[(C(!0),A(Ie,null,Xe(c.value,Oe=>(C(),A("button",{key:Oe.id,type:"button",class:Ee(["ws-pick-item",{on:Oe.id===e.activeWorkspaceId}]),onClick:Ye(we=>p(Oe.id),["stop"])},[h("span",nG,N(Oe.name),1),h("span",sG,N(Oe.shortPath),1)],10,tG))),128)),u.value>0?(C(),A("button",{key:0,type:"button",class:"ws-pick-item ws-pick-more",onClick:ge[9]||(ge[9]=Ye(Oe=>r.value=!r.value,["stop"]))},[h("span",null,N(M(m)("conversation.moreWorkspaces",{count:u.value})),1)])):re("",!0),ge[56]||(ge[56]=h("div",{class:"ws-pick-divider"},null,-1)),h("button",{type:"button",class:"ws-pick-action",onClick:ge[10]||(ge[10]=Ye(Oe=>{i.value=!1,o("addWorkspace")},["stop"]))},[ge[55]||(ge[55]=h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)),h("span",null,N(M(m)("conversation.addWorkspace")),1)])])):re("",!0)])):(C(),A("button",{key:1,type:"button",class:"empty-add-workspace",onClick:ge[11]||(ge[11]=Oe=>o("addWorkspace"))},[ge[57]||(ge[57]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"}),h("path",{d:"M8 7.25v4.5M5.75 9.5h4.5"})],-1)),h("span",null,N(M(m)("conversation.addWorkspace")),1)]))]),mt(DT,{ref_key:"emptyComposerRef",ref:v,class:"empty-composer","session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,"hide-context":"",onSubmit:Fs,onSteer:ge[12]||(ge[12]=Oe=>o("steer",Oe)),onCommand:ge[13]||(ge[13]=Oe=>o("command",Oe)),onInterrupt:cn,onUnqueue:ge[14]||(ge[14]=Oe=>o("unqueue",Oe)),onEditQueued:ge[15]||(ge[15]=Oe=>o("editQueued",Oe)),onSetPermission:ge[16]||(ge[16]=Oe=>o("setPermission",Oe)),onSetThinking:ge[17]||(ge[17]=Oe=>o("setThinking",Oe)),onTogglePlan:ge[18]||(ge[18]=Oe=>o("togglePlan")),onToggleSwarm:ge[19]||(ge[19]=Oe=>o("toggleSwarm")),onToggleGoal:ge[20]||(ge[20]=Oe=>o("toggleGoal")),onOpenBtw:ge[21]||(ge[21]=Oe=>o("command","/btw")),onCreateGoal:ge[22]||(ge[22]=Oe=>o("createGoal",Oe)),onControlGoal:ge[23]||(ge[23]=Oe=>o("controlGoal",Oe)),onFocusGoal:$,onFocusSwarm:E,onCompact:ge[24]||(ge[24]=Oe=>o("compact")),onPickModel:ge[25]||(ge[25]=Oe=>o("pickModel")),onSelectModel:ge[26]||(ge[26]=Oe=>o("selectModel",Oe))},null,8,["session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills"]),ge[59]||(ge[59]=h("div",{class:"empty-spacer"},null,-1))],64)):(C(),A(Ie,{key:1},[(C(),je(LT,{ref_key:"chatPaneRef",ref:f,key:e.fileReloadKey??"no-session",turns:e.turns,approvals:e.approvals,bubble:S.value,mobile:e.mobile,running:e.running,sending:e.sending,"fast-moon":e.fastMoon,"session-loading":e.sessionLoading,compaction:e.compaction,"has-more-messages":e.hasMoreMessages,"loading-more":e.loadingMore,"loading-more-error":e.loadingMoreError,"is-following":pe.value,onOpenFile:ge[27]||(ge[27]=Oe=>o("openFile",Oe)),onOpenMedia:ge[28]||(ge[28]=Oe=>o("openMedia",Oe)),onCopyConversationCopied:k,onOpenThinking:ge[29]||(ge[29]=Oe=>o("openThinking",Oe)),onOpenCompaction:ge[30]||(ge[30]=Oe=>o("openCompaction",Oe)),onOpenAgent:ge[31]||(ge[31]=Oe=>o("openAgent",Oe)),onEditMessage:ge[32]||(ge[32]=Oe=>o("editMessage",Oe)),onLoadOlderMessages:Vn},null,8,["turns","approvals","bubble","mobile","running","sending","fast-moon","session-loading","compaction","has-more-messages","loading-more","loading-more-error","is-following"])),d.value.length>0?(C(),A("div",oG,[(C(!0),A(Ie,null,Xe(d.value,Oe=>(C(),je(uz,{key:Oe.id,group:Oe},null,8,["group"]))),128))])):re("",!0)],64))],2)],32),e.turns.length===0&&!e.sessionLoading?re("",!0):(C(),je(HK,{key:0,ref:ce,style:$t(ae.value),"session-id":e.sessionId,running:e.running,queued:e.queued,"search-files":e.searchFiles,"upload-image":e.uploadImage,status:e.status,thinking:e.thinking,"plan-mode":e.planMode,"swarm-mode":e.swarmMode,"goal-mode":e.goalMode,"activation-badges":e.activationBadges,models:e.models,"starred-ids":e.starredIds,skills:e.skills,goal:e.goal,"goal-expand-signal":b.value,"dock-panel":P.value,"bash-tasks":T.value,"subagent-tasks":I.value,"bash-running":L.value,"subagent-running":R.value,"todo-done-count":O.value,"has-dock-work":F.value,todos:e.todos,"pending-question":X.value,"pending-approval":fe.value,mobile:e.mobile,onToggleDockPanel:ge[33]||(ge[33]=Oe=>K(Oe)),onCloseDockPanel:ge[34]||(ge[34]=Oe=>G()),onAnswer:Ni,onDismiss:ge[35]||(ge[35]=Oe=>o("dismiss",Oe)),onApproval:ls,onCancelTask:ge[36]||(ge[36]=Oe=>o("cancelTask",Oe)),onControlGoal:ge[37]||(ge[37]=Oe=>o("controlGoal",Oe)),onSubmit:Fs,onSteer:ge[38]||(ge[38]=Oe=>o("steer",Oe)),onCommand:ge[39]||(ge[39]=Oe=>o("command",Oe)),onInterrupt:cn,onUnqueue:ge[40]||(ge[40]=Oe=>o("unqueue",Oe)),onEditQueued:ge[41]||(ge[41]=Oe=>o("editQueued",Oe)),onSetPermission:ge[42]||(ge[42]=Oe=>o("setPermission",Oe)),onSetThinking:ge[43]||(ge[43]=Oe=>o("setThinking",Oe)),onTogglePlan:ge[44]||(ge[44]=Oe=>o("togglePlan")),onToggleSwarm:ge[45]||(ge[45]=Oe=>o("toggleSwarm")),onToggleGoal:ge[46]||(ge[46]=Oe=>o("toggleGoal")),onOpenBtw:ge[47]||(ge[47]=Oe=>o("command","/btw")),onCreateGoal:ge[48]||(ge[48]=Oe=>o("createGoal",Oe)),onFocusGoal:$,onFocusSwarm:E,onCompact:ge[49]||(ge[49]=Oe=>o("compact")),onPickModel:ge[50]||(ge[50]=Oe=>o("pickModel")),onSelectModel:ge[51]||(ge[51]=Oe=>o("selectModel",Oe))},null,8,["style","session-id","running","queued","search-files","upload-image","status","thinking","plan-mode","swarm-mode","goal-mode","activation-badges","models","starred-ids","skills","goal","goal-expand-signal","dock-panel","bash-tasks","subagent-tasks","bash-running","subagent-running","todo-done-count","has-dock-work","todos","pending-question","pending-approval","mobile"]))]),mt(Si,{name:"pill"},{default:vn(()=>[xe.value?(C(),A("button",{key:0,class:"newmsg-pill",style:$t({bottom:`${se.value+12}px`}),"aria-label":M(m)("conversation.jumpToLatestAria"),onClick:ge[52]||(ge[52]=Oe=>Ht(!0))},[ge[60]||(ge[60]=h("svg",{class:"pill-chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("polyline",{points:"4,6 8,10 12,6"})],-1)),ht(" "+N(M(m)("conversation.newMessages")),1)],12,iG)):re("",!0)]),_:1}),mt(Si,{name:"abort-toast"},{default:vn(()=>[Ss.value?(C(),A("div",rG,[h("span",lG,N(M(m)("conversation.manuallyAborted")),1)])):re("",!0)]),_:1})],2))}}),hG=yt(fG,[["__scopeId","data-v-253f70bd"]]),pG={key:0,class:"fp-empty fp-error"},mG={key:1,class:"fp-empty"},gG={key:2,class:"fp-loading"},vG={class:"fp-header"},yG={class:"fp-title"},kG=["title"],bG={class:"fp-meta"},_G={key:0,class:"fp-lines"},wG={class:"fp-size"},SG=["aria-label"],CG=["aria-label"],xG=["aria-label"],TG={key:3,class:"fp-search"},MG=["placeholder"],AG={key:0,class:"fp-search-count"},EG=["disabled","title"],IG=["disabled","title"],$G=["title"],NG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},LG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},OG=["title"],RG=["title"],PG=["href","title"],DG=["title"],BG={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},FG={key:1,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},HG=["title","aria-label"],WG={key:1,class:"fp-code"},UG={class:"fp-line-table"},qG=["data-line"],jG={class:"fp-gutter"},zG=["innerHTML"],VG={key:1,class:"fp-body fp-code"},KG={class:"fp-line-table"},GG=["data-line"],YG={class:"fp-gutter"},XG=["innerHTML"],ZG={key:2,class:"fp-body"},QG=["srcdoc","title"],JG={key:1,class:"fp-code"},eY={class:"fp-line-table"},tY=["data-line"],nY={class:"fp-gutter"},sY=["innerHTML"],oY={key:3,class:"fp-body fp-pdf-wrap"},iY=["src","title"],rY={key:1,class:"fp-binary-card"},lY={class:"fp-binary-label"},aY={key:4,class:"fp-body fp-table-wrap"},cY={class:"fp-table"},uY=["data-line"],dY={key:5,class:"fp-body fp-image-wrap"},fY=["src","alt"],hY={key:1,class:"fp-binary-card"},pY={class:"fp-binary-label"},mY={key:6,class:"fp-body fp-code"},gY={class:"fp-line-table"},vY=["data-line"],yY={class:"fp-gutter"},kY=["innerHTML"],bY={key:7,class:"fp-body fp-binary-wrap"},_Y={class:"fp-binary-card"},wY={class:"fp-binary-label"},SY=Ze({__name:"FilePreview",props:{file:{},loading:{type:Boolean},error:{},line:{},downloadUrl:{},closable:{type:Boolean},externalActions:{type:Boolean},openFile:{type:Function}},emits:["close","openExternal","reveal"],setup(e,{emit:t}){const{t:n}=wt();function s(me,ke){const _e=ke?ke.split("/").filter(Boolean):[];for(const ue of me.split("/"))ue===""||ue==="."||(ue===".."?_e.pop():_e.push(ue));return _e.join("/")}const o=Nt("resolveImage",async me=>me),i=j(()=>{const me=c.file?.path??"",ke=me.lastIndexOf("/");return ke>0?me.slice(0,ke):""});function r(me){if(/^(https?:|data:|blob:)/i.test(me)||me.startsWith("/"))return me;const ke=i.value;return ke?s(me,ke):me}async function l(me){const ke=r(me);return o?o(ke):ke}ln("resolveImage",l);function a(me){let ke=me.path;if(/^(https?:|mailto:|tel:|data:|blob:|#)/i.test(ke)||ke.startsWith("/"))return me;for(const ue of["#","?"]){const z=ke.indexOf(ue);z!==-1&&(ke=ke.slice(0,z))}const _e=i.value;return{...me,path:s(ke,_e)}}const c=e,u=t;function d(me){c.openFile?.(a(me))}const p=te(null),m=j(()=>{const me=c.file;if(!me)return"binary";const ke=me.mime??"",_e=me.languageId??"",ue=me.path.toLowerCase();return ke==="text/markdown"||_e==="markdown"||_e==="md"||ue.endsWith(".mdx")?"markdown":ke==="application/json"||_e==="json"?"json":ke==="text/html"||_e==="html"||ue.endsWith(".html")||ue.endsWith(".htm")?"html":ke==="application/pdf"||ue.endsWith(".pdf")?"pdf":ke==="text/csv"||_e==="csv"||ue.endsWith(".csv")?"csv":ke.startsWith("image/")?"image":me.isBinary?"binary":ke.startsWith("text/")||_e!==""?"text":"binary"});function f(me){const ke=atob(me),_e=Uint8Array.from(ke,ue=>ue.charCodeAt(0));return new TextDecoder().decode(_e)}const v=j(()=>{const me=c.file;if(!me)return"";if(me.encoding==="base64")try{return f(me.content)}catch{return me.content}return me.content}),w=j(()=>{if(m.value!=="json"||!c.file)return"";try{return JSON.stringify(JSON.parse(v.value),null,2)}catch{return v.value}}),_=j(()=>c.file?(m.value==="json"?w.value:v.value).split(`
247
+ `):[]),b=j(()=>c.file?m.value==="json"?w.value:v.value:""),g=te(""),y=te(0),k=j(()=>{const me=g.value.trim().toLowerCase();if(!me)return[];const ke=[];return _.value.forEach((_e,ue)=>{_e.toLowerCase().includes(me)&&ke.push(ue+1)}),ke});Ve(g,()=>{y.value=0});function $(me,ke=!1){me&&ft(()=>{const _e=p.value?.querySelector(".fp-body"),ue=_e?.querySelector(`[data-line="${me}"]`);if(!_e||!ue)return;ke&&(_e.scrollTop=0);const z=_e.getBoundingClientRect(),X=ue.getBoundingClientRect(),fe=X.top-z.top+_e.scrollTop;_e.scrollTop=fe-_e.clientHeight/2+X.height/2})}Ve(()=>[c.file?.path,c.line],()=>$(c.line,!0),{immediate:!0});function E(me){const ke=k.value;ke.length!==0&&(y.value=(y.value+me+ke.length)%ke.length,$(ke[y.value]))}function S(me){const ke=k.value;return{target:c.line===me,hit:ke.includes(me),active:ke[y.value]===me}}function T(me){return me<1024?`${me} B`:me<1024*1024?`${(me/1024).toFixed(1)} KB`:`${(me/(1024*1024)).toFixed(1)} MB`}const I=te(!1),L=te(!1);function R(){c.file&&navigator.clipboard.writeText(b.value).then(()=>{I.value=!0,setTimeout(()=>{I.value=!1},1400)}).catch(()=>{})}function O(){c.file&&navigator.clipboard.writeText(c.file.path).then(()=>{L.value=!0,setTimeout(()=>{L.value=!1},1400)}).catch(()=>{})}const F=te("preview"),P=te("preview"),q=te("fit");Ve(m,me=>{F.value=me==="html"?"preview":"source",P.value="preview",q.value="fit"});const K=j(()=>{const me=c.file;return!me||m.value!=="image"?null:me.sourceUrl?me.sourceUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:me.mime==="image/svg+xml"?`data:${me.mime};charset=utf-8,${encodeURIComponent(me.content)}`:null}),G=j(()=>{const me=c.file;return!me||m.value!=="pdf"?null:c.downloadUrl?c.downloadUrl:me.encoding==="base64"?`data:${me.mime};base64,${me.content}`:null}),oe=j(()=>c.file?["<!doctype html>",'<meta charset="utf-8">',`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: blob:; style-src 'unsafe-inline'; font-src data:;">`,v.value].join(""):"");function J(me){const ke=[];let _e="",ue=!1;for(let z=0;z<me.length;z++){const X=me[z];X==='"'&&me[z+1]==='"'?(_e+='"',z++):X==='"'?ue=!ue:X===","&&!ue?(ke.push(_e),_e=""):_e+=X}return ke.push(_e),ke}const he=j(()=>_.value.slice(0,200).map(J));function Ne(me){return me.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function Fe(){const me=c.file;if(!me)return"";const ke=me.languageId?.toLowerCase();return ke||(me.path.split(".").pop()?.toLowerCase()??"")}function We(me){const ke=Fe();let _e=Ne(me);return m.value==="json"||ke==="json"||ke==="jsonc"?(_e=_e.replace(/(&quot;[^&]*?&quot;)(\s*:)/g,'<span class="tok-key">$1</span>$2'),_e=_e.replace(/(:\s*)(&quot;[^&]*?&quot;)/g,'$1<span class="tok-string">$2</span>'),_e=_e.replace(/\b(true|false|null)\b/g,'<span class="tok-literal">$1</span>'),_e=_e.replace(/(:\s*)(-?\d+(?:\.\d+)?)/g,'$1<span class="tok-number">$2</span>'),_e):m.value==="html"||ke==="html"||ke==="xml"||ke==="svg"?(_e=_e.replace(/\s([A-Za-z_:][-A-Za-z0-9_:.]*)(=)/g,' <span class="tok-attr">$1</span>$2'),_e=_e.replace(/(&quot;.*?&quot;)/g,'<span class="tok-string">$1</span>'),_e=_e.replace(/(&lt;\/?)([A-Za-z][\w:-]*)/g,'$1<span class="tok-tag">$2</span>'),_e):(_e=_e.replace(/\b(async|await|break|case|catch|class|const|continue|else|export|extends|finally|for|from|function|if|import|interface|let|new|return|switch|throw|try|type|while)\b/g,'<span class="tok-keyword">$1</span>'),_e=_e.replace(/(&quot;.*?&quot;|'.*?')/g,'<span class="tok-string">$1</span>'),_e=_e.replace(/(\/\/.*)$/g,'<span class="tok-comment">$1</span>'),_e)}function $e(me,ke=55){return!me||me.length<=ke?me:"…"+me.slice(me.length-ke+1)}return(me,ke)=>(C(),A("div",{ref_key:"rootRef",ref:p,class:"file-preview"},[e.error&&!e.loading?(C(),A("div",pG,[h("span",null,N(e.error),1),e.closable?(C(),A("button",{key:0,type:"button",class:"fp-action",onClick:ke[0]||(ke[0]=_e=>u("close"))},N(M(n)("filePreview.close")),1)):re("",!0)])):!e.file&&!e.loading?(C(),A("div",mG,N(M(n)("filePreview.empty")),1)):e.loading?(C(),A("div",gG,[ke[13]||(ke[13]=h("span",{class:"spinner"},null,-1)),h("span",null,N(M(n)("filePreview.loading")),1)])):e.file?(C(),A(Ie,{key:3},[h("div",vG,[h("span",yG,N(M(n)("common.preview")),1),h("span",{class:"fp-path",title:e.file.path},N($e(e.file.path)),9,kG),h("span",bG,[e.file.lineCount?(C(),A("span",_G,N(M(n)("filePreview.lineCount",{count:e.file.lineCount})),1)):re("",!0),h("span",wG,N(T(e.file.size)),1)]),m.value==="html"?(C(),A("div",{key:0,class:"fp-seg",role:"group","aria-label":M(n)("filePreview.htmlMode")},[h("button",{type:"button",class:Ee(["fp-seg-btn",{on:F.value==="preview"}]),onClick:ke[1]||(ke[1]=_e=>F.value="preview")},N(M(n)("filePreview.preview")),3),h("button",{type:"button",class:Ee(["fp-seg-btn",{on:F.value==="source"}]),onClick:ke[2]||(ke[2]=_e=>F.value="source")},N(M(n)("filePreview.source")),3)],8,SG)):re("",!0),m.value==="markdown"?(C(),A("div",{key:1,class:"fp-seg",role:"group","aria-label":M(n)("filePreview.markdownMode")},[h("button",{type:"button",class:Ee(["fp-seg-btn",{on:P.value==="preview"}]),onClick:ke[3]||(ke[3]=_e=>P.value="preview")},N(M(n)("filePreview.preview")),3),h("button",{type:"button",class:Ee(["fp-seg-btn",{on:P.value==="source"}]),onClick:ke[4]||(ke[4]=_e=>P.value="source")},N(M(n)("filePreview.source")),3)],8,CG)):re("",!0),m.value==="image"?(C(),A("div",{key:2,class:"fp-seg",role:"group","aria-label":M(n)("filePreview.imageFit")},[h("button",{type:"button",class:Ee(["fp-seg-btn",{on:q.value==="fit"}]),onClick:ke[5]||(ke[5]=_e=>q.value="fit")},N(M(n)("filePreview.fit")),3),h("button",{type:"button",class:Ee(["fp-seg-btn",{on:q.value==="actual"}]),onClick:ke[6]||(ke[6]=_e=>q.value="actual")},N(M(n)("filePreview.actual")),3)],8,xG)):re("",!0),m.value==="text"||m.value==="json"||m.value==="html"||m.value==="csv"?(C(),A("div",TG,[Et(h("input",{"onUpdate:modelValue":ke[7]||(ke[7]=_e=>g.value=_e),class:"fp-search-input",type:"search",placeholder:M(n)("filePreview.search")},null,8,MG),[[yn,g.value]]),g.value.trim()?(C(),A("span",AG,N(k.value.length),1)):re("",!0),h("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:M(n)("filePreview.prevMatch"),onClick:ke[8]||(ke[8]=_e=>E(-1))},"↑",8,EG),h("button",{type:"button",class:"fp-icon-btn",disabled:k.value.length===0,title:M(n)("filePreview.nextMatch"),onClick:ke[9]||(ke[9]=_e=>E(1))},"↓",8,IG)])):re("",!0),h("button",{type:"button",class:Ee(["fp-action fp-act-icon",{copied:L.value}]),title:L.value?M(n)("filePreview.copied"):M(n)("filePreview.copyPath"),onClick:O},[L.value?(C(),A("svg",LG,[...ke[15]||(ke[15]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),A("svg",NG,[...ke[14]||(ke[14]=[h("path",{d:"M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.2l-1 1"},null,-1),h("path",{d:"M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.2l1-1"},null,-1)])]))],10,$G),e.externalActions?(C(),A("button",{key:4,type:"button",class:"fp-action fp-act-icon",title:M(n)("filePreview.openInEditor"),onClick:ke[10]||(ke[10]=_e=>u("openExternal"))},[...ke[16]||(ke[16]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M12 8.7V12a1.5 1.5 0 0 1-1.5 1.5H4A1.5 1.5 0 0 1 2.5 12V5.5A1.5 1.5 0 0 1 4 4h3.3"}),h("path",{d:"M9.5 2.5h4v4"}),h("path",{d:"M13.5 2.5 7.5 8.5"})],-1)])],8,OG)):re("",!0),e.externalActions?(C(),A("button",{key:5,type:"button",class:"fp-action fp-act-icon",title:M(n)("filePreview.reveal"),onClick:ke[11]||(ke[11]=_e=>u("reveal"))},[...ke[17]||(ke[17]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M1.5 4.5A1.5 1.5 0 0 1 3 3h3l1.5 1.5H13A1.5 1.5 0 0 1 14.5 6v6A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12z"})],-1)])],8,RG)):re("",!0),e.downloadUrl?(C(),A("a",{key:6,class:"fp-action fp-act-icon",href:e.downloadUrl,target:"_blank",rel:"noreferrer",download:"",title:M(n)("filePreview.download")},[...ke[18]||(ke[18]=[h("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 2v8"}),h("path",{d:"M4.5 6.5 8 10l3.5-3.5"}),h("path",{d:"M2.5 13.5h11"})],-1)])],8,PG)):re("",!0),!e.file.isBinary&&m.value!=="image"?(C(),A("button",{key:7,type:"button",class:Ee(["fp-action fp-act-icon",{copied:I.value}]),title:I.value?M(n)("filePreview.copied"):M(n)("filePreview.copy"),onClick:R},[I.value?(C(),A("svg",FG,[...ke[20]||(ke[20]=[h("polyline",{points:"3,8 6.5,11.5 13,5"},null,-1)])])):(C(),A("svg",BG,[...ke[19]||(ke[19]=[h("rect",{x:"3",y:"3",width:"9",height:"9",rx:"1.5"},null,-1),h("path",{d:"M6 1h7a1 1 0 0 1 1 1v7"},null,-1)])]))],10,DG)):re("",!0),e.closable?(C(),A("button",{key:8,type:"button",class:"fp-close",title:M(n)("filePreview.close"),"aria-label":M(n)("filePreview.close"),onClick:ke[12]||(ke[12]=_e=>u("close"))}," × ",8,HG)):re("",!0)]),m.value==="markdown"?(C(),A("div",{key:0,class:Ee(["fp-body",{"fp-markdown":P.value==="preview"}])},[P.value==="preview"?(C(),je(Lf,{key:0,text:v.value,"open-file":c.openFile?d:void 0},null,8,["text","open-file"])):(C(),A("div",WG,[h("div",UG,[(C(!0),A(Ie,null,Xe(_.value,(_e,ue)=>(C(),A("div",{key:ue,class:Ee(["fp-line-row",S(ue+1)]),"data-line":ue+1},[h("span",jG,N(ue+1),1),h("span",{class:"fp-line-text",innerHTML:We(_e)},null,8,zG)],10,qG))),128))])]))],2)):m.value==="json"?(C(),A("div",VG,[h("div",KG,[(C(!0),A(Ie,null,Xe(_.value,(_e,ue)=>(C(),A("div",{key:ue,class:Ee(["fp-line-row",S(ue+1)]),"data-line":ue+1},[h("span",YG,N(ue+1),1),h("span",{class:"fp-line-text",innerHTML:We(_e)},null,8,XG)],10,GG))),128))])])):m.value==="html"?(C(),A("div",ZG,[F.value==="preview"?(C(),A("iframe",{key:0,class:"fp-html-frame",sandbox:"",srcdoc:oe.value,title:e.file.path},null,8,QG)):(C(),A("div",JG,[h("div",eY,[(C(!0),A(Ie,null,Xe(_.value,(_e,ue)=>(C(),A("div",{key:ue,class:Ee(["fp-line-row",S(ue+1)]),"data-line":ue+1},[h("span",nY,N(ue+1),1),h("span",{class:"fp-line-text",innerHTML:We(_e)},null,8,sY)],10,tY))),128))])]))])):m.value==="pdf"?(C(),A("div",oY,[G.value?(C(),A("iframe",{key:0,class:"fp-pdf-frame",src:G.value,title:e.file.path},null,8,iY)):(C(),A("div",rY,[h("span",lY,N(M(n)("filePreview.pdfNoPreview")),1)]))])):m.value==="csv"?(C(),A("div",aY,[h("table",cY,[h("tbody",null,[(C(!0),A(Ie,null,Xe(he.value,(_e,ue)=>(C(),A("tr",{key:ue,class:Ee(S(ue+1)),"data-line":ue+1},[h("th",null,N(ue+1),1),(C(!0),A(Ie,null,Xe(_e,(z,X)=>(C(),A("td",{key:X},N(z),1))),128))],10,uY))),128))])])])):m.value==="image"?(C(),A("div",dY,[K.value?(C(),A("img",{key:0,src:K.value,alt:e.file.path,class:Ee(["fp-image",{actual:q.value==="actual"}])},null,10,fY)):(C(),A("div",hY,[ke[21]||(ke[21]=h("span",{class:"fp-binary-icon"},[h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[h("rect",{x:"2",y:"2",width:"16",height:"16",rx:"2",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),h("path",{d:"M7 10h6M10 7v6",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),h("span",pY,N(M(n)("filePreview.imageNoPreview",{mime:e.file.mime,size:T(e.file.size)})),1)]))])):m.value==="text"?(C(),A("div",mY,[h("div",gY,[(C(!0),A(Ie,null,Xe(_.value,(_e,ue)=>(C(),A("div",{key:ue,class:Ee(["fp-line-row",S(ue+1)]),"data-line":ue+1},[h("span",yY,N(ue+1),1),h("span",{class:"fp-line-text",innerHTML:We(_e)},null,8,kY)],10,vY))),128))])])):(C(),A("div",bY,[h("div",_Y,[ke[22]||(ke[22]=h("span",{class:"fp-binary-icon"},[h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[h("path",{d:"M5 3h7l4 4v10H5V3z",stroke:"currentColor","stroke-width":"1.2",fill:"none"}),h("path",{d:"M12 3v4h4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})])],-1)),h("span",wY,N(M(n)("filePreview.binaryNoPreview",{mime:e.file.mime||M(n)("filePreview.unknownType"),size:T(e.file.size)})),1)])]))],64)):re("",!0)],512))}}),CY=yt(SY,[["__scopeId","data-v-adda0678"]]),xY={class:"tp"},TY={class:"tp-header"},MY={class:"tp-title"},AY={class:"tp-sub"},EY=["title","aria-label"],IY=Ze({__name:"ThinkingPanel",props:{text:{},subtitle:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),i=te(null);return Ve(()=>n.text,()=>{const r=i.value;!r||!(r.scrollHeight-r.scrollTop-r.clientHeight<24)||ft(()=>{i.value&&(i.value.scrollTop=i.value.scrollHeight)})},{immediate:!0}),(r,l)=>(C(),A("div",xY,[h("div",TY,[h("span",MY,N(M(o)("common.preview")),1),h("span",AY,N(e.subtitle??M(o)("thinking.panelTitle")),1),h("button",{type:"button",class:"tp-close",title:M(o)("thinking.close"),"aria-label":M(o)("thinking.close"),onClick:l[0]||(l[0]=a=>s("close"))},[...l[1]||(l[1]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,EY)]),h("pre",{ref_key:"bodyEl",ref:i,class:"tp-body"},N(e.text),513)]))}}),_w=yt(IY,[["__scopeId","data-v-569d52b0"]]),$Y={class:"ap"},NY={class:"ap-header"},LY={class:"ap-title"},OY={class:"ap-sub"},RY=["title","aria-label"],PY={key:0,class:"ap-type"},DY={key:1,class:"ap-reason"},BY={key:2,class:"ap-field"},FY={class:"ap-field-body"},HY={key:3,class:"ap-field"},WY={class:"ap-field-body ap-progress"},UY={key:4,class:"ap-field"},qY={class:"ap-field-body"},jY=Ze({__name:"AgentDetailPanel",props:{member:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),i=j(()=>(n.member.outputLines??[]).map(a=>a.trimEnd()).filter(a=>a.length>0));function r(a){switch(a){case"queued":return"Queued";case"working":return"Working";case"suspended":return"Suspended";case"completed":return"Completed";case"failed":return"Failed"}}const l=te(null);return Ve(()=>i.value.length,()=>{const a=l.value;!a||!(a.scrollHeight-a.scrollTop-a.clientHeight<24)||ft(()=>{l.value&&(l.value.scrollTop=l.value.scrollHeight)})},{immediate:!0}),(a,c)=>(C(),A("div",$Y,[h("div",NY,[h("span",LY,N(M(o)("common.preview")),1),h("span",OY,N(e.member.name),1),h("span",{class:Ee(["ap-phase",`phase-${e.member.phase}`])},N(r(e.member.phase)),3),h("button",{type:"button",class:"ap-close",title:M(o)("thinking.close"),"aria-label":M(o)("thinking.close"),onClick:c[0]||(c[0]=u=>s("close"))},[...c[1]||(c[1]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,RY)]),h("div",{ref_key:"bodyEl",ref:l,class:"ap-body"},[e.member.subagentType?(C(),A("div",PY,N(e.member.subagentType),1)):re("",!0),e.member.suspendedReason?(C(),A("div",DY,N(e.member.suspendedReason),1)):re("",!0),e.member.prompt?(C(),A("div",BY,[c[2]||(c[2]=h("span",{class:"ap-field-label"},"Task",-1)),h("div",FY,N(e.member.prompt),1)])):re("",!0),i.value.length>0?(C(),A("div",HY,[c[3]||(c[3]=h("span",{class:"ap-field-label"},"Progress",-1)),h("div",WY,[(C(!0),A(Ie,null,Xe(i.value,(u,d)=>(C(),A("span",{key:d},N(u),1))),128))])])):re("",!0),e.member.summary?(C(),A("div",UY,[c[4]||(c[4]=h("span",{class:"ap-field-label"},"Result",-1)),h("div",qY,N(e.member.summary),1)])):re("",!0)],512)]))}}),zY=yt(jY,[["__scopeId","data-v-1904f68b"]]),VY={class:"sc"},KY={class:"sc-header"},GY={class:"sc-title"},YY=["title"],XY=["title","aria-label"],ZY={key:0,class:"sc-empty"},QY={key:2,class:"sc-loading","aria-hidden":"true"},JY={class:"sc-composer"},eX=["placeholder"],tX=["disabled","title"],nX=Ze({__name:"SideChatPanel",props:{turns:{},running:{type:Boolean},sending:{type:Boolean},title:{},subtitle:{}},emits:["send","close"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt(),i=j(()=>n.turns.find(b=>b.role==="user")?.text?.trim()??""),r=j(()=>n.title?.trim()||o("sideChat.title")),l=j(()=>n.subtitle?.trim()?n.subtitle.trim():i.value||o("sideChat.subtitle")),a=te(""),c=te(null),u=te(null);function d(){const _=a.value.trim();_&&(s("send",_),a.value="",ft(()=>{c.value&&(c.value.style.height="auto"),p()}))}function p(){const _=u.value;_&&(_.scrollTop=_.scrollHeight)}const m=j(()=>{const _=n.turns;if(_.length===0)return"0";const b=_.at(-1),g=b.thinking?.length??0,y=b.tools?.reduce((k,$)=>k+$.name.length+($.arg?.length??0)+($.output?.join("").length??0),0)??0;return`${_.length}:${b.text.length}:${g}:${y}`});Ve(m,async()=>{!n.running&&!n.sending||(await ft(),p())});const f=j(()=>n.sending?n.turns.at(-1)?.role==="user":!1);function v(_){_.key==="Enter"&&!_.shiftKey&&!_.isComposing&&(_.preventDefault(),d())}function w(){const _=c.value;_&&(_.style.height="auto",_.style.height=`${Math.min(_.scrollHeight,160)}px`)}return(_,b)=>(C(),A("div",VY,[h("div",KY,[h("span",GY,N(r.value),1),h("span",{class:"sc-subtitle",title:l.value},N(l.value),9,YY),h("button",{type:"button",class:"sc-close",title:M(o)("thinking.close"),"aria-label":M(o)("thinking.close"),onClick:b[0]||(b[0]=g=>s("close"))},[...b[2]||(b[2]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,XY)]),h("div",{ref_key:"bodyRef",ref:u,class:"sc-body"},[e.turns.length===0?(C(),A("div",ZY,N(M(o)("sideChat.empty")),1)):(C(),je(LT,{key:1,turns:e.turns,approvals:[],running:e.running,sending:e.sending,bubble:""},null,8,["turns","running","sending"])),f.value?(C(),A("div",QY,[mt(l1)])):re("",!0)],512),h("div",JY,[Et(h("textarea",{ref_key:"inputRef",ref:c,"onUpdate:modelValue":b[1]||(b[1]=g=>a.value=g),class:"sc-input",rows:"1",placeholder:M(o)("sideChat.placeholder"),onInput:w,onKeydown:v},null,40,eX),[[yn,a.value]]),h("button",{type:"button",class:"sc-send",disabled:!a.value.trim(),title:M(o)("sideChat.send"),onClick:d},[...b[3]||(b[3]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M2 8h10"}),h("path",{d:"M8 4l4 4-4 4"})],-1)])],8,tX)])]))}}),sX=yt(nX,[["__scopeId","data-v-a4129d73"]]),oX={class:"changes-pane"},iX={class:"dv-panel-head"},rX={class:"dv-title"},lX=["title"],aX=["title","aria-label"],cX={class:"diff-head"},uX=["title"],dX={class:"back-label"},fX={key:0,class:"empty-state"},hX={key:1,class:"diff-lines"},pX={key:0,class:"hunk-text"},mX={class:"dl-gutter old"},gX={class:"dl-gutter new"},vX={class:"dl-sign"},yX={class:"dl-text"},kX={key:2,class:"empty-state"},bX={class:"dv-panel-head"},_X={class:"dv-title"},wX={class:"dv-change-count"},SX=["aria-label"],CX=["aria-pressed"],xX=["aria-pressed"],TX=["title","aria-label"],MX={class:"ch-head"},AX={class:"br-label"},EX={class:"br-name"},IX={key:0,class:"sync-info"},$X=["title"],NX=["title"],LX={key:1,class:"empty-head"},OX={key:0,class:"ch-list"},RX=["title","onClick"],PX={class:"fpath"},DX={key:1,class:"ch-list ch-tree"},BX={class:"tree-list"},FX=["onClick"],HX={class:"tree-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},WX=["d"],UX={class:"tree-name"},qX=["title","onClick"],jX={class:"tree-name"},zX={key:2,class:"empty-state"},VX={key:3,class:"empty-state"},KX=Ze({__name:"DiffView",props:{changes:{},gitInfo:{},fileDiff:{},selectedDiffPath:{},fileDiffLoading:{type:Boolean},mode:{default:"full"},hideBack:{type:Boolean,default:!1},closable:{type:Boolean,default:!0}},emits:["open","back","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t;function i(P){const q=P.toLowerCase();return q==="modified"?"modified":q==="added"?"added":q==="deleted"?"deleted":q==="renamed"?"renamed":q==="untracked"?"untracked":q==="conflicted"?"conflicted":q==="ignored"?"ignored":q==="clean"?"clean":"unknown"}const r={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"U",conflicted:"C",ignored:"I",clean:"·",unknown:"?"};function l(P){return r[i(P)]??"?"}function a(P,q=60){return P.length<=q?P:"…"+P.slice(P.length-q+1)}const c=j(()=>s.gitInfo!==null),u=j(()=>s.changes.length>0),d=j(()=>(s.selectedDiffPath??null)!==null),p=j(()=>s.mode==="detail"||s.mode==="full"&&d.value),m=j(()=>s.fileDiff??[]),f=j(()=>s.fileDiffLoading===!0);function v(P){return P.oldNo!==void 0?String(P.oldNo):""}function w(P){return P.newNo!==void 0?String(P.newNo):""}function _(P){return`dl-${P.type}`}function b(P){o("open",P)}function g(){o("back")}function y(){o("close")}const k=te("list");function $(P){k.value=P}function E(P){const q={children:[]},K=[...P].sort((G,oe)=>G.path.localeCompare(oe.path));for(const G of K){const oe=G.path.split("/");let J=q;for(let he=0;he<oe.length;he++){const Ne=oe[he],Fe=he===oe.length-1,We=oe.slice(0,he+1).join("/");let $e=J.children.find(me=>me.name===Ne&&me.kind===(Fe?"file":"folder"));$e||($e={name:Ne,path:We,kind:Fe?"file":"folder",status:Fe?G.status:void 0,children:[]},J.children.push($e)),J=$e}}return q.children}const S=j(()=>E(s.changes)),T=te(new Set);function I(P){return!T.value.has(P)}const L=j(()=>{const P=[];function q(K,G){for(const oe of K)P.push({node:oe,depth:G}),oe.kind==="folder"&&I(oe.path)&&q(oe.children,G+1)}return q(S.value,0),P});function R(P){const q=new Set(T.value);q.has(P.path)?q.delete(P.path):q.add(P.path),T.value=q}const O=P=>"M1.5 3.5h3l1.5 2h7a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1z";function F(P){return`${16+P*16}px`}return(P,q)=>(C(),A("div",oX,[p.value?(C(),A(Ie,{key:0},[h("div",iX,[h("span",rX,N(M(n)("diff.title")),1),h("span",{class:"dv-path",title:e.selectedDiffPath??""},N(a(e.selectedDiffPath??"",50)),9,lX),e.closable?(C(),A("button",{key:0,type:"button",class:"dv-close",title:M(n)("diff.close"),"aria-label":M(n)("diff.close"),onClick:y},[...q[2]||(q[2]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,aX)):re("",!0)]),h("div",cX,[e.hideBack?re("",!0):(C(),A("button",{key:0,class:"back-btn",type:"button",onClick:g,title:M(n)("diff.back")},[q[3]||(q[3]=h("span",{"aria-hidden":"true"},"←",-1)),h("span",dX,N(M(n)("diff.back")),1)],8,uX))]),f.value?(C(),A("div",fX,N(M(n)("diff.loading")),1)):m.value.length>0?(C(),A("div",hX,[(C(!0),A(Ie,null,Xe(m.value,(K,G)=>(C(),A("div",{key:G,class:Ee(["dl",_(K)])},[K.type==="hunk"?(C(),A("span",pX,N(K.text),1)):(C(),A(Ie,{key:1},[h("span",mX,N(v(K)),1),h("span",gX,N(w(K)),1),h("span",vX,N(K.type==="add"?"+":K.type==="del"?"-":" "),1),h("span",yX,N(K.text),1)],64))],2))),128))])):(C(),A("div",kX,N(M(n)("diff.noDiff")),1))],64)):(C(),A(Ie,{key:1},[h("div",bX,[h("span",_X,N(M(n)("diff.title")),1),h("span",wX,N(M(n)("diff.changeCount",{count:e.changes.length})),1),h("div",{class:"dv-toggle",role:"group","aria-label":M(n)("diff.list")+" / "+M(n)("diff.tree")},[h("button",{type:"button",class:Ee(["dv-toggle-btn",{active:k.value==="list"}]),"aria-pressed":k.value==="list",onClick:q[0]||(q[0]=K=>$("list"))},N(M(n)("diff.list")),11,CX),h("button",{type:"button",class:Ee(["dv-toggle-btn",{active:k.value==="tree"}]),"aria-pressed":k.value==="tree",onClick:q[1]||(q[1]=K=>$("tree"))},N(M(n)("diff.tree")),11,xX)],8,SX),e.closable?(C(),A("button",{key:0,type:"button",class:"dv-close",title:M(n)("diff.close"),"aria-label":M(n)("diff.close"),onClick:y},[...q[4]||(q[4]=[h("svg",{viewBox:"0 0 12 12",width:"11",height:"11",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[h("line",{x1:"2",y1:"2",x2:"10",y2:"10"}),h("line",{x1:"10",y1:"2",x2:"2",y2:"10"})],-1)])],8,TX)):re("",!0)]),h("div",MX,[c.value?(C(),A(Ie,{key:0},[h("span",AX,N(M(n)("diff.branch")),1),h("span",EX,N(e.gitInfo.branch),1),e.gitInfo.ahead>0||e.gitInfo.behind>0?(C(),A("span",IX,[e.gitInfo.ahead>0?(C(),A("span",{key:0,class:"ahead",title:M(n)("diff.aheadTitle")},"↑"+N(e.gitInfo.ahead),9,$X)):re("",!0),e.gitInfo.behind>0?(C(),A("span",{key:1,class:"behind",title:M(n)("diff.behindTitle")},"↓"+N(e.gitInfo.behind),9,NX)):re("",!0)])):re("",!0)],64)):(C(),A("span",LX,N(M(n)("diff.empty")),1))]),u.value&&k.value==="list"?(C(),A("div",OX,[(C(!0),A(Ie,null,Xe(e.changes,K=>(C(),A("button",{key:K.path,type:"button",class:"ch-row",title:K.path,onClick:G=>b(K.path)},[h("span",{class:Ee(["badge",i(K.status)])},N(l(K.status)),3),h("span",PX,N(a(K.path)),1)],8,RX))),128))])):u.value&&k.value==="tree"?(C(),A("div",DX,[h("ul",BX,[(C(!0),A(Ie,null,Xe(L.value,({node:K,depth:G})=>(C(),A("li",{key:K.path,class:"tree-node"},[K.kind==="folder"?(C(),A("button",{key:0,type:"button",class:"tree-row tree-folder",style:$t({paddingLeft:F(G)}),onClick:oe=>R(K)},[(C(),A("svg",HX,[h("path",{d:O(I(K.path))},null,8,WX)])),h("span",UX,N(K.name),1)],12,FX)):(C(),A("button",{key:1,type:"button",class:"tree-row tree-file",style:$t({paddingLeft:F(G)}),title:K.path,onClick:oe=>b(K.path)},[h("span",{class:Ee(["badge",i(K.status)])},N(l(K.status)),3),h("span",jX,N(K.name),1)],12,qX))]))),128))])])):c.value?(C(),A("div",zX,N(M(n)("diff.clean")),1)):(C(),A("div",VX,N(M(n)("diff.empty")),1))],64))]))}}),GX=yt(KX,[["__scopeId","data-v-28cd4181"]]);function Ah(e,t){let n=null;Jt(()=>{n=typeof document<"u"&&document.activeElement instanceof HTMLElement?document.activeElement:null,ft(()=>{const s=t?.value??e.value;try{s?.focus()}catch{}})}),to(()=>{const s=n;if(n=null,!(!s||typeof document>"u"||!document.contains(s)))try{s.focus()}catch{}})}const YX=["aria-label"],XX={class:"dh"},ZX={class:"dtitle"},QX=["title"],JX={class:"search-wrap"},eZ=["placeholder"],tZ=["aria-label"],nZ=["aria-selected","onClick"],sZ={key:1,class:"loading-state"},oZ={key:2,class:"unavail-state"},iZ={key:3,class:"model-list"},rZ=["aria-selected","onClick","onMouseenter"],lZ={class:"check"},aZ={key:0,viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},cZ={class:"model-main"},uZ={class:"model-name"},dZ={class:"model-id"},fZ={class:"model-provider"},hZ={class:"model-ctx"},pZ={key:0,class:"caps"},mZ=["title","onClick"],gZ={viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true"},vZ=["fill"],yZ={key:0,class:"empty"},kZ={class:"footer-hint"},bZ=Ze({__name:"ModelPicker",props:{models:{},current:{},starredIds:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["select","toggle-star","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=j(()=>new Set(s.starredIds??[]));function r(g){return i.value.has(g)}const l=te(""),a=te(null),c=te(null),u=te("all");Ah(c,a);const d=j(()=>{const g=new Set,y=[{id:"all",label:n("model.allTab")}];for(const k of s.models)g.has(k.provider)||(g.add(k.provider),y.push({id:k.provider,label:k.provider}));return y}),p=j(()=>{const g=l.value.toLowerCase().trim(),y=s.models.filter(k=>{if(u.value!=="all"&&k.provider!==u.value)return!1;const $=(k.displayName??k.model).toLowerCase().includes(g),E=k.provider.toLowerCase().includes(g),S=k.id.toLowerCase().includes(g);return!g||$||E||S});return u.value!=="all"?y:y.sort((k,$)=>{const E=r(k.id)?1:0;return(r($.id)?1:0)-E})}),m=j(()=>p.value),f=te(0);Ve([l,u],()=>{f.value=0}),Ve(d,g=>{g.some(y=>y.id===u.value)||(u.value="all")}),Ve(m,g=>{f.value=Math.min(f.value,Math.max(g.length-1,0))});function v(g){if(g.key==="Escape"){o("close");return}if(g.key==="ArrowDown")g.preventDefault(),f.value=Math.min(f.value+1,m.value.length-1);else if(g.key==="ArrowUp")g.preventDefault(),f.value=Math.max(f.value-1,0);else if(g.key==="Enter"){const y=m.value[f.value];y&&o("select",y.id)}}Jt(()=>{document.addEventListener("keydown",v)}),qt(()=>{document.removeEventListener("keydown",v)});function w(g){o("select",g)}function _(g){return m.value.indexOf(g)}function b(g){u.value=g}return(g,y)=>(C(),A("div",{class:"backdrop",onClick:y[3]||(y[3]=Ye(k=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("model.dialogLabel")},[h("div",XX,[h("span",ZX,N(M(n)("model.title")),1),h("button",{class:"close-btn",title:M(n)("model.close"),onClick:y[0]||(y[0]=k=>o("close"))},"✕",8,QX)]),h("div",JX,[Et(h("input",{ref_key:"searchRef",ref:a,"onUpdate:modelValue":y[1]||(y[1]=k=>l.value=k),class:"search-input",type:"text",placeholder:M(n)("model.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,eZ),[[yn,l.value]])]),d.value.length>1?(C(),A("div",{key:0,class:"tab-strip",role:"tablist","aria-label":M(n)("model.providerTabs")},[(C(!0),A(Ie,null,Xe(d.value,k=>(C(),A("button",{key:k.id,type:"button",class:Ee(["tab-btn",{on:k.id===u.value}]),role:"tab","aria-selected":k.id===u.value,onClick:$=>b(k.id)},N(k.label),11,nZ))),128))],8,tZ)):re("",!0),e.loading?(C(),A("div",sZ,[y[4]||(y[4]=h("svg",{class:"spin-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"8",cy:"8",r:"6","stroke-dasharray":"24 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})])],-1)),h("span",null,N(M(n)("model.loading")),1)])):e.unavailable?(C(),A("div",oZ,[y[5]||(y[5]=h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M10 2 L19 18 H1 Z"}),h("line",{x1:"10",y1:"9",x2:"10",y2:"13"}),h("circle",{cx:"10",cy:"16",r:"0.8",fill:"var(--warn)"})],-1)),h("span",null,N(M(n)("model.unavailable")),1)])):(C(),A("div",iZ,[(C(!0),A(Ie,null,Xe(m.value,k=>(C(),A("div",{key:k.id,class:Ee(["model-row",{"is-current":k.id===e.current,"is-selected":_(k)===f.value}]),role:"option","aria-selected":k.id===e.current,onClick:$=>w(k.id),onMouseenter:$=>f.value=_(k)},[h("span",lZ,[k.id===e.current?(C(),A("svg",aZ,[...y[6]||(y[6]=[h("path",{d:"M3 8.5l3.5 3.5L13 4.5"},null,-1)])])):re("",!0)]),h("span",cZ,[h("span",uZ,N(k.displayName??k.model),1),h("span",dZ,N(k.id),1)]),h("span",fZ,N(k.provider),1),h("span",hZ,N(M(n)("model.contextSuffix",{size:Math.round(k.maxContextSize/1e3)})),1),k.capabilities&&k.capabilities.length>0?(C(),A("span",pZ,N(k.capabilities.join(", ")),1)):re("",!0),h("button",{type:"button",class:Ee(["star-btn",{starred:r(k.id)}]),title:r(k.id)?M(n)("model.unstarTitle"):M(n)("model.starTitle"),onClick:Ye($=>o("toggle-star",k.id),["stop"]),onMouseenter:y[2]||(y[2]=Ye(()=>{},["stop"]))},[(C(),A("svg",gZ,[h("path",{fill:r(k.id)?"currentColor":"none",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round",d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,8,vZ)]))],42,mZ)],42,rZ))),128)),m.value.length===0&&!e.loading&&!e.unavailable?(C(),A("div",yZ,N(s.models.length===0?M(n)("model.emptyNoModels"):M(n)("model.emptyNoMatch")),1)):re("",!0)])),h("div",kZ,N(M(n)("model.footerHint")),1)],8,YX)]))}}),_Z=yt(bZ,[["__scopeId","data-v-038b94df"]]),wZ=["aria-label"],SZ={class:"dh"},CZ={class:"dtitle"},xZ=["title"],TZ={class:"prov-list"},MZ={key:0,class:"state-row"},AZ={key:1,class:"state-row unavail"},EZ={key:2,class:"empty"},IZ=["title"],$Z={key:0,width:"8",height:"8",viewBox:"0 0 8 8"},NZ=["fill"],LZ={key:1,width:"8",height:"8",viewBox:"0 0 8 8"},OZ=["fill"],RZ={key:2,width:"8",height:"8",viewBox:"0 0 8 8"},PZ={class:"prov-info"},DZ={class:"prov-type"},BZ={key:0,class:"prov-url"},FZ={class:"prov-meta"},HZ={key:0},WZ={key:0,class:"confirm-row"},UZ={class:"confirm-text"},qZ={key:1,class:"prov-actions"},jZ=["title","onClick"],zZ=["title","onClick"],VZ={key:0,class:"add-section"},KZ={key:0,class:"add-btns"},GZ={key:1,class:"add-form"},YZ={class:"form-row"},XZ={class:"flabel"},ZZ=["value"],QZ={class:"form-row"},JZ={class:"flabel"},eQ={class:"form-row"},tQ={class:"flabel"},nQ=["placeholder"],sQ={class:"form-row"},oQ={class:"flabel"},iQ=["placeholder"],rQ={key:0,class:"add-error"},lQ={class:"form-btns"},aQ={class:"footer-hint"},cQ=Ze({__name:"ProviderManager",props:{providers:{},loading:{type:Boolean},unavailable:{type:Boolean}},emits:["add","refresh","delete","openLogin","close"],setup(e,{emit:t}){const{t:n}=wt(),s=te(null);Ah(s);const o=t,i=te(null);function r(g){i.value=g}function l(){i.value&&(o("delete",i.value),i.value=null)}function a(){i.value=null}const c=te(!1),u=Vs({type:"moonshot",apiKey:"",baseUrl:"",defaultModel:""}),d=te(""),p=["moonshot","anthropic","openai","custom"];function m(){u.type="moonshot",u.apiKey="",u.baseUrl="",u.defaultModel="",d.value="",c.value=!0}function f(){c.value=!1}function v(){if(!u.apiKey.trim()){d.value=n("providers.apiKeyRequired");return}d.value="",o("add",{type:u.type,apiKey:u.apiKey.trim()||void 0,baseUrl:u.baseUrl.trim()||void 0,defaultModel:u.defaultModel.trim()||void 0}),c.value=!1}function w(g){if(g.key==="Escape"){if(c.value){f();return}if(i.value){a();return}o("close")}}Jt(()=>document.addEventListener("keydown",w)),qt(()=>document.removeEventListener("keydown",w));function _(g){return g==="connected"?"var(--ok)":g==="error"?"var(--err)":"var(--faint)"}function b(g){return n(g==="connected"?"providers.status.connected":g==="error"?"providers.status.error":"providers.status.unconfigured")}return(g,y)=>(C(),A("div",{class:"backdrop",onClick:y[7]||(y[7]=Ye(k=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("providers.dialogLabel")},[h("div",SZ,[h("span",CZ,N(M(n)("providers.title")),1),h("button",{class:"close-btn",title:M(n)("providers.close"),onClick:y[0]||(y[0]=k=>o("close"))},"✕",8,xZ)]),h("div",TZ,[e.loading?(C(),A("div",MZ,[y[8]||(y[8]=h("svg",{class:"spin-icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)),h("span",null,N(M(n)("providers.loading")),1)])):e.unavailable?(C(),A("div",AZ,[y[9]||(y[9]=h("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M8 1.5 L15.5 14.5 H0.5 Z"}),h("line",{x1:"8",y1:"7",x2:"8",y2:"10.5"}),h("circle",{cx:"8",cy:"12.5",r:"0.7",fill:"var(--warn)"})],-1)),h("span",null,N(M(n)("providers.unavailable")),1)])):e.providers.length===0?(C(),A("div",EZ,N(M(n)("providers.empty")),1)):(C(!0),A(Ie,{key:3},Xe(e.providers,k=>(C(),A("div",{key:k.id,class:"prov-row"},[h("span",{class:"status-dot",style:$t({color:_(k.status)}),title:b(k.status)},[k.status==="connected"?(C(),A("svg",$Z,[h("circle",{cx:"4",cy:"4",r:"3.5",fill:_(k.status)},null,8,NZ)])):k.status==="error"?(C(),A("svg",LZ,[h("circle",{cx:"4",cy:"4",r:"3.5",fill:_(k.status)},null,8,OZ)])):(C(),A("svg",RZ,[...y[10]||(y[10]=[h("circle",{cx:"4",cy:"4",r:"3",fill:"none",stroke:"var(--faint)","stroke-width":"1"},null,-1)])]))],12,IZ),h("div",PZ,[h("span",DZ,N(k.type),1),k.baseUrl?(C(),A("span",BZ,N(k.baseUrl),1)):re("",!0),h("span",FZ,[h("span",{class:Ee(["prov-key-state",k.hasApiKey?"has-key":"no-key"])},N(k.hasApiKey?M(n)("providers.keySet"):M(n)("providers.keyNotSet")),3),k.models&&k.models.length>0?(C(),A("span",HZ," · "+N(M(n)("providers.modelCount",{count:k.models.length})),1)):re("",!0)])]),i.value===k.id?(C(),A("div",WZ,[h("span",UZ,N(M(n)("providers.confirmDelete")),1),h("button",{class:"act-btn danger",onClick:l},N(M(n)("providers.confirm")),1),h("button",{class:"act-btn",onClick:a},N(M(n)("providers.cancel")),1)])):(C(),A("div",qZ,[h("button",{class:"act-btn",title:M(n)("providers.refreshTitle",{type:k.type}),onClick:$=>o("refresh",k.id)},N(M(n)("providers.refresh")),9,jZ),h("button",{class:"act-btn danger",title:M(n)("providers.deleteTitle",{type:k.type}),onClick:$=>r(k.id)},N(M(n)("providers.delete")),9,zZ)]))]))),128))]),e.unavailable?re("",!0):(C(),A("div",VZ,[c.value?(C(),A("div",GZ,[h("div",YZ,[h("label",XZ,N(M(n)("providers.fieldType")),1),Et(h("select",{"onUpdate:modelValue":y[3]||(y[3]=k=>u.type=k),class:"finput fselect"},[(C(),A(Ie,null,Xe(p,k=>h("option",{key:k,value:k},N(k),9,ZZ)),64))],512),[[of,u.type]])]),h("div",QZ,[h("label",JZ,N(M(n)("providers.fieldApiKey")),1),Et(h("input",{"onUpdate:modelValue":y[4]||(y[4]=k=>u.apiKey=k),class:"finput",type:"password",placeholder:"sk-…",autocomplete:"off",spellcheck:"false"},null,512),[[yn,u.apiKey]])]),h("div",eQ,[h("label",tQ,N(M(n)("providers.fieldBaseUrl")),1),Et(h("input",{"onUpdate:modelValue":y[5]||(y[5]=k=>u.baseUrl=k),class:"finput",type:"text",placeholder:M(n)("providers.baseUrlPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,nQ),[[yn,u.baseUrl]])]),h("div",sQ,[h("label",oQ,N(M(n)("providers.fieldDefaultModel")),1),Et(h("input",{"onUpdate:modelValue":y[6]||(y[6]=k=>u.defaultModel=k),class:"finput",type:"text",placeholder:M(n)("providers.optional"),autocomplete:"off",spellcheck:"false"},null,8,iQ),[[yn,u.defaultModel]])]),d.value?(C(),A("div",rQ,N(d.value),1)):re("",!0),h("div",lQ,[h("button",{class:"act-btn primary",onClick:v},N(M(n)("providers.add")),1),h("button",{class:"act-btn",onClick:f},N(M(n)("providers.cancel")),1)])])):(C(),A("div",KZ,[h("button",{class:"add-btn-oauth",onClick:y[1]||(y[1]=k=>o("openLogin","moonshot"))},[y[11]||(y[11]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("circle",{cx:"5",cy:"3",r:"2"}),h("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),ht(" "+N(M(n)("providers.loginCyberNeurova")),1)]),h("button",{class:"add-btn-oauth",onClick:y[2]||(y[2]=k=>o("openLogin","anthropic"))},[y[12]||(y[12]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("circle",{cx:"5",cy:"3",r:"2"}),h("path",{d:"M1 9c0-2.2 1.8-4 4-4s4 1.8 4 4"})],-1)),ht(" "+N(M(n)("providers.loginAnthropic")),1)]),h("button",{class:"add-btn add-btn-key",onClick:m},[y[13]||(y[13]=h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"5",y1:"1",x2:"5",y2:"9"}),h("line",{x1:"1",y1:"5",x2:"9",y2:"5"})],-1)),ht(" "+N(M(n)("providers.enterApiKey")),1)])]))])),h("div",aQ,N(M(n)("providers.escClose")),1)],8,wZ)]))}}),uQ=yt(cQ,[["__scopeId","data-v-7ddea223"]]),dQ={class:"backdrop"},fQ=["aria-label"],hQ={class:"dh"},pQ={class:"dtitle"},mQ=["title"],gQ={key:0,class:"center-body"},vQ={class:"center-text"},yQ={key:1,class:"nb"},kQ={class:"nb-lead"},bQ=["href"],_Q={class:"nb-or"},wQ={class:"nb-fallback"},SQ={class:"nb-fb-text"},CQ=["href"],xQ={class:"nb-code-row"},TQ={class:"nb-code"},MQ={class:"nb-status"},AQ=["aria-label"],EQ={class:"nb-status-text"},IQ={class:"nb-countdown"},$Q={key:2,class:"center-body"},NQ={class:"center-text success-text"},LQ={class:"center-hint"},OQ={class:"center-body"},RQ={class:"center-text err-text"},PQ={class:"center-hint"},DQ={class:"actions"},BQ={class:"center-body"},FQ={class:"center-text warn-text"},HQ={class:"center-hint"},WQ={class:"actions"},UQ=Ze({__name:"LoginDialog",props:{onStartOAuthLogin:{type:Function},onPollOAuthLogin:{type:Function},onCancelOAuthLogin:{type:Function}},emits:["success","close"],setup(e,{emit:t}){const{t:n}=wt(),s=te(null);Ah(s);const o=t,i=e,r=te("starting"),l=te(null),a=te(0),c=te(!1);let u=null,d=null;Jt(async()=>{document.addEventListener("keydown",g),await p()}),qt(()=>{document.removeEventListener("keydown",g),v()});async function p(){v(),l.value=null,r.value="starting";const k=await i.onStartOAuthLogin();if(!k){r.value="error";return}l.value={flowId:k.flowId,verificationUri:k.verificationUri,verificationUriComplete:k.verificationUriComplete,userCode:k.userCode,expiresIn:k.expiresIn,interval:k.interval},a.value=k.expiresIn,r.value="device-code",m(),f(k.interval)}function m(){d&&clearInterval(d),d=setInterval(()=>{a.value>0?a.value--:(d&&clearInterval(d),d=null)},1e3)}function f(k){u&&clearTimeout(u),u=setTimeout(async()=>{const $=await i.onPollOAuthLogin();$?.status==="authenticated"?(v(),r.value="success",setTimeout(()=>{o("success"),o("close")},1200)):$?.status==="expired"||$?.status==="cancelled"?(v(),r.value="expired"):f(k)},k*1e3)}function v(){u&&(clearTimeout(u),u=null),d&&(clearInterval(d),d=null)}async function w(){await p()}async function _(){if(l.value)try{await navigator.clipboard.writeText(l.value.userCode),c.value=!0,setTimeout(()=>{c.value=!1},2e3)}catch{}}async function b(){v(),r.value==="device-code"&&i.onCancelOAuthLogin(),o("close")}function g(k){k.key==="Escape"&&b()}function y(k){const $=Math.floor(k/60),E=k%60;return`${$}:${String(E).padStart(2,"0")}`}return(k,$)=>(C(),A("div",dQ,[h("div",{ref_key:"dialogRef",ref:s,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("login.title")},[h("div",hQ,[h("span",pQ,N(M(n)("login.title")),1),h("button",{class:"close-btn",title:M(n)("login.close"),onClick:b},[...$[0]||($[0]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,mQ)]),r.value==="starting"?(C(),A("div",gQ,[$[1]||($[1]=h("svg",{class:"spin-icon",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"11",cy:"11",r:"8","stroke-dasharray":"30 18","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 11 11",to:"360 11 11",dur:"0.9s",repeatCount:"indefinite"})])],-1)),h("span",vQ,N(M(n)("login.starting")),1)])):r.value==="device-code"&&l.value?(C(),A("div",yQ,[h("div",kQ,N(M(n)("login.lead")),1),h("a",{class:"nb-primary",href:l.value.verificationUriComplete,target:"_blank",rel:"noopener noreferrer"},[ht(N(M(n)("login.authorizeInBrowser"))+" ",1),$[2]||($[2]=h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.6"},[h("path",{d:"M6 2H2.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V8"}),h("path",{d:"M9.5 1.5h3v3M12.5 1.5 7 7"})],-1))],8,bQ),h("div",_Q,N(M(n)("login.orDivider")),1),h("div",wQ,[h("div",SQ,[ht(N(M(n)("login.fallbackPrefix")),1),h("a",{class:"nb-fb-link",href:l.value.verificationUri,target:"_blank",rel:"noopener noreferrer"},N(l.value.verificationUri),9,CQ),ht(N(M(n)("login.fallbackSuffix")),1)]),h("div",xQ,[h("span",TQ,N(l.value.userCode),1),h("button",{class:Ee(["nb-copy",{"is-copied":c.value}]),onClick:_},[c.value?(C(),A(Ie,{key:0},[$[3]||($[3]=h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2"},[h("polyline",{points:"1,6 4,9 11,2"})],-1)),ht(" "+N(M(n)("login.copied")),1)],64)):(C(),A(Ie,{key:1},[$[4]||($[4]=h("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),h("path",{d:"M8 4V2a1 1 0 0 0-1-1H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h2"})],-1)),ht(" "+N(M(n)("login.copy")),1)],64))],2)])]),h("div",MQ,[h("span",{class:"nb-spinner","aria-label":M(n)("login.waitingAuth")},[...$[5]||($[5]=[h("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",stroke:"var(--blue)","stroke-width":"1.5"},[h("circle",{cx:"7",cy:"7",r:"5","stroke-dasharray":"20 12","stroke-linecap":"round"},[h("animateTransform",{attributeName:"transform",type:"rotate",from:"0 7 7",to:"360 7 7",dur:"1s",repeatCount:"indefinite"})])],-1)])],8,AQ),h("span",EQ,N(M(n)("login.waitingAutoClose")),1),h("span",IQ,N(y(a.value)),1)])])):r.value==="success"?(C(),A("div",$Q,[$[6]||($[6]=h("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--ok)","stroke-width":"2"},[h("circle",{cx:"18",cy:"18",r:"15"}),h("polyline",{points:"10,18 15,24 26,12"})],-1)),h("span",NQ,N(M(n)("login.success")),1),h("span",LQ,N(M(n)("login.successHint")),1)])):r.value==="expired"?(C(),A(Ie,{key:3},[h("div",OQ,[$[7]||($[7]=h("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--err)","stroke-width":"1.5"},[h("circle",{cx:"14",cy:"14",r:"12"}),h("line",{x1:"14",y1:"8",x2:"14",y2:"15"}),h("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--err)"})],-1)),h("span",RQ,N(M(n)("login.expiredTitle")),1),h("span",PQ,N(M(n)("login.expiredHint")),1)]),h("div",DQ,[h("button",{class:"act-btn primary",onClick:w},N(M(n)("login.retry")),1),h("button",{class:"act-btn",onClick:b},N(M(n)("login.closeBtn")),1)])],64)):r.value==="error"?(C(),A(Ie,{key:4},[h("div",BQ,[$[8]||($[8]=h("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--warn)","stroke-width":"1.5"},[h("path",{d:"M14 3 L26 24 H2 Z"}),h("line",{x1:"14",y1:"12",x2:"14",y2:"18"}),h("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--warn)"})],-1)),h("span",FQ,N(M(n)("login.errorTitle")),1),h("span",HQ,N(M(n)("login.errorHint")),1)]),h("div",WQ,[h("button",{class:"act-btn primary",onClick:w},N(M(n)("login.retry")),1),h("button",{class:"act-btn",onClick:b},N(M(n)("login.closeBtn")),1)])],64)):re("",!0)],8,fQ)]))}}),qQ=yt(UQ,[["__scopeId","data-v-9fca324c"]]),jQ=["aria-label"],zQ={class:"dh"},VQ={class:"dtitle"},KQ=["title"],GQ={class:"form-body"},YQ={class:"form-row"},XQ={class:"flabel",for:"ns-cwd"},ZQ=["placeholder"],QQ={key:0,class:"recent-section"},JQ={class:"recent-label"},eJ={class:"recent-list"},tJ=["title","onClick"],nJ={class:"recent-path"},sJ={class:"form-row"},oJ={class:"flabel",for:"ns-title"},iJ=["placeholder"],rJ={class:"actions"},lJ=["disabled"],aJ={class:"footer-hint"},cJ=Ze({__name:"NewSessionDialog",props:{recentCwds:{}},emits:["create","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=te(""),r=te("");Ve(()=>s.recentCwds,p=>{i.value===""&&p.length>0&&(i.value=p[0])},{immediate:!0});const l=j(()=>i.value.trim()),a=j(()=>l.value.length>0);function c(){if(!a.value)return;const p={cwd:l.value},m=r.value.trim();m&&(p.title=m),o("create",p)}function u(p){i.value=p}function d(p){p.key==="Escape"?o("close"):p.key==="Enter"&&!(p.target instanceof HTMLButtonElement)&&c()}return Jt(()=>document.addEventListener("keydown",d)),qt(()=>document.removeEventListener("keydown",d)),(p,m)=>(C(),A("div",{class:"backdrop",onClick:m[4]||(m[4]=Ye(f=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("newSession.title")},[h("div",zQ,[h("span",VQ,N(M(n)("newSession.title")),1),h("button",{class:"close-btn",title:M(n)("newSession.close"),onClick:m[0]||(m[0]=f=>o("close"))},[...m[5]||(m[5]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,KQ)]),h("div",GQ,[h("div",YQ,[h("label",XQ,N(M(n)("newSession.cwdLabel")),1),Et(h("input",{id:"ns-cwd","onUpdate:modelValue":m[1]||(m[1]=f=>i.value=f),class:"finput",type:"text",placeholder:M(n)("newSession.cwdPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,ZQ),[[yn,i.value]])]),e.recentCwds.length>0?(C(),A("div",QQ,[h("div",JQ,N(M(n)("newSession.recentLabel")),1),h("div",eJ,[(C(!0),A(Ie,null,Xe(e.recentCwds,f=>(C(),A("button",{key:f,class:Ee(["recent-item",{"is-active":i.value===f}]),title:f,onClick:v=>u(f)},[m[6]||(m[6]=h("svg",{class:"dir-icon",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3",width:"9",height:"6.5",rx:"1"}),h("path",{d:"M1 4.5V3a1 1 0 0 1 1-1h2.5l1 1.5"})],-1)),h("span",nJ,N(f),1)],10,tJ))),128))])])):re("",!0),h("div",sJ,[h("label",oJ,N(M(n)("newSession.titleFieldLabel")),1),Et(h("input",{id:"ns-title","onUpdate:modelValue":m[2]||(m[2]=f=>r.value=f),class:"finput",type:"text",placeholder:M(n)("newSession.titleFieldPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,iJ),[[yn,r.value]])])]),h("div",rJ,[h("button",{class:"act-btn primary",disabled:!a.value,onClick:c},N(M(n)("newSession.create")),9,lJ),h("button",{class:"act-btn",onClick:m[3]||(m[3]=f=>o("close"))},N(M(n)("newSession.cancel")),1)]),h("div",aJ,N(M(n)("newSession.footerHint")),1)],8,jQ)]))}}),uJ=yt(cJ,[["__scopeId","data-v-d0d1f194"]]),dJ={class:"lang-switch",role:"group","aria-label":"Language"},fJ=["aria-pressed","onClick"],hJ=Ze({__name:"LanguageSwitcher",setup(e){const{locale:t}=wt();function n(s){t.value!==s&&iC(s)}return(s,o)=>(C(),A("div",dJ,[(C(!0),A(Ie,null,Xe(M(oC),i=>(C(),A("button",{key:i.code,type:"button",class:Ee(["lang-opt",{on:M(t)===i.code}]),"aria-pressed":M(t)===i.code,onClick:Ye(r=>n(i.code),["stop"])},N(i.label),11,fJ))),128))]))}}),BT=yt(hJ,[["__scopeId","data-v-48052b9d"]]),ww="cyberneurova-web.client-id",pJ="cyberneurova-cli-web",mJ="web";function gJ(){return{serverHttpUrl:yJ(),clientId:wJ(),clientName:pJ,clientVersion:SJ(),clientUiMode:mJ}}function vJ(){return typeof window<"u"&&window.location?.origin?window.location.origin:"http://127.0.0.1:58627"}function yJ(e){const t=vJ(),n=new URL(t);return n.pathname=n.pathname.replace(/\/v1\/?$/,"").replace(/\/$/,""),n.search="",n.hash="",n.toString().replace(/\/$/,"")}function kJ(e){return e.replace(/^https?:\/\//,"").replace(/\/$/,"")}function bJ(){const e=typeof window<"u"&&window.location?.origin?window.location.origin:"";return kJ(e)}function Of(e,t){return`${e}/api/v1${t.startsWith("/")?t:`/${t}`}`}function _J(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}function wJ(){const e=globalThis.localStorage?.getItem(ww);if(e)return e;const t=`web_${globalThis.crypto?.randomUUID?.()||Math.random().toString(36).slice(2)}`;return globalThis.localStorage?.setItem(ww,t),t}function SJ(){return"0.1.1".trim()?"0.1.1":"0.0.0-dev"}const Sw=1e3,qm=16384,jm=500,zm=50,CJ=6,xJ=/api[_-]?key|authorization|token|secret|password|cookie|credential/i,TJ=/^[A-Za-z0-9+/=_-]{200,}$/;let Vm=null;function ni(){if(Vm!==null)return Vm;let e=!1;try{if(typeof location<"u"){const t=new URLSearchParams(location.search).get("debug");(t==="1"||t==="true")&&(e=!0)}}catch{}if(!e)try{e=localStorage.getItem("cyberneurova-web.debug")==="1"}catch{}return Vm=e,e}const sr=[];let MJ=1;const Rv=te(0),cc=al(!1);function AJ(){return sr}function EJ(){sr.length=0,Rv.value++}function ul(e){cc.value||(sr.push({id:MJ++,ts:Date.now(),...e}),sr.length>Sw&&sr.splice(0,sr.length-Sw),Rv.value++)}function a1(e,t=0){if(e==null)return e;const n=typeof e;if(n==="number"||n==="boolean")return e;if(n==="string"){const o=e;return TJ.test(o)?`[base64-like, ${o.length} chars omitted]`:o.length>jm?`${o.slice(0,jm)}… [+${o.length-jm} chars]`:o}if(n!=="object")return String(e);if(t>=CJ)return"[max depth]";if(Array.isArray(e)){const o=e.slice(0,zm).map(i=>a1(i,t+1));return e.length>zm&&o.push(`[+${e.length-zm} more items]`),o}const s={};for(const[o,i]of Object.entries(e))s[o]=xJ.test(o)?"[redacted]":a1(i,t+1);return s}function _a(e){if(e===void 0)return;const t=a1(e);try{const n=JSON.stringify(t);if(n!==void 0&&n.length>qm)return{_truncated:`detail JSON was ${n.length} chars; first ${qm} kept`,preview:n.slice(0,qm)}}catch{return"[unserializable detail]"}return t}function Cw(e){ni()&&ul({source:"rest",kind:"rest:request",label:`→ ${e.method} ${e.path}`,method:e.method,path:e.path,requestId:e.requestId,detail:{url:e.url,body:_a(e.body)}})}function xw(e){if(!ni())return;const t=e.code!==0;ul({source:"rest",kind:t?"rest:error":"rest:response",label:`← ${e.method} ${e.path} ${e.status} code=${e.code}${t?` "${e.msg}"`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,code:e.code,durationMs:e.durationMs,detail:{envelope:{code:e.code,msg:e.msg,request_id:e.envelopeRequestId},data:_a(e.data)}})}function vd(e){ni()&&ul({source:"rest",kind:"rest:error",label:`✕ ${e.method} ${e.path} ${e.phase} error${e.status!==void 0?` (HTTP ${e.status})`:""} ${Math.round(e.durationMs)}ms`,method:e.method,path:e.path,requestId:e.requestId,status:e.status,durationMs:e.durationMs,detail:{phase:e.phase,error:String(e.error)}})}function Rl(e,t){ni()&&ul({source:"ws",kind:"ws:lifecycle",eventType:e,label:`ws ${e}`,detail:_a(t)})}function IJ(e){if(!ni())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=t.payload,o=typeof s?.session_id=="string"?s.session_id:void 0;ul({source:"ws",kind:"ws:out",eventType:n,sessionId:o,label:`→ ${n}`,detail:_a(e)})}function $J(e){if(!ni())return;const t=e??{},n=typeof t.type=="string"?t.type:"(unknown)",s=typeof t.session_id=="string"?t.session_id:typeof t.payload?.session_id=="string"?t.payload.session_id:void 0,o=typeof t.seq=="number"?t.seq:void 0,i=typeof t.offset=="number"?t.offset:void 0,r=[s,o!==void 0?`seq=${o}`:void 0,i!==void 0?`offset=${i}`:void 0,t.volatile===!0?"volatile":void 0].filter(Boolean);ul({source:"ws",kind:"ws:in",eventType:n,sessionId:s,seq:o,offset:i,label:`← ${n}${r.length>0?` (${r.join(" ")})`:""}`,detail:_a(t.payload)})}const NJ={error:"✕",warn:"⚠",info:"ℹ",debug:"·",log:"·"};function Km(e,t,n){ni()&&ul({source:"client",kind:`client:${e}`,label:`${NJ[e]} ${t}`,detail:_a(n)})}let Tw=!1;function LJ(){if(!(Tw||!ni())){Tw=!0;try{typeof window<"u"&&(window.addEventListener("error",e=>{Km("error",e.message||"window error",{source:e.filename,line:e.lineno,col:e.colno,stack:e.error instanceof Error?e.error.stack:void 0})}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;Km("error","unhandled promise rejection",{reason:t instanceof Error?`${t.name}: ${t.message}`:t,stack:t instanceof Error?t.stack:void 0})}))}catch{}for(const e of["error","warn","log","info","debug"]){const t=console[e];typeof t=="function"&&(console[e]=(...n)=>{try{Km(e,n.map(OJ).join(" "),n.length>1?n:n[0])}catch{}t.apply(console,n)})}}}function OJ(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}function FT(e=sr){if(typeof document>"u")return;const t=new Blob([RJ(e)],{type:"application/x-ndjson"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=`cyberneurova-web-log-${new Date().toISOString().replace(/[:.]/g,"-")}.jsonl`,document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(n)}function RJ(e=sr){return e.map(t=>JSON.stringify(t)).join(`
248
+ `)}const PJ=["aria-label"],DJ={class:"dh"},BJ={class:"dtitle"},FJ=["title"],HJ={class:"settings-layout"},WJ=["aria-label"],UJ=["aria-selected","aria-controls","id","onClick"],qJ={class:"body"},jJ={id:"settings-panel-general",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-general"},zJ={class:"sec"},VJ={class:"sec-title"},KJ={class:"row"},GJ={class:"rlabel"},YJ=["aria-label"],XJ=["aria-pressed"],ZJ=["aria-pressed"],QJ={class:"row"},JJ={class:"rlabel"},eee=["aria-label"],tee=["aria-pressed"],nee=["aria-pressed"],see=["aria-pressed"],oee={class:"row"},iee={class:"rlabel"},ree={class:"num-field"},lee=["value","aria-label"],aee={class:"row"},cee={class:"rlabel"},uee={class:"sec"},dee={class:"sec-title"},fee={class:"row"},hee={class:"rlabel"},pee={key:0,class:"hint"},mee=["aria-checked","disabled"],gee={class:"sec"},vee={class:"sec-title"},yee={class:"row"},kee={class:"rlabel"},bee=["title"],_ee={class:"actions"},wee={class:"sec"},See={class:"sec-title"},Cee={class:"row"},xee={class:"rlabel"},Tee={class:"rvalue mono"},Mee={id:"settings-panel-agent",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-agent"},Aee={class:"sec"},Eee={class:"sec-head"},Iee={class:"sec-title"},$ee={key:0,class:"saving"},Nee={class:"row"},Lee={class:"rlabel"},Oee={class:"hint"},Ree=["value","disabled","aria-label"],Pee={key:0,value:"",disabled:""},Dee=["label"],Bee=["value"],Fee={key:1,class:"rvalue mono"},Hee={class:"row"},Wee={class:"rlabel"},Uee={class:"hint"},qee=["aria-label"],jee=["aria-pressed","disabled","onClick"],zee={class:"row"},Vee={class:"rlabel"},Kee={class:"hint"},Gee=["aria-checked","disabled"],Yee={class:"row"},Xee={class:"rlabel"},Zee={class:"hint"},Qee=["aria-checked","disabled"],Jee={class:"row"},ete={class:"rlabel"},tte={class:"hint"},nte=["aria-checked","disabled"],ste={key:0,class:"row"},ote={class:"rlabel"},ite=["aria-checked","disabled"],rte={key:1,class:"provider-list"},lte={class:"provider-main"},ate={class:"provider-id"},cte={class:"provider-type"},ute={class:"provider-meta"},dte={key:0,class:"provider-model"},fte={key:1,class:"empty-config"},hte={id:"settings-panel-advanced",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-advanced"},pte={class:"sec"},mte={class:"sec-title"},gte={class:"row"},vte={class:"rlabel"},yte={class:"rvalue mono"},kte={class:"row"},bte={class:"rlabel"},_te={key:0,class:"hint"},wte={id:"settings-panel-experimental",class:"panel",role:"tabpanel","aria-labelledby":"settings-tab-experimental"},Ste={class:"sec"},Cte={class:"sec-title"},xte={class:"row"},Tte={class:"rlabel"},Mte={class:"hint"},Ate=["aria-checked"],Ete=Ze({__name:"SettingsDialog",props:{theme:{},colorScheme:{},uiFontSize:{},authReady:{type:Boolean},accountModel:{},notify:{type:Boolean},notifyPermission:{},betaToc:{type:Boolean},config:{},models:{},configSaving:{type:Boolean},serverVersion:{}},emits:["setTheme","setColorScheme","setUiFontSize","setNotify","setBetaToc","login","logout","openOnboarding","updateConfig","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=te("general"),r=[{id:"general",labelKey:"settings.tabs.general"},{id:"agent",labelKey:"settings.tabs.agent"},{id:"advanced",labelKey:"settings.tabs.advanced"},{id:"experimental",labelKey:"settings.tabs.experimental"}],l=bJ(),a=["manual","auto","yolo"],c=te(null);Ah(c);function u(E){E.key==="Escape"&&o("close")}Jt(()=>document.addEventListener("keydown",u)),qt(()=>document.removeEventListener("keydown",u));function d(){FT()}const p=j(()=>{const E=new Map;for(const S of s.models??[])E.set(S.id,{id:S.id,label:S.displayName??S.model??S.id,provider:S.provider});for(const[S,T]of Object.entries(s.config?.models??{})){if(E.has(S))continue;const I=w(T);E.set(S,{id:S,label:_(S,T,I),provider:I??S})}return Array.from(E.values())}),m=j(()=>{const E=new Map;for(const S of p.value){const T=E.get(S.provider)??[];T.push(S),E.set(S.provider,T)}for(const S of E.values())S.sort((T,I)=>T.label.localeCompare(I.label));return Array.from(E.entries()).toSorted(([S],[T])=>S.localeCompare(T)).map(([S,T])=>({provider:S,options:T}))}),f=j(()=>Object.entries(s.config?.providers??{}).map(([E,S])=>({id:E,provider:S})).sort((E,S)=>E.id.localeCompare(S.id))),v=j(()=>{const E=s.config?.defaultPermissionMode;return E==="auto"||E==="yolo"||E==="manual"?E:"manual"});function w(E){if(!E||typeof E!="object")return;const S=E;return typeof S.provider=="string"?S.provider:void 0}function _(E,S,T){if(!S||typeof S!="object")return E;const I=S,L=typeof I.model=="string"?I.model:void 0,R=T??w(S);return L&&R?`${E} (${R}/${L})`:L?`${E} (${L})`:E}function b(E){return E===!0}function g(E){const S=E.target.value;!S||S===s.config?.defaultModel||o("updateConfig",{defaultModel:S})}function y(E){E!==v.value&&o("updateConfig",{defaultPermissionMode:E})}function k(E){const S=s.config?.[E];o("updateConfig",{[E]:!b(S)})}function $(E){i.value=E}return(E,S)=>(C(),A("div",{class:"backdrop",onClick:S[16]||(S[16]=Ye(T=>o("close"),["self"]))},[h("div",{ref_key:"dialogRef",ref:c,class:"dialog",role:"dialog","aria-modal":"true",tabindex:"-1","aria-label":M(n)("settings.title")},[h("div",DJ,[h("span",BJ,N(M(n)("settings.title")),1),h("button",{class:"close-btn",title:M(n)("newSession.close"),onClick:S[0]||(S[0]=T=>o("close"))},[...S[17]||(S[17]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,FJ)]),h("div",HJ,[h("nav",{class:"settings-tabs",role:"tablist","aria-label":M(n)("settings.title")},[(C(),A(Ie,null,Xe(r,T=>h("button",{key:T.id,type:"button",class:Ee(["tab",{on:i.value===T.id}]),role:"tab","aria-selected":i.value===T.id,"aria-controls":`settings-panel-${T.id}`,id:`settings-tab-${T.id}`,onClick:I=>$(T.id)},N(M(n)(T.labelKey)),11,UJ)),64))],8,WJ),h("div",qJ,[Et(h("section",jJ,[h("section",zJ,[h("h3",VJ,N(M(n)("settings.appearance")),1),h("div",KJ,[h("span",GJ,N(M(n)("theme.label")),1),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.label")},[h("button",{type:"button",class:Ee(["opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:S[1]||(S[1]=T=>o("setTheme","modern"))},N(M(n)("theme.modern")),11,XJ),h("button",{type:"button",class:Ee(["opt",{on:e.theme==="cyberneurova"}]),"aria-pressed":e.theme==="cyberneurova",onClick:S[2]||(S[2]=T=>o("setTheme","cyberneurova"))},N(M(n)("theme.cyberneurova")),11,ZJ)],8,YJ)]),h("div",QJ,[h("span",JJ,N(M(n)("theme.colorSchemeLabel")),1),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.colorSchemeLabel")},[h("button",{type:"button",class:Ee(["opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:S[3]||(S[3]=T=>o("setColorScheme","light"))},N(M(n)("theme.light")),11,tee),h("button",{type:"button",class:Ee(["opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:S[4]||(S[4]=T=>o("setColorScheme","dark"))},N(M(n)("theme.dark")),11,nee),h("button",{type:"button",class:Ee(["opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:S[5]||(S[5]=T=>o("setColorScheme","system"))},N(M(n)("theme.system")),11,see)],8,eee)]),h("div",oee,[h("span",iee,N(M(n)("settings.uiFontSize")),1),h("label",ree,[h("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":M(n)("settings.uiFontSize"),onInput:S[6]||(S[6]=T=>o("setUiFontSize",Number(T.target.value)))},null,40,lee),S[18]||(S[18]=h("span",{class:"num-unit"},"px",-1))])]),h("div",aee,[h("span",cee,N(M(n)("sidebar.language")),1),mt(BT)])]),h("section",uee,[h("h3",dee,N(M(n)("settings.notifications")),1),h("div",fee,[h("span",hee,[ht(N(M(n)("settings.notifyOnComplete"))+" ",1),e.notifyPermission==="denied"?(C(),A("span",pee,N(M(n)("settings.notifyDenied")),1)):re("",!0)]),h("button",{type:"button",class:Ee(["switch",{on:e.notify}]),role:"switch","aria-checked":e.notify,disabled:e.notifyPermission==="denied",onClick:S[7]||(S[7]=T=>o("setNotify",!e.notify))},[...S[19]||(S[19]=[h("span",{class:"knob"},null,-1)])],10,mee)])]),h("section",gee,[h("h3",vee,N(M(n)("settings.account")),1),h("div",yee,[h("span",kee,N(e.authReady?"managed:cyberneurova-cli":M(n)("sidebar.notSignedIn")),1),e.authReady&&e.accountModel?(C(),A("span",{key:0,class:"rvalue",title:e.accountModel},N(e.accountModel),9,bee)):re("",!0)]),h("div",_ee,[h("button",{type:"button",class:"act",onClick:S[8]||(S[8]=T=>{o("openOnboarding"),o("close")})},N(M(n)("onboarding.reopen")),1),e.authReady?(C(),A("button",{key:0,type:"button",class:"act danger",onClick:S[9]||(S[9]=T=>o("logout"))},N(M(n)("sidebar.signOut")),1)):(C(),A("button",{key:1,type:"button",class:"act signin",onClick:S[10]||(S[10]=T=>o("login"))},N(M(n)("sidebar.signIn")),1))])]),h("section",wee,[h("h3",See,N(M(n)("settings.build")),1),h("div",Cee,[h("span",xee,N(M(n)("settings.serverVersion")),1),h("span",Tee,N(e.serverVersion||"-"),1)])])],512),[[No,i.value==="general"]]),Et(h("section",Mee,[h("section",Aee,[h("div",Eee,[h("h3",Iee,N(M(n)("settings.agentDefaults")),1),e.configSaving?(C(),A("span",$ee,N(M(n)("settings.saving")),1)):re("",!0)]),e.config?(C(),A(Ie,{key:0},[h("div",Nee,[h("span",Lee,[ht(N(M(n)("settings.defaultModel"))+" ",1),h("span",Oee,N(M(n)("settings.defaultModelHint")),1)]),m.value.length>0?(C(),A("select",{key:0,class:"select-field",value:e.config.defaultModel??"",disabled:e.configSaving,"aria-label":M(n)("settings.defaultModel"),onChange:g},[e.config.defaultModel?re("",!0):(C(),A("option",Pee,N(M(n)("settings.noDefaultModel")),1)),(C(!0),A(Ie,null,Xe(m.value,T=>(C(),A("optgroup",{key:T.provider,label:T.provider},[(C(!0),A(Ie,null,Xe(T.options,I=>(C(),A("option",{key:I.id,value:I.id},N(I.label),9,Bee))),128))],8,Dee))),128))],40,Ree)):(C(),A("span",Fee,N(e.config.defaultModel??M(n)("settings.noDefaultModel")),1))]),h("div",Hee,[h("span",Wee,[ht(N(M(n)("settings.defaultPermission"))+" ",1),h("span",Uee,N(M(n)("settings.defaultPermissionHint")),1)]),h("div",{class:"seg",role:"group","aria-label":M(n)("settings.defaultPermission")},[(C(),A(Ie,null,Xe(a,T=>h("button",{key:T,type:"button",class:Ee(["opt",{on:v.value===T}]),"aria-pressed":v.value===T,disabled:e.configSaving,onClick:I=>y(T)},N(M(n)(`settings.permission.${T}`)),11,jee)),64))],8,qee)]),h("div",zee,[h("span",Vee,[ht(N(M(n)("settings.defaultThinking"))+" ",1),h("span",Kee,N(M(n)("settings.defaultThinkingHint")),1)]),h("button",{type:"button",class:Ee(["switch",{on:b(e.config.defaultThinking)}]),role:"switch","aria-checked":b(e.config.defaultThinking),disabled:e.configSaving,onClick:S[11]||(S[11]=T=>k("defaultThinking"))},[...S[20]||(S[20]=[h("span",{class:"knob"},null,-1)])],10,Gee)]),h("div",Yee,[h("span",Xee,[ht(N(M(n)("settings.defaultPlanMode"))+" ",1),h("span",Zee,N(M(n)("settings.defaultPlanModeHint")),1)]),h("button",{type:"button",class:Ee(["switch",{on:b(e.config.defaultPlanMode)}]),role:"switch","aria-checked":b(e.config.defaultPlanMode),disabled:e.configSaving,onClick:S[12]||(S[12]=T=>k("defaultPlanMode"))},[...S[21]||(S[21]=[h("span",{class:"knob"},null,-1)])],10,Qee)]),h("div",Jee,[h("span",ete,[ht(N(M(n)("settings.mergeSkills"))+" ",1),h("span",tte,N(M(n)("settings.mergeSkillsHint")),1)]),h("button",{type:"button",class:Ee(["switch",{on:b(e.config.mergeAllAvailableSkills)}]),role:"switch","aria-checked":b(e.config.mergeAllAvailableSkills),disabled:e.configSaving,onClick:S[13]||(S[13]=T=>k("mergeAllAvailableSkills"))},[...S[22]||(S[22]=[h("span",{class:"knob"},null,-1)])],10,nte)]),e.config.telemetry!==void 0?(C(),A("div",ste,[h("span",ote,N(M(n)("settings.telemetry")),1),h("button",{type:"button",class:Ee(["switch",{on:b(e.config.telemetry)}]),role:"switch","aria-checked":b(e.config.telemetry),disabled:e.configSaving,onClick:S[14]||(S[14]=T=>k("telemetry"))},[...S[23]||(S[23]=[h("span",{class:"knob"},null,-1)])],10,ite)])):re("",!0),f.value.length>0?(C(),A("div",rte,[(C(!0),A(Ie,null,Xe(f.value,({id:T,provider:I})=>(C(),A("div",{key:T,class:"provider-row"},[h("div",lte,[h("span",ate,N(T),1),h("span",cte,N(I.type),1)]),h("div",ute,[h("span",{class:Ee(["provider-badge",I.hasApiKey?"ok":"warn"])},N(I.hasApiKey?M(n)("settings.credentialReady"):M(n)("settings.credentialMissing")),3),I.defaultModel?(C(),A("span",dte,N(I.defaultModel),1)):re("",!0)])]))),128))])):re("",!0)],64)):(C(),A("div",fte,N(M(n)("settings.configUnavailable")),1))])],512),[[No,i.value==="agent"]]),Et(h("section",hte,[h("section",pte,[h("h3",mte,N(M(n)("settings.advanced")),1),h("div",gte,[h("span",vte,N(M(n)("sidebar.daemon")),1),h("span",yte,N(M(l)),1)]),h("div",kte,[h("span",bte,[ht(N(M(n)("settings.exportLog"))+" ",1),M(ni)()?re("",!0):(C(),A("span",_te,N(M(n)("settings.logHint")),1))]),h("button",{type:"button",class:"act",onClick:d},N(M(n)("settings.exportLogBtn")),1)])])],512),[[No,i.value==="advanced"]]),Et(h("section",wte,[h("section",Ste,[h("h3",Cte,N(M(n)("settings.beta")),1),h("div",xte,[h("span",Tte,[ht(N(M(n)("settings.betaToc"))+" ",1),h("span",Mte,N(M(n)("settings.betaTocHint")),1)]),h("button",{type:"button",class:Ee(["switch",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc,onClick:S[15]||(S[15]=T=>o("setBetaToc",!e.betaToc))},[...S[24]||(S[24]=[h("span",{class:"knob"},null,-1)])],10,Ate)])])],512),[[No,i.value==="experimental"]])])])],8,PJ)]))}}),Ite=yt(Ete,[["__scopeId","data-v-c641cd18"]]),$te=["aria-label"],Nte={class:"dh"},Lte={class:"dtitle"},Ote={class:"count"},Rte=["aria-label","title"],Pte={class:"search-wrap"},Dte=["placeholder"],Bte={class:"session-list"},Fte=["aria-selected","onClick","onMouseenter"],Hte={class:"meta"},Wte={class:"title"},Ute={class:"sub"},qte={class:"ws"},jte={class:"time"},zte={key:0,class:"attn-badge"},Vte={key:0,class:"empty"},Kte={class:"footer-hint"},Gte=Ze({__name:"SessionsDialog",props:{sessions:{},workspaceGroups:{},attentionBySession:{},activeId:{}},emits:["select","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=j(()=>{const f={};for(const v of s.workspaceGroups)for(const w of v.sessions)f[w.id]=v.workspace.name;return f}),r=te(""),l=te(null),a=j(()=>{const f=r.value.toLowerCase().trim();return f?s.sessions.filter(v=>v.title.toLowerCase().includes(f)):s.sessions}),c=te(0);Ve(r,()=>{c.value=0});function u(f){o("select",f)}function d(f){return s.attentionBySession[f]??0}function p(f){return d(f.id)>0||f.status==="awaitingApproval"||f.status==="awaitingQuestion"?"attn":f.busy?"run":f.status==="aborted"?"aborted":"idle"}function m(f){if(f.key==="Escape"){o("close");return}if(f.key==="ArrowDown")f.preventDefault(),c.value=Math.min(c.value+1,a.value.length-1);else if(f.key==="ArrowUp")f.preventDefault(),c.value=Math.max(c.value-1,0);else if(f.key==="Enter"){const v=a.value[c.value];v&&u(v.id)}}return Jt(()=>{document.addEventListener("keydown",m),ft(()=>l.value?.focus())}),qt(()=>{document.removeEventListener("keydown",m)}),(f,v)=>(C(),A("div",{class:"backdrop",onClick:v[2]||(v[2]=Ye(w=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("sessions.title")},[h("div",Nte,[h("span",Lte,N(M(n)("sessions.title")),1),h("span",Ote,N(e.sessions.length),1),h("button",{class:"close-btn","aria-label":M(n)("sessions.close"),title:M(n)("sessions.close"),onClick:v[0]||(v[0]=w=>o("close"))},[...v[3]||(v[3]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Rte)]),h("div",Pte,[Et(h("input",{ref_key:"searchRef",ref:l,"onUpdate:modelValue":v[1]||(v[1]=w=>r.value=w),class:"search-input",type:"text",placeholder:M(n)("sessions.searchPlaceholder"),autocomplete:"off",spellcheck:"false"},null,8,Dte),[[yn,r.value]])]),h("div",Bte,[(C(!0),A(Ie,null,Xe(a.value,(w,_)=>(C(),A("div",{key:w.id,class:Ee(["session-row",{"is-active":w.id===e.activeId,"is-selected":_===c.value}]),role:"option","aria-selected":w.id===e.activeId,onClick:b=>u(w.id),onMouseenter:b=>c.value=_},[h("span",{class:Ee(["dot",p(w)])},null,2),h("div",Hte,[h("span",Wte,N(w.title),1),h("span",Ute,[h("span",qte,N(i.value[w.id]??M(n)("sessions.noWorkspace")),1),v[4]||(v[4]=h("span",{class:"sep"},"·",-1)),h("span",jte,N(w.time),1)])]),d(w.id)>0?(C(),A("span",zte,N(d(w.id)),1)):re("",!0)],42,Fte))),128)),a.value.length===0?(C(),A("div",Vte,N(e.sessions.length===0?M(n)("sessions.emptyNone"):M(n)("sessions.emptyNoMatch")),1)):re("",!0)]),h("div",Kte,N(M(n)("sessions.footerHint")),1)],8,$te)]))}}),Yte=yt(Gte,[["__scopeId","data-v-6eaa2ced"]]),Xte=["aria-label"],Zte={class:"dh"},Qte={class:"dtitle"},Jte=["aria-label"],ene={class:"crumbbar"},tne=["disabled","title","aria-label"],nne={class:"crumbs"},sne={key:0,class:"crumb-sep"},one=["onClick"],ine={key:0,class:"filterbar"},rne=["placeholder"],lne={key:0,class:"search-spin","aria-hidden":"true"},ane={class:"folder-list"},cne={key:0,class:"fl-loading"},une=["onClick"],dne={class:"folder-name search-rel"},fne={key:0,class:"git-tag"},hne={key:0,class:"git-branch"},pne={key:0,class:"fl-empty"},mne={key:1,class:"fl-loading"},gne=["onClick"],vne={class:"folder-name"},yne={key:0,class:"git-tag"},kne={key:0,class:"git-branch"},bne={key:0,class:"fl-empty"},_ne={class:"paste-label",for:"aw-path"},wne=["placeholder","onKeydown"],Sne=["disabled","title"],Cne={class:"actions"},xne=["disabled","title"],Tne={class:"footer-hint"},Mne=600,Ane=6,Mw=150,Ene=Ze({__name:"AddWorkspaceDialog",props:{browseFs:{type:Function},getFsHome:{type:Function},defaultPath:{}},emits:["add","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=te(!1),r=te(!1),l=te(""),a=te(null),c=te([]),u=te(""),d=te(!1),p=te([]),m=j(()=>u.value.trim().length>0);let f=0,v=null;function w(O,F){const P=O.toLowerCase(),q=F.toLowerCase();let K=0;for(let G=0;G<q.length&&K<P.length;G++)q[G]===P[K]&&K++;return K===P.length}async function _(O){const F=l.value,P=O.trim();if(!F||P===""){p.value=[],d.value=!1;return}const q=++f;d.value=!0;const K=[],G=[{path:F,depth:0}];let oe=0;for(;G.length>0&&oe<Mne&&K.length<Mw;){if(q!==f)return;const J=G.shift();oe++;let he;try{he=await s.browseFs(J.path)}catch{continue}if(q!==f)return;for(const Ne of he.entries){if(!Ne.isDir)continue;const Fe=Ne.path.startsWith(F)?Ne.path.slice(F.length).replace(/^\/+/,""):Ne.path;if(w(P,Fe||Ne.name)&&(K.push({path:Ne.path,name:Ne.name,rel:Fe||Ne.name,isGitRepo:Ne.isGitRepo,branch:Ne.branch}),K.length>=Mw))break;J.depth+1<Ane&&G.push({path:Ne.path,depth:J.depth+1})}q===f&&(p.value=[...K])}q===f&&(d.value=!1)}Ve(u,O=>{if(v&&clearTimeout(v),O.trim()===""){f++,p.value=[],d.value=!1;return}v=setTimeout(()=>void _(O),220)});const b=te(!1),g=te(""),y=j(()=>g.value.trim()),k=j(()=>{const O=l.value;if(!O)return[];const F=O.split("/").filter(Boolean),P=[{label:"/",path:"/"}];let q="";for(const K of F)q+=`/${K}`,P.push({label:K,path:q});return P}),$=j(()=>l.value.length>0);async function E(O){i.value=!0;try{const F=await s.browseFs(O);if(!F.path){r.value=!0;return}l.value=F.path,a.value=F.parent,c.value=F.entries,u.value="",r.value=!1}catch{r.value=!0}finally{i.value=!1}}function S(O){O.isDir&&E(O.path)}function T(){a.value&&E(a.value)}function I(){$.value&&o("add",l.value)}function L(){y.value.length!==0&&o("add",y.value)}Jt(async()=>{i.value=!0;try{if(s.defaultPath&&(await E(s.defaultPath),!r.value))return;const O=await s.getFsHome();O.home?await E(O.home):r.value=!0}catch{r.value=!0}finally{i.value=!1}});function R(O){O.key==="Escape"&&o("close")}return Jt(()=>document.addEventListener("keydown",R)),qt(()=>{document.removeEventListener("keydown",R),v&&clearTimeout(v)}),(O,F)=>(C(),A("div",{class:"backdrop",onClick:F[6]||(F[6]=Ye(P=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("workspace.addTitle")},[h("div",Zte,[h("span",Qte,N(M(n)("workspace.addTitle")),1),h("button",{class:"close-btn","aria-label":M(n)("workspace.cancel"),onClick:F[0]||(F[0]=P=>o("close"))},[...F[7]||(F[7]=[h("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[h("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),h("line",{x1:"9",y1:"1",x2:"1",y2:"9"})],-1)])],8,Jte)]),r.value?re("",!0):(C(),A(Ie,{key:0},[h("div",ene,[h("button",{class:"up-btn",disabled:!a.value,title:M(n)("workspace.up"),"aria-label":M(n)("workspace.up"),onClick:T},[...F[8]||(F[8]=[h("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[h("path",{d:"M8 12V4M4 7l4-3 4 3"})],-1)])],8,tne),h("div",nne,[(C(!0),A(Ie,null,Xe(k.value,(P,q)=>(C(),A(Ie,{key:P.path},[q>1?(C(),A("span",sne,"/")):re("",!0),h("button",{class:Ee(["crumb",{last:q===k.value.length-1}]),onClick:K=>E(P.path)},N(P.label),11,one)],64))),128))])]),i.value?re("",!0):(C(),A("div",ine,[F[9]||(F[9]=h("svg",{class:"filter-icon",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("circle",{cx:"7",cy:"7",r:"4.5"}),h("path",{d:"M11 11l3 3"})],-1)),Et(h("input",{"onUpdate:modelValue":F[1]||(F[1]=P=>u.value=P),class:"filter-input",type:"text",placeholder:M(n)("workspace.searchPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:F[2]||(F[2]=Ye(()=>{},["stop"]))},null,40,rne),[[yn,u.value]]),d.value?(C(),A("span",lne)):re("",!0)])),h("div",ane,[i.value?(C(),A("div",cne,N(M(n)("workspace.browsing")),1)):m.value?(C(),A(Ie,{key:1},[(C(!0),A(Ie,null,Xe(p.value,P=>(C(),A("button",{key:P.path,class:"folder-row",onClick:q=>E(P.path)},[F[10]||(F[10]=h("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),h("span",dne,N(P.rel),1),P.isGitRepo?(C(),A("span",fne,[ht(N(M(n)("workspace.gitTag")),1),P.branch?(C(),A("span",hne,N(P.branch),1)):re("",!0)])):re("",!0)],8,une))),128)),!d.value&&p.value.length===0?(C(),A("div",pne,N(M(n)("workspace.noFilterMatch",{q:u.value.trim()})),1)):d.value&&p.value.length===0?(C(),A("div",mne,N(M(n)("workspace.searching")),1)):re("",!0)],64)):(C(),A(Ie,{key:2},[(C(!0),A(Ie,null,Xe(c.value,P=>(C(),A("button",{key:P.path,class:"folder-row",onClick:q=>S(P)},[F[11]||(F[11]=h("svg",{class:"dir-icon",width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2"},[h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"}),h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"})],-1)),h("span",vne,N(P.name),1),P.isGitRepo?(C(),A("span",yne,[ht(N(M(n)("workspace.gitTag")),1),P.branch?(C(),A("span",kne,N(P.branch),1)):re("",!0)])):re("",!0)],8,gne))),128)),c.value.length===0?(C(),A("div",bne,N(M(n)("workspace.noSubfolders")),1)):re("",!0)],64))])],64)),h("div",{class:Ee(["paste-section",{"paste-only":r.value}])},[!r.value&&!b.value?(C(),A("button",{key:0,type:"button",class:"paste-toggle",onClick:F[3]||(F[3]=P=>b.value=!0)},N(M(n)("workspace.pasteToggle")),1)):(C(),A(Ie,{key:1},[h("label",_ne,N(M(n)("workspace.pathLabel")),1),Et(h("input",{id:"aw-path","onUpdate:modelValue":F[4]||(F[4]=P=>g.value=P),class:"paste-input",type:"text",placeholder:M(n)("workspace.pathPlaceholder"),autocomplete:"off",spellcheck:"false",onKeydown:_o(Ye(L,["stop"]),["enter"])},null,40,wne),[[yn,g.value]]),h("button",{class:"paste-add",disabled:y.value.length===0,title:M(n)("workspace.add"),onClick:L},[...F[12]||(F[12]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M8 3v10M3 8h10"})],-1)])],8,Sne)],64))],2),h("div",Cne,[r.value?re("",!0):(C(),A("button",{key:0,class:"act-btn primary",disabled:!$.value,title:l.value,onClick:I},N(M(n)("workspace.openThisFolder")),9,xne)),h("button",{class:"act-btn",onClick:F[5]||(F[5]=P=>o("close"))},N(M(n)("workspace.cancel")),1)]),h("div",Tne,N(M(n)("workspace.browseHint")),1)],8,Xte)]))}}),Ine=yt(Ene,[["__scopeId","data-v-0b1c4848"]]),$ne=["aria-label"],Nne={class:"dh"},Lne={class:"dtitle"},One=["title"],Rne={class:"rows"},Pne={class:"row"},Dne={class:"row"},Bne={class:"row"},Fne={class:"row"},Hne={class:"row"},Wne={class:"row"},Une={class:"ctx-text"},qne={key:0,class:"bar"},jne={class:"row"},zne=Ze({__name:"StatusPanel",props:{status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},costUsd:{}},emits:["close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=j(()=>s.status.ctxMax>0?Math.round(s.status.ctxUsed/s.status.ctxMax*100):0),r=j(()=>s.status.ctxMax>0?n("status.statusContextValue",{used:s.status.ctxUsed.toLocaleString(),max:s.status.ctxMax.toLocaleString(),pct:i.value}):n("status.statusNone"));function l(f){return n(f==="yolo"?"status.permissionYolo":f==="auto"?"status.permissionAuto":"status.permissionManual")}const a=j(()=>{const f=s.status.permission;return f==="yolo"?"var(--err)":f==="auto"?"var(--warn)":"var(--ink)"}),c=j(()=>s.planMode?n("status.planOn"):n("status.planOff")),u=j(()=>s.swarmMode?n("status.swarmOn"):n("status.swarmOff")),d=j(()=>typeof s.costUsd=="number"&&s.costUsd>0),p=j(()=>d.value?`$${s.costUsd.toFixed(4)}`:n("status.statusNone"));function m(f){f.key==="Escape"&&o("close")}return Jt(()=>document.addEventListener("keydown",m)),qt(()=>document.removeEventListener("keydown",m)),(f,v)=>(C(),A("div",{class:"backdrop",onClick:v[1]||(v[1]=Ye(w=>o("close"),["self"]))},[h("div",{class:"dialog",role:"dialog","aria-label":M(n)("status.statusPanelTitle")},[h("div",Nne,[h("span",Lne,N(M(n)("status.statusPanelTitle")),1),h("button",{class:"close-btn",title:M(n)("status.statusPanelClose"),onClick:v[0]||(v[0]=w=>o("close"))},"✕",8,One)]),h("dl",Rne,[h("div",Pne,[h("dt",null,N(M(n)("status.statusModel")),1),h("dd",null,N(e.status.model),1)]),h("div",Dne,[h("dt",null,N(M(n)("status.statusThinking")),1),h("dd",null,N(e.thinking),1)]),h("div",Bne,[h("dt",null,N(M(n)("status.statusPermission")),1),h("dd",{style:$t({color:a.value})},N(l(e.status.permission)),5)]),h("div",Fne,[h("dt",null,N(M(n)("status.statusPlanMode")),1),h("dd",{class:Ee({"plan-on":e.planMode})},N(c.value),3)]),h("div",Hne,[h("dt",null,N(M(n)("status.statusSwarmMode")),1),h("dd",{class:Ee({"swarm-on":e.swarmMode})},N(u.value),3)]),h("div",Wne,[h("dt",null,N(M(n)("status.statusContext")),1),h("dd",null,[h("span",Une,N(r.value),1),e.status.ctxMax>0?(C(),A("span",qne,[h("i",{style:$t({width:i.value+"%"})},null,4)])):re("",!0)])]),h("div",jne,[h("dt",null,N(M(n)("status.statusCost")),1),h("dd",null,N(p.value),1)])])],8,$ne)]))}}),Vne=yt(zne,[["__scopeId","data-v-cb15f7ae"]]),Kne={key:0,class:"toasts",role:"status","aria-live":"polite"},Gne=["onPointerenter","onPointerleave"],Yne={class:"body"},Xne={class:"title"},Zne={key:0,class:"msg"},Qne={key:1,class:"actions"},Jne=["onClick"],ese=["onClick"],tse={key:2,class:"details"},nse=["aria-label","onClick"],sse=Ze({__name:"WarningToasts",props:{warnings:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,s=t,{t:o}=wt();function i(S){return typeof S=="object"&&S!==null}function r(S){return i(S)?S.title:S}function l(S){return i(S)?S.message??"":""}function a(S){return i(S)?S.details:void 0}function c(S){return i(S)?S.severity==="error":S.startsWith(`${o("warnings.errorLabel")}:`)||/\b4\d\d\b|error|失败|failed/i.test(S)}function u(S){return i(S)?`notice:${S.severity}:${S.title}:${S.message??""}:${JSON.stringify(S.details??[])}`:`text:${S}`}function d(S){if(!i(S))return S;const T=[S.title];S.message&&T.push(S.message);const I=S.details??[];if(I.length>0){T.push("",`${o("warnings.diagnostics")}:`);for(const L of I)T.push(`${L.label}: ${L.value}`)}return T.join(`
249
+ `)}let p=1;const m=te([]),f=new Map,v=new Map;function w(S){const T=c(S)?12e3:6e3;return typeof window<"u"&&window.matchMedia?.("(hover: none)").matches===!0?T+5e3:T}function _(S,T){const I=f.get(S)??{handle:null,deadline:0,remaining:0};I.handle=setTimeout(()=>E(S),T),I.deadline=Date.now()+T,f.set(S,I)}function b(S){const T=f.get(S);T&&T.handle!==null&&clearTimeout(T.handle),f.delete(S)}function g(S){const T=f.get(S);!T||T.handle===null||(clearTimeout(T.handle),T.handle=null,T.remaining=Math.max(0,T.deadline-Date.now()))}function y(S){if(m.value.find(L=>L.id===S)?.detailsOpen)return;const I=f.get(S);!I||I.handle!==null||_(S,I.remaining)}function k(S){S.detailsOpen=!S.detailsOpen,S.detailsOpen?g(S.id):y(S.id)}async function $(S){if(!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(d(S.warning)),S.copied=!0;const T=v.get(S.id);T&&clearTimeout(T),v.set(S.id,setTimeout(()=>{S.copied=!1,v.delete(S.id)},1400))}function E(S){b(S);const T=v.get(S);T&&clearTimeout(T),v.delete(S);const I=m.value.findIndex(L=>L.id===S);I!==-1&&(m.value=m.value.filter(L=>L.id!==S),s("dismiss",I))}return Ve(()=>n.warnings,S=>{const T=[...m.value];m.value=S.map(I=>{const L=u(I),R=T.findIndex(P=>P.key===L),O=R===-1?void 0:T.splice(R,1)[0];if(O)return O.warning=I,O;const F={id:p++,key:L,warning:I,detailsOpen:!1,copied:!1};return _(F.id,w(I)),F});for(const I of T){b(I.id);const L=v.get(I.id);L&&clearTimeout(L),v.delete(I.id)}},{immediate:!0,flush:"post"}),qt(()=>{f.forEach(S=>{S.handle!==null&&clearTimeout(S.handle)}),f.clear(),v.forEach(S=>clearTimeout(S)),v.clear()}),(S,T)=>m.value.length?(C(),A("div",Kne,[(C(!0),A(Ie,null,Xe(m.value,I=>(C(),A("div",{key:I.id,class:Ee(["toast",{err:c(I.warning)}]),onPointerenter:L=>g(I.id),onPointerleave:L=>y(I.id)},[T[1]||(T[1]=h("span",{class:"dot","aria-hidden":"true"},null,-1)),h("div",Yne,[h("div",Xne,N(r(I.warning)),1),l(I.warning)?(C(),A("div",Zne,N(l(I.warning)),1)):re("",!0),a(I.warning)?.length?(C(),A("div",Qne,[h("button",{class:"link",type:"button",onClick:L=>k(I)},N(I.detailsOpen?M(o)("warnings.hideDetails"):M(o)("warnings.showDetails")),9,Jne),h("button",{class:"link",type:"button",onClick:L=>$(I)},N(I.copied?M(o)("warnings.copied"):M(o)("warnings.copyDetails")),9,ese)])):re("",!0),I.detailsOpen&&a(I.warning)?.length?(C(),A("dl",tse,[(C(!0),A(Ie,null,Xe(a(I.warning),L=>(C(),A("div",{key:`${L.label}:${L.value}`,class:"detail-row"},[h("dt",null,N(L.label),1),h("dd",null,N(L.value),1)]))),128))])):re("",!0)]),h("button",{class:"x",type:"button","aria-label":M(o)("warnings.dismiss"),onClick:L=>E(I.id)},[...T[0]||(T[0]=[h("svg",{viewBox:"0 0 16 16",width:"12",height:"12"},[h("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor","stroke-width":"1.5",fill:"none","stroke-linecap":"round"})],-1)])],8,nse)],42,Gne))),128))])):re("",!0)}}),ose=yt(sse,[["__scopeId","data-v-debb0b68"]]),ise={class:"topbar"},rse={class:"wsq"},lse=["aria-label"],ase={class:"tb-path"},cse={class:"ws"},use={class:"se"},dse={class:"tb-sub"},fse=["aria-label"],hse=Ze({__name:"MobileTopBar",props:{workspace:{default:null},sessionTitle:{default:""},running:{type:Boolean,default:!1},branch:{default:""},sessionCount:{default:0}},emits:["openSwitcher","openSettings"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=j(()=>{const a=s.workspace,u=(a?.name||a?.root||"").trim().charAt(0);return u?u.toUpperCase():"K"}),r=j(()=>s.workspace?.name??n("workspace.noWorkspace")),l=j(()=>s.running?n("mobile.running"):n("mobile.idle"));return(a,c)=>(C(),A("div",ise,[h("span",rse,N(i.value),1),h("button",{type:"button",class:"tb-mid","aria-label":M(n)("mobile.openSwitcher"),onClick:c[0]||(c[0]=u=>o("openSwitcher"))},[h("span",ase,[h("span",cse,N(r.value),1),e.sessionTitle?(C(),A(Ie,{key:0},[c[2]||(c[2]=h("span",{class:"sl"},"/",-1)),h("span",use,N(e.sessionTitle),1)],64)):re("",!0),c[3]||(c[3]=h("span",{class:"cv"},"⌄",-1))]),h("span",dse,[h("span",{class:Ee(["rd",{on:e.running}])},null,2),h("span",null,N(l.value),1),e.branch?(C(),A(Ie,{key:0},[ht(" · "+N(e.branch),1)],64)):re("",!0),e.sessionCount>0?(C(),A(Ie,{key:1},[ht(" · "+N(M(n)("mobile.sessionCount",{n:e.sessionCount})),1)],64)):re("",!0)])],8,lse),h("button",{type:"button",class:"tb-set","aria-label":M(n)("mobile.openSettings"),onClick:c[1]||(c[1]=u=>o("openSettings"))},[...c[4]||(c[4]=[dr('<svg viewBox="0 0 24 24" width="21" height="21" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true" data-v-afe221dd><line x1="4" y1="8" x2="20" y2="8" data-v-afe221dd></line><circle cx="10" cy="8" r="2.5" fill="var(--bg)" data-v-afe221dd></circle><line x1="4" y1="16" x2="20" y2="16" data-v-afe221dd></line><circle cx="15" cy="16" r="2.5" fill="var(--bg)" data-v-afe221dd></circle></svg>',1)])],8,fse)]))}}),pse=yt(hse,[["__scopeId","data-v-afe221dd"]]),mse={key:0,class:"sheet-root"},gse=["aria-label"],vse=["aria-label"],yse={key:0,class:"sheet-head"},kse={class:"sheet-title"},bse={class:"sheet-body"},_se=Ze({__name:"BottomSheet",props:{modelValue:{type:Boolean},title:{default:""}},emits:["update:modelValue","close"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t;function i(){o("update:modelValue",!1),o("close")}function r(l){l.key==="Escape"&&i()}return Ve(()=>s.modelValue,l=>{typeof document>"u"||(l?document.addEventListener("keydown",r):document.removeEventListener("keydown",r))},{immediate:!0}),qt(()=>{typeof document<"u"&&document.removeEventListener("keydown",r)}),(l,a)=>(C(),je(Si,{name:"sheet"},{default:vn(()=>[e.modelValue?(C(),A("div",mse,[h("div",{class:"sheet-scrim",onClick:i}),h("div",{class:"sheet-panel",role:"dialog","aria-label":e.title||M(n)("mobile.sheetLabel")},[h("button",{type:"button",class:"sheet-grab","aria-label":M(n)("mobile.closeSheet"),onClick:i},null,8,vse),e.title?(C(),A("div",yse,[h("span",kse,N(e.title),1)])):re("",!0),h("div",bse,[Xl(l.$slots,"default",{},void 0,!0)])],8,gse)])):re("",!0)]),_:3}))}}),HT=yt(_se,[["__scopeId","data-v-3d02ba1d"]]),wse={class:"mlist"},Sse={key:0,class:"mempty"},Cse=["onClick"],xse={class:"mgh-folder",width:"15",height:"15",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor","stroke-width":"1.2","aria-hidden":"true"},Tse={class:"mgh-main"},Mse={class:"mgh-name"},Ase=["title"],Ese={key:0,class:"att"},Ise=["title","aria-label","onClick"],$se=["title","aria-label","onClick"],Nse=["onClick"],Lse=["onClick"],Ose={key:0,class:"mempty small"},Rse=["onClick"],Pse={class:"m"},Dse={class:"s"},Bse={key:0,class:"att"},Fse=["title","onClick"],Hse=["onClick"],Wse=["onClick"],Use=["onClick"],Aw=5,qse=7200*60*1e3,jse=Ze({__name:"MobileSwitcherSheet",props:{modelValue:{type:Boolean},groups:{},activeWorkspaceId:{default:null},activeId:{},attentionBySession:{default:()=>({})},attentionByWorkspace:{default:()=>({})}},emits:["update:modelValue","select","create","createInWorkspace","addWorkspace","rename","archive","deleteWorkspace"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t;function i(){o("update:modelValue",!1)}function r(F){o("select",F),i()}function l(F){o("createInWorkspace",F),i()}function a(){o("create"),i()}function c(){o("addWorkspace"),i()}const u=te(new Set);function d(F){return u.value.has(F)}function p(F){const P=new Set(u.value);if(P.has(F)){P.delete(F);const q=new Set(f.value);q.delete(F),f.value=q}else P.add(F);u.value=P,b.value=null,S.value=null}function m(F){return s.attentionByWorkspace[F]??0}const f=te(new Set);function v(F){return f.value.has(F)}function w(F){const P=new Set(f.value);P.has(F)?P.delete(F):P.add(F),f.value=P}function _(F,P,q){if(P||F.length<=Aw)return F;const G=Date.now()-qse,oe=F.slice(0,Aw),J=new Set(oe.map(Fe=>Fe.id)),he=F.filter(Fe=>J.has(Fe.id)?!1:(Fe.updatedAt?Date.parse(Fe.updatedAt):0)>G),Ne=[...oe,...he];if(q&&!Ne.some(Fe=>Fe.id===q)){const Fe=F.find(We=>We.id===q);Fe&&Ne.push(Fe)}return Ne}const b=te(null),g=te(null);let y;function k(F){b.value=b.value===F?null:F,S.value=null,clearTimeout(y),g.value=null}function $(F){b.value=null;const q=(typeof window<"u"?window.prompt(n("sidebar.rename"),F.title):null)?.trim();q&&o("rename",F.id,q)}function E(F){if(g.value===F){clearTimeout(y),g.value=null,b.value=null,o("archive",F);return}clearTimeout(y),g.value=F,y=setTimeout(()=>{g.value=null},2500)}const S=te(null),T=te(null);let I;function L(F){S.value=S.value===F?null:F,b.value=null,clearTimeout(I),T.value=null}function R(F){navigator.clipboard.writeText(F.root),S.value=null}function O(F){if(T.value===F){clearTimeout(I),T.value=null,S.value=null,o("deleteWorkspace",F);return}clearTimeout(I),T.value=F,I=setTimeout(()=>{T.value=null},2500)}return qt(()=>{clearTimeout(y),clearTimeout(I)}),(F,P)=>(C(),je(HT,{"model-value":e.modelValue,"onUpdate:modelValue":P[2]||(P[2]=q=>o("update:modelValue",q))},{default:vn(()=>[h("button",{type:"button",class:"newrow",onClick:a},[P[3]||(P[3]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M4 2.5h8a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H8.5l-2.5 2V11.5H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2z"})],-1)),ht(" "+N(M(n)("sidebar.newChat")),1)]),h("button",{type:"button",class:"newrow secondary",onClick:c},[P[4]||(P[4]=h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"}),h("path",{d:"M1 5.5h12"})],-1)),ht(" "+N(M(n)("sidebar.newWorkspace")),1)]),h("div",wse,[e.groups.length===0?(C(),A("div",Sse,N(M(n)("workspace.noWorkspace")),1)):re("",!0),(C(!0),A(Ie,null,Xe(e.groups,q=>(C(),A("div",{key:q.workspace.id,class:"mgroup"},[h("div",{class:Ee(["mgh",{on:q.workspace.id===e.activeWorkspaceId}]),onClick:K=>p(q.workspace.id)},[(C(),A("svg",xse,[d(q.workspace.id)?(C(),A(Ie,{key:0},[P[5]||(P[5]=h("rect",{x:"1",y:"3.5",width:"12",height:"8.5",rx:"1"},null,-1)),P[6]||(P[6]=h("path",{d:"M1 5V3.5A1 1 0 0 1 2 2.5h3.5l1.3 2"},null,-1))],64)):(C(),A(Ie,{key:1},[P[7]||(P[7]=h("path",{d:"M1 3.5V2.5A1 1 0 0 1 2 1.5h3.5l1.3 2h5.2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"},null,-1)),P[8]||(P[8]=h("path",{d:"M1 5.5h12"},null,-1))],64))])),h("div",Tse,[h("span",Mse,N(q.workspace.name),1),h("span",{class:"mgh-path",title:q.workspace.root},N(q.workspace.branch||q.workspace.shortPath),9,Ase)]),d(q.workspace.id)&&m(q.workspace.id)>0?(C(),A("span",Ese,N(m(q.workspace.id)),1)):re("",!0),h("button",{type:"button",class:"mgh-more",title:M(n)("sidebar.options"),"aria-label":M(n)("sidebar.options"),onClick:Ye(K=>L(q.workspace.id),["stop"])},[...P[9]||(P[9]=[h("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Ise),h("button",{type:"button",class:"mgh-add",title:M(n)("workspace.newInGroup"),"aria-label":M(n)("workspace.newInGroup"),onClick:Ye(K=>l(q.workspace.id),["stop"])},"+",8,$se),S.value===q.workspace.id?(C(),A("div",{key:1,class:"kmenu wsmenu",onClick:P[0]||(P[0]=Ye(()=>{},["stop"]))},[h("button",{class:"kitem",onClick:Ye(K=>R(q.workspace),["stop"])},N(M(n)("sidebar.copyPath")),9,Nse),h("button",{class:"kitem archive",onClick:Ye(K=>O(q.workspace.id),["stop"])},N(T.value===q.workspace.id?M(n)("sidebar.confirm"):M(n)("sidebar.delete")),9,Lse)])):re("",!0)],10,Cse),Et(h("div",null,[q.sessions.length===0?(C(),A("div",Ose,N(M(n)("sidebar.noSessions")),1)):re("",!0),(C(!0),A(Ie,null,Xe(_(q.sessions,v(q.workspace.id),e.activeId),K=>(C(),A("div",{key:K.id,class:Ee(["srow",{cur:K.id===e.activeId}]),onClick:G=>r(K.id)},[h("div",Pse,[h("div",{class:Ee(["t",{run:K.busy,aborted:K.status==="aborted"}])},N(K.title),3),h("div",Dse,N(K.time),1)]),(e.attentionBySession[K.id]??0)>0?(C(),A("span",Bse,N(e.attentionBySession[K.id]),1)):re("",!0),h("button",{type:"button",class:"kb",title:M(n)("sidebar.options"),onClick:Ye(G=>k(K.id),["stop"])},[...P[10]||(P[10]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[h("circle",{cx:"8",cy:"3",r:"1.3"}),h("circle",{cx:"8",cy:"8",r:"1.3"}),h("circle",{cx:"8",cy:"13",r:"1.3"})],-1)])],8,Fse),b.value===K.id?(C(),A("div",{key:1,class:"kmenu",onClick:P[1]||(P[1]=Ye(()=>{},["stop"]))},[h("button",{class:"kitem",onClick:Ye(G=>$(K),["stop"])},N(M(n)("sidebar.rename")),9,Hse),h("button",{class:"kitem archive",onClick:Ye(G=>E(K.id),["stop"])},N(g.value===K.id?M(n)("sidebar.archiveConfirm"):M(n)("sidebar.archive")),9,Wse)])):re("",!0)],10,Rse))),128)),!v(q.workspace.id)&&_(q.sessions,!1,e.activeId).length<q.sessions.length?(C(),A("button",{key:1,type:"button",class:"mshow-more",onClick:Ye(K=>w(q.workspace.id),["stop"])},N(M(n)("sidebar.showMore",{count:q.sessions.length-_(q.sessions,!1,e.activeId).length})),9,Use)):re("",!0)],512),[[No,!d(q.workspace.id)]])]))),128))])]),_:1},8,["model-value"]))}}),zse=yt(jse,[["__scopeId","data-v-193940e0"]]),Vse={class:"srow-main"},Kse={class:"srow-label"},Gse={class:"srow-sub"},Yse={class:"srow-main"},Xse={class:"srow-label"},Zse={class:"srow-val"},Qse={class:"srow-main"},Jse={class:"srow-label"},eoe={class:"srow-sub"},toe=["aria-checked"],noe={class:"srow-main"},soe={class:"srow-label"},ooe={class:"srow-sub"},ioe=["aria-checked"],roe={class:"srow-main"},loe={class:"srow-label"},aoe={class:"srow read-only"},coe={class:"srow-main"},uoe={class:"srow-label"},doe={class:"srow-sub"},foe=["aria-label"],hoe={class:"srow read-only pref"},poe={class:"srow-main"},moe={class:"srow-label"},goe=["aria-label"],voe=["aria-pressed"],yoe=["aria-pressed"],koe={class:"srow read-only pref"},boe={class:"srow-main"},_oe={class:"srow-label"},woe=["aria-label"],Soe=["aria-pressed"],Coe=["aria-pressed"],xoe=["aria-pressed"],Toe={class:"srow read-only pref"},Moe={class:"srow-main"},Aoe={class:"srow-label"},Eoe={class:"srow read-only pref"},Ioe={class:"srow-main"},$oe={class:"srow-label"},Noe={class:"num-field"},Loe=["value","aria-label"],Ooe={class:"srow-main"},Roe={class:"srow-label"},Poe={class:"srow-sub"},Doe=["aria-checked"],Boe={class:"srow-main"},Foe={class:"srow-label"},Hoe={class:"srow-main"},Woe={class:"srow-label"},Uoe={key:2,class:"srow read-only"},qoe={class:"srow-main"},joe={class:"srow-label"},zoe={class:"srow-val dim"},Voe=Ze({__name:"MobileSettingsSheet",props:{modelValue:{type:Boolean},status:{},thinking:{},planMode:{type:Boolean},swarmMode:{type:Boolean},theme:{default:"terminal"},colorScheme:{default:"system"},uiFontSize:{default:14},authReady:{type:Boolean,default:!1},betaToc:{type:Boolean},serverVersion:{default:""}},emits:["update:modelValue","pickModel","setThinking","togglePlan","toggleSwarm","setPermission","setTheme","setColorScheme","setUiFontSize","setBetaToc","login","logout"],setup(e,{emit:t}){const{t:n}=wt(),s=e,o=t,i=["manual","auto","yolo"],r=j(()=>s.thinking??"high"),l=j(()=>s.planMode===!0),a=j(()=>s.swarmMode===!0),c=j(()=>{const g=s.status.permission;return g==="yolo"?"var(--err)":g==="auto"?"var(--warn)":"var(--faint)"}),u=j(()=>{const g=s.status.permission,y=n(g==="yolo"?"mobile.permYoloSub":g==="auto"?"mobile.permAutoSub":"mobile.permManualSub");return`${g} · ${y}`}),d=g=>`${Math.round(g/1e3)}k`,p=j(()=>s.status.ctxMax>0?Math.min(100,Math.max(0,Math.round(s.status.ctxUsed/s.status.ctxMax*100))):0),m=j(()=>s.status.ctxMax>0?`${d(s.status.ctxUsed)}/${d(s.status.ctxMax)}`:n("status.statusNone"));function f(){o("setThinking",r.value==="off"?"high":"off")}function v(){const g=i.indexOf(s.status.permission),y=i[(g+1)%i.length];o("setPermission",y)}function w(){o("pickModel"),o("update:modelValue",!1)}function _(){o("login"),o("update:modelValue",!1)}function b(){o("logout"),o("update:modelValue",!1)}return(g,y)=>(C(),je(HT,{"model-value":e.modelValue,title:M(n)("mobile.settingsTitle"),"onUpdate:modelValue":y[9]||(y[9]=k=>o("update:modelValue",k))},{default:vn(()=>[h("button",{type:"button",class:"srow",onClick:w},[h("span",Vse,[h("span",Kse,N(M(n)("status.statusModel")),1),h("span",Gse,N(e.status.model),1)]),y[10]||(y[10]=h("span",{class:"chev"},"›",-1))]),h("button",{type:"button",class:"srow",onClick:f},[h("span",Yse,[h("span",Xse,N(M(n)("status.statusThinking")),1)]),h("span",Zse,N(r.value==="off"?M(n)("status.planOff"):M(n)("status.planOn")),1),y[11]||(y[11]=h("span",{class:"chev"},"›",-1))]),h("button",{type:"button",class:"srow",onClick:y[0]||(y[0]=k=>o("togglePlan"))},[h("span",Qse,[h("span",Jse,N(M(n)("status.statusPlanMode")),1),h("span",eoe,N(M(n)("mobile.planModeSub")),1)]),h("span",{class:Ee(["toggle",{on:l.value}]),role:"switch","aria-checked":l.value},null,10,toe)]),h("button",{type:"button",class:"srow",onClick:y[1]||(y[1]=k=>o("toggleSwarm"))},[h("span",noe,[h("span",soe,N(M(n)("status.statusSwarmMode")),1),h("span",ooe,N(M(n)("mobile.swarmModeSub")),1)]),h("span",{class:Ee(["toggle",{on:a.value}]),role:"switch","aria-checked":a.value},null,10,ioe)]),h("button",{type:"button",class:"srow",onClick:v},[h("span",roe,[h("span",loe,N(M(n)("status.statusPermission")),1),h("span",{class:"srow-sub",style:$t({color:c.value})},N(u.value),5)]),y[12]||(y[12]=h("span",{class:"chev"},"›",-1))]),h("div",aoe,[h("span",coe,[h("span",uoe,N(M(n)("status.statusContext")),1),h("span",doe,N(m.value),1)]),h("span",{class:"ctx-meter","aria-label":m.value},[h("i",{style:$t({width:p.value+"%"})},null,4)],8,foe)]),h("div",hoe,[h("span",poe,[h("span",moe,N(M(n)("theme.label")),1)]),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.label")},[h("button",{type:"button",class:Ee(["seg-opt",{on:e.theme==="modern"}]),"aria-pressed":e.theme==="modern",onClick:y[2]||(y[2]=k=>o("setTheme","modern"))},N(M(n)("theme.modern")),11,voe),h("button",{type:"button",class:Ee(["seg-opt",{on:e.theme==="cyberneurova"}]),"aria-pressed":e.theme==="cyberneurova",onClick:y[3]||(y[3]=k=>o("setTheme","cyberneurova"))},N(M(n)("theme.cyberneurova")),11,yoe)],8,goe)]),h("div",koe,[h("span",boe,[h("span",_oe,N(M(n)("theme.colorSchemeLabel")),1)]),h("div",{class:"seg",role:"group","aria-label":M(n)("theme.colorSchemeLabel")},[h("button",{type:"button",class:Ee(["seg-opt",{on:e.colorScheme==="light"}]),"aria-pressed":e.colorScheme==="light",onClick:y[4]||(y[4]=k=>o("setColorScheme","light"))},N(M(n)("theme.light")),11,Soe),h("button",{type:"button",class:Ee(["seg-opt",{on:e.colorScheme==="dark"}]),"aria-pressed":e.colorScheme==="dark",onClick:y[5]||(y[5]=k=>o("setColorScheme","dark"))},N(M(n)("theme.dark")),11,Coe),h("button",{type:"button",class:Ee(["seg-opt",{on:e.colorScheme==="system"}]),"aria-pressed":e.colorScheme==="system",onClick:y[6]||(y[6]=k=>o("setColorScheme","system"))},N(M(n)("theme.system")),11,xoe)],8,woe)]),h("div",Toe,[h("span",Moe,[h("span",Aoe,N(M(n)("sidebar.language")),1)]),mt(BT)]),h("div",Eoe,[h("span",Ioe,[h("span",$oe,N(M(n)("settings.uiFontSize")),1)]),h("label",Noe,[h("input",{class:"num-input",type:"number",min:"12",max:"20",step:"1",value:e.uiFontSize,"aria-label":M(n)("settings.uiFontSize"),onInput:y[7]||(y[7]=k=>o("setUiFontSize",Number(k.target.value)))},null,40,Loe),y[13]||(y[13]=h("span",{class:"num-unit"},"px",-1))])]),h("button",{type:"button",class:"srow",onClick:y[8]||(y[8]=k=>o("setBetaToc",!e.betaToc))},[h("span",Ooe,[h("span",Roe,N(M(n)("settings.betaToc")),1),h("span",Poe,N(M(n)("settings.betaTocHint")),1)]),h("span",{class:Ee(["toggle",{on:e.betaToc}]),role:"switch","aria-checked":e.betaToc},null,10,Doe)]),e.authReady?(C(),A("button",{key:0,type:"button",class:"srow acct out",onClick:b},[h("span",Boe,[h("span",Foe,N(M(n)("sidebar.signOut")),1)])])):(C(),A("button",{key:1,type:"button",class:"srow acct in",onClick:_},[h("span",Hoe,[h("span",Woe,N(M(n)("sidebar.signIn")),1)])])),e.serverVersion?(C(),A("div",Uoe,[h("span",qoe,[h("span",joe,N(M(n)("settings.serverVersion")),1)]),h("span",zoe,N(e.serverVersion),1)])):re("",!0)]),_:1},8,["model-value","title"]))}}),Koe=yt(Voe,[["__scopeId","data-v-fcada252"]]),Goe={class:"ob-backdrop"},Yoe=["aria-label"],Xoe=["aria-label"],Zoe={class:"ob-brand"},Qoe={class:"ob-title"},Joe={class:"ob-sub"},eie={class:"ob-sec"},tie={class:"ob-label"},nie={class:"ob-seg",role:"group"},sie=["aria-pressed","onClick"],oie={class:"ob-sec"},iie={class:"ob-label"},rie={class:"ob-themes"},lie=["aria-pressed"],aie={class:"ob-theme-name"},cie={class:"ob-theme-desc"},uie=["aria-pressed"],die={class:"ob-theme-name"},fie={class:"ob-theme-desc"},hie=Ze({__name:"Onboarding",props:{theme:{}},emits:["setTheme","complete","skip"],setup(e,{emit:t}){const n=e,s=t,{t:o,locale:i}=wt();function r(c){i.value!==c&&iC(c)}const l=te(n.theme);function a(){l.value!==n.theme&&s("setTheme",l.value),s("complete")}return(c,u)=>(C(),A("div",Goe,[h("div",{class:"ob-card",role:"dialog","aria-modal":"true","aria-label":M(o)("onboarding.title")},[h("button",{type:"button",class:"ob-close","aria-label":M(o)("onboarding.skip"),onClick:u[0]||(u[0]=d=>s("skip"))},[...u[3]||(u[3]=[h("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","aria-hidden":"true"},[h("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])],8,Xoe),h("div",Zoe,[u[4]||(u[4]=h("svg",{class:"ob-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"CyberNeurova Code"},[h("defs",null,[h("mask",{id:"obNeurovaEyes",maskUnits:"userSpaceOnUse"},[h("rect",{x:"0",y:"0",width:"32",height:"22",fill:"#fff"}),h("g",{class:"ob-eyes",fill:"#000"},[h("rect",{class:"ob-eye",x:"11.8",y:"7",width:"2.8",height:"8",rx:"1.4"}),h("rect",{class:"ob-eye",x:"17.4",y:"7",width:"2.8",height:"8",rx:"1.4"})])])]),h("rect",{x:"1",y:"1",width:"30",height:"20",rx:"6",fill:"var(--blue)",mask:"url(#obNeurovaEyes)"})],-1)),h("div",null,[h("div",Qoe,N(M(o)("onboarding.title")),1),h("div",Joe,N(M(o)("onboarding.subtitle")),1)])]),h("section",eie,[h("div",tie,N(M(o)("onboarding.languageLabel")),1),h("div",nie,[(C(!0),A(Ie,null,Xe(M(oC),d=>(C(),A("button",{key:d.code,type:"button",class:Ee(["ob-seg-btn",{on:M(i)===d.code}]),"aria-pressed":M(i)===d.code,onClick:p=>r(d.code)},N(d.label),11,sie))),128))])]),h("section",oie,[h("div",iie,N(M(o)("onboarding.themeLabel")),1),h("div",rie,[h("button",{type:"button",class:Ee(["ob-theme",{on:l.value==="modern"}]),"aria-pressed":l.value==="modern",onClick:u[1]||(u[1]=d=>l.value="modern")},[u[5]||(u[5]=h("span",{class:"ob-theme-prev modern","aria-hidden":"true"},[h("span",{class:"bub u"}),h("span",{class:"bub a"})],-1)),h("span",aie,N(M(o)("theme.modern")),1),h("span",cie,N(M(o)("onboarding.modernDesc")),1)],10,lie),h("button",{type:"button",class:Ee(["ob-theme",{on:l.value==="cyberneurova"}]),"aria-pressed":l.value==="cyberneurova",onClick:u[2]||(u[2]=d=>l.value="cyberneurova")},[u[6]||(u[6]=h("span",{class:"ob-theme-prev cyberneurova","aria-hidden":"true"},[h("span",{class:"kb u"}),h("span",{class:"kb a"})],-1)),h("span",die,N(M(o)("theme.cyberneurova")),1),h("span",fie,N(M(o)("onboarding.neurovaDesc")),1)],10,uie)])]),h("button",{type:"button",class:"ob-start",onClick:a},N(M(o)("onboarding.start")),1)],8,Yoe)]))}}),pie=yt(hie,[["__scopeId","data-v-93bd8fd8"]]),mie=["aria-label"],gie={class:"gload-box"},vie={class:"gload-text"},yie=Ze({__name:"GlobalLoading",setup(e){const{t}=wt();return(n,s)=>(C(),A("div",{class:"gload",role:"status","aria-label":M(t)("app.connecting")},[h("div",gie,[s[0]||(s[0]=dr('<svg class="gload-logo" viewBox="0 0 96 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" data-v-467001ca><path fill="currentColor" d="M35.767 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304c-.37 0-.671.3-.671.671z" data-v-467001ca></path><path fill="currentColor" d="M90.353 31.329c0 .37.3.671.67.671h4.305c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.672-.671h-4.304a.67.67 0 0 0-.671.671z" data-v-467001ca></path><path fill="currentColor" d="M73.256 0a.67.67 0 0 0-.652.512l-6.366 26.1c-.106.428-.607.428-.71 0L59.159.512A.67.67 0 0 0 58.511 0H47.725c-.37 0-.668.3-.668.671V31.33c0 .37.3.671.67.671h4.781c.37 0 .671-.292.671-.662V5.554c0-.515.604-.622.726-.127l6.358 26.06a.67.67 0 0 0 .653.513h9.931c.31 0 .58-.212.653-.512L77.855 5.43c.122-.495.726-.388.726.127v25.772c0 .37.3.671.671.671h4.78c.371 0 .672-.3.672-.671V.67c0-.37-.3-.671-.671-.671z" data-v-467001ca></path><path fill="currentColor" d="M15.279 14.837 28.264 1.133A.671.671 0 0 0 27.777 0h-6.043a.67.67 0 0 0-.477.199L6.374 15.223c-.231.234-.573.025-.573-.35V.672c0-.37-.3-.671-.671-.671H.67a.67.67 0 0 0-.67.67V31.33c0 .37.3.671.671.671H5.13c.37 0 .671-.3.671-.671v-6.114a.5.5 0 0 1 .13-.35l4.594-4.69a.293.293 0 0 1 .386-.045l12.286 9.305c1.796 1.245 4.083 2.06 6.178 2.401a.645.645 0 0 0 .743-.648v-5.537a.7.7 0 0 0-.562-.677c-1.215-.262-2.565-.758-3.59-1.468L15.332 15.58c-.22-.152-.248-.544-.052-.744" data-v-467001ca></path></svg><div class="gload-bar" aria-hidden="true" data-v-467001ca><span class="gload-bar-fill" data-v-467001ca></span></div>',2)),h("div",vie,N(M(t)("app.connecting")),1)])],8,mie))}}),kie=yt(yie,[["__scopeId","data-v-467001ca"]]),bie={class:"kap-root"},_ie={class:"kap-head"},wie={class:"kap-count"},Sie={class:"kap-head-actions"},Cie={class:"kap-filters"},xie=["value"],Tie={class:"kap-check"},Mie={class:"kap-check"},Aie={class:"kap-view-toggle",role:"group"},Eie={key:0,class:"kap-empty"},Iie=["onClick"],$ie={class:"kap-ts"},Nie={class:"kap-label"},Lie={key:0,class:"kap-detail"},Oie={class:"kap-detail-actions"},Rie=["onClick"],Pie={key:1,class:"kap-agg"},Die={class:"mono"},Bie={class:"mono"},Fie={class:"num"},Hie={class:"num"},Wie={key:0},Uie={class:"mono"},qie={class:"num"},jie={class:"num"},zie={key:0},Vie=Ze({__name:"KapDebugView",emits:["close"],setup(e,{emit:t}){const n=t,s=te("all"),o=te(""),i=te(""),r=te(!1),l=te("timeline"),a=j(()=>(Rv.value,[...AJ()])),c=j(()=>{const T=new Set;for(const I of a.value)I.sessionId&&T.add(I.sessionId);return[...T].sort()});function u(T){return T.kind==="rest:error"||T.code!==void 0&&T.code!==0||T.eventType==="error"||T.eventType==="parse-error"}const d=j(()=>{const T=o.value.trim().toLowerCase();return a.value.filter(I=>!(s.value!=="all"&&I.source!==s.value||i.value&&I.sessionId!==i.value||r.value&&!u(I)||T&&!`${I.label} ${I.kind} ${I.eventType??""} ${I.sessionId??""} ${I.requestId??""}`.toLowerCase().includes(T)))}),p=j(()=>{const T=new Map;for(const I of d.value){if(I.kind!=="ws:in"&&I.kind!=="ws:out")continue;const L=I.kind==="ws:in"?"←":"→",R=`${L} ${I.eventType??"?"} @ ${I.sessionId??"-"}`,O=T.get(R)??{key:R,sessionId:I.sessionId??"-",eventType:I.eventType??"?",dir:L,count:0};O.count++,I.seq!==void 0&&(O.lastSeq=I.seq),T.set(R,O)}return[...T.values()].sort((I,L)=>L.count-I.count)}),m=j(()=>{const T=new Map;for(const I of d.value){if(I.source!=="rest"||I.kind==="rest:request")continue;const L=`${I.method??"?"} ${I.path??"?"}`,R=T.get(L)??{count:0,errors:0,totalMs:0,timed:0};R.count++,u(I)&&R.errors++,I.durationMs!==void 0&&(R.totalMs+=I.durationMs,R.timed++),T.set(L,R)}return[...T.entries()].map(([I,L])=>({key:I,count:L.count,errors:L.errors,avgMs:L.timed>0?Math.round(L.totalMs/L.timed):0})).sort((I,L)=>L.count-I.count)}),f=te(null),v=te(!0),w=te(null),_=te(null);Ve(()=>d.value.length,async()=>{if(!v.value||l.value!=="timeline")return;await ft();const T=w.value;T&&(T.scrollTop=T.scrollHeight)});function b(T){f.value=f.value===T?null:T}function g(T){const I=new Date(T),L=(R,O=2)=>String(R).padStart(O,"0");return`${L(I.getHours())}:${L(I.getMinutes())}:${L(I.getSeconds())}.${L(I.getMilliseconds(),3)}`}function y(T){return JSON.stringify(T,null,2)}async function k(T){try{await navigator.clipboard.writeText(y(T)),_.value=T.id,setTimeout(()=>{_.value===T.id&&(_.value=null)},1500)}catch{}}function $(){FT(d.value)}function E(T){return u(T)||T.source==="client"?"b-err":T.source==="rest"?"b-rest":T.kind==="ws:lifecycle"?"b-life":T.kind==="ws:out"?"b-out":"b-in"}function S(T){return T.source==="rest"?"REST":T.source==="client"?"APP":"WS"}return(T,I)=>(C(),A("section",bie,[h("header",_ie,[I[11]||(I[11]=h("strong",null,"KAP debug",-1)),h("span",wie,N(d.value.length)+"/"+N(a.value.length),1),h("div",Sie,[h("button",{type:"button",class:Ee({on:M(cc)}),onClick:I[0]||(I[0]=L=>cc.value=!M(cc))},N(M(cc)?"resume":"pause"),3),h("button",{type:"button",onClick:I[1]||(I[1]=L=>M(EJ)())},"clear"),h("button",{type:"button",onClick:I[2]||(I[2]=L=>$())},"export jsonl"),h("button",{type:"button",title:"Close window",onClick:I[3]||(I[3]=L=>n("close"))},"✕")])]),h("div",Cie,[Et(h("select",{"onUpdate:modelValue":I[4]||(I[4]=L=>s.value=L),"aria-label":"Source filter"},[...I[12]||(I[12]=[h("option",{value:"all"},"rest + ws + app",-1),h("option",{value:"rest"},"rest",-1),h("option",{value:"ws"},"ws",-1),h("option",{value:"client"},"app errors",-1)])],512),[[of,s.value]]),Et(h("select",{"onUpdate:modelValue":I[5]||(I[5]=L=>i.value=L),"aria-label":"Session filter"},[I[13]||(I[13]=h("option",{value:""},"all sessions",-1)),(C(!0),A(Ie,null,Xe(c.value,L=>(C(),A("option",{key:L,value:L},N(L),9,xie))),128))],512),[[of,i.value]]),Et(h("input",{"onUpdate:modelValue":I[6]||(I[6]=L=>o.value=L),type:"text",placeholder:"filter (type / path / id)","aria-label":"Text filter"},null,512),[[yn,o.value]]),h("label",Tie,[Et(h("input",{"onUpdate:modelValue":I[7]||(I[7]=L=>r.value=L),type:"checkbox"},null,512),[[sf,r.value]]),I[14]||(I[14]=ht(" errors",-1))]),h("label",Mie,[Et(h("input",{"onUpdate:modelValue":I[8]||(I[8]=L=>v.value=L),type:"checkbox"},null,512),[[sf,v.value]]),I[15]||(I[15]=ht(" follow",-1))]),h("div",Aie,[h("button",{type:"button",class:Ee({on:l.value==="timeline"}),onClick:I[9]||(I[9]=L=>l.value="timeline")},"timeline",2),h("button",{type:"button",class:Ee({on:l.value==="aggregate"}),onClick:I[10]||(I[10]=L=>l.value="aggregate")},"aggregate",2)])]),l.value==="timeline"?(C(),A("div",{key:0,ref_key:"listRef",ref:w,class:"kap-list"},[d.value.length===0?(C(),A("div",Eie," No trace entries yet. REST calls and WS frames will appear here. ")):re("",!0),(C(!0),A(Ie,null,Xe(d.value,L=>(C(),A("div",{key:L.id,class:"kap-row-wrap"},[h("button",{type:"button",class:Ee(["kap-row",{expanded:f.value===L.id}]),onClick:R=>b(L.id)},[h("span",$ie,N(g(L.ts)),1),h("span",{class:Ee(["kap-badge",E(L)])},N(S(L)),3),h("span",Nie,N(L.label),1)],10,Iie),f.value===L.id?(C(),A("div",Lie,[h("div",Oie,[h("button",{type:"button",onClick:R=>k(L)},N(_.value===L.id?"copied ✓":"copy json"),9,Rie)]),h("pre",null,N(y(L)),1)])):re("",!0)]))),128))],512)):(C(),A("div",Pie,[I[20]||(I[20]=h("h4",null,"WS frames by session / type",-1)),h("table",null,[I[17]||(I[17]=h("thead",null,[h("tr",null,[h("th",null,"dir"),h("th",null,"type"),h("th",null,"session"),h("th",null,"count"),h("th",null,"last seq")])],-1)),h("tbody",null,[(C(!0),A(Ie,null,Xe(p.value,L=>(C(),A("tr",{key:L.key},[h("td",null,N(L.dir),1),h("td",Die,N(L.eventType),1),h("td",Bie,N(L.sessionId),1),h("td",Fie,N(L.count),1),h("td",Hie,N(L.lastSeq??"—"),1)]))),128)),p.value.length===0?(C(),A("tr",Wie,[...I[16]||(I[16]=[h("td",{colspan:"5",class:"kap-empty"},"no ws frames",-1)])])):re("",!0)])]),I[21]||(I[21]=h("h4",null,"REST by endpoint",-1)),h("table",null,[I[19]||(I[19]=h("thead",null,[h("tr",null,[h("th",null,"endpoint"),h("th",null,"count"),h("th",null,"errors"),h("th",null,"avg ms")])],-1)),h("tbody",null,[(C(!0),A(Ie,null,Xe(m.value,L=>(C(),A("tr",{key:L.key},[h("td",Uie,N(L.key),1),h("td",qie,N(L.count),1),h("td",{class:Ee(["num",{err:L.errors>0}])},N(L.errors),3),h("td",jie,N(L.avgMs),1)]))),128)),m.value.length===0?(C(),A("tr",zie,[...I[18]||(I[18]=[h("td",{colspan:"4",class:"kap-empty"},"no rest calls",-1)])])):re("",!0)])])]))]))}}),Kie=yt(Vie,[["__scopeId","data-v-bbd9f2b7"]]),Gie=["title"],Yie=Ze({__name:"DebugPanel",setup(e){const t=te(!1);let n=null,s=null,o=null;const i=["data-theme","data-color-scheme","data-accent"];function r(u){const d=document.documentElement,p=u.documentElement;for(const m of i){const f=d.getAttribute(m);f!==null?p.setAttribute(m,f):p.removeAttribute(m)}}function l(u){const d=u.document;d.title="KAP debug";const p=d.createElement("base");p.href=location.href,d.head.appendChild(p);for(const f of Array.from(document.querySelectorAll('style, link[rel="stylesheet"]')))d.head.appendChild(f.cloneNode(!0));r(d),d.body.style.margin="0";const m=d.createElement("div");return m.style.height="100vh",d.body.appendChild(m),m}function a(){o?.disconnect(),o=null;try{s?.unmount()}catch{}s=null,n=null,t.value=!1}function c(){if(n&&!n.closed){n.focus();return}const u=window.open("","kap-debug","popup=yes,width=1040,height=760");if(!u)return;n=u;const d=l(u),p=rf(Kie,{onClose:()=>u.close()});p.mount(d),s=p,t.value=!0,o=new MutationObserver(()=>{n&&!n.closed&&r(n.document)}),o.observe(document.documentElement,{attributes:!0,attributeFilter:[...i]}),u.addEventListener("pagehide",a),u.addEventListener("beforeunload",a)}return Jt(()=>{c()}),to(()=>{n&&!n.closed&&n.close(),a()}),(u,d)=>(C(),A("button",{class:"kap-fab",type:"button",title:t.value?"Focus KAP debug window":"Open KAP debug window",onClick:c}," KAP ",8,Gie))}}),Xie=yt(Yie,[["__scopeId","data-v-aa096249"]]);function WT(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function c1(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaiting_approval":return"awaitingApproval";case"awaiting_question":return"awaitingQuestion";case"aborted":return"aborted"}}function Zie(e){switch(e){case"idle":return"idle";case"running":return"running";case"awaitingApproval":return"awaiting_approval";case"awaitingQuestion":return"awaiting_question";case"aborted":return"aborted"}}function Go(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,status:c1(e.status),archived:e.archived??!1,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:WT(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Rf(e){return{id:e.id,root:e.root,name:e.name,isGitRepo:e.is_git_repo,branch:e.branch??void 0,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function Ew(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:{kind:"url",url:e.url}}function Pv(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:Ew(e.source)};case"video":return{type:"video",source:Ew(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function u1(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Pv),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Qie(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function Jie(e){return{content:e.content.map(Qie),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl}}function ere(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function UT(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function tre(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function nre(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(tre),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function qT(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(nre),expiresAt:e.expires_at,createdAt:e.created_at}}function sre(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function ore(e){const t={};for(const[n,s]of Object.entries(e.answers))t[n]=sre(s);return{answers:t,method:e.method,note:e.note}}function d1(e){return{id:e.id,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index}}function Iw(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Ki(e,t){const n=e[t];return typeof n=="string"?n:void 0}function Pl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function fo(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function ire(e){if(!e||typeof e!="object")return null;const t=e,n=Ki(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const s=t.budget,o=s&&typeof s=="object"?s:{};return{goalId:Ki(t,"goalId")??Ki(t,"goal_id")??"goal",objective:Ki(t,"objective")??"",completionCriterion:Ki(t,"completionCriterion")??Ki(t,"completion_criterion"),status:n,turnsUsed:Pl(t,"turnsUsed")??Pl(t,"turns_used")??0,tokensUsed:Pl(t,"tokensUsed")??Pl(t,"tokens_used")??0,wallClockMs:Pl(t,"wallClockMs")??Pl(t,"wall_clock_ms")??0,terminalReason:Ki(t,"terminalReason")??Ki(t,"terminal_reason"),budget:{tokenBudget:fo(o,"tokenBudget")??fo(o,"token_budget"),remainingTokens:fo(o,"remainingTokens")??fo(o,"remaining_tokens"),turnBudget:fo(o,"turnBudget")??fo(o,"turn_budget"),remainingTurns:fo(o,"remainingTurns")??fo(o,"remaining_turns"),wallClockBudgetMs:fo(o,"wallClockBudgetMs")??fo(o,"wall_clock_budget_ms"),remainingWallClockMs:fo(o,"remainingWallClockMs")??fo(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function rre(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Go(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Go(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.workspace.created":return{type:"workspaceCreated",workspace:Rf(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Rf(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.status_changed":return{type:"sessionStatusChanged",sessionId:t.session_id,status:c1(t.payload.status),previousStatus:c1(t.payload.previous_status),currentPromptId:t.payload.current_prompt_id};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:WT(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=ire(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:u1(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Pv),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:UT(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:qT(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.question.expired":return{type:"questionExpired",sessionId:t.session_id,questionId:t.payload.question_id};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:d1(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:f1(t.payload.config)};default:return{type:"unknown",raw:e}}}function lre(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities}}function Gm(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function f1(e){const t={};for(const[n,s]of Object.entries(e.providers))t[n]={type:s.type,baseUrl:s.base_url,defaultModel:s.default_model,hasApiKey:s.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultThinking:e.default_thinking,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function are(e){return e.session_id}function cre(e){return e.seq}const ure="main",dre=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed"]);function Qi(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function fre(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function $w(){return{turnPromptId:new Map,currentPromptId:void 0,currentAssistantMsgId:void 0,turnTextLen:0,turnThinkLen:0,toolStartTimes:new Map,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",messages:[],subagentMeta:new Map}}function ts(e,t){const n=e[t];return typeof n=="string"?n:void 0}function zr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ho(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function hre(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,s=n&&typeof n=="object"?n:{},o=ts(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const i=ts(t,"goalId")??ts(t,"goal_id")??"goal",r=ts(t,"objective")??"";return{goalId:i,objective:r,completionCriterion:ts(t,"completionCriterion")??ts(t,"completion_criterion"),status:o,turnsUsed:zr(t,"turnsUsed")??zr(t,"turns_used")??0,tokensUsed:zr(t,"tokensUsed")??zr(t,"tokens_used")??0,wallClockMs:zr(t,"wallClockMs")??zr(t,"wall_clock_ms")??0,terminalReason:ts(t,"terminalReason")??ts(t,"terminal_reason"),budget:{tokenBudget:ho(s,"tokenBudget")??ho(s,"token_budget"),remainingTokens:ho(s,"remainingTokens")??ho(s,"remaining_tokens"),turnBudget:ho(s,"turnBudget")??ho(s,"turn_budget"),remainingTurns:ho(s,"remainingTurns")??ho(s,"remaining_turns"),wallClockBudgetMs:ho(s,"wallClockBudgetMs")??ho(s,"wall_clock_budget_ms"),remainingWallClockMs:ho(s,"remainingWallClockMs")??ho(s,"remaining_wall_clock_ms"),overBudget:s.overBudget===!0||s.over_budget===!0}}}function uc(e,t,n,s){if(typeof n!="string"||n.length===0)return null;const i={...e.subagentMeta.get(n)??{id:n,sessionId:t,kind:"subagent",description:"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...s,id:n,sessionId:t,kind:"subagent"};return e.subagentMeta.set(n,i),i}function pre(e){if(e==null)return"";try{const t=typeof e=="string"?e:JSON.stringify(e);return t.length>120?`${t.slice(0,117)}...`:t}catch{return""}}function mre(e,t){if(e==="turn.step.started")return"Started a step";if(e==="tool.use"||e==="tool.call.started"){const n=ts(t,"name")??ts(t,"toolName")??"tool",s=pre(t.args??t.input);return s?`Calling ${n}: ${s}`:`Calling ${n}`}if(e==="tool.progress"){const n=t.update;if(n&&typeof n=="object"){const o=ts(n,"text");if(o)return o;const i=ts(n,"message");if(i)return i}const s=ts(t,"message");if(s)return s}return e==="tool.result"?`Finished ${ts(t,"name")??ts(t,"toolName")??ts(t,"toolCallId")??"tool"}`:null}function gre(e,t,n,s,o,i){if(i.has(n)&&s==="turn.step.started")return[];const r=mre(s,o);if(r===null||r.length===0)return[];const l=e.subagentMeta.get(n),a=uc(e,t,n,{status:"running",subagentPhase:"working",startedAt:l?.startedAt??new Date().toISOString()}),c=[];return a&&c.push({type:"taskCreated",sessionId:t,task:a}),c.push({type:"taskProgress",sessionId:t,taskId:n,outputChunk:r,stream:"stdout"}),c}function yd(e){return{...e,content:e.content.map(t=>({...t}))}}function Nw(e,t,n){const s={id:Qi("msg_"),sessionId:t,role:"assistant",content:[],createdAt:new Date().toISOString(),promptId:n};return e.messages.push(s),s}function vre(e,t,n,s,o,i){const r={id:s,sessionId:t,role:"user",content:o,createdAt:i,promptId:n};return e.messages.push(r),r}function yre(e){return Array.isArray(e)?e.map(t=>Pv(t)):[]}function Lw(e,t,n,s){const o=e.messages.find(r=>r.id===t);if(!o)return-1;const i=o.content.at(-1);return i&&i.type===n?(n==="text"?i.text+=s:i.thinking+=s,o.content.length-1):(o.content.push(n==="text"?{type:"text",text:s}:{type:"thinking",thinking:s}),o.content.length-1)}function kre(e,t,n,s,o,i){const r=e.messages.find(l=>l.id===t);r&&r.content.push({type:"toolUse",toolCallId:n,toolName:s,input:o,outputLines:i})}function bre(e){const t=e.update,n=t&&typeof t=="object"?t:null,o=(n?.stream??n?.kind??e.stream)==="stderr"?"stderr":"stdout",i=typeof n?.text=="string"&&n.text||typeof n?.message=="string"&&n.message||typeof e.chunk=="string"&&e.chunk||typeof e.output=="string"&&e.output||typeof e.message=="string"&&e.message||"";return i.length>0?{outputChunk:i,stream:o}:null}function Ow(e,t){e.messages.find(n=>n.id===t)}function _re(e,t,n,s,o,i){const r={id:Qi("msg_"),sessionId:t,role:"tool",content:[{type:"toolResult",toolCallId:n,output:s,isError:o}],createdAt:new Date().toISOString(),promptId:i};return e.messages.push(r),r}function Ym(e,t){return e.messages.find(n=>n.id===t)}function Rw(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}function wre(){const e=new Map,t=new Set;function n(u){let d=e.get(u);return d||(d=$w(),e.set(u,d)),d}function s(u){e.set(u,$w())}function o(u){t.add(u)}function i(u,d){const p=n(u);p.currentPromptId=d}function r(u,d){s(u);const p=n(u),m=d.promptId??Qi("pr_");p.currentPromptId=m,p.turnPromptId.set(d.turnId,m);const f=Nw(p,u,m);d.thinkingText.length>0&&f.content.push({type:"thinking",thinking:d.thinkingText}),d.assistantText.length>0&&f.content.push({type:"text",text:d.assistantText});for(const v of d.runningTools){const w=typeof v.lastProgress?.text=="string"&&v.lastProgress.text.length>0?[v.lastProgress.text]:void 0;f.content.push({type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.args??{},outputLines:w}),p.toolStartTimes.set(v.toolCallId,Date.now())}return p.currentAssistantMsgId=f.id,p.turnTextLen=d.assistantText.length,p.turnThinkLen=d.thinkingText.length,[{type:"sessionStatusChanged",sessionId:u,status:"running",previousStatus:"idle",currentPromptId:m},{type:"messageCreated",message:yd(f)}]}function l(u,d,p,m){try{return c(u,d,p,m)}catch(f){return console.error("[agentProjector] Error projecting event:",u,f instanceof Error?f.message:f),[]}}function a(u,d){return d===void 0?"append":d<u?"skip":d>u?"gap":"append"}function c(u,d,p,m){const f=n(p),v=d,w=[],_=v?.agentId;if(typeof _=="string"&&_!==ure){const b=t.has(_);if(b&&(u==="thinking.delta"||u==="assistant.delta")){const g=v?.delta??"";return g?[{type:"agentDelta",sessionId:p,agentId:_,delta:{[u==="thinking.delta"?"thinking":"text"]:g}}]:[]}if(b&&u==="turn.ended")return[{type:"agentTurnEnded",sessionId:p,agentId:_,reason:v?.reason}];if(dre.has(u))return gre(f,p,_,u,v??{},t)}switch(u){case"session.meta.updated":{const b=v?.patch?.title??v?.title,g=v?.patch?.lastPrompt,y={};typeof b=="string"&&b.length>0&&(y.title=b),typeof g=="string"&&(y.lastPrompt=g),(y.title!==void 0||y.lastPrompt!==void 0)&&w.push({type:"sessionMetaUpdated",sessionId:p,...y});break}case"prompt.submitted":{const b=v?.promptId,g=v?.userMessageId;if(!b||!g)break;const y=yre(v?.content);if(y.length===0)break;f.currentPromptId=b;const k=vre(f,p,b,g,y,typeof v?.createdAt=="string"?v.createdAt:new Date().toISOString());w.push({type:"messageCreated",message:yd(k)});break}case"turn.started":{const b=v?.turnId,g=f.currentPromptId??Qi("pr_");f.currentPromptId=g,b!==void 0&&f.turnPromptId.set(b,g),f.turnTextLen=0,f.turnThinkLen=0,w.push({type:"sessionStatusChanged",sessionId:p,status:"running",previousStatus:"idle",currentPromptId:g});break}case"turn.step.started":{const b=v?.turnId;let g=f.turnPromptId.get(b)??f.currentPromptId;g||(g=Qi("pr_"),f.currentPromptId=g,b!==void 0&&f.turnPromptId.set(b,g));const y=Nw(f,p,g);f.currentAssistantMsgId=y.id,w.push({type:"messageCreated",message:yd(y)});break}case"thinking.delta":{const b=f.currentAssistantMsgId;if(!b)break;const g=v?.delta??"";if(!g)break;m?.offset===0&&f.turnThinkLen>0&&(f.turnThinkLen=0);const y=a(f.turnThinkLen,m?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const k=Lw(f,b,"thinking",g);if(k<0)break;f.turnThinkLen+=g.length,w.push({type:"assistantDelta",sessionId:p,messageId:b,contentIndex:k,delta:{thinking:g}});break}case"assistant.delta":{const b=f.currentAssistantMsgId;if(!b)break;const g=v?.delta??"";if(!g)break;m?.offset===0&&f.turnTextLen>0&&(f.turnTextLen=0);const y=a(f.turnTextLen,m?.offset);if(y==="skip")break;if(y==="gap"){w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"delta_gap"});break}const k=Lw(f,b,"text",g);if(k<0)break;f.turnTextLen+=g.length,w.push({type:"assistantDelta",sessionId:p,messageId:b,contentIndex:k,delta:{text:g}});break}case"tool.use":case"tool.call.started":{const b=f.currentAssistantMsgId,g=v?.turnId,y=f.turnPromptId.get(g)??f.currentPromptId;if(!b||!y)break;const k=v?.toolCallId,$=v?.name??v?.toolName??"",E=v?.args??v?.input??{};kre(f,b,k,$,E);const S=Ym(f,b);S&&S.content.length-1,f.toolStartTimes.set(k,Date.now()),S&&w.push({type:"messageUpdated",sessionId:p,messageId:b,content:S.content.map(T=>({...T})),status:"pending"});break}case"tool.call.delta":break;case"tool.progress":{const b=v?.toolCallId,g=bre(v??{});b&&g&&w.push({type:"toolOutput",sessionId:p,toolCallId:b,outputChunk:g.outputChunk,stream:g.stream});break}case"tool.result":{const b=v?.turnId;let g=f.turnPromptId.get(b)??f.currentPromptId;g||(g=Qi("pr_"),f.currentPromptId=g,b!==void 0&&f.turnPromptId.set(b,g));const y=v?.toolCallId,k=v?.output,$=v?.isError??!1;f.toolStartTimes.get(y)??Date.now(),f.toolStartTimes.delete(y);const E=_re(f,p,y,k,$,g);w.push({type:"messageCreated",message:yd(E)}),f.currentAssistantMsgId=void 0;break}case"turn.step.completed":{const b=f.currentAssistantMsgId,g=fre(v?.usage);if(f.totalInput+=g.input,f.totalOutput+=g.output,f.totalCacheRead+=g.cacheRead,f.totalCacheCreate+=g.cacheCreate,b){Ow(f,b);const y=Ym(f,b);y&&w.push({type:"messageUpdated",sessionId:p,messageId:b,content:y.content.map(k=>({...k})),status:"completed"})}break}case"agent.status.updated":{v?.model&&(f.model=v.model),v?.contextTokens!==void 0&&(f.contextTokens=v.contextTokens),v?.maxContextTokens!==void 0&&(f.contextLimit=v.maxContextTokens),w.push({type:"sessionUsageUpdated",sessionId:p,usage:Rw(f),model:f.model||void 0,swarmMode:v?.swarmMode===!0?!0:v?.swarmMode===!1?!1:void 0,planMode:v?.planMode===!0?!0:v?.planMode===!1?!1:void 0});break}case"turn.ended":{const b=f.currentAssistantMsgId,g=v?.reason??"completed",y=zr(v??{},"durationMs");if(b){Ow(f,b);const E=Ym(f,b);E&&w.push({type:"messageUpdated",sessionId:p,messageId:b,content:E.content.map(S=>({...S})),status:g==="failed"?"error":"completed",durationMs:y})}f.turnCount++;const k=Rw(f);w.push({type:"sessionUsageUpdated",sessionId:p,usage:k});const $=g==="cancelled"||g==="failed"?"aborted":"idle";w.push({type:"sessionStatusChanged",sessionId:p,status:$,previousStatus:"running"}),f.currentAssistantMsgId=void 0,f.currentPromptId=void 0,f.turnTextLen=0,f.turnThinkLen=0;break}case"prompt.completed":break;case"turn.step.retrying":case"turn.step.interrupted":{f.currentAssistantMsgId=void 0;break}case"subagent.spawned":{const g={id:typeof v?.subagentId=="string"&&v.subagentId.length>0?v.subagentId:Qi("task_"),sessionId:p,kind:"subagent",description:typeof v?.description=="string"?v.description:v?.subagentName??"Sub Agent",status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued",subagentType:typeof v?.subagentName=="string"?v.subagentName:void 0,parentToolCallId:typeof v?.parentToolCallId=="string"?v.parentToolCallId:void 0,swarmIndex:typeof v?.swarmIndex=="number"?v.swarmIndex:void 0};f.subagentMeta.set(g.id,g),w.push({type:"taskCreated",sessionId:p,task:g});break}case"subagent.started":{const b=uc(f,p,v?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString()});b&&w.push({type:"taskCreated",sessionId:p,task:b});break}case"subagent.suspended":{const b=uc(f,p,v?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof v?.reason=="string"?v.reason:void 0});b&&w.push({type:"taskCreated",sessionId:p,task:b});break}case"subagent.completed":{const b=typeof v?.resultSummary=="string"?v.resultSummary:void 0,g=uc(f,p,v?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),outputPreview:b});g&&w.push({type:"taskCreated",sessionId:p,task:g}),w.push({type:"taskCompleted",sessionId:p,taskId:v?.subagentId??"",status:"completed",outputPreview:b});break}case"subagent.failed":{const b=typeof v?.error=="string"?v.error:void 0,g=uc(f,p,v?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),outputPreview:b});g&&w.push({type:"taskCreated",sessionId:p,task:g}),w.push({type:"taskCompleted",sessionId:p,taskId:v?.subagentId??"",status:"failed",outputPreview:b});break}case"error":{w.push({type:"unknown",raw:{_agentError:!0,code:v?.code,message:v?.message}});break}case"warning":{w.push({type:"unknown",raw:{_agentWarning:!0,message:v?.message}});break}case"background.task.started":{const b=v?.info??{},g=typeof b.startedAt=="number"?new Date(b.startedAt).toISOString():void 0,y=typeof b.taskId=="string"?b.taskId:typeof b.taskId=="number"?String(b.taskId):Qi("task_"),k=typeof b.description=="string"?b.description:typeof b.command=="string"?b.command:bn.global.t("tasks.defaultDescription"),$=typeof b.command=="string"?b.command:void 0;w.push({type:"taskCreated",sessionId:p,task:{id:y,sessionId:p,kind:"bash",description:k,command:$,status:"running",createdAt:g??new Date().toISOString(),startedAt:g,outputPreview:$!==void 0?`$ ${$}`:void 0}});break}case"background.task.terminated":{const b=v?.info??{},g=b.status==="failed"||typeof b.exitCode=="number"&&b.exitCode!==0;w.push({type:"taskCompleted",sessionId:p,taskId:typeof b.taskId=="string"?b.taskId:typeof b.taskId=="number"?String(b.taskId):"",status:g?"failed":"completed"});break}case"compaction.completed":{const b=v?.result??{};w.push({type:"compactionCompleted",sessionId:p,tokensBefore:typeof b.tokensBefore=="number"?b.tokensBefore:void 0,tokensAfter:typeof b.tokensAfter=="number"?b.tokensAfter:void 0,summary:typeof b.summary=="string"?b.summary:void 0}),w.push({type:"historyCompacted",sessionId:p,beforeSeq:0,reason:"auto_compact"});break}case"compaction.started":{w.push({type:"compactionStarted",sessionId:p,trigger:v?.trigger==="manual"?"manual":"auto",instruction:typeof v?.instruction=="string"?v.instruction:void 0});break}case"compaction.cancelled":{w.push({type:"compactionCancelled",sessionId:p});break}case"goal.updated":{const b=hre(v?.snapshot??null);w.push({type:"goalUpdated",sessionId:p,goal:b?.status==="complete"?null:b});break}}return w}return{project:l,bindNextPromptId:i,seedInFlight:r,reset:s,markSideChannelAgent:o}}const Sre=new Set(["server_hello","ack","ping","resync_required","error","pong"]),Pw=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","background.task.started","background.task.terminated"]),Cre=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","question.expired","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),xre=new Set(["assistant.delta","thinking.delta"]);function Tre(e,t){if(Sre.has(e))return{route:"ignore"};const n=e.startsWith("event."),s=n?e.slice(6):e;return xre.has(s)?Mre(t)?{route:"agent",agentType:s}:{route:"protocol"}:n?Cre.has(s)?{route:"protocol"}:Pw.has(s)?{route:"agent",agentType:s}:{route:"protocol"}:Pw.has(s)?{route:"agent",agentType:s}:{route:"agent",agentType:s}}function Mre(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}class h1 extends Error{code;requestId;details;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details}}class dc extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview}}function fu(e){return e instanceof h1||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function jT(e){return e instanceof dc||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}const fc=3e4,zT="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Dw=500;function Bw(){try{return AbortSignal.timeout(fc)}catch{return}}function Are(e,t){let n="",s=e;for(let o=0;o<t;o++)n=zT[s%32]+n,s=Math.floor(s/32);return n}function Ere(e){const t=new Uint8Array(e);if(globalThis.crypto?.getRandomValues)globalThis.crypto.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>zT[n%32]).join("")}function Fw(){return`${Are(Date.now(),10)}${Ere(16)}`}function Ire(e){try{const t=[];return e.forEach((n,s)=>{typeof n=="string"?t.push({field:s,value:n}):t.push({field:s,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function Hw(e){try{const t=await e.text();return t?t.length>Dw?`${t.slice(0,Dw)}...`:t:void 0}catch{return}}class $re{constructor(t,n){this.origin=t,this.identity=n}async get(t,n){return this.request("GET",t,void 0,n)}async post(t,n,s){return this.request("POST",t,n,void 0,s?.allowCodes)}async postForm(t,n){const s=Of(this.origin,t),o=Fw(),i={"X-Request-Id":o};this.addClientHeaders(i);const r=Date.now();Cw({method:"POST",path:t,url:s,requestId:o,body:Ire(n)});let l;try{l=await fetch(s,{method:"POST",headers:i,body:n,signal:Bw()})}catch(u){throw vd({method:"POST",path:t,requestId:o,phase:"fetch",durationMs:Date.now()-r,error:u}),new dc({message:`Network error calling POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"fetch",timeoutMs:fc})}let a;const c=l.clone();try{a=await l.json()}catch(u){throw vd({method:"POST",path:t,requestId:o,phase:"parse",durationMs:Date.now()-r,status:l.status,error:u}),new dc({message:`Failed to parse JSON response from POST ${t}`,cause:u,method:"POST",path:t,url:s,requestId:o,phase:"parse",timeoutMs:fc,status:l.status,statusText:l.statusText,contentType:l.headers.get("content-type")??void 0,bodyPreview:await Hw(c)})}if(xw({method:"POST",path:t,requestId:o,status:l.status,durationMs:Date.now()-r,code:a.code,msg:a.msg,envelopeRequestId:a.request_id,data:a.data}),a.code!==0)throw new h1({code:a.code,msg:a.msg,requestId:a.request_id,details:a.details});return a.data}async patch(t,n){return this.request("PATCH",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,s,o,i=[]){let r=Of(this.origin,n);if(o){const m=new URLSearchParams;for(const[v,w]of Object.entries(o))w!==void 0&&m.set(v,String(w));const f=m.toString();f&&(r=`${r}?${f}`)}const l=Fw(),a={"X-Request-Id":l};this.addClientHeaders(a),s!==void 0&&(a["Content-Type"]="application/json; charset=utf-8");const c=Date.now();Cw({method:t,path:n,url:r,requestId:l,body:s});let u;try{u=await fetch(r,{method:t,headers:a,body:s!==void 0?JSON.stringify(s):void 0,signal:Bw()})}catch(m){throw vd({method:t,path:n,requestId:l,phase:"fetch",durationMs:Date.now()-c,error:m}),new dc({message:`Network error calling ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"fetch",timeoutMs:fc})}let d;const p=u.clone();try{d=await u.json()}catch(m){throw vd({method:t,path:n,requestId:l,phase:"parse",durationMs:Date.now()-c,status:u.status,error:m}),new dc({message:`Failed to parse JSON response from ${t} ${n}`,cause:m,method:t,path:n,url:r,requestId:l,phase:"parse",timeoutMs:fc,status:u.status,statusText:u.statusText,contentType:u.headers.get("content-type")??void 0,bodyPreview:await Hw(p)})}if(xw({method:t,path:n,requestId:l,status:u.status,durationMs:Date.now()-c,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),d.code!==0&&!i.includes(d.code))throw new h1({code:d.code,msg:d.msg,requestId:d.request_id,details:d.details});return d.data}addClientHeaders(t){this.identity!==void 0&&(t["X-CyberNeurova-Client-Id"]=this.identity.clientId,t["X-CyberNeurova-Client-Name"]=this.identity.clientName,t["X-CyberNeurova-Client-Version"]=this.identity.clientVersion,t["X-CyberNeurova-Client-Ui-Mode"]=this.identity.clientUiMode)}}class Nre{constructor(t,n,s){this.wsUrl=t,this.clientId=n,this.handlers=s}ws=null;connected=!1;closed=!1;subscriptions=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;reconnectAttempts=0;reconnectTimer=null;connect(){if(this.ws!==null||this.closed)return;Rl("connect",{url:this.wsUrl,attempt:this.reconnectAttempts});const t=new WebSocket(this.wsUrl);this.ws=t,t.onopen=()=>{Rl("open")},t.onmessage=n=>{try{const s=JSON.parse(String(n.data));$J(s),this.handleFrame(s)}catch(s){Rl("parse-error",{error:String(s)}),this.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},t.onerror=()=>{Rl("error"),this.handlers.onError(0,"WebSocket error",!1)},t.onclose=n=>{Rl("close",n?{code:n.code,reason:n.reason,wasClean:n.wasClean}:void 0),this.connected=!1,this.ws=null,this.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,Rl("reconnect-scheduled",{delayMs:n,attempt:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const s=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);s!==-1&&this.pendingSubscriptions.splice(s,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,s){const o=kd(t,n),i=this.terminalAttachments.get(o),r=s??i?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,s){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:s}})}terminalResize(t,n,s,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:s,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(kd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(kd(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}handleFrame(t){const n=t;switch(t.type){case"server_hello":this.onServerHello();break;case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const s=n.payload.session_id,o=n.payload.epoch;this.subscriptions.set(s,{seq:n.payload.current_seq,epoch:o}),this.handlers.onResync(s,n.payload.current_seq,o);break}case"error":{const s=n.session_id;typeof s=="string"&&this.handlers.onRawAgentEvent?this.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:s,timestamp:n.timestamp,payload:n.payload}):this.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":break;case"terminal_output":{const s=n.session_id,o=n.terminal_id,i=n.seq,r=kd(s,o),l=this.terminalAttachments.get(r);l&&this.terminalAttachments.set(r,{...l,lastSeq:Math.max(l.lastSeq,i)});const a=typeof n.payload?.data=="string"?n.payload.data:"";this.handlers.onTerminalOutput?.(s,o,a,i);break}case"terminal_exit":{const s=n.session_id,o=n.terminal_id,i=n.payload?.exit_code,r=typeof i=="number"?i:null;this.handlers.onTerminalExit?.(s,o,r);break}default:{this.trackCursor(n);const s=n.type,o=Tre(s,n.payload);if(o.route==="protocol"){this.handlers.onWireEvent(n);break}if(o.route==="agent"){if(this.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const i=n,r=n;this.handlers.onRawAgentEvent({type:o.agentType,seq:i.seq,session_id:i.session_id,timestamp:i.timestamp,payload:i.payload,...r.volatile!==void 0?{volatile:r.volatile}:{},...r.offset!==void 0?{offset:r.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const s of this.pendingSubscriptions)this.subscriptions.set(s.sessionId,s.cursor),t.includes(s.sessionId)||t.push(s.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[s,o]of this.subscriptions.entries())n[s]=o;this.send({type:"client_hello",id:this.nextId(),payload:{client_id:this.clientId,subscriptions:t,cursors:n}});for(const s of this.terminalAttachments.values())this.sendTerminalAttach(s.sessionId,s.terminalId,s.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n}})}sendTerminalAttach(t,n,s){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:s>0?s:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,s=t.seq;if(typeof n!="string"||typeof s!="number")return;const o=this.subscriptions.get(n);if(!o||s<=o.seq&&o.epoch!==void 0)return;const i=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(s,o.seq),epoch:i})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),IJ(t)}catch{}}nextId(){return`c_${++this.msgSeq}`}}function kd(e,t){return`${e}\0${t}`}function Xm(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function Ww(e){return e==="auto_compact"||e==="manual_compact"}class Lre{http;config;constructor(t){this.config=t,this.http=new $re(t.serverHttpUrl,{clientId:t.clientId,clientName:t.clientName,clientVersion:t.clientVersion,clientUiMode:t.clientUiMode})}async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[]}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,status:t?.status?Zie(t.status):void 0,include_archive:t?.includeArchive,workspace_id:t?.workspaceId},s=await this.http.get("/sessions",n);return{items:s.items.map(Go),hasMore:s.has_more}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const s=await this.http.post("/sessions",n);return Go(s)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Go(n)}async updateSession(t,n){const s={};n.title!==void 0&&(s.title=n.title),n.cwd!==void 0&&(s.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(s.agent_config=o);const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,s);return Go(i)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingLevel:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async listMessages(t,n){const s={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,s);return{items:o.items.map(u1),hasMore:o.has_more}}async getSessionSnapshot(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/snapshot`);return{asOfSeq:n.as_of_seq,epoch:n.epoch,session:Go(n.session),messages:n.messages.items.map(u1),hasMoreMessages:n.messages.has_more,inFlightTurn:n.in_flight_turn===null?null:{turnId:n.in_flight_turn.turn_id,assistantText:n.in_flight_turn.assistant_text,thinkingText:n.in_flight_turn.thinking_text,runningTools:n.in_flight_turn.running_tools.map(s=>({toolCallId:s.tool_call_id,name:s.name,args:s.args,description:s.description,lastProgress:s.last_progress})),promptId:n.in_flight_turn.current_prompt_id},pendingApprovals:n.pending_approvals.map(UT),pendingQuestions:n.pending_questions.map(qT)}}async submitPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,Jie(n));return{promptId:s.prompt_id,userMessageId:s.user_message_id,status:s.status}}async steerPrompts(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:s.steered,promptIds:s.prompt_ids}}async abortPrompt(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:s.aborted,atSeq:s.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async forkSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,s);return Go(o)}async createChildSession(t,n){const s={};n?.title!==void 0&&(s.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,s);return Go(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Go)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,ere(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,ore(s));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const s={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,s)).items.map(d1)}async getTask(t,n,s){const o={with_output:s?.withOutput,output_bytes:s?.outputBytes},i=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return d1(i)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Xm)}async createTerminal(t,n={}){const s={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,s);return Xm(o)}async getTerminal(t,n){const s=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Xm(s)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(s=>({name:s.name,description:s.description,source:s.source}))}async activateSkill(t,n,s){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s!==void 0&&s.length>0?{args:s}:{});return{activated:o.activated,skillName:o.skill_name}}async listDirectory(t,n){const s={};n.path!==void 0&&(s.path=n.path),n.depth!==void 0&&(s.depth=n.depth),n.includeGitStatus!==void 0&&(s.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,s),i=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(Iw)])):void 0;return{items:o.items.map(Iw),childrenByPath:i,truncated:o.truncated}}async readFile(t,n){const s={path:n.path};n.offset!==void 0&&(s.offset=n.offset),n.length!==void 0&&(s.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,s);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n){const s={query:n.query};n.limit!==void 0&&(s.limit=n.limit);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:search`,s);return{items:o.items.map(i=>({path:i.path,name:i.name,kind:i.kind,score:i.score,matchPositions:i.match_positions})),truncated:o.truncated}}async grepFiles(t,n){const s={pattern:n.pattern};n.regex!==void 0&&(s.regex=n.regex),n.caseSensitive!==void 0&&(s.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,s);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const s={};n!==void 0&&(s.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,s);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:s.path,diff:s.diff}}getFileDownloadUrl(t,n){const s=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Of(this.config.serverHttpUrl,`/sessions/${encodeURIComponent(t)}/fs/${s}:download`)}async openFile(t,n){const s={path:n.path};return n.line!==void 0&&(s.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,s)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,s,o){const i={app_id:n,path:s};o!==void 0&&(i.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,i)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Rf)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const s=await this.http.post("/workspaces",n);return Rf(s)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(s=>({name:s.name,path:s.path,isDir:s.is_dir,isGitRepo:s.is_git_repo,branch:s.branch}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(lre)}async listProviders(){return(await this.http.get("/providers")).items.map(Gm)}async addProvider(t){const n={type:t.type};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const s=await this.http.post("/providers",n);return Gm(s)}async deleteProvider(t){return this.http.delete(`/providers/${encodeURIComponent(t)}`)}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return Gm(n)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return{changed:t.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.unchanged,failed:t.failed}}async getConfig(){const t=await this.http.get("/config");return f1(t)}async setConfig(t){const n={},s={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultThinking:"default_thinking",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[i,r]of Object.entries(t)){const l=s[i];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return f1(o)}async getAuth(){const t=await this.http.get("/auth");return{ready:t.ready,providersCount:t.providers_count,defaultModel:t.default_model,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(){const t=await this.http.post("/oauth/login",{});return{flowId:t.flow_id,provider:t.provider,verificationUri:t.verification_uri,verificationUriComplete:t.verification_uri_complete,userCode:t.user_code,expiresIn:t.expires_in,interval:t.interval,status:t.status,expiresAt:t.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const s=await this.http.postForm("/files",n);return{id:s.id,name:s.name,mediaType:s.media_type,size:s.size}}getFileUrl(t){return Of(this.config.serverHttpUrl,`/files/${encodeURIComponent(t)}`)}connectEvents(t){const n=_J(this.config.serverHttpUrl,this.config.clientId),s=wre(),o=new Nre(n,this.config.clientId,{onWireEvent:i=>{const r=are(i),l=cre(i),a=rre(i);a.type==="historyCompacted"&&!Ww(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:i=>{const{type:r,seq:l,session_id:a,payload:c,offset:u}=i,d=s.project(r,c,a,{offset:u});for(const p of d)p.type==="historyCompacted"&&!Ww(p.reason)&&t.onResync(a,l),t.onEvent(p,{sessionId:a,seq:l})},onResync:(i,r,l)=>{s.reset(i),t.onResync(i,r,l)},onConnectionState:i=>{t.onConnectionChange(i)},onError:(i,r,l)=>{t.onError(i,r,l)},onTerminalOutput:(i,r,l,a)=>{t.onTerminalOutput?.(i,r,l,a)},onTerminalExit:(i,r,l)=>{t.onTerminalExit?.(i,r,l)}});return o.connect(),{subscribe(i,r){o.subscribe(i,r??{seq:0})},unsubscribe(i){o.unsubscribe(i)},seedSnapshot(i,r){if(r.inFlightTurn===null){s.reset(i);return}const l=s.seedInFlight(i,r.inFlightTurn);for(const a of l)t.onEvent(a,{sessionId:i,seq:r.asOfSeq})},bindNextPromptId(i,r){s.bindNextPromptId(i,r)},abort(i,r){o.abort(i,r)},terminalAttach(i,r,l){o.terminalAttach(i,r,l)},terminalInput(i,r,l){o.terminalInput(i,r,l)},terminalResize(i,r,l,a){o.terminalResize(i,r,l,a)},terminalDetach(i,r){o.terminalDetach(i,r)},terminalClose(i,r){o.terminalClose(i,r)},markSideChannelAgent(i){s.markSideChannelAgent(i)},close(){o.close()}}}}let Uw;function ot(){return Uw??=new Lre(gJ()),Uw}const VT="neurovaWeb.compaction",Ore="neurovaWeb.optimisticUserMessage";function Rre(){return{sessions:[],activeSessionId:void 0,messagesBySession:{},approvalsBySession:{},questionsBySession:{},tasksBySession:{},goalBySession:{},lastSeqBySession:{},compactionBySession:{},warnings:[]}}function Pre(e){return{...e,sessions:[...e.sessions],messagesBySession:{...e.messagesBySession},approvalsBySession:{...e.approvalsBySession},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},lastSeqBySession:{...e.lastSeqBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function Dre(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const s=e.lastSeqBySession[t]??0;n>s&&(e.lastSeqBySession[t]=n)}}function Zm(e){return e.role==="user"&&e.metadata?.[Ore]===!0}function Bre(e,t){return JSON.stringify(e.content)===JSON.stringify(t.content)}function qw(e){let t="",n=0;for(const s of e.content)s.type==="text"?t+=s.text:(s.type==="image"||s.type==="file")&&(n+=1);return{text:t,media:n}}function Fre(e,t){const n=qw(e),s=qw(t);return n.text===s.text&&n.media===s.media}function Hre(e,t){const n=t.promptId;if(n!==void 0)for(let s=e.length-1;s>=0;s--){const o=e[s];if(Zm(o)&&o.promptId===n)return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Zm(o)&&Bre(o,t))return s}for(let s=e.length-1;s>=0;s--){const o=e[s];if(Zm(o)&&Fre(o,t))return s}return-1}function Wre(e,t,n){let s=!1;const o=e.map(i=>{let r=!1;const l=i.content.map(a=>a.type!=="toolUse"||a.toolCallId!==t?a:(r=!0,{...a,outputLines:[...a.outputLines??[],n]}));return r?(s=!0,{...i,content:l}):i});return s?o:e}function Ure(e,t,n){const s=Pre(e);switch(Dre(s,n.sessionId,n.seq),t.type){case"sessionCreated":{s.sessions.some(i=>i.id===t.session.id)||(s.sessions=[t.session,...s.sessions]);break}case"sessionUpdated":{s.sessions=s.sessions.map(o=>o.id===t.session.id?t.session:o);break}case"sessionDeleted":{const o=t.sessionId;s.sessions=s.sessions.filter(i=>i.id!==o),delete s.messagesBySession[o],delete s.tasksBySession[o],delete s.goalBySession[o],delete s.approvalsBySession[o],delete s.questionsBySession[o],delete s.lastSeqBySession[o],s.activeSessionId===o&&(s.activeSessionId=void 0);break}case"sessionStatusChanged":{s.sessions=s.sessions.map(o=>o.id!==t.sessionId?o:{...o,status:t.status,currentPromptId:t.currentPromptId});break}case"sessionMetaUpdated":{s.sessions=s.sessions.map(o=>o.id===t.sessionId?{...o,title:t.title??o.title,lastPrompt:t.lastPrompt??o.lastPrompt}:o);break}case"sessionUsageUpdated":{s.sessions=s.sessions.map(o=>{if(o.id!==t.sessionId)return o;const i=t.model&&t.model.length>0?t.model:o.model;return{...o,usage:t.usage,model:i}});break}case"historyCompacted":break;case"compactionStarted":{s.compactionBySession={...s.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const o=t.sessionId,i=s.compactionBySession[o],{[o]:r,...l}=s.compactionBySession;if(s.compactionBySession=l,Object.prototype.hasOwnProperty.call(s.messagesBySession,o)){const a=s.messagesBySession[o]??[],c=`compaction_${o}_${n.seq}`;if(!a.some(u=>u.id===c)){const u={trigger:i?.trigger??"auto",tokensBefore:t.tokensBefore,tokensAfter:t.tokensAfter};s.messagesBySession[o]=[...a,{id:c,sessionId:o,role:"assistant",content:t.summary?[{type:"text",text:t.summary}]:[],createdAt:new Date().toISOString(),metadata:{origin:{kind:"compaction_summary"},[VT]:u}}]}}break}case"compactionCancelled":{const{[t.sessionId]:o,...i}=s.compactionBySession;s.compactionBySession=i;break}case"messageCreated":{const o=t.message.sessionId,i=s.messagesBySession[o]??[];if(!i.some(l=>l.id===t.message.id)){if(t.message.role==="user"){const l=Hre(i,t.message);if(l!==-1){const a=[...i],c=a[l];a[l]={...t.message,id:c.id,promptId:t.message.promptId??c.promptId,metadata:{...t.message.metadata,...c.metadata}},s.messagesBySession[o]=a;break}}s.messagesBySession[o]=[...i,t.message]}break}case"messageUpdated":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>r.id!==t.messageId?r:{...r,content:t.content,durationMs:t.durationMs??r.durationMs});break}case"assistantDelta":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=i.map(r=>{if(r.id!==t.messageId)return r;const l=[...r.content],a=t.contentIndex;for(;l.length<=a;)l.push({type:"text",text:""});const c=l[a];let u;return t.delta.text!==void 0?c.type==="text"?u={type:"text",text:c.text+t.delta.text}:u={type:"text",text:t.delta.text}:t.delta.thinking!==void 0?c.type==="thinking"?u={type:"thinking",thinking:c.thinking+t.delta.thinking,signature:c.signature}:u={type:"thinking",thinking:t.delta.thinking}:u=c,l[a]=u,{...r,content:l}});break}case"toolOutput":{const o=t.sessionId,i=s.messagesBySession[o]??[];s.messagesBySession[o]=Wre(i,t.toolCallId,t.outputChunk);break}case"approvalRequested":{const o=t.sessionId,i=s.approvalsBySession[o]??[];i.some(l=>l.approvalId===t.approval.approvalId)||(s.approvalsBySession[o]=[...i,t.approval]);break}case"approvalResolved":case"approvalExpired":{const o=t.sessionId,i=t.approvalId,r=s.approvalsBySession[o]??[];s.approvalsBySession[o]=r.filter(l=>l.approvalId!==i);break}case"questionRequested":{const o=t.sessionId,i=s.questionsBySession[o]??[];i.some(l=>l.questionId===t.question.questionId)||(s.questionsBySession[o]=[...i,t.question]);break}case"questionAnswered":case"questionDismissed":case"questionExpired":{const o=t.sessionId,i=t.questionId,r=s.questionsBySession[o]??[];s.questionsBySession[o]=r.filter(l=>l.questionId!==i);break}case"taskCreated":{const o=t.sessionId,i=s.tasksBySession[o]??[],r=i.findIndex(l=>l.id===t.task.id);if(r===-1)s.tasksBySession[o]=[...i,t.task];else{const l=[...i];l[r]=t.task,s.tasksBySession[o]=l}break}case"taskProgress":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>{if(r.id!==t.taskId)return r;const l=r.outputLines??[];return l.at(-1)===t.outputChunk?r:{...r,outputLines:[...l,t.outputChunk].slice(-40)}});break}case"taskCompleted":{const o=t.sessionId,i=s.tasksBySession[o]??[];s.tasksBySession[o]=i.map(r=>r.id!==t.taskId?r:{...r,status:t.status,outputPreview:t.outputPreview,outputBytes:t.outputBytes});break}case"goalUpdated":{const o=t.sessionId;t.goal===null||t.goal.status==="complete"?delete s.goalBySession[o]:s.goalBySession[o]=t.goal;break}case"configChanged":{s.config=t.config;break}case"agentDelta":case"agentTurnEnded":break;case"unknown":{const o=t.raw;if(!(o&&o._noop===!0))if(o&&(o._agentError||o._agentWarning)){const i=o._agentError?bn.global.t("warnings.errorLabel"):bn.global.t("warnings.noteLabel"),r=o.message??o.code??"agent error";s.warnings=[...s.warnings,`${i}: ${r}`]}else{const i=o?.type??"(unknown)";s.warnings=[...s.warnings,`Unhandled event: ${i}`]}break}}return s}const p1="/sessions/";function KT(e){const{pathname:t}=e;if(!t.startsWith(p1))return;const n=t.slice(p1.length);if(!(!n||n.includes("/")))try{const s=decodeURIComponent(n);return s.length>0?s:void 0}catch{return}}function qre(e){return e===void 0||e.length===0?"/":`${p1}${encodeURIComponent(e)}`}function jre(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function zre(e){const t=[];if(!e)return t;let n=0,s=0,o=!1;for(const i of e.split(`
250
+ `)){if(i.startsWith("diff --git")){o=!1;continue}if(!o&&jre(i))continue;if(i.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(i);a&&(n=Number.parseInt(a[1],10),s=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:i});continue}if(!o||i.startsWith("\\"))continue;const r=i.charAt(0),l=i.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:s}),s+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:s}),n+=1,s+=1)}return t}function GT(e,t){const n=new Set(e.map(o=>o.id)),s=t.filter(o=>o.kind==="subagent"&&!n.has(o.id));return s.length===0?e:[...e,...s]}const Vre=/^read[_-]?media(?:file)?$/i,Kre=/^agent$/i,Gre=/^data:([^;]+);base64,(.*)$/s,Yre=/^<(image|video|audio)\s+path="([^"]+)">$/,Xre=/Mime type:\s*([^.\s]+)/i,Zre=/Size:\s*(\d+)\s*bytes/i,Qre=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i;function Jre(e){if(e.length===0)return 0;const t=e.endsWith("==")?2:e.endsWith("=")?1:0;return Math.floor(e.length*3/4)-t}function ele(e){if(Array.isArray(e))return e;if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t:null}catch{return null}}function tle(e){const t=e.type,n=t==="image_url"?"image":t==="video_url"?"video":t==="audio_url"?"audio":null;if(n===null)return null;const o=e[n==="image"?"imageUrl":n==="video"?"videoUrl":"audioUrl"];if(typeof o!="object"||o===null)return null;const i=o.url;return typeof i=="string"?{kind:n,url:i}:null}function nle(e,t){if(!Vre.test(e))return;const n=ele(t);if(n===null)return;let s,o,i,r,l,a=null;for(const u of n){if(typeof u!="object"||u===null)continue;const d=u;if(d.type==="text"&&typeof d.text=="string"){const m=d.text,f=Yre.exec(m);f&&(o=f[1],s=f[2]);const v=Xre.exec(m);v?.[1]&&(i=v[1]);const w=Zre.exec(m);w?.[1]&&(r=Number(w[1]));const _=Qre.exec(m);_?.[1]&&_[2]&&(l=`${_[1]}x${_[2]}`);continue}const p=tle(d);p&&(a=p)}if(a===null)return;const c=Gre.exec(a.url);return c?.[1]&&(i=c[1]),c?.[2]&&(r=Jre(c[2])),{kind:a.kind??o??"image",url:a.url,path:s,mimeType:i,bytes:Number.isFinite(r)?r:void 0,dimensions:l}}function YT(e){if(e!=null){if(typeof e=="string")return e.split(`
251
+ `);if(Array.isArray(e)){const t=[];for(const n of e)if(typeof n=="string")t.push(...n.split(`
252
+ `));else if(n&&typeof n=="object"){const s=n;s.type==="text"&&typeof s.text=="string"?t.push(...s.text.split(`
253
+ `)):s.type==="think"&&typeof s.think=="string"?t.push(...s.think.split(`
254
+ `)):s.type==="image_url"||s.type==="image"?t.push("[image]"):typeof s.type=="string"?t.push(`[${s.type}]`):t.push(JSON.stringify(n))}return t.length>0?t:void 0}return[JSON.stringify(e)]}}function sle(e){return{id:e.id,toolCallId:e.parentToolCallId,name:e.description,subagentType:e.subagentType,phase:e.subagentPhase??(e.status==="completed"?"completed":e.status==="failed"?"failed":"working"),status:e.status,summary:e.outputPreview,outputLines:e.outputLines,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function ole(e){let t=null;if(typeof e=="string")try{const n=JSON.parse(e);n&&typeof n=="object"&&(t=n)}catch{t=null}else e&&typeof e=="object"&&(t=e);return t?{description:typeof t.description=="string"?t.description:void 0,subagentType:typeof t.subagent_type=="string"?t.subagent_type:void 0,prompt:typeof t.prompt=="string"?t.prompt:void 0}:{}}function ile(e,t,n,s){const o=ole(t),i=n?n.isError?"failed":"completed":s?"working":"completed",r=n?YT(n.output):void 0;return{id:e,toolCallId:e,name:o.description&&o.description.length>0?o.description:"Sub Agent",subagentType:o.subagentType,prompt:o.prompt,phase:i,status:n?n.isError?"failed":"completed":s?"running":"completed",summary:r&&r.length>0?r.join(`
255
+ `):void 0}}function rle(e,t){const n=e.swarmIndex??Number.MAX_SAFE_INTEGER,s=t.swarmIndex??Number.MAX_SAFE_INTEGER;return n!==s?n-s:e.createdAt.localeCompare(t.createdAt)}function lle(e,t){const n=e.split(`
256
+ `),s=t.split(`
257
+ `),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function ale(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:lle(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}return n==="shell"||n==="command"?{kind:"shell",command:typeof t.command=="string"?t.command:e.action,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:void 0}:n==="file_content"||n==="file"?{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0}:n==="file_op"||n==="fileop"?{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0}:n==="url_fetch"||n==="url"?{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action}:n==="search"?{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0}:n==="invocation"||n==="agent_call"||n==="skill_call"?{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0}:n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function cle(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"?t?.trigger==="user-slash":!1}function ule(e){return e.metadata?.origin?.kind==="compaction_summary"}function dle(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function XT(e,t,n,s=!0,o=[]){const i=[];let r=1;const l=new Map;for(const f of t)l.set(f.toolCallId,f);const a=new Map;for(const f of o){if(f.kind!=="subagent")continue;const v=[f.parentToolCallId,f.id].filter(w=>typeof w=="string"&&w.length>0);for(const w of v){const _=a.get(w)??[];_.push(f),a.set(w,_)}}for(const[f,v]of a.entries())a.set(f,v.toSorted(rle));const c=new Map;for(const f of e)for(const v of f.content)v.type==="toolResult"&&c.set(v.toolCallId,{output:v.output,isError:!!v.isError});let u=null;function d(f=!1){if(!u)return;const v=u;if(u=null,!f||!s)for(let w=0;w<v.tools.length;w++){const _=v.tools[w];if(_.status!=="running")continue;const b={..._,status:"ok"};v.tools[w]=b;const g=v.blocks.find(y=>y.kind==="tool"&&y.tool.id===b.id);g&&g.kind==="tool"&&(g.tool=b)}i.push({id:v.id,role:"assistant",no:r++,text:v.textParts.join(`
258
+ `),thinking:v.thinkingParts.length>0?v.thinkingParts.join(`
259
+ `):void 0,tools:v.tools.length>0?v.tools:void 0,blocks:v.blocks.length>0?v.blocks:void 0,approval:v.approval,approvalId:v.approvalId,durationMs:v.durationMs})}function p(f,v){for(const w of v)if(w.type==="text"){if(w.text){f.textParts.push(w.text);const _=f.blocks.at(-1);_&&_.kind==="text"?_.text+=`
260
+ `+w.text:f.blocks.push({kind:"text",text:w.text})}}else if(w.type==="thinking"){if(w.thinking){f.thinkingParts.push(w.thinking);const _=f.blocks.at(-1);_&&_.kind==="thinking"?_.thinking+=`
261
+ `+w.thinking:f.blocks.push({kind:"thinking",thinking:w.thinking})}}else if(w.type==="toolUse"){const _=a.get(w.toolCallId);if(_&&_.length>0){if(_.filter($=>$.swarmIndex!==void 0).length>1)continue;const k=_.map(sle);k.length===1?f.blocks.push({kind:"agent",member:k[0]}):f.blocks.push({kind:"agentGroup",members:k});continue}if(Kre.test(w.toolName)){const y=ile(w.toolCallId,w.input,c.get(w.toolCallId),s);f.blocks.push({kind:"agent",member:y});continue}const b=l.get(w.toolCallId),g={id:w.toolCallId,name:w.toolName,arg:typeof w.input=="string"?w.input:JSON.stringify(w.input),status:"running",output:w.outputLines};f.tools.push(g),f.blocks.push({kind:"tool",tool:g}),b&&(f.approval=ale(b),f.approvalId=b.approvalId)}else if(w.type==="toolResult"){const _=f.tools.findIndex(b=>b.id===w.toolCallId);if(_!==-1){const b=f.tools[_],g={...b,status:w.isError?"error":"ok",output:YT(w.output),media:w.isError?void 0:nle(b.name,w.output)};f.tools[_]=g;const y=f.blocks.find(k=>k.kind==="tool"&&k.tool.id===w.toolCallId);y&&y.kind==="tool"&&(y.tool=g)}}}function m(f){if(f.type==="image"||f.type==="video"){const v=f.type,w=f.source;if(w.kind==="url")return{url:w.url,kind:v};if(w.kind==="base64")return{url:`data:${w.mediaType};base64,${w.data}`,kind:v};if(w.kind==="file"&&n)return{url:n(w.fileId),kind:v}}if(f.type==="file"&&n){if(f.mediaType.startsWith("image/"))return{url:n(f.fileId),kind:"image"};if(f.mediaType.startsWith("video/"))return{url:n(f.fileId),kind:"video"}}}for(const f of e){if(f.role==="system")continue;if(ule(f)){d();const g=f.metadata?.[VT];i.push({id:f.id,role:"compaction",no:r,text:f.content.filter(y=>y.type==="text").map(y=>y.text).join(`
262
+ `),compaction:{trigger:g?.trigger,tokensBefore:g?.tokensBefore,tokensAfter:g?.tokensAfter}});continue}if(f.role==="user"){if(d(),!cle(f))continue;const g=f.metadata?.origin,y=g?.kind==="skill_activation"&&g?.trigger==="user-slash",k=[],$=[];for(const E of f.content){E.type==="text"&&(y?k.push(g.skillArgs??""):k.push(E.text));const S=m(E);S&&$.push({url:S.url,kind:S.kind,alt:E.type==="file"?E.name:void 0})}i.push({id:f.id,role:"user",no:r++,text:k.join(`
263
+ `),images:$.length>0?$:void 0,skillActivation:y?{name:g.skillName,args:g.skillArgs}:void 0,createdAt:f.createdAt});continue}if(f.role==="tool"){u&&p(u,f.content);continue}const v=f.promptId;dle(u,v)?u!==null&&u.promptId===void 0&&v!==void 0&&(u.promptId=v):(d(),u={id:f.id,promptId:v,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,durationMs:f.durationMs});const _=u;if(_===null)continue;const b=JSON.stringify(f.content);_.promptId!==void 0&&_.seenSigs.has(b)||(_.seenSigs.add(b),p(_,f.content))}return d(!0),i}function fle(e){return e==="in_progress"?"in_progress":e==="done"||e==="completed"?"done":"pending"}function hle(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role==="assistant")for(let s=n.content.length-1;s>=0;s--){const o=n.content[s];if(o.type!=="toolUse"||ru(o.toolName)!=="todo")continue;let i=o.input;if(typeof i=="string")try{i=JSON.parse(i)}catch{continue}const r=i?.todos;if(Array.isArray(r))return r.flatMap(l=>{const a=l??{},c=typeof a.title=="string"?a.title:typeof a.content=="string"?a.content:"";return c?[{title:c,status:fle(a.status)}]:[]})}}return[]}const ple=["queued","working","suspended","completed","failed"];function mle(e){return e.subagentPhase?e.subagentPhase:e.status==="completed"?"completed":e.status==="failed"?"failed":"working"}function gle(){return{queued:0,working:0,suspended:0,completed:0,failed:0}}function vle(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const s=n.parentToolCallId??"swarm",o=t.get(s)??[];o.push({id:n.id,name:n.description,subagentType:n.subagentType,phase:mle(n),summary:n.outputPreview,outputLines:n.outputLines,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(s,o)}return[...t.entries()].map(([n,s])=>{const o=s.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),i=gle();for(const r of o)i[r.phase]++;return{id:n,members:o,counts:i}}).filter(n=>n.members.length>1).toSorted((n,s)=>{const o=n.members.at(0)?.swarmIndex??0,i=s.members.at(0)?.swarmIndex??0;return o!==i?o-i:n.id.localeCompare(s.id)})}function yle(e){let t=0,n=0;for(const s of e){n+=s.members.length;for(const o of ple)(o==="completed"||o==="failed")&&(t+=s.counts[o])}return{done:t,total:n}}const ZT="cyberneurova-web.permission",Eh="cyberneurova-active-workspace",QT="cyberneurova-web.thinking",JT="cyberneurova-web.plan-mode",e3="cyberneurova-web.swarm-mode",t3="cyberneurova-web.goal-mode",n3="cyberneurova-web.theme",s3="cyberneurova-web.ui-font-size",o3="cyberneurova-web.starred-models",i3="cyberneurova-web.unread",m1=15,kle=12,ble=20,jw=40401,_le=40402,r3="cyberneurova-web.onboarded",wle=["off","low","medium","high","xhigh","max"];try{localStorage.removeItem("cyberneurova-web.code-font")}catch{}const l3="cyberneurova-web.accent",a3=["blue","mono"];function Sle(){try{const e=localStorage.getItem(l3);if(e&&a3.includes(e))return e}catch{}return"blue"}function Cle(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.accent=e)}const c3="cyberneurova-web.color-scheme",u3=["light","dark","system"];function xle(){try{const e=localStorage.getItem(c3);if(e&&u3.includes(e))return e}catch{}return"system"}function Tle(e){try{localStorage.setItem(c3,e)}catch{}}function Mle(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?"#0d1117":e==="light"?"#ffffff":null;t.forEach(s=>{const i=(s.getAttribute("media")??"").includes("dark")?"#0d1117":"#ffffff";s.setAttribute("content",n??i)})}function Ale(){try{const e=localStorage.getItem(ZT);if(e==="auto"||e==="yolo"||e==="manual")return e}catch{}return"manual"}function Ele(e){try{localStorage.setItem(ZT,e)}catch{}}function Ile(){try{const e=localStorage.getItem(QT);if(e&&wle.includes(e))return e}catch{}return"high"}function g1(e){try{localStorage.setItem(QT,e)}catch{}}function $le(){try{return localStorage.getItem(JT)==="true"}catch{return!1}}function Nle(e){try{localStorage.setItem(JT,e?"true":"false")}catch{}}function Lle(){try{return localStorage.getItem(e3)==="true"}catch{return!1}}function Ole(e){try{localStorage.setItem(e3,e?"true":"false")}catch{}}function Rle(){try{return localStorage.getItem(t3)==="true"}catch{return!1}}function d3(e){try{localStorage.setItem(t3,e?"true":"false")}catch{}}function Ple(){try{const e=localStorage.getItem(i3);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[s,o]of Object.entries(t))o===!0&&(n[s]=!0);return n}catch{return{}}}function f3(e){try{const t={};for(const[n,s]of Object.entries(e))s&&(t[n]=!0);localStorage.setItem(i3,JSON.stringify(t))}catch{}}function Dle(){try{const e=localStorage.getItem(o3);if(!e)return[];const t=JSON.parse(e);if(Array.isArray(t)&&t.every(n=>typeof n=="string"))return t}catch{}return[]}function Ble(e){try{localStorage.setItem(o3,JSON.stringify(e))}catch{}}function Fle(){try{const e=localStorage.getItem(n3);if(e==="terminal"||e==="modern"||e==="cyberneurova")return e}catch{}return"modern"}function Hle(e){try{localStorage.setItem(n3,e)}catch{}}function Ih(e){return Number.isFinite(e)?Math.min(ble,Math.max(kle,Math.round(e))):m1}function Wle(){try{const e=localStorage.getItem(s3);return e===null?m1:Ih(Number(e))}catch{return m1}}function Ule(e){try{localStorage.setItem(s3,String(Ih(e)))}catch{}}function qle(e){typeof document>"u"||!document.documentElement||document.documentElement.style.setProperty("--ui-font-size",`${Ih(e)}px`)}function jle(){try{return localStorage.getItem(Eh)}catch{return null}}const h3="cyberneurova-web.hidden-workspaces";function zle(){try{const e=localStorage.getItem(h3);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function Dv(e){try{localStorage.setItem(h3,JSON.stringify(e))}catch{}}function Bv(e){try{localStorage.setItem(Eh,e)}catch{}}function p3(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}function Vle(e,t){if(t&&e.startsWith(t)){const s=e.slice(t.length);return s?`~${s}`:"~"}const n=e.match(/^\/(?:Users|home)\/[^/]+(\/.*)?$/);return n?`~${n[1]??""}`:e}const W=Vs({...Rre(),connected:!1,serverVersion:"",workspaceName:"cyberneurova-web",connection:"disconnected",permission:Ale(),thinking:Ile(),planMode:$le(),swarmMode:Lle(),goalMode:Rle(),loading:!1,sessionLoading:!1,queuedBySession:{},gitStatusBySession:{},promptIdBySession:{},sendingBySession:{},unreadBySession:Ple(),authReady:!1,defaultModel:null,managedProviderStatus:null,workspaces:[],activeWorkspaceId:jle(),fsHome:null,recentRoots:[],hiddenWorkspaceRoots:zle(),availableOpenInApps:[],config:null,sideChatMessagesByAgent:{},sideChatSendingByAgent:{},sideChatUserMessageIdsBySession:{},messagesLoadingMoreBySession:{},messagesHasMoreBySession:{},messagesLoadMoreErrorBySession:{}}),$h=te([]),Bd=te(Dle()),Pf=te({}),Df=te([]),Kle=600,Gle=250,Nh=250,Yle=1e3,Xle=160,Bf=te(!1);let Yr=[],Qr=null,Ff=-Nh;const Zle=1e3,Qle=4096,m3=32*1024;let Ec=null,v1,Xc=new Set;function g3(){Yr=[],Ff=-Nh,Bf.value=!1,Qr!==null&&(clearTimeout(Qr),Qr=null)}function Jle(){Bf.value=!0,Qr!==null&&clearTimeout(Qr),Qr=setTimeout(()=>{Qr=null,Yr=[],Ff=-Nh,Bf.value=!1},Yle)}function eae(e){if(e<=0)return;const t=Date.now();Yr.push({time:t,chars:e});const n=t-Kle;if(Yr=Yr.filter(l=>l.time>=n),t-Ff<Nh)return;Ff=t;const s=Yr[0]?.time??t,o=Math.max(t-s,Gle);Yr.reduce((l,a)=>l+a.chars,0)/o*1e3>=Xle&&Jle()}const Zc=te(null);function v3(e){if(!(e==null||e.length===0))return $h.value.find(t=>t.id===e||t.model===e)}function tae(){const e=W.activeSessionId?W.sessions.find(t=>t.id===W.activeSessionId):void 0;return v3(e?.model??Zc.value??W.defaultModel)}function Fv(e){const t=PT(tae(),e);return W.thinking=t,g1(t),t}const jl=te(null),Ic=te([]),Hf=te(!1);async function Lh(e){let t;try{t=await ot().getSessionStatus(e)}catch{return}W.sessions=W.sessions.map(n=>n.id===e?{...n,model:t.model||n.model,usage:{...n.usage,contextTokens:t.contextTokens,contextLimit:t.maxContextTokens}}:n),W.swarmMode=t.swarmMode,W.planMode=t.planMode}function Oh(e){const t=W.activeSessionId;t&&Promise.resolve(ot().updateSession(t,e)).then(()=>Lh(t)).catch(()=>{})}const Rh=te(Fle());function nae(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.theme=e)}Ve(Rh,nae,{immediate:!0});function y3(e){e!=="terminal"&&e!=="modern"&&e!=="cyberneurova"||(Rh.value=e,Hle(e))}function sae(){y3(Rh.value==="modern"?"terminal":"modern")}const Hv=te(Wle());Ve(Hv,qle,{immediate:!0});function oae(e){const t=Ih(e);Hv.value=t,Ule(t)}const k3="cyberneurova-web.beta-toc";function iae(){try{return localStorage.getItem(k3)==="true"}catch{return!1}}function rae(e){try{localStorage.setItem(k3,e?"true":"false")}catch{}}const b3=te(iae());function lae(e){b3.value=e,rae(e)}const Wv=te(xle());Ve(Wv,Mle,{immediate:!0});function aae(e){u3.includes(e)&&(Wv.value=e,Tle(e))}const Uv=te(Sle());Ve(Uv,Cle,{immediate:!0});function cae(e){if(a3.includes(e)){Uv.value=e;try{localStorage.setItem(l3,e)}catch{}}}const y1="cyberneurova-web.notify-on-complete";function uae(){try{const e=localStorage.getItem(y1);return e===null?!0:e==="1"}catch{return!0}}const Wf=te(uae()),qv=te(typeof Notification<"u"?Notification.permission:"denied");async function dae(e){if(!e){Wf.value=!1;try{localStorage.setItem(y1,"0")}catch{}return}if(typeof Notification>"u")return;let t=Notification.permission;if(t==="default")try{t=await Notification.requestPermission()}catch{}if(qv.value=t,t==="granted"){Wf.value=!0;try{localStorage.setItem(y1,"1")}catch{}}}function fae(e){if(!Wf.value||typeof Notification>"u")return;const t=Notification.permission;if(t!=="denied"){if(t==="default"){Notification.requestPermission().then(n=>{qv.value=n,n==="granted"&&zw(e)});return}zw(e)}}function zw(e){if(e===W.activeSessionId&&typeof document<"u"&&document.visibilityState==="visible")return;const s=W.sessions.find(o=>o.id===e)?.title?.trim()||"CyberNeurova";try{const o=new Notification(s,{body:bn.global.t("settings.notifyBody"),tag:`cyberneurova-complete-${e}`});o.onclick=()=>{try{window.focus()}catch{}Rs(e),o.close()}}catch{}}function hae(e){try{return localStorage.getItem(e)??""}catch{return""}}const _3=te(hae(r3)==="1");function pae(e){_3.value=e;try{localStorage.setItem(r3,e?"1":"0")}catch{}}let ei=null,Vw=0;function Ph(){return Vw+=1,`msg_opt_${Date.now().toString(36)}_${Vw}`}const Qo=new Set;function mae(e,t,n){const s={sessions:W.sessions,activeSessionId:W.activeSessionId,messagesBySession:W.messagesBySession,approvalsBySession:W.approvalsBySession,questionsBySession:W.questionsBySession,tasksBySession:W.tasksBySession,goalBySession:W.goalBySession,lastSeqBySession:W.lastSeqBySession,compactionBySession:W.compactionBySession,config:W.config,warnings:W.warnings},o=Ure(s,e,{sessionId:t,seq:n});W.sessions=o.sessions,W.activeSessionId=o.activeSessionId,W.messagesBySession=o.messagesBySession,W.approvalsBySession=o.approvalsBySession,W.questionsBySession=o.questionsBySession,W.tasksBySession=o.tasksBySession,W.goalBySession=o.goalBySession,W.lastSeqBySession=o.lastSeqBySession,W.compactionBySession=o.compactionBySession,W.config=o.config??null,W.warnings=o.warnings,e.type==="configChanged"&&(W.defaultModel=e.config.defaultModel??null),e.type==="sessionUsageUpdated"&&e.sessionId===W.activeSessionId&&e.swarmMode!==void 0&&(W.swarmMode=e.swarmMode),e.type==="sessionUsageUpdated"&&e.sessionId===W.activeSessionId&&e.planMode!==void 0&&(W.planMode=e.planMode)}function jv(){if(ei!==null||typeof WebSocket>"u")return;W.connection="connecting",ei=ot().connectEvents({onEvent(t,n){if(t.type==="workspaceCreated"||t.type==="workspaceUpdated"||t.type==="workspaceDeleted"){Kce(t);return}mae(t,n.sessionId,n.seq);const s=xo.value[n.sessionId];if(s){const{agentId:o}=s,i=n.sessionId;t.type==="agentDelta"&&t.agentId===o?t.delta.text&&k1(o,i,t.delta.text):t.type==="agentTurnEnded"&&t.agentId===o?Gw(o,i):t.type==="taskProgress"&&t.taskId===o?k1(o,i,t.outputChunk):t.type==="taskCompleted"&&t.taskId===o&&Gw(o,i,t.outputPreview)}if(t.type==="messageCreated"&&t.message.role==="user"&&t.message.promptId!==void 0){const o=t.message.sessionId;W.promptIdBySession[o]!==t.message.promptId&&(W.promptIdBySession={...W.promptIdBySession,[o]:t.message.promptId})}if(t.type==="assistantDelta"&&n.sessionId===W.activeSessionId&&eae((t.delta.text?.length??0)+(t.delta.thinking?.length??0)),t.type==="sessionStatusChanged"&&(t.status==="idle"||t.status==="aborted")&&Hce(t.sessionId),t.type==="approvalRequested"){const o=W.permission;(o==="auto"||o==="yolo")&&Yv(t.approval.approvalId,{decision:"approved",scope:o==="yolo"?"session":void 0})}},onResync(t,n,s){s!==void 0&&(Dh[t]=s),zv(t)},onError(t,n,s){S3({severity:"error",title:bn.global.t("warnings.wsTitle"),message:n,details:[Ln("message",n)].filter(o=>o!==void 0)})},onConnectionChange(t){W.connected=t,W.connection=t?"connected":"disconnected"}})}const Dh={},Qc=new Set;function gae(e){return fu(e)&&e.code===jw?!0:typeof e=="object"&&e!==null&&e.code===jw}function Ln(e,t){if(!(t==null||t===""))return{label:bn.global.t(`warnings.details.${e}`),value:w3(t)}}function w3(e){if(e instanceof Error)return e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function vae(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.name=="string"?e.name:void 0}function yae(e){return e instanceof Error||typeof e=="object"&&e!==null&&typeof e.message=="string"?e.message:void 0}function kae(e,t,n){const s=[Ln("operation",e),Ln("sessionId",n)];return jT(t)?s.push(Ln("request",`${t.method} ${t.path}`),Ln("endpoint",t.url),Ln("requestId",t.requestId),Ln("phase",t.phase),Ln("timeout",`${t.timeoutMs}ms`),Ln("status",t.status===void 0?void 0:`${t.status} ${t.statusText??""}`.trim()),Ln("contentType",t.contentType),Ln("responsePreview",t.bodyPreview),Ln("cause",t.cause)):fu(t)?s.push(Ln("code",t.code),Ln("requestId",t.requestId),Ln("message",t.message),Ln("details",t.details)):s.push(Ln("errorName",vae(t)),Ln("message",yae(t)??w3(t))),s.filter(o=>o!==void 0)}function bae(e,t,n={}){const s=jT(t),o=fu(t),i=n.title??(s?bn.global.t("warnings.daemonNetworkTitle"):o?bn.global.t("warnings.daemonApiTitle"):bn.global.t("warnings.operationFailedTitle")),r=n.message??(s?bn.global.t("warnings.daemonNetworkMessage"):o?t.message:bn.global.t("warnings.operationFailedMessage"));return{severity:"error",title:i,message:r,details:kae(e,t,n.sessionId)}}function S3(e){W.warnings=[...W.warnings,e]}function St(e,t,n){S3(bae(e,t,n))}const _ae={40913:"warnings.goal.alreadyExists",40914:"warnings.goal.notFound",40915:"warnings.goal.statusInvalid",40916:"warnings.goal.notResumable",40918:"warnings.goal.objectiveTooLong"};function C3(e){if(!fu(e))return;const t=_ae[e.code];return t?bn.global.t(t):void 0}async function wae(e){if(W.sessions=W.sessions.filter(n=>n.id!==e),delete W.messagesBySession[e],delete W.approvalsBySession[e],delete W.questionsBySession[e],delete W.tasksBySession[e],delete W.goalBySession[e],delete W.gitStatusBySession[e],delete W.lastSeqBySession[e],delete W.compactionBySession[e],delete W.messagesLoadingMoreBySession[e],delete W.messagesHasMoreBySession[e],delete W.messagesLoadMoreErrorBySession[e],delete Dh[e],Qc.delete(e),W.activeSessionId!==e)return;const t=W.sessions[0];t?await Rs(t.id,{urlMode:"replace"}):(W.activeSessionId=void 0,W.sessionLoading=!1,Sr(void 0,"replace"))}async function zv(e){try{const n=await ot().getSessionSnapshot(e);return W.sessions=W.sessions.map(s=>s.id===e?{...n.session,model:n.session.model&&n.session.model.length>0?n.session.model:s.model}:s),W.messagesBySession={...W.messagesBySession,[e]:n.messages},W.messagesHasMoreBySession={...W.messagesHasMoreBySession,[e]:n.hasMoreMessages},W.approvalsBySession={...W.approvalsBySession,[e]:n.pendingApprovals},W.questionsBySession={...W.questionsBySession,[e]:n.pendingQuestions},W.lastSeqBySession={...W.lastSeqBySession,[e]:n.asOfSeq},Dh[e]=n.epoch,jv(),ei&&(ei.seedSnapshot(e,n),ei.subscribe(e,{seq:n.asOfSeq,epoch:n.epoch})),"ok"}catch(t){return gae(t)?(await wae(e),"not-found"):(St("getSessionSnapshot",t,{title:bn.global.t("warnings.sessionSnapshotTitle"),message:bn.global.t("warnings.sessionSnapshotMessage"),sessionId:e}),"failed")}}const Sae=50;async function Cae(e){if(W.messagesLoadingMoreBySession[e])return;const t=W.messagesBySession[e];if(!t||t.length===0)return;const n=t[0].id;W.messagesLoadingMoreBySession={...W.messagesLoadingMoreBySession,[e]:!0},W.messagesLoadMoreErrorBySession={...W.messagesLoadMoreErrorBySession,[e]:!1};try{const s=await ot().listMessages(e,{beforeId:n,pageSize:Sae}),o=[...s.items].reverse(),i=W.messagesBySession[e]??t;W.messagesBySession={...W.messagesBySession,[e]:[...o,...i]},W.messagesHasMoreBySession={...W.messagesHasMoreBySession,[e]:s.hasMore}}catch(s){W.messagesLoadMoreErrorBySession={...W.messagesLoadMoreErrorBySession,[e]:!0},St("loadOlderMessages",s,{sessionId:e})}finally{W.messagesLoadingMoreBySession={...W.messagesLoadingMoreBySession,[e]:!1}}}async function xae(e){try{const n=await ot().listTasks(e);W.tasksBySession={...W.tasksBySession,[e]:GT(n,W.tasksBySession[e]??[])},await Tae(e,n)}catch{}}async function Tae(e,t){if(W.activeSessionId!==e)return;const n=t??W.tasksBySession[e]??[],s=ot(),o=new Map;if(await Promise.all(n.map(async r=>{if((r.status==="completed"||r.status==="failed"||r.status==="cancelled")&&!Xc.has(r.id)&&!((r.outputLines?.length??0)>0))try{const a=await s.getTask(e,r.id,{withOutput:!0,outputBytes:m3});a.outputPreview!==void 0&&o.set(r.id,{preview:a.outputPreview,bytes:a.outputBytes})}catch{}finally{Xc.add(r.id)}})),o.size===0)return;const i=W.tasksBySession[e]??[];W.tasksBySession={...W.tasksBySession,[e]:i.map(r=>{const l=o.get(r.id);return l?{...r,outputPreview:l.preview,outputBytes:l.bytes}:r})}}async function Kw(e){if(W.activeSessionId!==e)return;const t=ot();let n;try{n=await t.listTasks(e)}catch{return}const s=new Map;await Promise.all(n.map(async l=>{const a=l.status==="running",c=l.status==="completed"||l.status==="failed"||l.status==="cancelled";if(!(!a&&!c)&&!(c&&(Xc.has(l.id)||(l.outputLines?.length??0)>0)))try{const u=await t.getTask(e,l.id,{withOutput:!0,outputBytes:a?Qle:m3});u.outputPreview!==void 0&&s.set(l.id,{preview:u.outputPreview,bytes:u.outputBytes})}catch{}finally{c&&Xc.add(l.id)}}));const o=W.tasksBySession[e]??[],i=new Map(o.map(l=>[l.id,l])),r=n.map(l=>{const a=i.get(l.id),c=s.get(l.id);return{...l,outputLines:a?.outputLines,outputPreview:c?.preview??a?.outputPreview,outputBytes:c?.bytes??a?.outputBytes}});W.tasksBySession={...W.tasksBySession,[e]:GT(r,o)}}function Mae(e){Ec!==null&&v1===e||(Uf(),v1=e,Kw(e),Ec=setInterval(()=>{typeof document<"u"&&document.visibilityState==="hidden"||(W.activeSessionId===e?Kw(e):Uf())},Zle))}function Uf(){Ec!==null&&(clearInterval(Ec),Ec=null),v1=void 0,Xc.clear()}async function Aae(e){try{const n=await ot().listSkills(e);Pf.value={...Pf.value,[e]:n}}catch{}}function Eae(e){return Object.prototype.hasOwnProperty.call(W.messagesBySession,e)}function Iae(e){if(jv(),ei){const t=W.lastSeqBySession[e]??0,n=Dh[e];ei.subscribe(e,{seq:t,epoch:n})}}function $ae(e){xae(e),Kv(e),Lh(e),Object.prototype.hasOwnProperty.call(Pf.value,e)||Aae(e)}function Bh(e){const t=W.sessions.find(i=>i.id===e);if(!t||t.status!=="running")return!1;const n=xo.value[e]?.agentId,o=(W.tasksBySession[e]??[]).filter(i=>i.status==="running");return o.length===0?!(n&&W.sideChatSendingByAgent[n]):o.some(i=>i.id!==n)}function Vv(e,t){try{const n=new Date(e),o=Date.now()-n.getTime(),i=o/36e5;return o<6e4?bn.global.t("sessions.justNow"):i<1?`${Math.round(o/6e4)}m`:i<24?`${Math.round(i)}h`:n.toLocaleDateString(bn.global.locale.value,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}const Nae=3e4,Jc=te(0);let Qm=null;function Lae(){Qm===null&&(Qm=setInterval(()=>{Jc.value=(Jc.value+1)%Number.MAX_SAFE_INTEGER},Nae),Qm.unref?.())}function Oae(e,t){const n=e.split(`
264
+ `),s=t.split(`
265
+ `),o=[];return n.forEach((i,r)=>{o.push({kind:"rem",gutter:String(r+1),text:`- ${i}`})}),s.forEach((i,r)=>{o.push({kind:"add",gutter:String(r+1),text:`+ ${i}`})}),o}function Rae(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const s=typeof t.path=="string"?t.path:"";return Array.isArray(t.diff)?{kind:"diff",path:s,diff:t.diff}:typeof t.old_text=="string"&&typeof t.new_text=="string"?{kind:"diff",path:s,diff:Oae(t.old_text,t.new_text)}:{kind:"diff",path:s,diff:[]}}if(n==="shell"||n==="command"){const s=typeof t.command=="string"?t.command:e.action,o=typeof t.cwd=="string"?t.cwd:void 0,i=typeof t.danger=="string"?t.danger:void 0;return{kind:"shell",command:s,cwd:o,danger:i}}if(n==="file_content"||n==="file"){const s=typeof t.path=="string"?t.path:"",o=typeof t.content=="string"?t.content:"",i=typeof t.language=="string"?t.language:void 0;return{kind:"file",path:s,content:o,language:i}}if(n==="file_op"||n==="fileop"){const s=typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,o=typeof t.path=="string"?t.path:"",i=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:s,path:o,detail:i}}if(n==="url_fetch"||n==="url"){const s=typeof t.url=="string"?t.url:e.action;return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:s}}if(n==="search"){const s=typeof t.query=="string"?t.query:e.action,o=typeof t.scope=="string"?t.scope:void 0;return{kind:"search",query:s,scope:o}}if(n==="invocation"||n==="agent_call"||n==="skill_call"){const s=typeof t.kind=="string"?t.kind:n,o=typeof t.name=="string"?t.name:e.toolName,i=typeof t.description=="string"?t.description:void 0;return{kind:"invocation",kind2:s,name:o,description:i}}return n==="todo"||n==="todo_list"?{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(i=>{const r=i??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})}:{kind:"generic",summary:e.action}}function Pae(e){return{questionId:e.questionId,sessionId:e.sessionId,questions:e.questions.map(t=>({id:t.id,question:t.question,header:t.header,body:t.body,options:t.options.map(n=>({id:n.id,label:n.label,description:n.description,recommended:n.recommended})),multiSelect:t.multiSelect,allowOther:t.allowOther,otherLabel:t.otherLabel}))}}function Dae(e){const t=W.messagesBySession[e.sessionId];if(!t||t.length===0)return;const n=new Map;for(const o of t)if(o.role==="assistant")for(const i of o.content){if(i.type!=="toolUse"||i.toolName!=="Bash"&&i.toolName!=="bash")continue;const r=i.input,l=r&&typeof r.command=="string"?r.command:void 0;l&&n.set(i.toolCallId,l)}if(n.size===0)return;const s=`task_id: ${e.id}`;for(const o of t)if(o.role==="tool")for(const i of o.content){if(i.type!=="toolResult")continue;if((typeof i.output=="string"?i.output:i.output!==void 0?JSON.stringify(i.output):"").includes(s)){const l=n.get(i.toolCallId);if(l)return l}}}function Bae(e){let t;e.status==="running"?t="run":e.status==="completed"?t="done":t="fail";let n="";if(e.status==="running"&&e.startedAt){const r=Math.round((Date.now()-new Date(e.startedAt).getTime())/1e3),l=Math.floor(r/60),a=r%60;n=bn.global.t("tasks.timingRunning",{time:`${l}:${String(a).padStart(2,"0")}`})}else if(e.completedAt&&e.startedAt){const r=Math.round((new Date(e.completedAt).getTime()-new Date(e.startedAt).getTime())/1e3);n=bn.global.t("tasks.timingDone",{sec:r})}else n=e.status;const s=e.outputLines&&e.outputLines.length>0?e.outputLines:e.outputPreview?e.outputPreview.split(/\r?\n/):void 0,o=e.command??Dae(e),i=e.kind==="bash"&&o?`$ ${o}`:void 0;return{id:e.id,name:e.description,kind:e.kind,state:t,timing:n,meta:i,output:s}}const Fae=j(()=>{const e=W.sessions.find(n=>n.id===W.activeSessionId),t=e?e.cwd.split("/").pop()??e.cwd:"main";return{name:W.workspaceName,branch:t}}),Hae=j(()=>(Jc.value,W.sessions.toSorted((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()).map(e=>({id:e.id,title:e.title,time:Vv(e.updatedAt,e.status),status:e.status,busy:Bh(e.id)})))),Wae=j(()=>W.activeSessionId??""),Uae=j(()=>{const e=W.activeSessionId;return e?Pf.value[e]??[]:[]}),qae=j(()=>{const e=W.activeSessionId;return e?W.sendingBySession[e]??!1:!1}),Fh=j(()=>{const e=W.activeSessionId;if(!e)return[];const t=xo.value[e]?.agentId;return(W.tasksBySession[e]??[]).filter(n=>n.id!==t)}),jae=j(()=>{const e=W.activeSessionId;if(!e)return[];const t=new Set(W.sideChatUserMessageIdsBySession[e]??[]),n=(W.messagesBySession[e]??[]).filter(o=>!t.has(o.id)),s=W.approvalsBySession[e]??[];return XT(n,s,o=>ot().getFileUrl(o),hu.value!=="idle",Fh.value)}),xo=te({}),wa=j(()=>{const e=W.activeSessionId;if(!e)return null;const t=xo.value[e];return t?{parentId:e,agentId:t.agentId}:null}),zae=j(()=>wa.value?.parentId??null),Vae=j(()=>wa.value!==null),Kae=j(()=>{const e=wa.value;return e?!!W.sideChatSendingByAgent[e.agentId]:!1}),x3=j(()=>{const e=wa.value;return e?W.sideChatSendingByAgent[e.agentId]?!0:(W.tasksBySession[e.parentId]??[]).some(t=>t.id===e.agentId&&t.status==="running"):!1}),Gae=j(()=>{const e=wa.value;if(!e)return[];const t=W.sideChatMessagesByAgent[e.agentId]??[];return XT(t,[],n=>ot().getFileUrl(n),x3.value,[])});function Hh(e,t){W.sideChatMessagesByAgent={...W.sideChatMessagesByAgent,[e]:t(W.sideChatMessagesByAgent[e]??[])}}function Yae(e,t){Hh(e,n=>[...n,t])}function Xae(e){Hh(e,t=>{const n=[...t].reverse().findIndex(o=>o.role==="user");if(n===-1)return t;const s=t.length-1-n;return t.filter((o,i)=>i!==s)})}function Zae(e,t){Hh(e,n=>{const s=[...n];for(let o=s.length-1;o>=0;o-=1){const i=s[o];if(i.role==="user")return s[o]={...i,promptId:i.promptId??t},s}return n})}function k1(e,t,n){n&&Hh(e,s=>{const o=s.at(-1);if(o?.role==="assistant"){const i=o.content[0],r=i?.type==="text"?i.text:"";return[...s.slice(0,-1),{...o,content:[{type:"text",text:`${r}${n}`}]}]}return[...s,{id:Ph(),sessionId:t,role:"assistant",content:[{type:"text",text:n}],createdAt:new Date().toISOString()}]})}function Gw(e,t,n){if(W.sideChatSendingByAgent={...W.sideChatSendingByAgent,[e]:!1},!n)return;const o=(W.sideChatMessagesByAgent[e]??[]).at(-1);(o?.role==="assistant"&&o.content[0]?.type==="text"?o.content[0].text:"").trim().length>0||k1(e,t,n)}async function Qae(e){const t=W.activeSessionId;if(t){if(!xo.value[t]){let n;try{({agentId:n}=await ot().startBtw(t))}catch(s){St("openSideChat",s,{sessionId:t});return}W.sideChatMessagesByAgent={...W.sideChatMessagesByAgent,[n]:W.sideChatMessagesByAgent[n]??[]},xo.value={...xo.value,[t]:{agentId:n}},jv(),ei?.markSideChannelAgent(n)}e&&e.trim()&&await T3(e.trim())}}function Jae(){const e=W.activeSessionId;if(!e)return;const{[e]:t,...n}=xo.value;xo.value=n}async function T3(e){const t=wa.value,n=e.trim();if(!t||!n)return;const s=t.parentId,o=t.agentId;W.sideChatSendingByAgent={...W.sideChatSendingByAgent,[o]:!0};const i={id:Ph(),sessionId:s,role:"user",content:[{type:"text",text:n}],createdAt:new Date().toISOString(),metadata:{"neurovaWeb.optimisticUserMessage":!0}};Yae(o,i);try{const r=await ot().submitPrompt(s,{content:[{type:"text",text:n}],agentId:o});Zae(o,r.promptId),W.sideChatUserMessageIdsBySession={...W.sideChatUserMessageIdsBySession,[s]:[...W.sideChatUserMessageIdsBySession[s]??[],r.userMessageId]}}catch(r){St("sendSideChatPrompt",r,{sessionId:s}),Xae(o),W.sideChatSendingByAgent={...W.sideChatSendingByAgent,[o]:!1}}}function ece(e){if(!xo.value[e])return;const{[e]:t,...n}=xo.value;xo.value=n}const b1=te(0);let nc=null;Ve(()=>Fh.value.some(e=>e.status==="running"),e=>{e&&nc===null?nc=setInterval(()=>{b1.value=(b1.value+1)%Number.MAX_SAFE_INTEGER},1e3):!e&&nc!==null&&(clearInterval(nc),nc=null)},{immediate:!0});Ve(()=>{const e=W.activeSessionId;if(!e)return{sid:void 0,hasRunning:!1};const t=W.tasksBySession[e]??[];return{sid:e,hasRunning:t.some(n=>n.status==="running")}},({sid:e,hasRunning:t},n,s)=>{let o;t&&e!==void 0?Mae(e):e!==void 0?o=setTimeout(()=>{(W.tasksBySession[e]??[]).some(r=>r.status==="running")||Uf()},1500):Uf(),s(()=>{o!==void 0&&clearTimeout(o)})},{deep:!0,immediate:!0});const tce=j(()=>(b1.value,Fh.value.map(Bae))),M3=j(()=>vle(Fh.value)),Hl=j(()=>{const e=W.activeSessionId;return e?W.goalBySession[e]??null:null}),nce=j(()=>{const e=W.activeSessionId;return e?hle(W.messagesBySession[e]??[]):[]}),sce=j(()=>{const e=W.activeSessionId;return e?W.compactionBySession[e]??null:null}),oce=j(()=>W.connection),ice=j(()=>W.loading),rce=j(()=>W.sessionLoading),lce=j(()=>{const e=W.activeSessionId;return e?W.messagesLoadingMoreBySession[e]??!1:!1}),ace=j(()=>{const e=W.activeSessionId;return e?W.messagesHasMoreBySession[e]??!1:!1}),cce=j(()=>{const e=W.activeSessionId;return e?W.messagesLoadMoreErrorBySession[e]??!1:!1}),uce=j(()=>W.serverVersion),dce=j(()=>W.permission),fce=j(()=>W.thinking),hce=j(()=>W.planMode),pce=j(()=>W.swarmMode),mce=j(()=>W.goalMode),gce=j(()=>{const e=yle(M3.value);return{plan:W.planMode,goal:Hl.value&&Hl.value.status!=="complete"?{status:Hl.value.status,turnsUsed:Hl.value.turnsUsed,elapsedMs:Hl.value.wallClockMs}:null,swarm:e.total>0?e:null}}),vce=j(()=>{const e=W.activeSessionId;return e?(W.queuedBySession[e]??[]).map(t=>({text:t.text,attachmentCount:t.attachments?.length??0})):[]}),yce=j(()=>W.warnings),kce=j(()=>{const e=W.activeSessionId;return e?(W.questionsBySession[e]??[]).map(Pae):[]}),bce=j(()=>{const e=W.activeSessionId;return e?(W.approvalsBySession[e]??[]).map(t=>({approvalId:t.approvalId,block:Rae(t),agentName:t.agentName})):[]}),hu=j(()=>{const e=W.activeSessionId;return e?(W.approvalsBySession[e]??[]).length>0?"awaiting-approval":(W.questionsBySession[e]??[]).length>0?"awaiting-question":Bh(e)?"running":"idle":"idle"}),qf=j(()=>{const e=W.activeSessionId;if(!e)return null;const t=W.gitStatusBySession[e];return t?{branch:t.branch,ahead:t.ahead,behind:t.behind}:null}),_ce=j(()=>{const e=W.activeSessionId;return e?W.gitStatusBySession[e]?.pullRequest??null:null}),wce=j(()=>{const e=W.activeSessionId;if(!e)return[];const t=W.gitStatusBySession[e];return t?Object.entries(t.entries).map(([n,s])=>({path:n,status:s})).sort((n,s)=>n.path.localeCompare(s.path)):[]}),Sce=j(()=>{const e=W.activeSessionId;if(!e)return null;const t=W.gitStatusBySession[e];return t?{totalAdditions:t.additions,totalDeletions:t.deletions}:null}),A3=j(()=>{const e=W.sessions.find(r=>r.id===W.activeSessionId),t=qf.value?.branch??(e?e.cwd.split("/").pop()??e.cwd:"main"),n=e===void 0?Zc.value:null,s=(e?.model&&e.model.length>0?e.model:n??W.defaultModel)??"—",o=$h.value.find(r=>r.id===s||r.model===s);return{model:o?.displayName||o?.model||(s.includes("/")?s.split("/").pop():s),modelId:o?.id??s,ctxUsed:e?.usage.contextTokens??0,ctxMax:e?.usage.contextLimit??0,permission:W.permission,branch:t,cwd:e?.cwd??"",isGitRepo:qf.value!==null}}),Cce=j(()=>Ic.value),xce=j(()=>W.sessions.find(t=>t.id===W.activeSessionId)?.usage.totalCostUsd??0),Tce=j(()=>W.authReady),Mce=j(()=>W.defaultModel),Ace=j(()=>W.managedProviderStatus),Ece=j(()=>W.config),Ice=j(()=>{const e=W.activeSessionId;if(!e)return{};const t=W.gitStatusBySession[e];return t?{...t.entries}:{}});function wr(e){return W.workspaces.find(t=>t.root===e.cwd)?.id??e.workspaceId??e.cwd}const vr=j(()=>{const e=new Set(W.hiddenWorkspaceRoots),t=new Map;for(const a of W.workspaces)e.has(a.root)||t.set(a.root,{...a});for(const a of W.sessions){const c=a.cwd;c&&(e.has(c)||t.has(c)||t.set(c,{id:a.workspaceId??c,root:c,name:p3(c),isGitRepo:!1,sessionCount:0}))}const n=new Map;for(const a of W.sessions){const c=wr(a);n.set(c,(n.get(c)??0)+1)}const s=qf.value,o=W.sessions.find(a=>a.id===W.activeSessionId)?.cwd,i=W.workspaces.map(a=>a.root),r=[...t.keys()].filter(a=>!i.includes(a));r.sort((a,c)=>a.localeCompare(c));const l=[];for(const a of[...i,...r]){const c=t.get(a),u=n.get(c.id)??n.get(c.root)??(W.loading?c.sessionCount:0);let d=c.branch;!d&&s&&o===c.root&&(d=s.branch),l.push({...c,sessionCount:u,branch:d})}return l}),Wh=j(()=>vr.value.map(e=>({id:e.id,name:e.name,root:e.root,shortPath:Vle(e.root,W.fsHome),branch:e.branch,sessionCount:e.sessionCount}))),E3=j(()=>{const e=W.activeWorkspaceId,t=vr.value;return e&&t.some(n=>n.id===e)?e:t[0]?.id??null}),$ce=j(()=>{const e=E3.value;return e?Wh.value.find(t=>t.id===e)??null:null}),Nce=j(()=>{Jc.value;const e=new Set(Wh.value.map(t=>t.id));return W.sessions.filter(t=>!t.parentSessionId&&e.has(wr(t))).map(t=>({id:t.id,title:t.title,time:Vv(t.updatedAt,t.status),status:t.status,busy:Bh(t.id),lastPrompt:t.lastPrompt}))}),Lce=j(()=>{Jc.value;const e=new Map;for(const t of W.sessions.toSorted((n,s)=>new Date(s.updatedAt).getTime()-new Date(n.updatedAt).getTime())){if(t.parentSessionId)continue;const n=wr(t),s={id:t.id,title:t.title,time:Vv(t.updatedAt,t.status),status:t.status,busy:Bh(t.id),updatedAt:t.updatedAt},o=e.get(n)??[];o.push(s),e.set(n,o)}return Wh.value.map(t=>({workspace:t,sessions:e.get(t.id)??[]}))}),I3=j(()=>{const e={};for(const[t,n]of Object.entries(W.approvalsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);for(const[t,n]of Object.entries(W.questionsBySession))n.length>0&&(e[t]=(e[t]??0)+n.length);return e}),Oce=j(()=>{const e={};for(const[t,n]of Object.entries(W.approvalsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).approvals=n.length);for(const[t,n]of Object.entries(W.questionsBySession))n.length>0&&((e[t]??={approvals:0,questions:0}).questions=n.length);return e}),Rce=j(()=>{const e={};for(const[t,n]of Object.entries(W.unreadBySession))n&&(e[t]=!0);return e}),Pce=j(()=>{const e={},t=I3.value;for(const n of W.sessions){const s=t[n.id]??0;if(s<=0)continue;const o=wr(n);e[o]=(e[o]??0)+s}return e}),Dce=j(()=>W.recentRoots),Bce=j(()=>{const e=new Set,t=[];for(const n of W.sessions){const s=n.cwd;if(s&&!e.has(s)&&(e.add(s),t.push(s),t.length>=8))break}return t}),Fce=j(()=>W.availableOpenInApps);function Hce(e){if(Qo.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1},W.promptIdBySession[e]!==void 0){const o={...W.promptIdBySession};delete o[e],W.promptIdBySession=o}e===W.activeSessionId?(g3(),Kv(e),Lh(e)):(W.unreadBySession={...W.unreadBySession,[e]:!0},f3(W.unreadBySession)),fae(e);const t=W.queuedBySession[e]??[];if(t.length===0)return;const[n,...s]=t;W.queuedBySession={...W.queuedBySession,[e]:s},n!==void 0&&qh(e,n.text,n.attachments).then(o=>{if(!o){const i=W.queuedBySession[e]??[];W.queuedBySession={...W.queuedBySession,[e]:[n,...i]}}})}async function Wce(e){const t=W.activeSessionId;if(t){jl.value=e,Ic.value=[],Hf.value=!0;try{const s=await ot().getFileDiff(t,e);if(jl.value!==e)return;Ic.value=zre(s.diff)}catch(n){jl.value===e&&(Ic.value=[]),console.warn("[loadFileDiff] diff unavailable for",e,n)}finally{jl.value===e&&(Hf.value=!1)}}}function pu(){jl.value=null,Ic.value=[],Hf.value=!1}async function Kv(e){try{const n=await ot().getGitStatus(e);W.gitStatusBySession={...W.gitStatusBySession,[e]:n}}catch{}}async function Gv(){try{const t=await ot().getAuth();W.authReady=t.ready,W.defaultModel=t.defaultModel,W.managedProviderStatus=t.managedProvider?.status??null}catch{}}async function Uce(){try{const e=ot();W.config=await e.getConfig()}catch{}}async function qce(e){try{const n=await ot().setConfig(e);return W.config=n,W.defaultModel=n.defaultModel??null,!0}catch(t){return St("setConfig",t),!1}}const $3=te(!1),jce=100;async function zce(){const e=ot(),t=[];let n;for(;;){const s=await e.listSessions({pageSize:jce,beforeId:n});if(t.push(...s.items),!s.hasMore||s.items.length===0)break;n=s.items[s.items.length-1].id}return t}async function N3(){W.loading=!0;try{const e=ot();await Promise.all([e.getHealth().catch(()=>null),e.getMeta().then(r=>{W.serverVersion=r.serverVersion,W.availableOpenInApps=r.openInApps}).catch(()=>null),jh()]),await Gv(),await Uce();const t=await zce().catch(()=>[]);W.sessions=t,await L3();const n=t[0],s=W.activeWorkspaceId;!(s!==null&&vr.value.some(r=>r.id===s))&&n&&dl(wr(n)),tue();const i=typeof window<"u"?KT(window.location):void 0;!W.activeSessionId&&i!==void 0&&(W.sessions.some(l=>l.id===i)||await O3(i))&&await Rs(i,{urlMode:"replace"}),!W.activeSessionId&&t.length>0&&await Rs(t[0].id,{urlMode:"replace"})}catch(e){St("load",e)}finally{W.loading=!1,$3.value=!0}}async function L3(){try{const e=ot(),[t,n]=await Promise.all([e.listWorkspaces().catch(()=>[]),e.getFsHome().catch(()=>({home:"",recentRoots:[]}))]);W.workspaces=t,W.fsHome=n.home||null,W.recentRoots=n.recentRoots}catch{}}function dl(e){W.activeWorkspaceId=e,Bv(e)}function Vce(e){dl(e);const t=W.sessions.filter(n=>wr(n)===e);if(t.length>0){const n=t[0];n&&n.id!==W.activeSessionId&&Rs(n.id)}else W.activeSessionId=void 0,Sr(void 0,"push")}function Uh(e){W.hiddenWorkspaceRoots.includes(e.root)&&(W.hiddenWorkspaceRoots=W.hiddenWorkspaceRoots.filter(s=>s!==e.root),Dv(W.hiddenWorkspaceRoots));const t=W.workspaces.findIndex(s=>s.id===e.id||s.root===e.root);if(t===-1){W.workspaces=[e,...W.workspaces];return}const n=[...W.workspaces];n[t]=e,W.workspaces=n}function Kce(e){if(e.type==="workspaceCreated"||e.type==="workspaceUpdated"){Uh(e.workspace);return}const t=W.workspaces.find(s=>s.id===e.workspaceId)?.root??e.root;if(t&&!W.hiddenWorkspaceRoots.includes(t)&&(W.hiddenWorkspaceRoots=[...W.hiddenWorkspaceRoots,t],Dv(W.hiddenWorkspaceRoots)),W.workspaces=W.workspaces.filter(s=>s.id!==e.workspaceId&&s.root!==t),W.activeWorkspaceId===e.workspaceId||W.activeWorkspaceId===t){const s=vr.value[0]?.id??null;if(W.activeWorkspaceId=s,s)Bv(s);else try{localStorage.removeItem(Eh)}catch{}W.activeSessionId=void 0,W.sessionLoading=!1,pu(),Sr(void 0,"replace")}}function Gce(){W.activeSessionId=void 0,Sr(void 0,"push")}function _1(e){dl(e),Gce(),pu()}async function Yce(e){const t=vr.value.find(n=>n.id===e);if(t)try{const n=ot();let s,o=t.root;try{const r=await n.addWorkspace({root:t.root});s=r.id,o=r.root,Uh(r)}catch{}const i=await n.createSession({workspaceId:s,cwd:o});return W.sessions=[i,...W.sessions.filter(r=>r.id!==i.id)],dl(i.workspaceId??s??e),Qc.add(i.id),await Rs(i.id),i}catch(n){St("createSessionInWorkspace",n);return}}async function Xce(e,t,n){const s=vr.value.find(o=>o.id===e);if(s)try{const o=ot();let i,r=s.root;try{const u=await o.addWorkspace({root:s.root});i=u.id,r=u.root,Uh(u)}catch{}const l=Zc.value??void 0,a=await o.createSession({workspaceId:i,cwd:r,model:l});Zc.value=null;const c=l!==void 0&&(!a.model||a.model.length===0)?{...a,model:l}:a;W.sessions=[c,...W.sessions.filter(u=>u.id!==a.id)],dl(a.workspaceId??i??e),await Rs(a.id),await qh(a.id,t,n)}catch(o){St("startSessionAndSendPrompt",o)}}async function Zce(e){const t=e.trim();if(!t)return;const n=ot();try{const s=await n.addWorkspace({root:t});Uh(s),_1(s.id)}catch{W.workspaces.find(o=>o.root===t)||(W.workspaces=[{id:t,root:t,name:p3(t),isGitRepo:!1,sessionCount:0},...W.workspaces]),_1(t)}}async function Qce(e){try{return await ot().browseFs(e)}catch{return{path:"",parent:null,entries:[]}}}async function Jce(){try{return await ot().getFsHome()}catch{return{home:"",recentRoots:[]}}}function Sr(e,t){if(t==="none"||typeof window>"u"||!window.history)return;const n=qre(e);if(window.location.pathname!==n)try{t==="push"?window.history.pushState(null,"",n):window.history.replaceState(null,"",n)}catch{}}async function O3(e){try{const t=await ot().getSession(e);return W.sessions.some(n=>n.id===t.id)||(W.sessions=[...W.sessions,t]),!0}catch{return!1}}function eue(){const e=KT(window.location);if(e===void 0){W.activeSessionId=void 0;return}if(e!==W.activeSessionId){if(W.sessions.some(t=>t.id===e)){Rs(e,{urlMode:"none"});return}(async()=>{if(await O3(e)){await Rs(e,{urlMode:"none"});return}const t=W.sessions[0];t?await Rs(t.id,{urlMode:"replace"}):(W.activeSessionId=void 0,Sr(void 0,"replace"))})()}}let Yw=!1;function tue(){Yw||typeof window>"u"||(Yw=!0,window.addEventListener("popstate",eue))}async function Rs(e,t){const n=Eae(e),s=!n&&Qc.has(e);Qc.delete(e);try{Sr(e,t?.urlMode??"push"),W.sessionLoading=!n&&!s,W.activeSessionId=e,g3(),W.unreadBySession[e]&&(W.unreadBySession={...W.unreadBySession,[e]:!1},f3(W.unreadBySession)),pu();const o=W.sessions.find(i=>i.id===e);if(o){const i=wr(o);W.activeWorkspaceId!==i&&dl(i)}if(n)Iae(e);else if(await zv(e)==="not-found")return;$ae(e)}catch(o){St("selectSession",o,{sessionId:e})}finally{W.activeSessionId===e&&(W.sessionLoading=!1)}}async function nue(e,t){try{const s=await ot().createSession({cwd:e,title:t?.title,model:t?.model});W.sessions=[s,...W.sessions.filter(o=>o.id!==s.id)],Qc.add(s.id),await Rs(s.id)}catch(n){St("createSession",n)}}async function qh(e,t,n){Qo.add(e),W.sendingBySession={...W.sendingBySession,[e]:!0};const s=Ph();try{const o=ot(),i=[];t&&i.push({type:"text",text:t});for(const m of n??[])m.kind==="video"?i.push({type:"video",source:{kind:"file",fileId:m.fileId}}):i.push({type:"image",source:{kind:"file",fileId:m.fileId}});if(i.length===0)return Qo.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1},!1;const r={id:s,sessionId:e,role:"user",content:i,createdAt:new Date().toISOString(),metadata:{"neurovaWeb.optimisticUserMessage":!0}},l=W.messagesBySession[e]??[];W.messagesBySession={...W.messagesBySession,[e]:[...l,r]};const a=W.sessions.find(m=>m.id===e),c=(a?.model&&a.model.length>0?a.model:W.defaultModel)??void 0;if(W.goalMode&&t)try{await o.updateSession(e,{goalObjective:t.trim()})}catch(m){St("createGoal",m,{sessionId:e}),Qo.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1};const f=W.messagesBySession[e]??[];return f.some(v=>v.id===s)&&(W.messagesBySession={...W.messagesBySession,[e]:f.filter(v=>v.id!==s)}),!1}const u=await o.submitPrompt(e,{content:i,model:c,thinking:W.thinking,permissionMode:W.permission,planMode:W.planMode,swarmMode:W.swarmMode});W.goalMode&&(W.goalMode=!1,d3(!1)),W.promptIdBySession={...W.promptIdBySession,[e]:u.promptId};const d=W.messagesBySession[e]??[],p=d.findIndex(m=>m.id===s);if(p!==-1){const m=[...d];m[p]={...m[p],promptId:m[p].promptId??u.promptId},W.messagesBySession={...W.messagesBySession,[e]:m}}return ei?.bindNextPromptId(e,u.promptId),!0}catch(o){Qo.delete(e),W.sendingBySession={...W.sendingBySession,[e]:!1};const i=W.messagesBySession[e]??[];return i.some(r=>r.id===s)&&(W.messagesBySession={...W.messagesBySession,[e]:i.filter(r=>r.id!==s)}),St("sendPrompt",o,{sessionId:e}),!1}}async function R3(e,t){const n=W.activeSessionId;if(n){if(hu.value!=="idle"||Qo.has(n)){P3(e,t);return}await qh(n,e,t)}}async function sue(e,t){const n=W.activeSessionId;if(!n)return;const s=W.queuedBySession[n]??[],o=[],i=[];for(const d of s){const p=d.text.trim();p&&o.push(p),d.attachments?.length&&i.push(...d.attachments)}const r=e.trim();if(r&&o.push(r),t?.length&&i.push(...t),o.length===0&&i.length===0)return;s.length>0&&(W.queuedBySession={...W.queuedBySession,[n]:[]});const l=o.join(`
266
+
267
+ `);if(hu.value==="idle"&&!Qo.has(n)){await qh(n,l,i);return}const a=[];l&&a.push({type:"text",text:l});for(const d of i)d.kind==="video"?a.push({type:"video",source:{kind:"file",fileId:d.fileId}}):a.push({type:"image",source:{kind:"file",fileId:d.fileId}});const c=Ph(),u={id:c,sessionId:n,role:"user",content:a,createdAt:new Date().toISOString(),metadata:{"neurovaWeb.optimisticUserMessage":!0}};W.messagesBySession={...W.messagesBySession,[n]:[...W.messagesBySession[n]??[],u]};try{const d=ot(),p=W.sessions.find(_=>_.id===n),m=(p?.model&&p.model.length>0?p.model:W.defaultModel)??void 0,f=await d.submitPrompt(n,{content:a,model:m,thinking:W.thinking,permissionMode:W.permission,planMode:W.planMode,swarmMode:W.swarmMode}),v=W.messagesBySession[n]??[],w=v.findIndex(_=>_.id===c);if(w!==-1){const _=[...v];_[w]={..._[w],promptId:_[w].promptId??f.promptId},W.messagesBySession={...W.messagesBySession,[n]:_}}if(f.status!=="queued"){W.promptIdBySession={...W.promptIdBySession,[n]:f.promptId},ei?.bindNextPromptId(n,f.promptId);return}try{await d.steerPrompts(n,[f.promptId])}catch{}}catch(d){const p=W.messagesBySession[n]??[];W.messagesBySession={...W.messagesBySession,[n]:p.filter(m=>m.id!==c)},St("steer",d,{sessionId:n})}}async function oue(e,t){try{const s=await ot().uploadFile({file:e,name:t});return{fileId:s.id,name:s.name,mediaType:s.mediaType}}catch(n){return St("uploadImage",n),null}}function P3(e,t){const n=W.activeSessionId;if(!n)return;const s=W.queuedBySession[n]??[];W.queuedBySession={...W.queuedBySession,[n]:[...s,{text:e,attachments:t}]}}async function iue(){const e=W.activeSessionId;if(!e)return;const t=W.sessions.find(o=>o.id===e);let n=W.promptIdBySession[e];if(n===void 0){const o=t?.currentPromptId;o?.startsWith("prompt_")&&(n=o)}const s=ot();if(n!==void 0)try{await s.abortPrompt(e,n);return}catch(o){if(!(fu(o)&&o.code===_le)){St("abortCurrentPrompt",o,{sessionId:e});return}}try{await s.abortSession(e)}catch(o){St("abortCurrentPrompt",o,{sessionId:e})}}async function Yv(e,t){const n=W.activeSessionId;if(n)try{const s=ot(),o={decision:t.decision,scope:t.scope,feedback:t.feedback};await s.respondApproval(n,e,o);const i=W.approvalsBySession[n]??[];W.approvalsBySession={...W.approvalsBySession,[n]:i.filter(r=>r.approvalId!==e)}}catch(s){St("respondApproval",s,{sessionId:n})}}async function rue(e,t){const n=W.activeSessionId;if(n)try{await ot().respondQuestion(n,e,t);const o=W.questionsBySession[n]??[];W.questionsBySession={...W.questionsBySession,[n]:o.filter(i=>i.questionId!==e)}}catch(s){St("respondQuestion",s,{sessionId:n})}}async function lue(e){const t=W.activeSessionId;if(t)try{await ot().dismissQuestion(t,e);const s=W.questionsBySession[t]??[];W.questionsBySession={...W.questionsBySession,[t]:s.filter(o=>o.questionId!==e)}}catch(n){St("dismissQuestion",n,{sessionId:t})}}async function aue(e){const t=W.activeSessionId;if(t)try{await ot().cancelTask(t,e);const s=W.tasksBySession[t]??[];W.tasksBySession={...W.tasksBySession,[t]:s.map(o=>o.id===e?{...o,status:"cancelled"}:o)}}catch(n){St("cancelTask",n,{sessionId:t})}}function cue(e){const t=Fv(e);Oh({thinking:t})}function D3(e){W.planMode=e,Nle(e),Oh({planMode:e})}function uue(){D3(!W.planMode)}function B3(e){W.swarmMode=e,Ole(e),Oh({swarmMode:e})}function due(){const e=!W.swarmMode;e&&W.permission==="manual"&&!confirm("Enable swarm mode? The agent will run multiple sub agents in parallel.")||B3(e)}function F3(e){W.goalMode=e,d3(e)}function fue(){F3(!W.goalMode)}async function hue(e){const t=e.trim();if(!t||W.permission==="manual"&&!confirm(`Start goal: "${t}"? The agent will run autonomously toward this objective.`))return;const n=W.activeSessionId;if(n){try{await ot().updateSession(n,{goalObjective:t})}catch(s){St("createGoal",s,{sessionId:n,message:C3(s)});return}await R3(t)}}function pue(e){const t=W.activeSessionId;t&&Promise.resolve(ot().updateSession(t,{goalControl:e})).catch(n=>{St("controlGoal",n,{sessionId:t,message:C3(n)})})}function mue(e){if(W.permission=e,Ele(e),Oh({permissionMode:e}),e==="auto"||e==="yolo"){const t=W.activeSessionId;if(t){const n=[...W.approvalsBySession[t]??[]];for(const s of n)Yv(s.approvalId,{decision:"approved",scope:e==="yolo"?"session":void 0})}}}function gue(e){const t=[...W.warnings];t.splice(e,1),W.warnings=t}async function vue(e,t){try{await ot().updateSession(e,{title:t}),W.sessions=W.sessions.map(s=>s.id===e?{...s,title:t}:s)}catch(n){St("renameSession",n,{sessionId:e})}}function yue(e,t){W.workspaces=W.workspaces.map(n=>n.id===e?{...n,name:t}:n)}async function kue(e){const t=W.workspaces.find(i=>i.id===e)?.root??vr.value.find(i=>i.id===e)?.root??e,n=W.activeSessionId?W.sessions.find(i=>i.id===W.activeSessionId):void 0,s=W.activeWorkspaceId===e||W.activeWorkspaceId===t,o=!!(n&&(n.cwd===t||n.workspaceId===e||wr(n)===e));t&&!W.hiddenWorkspaceRoots.includes(t)&&(W.hiddenWorkspaceRoots=[...W.hiddenWorkspaceRoots,t],Dv(W.hiddenWorkspaceRoots));try{await ot().deleteWorkspace(e)}catch{}if(W.workspaces=W.workspaces.filter(i=>i.id!==e&&i.root!==t),s||o){const i=vr.value[0]?.id??null;if(W.activeWorkspaceId=i,i)Bv(i);else try{localStorage.removeItem(Eh)}catch{}}(s||o)&&(W.activeSessionId=void 0,W.sessionLoading=!1,pu(),Sr(void 0,"replace"))}async function bue(e){try{await ot().archiveSession(e),W.sessions=W.sessions.filter(o=>o.id!==e),ece(e);const{[e]:n,...s}=W.sideChatUserMessageIdsBySession;if(W.sideChatUserMessageIdsBySession=s,W.activeSessionId===e){const o=W.sessions[0];o?await Rs(o.id,{urlMode:"replace"}):(W.activeSessionId=void 0,Sr(void 0,"replace"))}}catch(t){St("archiveSession",t,{sessionId:e})}}async function jh(){try{const e=ot();$h.value=await e.listModels(),Fv(W.thinking)}catch(e){St("loadModels",e)}}async function _ue(){try{const e=await ot().refreshOAuthProviderModels();for(const t of e.failed)St("refreshOAuthProviderModels",new Error(t.reason),{message:t.provider})}catch{}}async function Xv(){try{const e=ot();Df.value=await e.listProviders()}catch(e){St("loadProviders",e)}}async function wue(e){const t=W.activeSessionId,n=PT(v3(e),W.thinking),s=W.thinking;if(!t){Zc.value=e,Fv(n);return}const o=W.sessions.find(i=>i.id===t)?.model;W.sessions=W.sessions.map(i=>i.id===t?{...i,model:e}:i),n!==s&&(W.thinking=n,g1(n));try{await ot().updateSession(t,{model:e,thinking:n!==s?n:void 0})}catch(i){W.sessions=W.sessions.map(r=>r.id===t?{...r,model:o??r.model}:r),n!==s&&(W.thinking=s,g1(s)),St("setModel",i,{sessionId:t});return}await Lh(t)}function Sue(e){const t=new Set(Bd.value);t.has(e)?t.delete(e):t.add(e),Bd.value=Array.from(t),Ble(Bd.value)}async function Cue(e,t){const n=W.activeSessionId;if(!n)return;const s=hu.value==="idle"&&!Qo.has(n),o=`msg_skill_opt_${Date.now().toString(36)}`;if(s){Qo.add(n),W.sendingBySession={...W.sendingBySession,[n]:!0};const i={id:o,sessionId:n,role:"user",content:[{type:"text",text:`/${e}${t?` ${t}`:""}`}],createdAt:new Date().toISOString(),metadata:{"neurovaWeb.optimisticUserMessage":!0,origin:{kind:"skill_activation",trigger:"user-slash",skillName:e,skillArgs:t}}};W.messagesBySession={...W.messagesBySession,[n]:[...W.messagesBySession[n]??[],i]}}try{await ot().activateSkill(n,e,t)}catch(i){if(s){Qo.delete(n),W.sendingBySession={...W.sendingBySession,[n]:!1};const r=W.messagesBySession[n]??[];W.messagesBySession={...W.messagesBySession,[n]:r.filter(l=>l.id!==o)}}St("activateSkill",i,{sessionId:n})}}async function xue(e){try{await ot().addProvider(e),await Promise.all([Xv(),jh()])}catch(t){St("addProvider",t)}}async function Tue(e){try{await ot().deleteProvider(e),await Promise.all([Xv(),jh()])}catch(t){St("deleteProvider",t)}}async function Mue(e){try{const n=await ot().refreshProvider(e);Df.value=Df.value.map(s=>s.id===e?n:s)}catch(t){St("refreshProvider",t)}}async function Aue(){try{return await ot().startOAuthLogin()}catch{return null}}async function Eue(){try{return await ot().pollOAuthLogin()}catch{return null}}async function Iue(){try{await ot().cancelOAuthLogin()}catch{}}async function $ue(){try{await ot().logout(),await Gv(),await N3()}catch(e){St("logout",e)}}function Nue(e){const t=W.activeSessionId;t&&ot().compactSession(t,e).catch(n=>{St("compact",n,{sessionId:t})})}async function Lue(e){const t=e??W.activeSessionId;if(t)try{const n=await ot().forkSession(t);W.sessions=[n,...W.sessions.filter(s=>s.id!==n.id)],await Rs(n.id)}catch(n){St("fork",n,{sessionId:t})}}async function Oue(e=1){const t=W.activeSessionId;if(!t)return null;const n=(()=>{const s=W.messagesBySession[t]??[];for(let o=s.length-1;o>=0;o--){const i=s[o];if(i.role==="user"&&!(i.metadata?.origin&&i.metadata.origin.kind!=="user"))return i.content.filter(r=>r.type==="text").map(r=>r.text).join(`
268
+ `)}return null})();try{return await ot().undoSession(t,e),await zv(t),n}catch(s){return St("undo",s,{sessionId:t}),null}}function Rue(e){const t=W.activeSessionId;if(!t)return;const n=W.queuedBySession[t]??[];if(e<0||e>=n.length)return;const s=[...n];s.splice(e,1),W.queuedBySession={...W.queuedBySession,[t]:s}}async function Pue(e){const t=W.activeSessionId;if(!t)return[];try{return(await ot().listDirectory(t,{path:e,includeGitStatus:!0})).items}catch{return[]}}async function Due(e){const t=W.activeSessionId;if(!t)return null;try{const s=await ot().readFile(t,{path:e});return{path:s.path,content:s.content,encoding:s.encoding,mime:s.mime,languageId:s.languageId,isBinary:s.isBinary,size:s.size,lineCount:s.lineCount}}catch{return null}}const Bue=10485760;function Fue(e){const t=W.activeSessionId;return t?ot().getFileDownloadUrl(t,e):null}async function Hue(e,t){const n=W.activeSessionId;if(!n)return!1;try{return await ot().openFile(n,{path:e,line:t}),!0}catch(s){return St("openFile",s,{sessionId:n}),!1}}async function Wue(e){const t=W.activeSessionId;if(!t)return;const n=A3.value.cwd||".";try{await ot().openInApp(t,e,n)}catch(s){St("openInApp",s,{sessionId:t})}}async function Uue(e){const t=W.activeSessionId;if(!t)return!1;try{return await ot().revealFile(t,{path:e}),!0}catch(n){return St("revealFile",n,{sessionId:t}),!1}}async function que(e){if(/^(https?:|data:|blob:)/i.test(e))return e;const t=W.activeSessionId;if(!t)return e;let n=e;if(n.startsWith("/")){const s=W.sessions.find(o=>o.id===t)?.cwd;if(s&&(n===s||n.startsWith(s.endsWith("/")?s:`${s}/`))){if(n=n.slice(s.length).replace(/^\//,""),!n)return e}else return e}try{const o=await ot().readFile(t,{path:n,length:Bue});return!o.isBinary||o.encoding!=="base64"||o.truncated?e:`data:${o.mime};base64,${o.content}`}catch{return e}}async function jue(e){const t=W.activeSessionId;if(!t)return[];try{return(await ot().searchFiles(t,{query:e,limit:20})).items.map(o=>({path:o.path,name:o.name}))}catch{return[]}}function zue(){return Lae(),{workspace:Fae,sessions:Hae,activeSessionId:Wae,workspacesView:Wh,visibleWorkspace:$ce,activeWorkspaceId:E3,sessionsForView:Nce,workspaceGroups:Lce,attentionBySession:I3,pendingBySession:Oce,attentionByWorkspace:Pce,unreadBySession:Rce,recentRoots:Dce,turns:jae,tasks:tce,todos:nce,goal:Hl,swarms:M3,activationBadges:gce,compaction:sce,status:A3,sessionCost:xce,fileDiff:Cce,selectedDiffPath:jl,fileDiffLoading:Hf,changes:wce,gitInfo:qf,gitDiffStats:Sce,activePullRequest:_ce,changesByPath:Ice,pendingApprovals:bce,recentCwds:Bce,availableOpenInApps:Fce,connection:oce,loading:ice,sessionLoading:rce,loadingMoreMessages:lce,hasMoreMessages:ace,loadMoreMessagesError:cce,serverVersion:uce,initialized:$3,permission:dce,thinking:fce,planMode:hce,swarmMode:pce,goalMode:mce,queued:vce,warnings:yce,questions:kce,activity:hu,isSending:qae,fastMoon:Bf,models:$h,starredModelIds:Bd,providers:Df,theme:Rh,setTheme:y3,toggleTheme:sae,uiFontSize:Hv,setUiFontSize:oae,betaToc:b3,setBetaToc:lae,colorScheme:Wv,setColorScheme:aae,accent:Uv,setAccent:cae,notifyOnComplete:Wf,notifyPermission:qv,setNotifyOnComplete:dae,onboarded:_3,setOnboarded:pae,load:N3,selectSession:Rs,createSession:nue,loadOlderMessages:Cae,loadWorkspaces:L3,selectWorkspace:dl,openWorkspace:Vce,openWorkspaceDraft:_1,createSessionInWorkspace:Yce,startSessionAndSendPrompt:Xce,addWorkspaceByPath:Zce,browseFs:Qce,getFsHome:Jce,sendPrompt:R3,steerPrompt:sue,sideChatVisible:Vae,sideChatSessionId:zae,sideChatTurns:Gae,sideChatRunning:x3,sideChatSending:Kae,openSideChat:Qae,closeSideChat:Jae,sendSideChatPrompt:T3,uploadImage:oue,abortCurrentPrompt:iue,respondApproval:Yv,respondQuestion:rue,dismissQuestion:lue,cancelTask:aue,setPermission:mue,setThinking:cue,setPlanMode:D3,togglePlanMode:uue,setSwarmMode:B3,toggleSwarmMode:due,setGoalMode:F3,toggleGoalMode:fue,createGoal:hue,controlGoal:pue,enqueue:P3,dismissWarning:gue,renameSession:vue,renameWorkspace:yue,deleteWorkspace:kue,archiveSession:bue,compact:Nue,forkSession:Lue,undo:Oue,unqueue:Rue,searchFiles:jue,loadGitStatus:Kv,loadFileDiff:Wce,clearFileDiff:pu,listDir:Pue,readFileContent:Due,getFileDownloadUrl:Fue,openWorkspaceFile:Hue,openInApp:Wue,revealWorkspaceFile:Uue,resolveImageUrl:que,refreshOAuthProviderModels:_ue,loadModels:jh,loadProviders:Xv,skills:Uae,activateSkill:Cue,setModel:wue,toggleStarModel:Sue,addProvider:xue,deleteProvider:Tue,refreshProvider:Mue,authReady:Tce,defaultModel:Mce,managedProviderStatus:Ace,config:Ece,updateConfig:qce,checkAuth:Gv,startOAuthLogin:Aue,pollOAuthLogin:Eue,cancelOAuthLogin:Iue,logout:$ue}}const Vue=640,Kue=`(max-width: ${Vue}px)`;function Gue(){const e=te(!1);if(typeof window>"u"||typeof window.matchMedia!="function")return e;const t=window.matchMedia(Kue);e.value=t.matches;const n=s=>{e.value=s.matches};return typeof t.addEventListener=="function"?(t.addEventListener("change",n),qt(()=>t.removeEventListener("change",n))):typeof t.addListener=="function"&&(t.addListener(n),qt(()=>t.removeListener(n))),e}const Yue={class:"app-shell"},Xue={key:0,class:"auth-page"},Zue={class:"auth-page-inner"},Que={class:"auth-page-copy"},Jue={key:0,class:"sidebar-rail"},ede=["title","aria-label"],tde={key:3,class:"coming-soon"},nde={class:"cs-text"},sde=["aria-label","aria-hidden"],Jm="/login",ode="cyberneurova-web.sidebar-width",Xw="cyberneurova-web.sidebar-collapsed",Zw=270,ide=170,rde=420,lde=36,ade="cyberneurova-web.file-preview-width",jr=320,cde=Ze({__name:"App",setup(e){const t=zue();ln("resolveImage",t.resolveImageUrl);const{t:n}=wt(),s=ni(),o=Gue(),i=te(!1),r=te(!1),l=j(()=>{const Be=t.activeSessionId.value;return t.sessions.value.find(le=>le.id===Be)?.title??""}),a=j(()=>t.visibleWorkspace.value?.sessionCount??0),c=j(()=>t.activity.value!=="idle"),u=j(()=>t.authReady.value),d=j(()=>t.initialized.value&&!u.value),p=te(null),m=te(null);let f=null;function v(){return typeof window>"u"?"/":`${window.location.pathname}${window.location.search}${window.location.hash}`}function w(Be){typeof window>"u"||window.history.replaceState(window.history.state,"",Be)}Ve(d,Be=>{if(!(typeof window>"u")){if(Be){window.location.pathname!==Jm&&(p.value=v(),w(Jm));return}window.location.pathname===Jm&&(w(p.value??"/"),p.value=null)}},{immediate:!0});function _(){const Be=m.value;Be&&(Be.classList.remove("blink-now"),Be.getBoundingClientRect(),Be.classList.add("blink-now"),f!==null&&clearTimeout(f),f=setTimeout(()=>{f=null,Be.classList.remove("blink-now")},300))}const b=["◐","◓","◑","◒"],g=te(0);let y=null;function k(){y===null&&(g.value=0,y=setInterval(()=>{g.value=(g.value+1)%b.length},250))}function $(){y!==null&&(clearInterval(y),y=null),g.value=0}Ve(c,Be=>{Be?k():$()},{immediate:!0});const E=j(()=>{const Be=c.value?`${b[g.value]} `:"";if(d.value)return`${Be}${n("app.authPageTitle")} - CyberNeurova Code Web`;const le=l.value;if(le)return`${Be}${le} - CyberNeurova Code Web`;const Se=t.visibleWorkspace.value?.name;return Se?`${Be}${Se} - CyberNeurova Code Web`:`${Be}CyberNeurova Code Web`});MA(()=>{typeof document<"u"&&(document.title=E.value)});function S(Be){return Be==="off"?"high":"off"}const T=te(!t.onboarded.value);function I(){t.setOnboarded(!0),T.value=!1}function L(){T.value=!0}Jt(()=>{t.load(),K(),document.addEventListener("keydown",O,!0)}),qt(()=>{document.removeEventListener("keydown",O,!0),$(),f!==null&&clearTimeout(f)});function R(){return J.value==="thinking"&&ie.value?(ze(),!0):J.value==="compaction"&&Ge.value?(xt(),!0):J.value==="agent"&&Vn.value?(Ke(),!0):J.value==="file"?(ce(),!0):J.value==="diff"?(Gn(),!0):J.value==="btw"?(Bs(),!0):!1}function O(Be){Be.key==="Escape"&&(cn.value||R()&&(Be.stopPropagation(),Be.preventDefault()))}const F=te(Zw),P=te(!1),q=j(()=>P.value?lde:F.value);function K(){try{P.value=localStorage.getItem(Xw)==="true"}catch{P.value=!1}}function G(){try{localStorage.setItem(Xw,String(P.value))}catch{}}function oe(){P.value=!P.value,G()}const J=te(null);function he(){return typeof window>"u"?jr*2:Math.max(0,window.innerWidth-q.value)}function Ne(Be){const le=Math.max(jr,he()-jr);return Math.min(le,Math.max(jr,Math.round(Be)))}function Fe(){return Ne(he()/2)}const We=j(()=>Fe()),$e=j(()=>Math.max(jr,he()-jr)),me=te(We.value),ke=te(null),_e=te(null),ue=te(!1),z=te(null),X=te(null);let fe=0;const D=j(()=>{const Be=X.value;return Be?t.getFileDownloadUrl(Be):null}),Z=j(()=>ke.value!==null);function ne(Be){return Be.length>1?Be.replace(/\/+$/,""):Be}function se(Be){const le=[];for(const Se of Be.split(/[\\/]+/))if(!(!Se||Se===".")){if(Se===".."){le.pop();continue}le.push(Se)}return le.join("/")}function ae(Be){const le=Be.trim();if(!le)return{error:n("filePreview.errors.emptyPath")};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(le))return{error:n("filePreview.errors.unsupportedPath")};if(le.startsWith("~"))return{error:n("filePreview.errors.outsideWorkspace")};const Se=ne(t.status.value.cwd);if(le.startsWith("/")){if(!Se||le!==Se&&!le.startsWith(`${Se}/`))return{error:n("filePreview.errors.outsideWorkspace")};const xa=le===Se?"":le.slice(Se.length+1);if(xa.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const gu=se(xa);return gu?{path:gu}:{error:n("filePreview.errors.isDirectory")}}if(le.split(/[\\/]+/).includes(".."))return{error:n("filePreview.errors.outsideWorkspace")};const Mt=se(le);return Mt?{path:Mt}:{error:n("filePreview.errors.emptyPath")}}async function H(Be){const le=++fe;J.value="file",_e.value=null,z.value=null,ue.value=!0,ke.value=Be,X.value=null;const Se=ae(Be.path);if("error"in Se){ue.value=!1,z.value=Se.error;return}X.value=Se.path;try{const Mt=await t.readFileContent(Se.path);if(le!==fe)return;Mt?_e.value={...Mt,path:Mt.path||Se.path}:_e.value={path:Se.path,content:"",encoding:"utf-8",mime:"text/plain",isBinary:!1,size:0}}catch(Mt){if(le!==fe)return;z.value=Mt instanceof Error?Mt.message:n("filePreview.errors.loadFailed")}finally{le===fe&&(ue.value=!1)}}function U(Be){return/^data:([^;,]+)/i.exec(Be)?.[1]}function Q(Be){Be.kind==="image"&&(J.value="file",ke.value=null,X.value=null,z.value=null,ue.value=!1,_e.value={path:Be.path??"ReadMediaFile image",content:"",encoding:"utf-8",mime:Be.mimeType??U(Be.url)??"image/*",sourceUrl:Be.url,isBinary:!0,size:Be.bytes??0})}function ce(){ke.value=null,X.value=null,_e.value=null,z.value=null,ue.value=!1,J.value==="file"&&(J.value=null)}const pe=te(null),xe=j(()=>{const Be=pe.value;if(!Be)return null;const Se=t.turns.value.find(Mt=>Mt.id===Be.turnId)?.blocks?.[Be.blockIndex];return Se?.kind==="thinking"?Se.thinking:null}),ie=j(()=>xe.value!==null);function be(Be){const le=pe.value;if(le&&le.turnId===Be.turnId&&le.blockIndex===Be.blockIndex){pe.value=null,J.value==="thinking"&&(J.value=null);return}J.value="thinking",pe.value=Be}function ze(){pe.value=null,J.value==="thinking"&&(J.value=null)}const Je=te(null),rt=j(()=>{const Be=Je.value;if(!Be)return null;const le=t.turns.value.find(Se=>Se.id===Be.turnId);return le?.role==="compaction"&&le.text?le.text:null}),Ge=j(()=>rt.value!==null);function ut(Be){if(Je.value?.turnId===Be.turnId){Je.value=null,J.value==="compaction"&&(J.value=null);return}J.value="compaction",Je.value=Be}function xt(){Je.value=null,J.value==="compaction"&&(J.value=null)}const Ht=te(null),Pt=j(()=>{const Be=Ht.value;if(!Be)return null;const Se=t.turns.value.find(Mt=>Mt.id===Be.turnId)?.blocks?.[Be.blockIndex];return Se?Se.kind==="agent"?Se.member.id===Be.memberId?Se.member:null:Se.kind==="agentGroup"?Se.members.find(Mt=>Mt.id===Be.memberId)??null:null:null}),Vn=j(()=>Pt.value!==null);function _s(Be){const le=Ht.value;if(le&&le.turnId===Be.turnId&&le.memberId===Be.memberId){Ht.value=null,J.value==="agent"&&(J.value=null);return}J.value="agent",Ht.value=Be}function Ke(){Ht.value=null,J.value==="agent"&&(J.value=null)}const zt=te("list"),Kn=te(null);function Ps(){J.value="diff",zt.value="list",Kn.value=null,t.loadGitStatus(t.activeSessionId.value)}function Gn(){J.value==="diff"&&(J.value=null),zt.value="list",Kn.value=null,t.clearFileDiff()}async function Do(Be){zt.value="detail",Kn.value=Be,await t.loadFileDiff(Be)}async function Ds(Be){await t.openSideChat(Be),J.value="btw"}function Bs(){t.closeSideChat(),J.value==="btw"&&(J.value=null)}function Fs(){J.value==="btw"&&(J.value=null)}const Ni=j(()=>t.sideChatVisible.value),ls=j(()=>J.value!==null&&(J.value!=="thinking"||ie.value)&&(J.value!=="compaction"||Ge.value)&&(J.value!=="agent"||Vn.value)&&(J.value!=="btw"||Ni.value)),$n=te(!1);function sn(){const Be=_e.value?.path??ke.value?.path;Be&&t.openWorkspaceFile(Be,ke.value?.line)}function Hs(){const Be=_e.value?.path??ke.value?.path;Be&&t.revealWorkspaceFile(Be)}Ve(t.activeSessionId,()=>{ce(),ze(),xt(),Ke(),Gn(),Fs()});const _t=te(null),Pn=te([]),Yt=j(()=>Pn.value.length>1);function so(Be){Pn.value=Be}const oo=te(!1),Ws=te(!1),Dn=te(!1),ws=te(!1),as=te(!1),vt=te(!1),Ss=te(!1),Bn=te(!1),Yn=te(null),cn=j(()=>oo.value||Ws.value||Dn.value||ws.value||as.value||vt.value||Ss.value||Bn.value||T.value||i.value||r.value),hn=te(!1),Me=te(!1),ge=te(!1),Oe=te(!1),we=te(!1);async function Ae(){hn.value=!0,Me.value=!1,oo.value=!0;try{await t.refreshOAuthProviderModels(),await t.loadModels()}catch{Me.value=!0}finally{hn.value=!1}}async function He(){ge.value=!0,Oe.value=!1,Ws.value=!0;try{await t.loadProviders()}catch{Oe.value=!0}finally{ge.value=!1}}function tt(){Dn.value=!0}async function pn(Be){oo.value=!1,await t.setModel(Be)}async function Vt(Be){await t.addProvider(Be)}async function Xn(Be){await t.deleteProvider(Be)}async function en(Be){await t.refreshProvider(Be)}async function Zn(Be){we.value=!0;try{await t.updateConfig(Be)&&await t.checkAuth()}finally{we.value=!1}}async function Bo(){return t.startOAuthLogin()}async function io(){return t.pollOAuthLogin()}async function Cr(){return t.cancelOAuthLogin()}async function cs(){Dn.value=!1,await t.checkAuth(),await t.load()}async function mu(Be){await t.undo(1),await ft(),_t.value?.loadComposerForEdit(Be)}function zh(Be){if(Be==="/compact"||Be.startsWith("/compact ")){t.compact(Be.slice(8).trim()||void 0);return}if(Be==="/swarm"||Be.startsWith("/swarm ")){const le=Be.slice(6).trim();le==="on"?t.setSwarmMode(!0):le==="off"?t.setSwarmMode(!1):le?(t.setSwarmMode(!0),t.sendPrompt(le)):t.toggleSwarmMode();return}if(Be==="/goal"||Be.startsWith("/goal ")){const le=Be.slice(5).trim();le==="pause"||le==="resume"||le==="cancel"?t.controlGoal(le):le?t.createGoal(le):t.toggleGoalMode();return}if(Be==="/btw"||Be.startsWith("/btw ")){const le=Be.slice(4).trim();!le&&t.sideChatVisible.value?t.closeSideChat():Ds(le||void 0);return}switch(Be){case"/new":case"/clear":ws.value=!0;break;case"/sessions":as.value=!0;break;case"/fork":t.forkSession();break;case"/undo":t.undo();break;case"/permission":{const le=t.permission.value,Se=le==="manual"?"auto":le==="auto"?"yolo":"manual";t.setPermission(Se);break}case"/plan":t.togglePlanMode();break;case"/auto":t.setPermission("auto");break;case"/yolo":t.setPermission("yolo");break;case"/thinking":t.setThinking(S(t.thinking.value));break;case"/help":t.dismissWarning(-1);break;case"/status":Ss.value=!0;break;case"/model":Ae();break;case"/provider":He();break;case"/login":tt();break;default:{const le=Be.indexOf(" "),Se=(le===-1?Be:Be.slice(0,le)).slice(1),Mt=le===-1?void 0:Be.slice(le+1).trim()||void 0;Se&&t.activateSkill(Se,Mt);break}}}function xr(Be){t.unqueue(Be)}function us(Be){t.unqueue(Be)}async function si(Be){const le=t.activeWorkspaceId.value;if(!t.activeSessionId.value&&le){await t.startSessionAndSendPrompt(le,Be.text,Be.attachments);return}if(!t.activeSessionId.value&&!le){Yn.value=Be,vt.value=!0;return}t.sendPrompt(Be.text,Be.attachments)}async function Sa(Be){vt.value=!1,await t.addWorkspaceByPath(Be);const le=Yn.value;Yn.value=null;const Se=t.activeWorkspaceId.value;le&&Se&&await t.startSessionAndSendPrompt(Se,le.text,le.attachments)}function Tr(){Yn.value=null,vt.value=!1}function oi(){const Be=t.activeWorkspaceId.value;Be?t.openWorkspaceDraft(Be):ws.value=!0}function Ca(Be){t.openWorkspaceDraft(Be)}function Vh(Be){Be&&window.open(Be,"_blank","noopener")}return(Be,le)=>(C(),A("div",Yue,[d.value?(C(),A("section",Xue,[h("div",Zue,[(C(),A("svg",{ref_key:"authLogoRef",ref:m,class:"auth-page-logo ch-logo",viewBox:"0 0 32 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"CyberNeurova Code",onMousedown:le[0]||(le[0]=Ye(()=>{},["prevent"])),onClick:_},[...le[90]||(le[90]=[dr('<defs data-v-18370979><mask id="authNeurovaEyes" maskUnits="userSpaceOnUse" data-v-18370979><rect x="0" y="0" width="32" height="22" fill="#fff" data-v-18370979></rect><g class="ch-eyes" fill="#000" data-v-18370979><rect class="ch-eye" x="11.8" y="7" width="2.8" height="8" rx="1.4" data-v-18370979></rect><rect class="ch-eye" x="17.4" y="7" width="2.8" height="8" rx="1.4" data-v-18370979></rect></g></mask></defs><rect x="1" y="1" width="30" height="20" rx="6" fill="var(--logo)" mask="url(#authNeurovaEyes)" data-v-18370979></rect>',2)])],544)),h("div",Que,[h("h1",null,N(M(n)("app.authPageTitle")),1),h("p",null,N(M(n)("app.authPageMessage")),1)]),h("button",{type:"button",class:"auth-page-btn",onClick:tt},[le[91]||(le[91]=h("svg",{viewBox:"0 0 16 16",width:"15",height:"15",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[h("path",{d:"M6 3h5a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H6"}),h("path",{d:"M9 8H2"}),h("path",{d:"M5 5l3 3-3 3"})],-1)),h("span",null,N(M(n)("app.authPageLogin")),1)])])])):(C(),A("div",{key:1,class:Ee(["app",{mobile:M(o),"sidebar-collapsed":P.value&&!M(o)}]),style:$t({"--side-w":q.value+"px","--preview-w":me.value+"px"})},[M(o)?(C(),je(pse,{key:1,workspace:M(t).visibleWorkspace.value,"session-title":l.value,running:c.value,branch:M(t).status.value.branch,"session-count":a.value,onOpenSwitcher:le[12]||(le[12]=Se=>i.value=!0),onOpenSettings:le[13]||(le[13]=Se=>r.value=!0)},null,8,["workspace","session-title","running","branch","session-count"])):(C(),A(Ie,{key:0},[Et(mt(f$,{"col-width":F.value,"active-workspace":M(t).visibleWorkspace.value,"active-workspace-id":M(t).activeWorkspaceId.value,sessions:M(t).sessionsForView.value,groups:M(t).workspaceGroups.value,"active-id":M(t).activeSessionId.value,"attention-by-session":M(t).attentionBySession.value,"pending-by-session":M(t).pendingBySession.value,"unread-by-session":M(t).unreadBySession.value,onSelect:le[1]||(le[1]=Se=>M(t).selectSession(Se)),onCreate:oi,onCreateInWorkspace:le[2]||(le[2]=Se=>Ca(Se)),onSelectWorkspace:le[3]||(le[3]=Se=>M(t).openWorkspace(Se)),onAddWorkspace:le[4]||(le[4]=Se=>vt.value=!0),onRename:le[5]||(le[5]=(Se,Mt)=>M(t).renameSession(Se,Mt)),onArchive:le[6]||(le[6]=Se=>M(t).archiveSession(Se)),onFork:le[7]||(le[7]=Se=>M(t).forkSession(Se)),onRenameWorkspace:le[8]||(le[8]=(Se,Mt)=>M(t).renameWorkspace(Se,Mt)),onDeleteWorkspace:le[9]||(le[9]=Se=>M(t).deleteWorkspace(Se)),onSelectWorkspaces:so,onOpenSettings:le[10]||(le[10]=Se=>Bn.value=!0),onCollapse:oe},null,8,["col-width","active-workspace","active-workspace-id","sessions","groups","active-id","attention-by-session","pending-by-session","unread-by-session"]),[[No,!P.value]]),Et(mt(Lk,{"storage-key":ode,"default-width":Zw,min:ide,max:rde,"onUpdate:width":le[11]||(le[11]=Se=>F.value=Se)},null,512),[[No,!P.value]]),P.value?(C(),A("div",Jue,[h("button",{type:"button",class:"sidebar-expand-btn",title:M(n)("sidebar.expandSidebar"),"aria-label":M(n)("sidebar.expandSidebar"),onClick:oe},[...le[92]||(le[92]=[dr('<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-v-18370979><path d="M4 6h9" data-v-18370979></path><path d="M4 12h9" data-v-18370979></path><path d="M4 18h9" data-v-18370979></path><path d="M17 9l3 3-3 3" data-v-18370979></path></svg>',1)])],8,ede)])):re("",!0)],64)),Yt.value?(C(),A("div",tde,[le[93]||(le[93]=h("span",{class:"cs-icon"},"🚧",-1)),h("span",nde,N(M(n)("app.comingSoon")),1)])):(C(),je(hG,{key:2,ref_key:"conversationPaneRef",ref:_t,mobile:M(o),modern:M(t).theme.value==="modern"||M(t).theme.value==="cyberneurova",turns:M(t).turns.value,"session-id":M(t).activeSessionId.value,approvals:M(t).pendingApprovals.value,changes:M(t).changes.value,"git-info":M(t).gitInfo.value,tasks:M(t).tasks.value,todos:M(t).todos.value,goal:M(t).goal.value,swarms:M(t).swarms.value,"activation-badges":M(t).activationBadges.value,status:M(t).status.value,thinking:M(t).thinking.value,"plan-mode":M(t).planMode.value,"swarm-mode":M(t).swarmMode.value,"goal-mode":M(t).goalMode.value,models:M(t).models.value,"starred-ids":M(t).starredModelIds.value,skills:M(t).skills.value,questions:M(t).questions.value,running:c.value,queued:M(t).queued.value,"search-files":M(t).searchFiles,"upload-image":M(t).uploadImage,sending:M(t).isSending.value,"fast-moon":M(t).fastMoon.value,"file-reload-key":M(t).activeSessionId.value,"session-loading":M(t).sessionLoading.value,compaction:M(t).compaction.value,"has-more-messages":M(t).hasMoreMessages.value,"loading-more":M(t).loadingMoreMessages.value,"loading-more-error":M(t).loadMoreMessagesError.value,"load-older-messages":M(t).loadOlderMessages,"workspace-name":M(t).visibleWorkspace.value?.name,"workspace-root":M(t).visibleWorkspace.value?.root??M(t).status.value.cwd,"git-diff-stats":M(t).gitDiffStats.value,workspaces:M(t).workspacesView.value,"active-workspace-id":M(t).activeWorkspaceId.value,"session-title":l.value,pr:M(t).activePullRequest.value,"beta-toc":M(t).betaToc.value,onOpenChanges:le[14]||(le[14]=Se=>Ps()),onSelectWorkspace:le[15]||(le[15]=Se=>Ca(Se)),onAddWorkspace:le[16]||(le[16]=Se=>vt.value=!0),onOpenPr:Vh,onSubmit:le[17]||(le[17]=Se=>si(Se)),onSteer:le[18]||(le[18]=Se=>M(t).steerPrompt(Se.text,Se.attachments)),onApproval:le[19]||(le[19]=(Se,Mt)=>M(t).respondApproval(Se,Mt)),onCancelTask:le[20]||(le[20]=Se=>M(t).cancelTask(Se)),onAnswer:le[21]||(le[21]=(Se,Mt)=>M(t).respondQuestion(Se,Mt)),onDismiss:le[22]||(le[22]=Se=>M(t).dismissQuestion(Se)),onCommand:zh,onInterrupt:le[23]||(le[23]=Se=>M(t).abortCurrentPrompt()),onUnqueue:xr,onEditQueued:us,onSetPermission:le[24]||(le[24]=Se=>M(t).setPermission(Se)),onSetThinking:le[25]||(le[25]=Se=>M(t).setThinking(Se)),onTogglePlan:le[26]||(le[26]=Se=>M(t).togglePlanMode()),onToggleSwarm:le[27]||(le[27]=Se=>M(t).toggleSwarmMode()),onToggleGoal:le[28]||(le[28]=Se=>M(t).toggleGoalMode()),onCreateGoal:le[29]||(le[29]=Se=>M(t).createGoal(Se)),onControlGoal:le[30]||(le[30]=Se=>M(t).controlGoal(Se)),onRefreshGitStatus:le[31]||(le[31]=Se=>M(t).activeSessionId.value&&M(t).loadGitStatus(M(t).activeSessionId.value)),onRenameSession:le[32]||(le[32]=(Se,Mt)=>M(t).renameSession(Se,Mt)),onForkSession:le[33]||(le[33]=Se=>M(t).forkSession(Se)),onArchiveSession:le[34]||(le[34]=Se=>M(t).archiveSession(Se)),onCompact:le[35]||(le[35]=Se=>M(t).compact()),onPickModel:le[36]||(le[36]=Se=>Ae()),onSelectModel:le[37]||(le[37]=Se=>M(t).setModel(Se)),onOpenFile:le[38]||(le[38]=Se=>H(Se)),onOpenMedia:le[39]||(le[39]=Se=>Q(Se)),onOpenThinking:le[40]||(le[40]=Se=>be(Se)),onOpenCompaction:le[41]||(le[41]=Se=>ut(Se)),onOpenAgent:le[42]||(le[42]=Se=>_s(Se)),onEditMessage:mu},null,8,["mobile","modern","turns","session-id","approvals","changes","git-info","tasks","todos","goal","swarms","activation-badges","status","thinking","plan-mode","swarm-mode","goal-mode","models","starred-ids","skills","questions","running","queued","search-files","upload-image","sending","fast-moon","file-reload-key","session-loading","compaction","has-more-messages","loading-more","loading-more-error","load-older-messages","workspace-name","workspace-root","git-diff-stats","workspaces","active-workspace-id","session-title","pr","beta-toc"])),ls.value&&!M(o)?(C(),je(Lk,{key:4,"storage-key":ade,"default-width":We.value,min:jr,max:$e.value,reverse:"","aria-label":M(n)("layout.resizePreviewAria"),"onUpdate:width":le[43]||(le[43]=Se=>me.value=Se),"onUpdate:dragging":le[44]||(le[44]=Se=>$n.value=Se)},null,8,["default-width","max","aria-label"])):re("",!0),!M(o)||ls.value?(C(),A("aside",{key:5,class:Ee(["global-preview",{open:ls.value,mobile:M(o),"no-anim":$n.value}]),role:"complementary","aria-label":M(n)("layout.detailPanelAria"),"aria-hidden":!ls.value},[J.value==="thinking"&&ie.value?(C(),je(_w,{key:0,text:xe.value??"",onClose:ze},null,8,["text"])):J.value==="compaction"&&Ge.value?(C(),je(_w,{key:1,text:rt.value??"",subtitle:M(n)("conversation.summaryTitle"),onClose:xt},null,8,["text","subtitle"])):J.value==="agent"&&Pt.value?(C(),je(zY,{key:2,member:Pt.value,onClose:Ke},null,8,["member"])):J.value==="btw"&&Ni.value?(C(),je(sX,{key:3,turns:M(t).sideChatTurns.value,running:M(t).sideChatRunning.value,sending:M(t).sideChatSending.value,onSend:le[45]||(le[45]=Se=>M(t).sendSideChatPrompt(Se)),onClose:Bs},null,8,["turns","running","sending"])):J.value==="diff"?(C(),je(GX,{key:4,mode:zt.value,changes:M(t).changes.value,"git-info":M(t).gitInfo.value,"file-diff":M(t).fileDiff.value,"selected-diff-path":M(t).selectedDiffPath.value,"file-diff-loading":M(t).fileDiffLoading.value,closable:"",onOpen:Do,onBack:le[46]||(le[46]=Se=>{zt.value="list",Kn.value=null,M(t).clearFileDiff()}),onClose:Gn},null,8,["mode","changes","git-info","file-diff","selected-diff-path","file-diff-loading"])):J.value==="file"?(C(),je(CY,{key:5,file:_e.value,loading:ue.value,error:z.value,line:ke.value?.line,"download-url":D.value,closable:"","external-actions":Z.value,"open-file":H,onClose:ce,onOpenExternal:sn,onReveal:Hs},null,8,["file","loading","error","line","download-url","external-actions"])):re("",!0)],10,sde)):re("",!0),oo.value?(C(),je(_Z,{key:6,models:M(t).models.value,current:M(t).status.value.modelId,"starred-ids":M(t).starredModelIds.value,loading:hn.value,unavailable:Me.value,onSelect:le[47]||(le[47]=Se=>pn(Se)),onToggleStar:le[48]||(le[48]=Se=>M(t).toggleStarModel(Se)),onClose:le[49]||(le[49]=Se=>oo.value=!1)},null,8,["models","current","starred-ids","loading","unavailable"])):re("",!0),Bn.value?(C(),je(Ite,{key:7,theme:M(t).theme.value,"color-scheme":M(t).colorScheme.value,"ui-font-size":M(t).uiFontSize.value,"auth-ready":M(t).authReady.value,"account-model":M(t).defaultModel.value,notify:M(t).notifyOnComplete.value,"notify-permission":M(t).notifyPermission.value,"beta-toc":M(t).betaToc.value,config:M(t).config.value,models:M(t).models.value,"config-saving":we.value,"server-version":M(t).serverVersion.value,onSetTheme:le[50]||(le[50]=Se=>M(t).setTheme(Se)),onSetColorScheme:le[51]||(le[51]=Se=>M(t).setColorScheme(Se)),onSetUiFontSize:le[52]||(le[52]=Se=>M(t).setUiFontSize(Se)),onSetNotify:le[53]||(le[53]=Se=>M(t).setNotifyOnComplete(Se)),onSetBetaToc:le[54]||(le[54]=Se=>M(t).setBetaToc(Se)),onUpdateConfig:le[55]||(le[55]=Se=>Zn(Se)),onLogin:le[56]||(le[56]=()=>{Bn.value=!1,tt()}),onLogout:M(t).logout,onOpenOnboarding:le[57]||(le[57]=()=>{Bn.value=!1,L()}),onClose:le[58]||(le[58]=Se=>Bn.value=!1)},null,8,["theme","color-scheme","ui-font-size","auth-ready","account-model","notify","notify-permission","beta-toc","config","models","config-saving","server-version","onLogout"])):re("",!0),Ws.value?(C(),je(uQ,{key:8,providers:M(t).providers.value,loading:ge.value,unavailable:Oe.value,onAdd:le[59]||(le[59]=Se=>Vt(Se)),onRefresh:le[60]||(le[60]=Se=>en(Se)),onDelete:le[61]||(le[61]=Se=>Xn(Se)),onOpenLogin:le[62]||(le[62]=()=>{Ws.value=!1,tt()}),onClose:le[63]||(le[63]=Se=>Ws.value=!1)},null,8,["providers","loading","unavailable"])):re("",!0),ws.value?(C(),je(uJ,{key:9,"recent-cwds":M(t).recentCwds.value,onCreate:le[64]||(le[64]=({cwd:Se,title:Mt})=>{ws.value=!1,M(t).createSession(Se,{title:Mt})}),onClose:le[65]||(le[65]=Se=>ws.value=!1)},null,8,["recent-cwds"])):re("",!0),as.value?(C(),je(Yte,{key:10,sessions:M(t).sessions.value,"workspace-groups":M(t).workspaceGroups.value,"attention-by-session":M(t).attentionBySession.value,"active-id":M(t).activeSessionId.value,onSelect:le[66]||(le[66]=Se=>{M(t).selectSession(Se),as.value=!1}),onClose:le[67]||(le[67]=Se=>as.value=!1)},null,8,["sessions","workspace-groups","attention-by-session","active-id"])):re("",!0),Ss.value?(C(),je(Vne,{key:11,status:M(t).status.value,thinking:M(t).thinking.value,"plan-mode":M(t).planMode.value,"swarm-mode":M(t).swarmMode.value,"cost-usd":M(t).sessionCost.value,onClose:le[68]||(le[68]=Se=>Ss.value=!1)},null,8,["status","thinking","plan-mode","swarm-mode","cost-usd"])):re("",!0),vt.value?(C(),je(Ine,{key:12,"browse-fs":M(t).browseFs,"get-fs-home":M(t).getFsHome,"default-path":M(t).visibleWorkspace.value?.root??M(t).status.value.cwd,onAdd:le[69]||(le[69]=Se=>Sa(Se)),onClose:Tr},null,8,["browse-fs","get-fs-home","default-path"])):re("",!0),mt(Si,{name:"gload-fade"},{default:vn(()=>[M(t).initialized.value?re("",!0):(C(),je(kie,{key:0}))]),_:1}),T.value&&!d.value?(C(),je(pie,{key:13,theme:M(t).theme.value,onSetTheme:le[70]||(le[70]=Se=>M(t).setTheme(Se)),onComplete:I,onSkip:I},null,8,["theme"])):re("",!0),mt(ose,{warnings:M(t).warnings.value,onDismiss:M(t).dismissWarning},null,8,["warnings","onDismiss"]),M(s)?(C(),je(Xie,{key:14})):re("",!0),M(o)?(C(),je(zse,{key:15,modelValue:i.value,"onUpdate:modelValue":le[71]||(le[71]=Se=>i.value=Se),groups:M(t).workspaceGroups.value,"active-workspace-id":M(t).activeWorkspaceId.value,"active-id":M(t).activeSessionId.value,"attention-by-session":M(t).attentionBySession.value,"attention-by-workspace":M(t).attentionByWorkspace.value,onSelect:le[72]||(le[72]=Se=>M(t).selectSession(Se)),onCreate:oi,onCreateInWorkspace:le[73]||(le[73]=Se=>Ca(Se)),onAddWorkspace:le[74]||(le[74]=Se=>vt.value=!0),onRename:le[75]||(le[75]=(Se,Mt)=>M(t).renameSession(Se,Mt)),onArchive:le[76]||(le[76]=Se=>M(t).archiveSession(Se)),onDeleteWorkspace:le[77]||(le[77]=Se=>M(t).deleteWorkspace(Se))},null,8,["modelValue","groups","active-workspace-id","active-id","attention-by-session","attention-by-workspace"])):re("",!0),M(o)?(C(),je(Koe,{key:16,modelValue:r.value,"onUpdate:modelValue":le[78]||(le[78]=Se=>r.value=Se),status:M(t).status.value,thinking:M(t).thinking.value,"plan-mode":M(t).planMode.value,"swarm-mode":M(t).swarmMode.value,theme:M(t).theme.value,"color-scheme":M(t).colorScheme.value,"ui-font-size":M(t).uiFontSize.value,"auth-ready":M(t).authReady.value,"beta-toc":M(t).betaToc.value,"server-version":M(t).serverVersion.value,onPickModel:le[79]||(le[79]=Se=>Ae()),onSetThinking:le[80]||(le[80]=Se=>M(t).setThinking(Se)),onTogglePlan:le[81]||(le[81]=Se=>M(t).togglePlanMode()),onToggleSwarm:le[82]||(le[82]=Se=>M(t).toggleSwarmMode()),onSetPermission:le[83]||(le[83]=Se=>M(t).setPermission(Se)),onSetTheme:le[84]||(le[84]=Se=>M(t).setTheme(Se)),onSetColorScheme:le[85]||(le[85]=Se=>M(t).setColorScheme(Se)),onSetUiFontSize:le[86]||(le[86]=Se=>M(t).setUiFontSize(Se)),onSetBetaToc:le[87]||(le[87]=Se=>M(t).setBetaToc(Se)),onLogin:le[88]||(le[88]=()=>{r.value=!1,tt()}),onLogout:M(t).logout},null,8,["modelValue","status","thinking","plan-mode","swarm-mode","theme","color-scheme","ui-font-size","auth-ready","beta-toc","server-version","onLogout"])):re("",!0)],6)),Dn.value?(C(),je(qQ,{key:2,"on-start-o-auth-login":Bo,"on-poll-o-auth-login":io,"on-cancel-o-auth-login":Cr,onSuccess:cs,onClose:le[89]||(le[89]=Se=>Dn.value=!1)})):re("",!0)]))}}),ude=yt(cde,[["__scopeId","data-v-18370979"]]);LJ();rf(ude).use(bn).mount("#app");export{jM as $,Bde as A,OA as B,wn as C,ffe as D,o2 as E,Ie as F,dr as G,ht as H,mt as I,hA as J,Pde as K,Zo as L,Ze as M,rE as N,Wde as O,Ude as P,zde as Q,Hd as R,Ql as S,Ede as T,qde as U,W1 as V,Hde as W,pfe as X,jde as Y,lfe as Z,fde as _,N2 as a,ss as a$,rs as a0,C1 as a1,_de as a2,I1 as a3,I4 as a4,Ut as a5,ga as a6,Mde as a7,yfe as a8,Nde as a9,D2 as aA,zA as aB,ZA as aC,Jt as aD,XA as aE,YA as aF,x1 as aG,GA as aH,qt as aI,N1 as aJ,yA as aK,C as aL,sE as aM,xde as aN,ln as aO,_2 as aP,Cde as aQ,zd as aR,Vs as aS,Ud as aT,te as aU,tfe as aV,_E as aW,Xe as aX,Xl as aY,JA as aZ,Dde as a_,Rde as aa,Ode as ab,Lde as ac,sfe as ad,kfe as ae,Nt as af,P4 as ag,sh as ah,or as ai,Ai as aj,Cn as ak,nfe as al,Gs as am,ur as an,tr as ao,Gde as ap,Yde as aq,Kt as ar,ft as as,W4 as at,Ee as au,dde as av,$t as aw,jA as ax,KA as ay,to as az,Sde as b,UB as b$,ufe as b0,Rc as b1,Zd as b2,afe as b3,cr as b4,cA as b5,pde as b6,al as b7,xA as b8,cfe as b9,yn as bA,No as bB,D4 as bC,ife as bD,Ve as bE,MA as bF,Ade as bG,AA as bH,Zde as bI,vn as bJ,Vde as bK,Et as bL,_o as bM,ofe as bN,Ye as bO,Tde as bP,jt as bQ,Ks as bR,Tfe as bS,$F as bT,sT as bU,Afe as bV,kB as bW,Tv as bX,Mfe as bY,Ug as bZ,Efe as b_,hde as ba,N as bb,bd as bc,Fde as bd,It as be,yde as bf,vde as bg,gde as bh,efe as bi,mde as bj,M as bk,ou as bl,gfe as bm,hfe as bn,aE as bo,Ide as bp,Qde as bq,TA as br,mfe as bs,Kde as bt,$de as bu,$2 as bv,sf as bw,gE as bx,SS as by,of as bz,rfe as c,WB as c0,Jx as c1,HB as c2,Sfe as c3,mB as c4,wfe as c5,FB as c6,$fe as c7,_T as c8,$f as c9,yT as ca,Nfe as cb,Ife as cc,xfe as cd,vo as ce,_fe as cf,Cfe as cg,bT as ch,vT as ci,EH as cj,bfe as ck,Jde as d,ir as e,kde as f,Si as g,vfe as h,bde as i,wde as j,To as k,tu as l,In as m,Yf as n,Ei as o,dfe as p,j as q,rf as r,je as s,re as t,A as u,h as v,_4 as w,Xde as x,b4 as y,wE as z};